nesting

Style of if: to nest or not to nest

A colleague of mine and me had a discussion about the following best-practice issue. Most functions/methods start with some parameter checking. I advocate the following style, which avoids nesting. if (parameter one is ugly) return ERROR; if (parameter two is nonsense || it is raining) return ERROR; // do the useful stuff return result...

Symfony: embedRelation() controlling options for nesting multiple levels of relations

Hey all, I'm trying to set some conditional statements for nested embedRelation() instances, and can't find a way to get any kind of option through to the second embedRelation. I've got a "Measure->Page->Question" table relationship, and I'd like to be able to choose whether or not to display the Question table. For example, say I have...

In CSS, can "#footer #caption" coexist with "#content #caption"?

I was going to "nest" the CSS ids like this #content #caption { color: teal } ... #footer #caption { margin: 2em 1em } because that's the way SASS (a CSS generator) can do nesting for... but then in one HTML document, we cannot have two ids with the same name, isn't that true, so the above nesting won't work or won't work well. (e...

running pdb from within pdb

I'm debugging an script that I'm writing and the result of executing a statement from pdb does not make sense so my natural reaction is to try to trace it with pdb. To paraphrase: Yo dawg, I like python, so can you put my pdb in my pdb so I can debug while I debug? ...

Does it really saves a lot of time to have nested rules in CSS? (using HAML or LESS)

Currently, this is how I'm coding my CSS: Normal CSS: #content { color: white; background: black; } #content a { color: yellow; } #content p { margin: 0; } #content (etc...) #contnet (etc...) #content (etc...) (I always include the parent even if its not necessary so I can orient myself within the stylesheet) This is how...

T-SQL Nested Subquery

Not being a SQL expert, and also only being semi-competent in CTE, how can I code this statement use the resultset from the following subquery within the main query, as our SQL Server is 2000. declare @subcategoryConcatenate varchar(3999) set @subcategoryConcatenate = '' select @subcategoryConcatenate = @subcategoryConcatenate + pumpCa...

Nesting queries in CF

I'm using this code to display a list of platforms. If a platformID was specified upon entering the page, I would like to create a list of genres underneath the specified platform. browse.cfm was accessed via a link that specified a platformID of 1 browse.cfm will list all available platforms browse.cfm will now list all available gen...

How can I determine what constitutes valid nesting of tags in Apache Trinidad Faces?

I have a complex application that contains a mix of JSF and Apache MyFaces. In any case, I'm getting a runtime ServletException about a ConvertNumberTag () that's invalidly-nested (currently, it's under a tr:outputText tag). Unfortunately, I cannot figure out how to tell what is valid and invalid nesting. The Apache MyFaces site doesn't...

Does nesting affect efficiency?

Consider languages like Python or JavaScript that allow functions to be nested like this: print(vector(a * b),(a * c),(b * c))) or flat like this: i = (a * b) j = (a * c) k = (b * c) V = vector(i,j,k) print(V) How much does the different format affect performance? Can valid generalizations be made, or does it vary a lot by language...

Best Practice Mongoid:NestedResources

Hello Mongo Friends, I'm starting off with a small Rails3:MongoDB:Mongoid project and came along some questions that's nature is more architectural. When to use nested resources, and how deep to nest? I'm not a friend of nested routes at all, but they become handy if not stacked deeper than 2 resources and document oriented database...

Nested ajax calls not working in IE7

Hi all, I have nested ajax calls that are not working in ie7. They work fine in Firefox. The service file in the second $.post is not being entered at all. In other words, if the first line of my service file is print 'hello'; I never see it...even if I add a console.log in the $.post for the response. I have seen this issue in other pla...

Limits on Windows environment variable nesting?

So, is there a limit to how deeply environment variables can be nested in Windows? I do a lot of development work and I'm trying to set up my development environment vars, and a lot of them nest off each other, ie. GLEW=%THIRD_PARTY_ROOT%\GLEW GLEW_1_5_5=%GLEW%\glew-1.5.5 GLEW_BIN_PATH=%GLEW_ROOT%\bin GLEW_INCLUDE_PATH=%GLEW_ROOT%\incl...

Maximum stored procedure, function, trigger, or view nesting level exceeded in Visual Studio (ado.net) but not in SQL server.

I have a problem with a recursive SQL function. The original problem is that I've got a list of employees, each of them has various trainings. Each of these trainings has some pre requirements. For example to have your Class 1 drivers license you must have your Class 5. If I remove the Class 5 I need to check disable the Class 1. Now as...

binding a datagrid to nested collections within collection

I'm trying to bind a datagrid to data from within a collection of a collection of the datacontext. The result should be as though all of the nested collections were just one collection with the parent collection properties still available. For example I have a series of products associated to an order and each product can have multipl...

Restrict the depth of nested elements in XSD

Is it possible with XML schema to restrict the depth of child elements nested in a parent? The context here is I collect alarms from a management system and I want to provide a XML document which allows the end user define some rules in order to filter the alarms into folders in the UI. I want to restrict the depth of nested folders to ...

Don't understand JspTagException: "Illegal use of <when>-style tag without <choose> as its direct parent

I've been staring at the tag nesting below for about an hour now and I still can't figure out why I keep getting a JspTagException: "Illegal use of <when>-style tag without <choose> as its direct parent" Are you not allowed to nest condition tags this deeply in JSTL? <c:choose> <c:when test="${rec.image1Available}"> <img alt=...

Nested Classes C++ static inner methods (Xml parsing and trying to populate vector with values)

So this is what I am trying to accomplish. I am trying to use a sax parser to parse some XML. it looks like I need to call all their methods as statics. So if I want to pass a value back from say startElement it is static void startElement. Which brings me to my example code. I have been pulling my hair on how to update a value in a Nes...

Limit functions to be called by specific other functions in Ada

Suppose I have a procedure that I want to only have called by another specific procedure. Is it possible to force restrictions on that procedure so that it can only be referenced by the specified calling procedure? Really what I'm wanting to know, is whether there is another way to write the code so you don't have to nest/embed procedure...

Nesting Android APKs

Hey, Is there any way to nest APKs so that you can open one with another? I am looking to wrap a bunch of APKs with some control options that can fire an APK when selected. Even if i can start with one opening one other it would be a start... I have thus far tried the dex loader to no avail... Keep getting a load error in the log dump...

Multi-nested, multi-block mixins in lessphp

While transforming some code to lessphp from the classic less code; an incompatibility I discovered from the classic less css is that there is no support for multi-block mixins with nesting levels > 2. The classic less seems to be fully in support of mixins having many nested blocks in them. Is this intentional - the support for just tw...