nested

Logic for displaying infinite category tree in nested <ul>s from Self Join Table

Hi everybody! Please help me solve my big problem. in my on-line shopping project i created a dynamic Category List (with Infinite Level Depth) Implemented in a Single Table in DB with Self join. the schema is like below: Update I want to use a JQuery plugin to make a Multi Level Menu bar. this plugin uses <ul> and <li> elements so I sh...

What is the best practice for a hierarchical state machine using the state pattern?

Hi all, I'm about to implement a hierarchical state machine in C# using the state pattern. As a guide I'm using this example. The example doesn't provide an answer regarding hierarchical states though. Unfortunately, I can't seem to find good examples elsewhere. My first thought is to create nested classed for the hierarchical states. B...

Update Parent UpdatePanel from Child UpdatePanel - Conditionally

I am trying to trying to setup an updatepanel to update every X seconds, the problem is I don't want the control to actually refresh unless there is new data. So I currently have a child updatepanel in a parent UpdatePanel, the child updatepanel gets refreshed by a timer. But I can't seem to find a way to trigger the parent panel to up...

writing the outcome of a nested loop to a vector object in R

Dear Stackers, I have the following data read into R as a data frame named "data_old": yes year month 1 15 2004 5 2 9 2005 6 3 15 2006 3 4 12 2004 5 5 14 2005 1 6 15 2006 7 . . ... . . . ... . I have written a small loop which goes through the data and sums up the yes variable for each ...

Arbitrary number of nested-loops?

I'm looking to take an arbitrary number of lists (e.g. [2, 1, 4 . . .], [8, 3, ...], . . .) and pick numbers from each list in order to generate all permutations. E.g.: [2, 8, ...], [2, 3, ...], [1, 8, ...], [1, 3, ...], [4, 8, ...], [4, 3, ...], ... This is easily accomplished using nested for-loops, but since I'd like to it accept...

Pseudo-dicts as properties

I have a Python class C which should have two pseudo-dicts a and b. The term pseudo-dicts means that the dictionaries don't actually exist and that they are “recomputed” each time a key is accessed. In pseudocode this would look like this: class C: def a.__getitem__(self, key): return 'a' def b.__getitem__(self, key): ...

Removing nested bbcode (quotes) in PHP

Hello, I'm trying to remove nested quoting from my bulletin board, but I'm having some issues. Example input: [quote author=personX link=topic=12.msg1910#msg1910 date=1282745641] [quote author=PersonY link=topic=12.msg1795#msg1795 date=1282727068] The message in the original quote [/quote] A second message quoting the firs...

Python - Dynamic Nested List

Hi. So I'm trying to generate a nested list in Python based on a width and a height. This is what I have so far: width = 4 height = 5 row = [None]*width map = [row]*height Now, this obviously isn't quite right. When printed it looks fine: [[None, None, None, None], [None, None, None, None], [None, None, None, None],...

MYSQL WHERE-IN Subquery Runs Forever

I have a MySQL table. Let's call it Widgets. The Widget table has 3 fields: id, type_id, and name. I want, in one query, to get all the widgets that share a type_id with the Widget named 'doodad'. I've written 2 queries: Give me the type_id of the widget with the name 'doodad'. Give me all widgets with that type_id. This works. Each ...

Need clarification about nested models

I need an example on how to operate on nested models. Let's assume, we have some order management application and models: Order, Position, Item. Order can contain Positions and Positions can contain Items. The question is: how to handle data selection? Some use cases that is needed: Get list of Orders with Positions and Items (like...

extracting a structure from a nested structure in c

Hi I have following problem: I have one global structure that has many structures inside. Now I want one of the substructures taken out and stored in some other structure. typedef struct { int a; }A; typedef struct { int b; }B; typedef struct { A dummy1; B dummy2; } C; I want to declare fourth structure that extracts A fr...

AzMan Nested Roles not finding user in role

I'm using AzMan (1.0) for an ASP.Net web app, and I have a question about nested Roles. Say I have the following roles: MyApp MyAppUser MyAppAdmin MyAppSupport For the most part, all users (MyApp) can access the app, but some functions will be specific to the other roles. I want to declaratively restrict access to the web pages to me...

Declaring an instance of an explicit specializtion of a template within a regular class

I can't get this to compile at all. I may not be possible but I don't know why it should not be. class A { template <typename T> class B { int test() { return 0; } }; //template <> class B<int>; <-with this, namepace error B<int> myB_; }; template <> class A::B<int> { int test() { return 1; } }; As it appears ...

nested checkboxes with JStree

Hello. I am trying to replicate the behaviour of the nested tree list of checkboxes in the following link using the JStree Jquery module - http://www.blueshoes.org/_bsJavascript/components/tree/examples/example3.html JStree - www dot jstree dot com I've swiped the callback behaviour below from another post on the subject, but haven't...

Map<String, Map<String, Boolean>> myMap = new HashMap<String,HashMap<String,Boolean>>();

Why doesn't that work in java, but this does Map<String, Map<String, Boolean>> myMap = new HashMap<String,Map<String,Boolean>>(); Just to clarify the below alteration of the nested HashMap shows a compiler error, whereas the above does not not; with a Map (not hashmap) Map<String, Map<String, Boolean>> myMap = new HashMap<String,Hash...

In Java, is this considered an example of a "nested IF statement"?

Here we have a long-standing assumption that needs to be cleared up in my head. Is the following an example of nesting 'if' statements: if (...) ...; else if (...) ...; I was under the impression that nesting required an 'if' inside another 'if', like so: if (...) if (...) ...; or at least a clear separation of scope when...

Figure out nested submenu selections in wxPython?

Let's say in a larger submenu structure with a depth of 3 levels, I have selected 'car' in the first level, 'type' in the second, and 'suv' in the third and last level. Is there any way I can figure all these three selections in my def OnPopupItemSelected(self, event) method? I hope I have made myself clear enough, if not, please add a ...

Can you nest asp.net controls ?

I want to create control which would contain other controls. For these other controls I want to create "base" control with some default look and background logic and then derive all other controls from this "base" control. Is this possible, and how it can be done ? EDIT: With nesting I mean something like master pages. I would lik...

nesting too deep in JSON... should I switch to XML?

I am getting a JSONException complaining about a very deep nesting (more than 30). I know that the value is hardcoded in JSONWriter. what best can I do? use another library without this restriction if such thing exists? switch to XML? UPDATE: I am serializing a labeled tree structure into JSON. So starting with root, each node is nesti...

What's the motive behind Chained Package clauses in Scala?

Chained package clause were introduced in Scala 2.8, as described by Martin Odersky on the Scala site. I don't quite get the intuition behind this. Following was the example in the Scala book for the nested packages: package bobsrockets { package navigation { // In package bobsrockets.navigation class Navigator ...