list

Qt Model View for a given populated ro QList

i got a godgiven list of xyz (the code says int, just an example) glued into a QList (to big to move anywhere). How can I create a Model View for that? I allready read the Qt doc which tells me, I have to reimplement data, index, parent, rowCount, columnCount functions. But the preprocessor/compiler cries for more reimplemented functions...

Sorting a list of lists in Python

c2=[] row1=[1,22,53] row2=[14,25,46] row3=[7,8,9] c2.append(row2) c2.append(row1) c2.append(row3) c2 is now: [[14, 25, 46], [1, 22, 53], [7, 8, 9]] how do i sort c2 in such a way that for example: for row in c2: sort on row[2] the result would be: [[7,8,9],[14,25,46],[1,22,53]] the other question is how do i first sort by ro...

python: comparing this row with next row

c1 is a list of lists like this: c1=[[1,2,3],[1,2,6],[7,8,6]] for row in c1: i want to keep track of whether there is a change in row[0] for example: in [1, 2, 3] and [1, 2, 6] there is no change in row[0] however in [1, 2, 6] and [ 7, 8, 6] there is a change in row[0] how do i catch this change? also i would like to know which r...

python: using numpy.histogram

i am using this: http://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram.html i have an list a that i want to use like this: numpy.histogram(a,bins=[0.1,0.2,0.3,0.4...6], range=[0:6]) how do i include a set of bins 0.1 through 6 in 0.1 intervals? how do i specify a range of 0 through 6? ...

python: what does array([...]) mean?

i am working with lists, and there is a function that is returning something that looks like this: array([0, 5, 3, 3, 0, 1, 2]) how do i cast those values into a list? what does array mean? ...

Concise Lisp code to apply a list of functions all to the same argument(s) and get a list of the return values?

Suppose I have a single element, and I have a list of predicates (functions). I want to apply each of these predicates to the single element and get a corresponding list of return values. I know that map and friends can apply a single function to each a list of arguments, but is there any concise syntax to apply many functions to a singl...

Permanently add a directory to PYTHONPATH

Whenever I use sys.path.append, the new directory will be added. However, once I close python, the list will revert to the previous (default?) values. How do I permanently add a directory to PYTHONPATH? Using Windows. ...

I need to list out the Custom list and library from SharePoint Site?

I need to list out the Custom list and library from SharePoint Site? How to identify the content is comes under the custom created? ...

Removing things from Python list during for loop

Here is my code: toBe =[] #Check if there is any get request if request.GET.items() != []: for x in DB: try: #This is removing the PMT that is spcific to the name if request.GET['pmtName'] != "None": if not request.GET['pmtName'] in x['tags']: print x['title'], x['...

jquery toggle on dt element working in Firefox but not other browsers

The following works in Firefox but in no other browser. Is the parent child relationship of <dl>s different in the different browsers? $('dd').parent().find('h3').toggle( function(){ $(this).next('dd').slideDown(500); }, function(){ $(this).next('dd').slideUp(500); } ); HTML looks like: <dt><h3>stuff t...

generic list of value types with sequential layout and pack size -> BUG?!

The following code throws an ExecutionEngineException when I run the release build executable (start exe file). Is this a bug or is it normal behavior? value type with pack size = 1: [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct RunLong { public byte Count; public long Value; public RunLong(byte count, long...

Need help with VB.NET List Logic

Hey guys, so I am creating a List(Of String), always of size 9. This list contains True/False values. I need to go through this list and find the 3 values that are True (will never be more than 3, but could be less) and then set 3 string values in my code to the 3 index's of those values + 1. Here is my current code: Private Sub SetDe...

Format(line wrapping) constructor initializer list in Eclipse CDT

I tried to find a solution for now ~30min and couldn't find any. I am trying to set up the code style in CDT so it gives me: MyClass::MyClass() : var1(1), var2(2), var3(3){ } instead of MyClass::MyClass() : var1(1), var2(2), var3(3){ } but I couldn't find an option to do so. The only 'initializer list' option I could f...

converting uneven hierarchical list to a data frame

I don't think this has been asked yet, but is there a way to combine information of a list with multiple levels and uneven structure into a data frame of "long" format? Specifically: library(XML) library(plyr) xml.inning <- "http://gd2.mlb.com/components/game/mlb/year_2009/month_05/day_02/gid_2009_05_02_chamlb_texmlb_1/inning/inning_5....

c# bind 2 lists to repeater

Hi [c# linq] i have 2 datasources, 1 coming from an xml document and 1 coming from an sql server database, both return an IEnumerable<EventsDetails> is it possible to bind both of these lists to a single repeater? ...

List with a key

Before I embark on writing my own, is there a List like construct that also contains a Dictionary like key? And before someone suggests using a Dictionary instead, the order of items is important to me and Dictionary cannot guarantee a position. So, I'd like to be able to retrieve the item in the following manner: int position = 4; M...

Best way to change list type in scala

Hi all, I have a list in scala called l : List[AType] that I want to change to list[String]. This may sound like a very dirty, inefficient approach, but I'm not quite sure of the best way to do this. My code was: var result = new Array[String]("a","b") l foreach { case a => result = result :+ (a.toString().toUpperCase()); } result toL...

how to randomize Names that is not repeated?

i would like to make a list of names and then make a random selection but all of them should be called. off course not repeated. delphi code ...

value transfer from a list to another

Hallo, I have a problem with value transfer from a list to another in VB2008. I have 2 lists of string with same number of member that reference to their object-collections separately. I want to overwrite memory slots of list1 with the values of list2 without creating new memory slots. How can I do these? Thx. Lert ...

Unpacking argument lists for ellipsis in R

I am confused by the use of the ellipsis (...) in some functions, i.e. how to pass an object containing the arguments as a single argument. In Python it is called "unpacking argument lists", e.g. >>> range(3, 6) # normal call with separate arguments [3, 4, 5] >>> args = [3, 6] >>> range(*args) # call with argumen...