-
Posted: December 3rd, 2008, 8:07am CET
I've always loved rail travel. So here I am on the 5:05 from Canberra,
heading to Sydney. A plane and even a bus would be quicker, and there
would be some possibility that I could have got a lift with someone
going this way as well. So why put up with being constantly rocked
around, with other people who swear and play the guitar?P
For the fun of it, of course! I've never seen some of the countryside
I'm travelling through, out the back of Bungendore and Tarago. I've
driven under the railway bridges and followed the line from north of
Goulburn to Bundanoon, but never been on the track watching the cars.
And it really is quite beautiful in an Australian way - rocky creek
canyonettes (canyoninas?) and river banks green with recent rains, the
rolling hills that yellowy-browny-green that only Australia seems to
call fertile, and sweeps of countryside seen from other vantage points.
I'm just going past a a href=http://maps.google.com.au/?ie=UTF8ll=-34.722841,149.820213spn=0.002773,0.005268t=hz=18whole
set of brick - brick! - pylons/a crossing a
river that have no bridge or track on them. What is their story? What
is that mysterious high-security spot just south of Bungendore that you
see easily from the train but never see from the road? What is that
a href=http://maps.google.com.au/?ie=UTF8ll=-35.084623,149.637501spn=0.011045,0.021071t=hz=16huge
shipping container area/a - devoid of cargo - just near Tarago?
So many new things to find out! So much countryside I now appreciate
for its own character, its twists and turns and long straights, that
car drivers never touch.P
It's wonderful. And it doesn't cost that much either!P
Footnote: added links to Google maps for the two places I could find -
the mysterious high-security area isn't showing up where I expect it
to be - it's like the track, road, fences with cleared area around
them, dams and buildings all just ... don't exist ...
-
Posted: December 3rd, 2008, 1:21am CET
I've always loved rail travel. So here I am on the 5:05 from Canberra,
heading to Sydney. A plane and even a bus would be quicker, and there
would be some possibility that I could have got a lift with someone
going this way as well. So why put up with being constantly rocked
around, with other people who swear and play the guitar?P
For the fun of it, of course! I've never seen some of the countryside
I'm travelling through, out the back of Bungendore and Tarago. I've
driven under the railway bridges and followed the line from north of
Goulburn to Bundanoon, but never been on the track watching the cars.
And it really is quite beautiful in an Australian way - rocky creek
canyonettes (canyoninas?) and river banks green with recent rains, the
rolling hills that yellowy-browny-green that only Australia seems to
call fertile, and sweeps of countryside seen from other vantage points.
I'm just going past a whole set of brick - brick! - pylons crossing a
river that have no bridge or track on them. What is their story? What
is that mysterious high-security spot just south of Bungendore that you
see easily from the train but never see from the road? What is that
huge shipping container area - devoid of cargo - just near Tarago?
So many new things to find out! So much countryside I now appreciate
for its own character, its twists and turns and long straights, that
car drivers never touch.P
It's wonderful. And it doesn't cost that much either!
-
Posted: November 25th, 2008, 6:00am CET
The SECRET_KEY setting in Django is used as a 'salt' in (one would hope)
all hash calculations. When a new project is created, a piece of code
generates a new random key for that site. I'd seen a couple of these
and noted, in passing, that they seemed to have an unusually high amount
of punctuation characters. But I didn't give it much thought.P
Recently I had to generate a new one, and found a couple of recipes
quite quickly. The routine (in Python) is:P
pre
from random import choice
print ''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^*(-_=+)') for i in range(50)])
/pre
(Aside: Note how Python's idea of line breaks having grammatical meaning
in the source code has meant making one liners is now back in style?
Wasn't this supposed to be the readable language? Weren't one liners
supposed to be a backward construction used in stupid languages? Is that
the sound of a thousand Pythonistas hurriedly explaining that, yes, you
can actually break that compound up into several lines, either on brackets
or by \ characters or by partial construction? Oh, what a pity.)P
Anyway. A friend of mine and I noted that it seemed a little odd that
the upper case characters weren't included in the string. Maybe, we
reasoned, there was some reason that they didn't include these characters
(and the punctuation that isn't on the numeric keys). But, looking through
a href=http://code.djangoproject.com/changeset/230the actual
changeset/a that combined all the various salts and secrets into one
thing, and looking at where the secret key was used in the code, it seems
that it's always fed into the md5 hasher. This takes bytes, basically,
so there was no reason to limit it to any particular character subset.P
So my preferred snippet would be:P
pre
from random import choice
s = [chr(i) for i in range(32,38) + range(40,127)]
print ''.join([choice(s) for i in range(50)])
/pre
So you can at least read your secret key, and it doesn't include the
single quote character (ASCII 39) that would terminate the string early.
The update to the original functionality is in
a href=http://code.djangoproject.com/ticket/9687ticket 9687/a, so
let's see what the Django admins make of it.
-
Posted: November 22nd, 2008, 1:49am CET
Right. With two weeks to go until OSDC, I feel like I'm actually
nearly ready to give my talk. The slides are all written up, and my
first practice talk-through took 25 minutes - should fit into the
30 minute slot nicely. I aim to do about a dozen more talk-throughs
so I can get my notes up to speed, and so that I don't read from the
slides, speak too fast or ramble too much. I've spoken at CLUG before
but this is an order of magnitude larger audience and three orders of
magnitude more important. I really want this to go well, and I'm
determined to do it well.P
Damian Conway is my inspiration here - I will not fail him!
-
Posted: November 7th, 2008, 8:57am CET
I've become a big fan of a href=http://djangoproject.orgDjango/a,
a web framework that has a nice blend of python, good design and
flexibility. The template system might not appeal to the people who
like to write code inside templates, but to me it forces programmers to
put the code where it belongs - in the views (i.e. the controllers, to
non-Djangoistas) or models. I love the whole philosophy of Don't
Repeat Yourself in Django - that configuration should exist in one place
and it should be easy to refer to that rather than having to write the
same thing somewhere else. The admin system is nice, you can make it
do AJAX without much trouble, and it behaves with WCGI so you can run a
site in django without it being too slow.P
The one thing I've found myself struggling with in the various web
pages I've designed is how to do the sort of general 'side bar menu'
and 'pages list' - showing you a list of which applications (as Django
calls them) are available and highlighting which you're currently in -
without hard coding the templates. Not only do you have to override
the base template in each application to get its page list to display
list to display correctly, but when you add a new application you then
have to go through all your other base templates and add the new
application in. This smacks to me of repeating oneself, so I decided
that there had to be a better way.P
Django's settings has an ttINSTALLED_APPS/tt tuple listing all the
installed applications. However, a friend pointed out that some things
listed therein aren't actually to be displayed. Furthermore, the
relationship between the application name and how you want it displayed
is not obvious - likewise the URL you want to go to for the application.
And I didn't want a separate list maintained somewhere that listed what
applications needed to be displayed (Don't Repeat Yourself). I'm also
not a hard-core Django hacker, so there may be some much better way of
doing this that I haven't yet discovered. So my
solution is a little complicated but basically goes like this:P
First, you do actually need some settings for your 'shown' applications
that's different from the 'silent' ones. For me this looks like:
blockquotepre
SILENT_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
)
SHOWN_APPS = (
('portal', {
'display_name' : 'Info',
'url_name' : 'index',
}),
('portal.kb', {
'display_name' : 'KB',
'url_name' : 'kb_index',
}),
('portal.provision', {
'display_name' : 'Provision',
'url_name' : 'provision_index',
}),
)
INSTALLED_APPS = SILENT_APPS + tuple(map(lambda x: x[0], SHOWN_APPS))
/pre/blockquote
We build the ttINSTALLED_APPS/tt tuple that Django expects out of
the silent and shown apps, although I imagine a few Python purists are
wishing me dead for the map lambda construct. My excellent defence
is a good grounding in functional programming. When my site
supports Python 3000 and its pythonisations of these kind of concepts,
I'll rewrite it.P
So ttSHOWN_APPS/tt is a tuple of tuples containing application paths
and dictionaries with their parameters. In particular, each shown
application can have a ttdisplay_name/tt and a tturl_name/tt.
The latter relates to a named URL in the URLs definition, so you then
need to make sure that your index pages are listed in your application's
tturls.py/tt file as:P
blockquotepre
url(r'^$', 'kb.views.vIndex', name = 'kb_index'),
/pre/blockquote
Note the 'name' parameter there, and the use of the tturl()/tt
constructor function.p
You then need a 'context processor' to set up the information that can
go to your template. This is a piece of code that gets called before
the template gets compiled - it takes the request context and returns a
dictionary which is added to the dictionary going to the template.
At the moment mine is the file ttapp_name_context.py/tt:P
blockquotepre
from django.conf import settings
from django.core.urlresolvers import reverse
def app_names(request):
Get the current application name and the list of all
installed applications.
dict = {}
app_list = []
project_name = None
for app, info in settings.SHOWN_APPS:
if '.' in app:
name = app.split('.')[1] # remove project name
else:
name = app
project_name = name
app_data = {
'name' : name,
}
# Display name - override or title from name
if 'display_name' in info:
app_data['display_name'] = info['display_name']
else:
app_data['display_name'] = name.title()
# URL name - override or derive from name
if 'url_name' in info:
app_data['url'] = reverse(info['url_name'])
else:
app_data['url'] = reverse(name + '_index')
app_list.append(app_data)
dict['app_names'] = app_list
app_name = request.META['PATH_INFO'].split('/')[1]
if app_name == '':
app_name = project_name
dict['this_app'] = app_name
return dict
/pre/blockquote
Note the use of ttreverse/tt. This takes a URL name and returns
the actual defined URL for that name. This locks in with the named
URL in the tturls.py/tt snippet. This is the Don't Repeat Yourself
principle once again: you've already defined how that URL looks in
your tturls.py/tt, and you just look it up from there. Seriously,
if you're not using reverse and ttget_absolute_url()/tt in your
Django templates, stop now and go and fix your code.P
We also try to do the Django thing of not needing to override
behaviour that is already more or less correct. So we get display
names that are title-cased from their application name, and URL names
which are the application name with '_index' appended.
You now need to include this context processor in the list of template
context processors that are called for every page. You do this by
using the ttTEMPLATE_CONTEXT_PROCESSORS/tt setting; unfortunately,
if this isn't listed (and it isn't by default) then you get a set of
four very useful context processors that you don't want to miss, so
you have to include them all explicitly if you override this setting.
So in your ttsettings.py/tt file you need to further add:
blockquotepre
TEMPLATE_CONTEXT_PROCESSORS = (
django.core.context_processors.auth,
django.core.context_processors.debug,
django.core.context_processors.i18n,
django.core.context_processors.media,
portal.app_name_context.app_names,
)
/pre/blockquote
The most inconvenient part of the whole lot is that you now have to
use a specific subclass of the Context class in every template you
render in order to get these context processors working. You need to do
this anyway if you're writing a site that uses permissions, so there is
good justification for doing it. For every ttrender_to_response/tt
call you make, you now have to add a third argument - a RequestContext
object. These calls will now look like:p
blockquotepre
return render_to_response('template_file.html', {
# dictionary of stuff to pass to the template
}, context_instance=RequestContext(request))
/pre/blockquote
The last line is the one that's essentially new.P
Finally, you have to get your template to show it! This looks like:
blockquotepre
lt;ulgt;{% for app in app_names %}
lt;ligt;lt;a class={% ifequal app.name this_app %}menu_selected{% else %}menu{% endifequal %}
href={{ app.url }}gt;{{ app.display_name }}lt;/agt;lt;/ligt;
{% endfor %}lt;/ulgt;
/pre/blockquote
With the apprporiate amount of CSS styles, you now get a list of
applications with the current one selected, and whenever you add an
application this will automatically change to include that new
application. Yes, of course, the solution may be more complicated in
the short term - but the long term benefits quite make up for it in my
opinion. And (again in my opinion) we haven't done anything that is
too outrageous or made
-
Posted: October 28th, 2008, 6:55am CET
For the more technically minded, here is a brief synopsis of my
criticisms of the Clean Feed 'initiative', sent in a letter to
Senator Stephen Conroy:P
blockquote
ol
li1% false positive rate is way too high to be usable./li
li75% slower is too low to be usable, and the faster filters have a
higher false positive rate./li
liIt only blocks standard web traffic, not file sharing, chat or
other protocols./li
liIf you filter HTTPS, you cripple the financial system of internet
shopping, banking, and personal information (e.g. tax returns)./li
liIf the Government ignores who's requesting filtered content, then
those wishing to circumvent it can keep on looking with no punishment.
If the Government does record who requests filtered content, then even
ASIO will have a hard time searching through the mountain of false
positives./li
liWe already have filtering solutions for those that want it, at
no cost./li
liMandatory filtering leads to state-run censorship and gives an in
for the Big Media Corporations to 'protect their assets' by blocking
anything they like./li
liThe whole thing is morally indefensible: it doesn't prevent a
majority of online abuse such as chat bullying or file trading, and it
relies on the tired old 'think of the children' argument which is
beneath contempt./li
liPeople who assume that their children are safe under such as system
and therefore do not use other protection mechanisms such as watching
their children or providing appropriate support are living in a false
sense of security./li
/ol
Instead, the Government should either put the money toward the National
Broadband Network programme, or run their own ISP with the clean feed
technology to compete with the regular ISPs.P
Regards, Paul.P
/blockquote
I urge every Australian to write to Senator Conroy and/or their local
Member of Parliament on this issue - it is one we cannot afford to be
complacent about!
-
Posted: October 13th, 2008, 11:38pm CEST
With the way tickets went for A href=http://www.linux.conf.au/Linux
Conf AU/A this year gone, and getting paid today, I decided to get
my registration in early. Once again I noted they had continued the
fine tradition of having a random silly message per registrant. Once
again I decided to hack it to make it say what I wanted it to say.P
Needless to say they raised the bar this year. Up until 2007 it was
just a hidden field in the form. In 2008 they added a checksum - this
delayed me a good five minutes while I worked out how they'd generated
it. This year they've upped the ante, including both a different
checksum and adding a salt to it. Another five minute's playing with
ttbash/tt revealed the exact combination of timestamp, delimiter,
and phrase necessary to get a correct checksum.
span style=color: white; background-color: white;I am also made of
cheese./spanP
Naturally, don't bother A href=mailto:paulway@mabula.netemailing
me/a to find out how I did it; the fun is in the discovery!
-
Posted: October 9th, 2008, 5:18am CEST
Back in the days when Icehouse was in, Crowded House was big and
I was getting deeply hooked into Yello, I had a Roland Juno 6. It
was my Dad's, but I played it a fair bit. One of the leaders in the
analog synthesis days between full-on knob-for-everything setups
like the Moog and the start of MIDI and digital control, it is still
legendary for producing huge bass lines and stunning synth leads.
Then our house burned down and took the Juno with it, and though I
often thought of getting another synthesizer I never did.P
Until now. It started with playing the piano at friends and relatives
houses; then Kate suggested I could accompany her violin playing. As
I got more into LMMS I started realising that having a keyboard to
record lines and work out notes and melodies on was going to be very
useful. So I did some research and found the Roland Juno G, which sat
between the full-on knob tweaking of Nords and Moogs (all digital, now,
of course, but still faithfully emulating the analogue sound synthesis
process), the 'play the demo song' integrated-speaker cheap synthesizer
market, and the 'it has 4096 patches, all pianos' professional keyboard.
This may sound like a no man's land, but the market segment is for
people who want a range of instruments, the ability to fiddle with how
they sound, and don't need heavy 'piano-action' keys. Unfortunately,
they don't make the Juno G anymore.P
Fortunately, it's successor is the Juno Stage, which is basically
version 2 - all the features of the G but without the confusion between
it and the Juno D. You get knobs to control attack and release, low
and high frequency rolloff, and cutoff and resonance of the filter -
which you can twiddle on the fly. It comes with 1024 different patches,
a variety of modes including split keyboard (SuperSaw on the left and
piano on the right is a favourite) and lots of nice features that I
haven't truly discovered yet. So I bought it, brought it home, and
started practicing again.P
Gradually my fingers are warming up again, playing scales and old tunes
I used to know. But what has amazed me is the amount of pure
inspiration I'm getting from the sounds. A new patch will make me
start writing new melodies out of thin air, and when I find that some
presets consist of an arpeggio and drum rhythm on the left hand, new
mystical tunes will flow out of my right hand and almost amaze me in
the process. That and the joy of working out the chord progressions
(the title of this post is a nod to the classic synth line of 'Jump'
by Van Halen - I hit the first two chords (C, F in my playing) and then
had to figure out the next (B) later by experimentation - I don't know
what the actual song used but it's easiest to play on G, C, and F)
for songs I remember. Playing the Doctor Who theme or the theme to
Axel F or Fletch (yay Harold Faltermeyer) is always a blast, and it
all came right back to me.P
So I'm now doing regular practice of my own devising, before I seek out
someone to teach me how to play more. I'll report how I go plugging it
into the computer (yay USB MIDI interface) in another post.
-
Posted: October 9th, 2008, 5:11am CEST
In my work I've recently had to implement several pieces of code which
follow this basic pattern:P
ol
liRetrieve data from the database/li
liProcess data/li
liStore data somewhere./li
/ol
Because of Perl DBI's habit (on the systems I've used) of grabbing all
the data from the database into memory before actually giving it to
the caller, and because that data can often get large enough to get my
process swapping or killed, what this usually turns into is:P
ol
liGet a list of 'grouping' items (e.g. days, months, IP addresses, etc.)/li
liFor each item in that group:
ol
liRetrieve data from the database for that item.
liProcess data/li
liStore data somewhere./li
/ol
/ol
This runs into an unfortunate problem when the database server you're
talking to takes a noticeable time to process your query - the whole
thing slows down hugely. A typical slowdown I've seen is in the order
of 500% - and both the database and the client processors are mostly
idle during that time, as each query has to be individually fetched,
processed, dumped back to the client, and then processed. It suffers
the same problem if the time to process each group of data is
significant - by the time you've got back to fetching the next group,
the database has gone off and done other things and needs to get its
disk heads back in the right place for your data.P
These days we have processors capable of doing multiple things at the
same time, and so it would be nice if the client could be processing
rows at the same time as it's also requesting more data from the
database. This is where Perl's
a href=http://perldoc.perl.org/threads.htmlttthreads/tt/a and
a href=http://perldoc.perl.org/Thread/Queue.htmlttThread::Queue/tt/a
libraries come in. It seems to me to be a generalisable task, so I'm
sharing my first attempt at doing this in a generalisable way here.
My main subroutine is:P
pre
######################################
sub Thread_Process {
######################################
# We take one query which returns a list of items, a query which
# returns other rows based on each of those items, and a function
# which processes those rows. We then run the processor function
# in parallel to the fetching process to utilise the connection
# to the database and keep the local processor active.
# Requirements:
# The item query must be executed and ready to return rows. It
# can return any number of fields.
# The rows query must be ready to be executed, and will be
# executed with the row_args_ref and then the items from each
# row in the item query in turn (as arrays).
# The function takes as its last argument the Thread::Queue object
# that data will be passed through. It must know exactly how
# many items it will take from each row, and that should match
# the number of items returned in the query. For reasons as yet
# unclear, we can't pass references of any kind on the queue,
# so we pass the fields in each row as single scalars. Any
# arguments that it needs should be given in fn_args_ref. It
# should exit on receiving an undef.
my ($items_qry, $rows_qry, $row_args_ref, $fn_ref, $fn_args_aref) = @_;
my ($items_aref) = $items_qry-fetchall_arrayref;
unless (ref $items_aref eq 'ARRAY') {
carp Warning: got no rows from item query\n;
return 0;
}
my $queue = Thread::Queue-new();
my $thread = threads-create($fn_ref, @$fn_args_aref, $queue);
foreach my $item_aref (@$items_aref) {
$rows_qry-execute(@$row_args_ref, @$item_aref);
while (my $aref = $rows_qry-fetchrow_arrayref) {
$queue-enqueue(@$aref);
}
}
$queue-enqueue(undef);
$thread-join();
return scalar @$items_aref;
}
/pre
A sample caller function would be:p
pre
sub Send_mail_to_everyone {
my ($mail_handler, $template, $start_date, $end_date);
my $servers_qry = $dbh-prepare(
'select distinct mail_server from addresses'
.' where birth_date between ? and ? and current = true',
);
my $args_ref = [$start_date, $end_date];
$servers-execute(@$args_ref);
my $email_qry = $dbh-prepare(
'select user_name, server, full_name, birth_date'
.' from addresses'
.' where birth_date between ? and ? and server = ?'
.' and current = true'
);
my $mailer_sub = sub {
my ($queue) = @_;
while (defined my $user_name = $queue-dequeue) {
my $server = $queue-dequeue;
my $full_name = $queue-dequeue;
my $birth_date = $queue-dequeue;
my $email_body = sprintf $template
, $username, $server, $full_name, $birth_date;
$mail_handler-send($user_name@$server, body = $email_body);
}
};
# Here most of the work gets done.
Thread_Process($servers_qry, $email_qry, $args_ref, $mailer_sub, []);
}
/pre
Of course, this is somewhat of a contrived example, and gives you little
in the way of feedback or error handling. But it's an example of how
to use the ttThread_Process/tt subroutine. The mailer subroutine
gets its tt$mail_hander/tt and tt$template/tt from being within
the ttSend_mail_to_everyone/tt routine.P
There are two problems I've discovered so far. The first is that trying
to do any kind of database operation within the subroutine doesn't work,
because the database handle needs to be cloned. On the systems I've
tested this on, unfortunately, tt$dbh-clone/tt seems to be a no-op
and the DBI engine complains that a different thread is using the database
handle. I've tried passing tt$dbh-clone/tt to the handler function,
and doing the clone inside the handler function, but they change nothing.P
More annoying is the fact that the memory used by the process continues
to rise even if the number of outstanding rows is constant or dropping.
I haven't traced this down, and haven't really the time now, but it seems
to be related to the Thread::Queue object - I've tested variations of my
handler routine that reuse existing memory rather than doing ttundef
@array/tt and ttpush @array, $data/tt in the handler, and this
changes little.P
What I don't know yet is whether either to package this up as a Perl
module and start being a maintainer or whether it's too trivial or not
generalised enough to be useful for anyone but me.
-
Posted: October 9th, 2008, 5:11am CEST
I bought a Stereo Headset Kit at Landmark Computers in Braddon the
other day. This consists of a pair of wireless headphones, a bluetooth
dongle that functions as a stereo encoder, a CD, a USB cable, a charger
and some basic instructions. It's almost impossible to find out exactly
who made this - there's no actual brand on the box or devices and the
only identifiable branding is of the USB connection software. The
software does have a Linux version available but (almost inevitably)
it isn't supplied - the disk is really Windows-only.P
The dongle has a switch that allows it to function in either USB or
Audio mode. In USB mode it is a fully-featured USB Bluetooth dongle
- plugging it into my Fedora 9 install allowed me to see all nearby
Bluetooth phones, computers and the headset. I haven't tried to see
if I can get it to function as a Bluetooth audio device, but PulseAudio
does apparently provide this. In Audio mode, it encodes input from the
headphone jack on the dongle and sends it to the paired headset. This
allows you to use other devices such as computers, phones and music
players that don't have Bluetooth capability.P
The headset supports the A2DP profile, which basically supports
(reasonable quality) stereo audio over Bluetooth. The quality and the
stereo separation are quite good and, although it might not be up to
full studio monitoring quality, it is easily capable of delivering
good quality audio for everyday use. It also supports the headset
profile for phones that don't have A2DP capability, but the headphones
don't have a microphone so you can't use it as a full headset.P
The headphones are comfortable even after a couple of hours of use. They
sit around the back of the head, and even for people who have a large
skull (such as myself) they don't press in uncomfortably. They can also
fold to be flat so they can easily fit in a pocket when not in use. The
right speaker has a volume up/down control, a skip forward/back control
(for phones that support such control) and a main button that can be
used to turn the unit off and on and put it in pairing mode.P
These are not a cheap device, at around $110. However, they are cheaper
than many of the brand-name devices and are more comfortable than the
BlueAnt X5s that I tried a while back. The larger speaker gives them a
better bass response than smaller earphones and the lack of cord
prevents all sorts of tangles and trip-ups. As someone who seems prone
to turning away from the computer and pulling the earphones out of my
ears by accident (and force), that's a good thing.P
The major downside so far has been that, while they give perfectly good
stereo audio between the encoder dongle and the headphones, the other
two devices I've tried both have bizarre and annoying behaviour that
makes them nearly unusuable. My phone, a Nokia 5310 XpressMusic easily
capable of A2DP, will drop them down from A2DP to Headset protocol,
detectable as a flat mono signal, and then eventually (in three tests)
drop them altogether, often getting wedged on the song being played
back (a different song each time which has played normally otherwise, so
that wasn't the problem). This wedges the headphones too, requiring a
little press of the hidden reset button with a handy bent paperclip.
Don't have one to hand? Too bad. (Note to young players - the little
hole beneath the reset button is actually to seal the rubber protector
in place, and should not be poked into unless you want to put a
damaging hole in the speaker diaphragm. And you don't.)P
The computer was even worse. I got the laptop bluetooth working with
the instructions at a href=http://fedoraforum.org/forum/showthread.php?t=190468http://fedoraforum.org/forum/showthread.php?t=190468/a
and it all came through nicely. For two minutes. Then it went to
Insanely Loud Mode. Once I'd dialled back all the settings in
PulseAudio (which, for reasons as yet unclear, muted the audio
completely at 60% main volume or 40% RhythmBox volume) it was listenable,
although you could tell there was hard clipping going on somewhere
before the volume reduction stage (audible as a 'crackliness' to the
sound). Then, two minutes later, it dropped back to completely
inaudible, and only by turning all the volumes up again did anything
come out. Two minutes later it cycled back to insanely loud and kept
doing this as long as I was prepared to put up with it. Adjusting the
volume on the headset seemed to do little, although when I later
connected it to my phone for a second test the volume on the headset
was turned up very loud, and changing the volume on the headset altered
the volume on the phone. So I assume that something in PulseAudio was
'helpfully' adjusting the volume, for reasons as yet unclear.P
I haven't tested it with anything else that outputs A2DP via Bluetooth,
so I haven't any other benchmarks to work against. But so far this is
a device that works perfectly with its own adapter and appallingly
with everything else; not a trait that endears it to me.
-
Posted: September 9th, 2008, 2:54am CEST
I had a realisation last night that there's a new word that I suspect will
be entering the news lexicon soon. That word isp
ddbEnviropath/b/dd
dtAn benviropath/b is a person or company who has a warped or distorted
view of how to treat the environment, most commonly seeing it simply as
something to exploit without consequence. Just as a sociopath cares little
about their effect on society, and a psychopath cares little for their
effect on people's psychologies, an enviropath cares little about their
effect on the environment in the course of doing what they want./dtp
The Urban Dictionary, which I won't link to here, has an alternate definition
which basically is a derogatory term for someone too obsessed with the
environment. I don't think this is using the i-pathy/i suffix - meaning
a href=http://www.hospitalhelp.co.uk/general/operation_terminology.html'suffering
or disease'/a - correctly; but then I'm sure the Urban Dictionary doesn't
really care.P
What it comes down to, for me, is that I believe that there are people and
companies whose view point on the Earth and the natural world is that it is
simply there for exploitation. They seem to believe that we can not just
keep on doing what we've been doing, but actually find new ways to exploit
the world, and the consequences simply don't apply to them. In this, my
basic stance is completely the opposite - I believe it's time to do
everything we possibly can to save the planet we live in. I also side with
my dad's line of reasoning on this, in that I can afford to be wrong, but
they can't.
-
Posted: August 26th, 2008, 8:57am CEST
There is a state in playing a href=http://en.wikipedia.org/wiki/Go_(board_game)Go/a
where one recognises that a move might seem to give one a small gain in
pieces now but gives more power to ones opponent in the long run. While
I still struggle with this, and the larger question of 'what should I
play so that I ido/i gain advantage over my opponent in the long run'
is one I still find exceptionally difficult to grasp, I have at least
started to recognise that getting a single eye now may actually give my
opponent a double eye later.P
It occurs to me, albeit as a layman with little knowledge of the real
processes of law in and out of the courts, that there is a common
pattern to high-profile law cases. If the objective is for A to
win over B, then it is:P
ol
liA sues B and wins/li
liB appeals against the judgement, brings in new arguments and wins./li
liA appeals against that decision in the high court, brings in the full
arsenal, and wins./li
/ol
B has lost because they have no higher court to appeal to. B has also
lost because it has let itself be put in this position.P
So what's odd in the whole Nine versus IceTV is that Nine has done this:P
ol
liNine sues IceTV and iloses/i/li
liNine appeals against the judgement, brings in new arguments and wins./li
liIceTV appeals against that decision in the high court.../li
/ol
Substituting Nine for B and IceTV for A in the pattern, therefore, means
that it has allowed itself to be snookered by IceTV. Not only that, but
the a href=http://www.austlii.edu.au/au/cases/cth/FCAFC/2008/71.htmlappeal
decision/a, in my (again completely layman) view, were rather
skewed: calling Nine's last minute channel changes 'creative input' is a
rather large stretch, whereas calling them 'bungles' is probably nearer
the mark. Then arguing that those changes then become not mere facts
(that can be copied) but are promoted to copyrightable material is to
call anything that a human being has any input into a creative process.
It's easy to come up with counter-examples - copying numbers from a book,
or assembling cars - but what may be more important is that this works in
IceTV's favour, in that by the same rule IceTV are then putting creative
input into the schedule and are therefore also making a creative work which
is distinct from Nine's schedule by that very fact.P
I'm sure the legal minefield starts well back at the start of that
previous paragraph, and so I defer
to Kim Weatherall and other experts, but when courts start handing down
legal judgements that imply that almost any information is copywritable
by someone makes the whole existence of facts in the public domain highly
tenuous. Can someone copyright my name? My address? Do I somehow own a
copyright to my particular choice of phone number and address that means
that Telstra owes me money every time they print a phone book? (Note here
that when it came to moving house most recently, I was given the choice of
a couple of numbers by Telstra and I chose the one I liked - therefore, it
wasn't Telstra's creative input that determined my phone number, it was
mine.) If someone uses the word PaulWay in a way that I don't like,
and I've been using it since 1992 and therefore have 15 years of
established usage to back it up (again, having chosen that name creatively),
can I sue them for copyright infringement without ever having to register
it as a trademark? And if it's a copyright infringement, do I get those
penalties that the APRA and ACA and so forth have fought for - penalties
that are much worse than if it was just a defamation or trademark
infringement case? Can you go to prison for creating a post-it note that
copies your bus timetable or a person's phone number?P
Yes, I know, it's all wild speculation. But this whole judgement feels
completely at odds with how people really think about facts and raw
information. While I respect the old style of directory compilation, to
me it still doesn't equate to a monopoly on the information so collected.
The whole sweat of the brow protection - that the labour itself makes
it enough to be protected - doesn't wash with me, especially in a world
where facts, information, opinions and news wash over us almost
continually.P
Anyway, back to my point. I think that Nine has, in their attempt to
get their way in the short term, actually meant that IceTV will triumph
in the end. By presenting a case based on such a skewed interpretation
of the Australian copyright laws as they apply to facts and information,
they've opened it up to the High Court leaning in the opposite direction
and blowing Nine out of the water (and, I'd say, causing a considerable
re-evaluation of the Desktop Systems vs Telstra case).
-
Posted: August 22nd, 2008, 10:01am CEST
At the moment, recycling is by and large a voluntary affair. We
private citizens mostly have recycling bins, and a reasonable
proportion of the populace put the correct stuff in them. Companies
and Government too are catching on, with recycling bins appearing in
tea rooms and beside desks and photocopiers. I've even been bringing
my own compost bin into work, and that's been getting a reasonable
quantity of scraps in it.P
However, it seems to me that there are two barriers to this being a
much more wide-spread and profitable industry. The first is that in
many places it's difficult to know exactly what can be recycled. In
many instances, things which can be recycled aren't marked with the
appropriate symbols, or the bins which take the recycling aren't marked
to say what exactly they can take. As another example, if you move
house in Melbourne (for example) what you can actually put in your
recycling bin, as well as its size, can vary dramatically. In my view,
people will tend to be conservative and not put things in the recycling
bin which could be recycled in case they can't, instead of the more
optimistic opposite approach.P
But it seems to me that this is a minor concern compared with the
fundamental problem, which is illustrated in my first sentence. The
fact that it's completely voluntary, combined with the complete
absence of any feedback regarding whether you're doing the right
thing or not, means that the wasters out there have absolutely no
incentive to change. They can keep on throwing their cans, cardboard,
plastic boxes and bottles and paper into the garbage and it will keep
on being merrily taken away and put into landfill, and they never
have to lift a finger to change.P
As a case in point, I noticed on the way into my work that there is a
large skip outside the deliveries entrance. It's being used because
there are building renovations going on and the scrap material is
going into the bin. It was quite easy for me to see that there were
may cardboard boxes and metal wall divisions, all of which could be
easily recycled. While I know that a couple of the waste skip hire
companies in Canberra do actually send all their rubbish through the
a href=http://www.skipbins.com/actrcc.htmrecycling centre/a here,
I'll bet three to one that the majority of skip hire companies in most
other capital cities in Australia don't do this. Canberra has an
aggressive No Waste by 2010 policy, but how the ACT Government intends
to get that last 10% fixed in the sixteen months remaining is beyond
me.P
Imagine, for a moment, random house bin inspections. A note in your
letterbox gives you a score of how good you are at recycling, and
what things you may have missed. Houses with good scores might
receive a discount on their rates, and houses at the bottom end might
recieve fines (to compensate). A follow-up with the worst offenders
in a week or two might find other ways that the household could
reduce their waste, energy use and costs. A similar scheme for
companies would be easy to implement, and for businesses that have a
lot of variety in their waste types - restaurants and builders, for
example - might be linked up with other programmes (such as worm
farms for spoilt food waste or recycled building supplies resellers)
to help them reduce their waste output or get it going to the best
use available.P
The one great flaw in this plan, however, is that Governments have
tried to avoid any confrontation with the public - any situation
where they have to tell people to change their ways for the good of
society. There are obvious exceptions, but the key difference I see
between this kind of recycling enforcement and a programme to get
dangerous cars off the road or to curb violent behaviour is that
the latter things break laws and are 'provably' dangerous to other
people. On soft issues like good parenting, good recycling or good
social responsibility, the Government has heard the NIMBY and Nanny
State lobbyists and realised that it's much easier to get people to
do something if opposition can be branded as somehow bad. It's much
easier to get people to give up their civil liberties and freedoms
if you can say that anyone who wants to walk around taking pictures
of arbitrary places (for example) must be a terrorist.P
Ahem. Got carried away there.P
Anyway, the other side to this is for state, territory and federal
Governments to make sure that they aren't providing unnecessary
subsidies to industries that are deliberately wasting resources. If
these companies can't see the writing on the wall when it comes to
climate change, then should we really be propping them up? Lobbyists
from the coal power industry love to say how other methods of power
generation aren't profitable, while conveniently overlooking the
hundreds of millions of dollars in funding that they get from the
Government to shore up their own 'we-can't-do-any-better' behaviour.P
Capitalism gone right, on the other hand, looks like
a href=http://www.skipbins.com/aboutus.htmACT Skip Bins/a.
Other companies might whinge and moan that they can't possibly recycle
everything as it costs too much. Then ACT Skip Bins not only goes
and does it, but then makes money from the recycled materials as well.P
But despite this, I still end up thinking that there are a lot of
people and companies who not only just don't care but don't have to.
And until they get hit in the hip pocket, they won't care either.
-
Posted: August 20th, 2008, 8:13am CEST
If there's one thing anyone that works with computers hates, it's an
error message that is misleading or vague. Syntax Error, Bad Command
Or File Name, General Protection Fault, and so forth have haunted
us for ages; kernel panics, strange reboots, devices that just don't
seem to be recognised by the system, and programs mysteriously
disappearing likewise. The trend has been to give people more
information, and preferably a way to understand what they need to do to
fix the problem.P
I blog this because I've just been struggling with a problem in Django
for the last day or so, and after much experimentation I've finally
discovered what the error really means. Django, being written in Python,
of course comes with huge backtraces, verbose error messages, and neat
formatting of all the data in the hopes that it will give you more to
work with when solving your problem. Unfortunately, this error message
was both wrong - in that the error it was complaining about was not
actually correct - and misleading - in that the real cause of the error
was something else entirely.P
Django has a tturls.py/tt file which defines a set of regular
expressions for URLs, and the appropriate action to take when receiving
each one. So you can set up ttr'/poll/(?Ppoll_id\d+)'/tt as a
URL, and it will call the associated view's method and pass the parameter
ttpoll_id/tt to be whatever the URL contained. In the spirit of
Don't Repeat Yourself, you can also name this URL, for example:P
tturl(r'/poll/(?Ppoll_id\d+)', 'view_poll', name = 'poll_view_one')/ttP
And then in your templates you can say:P
ttlt;a href={{ url poll_view_one poll_id=poll.id }}gt;{{ poll.name }}lt;/agt;/ttP
Django will then find the URL with that name, feed the poll ID in at the
appropriate place in the expression, and there you are - you don't have to
go rewriting all your links when your site structure changes. This, to me,
is a great idea.P
The problem was that Django was reporting that Reverse for
'portal.address_new_in_street' not found. when it was clearly listed
in a clearly working tturls.py/tt file. Finally, I started playing
around with the expression, experimenting with what would work and what
wouldn't in the expression. In this case, the pattern was:P
ttnew/in/(?Psuburb_id\d+)/(?Pstreet[A-Za-z .'-]+)/ttP
When I changed this to:P
ttnew/in/(?Psuburb_id.+)/(?Pstreet.+)/ttP
It suddenly came good. And then I discovered that the the thing being
fed into the 'suburb_id' was not a number, but a string. So what that
error message really means is The pattern you tried to use didn't
match because of format differences between the parameters and the
regular expression. Maybe it means that you can have several patterns
with the same name that will try to match based on the first such pattern
that does so. But until then, I'll remember this; and hopefully someone
else trying to figure out this problem won't butt their head against a
wall for a day like I did.
-
Posted: July 29th, 2008, 5:53am CEST
At work I've started working on a portal written in Python using the Django
framework. And I have to say I'm pretty impressed. Django does large
quantities of magic to make mothe model data accessible, the templating
language is pretty spiffy (it's about on a par with ClearSilver, which I'm
more familiar with - each has bits that the other doesn't do), and the
views and url mapping handling is nice too. I can see this as being a
very attractive platform to get into in the future - I'm already considering
writing my Set Dance Music Database in it just to see what it can do.P
So how do I feel as a Perl programmer writing Python? Pretty good too.
There are obvious differences, and traps for new players, but the fact that
I can dive into something and fairly quickly be fixing bugs and implementing
new features is pretty nice too. Overall, I think that once you get beyond
the relatively trivial details of the structure of the code and how variables
work and so on, what really makes languages strong is their libraries and
interfaces, and this to me is where Perl stands out with its overwhelmingly
successfull CPAN and Python, while slightly less organised from what I've
seen so far, still has a similar level of power.P
About the only criticism
I have is the way the command line option processing is implemented - Python
has tried one way (getopt) which is clearly thinking just like a C
programmer, and another (optparse) which is more object oriented but is
hugely cumbersome to use in its attempt to be flexible. Neither of these
hold a candle to Perl's GetOpt::Long module.
-
Posted: July 25th, 2008, 1:22pm CEST
History has been revised. Thank you.
-
Posted: July 15th, 2008, 1:51am CEST
After that post, I thought I'd just check which category I'd put my previous
limericks in. To my horror, I discovered that I hadn't blogged them at all,
but had (merely) posted them to the Linux Australia list. So I rescued them
and posted them here for posterity.P
blockquote
That wonderful man Andrew Tridgellbr
Over SaMBa keeps permanent vigil.br
SMB, it is said,br
He decodes in his head,br
And CIFS 2 will some day bear his sigil./blockquote
blockquote
The great LGuest programmer Rusty,br
Is virtually never seen dusty.br
He eats 16K pages,br
And has done so for ages,br
Yet his moustache is clean and not crusty./blockquote
blockquote
That marvellous girl Pia Waughbr
Is certainly hard to ignore.br
With her leet ninja moves,br
Open Source just improves -br
All Linux Australians show awe!/blockquote
-
Posted: July 15th, 2008, 1:50am CEST
After the three limericks I wrote about Tridge, Pia and Rusty, the conversation
came up on #linux-aus about whether I could make a similar epgiram for Jon
Oxer, former Linux Australia president, front-line hardware hacker and all-round
good guy. It took me two months, but in an email to Jon I finally cracked it,
packing much more into the rhyme than I originally thought would be possible:P
blockquote
The wireless Jonathan Oxer,br
Waves his hand and his front door unloxer.br
A remote-control loo,br
And home theatre too -br
If you as me, his whole house just roxor!/blockquote
Who's next, I wonder?P
blockquote
We tune to podcasting James Purser,br
Long known as a rhymer and verser.br
With his darling wife Karinbr
They are not known as barren:br
Three children now stare at their cursor./blockquote
Steve Walsh, however, is going to take a bit more thinking about.P
Send your suggestions of who should be next under the pen to
a href=mailto:paulway#64;mabula.netpaulway#64;mabula.net/a
-
Posted: July 10th, 2008, 12:50am CEST
A couple of days ago I missed a couple of phone calls from one of Kate's
family. When I finally got back to her it was to find out that she'd
objected to me putting photos of her daughters (my nieces through Kate)
on the internet, and blogging about her and her family. The photos I can
vaguely understand - I had already put another bunch of photos from
another family outing under a password-protected part of the gallery, but
this group - which only features one photo of her eldest daughter -
hadn't gone under that stricture yet. They are now.
There are two things that gall me about this incident. The first is that
she has not actually seen what I had on my blog or my gallery - they
don't have access to the internet at home and she uses it at her part
time work only sparingly. She was prepared to accuse me of some nameless
terror against her children, some breaking of trust, based purely on
what her brother had (inadvertently) reported to her. He, it should be
said, takes much the same attitude - that any personal details including
photographs can be somehow used against you in the future. Again, he
hasn't read through my blog to see whether I am actually discreet or not
- I think I am - but is prepared to just put the blanket statement down
and say that I shouldn't write about them or post pictures of them.
The second thing that galls me here is what I refer to as "somehow used
against you" and "nameless terror". It's just basic paranoia combined
with ignorance. They have no actual idea of the threats that are out
there or whether the above disclosures of information are in any way
likely to lead to any real danger, but they're going to shut me up and
tell me off just in case. It doesn't satisfy them, either, because
they only come up with some more prepostorous "nameless terror" that
might befall their children or themselves because of the next imagined
problem.
In Kate's sister's defence, apparently friends of theirs have had some
acrimonious fall-out with photos of daughters being posted on the
internet. And I can well understand that Kate's sister may not want
to divulge too many details of this family to protect whatever privacy
they have left. But this is all sounding like yet another "friend of a
friend" story. From what little detail I have I would propose that
this family was in much more danger from their own members knowing each
other's phone numbers, bank account details, and whereabouts - a bunch
of photos on the internet is hardly the great threat that it sounds.
From what I know - and, to borrow a phrase overused a couple of nights
ago for entirely different reasons, I am prepared to change my belief
if sufficient proof otherwise is provided - there has been no case of
people dangerous to children being found with photos of random
children from the internet in perfectly ordinary situations. The
paedophile rings that I've heard busted have traded photos exclusively
within their own group and they are photos taken by them of children
"in their power". In other words, my photos of Kate's nieces are
hardly a danger to them or their family.
It's not unlike the recent kerfuffle over Bill Henson's photos -
although his photos are (in my opinion) much more controversial, they
are still hardly likely to be the subject of or cause any paedophilic
behaviour. But the masses, uneducated in the actual threats and their
likelihood, are prepared to go on making wild accusations in order to
assuage their latest paranoid fantasy.
I've had my name, birthday and post office box on my website for years.
There has never been any problem caused by that. No-one has
ever used it to steal my identity, no-one has ever sent me unsolicited
post, and no trouble has ever been caused by it. On the other hand,
I just got a phishing spam the other day asking for my username,
password and date of birth, and I'm sure that there are uneducated
idiots out there that would thoughtlessly respond despite the email's
obvious lack of personal identification and simple spelling and grammar
mistakes. Which is the greater threat? Which should we be realistically
guarding against?
It would be petty of me - but quite apposite - to reciprocate by telling
them, if they ever ask me to help get them set up on the internet, to
tell them that I've never seen how they use the internet but since they
are obviously unaware of the dangers of spam and viruses I'd better
make sure they never use the internet just in case.
-
Posted: July 2nd, 2008, 2:29am CEST
I've just started work on Monday at my new employer,
a href=http://www.transact.com.auTransACT/A, a fibre and copper
communications provider in (as the name implies) the Australian
Capital Territory. I've read through the employee handbook, done all
the financial documentation, been given a computer and installed Fedora
9 on it. The majority of the team here use Mac Minis as their desktop
machines, because there's a high requirement to use Unix commands to
manage the network infrastructure. Of course, we still have to hook
into the Microsoft Windows support infrastructure, but that's hardly a
challenge these days.P
The reason I mention this is because TransACT and its parent company
ActewAGL are featured on Microsoft Australia's
a href=http://www.microsoft.com/australia/windowsserversystem/getthefacts/default.mspxGet
The Facts/a pages as some kind of 'shining example' of a company
that Wave[d] Goodbye To Linux and somehow saved money. The Ifacts/I
are radically different, even from the small sample I've seen so far. All
the network infrastructure, from the set top boxes to the DHCP servers to
the encryption server for the IPTV, run on some kind of Unix - Debian
Linux seems to be the predominate flavour. Microsoft's case study is
really just a small part of TransACT and ActewAGL's business, and it's
hardly waved goodbye to Linux in the organisation.