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
# -*- coding: utf-8 -*- | |
''' | |
Created on Oct 30, 2010 | |
@author: joern | |
''' | |
import rdflib | |
def sparqlJSONresultBindingsToRDFlib(resBindings): | |
""" Converts a result's bindings as retrieved in res["results"]["bindings"] |
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 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Mar 19, 2012 | |
@author: Joern Hees | |
""" | |
import scipy | |
from scipy.stats import poisson |
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
# so let's say you cloned repo someone/project like this | |
git clone git://github.com/someone/project.git | |
# you use it and then later on discover a bug. | |
# to fix it you create a fork on github to which you can | |
# write and issue a pull request, but now your origin is | |
# someone/project instead of you/project . | |
# fix it like this: | |
git remote rename origin upstream |
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 | |
# -*- coding: utf-8 -*- | |
''' | |
Created on 21.03.2013 | |
@author: joern | |
''' | |
import sys, os | |
import json, csv |
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
$ ipython | |
Python 2.7.5 (default, Jun 8 2013, 00:27:06) | |
Type "copyright", "credits" or "license" for more information. | |
IPython 0.13.2 -- An enhanced Interactive Python. | |
? -> Introduction and overview of IPython's features. | |
%quickref -> Quick reference. | |
help -> Python's own help system. | |
object? -> Details about 'object', use 'object??' for extra details. |
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
# -*- coding: utf-8 -*- | |
""" | |
Script to plot recall-precision values with f-measure equi-potential lines. | |
Created on Dec 16, 2009 | |
@author: Jörn Hees | |
""" | |
import scipy as sc |
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
from multiprocessing import Process, Manager, Lock | |
import random | |
def f(d): | |
from rdflib import URIRef | |
for i in random.sample(range(1000), 1000): | |
k = URIRef('foo'+str(i)) | |
with l: | |
if k not in d: |
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
{"comment": "Kaiserslautern ([\u02ccka\u026az\u0250s\u02c8la\u028at\u0250n]) is a city in southwest Germany, located in the Bundesland (State) of Rhineland-Palatinate (Rheinland-Pfalz) at the edge of the Palatinate Forest (Pf\u00e4lzerwald). The historic centre dates to the 9th century. It is 459 kilometres (285 miles) from Paris, 117 km (73 miles) from Frankfurt am Main, and 159 km (99 miles) from Luxembourg.", "pic": "http://commons.wikimedia.org/wiki/Special:FilePath/Kaiserslautern-Stadtwappen.svg", "uri": "http://dbpedia.org/resource/Kaiserslautern", "label": "Kaiserslautern", "areaTotal": "1.3972e+08", "types": ["http://www.w3.org/2002/07/owl#Thing", "http://www.wikidata.org/entity/Q3957", "http://www.wikidata.org/entity/Q486972", "http://dbpedia.org/ontology/PopulatedPlace", "http://dbpedia.org/ontology/Settlement", "http://dbpedia.org/ontology/Town", "http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing", "http://schema.org/Place", "http://dbpedia.org/ontology/Place", "http://dbpedia.org/ontology/Locat |
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
#!/bin/bash | |
# adapted from https://gist.github.com/joelittlejohn/5937573 | |
if [ "$#" -ne 2 ]; then | |
echo "Usage: ./generate-changelog.sh user/repo <username>" | |
exit 1 | |
fi | |
# read -s -p "@$2 password: " PASS |