wtorek, 29 marca 2011

Geek on the Run

In the common sense, geek is someone rather avoiding physical exercises. But the common sense is generally wrong ;-) I know many of us biking, running or doing other sports - in most cases individual sports (to give back some credit to the common sense), but that's not a rule neither.

Anyway, I'm one of those geek runners and us much as I enjoy the exercises themselves, I obviously love collecting as much data as possible so I can crunch the numbers later on. I'm using currently several apps on my Android smartphone for recording and exporting my tracks. Those are Endomondo, RunKeeper, CardioTrainer and HandyRunner. I must say that collectively all those apps have the set of functions that I need, but none of them has all of those alone.

Here is what I need from the mobile app:
  • recording the path and time - all the apps mentioned above do that,
  • recording the heart rate from the heart rate monitor (I'm using Polar WearLink with Bluetooth conectivity) - here the HandyRunner is out of the game,
  • configurable audio cues. All the aps provide voice messages, but I would like to configure what triggers the audio cues (time or distance) and what is the content (time, speed, pace, distance, heart rate etc.). It would be good also to be able to define some pattern that helps avoiding longish messages as I cannot parse two much info when I'm concentrated on something else. For example app could give me an update on my speed and heart rate every second minute and time and distance every other minute. Developers of CardioTrainer have sort of thought of it, it's still not very configurable, but works fine for me.
  • That's not a must, but even though I'm a big fan of Si-Fi and my phone is an Android-based one I still prefer the voice messages to be given in human voice rather than by synthesizer. That's where Endomondo is a bit dissapointing.
  • exporting all the collected data. That's really crucial - I want my data!!! It's all mine, my precioussss numbersss. OK, each of the mentioned apps has a website where it automatically uploads the data for you and where you can see some stats. But that's not enough for me - I need my data in a raw format so I can treat it the way I like. Data export to GPX is fortunatelly in all the apps, but that's just the track, waypoints and timing. And what about my heart rate? Seems that Endomondo is the only one having that option (using Garmin extensions to the GPX format).

What I care less about is advanced playlist/playback options and tracking songs that I was listening to when running. That may be ofcourse a source for interesting analysis as well for those who listen to the music during workout, but I'm not - instead I'm catching up on my podcasts backlog and for that I'm using an external player anyway.

czwartek, 16 grudnia 2010

Running (with) Android

I'm running on a regular basis. Not a typical thing a geek would do, but at least it generates a lot of data in form of GPS traces for further processing. I'm keeping track of my running workouts with RunningAhead website [http://www.runningahead.com] and for a while I was also using their dedicated app for Android to record my exercises. However over time I found software called CardioTrainer[http://www.worksmartlabs.com/cardiotrainer/] much better as it gives me voice updates on my speed, distance, remaining distance etc., provides music (or podcasts in my case) playback. I couldn't though completely migrate to it from RunningAhead for two reasons: one, CardioTrainer does not support history import (well you can enter workout info manually, but that's only overall time and distance); two, RunningAhead website is so much better.
So for now, I'm recording tracks with CardioTrainer, than exporting gpx files and uploading them to RunningAhead. I've also just started my own little project to have a software that combines the best of the two plus gives some extra data crunching features that I'm missing now...

środa, 15 grudnia 2010

Passing array as a parameter to Perl subroutine

In Perl if you pass an array as a parameter to a subroutine like this: 
someroutine(@arg1, $arg2);
Then inside the routine you would expect the following to be the way to get the parameter values:
(@arg1in, $arg2in) = @_;
but that doesn't work as the @arg1in get assigned the entire content of the @_; A solution to that is passing an array reference instead so the call would look like that:
someroutine(\@arg1, $arg2);
Then inside after doing this:
($arg1in, $arg2in) = @_;
you can refer to the array as @{$arg1in}  or to its elements like ${$arg1in}[1].
See also: http://www.cs.cf.ac.uk/Dave/PERL/node61.html