nested

Return function pointer to a nested function in C

As the title already states, I'm trying to declare a nested function and return a pointer to that function. I want this function 'not' to return a new function pointer which will return the negation of whatever the original function was. Here is what I have: someType not( someType original ) { int isNot( ListEntry* entry ) { ...

Why/when should you use nested classes in .net? Or shouldn't you?

In Kathleen Dollard's recent blog post, she presents an interesting reason to use nested classes in .net. However, she also mentions that FxCop doesn't like nested classes. I'm assuming that the people writing FxCop rules aren't stupid, so there must be reasoning behind that position, but I haven't been able to find it. ...

Nested SQL Server transaction performing cascade delete

Suppose I have a table called Companies that has a DepartmentID column. There's also a Departaments table that has as EmployeeID column. Of course I have an Employee table as well. The problem is that I want to delete a company, so first i have to delete all the employees for every departament and then all the departaments in the company...

Need refactoring ideas for Arrow Anti-Pattern

I have inherited a monster. It is masquerading as a .NET 1.1 application processes text files that conform to Healthcare Claim Payment (ANSI 835) standards, but it's a monster. The information being processed relates to healthcare claims, EOBs, and reimbursements. These files consist of records that have an identifier in the first few...

Can regular expressions be used to match nested patterns?

Is it possible to write a regular expression that matches a nested pattern that occurs an unknown number of times. For example, can a regular expression match an opening and closing brace when there are an unknown number of open closing braces nested within the outer braces. For example: public MyMethod() { if (test) { // More ...

Nested Class

What's the best way of accessing the control in the enclosing class from the nested class? Say if I have a dropdown in a form and I have another nested class inside of this class . Now what's the best way to access this dropdownlist from the nested class? ...

How do you sort a tree stored using the nested set model?

When I refer to nested set model I mean what is described here. I need to build a new system for storing "categories" (I can't think of better word for it) in a user defined hierarchy. Since the nested set model is optimized for reads instead of writes, I decided to use that. Unfortunately during my research and testing of nested sets...

Parsing of nested tags in a file

Hi, I am wondering - What's the most effective way of parsing something like: {{HEADER}} Hello my name is {{NAME}} {{#CONTENT}} This is the content ... {{#PERSONS}} <p>My name is {{NAME}}.</p> {{/PERSONS}} {{/CONTENT}} {{FOOTER}} Of course this is intended to be somewhat of a templating system in the end, s...

Nested transactions in LINQ to SQL

I need help with realizing quite complex business logic which operates on many tables and executes quite a few SQL commands. However I want to be sure that the data will not be left in incosistent state and to this moment I don't see the solution which would not require nested transactions. I wrote a simple pseudo-code which illustrates ...

C++ Nested classes driving me crazy...

i am trying to compile this very simple piece of code class myList { public: std::vector<std::string> vec; class Items { public: void Add(std::string str) { myList::vec.push_back(str); }; }items; }; int main() { myList newList; newList.items.Add("A"); } what can i do to make this work ...

Jython and Java nested class

Hi, I'm using Jython to write tests for a Java project. It works well, but I can't figure how to get access to a java public nested class. package mypackage; public class NyClass { public class MyNestedClass { ... } } Does somebody knows how to do this? ...

Searching for the best PHP nested sets class (PEAR class excluded)

I'm looking for a PHP (with MYSQL) nested sets class with all needed functions. For example: createLeftNode, createRightNode,createRootNode, createSubNode,deleteNode and moveTree. Not only 1 left, 1 right, 1 up and 1 down but also a part of a tree in a nother tree. Thanks! ...

Nested Datalists using stored procedure parameters

Hi, I'm working with some nested datalist controls and cannot get the SP parameters for my nested stored procedure to work. In debug I can see that SqlDataSource2.SelectParameters.Add("Section",oLabel.Text.ToString()); is getting the correct value from the label but when the results display I always get the results for the last parame...

Can you have protected nested classes in C++?

I have a class that only really ever needed by classes in a certain class hierarchy. I wanted to know if it is possible to nest the class in the highest class's protected section and have all the other classes automatically inherit it? ...

C++ Nested classes forward declaration error

I am trying to declare and use a class B inside of a class A and define B outside A. I know for a fact that this is possible because Bjarne Stroustrup uses this in his book "The C++ programming language" (page 293,for example the String and Srep classes). So this is my minimal piece of code that causes problems class A{ struct B; // fo...

Nested functions: Improper use of side-effects?

I'm learning functional programming, and have tried to solve a couple problems in a functional style. One thing I experienced, while dividing up my problem into functions, was it seemed I had two options: use several disparate functions with similar parameter lists, or using nested functions which, as closures, can simply refer to bindin...

How to performance test nested Sybase stored procedures?

I am looking for any tool which will allow the performance testing/tuning of Sybase nested stored procedures. There are many tools around and of course Sybase's own for performance tuning and testing SQL but none of these can handle nested stored procedures (i.e. a stored proc calling another stored proc). Does anyone have/know of such a...

Replacing Nested if statements.

This is related to a chapter from beautiful code. And in that chapter I read about the nested ifs. The author was talking about deeply nested ifs as orginator of bugs and less readable. And he was talking about replacing nested ifs with case statements and decision tables. Can anybody illustrate how to remove nested ifs with case (sel...

Change items in the LayoutTemplate of a nested ListView

This is related to my earlier question, but I thought I'd simplify it and make a challenge out of it. Given the code below, can you change the value of "ChangeThisLabel" from the code behind? <asp:ListView ID="OuterListView" runat="server"> <LayoutTemplate> <asp:PlaceHolder ID="itemPlaceHolder" runat="server" /> </Layout...

Is there a Ruby equivalent to Perl's Data::Rmap?

Perl's Data::Rmap allows you to recursively evaluate a BLOCK over a list of data structures (locally setting $_ to each element) and return the list composed of the results of such evaluations. $_ can be used to modify the elements. This is useful for iterating over things like nested hashes, or hierarchies of arrays of hashes and the l...