A multimedia studio for Comm students

I am happy to announce that the Mediacom Studio website, www.mediacomstudio.com, has just been created by Christina and myself.

Mediacom Studio is a state-of-the-art audio and video production facility for Communication Studies students at the University of Mauritius. The studio will be fully operational for the 2008-2009 academic year. The studio has been funded by one agency of the UNESCO to promote the development of professional journalism in Mauritius.

The project was conceived by Christina and was approved by the UNESCO in 2007.

My contribution to the whole project was to help Christina select the equipment to acquire for the studio. This was a tough exercise as we were constrained by the budget and what equipment we could order in Mauritius. Nevertheless, we managed to come up with a very balanced and functionally rich list of equipment in my opinion:

  • Apple iMac computers with Leopard, iLife ’08 and iWork ’08
  • Panasonic HDC-SD5 HD camcorders with tripod and lighting kit
  • Olympus WS-300M audio recorders with external microphone
  • Sennheiser PC151 noise canceling headsets with microphone

Initially, the students will use iMovie ’08 for video editing. This is what I use at home and I find it excellent for beginners. We have also acquired one license of Final Cut Express for those students who want to use a more professional video editing software.

For viewing their creations, the students will be able to transfer their rendered files to an Apple TV connected to a Philips LCD TV. Additionally, they’ll be able to post their movies online on www.mediacomstudio.com for discerning people like you to enjoy…

Phew.

On being a Rock Star Software Engineer

I have just come across a great article by Alex Iskold entitled Top 10 Traits of a Rockstar Software Engineer. It is a must read for all aspiring software engineers out there… especially those who are still learning the skills in a university.

The 10 traits he mentions are:

  1. Loves To Code
  2. Gets Things Done
  3. Continuously Refactors Code
  4. Uses Design Patterns
  5. Writes Tests
  6. Leverages Existing Code
  7. Focuses on Usability
  8. Writes Maintainable Code
  9. Can Code in Any Language
  10. Knows Basic Computer Science

Phew! What can I say more? Apart from telling all of you to read the article thoroughly and to pay special attention to the various books he refers too.

Priceless.

Scripting with Ruby and Audioscrobbler

My Year II students are currently learning scripting with Ruby, my favorite programming language (ex aequo with Scheme I think…). Today I thought about what could be the difference between scripting and programming and I came up with:

Scripting is the same as programming except that you don’t have to worry about unnecessary details like deciding upon types, declaring classes and handling exceptional conditions. In other words, you only focus on the fundamentals.

Ruby is an excellent scripting language because it has been designed correctly. My students have had no problems understanding Ruby code that they were seeing for the first time. In fact, Ruby is a very elegant language.

Ruby is also very powerful thanks to the predefined functionalities in Ruby Core and the Ruby Standard Library. I have naturally spent some time explaining the likes of strings, regular expressions, etc. to my students but also libraries like OpenURI (used to access resources likes files, images and web services found on the Internet) and REXML (used to extract parts of an XML file.)

Consider the following Ruby script for instance:

require "open-uri"
require "rexml/document"   

artist = gets
artist.chomp!
artist.gsub!(" ","+")

input = open("http://ws.audioscrobbler.com/1.0/artist/#{artist}/toptracks.xml")
doc = REXML::Document.new(input)

puts
puts "The 10 greatest tracks are:"
puts

count = 1

doc.elements.each("mostknowntracks/track") { |track|
  puts "(#{count}) #{track.elements["name"].text}"
  count += 1
  break if count > 10
}

This simple Ruby script prompts the user for the name of an artist and queries Audioscrobbler for his/her top music tracks using OpenURI. The XML file returned is parsed using REXML and the top 10 tracks are displayed on screen. This is what I get when running it:

$ ruby top-10-tracks.rb 
Depeche Mode 

The 10 greatest tracks are:

(1) Enjoy the Silence
(2) Personal Jesus
(3) Precious
(4) Just Can't Get Enough
(5) Policy of Truth
(6) Never Let Me Down Again
(7) It's No Good
(8) Dream On
(9) Strangelove
(10) World in My Eyes

and also

$ ruby top-10-tracks.rb 
Avinash Meetoo 

The 10 greatest tracks are:

(1) This is real
(2) Play
(3) Beautiful sea
(4) Helium
(5) The myst
(6) Zygma
(7) Seduction
(8) Deception
(9) Eternity
(10) Lion Heart

Not bad for a 20-lines long script! Incidentally, I deeply believe that Ruby is a great language to learn programming.

This is a great quote from one of my heroes, Mr Steve Yegge!

Ruby‘s one of the easiest languages for just about anyone to learn — it’s maybe a 3-day exercise, and after a week or so of using Ruby, you just may never look back. It’s like getting a new car: it still gets you from A to B, but without your old car’s flaky transmission, cracked windshield, and 5-year-old french-fry remnants under the driver’s seat.

Who am I to argue?

Your top five songs… today

I came across an interesting thread on Amazon where people were discussing about their top five favorite songs. What is cool is that they all said that they couldn’t possibly list their top five songs ever as, I quote, “these change weekly or as the mood strikes”.

This is my current top five songs today:

  1. FischerspoonerA Kick In The Teeth
  2. Yael NaimToxic
  3. FaithlessReverence
  4. Daft PunkTelevision Rules The Nation / Crescendolls
  5. Porcupine TreeHatesong

Incidentally, all the above links point to Last.fm which is, IMHO, a fantastic social networking site for music lovers. Personally, it has allowed me to discover countless artists through its recommendation engine and by exploring the playlists of people having similar music taste as me. Give it a try!

This is my own artist page (yep!) on Last.fm. By the way, some people say (and I think it’s true) that good computer scientists are also good musicians and vice-versa. Apparently, this has something to do with structured reasoning. What I personally know is that I derive the same kind of pleasure playing some music and writing a program…

The picture above shows David Gahan and Martin Gore of Depeche Mode, my favorite music group by very very far…

 

What are your own top five songs today?

Scheme is a good language for beginners

I am currently teaching programming languages to second year students. I spent about 4 weeks introducing Scheme to them and I covered the following topics:

  • Expressions
  • Functions
  • Scope
  • Recursion and tail-recursion optimization
  • Pairs and lists
  • Higher-order function

Each lecture was followed by a lab session where students practiced what they saw in class.

I then gave the students an assignment to do where they had to write moderately complex higher-order functions. Last week, I asked the students to demonstrate to me what they had done. During the demo, I asked them a couple of questions.

What did they think about the assignment

Most students told me that they liked the assignment even if it was moderately tough. This was a surprise to me as I did not expect the students to like assignments. But this might be normal as I devised the assignment to appeal to the social networking generation. Another possibility is that many students managed to do a substantial part of the assignment without having to copy from a friend as Scheme is so beginner-friendly and powerful at the same time.

What did they think about Scheme

Many of them told me they found Scheme (and the DrScheme IDE) easier to understand than C++ which they used in Year I. Some said that higher-order function were very powerful and made their functions very compact yet powerful and easy to understand. A few didn’t use higher-order functions at all and relied on plain old recursion to solve the problems (that’s ok with me).

Interestingly, some students told me that Scheme should have been used in Year I instead of C++.

My opinion

I agree with them and I think there are two important reasons why Scheme is better than C++ for teaching programming:

  • Scheme, when used as a functional language, is waaaaaay simpler than C++. The only keywords we used were define, let*, lambda, cond, cons, car, cdr, add1, sub1 and null? With those, students managed to build very powerful functions. Compare this to the complexity of ISO C++.
  • Scheme has DrScheme which is, quite simply, the best Integrated Development Environment for students. It has fantastic stepping and tracing facilities (which are pretty much essential when one is learning…) and also provides a very powerful read-eval-loop. I learned programming around 1987 using a BASIC interpreter and I guess I would have become a poorer programmer if I only had a compiler at that time.

Of course, Scheme can be replaced by something like Haskell or even by the disciplined use of Ruby or Python.

The point is to use a simple (subset of a) language with a beginner-oriented IDE featuring a read-eval-loop. This is the exact opposite of using the most complex programming language ever with an IDE designed for professional software developers.

The top five universities in the world can’t all be wrong after all :-)