(Un)Iconify a frame in griffon

Doing some Griffon stuff, been a little while… Wanting to show/hide my application from the icon state. Probably easier to figure out if I was already proficient with Swing, but … As it turned out, the only tricky part was figuring out how to reference the main frame, but even that was a duh…

 in the view
  main = application(title: ‘Demo’)
mostly, a duh there…
And then, in the controller, put the logic to check and decide to show or hide the frame
import java.awt.Frame
if (show) {
  execInsideUISync {view.main.setState(Frame.NORMAL)}
} else {
  execInsideUISync {view.main.setState(Frame.ICONIFIED)}
}
Using execInsideUISync to get on the UI thread.

Great external HDD solution

I have a few external USB drives and needed a new one and was looking either to upgrade the capacity of one of the drives or buy a new unit. I wanted at least a 500GB drive whose sole purpose would be a Time Machine backup drive hanging off my Mac. I have an existing 500GB unit, at the time the cheapest I could find, but it recently died (you get what you pay for!). So, temporarily, I started using an older 250GB drive. But that was filling up; considering I need 200+ MB for backup and Time Machine was starting to delete the older weekly backups.

Was considering one of the Drobo units, to take advantage of increasingly cheaper HDD, but didn’t really need the ultimate flexibility, and didn’t want the price either. To not make that decision, I was going to settle for a cheap enclosure/ATA drive. But, while doing my normal surf habit, I saw a reference to Thermaltake BlacX Docking Station and did some research on it. Basically a toaster like unit to swap SATA drives, both 3.5 and 2.5 units. Everything looked good and I started shopping. Found it on Newegg for $37 and picked out a nice (well-reviewed) 750GB SATA drive for $59. Great solution for < $100!

Now, I’ll continue to look for SATA deals and I’m all set to roll over to a new Time Machine backup, or swap in a drive temporarily to copy to/from archives, etc..

Up and running in no time. Flawless.

BTW… Time Machine is a great app… I know, I know, it is just a backup and lots of other solutions out there, but the fact that it comes as part of Max OS X, and extremely simple to plug in a drive and go is tremendous.. Already saved my bacon after my main drive failed. After the drive was replaced, I was up and running after a simple restore from Time Machine — didn’t lose a thing. Actually, in this case, the drive was not completely shot — it wouldn’t boot but I was able to inspect via DiskWarrior (another great tool) and actually made emergency backup from there before I took in for repairs, but ultimately used the restore from Time Machine

Magento api with Java Client — problem with XML-RPC interface

One of the features touted by Magento is the api exposed via both XML-RPC and SOAP. I quickly (and successfully) tested the SOAP interface using the amazingly complete (and free) soapUI. I wanted to use XML-RPC, and decided to build a test client in Java. While trying to build a client, using the apache ws-xmlrpc library, I ran into a roadblock. The initial login and some other calls would work just fine, but some calls such as product.info would always cause an exception, similar to:

Exception in thread "main" org.apache.xmlrpc.client.XmlRpcClientException:
Failed to parse servers response: Unknown type: nil

I posted on the magento forum to no success (except to find a few others with the same problem). So I was on my own..

After some research, I determined that the problem (IMHO) is that the Magento api is incorrectly using the nil type in responses. According to the XML-RPC spec, nil is an extended type, and can only be used with a namespace (e.g. ex:nil) — see the data types section on the apache site. But, luckily, the ws-xmlrpc library can be easily extended to provide a work around, and the following solution worked for me.

Continue reading

Playing with Magento

One of my side interests is eCommerce, primarily for building stores, and even more so from the programming side… I’m not really sure why, but it is an area that has always intrigued me… And recently, lucky enough to have the chance to “play” with it while working on some side projects. We were looking at osCommerce for a while, but eventually decided to focus on Magento. Both freeware, php-based platforms, but in the end, Magento had fewer warts.