list

python:[[1,2],[3,4],[5,6],[7,8]] transform into [[1],[2,3],[4,5],[6,7],[8]] and vice versa

my current solution-pointers would be ether via a iterator class which yields the new assembled inner lists or via a iter function which yields the new assembled inner lists is there another, better way to solve this challenge? Edit @Glenn: good objection. I wasn't thinking of that because I experienced lists not ordered in the ma...

Resize nested mx:Lists to display all list items

Hi, I'm trying to create a nested list in Flex which will dynamically resize to display all children when the data provider changes. Here's a simplified example which illustrates the problem: <mx:Script> <![CDATA[ import mx.collections.ArrayCollection; [Bindable] public var outer:ArrayCollection = new Arr...

C# ListView : How to Scroll it Vertically in List mode (normally its horizontal scroll bar is shown When View = List) ?

When C#(.net 2.0) list view is in List mode(see the code below): this.listView1.View = System.Windows.Forms.View.List; the list view scroll bar that is enabled is horizontal scroll bar(when list view items can't fit into the space available). But I want to enable vertical scroll bar, how? ...

How to convert datatable into generic type.

How to convert DataTable having N rows into KeyValuePair<long,string>[] type having same N no of rows I want to return KeyValuePair<long,string>[] kind of value from a function that will convert DataTable into above type. ...

IE8 only renders the first class-change in a jQuery CSS drop-down menu

In http://www.scherer.nl/nieuw (the /nieuw part will be removed when the site is ready) the drop-down submenu's on the left should shift up their background image when hovered over, so the hovered item becomes red i.s.o. orange. With jQuery I'm using toggleClass to add a class 'hover' to the hovered menu-item. The CSS makes the backgroun...

How can I get a <ul> to be evenly spaced across the content area it exists in?

I have a List that I'm using as a list of tabs: <div id="SearchForm"> <ul class="TabControl"> <li> <a href="/search/Funds">Funds (60)</a> </li> <li> <a href="/search/Companies">Companies (4)</a> </li> <li> <a href="/search/Groups">Groups (1)</a> </li...

Last cell selection .End(xlup) using VBA in Excel 2003 'lists' - requires two .Select to get correct cell?

Hi All! I'm a new convert from Experts-Exchange since I noticed they increased the 'Free Premium Services' points threshold. It seems that Excel 2003 has issues with the End(xlup) command when using it in a worksheet that contains an Excel 'List'.. If I select a cell outside the 'list' boundary, and then try to select the last cell in...

Get the current <li> number

Hi I have a list like this one: <ul> <li> <a href="..."> ... </a> <a href="..."> ... </a> </li> <li> <a href="..."> ... </a> <a href="..."> ... </a> </li> <li> <a href="..."> ... </a> <a href="..."> ... </a> </li> ... </ul> and the jQuery: $("li").each(function(){ // do stuff }); How...

DataGridView List<T> column?

I have a datagridView, that is bound to a List. This List is made up of my class which contains 2 public properties, a String Name, and another List CustomList. See below: public class MyClass2 { public string Name { get; set;} public string Description { get; set; } } public class MyCla...

how to use linq on a list<T> to generate a list<lists<T>> in C#

I've seen examples of the reverse question, but they don't help me with this direction. I've got a List where T has an int weight. I'd like to divide this into lists of 5 grouped by weight. if I have the following T's with respective weights A:1 B:2 C:3 D:4 E:5 F:6 G:7 H:8 I:9 J:-11 I want {A,B,C,D,E,F,G,H,I,J} to be sorted to {{J,A,B,...

Converting a list with many items into single item lines in python

Hi, I want to convert lines in a text file from this: animal cat, mouse, dog, horse numbers 22,45,124,87 to this: animal cat animal mouse animal dog animal horse numbers 22 numbers 45 numbers 124 numbers 87 How would I do this conversion in python? Thanks ...

Why is my List<T> not being serialized?

This relates to this question, but this time I'm trying to work out how to serialize the dictionary. I have a class that inherits from Dictionary that I need to be able to serialize. The Serialization methods look like this, basically the values collection from the dictionary are added to the list, which is serialized. [Serializable] p...

How to do design list view like SharePoint 2010 Custom List or Document Library?

I am generation Recent Activity list from SharePoint 2010 site, What i need is ,i have to display the list in a particular page,The UI must be like a SharePoint 2010 Custom List or Document Library, How to design it, Is there any way to do this. ...

(Unintentionally) skipping items when iterating over a list

I have a list and I want to remove from it the items that don't appear in another list. I've tried the following: for w in common: for i in range(1,n): if not w in words[i]: common.remove(w) However, this fails to remove some of the items. Adding print statements for w in common: for i in r...

Convert list to array

Hello, I have functon that convert list in array: void* list_to_array(SList* list) { int i; int array_size = list_get_length(list); void* array[array_size]; for (i = 0; i < array_size; i++) { array[i] = list_get_n_data(list,i); } return *array; } But when i try to test it: int* a = (int*)l...

Splitting a C# List<T> Into Two

I'm using C# and ASP.NET 3.5. Basically I'm retrieving a column of data from a dataset and putting this into a list like so: List<String> dates = new List<String>(); foreach (DataRow rowMonth in myDS.Tables[0].Rows) { string ListedMonthYear = (string)rowMonth[0]; dates.Add(ListedMonthYear); } The retur...

c++ std::copy with type cast to derived class possible?

Hi, I am pretty sure that there is no way around doing this explicitly but I would like to ask nontheless in case there is a better way. I have a base class A and a derived class B, now I have a std::list of A* which point to B*'s and I want to copy this list of A*'s to a std::vector of B*'s so basically I want to do this: std::list<A*>...

Removing objects contained in a List<> from another List<>?

I have an object which is contained within a List<>, I need to remove these from another List<> e.g. List<MyObject> AllElements = new List<MyObject>(); List<MyObject> SearchResults = new List<MyObject>(); ... Do something so that SearchResults contains a subset of the objects contained within AllResults Currently I do this to de...

Sorting IComparable Object Performance in C#

I have designed a class which is basically nothing but an object which stores a large number of properties of a piece of data. I have implemented IComparable in the class. Objects of the class are instantiated and stored in a List. There is an added level of complexity in that certain fields of the object determine on which fields I...

Lists and ICollections

Looking at the interface System.Collections.Generic.ICollection its definition requires that the inheriting member contains the property bool IsReadOnly { get; }. However I then took a look at the class System.Collections.Generic.List which inherits System.Collections.Generic.ICollection and this class does not contain a definition of ...