Yes, I have read most of the topics here, but I can't find an answer that works.
I have Three drop-down lists. The first is databound to grab distinct experiment names. The user selects, page posts back, and the second drop-down menu displays distinct time points. This is where I need help. I need to add an item to THAT drop-down list w...
R newbie question:
I have two variables, key and value, and I want to add them as a key/value pair to a list:
> key = "width"
> value = 32
> mylist = list()
> mylist$key = value
The result is this:
> mylist
$key
[1] 32
But I would like this instead:
> mylist
$width
[1] 32
How can I do this?
...
I have a div that is 320px wide. I'm floating list items to the left, each with a width of 100px. I then want to have a right margin of 10px to the right of each list item. All other margins and padding has been removed.
So, I bascially want 3 list items per row before it goes onto the next line. But because there is a margin-right on t...
By which I mean a structure with:
O(log n) complexity for x.push() operations
O(log n) complexity to find an element
O(n) complexity to compute list(x) which will be sorted
I also had a related question about performance of list(...).insert(...) which is now here.
...
I thought about the following question about computer's architecture. Suppose I do in Python
from bisect import bisect
index = bisect(x, a) # O(log n) (also, shouldn't it be a standard list function?)
x.insert(index, a) # O(1) + memcpy()
which takes log n, plus, if I correctly understand it, a memory copy operation for x[...
I'm working on an application, and I have a screen that in my mind, looks a lot like the Wireless Network List in Windows Vista. For those who are unaware, its basically a listview, but in each row, instead of a line of text, there's a large 'panel' that contains all sorts of useful information. Does anyone know if that's an actual UI ...
Can anyone explain why isn't the operator[] implemented for a std::list? I've searched around a bit but haven't found an answer. It wouldn't be too hard to implement or am I missing something?
...
Hi.
I'm trying to implement my own List system in Java.
the List class file :
package RoutingDemo.List;
/**
* A 2-way Linked-List to store generic elements.
*
*/
public class List {
/*
Instance Variables
---------------------------------------------------------------------------
*/
/**
* Reference to el...
how can I find last node of a circular linked list whose size I dont know and the last node points to any other node except first node of the linked list?
...
I'm curious. What could be the reason that a Comparator shuffles entries on each
application start?
final static class ContactsListComparator implements Comparator
{
public int compare(Object o1, Object o2)
{
if((o1.toString().compareTo(o2.toString()))<0)
{
return -1;
}
if((o1.toString().compareT...
Hello everyone,
I have a few questions concerning Lists, classes and variables in clojure.
This may seem quite stupid but how do I access elements in a List ?
I'm coding a program that allows you to manipulate a phonebook; You can add an entry, delete one or print the information about one. This leads me to two questions :
Is the...
I'm working on a GUI in SDL. I've created a slave/master class that contains a std::list of pointers to it's own slaves to create a heirarchy in the GUI (window containing buttons. Button a label and so on). It worked fine for a good while, until I edited a completely different class that doesn't effect the slave/master class directly. T...
Hi,
I have a button user control, on which I've created a property, UserRights, which I use to define the rights a user must have before the button is enabled. These rights are defined as public constants in a class called UserRight (I don't use Enum for some special code design reasons).
So, what I would like to achive is this:
<hmk:...
Hi All,
I have a question about the priority of CSS classes after encountering a problem today. The situation is as follows:
I have an unordered list which has a class associated with it. The LI tags has some styles defined too. I want to change the styling of the LIs after a click (a "selected" class) but the added class's styles are...
In my application, _collection is a List from which I need to remove all User objects which do not match the criteria.
However, the following code gets an invalid operation error in its second iteration since the _collection itself has been changed:
foreach (User user in _collection)
{
if (!user.IsApproved())
{
_collect...
With the String class, you can do:
string text = new string('x', 5);
//text is "xxxxx"
What's the shortest way to create a List< T > that is full of n elements which are all the same reference?
...
Title says it all,
here's the code :
(def entry {:name tempName :num tempNum})
(def tempList '(entry))
(println (get (nth tempList 0) (:name)))
Exception in thread "main" java.lang.IllegalArgumentException: Wrong number of args passed to keyword: :name
In this bit of code, I define a map called entry containing a :name and a :num...
What is the equivalent list comprehension in python of the following Common Lisp code:
(loop for x = input then (if (evenp x)
(/ x 2)
(+1 (* 3 x)))
collect x
until (= x 1))
...
Hi, I am a beginner in Clojure, and I have a simple (stupid) question.
I am trying to to read 4 user input , and then storing those inputs into a List
this is my code:
(def in1 (read-line))
(def in2 (read-line))
(def in3 (read-line))
(def in4 (read-line))
(def mylist '(in1 in2 in3 in4))
However, when i print the list, it gives...
Is it possible to use LINQ to retrieve a list that may contain nulls.
For example if I have a left outer join like so:
var query= from c in db.Customers
join o in db.Orders
on c.CustomerID equals o.CustomerID into sr
from x in sr.DefaultIfEmpty()
select x.OrderId;
Ho...