- 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 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
package main | |
import ( | |
"flag" | |
"fmt" | |
"golang.org/x/net/context" | |
"os" | |
"os/user" | |
"path/filepath" |
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
package main | |
import ( | |
A "github.com/jbenet/go-multihash" | |
B "gx/ipfs/QmYf7ng2hG5XBtJA3tN34DQ2GUN5HNksEw1rLDkmr6vGku/go-multihash" | |
) | |
func main() { | |
a := A.Multihash(nil) | |
b := B.Multihash(nil) |
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 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 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 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 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 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 cairo | |
from math import pi | |
from gi.repository import Gtk, Gdk | |
class CairoGtkWidget(Gtk.DrawingArea): | |
def __init__(self): | |
Gtk.DrawingArea.__init__(self) | |
# Theming Information (so cairo widgets look natural) |
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/env python | |
# encoding: utf-8 | |
import sys | |
import os | |
def finish(data_set): | |
base_names = {} | |
for dup in data_set: |