list

Captured variable in C# function with a List<> parameter

I have the following sample codes. I don't like to have lTest being captured and get the same value as lRet. I tried to introduce "List<Test> lTest1 = lTest0;" in the function AddMore2Test. It does not work. What is the proper way to do this? Thanks! Codes - private void Test(){ List<Test> lTest = GetInitTestList(); List<Test...

IE7 ul display:none/block problem

Hi to all. I've got a strange problem with IE7. This is my html: <div class="nav square"> <div> <ul> <li><a href="#square" class="square_lk">[b] square</a></li> <li><a href="#history" class="history_lk">[b] history</a></li> </ul> </div> ...

Python code refactoring question. Simplification.

I have code that looks something like this: self.ui.foo = False self.ui.bar = False self.ui.item = False self.ui.item2 = False self.ui.item3 = False And I would like to turn it into something like this: items = [foo,bar,item,item2,item3] for elm in items: self.ui.elm = False But obviously just having the variables in the list ...

Checkbox List in JDialog

I'm trying to use a JDialog box that has a search text field that as text is entered, it shortens a list to those that match. On this list I would like to display each line with a checkbox that can be selected. I might also want the ability for it to function like a select all list where Ctrl + Click on the line would select the item an...

different views on a single list ( Android )

Hi, Is there a way to make a list with different views? I mean that row in posiotion X will have layout "X.xml" and row number Z will have layout "Y.xml"? I've tried to manipulate ListRowAdapter() and getView() in a few ways but with no success... ...

Background images in list items not showing in IE7

What is it that I am not understanding about IE7 and background images in list items? I'd like to understand this once and for all please because I run into this problem a lot and only get it right with severe hacking. Please take a look at this link, the link menu items in the left and right column are not showing and I am not sure wha...

How to sort a list of inter-linked tuples?

lst = [(u'course', u'session'), (u'instructor', u'session'), (u'session', u'trainee'), (u'person', u'trainee'), (u'person', u'instructor'), (u'course', u'instructor')] I've above list of tuple, I need to sort it with following logic.... each tuple's 2nd element is dependent on 1st element, e.g. (course, session) -> session is dependent...

Convert array to string

Hello. I have a reeeealy huge string, which looks like ['elem1','elem2',(...)] and contains about 100 000(!) elements. What is the best method to change it back to list? ...

C# List<T> internals

What exactly happens when adding an object to a collection such as List? List<Person> people = new List<Person>(); Person dan = new Person() { Name="daniel", Age=10 }; people.Add(dan); dan = new Person() { Name = "hw", Age = 44 }; When I execute the above code, the List<Person> peopledoes not get affected by final line. So I am assumi...

add Items to Sencha Nested List

Hi i got a Problem with adding new Items to a Sencha Nested List Component. currently my code looks like this: var newItem = nestedList.add({text:rowData.name}); nestedList.doLayout(); The Problem is the Items just wont show up no matter how often on on what i do call doLayout. When in debug the nestedList Object, the items are corre...

Python splitting list based on missing numbers in a sequence

I am looking for the most pythonic way of splitting a list of numbers into smaller lists based on a number missing in the sequence. For example, if the initial list was: seq1 = [1, 2, 3, 4, 6, 7, 8, 9, 10] the function would yield: [[1, 2, 3, 4], [6, 7, 8, 9, 10]] or seq2 = [1, 2, 4, 5, 6, 8, 9, 10] would result in: [[1, 2], [4, ...

How do I get the index of the largest list inside a list of lists using Python ?

I am storing animation key frames from Cinema4D(using the awesome py4D) into a lists of lists: props = [lx,ly,lz,sx,sy,sz,rx,ry,rz] I printed out the keyframes for each property/track in an arbitrary animation and they are of different lengths: track Position . X has 24 keys track Position . Y has 24 keys track Position . Z has 24 ke...

Creating lists and sets in Scala: What do I actually get?

If I create a Set in Scala using Set(1, 2, 3) I get an immutable.Set. scala> val s = Set(1, 2, 3) s: scala.collection.immutable.Set[Int] = Set(1, 2, 3) Q1: What kind of Set is this actually? Is it some hash-set? What is the complexity of look-ups for instance? Q2: Where can I read up on this "set-creating" method? I thought that it w...

Can list.findall reference a variable?

Such as: mylist.FindAll(Function(item) item.property = variable) The reason I ask is if I use syntax like this, I tend to get a string to whatevever conversion error, which makes me think "variable" is being treated literally as a string. Thanks. ...

Python code refactoring question. Applying functions to multiple elements

I have code that looks something like this: self.ui.foo.setEnabled(False) self.ui.bar.setEnabled(False) self.ui.item.setEnabled(False) self.ui.item2.setEnabled(False) self.ui.item3.setEnabled(False) And I would like to turn it into something like this: items = [foo,bar,item,item2,item3] for elm in items: self.ui.elm.setEnabled(Fa...

Search list of objects based on object variable

I have a list of objects. These objects have three variables, ID, Name, & value. There can be a lot of objects in this list, and I need to find one based on the ID or Name, and change the value. Example class objec { public string Name; public int UID; public string value; } List<objec> TextPool = new List<objec>(); How ...

F# under SharpDevelop

Ok this is rather frustrating, I;ve installed the latest version of SharpDevelop, and also installed the F# compiler (as per the link from SharpDevelops website) I am running in Vista. thus far, everything has been working fine. But for some reason it simply refuses to compile when I try to use List.fold_left, however List.fold seems ...

Trying to get VB anonymous methods working. querying lists

I am trying to get my code working as per the instruction on http://www.paulstovell.com/vb-anonymous-methods So far I have the wrapper: Public Delegate Function PredicateWrapperDelegate(Of T, A)(ByVal item As T, ByVal argument As A) As Boolean Public Class PredicateWrapper(Of T, A) Private _argument As A Private _wrapperDelegat...

C# in Visual Studio: How to display a list in a DataGridView? Getting weird stuff

Hi Everybody - Been a while and I've volunteered to teach myself Windows programming at my company. Started writing vbs scripts and suddenly realized how incredibly useful this programming thing is ;-) Anyway, I'm a total newbie at C# AND Visual Studio, I kind of get how it works, you drag and drop interface pieces in the design side t...

List of PID's in Erlang

Long story short I am trying to replicate the Sleeping barber problem in Erlang. In my solution I decided that for all the processes that are waiting I would put them into a list. Then, once it was that processes turn, I would take that PID off of the list. Unfortunately when I call length(myListOfPids). it fails, as an example: ...