Questions tagged [hierarchy]

For issues relating to creating, maintaining, or displaying a hierarchy of data or resources, etc.

A hierarchy is an arrangement of items (objects, names, values, categories, resources, etc.) in which the items are represented as being "above," "below," or "at the same level as" one another. Abstractly, a hierarchy is simply an ordered set or an acyclic directed graph.

A hierarchy can link entities either directly or indirectly, and either vertically or horizontally. The only direct links in a hierarchy, insofar as they are hierarchical, are to one's immediate superior or to one of one's subordinates, although a system that is largely hierarchical can also incorporate alternative hierarchies. Indirect hierarchical links can extend "vertically" upwards or downwards via multiple links in the same direction, following a path. All parts of the hierarchy which are not linked vertically to one another nevertheless can be "horizontally" linked through a path by traveling up the hierarchy to find a common direct or indirect superior, and then down again.

2838 questions
13
votes
1 answer

How to organize Haskell modules with instances: stick to data type vs type class?

The general question is which module structure is more convenient when adding instances for existing objects? Which pros and cons there are? Let's say I want to add NFData instance for Seq type. I can place it in: Data.Sequence.Extra (as the same…
modular
  • 1,099
  • 9
  • 22
13
votes
1 answer

Display Typescript class hierarchy in VS Code

is there any way (native or extension) in VS Code to see class inheritance hierarchy of some class in Typescript? Something like Type Hierarchy view for Java classes in Eclipse? Thanx
Tom HANAX
  • 402
  • 3
  • 17
13
votes
2 answers

What's the meaning of bits in '/usr/include/c++/4.4/bits/'

What's the meaning of bits in '/usr/include/c++/4.4/bits/' Linux, gcc of course.
Qian
  • 1,462
  • 1
  • 14
  • 25
13
votes
5 answers

error: Only the original thread that created a view hierarchy can touch its views

Hi and thank you for looking at my question. I am an intermediate programmer in C but an Android newbie. I have been trying to get a chat programming working. Assuming everything else in the code below works perfectly. The one question I like to ask…
Byte
  • 2,920
  • 3
  • 33
  • 55
13
votes
2 answers

Maximum recursion depth error in Python when calling super's init.

I have a class hierarchy A <- B <- C, in B, I need some processing in the constructor, so I came up with this code from this post: Understanding Python super() with __init__() methods #!/usr/bin/python class A(object): def __init__(self, v,…
prosseek
  • 182,215
  • 215
  • 566
  • 871
13
votes
7 answers

How can I get the complete Call Hierarchy of a Java source code?

This is a bit tricky to explain. I have a class A: public class A { private Integer a1; private Integer a2; // getters and setters. } There is a static class B that returns my class A: public static class B { public static A…
Tarek
  • 3,080
  • 5
  • 38
  • 54
13
votes
2 answers

Calculate the percentage of the root owned by its parents

In simplified terms, I'm trying to calculate the percentage of the root of a tree owned by its parents, further up the tree. How can I do this in SQL alone? Here's my (sample) schema. Please note that though the hierarchy itself is quite simple…
Ben
  • 51,770
  • 36
  • 127
  • 149
12
votes
5 answers

Hierarchical Data Models: Adjacency List vs. Nested Sets

I have a product catalog. Each category consists of different number (in deep) of subcategories. The number of levels (deep) is unknown, but I quite sure that it will not be exceed of 5,6 levels. The data changes are much more rarely then reads. The…
S2201
  • 1,339
  • 3
  • 18
  • 35
12
votes
2 answers

How to check if one contour is nested/embedded in opencv

I have two contours and I want to check the relation between them (if one of them is nested). Normally, I would use the findContours function with CV_RETR_TREE retrieval mode. However, I obtained the contours from a different source (using MSER…
pzo
  • 2,087
  • 3
  • 24
  • 42
12
votes
2 answers

Creating an Hierarchy-Object with an undefined number of childs

I am currently working on a "code parser" parsing Valve Map Format (.vmf files) into a java readable Object. In vmf files, there are 2 types of objects: Classes and Properties. classes have a name and can contain other classes and…
RoiEX
  • 1,186
  • 1
  • 10
  • 37
12
votes
1 answer

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…
Rob Lachlan
  • 14,289
  • 5
  • 49
  • 99
12
votes
2 answers

Sorting hierarchical text in SQL

I've a table with a varchar field. This field stores hierarchical numbers which I want to order. Here is an example of my data: 1 1.1 1.1.1 1.1.2 1.1.3. 1.1.4 1.1.5 1.1.6. 1.1.7 10. 10.1 10.2 10.3 11. 11.1 11.2 2. 2.1 1.2.2 1.2.2.1 1.2.2.2 How can…
h0mebrewer
  • 167
  • 9
12
votes
3 answers

Creating a JSON Tree from a string hierarchy

Given these 4 variables, var el1 = {name:'ronaldo', team: 'europe/spain/realmadrid'} var el2 = {name:'messi', team: 'europe/spain/barcelona'} var el3 = {name:'gerald', team: 'europe/england/liverpool'} var el4 = {name:'unknown english', team:…
user275031
  • 161
  • 2
  • 2
  • 6
12
votes
4 answers

Why Oracle connect by with nocycle follows root cycle

Does anyone know why Oracle continues to follow a path beyond a cyclical loop when the cycle occurs at the top node (root node connected right back to root node)? More importantly, how to prevent it? I have Oracle 11g Release 2 (11.2) and I have…
Larry May
  • 121
  • 1
  • 1
  • 4
12
votes
8 answers

MySQL Nested Sets - How to find parent of node?

I have your run of the mill nested set hierarchy type setup with the following columns: table name: myset columns: id, name, lft, rgt Does anyone know a query to determine the parent of a node? I read a couple places that it's handy to also have a…
Jake Wilson
  • 88,616
  • 93
  • 252
  • 370