Skip to content

Instantly share code, notes, and snippets.

View lava's full-sized avatar

Benno Evers lava

  • Hamburg, Germany
View GitHub Profile
@lava
lava / gist:849292
Created March 1, 2011 15:27
GLSL Shader Test
View gist:849292
#include <string>
#include <vector>
#include <iterator>
#include <fstream>
#include <iostream>
#include <GL/gl.h>
#include <GL/glext.h>
#include <SDL/SDL.h>
@lava
lava / exercise.tex
Created March 8, 2011 11:57
CG Test Exercises
View exercise.tex
\documentclass{exam}
\begin{document}
\begin{questions}
\section{Koordinatensysteme und Geometrie}
\titledquestion{Kameramodell}
Gegeben sei eine Kamera $C$ mit Projektionszentrum ${\mathbf{e}}$, Ziel-Vektor $\mathbf{z}$ und normalisiertem Up-Vektor $\mathbf{up}$.
@lava
lava / combined_grabber.rb
Created October 3, 2011 22:29
Naive ACM Metadata Grabber
View combined_grabber.rb
require 'nokogiri'
require 'open-uri'
require 'watir-webdriver'
require './acm_issue_downloader.rb'
require './acm_base.rb'
#base class for all acm-specific html extraction functions
class ACMBase
def extract_id(url)
@lava
lava / gist:4179092
Created November 30, 2012 22:15
circle input file
View gist:4179092
100
200
0 1 1 1
1 0 1 1
1 2 1 1
2 1 1 1
2 3 1 1
3 2 1 1
3 4 1 1
4 3 1 1
@lava
lava / gist:4706289
Created February 4, 2013 11:44
Python and CPP kalman filter update
View gist:4706289
def kalman_update(state_mean, state_cov, measurement, measurement_matrix, meas_cov):
# meas_cov should be a matrix with the right dimensions
statedim = state_mean.size
x = reshape( atleast_2d(state_mean), (statedim,1) )
C = atleast_2d( state_cov )
H = atleast_2d(measurement_matrix)
y = atleast_2d(np.array(measurement))
innovation = y - dot(H,x)
View agent-recovery
Relaxed Agent state recovery
# Problem
Most experienced mesos users will have encountered the following error message:
E1103 18:30:03.451825 12204 slave.cpp:6302] EXIT with status 1: Failed to perform recovery: Incompatible agent info detected.
------------------------------------------------------------
[...]
------------------------------------------------------------
@lava
lava / minbashmaxfun.md
Last active January 11, 2018 20:56
34c3 writeup: minbashmaxfun
View minbashmaxfun.md

Writeup: minbashmaxfun

by lava & ntq

+=============================================================+
|                MINIMAL BASH - MAXIMAL FUN                   | 
|                                                             | 
|            Who needs regular characters anyway?             |
|                                                             | 
|         Supported characters: $ ( ) # ! { } < \ ' ,         |
| |
@lava
lava / nethack_armor.md
Last active June 10, 2018 04:58
Nethack armor comparison
View nethack_armor.md

Nethack armor comparison

Imagine this totally hypothetical situation: You're in a boring meeting without internet, play a round of nethack as a rogue, and come across a dwarvish mithril-coat. Should you replace your current leather armor? On the one hand, mithril sounds pretty nifty. On the other hand, it seems a bit out-of-character for a rogue to wear full plate armor, so surely there are some good reasons to keep the leather?

Luckily, you are a professional developer, so you have a local copy of the games' source code.

@lava
lava / git_merge.md
Last active November 21, 2018 13:54
Git history and merge commits
View git_merge.md

Testing the --no-ff merge strategy

I created a sample git repository by creating branches second and third adding a file with the same name each, and then rebasing the branches and merging them using git merge --no-ff:

bevers@poincare:~/code/git$ ls
initial  second  third
@lava
lava / easel_post.py
Last active April 4, 2019 17:42
Postprocessing script to make FreeCAD paths importible by Easel (WIP)
View easel_post.py
# ***************************************************************************
# * (c) Benno Evers (bennoe@apache.org) 2019 *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU Lesser General Public License (LGPL) *
# * as published by the Free Software Foundation; either version 2 of *
# * the License, or (at your option) any later version. *
# * for detail see the LICENCE text file. *