subtree

LDAP entire subtree copy

Hi, I am actually new to this forum and I kept trying for a few days to find an easy way to copy an entire LDAP subtree to another tree. Since I couldn't find anything useful, i thought of dropping a question here as well. Does anybody know how to do this programatically ? For normal operations like add, remove, search, I've been using ...

Traversing a unidirectional tree efficiently

Hey folks, I've got a unidirectional tree of objects, in which each objects points to its parent. Given an object, I need to obtain its entire subtree of descendants, as a collection of objects. The objects are not actually in any data structure, but I can easily get a collection of all the objects. The naive approach is to examine eac...

Summing up all nodes

This may be a simple fix - but I'm trying to sum together all the nodes (Size property from the Node class) on the binary search tree. Below in my BST class I have the following so far, but it returns 0: private long sum(Node<T> thisNode) { if (thisNode.Left == null && thisNode.Right == null) return 0; ...

Using Git, what's the best way to subtree merge an external project that has submodules?

I'm using a Git repository for everything related to a website I'm developing. The repository holds all files related to the site, including documentation, mockups, original layered images, etc. as well as the web root stuff that I've put in a www subdirectory. I'm at the point where I want to start integrating the CMS I've chosen to us...

Finding the smallest subtree

Given a graph of n nodes that are all interconnected on a coordinate plane, what's the best way to find a subtree of minimal distance that contains m nodes? The only solution I've found to this problem is to generate all combinations of the nodes to connect and attempt to connect these nodes via either Kruskal's or Prim's algorithm whil...

How do I find a matching subtree?

I have a large binary tree, T. T "matches". Some number of subtrees of T will also match. In fact, the matching subtrees need not even be full subtrees: they can be truncated, too. By truncated subtree, I mean that nodes in the subtree may not contain children all the way down - some nodes that have children may have their children r...

git: can I subtree merge just a subpath of a repository?

Hi, I have the remotes Foo and Bar. Foo is a web application that has lots of directories, relevent amongst them is /public which cointains assorted files and other directories. Bar is a set of libraries and whatnot used on the front end, as such, it should go in /public/bar in Foo. Foo has no files there. That would all be piece of c...

Git confused when merging an update into my subtree

We previously used many submodules in our main repositories, but to increase the maintainability of our projects we started an experimental branch where we replaced them all with subtrees. This worked good - but now when I'm trying to update one of the subtrees it erroneously merges the update into a completely wrong directory that isn'...

Finding the most frequent subtrees in a collection of (parse) trees

I have a collection of trees whose nodes are labelled (but not uniquely). Specifically the trees are from a collection of parsed sentences (see http://en.wikipedia.org/wiki/Treebank). I wish to extract the most common subtrees from the collection - performance is not (yet) an issue. I'd be grateful for algorithms (ideally Java) or pointe...

git checkout remote branch shows extraneous files?

master branch has these files and folders (simplified): C:\Local\TickZoom\Project>ls file.txt name.txt public public branch is tracking a vendor repository and has been subtree merged as public folder in master branch above. public has three folders only (simplified): C:\Local\TickZoom\Project>ls platform providers www...

Using Git how to merge a subtree from remote branch

Subtrees in Git work nicely although some git commands remain to be supported for subtrees. Here's the question: How to make the subtree pull from a different remote branch like "stable" or "integrate"? FYI, we have a subtree "push" working as a script. In fact, it can even push the subtree to the specific branch of our choice o...

Find all subtrees in a tree matching a given subtree in Java

I am writing code in Java that uses an unordered, rooted tree where each node may have any number of child nodes. Given a tree T and a subtree S, I want to be able to find all the subtrees in T that match S (that is all the subtrees in T that are isomorphic to S). A subtree of T is isomorphic to S, if the nodes of S can be mapped to nod...

Git subtree tags

I want to use subtree merges to pull a remote project into a directory in my own git tree. I followed the instructions here: using subtree merge But I'm not sure how to checkout a tag. I imagine this is a common request - you want to pull in an external project but get a safe tagged version of the source. The subtree merge solution wo...

Using git subtree merging, while also merging in all branches of all merged subtrees

I'd like to use a popular, open source issue tracker (Redmine) that offers git integration. Unfortunately, each project in the tracker can only be associated with one git repo. Creating multiple projects in the tracker is not my ideal setup. With that in mind, I've attempted to use git subtree merging (explained here, and here). I've cr...

switch subtree to different remote branch

Hi, Consider this part of a repository of mine: / myproject django -> django/master (django/django @github) ... other dependencies django is a subtree that I merged following this howto: How to use the subtree merge strategy Now I found out that another dependency is incompatible with the current master of django and I want to sw...

only parse a specific subtree of an XML file

I have a massive XML file. However, I'm only interested in a single small subtree of this massive tree. I want to parse this subtree, but I don't want to waste time parsing the entire massive tree when I'm going to only be using a small part of it. Ideally, I'd want to scan through the file until I find the start of this subtree, parse...

Creating subtree from tree which is represented in xml - python

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...

Git subtree not properly using .gitignore when doing a partial clone

I am a graduate student with many scripts, bibliography data in bibtex, thesis draft in latex, presentations in open office, posters in scribus, and figures and result data. I would like to put everything in one project under version control. Then when I need to work on a portion such as the bibliography data, I would like to check tha...

TinyXML Iterating over a Subtree

Does anyone have code to iterate through the nodes of a subtree in TinyXML? IE: Given a parent, iterate through all its children and all of its children's children? ...

Procedure for cloning Git repos that use subtree

I'm using Git's subtree command to pull a couple of libraries in to a project. If I then clone the project in the normal way, I end up with all the code that I need, but I lose the subtree relationships - in the clone there is no remote for each of the libraries, and there is no -push branch for either of them. What's the best way to ...