impossible

The most impossible programming/technical behavior

What is the most impossible/irrational/magic behavior you ever encountered and what was the 'simple' rationale behind it? As an example i give this link to the famous 500-miles problem. ...

javascript user selection highlighting

I'm trying to find a way with javascript to highlight the text the user selects when they click some odd highlight button (as in <span style="background-color:yellow">highlighted text</span>). It only has to work with either WebKit or Firefox, but it seems to be well nigh impossible because it has to work in the following cases: <p>this...

Adding Icon on desktop of iPhone

Hi, I want to place an icon on the iPhone screen form my application, like placing an icon and if i will touch that icon it will do the desired operation, like opening a sound file or an image. So i want to ask is it possible to place an icon on screen through an application and do some events on it. Regards, Vishal ...

Things I cannot do in ASP.NET MVC

Are there some things I cannot do with ASP.NET MVC? Things that are only possible with ASP.NET WebForms, or extremely much easier with WebForms? We consider using ASP.NET MVC for a new project. But I wonder if there are some obvious things we will not be able to do with ASP.NET MVC when compared to WebForms, or places where we will h...

Invert a stack, without using extra data structures?

How would you invert a stack, without using extra data structures, like a second, or temporary, stack. Thus no stack1-stack2 or stack-queue-stack implementation in the answer. You just have access to push/pop feature of a standard stack. I think there is way to do it by keeping a global counter and using pointer manipulation. ...

An impossible problem - fitting a large html table into a small space

The obvious answer to this is "it's not possible" or "make the data smaller"...I have tried these and they don't wash so I need to come up with an alternative There is a table on a web page that has 14 columns in it. 2 of the columns have text in that is quite long (but cannot wrap - the text must be all on one line for each row). Nee...

C++, an "impossible" behavior

If you've been programming for a while then you probably noticed something completely impossible occurs every now and then for which you are convinced there is no possible explanation ("IT'S A COMPILER BUG!!"). After you find out what it was caused by though you are like "oooohhh". Well, it just happened to me :( Here AuthDb is NOT NUL...

Copy-protecting a static library

I will soon be shipping a paid-for static library, and I am wondering if it is possible to build in any form of copy protection to prevent developers copying the library. Ideally, I would like to prevent the library being linked into an executable at all, if (and only if!) the library has been illegitimately copied onto the developer's ...

How to increase java heap size programmatically

I have a java desktop application for searching files and it is usually reaching the default heap limit pretty soon. I wont have access to all the systems it will be installed in so I want to increase the JVM heap size in the application itself. Can anybody help me how can I do that programmatically in my application ...

Can CSS handle this hourglass-like situation ?

I am having a tough time thinking a solution to the following problem. Let me illustrate it first Situation I have 26 items (in this example, in general the number is not known..) but only 12 can be visible at one time.. I also have some navigation elements (the green boxes) Width of purple and green boxes is fixed but height of purpl...

Algorithm for approximate search in sorted integer list

Hi All, Consider an array of integers (assumed to be sorted); I would like to find the array index of the integer that is closest to a given integer in the fastest possible way. And the case where there are multiple possibilities, the algorithm should identify all. Example: consider T=(3, 5, 24, 65, 67, 87, 129, 147, 166), and if the g...

Can anyone explain this impossible bit of PHP logic?

I'm attempting to debug a simple PHP script. Essentially, there's a variable which is defined with: $variable = ($_GET['variable'] == 'true') ? TRUE : FALSE; Then, in the view file, the following code is meant to display a box if $variable == TRUE: <? if ($variable == true) { ?> <p class="box">You have imported a new plan.</p> <? } ...

Is this in any way usefull if (this != null)?

I came across some tests that included code like this: if (this != null) { do something } Is this if clause of any use? Is there a purpose I don't get that makes this useful? ...