Search Results

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

Page 28/185 | < Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >

  • Why does Python Array Module Process Strings and Lists Differently?

    - by Casey
    I'm having trouble understanding the result of the following statements: >>> from array import array >>> array('L',[0xff,0xff,0xff,0xff]) array('L', [255L, 255L, 255L, 255L]) >>> from array import array >>> array('L','\xff\xff\xff\xff') Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: string length not a multiple of item size

    Read the article

  • Upgrade Ubuntu 11.10 to 12.10

    - by Daniel Minassian
    To whoever can help, I want to update the ubuntu on my laptop to 12.10 from the current version 11.10, when i click on the update manager i get a partial update gui, if i click cancel on that i get the gui for update which has three buttons check, install updates and upgrade. The upgrade button upgrades only to 12.04.1.LTS, when i press check it checks and gives me this error "W:Failed to fetch h t t p://lb.archive.ubuntu.com/ubuntu/dists/precise/main/i18n/Index No Hash entry in Release file /var/lib/apt/lists/partial/lb.archive.ubuntu.com_ubuntu_dists_precise_main_i18n_Index , W:Failed to fetch h t t p://lb.archive.ubuntu.com/ubuntu/dists/precise/multiverse/i18n/Index No Hash entry in Release file /var/lib/apt/lists/partial/lb.archive.ubuntu.com_ubuntu_dists_precise_multiverse_i18n_Index , W:Failed to fetch http://lb.archive.ubuntu.com/ubuntu/dists/precise/restricted/i18n/Index No Hash entry in Release file /var/lib/apt/lists/partial/lb.archive.ubuntu.com_ubuntu_dists_precise_restricted_i18n_Index , W:Failed to fetch http://lb.archive.ubuntu.com/ubuntu/dists/precise/universe/i18n/Index No Hash entry in Release file /var/lib/apt/lists/partial/lb.archive.ubuntu.com_ubuntu_dists_precise_universe_i18n_Index , E:Some index files failed to download. They have been ignored, or old ones used instead." Thank you for your time and help, Daniel Minassian

    Read the article

  • Sync Google Calendar with SharePoint Calendar

    - by dataintegration
    The ADO.NET Providers for Google and SharePoint make it easy to retrieve and update data in both Google's web services and SharePoint. This article shows how the SQL interface to data makes it easy to build applications that need to move data from one source to another. The application described here is a demo Windows application that synchronizes calendar events between Google and SharePoint, but the RSSBus Providers can be used to achieve integrations on both the .NET and the Java platforms, including more sophisticated features like full automation. Getting the Events Step 1: Google accounts can have several calendars. Obtain a list of a user's Google Calendars by issuing a query to the Calendars table. For example: SELECT * FROM Calendars. Step 2: In order to get a list of the events from a given Google Calendar, issue a query to the CalendarEvents table while specifying the CalendarId from the Calendars table. The resulting events can be further filtered by using the StartDateTime or EndDateTime columns. For example: SELECT * FROM CalendarEvents WHERE (CalendarId = '[email protected]') AND (StartDateTime >= '1/1/2012') AND (StartDateTime <= '2/1/2012') Step 3: SharePoint stores data in Lists. There are various types of lists, e.g., document lists and calendar lists. A SharePoint account can have several lists of the same type. To find all the calendar lists in SharePoint, use the ListLists stored procedure and inspect the BaseTemplate column. Step 4: The SharePoint data provider models each SharPoint list as a table. Get the events in a particular calendar by querying the table with the same name as the list. The events may be filtered further by specifying the EventDate or EndDate columns. For example: SELECT * FROM Calendar WHERE (EventDate >= '1/1/2012') AND (EventDate <= '2/1/2012') Synchronizing the Events Synchronizing the events is a simple process. Once the events from Google and SharePoint are available they can be compared and synchronized based on user preference. The sample application does this based on user input, but it is easy to create one that does the synchronization automatically. The INSERT, UPDATE, and DELETE statements available in both data providers makes it easy to create, update, or delete events as needed. Pre-Built Demo Application The executable for the demo application can be downloaded here. Note that this demo is built using BETA builds of the ADO.NET Provider for Google V2 and ADO.NET Provider for SharePoint V2, and will expire in 2013. Source Code You can download the full source of the demo application here. You will need the Google ADO.NET Data Provider V2 and the SharePoint ADO.NET Data Provider V2, which can be obtained here.

    Read the article

  • Is it valid syntax to have ordered and unordered lists in sequence in markdown?

    - by nfm
    I just wrote some markdown and it doesn't seem to render correctly. Is it legal syntax to have an ordered list, followed by newlines, then followed by an unordered list? Or is this a bug in bluecloth? For example: 1. One 2. Two 3. Three * Apple * Banana * Carrot Bluecloth creates a single <ul> and nests apple, banana and carrot as <li>'s under it. Stackoverflow's markdown parser does this too. Am I just doing it wrong? Surely this is a common usage case...

    Read the article

  • Why does Python array moduel handle strings and lists differently?

    - by Casey
    I'm having trouble understanding the result of the following statements: >>> from array import array >>> array('L',[0xff,0xff,0xff,0xff]) array('L', [255L, 255L, 255L, 255L]) >>> from array import array >>> array('L','\xff\xff\xff\xff') Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: string length not a multiple of item size

    Read the article

  • Dependency problems installing wine 1.5 on ubuntu 12.04 x64

    - by Moreno
    I tried: $ sudo add-apt-repository ppa:ubuntu-wine/ppa $ sudo apt-get update $ sudo apt-get install wine1.5 result was: $ sudo apt-get install wine1.5 Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: wine1.5 : Depends: wine1.5-i386 (= 1.5.6-0ubuntu1~pulse17) E: Unable to correct problems, you have held broken packages. then I tried: $ sudo dpkg --configure -a $ sudo apt-get install -f result was: $ sudo apt-get install -f Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. after all I tried: $ sudo apt-get build-dep wine1.5 Reading package lists... Done Building dependency tree Reading state information... Done The following packages have unmet dependencies: libgnutls-dev : Depends: libgnutls26 (= 2.12.14-5ubuntu3) but 2.12.19-1 is to be installed Depends: libgnutlsxx27 (= 2.12.14-5ubuntu3) but it is not going to be installed Depends: libgnutls-openssl27 (= 2.12.14-5ubuntu3) but it is not going to be installed E: Build-dependencies for wine1.5 could not be satisfied. also tried: $ sudo apt-get install -y ia32-libs Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: ia32-libs : Depends: ia32-libs-multiarch E: Unable to correct problems, you have held broken packages. Using synaptic: using ubuntu software center (USC): Somebody can help me? Thanks. Trying again: $ sudo dpkg --configure -a $ sudo apt-get install -f Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded. $ sudo apt-get install wine1.5 Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: wine1.5 : Depends: wine1.5-i386 (= 1.5.10-0ubuntu1~pulse19+build4) E: Unable to correct problems, you have held broken packages.

    Read the article

  • How does one control select lists using form API ?

    - by user363036
    I know this is somewhat of a newb question but I am running into a deadline and 3 days of Drupal experience will just not cut it... $form['gender'] = array('#type' = 'select', '#title' = t('Gender: *'), '#options' = array(t('Male'), t('Female')), '#required' = TRUE, '#weight' = 2, ); How do I assign values to select values ? For example Male - 'm' and Female- 'f'. Also how do I give the select box a default caption "please select gender..." Thanks guys

    Read the article

  • Modified map2 (without truncation of lists) in F# - how to do it idiomatically?

    - by Maciej Piechotka
    I'd like to rewrite such function into F#: zipWith' :: (a -> b -> c) -> (a -> c) -> (b -> c) -> [a] -> [b] -> [c] zipWith' _ _ h [] bs = h `map` bs zipWith' _ g _ as [] = g `map` as zipWith' f g h (a:as) (b:bs) = f a b:zipWith f g h as bs My first attempt was: let inline private map2' (xs : seq<'T>) (ys : seq<'U>) (f : 'T -> 'U -> 'S) (g : 'T -> 'S) (h : 'U -> 'S) = let xenum = xs.GetEnumerator() let yenum = ys.GetEnumerator() seq { let rec rest (zenum : IEnumerator<'A>) (i : 'A -> 'S) = seq { yield i(zenum.Current) if zenum.MoveNext() then yield! (rest zenum i) else zenum.Dispose() } let rec merge () = seq { if xenum.MoveNext() then if yenum.MoveNext() then yield (f xenum.Current yenum.Current); yield! (merge ()) else yenum.Dispose(); yield! (rest xenum g) else xenum.Dispose() if yenum.MoveNext() then yield! (rest yenum h) else yenum.Dispose() } yield! (merge ()) } However it can hardly be considered idiomatic. I heard about LazyList but I cannot find it anywhere.

    Read the article

  • {12.04} cannot open software center or use apt-get install

    - by d6braun
    i have been trying to get it working for over an hour and a half now, the code below is what i keep getting. the example is from me trying to install synaptic, but i get the errors on most apt-get commands and update manager. sudo apt-get install synaptic Reading package lists... Error! E: Encountered a section with no Package: header E: Problem with MergeList /var/lib/apt/lists/wine.budgetdedicated.com_apt_dists_edgy_main_binary-i386_Packages E: The package lists or status file could not be parsed or opened.

    Read the article

  • Removing items from lists and all references to them.

    - by LiamV
    I'm facing a situation where I have dependent objects and I would like to be able to remove an object and all references to it. Say I have an object structure like the code below, with a Branch type which references two Nodes. public class Node { // Has Some Data! } public class Branch { // Contains references to Nodes public Node NodeA public Node NodeB } public class Graph { public List<Node> Nodes; public List<Branch> Branches; } If I remove a Node from the Nodes list in the Graph class, it is still possible that one or more Branch objects still contains a reference to the removed Node, thus retaining it in memory, whereas really what I would quite like would be to set any references to the removed Node to null and let the garbage collection kick in. Other than enumerating through each Branch and checking each Node reference sequentially, are there any smart ideas on how I remove references to the Node in each Branch instance AND indeed any other class which reference the removed Node?

    Read the article

  • C++ linked list based tree structure. Sanely move nodes between lists.

    - by krunk
    The requirements: Each Node in the list must contain a reference to its previous sibling Each Node in the list must contain a reference to its next sibling Each Node may have a list of child nodes Each child Node must have a reference to its parent node Basically what we have is a tree structure of arbitrary depth and length. Something like: -root(NULL) --Node1 ----ChildNode1 ------ChildOfChild --------AnotherChild ----ChildNode2 --Node2 ----ChildNode1 ------ChildOfChild ----ChildNode2 ------ChildOfChild --Node3 ----ChildNode1 ----ChildNode2 Given any individual node, you need to be able to either traverse its siblings. the children, or up the tree to the root node. A Node ends up looking something like this: class Node { Node* previoius; Node* next; Node* child; Node* parent; } I have a container class that stores these and provides STL iterators. It performs your typical linked list accessors. So insertAfter looks like: void insertAfter(Node* after, Node* newNode) { Node* next = after->next; after->next = newNode; newNode->previous = after; next->previous = newNode; newNode->next = next; newNode->parent = after->parent; } That's the setup, now for the question. How would one move a node (and its children etc) to another list without leaving the previous list dangling? For example, if Node* myNode exists in ListOne and I want to append it to listTwo. Using pointers, listOne is left with a hole in its list since the next and previous pointers are changed. One solution is pass by value of the appended Node. So our insertAfter method would become: void insertAfter(Node* after, Node newNode); This seems like an awkward syntax. Another option is doing the copying internally, so you'd have: void insertAfter(Node* after, const Node* newNode) { Node *new_node = new Node(*newNode); Node* next = after->next; after->next = new_node; new_node->previous = after; next->previous = new_node; new_node->next = next; new_node->parent = after->parent; } Finally, you might create a moveNode method for moving and prevent raw insertion or appending of a node that already has been assigned siblings and parents. // default pointer value is 0 in constructor and a operator bool(..) // is defined for the Node bool isInList(const Node* node) const { return (node->previous || node->next || node->parent); } // then in insertAfter and friends if(isInList(newNode) // throw some error and bail I thought I'd toss this out there and see what folks came up with.

    Read the article

  • How do I change the list using mutable lists in Racket or Scheme?

    - by exOne
    I need your help Can anyone help me? first question This procedure should modify each element which’s index in the list is even. The value of the element should be equal to the new-element. For example: (define number-list (1 56 8 1 43 9 78)) (modify-even-indices number-list 10) The new list: 1 10 8 10 43 10 78 second question This problem is the extended version of Question 1. (modify-even-odd-indices my-list new-element modification-type) This procedure should modify each element according to the modification-type. The modification-type can be even or odd. For example: (define number-list (1 56 8 1 43 9 78)) (modify-even-odd-indices number-list 10 ‘even’) The new list: 1 10 8 10 43 10 78 (modify-even-odd-indices number-list 10 ‘odd’) The new list: 10 56 10 1 10 9 10

    Read the article

  • What do I do for dependencies installing wine1.7 on 14.04

    - by user285207
    user@chrubuntu:~$ sudo apt-get install wine1.7 [sudo] password for user: user Sorry, try again. [sudo] password for user: Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: wine1.7 : Depends: wine1.7-i386 (= 1:1.7.19-0ubuntu2~trusty2) but it is not installable Recommends: gnome-exe-thumbnailer but it is not going to be installed or kde-runtime but it is not going to be installed Recommends: ttf-mscorefonts-installer but it is not going to be installed Recommends: fonts-horai-umefont but it is not going to be installed Recommends: fonts-unfonts-core but it is not going to be installed Recommends: ttf-wqy-microhei Recommends: winetricks but it is not going to be installed E: Unable to correct problems, you have held broken packages. user@chrubuntu:~$ Trying to install wine1.7 on Ubuntu 14.04 64 bit, and i'm not sure what this means, help is greatly appreciated. I already ran sudo apt-get update and get this: Reading package lists... Done W: Duplicate sources.list entry http://dl.google.com/linux/chrome/deb/ stable/main amd64 Packages (/var/lib/apt/lists/dl.google.com_linux_chrome_deb_dists_stable_main_binary-amd64_Packages) W: You may want to run apt-get update to correct these problems So I run apt-get update and: E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied) E: Unable to lock directory /var/lib/apt/lists/ E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? This is all very stressing because I have been trying to get Wine for the past week and had to reinstall and IT STILL WON'T WORK.

    Read the article

  • How would I compare two Lists(Of <CustomClass>) in VB?

    - by Kumba
    I'm working on implementing the equality operator = for a custom class of mine. The class has one property, Value, which is itself a List(Of OtherClass), where OtherClass is yet another custom class in my project. I've already implemented the IComparer, IComparable, IEqualityComparer, and IEquatable interfaces, the operators =, <>, bool and not, and overriden Equals and GetHashCode for OtherClass. This should give me all the tools I need to compare these objects, and various tests comparing two singular instances of these objects so far checks out. However, I'm not sure how to approach this when they are in a List. I don't care about the list order. Given: Dim x As New List(Of OtherClass) From {New OtherClass("foo"), New OtherClass("bar"), New OtherClass("baz")} Dim y As New List(Of OtherClass) From {New OtherClass("baz"), New OtherClass("foo"), New OtherClass("bar")} Then (x = y).ToString should print out True. I need to compare the same (not distinct) set of objects in this list. The list shouldn't support dupes of OtherClass, but I'll have to figure out how to add that in later as an exception. Not interested in using LINQ. It looks nice, but in the few examples I've played with, adds a performance overhead in that bugs me. Loops are ugly, but they are fast :) A straight code answer is fine, but I'd like to understand the logic needed for such a comparison as well. I'm probably going to have to implement said logic more than a few times down the road.

    Read the article

  • What are real world examples of when Linked Lists should be used?

    - by oo
    Another programmer was mentioning that they haven't found a use case for using a linked list data structure in any professional software in his career. I couldn't think of any good examples off the top of my head. He is mostly a C# and Java developer Can anyone give some examples where this was the correct data structure to solve a particular real world problem? Related: What is a practical, real world example of the Linked List?

    Read the article

  • C++ linked list based tree structure. Sanely copy nodes between lists.

    - by krunk
    edit Clafification: The intention is not to remove the node from the original list. But to create an identical node (data and children wise) to the original and insert that into the new list. In other words, a "move" does not imply a "remove" from the original. endedit The requirements: Each Node in the list must contain a reference to its previous sibling Each Node in the list must contain a reference to its next sibling Each Node may have a list of child nodes Each child Node must have a reference to its parent node Basically what we have is a tree structure of arbitrary depth and length. Something like: -root(NULL) --Node1 ----ChildNode1 ------ChildOfChild --------AnotherChild ----ChildNode2 --Node2 ----ChildNode1 ------ChildOfChild ----ChildNode2 ------ChildOfChild --Node3 ----ChildNode1 ----ChildNode2 Given any individual node, you need to be able to either traverse its siblings. the children, or up the tree to the root node. A Node ends up looking something like this: class Node { Node* previoius; Node* next; Node* child; Node* parent; } I have a container class that stores these and provides STL iterators. It performs your typical linked list accessors. So insertAfter looks like: void insertAfter(Node* after, Node* newNode) { Node* next = after->next; after->next = newNode; newNode->previous = after; next->previous = newNode; newNode->next = next; newNode->parent = after->parent; } That's the setup, now for the question. How would one move a node (and its children etc) to another list without leaving the previous list dangling? For example, if Node* myNode exists in ListOne and I want to append it to listTwo. Using pointers, listOne is left with a hole in its list since the next and previous pointers are changed. One solution is pass by value of the appended Node. So our insertAfter method would become: void insertAfter(Node* after, Node newNode); This seems like an awkward syntax. Another option is doing the copying internally, so you'd have: void insertAfter(Node* after, const Node* newNode) { Node *new_node = new Node(*newNode); Node* next = after->next; after->next = new_node; new_node->previous = after; next->previous = new_node; new_node->next = next; new_node->parent = after->parent; } Finally, you might create a moveNode method for moving and prevent raw insertion or appending of a node that already has been assigned siblings and parents. // default pointer value is 0 in constructor and a operator bool(..) // is defined for the Node bool isInList(const Node* node) const { return (node->previous || node->next || node->parent); } // then in insertAfter and friends if(isInList(newNode) // throw some error and bail I thought I'd toss this out there and see what folks came up with.

    Read the article

  • Is it possible to specify the name of the Index property to use for lists in a fluent nhibernate con

    - by Teevus
    When mapping a HasMany or HasManyToMany in fluent nhibernate, you can specify the column name to use for the list as a parameter to the AsList() method as follows: HasMany(c => c.Customers) .AsList(c => c.Column("PositionIndex")); I would prefer to be able to set this using a Fluent NHibernate convention (either a pre-existing one, or a custom one), especially since the default name appears to be "Index" which is a reserved word in MSSQL. I've tried using a custom convention implementing IHasManyConvention, but the instance parameter does not seem to contain the information about whether its a list, a bag, or a set, and also does not contain the column details for the index column. public void Apply(IOneToManyCollectionInstance instance) { } Any ideas?

    Read the article

< Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >