stack

Run-Time Check Failure #2 - Stack around the variable 'x' was corrupted.

I receive this Run-Time Check Failure upon the return in the following code. I believe similar code is running fine elsewhere in the program. Any ideas? String GetVariableName(CString symbol, CString filepath) { char acLine[512]; char acPreviousLine[512]; CString csFile; FILE *fp; csFile.Format("%svariables.txt", f...

How can I increase the stack size with runhaskell?

I'm writing some disposable Haskell scripts to solve some of the Project Euler problems. I don't really want to have to compile them because of the number of changes I'm constantly having to make, but in a few cases I've found that I've run out of stack space. The documentation for runhaskell says that the following syntax should increa...

How do I extend infix and stack priorities to additional operators?

How would the infix and stack priorities be extended to include the operators <, >, <=, >=, ==, !=, !, &&, and ||? When parsing an infix expression, for example: P + (Q – F) / Y#, each symbol has a priority which is relevant to their order of operation. / and * have a higher priority than + and -. Here are the priorities I have/underst...

General Question: Java has the heap and local stack. Can you access any object from the heap?

I was really looking at the differences between pass by value and how Java allocates objects and what java does to put objects on the stack. Is there anyway to access objects allocated on the heap? What mechanisms does java enforce to guarantee that the right method can access the right data off the heap? It seems like if you were cra...

How can I implement a stack?

How can I create a program to convert binary to decimal using a stack in C#? ...

Java Collections (LIFO Structure)

Hi, I am looking in the Collections framework of Java for a LIFO Structure (Stack) without any success. Basically I want a really simple stack; my perfect option would be a Deque, but I am in Java 1.5. I would like not to have to add another class to my structure but I am wondering if that is possible: Is there any class in the Collec...

segmentation fault using OMP

Hi, all! Typing from Italy This little piece of code works if the matrix size is less then 800 and fails with a segmentation fault for higher sizes.... I have tried it with gcc 4.3.2 compiler in linux and macosx and VisualStudio compiler in windows. Seemsthe problem is in the stack size..... how can I increase it ? How can I solve the pr...

C++: how to create an array of objects on the stack ?

Consider the following piece of Java code. int N = 10; Object obj[] = new Object[N]; for (int i = 0; i < N; i++) { int capacity = 1000 * i; obj[i] = new ArrayList(capacity); } Because in Java, all objects live on the Heap, the array does not contain the objects themselves, but references to the objects. Also, the array itself ...

I need some help in Undo function in Java

I write a Text Editor with Java , and I want to add Undo function to it but without UndoManager Class , I need to use a Data Structure like Stack or LinkedList but the Stack class in Java use Object parameters e.g : push(Object o) , Not Push(String s) I need some hints or links . Thanks ...

Hosting, deploying and running web applications in the cloud

So far I've read some blog articles about cloud computing and services for hosting applications in the grid. If I'd wanted to have a web application running in the cloud for as little cost as possible, what would be the best solution? Let's assume the following configuration: J2EE web application Any free database (MySQL, PostgreSQ...

Stacking rectangles to into the most square-like arrangement possible

My Situation I have a N rectangles The rectangles all have the same shape (for example 2 inches wide x 1 inch tall) - Let's refer to this size as Sw and Sh for the width and height I want to position these rectangles in a grid such that the rects completely on top and next to each other - like what you would see in a spreadsheet What ...

How to go to main stack

I am using alternate stack to handle signals for program in C over linux. When stack overflow occurs, my signal are delivered on to my alternate signal stack not on the main stack. So in this situation I want to dump the main stack.... how can I ? ...

Can you get a list of variables on the stack in C#?

All, just wondering if it's possible in .NET/C# to get a list of variables on the stack and their values? I am creating an exception handler for my app and beyond a standard stack trace I'd also like to see the names and values for any variables that are on the stack. Any idea if this can be done? ...

what does web stack mean?

especially "stack" part ...

Can I Limit the depth of a Generic Stack?

Is there a built in way to limit the depth of a System.Collection.Generics.Stack? So that if you are at max capacity, pushing a new element would remove the bottom of the stack? I know I can do it by converting to an array and rebuilding the stack, but I figured there's probably a method on it already. EDIT: I wrote an extension method...

How to determine maximum stack usage?

What methods are available for determining the optimum stack size for embedded/memory constrained system? If it's too big then memory is wasted that could be used elsewhere. However, if it is too small then we get this website's namesake... To try to jump start things: Jack Ganssle states in The Art of Designing Embedded Systems that, "...

How do I obtain a stack trace on Windows without using dbghelp.dll?

How do I obtain a stack trace of addresses on Windows without using dbghelp.dll? I don't need to know what the symbols or function names associated with the addresses, I just want the list of addresses -- something similar to backtrace of *nix systems. Thanks! ...

Stack,Static and Heap in C++

I've searched, but I've not understood very well these three concepts. When do I have to use dynamic allocation (in the heap) and what's its real advantage? What are the problems of static and stack? Could I write an entire application without allocating variables in the heap? I heard that others languages incorporate a "garbage coll...

Stacks - why PUSH and POP?

I was wondering why we use the terms "push" and "pop" for adding/removing items from stacks? Is there some physical metaphor that caused those terms to be common? The only suggestion I have is something like a spring-loaded magazine for a handgun, where rounds are "pushed" into it and can be "popped" out, but that seems a little unlikel...

Does this type of memory get allocated on the heap or the stack?

In the context of C++ (not that it matters): class Foo{ private: int x[100]; public: Foo(); } What I've learnt tells me that if you create an instance of Foo like so: Foo bar = new Foo(); Then the array x is allocated on the heap, but if you created an instance of Foo like so: Foo bar; Then it's created o...