list

Enabling management of content types on SharePoint lists via web service

I can enable the management of content types in a document library's "advanced settings". Is there any web service method for this? I need to do this in an automated way, not manually. It seems like neither Lists.AddList nor Lists.UpdateList can set the value of the "Flags" attribute that is needed for this. My web service client has a...

Converting an array of type T to an array of type I where T implements I in C#.

I am trying to accomplish something in C# that I do easily in Java. But having some trouble. I have an undefined number of arrays of objects of type T. A implements an interface I. I need an array of I at the end that is the sum of all values from all the arrays. Assume no arrays will contain the same values. This Java code works. Arra...

ClearCase : list the content of a directory (ls) using CAL.

Hi; In ClearCase, you can list the content of a directory using "cleartool ls". My question is how can I do the same thing using CAL (ClearCase Automation Layer). The reason I prefer the COM API is because I won't have to parse the output of "ls". So far, I am able to get the VOB and the View successfully, but I didn't find any method...

Is there a clever way to parse plain-text lists into HTML?

Question: Is there a clever way to parse plain-text lists into HTML? Or, must we resort to esoteric recursive methods, or sheer brute force? I've been wondering this for a while now. In my own ruminations I have come back again and again to the brute-force, and odd recursive, methods ... but it always seems so clunky. There must be a...

Output 2 dim array 'list of lists" to text file in python

Simple question - I am creating a two dim array (ddist = [[0]*d for _ in [0]*d]) using lists in the code below. It outputs distance using gis data. I just want a simple way to take the result of my array/list and output to a text file keeping the same N*N structure. I have used output from print statements in the past but not a good sol...

StackOverflowException with large lists

There is very simple task I want to do, that somehow makes the program crash. I have a list of number contained within, all unique. Past a certain number, I want to invert the order. Example : 5, 16, 11, 3, 8, 4 -> 5, 16, 11, 4, 8, 3 when using 3 as the pivot point. Below is one of the many methods I tried. private List<int> ShiftPat...

In Python, how do I index a list with another list?

I would like to index a list with another list like this L = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'] Idx = [0, 3, 7] T = L[ Idx ] and T should end up being a list containing ['a', 'd', 'h']. Is there a better way than T = [] for i in Idx: T.append(L[i]) print T # Gives result ['a', 'd', 'h'] ...

How do I convert a nested tuple of tuples and lists to lists of lists in Python?

I have a tuple containing lists and more tuples. I need to convert it to nested lists with the same structure. For example, I want to convert (1,2,[3,(4,5)]) to [1,2,[3,[4,5]]]. How do I do this (in Python)? ...

List Iterator Remove()

I have a list iterator that goes through a list and removes all the even numbers. I can use the list iterator to print out the numbers fine but I cannot use the list's remove() and pass in the dereferenced iterator. I noticed that when the remove() statement is in effect, *itr gets corrupted? Can somebody explain this? #include <iostre...

Mapping of some Data in c#

Hello, i search for a good solution for mapping data in c#. At first i have a Character "a" and a angle "0.0" degree. What is the best solution for the Mapping ? A list ? One requirement is that i must search for the degree if it not in the "list" then i add a new one.. and so on thanks for help :) EDIT: I must find out if the ang...

Java - Distinct List of Objects

I have a list/collection of objects that may or may not have the same property values. What's the easiest way to get a distinct list of the objects with equal properties? Is one collection type best suited for this purpose? For example, in C# I could do something like the following with LINQ. var recipients = (from recipient in recipien...

is there a better way to convert a list to a dictionary in python with keys but no values?

I was sure that there would be a one liner to convert a list to a dictionary where the items in the list were keys and the dictionary had no values. The only way I could find to do it was argued against "Using list comprehensions when the result is ignored is misleading and inefficient. A for loop is better" myList=['a','b','c','d...

Using jQuery to limit the number of list elements

I have a list element containing a number of between 20-30 events. I only want to show 5 of those, and have a «More» link I can click to watch the the next five. It doesn't matter if the five next events are appended. Can't find a jQuery script that actually does this, or am I just blind? I don't want to use carousel plugins or anything...

Scala match decomposition on infix operator

I'm trying to understand the implementation of Lists in Scala. In particular I'm trying to get my head around how you can write match expressions using an infix operator, for example: a match { case Nil => "An empty list" case x :: Nil => "A list without a tail" case x :: xs => "A list with a tail" } How is the match expression ...

how to group list elements using jquery

Hi all, Can somebody help me convert the following html <ul> <li>1</li> <li>2</li> <li>3</li> <li>4</li> </ul> into this one <ul> <li class="li_group"> <ul> <li>1</li> <li>2</li> </ul> </li> <li class="li_group"> <ul> <li>3</li> <li>4</li> </ul> </li> </ul using jQuery? Tha...

List.Sort in C#: comparer being called with null object

I am getting strange behaviour using the built-in C# List.Sort function with a custom comparer. For some reason it sometimes calls the comparer class's Compare method with a null object as one of the parameters. But if I check the list with the debugger there are no null objects in the collection. My comparer class looks like this: pu...

Define a double array without a fixed size ?

Hello i have a problem with c# Arrays. I need a array to store some data in there... My Code is that double[] ATmittelMin; ATmittelMin[zaehlMittel] = Gradient(x, xATmax, y, yATmax); But the compiler says: not defined var How can i define a double array without a fixed size ? Thanks a lot! ...

Is there anything like memcached, but for sorted lists?

I have a situation where I could really benefit from having system like memcached, but with the ability to store (per each key) sorted list of elements, and modifying the list by addition of values. For example: something.add_to_sorted_list( 'topics_list_sorted_by_title', 1234, 'some_title') something.add_to_sorted_list( 'topics_list_s...

LINQ: How to get items from an inner list into one list?

Having the following classes (highly simplified): public class Child { public string Label; public int CategoryNumber; public int StorageId; } public class Parent { public string Label; public List<Child> Children = new List<Child>(); } And having the following data: var parents = new List<Parent>(); var parent ...

How do I move items from a list to another list in C#?

What is the preferable way for transferring some items (not all) from one list to another. What I am doing is the following: var selected = from item in items where item.something > 10 select item; otherList.AddRange(selected); items.RemoveAll(item => selected.Contains(item)); In the interest of having...