Omgili - forum search, search forums  
  

Discussions about list

Displaying 1 - 10 out of 2,053,325 discussions.  
RSS Feed Options
Time Frame: (Any time)   Minimum number of replies: (2)   Minimum number of discussing users: (0)
  |  

Page: 1   2   3   4   5   6   7   8   9   10  
Keep this page open to be updated with the newest discussions automatically.
The question is confusing, but it is much more clear as described in the following codes: List<List<T>> listOfList; // add three lists of List<T> to listOfList, for example /* listOfList = new { { 1, 2, 3}, // list 1 of 1, 3, and 3 {...
Started by on , 4 posts by 4 people.  
Use the SelectMany extension method list = listOfList.SelectMany(x => x).ToList(); Do you mean List<int>() { 3, 4 }, new List<int>() { 5, 6 } }; var list = new List<int> { 9, 9, 9 = from list in listOfList from....
Imagine the following list: List<List<List<String>>> listRoot = new List<List<List<String>>>(); I want to count the elements of the first and the second list and return the accumulated value: int iFirstListCounter =...
Started by on , 5 posts by 5 people.  
ListRoot.SelectMany(l => l.SelectMany(li => li)).Count() int totalCount = listRoot.Sum(x => x.Count + x.Sum(y => y.Count)); This should do it: int firstListCounter = listRoot.Sum(f => f.Count); int secondListCount = listRoot.Sum(f =>... .
Lest say you want the last element of a python list: what is the difference between myList[-1:][0] and myList[len(myList)-1] I thought there was no difference but then I tried this >>> list = [0] >>> list[-1:][0] 0 >>> list[...
Started by on , 4 posts by 4 people.  
To get the same behaviour as ....
list[-1:] creates a new list.
[len(list)-1] is reference to last object.
So [-1:][0] modifies the new list.
If you use slicing [-1:], the returned list is a shallow-copy, not reference.
Ask your Facebook Friends
Original question: Can someone tell me how to use "slice lists" and the "ellipsis"? When are they useful? Thanks. Here's what the language definition says about "slice_list" and "ellipsis"; Alex Martelli's answer points out their origin, which is not ...
Started by on , 4 posts by 4 people.  
L = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] Indexing into a list: l[0] >>>....
Here goes list slicing: I hope you know that list indeces begin at 0.
Not too sure about ellipsis, so I will not address that, lest I give you a bad answer .
I have a List<List<int>> . I would like to convert it into a List<int> where each int is unique. I was wondering if anyone had an elegant solution to this using LINQ. I would like to be able to use the Union method but it creates a new...
Started by on , 5 posts by 5 people.  
How about: HashSet<int> set = new HashSet<int>(); foreach (List<int> list in listOfLists) { set.UnionWith(list); } return set.ToList(); List allInts = new List(); foreach(List<int> list in listOfLists....
Hi, How shall sort this in ASC order? I got List<List<UInt32>> full of records of List<UInt32> and I want those records to be sorted according to the first column in each record - the column is UInt32 number. So: I have List of: new ...
Started by on , 3 posts by 3 people.  
This way it works for any IEnumerable<T>.
First() instead of accessing the 0 element in the list.
I have a list of lists, and I need to find the longest one of them. If there are more than one with the same length it's the same which it returns. Thanks.
Started by on , 3 posts by 3 people.  
Here is a general predicate that scans a list to find a single member defined by a given goal now is define a predicate get_longer_list(L1, L2, L) , and use it instead of get_bigger_number/3, you should try to avoid calculating the length....
Hi, How do I sort List<List<string>> according to number of fields? The list got structure like a|b|c|d|eeee|rere|ewew| ewqewq|ewew| ewew|ewewewewew| By Sort I'd like to do it according to numbers of blockes (asc/desc) EDIT the <list<...
Started by on , 5 posts by 5 people.  
Var sorted * x.Count.CompareTo(y.Count));....
If you don't need to sort "in place" you can use LINQ to give you a new sorted, list.
To create a list that's sorted by the number of elements within a particular string in another list.
I've got an object of type A which consists of a list of objects of type B : class A { list<B> Alist;} class B { string C; string D;} In my program I have a list of A objects: list<A> listOfA = computeAList(); and I would like to select all...
Started by on , 3 posts by 3 people.  
The query expression equivalent of this is: var query = from a in computeAList() from b in a.Alist select b.C; For the sake of completeness, the other answers in this thread are variations on the same... .
Ybo's answer would have been my first response too.
What is the simplest and reasonably efficient way to slice a list into a list of the sliced sub-list sections for arbitrary length sub lists. For example, if our source list is: input = [1, 2, 3, 4, 5, 6, 7, 8, 9, ... ] And our sub list length is 3 then...
Started by on , 4 posts by 4 people.  
Since you don't define what might happened to the final element of the new list when the number; list(grouper(2, [1,2,3,4,5,6,7])) [(1, 2), (3, 4), (5, 6), (7, None)] I like SilentGhost's solution] for i in range(n)]) group....
Of a chunk.
Page: 1   2   3   4   5   6   7   8   9   10  
Related Searches
ram list    heroclix list    PTHC LIST    imgboard list    DISPLAY LIST    circumventor list    The Bucket List    megaupload list    PRL list    electrochoc list   
More Information


Forum Search About Omgili Help Plugins Forum/Board Owners Privacy

i
In Title
In Topic
In Reply
Exclude
Boost