Tuesday, March 23, 2010

Childhood's End & Rework

Just couple days after the previous audiobook post, I finished two more books:
  • Childhood's End (by Arthur C. Clarke) was a first Clarke novel I've read since I was a teenager. Naturally the early year it was written (1953) is evident on technology description, but it did not make the book less enjoyable.
  • Rework (by the guys at 37signals) was a disappointment. Even though I knew it was a short book consisting of a collection of small pieces of productivity/small business advice the end result was too scattered and self-promoting for me. On the book the writers boast that they've edited almost 50% of the text out in last stages - maybe they should've edited it a bit more? To books merit, there was many good pieces of advice and things that resonate well with the common sense at work - one good example was how inefficient the meeting culture usually is, and the many suggestions to improve/replace it.
At the moment my commutes are filled with House Rules (by Jodi Picoult). More about that next week..

Labels: ,

Thursday, March 11, 2010

Crop of audiobooks

Ever since my change of job last summer and the fact that the new work resides physically quite far away has naturally changed my commuting routines completely; No more bus or train rides to the city center and back, usually with magazines and books to read and music and podcasts in my ears. No more handy time off both work and home for personal notes in journal, or emails. Now it has been roughly one hour car trip one way every day, only occasionally broken with days on the train.

As the finnish radio programs have never really kept my interest I tried to find out some real content to fill the long commutes. On this first year, audiobooks have been the filling. Audiobooks, and occasional conversations on the phone with friends on the phone (anohter habit I had almost forgot under the huge amount of SMS and emails).

Now it has been almost 10 months since I started the long commutes and during that time I've listened 21 audiobooks. The number was a surprise. I do not remember a year in my adulthood where I've read more than five book in a year (non-work-related books, that is).

Here's the list of books so far in rough chronological order, with rbrief comments attached:

  • Confessions of an Economic Hit Man (John Perkins) - Thought-provoking narrative on multinational companies behaviour with developing countriers. Facts or fiction, who knows?
  • Getting Things Done (David Allen) - A bit over-hyped but still inspirational book for time management disasters like myself. Ever since listening I've used GTD-like methods with success.
  • Legacy of Ashes (Tim Weiner) - Perhaps a bit one-sided view on the history of CIA. Gripping book, nevertheless.
  • Endymion (Dan Simmons) - I even have this book but never finished it on paper. All four books of 'Hyperion cantos' were quite an effort to listen timewise but I did enjoy them all.
  • The Fall of Hyperion (Dan Simmons)
  • Hyperion (Dan Simmons)
  • The Rise of Endymion (Dan Simmons)
  • A Game of Thrones (George R. R. Martin) - Another multi-book monster (A Song of Ice and Fire) started. Enjoyed the different (more traditional?) kind of fantasy book after a loong while. Have not continued with the series yet but I will.
  • Rivo Satakieli (Leena Lehtolainen) - Trip to finnish detective story genre. Will not be the last one, especially if the plots vary enough. It was fun to have the story happening at Espoo (where we live). Bought for few euros from a book fair. There should be electronic distribution for finnish audiobooks!
  • Life of Pi (Yann Martel) - Well-told road-trip with Indian and ocean-going twist.
  • Ubik (Philip K. Dick) - First Philip K. Dick novel I've tried. Short and confined. Liked but not the best of all things.
  • Cryptonomicon (Neal Stephenson) - As a physical book this is a monster, as audiobook not as frightening. As computer history/security/crypto things are close to my heart this was pure joy. More like this?
  • Snow Crash (Neal Stephenson) - bought this with in the good feeling from the previous book. More on the pure scifi/cyberpunk genre. Did like!
  • Redo Moon Rising (Matthew Brzezinski) - Phew, what a contrast to 'Snow Crash'! Historical view to the race to the space. A bit limited, but included facts that I would've not come accross elsewhere, especially on the USSR-side of things.
  • The Kite Runner (Khaled Hosseini) - We have this book physically, but as no time to read it I decided to go for it. Well-told story. Left me thinking for a long time the life in totally different cultures - how narrow-viewed we really are, and very lucky at the same time..
  • A Thousand Splendid Suns (Khaled Hosseini) - Chose this after good experience of the 'runner. Similar good qualities, enjoyed very much!
  • The Lost Symbol (Dan Brown) - As having read the previous Browns I knew I would read this eventually. So why not now. Dan Brown cannot help copying from his previous bestsellers which was a bit annoying. There was no diffinculty on listening through this. I'm just hoping that the next one would be very different..
  • Blade Runner (Philip K. Dick) - The original novel loosely behind the Blade runner movie. More enjoyable than the previous novel of his I listened. Now I want to see the movie again!
  • Sarasvatin Hiekkaa (Risto Isomäki) - Recommendation from an old aquaintance. Well, the story was a good one, but perhaps too one-track-mind without sufficient self-critique to be really good.
  • Sinuhe Egyptiläinen (Mika Waltari) - I did start listening to this years back on CD:s. Now, after converting to iPod friendly format I did get back and listened the last 15 or so hours. No wonder this has been a worldwide bestseller. Thoughtprovoking, pondering, very human story in its historical marvel.
  • A Scanner Darkly (Philip K Dick) - Finished this just this morning. Trippy story blended my dizzines of super-early-morning train journey. Again a book leaving me wanting to see the movie. Well, usually they dissappoint - do they?
The following books I have 'cued' already on my iPod:
  • Childhoods End (Arthur C Clarke) - currently playing
  • House Rules (Jodi Picoult)
There's at least the following books I have earmarked recently for listening.

  • Rework (37signals)
  • Fatal System Error (Joseph Menn)
  • Daemon (Daniel Suarez) - any legal way to get these on Europe? audible.com seems to restrict the sales of Suarez books only to US.
  • Freedom (Daniel Suarez)
As hinted above, most of the books have been bought from audible.com using their two-books-a-month subscription. I have been pretty pleased with the selection so far. I will start to use the local library much more in the future, if I just have the time for all that CD ripping.

Any recommendations? Please fill in with the very best audiobooks you've listened to!

Labels: ,

Monday, June 29, 2009

Invoking Spotify playlist using applescript

Spotify has plenty of Finnish children's music available so it has gained specific popularity in our household. This has rendered my older iTunes-control -scripts not that useful anymore. I decided to give Spotify scripting a go, even though I knew there's not applescript interface available. Thankfully simple key navigation is enough for the basic use case of "play random song from this playlist":

-- Invoke Spotify simply by opening a Spotify playlist or artist URL

open location "http://open.spotify.com/artist/4Zml6rzsSiVkfIIWJh6EWX"

-- Make sure we have the spotify-application on front and in focus
tell application "Spotify"
end tell

-- Now navigate to the song we want to play and play it
tell application "System Events"
-- Three times tabulator = move selection to the songs list
key code 48
key code 48
key code 48
-- Wait for a while the spotify app to catch up
delay (2)
-- enter key = play selected song
key code 36
-- right key with command = next song (random assumed)
key code 124 using command down
end tell
Note that if the Spotify URL is your private playlist this still works, as the playlist is invoked locally!

Other assumptions:
  • "enable access to assistive devices" is enabled on the "Universal Access" -settings
  • Spotify URL:s properly associated to your favourite browser (tested only with firefox)
Known issues:
  • Invoking a random song requires you to set the shuffle on manually on the Spotify app
  • Naturally this generates new browser tabs on each time the script is invoked
  • As the key events are used, and even with a noticeable wait in between, this can cause really weird results if something is happening onscreen either interactively or autonomously.
  • There is no straightforward way of knowing if Spotify is already playing something. Toggling the playback off, if invoked second time (useful when used with RFID tags) isn't therefore easy.. or is there a apparent solution other than closing the app?
As this works OK, I have to print out new RFID-tag for Ti-Ti -nalle for my daughters ;)

Again, the script is not really a rocket science and most of the elements were just copy&pasted from invaluable Doug's AppleScripts. It is just fun to simply being able to control other apps in OSX!

Labels: , , ,

Tuesday, May 05, 2009

Changes, changes..

Looking back couple years there has been "one big change" happening in our life each year. Change of country, moving places, change of job, getting married, birth of children etc.

This year it will be significant change in my employment.

I am leaving Nokia this month, after six years, and I'm heading to a researcher position in Finnish Defence Forces! One can say that this will be a big change in company ways of working, scope and the whole technology context. On the other hand, I am looking forward applying some of my experience in this new envinronment in new ways and learning a lot at the same time.

I am looking back to my years at Nokia with warmth. It is a very good, big company to work for - providing lots of exciting challenges with lot of variety. I have also had the pleasure of constantly working with very intelligent people, many of which are the absolute world class top professionals in their fields.

Now, maybe I can have a bit more opportunities for doing mobile programming as a hobby as it is not filling 110% of my work days? Well, you never know.. ;-)

Labels: , , ,

Saturday, March 07, 2009

Simple applescript for playing music in iTunes

In addition to make skype video calls I thought it would be nice to give my kids some control over playing music on the iMac. So, a new rfid tag was assigned to following simple applescript:

tell application "iTunes"
if player state is playing then
set the view of the front browser window to playlist "kertun musaa"
set myNumberOfTracks to number of tracks in playlist "kertun musaa"
set randomTrack to (random number (myNumberOfTracks - 1)) + 1
play track randomTrack of user playlist "kertun musaa"
end if
end tell

So when the tag is shown to the reader the script either
  • stops the playback if itunes is playing a something, or
  • if nothing is playing, starts a play a random song in a named playlist
The script would've been even more simple if iTunes would allow setting the current playlist. Then I could've used the native shuffle mode of the player.

Using applescript one can do almost anything on iTunes. A good source for further information is http://dougscripts.com/itunes/

Labels: , ,

Friday, March 06, 2009

RFID "calling cards" for OSX and Skype

I made a simple "calling cards" for my daughter(s) which enable her to make a Skype video call to me and to her grandparents without using keyboard and mouse. In order to make the call she would just show the card with right image to the reader. Computer would respond by saying aloud either "calling grandma" or "cannot make the call to grandma", depending whether the other party is online or not.

cheap rfid-reader and "calling cards"

  • iMac with Skype installed
  • Tikitag/Touchatag rfid reader. Bought the reader and some tags for about 12€ (75% discount) when the company changed its name.
  • Applescripts for calling to grandmas and myself at work, saved as application. The scripts check if the target is online, gives voice feedback using speech synthesizer, and makes the call with the window maximized.
  • Rfid tags assigned with local URL:s at touchatag service. The local url is simply a link to the application to start when the tag is shown to the reader. As example, an URL to "call my work skype app" is
  • Pictures in see-through plastic pouches. The Rfid tag is put behind the image. One could also e.g. laminate the cards.
I have also experimented having Nokia N770 internet tablet next to the reader showing visually who is online and who isn't. Having the extra device on the table did make the setup look a bit complex. Let's see with the target audience if is it needed or not. ;-)

Controlling a computer via non-traditional methods feels nice. If the setup works reliably and the actual interaction makes sense I will definitely expand the use to playback of some favourite music etc.

OK, nice hack but will it be used for real? We see it next week when the family comes back home ;)

EDIT: Added the example of a local URL

Labels: , , ,

Thursday, March 05, 2009

Learning applescript: controlling skype

While I've always known that you can control many of the applications running in OSX using applescript I have very rarely tried that myself.

Now, as I have a use case of semi-automation of skype video calling for the kids I started experimenting. I did buy a tikitag rfid reader on cheap which will be used for triggering the call.

Here's what will be triggered by the rfid tag. This simple script checks if person xxxxxx is online and tries to open a call if he is. At the same time the script enlarges the call window to full screen for maximum video size. I have added some text-to speech notifications just for sake of experimenting, most probably I will replace them later with recorded samples.

Edit: Updated the script a bit and framed it in


on SkypeCall(login)
set AppleScript's text item delimiters to " "
tell application "Skype"
set foo to send command "GET USER " & login & " ONLINESTATUS" script name "MyScript"
set UserStatus to my GetPart(foo, 4, " ")
if UserStatus is "ONLINE" then
say "soitan"
send command "CALL " & login script name "MyScript"
copy (run script "tell application \"Finder\" to desktop's window's bounds") to bounds of window 1
say "[a] onnnnissstu!"
end if
end tell
end SkypeCall

on GetPart(s, p, d)
set theList to every text item of s
return (item p of theList)
end GetPart
I used this macoshints article as an example.

Labels: , , ,