list

Color names allowed in HTML/CSS

I know and use a few color names like 'white', 'blue', 'red', is there a complete list of colors allowed in HTML/CSS ? ...

Appending an integer to a List in Ocaml

How can i implement this function? let rec append l i = (* For example, if l is a list [1;2] and i is an integer 3 append [1;2] 3 = [1;2;3]*) ;; ...

How to generate a list of 150 cases initialised with a dict in Python ?

I would like to create a list like this list = [] for i in range(150): list.append({'open': False, 'serve': False}) But is there a better way in Python to do it ? ...

How to strip a list of tuple with python ?

I have an array with some flag for each case. In order to use print the array in HTML and use colspan, I need to convert this : [{'serve': False, 'open': False}, {'serve': False, 'open': False}, {'serve': False, 'open': False}, {'serve': False, 'open': False}, {'serve': False, 'open': False}, {'serve': False, 'open': False}, {'serve': F...

foreach in linq result not working

Don't know what's wrong here, when I run the application it says "Specified method is not supported" pointing at "var result in query" in foreach loop. Please help... var query = from c in entities.Customer select c.CustomerName; List<string> customerNames = new List<string>(); foreach (var result in query) { customerN...

ocaml recurssion iteration- find last occurence of element in a list

Assuming l is a List and elem is an element, how can I return the last occurence of the element elem in the list l? Also return -1 if the element does not exisit in l. I dont quite understand how to use recursion for iterating through the list... let rec getLastOccurence l elem = ;; ...

How can I sort a list when the sorting criterion requires an extra variable? C++

Hi there, this is for an assignment so I will be deliberately general. My question is related to implementation decisions I already made--maybe they weren't good ones. I have a list of pointers to structs, e.g. list<MyStruct*> bob; At one point I've needed to sort these pointers by one of the data members of their targets and I was able...

List view control displaying distorted images

Hi, I have a problem with the ListView control in a windows forms application. Even if I create a thumbnail image or resize the real one I get distorted images in the list view. The image looks like when you zoom in an image very much. I first thought that the GetThumbnailImage is couseing this but I used a resize code I found here an...

How to implement MapThread with basic list mapping?

Mathematica has a function MapThread that behaves like this: MapThread[ f , { {a,b,c} , {d,e,f} } ] -> { f[a,d] , f[b,e] , f[c,f] } I'd like to implement this in TeX, which has very primitive programming facilities. I've basic facilities for iterating over lists, but no logical indexing into them. Given this restriction, is there an a...

ASP.NET MVC Updating a list of objects on one form? (model binding to a list)

Hello (again) Quick question regarding updating a list of items in asp.net mvc. Basically I have an edit action method that returns a collection of objects (incidentally, the table structure of which looks as follows 'testID, assetID, Result' - a link table). I basically want this items to be displayed one after another in a form and ...

Sharepoint Alerts on List Folders.

Hi, I would like to programatically add alert to folders inside a sharepoint list. I have found how to set alerts to a list and this works perfect. Could someone please help me on how to set alerts to a specific folder which is inside a list. Below is the code i currently have which sets alerts only to the list. using (SPSite s...

Create selection lists from a column with strings in a spreadsheet

I'm trying to make a selectionlist in NeoOffice (mac osx clone of OpenOffice) from a column with strings. I can make selection lists when in the same column, but I want a reference between a list of cells to another column selection list. How can I do that? Maybe some references? ...

Clarification on lists and removing elements

If I have a list<object*>>* queue and want to pop the first object in the list and hand it over to another part of the program, is it correct to use (sketchy code): object* objPtr = queue->first(); queue->pop_first(); return objPtr; // is this a pointer to a valid memory address now? ? According to the documentation on http://www.cp...

Find element and add class (jQuery)

<ul> <li><a href="#">LEVEL 1</a> <ul> <li>...</li> </ul> </li> <li><a href="#">LEVEL 1</a> <ul> <li>...</li> </ul> </li> </ul> I have a nested list and I want to use jQuery to add class to the LI that containts A>LEVEL 1 based on this condition: if a nested UL exists AFTER UL LI A, ...

Can't Allow User To Add Rows to DataGridView with List<> Datasource.

Hi everyone, I've DataGridView that bound to List<myClass> as DataSource. But when i set "AllowUserToAddRows" property to "True" there is nothing appear. I tried to change the DataSource to BindingList<myClass> and it's going well. I wonder if i should replace my List<> with BindingList<> or there is better solution ??. Thank you ve...

deleting an object in a loop that runs through the range of the list??

I have a list composed of [start position, stop position, [sample names with those positions]] My goal is to remove the duplicates with exact start and stop positions and just add the extra sample to the sample names section. The problem I'm encountering is that when I delete from the list, I end up with an out of range error, because...

How to use IndexOf() method of List<object>

All the examples I see of using the IndexOf() method in List are of basic string types. What I want to know is how to return the index of a list type that is an object, based on one of the object variables. List<Employee> employeeList = new List<Employee>(); employeeList.Add(new Employee("First","Last",45.00)); I want to find the inde...

Which STL Container?

I need a container (not necessarily a STL container) which let me do the following easily: Insertion and removal of elements at any position Accessing elements by their index Iterate over the elements in any order I used std::list, but it won't let me insert at any position (it does, but for that I'll have to iterate over all element...

AddHour / AddMinute store within a ListItem

Hello all, I am using c#.net I have two times pulled from a database (‘earliest start time’ and ‘latest end time’). I want to loop through and add ‘in-between’ times to a list. Example earliest start time – 12:00 12:30 13:00 13:30 14:00 14:30 latest end time – 15:00 I have found some code, but as the information is being pulled ...

Multithreaded Syncronised List<T>

I have a requirement whereby I needed to store a simple cache of a list of items. I was using List< T > for this purpose, but we have now changed the design to accomodate multiple threads. The architecture of the system is driven by events, therefore it's quite likely that a read and write operation could collide. Since the vast majorit...