Friday, December 19, 2008

I'm a Geek

It's true, and heres why.

There is a site out there called Project Euler, which is basically a collection of math problems that (most of the time) require a computer to solve them. The idea is that you get an account, and then set about solving problems, and after you successfully solve a problem you get access to a forum thread where you can discuss your solution with other geeks. I would be lying if I said this wasn't one of the funnest things I've ever encountered. I actually discovered it during the semester, but I wasn't able to spend any time on it due to school work. Now that I am on break, I decided to try my hand at some problems. As of the beginning of break, I had solved two problems. Now, I have solved 25 problems. This is a particularly important number, as you have to solve 25 to officially obtain level 1 status, which the website informed me 79.89% of members do not do. So yeah, I did it, and I enjoyed it.

This experience has also served to make me and even bigger Python fan-boy that I already was. I have used Python for nearly every solution, and have been nothing less than amazed by the power of the language. I mentioned in my last entry that I didn't think Python was a replacement for Java. Let me clarify that statement quickly. Java is tops in my opinion for building big, carefully designed, object-oriented systems. It offers convenient language constructs for taking advantage of all of the buzz words associated with object-oriented design (encapsulation, inheritance, polymorphism, etc.). However, for smaller projects, which make up 99% of what every programmer I know does, most of that stuff is total overkill. Using Java to write a little app for personal use, or to sketch out an idea for a program, is like trying to kill a fly with a jackhammer. For just about anything I can think of, short of building a industry level project or some kind of speed-intensive application, Python is a much better choice.

I also think that Python is a much better choice for education. My reason for this is that I think what we are primarily studying as computer scientists is problem solving. The computer comes into the picture simply because it is the single best available tool for solving problems. In this way one can think of computer science as simply being applied mathematics, only with a massive scope of problems. When I think of mathematics, I think of the following statement by Alfred North Whitehead:

By relieving the brain of all unnecessary work, a good notation sets it free to concentrate on more advanced problems, and, in effect, increases the mental power of the race.


Python, I believe, is a good notation in this sense. One of the main problems people face when programming computers is that computers are very stupid and must be told exactly what to do and must be given explicit directions on how to accomplish these tasks. This often causes people to spend more time fighting the language than thinking about the problem. The expressiveness of python combined with its compact and intuitive syntax allows programmers to turn their attention back to the problem and let the computer really help them with the problem.

For example, there is a guy I go to school with who is in his second year in the program. He is a bright guy, but not very experienced with computer programming. He was asked to do some independent, out-0f-class work on a project for out school's Bioinformatics Research Group. We were talking about it and I suggested he consider using Python for it. He decided that it would be a good opportunity to pick up a second language and started simulataneously learning Python and writing his program in it. The results were somewhat amazing. He, in one semester, managed to put together a prototype of a application that does some fairly sophisticated analysis on DNA sequences. The seriousness of the problem he solved with this program and the difficulty in solving it was miles above anything he had done previously, and far surpassed anything his peers were doing. This, I believe, was primarily because he was able to use all of his creative potential and problem solving ability in actually solving the problem, and that was due to his language choice.

So in conclusion, Python is awesome, and so is Project Euler. Hooray for geekiness.

Friday, December 12, 2008

Break Time

The semester has finally ended, and not a moment to soon. Don't get me wrong, I love school, but it's definitely time for a little break. So what have I learned this semester? Heres a brief rundown:
  • I really like programming networked applications
  • I'm not so crazy about doing computer graphics stuff
  • Java is an outstanding programming language, despite what its critics say
  • Python is a great programming language, but no replacement for Java, despite what its proponents say
  • A less ambitious project that is finished and works is better than a potentially amazing project that isn't finished and doesn't work
  • Operating systems programming is very difficult
  • It's easier to blog about some topic you are interested in than to give random updates on your life
I am pleased with the outcome of this semester. For one, I got to do a lot of really cool stuff. I got to do an independent study project and learn a lot about operating systems, I got to compete (and get seriously humbled) in a programming competition, I got to present my work at a research conference, and I got to accept an award for all of the above (and more). Now I get to relax a while, hang out with Tab during the day, maybe play some video games, and I get to read some stuff just for fun. Granted, most of what I read will probably be about computers and programming, but the point is I will be doing it just because I want too. In particular, I plan on doing some reading on data structures to get prepared for my algorithms class next semester and I just bought a really cool book on design patterns. In general, I feel like the amount of stuff I want to study is just overwhelming. There is really no possible way I could learn about all of things I would like to learn about, so I just try to pick out things that I think are the most essential and start with them first.

Another exciting note, I just totally wiped Windows off my laptop and installed Linux on it. You would think that after three years of using Linux it would be old hat by now, but I am still totally amazed at its superiority over Windows. To indulge my geekiness a little, I didn't just toss in a Linux install disk and install over Windows, instead I downloaded a copy of Dariks Boot and Nuke and performed a complete and total annihilation of all of the data on my hard disk. Was this necessary? No. But I like to play with toys, and what's more fun than a toy that so thoroughly destroys a hard drive that not even the most sophisticated of data forensics devices can retreive anyting from it (can you say a ridiculous number of passes over the entire disk using a psuodo-random number generator)?

Well that ends my rant, I hope to cover some of the things I mentioned a little more thoroughly later, but until then, this Wii isn't going to play itself.

Saturday, December 6, 2008

mmmmm...tasty


If you are a fan of beer, and you don't mind spending a little money ever now and then to enjoy something really excellent, then let me recommend Samuel Adams Chocolate Bock. Sam Adams has always been known for producing some really great seasonal beers (the winter lager is also highly recommended), and occasionally they produce an outstanding special brew. After finishing a couple of major projects for school I decided to treat myself with a bottle of this, and it was indeed a treat. It is dark and rich without being too heavy, and the chocolate flavor is clearly present but not sweet or overpowering. Again, it is a little pricey, but if you are wanting to try out a really great beer, then it is a good investment.

making vi friendlier on Ubuntu

In the world of computing, there is no holy war that has been waged longer or fiercer than the editor war. The mere mention of vi or emacs in a tech forum post is the beginning of the end for that thread, and innocent bystanders should get out of the way as soon as possible. It has always occurred to me though, that there is one group of people, the young and uninitiated, for whom this endless battle is a but a strange curiosity. I know this because I was once a member of this group. Reading through the vicious flame wars, I became convinced that there was literally no decision more important than choosing your text editor, and these two (vi and emacs) were without question the only two worth choosing from. They were more than software, they were a marker of one's identity. To choose one was to align yourself with an ideology, and it was a choice with far deeper ramification than pc or mac could ever have. One could imagine my shock then, when I sat down at my Linux machine and started up vi for the first time. I stared at the cursor as it steadily blinked on the spartan background of the terminal. I squinted my eyes at the long list of arcane commands I found in a reference book. Once I got up the courage, I tried typing in some Java code...

No syntax highlighting.

No automatic code indention.

Nothing. I might as well be using notepad.

If you are a recent Linux convert, and a programmer, you too may have experienced the exact same thing. The good news is, you can believe the hype, vi is the amazing tool you have heard it is. The bad news is, it doesn't just come that way, and it's not terribly obvious how to get it that way. Hoperfully, however, I can help a little. I'm guessing the first thigns you want are syntax highlighting automatic code indention. These can be added fairly easily (note: I am assuming you are using Ubuntu, these instructions may not work on another distribution). The first issue here that confuses most people is that Ubuntu does not come with the full vi package by defualt, but rather vim-tiny (also note: vi is pretty old school and is generally not used much these days. Instead an updated version called vim is used, but it is often still referred to as vi, and starting vi at the command line will start vim instead). Once you have the package installed you just need to copy the code in an example file that comes with it over into the .vimrc file in your home folder. This will take care of the aforementioned issues. The commands you need to enter are:

sudo apt-get install vim-full
cp /usr/share/vim/vim71/vimrc_example.vim ~/.vimrc

Aftere you do this fire up a shell and try it out. I have tested it so far with C/C++, Java, and Python code and it works great for all three. I hope this helps get you up and running with vi, and I will try to post more fun tips as I come across them.

Friday, December 5, 2008

Tech Lust / Losing My Religion


Behold the object of my digital desire, the new MacBook. I had the chance to play around with one while I was at the mall today, and to say I was impressed would be quite an understatement. This thing looks great, feels great, is incredibly fast, and it comes with features that Windows has never even thought about including. First of all, the most obvious plus is that it runs a Unix-based operating system. Second, the programs for a Mac are exceptional. For example, Mac OS X includes, by default, a 3D grapher. Now this isn't one of the apps that apple publicizes in order to sell Macs, and its coolness is lost on the vast majority of users, but for a math geek like me this is a really big deal. No, it's not the greatest 3D grapher out there, but just the fact that it is there adds a certain something to the appeal of the computer. I feel like it is Apple's way of winking at me, saying "even though these are being marketed to the average users, we both know about the geeky goodness inside". And most importantly, Mac OS X has the feeling of really being an elegant system. In Windows it feels like the OS and the programs it is running exist in two totally separate realms, and are always battling against each other; the OS preventing the application from realizing its true potential and the application trying its best to crash the entire system. Granted, this is a little imaginative on my part, but many of you have surely had the same feeling. Linux is much better, at least in that it feels stable, but it also feels cobbled together to an even worse degree. Now a true Linux aficionado, such as myself, will pontificate for hours about how this is a good thing, and how Linux allows developers the freedom to do whatever they want and as a result get to use a rich, diverse selection of software, none of which is forced into some mold that was arbitrarily decided upon by a big software company. While I do believe this is true, I must confess that even in the heat of my fervent Linux fan-boy passion I see the seamless integration of OS X and I am little jealous.

Speaking of this secret jealousy forces me to face the difficult question that it brings to light. Could I switch to Mac, or would doing so make me feel like i was betraying Linux? I feel like I should explain something to any non-techies who may have stumbled upon this blog and are a little confused by the potential ridiculousness of that last sentence. For those of us who use it, Linux is not just an operating system, it is a religion. Actually, open-source software is the religion, but central to the practice of this religion is the use of Linux.

I think the answer to my question lies in the subtleties surrounding it. First of all, it isn't really the binary choice I make it out to be. It's not like my laptop (which is what I will be purchasing next) will be my only computer. I am currently typing this on a desktop running Linux which will still be around and still be running Linux even if I do buy a Mac. Also, through the glorious technology that is virtualization I don't have to be restricted to just running OS X on a Mac. In fact, it's already a guaranteed thing that whatever I get I will be running Windows on it in a virtual machine, so why not run Linux too, then I can have all three major operating systems (sorry Solaris, you don't get included in this list yet) on one computer. Now that really excites my geekiness. Finally, since Macs now run on Intel processors, I can install Linux directly on the hard drive and run a dual boot if my Linux shunning guilt gets the best of me.

I also want to point out that, despite my love of open-source software, I don't necessarily dislike proprietary software. On the contrary, I think there are very good arguments for using proprietary software. For one, when you buy a car you want it to be made by professional car makers, most likely by the best you can afford to buy from. Why should operating systems really be any different? In fact, if you are in my position and your computer is the single most important thing besides your brain in your professional life, then you should feel even more strongly about it. That doesn't necessarily mean that Linux is doomed to be inferior because it's not made exclusively by people who are being paid to make it and it only, but it does at give you something to think about. I have no doubt that many of the people who are volunteering their time to work on Linux (and the applications that run on it) are superior programmers to the people at Apple,but the fact that they are volunteering shows in the afore-mentioned integration issues. The people at Apple are getting paid to insure that the code they write works in the system as a whole.

The final thing that makes Mac so appealing is that you don't have to spend as much time administrating your own system with it. Don't get me wrong, I love playing with my computer, but sometimes I don't want to spend all night tracking down dependencies and editing configuration files, I just want things to work. The point is, I will continue to consider this issue, but for now Mac looks really good.

In closing, I'd like to give a shout out to my fiancee Tab, who is and will always be the original Mac convert in our household. If there is any justice then she will be the first of us to get a shiny new Mac, hopefully using a nice piece of cash from a shiny new job.

Thursday, December 4, 2008

Not off to a great start.

I was sitting here and work, and there really wassn't any work to do, so I decided to try something out. While looking through stuff I discovered that Microsoft just released the (somewhat) anticipated Office Live site. The idea here is compete with Google Docs by offering their own online document editing web app. This is a sensible move on Microsoft's part, given that Google is stepping on their long controlled office suite territory in a major way. Granted, the Google Docs apps still lack many of the features available in their Office counterparts, but the advantages offered in cloud storage and extensive collaboration make up for a good deal of these. I know that this year alone I have used Google Docs for at least five school projects, all of which I would of used Word for in the past. So how does Office Live compare? Well, things looked good in the beginning. I went to the site and was able to sign in using my Windows Live account. I was very impressed at this point with what seemed to be a very generous offer from Microsoft. I was sure they didn't really want to offer Office services for free, but I figured that they were somewhat forced to by the fact that Google Docs is free and that's who they are competing with. On top of the free access, the user interface looked really nice. The "workspaces" motif was intuitive and appealing, and I liked the fact that they offered several workspace templates, all of which come loaded with template docs for that particular theme. For example, I decided to check the job search workspace and found pretty nice templates for the following:
  • cover letter
  • informational interview request
  • interview preparation notes
  • interview thank you letter
  • resume
  • interview schedule
  • job contacts
I also noticed that you could share documents with collaborators and add comments to documents. Impressed so far, I decided to try to create a new document. I clicked on "new", chose to create a Word document, and then the wheels totally came off. As it turns out, you can't actually edit anything online. Instead you go to the site, click on a file and "check it out", meaning that it opens up locally on your machine in Microsoft Office, and when you are done working on it you check it back in. There are at least two flaws here. First of all, while person has a document checked out it is inaccessible to all other collaborators. This I was only mildly annoyed by. After all, even though you technically can simultaneously edit a Google Doc with your collaborators, I don't see too many people actually doing it. The second issue is the big one. You have to actually have Microsoft Office on your computer to do anything. To begin with, this makes the whole thing a little dishonest, because it's not really free to use like they claim. Sure it's free if you already office, but if not you are out of luck. Chalk one up for Google. The next problem, and this is more personal, is that it is totally inaccessible to Linux users (and to Mac users who don't use Office for Mac). And what about Google Docs? Oh yeah, it's totally cross platform...chalk another one up for Google. Once I got over my shock and outrage, I decided to move on with my experiment and try (since I happened to be using a Windows machine at school) to edit a document. The thought hadn't occurred to me yet, but I realized at this point that there was going to be an issue. How was Word going to be able to check out and check in documents, given that they weren't originally designed with that functionality in mind? The solution is appalling. You have to download a plug-in to make it possible. That's right, you have to actually download and install yet another thing from Microsoft for this is to be usable, which is just great since I'm working on a campus machine that I don't have admin rights on. At this point I am ready to call this experiment a total fail. The gist here is that Microsoft is trying to offer me a product that does what Google Docs already does, only it has less features, requires that I already own their expensive office suite, isn't cross platform, and requires I install more stuff. Bang-up job guys.

The Microsoft Hater

I am a Hater of all things Microsoft, and I have been for some time. About three years ago I started using Linux and I have been using it primarily ever since. I do have a laptop with Windows on it that I use for school projects (I am a computer science major and often have to use Microsoft products such as Visual Studio), but when given the choice I always use Linux. However, if there is anything stronger than my hatred for Microsoft it is my love of technology. For that reason I have decided to try an experiment. I have heard that Microsoft has released quite a few cool products since I last used their stuff regularly and they have made significant improvements to others. Now I have no desire to needlessly hate a company or to hate them based on past mistakes. In fact, I think the recent rise of interest in Apple's products coupled with the dominance of Google on the web has provided Microsoft with quite a wake-up call and given them an incentive to improve their offerings. So I have downloaded the Windows Live apps and registered an account, and I will be trying out the goods and writing about my experiences and opinions. Will Microsoft win back my affection, or will my hatred only grow stronger? Stay tuned to find out.