Wednesday, September 24, 2008

Latex Math Symbols

For some reason nobody ever seems to mention this. But you actually need to include:

\usepackage{amssymb}

inside your latex document to use a lot of the math symbols. (Like \blacksquare )

Otherwise you'll end up getting an "Undefined Control Sequence" error.

Wednesday, September 10, 2008

Calculate Pearson Correlation Coefficient Critical Values

Two-tailed Pearson Correlation Coefficient Critical Values can be found exactly in Open Office or Excel by:

1. Enter the probability you wish into a cell, ie 0.1 or 0.05 (Say cell A1)
2. Enter the number of samples (N) into a cell (Say cell A2)
3. Enter A2 - 2 into a cell to get the degrees of freedom (Say cell A3)
4. Enter =TINV(A1;A3) into cell A4
5. Enter =SQRT(A4^2/(A4^2+A3)) into a cell to find the Critical Value.

This takes advantage of the relationship between the t-test critical value and the Pearson critical value.

t = r / sqrt ( (1-r)^2 / (n-2))

where t is the t-test value, and r is the Pearson.

Monday, September 8, 2008

Changing ownership for a mounted drive

Hmmm. Quick fix I found...after mounting my newly formatted drive, I suddenly did not have permissions to write or execute to it (ownership was only to root).

Changed ownership and got permissions by running:

sudo chown -R km /media/disk

Dunno if I'll have to find some other solution so I don't have to do this every time though.

Sunday, September 7, 2008

Unmounting a busy drive in Unix

When a drive is "busy" and having problems unmounting

sudo umount /media/HD-HSU2/
umount: /media/HD-HSU2: device is busy
umount: /media/HD-HSU2: device is busy

you can find out what's keeping the drive busy by using:

fuser -m /dev/sdc1

This will return with the process number of the process keeping the device busy.

Then use ps (like, a ps -x) to find out what process it really is and kill it.