My experiences

This section is just a way of including all the stuff I learn in little bits and pieces and then forget. Sometimes I feel I'm redoing things (many times). Hopefully this section will collect things so then I can come back here and say 'Oh, that's how I did that'. Most of the time I have a little problem or a question then I google it, fix it and then forget about it. I should be better at bookmarking or tagging. Here I will include more general stuff.


Profiling code

Profiling consists of a dynamic analysis of you program, which is usually useful to learn in which functions or subroutines the program is spending more time or how memory is allocated. Usually, it is not a good idea to worry about this until you program does what is intended to do. I have used Shark in OS X to profile code and it is extremeley good and easy to use. Launch Shark, start it, run your application, stop Shark and get the results. I don't remember now but I think it does not come installed by default and it might need to be installed from the DVD.

In Linux gprof has been used, but I haven't tried it yet and I'm using oprofile instead. In Ubnutu, it seems that the samples folder got placed in /home/user/ so to get it to work you need to specify the folder for the report (opreport --session-dir=/home/user). In addition, in a virtual machine (I'm running Fedora) some modifications are needed .


The first time I saw Windows running on a Mac was sometime in early 2007. This was done using Parallels and it was cool to see the desktop rotating like a cube when switching between OSs. At the time I was dual-booting Windows and Ubuntu on my laptop (Toshiba P15-s409) and it was always a pain every time I wanted to use Windows. I decided to get a Mac when the Toshiba's hard drive died. Although it was fixable, the laptop had three big drawbacks: 1) poor battery life, probably less than two hours, 2) frequently overheated and 3) it was rather heavy ~8lbs. However, it is still pretty powerful and snappy with 2.8 GHz and over 1GB of RAM it runs Ubuntu 9.04 like a champ.

Now on the Mac I have VMware Fusion which allows me to run Windows XP when needed. I replaced the hard drive on the Toshiba and now run Windows XP under VirtualBox which is pretty cool. I also run other Ubuntu box as a remote desktop on these images.



Overall, virtualization is pretty cool. I was going to try Windows 7 today (as a virtual machine) until I found out that it requires 1GB of RAM and I it is probably a hog like Vista despite what some say.

Mac and the dark side

About 10 days ago my good old toshiba p15-409 started having problems. Serious problems. I would try to open an application and and it would take like 30 seconds while the hard drive showed close to 100% activity. This was a bad sign. Surely enough, two days later I get a smart check saying I should back up everything since there was an imminent hard disk failure. I resolved not to fix it (yet) but to buy a new laptop. Unfortunately I feel there are very few options. Nowadays most laptops come with Vista and I hear all this horror stories of trying to 'upgrade' to XP. On the other hand, I don't use Windows if I have a choice although it is sometimes useful to have a Windows box handy. For example, uploading videos from picasa can only be done using Windows (at the moment). Alternatively, I could get a laptop from System76 running Ubuntu, but their options did not fully convinced me.


So I decided to get a Mac (MacBook Pro 15in 2.4 GHz 4 GB RAM). It is a beautiful laptop in terms of specs and design. This machine is FAST. These new Intel processors fly!

PROS: It is a UNIX machine (sort of). So in many ways it is like having Linux. Everything is pretty and shiny and I don't need to worry about wireless, DVD playback, power management, graphics cards, etc. as I normally do in Ubuntu. Solving this issues can be relatively easy, but sometimes it is impossible. For example, my old laptop would not wake from sleeping mode no matter how hard I tried to fix it.  So these are pros when compared to Linux mostly. The hardware and software work together nicely in a Mac whereas this is not always easy for Linux on a laptop. Another pro is that if I ever need MS Office I could install the Mac version (although, most probably this will never happen). If I'm really desperate I could also install Windows or Ubuntu with Boot Camp!

CONS: My first two objections about this Mac coming from Linux are that this Mac is already using 40GB of disk space (!). I haven't figure out yet where is all going. I barely installed a few programs and just have a few files, pictures and movies. I guess there is no free lunch. On Linux I was doing all of my work, plus files, pictures and movies and I was barely exceeding 10GB of disk space. The second is about RAM. I got 4GB instead of the 2GB that this model usually ships with and this hog really needs it to run more than 3 or 4 apps (!). Another less important issue is that many of the Open Source programs I use run smoother on Linux but they run pretty well on the Mac, so this is not a big deal.

I will update my first impressions of using this Mac in the future. So far it is a very pleasent experioence. Why the dark side? Because it is commercial software and you are constantly tempted to spend money. From iTunes to gadgets and software. Apparently, there are a lot of good programs for Macs that cost in the order of $ 30 which promise to be really good. Coming from Ubuntu where I never spent a dime on software this seems somewhat aggressive at times. 

More Emacs and other goodies

I have added the reference cards I use on a daily basis. These are extremely useful but I don't always remember to bring them with me where I need them. So here they are for whenever I need them.  

I have been learning some new stuff lately. First, installing software in linux is not always easy. :) I had some difficulties when installing a few R packages. The problem always seems to be that there is some library that is required by these packages and these are not installed even if you do have the linux package installed. The other problem is to have the configure file point to where the library is located. 

I have also been having fun learning about NetCDF files and investigating the software that can handle these files. I was pleased to see that most of this work is done in Unix or Linux. At the moment I'm using nco and ncview to manipulate and get a quick look at the data. Soon I will be using the RNetCDF package more often which was not so easy to install in Fedora.


I haven't posted here since Feb 20th since I've been quite busy. Really, part of the motivation for writing this is that I can come back and see how I did something. For example, ocasionally I find that for something to work I need a specific package, or the way to set up something is done in this or that way. Weeks or months later I need to do it again and it just takes forever, as if I had never done it before.

I added a section for GNU Emacs my everyday environment. I really enjoy editing R, C and LaTeX in Emacs as well as running a shell or just editing text files. Ironically, I'm using Kompozer to edit this file. 

iPod and Ubuntu

Almost two years ago I've got an iPod (black nano 2GB Model A1137) from my wife which came 'free' with the MacBook I bought for her for finishing her PhD. So I downloaded iTunes for Windows and starting building a library. Now, I'm trying to boot into Windows as little as possible and I have her old Dell Inspiron which I'm planning to convert in a dedicated photos/music computer. About a month ago I was playing around with all the different programs you can use in Ubuntu to manage your iPod (see left). One of them gtkpod corrupted the database file on the iPod and it looked like it had erased all the music in it! Oh, I love Ubuntu. :)

So the first thing was leave the m4a format behind. For this in iTunes you can go to Edit -> Preferences -> Advanced and select the MP3 Encoder option. Now you can right click on songs in your library and convert them to mp3. The mp3 format is not great, but as far as I know it is the easiest way of moving the music from iTunes Windows to Ubuntu. In Ubuntu I'm using Banshee and I really like it so far. 

The recommended option for iPods is using rhythmbox for managing your library  and listening music from the iPod and use gtkpod for transfering and deleting music to and from the iPod. These did not work at all for me. Also, I've tried Amarok several times and I still don't like it. It did not work with my iPod either. If you are going to try any of this stuf yourself I recommend backing up your music as you never know what these programs are going to do to your iPod. I don't use the iPod for podcasts or calendars or anything like that, so can't really say much about this.

Welcome to FOSS (for me)

My first post here is related to the shift I've done from using certain software tools 4 years ago to what I'm using now. I just included in the Research Cover Crops section data and code from my Masters thesis. At that time I used the computer in my office. A Dell desktop Pentium IV 1.4 GHz, 256 Mb RAM and a 18Gb hard drive. The operating system (still) is Windows 2000. So at that time I used Excel to create the database, SAS to analyze the data and Sigma Plot to make the graphs. Today I don't use any of this software. I have Ubuntu Gutsy 7.10 on my laptop (dual boot with Windows XP), I use R instead of SAS + Sigma Plot and I don't use Excel. Most of my programming work during my PhD was done on a Dell Inspiron 1100 running flavors of Ubuntu starting with Breezy Badger (5.10). In case you don't know FOSS stands for Free Open Source Software.

Although I really like the idea of FOSS software the shift to Ubuntu Linux, R and other goodies is a matter of convenience. Being able to look at source code, installing software, managing multiple workspaces and the eye candy in Compiz beat the experience in Windows. On top of that this laptop (Toshiba Satellite  P15-s409) runs faster on Linux than on Windows XP. I'm not in a position to discuss the technicalities of why Linux is faster, but this is my experience. 

Additionally, I very much doubt I will ever use Windows Vista. See link on the left.