Search Results

Search found 36179 results on 1448 pages for 'generic list'.

Page 121/1448 | < Previous Page | 117 118 119 120 121 122 123 124 125 126 127 128  | Next Page >

  • converting python list of strings to their type

    - by user248237
    given a list of python strings, how can I automatically convert them to their correct type? Meaning, if I have: ["hello", "3", "3.64", "-1"] I'd like this to be converted to the list ["hello", 3, 3.64, -1] where the first element is a stirng, the second an int, the third a float and the fourth an int. how can I do this? thanks.

    Read the article

  • List remove question

    - by younevertell
    List collCustList = new List(); collCustList.Add(new Customer(99, "H", "P")); I tried collCustList.Remove(new Customer(99, "H", "P")); but it doesn't work How could I remove the new item(new Customer(99, "H", "P")) I just added? Thanks

    Read the article

  • Hibernate - how to create list of pojos?

    - by AspNewbie
    I am very new to Hibernate. I have MySQL database and mapped pojos. What should I do next? I know little bit LINQ to SQL from .NET, and it generates me List of mapped objects. So basically, what are my next steps after creating POJOS if I want to have List of them and do CRUD operations upon them and data will be also saved in DB not only in java objects ? kthx

    Read the article

  • [C#] How to do a search from a list with non-prefix keywords

    - by aNui
    First of all, sorry if my english or my post got any mistakes. I am programming a program to search the name from the list and I need to find them if the keyword is not in front of the names (that's what I mean non-prefix) e.g. if I my list is the music instruments and I type "guit" to the search textbox. It should find the names "Guitar, Guitarrón, Acoustic Guitar, Bass Guitar, ..." or something like this Longdo Dictionary's search suggestion. here is my simple and stupid algorithm (that's all I can do) const int SEARCHROWLIMIT = 30; private string[] DoSearch(string Input, string[] ListToSearch) { List<string> FoundNames = new List<string>(); int max = 0; bool over = false; for (int k = 0; !over; k++) { foreach (string item in ListToSearch) { max = (max > item.Length) ? max : item.Length; if (k > item.Length) continue; if (k >= max) { over = true; break; } if (!Input.Equals("Search") && item.Substring(k, item.Length - k).StartsWith(Input, StringComparison.OrdinalIgnoreCase)) { bool exist = false; int i = 0; while (!exist && i < FoundNames.Count) { if (item.Equals(FoundNames[i])) { exist = true; break; } i++; } if (!exist && FoundNames.Count < SEARCHROWLIMIT) FoundNames.Add(item); else if (FoundNames.Count >= SEARCHROWLIMIT) over = true; } } } return FoundNames.ToArray(); } I think this algorithm is too slow for a large number of names and after several trial-and-error, I decided to add SEARCHROWLIMIT to breaks the operation And I also think there're some readymade methods that can do that. And another problem is I need to search music instruments by a category like strings, percussions, ... and by the country of origins. So I need to search them with filter by type and country. please help me. P.S. Me and my friends are just student from Thailand and developing the project to compete in Microsoft Imagine Cup 2010 and please become fan on our facebook page [KRATIB][3]. And we're so sorry we don't have much information in English but you can talk to us in English.

    Read the article

  • How to get the list in second image ?

    - by rajesh
    Hi, actually i have 2 images ,when we click on one image it generates pop window containing n no of list. if i click on any link 2 parameters are passed to function one for url and other image path and now i have another image ,what i want to do is if i click on that image it will generate a list which has a content of first image after clicking any link of first image means if i click image1 image2 1 2 3 now if i click 1 then result must be like this image1 image2 1 1 2 3 Please help thanks.

    Read the article

  • Refresh Service List of a paired Bluetooth device !

    - by sas-san
    Hi- Is there any possibility to refresh the service list of a paired device in a programm? At the moment, i have to go to the bluetooth options and select the device properties of the bluetooth device and have to refresh the service list manually. Is there any API that RIMM provides to do programmatically? thanks,

    Read the article

  • How to quickly parse a list of strings

    - by math
    If I want to split a list of words separated by a delimiter character, I can use >>> 'abc,foo,bar'.split(',') ['abc', 'foo', 'bar'] But how to easily and quickly do the same thing if I also want to handle quoted-strings which can contain the delimiter character ? In: 'abc,"a string, with a comma","another, one"' Out: ['abc', 'a string, with a comma', 'another, one'] Related question: How can i parse a comma delimited string into a list (caveat)?

    Read the article

  • List content of tar file or a directory only down to some level

    - by Tim
    I wonder how to list content of tar file only down to some level? I understand "tar tvf mytar.tar" will list all files, but sometimes I wish I can just see directories down to some level. Similarly for command "ls" how to control the level of subdirectories that will be displayed? By default, it will only show the direct subdirectories, but not further. Thanks and regards

    Read the article

  • wpf how to bind a listbox to a list (two ways) - c#

    - by user429400
    Hi, I want to create a 2 way bind between a listbox and a .NET list. In my GUI, I have a listbox, a textbox and add and remove buttons. The listbox displays cars, and my goal is to create a 2way bind between the .Net car list and the listbox: when the user enters a car into the textbox, it gets updated only in the .Net list, and the listbox is updated automatically. When the user press the GUI "remove" button, a car gets removed from the GUI and the .Net list is updated automatically. I've started to write the xaml code, but figured that I don't actually know how to do the binding on both sides (c# and xaml): <Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c="clr-namespace:WpfApplication1" Title="Window1" Height="300" Width="369" Loaded="Window_Loaded"> <Window.Resources> <ObjectDataProvider x:Key="carsData" ObjectType="{x:Type c:Window1}" /> </Window.Resources> <Grid Width="332"> <ListBox Margin="10,62,0,100" Name="myListBox" HorizontalAlignment="Left" Width="120" ItemsSource="{Binding Source={StaticResource CarsData}}"/> <Button Height="23" Margin="66,0,0,65" Name="addBtn" VerticalAlignment="Bottom" Click="addBtn_Click" HorizontalAlignment="Left" Width="64">add</Button> <TextBox Margin="10,0,0,64.48" Name="myTextBox" Height="23" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="47" /> <Button Height="23" Margin="66,0,0,33" Name="removeButton" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="64" Click="removeButton_Click">Remove</Button> </Grid> </Window> There is my c# code: namespace WpfApplication1 { public partial class Window1 : Window { MyModel listMgr; ObservableCollection carList; public Window1() { InitializeComponent(); listMgr = new MyModel(); } private void addBtn_Click(object sender, RoutedEventArgs e) { listMgr.add(new Car(0, myTextBox.Text, 2011)); } private void removeButton_Click(object sender, RoutedEventArgs e) { //myListBox.Items.RemoveAt(0); } private void Window_Loaded(object sender, RoutedEventArgs e) { carList = listMgr.getList(); myListBox.DataContext = carList; //secondListBox.DataContext = carList; } } } Thanks, Li

    Read the article

  • how List<string> become AutoCompleteStringCollection

    - by aeruL
    I have list, i want to convert it to autoCompleteStringCollection.. And I don't want use foreach. _textbox.AutoCompleteMode = AutoCompleteMode.Append; _textbox.AutoCompleteSource = AutoCompleteSource.CustomSource; _textbox.AutoCompleteCustomSource = user.GetNameUsers() as AutoCompleteStringCollection; Note user.GetNameUsers() is list. Code doesn't work, it become null. Thank you

    Read the article

  • How do I do cron job for list of URLS

    - by mathew
    HI I do have a list of urls and my site is giving information about indexing and back links of any website out their. so what I want is I do have thousands of website lists with me and I want all that to run and store it in my database. so how do I do it using crone job?? the url address is for example www.mydomain.com/search?url=www.google.com so after google.com another one and all which is in the list.

    Read the article

  • python: list manipulation

    - by Jason S
    I have a list L of objects (for what it's worth this is in scons). I would like to create two lists L1 and L2 where L1 is L with an item I1 appended, and L2 is L with an item I2 appended. I would use append but that modifies the original list. How can I do this in Python? (sorry for the beginner question, I don't use the language much, just for scons)

    Read the article

  • length of dropdown list

    - by sushant
    i have a drop down list in my form. it contains a lot of values. so when i click on it, it covers whole of the page, along with the scroll bar. is there a way to limit the length of the drop down list, say showing only 10 values at a time. any help is very much appreciated

    Read the article

  • Resultset To List

    - by Gnaniyar Zubair
    I want to convert my Resultset to List in my JSP page. and want to display all the values. This is my query: SELECT userId, userName FROM user; I have executed that using preparedstatement and got the Resultset. But how to convert it as a List and want to display the result like this: userID userName ------------------ 1001 user-X 1006 user-Y 1007 user-Z

    Read the article

  • Getting every odd variable in a list?

    - by John
    If I make a list in Python and want to write a function that would return only odd numbers from a range 1 to x how would I do that? For example, if I have list [1, 2, 3, 4] from 1 to 4 (4 ix my x), I want to return [1, 3].

    Read the article

  • linked list problem

    - by progster
    Delete every 't'th (t1) node of a single linked list. In the resultant linked list, again delete 't'th node. Repeat this till only t-1 nodes remains. For this i have come up with: Traverse until you reach 't'th node, delete all the nodes till the end. Is there any efficient way other than this?. Can any one please help me out. Thanks.

    Read the article

  • hashmap and list compare

    - by sarah
    Hi, I have a hashmap having four values a,b,c,d and list having only a i want to see if the hashmap has the value a and print it. hashmap.get('data') results a,b,c,d list l is having a how will i print only the value a

    Read the article

< Previous Page | 117 118 119 120 121 122 123 124 125 126 127 128  | Next Page >