list

Editable List for AS3

I'm looking for an editable list that allows users (not programmers!) to rename items by double clicking and typing within a textbox that should appear. Here's what I tried out: Flash CS3 List - no renaming Flex List - cannot rebuild my entire application within a Flex App. Too much trouble. Yahoo Astra Tree - no renaming! Do you kn...

Webapp: safetly update a shared List/Map in the AppContext

I've Lists and Maps in my WebAppContext. Most of the time these are only read by multiple Threads but sometimes there's the need to update or add some data. I'm wondering what's the best way to do this without incurring in a ConcurrentModificationException. I think that using CopyOnWriteArrayList I can achieve what I want in terms of -...

Efficient method to calculate the rank vector of a list in Python

I'm looking for an efficient way to calculate the rank vector of a list in Python, similar to R's rank function. In a simple list with no ties between the elements, element i of the rank vector of a list l should be x if and only if l[i] is the x-th element in the sorted list. This is simple so far, the following code snippet does the tr...

Custom List form - Autopopulate Manager

Hi, I have a Sharepoint 2007 custom list with a column named 'Manager', to hold the user's Manager (single line of text). When creating a new item I want the NewForm.aspx to autopulate the Manager field with the user's manager. I know we can autopulate list form fields using JQuery to access Sharepoint's 'User Information List' expose...

ocaml using List.map iterate over list

is there a way to iterate list over the list through List.map? I know List.map takes single function and list and produce a list that the function applies to all elements. But what if i have a list of function to apply a list and produce list of the list ? ...

Android multiple column list/grid with adapter and OnItemClickListener?

I have a simple grid with rows of items and columns of options on each item. Of course I can manually link OnClick actions to cell items through specific resource IDs: views.setOnClickPendingIntent(R.id.row1column1, launchA); views.setOnClickPendingIntent(R.id.row1column2, launchB); // ... views.setOnClickPendingIntent(R.id.row2co...

Optimizing operations on lists

I need to process lots of data in lists and so have been looking at what the best way of doing this is using Python. The main ways I've come up with are using: - List comprehensions - generator expressions - functional style operations (map,filter etc.) I know generally list comprehensions are probably the most "Pythonic" method, b...

How to cast list to enumerable

I've got a problem with the following code: public IEnumerable<ISession> GetSessions() { // ... using (ProvaDbEntities DBEntities = new ProvaDbEntities(Utilities.ToEntitiesConnectionString())) { ObjectQuery<session> sessions = DBEntities.session; IEnumerable<session> q1 = from session in sessions ...

List<T>.Clear - Does it have to be called?

So I've been fighting another memory problem in my project for the past week. I tried a couple of memory profilers but nothing gave me insight into what was causing the minor memory leak. The following code turned out to be causing it: private void DeleteAll( FlowLayoutPanel flp) { List<ImageControl> AllList = GetAllList(flp); L...

List<>.Find(delegate) issue

I have a multi-column combobox where the datasource is a List<> in my Select Class Select selection = new Select(); RadComboBox1.DataSource = selection.GetAcctUtilCo(e.Text, 10).Skip(e.NumberOfItems); I have a few DataTextFields. My DataValueField is the AcctID. Once an account is selected, I need the datatextfield values to pop...

Troubles with STL list iterators

After a thousand of attempts to Google/bypass that using pointers, I decided myself to post this question to you guys. Here's the problem: I'm trying to create a minimum spanning tree from a graph that I previously made. I'm using Kruscal's Algorithm for that, which is about checking every arc from the shorter to the longest and taking ...

Haskell List of Tuple Search

Hello to all, i have a list of tuple like this [("username", 123), ("df", 54), ("as",2 34)] I need to search the value based on username. I have using lookup but i need to change the value of the integer and write back to file. My logic of this is to delete the tuple and insert another new tuple value rather than change it. Any idea...

Clojure Lazy Sequences that are Vectors

I have noticed that lazy sequences in Clojure seem to be represented internally as linked lists (Or at least they are being treated as a sequence with only sequential access to elements). Even after being cached into memory, access time over the lazy-seq with nth is O(n), not constant time as with vectors. ;; ...created my-lazy-seq here...

Does STL and vector provide sort option?

Hi, Does STL and Vector provide the default sorting option?. ...

internet explorer and dynamic lists from javascript

I have a page that requires user input then it will execute some javascript and populate fields on the page. Part of this includes calling a perl script that will run and get data from another page check that against the input from the user. The number of items that the perl script will return could be anywhere from zero to ten or even m...

ArrayOf when using List<T> with a WCF Rest Service

Hello, I am trying to create a REST web service using .NET 4.0 and WCF. My REST service is returning a List which then gets serialized into XML. The problem I am having is that the XML being returned starts with ArrayOf, which I don't like. In other words, right now the XML looks like this: <ArrayOfAchievement> <Achievement> ...

Alternative to List<Tuple<Grid, TabItem, int, string, int>>... in C#

Hi, I'm trying to find an alternative to List<Tuple<Grid, TabItem, int, string, int>>..., since I need to be able to modify the integers' values or string's value. I say "alternative" because I don't think it's possible to modify any values in a tuple. I don't want to delete it and create it again with different values. ...

jquery hide not actually working (NOT IE)

Hi all, jQuery is driving me nuts. Ive looked around on the web for a simple category expander slider but haven't found one. Ive attempted to create one here. The problem I'm having is when trying to hide() an element previously show()n. If another element is show()n before the hide() is called, the call to hide() for the first elemen...

R: turning list items into objects

I have a list of objects that I've created manually, like this: rand1 <- rnorm(1e3) rand2 <- rnorm(1e6) myObjects <- NULL myObjects[[1]] <-rand1 myObjects[[2]] <-rand2 names(myObjects) <- c("rand1","rand2") I'm working on some code that bundles up objects and puts them up in S3. Then I have code in EC2 that I want to grab the myObjec...

how to seperate List elements with commas in groovy

def names = ["myname", "yourname", "theirname", "allnames"] String n = "" names.each{ n += it + "," } println n Output: myname,yourname,theirname,allnames, How do I get rid of the leading comma ...