Search Results

Search found 252796 results on 10112 pages for 'stack o frankie'.

Page 19/10112 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • How do I implement a fibonacci sequence in java using try/catch logic?

    - by Lars Flyger
    I know how to do it using simple recursion, but in order to complete this particular assignment I need to be able to accumulate on the stack and throw an exception that holds the answer in it. So far I have: public static int fibo(int index) { int sum = 0; try { fibo_aux(index, 1, 1); } catch (IntegerException me) { sum = me.getIntValue(); } return sum; } fibo_aux is supposed to throw an IntegerException (which holds the value of the answer that is retireved via getIntValue) and accumulates the answer on the stack, but so far I can't figure it out. Can anyone help?

    Read the article

  • How to delete the widget from the stack in Qt

    - by Solitaire
    Hi, i am using Qstackedwidget to switch between the views, i will be able to traverse between the views, i am facing problem in some scenario, where i do not require the widgets, i want to remove them completely.. stackedwidget provides the functionality to removewidgets, still the ownership of the widget will be there, i mean widget will be hidden. i dont want this to be happen, when i call remove widget the widget should be deleted. how to handle this?

    Read the article

  • Closing Question Rights in Stack over flow

    - by Asim Sajjad
    I have posted my Question and some one has closed that question, but i didn't get my answer from any of the viewer who have view my question or post theire answer, how can anyone close question when I don't get answer or statisfied with the answer posted against my question??? Why people close the question without permission of the question owner ???

    Read the article

  • Stack Overflow like Watermarks in Forms

    - by Kaushik Gopal
    Hey people, I remember seeing a tutorial somewhere that talks of how to style your input forms in a more "usable" way. Essentially, you have a placeholder value and when you enter the input, it hides the hint so to speak. Now, just to be clear: I don't want the hint (placeholder value text) to disappear onFocus, but rather to go lighter when I first start typing something. Good e.gs: Check out the forms on Aardvark http://vark.com/. This is exactly how I wish to have my input forms. Our very own stackoverflow. When you try to ask a question, on clicking inside any input form, it doesn't hide the text right away. You see your cursor as well as the hint. but when you start to type, it hides the hint(I would prefer having it go to a much lighter shade rather than hiding all together, like above example). I remember very clearly reading a tutorial somewhere on the interwebz with this exact requirement, but darn forgot to bookmark it. Any suggestions/links?

    Read the article

  • Stack usage with MMX intrinsics and Microsoft C++

    - by arik-funke
    I have an inline assembler loop that cumulatively adds elements from an int32 data array with MMX instructions. In particular, it uses the fact that the MMX registers can accommodate 16 int32s to calculate 16 different cumulative sums in parallel. I would now like to convert this piece of code to MMX intrinsics but I am afraid that I will suffer a performance penalty because one cannot explicitly intruct the compiler to use the 8 MMX registers to accomulate 16 independent sums. Can anybody comment on this and maybe propose a solution on how to convert the piece of code below to use intrinsics? == inline assembler (only part within the loop) == paddd mm0, [esi+edx+8*0] ; add first & second pair of int32 elements paddd mm1, [esi+edx+8*1] ; add third & fourth pair of int32 elements ... paddd mm2, [esi+edx+8*2] paddd mm3, [esi+edx+8*3] paddd mm4, [esi+edx+8*4] paddd mm5, [esi+edx+8*5] paddd mm6, [esi+edx+8*6] paddd mm7, [esi+edx+8*7] ; add 15th & 16th pair of int32 elements esi points to the beginning of the data array edx provides the offset in the data array for the current loop iteration the data array is arranged such that the elements for the 16 independent sums are interleaved.

    Read the article

  • Do you have suggestions for these assembly mnemonics?

    - by Noctis Skytower
    Greetings! Last semester in college, my teacher in the Computer Languages class taught us the esoteric language named Whitespace. In the interest of learning the language better with a very busy schedule (midterms), I wrote an interpreter and assembler in Python. An assembly language was designed to facilitate writing programs easily, and a sample program was written with the given assembly mnemonics. Now that it is summer, a new project has begun with the objective being to rewrite the interpreter and assembler for Whitespace 0.3, with further developments coming afterwards. Since there is so much extra time than before to work on its design, you are presented here with an outline that provides a revised set of mnemonics for the assembly language. This post is marked as a wiki for their discussion. Have you ever had any experience with assembly languages in the past? Were there some instructions that you thought should have been renamed to something different? Did you find yourself thinking outside the box and with a different paradigm than in which the mnemonics were named? If you can answer yes to any of those questions, you are most welcome here. Subjective answers are appreciated! Stack Manipulation (IMP: [Space]) Stack manipulation is one of the more common operations, hence the shortness of the IMP [Space]. There are four stack instructions. hold N Push the number onto the stack copy Duplicate the top item on the stack copy N Copy the nth item on the stack (given by the argument) onto the top of the stack swap Swap the top two items on the stack drop Discard the top item on the stack drop N Slide n items off the stack, keeping the top item Arithmetic (IMP: [Tab][Space]) Arithmetic commands operate on the top two items on the stack, and replace them with the result of the operation. The first item pushed is considered to be left of the operator. add Addition sub Subtraction mul Multiplication div Integer Division mod Modulo Heap Access (IMP: [Tab][Tab]) Heap access commands look at the stack to find the address of items to be stored or retrieved. To store an item, push the address then the value and run the store command. To retrieve an item, push the address and run the retrieve command, which will place the value stored in the location at the top of the stack. save Store load Retrieve Flow Control (IMP: [LF]) Flow control operations are also common. Subroutines are marked by labels, as well as the targets of conditional and unconditional jumps, by which loops can be implemented. Programs must be ended by means of [LF][LF][LF] so that the interpreter can exit cleanly. L: Mark a location in the program call L Call a subroutine goto L Jump unconditionally to a label if=0 L Jump to a label if the top of the stack is zero if<0 L Jump to a label if the top of the stack is negative return End a subroutine and transfer control back to the caller halt End the program I/O (IMP: [Tab][LF]) Finally, we need to be able to interact with the user. There are IO instructions for reading and writing numbers and individual characters. With these, string manipulation routines can be written. The read instructions take the heap address in which to store the result from the top of the stack. print chr Output the character at the top of the stack print int Output the number at the top of the stack input chr Read a character and place it in the location given by the top of the stack input int Read a number and place it in the location given by the top of the stack Question: How would you redesign, rewrite, or rename the previous mnemonics and for what reasons?

    Read the article

  • not output exception stack trace in EUnit

    - by hpyhacking
    I'm write a test with EUnit, but not anything exception detail output in console. exp_test() -> ?assertEqual(0, 1/0). Run this module:exp_test() in the Erlang Shell output following ** exception error: bad argument in an arithmetic expression in function exp_test:'-exp_test/0-fun-0-'/1 (src/test/eunit/xxx_test.erl, line 8) But in EUnit output following > eunit:test(xxx). > xxx_test: exp_test...*failed* ::badarith EUnit not output anything exception trace info Im trying the verbose config in eunit, but no effect. I want to output some exception detail in eunit test result. Thanks~

    Read the article

  • getting java.lang.OutOfMemoryError exception while running a Midlet (using netbeans)

    - by Jeeka
    I am writing a Midlet(using Netbeans) which reads a file containing exactly 2400 lines (each line being 32 characters long) and (extract a part of each line) puts them in an array. I am doing the same for 11 such files( all files have exactly 2400 lines).The Midlet runs fine for reading 6 files and putting them in 6 arrays. However, the Midlet stops while doing it for the 7th file throwing the following exception: TRACE: , startApp threw an Exception java.lang.OutOfMemoryError (stack trace incomplete) java.lang.OutOfMemoryError (stack trace incomplete) I have tried the modifying the netbeans.conf file to increase the heap memory ( as suggested by many forums and blogs) but nothing works for me. Here are the parameters that i had modified in the netbeans.conf file: -J-Xss2m -J-Xms1024m -J-Xmx1024m -J-XX:PermSize=1024m -J-XX:MaxPermSize=1536m -J-XX:+UseConcMarkSweepGC -J-XX:+CMSClassUnloadingEnabled -J-XX:+CMSPermGenSweepingEnabled Can anyone please help me to get me out of this ! I badly need this to be sorted out ASAP ! Thanks in advance !

    Read the article

  • Stack recommendations for small/medium-sized web application in Python

    - by reto
    I'm looking for some recommendations for a python web application. We have some memory restrictions and we try to keep it small and lean. We thought about using WSGI (and a python webserver) and build the rest ourself. We already have a template engine we'd like to use, but we are open for some suggestions regarding the whole request handling (the controller). The application has to run in a single process and the requests have to be processed with multiple threads. We've looked at django, but we are a not sure if it fits into our memory budget. Your feedback is very welcome! Cheers, Reto

    Read the article

  • Intro Bar like stack overflow

    - by Dasa
    I have a simple top bar using jquery like the one on stackoverflow, but i want it to only appear on the first time a person visits the website. below is the HTML followed by the "bxSlider.js" file <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript" src="bxSlider.js"></script> <title>topbar</title> <style type="text/css" media="screen"> #message { font-family:Arial,Helvetica,sans-serif; position:fixed; top:0px; left:0px; width:100%; z-index:105; text-align:center; color:white; padding:2px 0px 2px 0px; background-color:#8E1609; } #example1 { text-align: center; width: 80%; } .close-notify { white-space: nowrap; float:right; margin-right:10px; color:#fff; text-decoration:none; padding-left:3px; padding-right:3px } .close-notify a { color: #fff; } h4, p { margin:0px; padding:0px; } </style> </head> <body> <DIV ID='message' style="display: none;"> <DIV ID="example1"> <DIV CLASS="item"> <h4>Head 1</h4> <p>Text 1</p> </div><!-- end item --> <DIV CLASS="item"> <h4>Head 2</h4> <p>Text 2</p> </div><!-- end item --> </div><!-- end example1 --> <a href="#" CLASS="close-notify" onclick="closeNotice()">X</a> </div> <script type="text/javascript"> $(document).ready(function() { $("#message").fadeIn("slow"); $('#example1').bxSlider({ mode: 'slide', speed: 250, wrapper_CLASS: 'example1_container' }); }); function closeNotice() { $("#message").fadeOut("slow"); } </script> </body> </html> /** * * * bxSlider: Content slider / fade / ticker using the jQuery javascript library. * * Author: Steven Wanderski * Email: [email protected] * URL: http://bxslider.com * * **/ jQuery.fn.bxSlider = function(options){ ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // Declare variables and functions ///////////////////////////////////////////////////////////////////////////////////////////////////////////// var defaults = { mode: 'slide', speed: 500, auto: false, auto_direction: 'left', pause: 2500, controls: true, prev_text: 'prev', next_text: 'next', width: $(this).children().width(), prev_img: '', next_img: '', ticker_direction: 'left', wrapper_class: 'container' }; options = $.extend(defaults, options); if(options.mode == 'ticker'){ options.auto = true; } var $this = $(this); var $parent_width = options.width; var current = 0; var is_working = false; var child_count = $this.children().size(); var i = 0; var j = 0; var k = 0; function animate_next(){ is_working = true; $this.animate({'left':'-' + $parent_width * 2 + 'px'}, options.speed, function(){ $this.css({'left':'-' + $parent_width + 'px'}).children(':first').appendTo($this); is_working = false; }); } function animate_prev(){ is_working = true; $this.animate({'left': 0}, options.speed, function(){ $this.css({'left':'-' + $parent_width + 'px'}).children(':last').insertBefore($this.children(':first')); is_working = false; }); } function fade(direction){ if(direction == 'next'){ var last_before_switch = child_count - 1; var start_over = 0; var incr = k + 1; }else if(direction == 'prev'){ var last_before_switch = 0; var start_over = child_count -1; var incr = k - 1; } is_working = true; if(k == last_before_switch){ $this.children().eq(k).fadeTo(options.speed, 0); $this.children().eq(start_over).fadeTo(options.speed, 1, function(){ is_working = false; k = start_over; }); }else{ $this.children().eq(k).fadeTo(options.speed, 0); $this.children().eq(incr).fadeTo(options.speed, 1, function(){ is_working = false; k = incr; }); } } function add_controls(){ ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // Check if user selected images to use for next / prev ///////////////////////////////////////////////////////////////////////////////////////////////////////////// if(options.prev_img != '' || options.next_img != ''){ $this.parent().append('<a class="slider_prev" href=""><img src="' + options.prev_img + '" alt=""/></a><a class="slider_next" href=""><img src="' + options.next_img + '" alt="" /></a>'); }else{ $this.parent().append('<a class="slider_prev" href="">' + options.prev_text + '</a><a class="slider_next" href="">' + options.next_text + '</a>'); } $this.parent().find('.slider_prev').css({'float':'left', 'outline':'0', 'color':'yellow'}); $this.parent().find('.slider_next').css({'float':'right', 'outline':'0', 'color':'yellow'}); ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // Accomodate padding-top for controls when elements are absolutely positioned (only in fade mode) ///////////////////////////////////////////////////////////////////////////////////////////////////////////// if(options.mode == 'fade'){ $this.parent().find('.slider_prev').css({'paddingTop' : $this.children().height()}) $this.parent().find('.slider_next').css({'paddingTop' : $this.children().height()}) } ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // Actions when user clicks next / prev buttons ///////////////////////////////////////////////////////////////////////////////////////////////////////////// $this.parent().find('.slider_next').click(function(){ if(!is_working){ if(options.mode == 'slide'){ animate_next(); if(options.auto){ clearInterval($.t); $.t = setInterval(function(){animate_next();}, options.pause); } }else if(options.mode == 'fade'){ fade('next'); if(options.auto){ clearInterval($.t); $.t = setInterval(function(){fade('next');}, options.pause); } } } return false; }); $this.parent().find('.slider_prev').click(function(){ if(!is_working){ if(options.mode == 'slide'){ animate_prev(); if(options.auto){ clearInterval($.t); $.t = setInterval(function(){animate_prev();}, options.pause); } }else if(options.mode == 'fade'){ fade('prev'); if(options.auto){ clearInterval($.t); $.t = setInterval(function(){fade('prev');}, options.pause); } } } return false; }); } function ticker() { if(options.ticker_direction == 'left'){ $this.animate({'left':'-' + $parent_width * 2 + 'px'}, options.speed, 'linear', function(){ $this.css({'left':'-' + $parent_width + 'px'}).children(':first').appendTo($this); ticker(); }); }else if(options.ticker_direction == 'right'){ $this.animate({'left': 0}, options.speed, 'linear', function(){ $this.css({'left':'-' + $parent_width + 'px'}).children(':last').insertBefore($this.children(':first')); ticker(); }); } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // Create content wrapper and set CSS ///////////////////////////////////////////////////////////////////////////////////////////////////////////// $this.wrap('<div class="' + options.wrapper_class + '"></div>'); //console.log($this.parent().css('paddingTop')); if(options.mode == 'slide' || options.mode == 'ticker'){ $this.parent().css({ 'overflow' : 'hidden', 'position' : 'relative', 'margin' : '0 auto', 'width' : options.width + 'px' }); $this.css({ 'width' : '999999px', 'position' : 'relative', 'left' : '-' + $parent_width + 'px' }); $this.children().css({ 'float' : 'left', 'width' : $parent_width }); $this.children(':last').insertBefore($this.children(':first')); }else if(options.mode == 'fade'){ $this.parent().css({ 'overflow' : 'hidden', 'position' : 'relative', 'width' : options.width + 'px' //'height' : $this.children().height() }); if(!options.controls){ $this.parent().css({'height' : $this.children().height()}); } $this.children().css({ 'position' : 'absolute', 'width' : $parent_width, 'listStyle' : 'none', 'opacity' : 0 }); $this.children(':first').css({ 'opacity' : 1 }); } ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // Check if user selected "auto" ///////////////////////////////////////////////////////////////////////////////////////////////////////////// if(!options.auto){ add_controls(); }else{ if(options.mode == 'ticker'){ ticker(); }else{ ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // Set a timed interval ///////////////////////////////////////////////////////////////////////////////////////////////////////////// if(options.mode == 'slide'){ if(options.auto_direction == 'left'){ $.t = setInterval(function(){animate_next();}, options.pause); }else if(options.auto_direction == 'right'){ $.t = setInterval(function(){animate_prev();}, options.pause); } }else if(options.mode == 'fade'){ if(options.auto_direction == 'left'){ $.t = setInterval(function(){fade('next');}, options.pause); }else if(options.auto_direction == 'right'){ $.t = setInterval(function(){fade('prev');}, options.pause); } } if(options.controls){ add_controls(); } } } }

    Read the article

  • CSS Experts required - problems with Z-Index stack in my page design

    - by Jack W-H
    Howdy y'all! Basically I'm having some problems with Z-Index. Although I'm not amazing at CSS I would reckon I was reasonably good, but really can't work this out. You'll see at the URL... http://howcode.com/code/ ... that my problem is that links in the returned 'Popular' results aren't clickable or anything. I've concluded this is due to their Z-Index being messed up. I had to fiddle and tweak with Z-Index to get the tabs - Popular, Top Rated, Featured etc. - to show above the codebg div. When I adjusted the Z-Index so that the results were definitely on top, they acted as normal - text could be selected, the ratings images hovered, etc. etc. However the downside to this was that my Popular, Top Rated, Featured tabs were all placed BENEATH the background image for the returned results. If anyone can post a workaround or alteration to my CSS that would be much appreciated. Please don't forget this is a test site and design and any other URLs are likely not to work, I haven't uploaded any database configs yet or whatever! Attached are a couple of screenshots to clarify what I mean: This is what I WANT to happen (not that in actual fact in this screenshots link aren't clickable, just to demo my point though): This is what DOES happen when I adjust the Z-Index properties (I don't want this!): Thanks y'all!

    Read the article

  • Bypass OpenID. Please give us a simple login form.

    - by Florin
    Can I kindly ask that we're allowed to login without the OpenID nonsense? This system is so popular that stack-overflow is the only place that I use it. If it is the policy of stack-overflow to prevent people to login, they've succeeded. I am a passive reader. For some reasons, I really don't like the idea of having one Id for all sites. To me, this system is dead in the water. Unless used within organizations I will never use it. Of course, until the government decides to reign us all in. Will you give them a hand? Until then, can we simply have a login form as in 1995? Thank you for your consideration.

    Read the article

  • UIViewController is popped from view stack and NSURLConnection crashes the application

    - by rickharrison
    I am pushing a UIViewController onto a UINavigationController. This view controller immediately starts a download of an xml feed and then parses it. However, if you hit the back button before it is done downloading, and crashes with EXC_BAD_ACCESS. The line that is crashing it is in parserDidEndDocument and is this line: if (self.delegate && [self.delegate conformsToProtocol:@protocol(ModelDelegate)]) [self.delegate modelDidFinishParsing:self]; I assume it is crashing because it is trying to access self.delegate which is not assigned anymore. How do I get around this? Also, I would release the model object in the modelDidFinishParsing method. How would I release this model if it never reaches this method.

    Read the article

  • How to use traceit to report function input variables in stack trace

    - by reckoner
    Hi, I've been using the following code to trace the execution of my programs: import sys import linecache import random def traceit(frame, event, arg): if event == "line": lineno = frame.f_lineno filename = frame.f_globals["__file__"] if filename == "<stdin>": filename = "traceit.py" if (filename.endswith(".pyc") or filename.endswith(".pyo")): filename = filename[:-1] name = frame.f_globals["__name__"] line = linecache.getline(filename, lineno) print "%s:%s:%s: %s" % (name, lineno,frame.f_code.co_name , line.rstrip()) return traceit def main(): print "In main" for i in range(5): print i, random.randrange(0, 10) print "Done." sys.settrace(traceit) main() Using this code, or something like it, is it possible to report the values of certain function arguments? In other words, the above code tells me "which" functions were called and I would like to know "what" the corresponding values of the input variables for those function calls. Thanks in advance.

    Read the article

  • IE jQuery ajax results in a stack overflow

    - by dave
    I have the following code that in IE gives me an error in jQuery for "open(G,M.url,M.async" $("#submitButton").click(function(){ $.ajax({ type: "POST", url: "http://url.com/postChat.php", data: "comment="+$("#userInput").val(), success: function(msg){ } }); }); Any ideas as to why this would happen in IE?

    Read the article

  • Why should pop() take an argument?

    - by Stephano
    Quick background I'm a Java developer who's been playing around with C++ in my free/bored time. Preface In C++, you often see pop taking an argument by reference: void pop(Item& removed); I understand that it is nice to "fill in" the parameter with what you removed. That totally makes sense to me. This way, the person who asked to remove the top item can have a look at what was removed. However, if I were to do this in Java, I'd do something like this: Item pop() throws StackException; This way, after the pop we return either: NULL as a result, an Item, or an exception would be thrown. My C++ text book shows me the example above, but I see plenty of stack implimentations taking no arguments (stl stack for example). The Qustion How should one implement the pop function in C++? The Bonus Why?

    Read the article

  • kernel get stack when signalled

    - by yoavstr
    hi there i write readers and writers where the kernel have to syncronize between them and block writer who already read a massage when i am in the queue waiting I get signal so I do the fallowing while (i_Allready_Read(myf) == ALLREADY_READ || isExistWriter == false ) //while (!(i_Allready_Read(aliveProc,current->pid))) { int i, is_sig = 0; printk(KERN_INFO "\n\n*****entered set in read ******\n\n" ); if (i_Allready_Read(myf) == ALLREADY_READ ) wait_event_interruptible (readWaitQ1, !i_Allready_Read(myf)); else wait_event_interruptible (readWaitQ1, isExistWriter); //printk(KERN_INFO "Read Wakeup %d\n",current->pid); for (i = 0; i < _NSIG_WORDS && !is_sig; i++) { is_sig = current->pending.signal.sig[i] & ~current->blocked.sig[i]; } if (is_sig) { handledClose(myf); module_put (THIS_MODULE); return -EINTR; } } return 0;//success } inline void handledClose(struct file *myf)//v { /* *if we close the writer other writer *would be able to enter to permissiones */ if (myf == writerpid ) { isExistWriter = DOESNT_EXIST; //printk(KERN_INFO "procfs_close : this is pid that just closed %d \n", writerpid); } /* *else its a reader so our numofreaders *need to decremented */ else { removeFromArr(myf); numOfReaders--; } } and my close does nothing ... what did i do wrong?

    Read the article

  • Getting source code information from groovy stack trace

    - by dotsid
    When exception generated I want to show some additional information (source code) for particular exception. But grails have very hairy exceptions (it's all about groovy dynamic nature). It's my problem where to get and how to display source code. All I need is file/line information. So... Is there any possibility to get file and line where exception were generated in grails/groovy?

    Read the article

  • How do I stack Plack authentication handlers?

    - by Schwern
    I would like to have my Plack app try several different means of authorizing the user. Specifically, check if the user is already authorized via a session cookie, then check for Digest authentication and then fall back to Basic. I figured I could just enable a bunch of Auth handlers in the order I wanted them to be checked (Session, Digest, Basic). Unfortunately, the way that Plack::Middleware::Auth::Digest and Plack::Middleware::Auth::Basic are written they both return 401 if digest or basic auth doesn't exist, respectively. How is this normally dealt with in Plack?

    Read the article

  • How to use URLs like Stack Overflow?

    - by user260165
    I want to somehow place a question on the title using the url. Actually I am building a webpage where I have placed a question input box and submit button, so I want that when I submit it should redirect me to the ask questions page and the title should contain the question that he asked. Is there any way to do that? Thanks.

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >