hierarchy

how to encode this data to parent / children structure in JSON

点点圈 提交于 2019-12-02 22:05:50
I am working with d3.js to visualise families of animals (organisms) (up to 4000 at a time) as a tree graph, though the data source could just as well be a directory listing, or list of namespaced objects. my data looks like: json = { organisms:[ {name: 'Hemiptera.Miridae.Kanakamiris'}, {name: 'Hemiptera.Miridae.Neophloeobia.incisa'}, {name: 'Lepidoptera.Nymphalidae.Ephinephile.rawnsleyi'}, ... etc ... ] } my question is: I am trying to find the best way to convert the above data to the hierarchical parent / children data structure as is used by a number of the d3 visualisations such as

Best Relational DataBase Representation Of Time Bound Hierarchies

浪尽此生 提交于 2019-12-02 19:49:31
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(*) | |-Moe |-Bashfull |-Sleepy Day 2... Business | |-Joe | |-Happy | |-Sneezy | |-Moe |-Doc(*) |-Bashfull |-Sleepy At any time, a child can join the hierarchy for the first time, or leave the hierarchy completely. (For example, new employees, and retired employees.) The main

Maven naming conventions for hierarchical multiple module projects

余生长醉 提交于 2019-12-02 16:37:38
I've got a question on Maven naming conventions (groupId, artifactId and directory names) in a multiple module project with a hierarchical directory structrure. Research Before asking, I went through other the web on this topic and what I cleared out for myself: Possible duplication for my question, but it does not cover multiple-hierarchy levels. Project directory name should match artificatId . Guide to Naming Conventions provide examples: groupId will identify your project uniquely across all projects, so we need to enforce a naming schema. It has to follow the package name rules (eg. org

How can I split my javascript code into separate files?

扶醉桌前 提交于 2019-12-02 16:20:00
I'm reading the Javascript Guide from Mozilla And when they contrasted JS to Java , It got me thinking, Java code is easily split up with each class in his own file. after futher search , I understand that the same can be accomplished in JS with namespacing and module pattern - I messed around with it but got very confused ( especially with calling a constructor declared in File1.js into File2.js ) so here is the hierarchy: But i just can't figure out how to properly make it works how do i simply go from //employe.js function Employee () { this.name = ""; this.dept = "general"; } function

R is not taking the parameter hgap in layout_with_sugiyama

眉间皱痕 提交于 2019-12-02 12:34:57
问题 I'm working on R on a graph and I'd like to have a hierarchical plot, based on the values in the vector S (a value for each node). lay2 <- layout_with_sugiyama(grafo, attributes="all", layers = S, hgap=10, vgap=10) plot(lay2$extd_graph, vertex.label.cex=0.5) However, the paramaters hgap e vgap are not taken and the graph is really confused (even because I've got 162 nodes). I'm doing something wrong or there is another way in which I can do a hierarchical graph? 回答1: I believe that layout

T-SQL Stored Procedure for Looping a hierarchy with recursion

偶尔善良 提交于 2019-12-02 11:02:45
i have a specific Question. My Stored Procedure don't work correctly.. I will show you the Procedure, the database and the parameter: ALTER PROCEDURE [dbo].[ManufacturerParentToChild] @ServiceProviderId int, @CarmakerId int AS BEGIN SET NOCOUNT ON; DECLARE @childSPPId int, @isDeleted bit DECLARE ServiceProviderChildren_Cursor CURSOR FOR SELECT ServiceProviderId, isDeleted FROM ServiceProvider WHERE ParentServiceProviderId = @ServiceProviderId; OPEN ServiceProviderChildren_Cursor; FETCH NEXT FROM ServiceProviderChildren_Cursor INTO @childSPPId, @isDeleted; WHILE @@FETCH_STATUS = 0 BEGIN IF

Maintaining xml hierarchy (ie parent-child) information in objects generated by XmlSerializer

不想你离开。 提交于 2019-12-02 08:41:13
问题 for some time now I have been trying to solve the following problem and I'm starting to run out of ideas: I have generated a set of C# classes from an xsd schema using the xsd.exe tool and deserializing xml files works fine. The problem is that apart from the convenience and safety of using the auto generated classes, I also need information about the xml hierarchy, ie I need to establish parent-child relationships between the objects created during deserialization. Note that I want to avoid

Which class hierarchy differences can exist compared to the JSE JavaDoc?

亡梦爱人 提交于 2019-12-02 08:25:28
问题 I'm currently generating some ASM code in a maven post compilation task. In Java 6 a StackMapTable was introduced representing the data types on the stack, which is mandatory in later versions. So I'm automatically determining the most specific class which can be on the stack. Now I ran into the problem that in my VM ThaiBuddhistDate and HijrahDate inherit from ChronoLocalDateImpl, so it would create this type in the StackMapTable, which would obviously crash in other VMs (maybe even versions

Maintaining xml hierarchy (ie parent-child) information in objects generated by XmlSerializer

蓝咒 提交于 2019-12-02 07:29:15
for some time now I have been trying to solve the following problem and I'm starting to run out of ideas: I have generated a set of C# classes from an xsd schema using the xsd.exe tool and deserializing xml files works fine. The problem is that apart from the convenience and safety of using the auto generated classes, I also need information about the xml hierarchy, ie I need to establish parent-child relationships between the objects created during deserialization. Note that I want to avoid keeping a separate xml hierarchy structure (like a DOM tree), but rather make the generated objects

How to retrieve hierarchical data from SQL table

心已入冬 提交于 2019-12-02 07:11:33
问题 I have 2 tables : T_Employees and T_Projects Every project has different number of employees assigned. What i need to do, is to get hierarchical structure of each employee, assigned to a specific project. Look at the image below and the expected results. How to get this done on Microsoft SQL Server 2008R2? CREATE TABLE [dbo].[T_Projects]( [ID] [int] IDENTITY(1,1) NOT NULL, [ProjectId] [int] NOT NULL, [EmployeeId] [int] NOT NULL, CONSTRAINT [PK_T_Projects] PRIMARY KEY CLUSTERED([ID] ASC)WITH