Skip to content

Instantly share code, notes, and snippets.

View dendisuhubdy's full-sized avatar
🚀
at the speed of light

Dendi Suhubdy dendisuhubdy

🚀
at the speed of light
View GitHub Profile
/*****************************************************************************
* QuantCup 1: Price-Time Matching Engine
*
* Submitted by: voyager
*
* Design Overview:
* In this implementation, the limit order book is represented using
* a flat linear array (pricePoints), indexed by the numeric price value.
* Each entry in this array corresponds to a specific price point and holds
* an instance of struct pricePoint. This data structure maintains a list
@dendisuhubdy
dendisuhubdy / publickey-git-error.markdown
Created May 1, 2017 18:38 — forked from adamjohnson/publickey-git-error.markdown
Fix "Permission denied (publickey)" error when pushing with Git

"Help, I keep getting a 'Permission Denied (publickey)' error when I push!"

This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:

  1. Open git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. Pro Tip: You can use any *nix based command prompt (but not the default Windows Command Prompt!)
  2. Type cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows)
  3. Within the .ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.
  4. To create the SSH keys, type ssh-keygen -t rsa -C "[email protected]". Th

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@dendisuhubdy
dendisuhubdy / crbm.py
Created June 12, 2017 03:19 — forked from gwtaylor/crbm.py
Theano CRBM demonstration
""" Theano CRBM implementation.
For details, see:
http://www.uoguelph.ca/~gwtaylor/publications/nips2006mhmublv
Sample data:
http://www.uoguelph.ca/~gwtaylor/publications/nips2006mhmublv/motion.mat
@author Graham Taylor"""
import numpy
@dendisuhubdy
dendisuhubdy / yellow_fin.py
Created July 4, 2017 12:51 — forked from botev/run_yellow_fin_vae.py
Theano Yellow Fin
import numpy as np
import theano
import theano.tensor as T
from theano.printing import Print
from collections import OrderedDict
def yellow_fin(loss, params, beta=0.99,
learning_rate_init=0.01, momentum_init=0.0,
t=None, window_width=20, debug=False):
@dendisuhubdy
dendisuhubdy / stdc++.h
Created October 12, 2017 14:34 — forked from velicast/stdc++.h
Linux GCC 4.8.0 /bits/stdc++.h header definition.
// C++ includes used for precompiling -*- C++ -*-
// Copyright (C) 2003-2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
@dendisuhubdy
dendisuhubdy / main.hs
Created November 25, 2017 23:03 — forked from dpiponi/main.hs
Primality test based on Chebyshev polynomials
import Data.Bits
import Control.Monad
type Z = Integer
-- Find smallest power of two >= given integer.
-- Sadly it's not convenient using the usual interface to Integer
-- Got exceptions when using Data.Bits.Bitwise
suitablePower :: Z -> Int
@dendisuhubdy
dendisuhubdy / condaenv.txt
Created January 17, 2018 22:29 — forked from pratos/condaenv.txt
To package a conda environment (Requirement.txt and virtual environment)
# For Windows users# Note: <> denotes changes to be made
#Create a conda environment
conda create --name <environment-name> python=<version:2.7/3.5>
#To create a requirements.txt file:
conda list #Gives you list of packages used for the environment
conda list -e > requirements.txt #Save all the info about packages to your folder
@dendisuhubdy
dendisuhubdy / shuffle_weights.py
Created April 2, 2018 20:57 — forked from jkleint/shuffle_weights.py
Quickly re-initialize weights of a Keras model
#!/usr/bin/env python
"""Demonstrate Keras model weight shuffling as fast alternative to re-creating a model."""
from __future__ import print_function
import numpy as np
from keras.layers import Dense
from keras.models import Sequential
@dendisuhubdy
dendisuhubdy / rsa-old.py
Last active April 8, 2018 20:37 — forked from tylerl/rsa.py
RSA Explained in Python
#!/usr/bin/env python
# This example demonstrates RSA public-key cryptography in an
# easy-to-follow manner. It works on integers alone, and uses much smaller numbers
# for the sake of clarity.
#####################################################################
# First we pick our primes. These will determine our keys.
#####################################################################