2009:05:12
I’ve been going without Photoshop for about a month now and I have to say, I don’t miss it.
I did have the issue of getting hex color codes from a color picker in Pixelmator. A quick google revealed that the OS X community had a solution. It’s called HexColorPicker and it upgrades the standard color picker in OS X with hex color code support.
Once installed, all applications that use the standard color picker get this nice feature.

2 Comments |
Technology | Tagged: hexcolorpicker, pixelmator, rgb values |
Permalink
Posted by mcoopet
2009:05:04
Open up terminal and type
say -v "Bad News" Your mother in-law is moving in with you
See a list of available voices here.
Leave a Comment » |
Technology |
Permalink
Posted by mcoopet
2009:03:24
I like using the SWT Browser component for embedded web application functionality in a desktop app. Unfortunately, users can drop whatever they want on the Browser and it will load the dropped item.
Let’s take a look at what I’m talking about
SWT Browser is sweet for displaying various content types like PDF

Not looking so sweet after dropping a URL on it!

Coming up with a fix
My first line of thought was to disable drop handling using a DropTarget and DropTargetListener. Short story – that doesn’t work as of SWT 3.5M6.
Well, you can’t disable drop handling in the Browser component, as the title suggests. It *is possible* to capture location change events and cancel them before they actually change the browser’s location. Since location change events fire when a user drops an item on the Browser component, canceling them achieves the desire effect of disabling drop handling.
Disable Browser Location Change Event
See the code snippet below for a simple solution for preventing the Browser from loading user dropped items.
// Prevent browser from changing to unwanted location
// Assumes you have a Browser reference named 'browser'
browser.addLocationListener(new LocationListener() {
public void changed(LocationEvent event) {
System.out.println("Changed location to " + event.location);
}
public void changing(LocationEvent event) {
System.out.println("Changing location to " + event.location);
event.doit = false; // this cancels the browser location change
}
});
Further Customization
The above example can be tailored to suit your needs. You can put conditions in the ‘changing()’ method to only allow your valid location URLs. To really polish this off, we can add a ‘disabled’ cursor action when the user tries to drop an item on the Browser.
new DropTarget(browser, DND.DROP_NONE);
There! Now the user knows that the drop is invalid and the actual drop will not result in the Browser loading the dropped item.
Leave a Comment » |
Java, SWT, Technology | Tagged: browser, disable drop, Java, SWT |
Permalink
Posted by mcoopet
2009:03:23
TechCrunch.com – Carbonite Loses Customer Data
According to this article, Carbonite lost 7,500 customers’ data. Losing customer data is not a fun spot to be in and I seriously feel for the folks at Carbonite, especially since it was a hardware failure and not related to Carbonite software.
Note – CEO of Carbonite, David Friend points out in a comment below that only 54 customers actually lost data that was unrecoverable.
Before I begin, please be aware of the following -
- I am a partner in a company that makes the backup software CrashPlan
- Carbonite is a competitor to the CrashPlan consumer backup product
- I am going to tout a feature about CrashPlan that prevents this from affecting CrashPlan users
This brings me to the point of this article and a point we’ve been trying to make with CrashPlan since its inception -
Online backup by itself is not enough
Online backup solutions are for the most part very simple to use and get going with. However many of them lack a crucial component to a complete backup solution – multiple backup locations. The premise is that because the solution is online and in the cloud, it is reliable and safe. This couldn’t be farther from the truth. Cloud reliability relies on a number variables -
- Network connectivity – You have to be online to talk to the cloud! In other words, if you are not online, you are not backed up.
- Bandwidth – Bandwidth is the killer for transferring data too and from the cloud. Backup data is often measured in GB if not TB these days. At 10 Mb/s, you are looking at 10 days to download a 1 TB of data.
- Hardware – Ultimately your data is going to be on some storage system, somewhere. Believe it or not, its most likely sitting on the same type of storage that is in your computer – a SATA drive of some sort. Various RAID setups can help make failure of this drive less drastic but the bottom line is that all drives fail at some point.
As of today, online/cloud solutions are facing some serious practical challenges. Will these challenges be overcome in the future? Possibly, but to be safe, one should treat online backup as just a part of a complete backup solution.
You need multiple backup locations
- Your backup is only as good as your backup location.
- Your best bet is to have at least three.
A complete backup solution should provide you a guaranteed restore experience and to have that, you need at least three (3) backup locations -
- Local backup – This hits the 80% sweet spot for your daily backup and restore needs. An external USB drive works beautifully in this capacity as it provides a fast, easy to use backup location.
- Near-line backup – In CrashPlan we call this backing up to your friends and family. Don’t just backup to a cloud, backup to a trusted location that you can access physically and quickly should disaster strike. If that USB drive fails after someone stole your laptop, you can still drive over to a friend’s house and get your data.
- Online backup – Yes, online backup is an important part of the overall solution. In a pinch, you can quickly restore key files, like a term paper or a sales presentation. However, it is less than ideal should you need to restore an entire filesystem.
<start-sales-pitch>
CrashPlan makes backing up to mutiple locations simple. Backup to local drives, your friends computers and/or our online backup service, CrashPlan Central. All of this done in a super efficient, secured manner.
If this sounds like a backup solution for you then try CrashPlan for yourself, its free!
</end-sales-pitch>
2 Comments |
Technology |
Permalink
Posted by mcoopet
2009:03:11
http://www.ucdetector.org/
UCDetector is an Eclipse plugin that lists unused classes/code in a project as warnings in the Problems panel.
I found this plugin to be easy to install and use, however its pretty slow when performing its scan. By default it scans text files (*.xml to be precise, which you can modify) for textual class references so I turned that off to see if it would speed things up. No such luck.
UCDetector also makes recommendations on visibility – i.e. ‘method A’ should be protected instead of public. After using it, I found that I didn’t like its visibility recommendations so I turned them off as well.
Overall, its a nice utility to have when you want to cut the fat out of your code base.
1 Comment |
Java, eclipse | Tagged: eclipse, Java, ucdetector, unused classes |
Permalink
Posted by mcoopet
2009:02:24
Awhile back I wrote the article ‘OS X Command line Image Manipulation‘ which shows how to use the ’sips’ command to rasterize a PDF document into a PNG, JPG or any other image format file.
A reader then asked how to do this with a multi-page PDF document. From what I can tell, its not possible with the ’sips’ command by itself. However, a little poking around on the internet revealed another very useful command-line tool when dealing with PDF documents – ‘pdftk’.
http://www.accesspdf.com/pdftk/index.html
‘pdftk’ is an open source command line tool for manipulating PDF documents. In particular, it can extract the pages of a single PDF document into their own PDF document files.
By using ‘pdftk’ to extract each page into a its own PDF document file, we can now use ’sips’ to convert the files into our desired rasterized image format.
Installing ‘pdftk’
Easiest method is to download it from the web -
http://www.pdfhacks.com/pdftk/OSX-10.3/pdftk1.12_OSX10.3.dmg.gz
Note – I have not tried this version as I found the next method more to my liking…
Mac Ports
If you’re running Mac ports, you can install it via command line
sudo port install pdftk
This can take a *long* time if gcc needs to be built. Just be patient, it’ll finish eventually!
Using ‘pdftk’
Once installed, simply issue the command
pdftk multi-page.pdf burst
where multi-page.pdf contains the pages you want extracted. This will result in each page being written as its own PDF document in your current working directory. The filenames will be ‘pg_000x.pdf’ where x is the page number.
Integrating with ’sips’ at this point is trivial, as you can customize the output file naming scheme of pdftk to whatever you need.
Leave a Comment » |
OS-X, Technology | Tagged: command line, extract, Mac, multi page, OS-X, PDF, pdftk, sips |
Permalink
Posted by mcoopet
2009:02:24
Here are a couple of pictures of the nightly webkit build after having installed Safari 4 Beta -


Notice the Safari 4 top tab browsing and debugging button. Also, the top-sites and ‘cover flow’ history navigation all appear intact as well. I guess Safari is the window dressing to Webkit’s browser engine.
It took a few moments to get used to the eye-candy features like top-sites but I am settling into it and definitely like the top tab positioning.
4 Comments |
Mac, OS-X, Safari | Tagged: OS-X, Safari, Webkit |
Permalink
Posted by mcoopet