stackoverflow

Stack Overflow Error With This Recursive Program? - C++

Hello, I'm a programming student in my first C++ class, and recently we were given an assignment to implement a recursive program that finds the first occurrence of a given substring in a given string. For example: int StringIndex("Mississippi", "sip"); // this would return 6 The hint we are given is to use a recursive helper functi...

What to do with error information after stack smashing

I'm experiencing some problems with my C program on Linux. It compiles and runs just fine on Windows. The Linux terminal returns this information: *** stack smashing detected ***: ./student terminated ======= Backtrace: ========= /lib/libc.so.6(__fortify_fail+0x4b)[0xb7e908ab] /lib/lib...

Operator Overloading working but giving stack overflow and crashing in C++

I wrote this Node class and = operator overload function and this is the only way I could get it to compile and run but it just overflows and bomb my program. Can someone please fix it so it works. I don't have a lot of experience with overloading operator in C++. I just want to set a Node object equal to another Node object. Thanks in a...

How do I fix Stack Overflow after upgrading rails 2.0.2 to 2.3.5 (or even 2.1.0) => problem appears in ActiveRecord::SessionStore

Ok, so we're upgrading a client's legacy code from 2.0.2 to latest rails. Most of the basics were easy to fix, but I can't get to the admin screens. Every time we hit "current_user" we get a "stack level too deep" error. I've dug deeply into the code (read: flailed around a lot at random) and I've finally narrowed it down to the ActiveR...

C# Editor and Compiler Preference

For those of you that are quick to answer some questions, with code snippets. I must say that I have been beaten to the punch a few times because loading up Visual Studio, File -> New Project... does take some time. Does anyone out there - particularly for those that are contributing answers here - have a good quick editor on Windows th...

JSONP request to stackoverflow with mootools not working

I'm trying to build a custom stackoverflow badge using JSONP and mootools. Here is the code: new Request.JSONP('http://stackoverflow.com/users/flair/166325.json', { onComplete: function(data) { console.log(data); } }).request(); However, I always get back this message: RequestJSONPrequest_maprequest_0 is not defined I'm won...

Special PHP Errors

How can PHP cause memory leaks, buffer overflows, stack overflows and any other errors of such kind? Can PHP even cause such errors? ...

Why does does my stack overflow error occur after 518669 specifically?

I created a java program to count up toward infinity: class up { public static void up (int n) { System.out.println (n) ; up (n+1) ; } public static void main (String[] arg) { up (1) ; } } i didn't actually expect it to get there but the thing that i noticed that was a bit curious was that it st...

Recursion Question--Java

Ok so I have a recursion problem thats causing a stack overflow error at large sizes I increased the heap size to like it works fine at smaller sizes. The problem is to find the largest contiguous group of cells with 1 or more adults in a 2d- array. public class Field { Cell[][] cells; public Field(Cell[][] cells){ th...

jQuery Plugin Overwriting Parameters

Hey Everyone, This maybe a very mundane question, but this is the first jQuery plugin that I write and I'm a bit fuzzy on understanding the scope rules in Javascript. I'm trying to write an simple jQuery plugin that wraps around the Stack Overflow API. I'm starting off by trying to work with the Flair API. I wanted to make the plugin...

Q&A database map like stackoverflow - seperate table for questions titles

I am planning to make Q&A system (quite specific, has nothing to do with IT) I was looking for Stackoverflow database map: http://meta.stackoverflow.com/questions/2677/anatomy-of-a-data-dump/2678#2678 And I am thinking is not it is better practice to make separate table for questions titles. With "firstPostId". Instead of |- PostTy...

Trying to calculate the 10001st prime number in Java.

Greetings. I am doing Problem 7 from Project Euler. What I am supposed to do is calculate the 10001st prime number. (A prime number being a number that is only divisible by itself and one.) Here is my current program: public class Problem7 { public static void main(String args []){ long numberOfPrimes = 0; long number = 2; ...

Authenticating stackoveflow programatically - OpenID

I would like to add up and down voting to my iPhone appilcation - MyStacks, for this I need the to be able to authenticate the user with SO. I'm look at adapting the Twitter-OAuth-iPhone library. However The problem I have is obtaining the consumer and secret key. to use OAuth, do I need to obtain a different key for each provider? In...

Recursive main() - why does it segfault?

Why does the following program segfault? int main() { main(); } Even though it is a recursion that does not end and is therefore invalid by definition, I don't see why it segfaults (gcc 4.4.3 and clang 1.5 (trunk)). ...

Stack Overflow problem in a recursive program in C

Hi all, I am getting a stack overflow in one of the recursive functions i am running.. Here is the code.. void* buddyMalloc(int req_size) { // Do something here return buddy_findout(original_index,req_size); // This is the recursive call } void *buddy_findout(int current_index,int req_size) { char *selected = NULL; ...

How to embed multiple tags in Rails routes, like Stackoverflow.

When one selects a Tag on stackoverflow, it is added to the end of the Url. Add a second Tag and it is add to the end of the Url after the first Tag, with a '+' delimiter. For example, http://stackoverflow.com/questions/tagged/ruby-on-rails+best-practices. How is this implemented? Is this a routing enhancement or some logic contained...

Creating a 'remove member' function in prolog

I am new to prolog and I'm trying to to create function that will simply remove all instances of an element from a list. The following code is what I have so far: remove([H|T], E, L2) :- (\+ ([H|T] == []) -> (H == E -> remove(T, E, L2) ; append(L2, H, L2), remove(T, E, L2) ) ; append(L2, []) ). When I run ...

How to change stack size for a .NET program?

I have a program that does recursive calls for 2 billion times and the stack overflow. I make changes, and then it still need 40K resursive calls. So I need probably serveral MB stack memory. I heard the stack size is default to 1MB. I tried search online. Some one said to go properties ->linker .........in visual studio, but I cannot fi...

StackOverflow in VB.NET SQLite query

I have an StackOverflowException in one of my DB functions that I don't know how to deal with. I have a SQLite database with one table "tblEmployees" that holds records for each employees (several thousand posts) and usually this function runs without any problem. But sometimes after the the function is called a thousand times it breaks...

stack overflow problem in program

So I am currently getting a strange stack overflow exception when i try to run this program, which reads numbers from a list in a data/text file and inserts it into a binary search tree. The weird thing is that when the program works when I have a list of 4095 numbers in random order. However when i have a list of 4095 numbers in incr...