iPad applications

A few people have asked what applications Im using on my iPad, here is the current list:

Instapaper Pro

Allows you to save articles to read later, presents them sans website junk. Just the text on an off-white background, a most compelling way to read. Just Lovely.

GoodReader 

PDF viewer - allows you to upload PDFs and other file types. I have all my technical books on it. Displays them nicely. Not sure it will be needed once iBooks supports PDFs, will see.

Echofon

My twitter client of choice. 

EyeWitness

Photo from the Guardian each day with a "pro tip". Wonderfully built app, do one thing and do it well. 

Dropbox

Nice to be able to watch telly without having to bother with a laptop.

Adobe ideas  

Drawing tool, think finger painting for 3 year olds if you have my ability.

pTerm

ssh terminal tool that supports keys. Useful if you need to check your servers and don't want to leave bed.

GodFinger

This is a wonderful game to showcase the interface. It was pointless after level 20 or so. They have since updated it and added a load more fucntionality. Probably not to bad to start now.

Harbor Master

This is another wonderful showcase of the iPad interface, try playing with with a mouse and keyboard.

Carcassonne

Current an iPhone app, it scales okay on the iPad. Is meant to be a free upgrade later this year. We play the board game at home, so it is nice to have a electronic version.

Wolfram Alpha 

Native client, runs on the iPad and iPhone. 

COED&T     

Concise Oxford English Dictionary & Thesaurus.

Twitter client, minimal twitter client. a few too many querks for me. This maybe a little unfair, it could be that it is different to my beloved echofon.

Reeder

Google reader client, wonderful and minimal, unfortunately requires linear reading habits. I'm not linear in my reading. 

BBC News 

Sort of like the website except crippled.

Pulse News

RSS reader, a little average. This maybe a little harsh, I've not spent a long time playing, it is mean to support google reader, I couldn't get it working.  I still prefer google readers website, it allows me to move quickly through feeds.

Final thoughts 

Waiting for iOS4 and mail that works, multitasking, folders and native skype. I've loosely ordered the apps according to how much I like / use them.     

 

Branch you silly git

 

Recently I had a Hard drive failure. This meant a few things, firstly my Monday morning was less than fun. Secondly, I had a chance to test if TimeMachine worked.  Time Machine did work, but for some reason the latest complete backup was five days before the failure. A few days lost work, nothing to serious. It has however highlighted 
some deficiencies in routine, which has been: 
  • pull any updates from the server  and build if needed,
  • noodle with code, committing every so often,
  • once finish, possibly several days later, push changes to the server. 
Enter the branch

I've been using branches to experiment with idea and share them with folks, but not day to day work.  Which in retrospect was a mistake. My daily routine will now be :
  • pull any updates from the master branch and merge them with my current branch, build if needed,
  • noodle with code, commiting every so often,
  • at the very least at the end of the day push my branch to the server, compiling or not,
  • once story is finished, merge changes back into master.
Set up 

  
$git checkout -b jaf_wip master
Switched to a new branch 'jaf_wip'
 
$git push origin jaf_wip
Total 0 (delta 0), reused 0 (delta 0)
To git@git.spiralarm.com:taykt.git
 * [new branch]      jaf_wip -> jaf_wip
 

 

 

The above creates a new branch and pushes it to the server, this assumes you've already set a server to push to. 

 

Touch screens - the beginning of the end for the mouse.

I hope the iPad is the beginning of touch screen integration into all apple products. MacBooks and iMacs would be wonderful with an entire touch screen. No longer this disconnect between the pointing device and the thing you want to interact with, want to move a window, drag it, want to resize a window pinch it.

It could be the beginning of the end for the mouse. Not for everyone, specialist, such as graphic designers and possibly programmers would probably still need a mouse, if they don't like or know keyboard short cuts.

Here is hoping my next laptop is a MacBookPro with the optional touch screen interface.

Google needs to get into farming

Anna and I were watching Michael Pollan's talk on fora.tvhttp://fora.tv/2009/05/05/Michael_Pollan_Deep_Agriculture#fullprogram ), HT @jjprojects. He was talking about what is wrong with the American food system and what can be done to fix it - moving away from mono-cultures and feed lots to reduce the amount of oil needed to produce food; move away from spending 10 Calories of energy to produce 1 calorie of food. Also by moving to a diverse crop less pesticide and fertiliser is needed. Finally grow locally, so the produce isn't being shipped across America or the world.

The solution seemed to be that we need more diverse farmers, with a preference for farmers owning the farm rather than large corporates.  It occurred to me if you want to be able to trace your Broccoli or Steak from paddock to plate, google is your best bet. They already look after our search, mail and in the US at least are starting to look after our Health records, Internet connection and power generation. 

So, why not our food system. 

They could track from seed to plate,  gathering a wealth of information to help grown better crops in the future. Not by dumping large amount of chemicals on them, but by working out what plants grow together well.  Nature is already far better at this than us, but it doesn't mean we can't find improvements to suit our needs.

Also if google are running farms across america it can better cope with the ebb and flow of demand, instead of shipping steak from California to New York ship it from New England. It will arrive quicker and in a better state. 

The problem with electric cars

They don't go far enough and then you need to charge them for eight hours. The answer is apparently better batteries and while the performance of batteries will improve, I don't see them getting to the point where one could reasonably drive from Sydney to Melbourne in a day nor Sydney to the Gold Coast any time soon.

One way to get round this would be to treat cars more like laptops; you don't use your laptop on the battery for 3 hours then sit round for 2 waiting for it to charge. You keep it plugged in when you can and only use the battery when you need to.  If you inverted this idea and ran on battery around town, short trips and used power on longer trips - on the freeway / motorway. Then one could cover long distances with an electric car.  

I'm not of course suggesting we whip and buy 1000Km flex and hang it from the back of the car, rather use some kind of induction in the road to get power into the car. Pretty much turning the motorways into huge Scalextric tracks. Some kind of induction system would allow the batteries to charge while also providing power to move the car. 

It is probably not viable as the cost to build the infrastructure is most likely prohibitive and possibly having a big enough induction coil that close to people may not be healthy. Well, as healthy as the current western diet. 

Another alternative would be to treat the batteries like BBQ gas bottles and rather than refilling them yourself you swap them when empty. Service stations would then turn into large charge lots. It might be more efficient to direct power to service stations than homes and businesses for charging? 

My final thought was Hydrogen / electric hybrid. The Hydrogen could either charge the batteries or be the primary power source, 

Climate Change

Nothing will happen until one of several things happen: 
  • we go past the tipping point and the climate changes beyond our ability to ignore it, 
  • it fails to eventuate - highly unlikely but has to be considered a possibility,
  • the planet gets hit by a comet and climate change occurs rather quicker than anyone expected.
Western governments will never do anything serious about climate change, it is not in their interest. No one will vote for a government that is committed to serious targets as it will impact heavily on their current life style - increased food, electricity and petrol prices as a base. 

Climate Change has become another box to tick on the political trail. Until we move away from either a democratic and/or a capitalist driven society don't expect much to happen on the climate change front until the shit hits the fan.

Jono

Scala traits to enhance existing java libraries

Recently we moved some code over to Scala which uses Apache's httpClient, through laziness I used

method.getResponseBodyAsString. Apart from being poor form, it breaks our - nothing but errors in the Production logs rule at Spiral Arm.

To alleviate the coding smell we created a trait to read the body as a stream instead of a string. Rather a simple task. The nice things about the trait are the use of the self reference.


self:HttpMethod =>


This means 'I expect to be mixed with something of this type' nicely reducing the scope where the trait can be applied and is also self documenting. We could have returned a None Option instead of an empty String, meh. It's an implementation issue and not a huge issue.


trait SafeResponseBody {


self:HttpMethod =>

def getResponseBodyUpTo(to:Int):String = {

val in = new InputStreamReader(this.getResponseBodyAsStream, "UTF-8")

val buffer = new Array[Char](to)

val n = in.read(buffer,0,to)

n match {

case -1 => ""

case 0 => ""

case _ => new String(buffer, 0, n)

}

}

}


Using the trait is nice and clean, when creating an instance of the particular HttpMethod we mix in our trait and then have access to it's methods.


val method = new PostMethod(url) with SafeResponseBody

...

method.getResponseBodyUpTo(160)

Failing in humanity or possibly just geeks

This is not a critique of the language, it is a bigoted attack. Scala may not be as functional as Ocaml, this does not mean it is not functional at all. Just as German is a more precise language than English, doesn't make English complete incomprehensible language. Wielded by some, such as myself, it may appear to be incomprehensible but that should be taken as a slur against the user not the

Scala frameworks

I'm currently trying to get my head around Lift, but at the moment it seems about 10 perspiration 90% magic, It is incredible concise, which is wonderful after spending the last few days bashing my head against the struts wall.

I defaulted to looking at lift as I thought it was the only Scala web framework available. Today I spent a bit of time looking round for any others and below are some brief notes on the frameworks found.

Lift

Lift is the most popular of the Scala based framework. It is built round the notions of convention over configuration and separation of concerns - view are XHTML with lift tags, there can be no intermingling of presentation and code in the views. It has recently gone to version 1.0 and has an active community willing to help. It is easy to get started as lift requires maven and nothing else to create a project.

Sweet

Sweet is another convention over configuration framework with a grails like convention over configuration command line utility to quickly generate controllers. Sweet also uses maven to manage dependencies. Sees more flexible than lift, you are not bound to a session based implementation. This comes at the price that you will need to do more of the work yourself.
It is more standard MVC framework, but in scala, than a complete change that you get with lift. Site site seems to have a friendly tone and is some what more accessibly than the lift site. It is early days with the current version at 0.0.2.642 and 4 developers, it does however have a semi-active community.

Web flavor

flavor appears to be a scala replacement for php/cgi using scala script in the page, it looks like it also supports templating similar to lift. flavor currently has one developer and
I couldn't see any sign of a community, to be fair I didn't really look very hard.

Pinky

To quote Pinky's home page "Pinky is a simple Scala REST/MVC web framework built on top of Guice Servlet." It supports XML/Json generation out of the box no configuration nor batteries required. It appears to be about 7 weeks old and have a single developer and some what unsurprisingly no community that I could find.


Have I missed any others, do I have any wildly incorrect facts ?

State of Scala in the IDE

So I've been playing with Scala over the last few days and trying to get my head back in functional land, which means at some stage Im either going to go postal or start talking backwards. I used vi for the first few days until I couldn't handle being with out ctrl + space any longer.

I've not tried Intellij, The subversion interface disturbs me greatly, there is a review of the Scala integration below. For me unless intellij pulls something phnomenal out of the bad it is really between eclipse and netbeans.

Netbeans

I've only had a quick play with the latest plugin for 7.0 but it seems to handle refactoring, indentation, running and code completion fine, the site seems to
insinuate there is debugging, but buggered if I could find it, perhaps a less than cursory glance may have helped.

eclipse

I've been using eclipse for a few days now, and apart from a few hick-ups getting eclipse to compile or recognise the Scala classes it has been pretty
good. Running and debugging code is fine, code completion works, indentation is some weird sort of help that I have failed to under stand but anyone
with a post grad degree will be able to explain to me. The one thing it is missing and ones again causes me tears is it's lack of refactoring.


Both support maven so switching between IDE's is trivial, which is nice.

scala intellij integration