list

Batch: Do what ThinApp does

Hello, i want my batch file to do something like VMWARE's ThinApp Setup Capture does. So, this is what it basically needs to do: first run a total computer scan at any files, folders, register keys etc, and make a total list of them. after the user wants, it will do everything again and check for the differences between those two lists...

jQuery to add item from one listbox to another and remove it to the same original position

Hi! I have 2 listboxes and a button to add items from #list1 to #list2. I also have a button to remove item from #list2 and add it again to #list1. But, when I remove the selected item, it goes to the end of the #list1. Is there a way to make this removed item return to its original position? Thanks!! ...

How can I shorten List<List<KeyValuePair<string, string>>>?

I want to store an list of key value pair lists in a lightweight structure. This seems too cumbersome. What's better? Does List<Dictionary<string, string>> add much a overhead? What other options are available? ...

How to join a generic list of objects on a specific property

class Person { public string FirstName { get; set; } public string LastName { get; set; } } List<Person> theList = populate it with a list of Person objects How can I get a string which contains all the FirstName of the objects in the list separated by a comma. Eg: John,Peter,Jack A basic solution would be to iterate through ea...

Converting list of integers into a binary "string" in python

I have a list of numbers that i would like to send out onto a socket connection as binary data. As an example, i start off with the following list: data = [2,25,0,0,ALPHA,0,23,18,188] In the above list, ALPHA can be any value between 1 and 999. Initially, I was converting this into a string using hexdata = ''.join([chr(item) for i...

Problem with "ViewHolder" class in android

I have a problem when use "ViewHolder" class. I use "ViewHolder" to improve my List display speech. I think the code is ok, but why It throw exception when "setText" with data from "Cursor". My code here: if(row==null){ LayoutInflater inflater = LayoutInflater.from(context); row = inflater.inflate(R.layout.sbooks_row, null); ...

split generic list

I need to split a list into two equal lists. For Example: I have a list which consists of 10 items. I need to split the list into two equal parts(each with 5 items) I have a list which consists of 9 items sometimes. I need to split the list into two parts(one with 5 items and other with 4 items) Please suggest a solution for this. ...

Reaching end of list in prolog

Hi, I've been given the question: 'Define a predcate ordered/1, which cheks if a list of integers is correctly in ascending order. For example, the goal ordered([1,3,7,11]) should succed, as should the goal ordered ([1,3,3,7]), whereas the goal ordered([1,7,3,9]) should fail. So far I have this: ordered([]). ordered([N, M|Ns]):- ap...

Django Dynamic Drop-down List from Database

Hi...I wanted to develop a Django app and one of the functionalities I'd like to have is dynamic drop-down lists...specifically for vehicle makes and models...selecting a specific make will update the models list with only the models that fall under that make....I know this is possible in javascript or jQuery (this would be my best choic...

Removing duplicate string from List (.NET 2.0!)

I'm having issues finding the most efficient way to remove duplicates from a list of strings (List). My current implementation is a dual foreach loop checking the instance count of each object being only 1, otherwise removing the second. I know there are MANY other questions out there, but they all the best solutions require above .n...

Is there a better way to write new List<string> {"a", "b"}.Contains(str) ?

I want to test whether a certain string is contained in a short list of strings. Currently the code is like this: if (new List<string> { "A", "B", "C" }.Contains (str)) { However, this seems bloated. For instance, iirc, in Java I could simply write {"A", "B", "C"}.Contains(str) which would be much preferable to the above. I'm sure th...

Pythonic way of checking if a condition holds for any element of a list

I have a list in Python, and I want to check if any elements are negative. Specman has the has() method for lists which does: x: list of uint; if (x.has(it < 0)) { // do something }; Where it is a Specman keyword mapped to each element of the list in turn. I find this rather elegant. I looked through the Python documentation an...

How do I list dependent files not currently on the MATLAB path?

I'm trying to find a function (or make one) that lists all the dependent functions, including ones that are not on the MATLAB path. I already tried using depfun(fun) along with all of its flags but it does not list the dependent functions that are not on my paths. Any help would be greatly appreciated. ...

"svn list" ignores externals

hi all i have a directory called 'library' in my SVN tree which uses externals to load libs such as zend framework/smarty/.... im using a self written tool which uses "svn list" where i can select files which should be uploaded to the servers and it seems svn list doesnt load external props and thus the library directory is empty whic...

Improving Python list slicing

I've wondered why extend/append methods of Python don't return a reference to result list. To build string of all combination of list with last element, I would like to write simple: for i in range(l, 0, -1): yield " ".join(src[0:i-1].append(src[-1])) But I've got: TypeError. Instead following code with intermediate variable is us...

fastest way to remove an item in a list

I have a list of User objects, and I have to remove ONE item from the list with a specific UserID. This method has to be as fast as possible, currently I am looping through each item and checking if the ID matches the UserID, if not, then I add the row to a my filteredList collection. List allItems = GetItems(); for(int x = 0; x < all...

how do I extract the 1st element from a ant CSV property..

given a CSV ant property, <property name="module.list" value="mod1,mod2,mod3,mod4,mod5"/> how can I just get the first element (ie "mod1" here)? I want to execute a command that will take in "mod1" as one of the arguments. Moreover.. I cannot modify this original "module.list" property to a list or anything else.. although I can crea...

Ruby: Mailing List library or gem

Can anyone recommend a good gem or library for managing a mailing list with Ruby? No Rails solutions, if possible, please (I don't want to have ActionWhatever dependencies, this will most likely be done with Ramaze). I just need basic features, like management of the list itself (CRUD operations on the user list), plus being able to se...

What basic algorithm to choose for build sorted list? And how to get best perfomance durring adding to sorted list?

For exmple, i have undefined number of a pairs(key, value). And I want to build sorted list during iterate trough this pairs(it is long operation). I think to use a BinaryTree as a sorted structure and build list from tree after iterations. How you think in generally, is this method faster than simple sorting of the list getted from it...

Flex list-controls - maintain remote data

Hello. I have a TileList which represents some remote data. I also have a form which allows me to change the data. And the data may be changed by someone else too. What is the best way to maintain data in the list in an up-to-date state? The simplest option I see is the following: Select an item in the list Edit it in the form Save i...