list

bash: how to delete elements from an array based on a pattern

Say I have a bash array (e.g. the array of all parameters) and want to delete all parameters matching a certain pattern or alternatively copy all remaining elements to a new array. Alternatively, the other way round, keep elements matching a pattern. An example for illustration: x=(preffoo bar foo prefbaz baz prefbar) and I want to d...

Objective-C, iPhone RSS Reader Application Query - How to organize your RSS Feed Display into groups?

Hi! I've been very unfortunate with my programming. I am still rather new to Objective-C, but I am trying to learn as quickly as possible. I need to complete an RSS Reader for iPhones application, a relatively simple one which parses the rss feed, displays it in a navigation-table view and when you click on an article you are taken to ...

rails sortable list not updating

I have followed the instructions on http://railscasts.com/episodes/147-sortable-lists for creating a sortable list. The list drags and drops as it is supposed to, but the sort action is not being fired when the link is released. I have tested this by putting a render :text command into the sort. No error's appear, it just doesn't fire ...

Python permanent assignment variables

I have just started python and came across something kind of strange. The following code assigns a co-ordinate of x=1 and y=2 to the variable test. The test2 variable assigns itself the same value as test and then the [x] value for test2 is changed to the old [x] value minus 1. This works fine, however, when the last part is executed, n...

List all real users on Linux/*nix and data associated with them

Hello I'd like to list all real users on Linux/*nix and it's data. I probably need to parse /etc/passwd and /etc/shadow and check if user have password. The problem is that is not cross-platform (on *BSD there is no /etc/shadow). Is there any cross-platform library/command I can use? ...

Error while accessing list with SharePoint WebService

Hi All, I am trying to access the SharePoint List with web service and I need to update the same via web service accordingly. Following is the sample code that I am using Lists Testlist = new Lists(); Testlist.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials; Testlist.PreAuthenticate = true...

scrolling interval in a Spark List with Tilelayout oversized while using mouse wheel after scrolling with mouseclick

I have a spark List with an item renderer and a tile layout. If I scroll by clicking with the mouse on the scroll bar and trying to scroll with the mouse wheel after that, there is a problem: The interval of the scrolling is oversized, instead of scrolling one item down (or up) the List scrolls 4 items down (or up). <s:List dataPro...

scala list match

List(1,2) match { case List(1,_) => println("1 in postion 1") case _ => println("default") } compiles / works fine. So do List(1) match ... List(3,4,5) match ... but not List() match ... which results in the following error found : Int(1) required : Nothing case List(1,_) => println("1 in postion 1") Why does...

Python - Dynamic Nested List

Hi. So I'm trying to generate a nested list in Python based on a width and a height. This is what I have so far: width = 4 height = 5 row = [None]*width map = [row]*height Now, this obviously isn't quite right. When printed it looks fine: [[None, None, None, None], [None, None, None, None], [None, None, None, None],...

python: keep char only if it is within this list

i have a list: a = ['a','b','c'.........'A','B','C'.........'Z'] and i have string: string1= 's#$%ERGdfhliisgdfjkskjdfW$JWLI3590823r' i want to keep ONLY those characters in string1 that exist in a what is the most effecient way to do this? perhaps instead of having a be a list, i should just make it a string? like this a='abcdefg...

Alphabetical lists in CodeIgniter

Wondering how I can do this with CodeIgniter? Any help is greatly appreciated! Thanks. ...

How can I add some string to a list in order to make a count word? [Python]

I want to simply add some word to a list and then count how many words are in there... And check if the word isn't in the list already. How can I do it? ...

Cannot change content of list within list. Can anybody explain why?

I have a month variable which is a list of lists of tuples. Each list represents a week and each day is a tuple of the day of the month and the week day. I wish to make my month a list of lists of month days. I tried to do it like this: for week in month: week = [day[0] for day in week] for [[(1, 1), (2, 2)], [(3, 3), (4, 4)]] I e...

How to bind List<> to a column in ListView

I've got a DataTable with this fields datatable.Columns.Add("ProductID", typeof(int)); datatable.Columns.Add("LocationList", typeof(List<string>)); datatable.Columns.Add("LocationIds", typeof(List<int>)); datatable.Columns.Add("ProductName", typeof(string)); datatable.Columns.Add("Brand", typeof(string)); datatable.Columns.Add("Price", ...

Why are sets bigger than lists in python?

Why is the size of sets in Python noticeably larger than that of lists with same elements? a = set(range(10000)) b = list(range(10000)) print('set size = ', a.__sizeof__()) print('list size = ', b.__sizeof__()) output: set size = 524488 list size = 90088 ...

LINQ Convert IEnumerable<string> to List<ulong>

I have the following code: var personIds = from player in myPlayers select player.person_id; where personIds is an IEnumerable<string> that I'd like to convert to List<ulong>, since person_id is convertable via Convert.ToUInt64() Is this easily done in LINQ? ...

Iterative printing over parallel lists to print columns in Python

I have vsort and vsorta, both lists with equal numbers of items that should be right next to each other (about 250 elements per list). I want to print them as parallel columns, like so: >>> for x,y in vsort,vsorta: ... print x, y ... Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: too many value...

Java Collections with Mutable Objects

How does a TreeSet, HashSet or LinkedHashSet behave when the objects are mutable? I cannot imagine that they would work in any sense? If I modify an object after I have added it; what is the behaviour of the list? Is there a better option for dealing with a collection of mutable objects (which I need to sort/index/etc) other than a lin...

How to customize the list items in an Android AlertDialog

I want to show multiple lines with different text styles for each item in a list using AlertDialog, but can't fine any example. Does anyone know how to customize the items of an AlertDialog? Or do I really have to create an Activity with a ListView for this? ...

removing /n from list of words - python

Hi I have a list as below ['Jellicle', 'Cats', 'are', 'black', 'and', 'white,\nJellicle', 'Cats', 'are', 'rather', 'small;\nJellicle', 'Cats', 'are', 'merry', 'and', 'bright,\nAnd', 'pleasant', 'to', 'hear', 'when', 'they', 'caterwaul.\nJellicle', 'Cats', 'have', 'cheerful', 'faces,\nJellicle', 'Cats', 'have', 'bright', 'black', 'eyes...