tree

Visualization of object trees in VS

Hi, I am implementing a SPA tree algorithm and is looking for a Visual Studio plug-in that let me visualize objects and their relationships in debug/runtime. Visualization like: [0]-----[1] | \ / [2] \ / | [4] [3] | \ \ | [6] \[5] Any ideas? ...

How to generate a <ul><li> tree without recursive using python or other language ??

class tree: def __init__(self, name='a', childs=[]): self.name = name self.childs = childs output: <ul> <li> Introduction <ul> <li>Sub Intro</li> </ul> </li> <li>Module 1</li> </ul> Sorry, my English is poor. ...

how to change the icon of leaf node in dojo tree?

Hi, I have created a tree containing information about server and its VMs. I want to change the icon of VM to green if the VM is power on or to red if the VM is poweroff. How to achieve this? ...

Unix tree convert to recursive php array

I have a response from remote server like this: /home/computer/Downloads |-- /home/computer/Downloads/Apple | `-- /home/computer/Downloads/Apple/Pad |-- /home/computer/Downloads/Empty_Folder `-- /home/computer/Downloads/Subfolder |-- /home/computer/Downloads/Subfolder/Empty `-- /home/computer/Downloads/Subfolder/SubSubFolder ...

How to functionally generate a tree breadth-first. (With Haskell)

Say I have the following Haskell tree type, where "State" is a simple wrapper: data Tree a = Branch (State a) [Tree a] | Leaf (State a) deriving (Eq, Show) I also have a function "expand :: Tree a -> Tree a" which takes a leaf node, and expands it into a branch, or takes a branch and returns it unaltered. Th...

Problem with struts 2 dojo tree and ajax

I'm having a really strange problem in struts 2.1.8.1 with the dojo tree and ajax links. Ok, I got a dynamic navigation tree that looks like the second example in the showcase project that comes with struts(not the one named ajax). When the link in the tree is clicked a target div is updated. This works fine. Now for the weird bit. If ...

Json to treeview (<ul>)

Hi I get the following data back from my WCF Data Service (I cut out the metadata) { "d" : [ {"CodeId": 6, "Title": "A Child Sub Item", "Parent":}, {"CodeId": 5, "Title": "Another Root Item", "Parent": -1}, {"CodeId": 4, "Title": "Child Item", "Parent": 2}, {"CodeId": 2, "Title": "Root Item", "Parent": -1} ] } I am trying to ...

Express XPath as an expression tree

If I have an XPath query like NodeA/NodeB[@WIDTH and not(@WIDTH="20")] | NodeC[@WIDTH and not(@WIDTH="20")]/NodeD Is there any API available to visualize this XPath query as a stack of atomic expressions, something like (following is generic) Get results of NodeA, call it "first set" Get results of NodeB from "first set" Filter wher...

LINQ to XML, Retrieving in the right order the rigt nodes.

Have you ever had one of those days when you've dug a hole but your so deep in now that the only option is to keep on digging and see where you come out? I thought just for giggles in the latest component I'm writing to use LINQ to XML because it was about time I saw what all the hooplah was about. The Problem: I am generating an XML ...

Accessing selected node of richfaces tree from Javascript

Hello This should be a very simple question. I have a richfaces tree that is rendered using JSF. When the user clicks on a node I want a javascript function to run. Nothing more nothing less. No redirects, no re-submit, no-rerender, no Ajax. Just plain old Javascript. I have seen the onselected attribute of the tree and it indeed fires...

Saving tree-structures in Databases

Hello everyone. I use Hibernate/Spring and a MySQL Database for my data management. Currently I display a tree-structure in a JTable. A tree can have several branches, in turn a branch can have several branches (up to nine levels) again, or having leaves. Lately I have performanceproblemes, as soon as I want to create new branches on d...

Why DFS and not BFS for finding cycle in graphs.

Predominantly DFS is used to find a cycle in graphs and not BFS. Any reasons? Both can find if a node has already been visited while traversing the tree/graph. ...

Problem understanding treesort in Haskell

I am trying to figure out how exactly does treesort from here work (I understand flatten, insert and foldr). I suppose what's being done in treesort is applying insert for each element on the list thus generating a tree and then flattening it. The only problem I can't overcome here is where the list (that is the argument of the function...

Dynamic Tree control in Flex 3

I am looking for sample code to create a dynamic Tree control in Flex using a Collection of objects obtained from the backend(Perl cgi). So, initially the Tree will display the root nodes. Clicking root node, will invoke the data for populating the child nodes (basically adding child nodes on demand). Clicking child nodes will pull an...

Implementing the tree with reference to the root for each leaf

Hi, i implementing a products catalog, that looks, like this: group 1 subgroup 1 subgroup 2 item 1 item 2 ... item n ... subgroup n group 2 subgroup 1 ... subgroup n group 3 ... group n The Models: class CatalogGroup < ActiveRecord::Base has_many: catalog_items has_many :catalog_item...

Approaches to create a nested tree structure of NSDictionaries?

I'm parsing some input which produces a tree structure containing NSDictionary instances on the branches and NSString instance at the nodes. After parsing, the whole structure should be immutable. I feel like I'm jumping through hoops to create the structure and then make sure it's immutable when it's returned from my method. We can p...

Pure functional bottom up tree algorithm

Say I wanted to write an algorithm working on an immutable tree data structure that has a list of leaves as its input. It needs to return a new tree with changes made to the old tree going upwards from those leaves. My problem is that there seems to be no way to do this purely functional without reconstructing the entire tree checking a...

Scala: A class declaring itself as a variable

I'm trying to make a binary tree in scala and need to make a method for it so I'm trying to make functions inside the class that deals with children and parent. I want to make the parent a Tree so that I can recursively call it in another function called getPath but I can't create a Tree inside the Tree class. this is the code: case cl...

A data structure based on the R-Tree: creating new child nodes when a node is full, but what if I have a lot of objects at the exact same position?

I realize my title is not very clear, but I am having trouble thinking of a better one. If anyone wants to correct it, please do. I'm developing a data structure for my 2 dimensional game with an infinite universe. The data structure is based on a simple (!) node/leaf system, like the R-Tree. This is the basic concept: you set howmany ...

How to set initial checked values of rich tree leaf node.

Hi, How to set the initial the leaf node values. -----------------------Stations.xml <?xml version="1.0"?> <station name="RichRadioStation" type="stationName"> <feed date="yesterday" type="date"> <song time="09:00" type="time" key="RichRadioStation_yesterday_09:00"> AAAAAAAAAAAA</song> <song time="10:03" type="time" key="RichRadio...