list

Python: Removing spaces from list objects

I have a list of objects appended from a mysql database and contain spaces. I wish to remove the spaces such as below, but the code im using doesnt work? hello = ['999 ',' 666 '] k = [] for i in hello: str(i).replace(' ','') k.append(i) print k ...

designing list with CSS

Hi all, i am looking for a way to prevent a horizontal, inline unordered list from breaking into seperate lines once contained inside a element with specific width (shorter than the list). the element has "overflow" set to "hidden". the only way i found to create that effect is by giving a specific width to the "UL" element but now, ...

Search for the smallest element in a list after some value

Consider a list of integers <1,5,10> (assume sorted in ascending fashion). Given an integer, say, key = 6, is there a utility method that returns the smallest element after key (in this case it would be 10)? NB: Looping through the elements in the list and comparing it with key is an obvious way to do it, but I'm just wondering if ther...

mysql: selecting rows if a number is in a list field (ie. userIDs = "1,2,3", select * from table where 1 in userIDs)

i store lists of ids inside fields (by list i mean val1,val2,val3,...), and i want to select rows from a table where the field has valX in the list. i thought this would work, but apparently not :( SELECT * FROM userbulletins WHERE 25 IN `currentMessages` OR 25 IN `removedMessages` OR 25 IN `readMessages` currentMessag...

iphone app facebook newsfeed list control

Hi All, Im just wondering what is the most appropriate control and approach to creating a similar list control to the facebook newsfeed list? Each entry in the list will contain an image, some formatted text and in some cases a hyperlink to another page in the app. Thanks ...

Nested Incrementing Lists XHTML + Slidy

I am new to XHTML and I could use a little bit of help. I am using a tool called 'Slidy' to help me put together a slideshow on the net, I would like to make an incremented list so that when you advance the slideshow (click or press the right arrow) the next item appears. This should be the case whether the next item is a new item in the...

Finding similar word lists using StringListProperty on App Engine

I have a list of tags defined in a StringListProperty(). The DB contains around 1 million entries and each entry has around 20 different values in the list. e.g. a = [ 'ab', 'bc', 'ca', 'x', ....] b = ['x', 'm', 'a', .... ] I am using Google App Engine so I have constraints on running batch jobs ... (only 30 sec allowed) Here is m...

programmatically skinng the roll over idicator of a flex list component

Does anybody know how to add custom rolloveridicatorskins to a flex 3 list component? it doesn't have the rolloveridicatorskin in the css. ...

Using Deque.popleft as args for function

Hi, I am attempting to store a list of commands to send down a serial cable using deque in Python. My function "send_command" accepts 3 values; The command, an int. pause and a boolean wait. its definition is as follows. def send_command(self, command, pause=0, wait=False): What I would like to do is, rather than calling this functi...

Which direction is better for sorting multi-column lists?

Please note, I'm not asking how to implement or code a multi-column list. There are two ways to sort multi-column lists: horizontal and vertical. Many of the Microsoft System.Web.UI.WebControls have a RepeatDirection property that offers these two options. I'm sure other frameworks also offer these direction options. Below are sampl...

Pass list as argument to Python C module?

I found this nice example of a Python C Module, where a single integer is passed along as the only argument. How can I instead pass a python list as argument? ...

Why is there a List<T>.BinarySearch(...)?

I'm looking at List and I see a BinarySearch method with a few overloads, and I can't help wondering if it makes sense at all to have a method like that in List? Why would I want to do a binary search unless the list was sorted? And if the list wasn't sorted, calling the method would just be a waste of CPU time. What's the point of havi...

Python Deque appendleft with list

Hi, I am currently creating my deque object using the following, self.CommandList = deque((['S', False, 60],['c'],['g16'],['i50'],['r30', True],['u320'],['o5000'],['b1'],['B4500'],['W1'],['l5154'],['!10'],['p2', True, 10],['e1'],['K20'],['U0'],['Y0'])) But I wish to add a similar list to the queue later but using appendleft, so it ca...

Ruby Get Available Disk Drives

Can anyone tell me how I can get a list of the available disk drives in ruby? I am creating an open file dialogue and need to know! Thanks in advance, ell. ...

sorting a list of tuples

I have a list of tuples of the form (a,b,c,d) and I want to copy only those tuples with unique values of 'a' to a new list. I'm very new to python. Current idea that isn't working: for (x) in list: a,b,c,d=(x) if list.count(a)==1: newlist.append(x) ...

ListsView Binding with auto update.

Heya Guys. I have a application im working on that uses the Jabber Libraries to connect to a jabber Server and receive contacts etc. I have buit all login system and interface for the chat but now im working on how to Bind the data for the contacts to the ListView I have a function that is called when a contact comes online such, See ...

Sort list by given order of indices -Python

I have a list of lines read from a file. I need to sort the list by time stamp (in UTC), however the time stamp is not always at the beginning of the string. I have parsed out the time stamp using regular expressions and place them into a separate list. The indices of the two lists will match. Once I sort the list of time stamps, I can g...

How to make List's Add method protected, while exposing List with get property?

I have a class named WhatClass that has List field in it. I need to be able to read-only this field, so I used a get property to expose it to other objects. public class WhatClass { List<SomeOtherClass> _SomeOtherClassItems; public List<SomeOtherClass> SomeOtherClassItems { get { return _SomeOtherClassItems; } } } However it ...

How can i play sound list with HTML5 ?

Hi, I appreciate what you do guys in this great site. I want to know if there are any way to play Sound list clips with HTML5. This is a audio code in HTML5: <audio controls="controls" autoplay="autoplay"> <source src="test1.mp3" type="audio/mpeg" /> </audio> it is work with me but what i want is how can i play many sound list exa...

What is the python equivalent to perl "a".."azc"

Hello, In perl, to get a list of all strings from "a" to "azc", to only thing to do is using the range operator: perl -le 'print "a".."azc"' What I want is a list of strings: ["a", "b", ..., "z", "aa", ..., "az" ,"ba", ..., "azc"] I suppose I can use ord and chr, looping over and over, this is simple to get for "a" to "z", eg: >...