hierarchy

Rounded Corners in Parent DIV not effecting Child DIVs

纵然是瞬间 提交于 2019-11-29 19:09:43
问题 So, I'm experimenting with using rounded-corners in CSS3 (not in IE, don't care if it works there), and I have the DIV where all of my content lives looking quite nice. The problem I'm having is that there are child DIVs that are not getting "masked" by the parent's rounded corners. I'm not looking for the child to inherit the rounded-corners. I just want to have any content inside the parent to not be visible where it is rounded, as if it were masked. I tried using "overflow: hidden;", but

javascript: access object (array) by array notation string

我与影子孤独终老i 提交于 2019-11-29 18:14:15
I would like to access the object provided only it's string path in form of array is known. 1.) there is an object, where root["obj1"]["obj2"] = 1; (in common case root["obj1"]...["objN"] ) 2.) I have ONLY string objectPath known: var objectPath = 'root["obj1"]["obj2"]' 3.) I need NOT only READ the object, but SET it's value, like objectPath = 2; //so root["obj1"]["obj2"] === 2 As I understand there might be some options with eval(), but it gets the value, not the variable; one can loop through all objects of root, make convertion to "root.obj1.obj2" (which is not the case, as "obj1" can

Java inheritance vs. C# inheritance

╄→гoц情女王★ 提交于 2019-11-29 17:11:00
问题 Let's say Java has these hierarchical classes: class A { } class B extends A { public void m() { System.out.println("B\n"); } } class C extends B { public void m() { System.out.println("C\n"); } } class D extends C { public static void main(String[] args) { A a = new D(); // a.m(); // doesn't work B b = new D(); b.m(); C c = new D(); c.m(); D d = new D(); d.m(); } } This is the (blind) duplication of the same code in C#: using System; class A { } class B : A { public void M() { Console

wordpress: how to add hierarchy to posts

五迷三道 提交于 2019-11-29 16:02:39
问题 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', /*

How to use CTE to map parent-child relationship?

醉酒当歌 提交于 2019-11-29 15:29:05
Say I have a table of items representing a tree-like structured data, and I would like to continuously tracing upward until I get to the top node, marked by a parent_id of NULL. What would my MS SQL CTE (common table expression) look like? For example, if I were to get the path to get to the top from Bender , it would look like Comedy Futurama Bender Thanks, and here's the sample data: DECLARE @t Table(id int, description varchar(50), parent_id int) INSERT INTO @T SELECT 1, 'Comedy', null UNION SELECT 2, 'Futurama', 1 UNION SELECT 3, 'Dr. Zoidberg', 2 UNION SELECT 4, 'Bender', 2 UNION SELECT 5

mysql hierarchy storage with large trees

青春壹個敷衍的年華 提交于 2019-11-29 15:25:21
问题 I don't know how to store my hierarchical data in my innoDB-table. I've read a lot about the disadvantages of the method of storing the parent_id in each row. But now the problem is, that I have a very large database (~50 million rows). The hierarchy is mostly not very deep (3-6 levels). Many websites advise taking the "Nested Set Model" as a better alternative to the parent-id-storing-method. But there are always changes being made ( UPDATE , INSERT etc.) by the users of the website and

Dynamic Array traversal in PHP

為{幸葍}努か 提交于 2019-11-29 15:16:54
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 = (string) $key; $out = $array[$key] . "/" . $out; $key = $array[$key]; $out = $array[$key] ? $array[$key] . "/" . $out : ""; $key = $array[$key]; $out = $array[$key] ? $array[$key] . "/" . $out : ""; $key = $array[$key]; $out = $array[$key] ? $array[$key] . "/" .

Depth-first flattened collection of an object hierarchy using LINQ

蓝咒 提交于 2019-11-29 14:31:46
I have an object hierarchy (MasterNode -> ChildNodes) where master and child nodes are of the same type, and there are only two levels (top level and children) like this ('A' is parent of D,E and F, 'B' is parent of G, etc) A--+ | D | E | F | B--+ | G | C--+ H I Suppose I have a MasterNodes as an IEnumerable of the parent objects (A,B,C) and given a parent object X I can get an IEnumerable of its children by X.children I know that I can enumerate all of the leaf (child nodes) with the SelectMany method or by using from parent in Masternodes from child in parent.children select child This will

Whose view is not in the window hierarchy issue?

假装没事ソ 提交于 2019-11-29 07:37:36
Warning: Attempt to present on whose view is not in the window hierarchy! Yes I have looked at the other questions and answers before posting this question. They have not helped me resolve this. Here's what I am doing. I am calling on my singleton class socialHelper to display an action sheet, where postToFacebook method is an option to select. When clicking on this action, I get the Warning above and the postToFacebook is not displayed. I'm calling this from a UIViewController with the UINavigationController as the main controller, and my SocialHelper class is a NSOject . - (void

SQL Server 2008 Hierarchy Data Type Performance?

依然范特西╮ 提交于 2019-11-29 06:54:49
问题 How does SQL Server 2008's Hierarchy data type perform compared to using the hierarchy implementation described by Joe Celko here: http://www.intelligententerprise.com/001020/celko.jhtml? I've used Celko's method in the past with great results - but don't want to implement it for a new project unless it's better than what Microsoft has provided in SQL Server 2008. 回答1: So far, I've only found a single reasonably interesting article on the topic. HierarchyId is much faster than any self-made