stack

Is there a way to push a MATLAB workspace onto a stack?

Does anyone know if it's possible to have a stack of workspaces in MATLAB? It would be very convenient, to say the least. I need this for research. We have several scripts which interact in interesting ways. Functions have local variables, but not scripts... ...

C/C++ maximum stack size of program

I want to do DFS on a 100 X 100 array. (Say elements of array represents graph nodes) So assuming worst case, depth of recursive function calls can go upto 10000 with each call taking upto say 20 bytes. So is it feasible means is there a possibility of stackoverflow? What is the maximum size of stack in C/C++? Please specify for gc...

Allocation order on the stack

I'm running this C code #define STACKSIZE 65536 char d[STACKSIZE]; if (((int) &d[STACKSIZE-1]) - ((int) &d[0]) + 1 != STACKSIZE) { Printf ("Stack space reservation failed\n"); Exit (); } printf("Allocated from %d to %d so for %d bytes\n", &d, ...

When does the stack really overflow?

Is infinite recursion the only case or can it happen for other reasons? Doesn't the stack size grow as needed same as heap? Sorry if this question has been asked before, would appreciate links to them if that is the case. ...

Android stack size

How can i get and change the stack size (even for the main thread) of my Android application. ...

Does the stack get unwound when a SIGABRT occurs?

Hi, Does the stack get unwound (destructors run) when a SIGABRT occurs in C++? Thanks. ...

iphone: send back string value with navigationcontroller pop

Hi.. This may be very basic, but I just can`t figure out what to do, so thanks for any response... I`m using a navigationcontroller and are currently on the second level in the stack. Here i set a string value and use popViewControllerAnimated to go back to first level in the stack. What might be the best solution to use that string...

Can someone help spot the errors in my low lock list?

Hi all, I've written a low lock list in C++ on windows 32-bit. I'm getting BIG improvements over using critical sections but I'd like someone to sanity check that what I'm doing is correct and there aren't any errors in what I've done: #ifndef __LOW_LOCK_STACK_H_ #define __LOW_LOCK_STACK_H_ template< class T > class LowLockStack { pr...

stack overflow in swing at processKeyEvent

Hi, I'm battling an error I don't quite understand. I have a class in Java, let's call it DownloadTable derived from a JDTable. Each of these classes implement KeyListener. I'd like the base class JDTable to handle some keystrokes, so I put this.AddListener(this) in its constructor and create a key handler public void keyPressed(K...

Stacking DIVs in top of each other?

Hi, Is it possible to stack up multiple DIVs like: <div> <div></div> <div></div> <div></div> <div></div> </div> So that all those inner DIVs have the same X and Y position? By default they all go below each other increasing the Y position by the height of the last previous DIV. I have a feeling some sort of float or display or other...

Make a tkinter window appear over all other windows

#!/usr/bin/env python # Display window with toDisplayText and timeOut of the window. from Tkinter import * def showNotification(notificationTimeout, textToDisplay): ## Create main window root = Tk() Button(root, text=textToDisplay, activebackground="white", bg="white", command=lambda: root.destroy()).pack(side=LEFT) r...

Creating a stack of strings in C

I want to have a stack that takes strings. I want to be able to push and pop strings off, as well as clear the whole stack. I think C++ has some methods for this. What about C? ...

Pseudo-random stack pointer under Linux?

I was playing around with some code when I noticed something strange: [~] main% cat test.cc #include <stdio.h> void f() { int i; fprintf(stderr, "&i = 0x%08X\n", (long)&i); } int main(int argc, char**argv) { f(); } [~] main% g++ test.cc [~] main% ./a.out &i = 0xBFA27AB4 [~] main% ./a.out &i = 0xBFAD7E24 [~] main% ./a.out &...

Memory leak in trivial stack implementation.

I'm decently experienced with Python and Java, but I recently decided to learn C++. I decided to make a quick integer stack implementation, but it has a massive memory leak that I can't understand. When I pop the node, it doesn't seem to be releasing the memory even though I explicitly delete the old node upon poping it. When I run it, i...

The stack is an implementation detail, or not?

According to http://msdn.microsoft.com/en-us/library/ms229017.aspx, value types "are allocated on the stack or inline with other structures*". Yet in the stack is an implementation detail, Eric Lippert states that that's an implementation detail. To my understanding, an implementation detail is "a behavior produced by code which may be...

kernel stack vs user-mode application stack

Is the kernel stack a different structure to the user-mode stack that is used by applications we (programmers) write? Can you explain the differences? ...

Returning a value type from a property

Hey, I'm getting confused with what happens on the stack and heap in respect to value type properties in classes. My understanding so far: When you create a class with a structure (value type) like this: class Foo { private Bar _BarStruct; public Bar BarStruct { get {return _BarStruct; } set {_BarStruct = value; } } ...

Widcomm bluetooth : how to open the virtual COM

Hi! i'm trying to use the Widcomm bluetooth stack by Broadcomm and it should work but there's one thing that still i cannot understand: HOW CAN I AUTOMATICALLY OPEN THE VIRTUAL COM WHEN I NEED TO COMMUNICATE? i am trying to use SPP (Serial Port Profile) but the documentation with the SDK is not so exaustive. PLEASE, I JUST CANNOT USE 3...

Reducing stack load, memory allocation in C and easly casting malloc()'s return value

It's known that big local/global variables may cause to a stack overflow. I know that using pointers and allocating space in memory helps to overcome this problem. But is it the only option? What happens if I have (or need) too-many pointers in global scope? Regarding the stack space: Is a global struct-type variable takes space in the ...

Crash in C program while retrieving an item from a stack.

The following code crashes on the second Pop() call. I'm a novice with C and I've been staring at this code now for over an hour and i can't see the error. Any ideas to help me out on why this code is crashing? #include <stdio.h> #define StackDataSize 100 typedef struct Stack { int index; void *data[StackDataSize]; } Stack; v...