List.nth is 'T list - int - 'T, rather than the standard int - 'T list - 'T like Seq.nth.
This makes pipeline somewhat awkward.
Is there something behind the scene?
I don't know why.
I need to let my users enter a variable length listof items into something that looks like a grid view (or a series of standard text boxes stacked vertically). Each item could be a few characters or a few hundred characters long, and I just want them to enter a "sentence", and then tab to the next row, and always having another blank one ready to go at the bottom of the list.
I don't want to save any data to my SQL Server DB until they enter the entire list and then click on a "save all" button.
When they hit the "save all" button they will be given a preview screen where the data will be presented as standard HTML ordered list.
If they confirm/save, then each row of the grid will then be saved as a separate row into my SQL Server database (with an index to remember the order).
What ASP.Net (or Jquery/javascript) UI control would be the best to use in this situation?
i'm trying to get a listof the most recent used applications. NSWorkspace returns me a listof active applications and i can sort them on a few options using NSRunningApplication. see list below:
launchDate
finishedLaunching
processIdentifier
i dont want the lauch date but the recent 'active' date (like the way cmd-tab sorts).
Does anyone knows the solution for this?
This should probably be pretty simple but my Google-Fu is as yet unable to find an answer. I simply want to create a dropdown list in Access so that upon selection I can perform some action based on the value of the selection. For instance, I have a listof people and I would like to populate the combo box so that their names appear in the list but the "value" is set to their ID (the primary key).
How is it possible to randomly choose a number from a list with n elements, n time without picking the same element of the list twice. I wrote a code to choose the sequence number of the elements in the list but it is slow:
>>>redshift=np.array([0.92,0.17,0.51,1.33,....,0.41,0.82])
>>>redshift.shape
(1225,)
exclude=[]
k=0
ng=1225
while (k < ng):
flag1=0
sq=random.randint(0, ng)
while (flag1<1):
if sq in exclude:
flag1=1
sq=random.randint(0, ng)
else:
print sq
exclude.append(sq)
flag1=0
z=redshift[sq]
k+=1
It doesn't choose all the sequence number of elements in the list.
I have a listof items sorted alphabetically:
list = [a,b,c,d,e,f,g,h,i,j]
I'm able to output the list in an html table horizonally like so:
| a , b , c , d |
| e , f , g , h |
| i , j , , |
What's the algorithm to create the table vertically like this:
| a , d , g , j |
| b , e , h , |
| c , f , i , |
I'm using python, but your answer can be in any language or even pseudocode.
Thanks
I have an application that requires we use distinct user connection strings per user. We are trying to upgrade from SubSonic 2.x to 3.0. I'm running into issues with trying to create a List< of objects. When I try to create a List like this:
List<table_name> oList = table_name.All().Where(tn => tn.table_id == TableId).ToList();
I get the error "Connection string 'ConnectionStringName' does not exist."
So, I try to create the List< like this:
List<table_name> oList = table_name.All(sConnectionString, "System.Data.SqlClient").Where(tn => tn.table_id == TableId).ToList();
I get the error "The name 'table_name' does not exist in the current context."
I'm using SQL Server, and the sConnectionString is definitely verified to be a good connection string, and the table_name is a table in the database. What am I doing wrong?
So like the title says im starting to learn some python and im having trouble picking up on this technique. What I need to accomplish is to read in some numbers and store them in a list. The text file looks like the following:
0 0 3 50
50 100 4 20
Basically these are coordinates and directions to be used for python's turtle to make shapes. I got that part down the only problem is getting them in a correct format. So what I can not figure out is how to get those numbers from the file into [ [0, 0, 3, 50], [50, 100, 4, 20] ]
A list, with each four coordinates being a list in that one big list.
Heres my attempt but it as I said I need some help - thank you.
polyShape=[]
infile = open(name,"r")
num = int(infile.readline(2))
while num != "":
polyShape.append(num)
num = int(infile.readline(2))
infile.close()
The err part is Capitalized in the code, it also comes in foreaching. Because of the abstract list, it cannot be initialized, declaration is in a static field. The lists have the same type.
import java.util.*;
public class Test
{
public static final List<String> highPrio = Arrays.asList("*","/");
public static List<String> ops;
public static void main(String[] args)
{
//ERROR HERE, why do it throw nullPointer?
ops.addAll(highPrio);
for(String s : ops)
{
System.out.println(s);
}
}
}
Hi,
I have a sharepoint List.We will get the data from TEAMCENTER from there we will enter manually into the List.
Inorder to automatically update the sharepoint List with Teamcenter data is there any way????
I have a IList. where the object PersonDetails consists of the persons name, address and phone number. The list consists of more than 1000 person details. I would like to display 50 PersonDetails per page. Is there a way to select only 50 elements from the list, and return them.
For example.
myList.select(1,50)
myList.select(51, 100)
I am able to select only first 50 by using. myList.Take(50);
The entire list is at the wcf service, and i would like to get only fifty elements at a time.
I ran into following situation and I am wondering about best solution. Let's say I have List<Object1> and List<Object2>, these lists are result of two separated queries. Both of them have the same size and there is relationship 1:1 between elements in the lists based on ID. I know that best solution would be fetching data in one DB query but that's possible right now.
So my question is, what is the best way to join these lists into let's say List<Object3>?
I am trying to make a real-time data collection application that has timed task. Each task can have a different or the same update period. I would like to store the task with the common update period in a list where I can iterate through it and call the function that I registered in the list. How would I go about adding callbacks to a data structure like a list or vector? Can I store slots in them?
I have a large database table in SQLExpress on Windows, with a particular field of interest 'code'.
I have an Apache web server with MySQL on Linux. The web application on the Linux box needs access to the listof all codes. The only thing it will use the list for is checking for the existence of a given code.
Having the Linux server call out to the Windows server is impractical as the Windows server is behind a NAT'ed office internet connection, and it may not always be accessible. I have set it so the Windows server will push the listof codes to the web server by means of a simple HTTP POST request. However, at this point I have not implemented the storage of the codes on the Linux box.
Should I store them in a MySQL table with a single field 'code'? Then I get fast indexed lookups O(1), however I think synchronization will be an issue - given an updated listof codes, pushed from the Windows box, how would I optimally synchronize the list with the database? TRUNCATE, followed by INSERT?
Should I instead store them in a flat file? Then I have O(n) look up time rather than O(1). Additionally an extra constant-time overhead too, as I will be processing the file in Ruby. However, synchronization is easy - simply replace the file.
I need to walk a link list in the kernel debugger. How can I determine the head pointer and walk the list?
I have a listing and can find the address and location in the code where I check to see if I have a head, so I know the specific code location and address. But not sure how to determine the pointer or how to determine the next element and pointer on the list.
Hi, I've got a listof 'double' values. I need to select every 6th record. It's a listof coordinates, where I need to get the minimum and maximum value of every 6th value.
Listof coordinates (sample): [2.1, 4.3, 1.0, 7.1, 10.6, 39.23, 0.5, ... ]
with hundrets of coordinates.
Result should look like: [x_min, y_min, z_min, x_max, y_max, z_max]
with exactly 6 coordinates.
Following code works, but it takes to long to iterate over all coordinates. I'd like to use Linq instead (maybe faster?)
for (int i = 0; i < 6; i++)
{
List<double> coordinateRange = new List<double>();
for (int j = i; j < allCoordinates.Count(); j = j + 6)
coordinateRange.Add(allCoordinates[j]);
if (i < 3) boundingBox.Add(coordinateRange.Min());
else boundingBox.Add(coordinateRange.Max());
}
Any suggestions?
Many thanks! Greets!
Hi,
im using $this-widgetSchema-setFormFormatterName('list'); this way
below to render my form as a list but it is still a table. Any idea?
public function configure()
{
parent::configure();
$this->widgetSchema->setFormFormatterName('list');
}
}
Any idea?
Javi
My friends were having discussion on nested lists of objects in LINQ and when I asked what does that mean, they laughed :(
Can anyone here tell what is nested list. is it same like list inside list? Thank you to all who help me
I have a listof 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 allows multiple values per key.
I will now make a pretty picture:
List:
A1 - C1, A1 - C2, A2 - C3, A3 - C4, A3 - C5
Map:
A1 A2 A3
C1 C3 C4
C2 C5
Which option (or any others) do you see as the best solution? Are there any existing classes that will make development easier?
i have two lists:
List<comparerobj> list_c = new List<comparerobj>();
List<comparerobj> list_b = new List<comparerobj>();
i'm filling lists somehow
then i'm trying to find elements in list_b which list_c doesnt contain:
foreach (comparerobj b in list_b)
{
bool lc = !list_c.Contains(b);
if (lc != true)
{
data.Add(b);
}
}
but for any b i'm getting that lc = true. what am i doing wrong?
When using Java LinkedList how do you find out the element's next or previous relationships?
I mean, in a regular linked list I would do something like this:
Node node1 = new Node();
Node node2 = new Node();
LinkedList list = new LinkedList();
list.add(node1);
list.add(node2);
//then my node1 will know who it's next is:
assertEquals(node2, node1.next());
But in Java's LinkedList, the data does not seem to be modified. So how do I actually find out who the "next" (or "previous" in the case of doubly-linked lists) element is?
Hi,
I have an application (.Net 3.5) which creates threads to write something to the database so that the GUI does not block. All created threads are added to a list, so that I can wait (Thread.Join) for each thread when the application is closed (maybe not all threads are finished when the application is closed, so the app must wait for them).
Because of the list I get some serious problems if there are too many threads created (OutOfMemoryException). I tried removing finished threads from the list, but somehow that didn't work.
Are there better ways to manage a listof threads, so I can remove them once they are finished?
I've got two List<Name>s:
public class Name
{
public string NameText {get;set;}
public Gender Gender { get; set; }
}
public class Gender
{
public decimal MaleFrequency { get; set; }
public decimal MaleCumulativeFrequency { get; set; }
public decimal FemaleCumulativeFrequency { get; set; }
public decimal FemaleFrequency { get; set; }
}
If the NameText property matches, I'd like to take the FemaleFrequency and FemaleCumulativeFrequency from the listof female Names and the MaleFrequency and MaleCumulativeFrequency values from the listof male Names and create one listof Names with all four properties populated.
What's the easiest way to go about this in C# using .Net 3.5?
I switch in Xcode between working on a lot of different projects frequently (some I'm actively working on, some are old projects where I'm looking up code I want to re-use or quote in SO answers :)), so that part of my "working set" of projects invariably ends up falling off the recent project list. I do use finder tabs for the full working set of current project folders, but I really like the fast switching available using the recent projects list.
Is there a way to increase the length of this list so that I can see more recently opened projects?