Skip to content

Instantly share code, notes, and snippets.

@hG3n
hG3n / python_color
Created February 28, 2016 16:28
print colorful in python
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
@hG3n
hG3n / process_timer.cpp
Last active January 16, 2016 14:18
this is a short snippet to remind how one can calculate time needed by one process
#include <iostream>
#include <ctime>
#include <vector>
#include <algorithm>
int main() {
// create vector for storing the calculated times needed for a piece of code to finish
std::vector<float> times;
int counter = 0;
@hG3n
hG3n / .vimrc
Last active November 19, 2023 14:31
vim config file
"""""""""""""""""""""""
"--- !! VUNDLE !! --- "
"""""""""""""""""""""""
set shell=/bin/bash
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
@hG3n
hG3n / main.py
Last active November 26, 2015 21:53
bachelor snippet
#!/usr/bin/env python
import sys
import numpy as np
import cv2 as cv
class Subimage:
def __init__(self, TL, BR):
self.tl = TL
self.br = BR
@hG3n
hG3n / structure.txt
Last active October 20, 2015 18:41
bachelor thesis structure
Echtzeit Hinderniserkennung für unbemannte Flugsysteme unter Benutzung eines Stereo Kamera Systems
1. Einführung
1.1 Motivation
1.2 Setup
1.3 Ziel der Arbeit
2. Anforderungsanalyse
2.1 Bildaufnahme und Preprocessing
2.2 Erfassung von Hindernissen
@hG3n
hG3n / rights
Created October 11, 2015 11:18
short reminder on how to make shell applications run without explicitly using sudo
chmod 6555 $application
sudo chown root $application
@hG3n
hG3n / convertCoord1d2d.cpp
Created September 1, 2015 16:50
two little functions converting either 2d into 1d or 1d into 2d coordinates
cv::Point index2Coord(int index)
{
int x = index % width;
int y = index / width;
return cv::Point(x,y);
}
int coord2Index(int x, int y)
{
return x + width*y;
@hG3n
hG3n / matType2str.cpp
Created June 27, 2015 17:49
function to print the type of a matrix by passing Mat.type() as argument
std::string type2str(int type) {
std::string r;
uchar depth = type & CV_MAT_DEPTH_MASK;
uchar chans = 1 + (type >> CV_CN_SHIFT);
switch ( depth ) {
case CV_8U: r = "8U"; break;
case CV_8S: r = "8S"; break;
case CV_16U: r = "16U"; break;
@hG3n
hG3n / Default.sublime-theme
Created June 20, 2015 15:21
slightly adjusted Default Theme for Sublime-Text, features dark sidebar and filebrowser
[
{
"class": "label_control",
"color": [255, 255, 255],
"shadow_color": [24, 24, 24],
"shadow_offset": [0, -1]
},
{
"class": "button_control",
"content_margin": [6, 5, 6, 6],
@hG3n
hG3n / assignment.sty
Created May 11, 2015 14:16
latex config for assignment
%!TEX encoding = UTF-8 Unicode
\documentclass[a4paper,parskip,DIV15]{scrartcl}
\usepackage[utf8]{inputenc}
% \usepackage[utf8x]{inputenc}
\usepackage[ngerman]{babel}
% pretty fonts
\usepackage[T1]{fontenc}
\usepackage[defaultsans, scale=0.9]{lato}