hierarchy

Ruby on Rails: Routing for a tree hierarchy of places

So we've got a legacy system that tracks places with IDs like "Europe/France/Paris", and I'm building a Rails facade to turn this into URLs like http:// foobar/places/Europe/France/Paris. This requirement is not negotiable, the number of possible levels in unlimited, and we can't escape the slashes. Setting up routes.rb for http://foob...

OOP: trouble notifying other objects in hierarchy

Hi, I always struggle with sending messages between objects. Consider the hierarchy of objects of a quiz: Quiz QuestionList Question AnswerList Answer So: a Quiz has a QuestionList a QuestionList has multiple Questions a Question has an AnswerList a AnswerList has multiple Answers When an Answer gets clicked (we're talkin...

Help creating a functional hierarchy

I'm trying to create my first hierarchy with the following classes (Account, CheckingAccount, and SavingsAccount) and can't figure out how to link the classes together. Also, should the balance value be public in the header? Currently it is not, and it shows "error in this context" every time it's mentioned in this main code. [stackover...

How to convert objects with nested objects

I have an entity that is actually tree object structure (defining only relevant properties within my entity): public class TreeItem { public int Id { get; set; } public TreeItem Parent { get; set; } public List<TreeItem> Children { get; set; } ... } Parent and Children properties are correctly defined as navigatio...

How to map this legacy table with NHibernate (Fluent)?

New to NHibernate. Having trouble wrapping my head around how to map this legacy table. CREATE TABLE [dbo].[CmnAddress]( [addressId] [int] NOT NULL, [objectType] [varchar](63) NULL, [objectId] [int] NULL, [addressType] [varchar](7) NULL, [recordStatus] [char](1) NULL, [fromDate] [int] NULL, [toDate] [int] NULL, [onStreet] [varchar](254...

Completely remove configuration from root in Asp.net

In ASP.Net, if we create application from directory, the configuration from root will be inherited to its children application. www.mywebsite.com | |-- [blog] |-- [forum] |-- [others] so I created these blog, forum application but I don't want configuration from www.mywebsite.com/web.config inherited to blog & forum. I know i ca...

Need advice in designing tables in SQL-Server

Hello all! I have a quote that contains items (store in table QuoteItem): QuoteItemId, QuoteId, ItemId, Quantity etc. Now, I need to be able to create a group of chosen items in the quote and apply a discount on it. Well that's simple, I create two more tables: Group: GroupId, DiscountPercentage GroupQuoteItem: GroupId, QuoteItemId ...

How to properly sort MPTT hierarchy data into multidimensional array ?

Helo there, im trying to figure out how to write a function that returns a multidimensional array, based on the data below: I know how to write the function using the "category_parent" value, but im just trying to write a function that can create a multidimensional array by JUST using the left and right keys. Any help greatly appreciat...

Hierarchy Datagrid Display in Wpf

hi am new to wpf can any body help me how to display hierarchy /grouping in wpf datagrid using backend as sqlserver 2005 ,language c#. thanks in advance.... ...

High-Performance Hierarchical Text Search

I'm now in the final stages of upgrading the hierarchy design in a major transactional system, and I have been staring for a while at this 150-line query (which I'll spare you all the tedium of reading) and thinking that there has got to be a better way. A quick summary of the question is as follows: How would you implement a hierarchi...

Hierarchy of Classes in C#

Hello there! I have this set of classes: Node (SUPER Class) |------ NodeType1 (Class) |----------NodeType2 (Class) There are fields that the type1 and type2 have in common (For example: NAME). If i declare the NAME field in the SUPER class (Node) how should I access those variables in the types classes? How can i make those property's? ...

SQL Server get parent list

I have a table like this: id name parent_id 1 ab1 3 2 ab2 5 3 ab3 2 4 ab4 null 5 ab5 null 6 ab6 null I need to do a query with input id = 1 (for an example) and results will be like this: id name parent_id 5 ab5 null 2 ab2 5 3 ab3 2 1 ab1 3 (List all parents at all level start at item id = 1) ...

How can I get the instance that created another object's instance in php?

Hi guys, I need to track which instance created another instance. It's an instancing hierarchy not a parent-child class hierarchy. Here's an example: class Car{ private var $engine; private var $id; public function __construct(){ $this->id = nextId(); $this->engine = new Engine(500); } } class Engine{ ...

CTE SQL query get full paths

Hi, I have got simple query WITH conn_cte ( ParentCategoryId, CategoryId, IdsPath ) AS ( SELECT ParentCategoryId ,CategoryId ,CAST(ParentCategoryId AS varchar(1000)) FROM Ind_CategoriesConnections WHERE ParentCategoryId = 0 UNION ALL S...

Sql server query to flattening a hierarchy of records

I have a table that describes a hierarchy: Name MemberName A B A C B D D E F G MemberName references the Name column of the same table. From this table, I can easily query to see that B and C are members within A, D is a member of B, E is a member of D and G is a member of F. Based on this structur...

How to use CTE to map parent-child relationship?

Say I have a table of items representing a tree-like structured data, and I would like to continuously tracing upward until I get to the top node, marked by a parent_id of NULL. What would my MS SQL CTE (common table expression) look like? For example, if I were to get the path to get to the top from Bender, it would look like Comedy ...

Oracle Hierarchical Query

I have table which holds a company hierarchy. It was decided to use this flat table as there is no defined number of levels in the company. The table workes great, and if you were to use cascading lists on a client it's perfect. However, I need to see a "section", and all other "sections" owned by it. Hopefully the information below will...

Is there a library for python that will generate hierarchy/tree diagrams?

The title kind of says it all really. Matplotlib is fantastic for most graphing applications, but I can't seem to find anything that will make hierarchy or tree diagrams. Does anyone have experience with a package they would wish to recommend? Thanks in advance for your time, Dan ...

How should a REST URL schema look like for a tree hierarchy?

Let's assume that I have stores, shelves in a store, and products on a shelf. So in order to get a list of products on a shelf in a store, I'd use the following request: GET http://server/stores/123/shelves/456/products From here, how would I get an individual product? Should I use: GET http://server/products/789 Or: GET http://se...

proper way to delete album and its media and sub album and its media

what would be proper way to delete albums hierarchical data with its media. should i just start looping and find all the sub album id and delete thous and make query to delete all the media belonging to that album id. that will be loads of query execution if data is alot or albums are alot for a user. what your device is on this. my...