hierarchy

Bind DropDownList with Hierarchy from SQL Server Table with ASP.NET

I have the following sql table which contains menu (website menu) data. Table Name: MenuItems Columns: Id, MenuId, ParentMenuItemId, Text. My goal is to bind a DDL according to the following hierarchy (example): Id: 1, MenuId: 1, ParentMenuItemId: -1, Text: 'One' Id: 2, MenuId: 1, ParentMenuItemId: 1, Text: 'Two' Id: 3, MenuId: 1,...

Jarring/flattening out a lib directory using jarjar and ant

I'm trying to flatten out the lib directory of a project using jarjar, where it will produce a jar file with my main code and all my required libraries inside of it. I can get the project code into the jar, but I need to find a way to get every jar in the './lib/' directory extracted to the base directory of the final output jar. I don...

Objects with the same attributes and methods belongs to the same class?

Objects with the same attributes and methods belongs to the same class? Can't I declare two identical classes with the same methods and attributes, instanciate them and have "objects with the same attributes and methods belonging to different classes"? Can't I declare a class A and a sub-class B (children of the class A) both with the ...

SQL 2008 HierarchyID - Select X descendants down

How can I query a table which has a column of data type HIERARCHYID and get a list of descendants X levels deep under an employee? Here is the current structure: CREATE TABLE [dbo].[Employees]( [NodeId] [hierarchyid] NOT NULL, [EmployeeId] [int] IDENTITY(1,1) NOT NULL, [FirstName] [varchar](120) NULL, [MiddleInitial] [...

How to copy generically superclass instances to subclass instances?

Hi @all, I have a class hierarchy / inheritance like this: public class A { private String name; // with getters & setters public void doAWithName(){ ... } } public class B extends A { public void doBWithName(){ // a differnt implementation to what I do in class A } } public class C extends ...

How do you get the children of a Tk Widget?

How do tell a Tk widget to tell me what (or who as the case may be) its children are? Is there a command for this? For example given a canvas widget .cvs with a label, a button and other adornments ... How do interrogate the canvas? ...

Should I worry about running out of HierarchyIDs?

When you ask for a new HierarchyID between two others, the result gets progressively longer. For example, between 2/5.6 and 2/5.7 there's only 2/5.6.1 and other 4 component paths. The HierarchyID data type is limited to 800 some bytes, so you can't repeat this forever. Then again, integer types are also limited, but it isn't a problem...

EnumChildWindows doesn't return direct children

Hi, I am trying to create an application that dumps all processes and their children controls to a text file. I used EnumChildWindow but it visits all children including children's childdren. I can't create hierarchy using this method. Is there another way of doing this? Thanks ...

CTE to build a list of departments and managers (hierarchical)

I need to generate a list of users that are managers, or managers of managers, for company departments. I have two tables; one details the departments and one contains the manager hierarchy (simplified): CREATE TABLE [dbo].[Manager]( [ManagerId] [int], [ParentManagerId] [int]) CREATE TABLE [dbo].[Department]( [DepartmentId] [int], [Ma...

Rolling up search result counts to a parent category

Note: I'm having a hard time explaining this, so please ask questions and I'll try to refine the problem as much as possible. Assuming I have the following category structure: - Planets - Earth - Mars And the following items/categories (nevermind that some of them don't logically make sense): - Item #1 - Category: Planet -...

Dynamic Array traversal in PHP

I want to build a hierarchy from a one-dimensional array and can (almost) do so with a more or less hardcoded code. How can I make the code dynamic? Perhaps with while(isset($array[$key])) { ... }? Or, with an extra function? Like this: $out = my_extra_traverse_function($array,$key); function array_traverse($array,$key=NULL) { $out...

Getting HIERARCHY_REQUEST_ERR when using Javascript to recursively generate a nested list

I have a method that is trying to take in a list. This list can contain data and other lists. The end goal is to try to convert something like this ["a", "b", ["c", "d"]] into <ol> <li> <b>a</b> </li> <li> <b>b</b> </li> <ol> <li> <b>c</b> </li> <li> ...

Questions while designing OOP hierarchy

Hello When creating inheritance hierarchy, i get confused .Abstract Base class should contain only commonly used stuffs for inherited classes.But knowing which is commonly used methods,fields and properties is not possible while designing.So i feel free myself to grouping them with abstract classes which inherits hierarchicaly. This is ...

Ruby Exception or Error?

I have noticed that in the Ruby exception hierarchy, there are "errors" such as ArgumentError and there are "exceptions" such as SignalException. Is there a certain practise of naming exceptions? thanks in advance, ell. ...

Dataset and Hierarchial Data How to Sort

This is probably a dumb question, but I've hit a wall with this one at this current time. I have some data which is hierarchial in nature which is in an ADO.NEt dataset. The first field is the ID, the second is the Name, the third is the Parent ID. ID NAME Parent ID 1 Air Handling NULL 2 Compressor ...

SQL Server 2005: Update rows in a specified order (like ORDER BY)?

I want to update rows of a table in a specific order, like one would expect if including an ORDER BY clause, but SQL Server does not support the ORDER BY clause in UPDATE queries. I have checked out this question which supplied a nice solution, but my query is a bit more complicated than the one specified there. UPDATE TableA AS Parent...

Hierarchy as grid

I have hierarchy: public class Parameter { public string Name { get; set; } public Value Value { get; set; } } public abstract class Value { } public class StringValue : Value { public string Str { get; set; } } public class ComplexValue : Value { public ComplexValue() { Parameters = new List<Parameter>();...

How to create hierarchy by using HTML

Hello, I want to know is this possible to create hierarchy in web pages by using HTML tags? IF yes, then which HTML tag should I use? ...

When and how should independent hierarchies be used in clojure?

Clojure's system for creating an ad hoc hierarchy of keywords is familiar to most people who have spent a bit of time with the language. For example, most demos and presentations of the language include examples such as (derive ::child ::parent) and they go on to show how this can be used for multi-method dispatch. In all of the sli...

Sorting nested set by name while keep depth integrity

I'm using the nested set model that'll later be used to build a sitemap for my web site. This is my table structure. create table departments ( id int identity(0, 1) primary key , lft int , rgt int , name nvarchar(60) ); insert into departments (lft, rgt, name) values (1, 10, 'departments'); insert into departments (lft...