Freaks and Geeks

Director Paul Feig appeared on a recent Wait Wait… Don’t Tell Me! episode. His interview led me to two discoveries: the recent chick-flick Bridesmaids, which was pretty good and the TV series Freaks and Geeks, which turned out to be brilliant.

Freaks and Geeks is a high-school drama and the series that I believe it comes closest to is The Wonder Years. The series is set in the early 80s and revolves around two groups of students: a bunch of middle school geeks and a group of high school rebels, whom the geeks call freaks. The series follows the journey of Lindsay, a top-performing math student, from geek to freak.

F&G gets really engrossing after the first couple of episodes. The portrayal of school students is probably the most true and real I have ever seen. Diverging from typical school TV series, students here are not extremely violent or evil, they are just confused. Even the freaks here are not really freaks, they are just growing into an adult world and learning to negotiate it. The series beautifully drives home the fact that the geeks, the rebels, the freaks and everyone else in school are not that different from each other.

Wrapped around such a genuine core, Paul Feig throws in episodes each of which explores one aspect of growing up. Thanks to Lindsay and Sam, we get to see two transitions in the same series: Sam growing from middle to high school, while remaining true to his geekiness, while Lindsay grows into a college adult slowly revealing her inner rebel.

The episodes are 45 minutes long and totally engrossing. The rock music of the 70s is a huge running theme in the series and used heavily in every episode. There is a lot of content online that discusses the music that appears in F&G. I discovered The Who thanks to an episode that revolves around this British rock band. The casting and actors in F&G are so perfect that they are sure to remain memorable for life. While my personal favorites are the three geeks, the freaks are now Hollywood stars: James Franco, Jason Segel and Seth Rogen.

Maybe if Freaks and Geeks had appeared on HBO now, it would have thrived and survived longer. Such a brilliant act was not well appreciated by ABC viewers in 1999 and the series was sadly dumped after the first season. Freaks and Geeks gets my recommendation as the best TV series on our experiences and journeys in high school.

Wallet? What wallet?

My wallet had become quite fat and heavy, so I decided to see how others were tackling this problem. Quite a few people were switching to minimal wallets, card cases and money clips. So, about a month ago, I decided to go minimal on my wallet problem.

First, I took out all the stuff from my wallet and decided which of those items I really needed. I pared it down to 3 essential cards and a few currency notes:

  • NETS card for monetary transactions.
  • EZ-Link card for commuting on buses and trains.
  • University card for access to university facilities.
  • Lunch money.

After that, I picked up a tiny card case with 4 slots that could hold these items. Among the 4 items, the EZ-Link and university card never need to be removed out since they use RFID. And I was done!


This minimal wallet was so thin and small that I could not even feel its presence in my back pocket! It has been more than a month and the experiment has been a success. I am even thinking of skipping the lunch money, since I can keep that at my desk at work.

Computer Systems: A Programmer’s Perspective (2nd Edition)

I picked up Computer Systems: A Programmer’s Perspective (2nd Edition) by Randal Bryant and David O’Hallaron while searching for a stimulating book on computer architecture or operating systems. CSAPP turned out to be a good find since it is aimed at the intersection of computer architecture, computers systems and OS. Using practical examples and problems the book walks the student through all the hardware and software knowledge that is required to understand how a program comes to life on a computer.

Assume a student compiles a Hello world program and runs it. A plethora of hardware features and a large set of software come together to make this simple magic possible. Software like compiler, assembler, linker, loader, libraries and operating system kernel help to compile and load the program. Hardware features like hard disk, main memory, controllers, buses, cache and the processor bring the program to life. Also, hardware and software need to also act in tandem in virtual memory, system calls and interrupt handling to make the execution of a program scalable, efficient, fast and safe. This book argues that a good programmer needs to be aware of all the afore mentioned concepts and these are what the book tries to cover.

Some notes about this book:

  • The book is structured as a workbook. You read a concept, solve a problem or experiment with a program that illustrates it and then move on to the next concept. There are trivia, blurbs and practical information about IA32 (Intel) architecture and Linux where-ever necessary. This ensures that the book remains grounded in reality and never feels dry to study.
  • The authors have tried their best to introduce as many of modern multiprocessor concepts as possible in a practical way. There is a lot missing, for example, super-scalar architecture and out-of-order execution. However, the programmer interested in these details can easily learn about them with a book like Inside The Machine.
  • The chapters on memory hierarchy and virtual memory are the real treasure in this book. The sections on cache here and in Inside The Machine stand head-to-head as the most practical introductions to the topic.
  • Virtual memory is an important concept, but sadly it gets short shrift in computer science education. This is because it requires the OS and hardware to work together and those subjects are typically covered by two different courses or textbooks in university. Not having to deal with such caste boundaries, this book is able to show the student how virtual memory is brought to life.
  • The book gets a bit vague towards the end. I was not interested in and did not see any benefit for this book to touch on areas of system I/O, network programming and concurrency.

I am happy to conclude that CSAPP is a stimulating book to study and work through. This book covers all the knowledge that a good programmer needs to understand how his program executes upon the OS and CPU and how to make it efficient, fast and scalable. I highly recommend Computer Systems: A Programmer’s Perspective for anyone who feel they need a better grasp of these ideas.

Before The Rains

Looking for some movies starring Nandita Das, we ended up picking Before The Rains. Directed by Santosh Sivan, this is a 1930s drama set in the Kerala of British India. Henry (Linus Roache) is a planter who with the help of T.K. (Rahul Bose), a local, is planning to build a road in the hills so that he can start tea and spice plantations. Linus is also having a secret affair with his housemaid Sajani (Nandita Das). As Linus and T.K. strive to finish the construction of their road before the monsoon, complications arise when Linus’s wife returns to Kerala and Sajani’s villagers discover her secret.

Santosh Sivan is a cinematographer first and it really shows in Before the Rains. He creates a secret dreamland in the midst of lush green hills of Kerala, that feels hidden away from humanity. This is a place where a British planter and an Indian villager could spend endless days in each others arms, collect wild honey or wade in jungle streams. The dream is shattered once reality intrudes. Linus has his career invested in building the road, for which he needs all the help of Sajani’s villagers. But, due to their traditional beliefs and customs they will never accept their love, if discovered. The Indian Independence movement is gathering pace in the village, adding another facet to the clash between Linus and the world around him. And caught in between these worlds is T.K., a character (and name) that seems to have been plucked right out of a RKN novel. He does not mind the affair, likes the development of the road, sympathizes with the freedom fighters and cannot cut his ties to his villagers and their customs. Unable to pick a side, it is he who is put to the hardest test.

There cannot be many complaints about the acting with Rahul Bose and Nandita playing the characters. The movie is told from the world of its principal three characters, and so being set in English does not feel unnatural. The background score uses traditional Kerala instruments and is nice and atmospheric. By picking a ripe time and location, the story brings about the tension between master-servant, Western-Oriental culture and the British-Indian clash. Though the road and the fate of its characters are left incomplete at the end, I felt that Before The Rains is a satisfying watch because of that.

Huduga Hudugi (ಹುಡುಗ ಹುಡುಗಿ)

Huduga Hudugi (ಹುಡುಗ ಹುಡುಗಿ) is a run-of-the-mill romantic comedy directed by Indrajit Lankesh. Dhyan and Lekha Washington play anchors of a TV show about love problems. When Lekha has a crush on a rich brat, Dhyan helps her snag him. And predictably, as her wedding date nears, she starts having doubts and start wishing for Dhyan instead.

Huduga Hudugi would have been a lot more watchable if not for the pretentious songs and pomp that Indrajit throws into the movie. Actresses Ileana and Sada are also added into the mix just for the sake of it. Despite this, a few songs are good, I like the slow Usire Ninna. Dhyan and Lekha are actually quite bearable and one can catch this movie just for fun.

Back to the dumb-phone

I have always resisted the cellphone. When it first appeared, I saw it as the ultimate intrusion into a person’s solitude. I held out as long as I could for many years, even while working on software that ended up in many cellphones.

I like the kind of diverse hardware that is packed into today’s smartphone. And I absolutely love that we can now write software for the phone in managed languages like C# or Java and share them with the world. It is this power to create something for an ubiquitous gadget that endears it to me. As a creator, I love the smartphone, but as a user, I loathe it. Time and attention are scarce in my everyday life and the smartphone is an absolute hog of both.

When my phone finally started to gasp for breath last week, after a good 5-year run, I knew my choice. I had been thinking for many years that I need to move back to a dumb-phone. If I really could, I would love to live without a cellphone. I think that would be the ultimate freedom in today’s world. Since that is not possible in my current condition, I chose the next best option: a phone that does calls and SMS, and nothing else. Life is now back on the slow lane and I’ve got to see how long this world will allow me to enjoy this ride.

Programming Massively Parallel Processors

The next step for a CUDA newbie after CUDA by Example would naturally be the book Programming Massively Parallel Processors by David Kirk and Wen-mei Hwu. They taught the first course on CUDA at UIUC for a few semesters and this book is based on its lecture notes. I had used their lecture notes and videos when I first learnt CUDA.

To write any CUDA application that moulds the problem optimally to the CUDA architecture requires the programmer to think very differently from programming on a CPU. Using a matrix multiplication example, the authors walk the student through many levels of improvement. The authors introduce the different facets of the architecture and end up improving the performance of the solution by as much as two orders of magnitude in the end.

All the concepts of the CUDA architecture are covered: the thread-block-grid hierarchy, the global-shared-local memories and barrier synchronization. Details of the warps and the warp scheduler are explained. Since most CUDA applications are scientific, there is an entire chapter on the floating point format. This chapter gives a practitioner’s perspective that I found to be more useful than the popular but obscure What every computer scientist should know about floating-point arithmetic. There are two chapters on application case studies, which are mostly useless since one cannot understand the application intimately enough to draw any lessons from it.

CUDA runs only on NVIDIA devices. OpenCL is its twin that is designed to be used on all kinds of CPU and GPU processors. The authors have thrown in a chapter on OpenCL for folks who need to transition to it. OpenCL is exactly like CUDA, except that it does not have an equivalent of the CUDA Runtime API. So, the programmer ends up spending some time building the scaffolding required to run his kernels.

Programming Massively Parallel Processors is a easy book to study from. It should be accessible to any intermediate-to-expert programmer. Newbies can check out CUDA by Example before studying this book. I do wish this book covered some information on cache configuration, launch bounds, profiling, compiler options and other intimate details which one ends up using to squeeze out the last bit of performance. Currently, I do need to fall back onto the CUDA Programming Guide for such information. The book is also a wee bit outdated since the Fermi architecture is not well covered and the new Kepler architecture has already been released.