Wednesday, July 22, 2009

I Heart Automator

Every time I wish there were some way I can automate something in OSX, I find out there is a way, through the nifty scripting utility Automator.

I had a particular problem I wanted to solve, which was to add spotlight comments to multiple items. This way I can do dynamic searching of files based on keywords instead of creating an entire folder hierarchy and having to drill down to get to a specified file.


And here's my Automator plugin in action, accessible right from the finder menu. Slick!



Friday, May 8, 2009

MySQL Auto Data Conversion

So I've been researching MySQL, and I have run into something that kinda boggles my mind. Whenever you give MySQL the wrong datatype for a field, MySQL attempts to do autoconversion of your data. This in itself isn't a bad thing, and some of them may make sense, such as doing string to int or int to string. However, if you pass MySQL data that it is out of bounds, MySQL chooses data that is in bounds, and places that data in the field instead. So if you have a field defined as a tinyint, whose bounds are -127 to 127, and you pass it 1,000, MySQL will input 127, and consider it a success. 

You have to write your own MySQL specific data validation in your application BEFORE you pass it to MySQL..... Say it with me..... WHAT??? The whole idea with abstraction and error catching is that each layer of your software stack should be able to pass "something" to another layer and receive back success or failure, at which point the originating layer can decide how to handle it. By having your application layer have to do database validation checks BEFORE passing data to MySQL, you loose the benefits of abstraction, and by definition, you loose the benefits of modern software engineering. 

Somebody out there explain to my how MySQL's handling of out of bounds data is a good idea, cause I don't get it.

Keynote 2008

So I've just done my first presentation with Keynote 2008, and color me impressed. When you compare iWork vs MS Office, I consider Excel better than Numbers, and Word better than Pages. Keynote however, is far better than Powerpoint. Both programs have a practically identical purpose and workflow, but where Keynote excels is in the quality of the default templates, animations, and graphics. Basically those things that taken separately, don't matter much, but taken as a whole, it makes Keynote the superior presentation building application.

I wonder if OSX 10.5.7 will be included in Mac Box Set Family Pack. If so, I may have to pick that up so that I can iWork 2009, iLife 2009, and OSX 10.5.7

Saturday, March 7, 2009

Automator for OSX

I've begun using a software VPN utility called Hamachi, owned by the guys at logmein (every family IT dude's friend). Alas, there is a slick Windows client, but the OSX one is pure command line. I'm totally fine with that, but I figure "let's see if I can make it all OSeXy". So I created a bash script to execute all the Hamachi commands, and I combined that with some Applescript and OSX's Automator, which is kind of a wysiwig script editor. I could have done it all in bash or Applescript, but I wanted to put my script on the dock and run it from there. Only Automator "executables" can be moved directly to the dock.

Here's a sample from my automator window. Note how cool it looks to have a wysiwig script editor!


So the end result is I have a clickable "thing" on my dock which will start up or quit the OSX Hamachi client. I also added in a Growl notification for fun, which is shown below.

Sunday, January 25, 2009

Evernote

Evernote is one of a long line of notetaking applications, from Microsoft OneNote (which is supposedly pretty good) to Zoho. In my search for a notetaking application to supplement my brain (which has horrible short term memory), I settled on Evernote as the most full featured of the bunch:
  • Has a desktop AND web AND iPhone client
  • For notebooks that are synced to Evernote's servers, free OCR
  • The ability to have synced notebooks (to take advantage of web/iPhone clients and free OCR), or desktop only notebooks (for sensitive info)
  • The ability to add pics, pdf, word, excel, numbers, pages, webpages, or free text to a note
  • quick searchability

The only thing remaining for me is to put my local Evernote notebooks into my truecrypt partition, then I'd be all set