list

How to read lines from a file into a multidimensional array (or an array of lists) in python

I have a file with a format similar to this: a,3,4,2,1 3,2,1,a,2 I want to read the file and create an array of lists in a way that: array[0] = ['a','3','4','2','1'] array[1] = ['3','2','1','a','2'] How can I do that? So far I am stuck with: f = open('./urls-eu.csv', 'r') for line in f: arr = line.split(',') print arr But ...

Catalog items in Sharepoint

As a feed from external system we get a Catalog items (They are product info) as part of feed once a day. We need to take this feed and store in Sharepoint. Following are things we want to achive with this. Need to search those items and show as part of standard search resutls. There will be Insert (New Items) , updates and deletes to...

Conditional Lists of Values in Oracle APEX?

Hey all, I need to use the value of one Select List to populate the value of a second select list, but the items in Select List number two are going to be from a completely different tables depending on what's selected in list number one. Is there a way I can conditionally populate the second list based on the values from the first? S...

How to remove these duplicates in a list (python)

biglist = [ {'title':'U2 Band','link':'u2.com'}, {'title':'ABC Station','link':'abc.com'}, {'title':'Live Concert by U2','link':'u2.com'} ] I would like to remove the THIRD element inside the list...because it has "u2.com" as a duplicate. I don't want duplicate "link" element. What is the most efficient code to do t...

How to trim a list in Python

Suppose I have a list with X elements [4,76,2,8,6,4,3,7,2,1...] I'd like the first 5 elements. Unless it has less than 5 elements. [4,76,2,8,6] How to do that? ...

How do you prevent a user from resizing the column width of a clistctrl (report view)?

How do you prevent a user from resizing the column width of a clistctrl (report view)? ...

Where can I find a list of all UK _full_ postcodes including street name and their precise coordinates?

Where can I find a list of all UK full postcodes including street name and their precise coordinates? They should be not like AB1, AB23 etc but AB1 2AA, AB23 5ZZ etc. Preferably for free :) Thanks ...

Python: Replace values in list

Hello Stack Overflow Community, I have a list where I want to replace values with None where condition() returns True. [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] For example, if condition checks bool(item%2) should return: [None, 1, None, 3, None, 5, None, 7, None, 9, None] What is the most efficient way to do this? ...

Can you remove an item from a List<> whilst iterating through it in C#

Can you remove an item from a List<> whilst iterating through it? Will this work, or is there a better way to do it? My code: foreach (var bullet in bullets) { if (bullet.Offscreen()) { bullets.Remove(bullet); } } -edit- Sorry guys, this is for a silverlight game. I didn't realise silverlight was different to th...

Cloning iterators in Java

I have a LinkedList in Java, an iterator to browse the list and I would like to clone the iterator to do some temporary "look ahead" processing of the list with respect to the position of the original iterator. I understand that cloning an iterator is not possible in every situation, but is there a way to clone an iterator to a LinkedLi...

How to apply Loop to working Python Selenium Script?

Hi, I'm trying to figure out how to apply a for-loop to this script and I'm having a lot of trouble. I want to iterate through a list of subdomains which are stored in csv format (ie: one column with 20 subdomains) and print the html for each. They all have the same SourceDomain. Thanks! #Python 2.6 from selenium import selenium impo...

Can someone post an example of creating a boost inv_adjacency_iterator using inv_adjacency_iterator_generator?

Given definitions: typedef typename boost::graph_traits::adjacency_iterator adjacency_iter; typedef typename boost::inv_adjacency_iterator_generator::type inv_adjacency_iter; I am interested in semantics of boost::tie(i, end) = inv_adjacent_vertices((*start); adjacent_vertices works fine where inv_adjacent_vertices fails with the foll...

How to sort this list in Python?

[ {'time':33}, {'time':11}, {'time':66} ] How to sort by the "time" element, DESC. ...

Delphi - most successful applications developed

Can you name famous, successful applications, applications in development, future applications, that are developed with Delphi? The kind of applications that you use everyday is encouraged. Some of I know: Total Commander TopStyle Skype PHP Designer edit I'm not very interested in listing of applications taken from Google. Just the...

How do do this list manipulation in Python? This is tricky.

Suppose I have this list: [ [5, 44, 73] , [7, 21, 99], [1, 32, 100] ] What is the MOST efficient way to turn it into this list? [ 5, 7, 1, 44, 21, 32, 73, 99, 100 ] Notice, I grab the first from each. Then the 2nd element from each. Of course, this function needs to be done with X elements. I've tried it, but mine has many loops,a...

Remove duplicates in a list while keeping its order (Python)

This is actually an extension of this question. The answers of that question did not keep the "order" of the list after removing duplicates. http://stackoverflow.com/questions/1534736/how-to-remove-these-duplicates-in-a-list-python biglist = [ {'title':'U2 Band','link':'u2.com'}, {'title':'Live Concert by U2','link':'u2.com...

Use more than one predicate in a function parameter?

I have a class that builds a url with query string parameters and so on. The class has a method: Url() which returns the complete url composed from the class properties and another method: UrlNew() which allows passing a predicate as parameter for the replacement of the value of one of the properties and THEN Returns the modified URL. No...

C# - var to List<T> conversion

How to cast/convert a var type to a List type? This code snippet is giving me error: List<Student> studentCollection = Student.Get(); var selected = from s in studentCollection select s; List<Student> selectedCollection = (List<Student>)selected; foreach (Student s in selectedCollection) { s.Show(); } ...

return a list<int> from a function c++

Every time I try to use my add function and return a list from it. I get an undefined symbol error. What am I doing wrong here. this is the error: Undefined first referenced symbol in file add(std::list<int, std::allocator<int> > const&, std::list<int, std::allocator<int> >)/var/tmp//...

How to upload multiple files to a SharePoint List

I am trying to upload multiple files into a SharePoint LIST as attachments. (can't use Document Libraries). I'm trying to use jquery to accomplish this but I'd appreciate any help or advise you may have concerning how best to upload to a list. For instance, can multi-uploads be accomplished when creating a new item? If you have code ...