Login
Username:

Password:


Lost Password?

Register now!
Main Menu
Search

Planet::Articles


2008/3/27 18:52:00 | 11 reads

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)


2008/3/31 13:25:00 | 10 reads

After noticing the disparity of prices of Coca-Cola, 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]


Leah Duncan | 2008/2/22 9:08:00 | 8 reads

I It's been an interesting month or two, receiving feedback from both the Tassie and the National community since we won the bid for LCA 2009. In particular, Chris Neugebauer and his recent post caught my attention.

Many of the most successful Australian LUGs seem to be centred out of the surrounding Universities; this provides a number of opportunities for growth, publicity, and funding in the form of access to facilities, societal membership funding, and resources.

In contrast, TasLUG has formed, reformed and grown from a base of avid users, many of whom have not been involved in the University Computing communities. We have many members from very varied backgrounds, of many different levels of skill and focus. All the same, TasLUG has been growing soundly over the past 5 years, with the group's website now about to hit 100 topics, 500 posts, and 130 members within the next few months. Our LUG has had many posts praising our providing prompt, accurate, and friendly support to the community. We advertise on local ABC radio, where I have a regular spot, whenever the opportunity arises, we give away Ubuntu and Open CDs, we run a number of Software Freedom Day events across the state each September which attract 200+ people statewide, and now, as January 2009 fast approaches, we're about to host one of the biggest Linux events on the Australian conf calendar (and ooh boy, are we excited!).

And still, the feedback is coming in that there are people who are somehow missing out on the great community we have down here.

It is becoming apparent that without a growing support for Linux and Open Source within the University communities, LUGs face an uphill battle to bring their communities to those who might champion the cause, and pass the message on. Bringing an event of the magnitude of Linux.conf.au to the University of Tasmania can only help to achieve this goal.

Over the coming 12 months, we will be working to foster a new community of Linux and Open Source users within our community; and to cement our position in the Tasmanian community in such a way that no-one will call TasLUG's existence into question again .


2008/5/5 13:43:00 | 7 reads








TUCS Tech Talk #1,
originally uploaded by
Christopher Neugebauer.

As I mentioned href="/website/blog/life/20080503-TucsLaunch.html">previously,
TUCS
had its first tech talk on Friday (delivered by myself, on the topic of Introductory Python), this is the first opportunity to show off photos from it. I was rather impressed by the turnout (there are a few people off to the side that can't be seen in the frame).


2008/3/9 17:39:00 | 6 reads

I had dinner at my Grandparents' place last night, they live on the waterfront in Lindisfarne, and as the evening was clear and still, I took an opportunity to go and take some photographs. Here are some of my favourites:



Tasman Bridge at Night



Tasman Bridge at Night


2008/7/16 17:20:00 | 6 reads

I just posted the following announcement of my proposal for a Python Miniconf to be held at linux.conf.au 2009 to Australian Python mailing lists. I'm posting it here in case anyone has missed it:



Linux.conf.au 2009 is to be held at the University of Tasmania's Sandy
Bay campus in Hobart, Tasmania over the week of January 19-24; and the
call for presentations [1] and mini-confs [2] is now open.

I am currently in the process of producing a proposal for a Python
Miniconf to be held at LCA, so I thought I should detail my plans to a
greater audience for the purpose of feedback/suggestions.

The miniconf would be a single-day conference on the broad topic of
Python programming. Broadly speaking, the topics I would like to see
presented would range through:
- Recent developments on Python core (presented to a more
Python-oriented audience than may happen at LCA proper)
- Frameworks and libraries (e.g. Django, which I believe is hitting
1.0 this year)
- Techniques of Python programming (e.g. using advanced/new/etc
features of Python effectively)
- Discussions of Python use in the "real world" (e.g. Industry use,
education, etc, etc, etc).
- Anything else Python-related: please make suggestions! [3]

The intention is that there would be 5 "organised" talks of ~45
minutes length (although if there is sufficient interest/free space, I
could split blocks into 2x25 minute talks), with a 50-minute block of
lightning talks to conclude the event, with the possibilty of some
loosely-organised get-together of pythoners after the day's
proceedings have finished.

If you are interested in participating in the Python miniconf (which
requires you to also be interested in attending Linux.conf.au), please
e-mail me [3]. I would particularly like topics of talks that people
would be able to give (vague/general is fine at this early stage in
preparation), so that I can include them in the miniconf proposal (so
the earlier I receive them the better!).

Thanks in advance for any help that you may be able to offer me.

-- Christopher Neugebauer

P.S. if I have missed any user groups/potentially interested parties,
could you please forward this message on -- I've already dealt with
most relevant mailing lists in Australia, but international lists may
also be interested, due to the nature of LCA as an international
conference.

[1] http://marchsouth.org/media/news/6
[2] http://marchsouth.org/media/news/15
[3] for the benefit of google groups users: chrisjrn [ a t ] gmail.com


2008/7/17 20:52:00 | 6 reads

I was in the TUU Shop today, and did a double-take as I saw my surname staring back at me (it's in the top left corner of the wrapper).

Why a Brazilian chocolate company would call themselves "Neugebauer" is beyond me -- but I shalln't complain. The occasional ego trip can be healthy.

(Oh, and the chocolate itself wasn't particularly nice. Oh well :()


2008/2/25 13:56:00 | 5 reads

Well, it seems as though TasLUG have started their own Planet-like website, so I've submitted my blog to it. Hello, all you TasLUGgers who are now getting my blog. (And to all of you who are reading through other channels, sorry for the disturbance)


2008/2/8 17:10:00 | 5 reads

People have often asked for my opinion on Java (the programming language, not the Runtime engine, or the Coffee), and my response is normally a very unreserved expression of hatred. I have condensed all of my evidence from the past year, and the result is the following piece of code:




public class Dodgy{
public static void main (String[] args) {
boolean a = true;
boolean b;

if (a == false) {
b = true;
}

if (a == true) {
b = false;
}

System.out.println(b);

}
}


Whilst this code looks harmless, let's see what Java does when I try to compile it:



chris@blackboard:~/src$ javac Dodgy.java
Dodgy.java:14: error: The local variable b may not have been initialized
System.out.println(b);
^
1 problem (1 error)


It is obvious, from such a trivial example, that b will be initialised when line 14 is reached, however, Java prevents my code from even compiling. This demonstrates one differentiation between Java and C (or C++): Java does not trust your judgement. With appropriate syntax changes, that code would have been valid C code, but in Java it is illegal.



Whilst I would approve of such a case being a compiler Warning (I could then flag a -Wall or similar, and have my compiler abort when it finds such an issue), but causing such a thing to be an error is irrational.



Of course, all cases of whether a variable is initialised or not cannot be verified: a general purpose algorithm to do such a thing can be proven to not exist via reduction to the halting problem; so why should Java even attempt to do it in the first place?



So there you have it: Java has a distinct lack of trust in the programmer who uses it, and this is why I dislike it.


2008/3/14 11:13:00 | 4 reads

I generally have a policy of not allowing Flash onto my website (and sorry if any of you PLOAers object), but this opportunity was hard to pass up. Toni Westbrook has written Shredz64, a Guitar Hero-like-game for the Commodore 64. Following is part 2 of his video (the first part take a long time for him to get going, so I've not posted it here).



Enjoy...