Search Results

Search found 31920 results on 1277 pages for 'favorites list'.

Page 14/1277 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Checkbox Images in List

    - by Bridget
    It seems like it should be a simple concept. I need a vertical list. This list has an image with a checkbox and pathname of that image underneath it. The user should be able to check the checkboxes of the images they want to appear in their "shopping cart". The images, checkbox label, and list are populated by an XmlList. How can I do this in Flex 3.5 and Actionscript and have a button that when clicked, display a list of the checked items??

    Read the article

  • Multithreaded linked list traversal

    - by Rob Bryce
    Given a (doubly) linked list of objects (C++), I have an operation that I would like multithread, to perform on each object. The cost of the operation is not uniform for each object. The linked list is the preferred storage for this set of objects for a variety of reasons. The 1st element in each object is the pointer to the next object; the 2nd element is the previous object in the list. I have solved the problem by building an array of nodes, and applying OpenMP. This gave decent performance. I then switched to my own threading routines (based off Windows primitives) and by using InterlockedIncrement() (acting on the index into the array), I can achieve higher overall CPU utilization and faster through-put. Essentially, the threads work by "leap-frog'ing" along the elements. My next approach to optimization is to try to eliminate creating/reusing the array of elements in my linked list. However, I'd like to continue with this "leap-frog" approach and somehow use some nonexistent routine that could be called "InterlockedCompareDereference" - to atomically compare against NULL (end of list) and conditionally dereference & store, returning the dereferenced value. I don't think InterlockedCompareExchangePointer() will work since I cannot atomically dereference the pointer and call this Interlocked() method. I've done some reading and others are suggesting critical sections or spin-locks. Critical sections seem heavy-weight here. I'm tempted to try spin-locks but I thought I'd first pose the question here and ask what other people are doing. I'm not convinced that the InterlockedCompareExchangePointer() method itself could be used like a spin-lock. Then one also has to consider acquire/release/fence semantics... Ideas? Thanks!

    Read the article

  • Beginning android: how to map a string to a list

    - by user569421
    I just finished the NotepadV1-3 tutorial for Android apps, and I was thinking of creating my own inventory app for fun, which for now basically consists of a list of names (such as "DVD" or "Grocery"), each of which can be clicked, which will bring up another specific list associated with that name. However, with the SQLiteDatabase.insert(..) method, the ContentValue can only take (among many others) "String, String" as argument, and I can't figure out how to input into the database a list of Strings associated with a particular key. I'm having trouble researching on how to resolve this as I am not that familiar with SQL. What would be the best way to store a key with its associated list of Strings? Any pointers and suggestions are appreciated! Android newb :[

    Read the article

  • removing elements incrementally from a list

    - by Javier
    Dear all, I've a list of float numbers and I would like to delete incrementally a set of elements in a given range of indexes, sth. like: for j in range(beginIndex, endIndex+1): print ("remove [%d] => val: %g" % (j, myList[j])) del myList[j] However, since I'm iterating over the same list, the indexes (range) are not valid any more for the new list. Does anybody has some suggestions on how to delete the elements properly? Best wishes

    Read the article

  • Adding nodes to a global linked-list

    - by Zack
    I am attempting to construct my first linked list, and having read a basic introduction, have done the following. Firstly, declare a linked list node as: struct errorNode { uint8 error; struct errorNode* next; }; Secondly, define the first node globally as: struct errorNode errorList = {0, NULL}; This has been done to allow each of the libraries that make up my current project to insert errors into a common list. The function to do this is: void errorListWrite(uint8 error) { struct errorNode* newNode = malloc(sizeof(struct errorNode)); newNode->error = error; newNode->next = &errorList; errorList = *newNode; } Whilst this compiles without error, it does not function as expected. I thnk the problem is with the last two statements of the list write function, but I am unsure. A hint as to what I am doing wrong would be most appreciated.

    Read the article

  • Good practice of using list of function in Python

    - by riskio
    I am pretty new to python and I discovered by myself that I can create a list of function and call with a for loop. example: def a(args): print "A" def b(args): print "B" def c(args): print "C " + str(args) functions = [a,b,c] for i in functions: i(1) So, my question is: is there any good practice or elegant way to use list of functions and what is a good use of all this? (do have a particular name the "list of functions"?) thank you

    Read the article

  • Fill a array with List data

    - by marionmaiden
    How can I fill a array with the data provided by one List? For example, I have a List with Strings: List l = new ArrayList<String>(); l.add("a"); l.add("b"); l.add("c"); then I want to copy this data into a String array: String[] array = ?

    Read the article

  • Forbid public Add and Delete for a List<T>

    - by aaginor
    Hi folks, in my C#-project, I have a class which contains a List public class MyClass { public MyClass parent; public List<MyClass> children; ... } I want to prevent the user of the class from Adding (and Deleting) an Element to the children-List, but he shall still be able to parse its elements. I want to handle the Adding and Deleting within MyClass, providing an AddChild(MyClass item) and DeleteChild(MyClass item) to ensure that, when an item is added to the child list, the parent of that item will be set properly. Any idea how to do this besides implementing my own IList? Thanks in advance, Frank

    Read the article

  • django template find value within list

    - by dotty
    Hay, how do i find a value with in python list in django's template system? example list = [1,2,3,4,5,6,7] x = 1 if x is in list: return u'found!' else: return u'not found' endif: Something along those lines. any help would be great

    Read the article

  • Can't remove first node in linked list

    - by carlmonday
    I'm trying to make a linked list class in python (pointless I know, but it's a learning exercise), and the method I have written to remove a node doesn't work if I try to remove the first element of the linked list. If the node to be removed is anywhere else in the linked list the method works fine. Can someone give me some insight as to where I've gone wrong? Here's my code thus far: class Node: def __init__(self, data=None, next=None): self.data = data self.next = next def __repr__(self): return repr(self.data) def printNodes(self): while self: print self.data self = self.next def removeNode(self, datum): """removes node from linked list""" if self.data == datum: return self.next while self.next: if self.next.data == datum: self.next = self.next.next return self self = self.next

    Read the article

  • Python - Create a list with initial capacity

    - by Claudiu
    Code like this often happens: l = [] while foo: #baz l.append(bar) #qux This is really slow if you're about to append thousands of elements to your list, as the list will have to constantly be re-initialized to grow. (I understand that lists aren't just wrappers around some array-type-thing, but something more complicated. I think this still applies, though; let me know if not). In Java, you can create an ArrayList with an initial capacity. If you have some idea how big your list will be, this will be a lot more efficient. I understand that code like this can often be re-factored into a list comprehension. If the for/while loop is very complicated, though, this is unfeasible. Is there any equivalent for us python programmers?

    Read the article

  • concurrent doubly-linked list (1 writer, n-readers)

    - by Arne
    Hi guys, I am back in the field of programming for my Diploma-thesis now and stumbled over the following issue: I need to implement a thread-safe doubly-linked list for one thread writing the list at any position (delete, insert, mutate node data) and one to many threads traversing and reading the list. I am well aware that mutexes can be used to serialize access to the list, still I presume that a naive lock around any write operation will be less than optimal. I am wondering whether there are better variants. (I am well aware that 'optimal' has not much of a practical meaning as long as no exact measure/profiling are available but this is an academic thesis after all..) I am very gratefull for code-samples as well as references to academic granted these have at least a tiny bit of practical relevance. Thanks at lot

    Read the article

  • Scrolling down an awt.List

    - by nico
    As from subject, I have an awt.List object. When I add something to the list I would like to scroll it down to show the last inserted object. For instance: myList.add("sometext"); myList.select(myList.getItemCount()-1); myList.showSelectedItem(); // Or something like that The documentation does not seem to list any method that does something like that, can anybody help please?

    Read the article

  • String contains all the elements of a list

    - by CSSS
    I am shifting to Python, and am still relatively new to the pythonic approach. I want to write a function that takes a string and a list and returns true if all the elements in the list occur in the string. This seemed fairly simple. However, I am facing some difficulties with it. The code goes something like this: def myfun(str,list): for a in list: if not a in str: return False return True Example : myfun('tomato',['t','o','m','a']) should return true myfun('potato',['t','o','m','a']) should return false myfun('tomato',['t','o','m']) should return true Also, I was hoping if someone could suggest a possible regex approach here. I am trying out my hands on them too.

    Read the article

  • Java: set-size List issue UnsupportedOperationException thrown

    - by tuckster
    I am having a problem changing a List that has a set-size in Java. I understand that I can't add or remove from this list but why can't I use set? When I use set the UnsupportedOperationException is thrown as well as when I use add and remove which is expected. set public Object set(int index, Object element) Replaces the element at the specified position in this list with the specified element (optional operation). I understand its an optional operation its just that want to replace that one element of the list with another element. Is there any way I can do this?

    Read the article

  • R: Print list to a text file

    - by pms
    I have in R a list like this: > print(head(mylist,2)) [[1]] [1] 234984 10354 41175 932711 426928 [[2]] [1] 1693237 13462 Each element of the list has different number of its elements. I would like to print this list to a text file like this: mylist.txt 234984 10354 41175 932711 426928 1693237 13462 I know that I can use sink(), but it prints names of elements [[x]], [y] and I want to avoid it. Also because of different number of elements in each element of the list it is not possible to use write() or write.table().

    Read the article

  • Where does one get data like Country:(list) State:(list)

    - by rlb.usa
    As a programmer of data-entry forms of all kinds, I often find myself making fields for things like Country: <choose from list>, State: <choose from list>, Race/Ethnicity: <choose from list>. Consider: Perhaps a list the 50 United States names is an easy thing to find (does one include DC?) , but the countries are not. Nearly every site you find has a differing list with all of the political goings on over the years, and they become outdated quickly. What's the best/common practice regarding population of these kinds of lists? Where does this data come from if it's not given in the specs?

    Read the article

  • Manually extracting portions of strings contained in a list (parsing)

    - by user1652011
    I'm aware that there are modules that fully simplify this function, but saying that I am running from a base install of python (standard modules only), how would I extract the following: I have a list. This list is the contents, line by line, of a webpage. Here is a mock up list (unformatted) for informative purposes: <script> link = "/scripts/playlists/1/" + a.id + "/0-5417069212.asx"; <script> "<a href="/apps/audio/?feedId=11065"><span class="px13">Eastern Metro Area Fire</span>" From the above string, I need the following extracted. The feedId (11065), which is incidentally a.id in the code above., "/scripts/playlists/1/" and "/0-5417069212.asx". Remembering that each of these lines is just contents from objects in a list, how would I go about extracting that data? Here is the full list: contents = urllib2.urlopen("http://www.radioreference.com/apps/audio/?ctid=5586") Pseudo: from urllib2 import urlopen as getpage page_contents = getpage("http://www.radioreference.com/apps/audio/?ctid=5586") feedID = % in (page_contents.search() for "/apps/audio/?feedId=%") titleID = % in (page_contents.search() for "<span class="px13">%</span>") playlistID = % in (page_contents.search() for "link = "%" + a.id + "*.asx";") asxID = * in (page_contents.search() for "link = "*" + a.id + "%.asx";") streamURL = "http://www.radioreference.com/" + playlistID + feedID + asxID + ".asx" I plan to format it as such that streamURL should = : http://www.radioreference.com/scripts/playlists/1/11065/0-5417067072.asx

    Read the article

  • Ask the Readers: What’s on Your Geeky Christmas List?

    - by Jason Fitzpatrick
    From tablets to replicas of Tattoine, visions of geeky and technology-loaded gifts surely dance in many of your heads. This week’s question is all about you and the loot you’d love to find in your stocking this year. Whether you’re dreaming of tech goodies like a new ultrabook or ebook reader, or of more geeky pursuits like a Star Trek themed chess set or a tour of Africa to visit abandoned Star Wars sets, we want to hear all about it. Don’t be bashful, hop into the comments and let loose with your wish list; check back on Friday for a What You Said roundup highlighting wishes from the endearing to the extravagant. Our Geek Trivia App for Windows 8 is Now Available Everywhere How To Boot Your Android Phone or Tablet Into Safe Mode HTG Explains: Does Your Android Phone Need an Antivirus?

    Read the article

  • How do I figure out the minimum number of swaps to sort a list in-place?

    - by sova
    In-place sorting is essentially swapping elements without using extra storage, correct? How can I find the minimum number of swaps required for a list? A C D Q R Z E // input | | | > > > <<< // movement A C D E Q R Z // output Swapping: A C D Q R Z E swap Q with E, ACDERZQ swap R with Q, ACDEQZR swap R with Z, ACDEQRZ. done. 3 swaps. Shifting items left or right is essentially swapping, but I want the optimal number for plucking an item out of line and switching its place with another.

    Read the article

  • LINQ query to find if items in a list are contained in another list

    - by cjohns
    I have the following code: List<string> test1 = new List<string> { "@bob.com", "@tom.com" }; List<string> test2 = new List<string> { "[email protected]", "[email protected]" }; I need to remove anyone in test2 that has @bob.com or @tom.com. What I have tried is this: bool bContained1 = test1.Contains(test2); bool bContained2 = test2.Contains(test1); bContained1 = false but bContained2 = true. I would prefer not to loop through each list but instead use a Linq query to retrieve the data. bContained1 is the same condition for the Linq query that I have created below: List<string> test3 = test1.Where(w => !test2.Contains(w)).ToList(); The query above works on an exact match but not partial matches. I have looked at other queries but I can find a close comparison to this with Linq. Any ideas or anywhere you can point me to would be a great help.

    Read the article

  • Link List Problem,

    - by david
    OK i have a problem with a Link List program i'm trying to Do, the link List is working fine. Here is my code #include <iostream> using namespace std; struct record { string word; struct record * link; }; typedef struct record node; node * insert_Node( node * head, node * previous, string key ); node * search( node *head, string key, int *found); void displayList(node *head); node * delete_node( node *head, node * previous, string key); int main() { node * previous, * head = NULL; int found = 0; string node1Data,newNodeData, nextData,lastData; //set up first node cout <<"Depature"<<endl; cin >>node1Data; previous = search( head, node1Data, &found); cout <<"Previous" <<previous<<endl; head = insert_Node(head, previous, node1Data); cout <<"Depature inserted"<<endl; //insert node between first node and head cout <<"Destination"<<endl; cin >>newNodeData; previous = search( head, newNodeData, &found); cout <<"Previous" <<previous<<endl; head = insert_Node(head, previous, newNodeData); cout <<"Destinationinserted"<<endl; //insert node between second node and head cout <<"Cost"<<endl; cin >>newNodeData; previous = search( head, newNodeData, &found); cout <<"Previous" <<previous<<endl; head = insert_Node(head, previous, newNodeData); cout <<"Cost inserted"<<endl; cout <<"Number of Seats Required"<<endl; //place node between new node and first node cin >>nextData; previous = search( head, nextData, &found); cout <<"Previous" <<previous<<endl; head = insert_Node(head, previous, nextData); cout <<"Number of Seats Required inserted"<<endl; //insert node between first node and head cout <<"Name"<<endl; cin >>newNodeData; previous = search( head, newNodeData, &found); cout <<"Previous" <<previous<<endl; head = insert_Node(head, previous, newNodeData); cout <<"Name inserted"<<endl; //insert node between node and head cout <<"Address "<<endl; cin >>newNodeData; previous = search( head, newNodeData, &found); cout <<"Previous" <<previous<<endl; head = insert_Node(head, previous, newNodeData); cout <<"Address inserted"<<endl; //place node as very last node cin >>lastData; previous = search( head, lastData, &found); cout <<"Previous" <<previous<<endl; head = insert_Node(head, previous, lastData); cout <<"C"<<endl; displayList(head); char Ans = 'y'; //Delete nodes do { cout <<"Enter Keyword to be delete"<<endl; cin >>nextData; previous = search( head, nextData, &found); if (found == 1) head = delete_node( head, previous,nextData); displayList(head); cout <<"Do you want to Delete more y /n "<<endl; cin >> Ans; } while( Ans =='y'); int choice, i=0, counter=0; int fclass[10]; int coach[10]; printf("Welcome to the booking program"); printf("\n-----------------"); do{ printf("\n Please pick one of the following option:"); printf("\n 1) Reserve a first class seat on Flight 101."); printf("\n 2) Reserve a coach seat on Flight 101."); printf("\n 3) Quit "); printf("\n ---------------------------------------------------------------------"); printf("\nYour choice?"); scanf("%d",&choice); switch(choice) { case 1: i++; if (i <10){ printf("Here is your seat: %d " , fclass[i]); } else if (i = 10) { printf("Sorry there is no more seats on First Class. Please wait for the next flight"); } break; case 2: if (i <10){ printf("Here is your Seat Coach: %d " , coach[i]); } else if ( i = 10) { printf("Sorry their is no more Seats on Coach. Please wait for the next flight"); } break; case 3: printf("Thank you and goodbye\n"); //exit(0); } } while (choice != 3); } /******************************************************* search function to return previous position of node ******************************************************/ node * search( node *head, string key, int *found) { node * previous, * current; current = head; previous = current; *found = 0;//not found //if (current->word < key) move through links until the next link //matches or current_word > key while( current !=NULL) { //compare exactly if (key ==current->word ) { *found = 1; break; } //if key is less than word else if ( key < current->word ) break; else { //previous stays one link behind current previous = current; current = previous -> link; } } return previous; } /******************************************************** display function as used with createList ******************************************************/ void displayList(node *head) { node * current; //current now contains the address held of the 1st node similar //to head current = head; cout << "\n\n"; if( current ==NULL) cout << "Empty List\n\n"; else { /*Keep going displaying the contents of the list and set current to the address of the next node. When set to null, there are no more nodes */ while(current !=NULL) { cout << current->word<<endl; current = current ->link; } } } /************************************************************ insert node used to position node (i) empty list head = NULL (ii) to position node before the first node key < head->word (iii) every other position including the end of the list This is done using the following steps (a) Pass in all the details to create the node either details or a whole record (b) Pass the details over to fill the node (C) Use the if statement to add the node to the list **********************************************************/ node * insert_Node( node * head, node * previous, string key ) { node * new_node, * temp; new_node = new node; //create the node new_node ->word = key; new_node -> link = NULL; if (head == NULL || key < head->word ) //empty list { //give address of head to temp temp = head; //head now points to the new_node head = new_node; //new_node now points to what head was pointing at new_node -> link = temp; } else { //pass address held in link to temp temp = previous-> link; //put address of new node to link of previous previous -> link = new_node; //pass address of temp to link of new node new_node -> link = temp; } return head; } node * delete_node( node *head, node * previous, string key) { /* this function will delete a node but will not return its contents */ node * temp; if(key == head->word) //delete node at head of list { temp = head; //point head at the next node head = head -> link; } else { //holds the address of the node after the one // to be deleted temp = previous-> link; /*assign the previous to the address of the present node to be deleted which holds the address of the next node */ previous-> link = previous-> link-> link; } delete temp; return head; }//end delete The problem i have is when i Enter in the Number 2 in the Node(Seats) i like to get a Counter Taken 2 off of 50, some thing like what i have here enter code here int choice, i=0, counter=0; int fclass[10]; int coach[10]; printf("Welcome to the booking program"); printf("\n-----------------"); do{ printf("\n Please pick one of the following option:"); printf("\n 1) Reserve a first class seat on Flight 101."); printf("\n 2) Reserve a coach seat on Flight 101."); printf("\n 3) Quit "); printf("\n ---------------------------------------------------------------------"); printf("\nYour choice?"); scanf("%d",&choice); switch(choice) { case 1: i++; if (i <10){ printf("Here is your seat: %d " , fclass[i]); } else if (i = 10) { printf("Sorry there is no more seats on First Class. Please wait for the next flight"); } break; case 2: if (i <10){ printf("Here is your Seat Coach: %d " , coach[i]); } else if ( i = 10) { printf("Sorry their is no more Seats on Coach. Please wait for the next flight"); } break; case 3: printf("Thank you and goodbye\n"); //exit(0); } } while (choice != 3); How can i get what the User enters into number of Seats into this function

    Read the article

  • Data base structure of a subscriber list

    - by foodil
    I am building a application that allow different user to store the subscriber information To store the subscriber information , the user first create a list For each list, there is a ListID. Subscriber may have different attribute : email phone fax .... For each list, their setting is different , so a require_attribute table is introduced. It is a bridge between subscriber and List That store Listid ,subid , attribute, datatype That means the system have a lot of list, each user have their own list, and the list have different attribute, some list have email , phone , some may have phone, address, name mail.. And the datatype is different, some may use 'name' as integer , some may use 'name' as varchar attribute means email phone, it is to define for which list have which subscriber attribute datatype means for each attribute, what is its datatype Table :subscriber : Field :subid , name,email Table :Require Attribute: Field : Listid ,subid , attribute, datatype The attribute here is {name, email} So a simple data is Subscriber: 1 , MYname, Myemail Require Attribute : Listid , 1 , 'email', 'intger' Listid , 1 , 'name', 'varchar' I found that this kind of storage is too complex too handle with, Since the subscriber is share to every body, so if a person want to change the datatype of name, it will also affect the data of the other user. Simple error situation: Subscriber: list1, Subscriber 1 , name1, email1 list2, Subscriber 2 , name2 , email2 Require Attribute : List1 , Subscriber 1 , 'email', 'varchar', List1 , Subscriber 1 , 'name', 'varchar', Listid , Subscriber 2 , 'email', 'varchar', Listid , Subscriber 2, 'name', 'integer', if user B change the data type of name in require attribute from varchar to integer, it cause a problem. becasue list 1 is own by user A , he want the datatype is varchar, but list 2 is won by user B , he want the datatype to be integer So how can i redesign the structure?

    Read the article

  • SharePoint: UI for ordering list items

    - by svdoever
    SharePoint list items have in the the base Item template a field named Order. This field is not shown by default. SharePoint 2007, 2010 and 2013 have a possibility to specify the order in a UI, using the _layouts page: {SiteUrl}/_layouts/Reorder.aspx?List={ListId} In SharePoint 2010 and 2013 it is possible to add a custom action to a list. It is possible to add a custom action to order list items as follows (SharePoint 2010 description): Open SharePoint Designer 2010 Navigate to a list Select Custom Actions > List Item Menu Fill in the dialog box: Open List Settings > Advanced Settings > Content Types, and set Allow management of content types to No  On List Settings select Column Ordering This results in the following UI in the browser: Selecting the custom Order Items action (under List Tools > Items) results in: You can change your custom action in SharePoint designer. On the list screen in the bottom right corner you can find the custom action: We now need to modify the view to include the order by adding the Order field to the view, and sorting on the Order field. Problem is that the Order field is hidden. It is possible to modify the schema of the Order field to set the Hidden attribute to FALSE. If we don’t want to write code to do it and still get the required result it is also possible to modify the view through SharePoint Designer: Modify the code of the view: This results in: Note that if you change the view through the web UI these changes are partly lost. If this is a problem modify the Order field schema for the list.

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >