Skip to content

Instantly share code, notes, and snippets.

Sai Teja Suram dotslash

Block or report user

Report or block dotslash

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
# Usage:
# > python 12
# > python 3
# Needs - numpy
from numpy.random import seed
from numpy.random import randint
from collections import defaultdict as ddict
import sys
import time
View SnapshottableArray.scala
import scala.collection.mutable.ListBuffer
trait SnapshottableArray {
// Regular array operations
def set(index: Int, value: Int): Unit
def get(index: Int): Int
// Creates a snapshot and returns a handle to the snapshot
def snapshot(): Int
default_date_format = "";
def now():
def ts_to_dt():
def dt_to_string(dt, format=default_date_format):
dotslash /
Created Nov 9, 2016 — forked from pklaus/
Store your Bash history in an SQLite database with this Python script.
#!/usr/bin/env python
# -*- encoding: UTF8 -*-
""" Store all entered bash commands ('the history') in a database
import sqlite3
from os import path, makedirs
import sys
View emojis.json
"name":"grinning face",
from sklearn.preprocessing import LabelEncoder
from sklearn.cross_validation import train_test_split
import json
import re
import time
import sys
import scipy.sparse as sparse
from sklearn.ensemble import GradientBoostingClassifier, RandomForestClassifier
from sklearn.naive_bayes import MultinomialNB
from sklearn.linear_model import SGDClassifier
View .vimrc
" ===============VUNDLE============
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
dotslash /
Last active Jul 27, 2016
Twitter disclaimer - yesteapea
dotslash /
Created Apr 15, 2016
Examples for my post on converting recursion to stack
def hanoi(n, fr, to, buf):
if (n == 0):
#print "deb", 'l', n, fr, to, buf
hanoi(n-1, fr, buf, to)
#print "deb", 'r', n, fr, to, buf
print "{} {}->{}".format(n, fr, to)
hanoi(n-1, buf, to, fr)
def hanoi_iter(n, fr, to, buf):
You can’t perform that action at this time.