Skip to content

Instantly share code, notes, and snippets.


Jyotirmoy Bhattacharya jmoy

View GitHub Profile
jmoy /
Created Apr 23, 2016
Knight's Tour using OpenMP
A multi-threaded brute-force search for closed Knight's tours (used OpenMP)
Usage: knights_tours [m] [n]
to search for tour on a m x n board
rows are denoted by letters A.., columns by numbers 0..
Compile with
g++ -O3 -Wall -std=c++11 -fopenmp -o knight_tours
jmoy / CompetitiveStoragePython.ipynb
Last active Aug 28, 2018
Solving the competitive storage model using collocation
View CompetitiveStoragePython.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
jmoy /
Created Sep 19, 2015
Scrape daily wheat price data using Selenium and LXML
Download wheat price data from
Data is saved in file wheat.csv in current directory
Author: Jyotirmoy Bhattacharya, Ambedkar University, New Delhi,
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
View gali_ch3.R
# Parameters
sigma = 1 #log utility
phi=1 #unitary Frisch elasticity
phi_pi = 1.5 #inflation feedback Taylor Rule
phi_y = .5/4 #output feedback Taylor Rule
theta=2/3 #Calvo parameter
rho_nu = 0.5 #autocorrelation monetary policy shock
An implementation of Norvig's spelling corrector
Author: Jyotirmoy Bhattacharya []
Must be compiled as C++14 (-std=c++1y for g++)
#include <iostream>
View singular.lhs
%include lhs2TeX.sty
%include lhs2TeX.fmt
\title{Lazily Computing the \\Singular
Function of Bold Play}
\author{Jyotirmoy Bhattacharya}
jmoy /
Last active Jan 4, 2016
Simulate the fictitious play dynamic for the game in Shapley (1964).
Simulate the fictitious play dynamic
for the game in section 5.3 of
Shapley, Lloyd S. "Some topics in two-person games."
Advances in game theory 52 (1964): 1-29.
Author: Jyotirmoy Bhattacharya,
The author has placed this program in the public domain
jmoy /
Created Jul 23, 2013
Visualizing a 2D random walk using Python, Cairo and GTK
Random walk on two-dimensional grid
(c) Jyotirmoy Bhattacharya,
import random
import gtk,gobject,cairo
import math
jmoy /
Created Mar 5, 2011
Compute the weighted median
Calculate the weighted median
(c) Jyotirmoy Bhattacharya [], 2011
Licence: GPL
import itertools as it
def ecdf(vw):
ans = []
jmoy /
Created Feb 25, 2011
Create Asciidoc table of MySQL database schema
Create Asciidoc table of MySQL database schema
Usage: <database> <username> [password]
If you have AsciiDoc installed you can use the following to produce a pretty HTML file of your database schema: mydb myusr | asciidoc -a toc - > schema.html