Friday, December 5, 2008

File version control with Subversion

CCOM uses Subversion (svn) on their server to enable folks to have version control on their important documents. What this means is that I can commit a file to my subversion account on the server, and each time I modify the file, a new version will be saved. If I realize I made a mistake or need to go back to a previous copy of the file, I simply "checkout" an earlier version. This is great for constantly changing documents such as source code, html, my thesis proposal, etc. One neat thing is that everytime you "commit" a new version of the document to svn, it only saves the actual changes. Therefore, your memory usage increases only the minimal required amount each time.

To access svn on my Windows machine, I use a program called
Tortoise. Tortoise allows me to upload, checkout, update, and commit files easily to svn. For example, initially I uploaded some source code of mine to the repository. It is now safely stored on the server. When I checkout the file from svn, the most recent version (unless I specify otherwise) is dropped onto my local machine. Once I am happy with any edits I make to this local copy, I simply commit the file back to svn. This new copy autmatically gets a new version number (called revision in SVN) and will be stored as the most recent version. The update command is used to update any checked out copies on your local machine to most recent version in the svn repository. This is handy when multiple people are working on the same file.

The only potentially confusing thing thus far is that revision numbering in svn is global. This means that everytime I commit a file, the global revision number for the whole repository increments by one. For example, say I upload a file and svn assigns it a revision number of 25. Then I checkout a file with a revision number 2. Once I edit the file and commit it back to svn, its revision number will update to 26, instead of 3.

A typical svn reposity is set up with three main directories (note this is only a recommended structure):

  • trunk - this is the main directory for your files and where you commit regular changes
  • tags - a collection of snapshots of the trunk (or a branch) at a user-defined point in time. This basically contains pointer files to specific versions. This is good for a version you want to be able to access quickly. For example, if I used a specific version of my source code to process some data for a publication, I will want to quickly be able to access this exact version.
  • branches - active variations of the project compared to the trunk (or even another branch). Branches are good for when you are editing a file already in the trunk, but you do not have a working version yet. Perhaps you are trying out some new addition to your code, and you are still in the testing phase. This is also a good place to store any revisions you have to make to older versions of files in your trunk directory. For example, say I use version X of my code to process data for a paper. Now, a year later, I am on version Z of that code. Someone using version X from my paper finds a bug in it I need to fix but I do not wish to give them version Z yet. I can fix the bug in version X, and commit the new version of that code to the branch directory. That version Z of the code is still my most recent version in the trunk directory.
I found a good guide on svn here. This guide is for a specific svn client called Subclipse, but I find it a better tutorial than the one for Tortoise. Now I can stop pestering my poor boyfriend with svn questions over IM.

Oh, I should also note that Windows users who use Cygwin can also use svn via command line .

Saturday, November 29, 2008

Everybody do the wave! (Lightwave, that is!)

One of the faculty members on my committee pointed this out to me yesterday:

I took this as a hint and have begun practicing my moves. 

The guy who came up with this idea (who calls himself the Gonzo Scientist) also has apparently created a science guild within the online game World of Warcraft. The guild even had a science conference in WoW this past May! I personally never bought World of Warcraft after trying the demo, when I realized I would never accomplish anything in the real world ever again if I did (it seems pretty addictive). Now however, I realize it is a valuable platform where I can present my research to undead elves, trolls, and giants! I wonder if I can get my committee chair to cover the costs... 

Tuesday, November 25, 2008

CCOM Seminar Series Calendar

Since I have been in charge of organzing this year's CCOM/JHC seminar series, I starting keeping a Google calendar to help me keep track of who is coming when, when we do not have seminar, and when we have open dates.  Lately some issues have been affecting the computer that enables me to push this information out to the CCOM website, and so my only way to get the information out to folks is via email and flyers. Since it seems my blog gets a lot of UNH traffic - I am still shocked I really get any traffic to be honest, especially since I do not update regularly - I figured I would embed the calendar here. So if you scroll down to the bottom of this webpage, you should see the unofficial CCOM/JHC Seminar calendar. I am just now starting to schedule the Spring semester dates, so hopefully you will see this start to fill up soon. 

For local folk, remember, all CCOM seminars are held on Fridays, 3 - 4 pm, in the Chase Ocean Engineering Bldg. rm. 130 (the video classrom).



Friday, November 7, 2008

Code search and Blogger Backup

I found two cool tools during my morning procrastination today:

1) Google code search: http://www.google.com/codesearch
  
This lets you search for public source code. I am sure this will become a great resource for me as I try to learn Python. 

This freeware utility (source code is also availavle) lets you backup your Blogger posts as atom/XML files stored locally on your machine.  It took less than a minute to back up all of my posts into individual XML files that can easily be restored to Blogger if need be. There is no image support yet, but that is in the works. 


Thursday, November 6, 2008

Recovering files off my very old and very dead Macbook G4

My beloved old Macbook G4 (circa 2001) finally died. Nothing, and I mean nothing, happened when I pressed the power button, meaning it was probably a power board issue. I removed the back cover and took out the hard drive. Apparently you are supposed to have some fancy smancy screwdriver to remove two Torx screws holding the drive to the mount plate, but luckily I was able to carefully pry the drive out with a non-smancy screwdriver (the screws are fitted into rubber rings in the plastic mount plate, which has some give).


The drive itself could not fit into my external casing due to the Torx screws, but I was able to connect the USB connector to the IDE interface anyway and connect it to my ACER.


(here the drive is sitting on a protective sheet that came in my Mac. I would not recommend just plunking it down on just any old surface)

Windows XP could not recognize the MAC formatted drive (Quel surprise!) so I booted up in Ubuntu, which recognized the drive right away.



The next challenge was to unlock all the directories so I could access the files. All my personal files were denoted with:
drwxr-----
meaning that only the owner can access them. Since I cannot login to my MAC, this is a problem.

I was not actually sure if this would work, but I ran a chmod command as root to add the needed permissions. I opened a terminal window and navigated to the mounted hard drive where I ran the following command:

monica@Tzedakah:/media/Scooby$ sudo chmod -R +xrw Documents/

the -R causes the permissions to be changed for the Documents directory as well as all subdirectories and files. Now all the permissions on all the files denoted by:
drwxr-xr-x
meaning I can read/write/execute all files, group permissions are read/execute, and others can only execute.

This is great, as I can now look into to the subdirectories and see what is there. I found a bunch of papers I had written in college, including my undergrad thesis.

Saturday, November 1, 2008

Netflix "Watch Instantly" on Ubuntu

I just spent some time trying to see if I could get my beloved Netflix "Watch Instantly" to somehow run on Ubuntu. I first tried using wine, but that was a no go. You have to have Windows XP sp2 and Windows Media Player 11. I probably do not have the right version of WMP installed under wine, but an internet search implies this still will not work. I then tried using it in CrossOver, which I was able to score a free copy of last week during a giveaway they were having on their website (thanks, Kurt!). I set up my WinXP bottle, but the install of WMP11 would not complete. An internet search showed others have had this problem before...blast. I was just about to give up on the idea of being able to enjoy entire seasons of AbFab without the hassle of rebooting in Windows, when another internet search lead me to VirtualBox. Apparently, "Watch Instantly" will work (albeit not the most efficiently) with a VirtualBox XP emulation.

Getting this working might just be my Ubuntu project for tomorrow...

FYI:

CrossOver is a commercialized version of wine that seems to have slightly better implementation of some windows programs and games. Although I used both for the first time tonight, I noticed the difference right off. For example, once IE is running in CrossOver, I can view and use the IE toolbar as if it were running on a true Windows platform. In wine, however, I must run a terminal command each time I want to open a new website, as the toolbar is not displayed.

Hibernate happy in Ubuntu 8.10: Itrepid Ibex

This morning I updated my Ubuntu distribution to 8.10: Intrepid Ibex. It took a fair amount of time on the hotel's wireless connection to download all the necessary packages, but after that the actual install was pretty quick. Upon restart, my tablet pen no longer worked. A quick peek at the xorg.conf file showed me why. Ubuntu 8.10 uses HAL (Hardware Abstraction Layer) to control a lot of the input devices (such as my trackpad) and it therefore commented out a lot of the device specifications in the config file. I removed the comment symbol (#) only from the sections dealing with my tablet pen (detailed in a previous blog) and restarted. Now everything seems to be happy and I once again have a working tablet pen. The hibernate function also seems to be working now, which is something I never did get figured out in 8.04. It takes a few seconds to go into and come out of hibernate (long enough to make you wonder), but it does indeed work.

The only weird thing I have discovered so far is again related to the function keys. After installing the acerhk module in 8.04, the mail client would open whenever I hit the web browser button and nothing would happen when I hit the mail button. Under 8.10, the web browser button still opens my mail client,
but now mail button opens my web browser. At some point I should figure out what file controls how these keys are mapped and reconfigure it.