Search Results

Search found 254039 results on 10162 pages for 'overflow auto'.

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

  • Best way to handle Integer overflow in C#?

    - by byte
    Handling integer overflow is a common task, but what's the best way to handle it in C#? Is there some syntactic sugar to make it simpler than with other languages? Or is this really the best way? int x = foo(); int test = x * common; if(test / common != x) Console.WriteLine("oh noes!"); else Console.WriteLine("safe!");

    Read the article

  • Div overflow not hidden properly

    - by bbeckford
    Hi guys, I'm working on this site - http://dev.chriscurddesign.co.uk/mayday It works in everything other than IE7 and IE8 in compatibility mode (don't care about IE6), where the vacancies lists on the right aren't hidden correctly by their parent overflow property. I have been pulling my hair out trying to get to the bottom of this, its driving me up the wall, anyone got any ideas whatsoever? Below is an image of the issue, chrome on the left, IE8 compat mode on the right. Cheers, -Ben

    Read the article

  • Running down a 'stack overflow' bug

    - by ChuckO
    I have an application written in Delphi W32 that is in beta. On the test PC, it haphazardly kicks out a 'stack overflow' message after a few hours of use. How can I trap the error and find the cause? Can I increase the Stack size?

    Read the article

  • How does Exchange 2010 prevent auto-reply loop?

    - by Beaming Mel-Bin
    E.g., 2 users have auto-reply configured. User A sends a message to User B. User B's auto-reply gets sent to User A's mailbox. That, in turn, causes an auto-reply to be sent from User A and insanity ensues. How does Exchange 2010 prevent this scenario? Also, can Exchange 2010 prevent a user's mailbox sending more than one auto-reply to the same user in one day? Bonus: Assuming Exchange prevents this, how do I configure the settings?

    Read the article

  • Hide overflow in Silverlight TextBox

    - by chrisbz
    I have a Silverlight TextBox control that is inside of a Grid column with the width set to 'Auto', so the TexBox's width expands/contracts with the browser window is resized. Unfortunately, when the number of characters entered into the textbox exceeds the textbox's width, the textbox grows to accommodate it. Are there any properties that can be applied to the textbox that will force it to not expand with the number of characters inside of it? Thanks.

    Read the article

  • Integer Overflow in VBA project

    - by mcoolbeth
    Hi, everyone. Here is a small VBA (Excel) function that i wrote, full of MsgBoxes for debugging. I am passing in the numbers 10 and 1 as arguments, and getting an overflow error when the program reaches the top of the For loop, before it begins the first iteration. Any thoughts are appreciated. Function PerformanceTest(iterations As Integer, interval As Integer) As Double Dim st, tot, k As Double Dim n As Integer tot = 0# MsgBox "ok" k = iterations + tot MsgBox "ookk" n = 1 MsgBox "assigned" For n = 1 To iterations MsgBox n st = Timer Application.Calculate tot = tot + (Timer - st) Sleep (1000 * interval) Next n 'MsgBox (tot / k) PerformancTest = tot / k End Function

    Read the article

  • Overflow on UILabels

    - by jkeesh
    I have a table view that I am customizing and I am adding a UILabel as a subview of the contentView, and I want the number of lines to be relatively consistent. I set the numberOfLines property to be 3 so it can't go more than that, but there are still some that overflow onto the 4th line. If it overflows, I want to add a a trailing ... How can I figure out if it overflows? I've tried truncating at different character counts of my string, but since I am using lineBreakMode = UILineBreakModeWordWrap the number of characters doesn't really predict the number of lines. Is there a way to find out the number of lines your UILabel is using?

    Read the article

  • Making a vertically scrolling parent div which does not cause overflow of children

    - by marq
    I have something as follows: <div style="float: left; height: 20px; overflow-y: scroll"> <div>hello this is a test</div> <div>hello this is another test</div> <div>t1</div> <div>t2</div> <div>t3</div> </div> The parent div grows to the appropriate width to fit the largest child (which is what I want). However, the vertical scrollbar causes the inner width to be smaller, which causes the largest child to wrap. Is there a way to get the parent to grow to the width of the largest child + the width of the scroll bar? I've tried every margin trick I know, but nothing.

    Read the article

  • Brainfart: How to make overflow content in a div

    - by Conor
    I cant even come up with a proper subject for this one... Basically I have a box div, that when click expands to a rectangle and shows content in the new expanded area. The problem I'm having is that when I animate out the div's width, the browser wants to render the content as the box is stretching, rather than just have it placed where I need it. Initial State ____ | | |____| Clicked _________________ | Content | |_________________| How it currently renders __________ | Con | |______tent| How I want it to render: __________ | Cont|ent (overflow:hidden) |__________| Someone help me out here... total brainfart.

    Read the article

  • How to detect an overflow in C++ ?

    - by Tim
    Hi, I just wonder if there is some convenient way to detect if overflow happens to any variable of any default data type used in a C++ program during runtime? By convenient, I mean no need to write code to follow each variable if it is in the range of its data type every time its value changes. Or if it is impossible to achieve this, how would you do? For example, float f1=FLT_MAX+1; cout << f1 << endl; doesn't give any error or warning in either compilation with "gcc -W -Wall" or running. Thanks and regards!

    Read the article

  • [HTML][jQuery] Brainfart: How to make overflow content in a div

    - by Conor
    I cant even come up with a proper subject for this one... Basically I have a box div, that when click expands to a rectangle and shows content in the new expanded area. The problem I'm having is that when I animate out the div's width, the browser wants to render the content as the box is stretching, rather than just have it placed where I need it. Initial State ____ | | |____| Clicked _________________ | Content | |_________________| How it currently renders __________ | Con | |______tent| How I want it to render: __________ | Cont|ent (overflow:hidden) |__________| Someone help me out here... total brainfart.

    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

  • C# average function without overflow exception

    - by Ron Klein
    .NET Framework 3.5. I'm trying to calculate the average of some pretty large numbers. For instance: using System; using System.Linq; class Program { static void Main(string[] args) { var items = new long[] { long.MaxValue - 100, long.MaxValue - 200, long.MaxValue - 300 }; try { var avg = items.Average(); Console.WriteLine(avg); } catch (OverflowException ex) { Console.WriteLine("can't calculate that!"); } Console.ReadLine(); } } Obviously, the mathematical result is 9223372036854775607 (long.MaxValue - 200), but I get an exception there. This is because the implementation (on my machine) to the Average extension method, as inspected by .NET Reflector is: public static double Average(this IEnumerable<long> source) { if (source == null) { throw Error.ArgumentNull("source"); } long num = 0L; long num2 = 0L; foreach (long num3 in source) { num += num3; num2 += 1L; } if (num2 <= 0L) { throw Error.NoElements(); } return (((double) num) / ((double) num2)); } I know I can use a BigInt library (yes, I know that it is included in .NET Framework 4.0, but I'm tied to 3.5). But I still wonder if there's a pretty straight forward implementation of calculating the average of integers without an external library. Do you happen to know about such implementation? Thanks!! UPDATE: The previous example, of three large integers, was just an example to illustrate the overflow issue. The question is about calculating an average of any set of numbers which might sum to a large number that exceeds the type's max value. Sorry about this confusion. I also changed the question's title to avoid additional confusion. Thanks all!!

    Read the article

  • Fluid CSS: float column with overflow

    - by Ates Goral
    I'm using a fluid layout in the new theme that I'm working on for my blog. I often blog about code and include <pre> blocks within the posts. The float: left column for the content area has a max-width so that the column stops at a certain maximum width and can also be shrunk: +----------+ +------+ | text | | text | | | | | | | | | | | | | | | | | | | | | +----------+ +------+ max shrunk What I want is for the <pre> elements to be wider than the text column so that I can fit 80-character-wrapped code without horizontal scroll bars. But I want the <pre> elements to overflow from the content area, without affecting its fluidity: +----------+ +------+ | text | | text | | | | | +----------+--+ +------+------+ | code | | code | +----------+--+ +------+------+ | | | | +----------+ +------+ max shrunk But, max-width stops being fluid once I insert the overhanging <pre> in there: the width of the column remains at the specified max-width even when I shrink the browser beyond that width. I've played around with a bare-minimum scenario to reproduce the problem and noticed that doing either of the following brings back the fluidity: Remove the <pre> (doh...) Remove the float: left The workaround I'm currently using is to insert the <pre> elements into "breaks" in the post column, so that the widths of the post segments and the <pre> segments are managed mutually exclusively: +----------+ +------+ | text | | text | +----------+ +------+ +-------------+ +-------------+ | code | | code | +-------------+ +-------------+ +----------+ +------+ +----------+ +------+ max shrunk But this forces me to insert additional closing and opening <div> elements into the post text which I'd rather keep semantically pristine. Admittedly, I don't have a full grasp of how the box model works with floats with overflowing content, so I don't understand why the combination of float: left on the container and the <pre> inside it cripple the max-width of the container. I'm observing the same problem on Firefox/Chrome/Safari/Opera. IE6 (the crazy one) seems happy all the time. This also doesn't seem dependent on quirks/standards mode.

    Read the article

  • Average function without overflow exception

    - by Ron Klein
    .NET Framework 3.5. I'm trying to calculate the average of some pretty large numbers. For instance: using System; using System.Linq; class Program { static void Main(string[] args) { var items = new long[] { long.MinValue + 100, long.MinValue + 200, long.MinValue + 300 }; try { var avg = items.Average(); Console.WriteLine(avg); } catch (OverflowException ex) { Console.WriteLine("can't calculate that!"); } Console.ReadLine(); } } Obviously, the mathematical result is 9223372036854775607 (long.MaxValue - 200), but I get an exception there. This is because the implementation (on my machine) to the Average extension method, as inspected by .NET Reflector is: public static double Average(this IEnumerable<long> source) { if (source == null) { throw Error.ArgumentNull("source"); } long num = 0L; long num2 = 0L; foreach (long num3 in source) { num += num3; num2 += 1L; } if (num2 <= 0L) { throw Error.NoElements(); } return (((double) num) / ((double) num2)); } I know I can use a BigInt library (yes, I know that it is included in .NET Framework 4.0, but I'm tied to 3.5). But I still wonder if there's a pretty straight forward implementation of calculating the average of integers without an external library. Do you happen to know about such implementation? Thanks!! UPDATE: The previous example, of three large integers, was just an example to illustrate the overflow issue. The question is about calculating an average of any set of numbers which might sum to a large number that exceeds the type's max value. Sorry about this confusion. I also changed the question's title to avoid additional confusion. Thanks all!!

    Read the article

  • text-overflow:ellipsis in Firefox 4?

    - by Spudley
    The text-overflow:ellipsis; CSS property must be one of the few things that Microsoft has done right for the web. All the other browsers now support it... except Firefox. The Firefox developers have been arguing over it since 2005 but despite the obvious demand for it, they can't seem to actually bring themselves to implement it (even an experimental -moz- implementation would be sufficient). A few years ago, someone worked out a way to hack Firefox 3 to make it support an ellipsis. The hack uses the -moz-binding feature to implement it using XUL. Quite a number of sites are now using this hack. The bad news? Firefox 4 is removing the -moz-binding feature, which means this hack won't work any more. So as soon as Firefox 4 is released (later this month, I hear), we're going to be back to the problem of having it not being able to support this feature. So my question is: Is there any other way around this? (I'm trying to avoid falling back to a Javascript solution if at all possible) [EDIT] Lots of up-votes, so I'm obviously not the only one who wants to know, but I've got one answer so far which basically says 'use javascript'. I'm still hoping for a solution that will either not need JS at all, or at worst only use it as a fall-back where the CSS feature doesn't work. So I'm going to post a bounty on the question, on the off chance that someone, somewhere has found an answer.

    Read the article

  • overflow-y hides page contents in a webkit browsers (Chrome and Safari)

    - by Victor F
    Hi, I am currently making our website to be supported by all major browsers and I've met a very strange problem - oveflow-y attribute caused my data to be hidden. Below I've got an oversimplified code sample that works in IE and Firfox, but which doesn't work in Safari and Chrome. This is a 100% valid code and I am not sure why it doesn't display properly in webkit browsers. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body style="height: 100%;"> <form action="Webkit_Problem.html" style="height: 100%;"> <table style="height: 100%;> <tr> <td> <div style="overflow-y: auto; height: 100%;> THIS SHOULD BE VISIBLE </div> </td> </tr> </table> </form> </body> </html> http://www.alocet.com/VictorsTestFolder/Webkit_Problem.html (Live sample here) The only way to get it working is either remove the height:100% attributes for div or a table tag (which will ruin the purpose of my html), or add height:100% to html tag Does anyone has any suggestions? Thank you

    Read the article

  • Auto load a specific link at various time intervals

    - by user228837
    Here's what I need to do. I'm using Google Chrome. I have page that auto-reloads every 5 seconds using a script: javascript: timeout=prompt("Set timeout [s]"); current=location.href; if(timeout>0) setTimeout('reload()',1000*timeout); else location.replace(current); function reload() { setTimeout('reload()',1000*timeout); fr4me='<frameset cols=\'*\'>\n<frame src=\''+current+'\'/>'; fr4me+='</frameset>'; with(document){write(fr4me);void(close())}; } I found that script by Googling. The reason why the page auto-reloads every 5 seconds is I'm waiting for a specific link or url to appear in the page. It appears at random times. Once I see the link I'm waiting for, I immediately click the link. That's fine. But I want more. What I want is the page will auto-reload and I want it to auto-detect the the link I'm waiting for. Once the script finds the link I'm waiting for, it automatically loads that link on a new tab or page. For example, I'm auto-reloading www.example.com. I'm waiting for a specific url "BUY NOW". When the page auto-reloads, it checks if there's a url "BUY NOW". If it sees one, it should automatically open that link. Thanks.

    Read the article

  • Fluid CSS: floating column with max-width and overflow

    - by Ates Goral
    I'm using a fluid layout in the new theme that I'm working on for my blog. I often blog about code and include <pre> blocks within the posts. The float: left column for the content area has a max-width so that the column stops at a certain maximum width and can also be shrunk: +----------+ +------+ | text | | text | | | | | | | | | | | | | | | | | | | | | +----------+ +------+ max shrunk What I want is for the <pre> elements to be wider than the text column so that I can fit 80-character-wrapped code without horizontal scroll bars. But I want the <pre> elements to overflow from the content area, without affecting its fluidity: +----------+ +------+ | text | | text | | | | | +----------+--+ +------+------+ | code | | code | +----------+--+ +------+------+ | | | | +----------+ +------+ max shrunk But, max-width stops being fluid once I insert the overhanging <pre> in there: the width of the column remains at the specified max-width even when I shrink the browser beyond that width. I've reproduced the issue with this bare-minimum scenario: <div style="float: left; max-width: 460px; border: 1px solid red"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit</p> <pre style="max-width: 700px; border: 1px solid blue"> function foo() { // Lorem ipsum dolor sit amet, consectetur adipisicing elit } </pre> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit</p> </div> I noticed that doing either of the following brings back the fluidity: Remove the <pre> (doh...) Remove the float: left The workaround I'm currently using is to insert the <pre> elements into "breaks" in the post column, so that the widths of the post segments and the <pre> segments are managed mutually exclusively: +----------+ +------+ | text | | text | +----------+ +------+ +-------------+ +-------------+ | code | | code | +-------------+ +-------------+ +----------+ +------+ +----------+ +------+ max shrunk But this forces me to insert additional closing and opening <div> elements into the post markup which I'd rather keep semantically pristine. Admittedly, I don't have a full grasp of how the box model works with floats with overflowing content, so I don't understand why the combination of float: left on the container and the <pre> inside it cripple the max-width of the container. I'm observing the same problem on Firefox/Chrome/Safari/Opera. IE6 (the crazy one) seems happy all the time. This also doesn't seem dependent on quirks/standards mode. Update I've done further testing to observe that max-width seems to get ignored when the element has a float: left. I glanced at the W3C box model chapter but couldn't immediately see an explicit mention of this behaviour. Any pointers?

    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

  • Horizontal navigation from next previous buttons for Overflow:Hidden div

    - by brz dot net
    See following Code <div> <a id="west" href="javascript:void(0);" onclick="scrollBlockWest();"><<West</a> <a id="east" href="javascript:void(0);" onclick="scrollBlockEast();">East >></a> </div> <div id="myScrollContainer" style="overflow:hidden; width:900px; height:700px"> <table id="myScrollContent"><tr><td> <div id="block0" style="display:block;height:300px; width:300px; background-color:Lime">Content 0</div> </td><td> <div id="block1" style="display:block;height:300px; width:300px; background-color:Aqua">Content 1</div> </td><td> <div id="block2" style="display:block;height:300px; width:300px; background-color:Blue">Content 2</div> </td><td> <div id="block3" style="display:block;height:300px; width:300px; background-color:Gray">Content 3</div> </td><td> <div id="block4" style="display:block;height:300px; width:300px; background-color:Gray">Content 4</div> </td> </tr></table> </div> This is my script: <script type="text/javascript" > var totalBlock = 4; var currentBlock = 0; function scrollBlockEast() { var blk = document.getElementById('block'+currentBlock); //alert('block'+blockid); blk.style.display='none'; currentBlock++; //document.getElementById('myScrollContent').style.left = -100; if(currentBlock<totalBlock) { document.getElementById('west').style.display='inline'; } //alert(totlaBlock-1); if(currentBlock==totalBlock) { document.getElementById('east').style.display='none'; } } function scrollBlockWest() { currentBlock--; document.getElementById('block'+currentBlock).style.display='inline'; if(currentBlock<1) { document.getElementById('west').style.display='none'; } else { document.getElementById('east').style.display='inline'; } } </script> Now My object is to slide block on << and click. By default, 3 blocks(Content 0,Content 1,Content 2) are coming. When is clicked then (Content 1,Content 2,Content 3) will come. For this, I hide content 0 block. But layout will disturb on << click. I know this is wrong way. I should set left position instead of hiding content but it is empty I tried to set left position but no luck. Let me know How the block can be moved one by one using javascript and what is the best approach to do this?

    Read the article

  • Exchange 2007: Auto reply message to senders (server side)

    - by Mestika
    I’ve a need to create an auto-reply for some of the users in my organization where, when a person sends an E-mail to e.g. [email protected] is faced with an automatically auto-reply with some message “closed during the holidays. We are back at… etc. etc. etc.”. I’ve tried to create a Transport Rule on our Exchange server but the only option I can find in the actions-window is to reply with a “Bounce message to sender with enhanced status code” but I guess that is not the precise action I’m looking for. How can I set up a server-side auto-reply, apply it to only a fixed number of users in my organization and create a message to the senders (which is outside the organization)?

    Read the article

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