list

jQuery selectors for list elements

I am using jQuery and jQuery UI. Using the getJSON function, we are creating list elements and appending them to an OL element. Here's the code: $.getJSON("http://localhost/b/t.php", function(data){ $.each(data, function(i, thet){ //alert(thet.fname) var t = '<li class="name" id="p' + thet.pid + '">' + ...

How to transform HTML table to list with JQuery?

How would I transform a table <table> <tr> <td>Name</td> <td>Price</td> </tr> <tr> <td>Name</td> <td>Price</td> </tr> </table> to a list of paragraphs with jQuery <ul> <li> <p>Name</p> <p>Price</p> </li> <li> <p>Name</p> <p>Price</p> </l...

What is Haskell's Stream Fusion

What is Haskell's Stream Fusion and how do I use it? ...

Horizontal Ordered List (and IE)

I'm looking to generate an output similar to this: 1. One 2. Two 3. Three 4. Four from the following HTML Code <ol> <li>One</li> <li>Two</li> <li>Three</li> <li>Four</li> </ol> It seems that Internet Explorer does not want to display the number's (list-item's) when you float the li's in order to make ...

Convert Collection to List

I am using TreeBidiMap from the apache collections library. I want to sort this on the values which are doubles. My method is to retrieve a Collection view of the values using Collection coll = themap.values(). Which naturally works fine. Main Question: I now want to know how I can convert/cast (not sure which is correct) coll into a Li...

Is it possible to trigger a jQuery click event on a background-image in a list?

I have an unordered list of items, something like this, shortened for brevity: <div id="elementsContainer"> <ul> <li><a>One</a></li> <li><a>Two</a></li> </ul> </div> I have the list styled up, but these 3 styles deal with background images for the list items: #elementsContainer ul li { list-style:none; } #elementsCont...

C#: Declaring and using a list of generic classes with different types, how?

Hi, Having the following generic class that would contain either string, int, float, long as the type: public class MyData<T> { private T _data; public MyData (T value) { _data = value; } public T Data { get { return _data; } } } I am trying to get a list of MyData<T> where each item would be of differen...

WPF List View Sort on Load

Here is the problem: I want to sort a ListView when it is first loaded. I have implemented the functionality where in the List View can be sorted if the Header columns in the ListView are clicked. I unable to find a suitable event which I can use to call my sort function. I tried using OnInitialized of the UserControl and Loaded events...

Best way to create a dynamic Select (Dropdown) list?

I'm using jQuery and jqGrid. I'm trying to populate a select list dynamically, one for each row and I need to add a click event to it. When the select list is being populated I grab the index of the item I want selected, and then after all items are add I'm trying to set the selected item. I've tried $("#taskList")[0].selectedIndex ...

VB.NET List(of X).Contains Behavior

I have a custom class set up as a key that has two properties, X and Y I have something similar to this: Dim test As New List(of TestClass) Dim key as New TestData key._a = A key._b = B For Each a As TestClass In SomeCollection If Not test.Contains(key) Then 'Do Stuff End If Next My question is this: How does the .Contain...

Can you remove elements from a std::list while iterating through it?

I've got code that looks like this: for (std::list<item*>::iterator i=items.begin();i!=items.end();i++) { bool isActive = (*i)->update(); //if (!isActive) // items.remove(*i); //else other_code_involving(*i); } items.remove_if(CheckItemNotActive); I'd like remove inactive items immediately after update them, ...

Java List with blank allowed

Hello, This is probably really simple but I really could not word it properly on Google. See, I have a ArrayList that keeps the info for each thread. Each thread has it's own ID. So, at the beggining: myList.add(theIdOfTheThread, new InfoForTheThread()); //Add new thread info at index theIdOfTheThread And when I want info: myList.get...

Sub-items in ordered lists (for IE6 and IE7)

Hello Stack Overflow, I am attempting to figure out how to create incremented lists with IE6/IE7. E.G. It should look something like below: 1.0 1.1 1.2 1.3 2.0 2.1 2.2 From what I understand, this is possible to create in CSS with something like this: UL, OL { counter-reset: item; } LI { display: block } LI:be...

SharePoint List Item Not Returning Fields

Hi I have a question about SPListItem and how to retrieve values from it. In the view I am in I can access the "Article" no problem but when I try to access the "Link" I can an error saying object not initalized. I don't understand whats going on? Why can I not get the Link when I can get the Article field. Here is the code I am usin...

SharePoint List Error: "Value does not fall within the expected range"

Hi I am developing using the SharePoint namespace and I ran into the following error when I try to retrieve a URL column from one of my lsits. "Value does not fall within the expected range" All I am doing is: item["URL"] Can someone tell me what I can do about this? ...

What's the most efficient way to find the length of the longest item in a list?

Given a list of assorted length words, what is the best way to find the maximum length of any words? For example, the following should return 6 findMaxLen("a,set,of,random,words") Of course, it's fairly trivial to do this... <cffunction name="findMaxLen" returntype="Numeric"> <cfset var CurMax = 0 /> <cfset var CurItem = 0...

What's the easiest way to rename the columns of a DataGridView showing a List<T>?

I have a DataGridView, whose DataSource I am setting to a List<T>. T in this case is a class with a property called Foo, whose header I want to show as Foo bar. If it was a datatable, I could just change the query: select Foo as [Foo bar] from Baz But with something like this, where I'm setting the DataGridView's DataSource to a List...

How can I get the list of a columns in a table for a SQLite database?

I am looking to retrieve a list of columns in a table. The database is the latest release of SQLite (3.6, I believe). I am looking for code that does this with a SQL query. Extra bonus points for metadata related to the columns (e.g. length, data type, etc...) ...

Creating lists using yield in Ruby and Python

I'm trying to come up with an elegant way of creating a list from a function that yields values in both Python and Ruby. In Python: def foo(x): for i in range(x): if bar(i): yield i result = list(foo(100)) In Ruby: def foo(x) x.times {|i| yield i if bar(i)} end result = [] foo(100) {|x| result << x} Although I love ...

SharePoint Registration Form - How to Hide Fields

I created a basic registration form using a SharePoint 2007 custom list where users complete fields on the form. I created an 'Approver' field that I'm trying to hide from customers so that only the form's approver will edit that field (approve the request - Customers tend to approve their own request). How can I hide this approval field...