Archive for the ‘Open Source’ Category

Update: TPG Usage Widget

Wednesday, August 6th, 2008

Download TPG Widget for OSX (version 1.10, 92kb)

  • Fixed major bug in percentage calculations that was causing us to always use the 10% warning, 20% critical limits
  • Modified horizontalIndicator behaviour – don’t show critical unless we are over the critical limit. Basically, this has the effect of “rounding down” from critical to warning, which is useful, given the granularity of the indicator I’m using
  • Removed target percentage, it’s unnecessary
  • Fixed minor bug with clicking on the two targets in quick succession

I think it’s time to update this page with product info and revision history, instead of having separate posts for each update….

Update: TPG Usage Widget

Sunday, August 3rd, 2008

This version introduces two new features:

  • Click on the current usage value to see the current target
  • Notification if there’s a new version available on the back of the widget

Download TPG Usage Widget for OSX (version 1.8, 92kb)

It’s also now available from the Apple Dashboard Widgets site

3 updates in one week! Maybe I should stay off the booze more often ;)

That said, this version clears out all the todos I had on my list for this widget. So unless there’s any bugs, I don’t anticipate any new versions for a while, but let me know if there are any problems.

Update: TPG Usage Widget

Friday, August 1st, 2008

Update: Make sure you get the latest version of the widget!

Another minor update to fix some display issues that may show up at the very end and start of the billing cycles.

What’s changed this time:

  • Fixed bug in calculating offpeak usage (typo). Previously, offpeak was always green
  • If you’re over your total limit for the month, default to 75% warning and 90% critical for color coding. Otherwise, the entire bar is green
  • Fixed display bug: the short horizontal usage bars don’t have the granularity to show really small percentages (eg at the start of the billing period). So, we overwrite them with some friendlier values (10% of total for warning, 15% for critical). It’s less accurate, but clearer than showing a single red light
  • Don’t save empty values for settings (ensure the widget won’t forget your username or password)
  • Removed unnecessary saveSettings call
  • Converted all ints to floats, so we keep fractions of gb/mb

Download TPG Usage Widget for OSX (version 1.6, 96kb)

And if anyone was wondering, yes, you can use subversion to manage a Dashcode widget project…

(more…)

Update: TPG Usage Widget

Sunday, July 27th, 2008

Update: Make sure you get the latest version of the widget!

Another update to the TPG Usage Widget for Mac OS X.

This fixes a pretty major bug with the calculation of red and yellow sections on the indicators; I assumed that everyone’s TPG billing cycles were monthly, like mine so was calculating usage to the end of the current month, rather than looking at the actual expiry date. This caused some pretty confusing indicators showing usage in the red when they should have been in the green.

This should be fixed now, but since I’ve only tested this for my account, please let me know if you notice any weirdness.

Version 1.4 changes:

  • Fixed bug in calculating “target usage” – not everyone has a billing cycle that coincides with the end of the month!
  • Now displays < 1 day as “today” (I saw 0, and maybe a negative on my installation last month)
  • Added option to click on the expiry date (or days) and change mode. Note that once this option is set, the widget will not override it (unless the mac is restarted or the widget is reinstalled)

Download TPG Usage Widget (version 1.4, 96kb)

Confused? Maybe this fineprint from Apple will help: “Mac OS X 10.4 Tiger is required. If you’re using Safari, click the download link. When the widget download is complete, Show Dashboard, click the Plus sign to display the Widget Bar and click the widget’s icon in the Widget Bar to open it. If you’re using a browser other than Safari, click the download link. When the widget download is complete, unarchive it and place it in /Library/Widgets/ in your home folder. Show Dashboard, click the Plus sign to display the Widget Bar and click the widget’s icon in the Widget Bar to open it.”

No? Didn’t think so. Just leave a comment and I’ll help you out

Update: TPG Usage Widget

Saturday, June 21st, 2008

Update: Make sure you get the latest version of the widget!

As requested by a few users, I’ve updated the TPG Usage Widget to be a bit smarter about setting the yellow and red levels in on the indicators.

Previously, yellow was at 75% of maximum, and red at 90%.

The widget now considers the level your usage should be at, given your monthly limit and how much of the month is left. If you’re beyond this point, the indicator bar will be red. If you’re within a day of hitting this limit then the indicator bar is yellow.

Try it out… it makes a lot more sense when you see this in action. Any feedback on this is welcome!

(Also fixed a bug in the days countdown)

Download TPG Usage Widget (version 1.2, 88kb)

Update 27/07/08: Update 1.4 to fix a major bug

TPG Usage Widget for OS X

Saturday, May 17th, 2008

Update: Make sure you get the latest version of the widget!

Since I’ve hit my bandwidth limit with TPG this month, I figured a Mac OS X dashboard widget would be a good way of keeping tabs on my usage in future. The only one already available didn’t work for me, so I made my own.

TPG Widget - Front

 

TPG Widget - Back

It’s pretty simple it shows your choice peak usage, offpeak, both or both combined and you can set your bandwidth limits.

 

Download TPG Usage Widget (version 1.2, 88kb zip)

I’m not sure how frequently TPG update their Your Account area with bandwidth information, but this is where the widget gets the data from.

Resources I found useful for this:

  • Dashcode – the first time I’ve used an IDE. It wasn’t bad once I stopped typing vim commands, but there’s still a little bit of “magic” that’s hidden from you
  • Mostly existing widgets. It’s all just JavaScript, HTML, CSS under the hood. Right-click any widget and do “Show Package Contents”
  • A very introductory tutorial
  • The Flip Side – Some useful tutorials, just search

The biggest gotcha for this app was allowing network access (under Widget Attributes in dashcode, or in Info.plist). It turns out if you make an XMLHttpRequest with this disabled, the request doesn’t happen (obviously), but no error is thrown and you just get an empty string for responseText

Update 1/06/08: Updated the widget to fix some very minor bugs, and adding usage expiry date information, as requested by a few people.

Update 22/06/08: Update to improve the indicator values and fixed minor expiry days countdown bug

Update 27/07/08: Update 1.4 to fix a major bug

Updated PHP SVN Client

Monday, May 12th, 2008

I’ve been working on a frontend for multiple SVN repositories (I’ll write more about this later) and have been using the the Sixdegrees PHP SVN Client library.Since I’ve made some changes to the library, I thought I’d share them here. The changes/fixes I’ve put in mostly relate to the commit logs (I haven’t really used the other features), but will hopefully be of use to others

Changes:

- Added support for non-standard port numbers (rewrote cleanURL)
- getFileLogs will now include an array of files, if multiple files have been modified
- added setRepository method, to fix mis-spelling of old setRespository method
- various bugfixes (out by one error on getFileLogs)

Download Updated PHP SVN Client (zip, 22kb)

You might want to check the original package page for more information When investigating the SVN/WebDAV procotol, the following links were useful (documented here so I don’t have to find them again)

Update 23/06/08: This project is being actively developed by a few people (including myself). The new project homepage is at http://phpsvnclient.googlecode.com