Skip to content

Instantly share code, notes, and snippets.

Avatar

Paweł Szczur orian

View GitHub Profile
View benchmarkresults.md

Old levenstein:

/tmp/___gobench_github_com_datainq_teryt_search -test.v -test.bench . -test.run ^$
goos: linux
goarch: amd64
pkg: github.com/datainq/teryt/search
BenchmarkSearch_SearchOld
BenchmarkSearch_SearchOld-8   	      31	  40371148 ns/op
BenchmarkSearch_Search
@dave-andersen
dave-andersen / kmeans.py
Last active Jul 24, 2021
k-means in Tensorflow
View kmeans.py
import tensorflow as tf
import numpy as np
import time
N=10000
K=4
MAX_ITERS = 1000
start = time.time()
@fideloper
fideloper / crypt.py
Created Jun 4, 2015
Decrypt Laravel-encrypted value
View crypt.py
import os
import base64
import json
from Crypto.Cipher import AES
from phpserialize import loads
def decrypt(payload):
data = json.loads(base64.b64decode(payload))
@kirley
kirley / gist:3913166
Last active Jan 27, 2021
Setting up PostGIS for Timezone Lookup
View gist:3913166
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 — forked from jboner/latency.txt
Latency numbers every programmer should know
View latency.markdown

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns  = 250 µs
@iggymacd
iggymacd / FileHandler.dart
Created Apr 30, 2012
Sample FileHandler
View FileHandler.dart
class FileHandler {
FileHandler(){
}
void onRequest(HttpRequest request, HttpResponse response, [String fileName = null]){
final int BUFFER_SIZE = 4096;
if (fileName == null) {
fileName = request.path.substring(1);
}
@entaroadun
entaroadun / gist:1653794
Created Jan 21, 2012
Recommendation and Ratings Public Data Sets For Machine Learning
View gist:1653794

Movies Recommendation:

Music Recommendation:

@davesteele
davesteele / gmimap.py
Last active Jul 17, 2020
Class and example for using the Gmail IMAP Extensions
View gmimap.py
#!/usr/bin/python -tt
#
# Note that this uses xlist, which is deprecated.
#
# This also predates the GMail REST API, which is probably a better mechanism
# https://developers.google.com/gmail/api/
#
#
""" Example of how to use Google IMAP Extensions using Python