This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name DomJudge IP | |
// @namespace http://nullrich.de | |
// @include http://domjudge.iti.uni-karlsruhe.de/*/submissions.php* | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js | |
// ==/UserScript== | |
function deserialize(name, def) { | |
return eval(GM_getValue(name, (def || '({})'))); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/src/handlers.c | |
+++ b/src/handlers.c | |
@@ -717,6 +717,7 @@ int handle_window_type(void *data, xcb_connection_t *conn, uint8_t state, xcb_wi | |
*/ | |
static bool handle_normal_hints(void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window, | |
xcb_atom_t name, xcb_get_property_reply_t *reply) { | |
+ return true; | |
Con *con = con_by_window_id(window); | |
if (con == NULL) { | |
DLOG("Received WM_NORMAL_HINTS for unknown client\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Input-, Output-Klassen, Buffer-Properties: | |
Node.cs: | |
public class Output { | |
public Node Node; | |
public int Index; | |
public Frame Buffer; | |
} | |
public class Input { | |
public Input Source; | |
public Frame Buffer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python2.7 | |
# copy into .git/hooks | |
# dependencies: python2 dbus-python | |
import subprocess, dbus | |
room = "blub@conference.jabber.ccc.de" | |
bus = dbus.SessionBus() | |
obj = bus.get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
globalkeys = | |
... | |
-- Move all clients of active tags to next screen | |
awful.key({ modkey, "Control" }, "o", | |
function () | |
for i,t in ipairs(screen[mouse.screen]:tags()) do | |
if t.selected then | |
for j,c in ipairs(t:clients()) do | |
awful.client.movetoscreen(c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int dist(string a, string b) { | |
int n = a.length(), m = b.length(); | |
vector<int> row(m+1), prev(m+1); | |
// y == 0 | |
for (int x = 0; x <= m; x++) row[x] = x; | |
for (int y = 1; y <= n; y++) { | |
swap(prev, row); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type LinearFunc = { M : float; B : float } | |
type Point = { X : float; Y : float } | |
let sqr x = x * x | |
let frac x = x - floor x | |
let calc f x = { X = x; Y = f.M * x + f.B } | |
let plusMinus delta dx = { -delta..dx..delta } | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[<Struct>] | |
type Point (x : int, y: int) = | |
new (i : int) = Point (i,i) | |
member p.X = x | |
member p.Y = y | |
static member (+) (p : Point, q : Point) = Point (p.X + q.X, p.Y + q.Y) | |
static member (-) (p : Point, q : Point) = Point (p.X - q.X, p.Y - q.Y) | |
static member (|Point|) (p : Point) = p.X,p.Y | |
static member DistanceSqr (p : Point) (q : Point) = sqr (p.X - q.X) + sqr (p.Y - q.Y) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Expression<Func<T,V>> Bind<T, U, V>(Expression<Func<T, U>> f1, Expression<Func<U, V>> f2) | |
{ | |
var param = Ex.Parameter(typeof(T), "hi"); | |
return Ex.Lambda<Func<T, V>>( | |
Ex.Invoke(f2, | |
Ex.Invoke(f1, param)), | |
param); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Category | |
{ | |
// wiee, kein notify-Keyword :( ? | |
public string Header { get; set; } | |
public string Id { get; set; } | |
// two-way bound | |
public bool IsExpanded { get; set; } | |
public bool IsSelected { get; set; } | |
public ObservableCollection<Category> SubCategories { get; private set; } |