Skip to content

Instantly share code, notes, and snippets.

Sevag Hanssian sevagh

Block or report user

Report or block sevagh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View bloom-filter.rkt
#lang racket
(require "murmur3.rkt")
(require data/bit-vector)
(require racket/serialize)
(provide make-bloom-filter make-recommended-bloom-filter bloom-filter-recommender bloom-filter-member? bloom-filter-batch-member? bloom-filter-add! false-positive-rate )
(define (murmur-int x seed) (murmur-hash (integer->integer-bytes x 8 false false) seed))
(define (h1 x) (murmur-int x 583))
(define (h2 x) (murmur-int x 2387))
View Librosa stft vs scipy stft.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bmcfee
bmcfee / ks_key.py
Created Sep 7, 2017
Krumhansl-Schmuckler key estimation
View ks_key.py
import numpy as np
import scipy.linalg
import scipy.stats
def ks_key(X):
'''Estimate the key from a pitch class distribution
Parameters
----------
X : np.ndarray, shape=(12,)
View splay.rs
use std::ptr;
use std::mem;
#[derive(PartialEq, Eq, Copy, Clone)]
enum Dir { Left, Right }
impl Dir {
fn flip(&self) -> Dir {
match self {
&Dir::Left => Dir::Right,
@zchee
zchee / cgo.md
Last active Jan 16, 2020
cgo convert list
View cgo.md

See also, http://libraryofalexandria.io/cgo/

Using Go cgo

cgo has a lot of trap.
but Not "C" pkg also directory in $GOROOT/src. IDE's(vim) Goto command not works.

So, Here collect materials.

@aagontuk
aagontuk / red-black-tree.c
Last active Jan 12, 2020
A RED-BLACK TREE Implementation
View red-black-tree.c
/*
* [PROG] : Red Black Tree
* [AUTHOR] : Ashfaqur Rahman <sajib.finix@gmail.com>
* [PURPOSE] : Red-Black tree is an algorithm for creating a balanced
* binary search tree data structure. Implementing a red-balck tree
* data structure is the purpose of this program.
*
* [DESCRIPTION] : Its almost like the normal binary search tree data structure. But
* for keeping the tree balanced an extra color field is introduced to each node.
* This tree will mantain bellow properties.
@marklap
marklap / lapsync.go
Last active Jul 18, 2018
Rsync-lite-ish script that uses parallel goroutines to speed things up a bit.
View lapsync.go
////////////////////////////////////////////////////////////////////////////////
// The MIT License (MIT)
//
// Copyright (c) 2015 Mark LaPerriere
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@ryan-lane
ryan-lane / .bashrc
Created Jul 15, 2014
No more pyflakes errors for salt dunders
View .bashrc
export PYFLAKES_BUILTINS="__salt__,__opts__,__grains__,__pillars__,__context__"
@TSiege
TSiege / The Technical Interview Cheat Sheet.md
Last active Jan 21, 2020
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.
View The Technical Interview Cheat Sheet.md

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@rygorous
rygorous / magic_ring.cpp
Created Jul 22, 2012
The magic ring buffer.
View magic_ring.cpp
#define _CRT_SECURE_NO_DEPRECATE
#include <stdio.h>
#include <string.h>
#include <Windows.h>
// This allocates a "magic ring buffer" that is mapped twice, with the two
// copies being contiguous in (virtual) memory. The advantage of this is
// that this allows any function that expects data to be contiguous in
// memory to read from (or write to) such a buffer. It also means that
You can’t perform that action at this time.