Tuesday, February 17, 2009

Gnome Do Dominates

I am always trying to do things faster, and as we all know, using the keyboard is often faster than the mouse. Gnome Do, which you can install from synaptic is intuitive and lets you really fly. Try it out.

Friday, February 13, 2009

Can't mount external hard drive

Some people have suggested "forcing" your external hard drive to mount. This is a bad idea as you can lose your data. Simply plug your external hard drive into a Windows system and then safely remove the external hard drive; if you just unplug it without safely removing it, Ubuntu won't let you mount it without forcing it to.

Tuesday, January 13, 2009

Aggregate in R

For data that needs to be collapsed, the aggregate() function works great. For example:



If you need to collapse these so you only have one row per GLEAN, and have the Female and Male columns be the average of the collapsed rows, aggregate() can do this in one line:

collapsed_data<-aggregate(x=original_data, by=file_with_GLEAN_names_only, FUN=mean)

I used this to find the average expression levels of genes from a table that had the expression levels of each exon. Since some genes had one exon while others had many exons, aggregate was perfect for this situation. It did take a few minutes to compute, but I had over 57,000 rows and 8 columns, so that's understandable.

Virtualization with Virtual Box in Ubuntu

I copied some material from these links in doing this (there are one or two errors in them that I correct here):
http://www.ubuntu-unleashed.com/2008/04/howto-install-virtualbox-in-hardy-heron.html
http://www.linuxhaxor.net/2008/05/05/creating-seamless-virtual-machine-with-virtualbox-16/
  1. make sure you have the 'build-essential' package installed:
    sudo apt-get install build-essential
  2. Download your version of virtual box (probably i386 unless you have a 64 bit processor) and install it

    After download, right click the package and install with the GDeb package manager

  3. Add your user to the vboxusers group:
    sudo adduser $USER vboxusers

  4. Follow the Setup VirtualBox USB Support section here for USB support
    I did both of the things recommended. Note that the last step should read:
    sudo /etc/init.d/mountkernfs.sh start

  5. Install Guest Addons and turn on seamless mode
    after firing up the virtual OS, go to the 'Devices' window on the top and 'Install Guest Additions'
  6. Set up shared directories following this.

Wednesday, January 7, 2009

autotest with specs in a normal ruby library

Put this in a '.autotest' file in your project's base directory:

# -*- ruby -*-

# in .autotest file:

Autotest.add_hook :initialize do |at|
at.clear_mappings
end

Autotest.add_hook :initialize do |at|
at.add_mapping(%r%^lib/(.*)\.rb$%) { |_, m|
["spec/#{m[1]}_spec.rb"]
## for both specs and tests:
#["spec/#{m[1]}_spec.rb","test/#{m[1]}_test.rb"]
}
end

Friday, December 26, 2008

Smaller playlist.com music player for blog


Playlist.com is a popular source for getting free music on your blog. My problem was I didn't want it to be at the bottom of the blog, but on the sidebar. The code they give you makes a music player that is much too wide for a sidebar. Here is how you can edit the code to fit whatever width you want.

Your code should resemble the code below. Simply change the bold numbers from your code to smaller, or larger numbers, depending on the size you want (I only included the beginning of the code, where you need to make changes). For my sidebar I used 285 to replace 450 and then 275 to replace all the 435's.

div style="text-align: center; margin-left: auto; visibility:visible; margin-right: auto; width:450px;"embed style="width: 435px; visibility: visible; height: 270px;" allowscriptaccess="never" src="http://www.greatprofilemusic.com/mc/mp3player-othersite.swf?config=http://www.greatprofilemusic.com/mc/config/config_black.xml&mywidth=435&myheight=270&playlist_url=http://www.greatprofilemusic.com/loadplaylist.php?playlist=55939558" menu="false" quality="high" name="mp3player" width="435" height="270">

Sunday, November 30, 2008

Set Timex 1440 Sports watch

Couldn't find this anywhere on the web (the instruction manual for this watch does not match the watch). After many, many attempts I finally figured it out:

Press and hold the mode button for a few seconds, then, press the mode button again!

The 'set' button then changes the value while the 'start/stop' button will advance to the next thing to set.

Set the Timex 1440 Sports Watch (wr50m) Magnetism watch

hold down the "mode" button for 2 seconds. When the digits on the watch face start to blink, then press the "mode" button again. To change the hours, press the "adjust button". [instructions thanks to a comment below]

To turn the alarm off:

Press and hold "set."
At the same time press (and hold?) "start/stop."
You will see the alarm bell icon go away.

Also, see wiki.answers post for more details.

Thursday, October 23, 2008

Clean surfing on YouTube


YouTube is a great service. Unfortunately, it seems like dodgy promo videos (at least dodgy thumbnail images) are the norm for the site. Here's how to disable them (I'm assuming you are using Firefox):

  1. install the addon GreaseMonkey
  2. install the YouTube customization script
  3. on a video page, customize:


Now, all videos will have blocked Promotional Videos! Hooray! (Note: you can click on the little monkey in the bottom right hand of your browser to disable GreaseMonkey at any time)

Thursday, July 31, 2008

Installing emerald with Ubuntu 8.04

http://hacktivision.com/index.php/2008/06/07/how-to-enhance-ubuntu-8-04-hardy-heron-e?blog=2

Saturday, May 17, 2008

Export plots in R

In R exporting plots is easy:

jpeg("/home/Desktop/nameplot_here.jpg") #name the file and where to export it

hist(data) #this makes a histogram of your data

dev.off() #actually do the exporting

To do png or pdf just substitute it for jpeg.

Monday, March 24, 2008

Cool applications for Linux

http://linuxondesktop.blogspot.com/2007/07/35-cool-applications-to-install-on.html

Great website, I highly recommend it.