Archive for November, 2007

Pistach.io?

What's Pistach.io?

Hmm... I wonder what this is all about? ;)

It’s official: What people are really searching for is sex, not food, water, or shelter!

Google Trends Gadget verifies Maslow

I downloaded the new Google Gadgets for Mac today (finally, a third party gadget engine does it right -- they integrate with Dashboard so you don't have to have two sets of competing gadget paradigms) and tried out the Trends gadget that lets you compare Google search trends.

To make Maslow proud, I typed in sex, food, water, and shelter. And lo and behold, people are searching for sex online (whodathoughtit, eh?) Although, interestingly, the media appears to be more interested in water! (Water sells?)

Anyway, so Google Gadgets is a mixed bag. Some of the widgets (like the Google Earth widget) would not install and others didn't work properly (the weather widget didn't display it's preference panel, for example. The ones that do, work well though. Integrating it with Dashboard was a stroke of genius. Good one, Google!

3D Papervision count-down timer. On fire! With particles!

3D timer

(Click the movie and press spacebar to restart the counter if you don't see it.)

Seb asked me to make him a countdown timer for his 15 minute talk yesterday. He asked for something simple. So I made one. But wouldn't it be nice if I used Papervision3D to make it 3D? So, with a bit of John's code, it was. But if it's 3D, it should spin. So it did. But these days, 3D isn't 3D unless... it's on fire! So, with Grant's fire component, it was!

That's the version I surprised Seb with before his talk.

This morning though, I thought, it just isn't Flash these days if it doesn't have particles. So I added Seb's particle code to it so that the lighter areas emit sparkles. And I upped the number of planes to five and offset them on the z axis to create a nicer illusion of depth (the original was a single plane but ran well at 30fps, fullscreen on the 800x600 projector).

So I took bits of Seb, John, and Grant, and made a 3D spinning count-down timer... on fire... with particles!

It runs like a dog but hey, it runs. (And if I find out how to extrude a plane in PV3D it will run much faster!)

PS. I set the duration on here to 30 seconds so that you can see it go *poof* at the end. Click on the movie and press spacebar to reset the counter if you see an empty black space as the timer may have run out.

Leopard is tarnishing the reputation of OS X

This year I spoke at about ten international conferences and a couple of other meetings, starting with MacWorld in San Francisco in January. At each event, I kept noticing more and more developers on Macs. So much so that sometimes a sea of luminescent apples would greet me when I looked into the audience. And I've probably done my little bit to nudge quite a number of people onto Macs. Not because I own any stock in Apple (*doh*) but rather because switching from Windows to OS X (Tiger) made me love playing with computers again after 23 years on PCs.

My recent upgrade to Leopard, however, has left me with a sour taste in my mouth and I've started questioning whether Apple is truly committed to OS X and the computing business or whether those will take a back seat now to its mobile and devices business.

I've previously blogged about how difficult the upgrade process was for me (the installer refused to recognize that I had a hard disk in my MacBook Pro until I forced it to see it by saving the EULA on it) and how my keyboard randomly freezes (this happened to me about a dozen times yesterday while hacking out the countdown timer for Seb during the conference). But two things happened yesterday during my presentation that left me thinking that the mistakes that Apple is making with Leopard will ultimately hurt the image of OS X quite a bit.

Firstly, I saw Mike Jones apologize to the audience before starting his presentation that he was running Leopard and that he was sorry if it screwed up (he then went on to recount how horrible his upgrade experience was and how he had to reinstall it from scratch). I also found myself giving the same apology before my talk. If there was anyone in the audience considering an upgrade to Leopard (or buying a computer with Leopard on it), you can rest assured that they probably will not (or will think long and hard before they do).

Secondly, Keynote screwed up. Twice during my talk, it jumped to the last slide. This left me in the awkward position of having to rummage through my slides and restart my presentation. Twice! At first I thought that I had done something wrong -- pressed the wrong button or something (user's always initially blame themselves for errors). However, after my talk, someone in the audience Stephen Pollard came up to me and told me how he had just taught a three-day course and had Keynote do the same thing to him several times under Leopard.

I'm now considering whether I should downgrade to Tiger.

At the start of this post, I mentioned how much penetration OS X was getting with speakers and developers (the very people that others turn to for advice on which computer to buy). What is going to happen now that speakers realize that Keynote on Leopard is not reliable and may make them look bad in front of an audience? How many will downgrade to Tiger or begin their talks with a disclaimer about how unreliable Leopard is?

And how many more will have their keyboards freeze in front of a large audience?

How many will be greeted with jeers of "Get Windows!"

The final straw for me with Windows was having to stand in front of an audience in Australia while we all waited for Windows to verify my hard disk after crashing spectacularly in the middle of my talk. My keyboard freezing in the middle of a talk may just have the same effect on me for OS X. The darn thing is, I just can't go back to Windows -- it's a dark place that I want to forget about. So what do I do? Linux? Maybe I'll start flirting with it on an EEE PC but I don't think I could switch to it full time. A trip back to Tiger looks like the only viable alternative.

Please, Apple, fix the installer, those debilitating keyboard freezes, and the Keynote instability. If nothing else, these issues are affecting the very people that influence large numbers of others. OS X's reputation is being tarnished as we speak, and, if left unchecked, will continue to do so.

Why, Apple, did you take a polished, stable operating system (Tiger) and release an upgrade that lacks the key ingredients that made people love it? In case you're wondering what those were, they weren't eye candy and pizazz. They were stability, reliability and an impeccable polish.

I want those things back. You can keep the shiny 3D dock!

FlashBrighton’s Big Day Out rocked!

Big ups to Seb, Peter and the other volunteers from FlashBrighton who organized FlashBrighton's Big Day Out yesterday: it was a resounding success (and I hope the first of many more). Thanks also to Adobe, Influxis, and the other sponsors.

My favorite bit (apart from surprising Seb with my count-down timer -- more on that later) was the 30 minute snowstorm hackathon by Dom (who got 15 minutes to draw a shivering man) and Seb (who got 15 minutes to make a particle-based 3D snow storm in AS3 -- while writing all his own import statements in the Flash IDE!)

And I had a great time presenting my session, Beyond the Buttons. So much so that I think I'll develop it further and present it at some of the conferences in 2008.

Random keyboard freezes after upgrading to Leopard

After upgrading to Leopard, I've been experiencing random keyboard freezes and, apparently, I'm not alone.

One thing I've found is that repeatedly pressing Num Lock appears to bring it out of the freeze for me after pressing it about five or six times.

Of course, this is very annoying and I hope that Apple will address this problem ASAP (currently, they don't appear to acknowledge it as an issue and the latest system update (10.5.1) has not made a difference.) On the whole, I must say that I am not very happy with Leopard: It has definitely fallen short of the sort of stability and polish I had come to expect from OS X with Tiger.

Has anyone else with a MacBook or MacBook Pro experienced this?

FlashBrighton Big Day Out Schedule in Flash Lite

Yahoo! Hackday Schedule for mobile.

I have no idea why I made a Flash Lite schedule for FlashBrighton's Big Day Out when I should be working but here it is! (It updates the current session based on the actual time so you should see the highlights once it's past 12.30pm.)

Download it and transfer it to your Flash Lite 2.0 or 2.1 capable phone (15kb).

FlashBrighton’s Big Day Out: Beyond the buttons

Flash Brighton Big Day Out

Here's quick update on the session I'm presenting at FlashBrighton's Big Day Out (the event's now sold out) this Saturday. The talk is titled Beyond the Buttons:

Learning new programming languages, development tools, and technologies is a fun (and essential) part of what we do but they are not ends in and of themselves. IDEs like Flash and Flex Builder, languages like ActionScript 3, and technologies like AIR are merely tools, like the painter's brushes, easels, and paints, the animator's lightbox, and the photographer's camera. In this session, Aral looks beyond the tools to what you can make with them. You will not learn any new techniques or programming tricks but instead stock up on ideas and inspiration to spark your own creative endeavors.

Looking forward to seeing some of you this weekend!

Coming up: Mock data support and better default argument handling in the SWX Service Explorer

I'm currently working on a stealthy little pet project of mine that involves creating a PayPal Website Payments Pro API in SWX. A couple of the methods in the API require quite a few arguments (all the billing-related fields for processing a credit card transaction, for example) and I quickly got sick of having to enter mock data manually in the SWX Service Explorer to test and debug methods calls. (This is one scenario where Transfer Object support would be helpful but adding that right now would complicate things too much.) So, to make things easier for myself (and hopefully some of you as well), I've added mock data support (both static and dynamic) to SWX PHP and the SWX Service Explorer.

Using mock data

In the SWX Service Explorer, methods that have mock data will have a "Use mock data" button enabled.

Clicking the button will fill the arguments with the mock data, as the following screenshot demonstrates.

Creating static mock data

The first way to create mock data is to include it in the JavaDoc-style comments in your service classes. Place mock data at the end of the comment and surround it in square brackets.

/**
   * Do a direct credit card payment.
   *
   * @param (str) A unique order id [12345-12345]
   * @param (str) Credit card number [5105105105105100]
   * @param (str) Card type (Visa, American Express, Mastercard, etc.) [Mastercard]
   * @param (str) 3 or 4 character Credit Security Code [123]
   * @param (number, 4 digits MMYY) Expiry date [1209]
   * @param (number) Amount to charge [2.50]

This is a quick and easy way of adding mock data to a method. The recommended practice here, when possible, is to place enough mock data in a method to allow the user to make a successful call via the SWX Service Explorer. This is in keeping with the SWX philosophy of making things Just Work and Show, Don't Tell.

Generating mock data

The new mock data feature does not limit you to static mock data. You can also generate dynamic mock data with a little bit of PHP.

To generate mock data for a method called doDirectPayment(), for example, you can include a private method called _doDirectPaymentMock() in your service class. This method gets called (and passed an array of any static mock data for the method, which you can either add to or ignore) by the service explorer. It expects an array of mock data (one for each argument) to be returned as per the following example.

function _doDirectPaymentMock($mockData)
{
    // Generate a random order number
    $orderNum = '"'.date('ymd-H').rand(1000,9999).'"';
    $mockData[0] = $orderNum;
 
    return $mockData;
}

In the above example, the order number needs to be unique so it's generated by code but all the other default values are statically obtained from the comments.

Update: In the latest version of the SWX Service Explorer in SVN, the dynamic mock data now updates every time you press the Use mock data button.

Default values for optional arguments

I've also modified how default parameters are handled in the SWX Service Explorer. Previously, they were handled Really Badly (tm). i.e., they were basically ignored. Now, if your method has a default value defined, it is displayed in the SWX Service Explorer by default. This is true even if you define the default value as a constant (in PHP4, you must stick to the CONSTANT_NAMING_CONVENTIONS for constant resolution to work correctly.)

(Note that in PHP5, you must place all optional arguments at the end of your method signature. This is a best practice to follow in any case.)

The following screenshot shows how default values for arguments are handled in the new service explorer:

Currently, the changes outlined in this post are only available from the trunk of the SWX Subversion repository. I'd appreciate it if you guys can test it out. After further testing, it will be included in the next SWX PHP release.

Visor now works on Leopard

Visor gets a Leopard upgrade!

Things are beginning to get back to normal on Leopard for me now that my beloved Visor has a Leopard version.

Visor is a SIMBL plugin that gives you access to a Terminal window as a Quake-style console that drops down from the top of your screen. And the Leopard version supports tabs! Woot!

A big thank-you to Tim Robles for alerting me to the Leopard release in the comments of my previous Visor-related post.






Bad Behavior has blocked 0 access attempts in the last 7 days.