tree

Get item by index in a tree control

I'm doing a drag and drop operation on a tree using some help from Adobe's quick Starts: http://www.adobe.com/devnet/flex/quickstart/working_with_tree/ The code suggested is roughly this: var dropTarget:Tree = Tree(evt.currentTarget); var i:int = dropTarget.calculateDropIndex(evt); myTree.selectedIndex = i; var node:XML = myTree.select...

Flex tree droplocation indicator stuck (edit 2/4/10, almost a totaly different question)

OK I've got a little more research on this done so I'm going to totally rephrase the question: I have two trees, I want to be able to drag items from one tree to the other. In the receiving tree I have some logic that allows or denys the drop. I am using the native cursor feedback Like this : DragManager.showFeedback(DragManager.COPY); ...

Help me understand Inorder Traversal without using recursion

I am able to understand preorder traversal without using recursion, but I'm having a hard time with inorder traversal. I just don't seem to get it, perhaps, because I haven't understood the inner working of recursion. This is what I've tried so far: def traverseInorder(node): lifo = Lifo() lifo.push(node) while True: ...

Ruby and console output

It is possible, generally, by means of Ruby library to output a symbol at specific location on a common Windows console screen, which seems to be 80x25 ? The problem came up with the need to draw a specific 'tree' structure like this, for example: │ ├──x──y──z │ │ │ ├──a──b──c │ │ │ └──e──f──g │ └──u──v──o ...

Tree Show toolTip during drag

I am denying a user the ability to drop into my tree during certain conditions, it's all going well, but I want to tell the user why I'm denying the drop. I would prefer to do it with a toolTip, but it doesn't seem to work. Can I not have a toolTip during a drag operation? How can I force one? Flex seems to treat toolTips as a property...

Algorithm question: print all the elements on a single given level of a binary tree

Hi, I am required to print out(visit) the nodes on a single level of a binary tree. I don't see how this can be done but then again I not very skilled with algorithms in general. I know that in Breadth-First traversal you use a queue and that you start by putting the root node in the queue then you dequeue it visit it and enqueue it's ch...

Flex Tree Custom Tree View

Hi, I have an xml string fetched as a remote object like: <metadata> <system name="A"> <serviceGroup name="SG1"> <version id="id1" /> <service name="S1"/> </serviceGroup> <serviceGroup name="SG2"> <version id="id2" /> <serviceGroup name="SG3"> <version id="id3" /> ...

dijit tree and focus node

Hello, I cannot get focusNode() or expandNode() get working. I also tried switching back to dojo 1.32 and even 1.3, no difference to 1.4. And I debugged with firebug, the node is a valid tree node and no errors occur but the node wont get focused. Help is VERY appreciated! <head> <script type="text/javascript"> dojo.declare("itcTre...

Antrl3 conditional tree rewrites

Hello again, Stackoverflow. Continuing on my journey into Antlr (Previous questions may provide additional clues on what I'm trying to achieve! Q1 - How do I make a tree parser and Q2 - Solving LL recursion problem) I've hit yet another roadblock I cannot flathom. Basically (I believe) the expression rule in my grammar needs to either ...

Find out if Flex component (tree) ist scrollable?

How can you find out if a Flex Component (in my case the tree) is scrollable? I tried it like this if (_listOwner.height < _listOwner.measuredHeight) { // so stuff } from within the tree's item renderer but didn't succeed. Access to the tree's scrollbar is private so that I can't get the info that way. ...

Hitting Maximum Recursion Depth Using Python's Pickle / cPickle

The background: I'm building a trie to represent a dictionary, using a minimal construction algorithm. The input list is 4.3M utf-8 strings, sorted lexicographically. The resulting graph is acyclic and has a maximum depth of 638 nodes. The first line of my script sets the recursion limit to 1100 via sys.setrecursionlimit(). The prob...

Data structure for mapping URLs or local paths

Hi, I've been trying to workout a good way of doing this fast but I'm not sure what will be the most optimal, I'm hoping some of you more experienced developers can assist via your Data Structures knowledge :-) Essentially I have a list of paths (Eg. C:\inetpub\wwwroot\, C:\www\websites\vhosts\somesite.com\, D:\www-mirror\websites\vhos...

What's the best way to position interconnected nodes in a 2d graph?

I have a list (graph?) of nodes, and each node is connected to other nodes in the list one or more times. I want to take these nodes and lay them out in a nice 2d diagram with lines connecting them together in an optimal way. What's the best algorithm for doing this so that they're spaced evenly apart and the lines connecting them are ...

Flex Get the XML parent of a selected Tree item

Hi everybody, I have a XML based Tree Control. The XML Structure is recursive, so the children's can have the same Element as the parent. I now want to let the user add and remove the elements. Do do so I need to get the parent element of the selected Item. Following code I already collected together: var selected:XML = treeControl.sel...

Flex Tree Control how to get the itemEditorInstance of a just added xml node

Hi everybody, I have a Tree Control on which I let user add some nodes. When a node gets added I want to let the user edit the added control right away. How do I get the itemEditorInstance of a just added xml node? Thanks for hints! Markus ...

How to add nodes to a dijit tree on the fly

Basically what I have is a tree with 3 nodes, created like so: for (var i=0; i<response.length; i++) { response[i]["type"] = "project"; } var data = { "identifier": "name", "label": "name", "items": response }; var store = new dojo.data.ItemFileRea...

dijit tree insert and delete nodes

Has anyone got a working example on howto insert and delete nodes in a tree that is directly connected to a datastore (FileItemWriteSotre) without explicit declaring a Model? I tried everything I found searching net and forums, nothing works. Inserting the node into the datastore seems to work but does not insert a node in the Tree. A...

What is a vocabulary tree and how to build one?

I'm reading a lot about vocabulary trees when it comes to fast queries for similar images or texts in big databases. But I couldn't find any good (easy to unserstand) description on what such an vocabulary tree is and how to build one out of features. ...

anyone know how to decode huffman tree?

is there better way than just go left or right based on the input digit 0 or 1? ...

problem with breadth first tree generation

hello, i have a problem with breadth first algorithm, my script generates curves in maya, position them, rotate and scale them so they give me the tree shape, i have these variables cs=current State, p=parent, nodes=non visited node List lvl=current depth maxlvl= max depth the problem is that i cant determine current depth, and ter...