Archive for the ‘amusing’ Category

The Lord's Prayer, for coders

Wednesday, October 21st, 2009

The following comes from a funny (and slightly weird) conversation i had on a walk with a colleague this afternoon. This is literally the way we often talk when we go out for our walks around the fields of Barton Farm! One day we're probably going to have a day when we only speak in Ruby!

@heaven = Heaven.instance
@father = God.trinity[0]
@earth = Universe.galaxies.find_by_name("Milky Way").solar_system.planets[2]
 
@father.open_connection do
  @father.current_location.should == @heaven
  @father.name.should be_hallowed
 
  kingdom = mock_model(Kingdom)
  Kingdom.stub!(:new_for).with(@father).and_return(kingdom)
  kingdom.should_receive(:come!).and_return(true)
  @earth.should be_like(@heaven)
 
  @earth.current_population.each do |person|
    person.should_receive(:bread).daily
    @father.should_forgive(person) && person.should_forgive(:others)
    @father.should_not lead(person).into(:temptation)
    @father.should deliver(person).from(:evil)
  end
 
  while true do
    [Kingdom, Power, Glory].collect do |klass|
      klass.all.should be_attributed_to(@father)
    end
  end
end

Shame i haven't updated for such a long time. I was unable to log into my blog for a while, and even when i fixed it i couldn't think of anything to write to make a suitable come-back! Hopefully this satisfies! :)

the best free entertainment i've seen all year

Saturday, July 25th, 2009

This last week i've been enjoying watching A Very Potter Musical on youtube. It's a most hilarious Harry Potter parody with fantastic acting and delightfully catchy songs!

The star of the show has to be Lauren Lopez who plays Draco Malfoy and spends most of the time rolling around seductively on the floor/bench/harry/hermione! Lauren's sense of comic timing is incredible, and the voice and facial expressions are just adorable!

Lauren Lopez as Draco Malfoy

Voldemort and Quirrel are beautifully played with some very touching moments together. Snape is hilarious, like all the characters, much exaggerated!

I think the best songs are near the end. "Not Alone" (Act 2 Scene 5) is a beautifully composed piece of music, and "Voldemort Is Goin' Down" (Act 2 Scene 8) is magnificently performed by the cast.

I've enjoyed it so much that i'm making myself a dvd to take to show friends and family. I love it that the whole thing is freely available. By the fans, for the fans, and yep, the fans are loving it!

I also love how linux gives me free tools to be able to create a dvd. This morning i did not know how to do it, but using todisc and tovid i've been able to combine all the scenes into a sequence, with a menu. I used mplayer to extract the audio of one song, and audacity to split out the song that i wanted to use as an introduction when the menu is shown. I used kino to look at the frames one by one and export a frame to use as the background for the menu. I used the gimp to darken the image and reduce the contrast.

The menu for my dvd is hopefully going to look something like this:

A Very Potter Musical dvd menu

I'll update again if it works! Currently it is encoding each of the scenes into dvd format, which seems to take a very long time … and creates files 5 times bigger than the originals!

Update: it worked!! From youtube to my television!!

A Very Potter Musical

Potter Musical on my television!

A Very Potter Musical

Thank you to StarKidPotter, youtube, keepvid.com and to free open source software and the ubuntu community! Now i can take A Very Potter Musical with me to show anyone who has a dvd player! :D

What's going on in aimee's life?

Monday, March 16th, 2009

I'm back! I have been away from the Internet for a week – a self-enforced leave of absence to try to avoid getting RSI. Happily to say, it seems to have worked – just typing as much as i need to at work, and having a rest in the evenings. I love programming and i love my job, so i really don't want to injure myself.

I have been trying out another keyboard layout: Colemak. It has similar aims to Dvorak but, unlike Dvorak, they actually used a computer to help generate the layout! Also, unlike Dvorak, Colemak layout is fairly similar to Qwerty, possibly making it easier for Qwerty users to switch. It keeps Z, X, C and V in the same place, useful for the obvious keyboard shortcuts.

colemak.com – the website for the layout.
Colemak on a TypeMatrix EZ-Reach keyboard – made for my own reference, but i imagine others may come looking for it too. If you want it as a PDF, let me know.

Work has been fun lately – we've been trying out pair programming and i'm really enjoying it. I took a while to believe that it really is beneficial for two people to program together, but i'm coming round to the idea now. Especially when trouble-shooting – there is almost no break in the flow because the combination of two brains focussed on a problem means that we come up with the solution pretty quickly. Plus it's also really good fun! :D I think the key is to have a separate pairing station set up with two keyboards and two mice plugged in. That gives a feeling of equality. With a little perseverance it soon starts to feel very natural to program together.

Social life has been fun too. The Spring weather is making me very happy. Church has been great, really enjoying it. In my week-of-no-internet i became totally hooked on Life On Mars – can't wait to see the second series!

I leave you with something that i saw in a bookshop in Southampton yesterday – made me LOL ;-)

LOL

CAN HAZ CAFEEN PLZ!!

Wednesday, February 25th, 2009

Thought this was funny!

CAN HAZ CAFEEN PLZ!!

I love technology! I took the photo with my phone, bluetoothed it to the iMac, capped it on icanhascheezburger, uploaded it to Flickr, and inserted it into a blog post in a couple of minutes! :)

Nice lazy Caturday

Saturday, February 7th, 2009

funny pictures of cats with captions
more animals

I'm in serious need of a lazy caturday! Vim has been taking up all my brain energy all week, and i've had several late nights this week. Now i need a day to relax and just do as little as possible.

It's a lovely sunny day, i've done a bit of spring cleaning, and will probably do some more! I plan to go into town for a bit of shopping later on.

Have a nice weekend, everybody! :)

Apache tricks on Linux

Monday, January 26th, 2009

Most of my life is spent coding Ruby on Rails, but occasionally i venture into the world of PHP. When i do, i sometimes need to configure Apache because, unlike Rails, it does not happen automagically! To save myself always looking things up on the Internet, here is a little summary of the things i have learnt.

Don't do this!

When i very first started using Linux, i discovered that you could put files into /var/www and access them through http://localhost. This is a very bad idea because you don't have permissions to the /var directory (for good reason!) so i used to end up chmodding everything. Also, keeping anything outside your home directory is bad news because you're liable to forget to back it up before you do an upgrade! WHOOPS!

A perfectly good solution

The next thing i learnt was symlinking, or creating shortcuts. So you can set up a shortcut from the /var/www directory to an appropriate place in your home directory. For example:

sudo ln -s /home/aimee/websites /var/www/html

Now if i have a directory called mac2 under my websites directory i can go to http://localhost/html/mac2/index.php. Nice!

More advanced: VirtualHosts

Later on i started experimenting with Apache's RewriteRule and RewriteBase for nice 'pretty' URLs. You'll soon find out that the symlink method is no longer suitable because you're not using relative URLs anymore. It's time to learn about VirtualHosts, so that i can access my local files with a URL like http://mac2.aimee.

Apache2 keeps a list of available configurations under /etc/apache2/sites-available. I have one called aimee.conf because i am egotistical like that!

sudo vim /etc/apache2/sites-available/aimee.conf

It must start with this line:

NameVirtualHost 127.0.0.1

Then, for each site that i want, i add a VirtualHost like this:

<VirtualHost 127.0.0.1>
  ServerName mac2.aimee
  DocumentRoot /home/aimee/websites/mac2
  CustomLog /var/log/apache2/mac2.log combined
  DirectoryIndex index.php
</VirtualHost>

It really just needs to know where to find the source files. The log and directory index are not especially important. It's probably fairly obvious why i added them. There are plenty of other options you could use if you wanted to, but this is about all i use.

Next we need to enable the configuration. It's as simple as symlinking the file from the sites-available directory. You only need to do this once per .conf file (and i only use one for simplicity).

cd /etc/apache2/sites-enabled
sudo ln -s /etc/apache2/sites-available/aimee.conf .

The next step is to configure the hosts file such that when i type http://mac2.aimee into a browser it knows to look on my actual computer rather than on the Internet.

sudo vim /etc/hosts

I enter a line like this:

127.0.0.1       mac2.aimee

Finally, restart Apache and all should be very well!

sudo /etc/init.d/apache2 restart

The best of both worlds

If you want it both ways (and hey, why shouldn't you?!) it is quite simple to set up another VirtualHost for localhost. Just add it in like this:

<VirtualHost 127.0.0.1>
  ServerName localhost
  DocumentRoot /home/aimee/websites
</VirtualHost>

Restart Apache again and now the same site is accessible at both http://mac2.aimee and http://localhost/mac2/index.php.

Happy day! :)

Disclaimers

This is how i made it work on Ubuntu Linux in a development environment. Other operating systems may behave differently. I have no idea about setting up production servers!

If Apache is in a different place on your computer, you can find it like this:

whereis apache2

To find your hosts file:

locate hosts

I am not an Apache expert, so if you have any questions, chances are i can't answer them! Scroogle is your friend! :)

New Week's Resolution

Wednesday, January 7th, 2009

I don't do new year's resolutions. For me, a year is too long a time. I do, however, always try to do something for Lent, and occasionally i make new week's resolutions, which usually last just from Monday to Friday.

This week i am following a resolution that i was inspired to make after reading Nye's Top tips for a tidy home. It is full of many excellent tips, but the part i really liked was this:

You've had a really hard day at work and you're tired. Wait! Don't sit down on the sofa, no matter how tempting it is. Do a couple of chores first and then sit down. Give yourself a pat on the back!

It is true, when i come home from work i am only mentally tired. It seems to work really well to balance that with some physical exercise that doesn't require much brain power. This week i have aimed to do two chores, but ended up doing more because i found i actually had quite a lot of energy to use up.

Contrast that with my previous technique which was to put things off until after washing up, forgetting that i often don't get round to washing up until 10pm, and if there is a lot of washing up to do, i don't feel like doing chores afterwards at all. Meaning that i ended up doing most of my chores on a Sunday afternoon!

So thank you, Nye, your advice really seems to work well, and i hope that this will become a habit that lasts for more than just a week! :)

In other news, i just lol'd at this picture found on urban dictionary … what's the opposite of 'pro'?

What's the opposite of 'pro'? Clearly 'n00b'!

The teacher is a total n00b not to know that the opposite of 'pro' is blatantly 'n00b'!

Y GIT IZ BETTR THAN X

Wednesday, December 10th, 2008

LOLCATZ IN UR GITHUBZ!

There is really no need for this: lol.whygitisbetterthanx.com but it is so funny!

GIT WILL ALLOW U 2 HAS MULTIPLE LOCAL BRANCHEZ DAT CAN BE ENTIRELY INDEPENDENT OV EACH OTHR AN TEH CREASHUN, MERGIN AN DELESHUN OV DOSE LINEZ OV DEVELOPMENT TAEK SECONDZ.

Aimee's law of LOLCATS: Anything you push to GitHub will, in time, become translated into LOLCAT. This is inevitable.

P.S. I've just had a look on GitHub, and the page has now been translated into 11 languages. :) Sed ankoraŭ neniu estas tradukinta ĝin en Esperanton. Mi pensas, ke Esperanto devus esti la sekvontan tradukon. "Kial Git estas pli bona ol X" :)

L(slightly)OL!

Monday, December 1st, 2008

Seen on a mailing list:

Question:
How can I disable this warning:
"warning: no newline at end of file"

Answer:
Put a newline at the end of the file.

CUCUMBER IS TEH AWSUM!

Saturday, November 29th, 2008

Remember my LOLCAT Cucumber post?

Guess who came along and found it? Aslak Hellesøy who actually wrote Cucumber! As a result, Cucumber now speaks LOLCAT!

I never thought it would make it into the official repository! I only did it for the lolz! :)

By the way, i have now started actually testing MyChores with Cucumber. Here is my first feature test, which is surprisingly similar to the LOLCAT one, only in English, heh!

who-am-i
A web programmer in my late-late-twenties, fanatical about open source, free software, loving my job working daily with Ruby on Rails, RSpec, Cucumber and Git.

I am very proud to have created MyChores.co.uk, an online team based tracking system for household chores and other recurring tasks.
Search



Flickr