Search Results

Search found 10420 results on 417 pages for 'item'.

Page 6/417 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • python need some help

    - by maxt0r
    hi i have my codes i have to do a module def subjects but i cant figure out how can u help me thanks. class Enrol: def init(self, dir): def readFiles(, dir, files): for file in files: if file == "classes.txt": class_list = readtable(dir+"/"+file) for item in class_list: Enrol.class_info_dict[item[0]] = item[1:] if item[1] in Enrol.classes_dict: Enrol.classes_dict[item[1]].append(item[0]) else: Enrol.classes_dict[item[1]] = [item[0]] elif file == "subjects.txt": subject_list = readtable(dir+"/"+file) for item in subject_list: Enrol.subjects_dict[item[0]] = item[1] elif file == "venues.txt": venue_list = readtable(dir+"/"+file) for item in venue_list: Enrol.venues_dict[item[0]] = item[1:] elif file.endswith('.roll'): roll_list = readlines(dir+"/"+file) file = os.path.splitext(file)[0] Enrol.class_roll_dict[file] = roll_list for item in roll_list: if item in Enrol.enrolled_dict: Enrol.enrolled_dict[item].append(file) else: Enrol.enrolled_dict[item] = [file] try: os.walk(dir, _readFiles, None) except: print "directory not properly been recognise error" def subjects(what should i write here??): for name in suject_list: print name, out put should look like import enrol e = enrol.Enrol("/path/to/data") e.subjects() ['bw101', 'bw110', 'bw232', 'bw290', 'bw660']

    Read the article

  • IList<Item> Collection Class accessing database

    - by Mike
    Hi, I have a database with Users. Users have Items. These Items can change actively. How do you access the items in a collection type format? For the user, I fill all the user properties at the time of instantiation. If I load the user's items at the time of the instantiation, and the items change, they will have old data. I was thinking, maybe I need an ItemCollection class and have that a field/property apart of the user class, that way to traverse all the user's items I could use a foreach loop. So, my question is, what is the best practice/best way of accessing the items from a database using some sort of collection? On accessing the particular Item, it needs to get the latest database information, and when the user does do a foreach loop, the latest item information must be available. I.e. What I'm trying to do Console.WriteLine(User.Items[3].ID); returns 5. //this updates the item information and saves it to the database. User.Items[3].ID = 13; //Add a new item to the database. User.Items.Add(new Item { id = 17}); foreach (Item item in User.Items) { //this would traverse all items in the database. //not some cached copy at the time of instantiation of the user. }

    Read the article

  • Tooltips problem, making this javascript work with my smarty foreach loop, help pelase!

    - by Kyle Sevenoaks
    I am using an example of tooltips from http://www.dynamicdrive.com/dynamicindex5/stickytooltip.htm on www.euroworker.no/order I have this code here to work with, but it just doesn't seem to work correctly, I've tried everything I can think of (not a lot of things) Here's the code. {foreach from=$cart.cartItems item="item" name="cart"} <div class="{zebra loop="cart"}"> <div id="sgproductview"> <div id="cart2Varekode"> <p> {if $product.sku} <span class="param">{$item.product.sku}</span> {else} <span>{img src=$item.Product.DefaultImage.paths.1 alt=$item.Product.name_lang|escape}</span> {/if} </p> </div> <div id="cart2Produkt"> <p>{if $item.Product.ID} <a href="{productUrl product=$item.Product}" data-tooltip="sticky{$smarty.foreach.cart.iteration}" target="_blank">{$item.Product.name_lang|truncate:20}</a> {else} <span>{$item.Product.name_lang|truncate:20}</span> </a> {/if} </p> <p> {include file="order/itemVariations.tpl"} {include file="order/block/itemOptions.tpl"} {if $multi} {include file="order/selectItemAddress.tpl" item=$item} {/if} </p> </div> {if $item.Product.DefaultImage.paths.3} <div id="mystickytooltip" class="stickytooltip"> <div style="padding:5px;"> <div id="sticky1" class="atip" style="width:200px;"> <img src="{$item.Product.DefaultImage.paths.3}" alt="{$item.Product.name_lang|escape}"><br> {$item.Product.name_lang} </div> <div id="sticky2" class="atip" style="width:200px;"> <img src={$item.Product.DefaultImage.paths.3} alt="{$item.Product.name_lang|escape}"><br> {$item.formattedPrice} </div> <div id="sticky3" class="atip" style="width:200px;"> <img src="{$item.Product.DefaultImage.paths.3}" alt="{$item.Product.name_lang|escape}"><br> {$item.Product.name_lang}PRODUCT 3 </div> <div id="sticky4" class="atip" style="width:200px;"> <img src="{$item.Product.DefaultImage.paths.3}" alt="{$item.Product.name_lang|escape}"><br> {$item.Product.name_lang} </div> </div> </div> {/if} <div id="cart2Price"> <p class="actualPrice"> {$item.formattedPrice} </p> </div> <div id="salg"></div> <div id="cart2Salg"> <p></p> </div> <div id="antallbox"> <p class="cartQuant"> {textfield name="item_`$item.ID`" class="text"} </p> </div> <div id="cart2Total"> <p> {if $item.count == 1} <span class="basePrice">{$item.formattedBasePrice}</span><span class="actualPrice">{$item.formattedPrice}</span> {else} {$item.formattedDisplaySubTotal} <div class="subTotalCalc"> {$item.count} x <span class="basePrice">{$item.formattedBasePrice}</span><span class="actualPrice">{$item.formattedPrice}</span> </div> {/if} </p> </div> <div id="delete"> {if 'ENABLE_WISHLISTS'|config} <a href="{link controller=order action=moveToWishList id=$item.ID query="return=`$return`"}">{t _move_to_wishlist}</a> {/if} <a id="slett" href="{link controller=order action=delete id=$item.ID query="return=`$return`"}" title="Slett"><!--{t _remove}--></a> </div> </div> </div> {/foreach} Anyone can help? {html_image} doesn't work, by the way and all the extensions are present and correct.

    Read the article

  • Need help in filtering the data with various condition and filling in scroll window GP

    - by Rahul
    Hi all, I am filtering the data and displaying in scroll window. There are many combination to display this data by customer id, customer id and itemnumber, customer id, itemnumber, work and history condition. And from date and To date condition. My query is when I am selecting the customer id and work or history table it should display the corresponding data. Like select * from price history where customerid=’custid’ and name=’Work’. It should display in scroll only these values none other it the same way history condition should work. Work and History are in check box. In my case whatever range I am selecting whether Work and History always loading with entire data, so it’s not filtering properly. My second problem is if I select from date and keep empty to date …in this case all the data should display from selected from date to end of table data. But I am not getting….pls somebody help me here is my entire coding: if empty('Customer Number') then warning "Select Customer ID"; focus 'Customer Number'; abort script; end if; if '(L) RadioGroup4' of window Window1 of form 'Customer Pricing Inquiry'=1 then if empty(Date) then abort script; focus Date; end if; end if; if not empty('(L) Date') then if '(L) Date' {if not empty(Date) and empty('(L) Date') then warning"Please enter To Date"; focus field '(L) Date'; abort script; end if;} range clear table Display_Pricing_Temp; clear field 'Customer Number' of table Display_Pricing_Temp; range start table Display_Pricing_Temp; fill field 'Customer Number' of table Display_Pricing_Temp; range end table Display_Pricing_Temp; remove range table Display_Pricing_Temp; range clear table Display_Pricing; if '(L) Checkbox0' =true and '(L) Checkbox2'=true and empty('Item Code' of window Window1 of form 'Customer Pricing Inquiry') and str(Date of window Window1 of form 'Customer Pricing Inquiry')="0/0/0000" then {range clear table Display_Pricing;} range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and ("+ physicalname(Name of table Display_Pricing)+ "='History' or "+ physicalname(Name of table Display_Pricing)+ "='Work')"; {range clear table Display_Pricing;} end if; if '(L) Checkbox0' =true or '(L) Checkbox2'=true then {{Only Item No is there} if not empty('Item Code') and '(L) Checkbox0' =false and '(L) Checkbox2'=false and str('(L) Date')="0/0/0000" then range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname('Item Number' of table Display_Pricing)+ "='"+ str('Item Code')+"'"; end if; } if empty('(L) Date') and not empty(Date) then {date work hist item} if not empty('Item Code') and '(L) Checkbox0' =true and '(L) Checkbox2'=true and str(Date)<"0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname('Item Number' of table Display_Pricing)+ "='"+ str('Item Code')+"' and ("+ physicalname(Name of table Display_Pricing)+ "='Work' or " +physicalname(Name of table Display_Pricing)+ "='History')and convert(datetime,convert(varchar(20)," +physicalname(Date of table Display_Pricing)+"),102) convert(datetime,convert(varchar(20),'"+ str(Date of window Window1 of form 'Customer Pricing Inquiry')+ "'),102)" ; range clear table Display_Pricing; end if; {date work hist } if empty('Item Code') and '(L) Checkbox0' =true and '(L) Checkbox2'=true and str(Date)<"0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and ("+ physicalname(Name of table Display_Pricing)+ "='Work' or " +physicalname(Name of table Display_Pricing)+ "='History')and convert(datetime,convert(varchar(20)," +physicalname(Date of table Display_Pricing)+"),102) convert(datetime,convert(varchar(20),'"+ str(Date of window Window1 of form 'Customer Pricing Inquiry')+ "'),102)" ; range clear table Display_Pricing; end if; {date,work,item code} if not empty('Item Code') and '(L) Checkbox0' =true and '(L) Checkbox2'=false and str(Date)<"0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname('Item Number' of table Display_Pricing)+ "='"+ str('Item Code')+"' and "+ physicalname(Name of table Display_Pricing)+ "='Work' and convert(datetime,convert(varchar(20)," +physicalname(Date of table Display_Pricing)+"),102) convert(datetime,convert(varchar(20),'"+ str(Date of window Window1 of form 'Customer Pricing Inquiry')+ "'),102)" ; range clear table Display_Pricing; end if; {date history item code} if not empty('Item Code') and '(L) Checkbox0' =false and '(L) Checkbox2'=true and str(Date)<"0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname('Item Number' of table Display_Pricing)+ "='"+ str('Item Code')+"' and "+ physicalname(Name of table Display_Pricing)+ "='History' and convert(datetime,convert(varchar(20)," +physicalname(Date of table Display_Pricing)+"),102) convert(datetime,convert(varchar(20),'"+ str(Date of window Window1 of form 'Customer Pricing Inquiry')+ "'),102)" ; range clear table Display_Pricing; end if; {date,work} if empty('Item Code') and '(L) Checkbox0' =true and '(L) Checkbox2'=false and not empty(Date) then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname(Name of table Display_Pricing)+ "='Work' and convert(datetime,convert(varchar(20)," +physicalname(Date of table Display_Pricing)+"),102) convert(datetime,convert(varchar(20),'"+ str(Date of window Window1 of form 'Customer Pricing Inquiry')+ "'),102) "; range clear table Display_Pricing; end if; {date history } if empty('Item Code') and '(L) Checkbox0' =false and '(L) Checkbox2'=true and str(Date)<"0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname(Name of table Display_Pricing)+ "='History' and convert(datetime,convert(varchar(20)," +physicalname(Date of table Display_Pricing)+"),102) convert(datetime,convert(varchar(20),'"+ str(Date of window Window1 of form 'Customer Pricing Inquiry')+ "'),102)" ; range clear table Display_Pricing; end if; end if; if not empty('(L) Date') and not empty(Date) then {Only Item No is there and work} if not empty('Item Code') and '(L) Checkbox0' =true and '(L) Checkbox2'=false and str(Date)="0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname('Item Number' of table Display_Pricing)+ "='"+ str('Item Code')+"' and "+ physicalname(Name of table Display_Pricing)+ "='Work'"; range clear table Display_Pricing; end if; if not empty('Item Code') and '(L) Checkbox0' =true and '(L) Checkbox2'=true and str(Date)="0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname('Item Number' of table Display_Pricing)+ "='"+ str('Item Code')+"' and ("+ physicalname(Name of table Display_Pricing)+ "='Work' or " +physicalname(Name of table Display_Pricing)+ "='History')"; range clear table Display_Pricing; end if; {date work hist item} if not empty('Item Code') and '(L) Checkbox0' =true and '(L) Checkbox2'=true and str(Date)<"0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname('Item Number' of table Display_Pricing)+ "='"+ str('Item Code')+"' and ("+ physicalname(Name of table Display_Pricing)+ "='Work' or " +physicalname(Name of table Display_Pricing)+ "='History')and convert(datetime,convert(varchar(20)," +physicalname(Date of table Display_Pricing)+"),102) between convert(datetime,convert(varchar(20),'"+ str(Date of window Window1 of form 'Customer Pricing Inquiry')+ "'),102) and convert(datetime,convert(varchar(20),'"+ str('(L) Date' of window Window1 of form 'Customer Pricing Inquiry') +"'),102)"; range clear table Display_Pricing; end if; {date work hist } if empty('Item Code') and '(L) Checkbox0' =true and '(L) Checkbox2'=true and str(Date)<"0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and ("+ physicalname(Name of table Display_Pricing)+ "='Work' or " +physicalname(Name of table Display_Pricing)+ "='History')and convert(datetime,convert(varchar(20)," +physicalname(Date of table Display_Pricing)+"),102) between convert(datetime,convert(varchar(20),'"+ str(Date of window Window1 of form 'Customer Pricing Inquiry')+ "'),102) and convert(datetime,convert(varchar(20),'"+ str('(L) Date' of window Window1 of form 'Customer Pricing Inquiry') +"'),102)"; range clear table Display_Pricing; end if; {date,work,item code} if not empty('Item Code') and '(L) Checkbox0' =true and '(L) Checkbox2'=false and str(Date)<"0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname('Item Number' of table Display_Pricing)+ "='"+ str('Item Code')+"' and "+ physicalname(Name of table Display_Pricing)+ "='Work' and convert(datetime,convert(varchar(20)," +physicalname(Date of table Display_Pricing)+"),102) between convert(datetime,convert(varchar(20),'"+ str(Date of window Window1 of form 'Customer Pricing Inquiry')+ "'),102) and convert(datetime,convert(varchar(20),'"+ str('(L) Date' of window Window1 of form 'Customer Pricing Inquiry') +"'),102)"; range clear table Display_Pricing; end if; {date history item code} if not empty('Item Code') and '(L) Checkbox0' =false and '(L) Checkbox2'=true and str(Date)<"0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname('Item Number' of table Display_Pricing)+ "='"+ str('Item Code')+"' and "+ physicalname(Name of table Display_Pricing)+ "='History' and convert(datetime,convert(varchar(20)," +physicalname(Date of table Display_Pricing)+"),102) between convert(datetime,convert(varchar(20),'"+ str(Date of window Window1 of form 'Customer Pricing Inquiry')+ "'),102) and convert(datetime,convert(varchar(20),'"+ str('(L) Date' of window Window1 of form 'Customer Pricing Inquiry') +"'),102)"; range clear table Display_Pricing; end if; {date work} {date,work} if empty('Item Code') and '(L) Checkbox0' =true and '(L) Checkbox2'=false and not empty(Date) then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname(Name of table Display_Pricing)+ "='Work' and convert(datetime,convert(varchar(20)," +physicalname(Date of table Display_Pricing)+"),102) between convert(datetime,convert(varchar(20),'"+ str(Date of window Window1 of form 'Customer Pricing Inquiry')+ "'),102) and convert(datetime,convert(varchar(20),'"+ str('(L) Date' of window Window1 of form 'Customer Pricing Inquiry') +"'),102)"; range clear table Display_Pricing; end if; {date history } if empty('Item Code') and '(L) Checkbox0' =false and '(L) Checkbox2'=true and str(Date)<"0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname(Name of table Display_Pricing)+ "='History' and convert(datetime,convert(varchar(20)," +physicalname(Date of table Display_Pricing)+"),102) between convert(datetime,convert(varchar(20),'"+ str(Date of window Window1 of form 'Customer Pricing Inquiry')+ "'),102) and convert(datetime,convert(varchar(20),'"+ str('(L) Date' of window Window1 of form 'Customer Pricing Inquiry') +"'),102)"; range clear table Display_Pricing; end if; end if; {Only Item No is there and hist} if not empty('Item Code') and '(L) Checkbox0' =false and '(L) Checkbox2'=true and str(Date)="0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname('Item Number' of table Display_Pricing)+ "='"+ str('Item Code')+"' and "+ physicalname(Name of table Display_Pricing)+ "='History'"; range clear table Display_Pricing; end if; {for only work table } if empty('Item Code') and '(L) Checkbox0' =true and '(L) Checkbox2'=false and str(Date)="0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname(Name of table Display_Pricing)+ "='Work'"; range clear table Display_Pricing; end if; {for only hist table } if empty('Item Code') and '(L) Checkbox0' =false and '(L) Checkbox2'=true and str(Date)="0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname(Name of table Display_Pricing)+ "='History'"; range clear table Display_Pricing; end if; get first table Display_Pricing; if err() = OKAY then repeat copy from table Display_Pricing to table Display_Pricing_Temp; save table Display_Pricing_Temp; get next table Display_Pricing; until err() = EOF; else clear window Price_Scroll of form 'Customer Pricing Inquiry'; end if; else clear window Price_Scroll of form 'Customer Pricing Inquiry'; end if; fill window Price_Scroll table Display_Pricing_Temp by number 1;

    Read the article

  • XSLT templates and recursion

    - by user333411
    Hi All, Im new to XSLT and am having some problems trying to format an XML document which has recursive nodes. My XML Code: Hopefully my XML shows: All <item> are nested with <items> An item can have either just attributes, or sub nodes The level to which <item> nodes are nested can be infinently deep <?xml version="1.0" encoding="utf-8" ?> - <items> <item groupID="1" name="Home" url="//" /> - <item groupID="2" name="Guides" url="/Guides/"> - <items> - <item groupID="26" name="Online-Poker-Guide" url="/Guides/Online-Poker-Guide/"> - <items> - <item> <id>107</id> - <title> - <![CDATA[ Poker Betting - Online Poker Betting Structures ]]> </title> - <url> - <![CDATA[ /Guides/Online-Poker-Guide/online-poker-betting-structures ]]> </url> </item> - <item> <id>114</id> - <title> - <![CDATA[ Beginners&#39; Poker - Poker Hand Ranking ]]> </title> - <url> - <![CDATA[ /Guides/Online-Poker-Guide/online-poker-hand-ranking ]]> </url> </item> - <item> <id>115</id> - <title> - <![CDATA[ Poker Terms - 4th Street and 5th Street ]]> </title> - <url> - <![CDATA[ /Guides/Online-Poker-Guide/online-poker-poker-terms ]]> </url> </item> - <item> <id>116</id> - <title> - <![CDATA[ Popular Poker - The Popularity of Texas Hold&#39;em ]]> </title> - <url> - <![CDATA[ /Guides/Online-Poker-Guide/online-poker-popularity-texas-holdem ]]> </url> </item> - <item> <id>364</id> - <title> - <![CDATA[ The Impact of Traditional Poker on Online Poker (and vice versa) ]]> </title> - <url> - <![CDATA[ /Guides/Online-Poker-Guide/online-poker-tradional-vs-online ]]> </url> </item> - <item> <id>365</id> - <title> - <![CDATA[ The Ultimate, Absolute Online Poker Scandal ]]> </title> - <url> - <![CDATA[ /Guides/Online-Poker-Guide/online-poker-scandal ]]> </url> </item> </items> - <items> - <item groupID="27" name="Beginners-Poker" url="/Guides/Online-Poker-Guide/Beginners-Poker/"> - <items> + <item> <id>101</id> - <title> - <![CDATA[ Poker Betting - All-in On the Flop ]]> </title> - <url> - <![CDATA[ /Guides/Online-Poker-Guide/Beginners-Poker/poker-betting-all-in-on-the-flop ]]> </url> </item> + <item> <id>102</id> - <title> - <![CDATA[ Beginners&#39; Poker - Choosing an Online Poker Room ]]> </title> - <url> - <![CDATA[ /Guides/Online-Poker-Guide/Beginners-Poker/beginners-poker-choosing-a-room ]]> </url> </item> + <item> <id>105</id> - <title> - <![CDATA[ Beginners&#39; Poker - Choosing What Type of Poker to Play ]]> </title> - <url> - <![CDATA[ /Guides/Online-Poker-Guide/Beginners-Poker/beginners-poker-choosing-type-to-play ]]> </url> </item> + <item> <id>106</id> - <title> - <![CDATA[ Online Poker - Different Types of Online Poker ]]> </title> - <url> - <![CDATA[ /Guides/Online-Poker-Guide/Beginners-Poker/online-poker ]]> </url> </item> + <item> <id>109</id> - <title> - <![CDATA[ Online Poker - Opening an Account at an Online Poker Site ]]> </title> - <url> - <![CDATA[ /Guides/Online-Poker-Guide/Beginners-Poker/online-poker-opening-an-account ]]> </url> </item> + <item> <id>111</id> - <title> - <![CDATA[ Beginners&#39; Poker - Poker Glossary ]]> </title> - <url> - <![CDATA[ /Guides/Online-Poker-Guide/Beginners-Poker/beginners-poker-glossary ]]> </url> </item> + <item> <id>117</id> - <title> - <![CDATA[ Poker Betting - What is a Blind? ]]> </title> - <url> - <![CDATA[ /Guides/Online-Poker-Guide/Beginners-Poker/poker-betting-what-is-a-blind ]]> </url> </item> - <item> <id>118</id> - <title> - <![CDATA[ Poker Betting - What is an Ante? ]]> </title> - <url> - <![CDATA[ /Guides/Online-Poker-Guide/Beginners-Poker/poker-betting-what-is-an-ante ]]> </url> </item> + <item> <id>119</id> - <title> - <![CDATA[ Beginners Poker - What is Bluffing? ]]> </title> - <url> - <![CDATA[ /Guides/Online-Poker-Guide/Beginners-Poker/online-poker-what-is-bluffing ]]> </url> </item> - <item> <id>120</id> - <title> - <![CDATA[ Poker Games - What is Community Card Poker? ]]> </title> - <url> - <![CDATA[ /Guides/Online-Poker-Guide/Beginners-Poker/online-poker-what-is-community-card-poker ]]> </url> </item> - <item> <id>121</id> - <title> - <![CDATA[ Online Poker - What is Online Poker? ]]> </title> - <url> - <![CDATA[ /Guides/Online-Poker-Guide/Beginners-Poker/online-poker-what-is-online-poker ]]> </url> </item> </items> </item> </items> </item> </items> </item> </items> The XSL code: <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" indent="yes"/> <xsl:template name="loop"> <xsl:for-each select="items/item"> <ul> <li><xsl:value-of select="@name" /></li> <xsl:if test="@name and child::node()"> <ul> <xsl:for-each select="items/item"> <li><xsl:value-of select="@name" />test</li> </xsl:for-each> </ul> <xsl:call-template name="loop" /> </xsl:if> <xsl:if test="child::node() and not(@name)"> <xsl:for-each select="/items"> <li><xsl:value-of select="id" /></li> </xsl:for-each> </xsl:if> </ul> </xsl:for-each> <xsl:for-each select="item/items/item"> <li>hi</li> </xsl:for-each> </xsl:template> <xsl:template match="/" name="test"> <xsl:call-template name="loop" /> </xsl:template> </xsl:stylesheet> Im trying to write the XSL so that every <items> node will render a <ul> and every <items> node will render an <li>. The XSL needs to be recursive because i cant tell how deep the nested nodes will go. Can anyone help? Regards, Al

    Read the article

  • asp.net hover menu item

    - by WtFudgE
    When I hover on a static menu item that has a dynamic menu, the hover styles are in effect but once I start navigating the dynamic menu the static menu item goes back to the non-hover styles. Does anyone know how to make them stick until I stop ''using' that menu? I tried the 'selected' static menu item styles but that doesn't work - if I use them, even when I stop navigating the menu the last selected static menu item will display the selected style - after using the menu I want the styles to revert to the normal styles....

    Read the article

  • android gallery item selector

    - by Faisal khan
    I want to use following selector drawable for android gallery image will it work ? <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item state_selected="true" android:drawable="@drawable/selected_icon" > </item> <item android:drawable="@drawable/unselected_icon" > </item> </selector> i tried but it is not working

    Read the article

  • QTreeWidget activate item signals

    - by serge
    Hi everyone, I need to do some actions when item in QTreeWidget activates, but following code doestn't gives me expected result: class MyWidget(QTreeWidget): def __init__(self, parent=None): super(MyWidget, self).__init__(parent) self.connect(self, SIGNAL("activated(QModelIndex)"), self.editCell) def editCell(self, index): print index or class MyWidget(QTreeWidget): def __init__(self, parent=None): super(MyWidget, self).__init__(parent) self.connect(self, SIGNAL("itemActivated(QTreeWidgetItem, int)"), self.editCell) def editCell(self, item, column=0): print item What am i doing wrong or how to hadnle item activation in the right way? Thanks in advance, Serge

    Read the article

  • How do I de-duplicate a list of nodes in XSLT - and return the last node encountered?

    - by Broam
    I've seen lots of "de-duplicate this xml" questions but everyone wants the first node or the nodes are identical. I have a bit of a bigger puzzle. I have a list of articles in XML, a relevant snippet is shown: <item><key>Article1</key><stamp>100</stamp></item> <item><key>Article1</key><stamp>130</stamp></item> <item><key>Article2</key><stamp>800</stamp></item> <item><key>Article1</key><stamp>180</stamp></item> <item><key>Article3</key><stamp>900</stamp></item> <item><key>Article3</key><stamp>950</stamp></item> <item><key>Article4</key><stamp>990</stamp></item> <item><key>Article5</key><stamp>999</stamp></item> I'd like a list of nodes where the keys are unique and where the last instance is returned, not the first: Stamp (integer) is always increasing for elements of a particular key. Ideally I'd like "largest stamp" but they're always in order so the shortcut is ok. Desired result: (Order doesn't really matter.) <item><key>Article2</key><stamp>800</stamp></item> <item><key>Article1</key><stamp>180</stamp></item> <item><key>Article3</key><stamp>950</stamp></item> <item><key>Article4</key><stamp>990</stamp></item> <item><key>Article5</key><stamp>999</stamp></item> I'm somewhat confused on how to get this list. Any ideas? I'm using the Saxon processor if it matters.

    Read the article

  • Normalizing Item Names & Synonyms

    - by RabidFire
    Consider an e-commerce application with multiple stores. Each store owner can edit the item catalog of his store. My current database schema is as follows: item_names: id | name | description | picture | common(BOOL) items: id | item_name_id | picture | price | description | picture item_synonyms: id | item_name_id | name | error(BOOL) Notes: error indicates a wrong spelling (eg. "Ericson"). description and picture of the item_names table are "globals" that can optionally be overridden by "local" description and picture fields of the items table (in case the store owner wants to supply a different picture for an item). common helps separate unique item names ("Jimmy Joe's Cheese Pizza" from "Cheese Pizza") I think the bright side of this schema is: Optimized searching & Handling Synonyms: I can query the item_names & item_synonyms tables using name LIKE %QUERY% and obtain the list of item_name_ids that need to be joined with the items table. (Examples of synonyms: "Sony Ericsson", "Sony Ericson", "X10", "X 10") Autocompletion: Again, a simple query to the item_names table. I can avoid the usage of DISTINCT and it minimizes number of variations ("Sony Ericsson Xperia™ X10", "Sony Ericsson - Xperia X10", "Xperia X10, Sony Ericsson") The down side would be: Overhead: When inserting an item, I query item_names to see if this name already exists. If not, I create a new entry. When deleting an item, I count the number of entries with the same name. If this is the only item with that name, I delete the entry from the item_names table (just to keep things clean; accounts for possible erroneous submissions). And updating is the combination of both. Weird Item Names: Store owners sometimes use sentences like "Harry Potter 1, 2 Books + CDs + Magic Hat". There's something off about having so much overhead to accommodate cases like this. This would perhaps be the prime reason I'm tempted to go for a schema like this: items: id | name | picture | price | description | picture (... with item_names and item_synonyms as utility tables that I could query) Is there a better schema you would suggested? Should item names be normalized for autocomplete? Is this probably what Facebook does for "School", "City" entries? Is the first schema or the second better/optimal for search? Thanks in advance! References: (1) Is normalizing a person's name going too far?, (2) Avoiding DISTINCT

    Read the article

  • Horizontal Scrollview inside ListView item?

    - by lanks
    I have a ListView item layout that is using a HorizontalScrollView in the center. I have used the android attribute "android:descendantFocusability="blocksDescendants"" on my parent LinearLayout so that the ListView items are still selectable. The problem I am having is that when clicking the part of the ListView item which is the HorizontalScrollView, the ListView item click event is not called. How can I get the click event of the HorizontalScrollView to call the ListView list item click event?

    Read the article

  • Move an item from one div to another and back again using jquery

    - by Jean
    Hello, <div id=i1><span id=e1>Item 1</span></div> <div id=i2><span id=e2>Item 2</span></div> When I click on Item 1 it should be deleted and moved to i2 and when I click on Item 1 again it must go back to i1 Yes, I tried append(), it goes to i2, but on clicking again it does not move back to i1 How do I get to do it. Thanks Jean

    Read the article

  • ASP.NET lisbox - Selected first item, always

    - by Lijo
    I have a list box which is populated using a dictioanry. When I iterate throught the selected items using the following code, it always show only the first items as selected - even if the first item is not selected. Have you ever encountered this scenario? Could you please help on this? foreach (ListItem item in lstProcessName.Items) { if (item.Selected == true) { selectedNewSales.Add(item.Text); } }

    Read the article

  • Parallelism in .NET – Part 7, Some Differences between PLINQ and LINQ to Objects

    - by Reed
    In my previous post on Declarative Data Parallelism, I mentioned that PLINQ extends LINQ to Objects to support parallel operations.  Although nearly all of the same operations are supported, there are some differences between PLINQ and LINQ to Objects.  By introducing Parallelism to our declarative model, we add some extra complexity.  This, in turn, adds some extra requirements that must be addressed. In order to illustrate the main differences, and why they exist, let’s begin by discussing some differences in how the two technologies operate, and look at the underlying types involved in LINQ to Objects and PLINQ . LINQ to Objects is mainly built upon a single class: Enumerable.  The Enumerable class is a static class that defines a large set of extension methods, nearly all of which work upon an IEnumerable<T>.  Many of these methods return a new IEnumerable<T>, allowing the methods to be chained together into a fluent style interface.  This is what allows us to write statements that chain together, and lead to the nice declarative programming model of LINQ: double min = collection .Where(item => item.SomeProperty > 6 && item.SomeProperty < 24) .Min(item => item.PerformComputation()); .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } Other LINQ variants work in a similar fashion.  For example, most data-oriented LINQ providers are built upon an implementation of IQueryable<T>, which allows the database provider to turn a LINQ statement into an underlying SQL query, to be performed directly on the remote database. PLINQ is similar, but instead of being built upon the Enumerable class, most of PLINQ is built upon a new static class: ParallelEnumerable.  When using PLINQ, you typically begin with any collection which implements IEnumerable<T>, and convert it to a new type using an extension method defined on ParallelEnumerable: AsParallel().  This method takes any IEnumerable<T>, and converts it into a ParallelQuery<T>, the core class for PLINQ.  There is a similar ParallelQuery class for working with non-generic IEnumerable implementations. This brings us to our first subtle, but important difference between PLINQ and LINQ – PLINQ always works upon specific types, which must be explicitly created. Typically, the type you’ll use with PLINQ is ParallelQuery<T>, but it can sometimes be a ParallelQuery or an OrderedParallelQuery<T>.  Instead of dealing with an interface, implemented by an unknown class, we’re dealing with a specific class type.  This works seamlessly from a usage standpoint – ParallelQuery<T> implements IEnumerable<T>, so you can always “switch back” to an IEnumerable<T>.  The difference only arises at the beginning of our parallelization.  When we’re using LINQ, and we want to process a normal collection via PLINQ, we need to explicitly convert the collection into a ParallelQuery<T> by calling AsParallel().  There is an important consideration here – AsParallel() does not need to be called on your specific collection, but rather any IEnumerable<T>.  This allows you to place it anywhere in the chain of methods involved in a LINQ statement, not just at the beginning.  This can be useful if you have an operation which will not parallelize well or is not thread safe.  For example, the following is perfectly valid, and similar to our previous examples: double min = collection .AsParallel() .Select(item => item.SomeOperation()) .Where(item => item.SomeProperty > 6 && item.SomeProperty < 24) .Min(item => item.PerformComputation()); However, if SomeOperation() is not thread safe, we could just as easily do: double min = collection .Select(item => item.SomeOperation()) .AsParallel() .Where(item => item.SomeProperty > 6 && item.SomeProperty < 24) .Min(item => item.PerformComputation()); In this case, we’re using standard LINQ to Objects for the Select(…) method, then converting the results of that map routine to a ParallelQuery<T>, and processing our filter (the Where method) and our aggregation (the Min method) in parallel. PLINQ also provides us with a way to convert a ParallelQuery<T> back into a standard IEnumerable<T>, forcing sequential processing via standard LINQ to Objects.  If SomeOperation() was thread-safe, but PerformComputation() was not thread-safe, we would need to handle this by using the AsEnumerable() method: double min = collection .AsParallel() .Select(item => item.SomeOperation()) .Where(item => item.SomeProperty > 6 && item.SomeProperty < 24) .AsEnumerable() .Min(item => item.PerformComputation()); Here, we’re converting our collection into a ParallelQuery<T>, doing our map operation (the Select(…) method) and our filtering in parallel, then converting the collection back into a standard IEnumerable<T>, which causes our aggregation via Min() to be performed sequentially. This could also be written as two statements, as well, which would allow us to use the language integrated syntax for the first portion: var tempCollection = from item in collection.AsParallel() let e = item.SomeOperation() where (e.SomeProperty > 6 && e.SomeProperty < 24) select e; double min = tempCollection.AsEnumerable().Min(item => item.PerformComputation()); This allows us to use the standard LINQ style language integrated query syntax, but control whether it’s performed in parallel or serial by adding AsParallel() and AsEnumerable() appropriately. The second important difference between PLINQ and LINQ deals with order preservation.  PLINQ, by default, does not preserve the order of of source collection. This is by design.  In order to process a collection in parallel, the system needs to naturally deal with multiple elements at the same time.  Maintaining the original ordering of the sequence adds overhead, which is, in many cases, unnecessary.  Therefore, by default, the system is allowed to completely change the order of your sequence during processing.  If you are doing a standard query operation, this is usually not an issue.  However, there are times when keeping a specific ordering in place is important.  If this is required, you can explicitly request the ordering be preserved throughout all operations done on a ParallelQuery<T> by using the AsOrdered() extension method.  This will cause our sequence ordering to be preserved. For example, suppose we wanted to take a collection, perform an expensive operation which converts it to a new type, and display the first 100 elements.  In LINQ to Objects, our code might look something like: // Using IEnumerable<SourceClass> collection IEnumerable<ResultClass> results = collection .Select(e => e.CreateResult()) .Take(100); If we just converted this to a parallel query naively, like so: IEnumerable<ResultClass> results = collection .AsParallel() .Select(e => e.CreateResult()) .Take(100); We could very easily get a very different, and non-reproducable, set of results, since the ordering of elements in the input collection is not preserved.  To get the same results as our original query, we need to use: IEnumerable<ResultClass> results = collection .AsParallel() .AsOrdered() .Select(e => e.CreateResult()) .Take(100); This requests that PLINQ process our sequence in a way that verifies that our resulting collection is ordered as if it were processed serially.  This will cause our query to run slower, since there is overhead involved in maintaining the ordering.  However, in this case, it is required, since the ordering is required for correctness. PLINQ is incredibly useful.  It allows us to easily take nearly any LINQ to Objects query and run it in parallel, using the same methods and syntax we’ve used previously.  There are some important differences in operation that must be considered, however – it is not a free pass to parallelize everything.  When using PLINQ in order to parallelize your routines declaratively, the same guideline I mentioned before still applies: Parallelization is something that should be handled with care and forethought, added by design, and not just introduced casually.

    Read the article

  • Word2007 - Preventing mid-item line breaks in a list in a table

    - by Dan
    It's not programming, but it's the paperwork you have to fill out ot get things to program. When you have a list with an item that's two lines long, and text above pushes it down such that a page break should fall between the two lines, Word pushes the item down so that both lines are on the following page - this is called Widow/Orphan Control and is an option on the Paragraph menu. When the list is inside of a table cell, however, this feature doesn't seem to work - which is what I'm looking to work around. Word doesn't push the item down automatically, so it breaks across two pages, as seen here: Solutions that have been tried: Playing with the options on the Paragraph tab: doesn't seem to do anything Changing the margins or text: this is a template and will need to always work Any ideas?

    Read the article

  • Item 2, Scott Myers Effective C++ question

    - by user619818
    In Item2 on page 16, (Prefer consts, enums, and inlines to #defines), Scott says: 'Also, though good compilers won't set aside storage for const objects of integer types'. I don't understand this. If I define a const object, eg const int myval = 5; then surely the compiler must set aside some memory (of int size) to store the value 5? Or is const data stored in some special way? This is more a question of computer storage I suppose. Basically, how does the computer store const objects so that no storage is set aside?

    Read the article

  • Unable to set my own icon for launcher item in 12.04

    - by Alex K
    I use the Faenza icon collection in Ubuntu 12.04 Unity with no issues. I decided to change my Gimp launcher icon, so I made my own (gimp-ak.png) and added it, and its appropriately sized derivatives, to the Faenza icon folders: /usr/share/icons/Faenza/apps/16/gimp-ak.png /usr/share/icons/Faenza/apps/22/gimp-ak.png /usr/share/icons/Faenza/apps/24/gimp-ak.png /usr/share/icons/Faenza/apps/32/gimp-ak.png /usr/share/icons/Faenza/apps/48/gimp-ak.png /usr/share/icons/Faenza/apps/64/gimp-ak.png /usr/share/icons/Faenza/apps/96/gimp-ak.png /usr/share/icons/Faenza/apps/scalable/gimp-ak.svg I then updated the Icon field in /usr/share/applications/gimp.desktop from "gimp" to "gimp-ak": [Desktop Entry] Version=1.0 Type=Application Name=GIMP Image Editor GenericName=Image Editor Comment=Create images and edit photographs Exec=gimp-2.6 %U TryExec=gimp-2.6 Icon=gimp-ak Terminal=false Categories=Graphics;2DGraphics;RasterGraphics;GTK; X-GNOME-Bugzilla-Bugzilla=GNOME X-GNOME-Bugzilla-Product=GIMP X-GNOME-Bugzilla-Component=General X-GNOME-Bugzilla-Version=2.6.12 X-GNOME-Bugzilla-OtherBinaries=gimp-2.6 StartupNotify=true MimeType=application/postscript;application/pdf;image/bmp;image/g3fax;image/gif;image/x-$ X-Ubuntu-Gettext-Domain=gimp20 After logging off (and even restarting), my custom icon does not show up - Gimp has the default gear icon: Setting the Icon field in gimp.desktop to any other icon in the Faenza collection works fine. What do I need to do to get my custom icon to show up properly?

    Read the article

  • Work Item Traceability in TFS 2010

    - by Sam Patrick
    I have created a Windows Form project (VS solution) under a TFS 2010 project. I may eventually add more solutions to the TFS project. My question: Can we create a Use Case WIT for a specific solution within a TFS project? Furthermore, is it possible to create a "traceability matrix" that starts at the Use Case level and goes down to the the code level (at least the namespace level) of that particular VS solution?

    Read the article

  • FormatDate in Display Item Form Webpart

    - by H(at)Ni
    I've faced an issue that I wanted to display the date in the format of ('MMMM dd') that is retrieved from a sharepoint list in an arabic site collection. So, after googling this issue, I've found out that a possible solution to my poblem is using the function ddwrt:FormatDateTime that can be used as long as you'll include the following namespace xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" My purpose was solved by writing this line of code in my xsl code behind for the webpart : ddwrt:FormatDateTime(string(@StartDate),3073,'MMMM dd') but that worked only if the webpart is inserted into an English site . After trying to search but in vain, I started to use my guesses that ended up doing something like that: ddwrt:FormatDateTime(ddwrt:FormatDateTime(string(@StartDate),3073,'dd/MM/yyyy'), 3073, 'MMMM dd') And the cause of the problem was that sharepoint parses the date as 'MM/dd/yyyy' which I think could be related to server regional settings, so I had to force it to parse the date in arabic-Egypt format as 'dd/MM/yyyy' in order to get the correct 'Month Day' format as expected.

    Read the article

  • Inserting new 'numbered item' on Word 2010

    - by MarceloRamires
    I have a very simple problem in Word 2010. I have a document with a Table of Contents, and I have the following items: 1. Title 1  [some text]   1.1 Title 1.1    [some text] I simply want to add an item 1.2. If I go at the end of Title 1.1 and press enter, an item 1.2 appears below it, but the text regarding item 1.1 stays below it all. I somehow used to be able to do it on word 2007, but I can't remember what I used to do, and before struggling in it for too long, I remembered SuperUser. Can someone answer this and maybe additionally link me to a tutorial on this ? Every one I find talks about having a text already numbered and adding a TOC in the beginning. I want to build the text all over the TOC.

    Read the article

  • Inserting new 'numbered item' on Word 2010

    - by MarceloRamires
    I have a very simple problem in Word 2010. I have a document with a Table of Contents, and I have the following items: 1. Title 1  [some text]   1.1 Title 1.1    [some text] I simply want to add an item 1.2. If I go at the end of Title 1.1 and press enter, an item 1.2 appears below it, but the text regarding item 1.1 stays below it all. I somehow used to be able to do it on word 2007, but I can't remember what I used to do, and before struggling in it for too long, I remembered SuperUser. Can someone answer this and maybe additionally link me to a tutorial on this ? Every one I find talks about having a text already numbered and adding a TOC in the beginning. I want to build the text all over the TOC.

    Read the article

  • Stacked Launcher Item Double Click Behaviour on Alt-tab

    - by Brandon Bertelsen
    Let's say that you have multiple firefox windows open. What you see happen is an additional arrow points to it's icon in the launcher. However, if you double click the icon, it displays all of the windows in a spread out fashion, similar to the behaviour from pushing Super + W, but only for that program group. Is it possible to make this window spreading behaviour occur with alt-tab? PS: No idea what tags I should use, or if the language (jargon) in the title or question is appropriate.

    Read the article

  • Contract / Project / Line-Item hierarchy design considerations

    - by Ryan
    We currently have an application that allows users to create a Contract. A contract can have 1 or more Project. A project can have 0 or more sub-projects (which can have their own sub-projects, and so on) as well as 1 or more Line. Lines can have any number of sub-lines (which can have their own sub-lines, and so on). Currently, our design contains circular references, and I'd like to get away from that. Currently, it looks a bit like this: public class Contract { public List<Project> Projects { get; set; } } public class Project { public Contract OwningContract { get; set; } public Project ParentProject { get; set; } public List<Project> SubProjects { get; set; } public List<Line> Lines { get; set; } } public class Line { public Project OwningProject { get; set; } public List ParentLine { get; set; } public List<Line> SubLines { get; set; } } We're using the M-V-VM "pattern" and use these Models (and their associated view models) to populate a large "edit" screen where users can modify their contracts and the properties on all of the objects. Where things start to get confusing for me is when we add, for example, a Cost property to the Line. The issue is reflecting at the highest level (the contract) changes made to the lowest level. Looking for some thoughts as to how to change this design to remove the circular references. One thought I had was that the contract would have a Dictionary<Guid, Project> which would contain ALL projects (regardless of their level in hierarchy). The Project would then have a Guid property called "Parent" which could be used to search the contract's dictionary for the parent object. THe same logic could be applied at the Line level. Thanks! Any help is appreciated.

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >