Skip to content

Instantly share code, notes, and snippets.

@migerh
migerh / example.cpp
Created December 26, 2013 11:11
stack vs heap
vector<myclass> dosomething(vector<myclass>& param) {
vector<myclass> local1, local2;
// do something with local1 and local2 based on param
param = local2;
return local1;
}
@migerh
migerh / accidental-move
Last active December 30, 2015 01:49
skmeval - first result
c_dep_bisector 56
c_dep_segment 48
c_dep_bisector_3points 25
c_dep_bisector_4points 19
c_dep_ray 17
c_dep_bisector_triangle 16
c_dep_circle2p 16
c_dep_quad 11
c_dep_midpoint 9
c_dep_midpoint_conflict 9
@migerh
migerh / libimobiledevice.PKGBUILD
Last active December 28, 2015 03:39
Patched PKGBUILDs for libimobiledevice-git and usbmuxd-git
# Maintainer: Alex Brinister <alex_brinister at yahoo dot com>
pkgname=libimobiledevice-git
pkgver=1.1.0.406.g3c3a791
pkgrel=1
pkgdesc="libimobiledevice is a software library that talks the protocols to support iPhone and iPod Touch devices on Linux"
url="http://www.libimobiledevice.org/"
arch=('i686' 'x86_64')
license=('GPL2' 'LGPL2.1')
depends=('gnutls' 'libgcrypt' 'glib2' 'libplist-git')
@migerh
migerh / benchmark-utf8.html
Created September 26, 2013 09:58
Benchmark three different versions of utf8 decode(). See https://github.com/jsxgraph/jsxgraph/issues/50 for details. newerDecode() is a translation from C99 of http://bjoern.hoehrmann.de/utf-8/decoder/dfa/.
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="http://jsxgraph.uni-bayreuth.de/~michael/jsxgui/Examples/libs/benchmark.js"></script>
</head>
<body>
<div id="output"></div>
@migerh
migerh / curve.js
Last active December 18, 2015 00:29
Patch for JXG.Curve.updateRenderer()
JXG.Curve.prototype.updateRenderer = function () {
var wasReal;
if (this.needsUpdate && this.visProp.visible) {
wasReal = this.isReal;
if (this.isReal) {
this.board.renderer.updateCurve(this);
}
@migerh
migerh / xmodmap
Created May 21, 2013 20:34
xmodmap my desktop keyboard
$ xmodmap -e 'keycode 115 = Prior'
$ xmodmap -e 'keycode 112 = Next'
$ xmodmap -e 'keycode 117 = End'
public AlgoImplicitPolyFunction(Construction c, String label,GeoFunctionNVar func) {
super(c);
function=func;
implicitPoly = new GeoImplicitPoly(cons);
setInputOutput();
compute();
implicitPoly.setLabel(label);
}
@migerh
migerh / gist:5029208
Created February 25, 2013 11:21
rfc 2822 email regex
(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])
(function () {
// code hier, variablen immer mit var anlegen
var a = 3;
}());