Skip to content

Instantly share code, notes, and snippets.

View magnusja's full-sized avatar
👨‍💻
..

magnus magnusja

👨‍💻
..
View GitHub Profile
@magnusja
magnusja / rank_metrics.py
Created July 17, 2017 23:46 — forked from bwhite/rank_metrics.py
Ranking Metrics
"""Information Retrieval metrics
Useful Resources:
http://www.cs.utexas.edu/~mooney/ir-course/slides/Evaluation.ppt
http://www.nii.ac.jp/TechReports/05-014E.pdf
http://www.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf
http://hal.archives-ouvertes.fr/docs/00/72/67/60/PDF/07-busa-fekete.pdf
Learning to Rank for Information Retrieval (Tie-Yan Liu)
"""
import numpy as np
@magnusja
magnusja / gen_mongooseim_scram.py
Last active February 26, 2016 19:15
This code snippet is able to generate a scram salted password 'hash' in the format and with the necessary information mongooseim expects when using http auth and scram. See http://stackoverflow.com/questions/35652435/mongooseim-ejabberd-http-auth-using-scram and http://mongooseim.readthedocs.org/en/1.6.1/advanced-configuration/HTTP-authenticatio…
# https://tools.ietf.org/html/rfc5802
import base64
import hashlib
import hmac
import sys
from passlib.hash import scram