public bool IsList(object value)
{
Type type = value.GetType();
// Check if type is a generic list of any type
}
What's the best way to check if the given object is a list, or can be cast to a list?
...
I want to implement a priority queue class. When an item is added at a higher priority it is pushed to the front of the queue instead adding to the end of queue.
Simple few lines of code
Public Class PriorityQueue(Of T)
Inherits List(Of T)
Private _list As New List(Of T)
Public Sub Enque(ByVal item As T, Optional ByVal pu...
Hello,
I'm trying to build a context sensitive based command list. I set the command.ITEM option for all my command buttons. But I couldn't find a way how to provide the following functionality:
I have a list of values say A, B,C
For A, my command menu should contain 2,4
When I move the selection (cursor) to B, my commands menu should h...
hi,
i have a contact list that i use in a issue list(lookup). When i delete the contact in the contact list is also gone in my already created issue.
Someone?
thx
...
Hi,
I have a Repeater control who has its dataSource setted with a typed object list and in the inline code I want to access to its elements properties inside the ItemTemplate tag. I tried this with the eval expression but it does not work:
<ItemTemplate>
<tr>
<td><%# Eval("code") %></td>
<td><%# Eval("description") %></td>
...
Do you know how to programatically obtain a list of video codecs installed on computer, from windows forms ?
Thank you.
...
I use vectors, lists, strings and wstrings obsessively in my code. Are there any catch 22s involved that should make me more interested in using arrays from time to time, chars and wchars instead?
Basically, if working in an environment which supports the standard template library is there any case using the primitive types is actually ...
I have a SharePoint document library that has a folder structure used for organizing the documents (but also for controlling access, via permissions on the folders).
The documents in the library are updated every month, and we store every month's version of the document in the same folder; there's a "month" column used for filtering tha...
public class Person
{
public string name { get; set; }
public Email email { get; set; }
}
public class Email
{
public string desc { get; set; }
}
public static IEnumerable<T> Sort<T>(this IEnumerable<T> source, string sortExpression, bool desc)
{
var param = Expression.Parameter(typeof(T), string.Empty);
...
This is a great primer but doesn't answer what I need:
http://stackoverflow.com/questions/464342/combining-two-sorted-lists-in-python
I have two Python lists, each is a list of datetime,value pairs:
list_a = [['1241000884000', 3], ['1241004212000', 4], ['1241006473000', 11]]
And:
list_x = [['1241000884000', 16], ['1241000992000', 16...
I'm using SandCastle Help File Builder 1.8.0.1 with its MAML content editor.
I want an ordered list starting from a value other than the default of 1.
10. Some data
11. Other data
I even tried the following and it does not work as it is from HTML for the OL element:
<list class="ordered">
<listItem value="10">some data<...
How do i exit a Generic list ForEach with a delegate? Break or return doesn't work.
Example:
Peoples.ForEach(delegate(People someone)
{
if(someone.Name == "foo")
???? What to do to exit immediatly ?
});
...
I've got a function here that is meant to look through a list of tuples and find the second value in the tuple by taking in the first value. Here's the function so far:
lookup :: String -> [(String,String)] -> String
lookup _ _ [] = "Not found"
lookup x y zs = if (notFound x zs)
then "Not found"
else (head [b | (a,b) <- zs, (a==...
A list of every update and hotfix that has been installed on my computer, coming from either Microsoft Windows Update or from the knowledge base. I need the ID of each in the form of KBxxxxxx or some similar representation...
Currently I have:
const string query = "SELECT HotFixID FROM Win32_QuickFixEngineering";
var search = new Manag...
I was recently asking someone why he preferred to return a strongly-typed array over an IList. I had always thought that programming against an interface was the most flexible and best way program when faced with a project having a long life. So it struck me as odd when he replied:
We typically prefer immutable types
over mutable o...
In C# i have the following class and it compiles just fine:
class CustomItem
{
}
class CustomList : IList<CustomItem>
{
public CustomItem this[int index]
{
get { return null; }
set { throw new NotImplementedException(); }
}
public void CopyTo(CustomItem[] array, int arrayIndex)
{
}
...
How can I multiply the elements of two lists in Haskell, two by two?
Basically if I have [1,2,3] and [2,3,4] I want to get [2,6,12].
...
How could I possibly make every LI element of a list a droppable and apply the onDrop function to use it's ID?
...
I'm using fixed-size CList and I was wondering what the implementation does when the list is full and I make a call to add another element. Does it fail to add? Does it replace the oldest element?
...
I need to create a text file (aptest.s) that Ican use to read into another program. I am using Perl because I have a large list to work from. My code is as follows (which does not give the desired output - shown after code and actual output). Any help would be appreciated.
#!/usr/bin/perl -w
chdir("D://projects//SW Model ODME");
@link =...