Skip to content

Instantly share code, notes, and snippets.

View skariel's full-sized avatar
🎯
Focusing

Ariel Keselman skariel

🎯
Focusing
  • Huawei / Senior Software Architect
  • Haifa, Israel
View GitHub Profile
@skariel
skariel / dev_run.py
Last active August 23, 2020 16:44
hot reloading automation for sqlc, quicktemplates etc
#!python -u
import os
import sys
import glob
import time
import signal
import queue
from subprocess import Popen, getoutput, PIPE
from multiprocessing import Process, Queue
from watchdog.observers import Observer
@nicksam112
nicksam112 / keras_es.py
Last active November 28, 2020 16:02
Evolution Strategies with Keras
#Evolution Strategies with Keras
#Based off of: https://blog.openai.com/evolution-strategies/
#Implementation by: Nicholas Samoray
#README
#Meant to be run on a single machine
#APPLY_BIAS is currently not working, keep to False
#Solves Cartpole as-is in about 50 episodes
#Solves BipedalWalker-v2 in about 1000
@Oxyrus
Oxyrus / cache.go
Created July 22, 2017 17:07 — forked from zemirco/cache.go
golang database layer with cache
type CacheInterface interface {
Get(key string) ([]byte, error)
Set(key string, value interface{}) error
}
// Cache implements CacheInterface.
type Cache struct {
// wrap redis pool connection
// or whatever you need
}
@dtheodor
dtheodor / listen_pg.py
Created December 18, 2014 21:30
Listen for pg_notify with Psycopg2
import select
import datetime
import psycopg2
import psycopg2.extensions
conn = psycopg2.connect(database="postgres", user="vagrant")
#conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT)
curs = conn.cursor()
@Veedrac
Veedrac / just_some_cplusplus.cpp
Last active May 5, 2019 12:02
Speed test. Warning: Please read first comment
#include <iostream>
#include <iterator>
#include <numeric>
#include <unordered_set>
#include <vector>
int32_t some_calculations(int32_t number) {
std::vector<int32_t> a;
std::unordered_set<int32_t> s;

[JULIA] Faster than CGAL Delaunay

TL;DR

DelaunayJL is an incremental 2D Delaunay triangulation algorithm implemented in Julia, it is robust and ~20% faster than CGAL, the C++ de-facto industry standard. And it's MIT Licensed! all links to code are below

Show me the data!

The figure below shows how much time it takes to run a benchmark on my computer, an Intel Core i7-4800MQ CPU @ 2.7Ghz, 16GB RAM, Win8 64bit. The benchmark consists of inserting a number of points uniformly distributed. The benchmark is run 5 times for each number of points once for CGAL and once for Julia. The numbers of points used are 10K, 100K, 1M, and 10M. CGAL v4.4 was compiled with VS2013 64bit release mode, Julia is of version 0.3.0 Commit 7681878 (2014-08-20 20:43 UTC) x86_64-w64-mingw32 the delaunay code is here (see other gists of mine for complementing files... I'll compile this all into a library when I have the time)

@carnaval
carnaval / gist:d8055856a2a25cfd7b97
Created September 14, 2014 09:03
bench 2aeaa59d
# master: 3b2269d8
# incgc: 2aeaa59d
# micro
test name old new % speedup % st. dev
-----------------------------------------------------------
fib 0.055 0.053 3.64% 3.64%
mandel 0.163 0.152 6.75% 4.91%
micro.mem 255.609 178.449 30.19% 0.00%
parse_int 0.216 0.172 20.37% 354.17%
module GeometricalPredicates
# GeometricalPredicates_v0.2.9
#
# Fast, robust 2D and 3D geometrical predicates on generic point types.
# Implementation follows algorithms described in http://arxiv.org/abs/0901.4107
# and used (for e.g.) in the Illustris Simulation
# http://www.illustris-project.org/
#
# Author: Ariel Keselman (skariel@gmail.com)
@paulcuth
paulcuth / README.md
Last active August 13, 2017 20:25
Lua port of Slimdown.

Slimdown

This is a Lua port of of jbroadway's PHP project of the same name.

A very basic pattern-based Markdown parser. Supports the following elements (and can be extended via slimdown.addRule()):

  • Headers
  • Links
  • Bold
@MikeInnes
MikeInnes / startup.jl
Last active February 5, 2023 12:54
Some useful macros for Julia
# Repeat an operation n times, e.g.
# @dotimes 100 println("hi")
macro dotimes(n, body)
quote
for i = 1:$(esc(n))
$(esc(body))
end
end
end