Monday, February 25, 2008

80's The Limit


I'm currently "studying" the course "Introduction to computer science" at the university.

Why "studying"? Because I have to, and because I don't really go to lectures because they are boring as hell and useless.

Anyhow, the course has its own coding conventions and style. Most of the conventions are totally fine and agreeable, but there's one that's driving me crazy - "Thou shall not write lines that include more than 80 characters.".
The reason is not specified (as usual here - why specify why to do something when you can just tell the students to do A and B), but I may assume it concerns the 1980's DOS/Amiga/Mainframes 80 chars limit, when working in textual video mode.

So let's count how many graphical operating systems that can display and print lines longer than 80 chars in one line got released by Microsoft(TM) 'till now:
  1. Microsoft(TM) Windows(R) 3.1
  2. Microsoft(TM) Windows(R) NT 4
  3. Microsoft(TM) Windows(R) 95
  4. Microsoft(TM) Windows(R) 98
  5. Microsoft(TM) Windows(R) ME
  6. Microsoft(TM) Windows(R) 2000
  7. Microsoft(TM) Windows(R) XP
  8. Microsoft(TM) Windows(R) 2003
  9. Microsoft(TM) Windows(R) Vista

And they still haven't found the "Change font size" button... too sad.

Limiting line length is good, but why limit it to the ridiculous number of 80? When programming in an object oriented language, creating a line which calls a class method and specifying 2-3 parameters will exceed this limit. So to avoid losing points an evil linefeed needs to be inserted.

The huge problem here, as I see it, is that most of the people studying with me haven't programmed in a real programming language (not Pascal) and doesn't know how a real-life code should look like. This is one of some bad habits they learn in a place that should theoretically teach them everything they should know about programming.

So what's the moral here? Read Code Complete and forget about people who know nothing about programming.

Saturday, February 23, 2008

Guitar Hero and Actual Guitar Playing

Somehow this post managed to stay in my draft waiting for me to finish it for two months, so here it goes.

(If you don't know what Guitar Hero is, it probably means that you just woke up from the dead. So first of all, get a shower because you stink, and then check out Wikipedia).

Some time ago I've seen a comic strip in the internet making fun of people who play Guitar Hero by saying that maybe they are able to finish the game in "Expert" difficulty, but they don't even know how to hold a real guitar and play a basic chord.

This made me laugh mostly because it's true, but then it made me think about it in another way - is Guitar Hero related to real guitar playing at all?

To figure it out I came up with the following questions:
  • Will expert Guitar Hero players learn how to play guitar faster than a non-Guitar Hero players?
  • Will experienced guitar players or expert musicians learn the Guitar Hero skills faster than others?
No doubt a research needs to be conducted to resolve those questions, but I'll try to make some assumptions.

Here are some milestones I thought about that are needed to be achieved in order to gain experience in the game. They are mostly based on my experience and watching new players moving from playing in easy difficulty to hard (I've seen about 5-10 of them).

Easy:
  • Pressing the first three buttons (green, red, yellow) correctly and strumming downward when needed.
  • Pressing more than one button simultaneously.
Medium:
  • Dealing with the fourth (blue) button correctly.
  • Starting to connect with the song's rhythm.
Hard:
  • Using all the five buttons (mostly the fifth, orange button). This implicitly means learning how to move the hand across the "guitar's" neck without looking.
  • Beginning to play a song more by listening to it than looking at every single note.
  • Strumming upward in addition to the downward strumming.
  • Getting used to hard solos.
Expert:
  • "Parse" a screen full of notes by looking at the large picture, rather than looking at each note.
  • Using the hammer-off / pull-on technique.
  • Quick finger positioning, mostly for 3-string chords (Guitar Hero III).

So basically the important techniques that are being practiced are:
  • Finger positioning.
  • Note reading / parsing.
  • Rhythm processing.
  • Strumming.

Leaving the note reading alone (let's face it – they are not even close to tabs) I think that most of the techniques here are mostly crucial for a fair guitar play. Also I must about myself, that after wasting some time with Guitar Hero and reaching expert difficulty, I really did notice an improvement in my real guitar play, mostly dealing with song rhythms.

So I think that the answer for the first question is yes.

The answer to the second question is much more obvious after the analysis has been done – it's quite clear that experienced players will stumble upon smaller obstacles that the newbies; the things they need to learn is more or less how to handle the fake guitar and how to read the notes quickly. I'm basing that on my flat mate Ami, who is quite an experienced piano player. He finished a song in "Expert" level on his first play ever, and still is the best Guitar Hero player I've ever seen in real life.

Bottom line: not all the games we play are useless: in some we study about vicious weapons and what's the most efficient way to kill a monster, in some we learn how to wear a dog or manipulate George Washington (sorry for the spoiler) and in some we learn how to play a real guitar.

Happy gaming!

Saturday, February 9, 2008

iPhone Accessories and Cargo Tracking

After purchasing my iPhone and before unlocking it, I used to hang out with three different devices: iPhone (for accessing wifi networks and just being cool), cellphone and an iPod.

The main target was to drop down to only one piece of equipment - the iPhone, so first I needed to get my iPod out of the picture.

As you may know, the iPhone usually comes with 8GB of flash memory (a 16GB model have been released last week), so it also acts as an iPod. The thing that prevented me to use it as one was the earbuds that come with it. I don't like earphones, because I got used to in-ear phones after using 2 different models (Apple in-ear phones and a Pioneer model I bought after my Apple one's got damaged by my stupidity and water). Moreover, I didn't like the sound qualify of the earphones that came with the iPhone because they have a weak mid, and more important, bass response.

My Pioneer phones that are used with the iPod cannot be connected to the iPhone because the mini-PL connector now includes a microphone (it's longer than 9mm), so I decided to search for a mid-high end in-ear phones for my new-precious iPhone.

After digging a bit I've found this V-Moda Vibe Duo in-ear phones, and decided to order them. Needless to say, I've already purchased some stuff over the net, and by paying only 5$ to regular UPS shipping I thought I'll get the package in 2-3 weeks, in which I'll be left in the dark and just sit there waiting for the package to arrive (not really).

Two hours after making the deal, I got a mail from v-moda, providing a link to a tracking page that gives information about my package.

Immediately, the following psuedo-algorithm went into action:

  • Wait 5 minutes.
  • Refresh the page.
  • If a new details about the package has been added: go to your flatmates and update them beatifically about the progess, otherwise: complain like an old grandma about the lack of information.
  • Repeat the process until someone from UPS calls and tells you that your package is at the door.

The funny thing is that the whole situation is explained perfectly in this xkcd strip, and that I laughed at Segal while he anticipated a package a month ago while doing exactly the same :)

So the packaged arrived in 3 days (!!!), after passing through Germany and Turkey and I got very happy.

A nice look at the irrational ratio between the headphones and the package itself:


P.S. 1 - for the interested readers (if you got this far) who are interested in details, here it how it looks like:


P.S. 2 - Props to Geohot for unlocking the 1.1.2/1.1.3 OTB iPhones, which allowed me to get rid of my Nokia 6230i too.