Search Results

Search found 4616 results on 185 pages for 'lists'.

Page 7/185 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Different Types of Linked Lists!

    - by Jay
    What are the different types of Linked Lists which are commonly used? I know and have used the following: Singly Linked List Doubly Linked List Circular List What are the other kinds of lists that have been used by you or known to you?

    Read the article

  • Creating a list of lists with consecutive numbers

    - by Henrik
    I am looking for a convenient way to create a list of lists for which the lists within the list have consecutive numbers. So far I only came up with a very unsatisfying brute-typing force solution (yeah right, I just use python for a few weeks now): block0 = [] ... block4 = [] blocks = [block0,block1,block2,block4] I appreciate any help that works with something like nrBlocks = 4.

    Read the article

  • Maintaining property lists for xCode projects

    - by William Jockusch
    My project currently contains two largish property lists. One is currently 20KB; another is 8KB. So far, I have been maintaining them with xCode's property list editor. This is manageable but also a bit clunky. I am wondering if other people have better ways of doing this? So far, my lists consist of nested arrays of strings. The depth is not uniform.

    Read the article

  • Haskell lists difference

    - by user559354
    I'm trying make a lists difference. Found directly prelude operator \\\\ that makes lists difference. But errors Not in scope: '\\\\' occurs. Here is my simple from command line interpreter: Prelude> ([1,2,3] ++ [5,6]) -- works like expected [1,2,3,4,5,6] prelude> ([1,2,3] \\\\ [1,2]) -- erros occurs <interactive>:1:11: Not in scope: "\\\\" Thanks for explanation where I make a mistake.

    Read the article

  • concatenation of all combination from different Lists in c#

    - by shan
    i have a List and i m grouping it into different lists. like:-List("a","b","c","it","as","am","cat","can","bat") 3 list List1:-a,b,c List2:-it,as,am List3:-cat,can,bat how can i concat the all possible combination from this lists. output like: a,it,cat b,it,cat c,it,cat a,am,cat b,am,cat c,am,cat . . . . etc so on...

    Read the article

  • Prolog: How to make three lists the same lenght (by adding leading zeros)

    - by sixtyfootersdude
    I am writing a prolog program to solve a problem. The problem takes three lists as input: solve( [L|Lr] , [R|Rr] , [S|Sr] ) :- Unfortunately the lists all need to be equal length for the program to work. So these work: ?- solve( [A, B, C, D] , [1, 3, 5, 6], [E, F, G, H]). ?- solve( [1] , [2], [3]). But these do not: ?- solve( [A, B, C, D], [1], [B, I, T] ). ?- solve( [A], [1, 2], [4, 5]). What I would like to do is write a predicate(?) to pad the smaller lists with leading zeros. So: solve( [A, B, C, D], [1], [B, I, T] ) would become: solve( [A, B, C, D], [0, 0, 0, 1], [0, B, I, T] ) Any points on how to accomplish this would be awesome. I am from a functional background so I am struggling. Is there a way tell the length of a list? I think I could do that recursively, but it seems like a pain. Thanks

    Read the article

  • weird result with c# winForms array of Lists

    - by jello
    so I'm trying to store values in an array of Lists in C# winForms. In the for loop in which I make the sql statment, everything works fine: the message box outputs a different medication name each time. for (int i = 0; i < numberOfMeds; i++) { queryStr = "select * from biological where medication_name = '" + med_names[i] + "' and patient_id = " + patientID.patient_id; using (var conn = new SqlConnection(connStr)) using (var cmd = new SqlCommand(queryStr, conn)) { conn.Open(); using (SqlDataReader rdr = cmd.ExecuteReader()) { while (rdr.Read()) { medObject.medication_date = (DateTime)rdr["patient_history_date_bio"]; medObject.medication_name = rdr["medication_name"].ToString(); medObject.medication_dose = Convert.ToInt32(rdr["medication_dose"]); medsList[i].Add(medObject); } } conn.Close(); MedicationTimelineClass medObjectx = medsList[i][0] as MedicationTimelineClass; MessageBox.Show(medObjectx.medication_name); } } but then, when I take the message box code out of the loop, meaning that the array of Lists is supposed to be populated, I always get the same value: the last value entered. the same medication name, no matter what number I put between those brackets. It's like if the whole array of Lists is populated with the same data. for (int i = 0; i < numberOfMeds; i++) { queryStr = "select * from biological where medication_name = '" + med_names[i] + "' and patient_id = " + patientID.patient_id; using (var conn = new SqlConnection(connStr)) using (var cmd = new SqlCommand(queryStr, conn)) { conn.Open(); using (SqlDataReader rdr = cmd.ExecuteReader()) { while (rdr.Read()) { medObject.medication_date = (DateTime)rdr["patient_history_date_bio"]; medObject.medication_name = rdr["medication_name"].ToString(); medObject.medication_dose = Convert.ToInt32(rdr["medication_dose"]); medsList[i].Add(medObject); } } conn.Close(); } } MedicationTimelineClass medObjectx = medsList[0][0] as MedicationTimelineClass; MessageBox.Show(medObjectx.medication_name); what's going on here?

    Read the article

  • Doubly Linked Lists Implementation

    - by user552127
    Hi All, I have looked at most threads here about Doubly linked lists but still unclear about the following. I am practicing the Goodrich and Tamassia book in Java. About doubly linked lists, please correct me if I am wrong, it is different from a singly linked list in that a node could be inserted anywhere, not just after the head or after the tail using both the next and prev nodes available, while in singly linked lists, this insertion anywhere in the list is not possible ? If one wants to insert a node in a doubly linked list, then the default argument should be either the node after the to-be inserted node or node before the to-be inserted node ? But if this is so, then I don't understand how to pass the node before or after. Should we be displaying all nodes that were inserted till now and ask the user to select the node before or after which some new node is to be inserted ? My doubt is how to pass this default node. Because I assume that will require the next and prev nodes of these nodes as well. For e.g, Head<-A<-B<-C<-D<-E<-tail If Z is the new node to be inserted after say D, then how should node D be passed ? I am confused with this though it seems pretty simple to most. But pl do explain. Thanks, Sanjay

    Read the article

  • Ruby on Rails + Jquery: Saving data from draggable lists

    - by sjsc
    Hello. I'm trying to save data to the MySQL database in Rails when the user drags items from different lists. I'm using the below Jquery script and HTML: <script> $(document).ready(function() { $("#draggable").draggable( { connectToSortable: 'ul#myList', helper:'clone' } ); $("#myList").sortable(); }); </script> HTML: <ul> <li id="draggable">Drag me to myList</li> </ul> <ul id="myList"> <li id="item-1">item 1</li> <li id="item-2">item 2</li> </ul> I know I probably have to use something like this: $.post({ url: 'lists/update', data: $('#myList').sortable("serialize") }); I've been Googling for the last few hours but can't seem to find how to save data between multiple lists using Rails. Any idea?

    Read the article

  • Erlang list comprehension, traversing two lists and excluding values

    - by ErJab
    I need to generate a set of coordinates in Erlang. Given one coordinate, say (x,y) I need to generate (x-1, y-1), (x-1, y), (x-1, y+1), (x, y-1), (x, y+1), (x+1, y-1), (x+1, y), (x+1, y+1). Basically all surrounding coordinates EXCEPT the middle coordinate (x,y). To generate all the nine coordinates, I do this currently: [{X,Y} || X<-lists:seq(X-1,X+1), Y<-lists:seq(Y-1,Y+1)] But this generates all the values, including (X,Y). How do I exclude (X,Y) from the list using filters in the list comprehension?

    Read the article

  • AJAX, PHP, XML, and cascading drop-down lists

    - by Dave Jarvis
    What PHP libraries would you recommend to implement the following: Three dependent drop-down lists Three XML data sources AJAX-based Essentially, I'd like to create an XML database and wire up a form that allows the user to select three different dependent parameters: User clicks Region User clicks District (filtered by Region) User clicks Station (filtered by District) Even though I would like to use PHP and XML, the general problem is: One XHTML form Three dependent, cascading drop-down lists Three flat files (no relational database) for the list data The solution must be efficient, simple, reliable, and cross-browser. What technologies would you recommend to solve the problem? Thank you!

    Read the article

  • Enumerating all combinations of lists of different types

    - by jball
    Given two IEnumberables of different types, what is the best practice (considering readability and maintainability) for iterating over both lists to perform an action on all possible combinations? My initial solution was to use nested foreach loops, iterating over the first IEnumerable, and then within that loop, iterating over the second IEnumerable and passing the value from the outer and the current loop into the target method. Eg.: enum ParamOne { First, Second, Etc } List<int> paramTwo = new List<int>() { 1, 2, 3 }; void LoopExample() { foreach (ParamOne alpha in Enum.GetValues(typeof(ParamOne))) { foreach (int beta in paramTwo) { DoSomething(alpha, beta); } } } I tried to restructure it with LINQ, but ended up with something that had no obvious advantages and seemed less intuitive. A search here shows lots of questions about nesting foreachs to iterate over child properties, but I couldn't find anything about iterating over two distinct lists.

    Read the article

  • Use LINQ to count the number of combinations existing in two lists

    - by Ben McCormack
    I'm trying to create a LINQ query (or queries) that count the total number of occurences of a combinations of items in one list that exist in a different list. For example, take the following lists: CartItems DiscountItems ========= ============= AAA AAA AAA BBB AAA BBB BBB CCC CCC DDD The result of the query operation should be 2 since I can find two combinations of AAA and BBB (from DiscountItems) within the contents of CartItems. My thinking in approaching the query is to join the lists together to shorten CartItems to only include items from DiscountItems. The solution would be to find the CartItem in the resulting query that occurs the least amount of times, thus indicating how many combinations of items exist in CartItems. How can this be done? Here's the query I already have, but it's not working. query results in an enumeration with 100 items, far more than I expected. Dim query = From cartItem In Cart.CartItems Group Join discountItem In DiscountGroup.DiscountItems On cartItem.SKU Equals discountItem.SKU Into Group Select SKU = cartItem.SKU, CartItems = Group Return query.Min(Function(x) x.CartItems.Sum(Function(y) y.Quantity))

    Read the article

  • In Python, are there builtin functions for elementwise map of boolean operators over tuples of lists

    - by bshanks
    For example, if you have n lists of bools of the same length, then elementwise boolean AND should return another list of that length that has True in those positions where all the input lists have True, and False everywhere else. It's pretty easy to write, i just would prefer to use a builtin if one exists (for the sake of standardization/readability). Here's an implementation of elementwise AND: def eAnd(*args): return [all(tuple) for tuple in zip(*args)] example usage: >>> eAnd([True, False, True, False, True], [True, True, False, False, True], [True, True, False, False, True]) [True, False, False, False, True] thx

    Read the article

  • Lists Hash function

    - by John Retallack
    I'm trying to make a hash function so I can tell if too lists with same sizes contain the same elements. For exemple this is what I want: f((1 2 3))=f((1 3 2))=f((2 1 3))=f((2 3 1))=f((3 1 2))=f((3 2 1)). Any ideea how can I approch this problem ? I've tried doing the sum of squares of all elements but it turned out that there are collisions,for exemple f((2 2 5))=33=f((1 4 4)) which is wrong as the lists are not the same. I'm looking for a simple approach it there are any.

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >