Skip to content

Instantly share code, notes, and snippets.

View proycon's full-sized avatar

Maarten van Gompel proycon

View GitHub Profile
@proycon
proycon / lamblinsNearestNeighbors.py
Last active June 9, 2017 22:36 — forked from danielvarga/lamblinsNearestNeighbors.py
Theano code to find nearest neighbors to a set of vectors
# Implementing lamblin's workaround at https://github.com/Theano/Theano/issues/1399
# BEFORE:
# bestIndices = T.argmin(s, axis=0)
# Time in Function.fn.__call__: 3.870916e-02s (99.867%)
# <% time> <sum %> <apply time> <time per call> <type> <#call> <#apply> <Class name>
# 77.7% 77.7% 0.029s 2.93e-02s C 1 1 theano.tensor.basic.MaxAndArgmax
# 7.0% 84.7% 0.003s 2.64e-03s C 1 1 theano.sandbox.cuda.basic_ops.HostFromGpu
# 6.9% 91.6% 0.003s 1.30e-03s C 2 2 theano.sandbox.cuda.basic_ops.GpuFromHost
# 6.2% 97.8% 0.002s 2.35e-03s C 1 1 theano.sandbox.cuda.blas.GpuDot22Scalar
@proycon
proycon / keybase.md
Created September 7, 2016 18:02
Keybase verification

Keybase proof

I hereby claim:

  • I am proycon on github.
  • I am proycon (https://keybase.io/proycon) on keybase.
  • I have a public key ASBvbebQL-kGBKB23DsFOOMsWhmnFqpYBdWbv-Omnhc_oAo

To claim this, I am signing this object:

@proycon
proycon / webservices.json
Last active January 21, 2016 11:27
Radboud LST Webservices - Metadata for switchboard
[
{
task: "tokenisation",
name: "Ucto",
homepage: "https://proycon.github.io/ucto",
creators: ["Maarten van Gompel, Ko van der Sloot (CLST, Radboud University Nijmegen)"],
contact: {
person: "Maarten van Gompel",
email: "proycon@anaproy.nl",
},
@proycon
proycon / kpndecoder.lircd.conf
Created December 11, 2015 20:47
LIRC IR codes (lircd.conf) for Motorola VIP 1853, Arcadyan HMB2260, Arris VIP 2952, and family (used as mediabox/decoder by KPN)
# IrScrutinizer parametric export
#
# Creating tool: IrScrutinizer version 1.1.1
# Creating user: Erik
# CreateDate: Tue Oct 07 22:37:43 CEST 2014
#
#
# Manufacturer: Motorola
# Model: VIP1853
# Export from IrScrutinizer
Rougly 40% more compression on the data:
-rw-r--r-- 1 proycon proycon 221M Oct 9 23:24 europarl7-en.txt
-rw-r--r-- 1 proycon proycon 96M Oct 9 23:26 v1/europarl7-en.colibri.dat
-rw-r--r-- 1 proycon proycon 59M Oct 9 23:26 v2/europarl7-en.colibri.dat
Comparison with other compressions on plaintext (default settings):
-rw-r--r-- 1 proycon proycon 71M Oct 10 00:11 europarl7-en.txt.gz
-rw-r--r-- 1 proycon proycon 71M Oct 10 00:14 europarl7-en.txt.zip
-rw-r--r-- 1 proycon proycon 49M Oct 10 00:12 europarl7-en.txt.bz2
@proycon
proycon / MainActivity.java
Created September 9, 2015 07:13
Home automation android app with speech to text through google API, with self-signed certificate cause I'm cheap
package com.anaproy.homecontrol;
import java.util.ArrayList;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.speech.RecognizerIntent;
import android.view.View;
import android.view.View.OnClickListener;
@proycon
proycon / ca
Last active August 19, 2019 22:27 — forked from naiaden/ca
info over ssh scripts
#!/bin/bash
green='\033[1;92m'
yellow='\033[1;93m'
red='\033[1;91m'
blue='\033[1;31m' #"\033[1;96m"
normal='\033[0m'
if [ -z "$PONY" ]; then
@proycon
proycon / parent_child_mp_reduction
Last active August 29, 2015 14:26 — forked from sunilmallya/parent_child_mp_reduction
multiprocessing.reduction socket server with parent processing passing connections to client after accepting connections
#!/usr/bin/env python
"""
@author Sunil Mallya
Sample code to show a parent - child like process communication model where parent listens on a port and passes the pickled file descriptor
to the child process to read the bytes off the socket. The communication in this snippet is via a Queue which is thread/process safe
Just to be clear, the parent process is still accepting the connection and we are sending a live fd to the child
"""
import os
import sys
@proycon
proycon / trajectoryplanner.py
Created April 17, 2015 19:51
Trajectory/travel planner in 3D space between two moving bodies, based on code by Christer Swahn: https://gist.github.com/christerswahn/2708736
from __future__ import print_function, unicode_literals, division, absolute_import
import math
import numpy
def unit_vector(vector):
""" Returns the unit vector of the vector. """
return vector / numpy.linalg.norm(vector)
def angle_between(v1, v2):
""" Returns the angle in radians between vectors 'v1' and 'v2'::
from __future__ import division
from visual import *
AU = 149597870700 #m
scene.center = (0,0,0)
scene.width = 800
scene.height = 600
scene.range = (2.1*AU,2.1*AU,2.1*AU)