hierarchy

Why is my Linq to Entities code duplicating rows?

I'm using the ADO.NET Entity Framework to manage a hierarchy of objects. Each has a single parent and zero or more children. I present these in my WPF application with a TreeView control. New Things may be added as children to the selected Things with the click of a button... Visual Basic... Private Sub ButtonAddThing_Click(...) ...

What is the best way to store data on a TreeView Node?

The TreeView is a nice way to present a hierarchy to users, but imagine the following scenario with the hierarchy depicted below: Building 1 -Tenant 1 - Payment 1 - Payment 2 Building 2 -Tenant 1 - Payment 1 -Tenant 2 - Payment 1 - Payment 2 where you need to do an insert to a database when the user clicks on the Pa...

How to maintain several translations of a documentation set written with Sphinx?

I am starting a personal project and I'd like to provide documentation for my French speaking fellows as well as for the English speaking others. So how should I organize my directories? What to separate (I guess sources, some conf items like language for generated navigation links...)? What not to separate (a maximum of configuration...

Best practice for naming subclasses

I am often in a situation where I have a concept represented by an interface or class, and then I have a series of subclasses/subinterfaces which extend it. For example: A generic "DoiGraphNode" A "DoiGraphNode" representing a resource A "DoiGraphNode" representing a Java resource A "DoiGraphNode" with an associated path, etc., etc. ...

CTE to traverse back up a hierarchy?

I can find all the children of a given record in a hierarchical data model (see code below) but I'm not sure how to traverse back up the Parent/Child chain with a given Child ID. Can anyone point me in the right direction to figure out how to do this? Is this possible in Linq to SQL as well? WITH TaskHierarchy (TaskID, [Subject], Pare...

TreeView, Linq-To-SQL recursive data population

I have an IEnumerable(of Employee) with a ParentID/ChildID relationship with itself that I can databind to a TreeView and it populates the hierarchy perfectly. However, I want to be able to manually loop through all the records and create all the nodes programmatically so that I can change the attributes for each node based on the data ...

Parent-child relationship with LINQ2SQL and POCO objects

I just started learning LINQ2SQL and one of the first things I wanted to try is a simple parent-child hierarchy, but I can't seem to find a good way to do it. I saw some examples here on SO and i've googled, but I couldn't apply them directly, so I'll explain exactly what i'm trying to accomplish. Lets use the common example with tags. ...

Is PostgreSQL's Ltree module a good fit for threaded comments?

I'm considering using PostgreSQL's Ltree module in my application to help with threaded comments. I've been eying it for a while to use for threaded comments. I figure it would help with cases where you need to update a node and its children, like when you want to hide a comment and its replies. I'm thinking ltree (or something like...

How to diff two versions of same object ?

I want to compare two objects of different versions and display their differences in UI. First I call a method to know if there is any difference between the two objects The method is: public bool AreEqual(object object1,object object2, Type comparisionType) If the above method returns true, I call the GetDifferences method to get t...

Hierarchy traversal and comparison modules for Python?

I deal with a lot of hierarchies in my day to day development. File systems, nested DAG nodes in Autodesk Maya, etc. I'm wondering, are there any good modules for Python specifically designed to traverse and compare hierarchies of objects? Of particular interest would be ways to do 'fuzzy' comparisons between two nearly identical hier...

XSLT: Merge a set of tree hierarchies

I have an XML document based what Excel produces when saving as "XML Spreadsheet 2003 (*.xml)". The spreadsheet itself contains a header section with a hierarchy of labels: | A B C D E F G H I -+----------------------------------------------------- 1| a1 a2 2| a11 ...

how to bind asp.net controls using a self join and items tables "hierarchically structure"?

I have the following tables: 1-Categories: -CategoryID -CategoryName -ParentID 2-Items: -ItemId -ItemName -CategoryID categories can be in a hierarchically view, with many children categories inside each other. And any the last child category can have items, so just the last category child will show items under it. The view will be lik...

Looping through DirectoryEntry or any object hierarchy - C#

I am currently developing an application that use the System.DirectoryServices namespace to create a DirectoryEntry object and loop through the entire hierarchy to collect information. I do not know number of child entries for each DirectoryEntry object in the hierarchy, so I can not create a N number of nested loops to spiders throug...

Storing folder hierarchy in relational database

I have objects representing folders and I'm wondering if they should be represented in the database. On the one hand it seems like the easiest way would be to not represent folder objects and just store a path value for objects contained in a folder. Problems I see with this is that you can't persist an folder whose descendants do not ...

Efficiently searching a 3-level hierarchy

Lets say I have a FirstName > MiddleName > LastName hierarchy (~10k rows, for sake of the question). This means you could have "John > Mary-Anne > Eddy" or "Eddy > John > Jacob" row. The point being that the hierarchy makes little sense and is very foreign to the user (unlike, say, a Country > State > City structure). Because its so u...

What would be the pros and cons of hierarchical data vs. related data, in performance (and categorization)?

This is related to this question. It got me thinking that, for example, this book. Instead of it being a child of both [Agriculture] and [Other], in the trees [Books > Catalogs > Agriculture] and [Business & Industrial > Agriculture & Forestry > Other], respectively, it could just stand on its own have those levels as tags, instead. In ...

Adjacency tree from single table

I've read a lot of people discussing nested lists, but I was wondering how to iterate through an adjacancy list/tree in PHP. I have a table with: id, title, parent_id And I've selected all records out into an array called $pages. Then using this php: function makeList($pages, $used) { if (count($pages)) { echo "<ul>"; ...

Flatten Adjacency List Hierarchy To A List Of All Paths

I have a Table that stores Hierarchical information using the Adjacency List model. (uses a self referential key - example below. This Table may look familiar): category_id name parent ----------- -------------------- ----------- 1 ELECTRONICS NULL 2 TELEVISIONS 1 3 TUBE ...

Best Relational DataBase Representation Of Time Bound Hierarchies

What in everyone's opinion is the best representation for a time-bound hierarchy in SQL? What I mean by this is: - On any given date you have a normal tree hierarchy - This hierarchy can change from day to date - Each child still only has one parent on any given date Day 1... Business | |-Joe | |-Happy | |-Sneezy | |-Doc(*) ...

Hierarchy Visual Design

Hello, I have a hierarchy of categories, where a category can have a single parent (and you can have multiple levels of children.) I'm investigating ways to display this information to the user and it seems like a basic vanilla tree layout is the most intuitive way to go. But I'm wondering if anyone can suggest other approaches. The r...