I have three types of facts:
album(code, artist, title, date).
songs(code, songlist).
musicians(code, list).
Example:
album(123, 'Rolling Stones', 'Beggars Banquet', 1968).
songs(123, ['Sympathy for the Devil', 'Street Fighting Man']).
musicians(123, [[vocals, 'Mick Jagger'], [guitar, 'Keith Richards', 'Brian Jones']].
I need t...
a=['123','2',4]
b=a[4] or 'sss'
print b
I want to get a default value when the list index is out of range (here: 'sss').
How can I do this?
...
I'm originally a C# developer (as a hobby), but as of late I have been digging into Ruby on Rails and really enjoying it. Right now I am building an application in C#, and I was wondering if there is any collection implementation for C# that could match (or "semi-match") the find_by method of ActiveRecord.
What I am essentially looking ...
I have a simple html form. On php page. A simple list is placed on form. I submit this form (selected list items) to this page so it gives me page refresh. I want items which were POSTED to be selected after form was submited.
For my form I use such code, And It works just fine, But is it optimal or you can suggest some optimization fo...
I need to wrap a List<T> with some class that allows calls to set/get but does not allow add/remove calls, so that the list remains "stuck" at a fixed length. I think I have a thin wrapper class (below) that will work, but I'm not 100% positive.
Did I miss anything obvious?
import java.util.Collection;
import java.util.Iterator;
import...
I have a C++ program that uses a std::list containing instances of a class. If I call e.g. myList.push_back(MyClass(variable)); it goes through the process of creating a temporary variable, and then immediately copies it to the vector, and afterwards deletes the temporary variable. This is not nearly as efficient as I want, and sucks whe...
Hi,
How can I fix the following problem with IE6/7(IE Tester) with drop-down list(with fixed width), as it is dropping UP instead of DOWN on roll out?
Any help appreciated. Thanks in advance.
...
I'm trying to sort a list with the help of jQuery and the TinySort-plugin, and it works good but one thing is not working as i want. My Code is:
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>TinySort problem</title>
<script type="text/javascript" src="http://so.volmar.se/oldstatic/jquery....
How do I make a drop-down list that is filled with image items? I want to be able to see a list of images in the list with text titles, be able to select one exclusively, and have the text title appear in the selection box on top of the list. Does anyone know how this can be accomplished?
...
Hey
I have to search through a list and replace all occurrences of one element with another. I know I have to first find the index of all the elements, and then replace them, but my attempts in code are getting me nowhere. Any suggestions?
...
As the title mentions,is there any builtins to do this job?I looked for that in dir(list) but got no usable one.Thanks.
...
I am new to struts2.I am unable to populate value in side a table in my jsp page from my Action class.I have a List in my Action class.Can any body help me.
...
if ConvertAll throw an exception on one element, can i just skip this element and continue to the next element?
...
I am using ASP.Net 3.5.
I have fiiled dropdown list in javascript using ajax service but unable to get its selected value in button click event on server side.
...
I want to sort a list of strings based on the string length. I tried to use sort as follows, but it doesn't seem to give me correct result.
xs = ['dddd','a','bb','ccc']
print xs
xs.sort(lambda x,y: len(x) < len(y))
print xs
['dddd', 'a', 'bb', 'ccc']
['dddd', 'a', 'bb', 'ccc']
What might be wrong?
...
Hello,
I am creating a public method to allow callers to write values to a device, call it write_vals() for example.
Since these values will by typed live, I would like to simplify the user's life by allowing them type in either a list or a single value, depending on how many values they need to write. For example:
write_to_device([1...
I have a list of tuples, say [{x, a, y}, {x, b, y}].
Is there a built-in function (or can I use a combination of BIFs) to delete all tuples matching {x, _, y}, as in match and delete based on the first and third term in the tuples, ignoring the second?
...
[{'date': '2010-04-01', 'people': 1047, 'hits': 4522}, {'date': '2010-04-03', 'people': 617, 'hits': 2582}, {'date': '2010-04-02', 'people': 736, 'hits': 3277}]
Suppose I have this list. How do I sort by "date", which is an item in the dictionary. But, "date" is a string...
...
Hi all,
I have a particular method that is occasionally crashing with an ArgumentException:
Destination array was not long enough. Check destIndex and length, and the array's lower bounds.:
at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
at Syste...
I have a list of Customers. Each customer has an address and some customers may actually have the same address. My ultimate goal is to group customers based on their address. I figure I could either put the customers in some sort of list-based structure and sort on the addresses, or I could drop the objects into some sort of map that all...