list

Modifying list contents in Python

I have a list like: list = [[1,2,3],[4,5,6],[7,8,9]] I want to append a number at the start of every value in the list programmatically, say the number is 9. I want the new list to be like: list = [[9,1,2,3],[9,4,5,6],[9,7,8,9]] How do I go about doing this in Python? I know it is a very trivial question but I couldn't find a way t...

How can I trigger an itemEditEnd Event in a Flex List when the CheckBox is checked/unchecked?

I have a List component that has drop-in CheckBox itemEditor that also serves as the itemRenderer. It displays each item as a simple CheckBox with a label. However, the itemEditEnd Event does not get triggered until I click on something outside of the List. I want it triggered once the CheckBox is checked or unchecked. I was thinking o...

What does this code do?

while (list($task_id, $parent_id, $task) = mysqli_fetch_array($r, MYSQLI_NUM)) ...

How to hide, disable calendar list item fields in Sharepoint

I want to hide or make some fields read only on editform.aspx. I follwed the example on this page, but without deliting the "original" webpart list. I hide the original webpart and created a new custom list from the original list. Then i was able to apply xsl on the custom list to hide or to make the field "read only". Unfortunately the ...

Having Trouble with Absolute Positioning / Z-Index with Lists and Tables in IE 6 and 7

Hello! I'm creating a prototype of a CSS/XHTML tables-based calendar that eventually will be generated with PHP for the Simple Updates content management system. I've run into a problem with using absolute positioning to create a popup that would show all the events in a day when there are more than will fit in a cell. The problem can b...

using "apply()" with methods that return void in specman

Specman has the apply() method to perform the same action on all elements of a list: var a: list of int; a = somefunction.that.returns.list.of.int(); var b:= a.apply(it * 2); Where apply() does the same as: for each in a { b.add(it.*2); }; Now, if I want to call a method on the elements of a, I can use apply() so long as the me...

Odd generics behaviour of List.toArray(T[])

I came across something very basic but extremely bewildering today. I needed to convert a list to an array. The list contained String instances. Perfect example of using List.toArray(T[]), since I wanted a String[] instance. It would not work, however, without explicitly casting the result to String[]. As a test scenario, I used the fo...

Construct a java.util.List from a java.util.Set in Scala

I would like to create a java List based on another java Collection eg. Set in Scala. Why is this not possible? I get a required: scala.this.Int error. val in: java.util.Set[String] = new java.util.HashSet() val out : java.util.List[String] = new java.util.ArrayList(in) This worked however, but doesn't feel right: val in: java.util....

IndexOf too slow on list. Faster solution?

Hello, I have generic list which must be a preserved order so I can retrieve the index of an object in the list. The problem is IndexOf is way too slow. If I comment the IndexOf out, the code runs fast as can be. Is there a better way, such as a preserved ordered hash list for c#? Thanks, Nate Edit - The order in which the items are a...

How to list source versions using subversion

Hello. I am using svn to download the source code to an open source project. I want to download an older version do to compilation errors and I know you can do that, but I don't know the exact numbers (e.g. 1.2.3) that make up the version. Is there a way svn can list all of the available software versions and when they were published? T...

Can I avoid stating the library name in a SQL query to an AS400?

Gurus, Is there anyway that I can setup my DSN to avoid having the say "LIBRARY.TABLE" in my SQL statements? Our test and production environments differ in that the test AS400 does not have "TABLE" in the same library as production. I don't want to have to change code in moving from test to production. That defeats the purpose. Chri...

C# modify List.Contains behavior

Hi, I have a List<MyObj> with the class MyObj : IComparable. I wrote the method CompareTo in the MyObj class per the IComparable interface, but when I use the List<MyObj>.Contains(myObjInstance) it returns false when it should be true. I'm not sure I'm understanding how I need to proceed to make sure the List uses my custom comparison...

Replacing values in a Python list/dictionary?

Ok, I am trying to filter a list/dictionary passed to me and "clean" it up a bit, as there are certain values in it that I need to get rid of. So, if it's looking like this: "records": [{"key1": "AAA", "key2": "BBB", "key3": "CCC", "key4": "AAA"...}] How would I quickly and easily run through it all and replace all values of "AAA" wi...

JSTL sets ad Lists - checking if item exists in a set

Hello, I have a Java Set in my session and a variable also in the session. I need to be able to tell if that variable exists in the set. I want to use the contains ( Object ) method that Java has for Lists and Sets to test whether that object exists in the set. Is that possible to do in JSTL? If so, how? :) Thanks, Alex ...

One liner to replicate lines coming from a file (Python)

I have a regular list comprehension to load all lines of a file in a list f = open('file') try: self._raw = [L.rstrip('\n') for L in f] finally: f.close() Now I'd like to insert in the list each line 'n' times on the fly. How to do it inside the list comprehension ? Tnx ...

How to send jquery $.post with alert

Hi All I have a problem with following script. It generates a list of places which are editable, deletable or you can even create a new one. I want to send a $.post request when creating a new place to a php file which makes an entry into a database (MySQL) and then lists this entryes in html. Now why doesn't even the $.post send an a...

C# Bind Generic List To Textbox WinForms?

Hello! I have a method that returns a list of type string. I want to bind each item in the list to the textbox so essentially it looks like a listbox, except it will be editable since its actually a textbox! any ideas on how to go about doing this!? CODE: public List<string> GetAgentsDetails(string writeDir) { List<string>...

Add items to list programatically

Hi all, I am using form base authentication in my Sharepoint site. On my login page there are custom fields to be filled by unauthenticated user. These fields i want to add in to my list. I am using following code to insert record in list. protected void AddVendor(object sender, EventArgs e) { string strList = "http://comp01:5353/Li...

Sorting a List of LIst by the Value of the sublist

private List<String> subList; private List<List<String>> records = new ArrayList<List<String>>(); for(....){ subList = new ArrayList<String>(); ...populate.. records.add(subList); } For example, subList has three Strings - a, b, and c. I want to sort the records by the value of b in subList. records at 0 has a list of "...

Android Endless List

How can I create a list where when you reach the end of the list I am notified so I can load more items? Thanks, Isaac ...