Oracle turns Java into malware!

Oooh the shame. That I ever had to see this day. It’s sad, sad indeed.

Oracle is now officially EVIL!

Oracle has turned Java into malware, by installing addware such as browser toolbars and search providers, without explanation or asking for permission, as part of *critical* Java security updates.

We don't ask for your permission to install that nasty browser toolbar of ours, we just install it!

My girlfriend suddenly noticed that the Ask.com toolbar was installed on her machine. And today I found out why. Installing the latest update to Java (which is basically a MUST as it fixes critical security vulnerabilities) will, if you don’t pay close attention, also install nasty browser toolbars and search providers. Even if you had originally declined those pesky things, Oracle’s Java Installer will keep offering to install them, for *every* single (security) update, averaging about once each month or two. Until you finally forget to decline or give up on Java altogether.

Read more about it on ZDnet.

Active/Passive 3D Myth Revisited

About a month ago I wrote a post on this blog about what I like to refer to as the Passive 3D myth which states that

Passive 3D systems offer inferior resolution when compared to Active 3D because each eye only gets to see half of the image lines on the screen.

That post has received some good and insightful comments that made me rethink my position… and come to the exact same conclusion that the statement above is indeed a myth.

The comments did give a very good insight into where the source of the confusion lies when discussing this so I decided to revisit this subject with a more detailed explanation of why I think the statement is a myth and why the refresh rate of the television or the frame rate of the source material are largely irrelevant to the discussion of the merit of this statement.

Active glasses (back) shut out each eye in turn, passive glasses (front) filter the light

First, let us get some background on the subject and get our terminology straight as this turned out to be one of the major sources of confusion. Yours truly was not the least to blame as I myself succeeded in hopelessly mixing up terminology.

Active vs Passive
The challenge for any 3D system is delivering different pictures to each eye. Both active and passive 3D systems use glasses to achieve this but there is a fundamental difference. Active 3D glasses shut out each eye alternatingly whereas passive 3D glasses filter out the wrong picture, letting only the right one pass through to the eye.

Resolution
This is of course an important point to address as this term is used in the myth. Resolution actually means a lot of things and the definition of the term in Merriam-Webster’s free dictionary is a long page listing 6 different meanings some of which even have different variations. For this discussion we will be using this one:

6b. a measure of the sharpness of an image [..]

It is interesting to note that Merriam-Webster is not mentioning the use of the term resolution in discussions about audio though it obviously is used there a lot.

Spatial vs Temporal Resolution
In video, a whole sequence of images displayed in turn creates the illusion of movement. It is clear that both the spatial or angular resolution of the individual image frames as well as the temporal resolution of the image stream in time, the framerate, play a big role in perceived video quality. In 3D another factor is added, as the different images perceived by both eyes are blended in the brain to form a 3D video.

Progressive vs Interlaced
These terms originate from traditional CRT televisions and analog broadcasting systems. Basically when a picture is built progressively, the cathode ray in the television would start at one corner of the image and then beam the image, pixel by pixel, one line after the other until the full image was drawn, then start all over again for the next picture. In the beginning this could cause issues where the corner in the screen where the pixels were drawn first was already fading by the time the cathode ray gun would reach the last pixels of the image, giving a flickering, shimmering kind of effect. They came up with a way to counter this called interlacing. With interlacing the gun first scans all the even lines, reaching the other corner of the image twice as fast, and then would scan the odd lines of the image in the second pass. This was a very effective way to counter the shimmering effect back in the days of early CRT televisions and it has stayed with us ever since.

Framerate
This term refers to the rate at which different still video frames are shown to create the illusion of movement, usually measured in frames per second, or fps for short. Generally this term is applicable to the media source, e.g. a film or video game.

Film has traditionally been shot at 24 fps. This is also often called 24p. So in a traditional 2D film strip, one second of film consists of 24 video still frames, as shown below.


In a 24p 3D film, there are 2 times 24 images. For every moment in the film there is a still frame for the left eye (green) and one for the right eye (red).


Currently some film makers are experimenting with higher frame rates for their films. Both 48p and 60p frame rates are good candidates for future film standards. Below is that same second of 3D film, shot at 48p or 60p respectively.


Interesting as this subject may be, I will show that it is irrelevant to the discussion of whether the myth is true or not.

Refresh rate
Related to but distinct from the frame rate is the refresh rate. Where the frame rate is tied to the source material (i.e. the film you are watching), the refresh rate is related to the display technology (i.e the TV you are watching it on). We usually measure refresh rates in hz.

Traditionally televisions would have refresh rates of 60 hz (or 50 hz in Europe) but recently they more often than not have higher frequencies of 120 or even 240 hz. Again I will show that this is mostly irrelevant to this discussion.

Fields vs Frames
A television with a refresh rate of 60hz in interlaced mode renders only half frames, either the even or the odd scanlines. So we call what is rendered each pass a field. Two fields make up one frame.

Modern televisions don’t have a cathode ray gun anymore so the whole principle of interlacing is largely irrelevant for them, but when it comes to 3D it is making a reappearance in a new form in passive 3D television systems. So even though the term field from traditional interlacing isn’t directly applicable to modern televisions, it could be convenient to use it for the image that is rendered by the television each pass in it’s refresh cycle, to keep it distinct from the term frames which we will reserve for the source material.

Motion Interpolation
This is the technique of generating in-between frames to bridge the gap between the relatively low frame rate of the source material and the potentially much higher refresh frequency of the display technology. As this topic can make an already difficult discussion even more confusing and I think it is also irrelevant to this discussion I will largely ignore it.

Busting the myth
To bust the myth I would like to present an example. A single frame of a 60p 3D movie displayed on a 240hz 3D television, comparing active and passive display systems side by side. As we are talking about 3D, a single frame of film actually consists of two images; one for the left eye and one for the right. I’ll color these red and green as we have done in the pictures shown before. Now when displaying 60 fps source material on a 240hz screen, every field would repeat the same frame four times. The way these are repeated differs in active and passive systems. Have a look at the diagram below:

The colored pixels are showing the image and the black pixels are ‘blocked’ or ‘blacked out’. On the left we see active 3D. Here alternatingly the left and right eyes are shown a picture and a black field. On the right we see two ways of doing passive 3D, either alternating horizontal lines or a checkerboard pattern. Columns are not a good choice as in 3D the two camera’s are only at different positions on the horizontal axis (they are next to each other) but not on the vertical axis (they are at the same height) so the images are vertically much more alike than horizontally.

As you can clearly see with both the passive technologies your left and right eyes combined get exactly the same amount of displayed pixels (as opposed to blocked or blacked out ones) as with active 3D. But the patterns on the right are much more regular than the alternating pattern on the left, which should result in a much more stable, flicker-free picture. Remember, this is a single frame of 3D video, consisting of two images, one for each eye.

In passive 3D, because only half the scanlines of the screen are designated for each eye it is hard to maintain that each eye would get the full spatial resolution compared to 2D. In active 3D each eye gets a full image, however only half of the time. This time it’s hard to maintain each eye gets the full temporal resolution compared to 2D. In both cases, resolution is halved for each individual eye, just over a different dimension.

Now even though resolution is halved in both systems, one could maintain that passive systems discard half of the information in each frame because it only displays half of the scanlines of each image. That is where 3D interlacing comes in. In 3D interlacing a similar technique is used as in traditional interlacing where first all even scanlines are shown and then all odd scanlines, but in the case of 3D interlacing the scanlines shown in the second pass are drawn in the same position as the ones in the first pass. If we were to apply 3D interlacing to the left image of a single frame from a 60p movie with line based passive 3D like we showed in the example above, the four fields rendered for that single frame would look like this:


In the full frame, on the left of the arrow, we colored the even and odd lines in a different shade of green to be able to distinguish between them. We can see in the four fields on the right that alternatively the even and odd lines are shown, albeit always at the position of the even lines. The brain does receive the extra detail from the odd lines but has to do some work to reconstitute the original frame.

LG is one of the companies pioneering this 3D interlacing technique and they recently received certification that their technique delivers Full HD in 3D by VDE, a german certification company.

Active vs passive 3D in practice
So far for the theory, but how does this work in practice? Which technology really does give most detail and which is most comfortable to look at? For a good comparison of both technologies Displaymate did some hands-on tests with four different televisions, two active and two passive systems. They are strong in their opinion that the myth is busted:

[..] small text (6 to 10 pixels in height) was readable on the FPR Passive Glasses, which definitively establishes that there is excellent 3D Image Fusion and the Passive Glasses deliver full 1080p resolution in 3D. Again, if the Passive Glasses only delivered half the resolution, as some claim, then it would have been impossible to read the small text on the FPR TVs. So those half resolution claims are manifestly wrong – no, ands ifs or buts!

So there you have it. Theory, practice and certification offices all agree: Passive 3D does not halve resolution compared to active 3D. Please share your thoughts on this subject in the comments below.

Eclipse’s Import project from Git wizard’s finish button does nothing

If you want to import a project from GitHub or Heroku into Eclipse, you can use the Git import wizard found under:

Eclipse menu: File -> Import -> Git / Projects from Git

However for me, the wizard would refuse to finish. There was no error dialog, nothing just happened when I pressed Finish. When something like this happens in Eclipse, you should check the error log. You can open it’s view from:

Eclipse menu: Window -> Show View -> Error Log

When I pressed finish, this log entry appeared:

Unhandled event loop exception

java.lang.NullPointerException
. at org.eclipse.egit.core.securestorage.EGitSecureStore.calcNodePath(EGitSecureStore.java:86)
. at org.eclipse.egit.core.securestorage.EGitSecureStore.putCredentials(EGitSecureStore.java:55)
. at org.eclipse.egit.ui.internal.SecureStoreUtils.storeCredentials(SecureStoreUtils.java:36)
. at org.eclipse.egit.ui.internal.clone.GitCloneWizard.performFinish(GitCloneWizard.java:197)
. ...
. at org.eclipse.equinox.launcher.Main.run(Main.java:1410)

The stack trace provides a clue: GitCloneWizard.performFinish is invoking SecureStoreUtils.storeCredentials… This is actually an option represented by a checkbox in the wizard. On the bottom of the Clone Git Repository page of the wizard, below the User and Password fields, there is a checkbox marked ‘Store in Secure Store’. This checkbox is checked by default.

Eclipse import Git project wizard - Clone Git Repository page

Now when using SSH with pulic and private RSA keys, you can encrypt the private key with a password (as added security) and Eclipse will pop up a dialog asking for it. It will then remember this password in the secure store if you checked the option for that. However, securing your private key is optional and I did not use it. No password was needed for my key so Eclipse never asked for it. But this stacktrace shows that it is still trying to store it. The secure store seems to not expect this as it chokes on the null password with a NullPointerException …which brings us to:

The workaround

If you use a private SSH key that is not protected by a password, just uncheck the ‘Store in Secure Store’ checkbox to prevent this issue and the wizard should finish successfully as it did for me.

I reported this bug to Eclipse: BUG 372485.

Heroku.bat giving ‘The system cannot find the path specified’ on Windows Vista 64-bit

UPDATE: This issue has been fixed now!

So today I created an account on Heroku and downloaded the Heroku Toolbelt for Windows. The installer seemed to work very well but on attempting to run the heroku command I got an error message:

C:\>heroku
The system cannot find the path specified.

After some digging around I found out that this is a problem in the batch file Heroku uses to start Ruby, heroku.bat. This batch file is trying to determine the path to Ruby but for some reason is failing on Windows Vista. I managed to get it to work by adding two lines that solve the issue on Vista and (I think) won’t break other systems (Windows 7). Here is the fragment that I changed, with the lines I added marked:

:: determine if this is x86 or x64
if "%processor_architecture%" == "IA64" goto x64
if "%processor_architecture%" == "AMD64" goto x64

if "%ProgramFiles%" == "%ProgramW6432%" goto x64
goto x86

This fix works because currently there are two 64-bit architectures, IA64 (Intel) and AMD64 (AMD) and the two lines I added directly detect those architectures and swith to the correct code branch if found. So if you have this same issue, just open heroku.bat (in C:\Program Files (x86)\heroku\bin usually) and add the highlighted lines in the correct position. I’ll see if I can submit this solution to the Heroku team.

The cause of the issue seems to be that the ProgramW6432 environment variable is apparently not always set (at least it’s not set on my system) so alternatively, you can set that environment variable yourself. Make it point to %ProgramFiles% by setting it in the User environment variables through Start -> Control Panel -> System -> Advanced system settings -> Tab 'Advanced' -> Button 'Environment Variables'.

UPDATE
I mentioned this issue on the Heroku Google group and David Dollar picked it up and incorporated it into the Heroku Toolbelt source code. It is probably available in the latest release by now. Thanks David!

Active vs Passive 3D Myth

UPDATE: I revisited this subject because the comments on this post made it clear there was still a lot of confusion on this topic. Read the clearer explanation here.

I’m interested in 3D technology and lately there have been a lot of interesting developments. One of the most promising new 3D technologies for the home is imho the kind of passive 3D technology that LG and others are introducing to their new screens where the screen itself is taking care of delivering the images for the left and right eye to the separate eyes, instead of the glasses. This technology is called passive 3D because the glasses are simple passive polarized lenses, instead of battery powered active shutter glasses.

Active glasses (back) shut out each eye in turn, passive glasses (front) filter the light

But as sometimes seems to happen there is this myth that keeps perpetuating itself that to me seems to be blatantly wrong if you just stop and think about it for a second, but for some reason nobody does that and the myth just gets repeated over and over again. The myth is that:

“Passive 3D offers inferior resolution because the amount of display lines gets halved”

This seems to make sense at first. Only half the pixels is sent to each eye. The other half is reserved for the other eye. So resolution is halved right?

Well yes. Compared to 2D it sure is. But this is always mentioned as a disadvantage of passive 3D when compared to active 3D and I think that is totally misleading. Active 3D *also* halves the resolution, it just does that over a different dimension (time vs space). Active 3D halves the temporal resolution whereas passive 3D halves the spatial resolution. In the end both technologies display 2 frames on the same screen that would show only one frame in 2D mode, so both half the resolution compared to 2D.

Just have a look at the diagram below and I think it will be completely clear that active 3D does not show a single pixel more than passive 3D does. It will also be clear that passive 3D can potentially give a much more stable picture, with less flickering.

Diagram of active vs passive 3D display technologies

For each technology we show 4 frames of 3D animation. The white pixels are showing the image and the black pixels are ‘blocked’ or ‘blacked out’. On the left we see active 3D. Here alternating the left and right eyes are shown a picture and a black frame. On the right we see two ways of doing passive 3D, either alternating horizontal lines or a checkerboard pattern (theoretically columns could be possible too but I haven’t heard of a TV model doing this so I left that out). As you can clearly see with both the passive technologies your left and right eyes combined get exactly the same amount of displayed pixels (as opposed to blocked or blacked out ones) as with active 3D. But the patterns on the right are much more regular than the alternating pattern on the left, which should result in a much more stable, flicker-free picture.

WebKit Overflowed Float Bug

Martijn Traa from Mindcontrolled.nl brought to my attention a bug in WebKit that seems to be related to the WebKit Breaking Float Bug I blogged about earlier.

Scenario
This bug involves a floated block level element containing inline elements. Spans inside a div in this case but it seems this is generic. All inline elements have a margin- or padding-left or -right greater than zero and the first inline elements contains some nested inline elements.

This is the HTML markup for this bug scenario:

<div class="outer">
	<span><b><i>Web</i>Kit</b></span>
	<span>Overflowed</span>
	<span>Float</span
</div>

This is the stylesheet:

.outer {
	float: right;
}

.outer span {
	margin-left: 20px;
}

This is the expected result:

     WebKit   Overflowed   Float

This is the actual result:

     WebKit   Overflowed
     Float

Suggested fix
It seems a number of fixes are possible. The one that should have least impact on the design is floating the inline elements (spans in this case) to the left.

Repro and bug report
I created a demonstration page on my personal web space for this bug. Martijn had already reported it on the WebKit bug tracker.

UPDATE
I just tested my demonstration page with Chrome 26.0.1410.43 m and it is now displaying correctly. From visiting the bug tracker it seems that a related bug was fixed which probably also fixed this one. Great! Reporting bugs helps (even though it can be a long wait)!

Equals operator not symmetric in IE8?

Today I stumbled on the weirdest bug. It seems that the equals operator (==) is not symmetric in IE8.
Meaning that sometimes, even though a == b yields true, b == a will yield false.
I discovered one such scenario when working on my project Packages JS.

Have a look at my test page. Does your browser handle it correctly?
Please leave a comment here with Browser and OS version and test result. I am curious about other browsers and versions.