list

Flex 3: scrolling of list items with in a list via scroll wheel

Here is a snip from within my code: <mx:Panel id="recPanel" title="I have the following helpful recommendations for you:" verticalScrollPolicy="off" width="100%" height="180"> <mx:List dataProvider="{recommendations}" wordWrap="true" variableRowHeight="true" verticalScrollPolicy="auto" width="100%" height="100%" /> </mx:Panel> The...

Does a list<> store a reference to the property or instance?

When adding to a list, if I add the property of a class instance, is it set to a reference of the property's value or a reference to the property? Example: If I have: class A { public Action<Guid> SomeDelegate { get; set; } } And in a different class I create an instance of class A, ie: class B { public B() { a ...

Remove row or column from 2D list if all values (in that row or column) are None

I have a grid (6 rows, 5 columns): grid = [ [None, None, None, None, None], [None, None, None, None, None], [None, None, None, None, None], [None, None, None, None, None], [None, None, None, None, None], [None, None, None, None, None], ] I augment the grid and it might turn into ...

Slice like functionality from a List in F#

With an array let foo = [|1;2;3;4|] I can use any of the following to return a slice from an array. foo.[..2] foo.[1..2] foo.[2..] How can I do the same thing for List let foo2 = [1;2;3;4]? When I try the same syntax as the array I get error FS00039: The field, constructor or member 'GetSlice' is not defined. What's the preferred ...

C# - Iterate through given type elements inside a List<T>

I've got an abstract class (Object2D), and several class that inherits Object2D (DisplayObject2D for instance) I use a List to store all references to these objects. I'd like to iterate through every DisplayObject2D in this List. So far, the following code is working, but being new to C# development, I wanted to know if there wasn't a...

ruby on rails: how to change BG color of options in select list

Hi, I want to pull list of colors from model and put the color select list in the view. Options have value as color code. I want to change the background color of options same as its value. Below are two ways I tried to do but it comes out that it changes color for whole select list but not for individual options with individual colors....

Alternatives to keeping large lists in memory (python)

If I have a list(or array, dictionary....) in python that could exceed the available memory address space, (32 bit python) what are the options and there relative speeds? (other than not making a list that large) Let me emphasize "could". The list could exceed the memory but I have know way of knowing before hand. If it started to exceed...

Java: How to create an array of objects which include arrays?

Hi, I would like to create a list objects called Product (Listproducts) where Product includes the following members: public class Product { private Double price; private String title; private String description; private List<Point>points; ... } Point is another object which includes latitude and longitude: public class Point{ Doub...

How to un-nest nested lists in php

I have a nested unordered list like this (simplified version / the depth is variable) : <ul> <li> <a href="#">Root</a> <ul> <li> <a href="#">Page A</a> <ul> <li> <a href="#" title="Page A1">Page 1 2</a> </li> ...

Python Working with lists based on indexes

I have data in a CSV file. One of the column lists a persons name and all the rows that follow in that column provide some descriptive attributes about that person until the next persons name shows up. I can tell when the row has a name or an attribute by the LTYPE column, N in that column indicates that in that row the NAME value is a...

Map list onto dictionary

Is there a way to map a list onto a dictionary? What I want to do is give it a function that will return the name of a key, and the value will be the original value. For example; somefunction(lambda a: a[0], ["hello", "world"]) => {"h":"hello", "w":"world"} (This isn't a specific example that I want to do, I want a generic function li...

.NET: Combining two generic lists.

Let's say I have two generic lists of the same type. How do I combine them into one generic list of that type? ...

Qt - Dynamic list stuff

I'm fairly new to Qt4.5, and I'm unsure of the approach I should take to the following problem. I'm trying to create a QListWidget style widget, that can dynamically expand to an arbitrary length, probably no more than 300 elements. I tried to use the QListWidget, but I need to store three QStrings per line, and QListWidget is fairly l...

list onclick event problem in php

I'm trying to display the new dynamic list by clicking dynamic list. Why do i call them dynamic list? Because the data is from database. My idea is generating a list of companies, when i click one company, a list of all sites in the company is displayed; And then when i click the one site of one company, a list of all employees in the ...

Latex: How can I create nested lists which look this 1.1, 1.1.1, 1.1.2, 1.2 ...

How can I create lists which look this: 1. Topic 1.1 First Subtopic 1.2 Second Subtopic I tried using the enumeration list \begin{enumerate} \item Topic \begin{enumerate} \item First Subtopic \item Second Subtopic \end{enumerate} \end{enumerate} But the output looks like: 1. Topic (a) First Subtopic (b) Second Subtopic So ...

How to get the difference between two list based on substrings withing each string in the seperate lists.

I have two long list, one from a log file that contains lines formatted like 201001050843 blah blah blah <[email protected]> blah blah and a second file in csv format. I need to generate a list of all the entries in file2 that do not contain a email address in the log file, while maintaining the csv format. Example Log file contains: 2...

Convert List<Cookie> to CookieCollection in C#

Let's say I have List<Cookie> and I want to convert it to a CookieCollection. What's the easiest way to do this? I know I can use a foreach loop, but isn't there a way to instantiate it with code similar to this? List<Cookie> l = ...; var c = new CookieCollection() { l }; When I try to compile that though, I get the error: The be...

Powershell script to delete files not specified in a list

I have a list of filenames in a text file like this: f1.txt f2 f3.jpg How do I delete everything else from a folder except these files in Powershell? Pseudo-code: Read the text file line-by-line Create a list of filenames Recurse folder and its subfolders If filename is not in list, delete it. Thanks in advance. ~HP ...

jQuery add class to certain elements

[EDIT] : Sorry guys, the whole post didn't go through. Here is the correct post. Hi, I have a multilevel menu like this : <ul> <li>item 1 <ul> <li>item 1.1</li> <li>item 1.2</li> </ul> </li> <li>item 2</li> <li>item 3 <ul> <li>item 3.1</li> <li>item 3.2</li> </ul> </li> <li>item 4</...

Display random choice (Python)

I have a list[] of items from which I'd like to display one randomly, but the displayed item must not repeat more than once in last x requests. list1 = item1, item2, item3, item4, item5, item6, item7, item8, item9, item 10 Display a random selection from the list above list2 = store the last displayed item in list2 which should only...