Monthly Archives: March 2008

Coke Price Watch

After noticing the disparity of prices of Coca-Cola on campus at UTas, I decided that it would be a good idea to map out the location of vending machines and their prices.

and here is the link

If you have a vending machine location on campus to point out to me, or if there has been a price shift at any location, let me know by e-mailing cpw at [the domain that this post is hosted at]

Tasman Bridge — Earth Hour

It’s Earth Hour, therefore a large number of Tasmanian Landmarks have had their lights switched off. Here’s a photo of the Tasman Bridge in a strangely deluminated state.

Case-insensitive String Replacement (in Python)

One feature that Python’s built-in string replacement facilities does not provide is case-insensitive string replacement. This is a reasonably useful construct (that I use fairly frequently in other languages, such as PHP), which I couldn’t find code for after Googling — so here’s some code that does it (licenced under the WTFPL, of course)

 import re def ireplace(self,old,new,count=0): ''' Behaves like string.replace(), but does so in a case-insensitive fashion. ''' pattern = re.compile(re.escape(old),re.I) return re.sub(pattern,new,self,count) 

You can also subclass str in order to use it as a bound method:

 import re class str_cir(str): ''' A string with a built-in case-insensitive replacement method ''' def ireplace(self,old,new,count=0): ''' Behaves like S.replace(), but does so in a case-insensitive fashion. ''' pattern = re.compile(re.escape(old),re.I) return re.sub(pattern,new,self,count) 

Goodbye, IDS; Hello, TUCS!

Today was the AGM for the UTas Internet Developers’ Society. Other than the usual blather that occurs in AGMs for these sorts of things, we’ve approved a change of name to TUCS (or rather the Tasmania University (union) Computing Society). For the moment this name change is purely cosmetic (as we really haven’t done that much in the way of Internet Development for as long as I’ve been at the Uni. The new name (in my opinion) reflects the membership, and the aims of the society a lot better.

One item of Business that I raised was the upcoming Linux.conf.au 2009, which you probably already know by now is being held at the University of Tasmania in Hobart. It’s been resolved that the Society establish better ties with the Free Software/Open Source Community (in Tasmania, in Particular with TasLUG) with the intention of better promoting Free/Open Source software amongst the student and staff body in the leadup to the conference; and I ran for the executive (successfully) on that basis.

Here’s hoping it’s a successful year for the society (which now has a cool name!)