Skip to content

Instantly share code, notes, and snippets.

View niklasfi's full-sized avatar

Niklas Fischer niklasfi

View GitHub Profile
@niklasfi
niklasfi / main.cpp
Created April 20, 2011 15:52
matrix.cpp
#include "main.h"
Matrix f(const Matrix& in){
double x = in(0,0);
double y = in(0,1);
Matrix m(2,1);
m[0][0] = x - y*y + 3 * log(abs(x));
m[1][0] = 2*x*x-x*y-5*x+1;
Matrix f(const Matrix& in){
double x = in(0,0);
double y = in(0,1);
Matrix m(2,1);
m[0][0] = x - y*y + 3 * log(abs(x));
m[1][0] = 2*x*x-x*y-5*x+1;
return m;
@niklasfi
niklasfi / gist:924472
Created April 17, 2011 21:06
unzip :(
niklas@niklas-MS-7586:~/develop/c++/mu/ws01/training$ wget http://www-i6.informatik.rwth-aachen.de/web/Teaching/LabCourses/SS11/Softwareprojektpraktikum/daten/e
--2011-04-17 23:05:03-- http://www-i6.informatik.rwth-aachen.de/web/Teaching/LabCourses/SS11/Softwareprojektpraktikum/daten/e
Auflösen des Hostnamen »www-i6.informatik.rwth-aachen.de«.... 137.226.36.140
Verbindungsaufbau zu www-i6.informatik.rwth-aachen.de|137.226.36.140|:80... verbunden.
HTTP Anforderung gesendet, warte auf Antwort... 200 OK
Länge: 4156140 (4,0M) [text/plain]
In »»e«« speichern.
100%[===============================================================================================================================================>] 4.156.140 390K/s in 10s
@niklasfi
niklasfi / gist:920708
Created April 14, 2011 22:22
quicksort
#include <iostream>
typedef unsigned int uint;
void swap(uint& a, uint& b){
a^=b; b^=a; a^=b;
}
void quicksort(int lbound, int rbound, uint* f){
if(lbound>=rbound) return;
298418@rogers:~> host=`hostname` && [[ $host -eq "rogers" ]] && echo "true" || echo "false" && echo $host
true
rogers
298418@rogers:~> host=`hostname` && [[ $host -eq "roger" ]] && echo "true" || echo "false" && echo $host
true
rogers
root@vs1145146:/var/www/node-gallery/exiv2node# node-waf configure build
Setting srcdir to : /var/www/node-gallery/exiv2node
Setting blddir to : /var/www/node-gallery/exiv2node/build
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /usr/local
@niklasfi
niklasfi / hello.js
Created March 22, 2011 21:59
hello.cc
var import = require('./build/default/hello.node')
console.log('import.hello: ' + import.hello)
//logs: "import.hello: world"
@niklasfi
niklasfi / gist:878299
Created March 20, 2011 12:09
bash log
root@vs1145146:/var/www/node-gallery# cd exiv2node/
root@vs1145146:/var/www/node-gallery/exiv2node# node-waf configure && node-waf build
Setting srcdir to : /var/www/node-gallery/exiv2node
Setting blddir to : /var/www/node-gallery/exiv2node/build
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
niklas@niklas-MS-7586:/var/www$ ls -l
insgesamt 16
-rw-r--r-- 1 www-data www-data 177 2011-03-09 13:09 index.html
-rw-r--r-- 1 www-data www-data 3569 2011-02-01 21:54 index.lighttpd.html
drwxr-xr-x 2 www-data www-data 4096 2011-03-09 13:15 nginx-default
drwxrwxr-x 2 www-data www-data 4096 2011-03-09 21:56 phunky
niklas@niklas-MS-7586:/var/www$ ls -l phunky/
insgesamt 7684
-rw-rw-r-- 1 www-data www-data 148 2011-03-09 21:45 add_big.gif
-rw-rw-r-- 1 www-data www-data 87 2011-03-09 21:45 add.gif
%a{href: "/index/" + f.filename}
%h1.title = f.title
' vom '
= f.start.getDate()
'.'
= f.start.getMonth()
...
%sup
= (f.avi ? 'DivX ' : '')
= (!f.otrkey ? 'unverschlüsselt ': '')