hierarchy

wordpress: how to add hierarchy to posts

痴心易碎 提交于 2019-12-03 08:52:40
I am creating a web-site on wordpress platform where I want to be able to post my own book texts. So what I want is to have a some kind of hierarchy where I would add a post and then add children to it (chapters). I found this: register_post_type( 'post', array( 'labels' => array( 'name_admin_bar' => _x( 'Post', 'add new on admin bar' ), ), 'public' => true, '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ '_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */ 'capability_type' => 'post',

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

偶尔善良 提交于 2019-12-03 07:14:31
问题 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

Counting number of children in hierarchical SQL data

喜你入骨 提交于 2019-12-03 05:42:43
for a simple data structure such as so: ID parentID Text Price 1 Root 2 1 Flowers 3 1 Electro 4 2 Rose 10 5 2 Violet 5 6 4 Red Rose 12 7 3 Television 100 8 3 Radio 70 9 8 Webradio 90 For reference, the hierarchy tree looks like this: ID Text Price 1 Root |2 Flowers |-4 Rose 10 | |-6 Red Rose 12 |-5 Violet 5 |3 Electro |-7 Television 100 |-8 Radio 70 |-9 Webradio 90 I'd like to count the number of children per level. So I would get a new column "NoOfChildren" like so: ID parentID Text Price NoOfChildren 1 Root 8 2 1 Flowers 3 3 1 Electro 3 4 2 Rose 10 1 5 2 Violet 5 0 6 4 Red Rose 12 0 7 3

role_hierarchy with Symfony2

大兔子大兔子 提交于 2019-12-03 05:21:39
问题 I have a big problem with my role_hierarchy, security: role_hierarchy: ROLE_ADMIN:[ROLE_USER,ROLE_AUTHOR,ROLE_MODERATOR] ROLE_SUPER_ADMIN:[ROLE_ADMIN,ROLE_ALLOWED_TO_SWITCH] with that, if i got the SUPER_ADMIN role, I will got the ROLE_AUTHOR, ROLE_MODERATOR, ROLE_USER AND ROLE_ADMIN. But my problem it's when I login on my website, if I check the profiler, i can see i got only the ROLE_SUPER_ADMIN, not the others roles, so, can you help me? my view ( base.html.twig ) <h3>Blog</h3> <ul class=

Is PostgreSQL's Ltree module a good fit for threaded comments?

我与影子孤独终老i 提交于 2019-12-03 03:58:36
问题 I'm considering using PostgreSQL's Ltree module in my application to help with threaded comments. I've been eying it for a while to use for threaded comments. I figure it would help with cases where you need to update a node and its children, like when you want to hide a comment and its replies. I'm thinking ltree (or something like it) it would be useful if it was coupled with a traditional adjacency list ("comment_id"/"parent_comment_id"). Before taking the plunge into using ltree, I'm

Drools - rule hierarchy and conditional execution

女生的网名这么多〃 提交于 2019-12-03 03:51:29
I was wondering if there is a way to define hierarchy (not just order of execution) between rules and control the rule execution - i.e. if the parent rule fired then the ones below should not be evaluated etc... Information in this thread is an option but it is essentially IF/THEN/ELSE Is there a different option? thanks I am not sure if I understand your question, but using a combination of Activation Groups and the traditional conflict resolution strategies might achieve what you need. For instance, lets say you have 3 rules, A, B and C. You want to use, lets say, salience to give priority

Creating Taxonomy Table in MySQL

断了今生、忘了曾经 提交于 2019-12-03 03:07:14
I am creating a botanical database where the plants will be organized by their taxonomy: Life Domain Kingdom Phylum Class Order Family Genus Species I was considering using the example put forth by the article Managing Hierarchical Data in MySQL , however it is adding the above list as records inside the table....and I'm not sure if that is the best thing to do since I will be having multiple species per genus and multiple genus per family and so on. What would you suggest is the best way to approach this problem. Thanks in advance. Ante I worked with similar data, and I made it in 2 parts. In

Maven naming conventions for hierarchical multiple module projects

余生长醉 提交于 2019-12-03 03:04:47
问题 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

How to use enum with grouping and subgrouping hierarchy/nesting

被刻印的时光 ゝ 提交于 2019-12-03 01:31:16
I have one enum 'class' called Example as follows: enum Example { //enums belonging to group A: enumA1, enumA2, enumA3, //enums belonging to group B: enumB1, enumB2, enumB3, //enums belonging to group C: enumC1, enumC2, enumC3; } It's important for my project they all enums I work with belong to Example (since this is an argument in a constructor of a class). How do I use enum hierarchy/nesting in order to achieve the following: A method that tests whether an enum is of group A, B or C. For example, something like Example.enumA1.isGroupBelonging(Group.A) or isGroupBelonging(Example.enumA1

2D Game: Fast(est) way to find x closest entities for another entity - huge amount of entities, highly dynamic

本小妞迷上赌 提交于 2019-12-03 00:08:02
I'm working on a 2D game that has a huge amount of dynamic entities. For fun's sake, let's call them soldiers, and let's say there are 50000 of them (which I just randomly thought up, it might be much more or much less :)). All these soldiers are moving every frame according to rules - think boids / flocking / steering behaviour. For each soldier, to update it's movement I need the X soldiers that are closest to the one I'm processing. What would be the best spatial hierarchy to store them to facilitate calculations like this without too much overhead ? (All entities are updated/moved every