The end result has been captured below, showing cylinders whose height relates to the population and whose position on the map relate to the GPS coordinates for the post-codes in the data.
On a similar theme I’ve been reading Programming Collective Intelligence, O’reilly publishing. This book contains all manner of interesting discussions and examples (in Python) related to the analysis and use of large data sets. Some uses include a “PageRank” algorithm, a simplification of what Google might use, and a “recommendations engine” as you might find when browsing Amazon.
The book is fairly dry, but if you are a geek that likes to deal with practical algorithms I’d definitely recommend it. There are a couple of definitions given to the term Collective Intelligence, both relating to the power of crowds but another definition relates specifically to the superhuman intelligence exhibited by large groups of people when solving puzzles, the “hive mind” if you like, and this usually manifests itself in a viral manner. This effect was superbly illustrated by the I Love Bees and the Iris alternate reality games (the latter of which was a product of our AKQA San Francisco office). A paper was recently published by Jane McGonigal, PhD, going into incredible detail on the production and execution of I Love Bees and again I thoroughly recommend the read (PDF). AKQA also created an interactive walkthrough of the Iris campaign, featuring videos, commentary and a timeline of events.
It’s that time again, the Adobe sponsored London Poker Event is back. Luckily for me I can make it this time, and I hear from friends it was a great night last time round. It’s been a while since I’ve played but with such a mix of people there the prizes are anyone’s
Huge thanks to Sean and Adobe for making this happen. Here’s the info, link at the end:
The second Adobe sponsored London Poker Tournament (organised by Sean
McSharry) is taking place on Monday 25th February at the famous Loose
Cannon poker club in Cannon Street EC4. The event is FREE and open to all
professional Adobe software users. Adobe are taking care of the bar tab
and providing some impressive prizes for everyone who makes it to the
final table. Don’t worry if you’ve never played poker before, there will
be lots of novices and you all get 20 minutes of training before the event
begins.
Invariably it’s the beginners who usually do best, as was born out by the defending champion, Steve Riglesford, who will be there to see off all challengers, flaunting his winners bracelet no doubt. The event is next Monday and there are still some places left, so go to www.pokercoder.com and sign up quickly if you want to attend. You have to
register at the site to get in on the night.
You’ll also get the opportunity to network with Adobe representatives and fellow industry
experts (an invaluable career opportunity and a really great bunch of
people).
So there’s a problem with using gotoAndStop() in AS3 classes, as soon as you call it, you temporarily lose access to items on stage (on the timeline) whether they are defined as member variables, or using getChildByName(). This is different from AS2, items on stage were immediately accessible.
Why use the timeline at all? For one you might have a simple button using named keyframes as button states, or when dealing with assets created by designers that include animations with portions that require localisation of text. So like before you use gotoAndStop() or gotoAndPlay() to manage which “state” your MovieClip is in, but when you go to access anything on stage, it is null, even if it was on the previous keyframe. Here’s a snippet from a typical AS3 class:
...
public var myTitleField: TextField;
protected function onAddedToStage( event: Event ): void
{
myTitleField.text = "Step" + currentStep; // All good
}
...
But how about changing the current frame as a result of a mouse click for example:
protected function showNextStep(): void
{
gotoAndStop( "step" + currentStep );
myTitleField.text = "Step" + currentStep; // myTitleField is null!
}
Ouch, so unlike AS2, you cannot reference something on stage after a gotoAndStop()… I know! Wait a frame!? Afraid not. Waiting a frame (using a callLater or simply hooking into one ENTER_FRAME event broadcast) will not be long enough. But there is another event dispatched by Stage which might work, Event.RENDER.
I think the event sequence goes something like this:
1. myTitleField is defined here
2. gotoAndStop( “step2″ );
3. myTextField is null here
4. Event.ENTER_FRAME is dispatched
5. myTitleField is still null here
6. Any code written on the keyframe itself is executed
7. stage’s Event.RENDER is dispatched
8. myTitleField is defined again!
So thanks to a tip from Senocular, the RENDER event looks like what we need. To force this event to fire, you must call stage.invalidate(), also the event is only dispatched to items on a DisplayList, and on top of that, it doesn’t go through a typical capture phase, the event is broadcast directly to the DisplayObject, but that shouldn’t matter here.
Ok so a sample might now look like this:
...
public var myTitleField: TextField;
protected function onAddedToStage( event: Event ): void
{
myTitleField.text = "Step" + currentStep; // All good
stage.addEventListener( Event.RENDER, onStageRender );
}
protected function showNextStep(): void
{
gotoAndStop( "step" + currentStep );
stage.invalidate();
}
protected function onStageRender( event: Event ): void
{
myTitleField.text = "Step" + currentStep; // myTitleField is back!
}
So that’s fairly crude, but the idea is there. I was speaking to Tink on IM who suggested that we override the gotoAndStop/Play methods in a base class to automatically call stage.invalidate().
Really you want to wrap all of this up in a base class and hook it into a redraw cycle so that you don’t have to add the stage RENDER listener and handler each time you need to do this.
In my case, I have a base View class that contains some simple functionality such as a Flex-like initialization phase and callLater method. I’ve also added these overriden methods and in my case they call invalidate() on my base class, which invokes the “component-like” redraw function whenever a property is changed and it’s time to update the visuals.
My initial reason for doing this was because of shortcomings in Flash’s built in SimpleButton class, which doesn’t appear to allow for localisation or font embedding when switching states, so I ported an AS2 SimpleButton I had written.
This issue is a major annoyance as without using this workaround you are basically locking out designers from working on FLAs, and using code for everything, which isn’t always the best approach in highly creative work, it isn’t even always possible.
Anyway, I hope this proves useful, there’s a couple of other solutions out there but this one feels the most processor friendly and doesn’t rely on essentially “polling” the ADDED event, or ENTER_FRAME until your on stage element appears in memory.
Note: It’s important to remember that there are bugs related to both Event.ADDED_TO_STAGE and Event.RENDER (with wmode). So best be sure your viewers are using Flash Player 9.0.115.0 or greater to avoid a world of pain
I recently posted on using a mobile phone’s data connection with Mac OS X, and I’ve just had some sucess with my new eee Linux based laptop, again on Vodafone (but I imagine other operators will be similar).
To dial up a connection, plug the phone in via USB and setup a new Dialup Connection in the Network Connections manager with the following information:
Phone number: *99***internet#
User name: web
Password: web
The difference here is that I’m putting the access point name in the number to dial, no doubt the script I was using on OS X was doing this for me. These settings worked on a plain vanilla eee PC without messing around in /etc/ppp. So that might vary operator to operator. Best of luck, please post in the comments if your process varied for other operators or devices.
So I’ve just moved house and I’m without Internet. It seems I have to pay a total of £384 ($729 USD) for the priviledge this year. Unbelievably only £120 of this is for 16mb no-monthly-limit broadband from Sky, but the rest is on an obscene £124 activation cost to get a BT line set up in this place (I was told it has been 7 years since one was active), the rest is line rental for said line from BT. So that’s all going to take at least a month, because living in a town of several hundred thousand people counts as being “in the sticks” when compared with London, and they just don’t make enough phone engineers…
Either way, I’m currently using my mobile phone with my laptop as a stop-gap and I’m documenting the process as there wasn’t enough information online to get it sorted quickly.
My phone’s HSDPA connection is labelled as “3G+” apparently giving download speeds of up to 7.2mbps. Totally unrealistic, but it definitely feels a lot faster than a 56kb modem, and individual file downloads are certainly in the tens of kilobytes per second.
I found a site containing modem scripts for OS X for a variety of devices (thanks to Ross Barkman for his work). These are very well written, with plenty of automatic re-attempts and checking to save you the hassle of trying out many combinations of dialing numbers, CIDs, access point names, usernames and passwords.
I’m using a Samsung Z720 via USB, although bluetooth works as well. So I opted for the “generic HSDPA script". There are of course scripts for Nokia, Motorola and other manufacturers as well as a bunch of generic scripts like the one I am currently using. Then I ran through the Network settings in System Preferences, establishing a dial up connection over USB with the following entered into OSX’s Internet Connect wizard:
username: web
password: web
telephone number: internet
Also all header encryption/compression is turned off, and I’ve not specified a proxy server, even though one is specified on the mobile itself.
Normally you see people enter something like *99# or even *99**3# for the telephone number, the latter variation is for people entering a CID (the 3 in this case), but the modem script I’m using takes care of that for you, trying out several combinations, and leaving the telephone field free for you to enter your access point name, which you can get by looking at the settings on your mobile.
On one occaision I had to attempt the dialing a few times before it authenticated. A quick “tail” on /var/log/system.log showed the reason, Vodafone wasn’t happy with my hopping on so frequently and using up a bunch of “config requests” which were apparently maxed out, but a few minutes gap saw to that.
3 (Three) in the UK offer a broadband USB 3G modem for a one off cost of £99, plus £10 a month for a 2Gb limit (also available pay as you go), I think they have other plans with more and less of a limit which varies by price. Vodafone on the other hand offer a less friendly limit of 120mb/month when using your mobile phone, or £1 uper day for 15mb both available on contract or pay as you go. If you go over the limit you start paying by the day. Archaic but do-able.
For now this will do but I wanted to include one quick tip… a freeware application called SurplusMeter. You may remember these from the days of dial-up, you specify your monthly limit, the day the month starts on and it monitors bandwidth, archiving and reporting it to you so that you can keep tabs on usage. All in all an essential app if your operator is still enforcing capped monthly limits or operating a rather strict “fair usage” policy.
The other week I picked up an ASUS eeePC Linux based laptop from, believe or not, Toys ‘R’ Us, for an incredible £220 GBP ($429 USD). I have recently started commuting to London on the train with around a 40 minute journey time, so for me this was a purchase that would save my sanity and hopefully my (considerably more costly) MacBook Pro from being stolen. It’s small enough to have on one knee so don’t worry about a table and I’m currently using it to surf, code in Ruby, read books and watch videos.
The strange thing is it seems to be marketed at kids (Toys ‘R’ Us are one of the few places you can pick it up), it contains some educational software and a dumbed down interface (more on how to change that later). Once you boot into advanced mode, it’s a very capable machine with a familiar looking interface (KDE). So without further ado, here’s some more detailed info.
Hardware
This thing is tiny. The LCD is a mere 7 inches, weight is under 1kg. In this shell you can find an Intel 900Mhz processor with hardware accelerated graphics (runs Quake 3 fine), 512MB RAM and a 4GB solid state hard drive (which I have expanded using the built in memory card reader). There’s 3 USB slots for external drives or devices, and of course 802.11b/g WiFi. Battery life is around 3.5 hours.
Software
It comes pre-bundled with a lot of good stuff, and no crap. This includes Open Office, Adobe Reader, Firefox and Thunderbird, Skype, Messenger (Pidgin), Anti-Virus, Media Players and converters, eBook readers, image editors, and general utilities for doing most of the things you need to, I was actually suprised at the collection of things it comes with, even compared with OS X. They seem to have identified a lot of common tasks even if some of this is hidden away in the realms of command line programs. I’m going to attempt to run the Flex SDK on there, I think Eclipse might be pushing it but Linux has its fair share of decent text editors.
Operating System
Pre-installed is a branch of Xandros Server 2.0 (which is in turn based on Debian). This means you can use something like Synaptic (sudo synaptic on the Terminal) to install applications and games from the internet. It also means you can generally find help on advanced topics on Xandros or Debian forums. You can install Windows XP from external CD drive or memory stick, but I love the fact that my OS is taking a mere 30MB of ram when idle, and I’ve been wanting to learn a little bit more bash since I last dabbled as a kid. Alternatively there’s an Ubuntu branch.
Help and Community
The eeePC has a thriving community including a Wiki and forum. On there you can find introductory tutorials to Linux, to gaming, installing other operating systems, using mobile phones as modems and so on. There’s something about the little device that seems give its users an affinity with it, and that’s reflected by the sheer amount of blog, forum and wiki content you can find out there. Ease of use is never going to be on par with OS X or Windows, but it’s really not going to affect you unless you are a power user, and then you deserve it.
Conclusions
So as you’ve probably guessed I’m really happy with this. It’s definitely not gonna make a dev machine (unless your an old skool hacker), but it will let you do 90% of what you need when you’re away from your home or office and in my case it’s forcing me to learn some new languages. My recommendation is run out and get one today.