A CSS property which governs what happens if content overflows it's containing box
14
votes
5answers
2k views
Java Integer compareTo() - why use comparison vs. subtraction?
I've found that java.lang.Integer implementation of compareTo method looks as follows:
public int compareTo(Integer anotherInteger) {
int thisVal = this.value;
int anotherVal = anotherInteger.value;
...
10
votes
1answer
298 views
Can overflow:hidden affect layout?
There's no way for me to explain this except to refer to the following example on JS Fiddle- in it, the last BLUE box does not extend to 100% of the width as expected after I introduce an ...
31
votes
6answers
21k views
How can I check if a scrollbar is visible?
Is it possible to check the overflow:auto of a div?
For example:
HTML
<div id="my_div" style="width: 100px; height:100px; overflow:auto;" class="my_class">
* content
</div>
JQUERY
...
33
votes
2answers
34k views
IE6 + IE7 CSS problem with overflow: hidden; - position: relative; combo
So I have created a slider for a homepage, that slides some images with a title and teaser text using jQuery. Everything works fine, and I went to check IE and found that IE 6 and 7 kills my slider ...
22
votes
9answers
17k views
Stack overflows from deep recursion in Java?
After some experience with functional languages, I'm starting to use recursion more in Java - But the language seems to have a relatively shallow call stack of about 1000.
Is there a way to make the ...
16
votes
6answers
12k views
CSS3 property webkit-overflow-scrolling:touch ERROR
iOS 5 released web designers a new property -webkit-overflow-scrolling:touch that uses the iOS devices hardware accelerator to provide native scrolling for a scrollable div.
When implemented on our ...
17
votes
1answer
5k views
How to force overflow menu on android actionbar compat?
Android action bar compat
Is it possible? On older devices (pre 3.0) the itens that don't fit the action bar are only shown when the menu key is pressed, I want these itens to be grouped in the ...
6
votes
6answers
2k views
How do I get real integer overflows in MATLAB/Octave?
I'm working on a verification-tool for some VHDL-Code in MATLAB/Octave. Therefore I need data types which generate "real" overflows:
intmax('int32') + 1
ans = -2147483648
Later on, it would be ...
15
votes
8answers
2k views
How can I check if multiplying two numbers in Java will cause an overflow?
I want to handle the special case where multiplying two numbers together causes an overflow. The code looks something like this:
int a = 20;
long b = 30;
// if a or b are big enough, this result ...
12
votes
1answer
6k views
How do I get the real .height() of a overflow: hidden or overflow: scroll div?
I have a question regarding how to get a div height. I'm aware of .height() and innerHeight(), but none of them does the job for me in this case. The thing is that in this case I have a div that is ...
24
votes
2answers
390 views
Why does CSS2.1 define overflow values other than “visible” to establish a new block formatting context?
The CSS2.1 spec mandates that overflow other than visible establish a new "block formatting context". This strikes me as odd, that a property whose obvious purpose is to hide overflow without ...
18
votes
5answers
8k views
Check whether HTML element has scrollbars
What's the fastest way of checking whether an element has scroll bars?
One thing of course is checking whether element is larger than its viewport, which can easily be done by checking these two ...
23
votes
4answers
26k views
CSS Max Height Property
Is there a good cross-browser way to set a max-height property of a DIV and when that DIV goes beyond the max-height, it turns into an overflow with scroll bars?
14
votes
9answers
5k views
How does Java handle integer underflows and overflows and how would you check for it?
How does Java handle integer underflows and overflows?
Leading on from that, how would you check/test that this is occurring?
17
votes
9answers
6k views
How to detect possible / potential stack overflow problems in a c / c++ program?
Is there a standard way to see how much stack space your app has and what the highest watermark for stack usage is during a run?
Also in the dreaded case of actual overflow what happens?
Does it ...
8
votes
8answers
4k views
How to handle arbitrarily large integers
I'm working on a programming language, and today I got the point where I could compile the factorial function(recursive), however due to the maximum size of an integer the largest I can get is ...
7
votes
3answers
2k views
CSS text-overflow in a table cell?
I want to use CSS text-overflow in a table cell, such that if the text is too long to fit on one line, it will clip with an ellipsis instead of wrapping to multiple lines. Is this possible?
I tried ...
15
votes
5answers
2k views
No overflow exception for int in C#?
I had this weird experience with problem number 10 on Project Euler (great site by the way). The assignment was to calculate the sum of all the prime numbers below two million.
I used an int for the ...
8
votes
5answers
5k views
How to prevent scanf causing a buffer overflow in C?
I use this code:
while ( scanf("%s", buf) == 1 ){
What would be the best way to prevent possible buffer overflow so that it can be passed strings of random lengths?
I know I can limit the input ...
28
votes
6answers
40k views
IE8 overflow:auto with max-height
I have an element which may contain very big amounts of data, but I don't want it to ruin the page layout, so I set max-height: 100px and overflow:auto, hoping for scrollbars to appear when the ...
30
votes
4answers
5k views
Why do C++ streams use char instead of unsigned char?
I've always wondered why the C++ Standard library has instantiated basic_[io]stream and all its variants using the char type instead of the unsigned char type. char means (depending on whether it is ...
11
votes
4answers
1k views
Windows: avoid pushing full x86 context on stack
I have implemented PARLANSE, a language under MS Windows that uses cactus stacks to implement parallel programs. The stack chunks are allocated on a per-function
basis and are just the right size to ...
9
votes
3answers
362 views
How do promotion rules work when the signedness on either side of a binary operator differ?
Consider the following programs:
// http://ideone.com/4I0dT
#include <limits>
#include <iostream>
int main()
{
int max = std::numeric_limits<int>::max();
unsigned int one = ...
10
votes
4answers
475 views
C: avoiding overflows when working with big numbers
I've implemented some sorting algorithms (to sort integers) in C, carefully using uint64_t to store anything which has got to do with the data size (thus also counters and stuff), since the algorithms ...
10
votes
4answers
847 views
Know what overflow:hidden has hidden
I wat to know if there is any way you can call and use what the overflow:hidden has well hidden.
To clarify what I mean, in this example I would like to know that "This is hidden" is the hidden part ...
10
votes
3answers
5k views
Make child visible outside an overflow:hidden parent
In CSS the overflow:hidden is set on parent containers in order to allow it to expand with the height of their floating children. But it also has another interesting feature when combined with margin: ...
6
votes
3answers
4k views
Use jQuery to Detect Container Overflow?
I've seen this question but feel like there has to be a "cleaner" jQuery method of doing this. I'm not even sure if this really works in all scenarios. Is there a way for jQuery to determine if a ...
13
votes
5answers
210 views
When a child element overflows horizontally, why is the right padding of the parent ignored?
Given this simple structure:
<div id="parent">
<div id="child">Lorem ipsum</div>
</div>
with this CSS:
#parent {
width: 200px;
height: 200px;
padding: 20px;
...
11
votes
2answers
1k views
scala mailbox size limit
Can I set maximum size for an actor's mailbox in Scala?
Take the Producer-Consumer problem for example. If I'm using threads I can block producers when the buffer fills up. I saw a couple of ...
8
votes
4answers
3k views
How do I stop internet explorer's propriety gradient filter from cutting off content that should overflow?
I'm using the internet explorer gradient filter in my CSS.
It was all going well until I noticed that images that are supposed to extend beyond their containers overflow:visible; are getting clipped ...
4
votes
1answer
3k views
CSS overflow-y:visible, overflow-x:scroll
I've seen a few questions like this in my search, but either the question didn't get answered properly or no answer was given. So, I'll ask again.
<style>
.parent { overflow-y:scroll; ...
7
votes
4answers
2k views
Checking for underflow/overflow in C++?
Is there a general way to check for an overflow or an underflow of a given data type (uint32, int etc.)?
I am doing something like this:
uint32 a,b,c;
... //initialize a,b,c
if(b < c) {
a -= ...
2
votes
7answers
2k views
Stack overflow C++
This is my code. When I access dtr array in initImg function it gives a stack overflow exception. What might be the reason?
#define W 1000
#define H 1000
#define MAX 100000
void initImg(int img[], ...
2
votes
2answers
858 views
Overflowing a container div horizontally but not vertically
I'm working on a website that uses two columns inside a container. The container has a white background that should stretch to the bottom of whichever column is highest, so I'm using the holy grail ...
1
vote
2answers
3k views
How to limit a table cell to one line of text using CSS?
I have a table of users where each row contains their names, e-mail address, and such. For some users this row is one text line high, for some others two, etc. But I would like that each row of the ...
1
vote
2answers
487 views
overflow: auto in IE7 leaves room for the scrollbar when resizing
Because a customer requested it, I've changed a div to
position: absolute;
top: 5px;
bottom: 5px;
overflow: auto;
min-width: 945px;
which basically works fine in all supported browsers (IE7, IE8, ...
0
votes
6answers
649 views
memcpy overflow boundary exploit? (smashing the stack)
I'm trying to figure out if this could somehow be overflowed:
void print_address(char *p)
{
arp_ hw;
int i;
hw.length = (size) *(p + _OFFSET1); //189 + 4 = 193
memcpy(hw.addr, packet + ...
69
votes
8answers
9k views
CSS: Truncate table cells, but fit as much as possible
Meet Fred. He's a table:
<table border="1" style="width: 100%;">
<tr>
<td>This cells has more content</td>
<td>Less content here</td>
...
34
votes
4answers
17k views
CSS: How to have position:absolute div inside a position:relative div not be cropped by an overflow:hidden on a container
I have 3 levels of div:
(In green below) A top level div with overflow: hidden. This is because I want some content (not shown here) inside that box to cropped if it exceeds the size of the box.
(In ...
12
votes
3answers
1k views
Issue with scrolling in iOS 5 using -webkit-overflow-scrolling
I have an HTML page with a fixed-height div which should be scrollable (only vertically). In iOS 5 this can be achieved using:
overflow-y: auto;
-webkit-overflow-scrolling: touch;
The div contains ...
5
votes
10answers
1k views
Programmatically determining max value of a signed integer type
This related question is about determining the max value of a signed type at compile-time:
C question: off_t (and other signed integer types) minimum and maximum values
However, I've since realized ...
5
votes
3answers
7k views
android webview iframe overflow
I'm currently building a web app in android. My app runs in a webview, and loads third-party contents through iframes. The iframe size is fixed and supposed not to be changed by the content loaded. In ...
9
votes
3answers
2k views
Internet Explorer CSS property “filter” ignores overflow:visible
Apparently Internet Explorer (up to version 8 at least) ignores overflow:visible when applying filter (e.g. for opacity), causing anything outside the filtered element to be clipped as if ...
6
votes
4answers
275 views
The Impossible Layout?
I'm beginning to think this is impossible, but thought I'd ask you guys.
Basically it's a 2 column layout, but the "business" wants the following:
-Always take up the entire browser window
...
0
votes
2answers
83 views
Properties on CSS overflow
I have 2 questions or rather clarifications I need related to CSS overflow property..It is said that
Boxes with an overflow value other than visible will expand vertically
to enclose any floated ...
13
votes
2answers
11k views
Limit text length to n lines using CSS
Is it possible to limit a text length to "n" lines using CSS (or cut it when overflows vertically).
text-overflow: ellipsis; only works for 1 line text.
original text:
Ultrices natoque mus ...
13
votes
5answers
6k views
Overflow to left instead of right
I have a div with overflow:hidden, inside which I show a phone number as the user types it. The text inside the div is aligned to right and incoming characters are added to right as the text grows to ...
10
votes
3answers
379 views
Type of integer literals not int by default?
I just answered this question, which asked why iterating until 10 billion in a for loop takes so much longer (the OP actually aborted it after 10 mins) than iterating until 1 billion:
for (i = 0; i ...
8
votes
9answers
749 views
Unsigned int reverse iteration with for loops
I want the iterator variable in a for loop to reverse iterate to 0 as an unsigned int, and I cannot think of a similar comparison to i > -1, as you would do if it was a signed int.
for (unsigned ...
5
votes
1answer
416 views
What happens when HashMap or HashSet maximum capacity is reached?
Just a few minutes back I answered a question asking about the "Maximum possible size of HashMap in Java". As I have always read, HashMap is a growable data-structure. It's size is only limited by the ...