Ruby isn’t defensive
I came across this little gem while reading the Unix philosophy page on Wikipedia (Mike Gancarz’s 9 paramount precepts are worth a read).
“UNIX was not designed to stop its users from doing stupid things, as that would also stop them from doing clever things.” – Doug Gwyn
I think you could say the same about Ruby.
Screencasts may be neuvo, but shellcasts are retro baby!
The Unix script command lets you record a terminal session to file, isn’t that cool?!
From its man page:
NAME
script -- make typescript of terminal session
SYNOPSIS
script [-a] [file]
DESCRIPTION
script makes a typescript of everything printed on your terminal. It is
useful for students who need a hardcopy record of an interactive session
as proof of an assignment, as the typescript file can be printed out
later with lpr(1).
University assignments sure, but it’s also useful for is keeping track of what gems/ports you’re installing when setting up your new Mac (simply replay if you ever reformat or have more than one Mac like I do) or to help automate (script?) a series of commands you use together regularly.
I’m sure this is old news to all you shell-weenies out there, but I had to wait to discover it completely by accident before it could fill my life with terminal recording goodness. I was playing with a Rails project on my Mac when I accidentally left the slash out of script/plugin ... and typed script plugin .... So, I’m blogging this punting that at least one other shell-ignoramus such as myself will benefit, in fact maybe even just future me.
Wrong Ruby version on your Powerbook?
If you own an Apple Powerbook and try upgrading Ruby using MacPorts, you may find that typing ‘ruby -v’ at the console stubbornly insists the version installed is 1.8.2 whereas you’re expecting something more recent (1.8.6 at time of this post).
In my case it turned out that this was because the default order of the PATH environment variable had ‘/opt/local/bin’ after ‘/usr/bin’. This meant that the older version that came with OS X Tiger which was in ‘/usr/bin’ was being used in preference to the newer version installed by MacPorts in ‘/opt/local/bin’.
The solution: simply change PATH in ~/.profile so ‘/opt/local/bin’ appears before ‘/usr/bin’.
Finally, it turns out that on my shiny new Macbook Pro the PATH is ordered this way by default.
University podcasts
I’ve missed my weekly dose of pre-packaged knowledge since finishing my Masters degree so I was pleased when I discovered that several universities now offer free podcasts.
In particular I enjoyed listening to the first episode of the Marketing Podcast by Peter Wagstaff. It appears to be designed to accompany MKF1120 a marketing subject taught at Monash University in Melbourne. The first episode is arranged as a conversation between Peter and a guy called Julian Cole (the “good looking” one apparently). They discuss product placement as an alternative to traditional advertising which they say consumers have lost interest in for the most part. They use Big Brother Australia as a case study as it seems almost entirely a product placement or advertising exercise.
If you’d like to learn a little about marketing and share my propensity for laziness I suggest you give this podcast a whirl. All in all I think it’s pretty well made and I will probably continue listening to the remaining and any future episodes.
Finally, a few universities with free podcasts are:
- University of Sydney
- University of Melbourne
- Stanford University
- University of California, Berkley (one isn’t enough!)
If you know of any other good, university podcasts please let me know by emailing me. Comments are still broken, sorry.
Mat is irresponsible
Mat Holroyd, my so called friend, sat by idly and watched while I spent nearly $4000 on a Macbook Pro that I don’t need, at least not in a non-addiction sense.
I’m disappointed in you Mat.
And Apple, well. You’d think that spending almost $4000 in a day would be sufficient, but no. The final page in the process had a button which read “Continue Shopping” – they wanted more of my hard (not yet) earned money. They should get a conscience and replace the button with “Go take a stroll and think about what you’ve just done Abhi”.
Anyways, I can’t wait for my new baby to arrive!
How to restore a deleted file using svn
svn cp -r 1062 svn://server/repository/project/trunk/path/to/deleted_file.txt .
NB: ’1062′ is a revision in which the file exists.
Masters degree – tick.
It’s done. Over. Finished. Finally.
I don’t think I’ll miss the exams, or the assignment deadlines but I will miss being at university. There’s something to be admired about people who give up time with their loved ones, turn down going out with friends night after night, to pay for the privilege to learn. I enjoy being around people like this.
Anyway, I’m not feeling particularly articulate so I’ll stop there.
Oh and before I forget there’s the little matter of the “great average” I was hoping for. I finished with 84.675% – a high distinction when rounded :) Of course these things are very subjective; for my part I’m pleased.
Happiness and doing
“There can be no happiness if the things we believe in are different from the things we do.”
[Via the Chief Happiness Officer]
What superhero are you?
Your results:
You are Superman
|
You are mild-mannered, good, strong and you love to help others. |
Java7->property->access->is->yucky
Kirk (via Erik’s linkblog) blogs:
The purpose of the [->] operator is to provide a short hand notation for properties. The syntax that we would normally use is;
a.setFoo( b.getFoo());
With the “->” operator we would see;
a->foo = b->foo;
How we’d currrently coding this is;
a.foo = b.foo where foo would have to be more visiable than private.
My initial, not very well thought out, straight from gut, but strong reaction is “Yuck!”. I may elaborate in a later post, but feeling too lazy to post anything more useful that a subjective opinion.