list

Data Structures for hashMap, List and Set

Can any one please guide me to look in depth about the Data Structures used and how is it implemented in the List, Set and Maps of Util Collection page. In Interviews most of the questions will be on the Algorithms, but I never saw anywhere the implementation details, Can any one please share the information. ...

Removing items from lists and all references to them.

I'm facing a situation where I have dependent objects and I would like to be able to remove an object and all references to it. Say I have an object structure like the code below, with a Branch type which references two Nodes. public class Node { // Has Some Data! } public class Branch { // Contains references to Nodes pu...

CSS Hover on parent list Item only

Hey Everyone, So I have some nested lists (only one level deep) and I'm running into trouble with the CSS :hover feature. I only want the hover to apply to the parent class, but I can't figure that one out. Here's my CSS <style type="text/css" media="screen"> .listblock li img { visibility: hidden; } .listblock li:hover img ...

Algorithm - combine multiple lists, resulting in unique list and retaining order

I want to combine multiple lists of items into a single list, retaining the overall order requirements. i.e.: 1: A C E 2: D E 3: B A D result: B A C D E above, starting with list 1, we have ACE, we then know that D must come before E, and from list 3, we know that B must come before A, and D must come after B and A. If there are con...

Common elements between two lists not using sets in Python

I want count the same elements of two lists. Lists can have duplicate elements, so I can't convert this to sets and use & operator. a=[2,2,1,1] b=[1,1,3,3] set(a) & set(b) work a & b don't work It is possible to do it withoud set and dictonary? ...

Automatically change div on mouseover and on timer

I'm a bit o a noob so any help would be great... What I need to do is have it so that the div associated to a specific li can change on hover as well as automatically change on a timer so that it scrolls through the option. here is my code: <script type="text/javascript"> $(function () { $("#switches li").mouseover(functio...

efficient list mapping in python

Hi everyone, I have the following input: input = [(dog, dog, cat, mouse), (cat, ruby, python, mouse)] and trying to have the following output: outputlist = [[0, 0, 1, 2], [1, 3, 4, 2]] outputmapping = {0:dog, 1:cat, 2:mouse, 3:ruby, 4:python, 5:mouse} Any tips on how to handle given with scalability in mind (var input can get rea...

List<T>.Distinct() in C# - multiple criteria for EqualityComparer ?

I have a collection of objects which have several properties in each of them. I often need to get a list of distinct values for many properties in this collection. If I implement IEqualityComparer on this type , it gives me one single criteria for getting the distinct objects in the collection. How do I get to be able to call Distinct o...

How to get Date and current time from the Date/Time column in SharePoint Custom list

I have column called "Date Submitted" as Date/time in one of the Custom list in sharepoint 2007. it always set to today's date and 12AM time instead of that I want to display today's date with current time hh:mm:ss. I tried creating calculated column TestDate and formula is : =TEXT(([Date Submitted]),"mm dd yyyy h:MM:SS") result is 04...

Python: sort a list and change another one consequently

I have two lists: one contains a set of x points, the other contains y points. Python somehow manages to mix the x points up, or the user could. I'd need to sort them by lowest to highest, and move the y points to follow their x correspondants. They are in two separate lists.. how do I do it? ...

Jquery Livesearch with quicksilver plugin to include not just the <li>s

Ok, what i'm trying to do here is to make the exact code found here here ordered list and make it so that it doesn't just not work when i try to add additional elements into the list. Also i'm planning on using the more effecient one linked to at the end but i cannot put it here so you'll have to find that link on your own sadly. Since ...

Need help with implementation of the jQuery LiveUpdate routine

Hey all, Has anyone worked with the LiveUpdate function (may be a bit of a misnomer) found on this page? It's not really a live search/update function, but a quick filtering mechanism for a pre-existing list, based on the pattern you enter in a text field. For easier reference, I'm pasting the entire function in here: jQuery.fn.liv...

How do I hide data/field in a List in J2ME

Hi, I am working on a J2ME app which has dynamically generated Lists. Items on this list may be consequently selected, and the selection processed within the commandAction block. Is there a way to have the IDs of variables populating the List (from a remote database) included in the List item definition as in: this.append("A", null); t...

How to order a List by the order of another List?

I have a method as follows. It returns a list of MyTypes which appear to be ordered by myType.Id ascending by default. I'd like this list to be ordered by the ids parameter I pass into the method. public List<MyType> GetMyTypes(List<int> ids) { return (from myType in db.MyTypes where ids.Contains(myType.Id) select new My...

Creating a list in Python- something sneaky going on?

Apologies if this doesn't make any sense, I'm very new to Python! From testing in an interpreter, I can see that list() and [] both produce an empty list: >>> list() [] >>> [] [] From what I've learned so far, the only way to create an object is to call its constructor (__init__), but I don't see this happening when I just type []. S...

Blackberry Listfield with variable height for each row?

I need to implement custom ListField which has height variable for every each row. Selected row should has different height then other rows. ...

How do I make sure that there is always something selected in a Spark List?

I have a spark list, which is based on a dataProvider. As the application runs, the data in the dataprovider can change, and also the dataProvider can be swapped for a different one What I need to do is make sure that something is always selected in the list (unless it is empty) ...

retrieve the 2 highest item from a list containing 100 000 integers

Hi everyone, How can retrieve the 2 highest item from a list containing 100 000 integers. You do understand without having to sort the entire list. ...

Python 2D list has weird behavor when trying to modify a single value...

Hi guys, So I am relatively new to Python and I am having trouble working with 2D Lists. Here's my code: data = [[None]*5]*5 data[0][0] = 'Cell A1' print data and here is the output (formatted for readability): [['Cell A1', None, None, None, None], ['Cell A1', None, None, None, None], ['Cell A1', None, None, None, None], ['Cell ...

Extract list of attributes from list of objects in python

Hi, I have an uniform list of objects in python: class myClass(object): def __init__(self, attr): self.attr = attr self.other = None objs = [myClass (i) for i in range(10)] Now I want to extract a list with some attribute of that class (let's say attr), in order to pass it so some function (for plotting that data ...