In mathematics, Fibonacci numbers are the following sequence of numbers:
0, 1, 1, 2, 3, 5, 8, 13, …
By definition, the first two Fibonacci numbers are 0 and 1, and each remaining number is the sum of the previous two. This naturally occurring sequence is useful for determining the amount of time to sleep whenever you are polling a resource.
I’m often required to poll a database resource in some sort of daemon. For example, check a table for some asynchronous tasks to complete. If you have a lot of threads polling this resource at quick intervals, the impact on the resource can be excessive/high. Rather than poll at a set interval, I use a Fibonacci sequence to determine what the next sleep interval will be. Following are code examples of this polling technique hosted on GitHub in my most commonly used programming languages…
Read More
Download it ‘ere…
I currently have a mobile broadband account (HSDPA) provided by three.com.au, and after a hexy surcharge from the previous month when exceeding my limit, thought it would be prudent to build a dashboard widget that tracks my monthly bandwidth usage.
Building on a previous post that automates calls to a https website, I followed a nifty tutorial here to turn that perl script into a Mac OSX dashboard widget. I have since revised my original code and opted for a Ruby version of the script, as I found Ruby is easier to setup for a noob as opposed to Perl and its dependencies …
Read More
[UPDATE] Mr Gecko, has since implemented this logic and sorted out downloading woes (for u US folk) in a nifty little OSX app here …
In between contracts, I have been practicing the art of correlation by scraping data from public web sites. The legality of this is perhaps a little unclear so I’ve aimed not to infringe on copyrights by not storing the content, but just changing the way in which content is displayed from a live site. One such example was to open up MySpace songs via iTunes, rather than using the flash player MySpace provide. This required a fair analysis of web server to client traffic, in order to piece together the necessary conversation required to achieve all this via Perl …

Read More