Search Results

Search found 250905 results on 10037 pages for 'overflow'.

Page 28/10037 | < Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >

  • gcc optimization? bug? and its practial implication to project

    - by kumar_m_kiran
    Hi All, My questions are divided into three parts Question 1 Consider the below code, #include <iostream> using namespace std; int main( int argc, char *argv[]) { const int v = 50; int i = 0X7FFFFFFF; cout<<(i + v)<<endl; if ( i + v < i ) { cout<<"Number is negative"<<endl; } else { cout<<"Number is positive"<<endl; } return 0; } No specific compiler optimisation options are used or the O's flag is used. It is basic compilation command g++ -o test main.cpp is used to form the executable. The seemingly very simple code, has odd behaviour in SUSE 64 bit OS, gcc version 4.1.2. The expected output is "Number is negative", instead only in SUSE 64 bit OS, the output would be "Number is positive". After some amount of analysis and doing a 'disass' of the code, I find that the compiler optimises in the below format - Since i is same on both sides of comparison, it cannot be changed in the same expression, remove 'i' from the equation. Now, the comparison leads to if ( v < 0 ), where v is a constant positive, So during compilation itself, the else part cout function address is added to the register. No cmp/jmp instructions can be found. I see that the behaviour is only in gcc 4.1.2 SUSE 10. When tried in AIX 5.1/5.3 and HP IA64, the result is as expected. Is the above optimisation valid? Or, is using the overflow mechanism for int not a valid use case? Question 2 Now when I change the conditional statement from if (i + v < i) to if ( (i + v) < i ) even then, the behaviour is same, this atleast I would personally disagree, since additional braces are provided, I expect the compiler to create a temporary built-in type variable and them compare, thus nullify the optimisation. Question 3 Suppose I have a huge code base, an I migrate my compiler version, such bug/optimisation can cause havoc in my system behaviour. Ofcourse from business perspective, it is very ineffective to test all lines of code again just because of compiler upgradation. I think for all practical purpose, these kinds of error are very difficult to catch (during upgradation) and invariably will be leaked to production site. Can anyone suggest any possible way to ensure to ensure that these kind of bug/optimization does not have any impact on my existing system/code base? PS : When the const for v is removed from the code, then optimization is not done by the compiler. I believe, it is perfectly fine to use overflow mechanism to find if the variable is from MAX - 50 value (in my case).

    Read the article

  • vs2010 wpf c#: how to get friends list from facebook? (Desktop application)

    - by Ash
    As per this link code from stack overflow i have try this code for getting friendslist but after login i got this error "requires valid signature" string APIKey = ConfigurationManager.AppSettings["API_Key"]; string APISecret = ConfigurationManager.AppSettings["API_Secret"]; Facebook.Session.ConnectSession connectsession = new Facebook.Session.ConnectSession(APIKey, APISecret); Facebook.Rest.Api api = new Facebook.Rest.Api(connectsession); var friends = api.Friends.GetLists(); foreach (var friend in friends) { System.Console.WriteLine(friend.name); } guide me to find out the solution Thanks ash

    Read the article

  • define mysql indexing

    - by Bharanikumar
    Hi Am not sure, This is the right place to post this question , But in our stack overflow only am getting clear vision solutions , What is indexing and what is fulltext , for the above both questions i know the ans, but i cant expose that ans in the exact way to the interviewer , (indexing means somthing like index in book) (fulltext means for search string), Can please give me very simple defination for this questions , Advance thanks

    Read the article

  • Task queue java api

    - by user268515
    Hi i'm working in task queue concept.... First i struggled to program using task queue and i asked many doubts in stack overflow and Google app engine java. After a search i got a sample program for task queue. http://gaejexperiments.wordpress.com/2009/11/24/episode-10-using-the-task-queue-service/ It will very useful for beginners Like me. Regards, Sharun.

    Read the article

  • Removing the Google Maps API Premier Terms-of-Use/Logo/etc. links?

    - by appr3ntice
    Hi, is it legal to remove the logo/terms of use link displayed on my integrated google map (google maps premier)? The problem is that when I zoom into the map, the link tends to get longer and loger and overlays the whole website which is pretty ugly. Of course it is possible to give the div container a "overflow: hidden;" flag which helps a little. But it is still not satisfying. Thx

    Read the article

  • Store CSPC and UPC Codes in Rails

    - by Kevin Sylvestre
    What the best way to store CSPC and UPC codes are in Rails? I used integers with SQLite, but had overflow issues when moving to production. I've since switch to strings, but am not sure if a better generic datatype (needs to support SQLite, MySQL and PostgreSQL). Thanks.

    Read the article

  • Login From Multiple OAuth Services, Keeping Profiles in Sync

    - by viatropos
    Given the following: I have an application that allows people to login through twitter, myspace, yahoo, and google User creates initial account by logging in through Google User logs out User logs back in using Yahoo. ...is there a recommended way for the application to associate those two accounts together? Stack Overflow has this functionality but it seems like they need the user to manually say "this account google account is associated with that yahoo one". Is there no way to do this automatically?

    Read the article

  • Whats the Best Way to boost my StackOverflow score? [closed]

    - by 5arx
    I just joined stack overflow and am finding it very useful. But getting my score up to the level where I can actually do things like answer questions, mark people's answers up or down and so on is proving to be painfully slow. Can any of you SO hacks and experts furnish me with tips to get my score climbing ...? Thanks, 5arx

    Read the article

  • iPhone SDK - How is data shared in a unversal app

    - by norskben
    Stack overflow I want to make a universal version of my app available, but I am wondering how is data managed between the iPad and the iPhone versions? -Are they completely independent? or if I have a plist in the iPad app, does it also appear in the iPhone app. If so, is there any syncing etc etc. I have a few months experience with single iPad or iPhone apps, but never a universal. Thanks again.

    Read the article

  • Looping on a closed range

    - by AProgrammer
    How would you fix this code? template <typename T> void closed_range(T begin, T end) { for (T i = begin; i <= end; ++i) { // do something } } T is constrained to be an integer type, can be the wider of such types and can be signed or unsigned begin can be numeric_limits<T>::min() end can be numeric_limits<T>::max() (in which case ++i will overflow in the above code) I've several ways, but none I really like.

    Read the article

  • How to break the following line of python

    - by FrederikNS
    Hello Stack Overflow, I have come upon a couple of lines of code similar to this one, but I'm unsure how I should break it: blueprint = Blueprint(self.blueprint_map[str(self.ui.blueprint_combo.currentText())], runs=self.ui.runs_spin.text(), me=self.ui.me_spin.text(), pe=self.ui.pe_skill_combo.currentIndex()) Thanks in advance

    Read the article

  • SOA principals - should a service call another service?

    - by silves89
    I'm new to SOA (and to Stack Overflow too...) Some services and web applications we are developing must all log audit information. We are considering an audit service for this. Is there any SOA governing principal that should make me think twice about having one of the services call the audit service to log information? A service-to-service call in other words?

    Read the article

  • Flexslider position of previous and next slides

    - by TJ15
    I am using the basic flexslider, I wantto display some of the previous and next , so if slide 2 is showing you will see part of slide 1 to the left and part of slide 3 to the right. <!DOCTYPE html> <head> <link rel="stylesheet" href="flexslider.css" type="text/css"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <style> .container {overflow: hidden; width: 100%} .flexslider {max-width: 500px; width: 500px; margin: 0 auto} .content {background: #f2f2f2; max-width: 500px; display: block; margin: 0 auto} .flex-viewport {overflow: visible !important} </style> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <div class="container"> <div class="flexslider"> <ul class="slides"> <li><img src="785.jpg" /></li> <li><img src="785.jpg" /></li> <li><img src="785.jpg" /></li> <li><img src="785.jpg" /></li> </ul> </div> </div> <script src="jquery.flexslider.js"></script> <script> jQuery(document).ready(function($) { // You can use the locally-scoped $ in here as an alias to jQuery. $(window).load(function() { $('.flexslider').flexslider(); }); }); </script> </body> </html> I have reduced the image to 70% and positioned it in the middle of the page. I want to have the next and previous slides visible on either side of the main pic but no idea where to make the appropriate changes (I assume in the js file). I thought this was a margin issue but setting this to 0 in styles makes no difference. Has anyone done this and can provide some advice?

    Read the article

  • As3 help about addEventListener

    - by mydiscogr
    Hi, I've a little problem, I don't really understand if I can use addEventListener more than one time on the same object (and same callback function) if this case can I have a problem of overflow, or simple flex is so smart to not add again in the same stack same function for examples: var t:CServiceObj = _rModel.userGetBoardJoined(); t.addEventListener(EDataService.DATA_AVAILABLE,onDataOk); t.addEventListener(EDataService.DATA_AVAILABLE,onDataOk); t.addEventListener(EDataService.DATA_AVAILABLE,onDataOk); thanks

    Read the article

  • Is there a way to prevent a string of letters with no spaces from overflowing out of its correspondi

    - by Scarface
    The question is pretty straight forward, I have tried using a span with rules set to clear:both; and display:block;, at the bottom of each list entry where the text is being inserted in with no luck. I am not really sure what to do on this. I don't expect to many entries with long consecutive letter strings but for example if someone does lolololololol or ahaahahahhhhhhhhhhhhaaaaaaaa for like 100 letters, it will overflow. If anyone can give me a pointer I would really appreciate it.

    Read the article

  • Is String.concat slower than Array approach to join strings

    - by Rajat
    Strings in JavaScript are immutable. Across the web and here on Stack Overflow as well, I came across the Array approach to concatenate strings: var a = []; a.push(arg1,arg,2....); console.log(a.join('')); I know that this approach is better than the simple console.log(arg1 + arg2 +.....); for reasons of skipping creating intermediate objects but how does it fair better against : arg1.concat(arg2,arg3.....);

    Read the article

  • disable horizontal scrolling by finger swipe

    - by codelove
    This may just be a mac issue, but I have a page with an element which is twice the size of the page and is moved into view dynamically. in my css I have overflow-x:hidden set so that this element won't create an ugly bottom scollbar, the problem is on my laptop (and probably on ipads and other devices) I can just swipe with two fingers to scroll and view this content. This breaks the whole layout and looks really bad, and I am looking for a way to completely disable this horizontal scrolling action with javascript or css. Thank you

    Read the article

  • Simple regular expression for decimal numbers?

    - by finch
    I know this may be the simplest question ever asked on Stack Overflow, but what is the regular expression for a decimal with a precision of 2? Valid examples: 123.12 2 56754 92929292929292.12 0.21 3.1 Invalid examples: 12.1232 2.23332 e666.76 Sorry for the lame question, but for the life of me I haven't been able to find anyone that can help! The decimal place may be option, and that integers may also be included.

    Read the article

  • Rails Application Hosting

    - by deb
    Where do you host your rails applications? I've tried Heroku (shared) and Slicehost (dedicated). I thought I would ask you, the knowledgeable guys here at stack-overflow, for hosting recommendations. Thanks in advance -- Deb

    Read the article

< Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >