19
May 12

LATW Episode 16 (April 15 – May 15, 2012)

Web Video Box Office

Cool sound and water experiment

 

Berkeley Ridiculously Automated Dorm

 

Computing

Science & Technology


10
May 12

Challenges of pursing a CS degree at the CMU Qatar campus

Last Monday I went to the Qatar National Convention Center to attend the senior convocation. In the dinner banquet that followed I was fortunate enough to share the table with a gentleman who was on the advisory board of CMU alongside two other rising seniors. Given his position, the gentleman naturally asked us if we had any feedback about the Qatar campus. I was afraid that the three of us would commence a long rant about the horrors of the CS program. But what followed was a very well-structured explanation of what’s wrong in the CS program offered in Qatar. In fact, the explanation was so good that I decided to summarize it over here in this blog post.

Inability to offer classes to meet all curriculum requirements

This is by and large, the biggest problem CS students face on the Qatar campus. A good number of students walking at the convocation this year, will not get a degree because of this problem alone. The culprit in almost all of these cases is the Science Lab requirement. As per the curriculum,  CS students have to take 4 science courses, one of them being a science lab course. For a long time the Qatar campus has not been able to offer the lab requirement. Students were advised to cross register with Texas A&M/Cornell or spend a semester abroad in Pittsburgh to meet this requirement. For many students, neither of these options were feasible because of schedule clashes, or the unwillingness to study abroad. To be completely honest, the university did plan to offer lab courses many times. But for many consecutive semesters, these courses were canceled due to low number of registrations, or other logistic reasons. Even when the occasional Biology/Chemistry/Psychology lab was offered, students often found themselves unable to enroll in them because of not meeting pre-requirements. I understand, that this is a new campus and it will take time to iron out all the issues, but if there is consistently an issue with a single requirement, there should be a simple solution to offer a permanent class or waive the requirement all-together.

Ever changing elective requirements

This is one of those problems that affects both the campuses, but is aggravated over here because of the lack of choices for electives. The CS curriculum requires students to complete on course each to meet the Algorithms and Logic electives. In the Pittsburgh campus, there are about half a dozen choices for each of these electives. However, even one course for each elective is not offered consistently. Different visiting faculty often attempt to offer a different course every year, and the CS department tries to shoe-horn these courses to meet the elective requirements. Whenever, the schedule of classes is published every semester, it is often impossible to get a straight answer from academic advisors as to what requirements these new classes meet. The confusion surrounding this matter sometimes continues well after students have already started attending classes. Again, this does not seem like a very difficult problem to solve. Any debate about which requirement a course meets should be resolved before the schedule of classes is published and should be clearly documented.

Lack of a roadmap for future course offerings

This is somewhat related to the previous to. But I thought it deserves some special attention. As I said before, there are lab courses that are canceled right before the semester, unexpected lab courses for which students don’t have pre-requisites for, and even courses that switch to a different category during the semester. The situation regarding minors is even more unclear. The only thing for certain is that students can minor in BA and IS. With varying number of cross-registered/main campus courses, it is possible to minor in Maths and Design. Students have done it before. But only those students will be able to tell you what work-around they needed for the minor. Walk up to your advisor and ask for a suggested course sequence for a minor in X, chances are your advisor will be just as clueless as you are. Given all these complications, it is very difficult for a student to plan out a 4 year degree plan. What the CS program desperately needs is a roadmap of course offerings. I understand that there are many unforeseen factors. But I think a one-year or two-year roadmap of course-offerings is a reasonable demand.

Others

Besides these we also talked about other problems from our own experience. But they were mostly subjective in nature. That’s why I decided to file them under “others” and talk only about the most common of the issues. Given the dramatically small class sizes in CS, students get a lot of face time with professors both in and outside of class. While this could have been potentially beneficial, professors seem to abuse the extra face time by openly discussing poor grades, resulting in poor academic morale in an already challenging undergraduate program.

 

I was very happy to see the gentleman taking notes of all our feedback. I hope he gets the chance to bring them up someday and truly make a difference for prospective students.


15
Apr 12

LATW Episode 15 (March 1 – April 15, 2012)

Web Video Box Office

ship

100 years of ships

wind

Perpetual Ocean

Science & Technology

Computing


30
Mar 12

Qatar’s emerging technology scene

Every now and then a senior year student asks me “Do you know of any companies that are hiring computer science graduates?” Or the parent of a prospective student asks me, “Should I let my daughter study Information Systems, is there really a market for this major?”

I try to answer with as much enthusiasm as I can gather. I tell them about the tons of internships students do each year. I tell them about myself, about how I got myself into General Electric. As long as I talk, I can see a glow in their eyes. But it is very short-lived. I know as soon as I leave, they’ll start to have doubts again. I wish I could point people to a resource that they could browse at the comfort of their homes and use to make informed decisions about themselves or their children.

I believe there is a big gap between what the citizens of Qatar believe about the job market, and how it really is. And it’s really a matter of shame. Qatar has been investing in its knowledge based economy for about a decade now. To make this investment worthwhile, we need to close this gap from both sides. We need a platform to let students know what’s happening in Qatar’s technology scene, and we need the tech-companies to know more about students, their curriculum, their research, their projects etc..

All this is about to change with “Emerging Technologist”, a one of a kind internet show aimed at bridging the gap between Qatar’s tech industry and its world-class academia. Over the course of the next few months ET will:

  • Chase down working graduates from leading universities in Qatar and interview them about their jobs, their experience and their ambitions.
  • Collaborate with professors to get some insight on academic research and have students describe their contribution.
  • Interview potential employers and build detailed job profiles ahead of the career fair season.
  • Maintain up-to-date records of internship and full-time employment details of students majoring in tech.
  • Go on a university-level talent hunt looking for budding technology entrepreneurs with interesting personal projects.

The show is currently going through the planning phase for season 1. The current team consists of recent graduates, seniors and juniors from Carnegie Mellon University in Qatar. To be able to produce this show successfully we’ll need talented students to direct, record and edit our short episodes. The team is also looking for student contacts in TAMUQ, QU and CNAQ to expand our coverage to all technology domains.

If you are interested in a semester-long engagement, or willing to brainstorm with us over the summer, drop us an email, or follow us on:

emergingtechnologist@gmail.com

http://emergingtechnologist.tumblr.com


06
Mar 12

LATW Episode 14 (February 1 – February 29, 2012)

Video Box Office

starry_night

Interactive Starry Night

needle

Water droplets orbiting a needle

Photo of the month

guess

Guess the subject of the photograph

Science

Computing


18
Feb 12

Structural Pattern Matching using Exceptions

Back in college when I was first exposed to functional languages, I fell in love with algebraic data types and structural pattern matching. Now that I have joined the work-force I no longer have the freedom to work with those languages. So I decided to give a shot at emulating structural pattern matching in Java.

If this concept is new to you here’s a short intro. Let’s say we want to represent binary trees. We know that a tree has three kinds of structures:

  • A node that can have a left branch and right branch
  • A leaf that has a value
  • An empty tree with no value or branches

In Haskell, we can group these three structures under a single data type:

image

Now, whenever we do any kind of operation on trees, we can use pattern matching to find out which of these three structures we are dealing with. For example, here is function that calculates the depth of a tree.

image

This recursive function, tests the structure of the tree and returns different values depending on the pattern that matched.

Now, all that is good. But how do we implement the same in an object oriented language that does not support algebraic data types or pattern matching. Well, the closest thing to algebraic data types in an OOP language like Java is a class. And to simulate pattern matching we will use a feature called polymorphism.

Here’s our first implementation:

image

Nothing fancy is going on in this code snippet. I declared an interface called Tree which defines a method signature called “depth”. There are three classes that implement this interface. And each class provides it’s own implementation of depth. With this setup, the master depth function is trivial:

image

With the help of polymorphism, at each step of the recursion, the right implementation of depth is going to be called based on the class.

So? What’s the problem?  Well, it was trivial to write, but it’s going to be a nightmare to maintain this setup. Let’s say, tomorrow we want to add a function to flatten a tree, or a function to do an in-order traversal. We would have to add the methods to the tree interface. And then we would need to add an implementation of these methods to each of the three classes. Doesn’t sound like a lot of work. But imagine if we were distributing these classes as a library and there were hundreds of other people using it. Each time we add a couple of utility methods to the Tree interface we would need to recompile all the classes and deploy a new version of the library, and ask hundreds of users to update to the latest version.

So, we will need to think of a different approach. One that does not require us to change the original classes. We need an approach that empowers the library user to write his own implementation of “depth” without any fuss.

The quick and dirty way would be to use the instanceof operator to perform pattern matching manually.

image

This version works, but it has its problems. By using the instanceof operator we are giving up all compile-time guarantees on whether we are doing our cast correctly. That means, if you make any mistake, you’ll only find that out only at runtime. Moreover, our previous approach used interfaces. So we were guaranteed to have an implementation of depth for each possible structure. In our new approach, there are no such guarantees. If the library user, forgot to check for a particular variant of the tree structure he wouldn’t get any compile time warning, just an exception at runtime.

We need a new approach. One that takes advantage of compile time checks and also forces us to exhaustively check for all possible structures. We can do that using Exceptions and Try-Catch blocks. Here’s our new implementation of Tree:

image

Here are the important differences:

  • Tree is not an interface anymore, it’s a concrete class
  • Tree extends Exception, so it can be thrown
  • Node, Leaf, and Empty are also exceptions, so they can also be thrown
  • The match method can throw an exception corresponding to each possible structure

With our new approach, here is our new depth function:

image

Since the match method of the Tree class exhaustively lists all possible structures as throwable Exceptions, the depth function will even not compile unless there is a catch block for each structure. As a result, you are getting both exhaustiveness and compile time checks at the same time. To be honest, this does not guarantee 100% exhaustiveness. The developer of the library has to make sure he throws an Exception for each possible sub-class of his algebraic type. But at least, in this approach, the burden of responsibility lies on the API side, not on the user. Therefore, if any future release of the library introduces a new structure, users won’t have to read the documentation, or discover it at runtime. They can just rely on the compiler to do the check for them and identify the affected methods.

There’s just one thing that makes this approach less than perfect. Unfortunately, our tree class cannot be generic. Because of the way generics are implemented in Java, sub-classes of Exception are not allowed to be generic.

If this is a deal breaker for you, check out this excellent blog post that describes another approach using the Functional Java library.


08
Feb 12

Paradox of a CS major

  • We know how to write a History essay or an English research paper, but don’t have any clue when it comes to writing a functional specification document or a technical design document.
  • We can accurately measure the run time complexity of an algorithm but cannot reliably say how long we will need to write a piece of code.
  • We can make sense of an assembly dump, but cannot parse a piece of code written by someone else and proceed to rewrite it.
  • We learn how how to code the hard way with Vim and Emacs, but never bother to learn to use all the features of Eclipse.
  • We can do miracles while coding alone, but have no clue how to commit, checkout, branch, tag, and merge using a revision control software for a team project.
  • We excel at writing thousands of lines of code, but have difficulty compiling, linking, and creating executables.
  • We enjoy the challenge of a good debugging session, but hate to write unit tests and regression tests.

03
Feb 12

LATW Episode 13 (January 1 – January 31, 2012)

Web Video Box Office

arora

Breathtaking aurora formed by the largest magnetic storm in 10 years

robots

Interesting short film about prejudice against robots

Computing

Science

Bonus


19
Jan 12

Pitfalls of Programming at Work

As I slowly approach to the end of my second year of work at GE, I can sense how much I have changed as a programmer since I left CMU. In this article I want to put down my “lessons learnt” on paper. Chances are that in a few years I won’t even remember what it felt like to go to college. So before I forget I want to pass on the experience that no text book could ever teach me. Rather than a write a wordy reflective essay, I will just list some of the common pitfalls that you should avoid as a newly hired programmer.

Resist the urge to rewrite code

This is probably the hardest one. So it deserves some special attention. You will come across a lot of crappy code in your work life. There’s seldom any documentation. So your only option will be to read through code. And the more you read, the more you will feel the code has no structure, things are not done in a proper way, there’s a lot of repetition etc.. Well guess what? It might be crappy code, but it’s well tested crappy code. A lot of the obscure code-blocks are undocumented patches to bugs people found after months of testing. If you are new to the company, you will have absolutely no clue about all the bizarre edge cases of a program. Chances are when you rewrite a piece of code, you will produce a clean but buggy application. If you are unsure whether to rewrite or not, ask yourself these questions:

  1. Will cleaning up the code reduce development time in the future?
  2. Will it make testing easier?
  3. Will it make deployment less time consuming?
  4. Does #1, #2, #3 take more time the time it will take you to rewrite the code?

If the answer to all four of these questions are “yes”, try to see if your coworkers think the same too.

Not being satisfied by anything other than your work

This is also a hard one. If you are a hard-working and productive programmer, you will get a lot of responsibility on your shoulder. There’s nothing wrong with that. But don’t go overboard. Typically there will be others in your company who can also code. You may not think that they are as skillful as you. But practically speaking, given enough time they can also get the job done. So don’t lose your sleep trying to be a one man army. Be a team player. Learn to delegate. Document your code, so that others can fill in when you go on a well deserved vacation.

Get over the need for speed

Yes, changing that data structure to a tree will make lookups O(logn). But it will only reduce runtime from 10 minutes to 9.5. It’s usually very hard to give a find out the big O complexity of real life programs. So don’t jump at the first chance you get to apply your algorithm skills. Profile your code thoroughly. Get an understanding of what the real bottlenecks are and whether they are under your control. And even then, you should only optimize if your users are complaining about it.

Reluctance to test your code

Admit it. We all hate testing. We hated in college. We got mad at professors who graded your test cases. And we still hate it at work. The only difference is, now the code may affect the lives of hundreds or even thousands of people. So get over it. If you feel testing is a waste of time. Write test scripts. Write modular code. Write unit tests as you code. Get your co-workers to test your code. The more testing you pile up till the end, the more repulsive it will get. And then procrastination will take over and you will end up shipping buggy code.

Those were the main pitfalls I could think of. Maybe someday I will write a part 2 for this post with all the small tips and tricks I picked up over the years. Anyhow, if you manage to start your career avoiding these pitfalls, you should have a bright future ahead.


17
Jan 12

A rant against “religious spam”

I don’t claim to be a religious person. However I do view religion as a part of my identity, just like my nationality. Just like I won’t tolerate racist behavior against Bangladeshis, I wouldn’t tolerate mistreatment of Muslims either. However the opposite scenario is also true. Just like how I am sickened when I hear about a Bangladeshi doing something stupid to ruin our reputation, I am also ashamed when a fellow Muslim make us all look misinformed. This is really what this rant is all about.

Since the olden days of “Hotmail” people have been forwarding emails containing scientifically inaccurate “proofs” of vague concepts mentioned in the Quran. Even with the advent of social networks, people haven’t changed much. I still see some of my Facebook friends copy and paste statuses that outrageously inaccurate. Here’s one of my recent favorites:

image

 

So “all the rays will emit from your brain to earth”, will it? As if electromagnetic waves are like water drops and will drip of your hair when you lower your head? So why I don’t see sunlight coming out of ears when you pray. Or why not the latest episode of America’s got Talent? They are all electromagnetic waves just like mobile signals.

I don’t mind people posting religious content on Facebook. In fact I actually encourage it because social networks are a great way of reaching out to people and I don’t see why religious scholars shouldn’t make use of it. I would just like to see authentic material. Quote something inspiring from the Quran, or a Hadith. Translate it into English or in your mother-tongue so others can understand. Just stop posting this non-scientific nonsense. You guys are all educated people. Just exercise your high-school science skills before copying statuses and spreading religious spam.

image

And if you would like to go the extra mile, click next to the post and mark it as spam to help stop spread this disease.


  • Twitter
  • Tumblr
  • Facebook
  • LinkedIn
  • YouTube