list

SharePoint URL retrieval for SPListItem

When I try to retrieve a column which is a hyperlink I get two items that are comma delimited instead of one. When I pull item["ColumnName"] I get its value: http://www.google.com/article/583,%20title%20gets%20stars Why is it showing the link, and title? ...

Sharepoint - How to remove link from Javascript form within List

We have a sharepoint Aspx form that is formatted like an excel spreadsheet. On each row of the form are links that when clicked, launch a script to show new links, allowing the user to add, view, or hide comments. This will appear for each line item clicked on. We would like to remove the "add comment" link from the script, but cannot...

Python: Sort a dictionary by value

I have a dictionary of values read from 2 fields in a database: a string field and a numeric field. The string field is unique so that is the key of the dictionary. I can sort on the keys, but how can I sort based on the values? Note: I have read this post 72899 and probably could change my code to have a list of dictionaries but since...

Sortable list in WCF

Based on this article http://www.codeproject.com/KB/linq/bindinglist_sortable.aspx I implemented my bussines object with sortable feature. When I send the object to the client app (winfoms), the objects is not sortable. Does anyone have a solution for this? Thanks for the answer, Jani ...

virtual listbox in Swing

I'm trying to figure out how to make a virtual listbox (or tree or outline) in Swing -- this would be one where the listbox can show a "view" within a large result set from a database without getting the entire result set's contents; all it needs to give me is a heads up that Items N1 - N2 are going to need to be displayed soon, so I can...

Linq: List of double values - differences between successor values...

i have a list of double values... 1.23, 1.24, 1.78, 1,74... so i want to calculate the differences between the successor -> only adding (negative values should be firstly positive)... above 4 values would be 0,01 +0,53 (-)-0,04 (-) -> to make it positive... with an for-loop, it is easy... any idea how to solve it with linq? ...

Binding Generic List Array to GridView

Hi I have a List which returns an array of "Question". My question is how can I bind this to a grid view? When I try to call Question.Ordinal I get that it does not exist in the data source. I am using the following code: GridView1.DataSource = myList.GetQ(); GrdiView1.DataBind(); myList.GetQ() returns a List which is an array of "...

How to sort on the Value of an member of a List<> within a parent List<>

I have a List sort question. I am using c# 3.0 and a generic List structure like this: public class myObject { public int ID { get; set; } public List<mySetting> setting { get; set; } } public class mySetting { public int ID { get; set; } public string Name { get; set; } public string Value { get; set; } // sort o...

How to add value in a public property of List<string> type in c#?

private List<string> _Baseline = new List<string>(); public List<string> Baseline { get { return _Baseline; } set { _Baseline = value; } } How can I set this property? It does not let me add using the add method; it throws an "object reference null" error. ...

Add elements to an an announcements list for a specific user

I have a customer request to create a number of announcements based on some data from another database. Most of it seems easy enough but the new elements should be created by the user (login) specified in the input data. I was planning to add the announcements using the list web services but I sure would like to avoid using impersonatio...

Java: How to remove elements from a list while iterating over/adding to it

Hi! This question is a more special case of the problem described (and solved) in this question. I have two methods, stopAndRemove(ServerObject server) and a close() method. The later should close all servers and remove them from the server list. The list is defined as List<ServerObject> server. I do not want to have almost the same...

What's the difference between list and tuples in Python?

What's the difference? What are the advantages / disadvantages of tuples / lists? ...

How to remove an element from a list by index in Python?

How to remove an element from a list by index in Python? I found the list.remove method but say I want to remove the last element, how do I do this? It seems like the default remove searches the list, but I don't want any search to be performed. ...

How to run an operation on a collection in Python and collect the results?

How to run an operation on a collection in Python and collect the results? So if I have a list of 100 numbers, and I want to run a function like this for each of them: Operation ( originalElement, anotherVar ) # returns new number. and collect the result like so: result = another list... How do I do it? Maybe using lambdas? ...

Single implementation to cover both single and multiple values in Python?

Say you have a value like this: n = 5 and a method that returns the factorial of it, like so: Factorial ( 5 ) How do you handle multiple values: nums = [1,2,3,4,5] Factorial ( nums ) so it returns the factorials of all these values as a list. What's the cleanest way to handle this, without writing 2 methods? Does python have a go...

Manipulating lists in OCaml

I am having issues manipulating deeply nested lists in OCaml in the below context. class foo (pIn:int)= object (self) val p = pIn val even = if (pIn mod 2) = 0 then true else (false) method doIt = "doIt" method isEven = even method getP = p end;; let rec createListOfElements howMany = ( Random.self_init (); ...

How to create a list from beginning number and end number

I have a set of numbers: Column A: (A1)100,(A2)103,(A3)104,(A4)106 Column B: (B1)102,(B2)103,(B3)105,(B4)110 Column A is the beginning number and Column B is the end number. We need to create a list (on a separate cell) of numbers using the beginning number and end number using column A & B. E.g. based on the 1st set of data from Row...

Python - How to calculate equal parts of two dictionaries?

I have a problem with combining or calculating common/equal part of these two dictionaries. In my dictionaries, values are lists: d1 = {0:['11','18','25','38'], 1:['11','18','25','38'], 2:['11','18','25','38'], 3:['11','18','25','38']} d2 = {0:['05','08','11','13','16','25','34','38','40', '43'], 1:['05', '...

Pointer to member functions - C++ std::list sort

How do i pass a pointer to a member function to std::list.sort()? Is this possible? Thanks struct Node { uint32_t ID; char * Value; }; class myClass { private: uint32_t myValueLength; public: list<queueNode *> MyQueue; bool compare(Node * first, Node * second); ...

C# SelectMany

I can flatten the results of a child collection within a collection with SelectMany: // a list of Foos, a Foo contains a List of Bars var source = new List<Foo>() { ... }; var q = source.SelectMany(foo => foo.Bar) .Select(bar => bar.barId) .ToList(); this gives me the list of all Bar Ids in the Foo List. When I attempt to g...