rudisdotnet Kanashimi ikari chikara ni kaete




iWorkout 0.4a Released

08 Aug 2006

iWorkoutVersion 0.4a of the iWorkout Dashboard Widget idget is now available for download. No additional modules or libraries are required. It should install out of the box. I've changed the naming scheme of the widget a bit, so please delete any existing widget you have installed before using this one.

This is still an alpha version since all it does is show your last workout and doesn't format some of the data as pretty as I'd like it to be. If you have any votes for how you'd like to interact with this widget and what you want to be able to do with the data, please leave feedback to this post since I'm more likely to work on features people actually want as opposed to my list of things I'd like it to do.

Major thanks to KT & Jeff for their testing and coding input. Once I get the Google Code project repository setup, you'll be seeing credit in the code.

Reducing Download Size

I've just been messing around a bit with libraries, etc. I understand iWorkout is still in early stages, but some things to consider about polished package.

The bundled libexpat.1.5.0.dylib can be stripped of debug symbols and reduce size from 700K to about 250K. Command is:

# strip -x -S libexpat.1.5.0.dylib



Also, the symbol file libexpat.a should be needed to be bundled, which would save almost 800K.

Thanks again for doing all this work, it really will be much better than posting your runs to some corporate website. ;)



Features

A couple of features I would like to see, that the n+ website does not have.



1) A way to enter ad hoc comments for runs.



For example, two weekends ago I was silly enough to think I could run 5 miles at 2p in afternoon outside in 95F weather. I only made it 4.3 miles, and then had to run home. It would have been nice to note in the workout that I didn't meet my goal for the day due whatever reason. Also, I finished the last mile on treadmill, so I could have not this was the rest of the run for comments of this second workout. Other things, are noting the intensity of the workout, personal thoughts about the run, or whatever else ad hoc you'd like to keep track of.



2) Being able to create list of runs, and set that for a workout.

For example, the run two weekends ago, I would have selected from a list I created for first run "Park: Counter Clockwise" and the second one "Treadmill". Counter clockwise in the park I run means more steep uphills (harder workout), than clockwise which is steep downhills and gradual uphills (no quite as hard). Treadmill notation is obvious. ;)



Changes and Exceptions

I made a change to iWorkout.sh, where the line executing the iWorkout.pl, logs stderr to a file. So, this:

./iWorkout.pl 2>iWorkout.log



This is because something wasn't working, and thought it would be nice to trap standard error to log for future reference. You could also write some simple debug statements or info to the file for users to send or for your own debugging. Such as:


print STDERR "Sport Serial Number: ".$iPodSportSerialNumber."\n";




The iWorkout.log, of course, will be overwritten each time iWorkout.sh is run, so no worry about growing too large, even with lots of useful debug info.



Now the reason I did this is when updating the db with info when my iPod is connected, I'm get the following exceptions:


    Name "main::playlists" used only once: possible typo at ./iWorkout.pl line 291.
    Can't call method "bind_param" on an undefined value at ./iWorkout.pl line 227.



I'm assuming this is because $origXML is not defined, but I've not had time to determine why this is happening yet.


Re: Changes and Exceptions

I found the problem with why this error was showing:

Can't call method "bind_param" on an undefined value at ./iWorkout.pl line 227.




I have a playlist called 80's Mix that I happened to use in workout on Tuesday. The apostrophe was not escaping, of course, so the script was dying trying to import that xml file.


The change in iWorkout.pl is to change prepare line on 225, and then add another bind line and change the $origXML param number for bind to this:

      my $sth = $dbh->prepare("INSERT INTO sportlog VALUES ('$syncfile','$sportserial','$runstarttime',$distance,$runduration,$pace,$calories,?,?)") ;


      $sth->bind_param(1,$playlistNames) ;
      $sth->bind_param(2,$origXML,SQL_BLOB) ;




This allows funky playlists (pun) to not have problem during import.


I should be able to

incorporate this into a new build today with some other changes I've made along with the debug log mod from your previous post.

I forgot to escape the stupid SQL. Duh. Perhaps I can sell one of the kids to give me some more brain cycles back *:^)

thx!

boB


Nothing Displaying

Nice job except it doesn't work for me. Data is just showing up all zeroes.


Post new comment

The content of this field is kept private and will not be shown publicly.


Syndicate

Syndicate content