Compile MATLAB functions in C and link them with Intel MKL CBLAS

The MATLAB utility “mex” (enter “help mex” in command window in MATLAB) is a wrapper for your actual compiler, like gcc. It does not support intels icc. But this is no reason not to use the Intel MKL libraries! Write your code and compile it with: mex cpuMatrixCBLAS.c -I/opt/intel/Compiler/11.1/069/mkl/include/ -L/opt/intel/Compiler/11.1/069/mkl/lib/em64t /opt/intel/Compiler/11.1/069/mkl/lib/em64t/libmkl_solver_lp64_sequential.a -Wl,–start-group /opt/intel/Compiler/11.1/069/mkl/lib/em64t/libmkl_intel_lp64.a /opt/intel/Compiler/11.1/069/mkl/lib/em64t/libmkl_sequential.a /opt/intel/Compiler/11.1/069/mkl/lib/em64t/libmkl_core.a… Continue reading Compile MATLAB functions in C and link them with Intel MKL CBLAS

start MATLAB in command line mode from bash/linux console

Sometimes I want to start matlab without having the (lame) X interface. Instead of, I just use the command line. For this purpose, just run: matlab -nodisplay Or even easier, by adding a small script in /$MATLAB_HOME/bin maybe named “matlabnoX” with the content above. Make sure to chmod the file such that it is runnable!

Sort collections in java

Usual problem: When you pass a java list to Collections.sort(List list), the elements are sorted according to their returned values retrieved by calling the objects compareTo() methods. Well, what to do if you suddenly want to sort the same list by another criteria? Then a comparator is your friend.  A comparator knows how to compare… Continue reading Sort collections in java

Restart tomcat (the rude way)

To restart tomcat, fill the following two lines in a .sh file and make it executable (chmod +x [filename]): killall -s 9 java /[tomcat installation folder]/bin/startup.sh Warning: It kills all other java processes as well!

Use ETH SMS service for sending texts abroad

The following simple website demonstratates how to send texts using the free SMS service of the ETH (you need to be member of). The core task of the website is to send a HTTP post request to the following website: https://www.sms.ethz.ch/cgi-bin/sms/send.pl The documentation is found here: https://www.sms.ethz.ch/sms/simpledescription.htm The header data consists out of your ETH… Continue reading Use ETH SMS service for sending texts abroad

get sun java on debian based system

just type: sudo add-apt-repository “deb http://archive.ubuntu.com/ubuntu hardy main multiverse” sudo add-apt-repository “deb http://archive.ubuntu.com/ubuntu hardy-updates main multiverse” sudo add-apt-repository “deb http://archive.canonical.com/ lucid partner” sudo apt-get update sudo apt-get install sun-java6-jdk

xsl transform template for php5

// path to the xml document (may be url) $xml = “data.xml”; // path to the xsl document (may be url) $xsl = “transformation.xsl”; $xslDoc = new DOMDocument(); $xslDoc->load($xsl); $xmlDoc = new DOMDocument(); $xmlDoc->load($xml); $proc = new XSLTProcessor(); $proc->importStylesheet($xslDoc); echo $proc->transformToXML($xmlDoc);