- Ich hab eine Liste von Songs.
- Um Aussagen über deren ähnlichkeit zu machen muss ich die untereinander vergleichen. Das ergibt für N Songs ((N - 1) ^ 2 / 2) Vergleiche. Für N=32k ne ganze Menge. (Abgeschätzte Zeit wären ca. 13h, also unakzeptabel.)
This file contains hidden or 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
#!/bin/sh | |
# | |
# Shamelessly stolen from: | |
# http://www.es.ele.tue.nl/sdf3/manuals/development/files/pre-commit | |
# An example hook script to verify what is about to be committed. | |
# Called by "git commit" with no arguments. The hook should | |
# exit with non-zero status after issuing an appropriate message if | |
# it wants to stop the commit. | |
# | |
# To enable this hook, rename this file to "pre-commit". |
Es seien zwei variabel lange Listen mit variabel langen Tupeln darin:
a = [(85, 0), (190, 2), (190, 6)] b = [(85, 0), (190, 2, 0), (190, 2, 0), (190, 6)]
Die Listen sind stets sortiert, kleinste Werte zuerst. Es soll eine Distanzfunktion geschrieben werden die diese beiden Listen auf Ähnlichkeit untersucht. Diese Funktion soll eine Zahl zwischen 0.0 (volle ähnlichkeit) und 1.0 (volle divergenz) ergeben.
This file contains hidden or 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
[Core] | |
Name = Cover | |
Module = movie | |
[Documentation] | |
Description = A cover plugin | |
Author = My very own name | |
Version = 0.1 | |
Website = My very own website |
This file contains hidden or 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
/* | |
* Compile: gcc mpdsonglisten.c -o mpdsonglisten -lmpdclient -std=c99 | |
* Run: ./mpdsonglisten localhost 6600 <on_play_script> <on_stop_script> | |
* Example: ./mpdsong localhost 6600 'echo plays!' 'echo stopped!' | |
* | |
* It will call on_play_script once mpd starts playing, | |
* and on_stop_script once it pauses, stops or does something unknown. | |
* | |
* Error handling is done by ignoring none-fatal erros and trying to reconnect if | |
* fatal errors happen. |
This file contains hidden or 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
Hello Workshop |
This file contains hidden or 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/env python | |
# encoding: utf-8 | |
from gi.repository import Gtk, Gdk, GLib, Pango, PangoCairo | |
from cairo import Context, ImageSurface, RadialGradient, FORMAT_ARGB32 | |
from math import pi | |
def draw_center_text(ctx, width, height, text, font_size=15): | |
layout = PangoCairo.create_layout(ctx) |
This file contains hidden or 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
$ GDK_SYNCHRONIZE="1" gdb --args python swipe.py | |
(gdb) r | |
(gdb) bt | |
#0 0x00007ffff5b3beed in g_logv () from /usr/lib/libglib-2.0.so.0 | |
#1 0x00007ffff5b3c0d2 in g_log () from /usr/lib/libglib-2.0.so.0 | |
#2 0x00007ffff2f46e60 in ?? () from /usr/lib/libgdk-3.so.0 | |
#3 0x00007ffff2f51801 in ?? () from /usr/lib/libgdk-3.so.0 | |
#4 0x00007ffff29fd976 in _XError () from /usr/lib/libX11.so.6 | |
#5 0x00007ffff29fabc1 in ?? () from /usr/lib/libX11.so.6 | |
#6 0x00007ffff29fac05 in ?? () from /usr/lib/libX11.so.6 |
This file contains hidden or 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
import sys | |
from gi.repository import GLib, Gdk, Gtk, GtkClutter, Clutter | |
def _render_pixbuf(widget, width, height): | |
# Use an OffscreenWindow to render the widget | |
off_win = Gtk.OffscreenWindow() | |
off_win.add(widget) | |
off_win.set_size_request(width, height) |
This file contains hidden or 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
from gi.repository import GLib, Gtk, GtkClutter, Clutter, Gdk, GdkPixbuf | |
import sys | |
from random import random | |
BROWSERS = 42 | |
class ClutterBrowser(Gtk.ApplicationWindow): |