Search Results

Search found 266636 results on 10666 pages for 'back stack'.

Page 4/10666 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • remove specific field after clicking back in browser or using history.go(-1)

    - by Y.G.J
    i have a form with a capacha, if the capacha was entered wrong, after submit the page is doing a "history.go(-1)" and all fields include the capacha input are back on the screen right now i have a js that clear that - but now that i need it in several places, i want to know if it possible to clear a form field after back with something related to the html form or what ever thanks

    Read the article

  • GCC - How to realign stack?

    - by psihodelia
    I try to build an application which uses pthreads and __m128 SSE type. According to GCC manual, default stack alignment is 16 bytes. In order to use __m128, the requirement is the 16-byte alignment. My target CPU supports SSE. I use a GCC compiler which doesn't support runtime stack realignment (e.g. -mstackrealign). I cannot use any other GCC compiler version. My test application looks like: #include <xmmintrin.h> #include <pthread.h> void *f(void *x){ __m128 y; ... } int main(void){ pthread_t p; pthread_create(&p, NULL, f, NULL); } The application generates an exception and exits. After a simple debugging (printf "%p", &y), I found that the variable y is not 16-byte aligned. My question is: how can I realign the stack properly (16-byte) without using any GCC flags and attributes (they don't help)? Should I use GCC inline Assembler within this thread function f()?

    Read the article

  • The lua stack overflow,is this a bug?

    - by xiayong
    Some days ago, our program crash. I found the crash in lua code. So I check lua code, found the stack overflow. Please look this code In function luaD_precall: 1 if (!cl->isC) { /* Lua function? prepare its call */ 2 CallInfo *ci; 3 StkId st, base; 4 Proto *p = cl->p; 5 luaD_checkstack(L, p->maxstacksize); 6 func = restorestack(L, funcr); 7 if (!p->is_vararg) { /* no varargs? */ 8 base = func + 1; 9 if (L->top > base + p->numparams) 10 L->top = base + p->numparams; 11 } 12 else { /* vararg function */ 13 int nargs = cast_int(L->top - func) - 1; 14 base = adjust_varargs(L, p, nargs); 15 func = restorestack(L, funcr); /* previous call may change the stack */ 16 } 17 ci = inc_ci(L); /* now `enter' new function */ 18 ci->func = func; 19 L->base = ci->base = base; 20 ci->top = L->base + p->maxstacksize; 21 lua_assert(ci->top <= L->stack_last); 22 L->savedpc = p->code; /* starting point */ 23 ci->tailcalls = 0; 24 ci->nresults = nresults; 25 for (st = L->top; st < ci->top; st++) 26 setnilvalue(st); 27 L->top = ci->top; In my program, the p->maxstacksize is 79 before line 5, the current stacksize is 51, after call luaD_checkstack, the stacksize grow to 130. The lua function use vararg, so will run to line 14. Function adjust_varargs will be called. static StkId adjust_varargs (lua_State *L, Proto *p, int actual) { int i; int nfixargs = p->numparams; Table *htab = NULL; StkId base, fixed; for (; actual < nfixargs; ++actual) setnilvalue(L->top++); #if defined(LUA_COMPAT_VARARG) if (p->is_vararg & VARARG_NEEDSARG) { /* compat. with old-style vararg? */ int nvar = actual - nfixargs; /* number of extra arguments */ lua_assert(p->is_vararg & VARARG_HASARG); luaC_checkGC(L); htab = luaH_new(L, nvar, 1); /* create `arg' table */ In function adjust_varargs(), the lua function use “arg”, So luaC_checkGC will be called. In luaC_checkGC, the current lua stack size will be reduce to 65! The call stack like this: luaC_step() singlestep() propagatemark() traversestack() checkstacksizes() luaD_reallocstack() But the p->maxstacksize is 79, the stacksize is not enough… When the program run to line 27,the L->top is bigger than L->stack_last, in the next operation, will cause crash!

    Read the article

  • back button android

    - by Raogrimm
    i am having trouble implementing the back button properly. all of the code snippets i have seen have not worked for me. what i am trying to do when i press the back button is just go back to the previous list. pretty much i have a list within a list and i just want it to go back to the previous list. how would i go about doing this? this is the list i have, every item has a separate list that it has. lets say you click on weapons, you then get a list of different weapon types and so on final String[] weapons = getResources().getStringArray(R.array.weapons); setListAdapter(new ArrayAdapter<String>(ffxidirectory.this, R.layout.list_item, weapons)); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { System.out.println("item clicked: "+weapons[position]); switch(position) { case 0: final String[] axes = getResources().getStringArray(R.array.axes); setListAdapter(new ArrayAdapter<String>(ffxidirectory.this, R.layout.list_item, axes)); break; case 1: final String[] clubs = getResources().getStringArray(R.array.clubs); setListAdapter(new ArrayAdapter<String>(ffxidirectory.this, R.layout.list_item, clubs)); break; case 2: final String[] daggers = getResources().getStringArray(R.array.daggers); setListAdapter(new ArrayAdapter<String>(ffxidirectory.this, R.layout.list_item, daggers)); break; case 3: final String[] great_axes = getResources().getStringArray(R.array.great_axes); setListAdapter(new ArrayAdapter<String>(ffxidirectory.this, R.layout.list_item, great_axes)); break; case 4: final String[] great_katana = getResources().getStringArray(R.array.great_katana); setListAdapter(new ArrayAdapter<String>(ffxidirectory.this, R.layout.list_item, great_katana)); break; case 5: final String[] great_swords = getResources().getStringArray(R.array.great_swords); setListAdapter(new ArrayAdapter<String>(ffxidirectory.this, R.layout.list_item, great_swords)); break; case 6: final String[] hand_to_hand = getResources().getStringArray(R.array.hand_to_hand); setListAdapter(new ArrayAdapter<String>(ffxidirectory.this, R.layout.list_item, hand_to_hand)); break; case 7: final String[] katana = getResources().getStringArray(R.array.katana); setListAdapter(new ArrayAdapter<String>(ffxidirectory.this, R.layout.list_item, katana)); break; case 8: final String[] polearms = getResources().getStringArray(R.array.polearms); setListAdapter(new ArrayAdapter<String>(ffxidirectory.this, R.layout.list_item, polearms)); break; case 9: final String[] scythes = getResources().getStringArray(R.array.scythes); setListAdapter(new ArrayAdapter<String>(ffxidirectory.this, R.layout.list_item, scythes)); break; case 10: final String[] staves = getResources().getStringArray(R.array.staves); setListAdapter(new ArrayAdapter<String>(ffxidirectory.this, R.layout.list_item, staves)); break; case 11: final String[] swords = getResources().getStringArray(R.array.swords); setListAdapter(new ArrayAdapter<String>(ffxidirectory.this, R.layout.list_item, swords)); break; } } });

    Read the article

  • Stack overflow in xp cmd console

    - by Dave
    I am using an older program whose source code I cannot see. I am using the cmd.exe console in windows xp. The program ran with no problems on an xp machine last year, while a stack overflow code 2000 error was observed on a different xp machine (easy fix - use the machine that works). I tried running the program on the previously working machine lately, and now am getting the same error. No changes to the os were made and I did not change the service pack version. Any ideas on how to get around this stack overflow error so I can use the program? Dosbox will at least open the program, however it does not run to completion. Thanks!

    Read the article

  • ASP.NET MVC stack overflow exception when calling a partial view from master page

    - by quakkels
    Hey there everyone, I'm getting a stack overflow error when I try to call a partial view from the master. The Partial View: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> <form action="/members/TestLoginProcess/" method="post"> U: <input type="text" name="mUsername" /><br /> P: <input type="password" name="mHash" /><br /> <button type="submit">Log In</button> </form> The Action in the "Members" controller [ChildActionOnly] public ActionResult TestLogin() { return PartialView(); } Then I call the partial view from the master page: <!--Excerpt from wopr.master--> <%= Html.Action("TestLogin", "Members")%> When I go into debug mode the master page returns this error: {Cannot evaluate expression because the current thread is in a stack overflow state.} I don't understand how this error is getting triggered. any help would be much appreciated!

    Read the article

  • Using ptrace to generate a stack dump

    - by Gomez
    Hello. I am compiling C++ on *nix and I would like to generate a stack dump a) at an arbitrary point in the program, b) during any signal, particularly during SIGSEGV. Google tells me that ptrace is probably the tool for the job, but I can't find any comprehensible examples of walking the stack. Getting the return address, yeah, but what about the NEXT return address? And what about extracting the symbolic name of the function at that point? Something to do with DWARF? Many thanks if you can tell me where to go from here.

    Read the article

  • Stack overflow in OCaml and F# but not in Haskell

    - by Fernand Pajot
    I've been comparing for fun different languages for speed in execution of the following program: for i from 1 to 1000000 sum the product i*(sqrt i) One of my implementations (not the only one) is constructing a list [1..1000000] and then folding with a specific funtion. The program works fine and fast in Haskell (even when using foldl and not foldl') but stack overflows in OCaml and F#. Here is the Haskell code: test = foldl (\ a b -> a + b * (sqrt b)) 0 create 0 = [] create n = n:(create (n-1)) main = print (test (create 1000000)) And here is the OCaml one: let test = List.fold_left (fun a b -> a +. (float_of_int b) *. (sqrt (float_of_int b))) 0. ;; let rec create = function | 0 -> [] | n -> n::(create (n-1)) ;; print_float (test (create 1000000));; Why does the OCaml/F# implementation stack overflows?

    Read the article

  • Safari Back button not honouring PHP logout session

    - by Steve Kemp
    I've got a logout.php page which ends a user's session and works well and does the following: session_start(); session_unset(); session_destroy(); I've just noticed when testing with Safari that when you logout you can click the back button to return to the previous page which requires authentication but are not prompted. You cannot navigate away from this page without entering the navigation but it should not be displaying the previous page in the first place. So far in my testing this is only an issue with Safari on Mac OS X and there are a number of other reports about this but with no resolution that I could find: http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_23702691.html I would love to be able to disable this behaviour with Safari's back button - surprised that this is happening in the first place. Thanks, Steve

    Read the article

  • Multithreaded program in C: calculating thread stack space

    - by SlappyTheFish
    Situation: I am writing a program in C that maintains a number of threads. Once a thread ends, a new one is created. Each thread forks - the child runs a PHP process via exec() and the parent waits for it to finish. Each PHP process takes the next item from a queue, processes it and exits. Basic code: http://www.4pmp.com/2010/03/multitasking-php-in-parallel/ Problem: The PHP processes are Symfony tasks and Symfony requires a fairly huge amount of memory. How can I safely calculate the required stack space for each thread so that PHP processes will have enough memory? The memory limit set in php.ini is 128Mb so should I allocate this much space in the stack?

    Read the article

  • [Java] Flood fill using a stack

    - by dafero
    Hello to everyone :), I am using the recursive Flood fill algorithm in Java to fill some areas of a image. With very small images it works fine, but when de image becomes larger the JVM gives me a Stack Over Flow Error. That's the reason why I have to reimplement the method using a Flood Fill with my own stack. (I read that's the best way to do it in these kind of cases) Can anyone explain me how to code it? (if you don't have the code at hand, with the pseudo-code of the algorithm will be fine) I've read a lot in the Internet but I haven't understood it very well. Thanks!

    Read the article

  • Stack trace method names redacted

    - by c.cam108
    I have users email me stack traces when my app crashes on their device. Prior to iOS 6 they looked like this: CRASH: NSInvalidArgumentException (*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil) TRACE: ( 0 CoreFoundation 0x355e58a7 __exceptionPreprocess + 186 1 libobjc.A.dylib 0x3798c259 objc_exception_throw + 32 2 CoreFoundation 0x3553a1d7 -[__NSArrayM insertObject:atIndex:] + 186 3 MYAPP 0x0006c0f7 MYAPP + 188663 4 MYAPP 0x000652a3 MYAPP + 160419 5 Foundation 0x3512ac29 __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke_0 + 16 6 Foundation 0x350826d9 -[NSURLConnectionInternalConnection invokeForDelegate:] + 28 7 Foundation 0x350826a3 -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 198 8 Foundation 0x350825c5 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 60 9 CFNetwork 0x34de77f5 _ZN19URLConnectionClient23_clientDidFinishLoadingEPNS_26ClientConnectionEventQueueE + 192 10 CFNetwork 0x34ddc4a5 _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl + 424 11 CFNetwork 0x34ddc1a3 _ZN19URLConnectionClient13processEventsEv + 106 12 CFNetwork 0x34ddc0d9 _ZN17MultiplexerSource7performEv + 156 13 CoreFoundation 0x355b9ad3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14 14 CoreFoundation 0x355b929f __CFRunLoopDoSources0 + 214 15 CoreFoundation 0x355b8045 __CFRunLoopRun + 652 16 CoreFoundation 0x3553b4a5 CFRunLoopRunSpecific + 300 17 CoreFoundation 0x3553b36d CFRunLoopRunInMode + 104 18 GraphicsServices 0x371d7439 GSEventRunModal + 136 19 UIKit 0x33047cd5 UIApplicationMain + 1080 20 MYAPP 0x0003fbcf MYAPP + 7119 21 MYAPP 0x0003fb84 MYAPP + 7044 ) From the CoreFoundation etc method names and asking the user what happened, I can get a pretty good idea of where the crash happened. However, since iOS 6 was released, my crash reports all look like this: CRASH: NSRangeException (*** -[__NSArrayI objectAtIndex:]: index 2147483670 beyond bounds [0 .. 11]) TRACE: ( 0 CoreFoundation 0x3a3872bb <redacted> + 186 1 libobjc.A.dylib 0x32ca697f objc_exception_throw + 30 2 CoreFoundation 0x3a2d1e8d <redacted> + 164 3 MYAPP 0x000ff721 MYAPP + 214817 4 MYAPP 0x000e8999 MYAPP + 121241 5 UIKit 0x372f60ad <redacted> + 72 6 UIKit 0x372f605f <redacted> + 30 7 UIKit 0x372f603d <redacted> + 44 8 UIKit 0x372f58f3 <redacted> + 502 9 UIKit 0x372e1287 <redacted> + 526 10 UIKit 0x37373f3d <redacted> + 748 11 UIKit 0x3721e52b <redacted> + 318 12 UIKit 0x3720b809 <redacted> + 380 13 UIKit 0x3720b123 <redacted> + 6154 14 GraphicsServices 0x362085a3 <redacted> + 590 15 GraphicsServices 0x362081d3 <redacted> + 34 16 CoreFoundation 0x3a35c173 <redacted> + 34 17 CoreFoundation 0x3a35c117 <redacted> + 138 18 CoreFoundation 0x3a35af99 <redacted> + 1384 19 CoreFoundation 0x3a2cdebd CFRunLoopRunSpecific + 356 20 CoreFoundation 0x3a2cdd49 CFRunLoopRunInMode + 104 21 GraphicsServices 0x362072eb GSEventRunModal + 74 22 UIKit 0x3725f301 UIApplicationMain + 1120 23 MYAPP 0x000ccbd3 MYAPP + 7123 24 MYAPP 0x000ccb88 MYAPP + 7048 ) I get the stack trace from here, which the user is prompted to email when the app is re-opened: void uncaughtExceptionHandler(NSException *exception) { //make a file name to write the data to using the documents directory: NSString *fileName = [NSString stringWithFormat:@"%@/crashlog.txt", documentsDirectory]; //create content - four lines of text NSString *content = [NSString stringWithFormat:@"CRASH: %@ (%@)\n\nTRACE: %@", [exception name], [exception reason], [exception callStackSymbols]]; //save content to the documents directory [content writeToFile:fileName atomically:NO encoding:NSStringEncodingConversionAllowLossy error:nil]; } Without the method names, this is worse than useless. Is there any way of getting these method names back into my stack traces? This is a release configuration, not debug.

    Read the article

  • Detecting that the stack is full in C/C++

    - by Martin Kristiansen
    When writing C++ code I've learned that using the stack to store memory is a good idea. But recently I ran into a problem: I had an experiment that had code that looked like this: void fun(unsigned int N) { float data_1[N*N]; float data_2[N*N]; /* Do magic */ } The code exploted with a seqmentation fault at random, and I had no idea why. It turned out that problem was that I was trying to store things that were to big on my stack, is there a way of detecting this? Or at least detecting that it has gone wrong?

    Read the article

  • How can web form content be preserved for the back button

    - by Peter Howe
    When a web form is submitted and takes the user to another page, it is quite often the case that the user will click the Back button in order to submit the form again (the form is an advanced search in my case.) How can I reliably preserve the form options selected by the user when they click Back (so they don't have to start from scratch with filling the form in again if they are only changing one of many form elements?) Do I have to go down the route of storing the form options in session data (cookies or server-side) or is there a way to get the browser to handle this for me? (Environment is PHP/JavaScript - and the site must work on IE6+ and Firefox2+)

    Read the article

  • Using stack defined in C++ stl

    - by cambr
    #include <stack> using namespace std; int main() { stack<int> s; int i; for (i = 0; i <= 10; i++) { s.push(i); } for (i = 0; i <= 10; i++) { printf("%d", s.pop()); } } Whats wrong with the code above? Error: In function `int main()': aggregate value used where an integer was expected

    Read the article

  • Stack trace for C++ using gcc

    - by dimba
    We use stack traces in proprietary assert like macro to catch developer mistakes - when error is caught, stack trace is printed. I find gcc's pair backtrace()/backtrace_symbols() methods insufficient: Names are mangled No line information 1st problem can be resolved by abi::__cxa_demangle. However 2nd problem s more tough. I found replacement for backtrace_symbols(). This is better than gcc's backtrace_symbols(), since it can retrieve line numbers (if compiled with -g) and you don't need to compile with -rdynamic. Hoverer the code is GNU licenced, so IMHO I can't use it in commercial code. Any proposals?

    Read the article

  • I'm interested in checking out a stack-oriented programming language. Which one would you recommend?

    - by Anto
    I'm interested in learning a stack-oriented programming language (such as Forth), which one would you recommend? The qualities I want are: You should be able to develop non-trivial software in it, but it mustn't be a great language for that as: I want to learn the language so I can try out a new paradigm (that is, not because I (think) that I will have great use of it). The reason I want to learn another paradigm is that I want to broaden my views on different approaches (learn to think in new ways, different from OOP, functional and structured). The language should let me do that (learn to think differently). The language should have available and good resources to learn from. The resources should also approach stack-oriented programming in a way that you understand the paradigm (after all, I do this for the paradigm).

    Read the article

  • VERY strange stack overflow in C++ program

    - by mav
    Hello, I wrote a program some time ago (Mac OS X, C++, SDL, FMOD) and it perfomed rather good. But lately I wanted to extend its functionality and added some more code to it. And now, when I run it and try to test the new functionality, the program crashes with SIGABRT. Looking into debugger, on function stack I see: _kill kill$UNIX2003 raise __abort __stack_chk_fail odtworz <-- my function that was was modified As far as I know, "__stack_chk_fail" indicates a stack overflow. But that's not the weirdest thing about it. In this function "odtworz", I have some code like this: ... koniec = 0; while ( koniec == 0 ) { ... if (mode == 1) { ... } else if (mode == 2) { ... } else if (mode == 3) { ... } } mode is a global variable and is set to value "2" in a function before. And now imagine - if I delete the third if statement (mode == 3) which never gets executed in this mode, the program doesn't crash! Deleting code that doesn't even get to be executed helps the situation! Now, I don't want to delete this code because it's for other mode of my program. And it works fine there. So any hints where I can search? What could be possibly wrong with this?

    Read the article

  • Dynamic stack allocation in C++

    - by Poni
    I want to allocate memory on the stack. Heard of _alloca / alloca and I understand that these are compiler-specific stuff, which I don't like. So, I came-up with my own solution (which might have it's own flaws) and I want you to review/improve it so for once and for all we'll have this code working: /*#define allocate_on_stack(pointer, size) \ __asm \ { \ mov [pointer], esp; \ sub esp, [size]; \ }*/ /*#define deallocate_from_stack(size) \ __asm \ { \ add esp, [size]; \ }*/ void test() { int buff_size = 4 * 2; char *buff = 0; __asm { // allocate mov [buff], esp; sub esp, [buff_size]; } // playing with the stack-allocated memory for(int i = 0; i < buff_size; i++) buff[i] = 0x11; __asm { // deallocate add esp, [buff_size]; } } void main() { __asm int 3h; test(); } Compiled with VC9. What flaws do you see in it? Me for example, not sure that subtracting from ESP is the solution for "any kind of CPU". Also, I'd like to make the commented-out macros work but for some reason I can't.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >