<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9054026884791139362</id><updated>2011-12-09T22:40:20.629+01:00</updated><category term='dll'/><category term='Visual Fortran'/><category term='R'/><title type='text'>Notes to self</title><subtitle type='html'>Small comments on technical and scientific issues - another blog is reserved for more political oriented comments &lt;br&gt;&lt;a href="http://politicalrantshellmund.blogspot.com/"&gt;&lt;em&gt;A sanctuary of free political thought&lt;/em&gt;&lt;/a&gt;&lt;br&gt; Another homepage is related to my previous occupation as &lt;br&gt;&lt;a href="http://staff.pubhealth.ku.dk/~guhe/"&gt;scientific assistant (May09-May10) at the University of Copenhagen.&lt;/a&gt; &lt;br&gt;Educational background: PhD mathematical statistics April 2009, University of Aarhus.&lt;br&gt;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://hellmund.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://hellmund.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Gunnar</name><uri>http://www.blogger.com/profile/04154797491171625471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/-gRYZF9dIdts/TuKAJg8pAtI/AAAAAAAAAIM/49RkJ0hCyJc/s220/GunnarHellmund.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9054026884791139362.post-1396417164899154794</id><published>2011-08-20T13:23:00.000+02:00</published><updated>2011-08-20T13:23:59.142+02:00</updated><title type='text'>SPSSINC HETCOR</title><content type='html'>Computation of heterogeneous correlations are feasible with the R-package polychor, which in version 18 of SPSS has an official interface (Analyze -&gt; Correlate -&gt; heterogeneous correlations). I have experienced numerical instabilities following calls to the SPSSINC HETCOR interface - but a direct call to R and polycor in regular SPSS syntax avoids these problems.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9054026884791139362-1396417164899154794?l=hellmund.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hellmund.blogspot.com/feeds/1396417164899154794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9054026884791139362&amp;postID=1396417164899154794' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/1396417164899154794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/1396417164899154794'/><link rel='alternate' type='text/html' href='http://hellmund.blogspot.com/2011/08/spssinc-hetcor.html' title='SPSSINC HETCOR'/><author><name>Gunnar</name><uri>http://www.blogger.com/profile/04154797491171625471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/-gRYZF9dIdts/TuKAJg8pAtI/AAAAAAAAAIM/49RkJ0hCyJc/s220/GunnarHellmund.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9054026884791139362.post-4703020970093793881</id><published>2011-02-20T15:22:00.000+01:00</published><updated>2011-02-20T15:22:22.719+01:00</updated><title type='text'>More on convolution</title><content type='html'>Often you need to convolve a particular vector with a lot of other vectors of equal length, then the program below can be used. It illustrates the use of Rcpp/inline and FFTW used from within R.&lt;br /&gt;&lt;br /&gt;### The program below can be used, when a vector is convolved several times&lt;br /&gt;### with vectors of equal length&lt;br /&gt;&lt;br /&gt;### In the first step the FFT of x is stored and FFTW plans are created,&lt;br /&gt;### in subsequent steps the FFT of x is reused and FFTW plans recalled.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;library(Rcpp)&lt;br /&gt;require(inline)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### Definition of plugin, makes linkage to FFTW possible&lt;br /&gt;plug &lt;- Rcpp:::Rcpp.plugin.maker(include.before = "#include &lt;fftw3.h&gt;",&lt;br /&gt;                                     libs = paste("-L/usr/local/lib/R/site-library/Rcpp/lib -lRcpp",&lt;br /&gt;                                                  "-Wl,-rpath,/usr/local/lib/R/site-library/Rcpp/lib",&lt;br /&gt;                                                  "-lfftw3 -lm -L/usr/lib"))&lt;br /&gt;registerPlugin("FFTWconv", plug )&lt;br /&gt;&lt;br /&gt;### Convolution function used after initiation&lt;br /&gt;convFFTW &lt;- cxxfunction(&lt;br /&gt;signature(x_fftIn = "numeric", yIn = "numeric"),&lt;br /&gt;body = '&lt;br /&gt;Rcpp::NumericMatrix x_fft(x_fftIn);&lt;br /&gt;Rcpp::NumericVector y(yIn);&lt;br /&gt;int ny=y.size();&lt;br /&gt;int n=x_fft.ncol();&lt;br /&gt;Rcpp:NumericVector retPar(n);&lt;br /&gt;&lt;br /&gt;double in_1[n];&lt;br /&gt;double out_2[n];&lt;br /&gt;&lt;br /&gt;FILE *inputfile;&lt;br /&gt;&lt;br /&gt;fftw_complex *in_2,*out_1,*y_fft;&lt;br /&gt;in_2=(fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n);&lt;br /&gt;out_1=(fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n);&lt;br /&gt;&lt;br /&gt;fftw_plan forward;&lt;br /&gt;fftw_plan backward;&lt;br /&gt;&lt;br /&gt;inputfile = fopen("stored.wisdom", "r");&lt;br /&gt;fftw_import_wisdom_from_file(inputfile);&lt;br /&gt;fclose(inputfile);&lt;br /&gt;&lt;br /&gt;forward=fftw_plan_dft_r2c_1d(n, in_1, out_1, FFTW_MEASURE);&lt;br /&gt;backward=fftw_plan_dft_c2r_1d(n, in_2, out_2, FFTW_MEASURE);&lt;br /&gt;&lt;br /&gt;for(int i=0;i&lt;ny;i++) in_1[i]=y[i];&lt;br /&gt;for(int i=ny;i&lt;n;i++) in_1[i]=0.0;&lt;br /&gt;fftw_execute(forward);&lt;br /&gt;&lt;br /&gt;for(int i=0;i&lt;n;i++){&lt;br /&gt;    in_2[i][0]=x_fft(0,i)*out_1[i][0]+x_fft(1,i)*out_1[i][1];&lt;br /&gt;    in_2[i][1]=x_fft(1,i)*out_1[i][0]-x_fft(0,i)*out_1[i][1];&lt;br /&gt;    }&lt;br /&gt;fftw_execute(backward);&lt;br /&gt;&lt;br /&gt;for(int i=0;i&lt;n;i++) retPar[i]=out_2[i]/((double)n);&lt;br /&gt;&lt;br /&gt;fftw_destroy_plan(forward);&lt;br /&gt;fftw_destroy_plan(backward);&lt;br /&gt;&lt;br /&gt;return retPar;&lt;br /&gt;', plugin="FFTWconv")&lt;br /&gt;&lt;br /&gt;### Convolution function used for initiation / creation of FFTW plans&lt;br /&gt;convFFTWstart &lt;- cxxfunction(&lt;br /&gt;signature(xIn = "numeric", yIn = "numeric"),&lt;br /&gt;body = '&lt;br /&gt;Rcpp::NumericVector x(xIn);&lt;br /&gt;Rcpp::NumericVector y(yIn);&lt;br /&gt;int nx=x.size();&lt;br /&gt;int ny=y.size();&lt;br /&gt;int n=nx+ny-1;&lt;br /&gt;Rcpp:NumericMatrix retPar(3,n);&lt;br /&gt;&lt;br /&gt;double in_1[n];&lt;br /&gt;double out_2[n];&lt;br /&gt;&lt;br /&gt;FILE *inputfile;&lt;br /&gt;&lt;br /&gt;fftw_complex *in_2,*out_1,*x_fft,*y_fft;&lt;br /&gt;in_2=(fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n);&lt;br /&gt;out_1=(fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n);&lt;br /&gt;&lt;br /&gt;fftw_plan forward;&lt;br /&gt;fftw_plan backward;&lt;br /&gt;&lt;br /&gt;forward=fftw_plan_dft_r2c_1d(n, in_1, out_1, FFTW_MEASURE);&lt;br /&gt;backward=fftw_plan_dft_c2r_1d(n, in_2, out_2, FFTW_MEASURE);&lt;br /&gt;inputfile = fopen("stored.wisdom", "w");&lt;br /&gt;fftw_export_wisdom_to_file(inputfile);&lt;br /&gt;fclose(inputfile);&lt;br /&gt;&lt;br /&gt;for(int i=0;i&lt;(n-nx);i++) in_1[i]=0.0;&lt;br /&gt;for(int i=(n-nx);i&lt;n;i++) in_1[i]=x[i-n+nx];&lt;br /&gt;fftw_execute(forward);&lt;br /&gt;x_fft=(fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n);&lt;br /&gt;for(int i=0;i&lt;n;i++)&lt;br /&gt;    for(int j=0;j&lt;2;j++) x_fft[i][j]=out_1[i][j];&lt;br /&gt;&lt;br /&gt;for(int i=0;i&lt;ny;i++) in_1[i]=y[i];&lt;br /&gt;for(int i=ny;i&lt;n;i++) in_1[i]=0.0;&lt;br /&gt;fftw_execute(forward);&lt;br /&gt;&lt;br /&gt;for(int i=0;i&lt;n;i++){&lt;br /&gt;    in_2[i][0]=x_fft[i][0]*out_1[i][0]+x_fft[i][1]*out_1[i][1];&lt;br /&gt;    in_2[i][1]=x_fft[i][1]*out_1[i][0]-x_fft[i][0]*out_1[i][1];&lt;br /&gt;    }&lt;br /&gt;fftw_execute(backward);&lt;br /&gt;&lt;br /&gt;for(int i=0;i&lt;n;i++){&lt;br /&gt;retPar(0,i)=out_2[i]/((double)n);&lt;br /&gt;retPar(1,i)=x_fft[i][0];&lt;br /&gt;retPar(2,i)=x_fft[i][1];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;fftw_destroy_plan(forward);&lt;br /&gt;fftw_destroy_plan(backward);&lt;br /&gt;&lt;br /&gt;return retPar;&lt;br /&gt;', plugin="FFTWconv")&lt;br /&gt;&lt;br /&gt;convolve_fftw=function(x,y){&lt;br /&gt;return(convFFTW(x,rev(y)))&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;###R function which handles Rcpp/inline functions above&lt;br /&gt;conv.iteration &lt;&lt;- 0&lt;br /&gt;&lt;br /&gt;convolve_fftw=function(x,y){&lt;br /&gt;if(conv.iteration==0){&lt;br /&gt;conv.start &lt;&lt;- convFFTWstart(x,rev(y))&lt;br /&gt;conv.iteration &lt;&lt;- 1&lt;br /&gt;return(conv.start[1,])&lt;br /&gt;}&lt;br /&gt;else return(convFFTW(conv.start[2:3,],rev(y)))&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9054026884791139362-4703020970093793881?l=hellmund.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hellmund.blogspot.com/feeds/4703020970093793881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9054026884791139362&amp;postID=4703020970093793881' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/4703020970093793881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/4703020970093793881'/><link rel='alternate' type='text/html' href='http://hellmund.blogspot.com/2011/02/more-on-convolution.html' title='More on convolution'/><author><name>Gunnar</name><uri>http://www.blogger.com/profile/04154797491171625471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/-gRYZF9dIdts/TuKAJg8pAtI/AAAAAAAAAIM/49RkJ0hCyJc/s220/GunnarHellmund.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9054026884791139362.post-6453530614509567989</id><published>2011-02-20T09:07:00.000+01:00</published><updated>2011-02-20T09:07:06.616+01:00</updated><title type='text'>An example using Rcpp, inline and FFTW: Convolution</title><content type='html'>Following a discussion on the Rcpp mailing list I constructed the example below, which illustrates how to use Rcpp.plugin.maker to assure correct linkage of a library - in this case the FFTW library (Fastest Fourier Transform in the West). &lt;br /&gt;The resulting R function is named convolve_fftw&lt;br /&gt;&lt;br /&gt;The example also illustrates the general use of Rcpp and inline&lt;br /&gt;&lt;br /&gt;library(Rcpp)&lt;br /&gt;require(inline)&lt;br /&gt;&lt;br /&gt;plug &lt;- Rcpp:::Rcpp.plugin.maker(include.before = "#include &lt;fftw3.h&gt;",&lt;br /&gt;                                     libs = paste("-L/usr/local/lib/R/site-library/Rcpp/lib -lRcpp",&lt;br /&gt;                                                  "-Wl,-rpath,/usr/local/lib/R/site-library/Rcpp/lib",&lt;br /&gt;                                                  "-lfftw3 -lm -L/usr/lib"))&lt;br /&gt;registerPlugin("FFTWconv", plug )&lt;br /&gt;&lt;br /&gt;convFFTW &lt;- cxxfunction(&lt;br /&gt;signature(xIn = "numeric", yIn = "numeric"),&lt;br /&gt;body = '&lt;br /&gt;Rcpp::NumericVector x(xIn);&lt;br /&gt;Rcpp::NumericVector y(yIn);&lt;br /&gt;int nx=x.size();&lt;br /&gt;int ny=y.size();&lt;br /&gt;int n=nx+ny-1;&lt;br /&gt;Rcpp:NumericVector retPar(n,0.0);&lt;br /&gt;&lt;br /&gt;double in_1[n];&lt;br /&gt;double out_2[n];&lt;br /&gt;&lt;br /&gt;fftw_complex *in_2,*out_1,*irf_fft,*y_fft;&lt;br /&gt;in_2=(fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n);&lt;br /&gt;out_1=(fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n);&lt;br /&gt;&lt;br /&gt;fftw_plan forward;&lt;br /&gt;fftw_plan backward;&lt;br /&gt;&lt;br /&gt;forward=fftw_plan_dft_r2c_1d(n, in_1, out_1, FFTW_ESTIMATE);&lt;br /&gt;backward=fftw_plan_dft_c2r_1d(n, in_2, out_2, FFTW_ESTIMATE);&lt;br /&gt;&lt;br /&gt;for(int i=0;i&lt;(n-nx);i++) in_1[i]=0.0;&lt;br /&gt;for(int i=(n-nx);i&lt;n;i++) in_1[i]=x[i-n+nx];&lt;br /&gt;fftw_execute(forward);&lt;br /&gt;irf_fft=(fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n);&lt;br /&gt;for(int i=0;i&lt;n;i++)&lt;br /&gt;    for(int j=0;j&lt;2;j++) irf_fft[i][j]=out_1[i][j];&lt;br /&gt;&lt;br /&gt;for(int i=0;i&lt;ny;i++) in_1[i]=y[i];&lt;br /&gt;for(int i=ny;i&lt;n;i++) in_1[i]=0.0;&lt;br /&gt;fftw_execute(forward);&lt;br /&gt;y_fft=(fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n);&lt;br /&gt;for(int i=0;i&lt;n;i++) &lt;br /&gt;    for(int j=0;j&lt;2;j++) y_fft[i][j]=out_1[i][j];&lt;br /&gt;&lt;br /&gt;for(int i=0;i&lt;n;i++){&lt;br /&gt;    in_2[i][0]=irf_fft[i][0]*y_fft[i][0]+irf_fft[i][1]*y_fft[i][1];&lt;br /&gt;    in_2[i][1]=irf_fft[i][1]*y_fft[i][0]-irf_fft[i][0]*y_fft[i][1];&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;fftw_execute(backward);&lt;br /&gt;&lt;br /&gt;for(int i=0;i&lt;n;i++) retPar[i]=out_2[i]/((double)n);&lt;br /&gt;&lt;br /&gt;fftw_destroy_plan(forward);&lt;br /&gt;fftw_destroy_plan(backward);&lt;br /&gt;&lt;br /&gt;return retPar;&lt;br /&gt;', plugin="FFTWconv")&lt;br /&gt;&lt;br /&gt;convolve_fftw=function(x,y){&lt;br /&gt;return(convFFTW(x,rev(y)))&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9054026884791139362-6453530614509567989?l=hellmund.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hellmund.blogspot.com/feeds/6453530614509567989/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9054026884791139362&amp;postID=6453530614509567989' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/6453530614509567989'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/6453530614509567989'/><link rel='alternate' type='text/html' href='http://hellmund.blogspot.com/2011/02/example-using-rcpp-inline-and-fftw.html' title='An example using Rcpp, inline and FFTW: Convolution'/><author><name>Gunnar</name><uri>http://www.blogger.com/profile/04154797491171625471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/-gRYZF9dIdts/TuKAJg8pAtI/AAAAAAAAAIM/49RkJ0hCyJc/s220/GunnarHellmund.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9054026884791139362.post-444299839838909642</id><published>2011-02-19T17:33:00.000+01:00</published><updated>2011-02-19T17:33:57.382+01:00</updated><title type='text'>Til en kvinde</title><content type='html'>Dit lange velduftende krøllede mørke hår &lt;br /&gt;På en krop smukkere end de flestes &lt;br /&gt;Vil på nogle dage trækkes ublidt og besidende op til vores hule på bjergsiden&lt;br /&gt;i nåleskoven langt fra dalen.&lt;br /&gt;Langt oftest kysser jeg dig blidt på din hals til velkomst og afsked&lt;br /&gt;stryger din nakke&lt;br /&gt;- og løfter din krop op mod min.&lt;br /&gt;Hånligt tager du fat i min nakke og fører min tunge &lt;br /&gt;fra dine velpudsede sko op langs dine bløde inderlår til dine bryster &lt;br /&gt;- sådan ligger vi! &lt;br /&gt;vekslende en hel nat&lt;br /&gt;i favntag med mørket og lyset i os.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9054026884791139362-444299839838909642?l=hellmund.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hellmund.blogspot.com/feeds/444299839838909642/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9054026884791139362&amp;postID=444299839838909642' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/444299839838909642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/444299839838909642'/><link rel='alternate' type='text/html' href='http://hellmund.blogspot.com/2011/02/til-en-kvinde.html' title='Til en kvinde'/><author><name>Gunnar</name><uri>http://www.blogger.com/profile/04154797491171625471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/-gRYZF9dIdts/TuKAJg8pAtI/AAAAAAAAAIM/49RkJ0hCyJc/s220/GunnarHellmund.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9054026884791139362.post-6559318116837476604</id><published>2011-02-01T12:01:00.001+01:00</published><updated>2011-02-01T12:03:15.661+01:00</updated><title type='text'>ModernCV - for black and white printers</title><content type='html'>&lt;meta equiv="content-type" content="text/html; charset=utf-8"&gt;The LaTeX class ModernCV does not provide a black color theme option - and printouts can therefore contain rastered colors if printed on black and white printers.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I am using the classic layout and made the following changes in .../tex/latex/modercv/moderncvthemeclassic.sty to get a black color theme.&lt;/div&gt;&lt;div&gt;First of all I copied the style file and edited it as normal user, then copied the file to its original location as root.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the code section &lt;i&gt;Package options -&gt; color options&lt;/i&gt; I added the lines&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;% black&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;\newif\if@colorblack\@colorblackfalse&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;\DeclareOption{black}{\@colorblacktrue}&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;immediately after the line&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;i&gt;\DeclareOption{grey}{\@colorgreytrue}&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;Under &lt;i&gt;Style definition -&gt; color&lt;/i&gt; I added&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;\if@colorblack&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;\definecolor{addresscolor}{rgb}{0,0,0}&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;\definecolor{sectionrectanglecolor}{rgb}{0,0,0}&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;\definecolor{sectiontitlecolor}{rgb}{0,0,0}&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;\definecolor{subsectioncolor}{rgb}{0,0,0} &lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;b&gt;&lt;p style="white-space: pre-wrap; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; display: inline !important; "&gt; &lt;/p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;b&gt;&lt;p style="white-space: pre-wrap; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; display: inline !important; "&gt;\definecolor{titlecolor}{rgb}{0,0,0}&lt;br /&gt;&lt;/p&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;b&gt;&lt;p style="white-space: pre-wrap; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; display: inline !important; "&gt;\definecolor{quotecolor}{rgb}{0,0,0}&lt;/p&gt;&lt;/b&gt;&lt;/span&gt;\fi&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;immediately after the lines&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;i&gt;\if@colorgrey&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;\definecolor{addresscolor}{rgb}{0.35,0.35,0.35}&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;\definecolor{sectionrectanglecolor}{rgb}{0.75,0.75,0.75}&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;\definecolor{sectiontitlecolor}{rgb}{0.35,0.35,0.35}&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;\definecolor{subsectioncolor}{rgb}{0.35,0.35,0.35}&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;\definecolor{titlecolor}{rgb}{0,0,0}&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;\definecolor{quotecolor}{rgb}{0,0,0}\fi&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9054026884791139362-6559318116837476604?l=hellmund.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.tug.org/texlive/Contents/live/texmf-dist/doc/latex/moderncv/examples/' title='ModernCV - for black and white printers'/><link rel='replies' type='application/atom+xml' href='http://hellmund.blogspot.com/feeds/6559318116837476604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9054026884791139362&amp;postID=6559318116837476604' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/6559318116837476604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/6559318116837476604'/><link rel='alternate' type='text/html' href='http://hellmund.blogspot.com/2011/02/moderncv-for-black-and-white-printers.html' title='ModernCV - for black and white printers'/><author><name>Gunnar</name><uri>http://www.blogger.com/profile/04154797491171625471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/-gRYZF9dIdts/TuKAJg8pAtI/AAAAAAAAAIM/49RkJ0hCyJc/s220/GunnarHellmund.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9054026884791139362.post-4812660358645343045</id><published>2011-01-24T19:34:00.003+01:00</published><updated>2011-01-24T20:23:40.219+01:00</updated><title type='text'>Skønhed</title><content type='html'>Dine øjne er som midnatsskønne skovsøer i måneskin.&lt;div&gt;Langs bredden mærker jeg grannåle på de nedfaldne blade.&lt;/div&gt;&lt;div&gt;Vil du elske i nat eller skal jeg drukne ... ?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Du kigger på mig fra bredden, &lt;/div&gt;&lt;div&gt;afventende, &lt;/div&gt;&lt;div&gt;med dine kønne øjne,&lt;/div&gt;&lt;div&gt;skønnere end din smukke krop.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Du finder ro, tryghed har du ikke fundet,&lt;/div&gt;&lt;div&gt;kun vished har du fået til låns.&lt;/div&gt;&lt;div&gt;Din indre usikkerhed tager sine slag af livet,&lt;/div&gt;&lt;div&gt;så utroligt tilstedeværende&lt;br /&gt;og på afstand&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;hr size="3"&gt;&lt;br /&gt;Jeg har læst i den danske Shakespeare udgave, Romeo &amp;amp; Julie - og følte en smule inspiration hjulpet godt på vej af drømme om en nærværende kvinde.&lt;br /&gt;Her er Shakespeare:&lt;br /&gt;&lt;br /&gt;Elskov er som en røg af hede sukke,&lt;br /&gt;der flammer lutret i en elskers øje,&lt;br /&gt;så rent og klart; men når så modgang rammer,&lt;br /&gt;er den et hav, som tårestrømmen øger.&lt;br /&gt;Hvad er den mer? Et vanvid med forstand,&lt;br /&gt;en bitter drik, som sødt dog lindre kan!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9054026884791139362-4812660358645343045?l=hellmund.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hellmund.blogspot.com/feeds/4812660358645343045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9054026884791139362&amp;postID=4812660358645343045' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/4812660358645343045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/4812660358645343045'/><link rel='alternate' type='text/html' href='http://hellmund.blogspot.com/2011/01/sknheden.html' title='Skønhed'/><author><name>Gunnar</name><uri>http://www.blogger.com/profile/04154797491171625471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/-gRYZF9dIdts/TuKAJg8pAtI/AAAAAAAAAIM/49RkJ0hCyJc/s220/GunnarHellmund.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9054026884791139362.post-7711196180697856362</id><published>2011-01-06T19:02:00.008+01:00</published><updated>2011-01-19T11:25:25.736+01:00</updated><title type='text'>Time-dependent variables and SAS PHREG</title><content type='html'>There are several ways to include time-dependent variables in a call to SAS' Proc PHREG: Programming statements within PHREG or data steps combined with PHREG counting process format, i.e. in the model statement we use the syntax&lt;br /&gt;&lt;br /&gt;model (t_in,t_out)*censored(0) = X1 ... Xn;&lt;br /&gt;&lt;br /&gt;instead of&lt;br /&gt;&lt;br /&gt;model t*censored(0) = X1 ... Xn;&lt;br /&gt;&lt;br /&gt;Click the title to download the following SAS macro I have written. If you find an error please report it, otherwise you are free to use it. Another macro that can be used for the purpose of splitting a data set according to time-dependent variables is the Lexis macro developed by Bendix Carstensen &lt;a href="http://staff.pubhealth.ku.dk/%7Ebxc/Lexis/Lexis.sas"&gt;%LEXIS&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*Macro for splitting data according to 0-1 time dependent variables*/&lt;br /&gt;&lt;br /&gt;%macro split_time(&lt;br /&gt;filein, /*Data set file containing td_date among other variables*/&lt;br /&gt;id, /*Patient id - needed since we sort wrt. id and datein - could be removed */&lt;br /&gt;td_var, /*Created 0-1 time-dependent variable*/&lt;br /&gt;td_date, /*Date for update of timedependent variable*/&lt;br /&gt;datein, /*Entry date*/&lt;br /&gt;dateout, /*Exit date*/&lt;br /&gt;cenvar, /*Censored 0 yes 1 no*/&lt;br /&gt;fileout, /*Output file*/&lt;br /&gt;labeltext /*td_var label - plain text - no quotes!*/&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;proc sort data=&amp;amp;filein out=temp; by id &amp;datein; run;&lt;br /&gt;&lt;br /&gt;data temp1;&lt;br /&gt;set temp;&lt;br /&gt;if (&amp;amp;dateout GT &amp;amp;td_date) then do;&lt;br /&gt;&amp;amp;td_var=1;&lt;br /&gt;&amp;amp;datein=max(&amp;amp;td_date,&amp;amp;datein);&lt;br /&gt;end; &lt;br /&gt;else delete;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;data temp3;&lt;br /&gt;set temp;&lt;br /&gt;if (&amp;amp;dateout LE &amp;amp;td_date) then &amp;amp;td_var=0;&lt;br /&gt;else delete;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;data temp2;&lt;br /&gt;set temp;&lt;br /&gt;if (&amp;amp;dateout GT &amp;amp;td_date GT &amp;amp;datein) then do;&lt;br /&gt;&amp;amp;dateout=&amp;amp;td_date;&lt;br /&gt;&amp;amp;cenvar=0;&lt;br /&gt;&amp;amp;td_var=0;&lt;br /&gt;end;&lt;br /&gt;else delete;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;data temp; &lt;br /&gt;set temp1 temp2 temp3;&lt;br /&gt;label &amp;amp;td_var="&amp;amp;labeltext";&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;proc sort data=temp out=&amp;fileout;&lt;br /&gt;by &amp;amp;id &amp;datein;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;%mend split_time;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*Example of its use - three dates included on the input file are used*/&lt;br /&gt;%inc 'Z:\split_time.sas';&lt;br /&gt;&lt;br /&gt;proc sort data=lv.litval;&lt;br /&gt;    by id dateDep dateCon datePsy;&lt;br /&gt;run;&lt;br /&gt;&lt;br /&gt;%split_time(&lt;br /&gt;lv.litval,&lt;br /&gt;id,&lt;br /&gt;conDep,&lt;br /&gt;dateDep,&lt;br /&gt;dateFirstPurchase,&lt;br /&gt;eventTimeHosp,&lt;br /&gt;censoredHosp,&lt;br /&gt;outDataDep,&lt;br /&gt;Concomitant use of antidepressants&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;%split_time(&lt;br /&gt;outDataDep,&lt;br /&gt;id,&lt;br /&gt;conCon,&lt;br /&gt;dateCon,&lt;br /&gt;dateFirstPurchase,&lt;br /&gt;eventTimeHosp,&lt;br /&gt;censoredHosp,&lt;br /&gt;outDataCon,&lt;br /&gt;Concomitant use of anticonvulsants&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;%split_time(&lt;br /&gt;outDataCon,&lt;br /&gt;id,&lt;br /&gt;conPsy,&lt;br /&gt;datePsy,&lt;br /&gt;dateFirstPurchase,&lt;br /&gt;eventTimeHosp,&lt;br /&gt;censoredHosp,&lt;br /&gt;lv.litvalHosp,&lt;br /&gt;Concomitant use of antipsychotics&lt;br /&gt;);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9054026884791139362-7711196180697856362?l=hellmund.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='https://docs.google.com/leaf?id=0B9W0PeZeeB6ONzlhNThhMDUtY2IyNC00M2ViLWFiZDItNzJlOGQ5MGVlNTNi&amp;hl=en' title='Time-dependent variables and SAS PHREG'/><link rel='replies' type='application/atom+xml' href='http://hellmund.blogspot.com/feeds/7711196180697856362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9054026884791139362&amp;postID=7711196180697856362' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/7711196180697856362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/7711196180697856362'/><link rel='alternate' type='text/html' href='http://hellmund.blogspot.com/2011/01/time-dependent-variables-and-sas-phreg.html' title='Time-dependent variables and SAS PHREG'/><author><name>Gunnar</name><uri>http://www.blogger.com/profile/04154797491171625471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/-gRYZF9dIdts/TuKAJg8pAtI/AAAAAAAAAIM/49RkJ0hCyJc/s220/GunnarHellmund.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9054026884791139362.post-1028036719887232446</id><published>2010-11-25T20:40:00.013+01:00</published><updated>2010-12-14T07:49:01.191+01:00</updated><title type='text'>Programmer til dannelse af grundlæggende databaser</title><content type='html'>Mange bruger tilsyneladende SAS' proc sql når de gennemfører registerstudier på Danmarks Statistiks servere (DST). Med almindelige data steps kommer man langt, og med en baggrund som statistiker er data steps også mere håndgribelige (i samspil med proc sort, proc tabulate, proc append osv.) Dog skal man tage højde for ikke at benytte autogenererede variable (som f.eks. first.id fra en 'by id' statement) sammen med where options - og tjekke at forståelsen af retain statements er tilstede (ved at kontrollere resulterende datasæt). &lt;br /&gt;&lt;br /&gt;Vedlagt et par programmer jeg selv har skrevet og finder nyttige - rettelsesforslag er velkomne og hvis de benyttes bedes man angive kilde.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://docs.google.com/uc?id=0B9W0PeZeeB6OZTIwMzJiNjQtYjY1Ny00MzM4LThkMjItNTY3MjhhYTg5MTU2&amp;export=download&amp;hl=en"&gt;BDS.zip (Basic Data Steps)&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9054026884791139362-1028036719887232446?l=hellmund.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hellmund.blogspot.com/feeds/1028036719887232446/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9054026884791139362&amp;postID=1028036719887232446' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/1028036719887232446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/1028036719887232446'/><link rel='alternate' type='text/html' href='http://hellmund.blogspot.com/2010/11/programmer-til-dannelse-af-grundlggende.html' title='Programmer til dannelse af grundlæggende databaser'/><author><name>Gunnar</name><uri>http://www.blogger.com/profile/04154797491171625471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/-gRYZF9dIdts/TuKAJg8pAtI/AAAAAAAAAIM/49RkJ0hCyJc/s220/GunnarHellmund.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9054026884791139362.post-6578460626817520049</id><published>2009-10-22T22:50:00.002+02:00</published><updated>2009-10-22T23:03:17.765+02:00</updated><title type='text'>The Pleasure Of Finding Things Out</title><content type='html'>Found on YouTube:&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;em&gt;Part 1 of 5&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;object width="480" height="385"&gt;&lt;param name="movie" value="http://www.youtube.com/v/srSbAazoOr8&amp;hl=en&amp;fs=1&amp;rel=0&amp;color1=0x006699&amp;color2=0x54abd6"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/srSbAazoOr8&amp;hl=en&amp;fs=1&amp;rel=0&amp;color1=0x006699&amp;color2=0x54abd6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;a href="http://www.youtube.com/watch?v=UVjFPGIrbGw"&gt;Part 2 of 5&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.youtube.com/watch?v=RzPfKI4b-dg"&gt;Part 3 of 5&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.youtube.com/watch?v=Br_PJY-LZTw"&gt;Part 4 of 5&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.youtube.com/watch?v=taEw97brZis"&gt;Part 5 of 5&lt;/a&gt;&lt;/em&gt;&lt;/center&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9054026884791139362-6578460626817520049?l=hellmund.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hellmund.blogspot.com/feeds/6578460626817520049/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9054026884791139362&amp;postID=6578460626817520049' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/6578460626817520049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/6578460626817520049'/><link rel='alternate' type='text/html' href='http://hellmund.blogspot.com/2009/10/pleasure-of-finding-things-out.html' title='The Pleasure Of Finding Things Out'/><author><name>Gunnar</name><uri>http://www.blogger.com/profile/04154797491171625471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/-gRYZF9dIdts/TuKAJg8pAtI/AAAAAAAAAIM/49RkJ0hCyJc/s220/GunnarHellmund.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9054026884791139362.post-6262360891655277897</id><published>2009-09-29T23:14:00.005+02:00</published><updated>2009-09-29T23:24:53.505+02:00</updated><title type='text'>Impressive - a tool for pdf-presentations</title><content type='html'>Impressive is a presentation tool for pdf files. Click &lt;a href="http://impressive.sourceforge.net/"&gt;&gt;here&lt;&lt;/a&gt; to go to the homepage for the project on SourceForge.net &lt;br /&gt;&lt;br /&gt;Note: At time of writing last update of project files was 18/9/2008.&lt;br /&gt;&lt;br /&gt;Read &lt;a href="http://impressive.sourceforge.net/manual.php"&gt;the documentation&lt;/a&gt; to learn about all the options for the program - including the many advanced options: You can play audio files in the background or view full screen video on entry of specific slides, put a timer on slides, set duration of talk, rotate pages, define transitions for specific pages etc. Many of these features require the use of Info scripts (RTFM)&lt;br /&gt;&lt;br /&gt;There is also a useful script &lt;em&gt;gettransitions&lt;/em&gt; that will export Beamer transitions to Impressive by creating an appropriate Info file &lt;a href="http://www.cv.nrao.edu/~rreid/software/#gettransitions"&gt;Click here to go to the gettransitions site&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Most often the computer used for the pdf presentation will be a 32 bit Windows box. I therefore suggest to download the file &lt;a href="http://sourceforge.net/projects/impressive/files/Impressive/0.10.2/Impressive-0.10.2-win32.zip/download"&gt;Impressive-0.10.2-win32.zip&lt;/a&gt; and put it on the usb-pen with your pdf presentation file (and accompanying audio/video files etc.)&lt;br /&gt;&lt;br /&gt;In order to use Impressive simply drop the icon of your pdf file on impressive.exe &lt;br /&gt;&lt;br /&gt;Impressive has transitions and background rendering enabled by default - create a shortcut to impressive.exe with the options -t None -b in order to disable transitions and background rendering (Rightclick the impressive.exe icon, select &lt;strong&gt;Create Shortcut&lt;/strong&gt;. Then right-click the newly created shortcut and add &lt;strong&gt;-t None -b&lt;/strong&gt; to the path)&lt;br /&gt;&lt;br /&gt;Hyperlinks in your presentation will only work if you use pdftk for rendering: Download the pdftk zip file &lt;a href="http://www.pdfhacks.com/pdftk/pdftk-1.41.exe.zip"&gt; &gt;here&lt;&lt;/a&gt; and extract it in your Impressive folder. &lt;br /&gt;&lt;br /&gt;The most basic uses of Impressive are: Pressing the &lt;em&gt;tab&lt;/em&gt; key in order to watch a gallery of your slides and use this gallery to jump between slides and highlighting an area on a slide by left-clicking and selecting - view the demo.pdf file (using Impressive!) to learn other basic uses of Impressive.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9054026884791139362-6262360891655277897?l=hellmund.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://impressive.sourceforge.net/' title='Impressive - a tool for pdf-presentations'/><link rel='replies' type='application/atom+xml' href='http://hellmund.blogspot.com/feeds/6262360891655277897/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9054026884791139362&amp;postID=6262360891655277897' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/6262360891655277897'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/6262360891655277897'/><link rel='alternate' type='text/html' href='http://hellmund.blogspot.com/2009/09/impressive-tool-for-pdf-presentations.html' title='Impressive - a tool for pdf-presentations'/><author><name>Gunnar</name><uri>http://www.blogger.com/profile/04154797491171625471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/-gRYZF9dIdts/TuKAJg8pAtI/AAAAAAAAAIM/49RkJ0hCyJc/s220/GunnarHellmund.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9054026884791139362.post-1861868779167103129</id><published>2009-08-16T15:21:00.012+02:00</published><updated>2009-08-16T16:30:03.232+02:00</updated><title type='text'>Windows Remote Desktop on Linux</title><content type='html'>In this short guide I will describe how to obtain access to a Windows Remote Desktop session using rdesktop on Linux - assuming you obtain &lt;a href="http://en.wikipedia.org/wiki/VPN"&gt;VPN access to your companys network&lt;/a&gt; using &lt;a href="http://en.wikipedia.org/wiki/SSL-Explorer:_Community_Edition"&gt;SSL-explorer&lt;/a&gt;. &lt;/br&gt;&lt;br /&gt;You are invited to make suggestions and provide alternatives in the comments section - but I will not provide support for SSL-explorer, rdesktop, Linux, java or anything else.&lt;br /&gt;&lt;br /&gt;I first tried to connect to a Windows XP box through SSL-Explorer using rdesktop on a Fedora 11 box, but soon realized I needed to change permissions for Sun Java etc. in order to succeed. &lt;br /&gt;Instead I installed &lt;a href="http://www.linuxmint.com/"&gt;Linux Mint&lt;/a&gt; and from then on, everything went smooth.&lt;/br&gt;&lt;/br&gt;&lt;br /&gt;&lt;br /&gt;Linux Mint is a distro built on top of Ubuntu - which in itself is built on Debian. Linux Mint provides a smoother experience and easy install options for several non-open-source programs and drivers. &lt;/br&gt;&lt;/br&gt;&lt;br /&gt;&lt;br /&gt;If you are not an open-source fanatic and do not hold the brown color design of Ubuntu dear, but otherwise like the Ubuntu experience, then Linux Mint is your choice.&lt;/br&gt;&lt;/br&gt;&lt;br /&gt;&lt;br /&gt;Here we go:&lt;/br&gt;&lt;/br&gt;&lt;br /&gt;I login to the SSL-explorer homepage (remember to set a security exception in your browser) - on the initial logon you need to accept some Java-dialogs - the SSL-agent attach itself to the panel and my office computer appears in the applications folder of the SSL-menu.&lt;/br&gt; &lt;br /&gt;I right-click the SSL-agent in the panel and choose "Tunnel Monitor", which makes the Tunnel Monitor window appear. &lt;/br&gt;&lt;br /&gt;When I click the icon for my office computer, the Tunnel Monitor informs me a connection on local port xxxxx is being attempted.&lt;br /&gt;I then run the following command from a terminal:&lt;br /&gt;rdesktop -g 1600x1150 -a 16 -k da 127.0.0.1:xxxxx&lt;br /&gt;&lt;br /&gt;The "-g 1600x1150" option gives me the desired size of the remote desktop window, the "-a 16" option tells rdesktop, we will be using a 16 bit color resolution for the session, and "-k da" makes rdesktop aware, I use a keyboard with Danish layout.&lt;br /&gt;&lt;br /&gt;A note on choice of remote desktop window size:&lt;br /&gt;I use the 'xinerama' option provided by the proprietary Nvidia graphical driver. As such I cannot use rdesktop with the "-g workarea" option (I use a setup with two monitors). &lt;/br&gt;&lt;br /&gt;On the monitor I use for the remote desktop session, I have a panel on the top of the screen. I right-click the panel and choose "Properties" (I use Linux Mint with the Gnome window manager) The Properties dialog informs me the height of the panel is 24 pixels. Since my monitor has a 1600x1200 resolution, I choose to use the option "-g 1600x1150" (I also need 24 pixels for the remote desktop session window bar).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9054026884791139362-1861868779167103129?l=hellmund.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hellmund.blogspot.com/feeds/1861868779167103129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9054026884791139362&amp;postID=1861868779167103129' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/1861868779167103129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/1861868779167103129'/><link rel='alternate' type='text/html' href='http://hellmund.blogspot.com/2009/08/windows-remote-desktop-on-linux.html' title='Windows Remote Desktop on Linux'/><author><name>Gunnar</name><uri>http://www.blogger.com/profile/04154797491171625471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/-gRYZF9dIdts/TuKAJg8pAtI/AAAAAAAAAIM/49RkJ0hCyJc/s220/GunnarHellmund.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9054026884791139362.post-3899808320025054351</id><published>2009-05-17T19:14:00.003+02:00</published><updated>2009-05-17T19:24:02.368+02:00</updated><title type='text'>What Makes Us Happy?</title><content type='html'>A recent David Brooks column entitled &lt;a href="http://www.nytimes.com/2009/05/12/opinion/12brooks.html"&gt;They had it made&lt;/a&gt; - refers to a brilliant essay in &lt;a href="http://www.theatlantic.com"&gt;The Atlantic&lt;/a&gt; on the Grant study - one of the most comprehensive longitudinal studies in history.&lt;br /&gt;&lt;br /&gt;Watch the video below and then go read the essay &lt;a href="http://www.theatlantic.com/doc/200906/happiness"&gt;What Makes Us Happy?&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;embed src="http://c.brightcove.com/services/viewer/federated_f8/1460906593" bgcolor="#FFFFFF" flashVars="videoId=22804415001&amp;playerId=1460906593&amp;viewerSecureGatewayURL=https://console.brightcove.com/services/amfgateway&amp;servicesURL=http://services.brightcove.com/services&amp;cdnURL=http://admin.brightcove.com&amp;domain=embed&amp;autoStart=false&amp;" base="http://admin.brightcove.com" name="flashObj" width="486" height="412" seamlesstabbing="false" type="application/x-shockwave-flash" swLiveConnect="true" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"&gt;&lt;/embed&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9054026884791139362-3899808320025054351?l=hellmund.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.theatlantic.com/doc/200906/happiness' title='What Makes Us Happy?'/><link rel='replies' type='application/atom+xml' href='http://hellmund.blogspot.com/feeds/3899808320025054351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9054026884791139362&amp;postID=3899808320025054351' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/3899808320025054351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/3899808320025054351'/><link rel='alternate' type='text/html' href='http://hellmund.blogspot.com/2009/05/what-makes-us-happy.html' title='What Makes Us Happy?'/><author><name>Gunnar</name><uri>http://www.blogger.com/profile/04154797491171625471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/-gRYZF9dIdts/TuKAJg8pAtI/AAAAAAAAAIM/49RkJ0hCyJc/s220/GunnarHellmund.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9054026884791139362.post-4749992458154277033</id><published>2009-03-28T19:40:00.004+01:00</published><updated>2009-03-28T21:43:56.548+01:00</updated><title type='text'>Freeman Dyson</title><content type='html'>In our family we do not watch television on a daily basis. Besides The New Yorker, various science journals and the Danish weekly newspaper Weekendavisen I use the Internet as my primary source of (mis)information. &lt;br /&gt;A lot of bad things has been said about The New York Times especially in recent years, but the Op-Eds by David Brooks are brilliant - and I read his columns every week on nytimes.com with great interest. &lt;br /&gt;A couple of days ago The New York Times Magazine had a magnificent profile on Freeman Dyson &lt;a href="http://www.nytimes.com/2009/03/29/magazine/29Dyson-t.html"&gt;&gt;Click Here&lt;&lt;/a&gt;. &lt;br /&gt;While reading the article I remembered the time before my university studies: I read Feynman's bestselling stories (the profile even has a curious link to a Feynman anecdote) and thought I would find a community of creative non-conformists at the science departments. Well, to a large extend I was wrong - but to read the thoughts of a guy like Freeman Dyson provides comfort - and even HOPE! (and it made me order &lt;a href="http://www.amazon.com/exec/obidos/ASIN/1590172949/flexional-us-5-20"&gt;The Scientist as a Rebel&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9054026884791139362-4749992458154277033?l=hellmund.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hellmund.blogspot.com/feeds/4749992458154277033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9054026884791139362&amp;postID=4749992458154277033' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/4749992458154277033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/4749992458154277033'/><link rel='alternate' type='text/html' href='http://hellmund.blogspot.com/2009/03/freeman-dyson.html' title='Freeman Dyson'/><author><name>Gunnar</name><uri>http://www.blogger.com/profile/04154797491171625471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/-gRYZF9dIdts/TuKAJg8pAtI/AAAAAAAAAIM/49RkJ0hCyJc/s220/GunnarHellmund.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9054026884791139362.post-4260752327830529243</id><published>2008-12-29T16:38:00.010+01:00</published><updated>2009-01-08T05:51:51.368+01:00</updated><title type='text'>Tunnelier and your campus account</title><content type='html'>A friend asked me to put these instructions on my blog.&lt;br /&gt;&lt;br /&gt;This guide can be used to access the servers at the your campus from your Windows computer via ssh. You can thereby gain access to restricted resources such as your home folder and online journal archives. This method is an alternative to ssh -X and a vpn connection. Using this method reduces the amount of traffic between your computer and the campus server to a minimum. I can also recommend this method, if your ordinary vpn-connection does not allow you to access resources on your home network - quite annoying if your printer is attached to your local network.&lt;br /&gt;&lt;br /&gt;Download and install Tunnelier:&lt;br /&gt;http://dl.bitvise.com/Tunnelier-Inst.exe&lt;br /&gt;Run Tunnelier.&lt;br /&gt;In the 'Login' window type 'Host' (some.server), 'Username' (i.e. your campus username)&lt;br /&gt;Select 'password' as Initial method, type your password and check 'Store encrypted password in profile'.&lt;br /&gt;In the 'Options' window uncheck all boxes and choose 'Automatically reconnect if successful connection breaks'.&lt;br /&gt;In the 'Services' window check the box 'Enabled' under 'SOCKS / HTTP Proxy Forwarding and set 'Listen port' to 8080. Furthermore check the box 'Enabled' under 'FTP-to-SFTP Bridge'.&lt;br /&gt;Then click 'Save Profile' to the left and save as 'campusconnect'.&lt;br /&gt;To check that you got the settings right click the 'Login' button.&lt;br /&gt;&lt;br /&gt;Then open the 'Computer' folder in the Windows 'Start' menu.&lt;br /&gt;In the 'Computer' folder right-click somewhere in the white area of the window and select 'Add a Network connection'. Click 'Next' a couple of times, and write 'ftp://localhost' in the 'Internet or network address' field and click 'Next'. Uncheck the box 'Log on anonymously', write your campus username and click 'Next'. In the field 'Type a name for this network location' type 'campus folder'. Click 'Next' and then 'Finish'. (We use ftp over ssh to make a secure connection compared to ordinary ftp)&lt;br /&gt;By clicking the campus folder in the Computer folder you can now gain access to your campus home folder.&lt;br /&gt;&lt;br /&gt;To keep things seperate I use Firefox to surf restricted internet pages like journal homepages through the secure campus-connection and Internet Explorer for all other purposes.&lt;br /&gt;The details below apply equilly well to Internet Explorer, Opera, etc.&lt;br /&gt;Firefox can be downloaded from this location: &lt;a href="http://www.mozilla.com/"&gt;http://www.mozilla.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Install and launch Firefox. In the 'Tools' menu select 'Options' then select the 'Advanced tab' and 'Settings' next to 'Configure how Firefox connects to the Internet'. Select 'Manual proxy configuration:' Set 'SOCKS Host' to '127.0.0.1' and SOCKS Host 'Port' to '8080' then click 'OK'.&lt;br /&gt;&lt;br /&gt;If you automatically want to connect to your campus account on Windows startup (otherwise start Tunnelier and login each time you want access):&lt;br /&gt;Create a shortcut to Tunnelier in the Windows Startup folder (create a shortcut on the Desktop and cut-and-paste it to the Startup folder) On Vista: Click the "Start" button, Click "All Programs" then right click the "Startup" folder. Use Windows search on XP if you have trouble locating the Startup folder.&lt;br /&gt;Edit the Tunnelier shortcut in the Startup folder.&lt;br /&gt;In the 'Target:' field you have to write:&lt;br /&gt;&lt;span style="font-size:78%;"&gt;"C:\Program Files (x86)\Bitvise Tunnelier\Tunnelier.exe" -profile=C:\Users\ YOUR_WINDOWS_USER_NAME\Documents\campusconnect.tlp -loginOnStartup&lt;/span&gt;&lt;br /&gt;Your path to 'Tunnelier.exe' or 'campusconnect.tlp' might be different, if in doubt use Windows search.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9054026884791139362-4260752327830529243?l=hellmund.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hellmund.blogspot.com/feeds/4260752327830529243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9054026884791139362&amp;postID=4260752327830529243' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/4260752327830529243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/4260752327830529243'/><link rel='alternate' type='text/html' href='http://hellmund.blogspot.com/2008/12/tunnelier-and-your-campus-account.html' title='Tunnelier and your campus account'/><author><name>Gunnar</name><uri>http://www.blogger.com/profile/04154797491171625471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/-gRYZF9dIdts/TuKAJg8pAtI/AAAAAAAAAIM/49RkJ0hCyJc/s220/GunnarHellmund.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9054026884791139362.post-5100833206687823119</id><published>2008-03-26T23:40:00.011+01:00</published><updated>2008-03-27T00:39:38.659+01:00</updated><title type='text'>Vista, Visual Studio 2008, Intel Suite and IMSL</title><content type='html'>Since the first post on Visual Studio and Intel Fortran I have made some substantial modifications to my setup.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;First of all - for a long period of time - I went back to Microsoft XP and installed the Microsoft Visual Studio 2005 Premier Partner Edition, which shipped with my copy of the academic version of Intel Visual Fortran 10.1 Professional Edition with IMSL - no problems. &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Microsoft Visual Studio 2008 was released some months ago on MSDNAA, and some weeks ago Intel released updates with the relevant interfaces. Now I have decided to give Vista another shot. I have purchased the Intel® Software Development Suite Student Edition for Windows (because of the included optimization tools), installed Visual Studio 2008 and then the Intel suite (plus my 'old' copy of IMSL).&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;The interested reader can find screenshots attached, that describe my choice of Project Properties and Tools Options in Visual Studio 2008. &lt;a href="http://hellmund.dk/VS08settings.zip"&gt;http://hellmund.dk/VS08settings.zip&lt;/a&gt; &lt;/div&gt;&lt;div&gt;My values in Project Properties -&gt; Linker -&gt; Input -&gt; Additional Dependencies:&lt;/div&gt;&lt;div&gt;imsl.lib imslsuperlu.lib imslhpc_l.lib imsls_err.lib imslmpistub.lib mkl_c.lib mkl_ia32.lib libguide.lib&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;When I use IMSL procedures I have the following statement in my .F90 files&lt;br /&gt;INCLUDE 'link_fnl_static.h'&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Any comments on how to use Intel IPP and MPI would be nice!&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;a href="http://bp2.blogger.com/_ExHzeE2mpA0/R-rWU-MzC5I/AAAAAAAAAA0/8CCF4YLFCrM/s1600-h/ToolsOpts1.png"&gt;&lt;/a&gt;&lt;a href="http://bp3.blogger.com/_ExHzeE2mpA0/R-rWVOMzC6I/AAAAAAAAAA8/FwD6G-fiG-s/s1600-h/ToolsOpts_incsetup.png"&gt;&lt;/a&gt;&lt;a href="http://bp1.blogger.com/_ExHzeE2mpA0/R-rWVuMzC9I/AAAAAAAAABU/kC9xOoC9ODo/s1600-h/ProjectProps2.png"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9054026884791139362-5100833206687823119?l=hellmund.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='enclosure' type='' href='http://hellmund.dk/VS08settings.zip' length='0'/><link rel='replies' type='application/atom+xml' href='http://hellmund.blogspot.com/feeds/5100833206687823119/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9054026884791139362&amp;postID=5100833206687823119' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/5100833206687823119'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/5100833206687823119'/><link rel='alternate' type='text/html' href='http://hellmund.blogspot.com/2008/03/vista-visual-studio-2008-intel-suite.html' title='Vista, Visual Studio 2008, Intel Suite and IMSL'/><author><name>Gunnar</name><uri>http://www.blogger.com/profile/04154797491171625471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/-gRYZF9dIdts/TuKAJg8pAtI/AAAAAAAAAIM/49RkJ0hCyJc/s220/GunnarHellmund.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9054026884791139362.post-5957539575990387022</id><published>2008-03-09T21:45:00.006+01:00</published><updated>2008-03-09T23:06:34.143+01:00</updated><title type='text'>Introduction to Bayesian Scientific Computing</title><content type='html'>D. Calvetti &amp;amp; E. Somersalo, Springer (2007),  is a nice little book, with a remarkable good preface.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here's some quotes:&lt;br /&gt;&lt;br /&gt;"The nature of mathematics is being exact, and its exactness is underlined by the formalism used by mathematicians to write it. This formalism, characterized by theorems and proofs, and syncopated with occasional lemmas, remarks and corollaries, is so deeply ingrained that mathematicians feel uncomfortable when the pattern is broken, to the point of giving the impression that the attitude of mathematicians towards the way mathematics should be written is almost moralistic. There is a definition often quoted, "A mathematician is a person who proves theorems", and a similar, more alchemistic one, credited to Paul Erdös, but more likely going back to Alfréd Rényi, stating that "A mathematician is a machine that transforms coffee into theorems" (Footnote: That said, academic mathematics departments should invest on high quality coffee beans and decent coffee makers, in hope of better theorems. As Paul Turán, a third Hungarian mathematician, remarked, "weak coffee is fit only to produce lemmas".)&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;Therefore is seems to be the form, not the content, that characterizes mathematics, similarly to what happens in any formal moralistic code wherein form takes precedence over content.&lt;/strong&gt;"&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;On the reason why they do not use the formal framework of theorems and lemmas:&lt;br /&gt;"&lt;strong&gt;&lt;em&gt;when obsessed with a formal language that is void of ambiguities, one loses the capability of expressing emotions exactly, while by liberating the language and making it vague, one creates space for the most exact of all expressions, poetry&lt;/em&gt;&lt;/strong&gt;. Thus the exactness of expression is beyond the language. We feel the same way about mathematics."&lt;br /&gt;&lt;br /&gt;"Mathematics is a wonderful tool to express liberally such concepts as qualitative subjective beliefs, but by trying to formalize too strictly how to express them, we may end up creating beautiful mathematics that has a life of its own, in its own academic environment, but which is completely estranged to what we initially set forth."&lt;br /&gt;&lt;br /&gt;It cites Peter Lax on the occasion of his receiving the 2005 Abel Prize: "When a mathematician says he has solved the problem he means he knows the solution exits, that it's unique, but very often not much more."&lt;br /&gt;&lt;br /&gt;"By following the principle of exclusion and subjective learned opinions, we effectively narrow down the probability distributions of the model parameters so that the model produced plausible results. This process is cumulative: when new information arrives, old information is not rejected, as is often the case in the infamous "model fitting by parameter tweaking", but included as prior information. This mode of building models is not only Bayesian, but also Popperian in the wide sense: data is used to falsify hypotheses thus leading to the removal of impossible events or to assigning them as unlikely, rather than to verify hypotheses, which is in itself a dubious project. (Footnote: See A. Tarantola: Inverse problems, Popper and Bayes, Nature Physics 2, 492-492, (2006)) As the classic philosophic argument goes, producing one white swan, or , for that matter, three, does not prove the theory that all swans are white."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9054026884791139362-5957539575990387022?l=hellmund.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.springer.com/math/cse/book/978-0-387-73393-7' title='Introduction to Bayesian Scientific Computing'/><link rel='replies' type='application/atom+xml' href='http://hellmund.blogspot.com/feeds/5957539575990387022/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9054026884791139362&amp;postID=5957539575990387022' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/5957539575990387022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/5957539575990387022'/><link rel='alternate' type='text/html' href='http://hellmund.blogspot.com/2008/03/introduction-to-bayesian-scientific.html' title='Introduction to Bayesian Scientific Computing'/><author><name>Gunnar</name><uri>http://www.blogger.com/profile/04154797491171625471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/-gRYZF9dIdts/TuKAJg8pAtI/AAAAAAAAAIM/49RkJ0hCyJc/s220/GunnarHellmund.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9054026884791139362.post-1474573048221816986</id><published>2007-11-26T01:51:00.000+01:00</published><updated>2007-11-26T01:59:42.147+01:00</updated><title type='text'>C programming and R</title><content type='html'>Check out the slides on this page&lt;br /&gt;&lt;a href="http://www.biostat.wisc.edu/~kbroman/teaching/"&gt;http://www.biostat.wisc.edu/~kbroman/teaching/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Karl Broman offers some great advice considering programming in C for use with R amongst other things.&lt;br /&gt;A good and short beginners guide.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9054026884791139362-1474573048221816986?l=hellmund.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hellmund.blogspot.com/feeds/1474573048221816986/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9054026884791139362&amp;postID=1474573048221816986' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/1474573048221816986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/1474573048221816986'/><link rel='alternate' type='text/html' href='http://hellmund.blogspot.com/2007/11/c-programming-and-r.html' title='C programming and R'/><author><name>Gunnar</name><uri>http://www.blogger.com/profile/04154797491171625471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/-gRYZF9dIdts/TuKAJg8pAtI/AAAAAAAAAIM/49RkJ0hCyJc/s220/GunnarHellmund.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9054026884791139362.post-6645208108643595684</id><published>2007-11-03T15:55:00.000+01:00</published><updated>2007-11-09T11:32:07.200+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Fortran'/><category scheme='http://www.blogger.com/atom/ns#' term='dll'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>How to use Fortran95 code in R</title><content type='html'>Aim: Write a small test subroutine in Fortran using basic functionality and some calls to the International Mathematics and Statistics Library (IMSL) - compile a dll and call the subroutine from R taking some memory allocation problems into account.&lt;br /&gt;&lt;br /&gt;Prerequisites: A working installation of Microsoft Visual Studio and Intel Fortran Compiler v.10 w. IMSL and R 2.6&lt;br /&gt;&lt;a href="http://www.intel.com/support/performancetools/libraries/mkl/win/sb/CS-028372.htm"&gt;This link&lt;/a&gt; may also be useful.&lt;br /&gt;&lt;br /&gt;Save the following code as test.f90 in C:\Fortrancode&lt;br /&gt;&lt;br /&gt;!---begin code---&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;subroutine test(M,N,S1,V,NU,S2,D,INVX)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;!DEC$ ATTRIBUTES DLLEXPORT :: test&lt;br /&gt;!Routines necessary for BSKS,&lt;br /&gt;!used in calculation of&lt;br /&gt;!modified Bessel Function of second kind&lt;br /&gt;use BSKS_INT&lt;br /&gt;use UMACH_INT&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;!We use linear_operators for elegant&lt;br /&gt;!basic linear algebra syntax&lt;br /&gt;use linear_operators&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;implicit none&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;!input:&lt;br /&gt;!V vector with values used as input in Bessel fct.&lt;br /&gt;!M number of numbers in vector V&lt;br /&gt;!XDUM matrix with dimensions (M,N)&lt;br /&gt;!D dimension of dummy square matrix MX&lt;br /&gt;!NU fractional order used in calculation of&lt;br /&gt;!value of Bessel fct. modulo 1. Must be positive.&lt;br /&gt;integer, intent(in) :: M,N,D&lt;br /&gt;double precision, intent(in) :: NU, V(M)&lt;br /&gt;double precision :: INVX((D*D)), MX(D,D), XDUM(M,N)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;!output:&lt;br /&gt;!S1 sum of elements in XDUM&lt;br /&gt;!S2 values of Bessel fct.&lt;br /&gt;!INVX is both an input and an output vector,&lt;br /&gt;!converted to a square matrix of dim. D&lt;br /&gt;!the inverse is calculated and returned as INVX&lt;br /&gt;double precision, intent(out) :: S1,S2(M)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;!some dummy variables&lt;br /&gt;integer :: i,j,k&lt;br /&gt;double precision :: XX, BS(N)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;!Set all M*N elements in XDUM to 0.5&lt;br /&gt;XDUM=0.5&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;!Sum all elements in XDUM and return the result to S1&lt;br /&gt;S1=sum(XDUM)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;!Calculation of Bessel fct. values&lt;br /&gt;!corresponding to order NU+N and the&lt;br /&gt;!M different arguments found in V.&lt;br /&gt;!The M results are returned in S2.&lt;br /&gt;do i = 1, M&lt;br /&gt;XX=V(i)&lt;br /&gt;call BSKS (NU, XX, N, BS)&lt;br /&gt;S2(i)=BS(N)&lt;br /&gt;end do&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;!Transform the INVX vector into a D*D array, store result in MX&lt;br /&gt;!Note use of forall - which is a fast alternative to a&lt;br /&gt;!ordinary for loop.&lt;br /&gt;forall (i =1:D, j=1:D)&lt;br /&gt;MX(i,j)=INVX(i+(j-1)*D)&lt;br /&gt;end forall&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;!Calculate inverse of MX&lt;br /&gt;MX = .i. MX&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;!and return result in INVX&lt;br /&gt;forall (i =1:D, j=1:D)&lt;br /&gt;INVX(i+(j-1)*D)=MX(i,j)&lt;br /&gt;end forall&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;end subroutine test&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;!---end code---&lt;br /&gt;&lt;br /&gt;Run Microsoft Visual Studio as administrator&lt;br /&gt;Choose File -&gt; New Project&lt;br /&gt;Select Intel(R) Fortran -&gt; Library&lt;br /&gt;and click on Dynamic-link library&lt;br /&gt;Then give the project a name (test) and click OK&lt;br /&gt;In the right hand side frame in the Visual Studio main window right-click on Source Files&lt;br /&gt;Choose Add -&gt; Existing Item...&lt;br /&gt;Browse and select the test.f90 file and click OK&lt;br /&gt;&lt;br /&gt;Project-&gt; Properties&lt;br /&gt;Select Fortran-&gt;Optimization&lt;br /&gt;Set Optimization to Maximize Speed&lt;br /&gt;Select Fortran-&gt;Data&lt;br /&gt;Set SEQUENCE Types Obey Alignment Rules to Yes (/align:sequence)&lt;br /&gt;Select Fortran-&gt;External Procedures&lt;br /&gt;Set Name Case Interpretation to Lower Case (/names:lowercase)&lt;br /&gt;and Append Underscore to External Names to Yes (\assume:underscore)&lt;br /&gt;Go to Fortran-&gt; Command Line&lt;br /&gt;Write /heap-arrays in Additional Options:&lt;br /&gt;Click OK&lt;br /&gt;&lt;br /&gt;Setting the /heap-arrays option circumvent problems when calling the subroutine from R.&lt;br /&gt;(Dummy arrays are allocated using the heap and not the stack.)&lt;br /&gt;&lt;br /&gt;Since we use routines from the IMSL library (and maybe IntelMKL) we need a few more adjustments (using 32 bit versions):&lt;br /&gt;Tools-&gt;Options...-&gt;Intel Fortran-&gt;General&lt;br /&gt;Add C:\Program Files\VNI\imsl\fnl600\IA32\include\STATIC&lt;br /&gt;to Includes: (click ... add the path to the list and click OK) and&lt;br /&gt;&lt;br /&gt;Add C:\Program Files\VNI\imsl\fnl600\IA32\lib&lt;br /&gt;to Libraries: and Executables:&lt;br /&gt;In Project-&gt;Properties-&gt;Linker-&gt;Input&lt;br /&gt;in the "Additional Dependencies" line, add the following IMSL libraries and Intel MKL library according to your requirement (I highlighted the ones I use):&lt;br /&gt;Static link for 32 bit application: imsl.lib imslsuperlu.lib imslhpc_l.lib imsls_err.lib imslmpistub.lib mkl_c.lib libguide.lib Dynamic link for 32 bit application:&lt;span style="color:#3366ff;"&gt; &lt;strong&gt;imslmkl_dll.lib mkl_c_dll.lib libguide40.lib&lt;/strong&gt;&lt;/span&gt; Static link Intel 64 bit application: imsl.lib imslsuperlu.lib imslscalar.lib mkl_em64t.lib libguide.lib imsls_err.lib imslmpistub.lib Dynamic link Intel 64 bit application: imslmkl_dll.lib mkl_dll.lib libguide40.lib&lt;br /&gt;In Linker -&gt;Command&lt;br /&gt;write /force:multiple in Additional Options:&lt;br /&gt;&lt;br /&gt;In the main window change the option above the file editor frame from Debug to Release&lt;br /&gt;&lt;br /&gt;Choose Build -&gt; Build test (and wait)&lt;br /&gt;The file test.dll should now be available in&lt;br /&gt;C:\Users\hellmund\Documents\Visual Studio 2005\Projects\test\test\Release&lt;br /&gt;(if your Windows username is hellmund)&lt;br /&gt;&lt;br /&gt;In Intel Fortran Compiler version 10 it is not possible to change the default selection of a multi-threaded runtime library to a single-threaded. We thus have to provide som dlls in order to use our test.dll with dyn.load in R.&lt;br /&gt;Copy the files libifcoremd.dll and libmmd.dll from C:\Program Files\Intel\Compiler\Fortran\10.0.025\IA32\Lib to&lt;br /&gt;C:\Fortrancode&lt;br /&gt;&lt;br /&gt;I have used the following R-code to call the subroutine.&lt;br /&gt;When writing R-code, I prefer the editor Tinn-R&lt;br /&gt;&lt;br /&gt;#begin code&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;#Load the dll file&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;dyn.load("C:/Fortrancode/test.dll");&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;#Is the dll file loaded?&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;is.loaded("test");&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;#Set some parameters&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;M=100000;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;V=sqrt(1:M);&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;D=3;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;INVX=matrix(c(1,2,3,4,1,6,7,8,1),ncol=3,byrow=F);&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;N=5;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;S1=0.0;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;NU=0.5;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;S2=rep(0,M);&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;#Call the routine&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;F=.Fortran("test",as.integer(M),as.integer(N),as.double(S1),as.double(V),as.double(NU),as.double(S2),as.integer(D),as.double(INVX))&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;#See the output&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;F[[3]]&lt;br /&gt;F[[6]][1:10]&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;F[[8]]&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;#Check the inversion of the matrix INVX&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;solve(INVX)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;&lt;/span&gt;&lt;br /&gt;#end code&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9054026884791139362-6645208108643595684?l=hellmund.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hellmund.blogspot.com/feeds/6645208108643595684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9054026884791139362&amp;postID=6645208108643595684' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/6645208108643595684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9054026884791139362/posts/default/6645208108643595684'/><link rel='alternate' type='text/html' href='http://hellmund.blogspot.com/2007/11/how-to-use-fortran95-code-in-r.html' title='How to use Fortran95 code in R'/><author><name>Gunnar</name><uri>http://www.blogger.com/profile/04154797491171625471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/-gRYZF9dIdts/TuKAJg8pAtI/AAAAAAAAAIM/49RkJ0hCyJc/s220/GunnarHellmund.jpg'/></author><thr:total>2</thr:total></entry></feed>
