alternate

android listview alternate row color BUT with default cursor selection

[亡魂溺海] 提交于 2019-12-19 04:11:13
问题 i have been all over the web, stackoverflow included and just can't seem to get a clear complete way to I want to create a ListView that 1) has alternating colors (I am able to do that with code below) 2) retains the default orange selection behavior of android to accomplish #1 I have an custom adapter that extends ArrayAdapter and then I override getView like so public View getView(int position, View convertView, ViewGroup parent) { .... // tableLayoutId is id pointing to each view/row in my

Selecting alternate items of an array C#

时光怂恿深爱的人放手 提交于 2019-12-12 00:06:46
问题 I have an array statsname as apple X banana Y Kiwi z I need to put apple,banana and Kiwi in an array Fruits and X,Y and Z in an array called alphabets. Any simple C# mechanism for it please ? 回答1: Use the IEnumerable<T>.Where overload which supplies the index. var fruits = statsname.Where((s, i) => i % 2 == 0).ToArray(); var alphabets = statsname.Where((s, i) => i % 2 != 0).ToArray(); 回答2: Stolen from How to get Alternate elements using Enumerable in C# var fruits = myArray.Where((t, i) => i

Alternate method of inserting a .PDF file into HTML page

家住魔仙堡 提交于 2019-12-11 00:14:39
问题 Currently I'm using an embed tag with the src directed to the location of the .pdf however the embed tag does not allow for z-index manipulation or other div tags to be placed over it. After extensive searching for a fix to allow for embed tag z-index manipulation I have found that it is adobe that will not allow this to happen with their pdf files. I need a way to insert (without using embed or iframe tags) a pdf document into an html page and allow other divs to overlap it. Please Help! 回答1

Strange PHP syntax

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 12:38:37
问题 I've been working on PHP for some time but today when I saw this it came as new to me: if(preg_match('/foo.*bar/','foo is a bar')): echo 'success '; echo 'foo comes before bar'; endif; To my surprise it also runs without error. Can anyone enlighten me? Thanks to all :) 回答1: That style of syntax is more commonly used when embedding in HTML, especially for template/display logic. When embedded this way, it's a little easier to read than the curly braces syntax. <div> <? if ($condition): ?> <ul>

Google multilingual sitemap issue

痞子三分冷 提交于 2019-12-06 02:33:59
问题 I have a sitemap issue. I am working on a multilingual website and I'm trying to use the Google method to indicate alternate language pages, as it is described here : https://support.google.com/webmasters/answer/2620865?hl=en. You can see my sitemap here : http://preprod.fabric-a.fr/princesse-nomade/sitemap.xml It seems that this sitemap is broken, and I don't understand why, it respects the example given by google.. Curiously, when I replace xmlns:xhtml="http://www.w3.org/1999/xhtml" by

PHP: Need loop to alternate between returned posts

别来无恙 提交于 2019-12-05 19:24:49
I have a an array of posts that are returned by doing three queries. 3 posts from the blog where posts are NOT in 'In the Media' or 'Insights', 3 from the blog where posts are in 'In the Media' 3 from the blog where posts are in 'Insights'. Here's what I have for that. I don't think it's the most elegant solution: <? $args = array( 'post_type' => 'post', 'posts_per_page' => 3, 'category__not_in' => array( 268, 269 ) ); $homePosts = new WP_Query($args); $args = array( 'post_type' => 'post', 'category_name' => 'in-the-media', 'posts_per_page' => 3 ); $inthemediaPosts = new WP_Query($args); $args

Alternating row color for JasperReports

拈花ヽ惹草 提交于 2019-12-02 20:44:43
I want to get color to alternate for the rows in a JasperReports subreport. I have all rows with the same background color but I want it to alternate. Can this be done? travega Yes you can set up a style inside the JRXML file like this: <style name="Zebra" mode="Transparent"> <conditionalStyle> <conditionExpression><![CDATA[$V{REPORT_COUNT}%2 == 1]]></conditionExpression> <style backcolor="#CAC5BB"/> </conditionalStyle> </style> and add it to your report elements like this: <reportElement style="Zebra" mode="Opaque" x="1" y="1" width="554" height="20"/> You cannot add conditional styles to

Column Alias in a WHERE Clause

扶醉桌前 提交于 2019-12-01 04:48:23
Problem I am using alternate column name (alias) in a Query, I can use the alias "given_name" as part of the ORDER BY but am unable to use it as part of the WHERE clause. The WHERE "given_name" is passed in as the result of a request out of my control and I do not know the actual column name that should be used in the WHERE condition. Question It there a way/hack to use a column alias in a WHERE clause? Is there a way to find the column name from an alias? Research After some research it looks like alias are added after after the WHERE clause. Example SELECT profile.id AS id, given.name AS

android listview alternate row color BUT with default cursor selection

淺唱寂寞╮ 提交于 2019-11-30 23:49:14
i have been all over the web, stackoverflow included and just can't seem to get a clear complete way to I want to create a ListView that 1) has alternating colors (I am able to do that with code below) 2) retains the default orange selection behavior of android to accomplish #1 I have an custom adapter that extends ArrayAdapter and then I override getView like so public View getView(int position, View convertView, ViewGroup parent) { .... // tableLayoutId is id pointing to each view/row in my list View tableLayoutView = view.findViewById(R.id.tableLayoutId); if(tableLayoutView != null) { int

Selecting alternate items of an array C#

喜夏-厌秋 提交于 2019-11-29 17:39:10
I have an array statsname as apple X banana Y Kiwi z I need to put apple,banana and Kiwi in an array Fruits and X,Y and Z in an array called alphabets. Any simple C# mechanism for it please ? Use the IEnumerable<T>.Where overload which supplies the index. var fruits = statsname.Where((s, i) => i % 2 == 0).ToArray(); var alphabets = statsname.Where((s, i) => i % 2 != 0).ToArray(); GazTheDestroyer Stolen from How to get Alternate elements using Enumerable in C# var fruits = myArray.Where((t, i) => i % 2 == 0).ToArray(); var alphabets = myArray.Where((t, i) => i % 2 == 1).ToArray(); If i have