nested

More nest Python nested dictionaries.

After reading http://stackoverflow.com/questions/635483/what-is-the-best-way-to-implement-nested-dictionaries-in-python why is it wrong to do: c = collections.defaultdict(collections.defaultdict(int)) in python? I would think this would work to produce {key:{key:1}} or am I thinking about it wrong? ...

Nested Views-button aint clicking

i have a view which has a datepicker and a button added to it. There is another view which adds the above view as subview. But the events like touchesBegan and button's action are not being clicked on the subview. Please help The code of the parent view is: iTagDatePicker *dt=[[iTagDatePicker alloc] initWithFrame:CGRectMake(0.0, 180.0...

is it possible to dynamically set the level of for loop nesting

I'm working out an algorithm to get permutations like 123 132 213 231 312 321 I'm doing it using nested foreach loops. for (..) { for(..) { for(..) { echo $i . $j . $k . "<br />"; } } } Problem is those # of nested loops are optimized for 3-spot permutations. How can I could I dynamically set ...

How can I use nested Async (WCF) calls within foreach loops in Silverlight ?

The following code contains a few nested async calls within some foreach loops. I know the silverlight/wcf calls are called asyncrously -but how can I ensure that my wcfPhotographers, wcfCategories and wcfCategories objects are ready before the foreach loop start? I'm sure I am going about this all the wrong way -and would appreciate an...

Pass or Get a value from Parent ViewModel down to Sub-ViewModel?

I am using the MVVM Light framework as well as Unity for DI. I have some nested Views, each bound to a corresponding ViewModel. The ViewModels are bound to each View's root control DataContext via the ViewModelLocator idea that Laurent Bugnion has put into MVVM Light. This allows for finding ViewModels via a static resource and for contr...

MySQL nested CASE error I need help with?

What I am trying to do here is: IF the records in table todo as identified in $done have a value in the column recurinterval then THEN reset date_scheduled column ELSE just set status_id column to 6 for those records. This is the error I get from mysql_error() ... You have an error in your SQL syntax; check the manual that corresponds ...

Convert a nested array into a flat array with PHP

Hello all, I'm trying to create a generic database mapping class with PHP. Collecting the data through my functions is going well, but as expected I'm retrieving a nested set. A print_r of my received array looks like: Array ( [table] => Session [columns] => Array ( [0] => `Session`.`ID` AS `Session_ID` ...

Nested Row problem

Hi, I'm using the 1kb css grid framework for a site, and although nested rows are apparently supported by the framework, when I try to drop in a nested row it doesn't work! Sorry not to explain it better - the site's here, may be easier to just look at the source: http://2605.co.uk/saf/build/ the grid: /grid.css the stylesheet: /styl...

Help with SQL query (list strings and count in same query)

Hi everybody, I’m working on a small kind of log system to a webpage, and I’m having some difficulties with a query I want to do multiple things. I have tried to do some nested / subqueries but can’t seem to get it right. I’ve two tables: User = {userid: int, username} Registered = {userid: int, favoriteid: int} What I need is a q...

python: what are efficient techniques to deal with deeply nested data in a flexible manner?

My question is not about a specific code snippet but more general, so please bear with me: How should I organize the data I'm analyzing, and which tools should I use to manage it? I'm using python and numpy to analyse data. Because the python documentation indicates that dictionaries are very optimized in python, and also due to the f...

rails question: how to create multiple child objects linked to a parent object with a select drop down in the parents create form?

Hi there, In a booking engine for buying tickets for events, written in rails, I have the following models: an order a ticket One order has many tickets, and one ticket belongs to an event. People that want to book tickets for an event, typically create a new order. They fill in some details (kept in the order model), and at the end...

Access Parent DataItem in Nested ListView

Hi Everyone, So I've got two listviews; one nested inside the other. The parent is being bound to a collection of objects that contain fields such as MaxPrice, MinPrice, and SuggestedProducts. The nested one is being bound to the SuggestedProducts collection of the parent item. How could I reference MaxPrice and MinPrice in the nes...

Nested Set - for CMS with two versions (edit / publish) mode

Hi! I'm looking for a solution (PHP/Symfony/Doctrine) for the following problem. I'm creating a table called 'pages'. This table is a nested set. I also want to create a table called 'pages_published' which has ofcourse also a nested set. Once i create a record in table 'pages' at some point i want to publish this to the 'pages_publis...

SQL Stored Queries - use result of query as boolean based on existence of records

Just getting into SQL stored queries right now... anyway, here's my database schema (simplified for YOUR convenience): member ------ id INT PK board ------ id INT PK officer ------ id INT PK If you're into OOP, Officer Inherits Board Inherits Member. In other words, if someone is listed on the officer table, s/he is listed on the b...

Nested query to find details in table B for maximum value in table A

I've got a huge bunch of flights travelling between airports. Each airport has an ID and (x,y) coordinates. For a given list of flights, I want to find the northernmost (highest x) airport visited. Here's the query I'm currently using: SELECT name,iata,icao,apid,x,y FROM airports WHERE y=(SELECT MAX(y) FROM ...

Call nested rake file from the root directory

How can I run rake file for a nested project from the root directory? (2 cases: from console and from the root rakefile). Assume that I cannot modify the nested rakefile and that it must have 'libs/someproject' as the working directory. Here is my project structure: -root --rakefile.rb --libs ---someproject ----rakefile.rb ...

How to fill an inner gridview based on outer gridview selection (ASP.NET/C#)

I have 2 GridViews, the InnerGridView is nested inside a TemplateField of my OuterGridView. Each GridView has an ObjectDataSource (ODS). I want the InnerGridView to display data that is unique to the GroupName that is listed in the OuterGridView. I have been Googling this for weeks, seeing various ideas based around RowDataBound and the ...

Storing in variable for later use vs. creating from scratch again (Cocoa)

I'm wondering if there's a difference between NSFileManager *fileManager = [NSFileManager defaultManager]; [fileManager doStuff]; //doStuff is not a real method. [fileManager doOtherStuff]; and [[NSFileManager defaultManager] doStuff]; [[NSFileManager defaultManager] doOtherStuff]; In speed / memory footprint / everything else that...

Multiple levels of 'collection.defaultdict' in Python

Thanks to some great folks on SO, I discovered the possibilities offered by collections.defaultdict, notably in readability and speed. I have put them to use with success. Now I would like to implement three levels of dictionaries, the two top ones being defaultdict and the lowest one being int. I don't find the appropriate way to do th...

Nested function in C

Can we have a nested function in C? What is the use of nested functions? If they exist in C does there implementation differes from compiler to compiler. Are nested functions allowed in any other language? If yes then what is there significance? ...