list

How to group widgets in "Add widget" dialog

Hello! I have two appWidgets, now if user open "Add widget" dialog, both widgets will be visible in main list. But bundled HTC widgets are grouped by subject. For example clicking on "Calnedar" will bring another list, where user can pick desired design. Is it possible to reproduce such feature or it is some feature hardcoded to Sense ?...

JSON deseralization to abstract list using DataContractJsonSerializer

Hello, I'm trying to deserialize a JSon file to an instance of a class that contains an abstract list. Serializing the instance to the Json works well (check the json file below). When deserializing I get a "System.MemberAccessException" with the message "Cannot create an abstract class". Obvisouly the deseralizer is trying to instantia...

Reordering python list based on an algorithm or pattern

Here is a stumper for you math geeks out there. I have a python list that is just a sequence that looks like this: myList=[1,2,3,4,5,6,7,8,9,10,11,12,13,(...etc...),43] Unfortunately, the data from which the list was generated was not zero-padded, and it should have been. So in reality: 1==1 2==10 3==11 4==12 5==13 6==14 7==15 8=...

Parse and pivot student assignment data in c#

I've got a list of student/assignment pairs coming in to my application via flat file into a List object and I'd like to validate those assignment names against a list of assignments I have to see which student has done what assignment (if any). So - I have a list of students, a list of student/assignment pairs, and a list of assignment...

SilkTest: how to define expression for dynamic drop down list

How do I define an expression (or any other alternative method) when I want to select a value from a dynamic drop down list? ex: drop down list has these values: Plan A (X) Plan B (Y) Plan C (Z) where, X, Y and Z are all random numbers. Is there a way where I can define my selection to select the text up to "Plan #" and ignore the "(X)...

ListView with Alphabet on Android

Hi, I want to do a listview on android and it contains an alphabet near of the list (like iphone application). I couldnt find any way to implement an list and having alphabets, when ı click on c letter list scrolling and start with the c Letter. Thanks ...

Generic List Method Problem

Hello, I'm getting an error when I try to create a method with the following signature: public List<T> CreateList(DataSet dataset) Error 1 The type or namespace name 'T' could not be found (are you missing a using directive or an assembly reference?) Does anyone know what I'm doing wrong? Thanks in advance! ...

C# in VS2005: problem with lists

public class MyClass { List<MyOtherClass> myInnerList; } Let's say I have the following declared somewhere else: List<MyClass> myOuterlist; How would I quickly generate a list of the myInnerLists in C# using VS2005? ...

How to use a List(Of T) as Itemssource for a WPF DataGrid?

I wanted to quickly display a List(OF String) in a DataGrid (dynamically), so I thought myDataGrid.ItemsSource = myList would be the quick and easy way to do it, since this works great for a DataTable: myDataGrid.ItemsSource = myDataTable.DefaultView My DataGrid has the AutoGenerateColumns property set to 'True'. And for the datat...

SharePoint 2010 - List view threshold: What does not trigger the threshold?

In SharePoint 2010, we have the List View Threshold, which defaults to 5,000, and: Specifies the maximum number of list or library items that a database operation, such as a query, can process at the same time outside the daily time window set by the administrator during which queries are unrestricted. So, I'm looking to determine...

Can't click on ListView whose rows are made of WebViews

Hi, I have an Activity which extends ListView The ListView that I use is an extension of ArrayAdapter and each row of the ListView primarily consists of a WebView The problem is that touching the WebView does not call OnListItemClick. Any thoughts on how I can be able to touch the webview and call OnListItemClick? Or is there something...

Name three strategies for internal data storage when implementing a Stack ADT

This was a question my Data Structures teacher put on our recent test. I immediately thought of a List and an Array but I cannot for the life of me think of a third ADT that could be used as internal storage for a Stack. Any help? ...

Get found items as list from regex

Given the following code: var myList = new List<string> { "red", "blue", "green" }; Regex r = new Regex("\\b(" + string.Join("|", myList.ToArray()) + ")\\b"); MatchCollection m = r.Matches("Alfred has a red and blue tie and blue pants."); Is there a way to derive a List<string> of the "found" items ("red", "blue", "blue")? ...

Generating a multiple list of combinations for a number in Java

The following is the problem I'm working on and my snippet of code. Is there a better way to implement this? I have used basic control structures for this below. Is it better to store the rows and columns in a map and searching through the map based on the key/value pairs? There is a security keypad at the entrance of a building. It...

Python: Comparing Lists

I have come across a small problem. Say I have two lists: list_A = ['0','1','2'] list_B = ['2','0','1'] I then have a list of lists: matrix = [ ['56','23','4'], ['45','5','67'], ['1','52','22'] ] I then need to iterate through list_A and list_B and effectively use them as co-ordinates. For example I take the firs number from list A...

How to find positions of the list maximum?

I have a list: a = [32, 37, 28, 30, 37, 25, 27, 24, 35, 55, 23, 31, 55, 21, 40, 18, 50, 35, 41, 49, 37, 19, 40, 41, 31] max element is 55 (two elements on position 9 and 12) I need to find on which position the maximum elements are situated. Please, help. ...

Haskell: How to simplify or eliminate liftM2?

Consider the following code I wrote: import Control.Monad increasing :: Integer -> [Integer] increasing n | n == 1 = [1..9] | otherwise = do let ps = increasing (n - 1) let last = liftM2 mod ps [10] let next = liftM2 (*) ps [10] alternateEndings next last whe...

why is this optional method argument shared across different python objects?

Possible Duplicate: Least Astonishment in Python: The Mutable Default Argument can anyone explain me this? class Strange(object): def mutate(self, x=[]): x.append(1) return x obj = Strange() print obj.mutate() another_obj = Strange() print another_obj.mutate() >> [1] >> [1, 1] mutate() is called with...

What is an efficient algorithm for extracting bags from lists of pairs?

I have a list of pairs of objects. Objects can appear in the pair in either order. What is the most efficient algorithm (and implementation?) to find all bags (ie sets with duplicates permitted) of pairs between the same objects. For my purpose the object references can be assumed to be pointers, or names or some similar convenient, shor...

Cannot copy Dictionary 'Value' to a List - C#

Hello, Having followed a tutorial I have a hashtable that contains a TcpClient object that matches with the string of a connected user. After reading about the pro's and cons of a hashtable it was recommended that using a Dictionary is preferred due to it being generic, thus more flexible. From here an array is made that contains the V...