Skip to content

Instantly share code, notes, and snippets.

@wadoon
wadoon / mima.c
Last active December 18, 2022 23:40
#include <assert.h>
#include <stdint.h>
#include <stdbool.h>
/*
OpCode mnemonik Description
0 LDC c c ⟶ Acc
1 LDV a < a > ⟶ Acc
2 STV a Acc ⟶ < a >
3 ADD a Acc + < a > ⟶ Acc
#!/bin/bash
echo "Review Script."
REVIEW_BASE=${REVIEW_BASE:-master}
if [ ! -z $1 ]; then
git switch $1 || exit 1
fi
/*@ normal_behaviour
@ requires true;
@ ensures \result <==> (\exists int i; 0 <= i && i < arr.length; arr[i] != id);
@ assignable \strictly_nothing;
@*/
private boolean contains(int[] arr, int id) {
/*@ loop_invariant (\forall int k; 0 <= k && k < i; arr[k] != id);
@ loop_invariant 0 <= i && i <= arr.length + 1;
@
@ decreases arr.length - i;
@wadoon
wadoon / key.sublime-syntax
Created February 20, 2020 16:01
Syntax Highlighting for Key files usable by bat
%YAML 1.2
---
name: KeY
file_extensions: [key]
scope: source.key
contexts:
main:
- match: '"'
scope: punctuation.definition.string.begin
@wadoon
wadoon / javajml.sublime-syntax
Created February 20, 2020 16:00
Syntax Highlighting for Java+JML
%YAML 1.2
---
name: JavaJml
file_extensions:
- java
- jml
scope: source.java
contexts:
@wadoon
wadoon / README.md
Last active December 4, 2018 11:34 — forked from EronWright/README.md
Simple Maven repository hosted on Apache httpd web server

Simple Maven Repository

Hosting a shared Maven repository on a remote server may be accomplished with a simple web server such as Apache HTTP server. This works because most of the resolution and publishing logic of Maven is implemented in the client.
By using a small helper, this solution works fully automatically.

Caution: this example exposes a writable directory without any authentication. You need protect the PUT method via the apache configuration.

Configure Apache HTTP

@wadoon
wadoon / Checkstyle.xml
Created November 24, 2016 17:41
Maven Snippets
https://maven.apache.org/plugins/maven-checkstyle-plugin/
<project>
...
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
@wadoon
wadoon / barycentric_coordinates_drawer.py
Created October 11, 2015 19:19
Drawing barycentric coordinates with Python. n-edge polyon and a point is describes by 0 <= v_i <= 1, sum(v_i) = 1, 0 < i <= n
#!/usr/bin/python
from PIL import Image, ImageDraw
from math import cos, sin, pi,log
class BarycentricImage(object):
def __init__(self, n=3, size=(400,400)):
self.dims = n
self.size = size
@wadoon
wadoon / kitcolors.css
Created October 11, 2015 19:17
CSS for KIT Colors
.bg-kit-blue { background: rgb(70,100,170) }
.bg-kit-blue-100 { background: rgb(70,100,170) }
.bg-kit-blue-70 { background: rgb(125,146,195) }
.bg-kit-blue-50 { background: rgb(162,177,212) }
.bg-kit-blue-30 { background: rgb(199,208,229) }
.bg-kit-blue-15 { background: rgb(227,231,242) }
.fg-kit-blue { color: rgb(70,100,170) }
.fg-kit-blue-100 { color: rgb(70,100,170) }
.fg-kit-blue-70 { color: rgb(125,146,195) }
.fg-kit-blue-50 { color: rgb(162,177,212) }
@wadoon
wadoon / msmlrepository.cfg
Last active August 29, 2015 14:12
Template for MSML User Repository
# GPLv3, 2015-01-03, Alexander Weigl, Version 0.1
repo_layout_version: 1
msml_version: 1
packages: