Skip to content

Instantly share code, notes, and snippets.

View techedlaksh's full-sized avatar
🏠
Finding the right opportunities

Laksh Arora techedlaksh

🏠
Finding the right opportunities
View GitHub Profile
#! /usr/bin/env python
"""
Author: Laksh Arora
Program: SOFTMAX.PY
Date: Friday, April 15 2016
Description: Simple softmax function.
"""
import numpy as np
npa = np.array
{"Result":1,"Items":[{"TemplateId":"\"BADGE_BATTLE_ATTACK_WON\"","Badge":{"BadgeType":"BADGE_BATTLE_ATTACK_WON","BadgeRanks":4,"Targets":"\"\\nd\\350\\007\""}},{"TemplateId":"\"BADGE_BATTLE_TRAINING_WON\"","Badge":{"BadgeType":"BADGE_BATTLE_TRAINING_WON","BadgeRanks":4,"Targets":"\"\\nd\\350\\007\""}},{"TemplateId":"\"BADGE_BIG_MAGIKARP\"","Badge":{"BadgeType":"BADGE_BIG_MAGIKARP","BadgeRanks":4,"Targets":"\"\\0032\\254\\002\""}},{"TemplateId":"\"BADGE_CAPTURE_TOTAL\"","Badge":{"BadgeType":"BADGE_CAPTURE_TOTAL","BadgeRanks":4,"Targets":"\"\\036\\364\\003\\320\\017\""}},{"TemplateId":"\"BADGE_EVOLVED_TOTAL\"","Badge":{"BadgeType":"BADGE_EVOLVED_TOTAL","BadgeRanks":4,"Targets":"\"\\003\\024\\310\\001\""}},{"TemplateId":"\"BADGE_HATCHED_TOTAL\"","Badge":{"BadgeType":"BADGE_HATCHED_TOTAL","BadgeRanks":4,"Targets":"\"\\nd\\364\\003\""}},{"TemplateId":"\"BADGE_PIKACHU\"","Badge":{"BadgeType":"BADGE_PIKACHU","BadgeRanks":4,"Targets":"\"\\0032\\254\\002\""}},{"TemplateId":"\"BADGE_POKEDEX_ENTRIES\"","Badge":{"BadgeTy
@techedlaksh
techedlaksh / hellinger.py
Created December 10, 2016 12:04 — forked from larsmans/hellinger.py
Hellinger distance for discrete probability distributions in Python
"""
Three ways of computing the Hellinger distance between two discrete
probability distributions using NumPy and SciPy.
"""
import numpy as np
from scipy.linalg import norm
from scipy.spatial.distance import euclidean
sudo add-apt-repository "deb http://archive.canonical.com/ precise partner"
sudo apt-get update
sudo apt install adobereader-enu
########################################
Make Adobe Reader as Default Application
sudo gedit /etc/gnome/defaults.list
@techedlaksh
techedlaksh / gist:f422018e5fda06549d31ef223d7310de
Created January 21, 2017 07:26
Install opencv2.4 in Anaconda
conda install -c https://conda.binstar.org/menpo opencv
def rotateImage(image, angle):
image_center = tuple(np.array(image.shape)[:2]/2)
rot_mat = cv2.getRotationMatrix2D(image_center,angle,1.0)
result = cv2.warpAffine(image, rot_mat, image.shape[:2],flags=cv2.INTER_LINEAR)
return result
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/home/laksh/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
# ZSH_THEME="robbyrussell"
@techedlaksh
techedlaksh / mat_to_csv.py
Created March 21, 2017 23:07
Converting mat files to csv using python, scipy and pandas
import scipy.io
import pandas as pd
mat = scipy.io.loadmat('file.mat')
mat = {k:v for k, v in mat.items() if k[0] != '_'}
data = pd.DataFrame({k: pd.Series(v[0]) for k, v in mat.iteritems()})
data.to_csv("example.csv")
export DEFAULT_USER="laksh"
export TERM="xterm-256color"
export ZSH=/home/laksh/.oh-my-zsh
POWERLEVEL9K_MODE="awesome-fontconfig"
ZSH_THEME="powerlevel9k/powerlevel9k"
POWERLEVEL9K_FOLDER_ICON=''
#POWERLEVEL9K_HOME_SUB_ICON='$(print_icon HOME_ICON)'
@techedlaksh
techedlaksh / zsh_install
Created April 25, 2017 15:21
Install instruction of zsh in ubuntu
sudo apt-get install zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
chsh -s `which zsh`
# Restart the terminal
# ZSHRC file
https://gist.github.com/techedlaksh/4a95495fcdce492713201fd2f9b6c2dd