Wednesday, February 29, 2012

Switch the layout of your keyboards

Handy switch if you need to change regularly between layouts of keyboards.


Setxkbmap is a tool to set the keyboard layout. In the options of the tool you're allowed to set a switch.

setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll be,us

sets the keyboard to belgium (be) and with alt+shift I can switch to a us layout.

You can find the explanation for the coding in:

/usr/share/X11/xkb/rules/xorg.lst

You might want to execute this command autocratically on login, so you don't have to type it all the time again.

create a file "setxkbmap.desktop" in "~/.config/autostart/"

nano  ~/.config/autostart/setxkbmap.desktop

and enter the setxkbmap command

[Desktop Entry]
Encoding=UTF-8
Name=sertxkbmap
GenericName=set keyboard layout
Comment=Switch with alt+shift the layout of your keyboard
Exec=setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll be,us

this file will be run every time you login to your system

Tuesday, February 28, 2012

Changing the filename extension in R

Filenames ending with *.bin or *.txt will be given the extension *.grd. Applies to a character array containing multiple strings

outFileName = gsub("\\.bin|\\.txt", ".grd", inFileName)

Saturday, February 18, 2012

Ubuntu keyserver

If you have a keyserver error after adding a new repository try doing
 
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 16126D3A3E5C1192
 
replace 16126D3A3E5C1192 with the key of the repository you just added.

Thursday, February 16, 2012

Free tool for resizing a windows partition - EASEUS

EASEUS is free and works like a charm. It resizes a windows NTFS partition smaller than the size allowed by the Windows' own partition manager.

Tuesday, February 7, 2012

Reloading an updated R package without quitting R

Let us say that we worked on the source code of the package Cops and we would like to reload it  without quitting R

Re-install the package from Terminal 1 :
R CMD build Cops; sudo R CMD INSTALL Cops_1.2.tar.gz


Reload the modified package from the R session already running in  Terminal 2 :
detach(package:Cops,unload=T); library(Cops)

Thursday, January 12, 2012

Openoffice menu fonts display garbage with Nvidia graphic card in Ubuntu

http://user.services.openoffice.org/en/forum/viewtopic.php?f=16&t=10183#p59220

1. Ubuntu: System > Preferences > Appearance > Visual Effects Tab > None.
2. Open Office: Tools > Options > OpenOffice.org Entry > View Entry > Uncheck "Screen font antialiasing."
3. Ubuntu: System > Preferences > Appearance > Visual Effects Tab > Normal/Extra.

Compiling rgdal in 64 bits Mac

from http://blog.fellstat.com/?p=46

Currently Rstudio is available for the Mac platform only in 64 bits. We like Rstudio and continue using it. In order to use rgdal package in 64 bits, we had to compile the rgdal package.

Forst the Mac .dmg file of PROJ.4 was downloaded from the link given above. Then the source code of the latest rgdal (as of today) was downloaded from the rgdal website.

We then compiled rgdal from within a shell script using the following command :

sudo R --arch x86_64 CMD INSTALL --configure-args='--with-gdal-config=/Library/Frameworks/GDAL.framework/Programs/gdal-config --with-proj-include=/Library/Frameworks/PROJ.framework/Headers --with-proj-lib=/Library/Frameworks/PROJ.framework/unix/lib' rgdal_0.7-5.tar.gz