Courtesy of Twitter

Archive for December, 2007

Dear Rails Noobs

Thursday, December 27th, 2007

SCAFFOLD HAS BEEN DEPRECATED AS OF RAILS 2.0.

There has seemingly been an infinite number of posts to the ruby on rails talk mailing list going “OMG SCAFFOLD IS NOT WORKING!!11!11PLZHALPNOW!1″. I want all the newbies out there to understand that the Agile Web Development book is useless! (well, that part). STOP POSTING THAT SCAFFOLDING IS NOT WORKING. It is very irritating.

If you took the time out of your obviously extremely busy schedules and actually googled “Rails 2.0 scaffold” you will see that the wonderful Google hamsters have scoured the internet and found people with such hastiness as yourselves! GOOGLE BEFORE ASKING. It saves a crap load of effort on both sides and stops me writing nasty posts like this.

Maybe your New Year’s Resolution can be to “Just Fucking Google It”.

Eyes

Sunday, December 23rd, 2007

Yesterday I went into the bathroom and saw that the light coming in through the window was very bright and illuminated my eye very well. I took out my tripod and my camera and used the mirror so I could see the reflection of the screen in it and took about 30 photos before I got one I liked. It looked awesome! I needed something as a dual desktop display and I thought the eye would make a wonderful background. I put it into photoshop and made this 2560×1024 background image.

To use it put it in C:\Windows\Web\Wallpaper, right click on the desktop and go to properties, select the desktop tab, click the “eyes” image and change the position to tile.

Tips to Surviving Commercilisation Day

Saturday, December 22nd, 2007

It’s strange how over a period of around a millenia or two Christmas has turned from a celebration of an extremely influential human to yet another commercialisation day. It’s just used now as an excuse to empty your wallets and fill stockings. I don’t even believe in Christmas and personally don’t see why I have to celebrate it, I don’t celebrate Rammadan or Hanukkah or any other religious holiday, so why Christmas? I enjoy catching up with family, but it’s just too crazy and commercialised. Here’s some tips to surviving:

  • Do the speed limit. It’s the black number in the red circle on the white signs. The yellow signs only serve as a warning, and do not change the speed limit. Doing the speed limit ensures that your car is not involved in an unfortunate series of collisions with a sledgehammer, and your tires have no nasty cuts in them.
  • Don’t put your trolley in the middle of a walkway along with your girlfriend and talk to each other. Move to one side and talk.
  • Don’t walk slowly. Also in the same vein is stopping suddenly and window shopping.
  • Have the right money out before the Checkout Whore is done. This speeds things up so you don’t have to dig through your purse looking for that 5c piece from 1989, because the one from 2004 is the year of the birth of your grandson and it’s one of a kind.
  • Checkout people do not want to hear your life story. Neither do I. Don’t mention it. If you want to tell people, write a memoir.
  • The parking lot lanes are not an excuse to park your car to let friends/relatives out. There are people behind you that you should take into consideration.
  • When a P-Plater with a short temper has parked across from an empty park and looks like he’s got his car in Drive, it is not advisable to park directly across from him when there are three other spots directly next to it. Park in any of these three spots and you will not be blasted with an assault of verbal abuse, like a fellow I met today.

Merry Commercialisation Day. See you next year.

More Migration Sexiness - remove_columns & add_columns

Wednesday, December 19th, 2007

After seeing a post on errtheblog about them making migrations sexier, I was inspired on the train ride this morning to write something similar. I had a table and I wanted to drop many columns for it and I ended up writing something like:

 remove_column :table, :column_1
 
remove_column :table, :column_2
 
remove_column :table, :column_3
 
remove_column :table, :column_4...

and by now you’re starting to get the idea. I have to not only type out remove_column four times, but also the table name! What a waste of time!

So I hacked up some code and put it into lib/custom_methods.rb.

 module ActiveRecord
module ConnectionAdapters
class MysqlAdapter
def remove_columns(table_name, *columns)
columns.each { |column| remove_column table_name, column }
end
def add_columns(table_name, type, *columns)
columns.each { |column| add_column table_name, column, type}
end
end
end
end

So now instead of the monstrosity above I can now type:

remove_columns :table, :column_1, :column_2, :column_3, :column_4

to remove all the columns.

Also inspired by remove_columns was add_columns (already spied by the observant few). There’s a little difference in add_columns compared with add_column, the type is now the second argument instead of the third:

add_columns :table, :string, :column_1, :column_2, :column_3

More Migration Sexiness - remove_columns & add_columns

Wednesday, December 19th, 2007

After seeing a post on errtheblog about them making migrations sexier, I was inspired on the train ride this morning to write something similar. I had a table and I wanted to drop many columns for it and I ended up writing something like:

 remove_column :table, :column_1
 
remove_column :table, :column_2
 
remove_column :table, :column_3
 
remove_column :table, :column_4...

and by now you’re starting to get the idea. I have to not only type out remove_column four times, but also the table name! What a waste of time!

So I hacked up some code and put it into lib/custom_methods.rb.

module ActiveRecord
  module ConnectionAdapters
    class MysqlAdapter
      def remove_columns(table_name, *columns)
        columns.each { |column| remove_column table_name, column }
      end
 
      def add_columns(table_name, type, *columns)
        columns.each { |column| add_column table_name, column, type}
      end
    end
  end
end

So now instead of the monstrosity above I can now type:

remove_columns :table, :column_1, :column_2, :column_3, :column_4

to remove all the columns.

Also inspired by remove_columns was add_columns (already spied by the observant few). There’s a little difference in add_columns compared with add_column, the type is now the second argument instead of the third:

add_columns :table, :string, :column_1, :column_2, :column_3

Printer Troubles

Sunday, December 16th, 2007

Today Michael (mum’s boyfriend) was trying to install a printer onto Mum’s computer, connected via a 4m USB cable, but it wasn’t detecting it when he plugged it into any of the USB ports. So then I tried moving it to my computer and it worked. Then I tried sharing it from my computer, only to be met with something I have never seen before with printer sharing: it asked for a username and password. What. The. Fuck.

Anyway, so I moved it back to Mum’s computer and it still didn’t detect it. Michael and I played around with it for about another hour and during that time I was so adamant that it was the cable. I didn’t know how, I just knew it was the cable. So after Michael suggesting that no way in Hell could it be the cable, I decided I would go out and buy a cable.

I bought a 2m cable from D’Ambra Computers, plugged it in and it automatically detected the printer.

Now here’s my train of thought on this issue (and it could be totally wrong): because the cable was 4m longer the voltage sent from the USB ports on the computer wasn’t powerful enough to go all the way to the end of the cable and then come back on Mum’s computer which is a 400W Acer PSU. Because we’ve put mum’s old hard drive in there, there might have not been enough power to go the full length any more. My computer has a 600w Thermaltake PSU in it and the printer worked fine in it. Buying the shorter cable meant that the power was able to get all the way to the printer and therefore Windows detected it. This would also explain why were able to plug in devices with much shorter cables than the old printer cable like both the iPods into different ports and another mouse.

So if a printer isn’t being detected when it should be, try using a shorter cable. It might just do the trick.

Train Doors

Thursday, December 13th, 2007

Didn't they fix this?
I was interviewed this morning by Hannah Silverman from the Advertiser in regards to the photo (right) that I sent to them. She asked me a lot of questions like:

  • When did it happen? (7:51AM train from Elizabeth)
  • What line did it happen on? (Gawler)
  • What was your reaction? (”I’ve gotta get a photo of that.”)
  • Was there anybody near the doors? (No)
  • What did you think was the problem with the doors being open? (If there was a small child they would’ve gone to look out of the doors and might’ve fallen out)
  • What was everyone else’s reaction? (Nonchalant, treating it like it was a regular occurance now)
  • What do you think of the train system? (”I think it’s a heap of crap.”)
  • What’s wrong with the train system? (Ticket prices increasing, service degrading)
  • Contact Details? (You, as in the reader of this blog, are not getting them)

I hope after all the questions that an article gets published somewhere about this. It would be awesome.

UPDATE #1: Hannah called just before lunch asking me to confirm that it was yesterday. After I got back from lunch, she called again and asked me to pose for a photograph at the Adelaide Train Station. Honestly, I never expected it to get this far. I thought “hey, they’ve been hammering this for a while” so I sent it to them.

UPDATE #2: So I’ve just gotten back from getting my photo taken at least 50 times in random positions, walking onto the train, leaning against the train, leaning against the barrier. The photographer said it “might be on the front page”. If they’ve taken a photo of me and it’s in the paper, everyone gets free papers.

UPDATE #3: The photo I took on Wednesday was on the front page. I read the paper cover-to-cover and my photo’s not in there. It might be in Saturday’s paper, giving me a weekend to buy a disguise to deceive the AdelaideMetro thugs. The story was also on the AdelaideNow site!

UPDATE #4: “Uncle Fester” from Port Adelaide posted this comment on the AdelaideNow site, which gave me a chuckle:

“That looks like the DSTO in the background of the photo. Does Ryan Bigg realise he has committed a federal offense by photographing a secure Commonwealth site?”

Another commenter, David of Oaklands Park, posted this:

“Would have thought that the fires on Kangaroo Island justify a front page more than a Mr Bigg!!”

Thanks David! The fires have been burning for 8 days. The train doors have been malfunctioning longer. Fire can be put out, and all of the time eventually it does happen! The train doors unfortunately will not fix themselves and it’s up to AdelaideMetro and “The Government” to do something about it.

Another one of my gripes is there is not a single window on any carriage I have traveled on this week that some delinquent has not scratched his tag into. I believe this prompts the “other delinquents” to do the same after seeing that other people can get away with it. Replace the windows with something that can’t be scratched, or replace them more often to deter these bastards from blocking my view with their scrawl.

UPDATE #Infinity - Infinity + 5: Googling for my name (Ryan Bigg) returns the article as the second result in “the web” and first for “pages from Australia”.

UPDATE #6: Freakin’ Huge ™ front page scan is here

December Meetup

Wednesday, December 12th, 2007

There was an Adelaide Ruby Users Group meeting held last night at the usual location, the Brecnock Hotel on King William Street. This was the first meeting my friend, Tom, had decided to come to and he caught the train into town from Gawler. He eventually arrived at the other end of town at around 5:30 and phoned me up asking where I was. His voice seemed to echo too much, and the stairway in our building doesn’t echo like it did. I eventually figured out that he was in the TSR building and managed to get up to Level 2 unhindered. Great security the TSR guys have.

I finished up at work and then Anuj, Vishal, The Other Mongrel and I headed over to the Brecnock. Adam and Ali had other things to do and Michael still had his time off from work due to an operation he had.

We ordered our food at about quarter-past 6. It arrived at around 7ish in typical Brecnock style.

The meeting begun at 6:30 and begun with Luke talking about merb and Datamapper. Whilst very interestin, the talk was very long (at least an hour). I will try to grab a video of his talk once it’s up on the internet.

Afterwards I did a talk on Railscamp with 20 photos that I or other people (Lachie, Tim Lucas, Ryan Allen and Ross Hill) took at Railscamp. I rattled off a list of what presentations there were at Railscamp and this started a talk on Git. The Git talk went on for a while, and it was already 9:00 by this time so Tom and I decided to leave. Apparently the other guys only continued until about 9:15, and the talk turned to usability.

Tom thought it was really good and he said he’d definitely be going to the next one.

So why don’t you come as well?

Railscamp Summary

Friday, December 7th, 2007

I promised you guys a summary of Railscamp. Unfortunately I managed to lock myself out of sudo on my laptop AND hastily reinstall ubuntu. I could’ve sworn I had a backup on here somewhere.

Fortunately I’m supposed to be doing a very short presentation about what went on at Railscamp so I should have at least SOMETHING by next weekend!

Been very busy as of late. The blog went down and I’ve been playing around with WordPress as a replacement instead of re-inventing the wheel yet again. I simply do not have the time or energy to do something that massive again. WordPress does everything I want it to.

On last weekend’s Saturday I shaved off the beard and it was itchy. I don’t recommend it for anybody to grow a beard for 6 months and shave it all off in one go. It’s like that feeling when you get your hair cut and it goes down the back of your shirt. Now imagine that on your face 10 fold.

Also on the Tuesday (the 4th) just gone, I turned 20. Went out for dinner the Sunday before with my dad, Monday night had dinner at Mum’s, Tuesday night was poker, Wednesday night was Cafe Primo, Thursday night was play-around-with-blog night and tonight was get-everything-imported-into-wordpress night.

Tomorrow night I’m off to InLAN with Narthollis, Devastator and Freddy. This InLAN is free and doesn’t have prizes, but we’ll still own all the noobs.