nesting

To Nest or Not to Nest?

Premise: Usually during preparation of a new Ruby on Rails App, I draw out models and relations regarding user navigations. Usually I hit a place where I need to ask myself, whether or not I should go beyond the usual "rule of thumb" of nesting no more 1 level deep. Sometimes I feel the need to nest, rather than creating another namespac...

Preferred way to include relative reference to JavaScript in VS 2008 nested Masterpage.

Our base Masterpage has something like the following <head runat="server"> <title></title> <script type="text/javascript" src="<%= Page.ResolveClientURL("~/javascript/actions.js")%>"></script> <script type="text/javascript" src="<%= Page.ResolveClientURL("~/javascript/jquery/jquery-1.2.6.min.js")%>"></script> <asp:content...

Scheme Macro for nesting expressions

Can a macro be written in Scheme (with define-syntax, for example) which will take expressions like this: (op a b c d e f g h i j) And yield expressions like this as output? (op (op (op (op (op (op (op (op (op a b) c) d) e) f) g) h) i) j) Of course, for arbitrary lengths. I can't think of a way to do it, given some template like th...

Best way to do nested case statement logic in SQL Server

I'm currently writing an SQL Query, where a few of the columns returned need to be calculated depending on quite a lot of conditions. I'm currently using nested case statements, but its getting messy. Is there a better (more organised and/or readable) way? (I am using Microsoft SQL Server, 2005) A simplified example: SELECT col...

Can I have nested try-catch blocks in C++?

Can I have nested try-catch blocks? For example: void f() { try { //Some code try { //Some code } catch(ExceptionA a) { //Some specific exception handling } //Some code } catch(...) { //Some exception handling } }/...

How do you overcome the html form nesting limitation

I know that xhtml doesn't support nested form tags and I have already read other answers here in stackoverflow regarding this subject, but I still haven't figured out an elegant solution to the problem. Some say you don't need it and that they can't think of a scenario were this would be needed. Well, personally I can't think of a sce...

Flash, cant reach movie clip.

Hello, I am working on a flash step-by-step guide. and i have a problem. There are 3 layers, 1 is scripts 2 is invisible button 3 is a cover screen(mc) , inside cover screen. on its own timeline , it has an animation. , what im trying to do is ; when i roll over the invisible button , i want the cover screen timeline to play and sto...

Right Float and container div

Hi, I have 3 divs in a container div. The first is floated left, the second is floated right and the last sits in the center. This creates 3 approximately even divs across a container div. In each of these divs I am placing an image of varying heights. Then there is a separate div to sit below the container div which will be the full w...

When to include sub-items in RESTful resource representation?

RESTful design seems to advocate flat or shallow structured representations (at least when resources are represented as XML). A resource representation should contain just the resource, which the URI identifies. I'm wondering when it is sensible to present resource's sub-resources within the parent resource? To elaborate, consider this...

how do I make an element a child of itself in XML Schema?

I'd like the ability to have an arbitrary level of nesting children of the same parent element, e.g.: <path expr="/"> <path expr="usr"> <path expr="bin"> <path expr="X11" /> </path> </path> <path expr="var" /> </path> I'm writing the XML Schema file, and I'm at a loss as to how to represent this parent/child relati...

1 Dimensional Nesting

Does anybody have an effective Delphi software solution for nesting 1 dimensional lengths into predefined stock lengths? ...

Css Style Nesting - Proper Form?

I am having a problem trying to find any specific details on how to properly write css rules in a stylesheet where the class or id is nested within many other ids and styles. ie) .mainbody #container #header #toprightsearch .searchbox {} So here we have a searchbox class within a toprightsearch id, in a header id, in a container id, in...

Binding multiple related variables in Clojure without nested let

I want to use the value of a variable to compute the value of another variable in the same let statement. Is there a way to do this in Clojure without using nested lets? Nested let solution: (let [x 3] (let [y (+ 1 x)] y)) = 4 Desired solution: (let [x 3 y (+ 1 x)] y) = 4 ...

make a nested file from a flat file data

I am newbie for coding and I looking for simple solution for conversaton of the flat file (4 columns) like A-data//A-ID//B-data//B-ID sample1//123//sample2//456 where A-ID have a direct connection to the B-ID (like a directed graph A => B). I need to make the new flat file according to the algorithm: if the B-ID (row1) matches A-ID...

Simple C# Question: Nesting Classes, Accessibility

I know this is probably simple, but I can't seem to figure out if it's possible to do this. I have the following code: public class A { thisMethod(); public class B { someMethod(); } } public class C { A myA = new A(); A.B.someMethod(); } Why can't I access B if I've already instantiated A? THan...

CSS: position:fixed inside of position: fixed

Okay, I've noticed something, but couldn't find it in the CSS spec. Styling an element with position: fixed will position it absolutely, with respect to the browser viewport. What happens if you place a fixed-position element inside another? Example CSS along the lines of: .fixed { position: fixed; width: 100px; height: 100p...

How to release an NSMutableDictionary Instance Variable properly, with nested dictionaries, in Objective-C?

I have an Objective-C class that looks something like: @interface myClass : NSObject { NSMutableDictionary *aDict; } Its setter method looks like: - (void) setADict: (NSMutableDictionary *) newDict { [aDict release]; [newDict retain]; aDict = newDict; } I've created an instance of the object, put data into aDict, an...

Delimiting four nested items in Javascript/Html

Okay this is frustrating me to no end. I recently coded a page in JS for a buddy of mine who wants to display wedding pictures to a family to see which ones they'd like to purchase. I used a for loop to count 1-904: for (beginnum=1;beginnum<=904;beginnum++) { yada yada... Then, I used adobe bridge to rename the camera files to be 1-9...

When would you want to nest classes in C#?

Specifically, can anyone give me concrete examples of when or when not to use nested classes? I've known about this feature since forever, but never had a reason to use it. Thanks. ...

jQuery Nesting Events

Sometimes in my jQuery scripts they don't work unless I nest the events. For example... $(selector).click(function(){ //do something such as create an element $(selector).click(function(){ //do something with the created element }); }); Is this ok? I've always tried to avoid it as it doesn't seem the proper way of doi...