Skip to content

Instantly share code, notes, and snippets.

Avatar

Stefan 0xLeon

  • Siemens AG
  • Berlin, Germany
View GitHub Profile
@0xLeon
0xLeon / PizzaService.java
Created Nov 25, 2012
PizzaService Class for PSE homework
View PizzaService.java
import java.util.HashMap;
/**
* @author Stefan
*/
public class PizzaService {
public double calculatePizzaCost(int numberOfPizza, String typeOfPizza) throws IllegalArgumentException {
double[] extraCost = {4.3, 3.75, 2.5, 1.75};
HashMap<String, Number> typeToIndex = new HashMap<String, Number>();
@0xLeon
0xLeon / GUIExercise.java
Last active Dec 10, 2015
Swing exercise which creats an application with a window, a label and three buttons which align the window on the screen's center, open an new window and close the window.
View GUIExercise.java
package com.leon.uni;
import java.awt.Component;
import java.awt.EventQueue;
import java.awt.GraphicsEnvironment;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
@0xLeon
0xLeon / Date.java
Last active Dec 16, 2015
Custom Date Class, v2013.5.30.20.25
View Date.java
package com.leon.hfu.customDate;
import java.util.Calendar;
/**
* Custom date class containing methods for date calculation.
*
* @author Stefan Hahn
*/
public class Date implements Comparable<Date> {
@0xLeon
0xLeon / Main.java
Last active Dec 17, 2015
Vacation Home Handling, v2013.5.30.20.18
View Main.java
package com.leon.hfu.vacationHomeCalculation;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Vector;
import com.leon.hfu.customDate.Date;
import com.leon.hfu.customDate.DateFormatException;
/**
@0xLeon
0xLeon / Bubble.pde
Created Jul 4, 2013
Bubbles Processing
View Bubble.pde
class Bubble {
float x = random(0, width);
float y = height;
void zeichnung() {
fill(0, 200, 220);
stroke(0, 127, 220);
ellipse(x, y, 20, 20);
}
@0xLeon
0xLeon / RainbowMode.js
Created Apr 17, 2016
RainBow Mode module for BCPlus
View RainbowMode.js
Modules.RainbowMode = (function() {
var bcplus = null;
var initialize = function(_bcplus) {
bcplus = _bcplus;
buildUI();
addEventListeners();
};
@0xLeon
0xLeon / bitmaps.c
Last active May 23, 2016
Performance optimized graphics functions based on Teensy library for CAB202
View bitmaps.c
unsigned char bm_face_happy[] = {
0b11111111, 0b11111111,
0b00000001, 0b10000000,
0b00000001, 0b10000000,
0b00000001, 0b10000011,
0b00110001, 0b10000100,
0b00110001, 0b10001000,
0b00000001, 0b10001000,
0b00000001, 0b10001000,
@0xLeon
0xLeon / SeenLive.txt
Last active Oct 20, 2022
Bands I've seen live
View SeenLive.txt
10x Stick to Your Guns
9x Caliban
7x Heaven Shall Burn
6x Deadlock
6x Neaera
6x Parkway Drive
6x Terror
5x Darkest Hour
5x Emmure
5x The Ghost Inside
@0xLeon
0xLeon / DECSCA-Validation.mag
Last active Feb 10, 2018
Magma Script validating the German CSCA self-signed certificate using ECDSA
View DECSCA-Validation.mag
// Prime Field Size
p := 0x8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123ACD3A729901D1A71874700133107EC53;
// Curve Parameter One
a := 0x7BC382C63D8C150C3C72080ACE05AFA0C2BEA28E4FB22787139165EFBA91F90F8AA5814A503AD4EB04A8C7DD22CE2826;
// Curve Parameter Two
b := 0x04A8C7DD22CE28268B39B55416F0447C2FB77DE107DCD2A62E880EA53EEB62D57CB4390295DBC9943AB78696FA504C11;
// Cofactor
h := 0x01;
// Curve Base Point X
@0xLeon
0xLeon / calibrate.py
Created May 17, 2018
Improved Python camera calibration script using OpenCV
View calibrate.py
#!/usr/bin/env python3
import argparse
import glob
import multiprocessing.dummy
import os
import sys
import cv2 as cv
import numpy as np