Skip to content

Instantly share code, notes, and snippets.

@Beneboe
Beneboe / footer.css
Last active December 11, 2015 15:29
Makes the footer stick to the bottom of the page, even if the content doesn't fill the screen
@Beneboe
Beneboe / Keyinput.js
Created January 29, 2013 19:22
comes in handy when working with html5 canvas
var keyPressed;
document.onkeyup = function(event) {
keyPressed = String.fromCharCode(('which' in event) ? event.which : event.keyCode);
input();
};
function input() {
if(keyPressed == "D") document.write("hi");
}
@Beneboe
Beneboe / countdown.js
Created January 29, 2013 20:00
Flexible countdown that can find out the countdown time automatically
function countdowntimer(element, secs) {
var i = (secs) ? secs : element.innerHTML;
var t1 = setInterval(function() {
if(i != 0){
i--;
}
else{
clearInterval(t1);
//timer ends here
}
<!DOCTYPE html>
<html>
<head>
<title>Turm Fort Stahlberg</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<script src></script>
</head>
<body>
@Beneboe
Beneboe / timer classes and more.js
Created February 12, 2013 12:26
testing in js
console.log("\n");
var i = 10;
function writeD(d){
document.write(d);
}
function fixDecimal(num) {
return Math.round(num * 10) / 10;
}
function Timer (milisecs, callback) {
var t;
@Beneboe
Beneboe / index.html
Created February 24, 2013 15:00
makes labels go inside an input tag
<form action="/message">
<p>
<label for="user_tel">Telephone:</label>
<input type="text" id="user_tel"><br />
</p>
<p>
<label for="user_msg">Message:</label>
<textarea name="" id="user_msg" cols="30" rows="10">
</textarea><br />
\[\033[0;36m\]\A \[\033[0;37m\][ \[\033[0;34m\]\u@\h\[\033[1;34m\] \W \[\033[0;37m\]]\$\[\033[00m\]
@Beneboe
Beneboe / Erzeugung eines Turnierplans
Created January 13, 2014 19:32
Erzeugung eines Turnierplans
def range(start, stop, step = 1):
x = start
while True:
if x >= stop: return
yield x
x += step
# Erzeugung eines Turnierplans mit n Teilnehmern
# Eingabe von n

Komplexität

Kostenanalyse

Unser Vorgehen: dominante Operation auswählen und Kosten grob ausrechnen

Problemgröße: präzise Beschreibung des Umfangs der zu verarbeitenden Daten, von dem Zeit- bzw. Speicherverhalten von Lösungsalgorithmen maßgeblich beeinflusst wird.

Kostenmaß: legt fest, in welchem Maße Operationen bei der Aufwandsbestimmung berücksichtigt werden

@Beneboe
Beneboe / treetraversal.fs
Created May 8, 2019 19:52
F# Tree traversal Test
open System
// printfn "Hello, world!"
type Tree<'a> =
| Node of Tree<'a> * Tree<'a>
| Leaf of 'a
let rec travelTree tree =
match tree with