JpegDeux updated for OSX 10.8

April 14th, 2013

JPEGDeux logo
It’s been a long time since I’ve wanted to show a simple photo slideshow on OSX. Back in the day I feel like i had to do this more often. I remembered that I used to either use Graphic Converter or a simpler program called JPEGDeux.

I had to do a photo slideshow today, so I went to download one of these programs to do it. Graphic Converter was a 150MB download and I was on LTE so it wasn’t downloading quick enough. JPEGDeux, unfortunately, downloaded but wouldn’t work on my version of OSX. In fact it looks like they only have binaries for PPC versions of OSX less than 10.3.

JPEGDeux logo
Well, I had to fix this. I downloaded the source for JPEGDeux and spent the afternoon updating it and getting it to compile again. It used an old XCode project format and a lot of out-dated carbon APIs that aren’t supported anymore. After more time than I hoped I would have spent, it is now working again. I disabled the Quicktime option because that would have required re-writing large amounts of code to work with CoreImage, but it works just fine without the Quicktime option on modern hardware.

I uploaded the code to GitHub because Sourceforge makes me sad.

Please report any issues you have running this. I have only tried it on my mac so far. And if you have the means, please fork and help out with the code.

Files

 Download a compiled Binary
Download source at Github

Parsing Appleworks and Clarisworks file formats

January 17th, 2013

Over the past few years, when I have downtime, I sometimes like to reverse engineer abandoned file formats. It is kind of like working on a crossword puzzle with the bonus that any progress you make helps people out there who are trying to archive, index, or convert their old files.

output of hex fiend comparing two files

I’ve spent a lot of time trying to figure out file format for Appleworks and Clarisworks. My latest efforts have been to take a file, make a small change, then use Hex Fiend to compare what has changed in the binary format.

After years of off and on tinkering and documenting I finally wrote a basic parser for Appleworks and Clarisworks word processor files. I ‘believe’ this is the first free and open parser for this file format, even if it is ten years too late. I figured out a lot about the format, but it still has a long way to go. You can view my current documenting status here and download source for the parser on GitHub.

The parser so far can read:

  • document version
  • page size
  • margins
  • document content

output of parse

From what I have seen, most people trying to read Appleworks documents only really care about the document content, but I am very close to figuring out how to parse:

  • styles – (bold, italic, underline)
  • footnotes

I may not touch it again for another year, but who knows.

 Link to file format research

 Download source code at GitHub

Normalizing faces with OpenCV

January 8th, 2013

One of the things that comes up when doing facial recognition is that you have to build a profile for each face being recognized. If we simply use a cascade to detect the face and then throw it into the profile set things usually work, but I have found that you get much better results by normalizing the faces as much as possible before processing.

I have been playing with is attempting to correct for face rotation by detecting the eyes and then rotating and zooming the face so the eyes always appear at as close to the same place in the training image as possible.

This example uses OpenCV. It uses one haar cascade to detect the face then uses two more cascades to detect the two eyes. It averages all of the eye detection results which will “often” give you an estimate of where the pupil is. Once you have that the rotating and scaling is pretty easy.

This technique only works really well on head-on faces with a rotation of less than 15 degrees in either direction. It could probably be expanded to rotate the image while doing the eye detection to get a better angle range but faces rotated more than 15 degrees is somewhat rare.

Here are some examples of this normalization:

 Download source code at GitHub

(this code is very sloppy, sorry)

Haar cascade logo detection

November 8th, 2011

This is a proof of concept I did for a client earlier in the year for detecting a logo in a live video feed. We trained a haar cascade with about 100 shots of a coke can and it was able to pretty accurately track the logo in the vertical position. With more compute power and more training images we could get it to track even tighter and in more lighting conditions.

This demo was done entirely in OpenCV but later in the project were able to port it to ActionScript to work in a browser with a user’s webcam.

Command line file organization on OSX and Linux

May 7th, 2010

Some quick CLI commands I use all the time but forget the exact syntax for.

Find all files that have been modified in the past 7 days

find . -mtime -7

Find all JPEGs that have been modified more than 30 days ago

find . -name \*.jpg -mtime +30

Move all JPEGs from the current folder (recursively) that are greater than 40k into the folder /tmp/2

mv `find ./ -name \*.jpg -size +40k` /tmp/2

Tell me info about files in the current folder

file `ls`

Tell me info about all of the mp3 files in this folder

find . -name \*.mp3 -exec file '{}' \;

Clean subversion metadata out of a directory

find . -name .svn -type d -exec rm -r '{}' \;

Use the above to make an export of a working copy by doing:

cp -R ./working_copy ./working_copy_export
find ./working_copy_export -name .svn -type d -exec rm -r '{}' \;

Any command that is deleting files will prompt you for each file. to go through them all without prompts, just run the command as root

sudo find ./working_copy_export -name .svn -type d -exec rm -r '{}' \;

Well here’s an email that sucks to get

April 13th, 2010

You are receiving this email because you have a login, ‘terrencecurran’, on the Apache JIRA installation, https://issues.apache.org/jira/

On April 6 the issues.apache.org server was hacked. The attackers were able to install a trojan JIRA login screen and later get full root access:

https://blogs.apache.org/infra/entry/apache_org_04_09_2010

We are assuming that the attackers have a copy of the JIRA database, which includes a hash (SHA-512 unsalted) of the password
you set when signing up as ‘terrencecurran’ to JIRA. If the password you set was not of great quality (eg. based on a dictionary word), it
should be assumed that the attackers can guess your password from the password hash via brute force.

The upshot is that someone malicious may know both your email address and a password of yours.

This is a problem because many people reuse passwords across online services. If you reuse passwords across systems, we urge you to change
your passwords on ALL SYSTEMS that might be using the compromised JIRA password. Prime examples might be gmail or hotmail accounts, online
banking sites, or sites known to be related to your email’s domain, approachingpi.com.

Naturally we would also like you to reset your JIRA password. That can be done at:

https://issues.apache.org/jira/secure/ForgotPassword!default.jspa?username=terrencecurran

We (the Apache JIRA administrators) sincerely apologize for this security breach. If you have any questions, please let us know by email.
We are also available on the #asfinfra IRC channel on irc.freenode.net.

Regards,

The Apache Infrastructure Team

I can’t remember my password! doh!

The best Chrome feature: violation of Apple Human Interface

March 25th, 2010

Google Chrome is awesome. There don’t seem to be many people out there that will argue otherwise.

One of the things I like best about it is that they seem to willing to do whatever it takes to make the best user experience out of their product. They aren’t worried about the politics or competing interests that seem to plague progress on Firefox.

In my opinion, one of the best feature of Google Chrome on OSX is that it violates the Apple Human Interface Guidelines.

Apple has very strict interface guidelines that developers by and large tend to stick to. Partially because of Interface Builder, partially because of the community, applications on OSX tend to look and behave the same. This is in contrast to Windows where Microsoft can’t seem to settle for a single Widget toolkit for their own applications. So the guidelines are great, except when they are not.

Tabs in the title bar

The most obvious violation is related to tabs in the title bar of the UI.

from the guidelines:

The only controls that belong in a title bar are the close, minimize, and zoom buttons. If a title bar is combined with a toolbar, the unified area can contain the toolbar control and the toolbar customization contextual menu (these controls are described in “Title Bar Buttons”). Do not place other controls in a title bar.

This is in some ways just a nicety, but it is a new way to think about how to group information. It separates the tabs and makes it much more clear to a user that the back, forward, and URL controls are specific to the content in that tab. This also has the added benefit of making it possible for windows to be dropped into other windows to be merged or split.

Control focus when tabbing on the keyboard

According to the guidelines, controls should only receive focus if they are text entry fields. This means that hitting tab on a form will always tab over a drop down box.

from the guidelines

In default keyboard access mode, focus moves only between fields that receive keyboard input.

Anybody that has entered an address on a website knows what a pain in the ass it is when it tabs right past the state drop down field.

Apple suggests that application designers avoid this problem by limiting popup menus to be used only when you have short lists of items.
from the guidelines:

Use a pop-up menu to present up to 12 mutually exclusive choices that the user doesn’t need to see all the time. Sometimes a pop-up menu can be a good alternative to other types of selection controls.

Good in theory, but this isn’t how popups are used. Not in applications, and especially not on the web. Chrome tabs to select boxes on OSX like it does on other platforms. Google has decided that the web is their operating system and is using the same UX design across platforms accordingly. Perhaps it is time for companies to come together and come up with some cross-OS UX behaviors.

*This is actually one of my biggest pet peeves with the apple UI guidelines. They were set in stone many years ago and very rarely change. I understand the need for consistency but I think things like tabbing to all controls on a web-page need to be addressed. Perhaps they are long overdue for a review and overhaul. Apple, after all, is notorious for violating their own guidelines.

Java keystore cert import on OSX Leopard

March 17th, 2010

This morning I needed to connect IDE (IntelliJ Idea) to a FishEye/Jira server that had a self signed security certificate. Since IntelliJ (or at least the Atlassian plugin) uses Java to connect to https, it fails because of the JVM’s strict security checking.

Normally when this happens, it is just a matter of installing the certificate into the JVM keystore. There is an article and code that does this for you here. This blog post even has a nice bash wrapper that will download and compile this code for you on OSX.

When I tried to do this today, I got this error every time I tried to run this tool:

java.security.UnrecoverableKeyException: Password verification failed

After a lot of digging on google. I finally found the problem.

On Java for OSX 10.6 u1 and 10.5 u6, Apple changed the default keystore password from ‘changeit’ to ‘changeme’.

Such a trivial change, but annoying because changeit had been the Sun default forever. There is a funny post on the Apple Java mailing list where an engineer at Apple apologized and just sort of said they didn’t think it would be a big deal for anyone.

This post from Matt Fleming, has some more info as well as how to change the keystore password if you decide you don’t like this change:

sudo keytool -storepasswd -new changeit -keystore /Library/Java/Home/lib/security/cacerts -storepass changeme

IE Javascript not working

January 29th, 2010

I had some javascript that I couldn’t get to run in IE. It was driving me nuts. I spent a few hours slowly reading every line to make sure there were no stray commas or anything else IE doesn’t like.

After two wasted hours, I went to twitter.com, and it kindly informed me that javascript was disabled.

Except it wasn’t.

Another half an hour of google searching and I find out that I need to re-register the javascript dll.

Run this command from the start menu or command dialog if this happens to you:
regsvr32.exe jscript.dll

Windows is so dumb.

My First Domain name

January 13th, 2010

The very first domain name I ever bought was tacoland.com. I accidentally let it expire and it was registered within days by a link farm company and then later sold to BuyDomains. man I hated them so much. Five years later I did some work for BuyDomains. I probably could have gotten it back cheaply, but I realized it was a stupid site anyway.

A few weeks after tacoland, I registered GrilledCheese.com, a site I still like but haven’t updated in like 9 years. Ah well.