Skip to content

Instantly share code, notes, and snippets.

@shadiakiki1986
shadiakiki1986 / README.md
Last active August 29, 2015 14:05
Animated graph of financial market participants (based on d3.js, json data, and fed with dummy data)

The graph is controlled by data in the text boxes above as described, and the clock on the right. The "pause" button plays the clock through time. The "step" only makes a 1-hour step. Make sure to update the trade timestamps to be after the current time of the clock (displayed right above it). The same applies for the asset performances. If you can't see the "step" or "pause" links on the right of the clock, please use the "W" cursor to reduce the width of the graph's canvas. You can click and drag on the canvas to pan, and you can zoom in and out with the mouse scroll wheel.

The cyan discs are traders, and the blue discs are assets. The blue lines are long positions, and the pink ones are short positions. An asset disc encircled in blue indicates a positive performance for the time step, whereas a pink circle indicates a negative performance.

The text in the textareas are a json description of each box's content. The json tags I use are:

  • s: security ID
  • q: quantity held
  • c: trader ID
{
"name": "root/test-phpcache-filesystem",
"require": {
"cache/filesystem-adapter": "^0.3.2"
},
"authors": [
{
"name": "Shadi Akiki",
"email": "shadiakiki1986@gmail.com"
}
@shadiakiki1986
shadiakiki1986 / definitions-arabic.txt
Last active January 7, 2017 21:26
qamous al filaha
2016-12-18 عبدو الأَشقَر
١. طاب اليَد: الأَرضُ أَصبَحَت صالِحَة لِلفِلاحَة
٢. كيف العَدّان؟: كَيفَ الطّقسُ المُتَقَلِّب؟
٣. مغَطغطَة : مغَيّمَة وَصُعوبَة في الرُّؤيَة
٤. الوجاق: صوبيا تَعمَلُ عَلى الحَطَب، أَو البابور
@shadiakiki1986
shadiakiki1986 / example1.py
Last active June 28, 2017 16:08
Reconcile sklearn with MLJAR
"""
Reconciling results from MLJAR and sklearn.
Random forest classifier
X==y
Usage
pew new --python=python2 MLJAR_TEST
pip install mljar sklearn numpy scipy pandas
export MLJAR_TOKEN=exampleexampleexample
@shadiakiki1986
shadiakiki1986 / awsEc2Helper.sh
Last active July 1, 2017 01:26
Helper for aws ec2 CLI
#!/bin/bash
# This is a helper for aws ec2 CLI
# https://gist.github.com/shadiakiki1986/a4bc2956eaaef7dede10
if [ $# -ne 2 ] || [ "$2" == "help" ]; then
echo "Usage:"
echo " bash $0 id '*'"
echo " bash $0 id udacity"
echo " bash $0 id '*udacity*'"
echo " bash $0 start id"
@shadiakiki1986
shadiakiki1986 / test.py
Last active July 14, 2017 16:49
sklearn PCA requires normalization
# modified example of
# http://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html#sklearn.decomposition.PCA.transform
import numpy as np
from sklearn.decomposition import PCA
# Just the same PCA as the example
pca = PCA(n_components=2, svd_solver='full')
# same input as example
@shadiakiki1986
shadiakiki1986 / README.md
Last active August 15, 2017 14:05
Steps to deep clean pymssql repository
@shadiakiki1986
shadiakiki1986 / README.md
Last active January 5, 2018 15:16
g2-ml keras spot instance init: cpu and gpu

These are a few scripts that help me install requirements on fresh AWS EC2 instances for deep learning

@shadiakiki1986
shadiakiki1986 / README.md
Last active May 29, 2018 07:27
H2O driverless AI installation instructions

Installation scripts for H2O driverless AI

Launch order

  • install.sh (requires sudo)
    • need to exit and re-ssh into machine for "docker usage without sudo" to take effect
  • for GPU, refer to init-gpu.sh
  • dropbox.sh (optional)
  • start.sh
@shadiakiki1986
shadiakiki1986 / stride_group.py
Last active June 7, 2018 07:52
striding a matrix for RNN input
# Fiddle at
# https://pyfiddle.io/fiddle/a14865cf-38c9-48d6-b90a-f5bedc7a5b6e/?m=Saved%20fiddle
#
# reshape a matrix M x N into M x P x (N-P) while creating overlapping rows
# Useful for LSTM input
import numpy as np
import pandas as pd
def stride_group(group, lahead):