list

c# XmlSerializer serialize generic List of interface

I'm trying to use the XmlSerializer to persist a List(T) where T is an interface. The serializer deos not like interfaces. I'm curious if there is a simple way to serialize a list of hetrogenous objects easily with XmlSerializer. Here's what I'm going for: public interface IAnimal { int Age(); } public class ...

Add extra class for <li>

$string = '<ul> <li id="34334" class="some_class"><a href="/stack/">Text</a></li> <li id="someid" class="more_class"><a href="/overflow/">Text</a></li> </ul>'; What I need (actually don't know how to do, please help): We must check <a> inside each <li> If href of <a> == /stack/, then add extra class current for parent <li> ...

Creating a list with >255 elements

Ok, so I'm writing some python code (I don't write python much, I'm more used to java and C). Anyway, so I have collection of integer literals I need to store. (Ideally >10,000 of them, currently I've only got 1000 of them) I would have liked to be accessing the literals by file IO, or by accessing there source API, but that is disallow...

Parsing indeterminate amount of data into a python tuple

I have a config file that contains a list of strings. I need to read these strings in order and store them in memory and I'm going to be iterating over them many times when certain events take place. Since once they're read from the file I don't need to add or modify the list, a tuple seems like the most appropriate data structure. Howe...

How can I build Hierarchical Html List from Dataset?

I am getting following output in Dataset ActivityID ParentActivityID ActivityName AcivityLevel 0 NULL Dashboard 0 1 NULL Market Trends 0 2 1 News 1 3 NULL Master 0 4 3 Products 1 5 3 Segments 1 6 3 ...

Pure CSS drop down menu issue in IE 6 and 7

Hey Guys, I've seen a few hints on StackOverflow but cant really see a solution to my specific problem. I have a pure css menu with dropdowns, in IE8 and FF it works great, but compatibility mode for IE7 and IE6 it doesnt work. The thing is, it does drop down - but then when the mouse goes over the main website banner below, which has ...

Using Dictionary

Hi, I need to write a script which merges a list with a dictionary to create a third dictionary. I'm pretty new to programming and am struggling with the basics here. So far I've created the following class which generates a list of dates. I have another class which generates a dictionary and I want to basically create a third dictiona...

Segmentation fault on list.begin()

I have this member function in my Folder class: string _recFullPath() { list<Folder*> folders; list<Folder*>::iterator it = folders.begin(); folders.push_front(this); it = folders.begin(); while((*it)->hasParent()) { folders.push_front((*it)->parent()); it = folders.begin(); } folders.push_back(this); for(it = folders.begin(...

List files in a remote folder given the URL

Hello, I have a questions, and I would love you to try to answer it. Is it possible to get the list of files from a remote folder in java, knowing just the URL??? for example: http://localhost/img get all the images names in this directory. Thanks in advance ...

Counting unique elements in a list

Is there a straight-forward combination of standard higher-order funtions to count the unique elements in a list? For example the result for [1, 1, 4, 0, 4, 4] would be something like [(1,2), (4,3), (0,1)] ...

C++ STL list operator overloading for pairs (sorting according to first value, accessing with second value)

Hello I have some touble overloading operators for std::list. I store pairs in a list, consisting in an int value and a position array : typedef std::pair< int, std::vector<int,3> > pointPairType; typedef std::list< pointPairType > pointListQueueType; pointListQueueType pointsQueue; // adding some points to the list And I wou...

LINQ Comparing Two Lists - Add new, remove old, leave the ones in common

I have two lists (L1,L2) of an object A, L1 is used to store the list of objects(many to many relationship) before they are changed. L2 is the relationship after it has been changed. I need to keep the common elements but add the new ones and remove the ones that aren't in L2. I was wondering if there was a one liner I could use with LIN...

How to create a generic List with a dynamic object type

I want to create a generic list of the Type object. I have ... Type type = typeof(Foo); object model = GetModel(); Now I want to create a new List<Foo>((Foo)model) Is this possible in C#? ...

Problem setting default selection on a Flex 3 List

Hi I've got a list and the selectedIndex doesn't seem to have any effect. Is the alternatingItemColors causing a problem? I've got a panel with this list and a few radio buttons. I've set the defaults on the radio buttons, but I'm having problems setting 2010 as the default selection in the list. <mx:List id="myList" w...

List(of String) in structure in vb.net

How would I make use of a List(of String) in a structure in vb.net. for example Structure examplestrut Public exampleslist As List(Of String) End Structure How would I call exampleslist.add("example 1")? ...

Is there a way to compare two list of dicts in python?

I have a 2 list of dictionaries. The first list contains sphere definitions in terms of x, y, z, radius. The second list contains various points in space as x, y, z. These lists are both very long, so iterating over each list and compare against all values is inefficient. I've been trying the map and reduce terms, but both of them take...

I get the "FilenotfoundExceptionunhandled" ? in Console application while displaying the SharePoint site list name

Error Details: The Web application at http://dev001aaamaaind:333/ could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application. string urlSite = "http://dev001aaamaaind:333/"; usi...

How to find newly added item in the share point site??

How to find the recently added item in the share point page If the any user added the items in the custom list, library, list,Announcement, Picture library,etc......... i need to show all item that added last 2 days. Is that any object model available to find all item in the share point site???Instead of searching every list. ...

Access List from another class

Hi, can anyone tell me how to create a list in one class and access it from another? ...

How to space nav buttons equally in Sitefinity radmenu

Hi Guys, I have a Radmenu which has 6 buttons in it which need to have equal spacing between them in my horizontal menu. I have managed to get this right using a percentage value but what if someone decides to add another menu button? Is there a way of aligning my UL menu in the middle of my wrapping DIV and then spacing the buttons eq...