Error’d: European Edition

I traveled to the UK earlier this month and was greeted by an error screen a day for the first three days of my trip.

Day 1: London Subway Station
Nothing like a 5-foot-tall boot screen to make you feel at home in a foreign country.




Day 2: Cardiff Train Station
Found a Windows BSOD while waiting for the train. And they say Linux dominates the European market!




Day 3: London Bus
Found half-way up the stairs of one of London’s famous double decker public buses.




Bonus: Bed Bath & Beyond
So as not to forget American-based errors, here’s one I came across this morning (live for now). Those without time machines are at a severe disadvantage for this Bed Bath & Beyond rebate offer!


By the way, it was an excellent trip, with or without the BSOD’s following me around Europe!

Review: Marware Accent for iPhone 4

Accent 4 After waiting two months for the Marware Accent Case for the iPhone 4, I was excited when it finally reach my doorstep. I prefer “flip” cases to shell cases for my smart phones since they protect the screen when placed in a pants pocket or a woman’s purse. On top of that, since they are often made out of leather, they provide a nice cushion should the phone be dropped from a few feet. Unfortunately, the Marware Accent 4 for the iPhone 4 suffers a serious defect with regard to the camera flash and was not worth the wait. Read on for the rest of the review.

The Good

Overall, the Accent 4 case design is quite nice. Unlike older iPhone 3 cases that most iPhone 4 owners have been using for the last 2 months, the Accent 4 fits the iPhone 4 perfectly. The mute button and power adapter are fully exposed. The speakers on the bottom are partially exposed with thin mesh netting over them. The volume buttons are cover by a thin sheet of leather with indentations for each button. Finally, the death grip area is completely covered so no need to purchase an iPhone 4 band aid.

The Bad

During the two month wait for the case, I called Marware support a few times, hoping to get a solid delivery date. It was scheduled to be sent out mid July but the Marware customer service representative informed me that there was a problem with the hole for the camera and flash being too small. They said it would be delayed another few weeks while they redesign it. I’m sorry to say, though, that they did not resolve the issue with the camera as the test below demonstrates:

I tried a number of different variations in light rooms, dark rooms, and pitch black rooms, but the results were all the same. As shown in the picture, some of the reflection was off the top of the hole so I tried readjusting the position of the iPhone inside the case but even without the direct bounce, there is always an awful glare/haze covering the picture. All of the pictures I took with the iPhone 4 inside the Accent case came out with a glare similar to the one seen above.

iPhone - Camera/Flash hole

Examining the back, the hole is large enough for the camera and flash to be seen without obstruction but not large enough for the flash to function properly. The flash functions by spreading light outward, and the width of the leather is too large so as to catch the light from the flash, and reflect it back into the lens.

Contacting Marware Support

Having ordered my case through Marware directly, I contacted Marware support about this defect. Despite the numerous revisions, Marware checked with the shipping manager and assured me that I did indeed have the finished product. Unfortunately, as the pictures above show, this product is still quite defective. I have to assume someone just said “close enough” and shipped the product as is. The support representative indicated Marware was not planning another revision at this time, although offered to refund my money. After waiting two months for a case, I’m reluctant to wait another two more.

Marware Support Followup

UPDATE: Marware’s official response on the Accent 4 flash defect:

Hello Scott,

As per our phone conversation today, the case you received is the most recent one. There are no plans for re adjusting the camera hole again at this point. The only suggestion provided to me is that when you use the flash, to push the iPhone up out of the case a little. If you are not comfortable doing that we can either exchange for another case or give you a refund.

I look forward to hearing back from you.

Regards,
Name omitted
Marware Customer Support Team

Despite acknowledging the issue, Marware does not seem to be interested in fixing it. At this time, I cannot recommend purchasing this case as it is clearly defective.

Creating a tar.gz file in Java

Today’s article demonstrates how to create a tar.gz file in a single pass in Java. While there’s number of websites that provide instructions for creating a gzip or tar archive via Java, there aren’t any that will tell you how to make a tar.gz file without performing the same operations twice.

Reviewing Tar and Gzip Compression

First, download the Apache Commons Compression library. It is actually a subset of the code found in the Ant Jar for those performing compression operations that do not require all of Ant’s many features. Below is the code to create a tar and gzip archive, respectively, using the Compression library.

TarArchiveOutputStream out = null;
try {
     out = new TarArchiveOutputStream(
          new BufferedOutputStream(new FileOutputStream("myFile.tar")));
     // Add data to out and flush stream
     ...
} finally {
     if(out != null) out.close();
}
GZIPOutputStream out = null;
try {
     out = new GZIPOutputStream(
          new BufferedOutputStream(new FileOutputStream("myFile.tar")));
     // Add data to out and flush stream
     ...
} finally {
     if(out != null) out.close();
}

One subtlety in this example is that we use a BufferedOutputStream on the file stream for performance reasons. Often, archive files are large so that buffering the output is desirable. Another good practice is to always close your resources in a finally block after you are done with them.

The Solution

The solution is to wrap the tar stream around a gzip stream, since the order of writing goes inward from outer most to inner most stream. The code below first creates a tar archive, then compresses it inside a gzip stream. Buffering is applied and the result is written to disk.

TarArchiveOutputStream out = null;
try {
     out = new TarArchiveOutputStream(
          new GZIPOutputStream(
               new BufferedOutputStream(new FileOutputStream("myFile.tar.gz"))));
     // Add data to out and flush stream
     ...
} finally {
     if(out != null) out.close();
}

You can then treat the stream as a tar file using the TarArchiveEntry API to add entries and write data directly to the stream. The gzip compression will happen automatically as the stream is written.