Search

Friends

Atomspheric CO2 (PPM)

Archives

Blather

Uptime verified by Wormly.com

31 August 2008

Clean Coal

I don't know much about the science of clean coal, but I've been rather skeptical of all the clean coal skeptics. It tends to be framed as an enormous waste of investment with no returns and all. It's possibility of "clean" coal is supposedly a total myth. But I tend to doubt that kind of black and white analysis. I don't think the government would put $500 million into something with no prospects at all. I'm a little cynical about the government, but not that cynical yet. Still, I have only skeptical friends but I wasn't fully convinced by them.

But I recently read an article about clean coal subsidies from government, and specifically government insurance of long-term storage facilities. So companies would have to insure their storage against accidental release for a decade or so, but if anything went wrong after that the government would step in and pay for it. Or at least the government would cover the costs of insuring against accidents. The argument for this subsidy is that the industry won't be viable with out government support. And we're not just talking about short-term viability - but viability over 50 years. Which is surely reason to be suspicious. The industry apparently cannot be profitable if it has to cover all the costs of long-term storage.

The Greens were asking in parliament why the government should subsidise the industry. The government responded that we need to have clean coal, and the subsidy is the only way we will get it. That is rather strange. I suspect the solar power industry would flourish, completely absent of any subsidies, if the government stopped covering the arses of coal power plants by allow them to pollute for free. They're talking about solar power that will be cost-competitive with coal power in 10 years and that's with a slow carbon tax phase in.

MP Dick Adams claims "we need to find ways to assist the industry to begin." I don't think that insuring a company forever, against any cost shortcuts and mistakes it makes now is really a reasonable way of doing that.

Another interesting comment from Dick Adams was that since a lot of the clean coal operators would cease to exist, the government would assume long-term liability by default. If he really thinks the free market works so poorly, that a company can't assume long-term responsibility for it's infrastructure, then he probably needs to reflect a little hard on why he's supporting private industry here to begin with. I'm inclined to agree that free markets are only functional in the short term, but I'd suggest that the government run or regulate anything that needs a longer-term perspective. Just absorbing the long-term costs while allowing the immediate benefits to accrue to the private sector strikes me as rather stupid.

Once again, I'm surprised to discover that the Greens have given the economics of an issue a lot more thought than the other guy.

30 August 2008

Cancer & Bowel Research

A fellow came to our door just then. He was rather short and withdrawn and asked me gently if I would like to buy a raffle ticket for the Cancer & Bowel Research Trust. I decided I would buy one so I went into my coin bowl and got all the 50c and 20c coins I could find. I counted them out to him and it added up to $7. So I got two raffles tickets. He was ambiguously pleased and said that I'd equalled the record donation for the day. He'd been working for 6 hours and had got $100 worth of donations. He was a bit overwhelmed by the thought of it, and I felt quite sad about it. He left, but after a moment I decided to chase after him and give him the $50 note I had in my wallet. I have lots of money this month because I'm doing poverty budget - I don't think charitable donations are included in the "disposable income" bit thankfully. He was quite surprised, but I didn't really want more raffle tickets so I trotted off. He came back to the house 5 minutes later with a fistful of raffle tickets and two good pens. I just tested one of them out, and they are really nice pens indeed.

29 August 2008

Waiting cursor during Prototype’s Ajax.Request

In your stylesheet:

body.waiting {
  cursor: wait;
}

In your script:

document.body.addClassName('waiting');
new Ajax.Request(uri, {
  onComplete: function() {
    document.body.removeClassName('waiting');
  }
});

You probably want to be careful to make sure it's in the onComplete method and not the onSuccess method. Even better might be to create a setTimeout("document.body.removeClassName('waiting')", 3000), so you don't break the cursor for the rest of the page visit.

You also might prefer the "progress" instead of the "waiting" cursor. For other cursors and their compatibility check out QuirksMode.

Acer TravelMate 8200

I bought a totally sweet Acer TravelMate 8200 for $330 from GraysOnline. It's got 2GB RAM with an Intel Core Duo 2GHZ. It's super quick. Even has a dual layer DVD burner and a 256MB ATI video card.

I just put Hardy Heron on it and it all worked fine. Except for the wireless, which required me to apt-get install linux-ubuntu-modules-.... The wireless light still doesn't come on with the wireless button, but it does turn the wireless on and off.

I'm not even going to bother dual-booting Windows XP on this laptop. That's partly because I'm so amazingly elite, but mostly because all I do on Windows is play Rome: Total War and it's hurting my social/love life.

Acer TravelMate 8200

26 August 2008

Train Trippery

I have booked my train tickets to Alice Springs. I had plans to maybe fly one way because there is a three night "overnight" in Adelaide on the way there. But it worked out a bit silly with one-way fares, so I'm going on trains both ways. I'll spend 5 days getting there and 3 days getting back. I will have lots of time to think and read and look out the window. Even with three nights accomodation in Adelaide, it's still cheaper than flying. $398 is all for fully return tickets. And I can use the lounge, which has powerpoints for laptops. Hurray.

I'm leaving on the September 6th and getting back on October 1st, and I start at L'Arche (if they've decided I'm OK) on October 2nd.

22 August 2008

Teams

I was at Rough Edges a while back. It was a football night and a good night. Laurie, Ben & Amy were away so it was a bit of a mixed team. But despite that, and even though the Queensland sympathisers didn't get what they came for, the night went well.

I decided that I like being a team leader. I like the way it forces me to be available to people. It stops me from just muddling along in my own head and makes me conscious of the people around me. I start to care more about how everyone feels, mostly because it helps to have a sense of when something is going to go wrong.

I haven't been a team leader much lately - I think mostly because I was too daffy and unassertive - but it was good. I suppose it doesn't matter that much now I'm leaving. Next week is my last week. But I had always assumed that I would hate leading or being in charge of anything. And I tend to act like I don't enjoy it a bit. But I do.

Coase and the Cost of Adaptation

I've written about Coase Theorem before. But I had another thought about it. The idea of the theorem is that it doesn't matter who gets the right to decide what happens to things (or who gets the property rights), the outcome should be the same. Theoretically, the two (or more parties) will negotiate and the optimal use of the resource will be figured out. The benefits of using the resource as well as it can be used mean that everyone can have a bit more stuff. There are plenty of issues with it - unequal incomes, difficulty monetising the "vibe" of things that people enjoy, and the fact that people don't really negotiate with each other that much. But even so it does have some sense to it and it is used a lot by governments to justify their decisions.

The government will use it to say that it doesn't matter if they give land rights to indigenous people or mining companies. If indigenous people get it the mining company will just pay them to leave. If the mining company gets it they will make people leave without paying them. The second option might not seem "fair", but of course, in economics there is No Such Thing as fair. And even though it isn't fair the economists are happy because the land really should be used for mining because that is clearly its most productive use. Or at least that is the reasoning.

I think that is all quite silly, however even if you think it's reasonable I don't think you can be indifferent between who gets the property rights in the first place. The government largely assigns property rights arbitrarily. There is really no way around this, which I suppose is one of the dumb things about property in the first place. When the government assigns rights to one party, it is effectively imposing costs on the other party. They're either going to have to forgo a whole lot of benefit or buy that benefit from the other party. Often those costs are enormous, as in the case of communities moving to make way for big developers.

I'd suggest that those costs (which should of the same magnitude for whichever party doesn't get the property rights) are more difficult to absorb for the less organised party. Even if you think they can both negotiate equally, the more organised party will be better able to insure themselves against large, uncertain costs. Mining companies do it by distributing shares amongst a large number of people. Indigenous communities have to just get up and move.

It's hard to imagine an aboriginal community insuring itself against the possibility of losing a court case which forces them to move to another town. It's very easy to imagine a mining company insuring itself against the possibility of losing a court case which prevents them from mining somewhere they hoped to mine.

The ease with which a mining company can adapt to change makes the cost of that uncertainty or the arbitrariness of the government's/court's decision far more manageable. It is also a purely monetary cost which is easier to distribute over time or amongst others.

So I would suggest that in a disagreement between two parties, the property rights should always be given to the party least able to protect itself from the costs of not having those rights. According to Coase, this shouldn't affect ease of development at all. The mining companies can still buy the right to mine from the little guy if it's really the most productive use of the land. But by biasing your decisions towards the weaker party society can benefit from better risk distribution which comes entirely for free.

assert_change

The assert_difference test method in Rails is nice, but I found myself wanting a bit more flexibility. Like passing arguments to the method, not having to specify the exact change and checking for changes to things apart from numbers. So I wrote this. It gives you assert_change and assert_no_change which really just run the same thing twice. You could use a lambda sort of thing instead, which might be clearer. And it probably needs some kind of way of attaching a message. But I am mostly happy with it.

module Test::Unit::AssertChangeHelper
  def assert_change(object, *args, &block)
    old, new = before_and_after(object, *args, &block)
    assert_not_equal old, new
  end

  def assert_no_change(object, *args, &block)
    old, new = before_and_after(object, *args, &block)
    assert_equal old, new
  end

  protected
  def before_and_after(object, *args, &block)
    old = object.send(*args)
    block.call
    new = object.send(*args)
    return old, new
  end
end

You would use it like this:

assert_change(Visit, :find, :all, :conditions => ['is_exception = 1']) do
  Visit.create(options)
end

self.use_transactional_fixtures

Fixtures are slow. Even with a small project with hopeless test coverage the tests were taking over a minute. Which possibly doesn't seem like much to hardcore types, but I'm not hardcore.

I finally decided to experiment with using transactional fixtures to speed things up. In theory, I would expect it to work fine. I didn't think nested transactions were a problem. Apparently it doesn't cope with nested transactions (or possibly just certain kinds). However, you can turn it on by default and turn it off for certain tests.

So in your test_helper.rb file you can do this:

class Test::Unit::TestCase
  self.use_transactional_fixtures = true
end

and in your test for some transaction-needy controller you can do this:

class ContactsControllerTest < Test::Unit::TestCase
  self.use_transactional_fixtures = false 
  # Your tests and stuff
end

My test time dropped to 33 seconds from something like 70 seconds. And I am happier and have more time for other things like making tea at work.

21 August 2008

Falling prices do not increase stupid mortgage burden

I was reading the paper today and I found yet another article about how decreasing prices are putting more pressure on people's mortgages. Which seems to me very weird. As prices go down people possibly feel more stupid for paying so much, but it doesn't have any impact on their ability to pay the mortgage. Unless they're possibly doing some silly leveraging thing where the bank gets scared about equity and repossesses the house (or probably several). But the battlers these articles like talking about don't tend to own many leveraged properties, so I don't think this affects them.

If anything, dropping house prices reduce the burden on the average house owner. More people are able to buy houses with smaller mortgages. I don't understand how journalists think the price boom can be bad for home-buyers, and then the price crash is also bad.

There was an article in the Epoch Times called "Falling prices increase mortgage burden", which prompted this rant. But they definitely aren't the only ones saying this kind of thing.

18 August 2008

Lounge room as film set


Lounge room as film set, originally uploaded by Nutloaf.

We finished shooting the film my friend is making yesterday. Some day of it was in my house. It was really cool having all this cool equipment and lighting everywhere. I hope my friend gets famous, because this is her first real film and my house is one of the stars.

14 August 2008

locale: Cannot set LC_CTYPE to default locale

I get this problem a lot.

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_AU.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

I think possibly this solves it.

$ sudo apt-get install --reinstall language-pack-en

It says comforting things like...

Generating locales...
  en_AU.UTF-8... done
  en_BW.UTF-8... done

Update: Except it didn't work. But maybe this will.

$ sudo localedef -i en_AU -f UTF8 en_AU.utf8

13 August 2008

Server Hotlinking

I've disabled image hotlinking on the smurf server because I didn't know how to measure what bandwidth hotlinked images were consuming and I suspected they were using a lot. It shouldn't have any impact on anyone unless you're hotlinking images. If you don't know what hotlinking is, then you aren't doing it.

Trains and Planes

Ha! I thought that planes were pretty much always cheaper than trains for long distances. But it turns out they aren't. If you're willing to take days instead of hours and sleep in a chair for all those days. I have a scheme to go to Alice Springs for September and I don't want to fly. But I thought I would pay heaps for a return train fare. As it turns out you can get super budget returns from Sydney to Alice Springs for $398 going on The Indian Pacific and The Ghan.

The cheapest equivalent flight costs $544 return, and the value isn't nearly so good because it only lasts a few hours.

So I reckon catching a train is my plan. If I had a bit longer I'd get the unlimited train travel for 6 months ticket for $590. That would be amazingly brilliant, but I'd spend the whole month on trains if I trained it to Darwin and Perth as well.

ALDI has fair trade organic tea

Always pushing the boundaries, ALDI now has fair trade tea and coffee. Most of the big supermarkets I go to don't even have fair trade tea (coffee seems to be the popular one). So good on you ALDI. You make me so happy.

They also have full-on drill presses for $49.95. Brilliant.

Update: The tea is actually good too.

12 August 2008

Apache 2, mod_passenger and HTTP Authentication

Using Lighttpd and FastCGI for Rails you can use Lighty's HTTP Authentication to "protect" an application. But the equivalent doesn't work with Apache 2. Putting the Apache authentication stuff in a <Directory> block will protect all the styles and scripts but no the application itself. You need to use a <Location> block for that.

<Location /*>
    AuthType Basic
    AuthName "Beta Testing"
    AuthUserFile /path/to/htpasswd
    Require valid-user
</Location>

10 August 2008

Forestry Hearing

On Friday, I had the hearing for my East Gippsland naughtiness in December 2007. It's been adjourned a couple of times, but at 10am yesterday we finally made it to court. I was fortunate enough to have Vanessa, from Bleyer Lawyers, represent me for pro bono. The hearing went well. The magistrate was really good. Luckily he didn't much like logging and he made some good deadpan magistratery jokes about it.

I asked not to get a good behaviour bond because I didn't think I had exhibited bad behaviour. He thought I was a duffer for doing that and tried to talk me out of it. But luckily you can't be forced to sign a good behaviour bond and I got a fine instead.

So now I have a police record and when I get pulled over by the highway police I will have priors. I am suddenly the kind of person they will probably shoot if I get fidgety during RBTs.

7 August 2008

Guantanamo Bay prisoners definitely guilty

The Pentagon has announced that a lot of Guantanamo Bay prisoners will never be released even if they are found innocent in their trial. According to the Pentagon, these people are simply too dangerous for the US and the world to ever be released. Good thing they are looking out for the world and saving the world the inconvenience of having to think about these things for ourselves. Dealing with terrorism is obviously very tricky and something best left our self-appointed experts.

6 August 2008

Taser Shockwave

Those guys are totally wack. I was sure it was a spoof until the very end.

5 August 2008

Magic quotes and addslashes

I think I may have found a slightly nicer (and safer) solution than I've previously found to the problem of the PHP's magic_quotes_gpc. When you're converting old applications you don't want to just replace all the addslashes() with a conditional escaping method. Or just unquote all your form input on the assumption that the programmer was sensible. Your input won't necessarily come from forms or cookies, so that might reduce your security. You still want to escape everything that goes into the function, but maybe you want run stripslashes() on it first if you think it's probably GPC data and magic quoting is turned on.

<?php
function gpc_escape($str) {
    if(1 == get_magic_quotes_gpc()) {
        return mysql_escape_string(stripslashes($str));
    }
    else {
        return mysql_escape_string($str);
    }
}
?>

Then you can do something like:

$ find . -name *.php | xargs perl -pi -e 's/addslashes/gpc_escape/g'

0.149 seconds