Search Results

Search found 12375 results on 495 pages for 'red black tree'.

Page 10/495 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • New EFI Laptop: After restart, Ubuntu boots to black screen?

    - by Henson S
    So, I've got this new laptop (Acer Aspire 5560 15") that's doing a funny thing.. If I cold booth the machine, everything is great! I see the grub menu, and Ubuntu 12.04 loads just fine. If I reboot within Ubuntu, I see the BIOS screen, but then nothing. No grub menu, no hard drive activity except for just a blip. I noticed that when installing Ubuntu this time, I had to create an EFI boot partition -- something I'm not used to. And I'm guessing that it has something to do with the issue. Could be totally wrong. Any ideas?

    Read the article

  • How to use R-Tree for plotting large number of map markers on google maps

    - by Eeyore
    After searching SO and multiple articles I haven't found a solution to my problem. What I am trying to achieve is to load 20,000 markers on Google Maps. R-Tree seems like a good approach but it's only helpful when searching for points within the visible part of the map. When the map is zoomed out it will return all of the points and...crash the browser. There is also the problem with dragging the map and at the end of dragging re-running the query. I would like to know how I can use R-Tree and be able to achieve the all of the above.

    Read the article

  • I'm getting a black screen right after Install Ubuntu option on GRUB menu. Any ideas?

    - by Silight
    I've formatted my USB and remade the live USB twice. I tried editing editing the commands (pressing the 'e' key while the command was highlighted on the GRUB menu) by 1. deleting quiet splash and replacing it with nomodeset 2. adding nomodeset right before quiet splash 3. deleting quiet splash and adding radeon.modeset=0 I saw another solution for a fix by editing GRUB but in command line 'sudo' 'nano' and 'update-grub' all show up as unknown commands. I'm brand new to Ubuntu, in case you couldn't tell. I would appreciate any help you could give me. I want to convince my brother that Ubuntu is a better option than iOS but I can't do that if I can't install it. If you need more information, please ask. I'm not dual booting. I want this to be a full install. Thanks.

    Read the article

  • Height of a binary tree

    - by Programmer
    Consider the following code: public int heightOfBinaryTree(Node node) { if (node == null) { return 0; } else { return 1 + Math.max(heightOfBinaryTree(node.left), heightOfBinaryTree(node.right)); } } I want to know the logical reasoning behind this code. How did people come up with it? Does some have an inductive proof? Moreover, I thought of just doing a BFS with the root of the binary tree as the argument to get the height of the binary tree. Is the previous approach better than mine?Why?

    Read the article

  • Getting a table's values into a tree

    - by Jason
    So, I have a table like such: id|root|kw1|kw2|kw3|kw4|kw5|name 1| A| B| C| D| E| F|fileA 2| A| B| | | | |fileB 3| B| C| D| E| | |fileC 4| A| B| | | | |fileD (several hundred rows...) And I need to get it into a tree like the following: *A *B -fileB -fileD *C *D *E *F -fileA *B *C *D *E -fileC I'm pretty sure the table is laid out poorly but it's what I have to live with. I've read a little about Adjacency List Model & Modified Preorder Tree Traversal but I don't think my data is laid out correctly. I think this requires a recursive function, but I'm not at all sure how to go about that. I'm open to any ideas of how to get this done even if it means extracting the data into a new table just to process this. Are there any good options available to me or any good ways to do this? (Examples are a bonus of course)

    Read the article

  • Deleting a node in a family tree

    - by user559142
    Hi, I'm trying to calclulate the best way to delete a node in a family tree. First, a little description of how the app works. My app makes the following assumption: Any node can only have one partner. That means that any child a single node has, it will also be the partner nodes child too. Therefore, step relations, divorces etc aren't compensated for. A node always has two parents - A mother and father cannot be added seperately. If the user doesn't know the details - the nodes attributes are set to a default value. Also any node can add parents, siblings, children to itself. Therefore in law relationships can be added. I have the following classes: FamilyMember String fName; String lName; String dob; String gender; FamilyMember mother, father, partner; ArrayListchildren; int index; int generation; void linkParents(); void linkPartner(); void addChild(); //gets & sets for fields Family ArrayListfamily; void addMember(); void removeMember(); FamilyMember getFamilyMember(index); ArrayListgetFamilyMembers(); FamilyTree Family family; void removeMember(); //need help void displayFamilyMembers(); void addFamilyMember(); void enterDetails(); void displayAncestors(); void displayDescendants(); void printDescendants(); FamilyMember findRootNode(); void sortGenerations(); void getRootGeneration(); I am having trouble with identifying the logic for removing a member. All other functions work fine. Has anyone developed a family tree app before who knows how to deal with removing various different nodes in the family "tree"? e.g. removing a leaf removing a leaf with partner (what if partner has parents etc) removing a parent It seems to be another recursive property but my head is swelling from over thought.

    Read the article

  • Is there any tool which can show the call tree for SQL stored procedures

    - by DBZ_A
    I have a huge SQL script which i need to analyse. It would be really helpful if i could find a tool which can generate a call tree; ie, to see which all procedures are called from a particular procedure. a perl based example is here, http://sqlblog.com/blogs/linchi_shea/archive/2009/10/23/find-the-complete-call-tree-for-a-stored-procedure.aspx but i need a tool to analyse the text file (.sql file), not the procedure stored in the database. due to some reasons i will not be able to create the whole set of procedures in the database and use the above mentioned tool. please respond if you have come across any ide/tool with this feature.

    Read the article

  • dojo dgrid tree, subrows in wrong position

    - by Ventura
    I have a dgrid, working with tree column plugin. Every time that the user click on the tree, I call the server, catch the subrows(json) and bind it. But when it happens, these subrows are show in wrong position, like the image bellow. The most strange is when I change the pagination, after go back to first page, the subrows stay on the correct place. (please, tell me if is possible to understand my english, then I can try to improve the text) My dgrid code: var CustomGrid = declare([OnDemandGrid, Keyboard, Selection, Pagination]); var grid = new CustomGrid({ columns: [ selector({label: "#", disabled: function(object){ return object.type == 'DOCx'; }}, "radio"), {label:'Id', field:'id', sortable: false}, tree({label: "Title", field:"title", sortable: true, indentWidth:20, allowDuplicates:true}), //{label:'Title', field:'title', sortable: false}, {label:'Count', field:'count', sortable: false} ], store: this.memoryStore, collapseOnRefresh:true, pagingLinks: false, pagingTextBox: true, firstLastArrows: true, pageSizeOptions: [10, 15, 25], selectionMode: "single", // for Selection; only select a single row at a time cellNavigation: false // for Keyboard; allow only row-level keyboard navigation }, "grid"); My memory store: loadMemoryStore: function(items){ this.memoryStore = Observable(new Memory({ data: items, getChildren: function(parent, options){ return this.query({parent: parent.id}, options); }, mayHaveChildren: function(parent){ return (parent.count != 0) && (parent.type != 'DOC'); } })); }, This moment I am binding the subrows: success: function(data){ for(var i=0; i<data.report.length; i++){ this.memoryStore.put({id:data.report[i].id, title:data.report[i].created, type:'DOC', parent:this.designId}); } }, I was thinking, maybe every moment that I bind the subrows, I could do like a refresh on the grid, maybe works. I think that the pagination does the same thing. Thanks. edit: I forgot the question. Well, How can I correct this bug? If The refresh in dgrid works. How can I do it? Other thing that I was thinking, maybe my getChildren is wrong, but I could not identify it. thanks again.

    Read the article

  • Implementing an iterator over binary tree using C++ 11

    - by user1459339
    I would like to create an iterator over the binary tree so as to be able to use range-based for loop. I understand I ought to implement the begin() and end() function first. Begin should probably point to the root. According to the specification, however, the end() functions returns "the element following the last valid element". Which element (node) is that? Would it not be illegal to point to some "invalid" place? The other thing is the operator++. What is the best way to return "next" element in tree? I just need some advice to begin with this programming.

    Read the article

  • documenting black-box test cases

    - by Blux
    Hi everyone, I want to write an initial (black box) test cases for one of my university projects. I haven't started coding yet, I'm still in completing the SRS document and i should specify the test cases i'm going to implement after the coding. The project is web based, and i should follow this template in each test case: +++++ Test case ID: Author: Initial state: Preconditions: Use Case: Test input: Expected output: ++++++ The thing is, i don't know what is the difference between "initial state" and "preconditions". In some of the test cases it's hard to differentiate between them. Like in "Edit Page" what should be the initial state and what should be the preconditions? any help will appreciated.=)

    Read the article

  • PHP - string to image only produces black background

    - by Phil Jackson
    Hi im really having a problem find how to fix this. $string = "foo"; $font = 4; $width = ImageFontWidth($font) * strlen($string); $height = ImageFontHeight($font); $im = @imagecreatetruecolor ($width,$height); $bg = imagecolorallocate($im, 255, 255, 255); $textcolor = imagecolorallocate($im, 0, 0, 0); imagestring($im, 5, 0, 0, $string, $textcolor); imagegif($im, 'somefile.gif', 8); imagedestroy($im); I cannot seem to change the background from black. Does anyone have any ideas?

    Read the article

  • Red Sand – An Awesome Fan Made Mass Effect Prequel [Short Movie]

    - by Asian Angel
    Welcome to Mars where humanity has just discovered the Prothean Ruins and Element Zero, but danger abounds as the Red Sand terrorist group seeks to claim Mars for themselves! If you love the Mass Effect game series, then you will definitely want to watch this awesome fan made prequel set 35 years before the events of the first game. Synopsis From YouTube: Serving as a prequel to the MASS EFFECT game series,”Red Sand” is set 35 years before the time of Commander Shepard and tells the story of the discovery of ancient ruins on Mars. Left behind by the mysterious alien race known as the Protheans, the ruins are a treasure trove of advanced technology and the powerful Element Zero, an energy source beyond humanity’s wildest dreams. As the Alliance research team led by Dr. Averroes (Ayman Samman) seeks to unlock the secrets of the ruins, a band of marauders living in the deserts of Mars wants the ruins for themselves. Addicted to refined Element Zero in the form of a narcotic nicknamed “Red Sand” which gives them telekinetic “biotic” powers, these desert-dwelling terrorists will stop at nothing to control the ruins and the rich vein of Element Zero at its core. Standing between them and their goal are Colonel Jon Grissom (Mark Meer), Colonel Lily Sandhurst (Amy Searcy), and a team of Alliance soldiers tasked with defending the ruins at all costs. At stake – the future of humanity’s exploration of the galaxy, and the set up for the MASS EFFECT storyline loved by millions of gamers worldwide. RED SAND: a Mass Effect fan film – starring MARK MEER [via Geeks are Sexy] 7 Ways To Free Up Hard Disk Space On Windows HTG Explains: How System Restore Works in Windows HTG Explains: How Antivirus Software Works

    Read the article

  • Conditional Drag and Drop Operations in Flex/AS3 Tree

    - by user163757
    Good day everyone. I am currently working with a hierarchical tree structure in AS3/Flex, and want to enable drag and drop capabilities under certain conditions: Only parent/top level nodes can be moved Parent/top level nodes must remain at this level; they can not be moved to child nodes of other parent nodes Using the dragEnter event of the tree, I am able to handle condition 1 easily. private function onDragEnter(event:DragEvent):void { // only parent nodes (map layers) are moveable event.preventDefault(); if(toc.selectedItem.hasOwnProperty("layer")) DragManager.acceptDragDrop(event.target as UIComponent); else DragManager.showFeedback(DragManager.NONE); } Handling the second condition is proving to be a bit more difficult. I am pretty sure the dragOver event is the place for logic. I have been experimenting with calculateDropIndex, but that always gives me the index of the parent node, which doesn't help check if the potential drop location is acceptable or not. Below is some pseudo code of what I am looking to accomplish. private function onDragOver(e:DragEvent):void { // if potential drop location has parents // dont allow drop // else // allow drop } Can anyone provide advice how to implement this?

    Read the article

  • Java Binary Tree. Priting InOrder traversal

    - by user69514
    I am having some problems printing an inOrder traversal of my binary tree. Even after inserting many items into the tree it's only printing 3 items. public class BinaryTree { private TreeNode root; private int size; public BinaryTree(){ this.size = 0; } public boolean insert(TreeNode node){ if( root == null) root = node; else{ TreeNode parent = null; TreeNode current = root; while( current != null){ if( node.getData().getValue().compareTo(current.getData().getValue()) <0){ parent = current; current = current.getLeft(); } else if( node.getData().getValue().compareTo(current.getData().getValue()) >0){ parent = current; current = current.getRight(); } else return false; if(node.getData().getValue().compareTo(parent.getData().getValue()) < 0) parent.setLeft(node); else parent.setRight(node); } } size++; return true; } /** * */ public void inOrder(){ inOrder(root); } private void inOrder(TreeNode root){ if( root.getLeft() !=null) this.inOrder(root.getLeft()); System.out.println(root.getData().getValue()); if( root.getRight() != null) this.inOrder(root.getRight()); } }

    Read the article

  • Logic for family tree program

    - by david robers
    Hi All, I am creating a family tree program in Java, or at least trying to. I have developed several classes: Person - getters and setter for name gender age etc FamilyMember - extends Person getters and setters for setting arents and children Family - which consists of multiple family members and methods for adding removing members FamilyTree which is the main class for setting relationships. I have two main problems: 1) I need to set the relationships between people. Currently I am doing: FamilyMember A, FamilyMember B B.setMother(A); A.setChild(B); The example above is for setting a mother child relationship. This seems very clunky. Its getting very long winded to implement all relationships. Any ideas on how to implement multiple relationships in a less prodcedural way? 2) I have to be able to display the family tree. How can I do this? Are there any custom classes out there to make life easier? Thanks for your time...

    Read the article

  • How to exclude rows where matching join is in an SQL tree

    - by Greg K
    Sorry for the poor title, I couldn't think how to concisely describe this problem. I have a set of items that should have a 1-to-1 relationship with an attribute. I have a query to return those rows where the data is wrong and this relationship has been broken (1-to-many). I'm gathering these rows to fix them and restore this 1-to-1 relationship. This is a theoretical simplification of my actual problem but I'll post example table schema here as it was requested. item table: +------------+------------+-----------+ | item_id | name | attr_id | +------------+------------+-----------+ | 1 | BMW 320d | 20 | | 1 | BMW 320d | 21 | | 2 | BMW 335i | 23 | | 2 | BMW 335i | 34 | +------------+------------+-----------+ attribute table: +---------+-----------------+------------+ | attr_id | value | parent_id | +---------+-----------------+------------+ | 20 | SE | 21 | | 21 | M Sport | 0 | | 23 | AC | 24 | | 24 | Climate control | 0 | .... | 34 | Leather seats | 0 | +---------+-----------------+------------+ A simple query to return items with more than one attribute. SELECT item_id, COUNT(DISTINCT(attr_id)) AS attributes FROM item GROUP BY item_id HAVING attributes > 1 This gets me a result set like so: +-----------+------------+ | item_id | attributes | +-----------+------------+ | 1 | 2 | | 2 | 2 | | 3 | 2 | -- etc. -- However, there's an exception. The attribute table can hold a tree structure, via parent links in the table. For certain rows, parent_id can hold the ID of another attribute. There's only one level to this tree. Example: +---------+-----------------+------------+ | attr_id | value | parent_id | +---------+-----------------+------------+ | 20 | SE | 21 | | 21 | M Sport | 0 | .... I do not want to retrieve items in my original query where, for a pair of associated attributes, they related like attributes 20 & 21. I do want to retrieve items where: the attributes have no parent for two or more attributes they are not related (e.g. attributes 23 & 34) Example result desired, just the item ID: +------------+ | item_id | +------------+ | 2 | +------------+ How can I join against attributes from items and exclude these rows? Do I use a temporary table or can I achieve this from a single query? Thanks.

    Read the article

  • Getting tree construction with ANTLR

    - by prosseek
    As asked and answered in http://stackoverflow.com/questions/2999755/removing-left-recursion-in-antlr , I could remove the left recursion E - E + T|T T - T * F|F F - INT | ( E ) After left recursion removal, I get the following one E - TE' E' - null | + TE' T - FT' T' - null | * FT' Then, how to make the tree construction with the modified grammar? With the input 1+2, I want to have a tree ^('+' ^(INT 1) ^(INT 2)). Or similar. grammar T; options { output=AST; language=Python; ASTLabelType=CommonTree; } start : e - e ; e : t ep - ??? ; ep : | '+' t ep - ??? ; t : f tp - ??? ; tp : | '*' f tp - ??? ; f : INT | '(' e ')' - e ; INT : '0'..'9'+ ; WS: (' '|'\n'|'\r')+ {$channel=HIDDEN;} ;

    Read the article

  • Creating subtree from tree which is represented in xml - python

    - by Jay
    Hi I have an XML (in the form of tree), I require to create sub-tree out of it. For ex: <a> <b> <c>Hello</c> <d> <e>Hi</e> </a> Subtree would be <root> <a> <b> <c>Hello</c> </b> </a> <a> <d> <e>Hi</e> </d> </a> </root> What is the best XML library in python to do it? Any algorithm that already does this would also be helpful. Note: the XML doc won't be that big, it will easily fit in memory.

    Read the article

  • My Red Gate Experience

    - by Colin Rothwell
    I’m Colin, and I’ve been an intern working with Mike in publishing on Simple-Talk and SQLServerCentral for the past ten weeks. I’ve mostly been working “behind the scenes”, making improvements to the spam filtering, along with various other small tweaks. When I arrived at Red Gate, one of the first things Mike asked me was what I wanted to get out of the internship. It wasn’t a question I’d given a great deal of thought to, but my immediate response was the same as almost anybody: to support my growing family. Well, ok, not quite that, but money was certainly a motivator, along with simply making sure that I didn’t get bored over the summer. Three months is a long time to fill, and many of my friends end up getting bored, or worse, knitting obsessively. With the arrogance which seems fairly common among Cambridge people, I wasn’t expecting to really learn much here! In my mind, the part of the year where I am at Uni is the part where I learn things, whilst Red Gate would be an opportunity to apply what I’d learnt. Thankfully, the opposite is true: I’ve learnt a lot during my time here, and there has been a definite positive impact on the way I write code. The first thing I’ve really learnt is that test-driven development is, in general, a sensible way of working. Before coming, I didn’t really get it: how could you test something you hadn’t yet written? It didn’t make sense! My problem was seeing a test as having to test all the behaviour of a given function. Writing tests which test the bare minimum possible and building them up is a really good way of crystallising the direction the code needs to grow in, and ensures you never attempt to write too much code at time. One really good experience of this was early on in my internship when Mike and I were working on the query used to list active authors: I’d written something which I thought would do the trick, but by starting again using TDD we grew something which revealed that there were several subtle mistakes in the query I’d written. I’ve also been awakened to the value of pair programming. Whilst I could sort of see the point before coming, I also thought that it was impossible that two people would ever get more done at the same computer than if they were working separately. I still think that this is true for projects with pieces that developers can easily work on independently, and with developers who both know the codebase, but I’ve found that pair programming can be really good for learning a code base, and for building up small projects to the point where you can start working on separate components, as well as solving particularly difficult problems. Later on in my internship, for my down tools week project, I was working on adding Python support to Glimpse. Another intern and I we pair programmed the entire project, using ping pong pair programming as much as possible. One bonus that this brought which I wasn’t expecting was that I found myself less prone to distraction: with someone else peering over my shoulder, I didn’t have the ever-present temptation to open gmail, or facebook, or yammer, or twitter, or hacker news, or reddit, and so on, and so forth. I’m quite proud of this project: I think it’s some of the best code I’ve written. I’ve also been really won over to the value of descriptive variables names. In my pre-Red Gate life, as a lone-ranger style cowboy programmer, I’d developed a tendency towards laziness in variable names, sometimes abbreviating or, worse, using acronyms. I’ve swiftly realised that this is a bad idea when working with a team: saving a few key strokes is inevitably not worth it when it comes to reading code again in the future. Longer names also mean you can do away with a majority of comments. I appreciate that if you’ve come up with an O(n*log n) algorithm for something which seemed O(n^2), you probably want to explain how it works, but explaining what a variable name means is a big no no: it’s so very easy to change the behaviour of the code, whilst forgetting about the comments. Whilst at Red Gate, I took the opportunity to attend a code retreat, which really helped me to solidify all the things I’d learnt. To be completely free of any existing code base really lets you focus on best practises and think about how you write code. If you get a chance to go on a similar event, I’d highly recommend it! Cycling to Red Gate, I’ve also become much better at fitting inner tubes: if you’re struggling to get the tube out, or re-fit the tire, letting a bit of air out usually helps. I’ve also become quite a bit better at foosball and will miss having a foosball table! I’d like to finish off by saying thank you to everyone at Red Gate for having me. I’ve really enjoyed working with, and learning from, the team that brings you this web site. If you meet any of them, buy them a drink!

    Read the article

  • SVN X remains in tree-conflict

    - by Paul Knopf
    I am using VisualSVN (which uses Tortoise). I accidentally move a folder to a different location. When tries to move it back, SVN pukes with this error. It happened once before and I managed to do some random updates/commits, not knowing what I was doing and it was "fixed". I cannot pull the same magic again, so I need to know how to get my files and directory and of tree-conflict. Thanks!

    Read the article

  • how to wordwrap in flex tree node

    - by Sam Jones
    I have a Tree object in my Flex code. It's width is 100%, and it is contained by a Panel with width=200. I am using a custom itemrenderer that extends TreeItemRenderer. I need the text in each node to word wrap if it's too big (as happens often). I have tried label.wordWrap = true; in my item renderer without any luck. Any other suggestions?

    Read the article

  • aother option for modified preorder tree traversal algorithm

    - by poldo
    Hi, been searching for a while now and can't seem to find an alternative solution. I need the tree traversal algorithm in such a way that a node can have more than 1 parent, if it's possilbe (found a great article here: Storing Hierarchical Data in a Database). Are there any algorithms so that, starting from a root node, we can determine the sequence and dependencies of nodes (currently reading topological sorting)? thanks in advance!

    Read the article

  • Generic tree implementation in Java

    - by Ivan
    Is anyone aware of a generic tree (nodes may have multiple children) implementation for Java? It should come from a well trusted source and must be fully tested. It just doesn't seem right implementing it myself. Almost reminds me of my university years when we were supposed to write all our collections ourselves. EDIT: Found this project on java.net, might be worth looking into.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >