list

Output List content using ICEFaces

Hello, I want to show a List using ICEFaces, and I want to output it like: TAG1, TAG2, TAG3. But without using , or <% for (...) { ... } %>, is there a way to do this? Thanks! ...

Better way to remove matched items from a list

In c#, when I want to remove some items from a list, i do it in the following way, List<Item> itemsToBeRemoved = new List<Item>(); foreach(Item item in myList) { if (IsMatching(item)) itemsToBeRemoved.Add(item); } foreach(Item item in itemsToBeRemoved) { myList.Remove(item); } Is there any better way to do it? ...

Python: List initialization differences.

I want a list full of the same thing, where the thing will either be a string or a number. Is there a difference in the way these two list are created? Is there anything hidden that I should probably know about? list_1 = [0] * 10 list_2 = [0 for i in range(10)] Are there any better ways to do this same task? Thanks in advance. ...

Batch/CMD: Adding files to Startup list

Hello, How can a batch file lists itself in the startup list of Windows??? It doesn't matter if it goes from the registry or not. IF with the registry, please give also the command to DELETE the registry entry. This should work under all versions from ME to 7 please. Otherwise just XP/Vista/7. Thanks. ...

C# : instantiate a List, given a reference to a Type

Suppose that, in C#, myType is a reference to some Type. Using myType only, is it possible to create a List of objects of myType ? For example, in the code below, although it is erroneous, I'd like to instantiate via new List <myType> ( ) . using System ; using System.Reflection ; using System.Collections.Generic ; class MyClass ...

Python search in lists of lists

Hi, I have a list of two-item lists and need to search for things in it. If the list is: list =[ ['a','b'], ['a','c'], ['b','d'] ] I can search for a pair easily by doing ['a','b'] in list Now, is there a way to see if I have a pair in which a string is present in just the second position? I can do this: for i in range (0, len(l...

Is there a O(nlog(n)) algorithm for inverting a simply linked list?

In comments to this answer an idea is brought up that inverting a simply linked list could only be done in O(nlog(n)), not O(n) time. This is definitely wrong – an O(n) inversion is not a problem - just traverse the list and change pointers as you go. Three temporary pointers are required - that's constant extra memory. I understand co...

c# loop fails when adding object to list!

hey, this i have a loop that adds gathered strings and ints into an object, and then adds that object into a list. I need it to check if there is already an object with a property == to the one i'm about to assign, and then depending on which the property is, I either want to change one of its properties, or still add a new object. I'll ...

Link two sharepoint columns together

I have two lists in SharePoint. One is a Server/Device list, the other is an IP Address list. I would like to pre-populate the IP Address list, and then, on the server/device list select the IP address(s) assigned to that server. After that, I'd like the "Device" column on the IP Address list to reflect which device is using it. Is it ...

How do you get a list of MS Access data types?

Hello! I am trying to list data types from Microsoft Access 2000-2007 (depending on the MS Access database version) in a combobox for a C# program. How can I achieve such a thing? ...

Which one is more effecient : List<int> or int[]

Hi, Can some one tell me which one is more efficient between List and int[]. Because I am working on a project and as you might know efficiency is way so important concern now. Thanks in advance. If you added some introductory note to your post, it'd be great tho :) ...

In R, what is the difference between the [] and [[]] notations for accessing the elements of a list?

R provides two different methods for accessing the elements of a list or data.frame- the [] and [[]] operators. What is the difference between the two? In what situations should I use one over the other? ...

lists in structs in F# ?

Hi I'm very new to F# and I'm trying to make a struct for storing polygons, and it has to contain a list of coordinates: type Polygon = struct val Coords : list new(list_of_Coords) = { Coords = list_of_Coords } end but Visual studio says "The type 'Microsoft.FSharp.Collections.list<_>' expects 1 type argument(...

Limit width of custom list itemrenderer in Flex

I'm using a custom itemrenderer to display a list of photos and need to know how to control the width. At the moment it does this: Which, as I'm sure you'll agree, is eye-bleedingly ugly. The list is created like this: <mx:Panel width="100%" height="100%" layout="absolute" title="Photos"> <mx:List x="0" y="0" width="100%" height...

PHP automatic list creation from a textfile to (X)HTML

Hi all people! I'm creating a CMS as you might already know, and now I have a lil' problem. Lets say: I have a textfile containing this: [b]Some bold text[/b] [i]Italic[/i] - List item 1 - List item 2 - List item 3 # List item 1 # List item 2 # List item 3 And I want to convert it to: <b>Some bold text</b> <i>Italic</i> <ul> <l...

How to iterate through a list that is being modified?

I have a list of rows from a dataset that I need to iterate through. The problem is that the processing in the iteration may delete one or more rows from the list. Since the list is being modified, I can't use a foreach() loop. But since it is possible some of the deletions may occur at elements BEFORE the one I'm processing, I also ...

searching a list object

I have a list: Dim list As New List(Of String) with the following items: 290-7-11 1255-7-12 222-7-11 290-7-13 What's an easy and fast way to search if duplicate of "first block" plus "-" plus "second block" is already in the list. Example the item 290-7 appears twice, 290-7-11 and 290-7-13. I am using .net 2.0 ...

Preferred way to "move" an object between lists

I have two separate lists of entities: class EntityCollection : IList<Entity> { //... } EntityCollection Foo; EntityCollection Bar; I want to implement an operation to move an object Qux that is on list Foo to Bar. What's the best way to implement it? As a MoveTo instance method on EntityCollection: public void MoveTo(EntityCo...

Value of the last element of a list

Hi, how to get the value of the last element of a List? I've noted that List.hd (or .Head) return an item, while List.tl (or .Tail) returns a List. Is rev the List and get the hd the only way around? Thanks. ...

Is List-Comprehension any better than List-Abstractions?

Why do people prefer list comprehensions like (for [x '(1 2 3)] (* 2 x)) instead of (map #(* %1 2) '(1 2 3))? Are there benefits to this kind of programming? 1. Is it more readable? 2. Is it faster in some cases? 3. Is it better for certain kinds of operations and data structures? ...