hierarchy

Recursive Query - Only select nodes where leaf nodes represent active data

Given the following recursive query: WITH DepartmentHierarchy (DepartmentID, Name, IsInactive, IsSpecial, ParentId, HierarchyLevel) AS ( -- Base case SELECT DepartmentId, Name, IsInactive, IsSpecial, ParentId, 1 as HierarchyLevel FROM StoreDepartment WHERE ParentId IS NULL UNION ALL ...

MySQL - Recursing a tree structure

I have a database table which link locations together; a location can be in a location, which can be inside another location. location (<id>, ....) location_parent (<location_id>, <parent_id>) Here's the MySQL/PHP to go down for a depth of one: $sql = "SELECT id FROM se_locations_services WHERE parent_locationid IN ( SELECT location_...

simple java hierarchical problem

Hi All, I am having a problem to deal with following data. 1 a 0.64 3 2 d 0.76 3 3 e 0.46 3 1 k 3.43 9 2 i 4.37 9 1 j 0.43 5 2 h 4.74 5 3 j 7.44 5 4 p 3.47 5 1 k 8.33 4 it has 4 column. First is just id for each group. 4th colum is group id while float value is just value and 2nd column too. Here is what I am trying to do: I want to...

WPF: Binding Hierarchy

I have defined a default binding in my style. For example I have configured the visibility binding of my button so that it must not be visible if the relative command can not execute. This is my default binding behavior. Apart from my default behavior, every view can customize the buttons it uses with another visibility binding. I w...

Hierarchy based aggregation

I have a hierarchy table in SQL Server 2005 which contains employees -> managers -> department -> location -> state. Sample table for hierarchy table: ID Name ParentID Type 1 PA NULL 0 (group) 2 Pittsburgh 1 1 (subgroup) 3 Accounts 2 1 4 Alex 3 ...

Mimic property/list changes on an object on another object

I need to mimic changes (property/list) changes on an object and then apply it to another object to keep the structure/property the same. In essence it's like cloning etc. the biz rules require certain properties to not be applied to the other object, so I can't just clone the object otherwise this would be easy. I've already walked th...

Java Generics: set List of superclass using List of subclass

If I have a method in MyClass such as setSuperClassList(List<Superclass>) ...should I be able to do this: new MyClass().setSuperClassList(new ArrayList<Subclass>()) It appears this won't compile. Why? ...

Define a logger for a specific call hierarchy

Hi, Currently i am working on log4j stuff for my application. I have a specific requirement of logging. I need to define a logger for a specific call hierarchy. Meaning all the log messages of a specific call hierarchy should go to a specific appeneder. Example AddFormAction(method1) ---|--- FormBusinessObject(method4) --|-- FormDAOOb...

Using CONNECT BY to get all parents and one child in Hierarchy through SQL query in Oracle

I was going through some previous posts on CONNECT BY usage. What I need to find is that what to do if I want to get all the parents (i.e, up to root) and just one child for a node, say 4. It seems Like I will have to use union of the following two:- SELECT * FROM hierarchy START WITH id = 4 CONNECT BY id = PRIOR parent union...

Conditional Statement as Hierarchy jQuery

Is there a way to make jQuery use objects in a conditional statement as an object in a hierarchy. For Example, I want to validate that something exist then tell it to do something just using the this selector. Like this if ($(".tnImg").length) { //i have to declare what object I am targeting here to get this to work $(th...

Finding the actual runtime call tree of a Java Program

Suppose I have a big program that consists of hundreds of methods in it. And according to the nature of input the program flow is getting changed. Think I want to make a change to the original flow. And it is big hassle to find call hierarchy/ references and understand the flow. Do I have any solution for this within Eclipse? Or a plu...

Limit display object's drag coordinates in AS3

how can i reference a display object's coordinates according to it's parent object or stage from within the class that creates the object? essentially when i create a new sprite object from a custom class and add it to the display list, i'd like to include code within the custom class that limits the drag coordinates to the stage, or a ...

algorithm optimization: returning object and sub-objects from single SQL statement in PHP

I have an object oriented PHP application. I have a simple hierarchy stored in an SQL table (Chapters and Authors that can be assigned to a chapter). I wrote the following method to fetch the chapters and the authors in a single query and then loop through the result, figuring out which rows belong to the same chapter and creating bot...

need more complex index !

I'm sorry if it's not an appropriate question for this site, and if it's necesary I'll close this question. But maybe someone could give me an ideea: I'm trying to find a more complex index to make an hierarchy. For example: 5 votes from 6 = 83% AND 500 votes from 600 = 83%; 10 votes from 600 = 1.66% If I make a hierarchy with the ...

complex mysql rank !

I have a table with these columns: win, los, id ... I want to order the table by this index: win / ( win + los ) * 30 + win / SUM(win) * 70 and then to find the rank for two id's. I'm not very good on mysql, so what I wrote is totally wrong. (It uses Perl + DBI + DBD::mysql): $stmt=$con->prepare("SET @rk := 0"); $stmt=$con->prep...

How can I list all classes loaded in a specific class loader

For debug reasons, and curiosity, I wish to list all classes loaded to a specific class loader. Seeing as most methods of a class loader are protected, what is the best way to accomplish what I want? Thanks! ...

T-SQL Hierarchy to duplicate Dependent Objects tree view in SQL Server 2005

Hi Id like to map the calling stack from one master stored procedure through its hundreds of siblings. i can see it in the dialog, but cannot copy or print it, but couldnt trap anythiing worthwhile in proflier. do you know what sproc fills that treeview? i must be a recursive CTE that reads syscomments or information_schema.routines, bu...

iPhone: error: request for member 'table' in something not a structure or union

Hi there, When it comes to compiling my application, I get the error mentioned in the title. How would I go about remedying this error? Basically, I want to get from one table to the other. Hierarchy, navigation. NextViewController.m #import "RootViewController.h" #import "NextViewController.h" @implementation NextViewController - ...

Question about SQL Server HierarchyID depth-first performance

I am trying to implement hierarchyID in a table (dbo.[Message]) containing roughly 50,000 rows (will grow substantially in the future). However it takes 30-40 seconds to retrieve about 25 results. The root node is a filler in order to provide uniqueness, therefor every subsequent row is a child of that dummy row. I need to be able to ...

A resource for installation or setup folder hierarchy of various applications

Is there a web site (or something else) that has information on folders and their hierarchy where various programs and applications are installed? Please let me explain. I am writing an application that (part of what it does) references certain files installed by other application. To be able to determine the file paths for these folder...