2007-12-28

Using Sweave with LyX

It has been a while since I managed to configure LyX (a great "word processor") to work with Sweave (literate programming using LaTeX and R - wikipedia page). The paper describing the whole thing will probably be published in the next issue of Rnews. Since, I received some inquiries, I have created a temporary web page at Google with all the files needed for the configuration, ...

Happy LyX-ing with R!

2007-12-26

Prosti tečaji preko spleta

Že kar nekaj časa nazaj je MIT na splet prenesel celo kopico predmetov. Pri velikem številu predmetov so na voljo vsa gradiva in to ZASTONJ! Vse skupaj najdete tukaj.

Ampak to ni vse, ravno sem naletel na seznam univerz z naj prostimi tečaji - klik.

2007-12-24

Portal Drobnic@

Portal Drobnic@ že deluje nekaj časa in ni slabo, da ga omenim še tukaj. Skratka vabljeni.

2007-12-19

An LSD joke

After a while ..

A teenage boy asks his granny 'Have you seen my pills, they were labelled
LSD?'

Granny: 'Fuck the pills; have you seen the dragons in the kitchen?'

2007-09-29

Plače?

Po mailu dobim sledeči link, ki prikazuje plače. Najprej sem rekel, da ne bom pogledal. Seveda se nisem mogel upreti. Kdo vse spada na seznam ne vem. Po pregledu, sem se vprašal kako lahko ima ravnatelj srednje šole večjo plačo kot predsednik republike? Slučajno poznam dotično gimnazijo in mirne volje rečem, da tole enostavno ne more iti skupaj. Sicer ne vem, kaj dela predsednik republike, ker ga itak ni na spregled že nekaj časa - za to dobi 6.482 EUR/mesec. Je čisto vseeno ali je bruto ali neto. Vsekakor ravnatelj srednje šole po mojem ne bi smel imeti večjo plačo kot predsednik republike. Hmm. Zelo visoko je tudi na seznamu ravnatelj osnovne šole. Pa ne da podcenjujem delo šol, ampak kar je preveč je preveč.

2007-09-26

FABISnet

Na Oddelku za zootehniko, Biotehniške fakultete smo v okviru evropskega projekta FABISnet že pred časom vzpostavili lokalni informacijski sistem, ki zajema podatke o pasmah domačih (kmetijskih) živali.

Danes smo zaključili s prevodom, kar omogoča slovenskim uporabnikom enostaven ogled. Dostop je za obiskovalce prost in omogočen preko všečnega spletnega vmesnik tukaj. Sledite povezavi "Pasme" in nato izberite državo, vrsto in pasmo.

Kar nekaj podatkov manja, a to se bo sčasoma močno spremenilo. Bodite na preži!

2007-09-13

Cena stanovanj

Že kar nekaj časa se ubadam za mislijo na rešitev stanovanjskega problema. Žal so vse skupaj le misli in smeli poskusi. Cene so enostavno zasoljene in če moraš vmes še živeti v najemniškem stanovanju enostavno ni šans, da prebiješ zid do lastnega stanovanja. Namesto, da bi varčeval, plačuješ najemnino. Pri stanovanjskem skladu je pa žal tudi precej odvisno od sreče, da si ižreban. Potem pa še zame zgrešena definicija mlade družine.

Cene stanovanj v Ljubljani in daleč na okoli so kar lepo okoli 30 mio starih SIT. Preprost izračun pravi, da bi z mesečnim obrokom 100.000 starih SIT odplačeval 25 let. Seveda je ta izačun povsem enostaven, saj ti nihče ne bo dal kredita brez obresti. Potem pa slišiš, da Mirko Jelenič bodo izplačali 137.000 evrov za eno leto. Tip si bo lahko s tem denarjem kupil stanovanje ali pa pametno naložil v delnice, sklade, ... RK je očitno res dobrodelna organizacija. Adijo!

2007-09-10

Mednarodna razstava drobnice v Logarski dolini

V soboto in nedeljo je bila v Logarski dolini mednarodna razstava drobnice (ovc in koz). Sodelovali so slovenski ovčerejci in kozerejci ter ovčerejci iz Italije in Nemčije. Žal so udeležbo odpovedali rejci iz Avstrije in Švice, zaradi strogih veterinarskih pogojev. O tem več drugič. Razstavljene so bile praktično vse pomembnejše pasme ovc on koz iz Slovenije. Nekatere so lepo predstavljene tukaj.

Poleg razstave se je v soboto odvijalo 12. tekomovanje v striženju ovc. Ves čas so bili prisotni številni rejci in prodajalci izdelkov povezanih z drobnico tako ali drugače.

Žal ne morem ponuditi povezave, da bi si sedaj kdo ogledal, kako smo se imeli. Lahko vam je žal, da vas ni bilo! Sigurno bodo o tem pisali v reviji Drobnica.

2007-09-07

Definicija mlade družine

Stanovanjski sklad uporablja sledečo definicijo mlade družine: "Mlada družina je življenjska skupnost obeh ali enega izmed staršev z enim ali več otroki, posvojenci ali pastorki, pri čemer vsaj en otrok v koledarskem letu javnega poziva Sklada še ni šoloobvezen." Baje je ta definicija povzeta po enem zakonu.

Zgleda smiselno in ker je danes veliko parov pri prvem otroku starih okoli 30 (moja lastna opažanja), definicija kar zdrži v smislu, da rabijo takšni pari pomoč pri reševanju stanovanjskega problema. Kaj pa če ima par pri tej starosti otroka (enega ali pa več), ki je že šoloobvezen? Potem takšna družina ni več mlada družina, družina, kjer so starši stari 40 (ali pa tudi 50 let, da malo pretiravam) in še nimajo šoloobveznega otroka pa je mlada družina. Meni se zdi ta definicija mimo oziroma bi morala upoštevati starost staršev. Saj je ja namen, da se pomaga mladim družinam, ki so dejansko res mlade! Ne vidim zakaj bi starost otroka predstavljala pomembno ali pa vsaj ne edino vlogo pri tem. Poleg tega gredo po novem otroci eno leto prej v šolo!

Oh ja ...

2007-09-06

Število genov in intenzivnost selekcije

S prijateljem sva imela diskusijo na temo števila genov in intenzivnosti selekcije. Nekje sem zapisal:

"V kolikor je selekcija osnovana le na manjšem številu genov, je intenzivnost selekcije znatno višja s tem pa tudi zmanjševanje variabilnosti in verjetnost izgube mutacij."

Prijatelj je menil, da zmanjšanje variabilnosti narašča s številom genov, na katere delamo selekcijo. Npr. če delamo selekcijo na Ryr1 in RN- gena skupaj, je večja intenzivnost selekcije, kot če delamo le na enega od teh dveh.

Moj odgovor:

Imaš in nimaš prav. Vzemiva, da imamo v populaciji dva nevezana gena A in B ter, da ima vsak dva alela, torej A1 in A2 in B1 in B2. Nadalje vzemimo, da je frekvenca vseh alelov Pr(A1)=Pr(A2)=Pr(B1)=Pr(B2)=0.5, kjer Pr() pomeni  erjetnost/delež/frekvenco za posamezni alel.

Potem imava v populaciji sledeče stanje:

A1A1 B1B1 Pr(A1) * Pr(A1) * Pr(B1) * Pr(B1) = 1/16 = 0.0625
A1A1 B1B2 Pr(A1) * Pr(A1) * 2 * Pr(B1) * Pr(B2) = 2/16 = 0.1250
A1A1 B2B2 Pr(A1) * Pr(A1) * Pr(B2) * Pr(B2) = 1/16 = 0.0625

A1A2 B1B1 2 * Pr(A1) * Pr(A2) * Pr(B1) * Pr(B1) = 2/16 = 0.0625
A1A2 B1B2 2 * Pr(A1) * Pr(A2) * 2 * Pr(B1) * Pr(B2) = 4/16 = 0.1250
A1A2 B2B2 2 * Pr(A1) * Pr(A2) * * Pr(B2) * Pr(B2) = 2/16 = 0.1250

A2A2 B1B1 Pr(A2) * Pr(A2) * Pr(B1) * Pr(B1) = 1/16 = 0.0625
A2A2 B1B2 Pr(A2) * Pr(A2) * 2 * Pr(B1) * Pr(B2) = 2/16 = 0.1250
A2A2 B2B2 Pr(A2) * Pr(A2) * Pr(B2) * Pr(B2) = 1/16 = 0.0625

Skupaj: 9 genotipov Vsota: 1

Če bi odbirali le na en genotip in bi odbrali le A1A1, potem bomo odbrali 4/16 populacije. Če pa bi odbirali na dva genotipa in bi odbirali npr. le A1A1 B1B1 i.e. Ryr1 in RN- pa le 1/16 populacije. Torej je tvoja trditev o intenzivnosti selekcije pri večjem številu genov pravilna.

Ampak! Ko upoštevaš več genov hkrati, skoraj nikoli ne greš tako ozko, da odbereš le tisti genotip, ki te je naj zgoraj je to bil A1A1 B1B1 ampak želiš čimbolj optimalno kombinacijo, ki je recimo lahko tudi A1A2 B1B1, A1A1 B1B2 itd. Ko število genov narašča, izjemno hitro narašča tudi število različnih genotipov. Tako je potem odbira na podlagi večjega števila genov manj intenzivna in dolgoročno nudi več napredka. Kje je sedaj meja med enim in drugim pristopom pa ...

2007-08-10

CRAN package feed

Number of packages at CRAN is increasing sharply. Therefore, it is hard to keep track of what is available to useR. Dirk has bundled up a script that generates a web page and RSS for tracking changes on CRAN, called CRANberries. Site is here, while a note on RSS can be found here. Great! Now you can monitor the vivacity on CRAN and try to know what is available.

2007-08-08

Tora

Installed TOra on my Ubuntu GNU/Linux (check this howto as well as mine howto for details on Oracle instantclient) and Windows XP box.

Distributions

Ever wondered how distributions are related? Take a look here

2007-08-02

Computer Algebra System (CAS) in LyX via Ryacas

I have answered question on using Computer Algebra System (CAS) in LyX via Ryacas. You can see the answer here. In summary, LyX has a way to work with different CAS internally, but I have shown how to use Ryacas via Sweave in LyX. I sent yesterday a note on the latter to Rnews. Stay tuned!

2007-07-09

Pedigree viewer on GNU/Linux

Hi, it's time to share some good news with others. I have managed to install, run, and use Pedigree Viewer (a program that draws and manipulates pedigree diagrams, written by Brian and Sandy Kinghorn) under my laptop running GNU/Linux. Since this is a MS Windows application, wine emulator is being used of course. Bellow is a set of terminal commands one needs to issue to get the whole thing working.


# Create temporary folder
mkdir pedigreeViewer
cd pedigreeViewer

# Get the program and unzip it
wget http://www-personal.une.edu.au/%7Ebkinghor/pedigree.zip
unzip pedigree.zip

# Install the program
wine setup.exe

# Run it
wine /path/to/your/wine/drive_c/Program\ Files/Pedigree\ Viewer/Pedigree.exe &

# /path/to/your/wine depends on your configuration of wine
# usually it is ~/.wine/dosdevices/c:

# Optionally create alias for future use and put it into file like
# ~/.bashrc
alias PedigreeViewer='wine /path/to/your/wine/drive_c/Program\ Files/Pedigree\ Viewer/Pedigree.exe'


I have the following software:
Ubuntu GNU/Linux version 7.04 (Feisty Fawn)
wine version 0.9.33

2007-05-29

Emacsclient

Emacs can be used as a server and each file can than be opened via emacsclient. This is handy to keep session lean and to have all working files in one pot. This works however only if emacs is already running. Up to now I had some shell scripts that eased the opening of emacs if it was not running, but I have just find out that it is fairly easy to do this in the following way - I have emacs 22 now:

Set emacs-snapshot as emacs:
sudo update-alternatives --config emacs

Set emacsclient.emacs-snapshot as emacsclient:
sudo update-alternatives --config emacsclient

Set environmental variables (say in ~/.bashrc):
export EDITOR=emacsclient

export VISUAL=$EDITOR

export ALTERNATE_EDITOR=emacs

Now you can call emacsclient on any file you would like to open it. If emacs is not yet running ALTERNATE_EDITOR will startup, which we defined to be emacs. Simple!

Typing emacsclient someFile is to long so I have the following in my ~/.bashrc. Using & also unlocks the terminal, which is handy.

edit ()
{
$EDITOR $@ &
}

2007-05-18

Move to *ubuntu

I had to install GNU/Linux on my box at work and have looked yesterday at Ubuntu (uses Debian as a source of packages) and its derivatives (Kubuntu an Xubuntu). I decided to take Xubuntu, because I will use this machine for a bit more involved computing and I do not want to spend to much resources on eye-candy stuff. Additionally, Xubuntu should be the right choice for my poor laptop.

It turned out that this was very good choice. I had running linux in say 20 min. It is very nicely packed and organized. Up to now I have used RedHat and Debian and this is the best of all! Not to mention the quality of help - really clean, straight, nicely written. Impressive! Debian has great package management, but Ubuntu has pushed this even further. Very slick. I think I will install it also on my laptop over the weekend. I hope wireless will work OK.

I am installing now VirtualBox. Virtualization seems to be very easy these days. Looks like I will be able to abandon dual booting. Oh, at last.

2007-05-11

Skeleton-pair mode in Emacs

Emacs is really great editor. A bit clumsy for beginners, but powerful when you get used to it. I have just added skeleton-pair insert stuff to my .emacs file. This enables direct insert of additional character, say ), when I type (. Nice! Here is the elisp code for it - I found it at emacsWiki site


;; enable skeleton-pair insert globally
(setq skeleton-pair t)
(setq skeleton-pair-on-word t) ; apply skeleton trick even in front of a word.
(global-set-key (kbd "(") 'skeleton-pair-insert-maybe)
(global-set-key (kbd "[") 'skeleton-pair-insert-maybe)
(global-set-key (kbd "{") 'skeleton-pair-insert-maybe)
(global-set-key (kbd "\"") 'skeleton-pair-insert-maybe)
(global-set-key (kbd "\'") 'skeleton-pair-insert-maybe)

2007-04-20

Bloglines

I use bloglines as an RSS reader and today I got the message that they ar fixing something. This was the note:


Hi,

I'm the Bloglines Plumber. Bloglines is down for a little fixer upper. We will be back shortly. Bloglines will be all better when I'm done with it.

Thanks,

The Bloglines Plumber
OK. But the funny part is this picture




2007-04-16

GeneticsPed in BioC

We have finally switched to BioC SVN for development of GeneticsPed package. Now we have results of daily builds and checks at different platforms. Neat.

Sweave (bash) shell script

I uploaded my Sweave.sh (bash) shell script to CRAN. It is available here.

2007-04-13

Installing PyPedal under Debian

Here is my initial attempt about installing PyPedal on my Debian box. ## mark my comments and the rest are shell commands:


## Switch to root user
su -

## First install non-python stuff in Debian
##
## Software Debian package
## Graphviz graphviz
## SQLite sqlite3
##
## Note that there are sqlite and sqlite3 in Debian and
## I took the new one

aptitude install graphviz sqlite3

## Now we get to python modules that are
## already packaged in Debian
## Module Debian package
## elementtree python-elementtree
## matplotlib python-matplotlib
## NetworkX python-networkx
## NumPy python-numpy
## PIL python-imaging
## pydot python-pydot
## PyGraphviz python-pygraphviz
## pyparsing python-pyparsing
## pysqlite python-pysqlite2
## ReportLab python-reportlab
## setuptools python-setuptools

## Again, there are python-sqlite (for SQLite 2),
## python-pysqlite1.1 and python-pysqlite2
## (both for SQLite 3)

aptitude install python-elementtree\
python-matplotlib \
python-networkx \
python-numpy \
python-imaging \
python-pydot \
python-pygraphviz \
python-pyparsing \
python-pysqlite2 \
python-reportlab \
python-setuptools

## Other Python modules not in Debian

## According to Python inst. doc especially this section
## we should use the following way to install
## non-debianized modules
##
## python setup.py install --prefix=/usr/local

## PythonDoc
## Site: http://effbot.org/zone/pythondoc.htm
## At the time of writting I issued the following

wget http://effbot.org/downloads/pythondoc-2.1b6-20060406.tar.gz

tar -xzvvf pythondoc-*
cd pythondoc-*
python setup.py install --prefix=/usr/local
cd ..
rm -R -f pythondoc-*

## testoob
## Site: http://testoob.sourceforge.net/
## At the time of writting I issued the following

wget http://kent.dl.sourceforge.net/sourceforge/testoob/testoob-1.13.tar.gz

tar -xzvvf testoob-*
cd testoob-*
python setup.py install --prefix=/usr/local
cd ..
rm -R -f testoob-*

## PyPedal
## Site: http://pypedal.sourceforge.net/
## At the time of writting I issued the following

wget http://puzzle.dl.sourceforge.net/sourceforge/pypedal/PyPedal-2.0.0b21.tar.gz

tar -xzvvf PyPedal-*
cd PyPedal-*
python setup.py install --prefix=/usr/local

## Upps! The last one does not install cleanly as
## reported on SF mailist list for PyPedal.

2007-04-06

Wich forge for R should I use

When developing software it is very handy to have some version control companied with e-mail alerts on commits, maybe a forum etc. I have used SourceForge for this for some of my packages i.e. in r-genetics and r-ggorjan "projects". I have even persuaded some of "R-BUGS" people to initiate bugs-r (I have not done any development recently there which is a pitty). What I miss with SourceForge is daily checks with R CMD check etc. I have written some scripts to do this and even played with (semi-)automatic publication on my homepage (follow software --> R). This was very tedious and it never worked in the way I wanted. CRAN provides daily check for all packages but only for those published at CRAN. BioC has pushed this idea a bit further with SVN and daily checks of code in SVN against several R versions (the last feature is also available by CRAN).

I noticed in the past a note by Gregory Warnes on site ala "R-Forge" - I do not remember the details. Now I have discovered r-forge.net by Simon Urbanek which seems to be great for what I want. I have browsed the site and wanted to join there, but then I discover the following note on that site:

"Note: This site is not related (except in spirit) to the R-Forge project at the WU Wien which can be found at http://r-forge.wu-wien.ac.at/."

Pheu. There seems to be another site with this functionality! Given that this site has r-project.org domain I guess that this will become official forge for R. I will ask on R-devel list.

RJDBC

Just found an R package RJDBC that allows connecting R to any database that has JDBC driver. This might be even easier than with ODBC as I have previously described for Oracle.

For example, see this blog post.

2007-04-04

Tips in ESS mode for R functions

Sven has written handy function that shows arguments when you start typing function( . This is really handy and it was available only in some GUIs. There is some discussion here.

2007-04-02

Bayesian inference on quantitative genetic (animal) model in BUGS & R

There is a paper by Lars Damgaard in Journal of Animal Science showing how to fit quantitative genetic (animal) model in WinBUGS and this of course extends also to other BUGS versions. This is really great. It is based on decomposition of additive relationship matrix A=TDT'. I will try to provide functions to ease the preparation of needed data for BUGS in my R package GeneticsPed. This will ease the exploration and first stage fitting of models on small or medium datasets. As noted by Damgaard, BUGS will not serve for genetic evaluation. I wonder if one can gain in speed with using Umacs or JAGS (site seems to be down at the moment).

2007-04-01

Bayesian methods in animal breeding and theory

I have finally read the seminal paper by Gianola and Fernando (1986). I had it in my pile of must read papers for some time now. I guess around two years. Phuh! I am glad I read it since it is nice to see how thing conceptually have not changed a lot from that time. It is 20 year from then, but you can still find the same stuff is in the papers today. The only difference is that now problems are tackled with use of MCMC machinery, while the concept is the same. Is this a sign of ...? I also liked the paper since a lot of issues that you find in many different places are in one place. I would rate is as a must read paper for anyone working in field of animal breeding. I wonder if it can be recommended as an introductory paper to Bayesian way for animal breeding problems. I had some experience with Bayesian approach and have read a lot of literature on this topic so my impressimon might be distorted. Anyway, I found it nice to refresh the setup and to take a journey from Bayes theorem, posteriors, priors, likelihood, sequential inference of breeding values, sample data domination, Bayesian asymptotic theory, integration of nuisance parameters, a pinch of Jeffrey's priors, inference of breeding values with informative priors, a touch to Henderson's mixed model equations when priors are uniformative and variance components known, biased but better (in the sense of mean-square error) estimators, selection and assortative mating, Bayesian view of selection index (best linear predictor) and best linear unbiased predictor, nonlinear merit functions, nonlinear models, Bayesian estimation of (genetic) parameters - variances. Oddly, paper finishes with "a cut" - no real end. Weird. Blasco is more recent example of such a paper. It covers quite a lot of topics as Gianola and Fernando (1986) - I told you thing are repeating, but also adding comparison with frequentist/likelihood approach and is writen in a way that also people that are not everyday into the statistics.

Blasco, A. (2001) The {Bayesian} controversy in animal breeding. Journal of Animal Science. 79(8):2023--2046 http://jas.fass.org/cgi/reprint/79/8/2023

Gianola, D. and Fernando, R. L. (1986) Bayesian methods in animal breeding and theory. Journal of Animal Science, 63:217-244

Oracle instantclient + ODBC on Debian GNU/Linux

I have finally managed to properly install Oracle's instantclient and ODBC drivers on my Debian GNU/Linux box. Here is my mini HOWTO. Lines that start with # are comments.

# Change to root (as usual)

su -

# Go to link bellow and register

http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html

# Download

Instant Client Package - Basic: All files required to run OCI, OCCI, and
JDBC-OCI applications

oracle-instantclient-basic-10.2.0.3-1.i386.rpm

Instant Client Package - SDK: Additional header files and an example makefile for developing Oracle applications with Instant Client

oracle-instantclient-devel-10.2.0.3-1.i386.rpm

Instant Client Package - JDBC Supplement: Additional support for XA,
Internationalization, and RowSet operations under JDBC

oracle-instantclient-jdbc-10.2.0.3-1.i386.rpm

Instant Client Package - SQL*Plus: Additional libraries and executable for
running SQL*Plus with Instant Client

oracle-instantclient-sqlplus-10.2.0.3-1.i386.rpm

Instant Client Package - ODBC: Additional libraries for enabling ODBC applications

instantclient-odbc-linux32-10.2.0.3-20061115.zip

# Convert rpm to deb

alien oracle-instantclient-*

# Install

dpkg -i oracle-instantclient-*deb

# Remove deb and rpm files

rm -f oracle-instantclient-*rpm oracle-instantclient-*deb

# Installed files are

dpkg -L oracle-instantclient-basic
/usr
/usr/share
/usr/share/doc
/usr/share/doc/oracle-instantclient-basic
/usr/share/doc/oracle-instantclient-basic/copyright
/usr/share/doc/oracle-instantclient-basic/changelog.Debian.gz
/usr/lib
/usr/lib/oracle
/usr/lib/oracle/10.2.0.3
/usr/lib/oracle/10.2.0.3/client
/usr/lib/oracle/10.2.0.3/client/bin
/usr/lib/oracle/10.2.0.3/client/bin/genezi
/usr/lib/oracle/10.2.0.3/client/lib
/usr/lib/oracle/10.2.0.3/client/lib/libclntsh.so.10.1
/usr/lib/oracle/10.2.0.3/client/lib/libnnz10.so
/usr/lib/oracle/10.2.0.3/client/lib/libocci.so.10.1
/usr/lib/oracle/10.2.0.3/client/lib/libociei.so
/usr/lib/oracle/10.2.0.3/client/lib/libocijdbc10.so
/usr/lib/oracle/10.2.0.3/client/lib/ojdbc14.jar

dpkg -L oracle-instantclient-devel
/usr
/usr/share
/usr/share/doc
/usr/share/doc/oracle-instantclient-devel
/usr/share/doc/oracle-instantclient-devel/copyright
/usr/share/doc/oracle-instantclient-devel/changelog.Debian.gz
/usr/share/oracle
/usr/share/oracle/10.2.0.3
/usr/share/oracle/10.2.0.3/client
/usr/share/oracle/10.2.0.3/client/cdemo81.c
/usr/share/oracle/10.2.0.3/client/demo.mk
/usr/share/oracle/10.2.0.3/client/occidemo.sql
/usr/share/oracle/10.2.0.3/client/occidemod.sql
/usr/share/oracle/10.2.0.3/client/occidml.cpp
/usr/include
/usr/include/oracle
/usr/include/oracle/10.2.0.3
/usr/include/oracle/10.2.0.3/client
/usr/include/oracle/10.2.0.3/client/nzerror.h
/usr/include/oracle/10.2.0.3/client/nzt.h
/usr/include/oracle/10.2.0.3/client/occi.h
/usr/include/oracle/10.2.0.3/client/occiAQ.h
/usr/include/oracle/10.2.0.3/client/occiCommon.h
/usr/include/oracle/10.2.0.3/client/occiControl.h
/usr/include/oracle/10.2.0.3/client/occiData.h
/usr/include/oracle/10.2.0.3/client/occiObjects.h
/usr/include/oracle/10.2.0.3/client/oci.h
/usr/include/oracle/10.2.0.3/client/oci1.h
/usr/include/oracle/10.2.0.3/client/oci8dp.h
/usr/include/oracle/10.2.0.3/client/ociap.h
/usr/include/oracle/10.2.0.3/client/ociapr.h
/usr/include/oracle/10.2.0.3/client/ocidef.h
/usr/include/oracle/10.2.0.3/client/ocidem.h
/usr/include/oracle/10.2.0.3/client/ocidfn.h
/usr/include/oracle/10.2.0.3/client/ociextp.h
/usr/include/oracle/10.2.0.3/client/ocikpr.h
/usr/include/oracle/10.2.0.3/client/ocixmldb.h
/usr/include/oracle/10.2.0.3/client/odci.h
/usr/include/oracle/10.2.0.3/client/oratypes.h
/usr/include/oracle/10.2.0.3/client/ori.h
/usr/include/oracle/10.2.0.3/client/orid.h
/usr/include/oracle/10.2.0.3/client/orl.h
/usr/include/oracle/10.2.0.3/client/oro.h
/usr/include/oracle/10.2.0.3/client/ort.h
/usr/include/oracle/10.2.0.3/client/xa.h
/usr/lib
/usr/lib/oracle
/usr/lib/oracle/10.2.0.3
/usr/lib/oracle/10.2.0.3/client
/usr/lib/oracle/10.2.0.3/client/lib
/usr/lib/oracle/10.2.0.3/client/lib/libclntsh.so
/usr/lib/oracle/10.2.0.3/client/lib/libocci.so

dpkg -L oracle-instantclient-jdbc
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/oracle-instantclient-jdbc
/usr/share/doc/oracle-instantclient-jdbc/copyright
/usr/share/doc/oracle-instantclient-jdbc/changelog.Debian.gz
/usr/lib
/usr/lib/oracle
/usr/lib/oracle/10.2.0.3
/usr/lib/oracle/10.2.0.3/client
/usr/lib/oracle/10.2.0.3/client/lib
/usr/lib/oracle/10.2.0.3/client/lib/libheteroxa10.so
/usr/lib/oracle/10.2.0.3/client/lib/orai18n.jar

dpkg -L oracle-instantclient-sqlplus
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/oracle-instantclient-sqlplus
/usr/share/doc/oracle-instantclient-sqlplus/copyright
/usr/share/doc/oracle-instantclient-sqlplus/changelog.Debian.gz
/usr/bin
/usr/lib
/usr/lib/oracle
/usr/lib/oracle/10.2.0.3
/usr/lib/oracle/10.2.0.3/client
/usr/lib/oracle/10.2.0.3/client/bin
/usr/lib/oracle/10.2.0.3/client/bin/sqlplus
/usr/lib/oracle/10.2.0.3/client/lib
/usr/lib/oracle/10.2.0.3/client/lib/glogin.sql
/usr/lib/oracle/10.2.0.3/client/lib/libsqlplus.so
/usr/lib/oracle/10.2.0.3/client/lib/libsqlplusic.so
/usr/bin/sqlplus

# Configuration

# Create a general link so that env. variables bellow can be more general
# between different versions

cd /usr/lib/oracle/
ln -s 10.2.0.3/ default

# Add the following lines in '/etc/profile' so that all users will benefit

echo 'export SQLPATH=/usr/lib/oracle/default/client/lib' >> /etc/profile
echo 'export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SQLPATH"' >> /etc/profile

# LD_LIBRARY_PATH can be clobbered by unknown system to me and it is
# probably nicer to add library location via the following way, which will
# work out of the box for all users.

echo '/usr/lib/oracle/default/client/lib' >> /etc/ld.so.conf
ldconfig

# Set TNS_ADMIN, which should point to map with 'TNSNAMES.ORA' file. Hmm,
# where do you get that file? You should ask database administrator. I got
# it from him and put it via commands bellow. Additionally, I also needed
# file 'SQLNET.ORA' in same place!

cd /usr/lib/oracle/
mkdir -p network/admin
mv TNSNAMES.ORA SQLNET.ORA /usr/lib/oracle/network/admin/.
## keep in uppercase !!!!
echo 'export TNS_ADMIN=/usr/lib/oracle/network/admin' >> /etc/profile

# Login to database with

sqlplus username/password@//machineName:port/databaseName

# Additionally, ODBC drivers where not available as RPM package so I need
# to do installation by hand.

# Unpack
unzip instantclient-odbc-linux32-10.2.0.3-20061115.zip
Archive: instantclient-odbc-linux32-10.2.0.3-20061115.zip
inflating: instantclient_10_2/ODBCRelnotesJA.htm
inflating: instantclient_10_2/ODBCRelnotesUS.htm
inflating: instantclient_10_2/ODBC_IC_Readme_Linux.html
inflating: instantclient_10_2/libsqora.so.10.1
inflating: instantclient_10_2/odbc_update_ini.sh

# Move files to proper place
mv instantclient_10_2/* /usr/lib/oracle/default/client/lib/.
cd /usr/lib/oracle/default/client/lib/.

# Create link - just to be sure
ln -s libsqora.so.10.1 libsqora.so

# We need system ODBC stuff
aptitude install odbcinst1

# Issue ODBC configuration via available shell script. I had a problem to
# understandwhat and where is driver manager directory. Looking in install
# script revealed that this is a root directory, since I should pass
# something like $DM_HOME/etc/odbc.ini. Since 'odbc.ini' is in '/etc',
# driver manager home is just '/'.
chmod a+x odbc_update_ini.sh
./odbc_update_ini.sh /

# Now let's take a look
cat /etc/odbcinst.ini

[Oracle 10g ODBC driver]
Description = Oracle ODBC driver for Oracle 10g
Driver = /usr/lib/oracle/10.2.0.3/client/lib/libsqora.so.10.1
Setup =
FileUsage =
CPTimeout =
CPReuse =

cat $HOME/.odbc.ini

[_yourDSN_]
Application Attributes = T
Attributes = W
BatchAutocommitMode = IfAllSuccessful
BindAsFLOAT = F
CloseCursor = F
DisableDPM = F
DisableMTS = T
Driver = Oracle 10g ODBC driver
DSN = OracleODBC-10g
EXECSchemaOpt =
EXECSyntax = T
Failover = T
FailoverDelay = 10
FailoverRetryCount = 10
FetchBufferSize = 64000
ForceWCHAR = F
Lobs = T
Longs = T
MetadataIdDefault = F
QueryTimeout = T
ResultSets = T
ServerName = _yourServerName_
SQLGetData extensions = F
Translation DLL =
Translation Option = 0
DisableRULEHint = T
UserID = _yourUserID_

# Exit root account
exit

# Copy roots' '.odbc.ini' to users home and modify it that it matches to your
# database.
cat /root/.odbc.ini >> .odbc.ini

# You can play with graphical tools

DataManager &
DataManagerII &
OBCDConfig & # I got crash here when I wanted to connect to database

# Or with command line

isql -v _yourDSN_ _yourUserName_ _yourPassword_

# Now slick stuff with RODBC

su - # again as root
aptitude install r-cran-rodbc
exit

# Start R

library(RODBC)

channel <- odbcConnect(dsn=_yourDSN_, uid=_yourUserID_, pwd=_yourPassword_,
case="oracle", believeNRows=FALSE)
odbcGetInfo(channel)

# Simple query
query <- "query1;"
zival <- sqlQuery(channel, query)

# Or a set of queries, where sprintf can be nicely used

query <- c(
"query1;",
sprintf("CREATE TABLE tmp AS
SELECT bla1,
bla2,
FROM tableX
WHERE bla3 = '%s';", x),
"query3;")

sapply(query, sqlQuery, channel=channel)

2007-03-27

EFABIS in Slovenia

Last week I have been involved in setting up local node within EFABISNet (using EFABIS). We are partners in EU funded project EFABISNet and our node is the first one. It is up and running at efabis.bfro.uni-lj.si. Translation to slovenian is far from complete and we are trying to do our best. Looking forward to get any comments on the site.

Update on 2011-03-30: new website address.

2007-03-19

Survival analysis applied to animal breeding and epidemiology

I was out of the office for a while, so there has been no posts. I attended short course by Vincent Ducrocq on Survival analysis applied to animal breeding and epidemiology. The course was really great! We had lectures in morning and practicals after lunch. We have used his program called Survival Kit, written in FORTRAN 77. It is a nice program and can be used on big datasets and last but not least available for free at link. Now we have the know how to start the analyses of longevity in our farm animals.

2007-03-03

New version of connectedness

Spent some time on R package connecetdness and rolled up a new version (0.2.2). It has been quite a while since last update and list of changes is quite long. I have also written a vignette! Check the news.


NTFS with Linux

As a Linux user I always had problems with NTFS drivers for Windows disk/partition. I used drivers that come with a kernel, but only read was supported. Now, we can have also write support with NTFS-3G. Debian users can simply type

aptitude install ntfs-3g

NTFS-3G site shows how to use this "driver". Now I have the following in my /etc/auto.mnt

flash -fstype=ntfs-3g,gid=usb,umask=002,sync :/dev/sda1
slimwin -fstype=ntfs-3g,gid=usb,umask=002,sync :/dev/sda1


This also means that I can safely reformat my USB stick from VFAT to NTFS and no more "problems" with long filenames. I was unable to format USB to NTFS. I followed this note.

Finally, this is one barrier less for use of Linux. Great!

2007-03-02

Open access

It seems that Open Access is gaining its momentum more and more and I think it is right so. After all we are all paying taxes and should have access to research results. Here is the BBC news about this link.

Openness is also gaining its momentum in the field of software, where Open Source has made tremendous progress in last, say 5, years. It seems that we will soon have open and well documentet formats for our files. This is very important since closed formats can be an evil after few years when nonone has access to old versions of the program. Link to one of many Slahdot news.

2007-03-01

Tamara sent me this:

Science vs faith

Yep, it would really be wise if some actions (not only revolution part) from left would be used in right part of the picture. But sometimes I think that a lot of "holy" wars were and are fought mainly because small group of people have particular position.

Book search

Finding and buying a book can be very fast due to Amazon and similar sites. But I was impressed how fast I was able to find an illegal copy on the web. There was no need to search the torrents, emule and similar file sharing stuff. Take a look at

http://rapidsharebooks.blogspot.com/index.html
http://anuvinu.blogspot.com/index.html
http://linkgrabber.blogspot.com/index.html

No comment.

2007-02-28

Code search

Why should we reinvent the wheel? Code search is really hand today. It can of course be a neat way to learn how particular language is used and study the examples. Koders and Google code search offer nice interface. There is also Firefox plugin for Google's code search.

First post

Hi!

OK. I decided it is time to create my own blog. I have been thinking about this for some time now, being inspired by many excellent bloggers around the globe. I am in dilemma about the language of posts. My native language is Slovenian, but I think that I will get more "audience" using English. Maybe I will just use native lang. for local thoughts and English otherwise. We will see ...