Skip to content

Instantly share code, notes, and snippets.

🔥

Sevag H sevagh

🔥
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 Jun 19, 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 Apr 29, 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
@myusuf3
myusuf3 / delete_git_submodule.md
Created Nov 3, 2014
How effectively delete a git submodule.
View delete_git_submodule.md

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@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__"
@zonque
zonque / xymodem-mini.c
Last active May 30, 2020
simple xmodem/ymodem implementation in C
View xymodem-mini.c
/*
* Minimalistic implementation of the XModem/YModem protocol suite, including
* a compact version of an CRC16 algorithm. The code is just enough to upload
* an image to an MCU that bootstraps itself over an UART.
*
* Copyright (c) 2014 Daniel Mack <github@zonque.org>
*
* License: MIT
*/
You can’t perform that action at this time.