list

Scheme Compare item or list if it's inside the test list (can be nested)

Another hw question, here is what I have so far. My Goal is to make the function part? return true if a list or an item is inside the nested list. But so far I can only get it working with signal item inside a first order list. (not nested list yet) (define part? (lambda (item l) (and (not (null? l)) (or (= item (car l...

Wordpress : List posts in category on '.com/categoryname' and display post on '.com/categoryname/post-name'

I have a permalink structure of /%catergory%/%postname%/. When I go to blah.com/categoryname I want all posts in that specific category to be listed. When I go to blah.com/categoryname/post-name I want just the specific post to be displayed. I have made a category specific template (category-5.php) and have got as far as... // Display...

Efficient method to determine location on a grid(array)

I am representing a grid with a 2D list in python. I would like to pick a point (x,y) in the list and determine it's location...right edge, top left corner, somewhere in the middle... Currently I am checking like so: # left column, not a corner if x == 0 and y != 0 and y != self.dim_y - 1: pass ...

ASP.NET - Grid View and List View with Paging

Hi, We are working on Grid View and List View controls in an ASP.NET application. To provide better performance we planned to provide pagination with 10 records display, at a time. We does not want to get all the records from database (at a time) and bind them to these controls i.e. we need to get only 10 records at a time from databas...

Why does my Perl print show HASH(0x100a2d018)?

Here I am thinking I know how to use lists in Perl, when this happens. If I do this (debugging code, prettiness not included): #! /usr/bin/perl -w use strict; my $temp1 = "FOOBAR"; my $temp2 = "BARFOO!"; my @list = { $temp1, $temp2 }; print $temp1; #this works fine print $list[0]; #this prints out HASH(0x100a2d018) It looks like I...

List of Lists in python?

I need a good function to do this in python. def foo(n): # do somthing return list_of_lists >> foo(6) [[1], [2,3], [4,5,6]] >> foot(10) [[1], [2,3], [4,5,6] [7,8,9,10]] NOTE:Seems like my brain has stopped functioning today. ...

How to remove specific element on List

How to remove specific element on List? ... java.util.List<Polygon> triangles = new LinkedList<Polygon>(); Point startDrag, endDrag, midPoint; Polygon triangle; .... int[] xs = { startDrag.x, endDrag.x, midPoint.x }; int[] ys = { startDrag.y, startDrag.y, midPoint.y }; triangles.add( new Polygon(xs, ys,3)); .... public void mo...

scala - Getting a read-only sublist view of a List

I would like a List, Seq, or even an Iterable that is a read-only view of a part of a List, in my specific case, the view will always start at the first element. List.slice, is O(n) as is filter. Is there anyway of doing better than this - I don't need any operations like +, - etc. Just apply, map, flatMap, etc to provide for list co...

Evaluating into two or more lists

Howdy, codeboys and codegirls! I have came across a simple problem with seemingly easy solution. But being a Python neophyte I feel that there is a better approach somewhere. Say you have a list of mixed strings. There are two basic types of strings in the sack - ones with "=" in them (a=potato) and ones without (Lady Jane). What you n...

Adding items to anonymous lists via code

We have a custom list inside a moss publishing site that an asp.net form is submitting information to. We seem unable to submit the form when accessing the site anonymously, though we have turned off viewformspageslockdown, have enabled anonymous access on the site and allowed add anon on the list itself. We can navigate to the list an...

.Net List<T> insert

Hi, I am trying to do var test = new List< int>(10); test.Insert(1, 0); or test[1] =0; I am getting exception at this. How can I insert to list? Thanks space is there to get this editor show things properly. ...

Why do ListBox.ObjectCollection and ListView.ListViewItemCollection have AddRange but not InsertRange or RemoveRange?

So, both ListBox.ObjectCollection and ListView.ListViewItemCollection implement the IList class, which provides Add and Remove methods but no AddRange, InsertRange, or RemoveRange. However, ListBox.ObjectCollection and ListView.ListViewItemCollection also provide an AddRange method -- just no InsertRange or RemoveRange. Look at the Arra...

Rendering error with a list on IE8, 7, 6

What is the trick to getting IE to display a <ul>? I am working on a page with a php extension. I have a simple list. <ul> <li>Stuff one</li> <li>stuff two</li> <li>stuff three</li> <li>stuff four</li> </ul> While on Safari and Firefox I get a list that renders properly, on IE it just displays a paragraph. I have ...

Select max age C#

Greetings, I created a list that contains a collection of objects that have this properties: X, Y, Z I want to find out which object in the collection has the greatest Z I tried to use the Max() function but I don't understand how it's used... How can I accomplish this Thanks in advance ...

css tree folders list with jquery progress bar

I have a tree of folders and I want to add a progress bar next to the folder name which is also an anchor. The progress bar div section is the jQuery UI progress bar div. The pblabel element should seat on top of the progress bar. The bar element is the progress bar itself with a variable width. <ul> <li> <a href="" style="displa...

List Linked List reference

How to get the data reference/index in Linked list? e.g. if I have this linked list java.util.List<Polygon> triangles = new LinkedList<Polygon>(); polygon triangle, selectedTriangle; Point startDrag,endDrag,midPoint; .... triangles.add( new Polygon(xs, ys,3)); e.g. How can I set the Polygon selectedTriangle as the same with one of ...

controlling list indexing

In html the list (ul and ol ) provides indexing like 1.main 1.1 sub1 1.2 sub2 1.2.1 .... i want indexing as 1. main 1.1 sub1 1.2 sub2 how to do this ...

Sorting List<MyObject>

Which is the quickest way in Java to sort a list List<MyObject> myObjectList based on some numerical property of MyObject? ...

Trouble with local variables in C#

I have a couple of variables that need to be assigned inside a for loop. Apparently, when the loop exits, C# ignores whatever happened in there, and the variables are returned to their original status. Specifically, I need them to be the last and next-to-last elements of a List. Here's the code: int temp1, temp2; for (int i = 0; i < toR...

Combining Dictionaries Of Lists In Python

I have a very large collection of (p, q) tuples that I would like to convert into a dictionary of lists where the first item in each tuple is a key that indexes a list that contains q. Example: Original List: (1, 2), (1, 3), (2, 3) Resultant Dictionary: {1:[2, 3], 2:[3]} Furthermore, I would like to efficiently combine these dict...