Tuesday, May 15, 2012

Enable Skype Icon on Unity Notification Panel on Ubuntu 12.04 LTS

http://www.tautvidas.com/blog/2012/05/enable-skype-icon-on-unity-panel-on-ubuntu-12-dot-04-lts/

Wednesday, May 9, 2012

Nvidia driver does not install in Ubuntu 12.04 precise

Follow http://dragly.org/2012/05/04/installing-the-nvidia-driver-in-kubuntu-12-04/

Tuesday, May 8, 2012

Repairing grub by booting from the Ubuntu live-CD

I just installed the new version of Ubuntu (12.04). The installation went fine but the bootloader installation at the end did not work. When I turn on the computer, the new version of the ubuntu does not show in the old bootloader (grub2) menu. What to do? #Boot the computer with the Ubuntu live cd, mount the / partition under /home/ubuntu/a and issue the following command : sudo mount --bind /dev/ /home/ubuntu/a/dev sudo mount --bind /proc/ /home/ubuntu/a/proc sudo mount --bind /sys/ /home/ubuntu/a/sys sudo chroot /home/ubuntu/a #Then let grub2 create /boot/grub/grub.cfg by autodetecting the present OS'es sudo update-grub Found linux image: /boot/vmlinuz-3.2.0-23-generic Found initrd image: /boot/initrd.img-3.2.0-23-generic Found memtest86+ image: /boot/memtest86+.bin Found Windows 7 (loader) on /dev/sda1 Found Ubuntu 10.10 (10.10) on /dev/sda6 done #Exit from the modified chroot exit #Run grub-install sudo grub-install --root-directory=/home/ubuntu/a /dev/sda You should get the message : Installation finished. No error reported.

Wednesday, April 25, 2012

Syntax highlighting in Blogger with SyntaxHighlighter

http://www.craftyfella.com/2010/01/syntax-highlighting-with-blogger-engine.html

Wednesday, March 21, 2012

Compiling source code of netcdf4 on linux

First obtain szip libraries (from the link at http://www.hdfgroup.org/HDF5/release/obtain5.html)
wget http://www.hdfgroup.org/ftp/lib-external/szip/2.1/src/szip-2.1.tar.gz
tar -xzvf szip-2.1.tar.gz
cd szip-2.1

./configure --prefix=/home/acizmeli/opt
make 
make test
make install

Then obtain the hd5 source code  (again from http://www.hdfgroup.org/HDF5/release/obtain5.html)
wget http://www.hdfgroup.org/ftp/lib-external/szip/2.1/src/szip-2.1.tar.gz
tar -xzvf hdf5-1.8.8.tar.gz 
cd hdf5-1.8.8
./configure --prefix=/home/acizmeli/opt  --with-szlib=/home/acizmeli/opt/
(make sure that ./configure has recognized the szip libraries)
make
(or for parallel compilation : ) make -j -16
make install

Then obtain the netcdf4 source :
wget http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.2.tar.gz
tar -xzvf netcdf-4.2.tar.gz
cd netcdf-4.2
CPPFLAGS=-I/home/acizmeli/opt/include/ LDFLAGS=-L/home/acizmeli/opt/lib ./configure --prefix=/home/acizmeli/opt/
make
make install

If there is a doxygen error, try adding --disable-doxygen

Sunday, March 11, 2012

Find nearest neighbours in a point cloud

From http://rwiki.sciviews.org/doku.php?id=tips:spatial-data:overlapping

library(spdep)
data(columbus)
#Extract coordinates from a data frame
coords <- columbus[,c("X", "Y")]
#For each point, determine the four closest points based on great circle distances:
knn.col <- knearneigh(as.matrix(coords), k=4, longlat=T)
knn.nb <- knn2nb(knn.col)
#What are the indices of the four nearest neighbours to point number 5?
knn.col$nn[5,]
#Equivalently:
knn.nb[[5]]
#Plot all points, then mark point number 5 by red, and its four nearest neighbours by blue:
plot(coords)
points(coords[5,], col="red", pch=19)
points(coords[knn.nb[[5]],], col="blue", pch=19)

Some beginner tricks with git

#################################################
Problem : error: Your local changes to the following files would be overwritten by merge: rfiles/BiOpticaR/Various/spacetime_ISIN.R
Please, commit your changes or stash them before you can merge.Aborting
#################################################
$ git pull
remote: Counting objects: 38, done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 25 (delta 13), reused 1 (delta 0)
Unpacking objects: 100% (25/25), done.
From ssh://ekumen/home/acizmeli/GIT
   d63ba8f..cea6b9e  master     -> origin/master
Updating d63ba8f..cea6b9e
error: Your local changes to the following files would be overwritten by merge:
    rfiles/BiOpticaR/Various/spacetime_ISIN.R
Please, commit your changes or stash them before you can merge.
Aborting

Solution:
$ git reset --hard HEAD
HEAD is now at d63ba8f Moved all netcdf imagery functions in the fil......
$ git pull

#################################################
Problem :  Push rejected
! [rejected]        master -> master (non-fast forward)
error: failed to push some refs to.....
#################################################
Solution:
(From http://rip747.wordpress.com/2009/04/20/git-push-rejected-non-fast-forward/)

When trying to do a push to a repo, you might encounter the following error:
$ git push github master
To git@gitproxy:rip747/cfwheels.git
! [rejected]        master -> master (non-fast forward)
error: failed to push some refs to ‘git@gitproxy:rip747/cfwheels.git’
Don’t panic, this is extremely easy to fix. All you have to do is issue a pull and your branch will be fast-forward:
$ git pull github master
From git@gitproxy:rip747/cfwheels
* branch            master     -> FETCH_HEAD
Already uptodate!
Merge made by recursive.
Then retry your push and everything should be fine:
$ git push github master

#################################################
Problem : Automatic merge failed; fix conflicts and then commit the result.
#################################################
use :
git mergetool