Skip to content

Instantly share code, notes, and snippets.

View musically-ut's full-sized avatar
๐Ÿ™
๐Ÿข ๐ŸŽฃ ๐Ÿ 

Utkarsh Upadhyay musically-ut

๐Ÿ™
๐Ÿข ๐ŸŽฃ ๐Ÿ 
View GitHub Profile
@musically-ut
musically-ut / README.md
Last active November 2, 2015 10:50
Scripts to convert sqlite

Scripts to convert datasets from unruly forms to SQLite

The script json2sqlite.py reads files which have one JSON block per new line to be inserted in a database. This has become a rather common dataformat which is easy to incrementally parse. The arguments to the scripts are self explanatory.

Example execution: python json2sqlite.py --gzip aggressive_dedup.json.gz amazon.sqlite reviews

For a more upto date scripts, see: Networks-Leraning/datasets2sqlite.

@diegopacheco
diegopacheco / go-install.md
Last active August 12, 2019 19:40
How to Install GO Lang on CentOS / Amazon Linux?

How to Install GO Lang on CentOS / Amazon Linux?

sudo wget https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz
tar -xzf go1.4.2.linux-amd64.tar.gz 
export GOROOT=PATH_WHERE_YOU_EXTRACT_GO
export PATH=$PATH:$GOROOT/bin 
export GOBIN=$GOROOT/bin 
mkdir ~/golang/ 
export GOPATH=~/golang/ 
@nebw
nebw / arXiv popularity scoring.ipynb
Created September 6, 2015 12:07
Popularity scoring for arXiv publications
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@revolunet
revolunet / python-es6-comparison.md
Last active April 11, 2025 10:54
# Python VS JavaScript ES6 syntax comparison

Python VS ES6 syntax comparison

Python syntax here : 2.7 - online REPL

Javascript ES6 via Babel transpilation - online REPL

Imports

import math
@fregante
fregante / git-get-git-put.md
Created June 30, 2015 18:34
Use git get and put instead of git pull and push

As explained on Don't Be Scared of git rebase, git fetch+rebase is a better alternative to git pull; unfortunately it's not as concise.

git get

From now on, use git get instead of git pull, a custom command that does this:

# get data from remote
git fetch origin
# rebase the remote branch with the same name as local
@pravsripad
pravsripad / plot_circle_von_mises.py
Created June 22, 2015 12:53
Circular bar plot - von Mises distribution
#!/usr/bin/env python
# Inspired from :
# http://matplotlib.org/examples/pie_and_polar_charts/polar_bar_demo.html
''' Plot von Mises distribution as a circular bar plot. '''
import numpy as np
import matplotlib.pyplot as pl
@chris1610
chris1610 / Ipython-pandas-tips-and-tricks.ipynb
Last active October 18, 2016 15:57
Ipython Notebook from pbpython.com
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@musically-ut
musically-ut / notes.txt
Created April 28, 2015 22:09
Anki slides import example notes.
Slide 3:
What percentage of Indians are vegetarians?
Why are they vegetarian?
Slide 4:
What are the things that a lacto-vegetarian can eat?
Slide 6:
What does veg lunch in New Delhi look like?
@musically-ut
musically-ut / set-cover.py
Created March 18, 2015 12:15
Implementation of various approximation algorithms for set cover problem.
# There are many greedy algorithms that could be used to pick a collection of sets that is close to as small as possible. Here are some that you will consider in this problem.
def isCovered(cover, allElems):
coverElems = set()
for s in cover:
coverElems.update(s)
return len(coverElems) == len(allElems)
def getAllElems(sets):
elems = set()
@musically-ut
musically-ut / adverts.jl
Last active August 29, 2015 14:17
Simulation designed for solving "Mining Massive Datasets MOOC@Coursera" exercise
typealias Slot Int
typealias Bidder Int
immutable BidderRoundData
numSlots :: Int
ctr :: Dict{(Bidder, Slot), Float64}
bids :: Vector{Float64}
budgets :: Vector{Float64}
clickThroughs :: Int
end