list

How can I get a first element from a sorted list?

I used Collections.sort(playersList); to sort a List. So, I think playersList is sorted now. But how can I get the first element of the list? playersList[0] does not work. ...

Using the sharepoint stsadm import command fails when list exists

When using the stsadm -o import command in sharepoint I am getting an error relating to a list already existing, the import then seems to fail. Should it not handle this scenario of a list already existing on the destination server? I then used the UI to delete the existing list and ran the import again. It then seemed to fail at the sa...

Filter a Sharepoint List based on current user's profile property

How would you implement the filtering of a list in WSS 3.0 by a current user's profile property. Let's say there is a list with a Department column and I want that list filtered by the current's user department. ...

Can Anyone point me to a Android Market catalog or application list.

I'm up and running in Eclipse, have worked through several tutorials and would like to start developing my first marketable app. Is there anyplace I can find a comprehensive list or catalog of what's available on the Android marketplace? I'd hate to waste a lot of development time building an app that has twelve free versions already a...

Appending item to lists - python

I have a list, let's say, a=[[1,2],[3,4],[5,6]] I want to add to each item in a the char 'a'. When I use: a=[x.append('a') for x in a] it returns [None,None,None]. But if I use: a1=[x.append('a') for x in a] then it does something odd. a, but not a1 is [[1,2,a],[3,4,a],[5,6,a]]. I don't understand why the first call retur...

How to create mapping for a List<SomeNativeType> in FluentNhibernate ?

Hi all, I am trying to create a mapping file for the following Model using Fluent NHibernate. But, I am not sure of how to do the mapping for the List<string> in the mapping file. public class MyClass { public virtual Guid Id { get; set; } public virtual string Name { get; set; } public virtual List<stri...

Merging contents of two lists based on a if-loop

I have a minor problem while checking for elements in a list: I have two files with contents something like this file 1: file2: 47 358 47 48 450 49 49 56 50 I parsed both files into two lists and used the following code to check for i in file_1: for j in file_2: j = j.split() ...

List of dict in Python

Hi everybody, I've got a list of dict in Python: dico_cfg = {'name': entry_name, 'ip': entry_ip, 'vendor': combo_vendor, 'stream': combo_stream} self.list_cfg.append(dico_cfg) I append to my list a lot of dict in the same way. Now I would like to delete one dict and only one dict in this list? What is the best way to proceed? I've ...

List<> own comparer

I have a List where element is: struct element { double priority; int value; } How can I implement my own comparer which allow me sort List by priority ? I try with SortredList... but it don't allow douplicated keys :( Big thanks for help! ...

Python - Nested List to Tab Delimited File?

Hi, I have a nested list comprising ~30,000 sub-lists, each with three entries, e.g., nested_list = [['x', 'y', 'z'], ['a', 'b', 'c']]. I wish to create a function in order to output this data construct into a tab delimited format, e.g., x y z a b c Any help greatly appreciated! Thanks in advance, Seafoid. ...

Generic List created at runtime

Hi... i neeed something like this in C#.. have list in class but decide what will be in list during runtime class A { List<?> data; Type typeOfDataInList; } public void FillData<DataTyp>(DataTyp[] data) where DataTyp : struct { A a = new A(); A.vListuBudouDataTypu = typeof(DataTyp); A.data = new List<A.typeOfDataInL...

List<element> initialization fires "Process is terminated due to StackOverflowException"

I have structs like below and when I do that initialization: ArrayList nodesMatrix = null; List<vertex> vertexMatrix = null; List<bool> odwiedzone = null; List<element> priorityQueue = null; vertexMatrix = new List<vertex>(nodesNr + 1); nodesMatrix = new ArrayList(nodesNr + 1); odwiedzone = new List<bool>(nodesNr + 1); priorityQueue = ...

other way to add item to List<>

In my other question You can see code of my arr structure and PriorityQueue collection. I normally add items to this collection like that: arr.PriorityQueue.Add(new element((value(item, endPoint) + value(startPoint, item)),item)); I am curious that is other way to do this (add element(which is struct) object to List) ? In lambda way f...

I need to order a list that is dependant on another list. how to change both lists?

I have a Matlab program that generates a list x = 6.1692 8.1863 5.8092 8.2754 6.0891 the program also outputs another list aspl = 680 637 669 599 693. The two lists are on equal length and the first element in list x is related to the first element in list aspl. I need to graph the two lists but want list aspl ...

remove a sublist from a list in python

Hi I am looking for a way to remove a sublist from a list. something like this: a=range(1,10) a.remove([2,3,7]) print a a=[1,4,5,6,8,9] ...

F#: how to print full list (Console.WriteLine() prints only first three elements)

Is it possible to print full list without using cycle? I tried: Console.WriteLine([1;2;3;4;5]) and it prints only three first elements: [1;2;3; ... ] ...

not able to add list item between a list using jquery

Hi I m having a ordered list having the structure <ol> <li> </li> <li> </li> <li> <ol> <li> Test </li> <li> another test </li> <li> <a href='#'>Add </a> </li> ...

Can't access a map member from a pointer

Hi. That's my first question :) I'm storing the configuration of my program in a Group->Key->Value form, like the old INIs. I'm storing the information in a pair of structures. First one, I'm using a std::map with string+ptr for the groups info (the group name in the string key). The second std::map value is a pointer to the sencond st...

Searchable list of objects in Java

I want to create a large (~300,000 entries) List of self defined objects of the class Drug. Every Drug has an ID and I want to be able to search the Drugs in logarithmic time via that ID. What kind of List do I have to use? How do I declare that it should be searchable via the ID? ...

PHP Get all subdirectories of a given directory

How can I Get all subdirectories of a given directory (without files and "." or "..") and then use each directory in a function? Thanks. ...