list

string.split returns a string[] I want a List<string> is there a one liner to convert an array to a list?

Lists in c# have the .toArray() function. I want the inverse, where an array is transformed into a list. I know how to create a list and loop through it but i would like a one liner to swap it back. I am using the string.split function in the .NET 2.0 environment so Linq etc. is not available to me. ...

Python - append vs. extend

What is the difference between the list methods append and extend? ...

Python filter/remove URLs from a list

Hi. I have a text file of URLs, about 14000. Below is a couple of examples: http://www.domainname.com/pagename?CONTENT_ITEM_ID=100&amp;param2=123 http://www.domainname.com/images?IMAGE_ID=10 http://www.domainname.com/pagename?CONTENT_ITEM_ID=101&amp;param2=123 http://www.domainname.com/images?IMAGE_ID=11 http://www.domainname.com/page...

python, functions running from a list and adding to a list through functions

How do I run a function on a loop so all the results go straight into a list and is there a way to run a function which acts on all the values in a list? ...

Compare two consecutive elements in std::list

I'd like to compare two consecutive elements in a std::list while iterating through the list. What is the proper way to access element i+1 while my iterator is at element i? Thanks Cobe ...

Merging/adding lists in Python

I'm pretty sure there should be a more Pythonic way of doing this - but I can't think of one: How can I merge a two-dimensional list into a one-dimensional list? Sort of like zip/map but with more than two iterators. Example - I have the following list: array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] I want to have result = [12, 15, 18] #...

Search multiple list for missing entries

I have 3 lists, I will make them simple here. list of letters A B C list of numbers 1 2 3 Mixed A,1 A,2 B,2 B,3 C,1 C,3 I need to know what is missing: A,3 B,1 C,2 The list of letters has about 85 entries and the list of numbers has about 500 entries. The mixed list has about 75,000...

Is there a no-duplicate List implementation out there?

Hey all, I know about SortedSet, but in my case I need something that implements List, and not Set. So is there an implementation out there, in the API or elsewhere? It shouldn't be hard to implement myself, but I figured why not ask people here first? thanks, Yuval =8-) ...

What is the best UI/CSS combination when displaying strings of unknown length?

I have a list of items that I am displaying in a floated list, with each item in the list at a fixed width so that there's two per row. What is the best practice to prevent this horrible thing from happening: Possibilites: Trim to a specified number of characters before displaying the data. Requires guesswork on how many characters...

Sharepoint Lists - GroupBy?

Hello, I'm trying to get data from a Sharepoint list and put it into some Flex graphs. I can call the list data just fine using a CAML query, but I want to use a GroupBy to consolidate the rows by Teams. So, for example Team 1 may have 20 records, Team 2 may have 8 records, and Team 3 might have 25 records... Instead of showing 53 rec...

Comparing generic list to an array

Why is the generic.list slower than array? ...

Using Lists in C#

I am an upper level Software Engineering student currently in a Data Structures and Algorithms class. Our professor wants us to write a program using the List structure found in the C++ STL. I have been trying to use C# more and more, and was wondering if the ArrayList structure in .NET is a good substitute for the STL List implementat...

What is the easiest approach to exporting a Sharepoint list in xml format?

Pretty self explanatory. I just need to export lists easily to xml format. Are there any tools that accomplish this? ...

Conditionally wrap HTML elements

In my Seam application, I have a Seam component that returns a (@Datamodel) list of items I want to transform into a set of <li> HTML elements. I have this working without a problem. But now, I want to split up the list according to an EL expression. So the EL expression determines if a new <ul> element should be started. I tried the f...

The best way to process lists of email addresses

I have got 3 text files (A, B and C), each with several hundred email addresses. I want to merge list A and list B into a single file, ignoring differences in case and white space. Then I want to remove all emails in the new list that are in list C, again ignoring differences in case and white space. My programming language of choice is...

How do I add custom column to existing WSS list template

I need to use feature stapler to add some text columns to Posts list inside OOTB blog site definition. I plan not to use site columns, but only to add those columns to list (I don't use site columns because I have multiple site collections and there will be only one Posts list per site collection, so site columns are not very reusable in...

Python - sort a list of nested lists

I have input consisting of a list of nested lists like this: l = [[[[[39]]]], [1, 2, 3], [4, [5, 3], 1], [[[[8, 9], 10], 11], 12]] I want to sort this list based on the sum of all the numbers in the nested lists... so, the values I want to sort by of l would look like this: [39, 6, 13, 50] Then I want to sort based on these. So the...

Why can't I store boost::function in std::list?

Why does the following code have the error "error: expected `;' before 'it'"? #include <boost/function.hpp> #include <list> template< class T > void example() { std::list< boost::function<T ()> >::iterator it; } ...

F# help @ the newbie level

Suppose I have some code: let listB = [ 1; 2; 3 ] Using Lisp notation, how do I do a car and cadr against this list? I know cons is ::. Or in Scheme, first and rest? Thanks! :-) ...

How to create automatic a list of items used in a LaTeX-document?

I want to add items in a LaTeX-document. Say for example, that I want add hints to the document. I create a command, so I can call something similar to this: \hint{foocareful}{Be careful with foo!}{foo is a very precious item and can easily be broken. Be careful, especially don't throw foo.} This will be formatted in special way, to m...