list

Using Linq to select a list of Entities, linked Entities, linked Entities

Apologies for the poor question title - I'm not sure how to describe what I'm doing but that is the best I could come up with, please edit it if what I'm asking for has a real name! I have Programmes, which can have a group of Projects assigned, which in turn have groups of Outputs assigned. I would like to get all the outputs for the ...

Extending a Prolog goal through recursion?

I've implemented (finally) a few goals that will schedule a series of tasks according to a startBy startAfter and duration. The schedule goal however, accepts only the prescribed number of tasks. I'd like to extend the functionality of the schedule goal to accept a single list and iterate through that list while scheduling. unfortunatel...

Delphi - How to free an object that belongs to 2 (or more) Lists

Hi all, In the project I am working on, there are cases where more than one TList objects contain the same item object. Essentially, there is a master list which contains all the item objects, then smaller lists that contain only a subset of all the items. The items are the same however, not a copy. Where the problem arises is during ...

Flatten (an irregular) list of lists in Python

Yes, I know this subject has been covered before (here, here, here, here), but AFAIK, all solutions save one choke on a list like this: L = [[[1, 2, 3], [4, 5]], 6] where the desired output is [1, 2, 3, 4, 5, 6] or perhaps even better, an iterator. The only solution I saw that works for an arbitrary nesting is from @Alabaster Codi...

How to show list of objects in a table in ASP.NET MVC?

I've new to ASP.NET MVC and .NET in general, so just got a simple question. I want to display a list of objects on the web page, what's the best way to do it? The models so far are as follow: public class NoticeBoard { public List<Notice> Notices; public NoticeBoard() { Notices = new List<Notice>(); } } public...

Is it possible to deserialize xml to List object using .net provided serialization attributes?

I have xml input which looks like (simplified version used for example): <Student> <Subject> History </Subject> <Subject> English </Subject> </Student> Is there a way to get the above xml deserialized to a object whose class looks like: [Serializable] [XmlRoot(ElementName = "Student", Namespace="")] class Student { public Student()...

Making a list of every separate line with jQuery

Hello. I'd love to know that how to create a list from block of text. Let me explain.. Here's my html: <div class="asd"> well worth it </div> And this should be automatically converted to list like this: <div class="asd"> <ul> <li>well</li> <li>worth</li> <li>it</li> </ul> </div> Hope you understood :-D I've already tried it with...

how to display files inside directory

i am trying to get list of files inside the directory in this case "c:\dir\" (ofcourse i have files inside) and i wanted to display the name of those files in console program build in c#.... initially i did this.... static class Program { static void Main() { string[] filePaths = Directory.GetFiles(@"c:...

Sharepoint: rename column (field) with C#

I want to rename a column (field) of some list with C#. How do I do this? Resetting 'Title' property or something else doesn't work. ...

help with linked lists implementation

Hi, I'm trying to make a Stack using an underlying linked list structure. Maybe I'm wrong, but I'm having trouble with the remove() function. int Stack::remove(){ node* victim = new node; int popped; popped = top->element; victim = top; top = victim->next; delete victim; return popped; } I'm getting glibc ...

Filtering SharePoint list item on version number

I need to filter a sharepoint list based upon the version number of the list items. I only want to see items where the version number is say greater than 50. When I apply such a filter to the list, the result is incorrect. I get all items where the first digit of the version number is greater than the first digit of the filter value, s...

Using list comprehension in Python to do something similar to zip()?

I'm a Python newbie and one of the things I am trying to do is wrap my head around list comprehension. I can see that it's a pretty powerful feature that's worth learning. cities = ['Chicago', 'Detroit', 'Atlanta'] airports = ['ORD', 'DTW', 'ATL'] print zip(cities,airports) [('Chicago', 'ORD'), ('Detroit', 'DTW'), ('Atlanta', 'ATL')] ...

Center a list vertically in a div

I want my navigation links to be in the middle of the parent div, vertically. How do I do that? HTML: <div id="nav"> <ul> <li><a href="#">Link</a></li> <li><a href="#">Link</a></li> <li><a href="#">Link</a></li> <li><a href="#">Link</a></li> </ul> </div> CSS: #nav { background: #8DC3E9; w...

List multiplication

Hi, Python newbie here. I have a list L = [a, b, c] and I want to generate a list of tuples : [(a,a), (a,b), (a,c), (b,a), (b,b), (b,c)...] I tried doing L * L but it didn't work. Can someone tell me how to get this in python. ...

Python __init__ argument problem

I have some trouble understanding what happens with class init arguments that are lists like: class A(object): def __init__(self, argument=[]): self.argument = argument[:] or: def __init__(self,argument=None): self.arguments = arguments or [] or: def __init__(self, argument=[]): self.argument = argume...

Get first list index containing sub string in Python

For lists the method list.index(x) returns the index in the list of the first item whose value is x. But if I want to look inside the items, and not just at the whole items, how do I make the slickest Python method for this? For example, with l = ['the cat ate the mouse','the tiger ate the chicken','the horse ate the straw'] this fun...

How to compare literals in COUNTIF

Named lists in an excel sheet are referenced from another sheet on the same book. E.g. Sheet 2 has the named lists(GRPCNT) contain strings > 5 5 - 9 10 - 20 > 20 Sheet 1 uses GRPCNT to provide a list of options. Say, there are three rows A | > 5 B | > 20 C | > 5 Sheet 1 has to determine the number of occurrences of each option f...

HTML list to array

How can I parse multilevel HTML list and get an array by php ...

How to create nested lists in python?

I know you can create easily nested lists in python like this: [[1,2],[3,4]] But how to create a 3x3x3 matrix of zeroes? [[[0] * 3 for i in range(0, 3)] for j in range (0,3)] or [[[0]*3]*3]*3 Doesn't seem right. There is no way to create it just passing a list of dimensions to a method? Ex: CreateArray([3,3,3]) ...

Scala objects not changing their internal state

I am seeing a problem with some Scala 2.7.7 code I'm working on, that should not happen if it the equivalent was written in Java. Loosely, the code goes creates a bunch of card players and assigns them to tables. class Player(val playerNumber : Int) class Table (val tableNumber : Int) { var players : List[Player] = List() def...