Chart::OFC2

December 30th, 2010 robin Posted in Ironman, Perl | 1 Comment »

Recently I started looking at Chart::OFC2.  It’s a pretty neat module to create Open Flash Chart charts (or more importantly, the data format required for the charts).  One small problem: the y_axis_right option wasn’t completely implemented… but thankfully the creator is also a GitHub user, so I just forked, patched, and posted a pull-request.

If any one wants to get my fork before it’s merged – here you go!


Demonstrating Git with Perl

December 20th, 2010 robin Posted in Ironman, Perl | 2 Comments »

Git is the latest and greatest amongst version control systems.  Git is:

a free & open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Every Git clone is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server. Branching and merging are fast and easy to do.
Git is used for version control of files, much like tools such as Mercurial, Bazaar, Subversion, CVS, Perforce, and Visual SourceSafe.

But how do you persuade your boss, friend, co-worker, …. that it is so much better.  You can rant and rave about how quick, compact and cool it is till the cows come home, but they probably won’t be converted until they see it live in action, and that often takes time…  And in a slide show presentation you don’t want to wander off hacking at the console changing files and cd-ing directories just to show checking in/out a few files…

Along comes Git::Demo – a Perl module to allow you to write stories about Git, and then play them back to your friends, colleagues and bosses to your hearts delight, showing off the snazzy coolness of git.

A Git::Demo story is written in YAML (that’s like XML, but easier to write/read), and has characters:

characters:
- name: Bob
- name: Mary
- name: Jane
- name: Peter

It has events:

- type: print
  action: screen
  characters: ALL
  args:
  - Yippee - go-go-Git!

And those events can be print (prints to screen), “git”, or “file” events

- type: git
  action: remote
  characters: ALL_NOT origin
  args:
  - add
  - origin
  - ../origin

By writing a story of events carried out by the characters, you can show live (and with wallclock times) how quick and easy Git actions are, and you’re not just doing a “here’s one I did earlier” show: it’s happening live at that very moment, so if your viewer says “Wait a moment, what happens now if I …?”, you can pause the story, and do it right there and then.

Git::Demo is still pretty rough, and my sample scripts are short and not so cool yet… but I’m hoping that this will catch the eye of other Git-Lovers out there, and that some will help improve the code, and write more stories!

Have fun, and use Git! 🙂


Turtle hibernation with Perl

December 12th, 2010 robin Posted in Ironman, Just for Fun, Perl | Comments Off on Turtle hibernation with Perl

We have two red-eared slider turtles.  For most of the year they live in our living room in a big aquarium, but for the winter they have to go into hibernation.  As the winter approaches, the light and temperature in the aquarium has to be reduced, and then around the beginning of December they have to go into complete darkness, at about 10C.  Last year we tried putting them into the cellar: our cellar was too cold (went down to just +1C, could have frozen…), my girlfriends parents cellar was too warm, and in the end our neighbours cellar had about the right temperature… but a lot of bother.

So this year I thought I’d find a technical solution.

  • styrofoam and spray foam around a storage box to make a really well insulated box for the turtles.
  • Two CPU water cooling blocks sandwiching a Peltier element (thermoelectric heat pump).
  • From the cold side of the heat pump a water cycle through a copper pipe in the turtle box to cool the box
  • From the hot side of the heat pump a water cycle through a radiator to cool the water
  • A networked atmega processor to read the values from two thermometers (one in the cool water cycle, one in the turtle box), and turn the pumps and peltier element on and off.
  • A Perl script to control it!

When I’ve got the logic and parameters worked out, I’m going to translate the logic of the Perl script to C and load it onto the atmega processor, but for starters Perl is a great helper because I can quickly prototype, try out and refine without having to recompile, and to be honest… I just don’t really like C as much.

And as a by-product of monitoring and controlling the system with Perl, I was able to easily store the data in an SQLite database, and use GD::Graph to create pretty graphs to see how healthy the system (and of course the turtles) is:

This is what it looks like: