Colour me stupid!

Finally – I read the book on HTML5 and CSS3 that has been sitting on my desk since I bought it at JAX London. Well, alright, truthfully – I have read half of it.

Reading books is a good way to learn  – but I find  that technical stuff doesn’t sink in unless I apply what I read somehow.

Since I struggle a bit with the ‘art’ side of web sites I wrote something that makes it a bit easier for me to visualise what colours and fonts will look like when you put them together in a standard sort of ‘blog site’ . It’s beginner style HTML5 so for goodness sake don’t copy it (read the book) ; I used Jan Odvarko’s jscolor library for picking colours.

Here is a link to it – let me know if it’s useful or fun or you can think of more stuff it should do. I hope the usage is self evident. Caveat – it has not been widely tested, if it doesn’t look right in your browser try Chrome or Firefox :-)

 

 

Now I need to read the rest of the

Monki Gras

Monki Gras was the best conference I’ve been to for a long time. I have been to some very good conferences over the past few years, so being the best is quite good.  That’s a nice English understatement.

I spent a while this afternoon analysing why it was so good. This is the list of things that I want get from attending a conference -

 

  • To come away with at least 2 ideas to follow up – maybe 3 or 4, but no more than that.
  • To be given sketches, glimpses of what different technologies can do – but I mainly don’t want a whole lot of detail on how.
  • To get the ‘vision thing’.
  • To be entertained.
  • To catch up with old friends and make a few new ones.

 

Monki Gras gave me all of this and more, and I’m tired because it was also hard work. I’m also full of energy and enthusiasm for …. well you may have to wait and see.

Setting up an Android environment for PhoneGap

 

Starting to use  PhoneGap – aka Apache Cordova has been a frustrating experience, not because of PhoneGap but because of getting the Android environment set up. The getting started (Android) tutorial for PhoneGap is great. Once I had the environment set up, working through the tutorial took a few minutes. I am not going to reproduce anything that is in that tutorial here, this post is just about how to get to the point where you can work through the tutorial. I’m working on a Mac (Snow Leopard) so these instructions are Mac specific.

 

There are 4 steps:

  1. Downloads
  2. Installing the ADT Eclipse Plugin
  3. Installing the Android SDK
  4. Setting up an Android Virtual Device.

 

1. Downloads

Get started by downloading the major components.

  1. Eclipse Classic 3.7.1
  2. Android SDK R16 MacOSX (Note: This is an ‘SDK starter kit’, see later)
  3. PhoneGap 1.4.1. You don’t need this to set up the Android environment but you will need it for the PhoneGap tutorial so grabbing it while you are downloading stuff makes sense.

I extracted these into 3 separate directories under ~/Applications/ECLIPSE, ~/Applications/ANDR and ~/Applications/PHONEGAP, I don’t think it matters much where they go. Just remember the location.

 

2. Install the Android Developer Tools (ADT) plugin for Eclipse.

Start up Eclipse, I normally do this from the command line so I just executed:

./Applications/ECLIPSE/eclipse/eclipse &

With the brand new install of Eclipse running,  you can  install the ADT plugin:

  1. Help->Install New Software.
  2. Click the ‘Add’ button, top right.
  3. Type ‘ADT Plugin’ in the box labelled ‘Name’
  4. Paste this location “https://dl-ssl.google.com/android/eclipse/” into the box labelled ‘Location’.
  5. Follow the instructions. These are straightforward, so I won’t reproduce them.

 

3. Install the Android SDK

First, tell Eclipse where you put the SDK starter kit. To do this:

  1. Eclipse->Preferences->Android
  2. Paste the location of our SDK into the box and click ‘Apply’

This part is confusing because nothing happens except this:

The SDK Platform Tools component is missing!??

I spent a long time wondering what I had done wrong.  In fact this is the expected behaviour, all that this step achieves is to tell Eclipse where the ‘SDK starter kit’ can be found so that in the next step it can install the SDK. Just click ‘OK’ to get rid of the message and ‘OK’ again to close the window.

Now that Eclipse knows where you have put the ‘SDK starter kit’ you can go ahead and install whatever version of the SDK you need.

  1. Window->Android SDK manager
  2. A window appears with all SDKs you might want to install (see below), pick whatever you need and install it.

 

Android SDKs to install

Android SDKs to install

This takes a while, in the end you should see something like this:

Success installing SDK

Success!

Now, if you return to the the Android SDK pages in Eclipse, (Eclipse->preferences->Android) you will see that Eclipse knows about the SDK:

 

Android SDK is installed

The Android SDK is installed!


 

4. Setting up an Android Virtual Device (AVD)

The final piece that you will need to run the PhoneGap sample is to install an Android Virtual Device, this is a ‘phone emulator that is going to display your PhoneGap (Android)  application.

  1. Window->AVD Manager ->New
  2. Give the AVD a name (whatever you want)
  3. Under ‘Target’, select the SDK that you just installed.
  4. Give it a size. I have no idea what is appropriate here, I allocated it 10 (MiB) and things seem to work.

That’s it. If you have followed through this you have everything that you need to run the PhoneGap Android tutorial.

 

PHP UK Conference

It’s been a long time since I’ve been to a PHP conference. I stopped actively contributing to PHP in mid 2009 when my IBM job changed. Of course, I had hoped to continue in my spare time but I found learning about OSGi took up all my IBM time and all my spare time. In November last year I finally had time to get re-engaged with PHP and volunteered to do what I could to help organise the PHP UK conference. I will doing a much longer write up of the conference for the Web and PHP magazine, so this is just a short post on a couple of personal highlights.

The first thing I want to say is that it’s been a huge pleasure to be part of the conference team. PHP was the first developer community I got involved in and it was a delight to see how much had changed in two years and how much, the warmth and friendliness, was still the same.

That leads on to my second point. Rasmus Lerdorf gave the first conference keynote and the message I took away from that is that PHP still needs more contributors – in particular we need people to fix bugs. If you are bored – and especially if you work on Windows – please try this:

http://bugs.php.net/random

and see if you can help us fix a bug?

The best talks always teach me something and leave me with a picture. June Henrikson (Redpill Linpro) gave a talk about creativity in which she explained something I knew already but was reluctant to believe because I didn’t have have a good mental picture for it. I can’t even begin to count the number of times that I’ve sat in front of a screen trying to solve a problem, knowing that it was taking too long and that I was tired, but just fixated on staying at the keyboard until I cracked the problem. Deep down I always knew that the best answer with that sort of problem is to take a break – here is  why:

Dual CPU model of the brain

Imagine your brain as having two CPUs, one side (CPU1) does the analytical problem solving part and it’s operating while you are concentrating on trying to fix a bug, solve a technical problem etc. While that side is using the memory bus the other side of your brain (CPU2) has no access to memory. When you stop using CPU1, for example – go for a walk, get a cup of tea, you give CPU2 a chance to start working on your problem – which it does as a background process. Eventually – given enough time, CPU2 will deliver a solution, it will feel as though it has just popped into your head. In summary – if you have a difficult problem to solve -  force yourself to take regular breaks.

It’s probably slightly bad form to list my own talk was a highlight – but it was for me. I was a little nervous about doing it the way I did – I owe a huge apology to the people who thought I was serious to start with. In fact I meant almost precisely the opposite of almost everything that I said. I was calling out bad development management practices which I have seen, and even been part of, in large organisations. There was one final twist that (if you don’t know IBM that well) most people probably missed. IBM’s newly appointed president and CEO is a “Lady Cat”. I am ridiculously proud of this fact – also that she holds a degree in Computer Science so is an example of someone that started as an engineer and is a hugely successful manager.

I would love to extend the “Misguided manager” talk – but I need a few more examples. Mail me if you have one and I’ll try to work it in.

There were many outstanding talks at the conference, Hugh Williams gave some fascinating insights into Ebay, Stefan Marek talked about the journey towards CI at Plusnet, Ian Barber talked about why fraud detection is so complex, Patrick Allaert gave a great talk on how to implement complex data types efficiently. All of the talks were recorded and will be made available within the next couple of weeks. I am looking forward to watching the ones I missed – in particular Davey Shafik’s “PHP 5.4: The new bits” which I somehow managed to miss on both days.