Audible book #fail

Media

We're sorry. Due to publishing rights restrictions, we are not authorized to sell this item in the country where you live.

I don't think it's Audible's fault, but that doesn't make it any less irritating or dissapointing, I heard amazing things about that book. Hey, "heard" amazing things, that was an above average pun for me.

Fortunately that was the first time that happened, every other book I've been able to get without problems.


Going to see Bebel Gilberto!

Media

Movimento by Bebel Gilberto

Just a quick heads up, my dad and I just bought tickets to go see Bebel Gilberto in Singapore! I'm so giddy with happiness I could launch myself into the air and bash my head on the ceiling. Which I won't do so I don't have to deal with medical forms.

That is all ^_^.


Main methods in Python, Ruby, Java stuff

Software

Main Street

I've decided to put my code snippets blog idea on hold because I don't have time to be maintaining a separate blog right now. Had I started it, this would have gone there.

Not having main methods never used to worry me, but since studying Java again I really like being able to have an application kick into action without having to create an instance of it manually.

To illustrate what I mean, here's a crappy Java application that I merely have to execute from the command line for it to display Bender's favourite words.

MainInJava.java:
public class MainInJava
{
  public static void main(String[] args)
  {
    System.out.println("Kiss my shiny metal arse");
  }
}

Now here are roughly equivalent applications written in Ruby (my formerly favourite scripting language) and Python (my formerly favourite scripting language, and now my favourite scripting language again!):

MainInRuby.rb:
#!/usr/bin/env ruby -w
class MainInRuby
  def initialize()
    puts("Hello, world!")
  end
end
MainInPython.py:
#!/usr/bin/env python -3t
class MainInPython:
    def __main__(self):
        print("Hello, world!")

If you were to run either of these example applications, nothing would happen. The initialize and main methods aren't run because merely running the application doesn't do any instantiation. Ruby and Python expect you to create and run an instance of the application in the source.

The proposed workarounds if you really want Java-ish main method equivalents in these languages are to write these lines of boilerplate outside the class.

MainInRuby.rb:
if __FILE__ == $PROGRAM_NAME
  # Put "main" code here
end
MainInPython.py:
if __name__ == "__main__":
    main()

I understand what these functions do, but for scripting languages that pride themselves on making life easier compared to heavy languages like Java, these don't seem all that intuitive or elegant.

I suppose one could argue that I've been corrupted into thinking I need a main method and that I haven't bothered to learn the Ruby or Python way of doing things. They may be onto something ^_^.

__EXIT__

Launching my code snippet site… maybe…

Software

Icon from the Tango Desktop ProjectIcon from the Tango Desktop Project

Given it's my birthday and all that, I thought I'd use the time to announce an announcement: I [might be] starting a new blog thingy for code snippets!

Here’s what I was thinking

When I'm stuck on a problem often it isn't the huge projects people have made public online that help me, they're little code snippets that show how to do something, how something works, or that elegantly demonstrate a concept. Other times I discover or learn how to do something myself and I make a note of it. These go for programming languages, package managers, resource and configuration files, how to talk to girls… wait, scratch that last one.

Over the years I've hoarded a ton of these gems, and it occurred to me: why not make them public? I already blog way too much here, so I figured I could start a new blog where each post is just a snippet, and each will be tagged with the platform and language. Kinda like my current dotfiles folder on RubenSchade.com but with links. No extra fluff.

I'm aware of a ton of sites that let you share code snippets, but I'd prefer to keep things in house. I already import my tweets each day because the idea of having my data on a server I don't control worries me. Plus it'll be more fun :).

I'm thinking of resurrecting my old Perl FastCGI script from the old days this blog back when it was on the RubenerdShow.com domain, I wrote it to be fast and it used more crypto than a nuclear submarine, plus it works on an SQLite database which kept things simple. Come to think of it, I forget why I moved off it in the first place.

Anyway stay tuned!


It’s my Jack Bauer, 42 backwards birthday

Thoughts

Me

It's official folks, I've been on this planet for 24 years, at least according to this timezone. They really need to set up a series of mirrors so the world has daylight at the same time.

I like rambling lists

  • It’s my Jack Bauer birthday, which means I’ll be living it in real time, with six different views available to me and a digital clock superimposed over my vision. I’ll also hear beeps every second which will no doubt drive me insane.

  • Halfway through the year I’ll get to meet Duck Dodgers.

  • Brace yourself, 24 is 42 backwards. This doesn’t mean Deep Thought will tell me the answer to life, the universe and everything, but I’m hoping I’ll get a glimpse. I’m no closer to discovering it by myself.

  • The 27th of March is also the birthday of The Overnightscape and is Earth Day. I’m seemingly in good company, though I won’t be able to see it with all the lights turned off :P

  • The 24th element is Zinc. Zinc is pretty and shiny, and Firefly taught me Shiny means awesome. I’m hoping that means this year will be too; I know it won’t be, but it could surprise me :)

  • Apparently today Mitsubishi is recording a television commercial in my suburb in Adelaide which I should run out to be in the background of with a giant sign advocating steep road tax hikes and new public transport lines paid for by said hikes!

  • It’s been 2 years, 3 months, 3 days, 21 hours and 14 minutes since I’ve hugged my mum, 3 years since she wished me Happy Birthday and 2 minutes since I last thanked her.

  • There are 24 hours in a day… almost. They really need to fix the speed of the Earth’s rotation, these leap years and crap are just irritating, especially for computer programmers. That means there’s been an hour each day for each year of my life, that’s kinda trippy.

Any questions?

For now all I hope for is my 24th year will be better than my 23rd. Without sounding too emo, and while acknowledging plenty of other people have far worse problems than me, I feel as though my life has been on a sharp downward curve for many years now. I've become even more introverted and shy than I used to be (if that were possible), the studies I do in my own spare time thrill me more than any of the stuff I'm learning at university, but perhaps the most crushing is the constant worrying. I'm always worried, but the problems I'm facing aren't any more or less than what I've had before. It's draining all my energy.

Anyway on that upbeat note, happy birthday to me and good night!!! Well technically, good morning seeing as it's 00:18. What am I, a talking clock?


Impulsive Futurama boots

Media

Futurama 02x20

Professor Farnsworth: I need an heir. The others simply aren’t level headed enough, they’re too impulsive. Not like you, not like old, predictable, dull as dishwater Leela…

Leela: Uh hello… new boots!


Clean Windows 7 upgrade from Windows 2000

Software

Windows 2000-tan

A quick followup to my post from yesterday, turns out it is possible to do a clean install of Windows 7 by using a Windows 2000 disc for the upgrade.

  1. Install Windows 2000, in my case in a VM
  2. Boot from the Windows 7 Upgrade install disc [image]
  3. Select Advanced Install
  4. Delete the Windows 2000 partition, create new partition
  5. Install Windows 7, rimshot!

As Alex said in the comments on my previous post, it would have helped if Microsoft made this clearer, particularly during the install process. There's really no excuse for it being so opaque.


Seven years of the illegal Iraq war

Thoughts

Aqrah, Ninawa province, Iraq, by Jan Sefti

Whooptie do.

This time last week was the seventh anniversary of the illegal coalition invasion of Iraq. I was 16 at the time and in my school's canteen in Singapore when I first heard the news. I couldn't believe it, and now with the death toll in the hundreds of thousands and no end in sight I still can't. It's as if my mind simply can't comprehend the numbers or the reasons, so it just shuts off.

There's so much good in the world, it's just you need to trudge through and push aside a dismally vast amount of awful stuff and people to get to it. People who don't learn from history. People with an overinflated sense of their own intelligence, entitlement and warped morality. What a waste, and a crying shame :(.


A 2700 Rubenerd pointless milestone!

Thoughts

A Rubenerd Pointless Milestone

Once upon a time there was a guy who wasn't terribly exciting or witty, so when something as silly as a nice round even number appeared as his blog post count, he had to tell everyone. In his best Austin Powers voice: post #2700 bay-bee!

Before you complain, at least this post had more substance than my previous post from this evening. Which makes no sense, because that post was chronicling the end of the world; if anything it should have had more detail. I'm going to bed.


The world has come to an end!

Internet

Windows 7 logo