Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am salzig on github.
  • I am salzig (https://keybase.io/salzig) on keybase.
  • I have a public key whose fingerprint is CD9D 2123 9FFA 5593 1E16 92F1 D770 F3C0 0283 C6AA

To claim this, I am signing this object:

@salzig
salzig / _.md
Created June 2, 2013 15:55
HAW - Next Media - Tile Rechnerei
@salzig
salzig / _.md
Created May 22, 2013 09:58
minimal d3 area chart
@salzig
salzig / README.md
Last active December 16, 2015 05:19
TideSDK 1.3.1 http://test262.ecmascript.org/ Example Application

TideSDK 1.3.1 http://test262.ecmascript.org/ Example Application

  • Start Application
  • Click on "Run"
  • Click on "Run" right next to "Chapter - ch15 (8075 tests)"
@salzig
salzig / DES.java
Created November 12, 2012 21:34
Finde den Fehler O.o
// Copyright (C) 1998-2001 Logi Ragnarsson
import java.util.Random;
/**
* This is the class for Data Encryption Standard (DES) keys. See FIPS PUB 46-1
* or DEA defined in ANSI X3.92-1981 for a complete specification.
*
* <p>
* DES is the most widely used block cipher, although it is nowadays normally
@salzig
salzig / caja.rb
Created November 6, 2012 17:21
Kleiner en/de-coder für Caja
# coding: utf-8
# Beispiel:
# > Caja.encode("Hallo Welt, es ist 13 Uhr")
# > Caja.decode(Caja.encode("Hallo Welt, es ist 13 Uhr"))
class Caja
@@table = {
"a" => "¥¥µ",
"h" => "þµ¥",
@salzig
salzig / gist:3636465
Created September 5, 2012 13:24
Oh why? O.o
> a = Hash.new(Hash.new(0))
=> {}
> a[DateTime.now.beginning_of_day]["abc"] = 13
=> 13
> a[DateTime.now.beginning_of_day]["abc"]
=> 13
> a[DateTime.now.beginning_of_day]
@salzig
salzig / time.scala
Created April 25, 2012 08:48
Scala Time
package time
object App {
def main(args:Array[String]) {
import TimeImplicit._
println(10 ns)
println(20 µs)
println(30 ms)
println(40 s)
@salzig
salzig / aufgabe5.scala
Created April 24, 2012 21:50
Scala Aufgabe 5
package aufgabe5
class Matrix[T](val xDim:Int, val yDim:Int, protected val data:Array[T])(implicit num : Numeric[T], m : Manifest[T]) {
val numeric = num
val manifest = m
def apply(x:Int, y:Int):T =
if (x < 0 || x >= xDim || y < 0 || y >= yDim)
numeric.zero
else
class Matrix[T: Numeric: Manifest](val xDim:Int, val yDim:Int, private val data:Array[T]) {
require(data.size == xDim*yDim, "provided data dosn't match required dimensions")
val numeric = implicitly[Numeric[T]]
val manifest:Manifest[T] = implicitly
//...
override def toString = "Matrix[%s](%s)" format (manifest, data.grouped(xDim).map( "(%s)" format _.mkString(", ") ).mkString(", "))
}
object Matrix {