11,090 questions
Advice
0
votes
5
replies
103
views
Undo last pop() in a Python stack implementation
I'm implementing a simple stack in Python and I want to add the ability to undo the last pop() operation.
The behavior I want is something like this:
s.push(10)
s.push(20)
s.push(30)
s.pop() # ...
3
votes
1
answer
138
views
Eclipse collection that is concurrent, has unique elements and atomic retrieval and removal [closed]
I wonder if there is a suitable data structure that has the following three characteristics:
The collection can be modified by multiple threads
Has unique elements in the collection
The collection ...
Advice
1
vote
11
replies
6k
views
How much stack space is allocated for char buffer[500] variable?
I'm disassembling a very simple program written in C and would like to determine how much stack storage is allocated for the char buffer[500] variable. Here is the C program:
int main(int argc, char** ...
1
vote
0
answers
60
views
Detecting history popstate event without triggering for anchor links
I'm working on an application which uses dynamicly loaded page elements, which use pushState to change the URL hash and add an entry to the browser's history. It will be too much work to refactor this ...
Advice
0
votes
1
replies
113
views
Stack performance in Flutter?
In my android application, there is a 4X4 board for 2 player and 4 play buttons together. One board square is made of one stack each. And there is 5-7 layers to several widgets on one stack depending ...
2
votes
0
answers
122
views
Stack for Haskell unable to remove files?
I am a beginner Haskell programmer on Windows 11. I am writing a Snakes & Ladders program, and am attempting to set up a Stack environment to work in.
I have been following this guide, as well as ...
1
vote
1
answer
81
views
Error "error: ERR 211 Not enough local stack" while building on GeneXus 17
When building a KB in GeneXus 17, it outputs the following error:
error: ERR 211 Not enough local stack
Followed by:
warning: [BuildDaemon] Auto restarting Specifier daemon. True - AutoRestartCount:
...
Best practices
0
votes
0
replies
45
views
Nested Navigation Not Working in AutoRoute
I’m trying to navigate between nested pages using AutoRoute, but I’m unable to route to child pages or go back using AutoRouter.of(context).back().
I have an Authentication module with multiple nested ...
2
votes
2
answers
166
views
Location of the first value pushed onto stack in assembly (x86 I386 assembly) (gdb) (AT&T)
Consider the assembly program below:
.section .data
.section .text
.global _start
_start:
pushl $85 #make it obvious in memory
popl %ebx
movl $1, %eax
int $0x80
It ...
0
votes
0
answers
80
views
Locate return address into EXE from DllMain
I'm writing a 64-bit Windows DLL that needs to locate, on the stack, the return address that belongs to the host EXE (the place in the EXE that called into my DLL). The EXE loads my DLL and eventually ...
2
votes
1
answer
392
views
Why do relative stack addresses change each time this Windows program is run?
See (far below) how the relative stack location of the local variable x changes between runs of this program. Why does that happen? I know about ASLR and can see (looking at pLow and pHigh) that the ...
-1
votes
1
answer
83
views
Converting 2d tiff into 3d tif files - stack error
I'm working in WSL Ubuntu, writing this script in SPAM Jupyter Lab. I want to convert my 2d TIFF files into a 3d TIFF file. After stating the directory where the 2d TIFF files are, this is my code:
...
-2
votes
1
answer
126
views
Array passed as an argument does not seem to be changing [closed]
I was tasked to write up a C program to sort an array using quicksort, without using recursion.
Original array:
-25, 87, 12, -6, 91, 3, -48, 70, 19, -33, 55, 2, -18, 99, 41, -72, 63, 15, -90, 27, 8, -...
0
votes
1
answer
131
views
Balanced parens -- O(n^2), but passing on hacker rank and leetcode
I am trying to implement the classic balanced parens with stacks
So I decided to test the stupid, O(n^2) algorithm
def balanceada(string):
while True:
before = len(string)
string = ...
4
votes
2
answers
230
views
Trying to exploit the stack content with a format string, but I can't understand where it takes the output from
I am studying for my Computer Security exam and I am on the Format String Bugs section. In the notes there is this code, and I was testing it on my VM:
#include <stdio.h>
void test(char *arg) {
...