View knights_tour.cc
/* | |
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 knight_tours.cc -o knight_tours |
View CompetitiveStoragePython.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View wheat.py
#!/usr/bin/python3 | |
""" | |
Download wheat price data from http://agmarket.nic.in | |
Data is saved in file wheat.csv in current directory | |
Author: Jyotirmoy Bhattacharya, Ambedkar University, New Delhi, jyotirmoy@jyotirmoy.net | |
""" | |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys |
View gali_ch3.R
library(QZ) | |
# 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 |
View spellcorrector.cc
/* | |
An implementation of Norvig's spelling corrector | |
Original: http://norvig.com/spell-correct.html | |
Author: Jyotirmoy Bhattacharya [jyotirmoy@jyotirmoy.net] | |
Must be compiled as C++14 (-std=c++1y for g++) | |
*/ | |
#include <iostream> |
View singular.lhs
\documentclass{amsart} | |
%include lhs2TeX.sty | |
%include lhs2TeX.fmt | |
\begin{document} | |
\title{Lazily Computing the \\Singular | |
Function of Bold Play} | |
\author{Jyotirmoy Bhattacharya} |
View shapley.py
""" | |
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, jyotirmoy@jyotirmoy.net | |
The author has placed this program in the public domain |
View rwalk.py
#!/usr/bin/python | |
""" | |
Random walk on two-dimensional grid | |
(c) Jyotirmoy Bhattacharya, jyotirmoy@jyotirmoy.net | |
LICENSE: GPL3 | |
""" | |
import random | |
import gtk,gobject,cairo | |
import math |
View wmedian.py
""" | |
Calculate the weighted median | |
(c) Jyotirmoy Bhattacharya [jyotirmoy@jyotirmoy.net], 2011 | |
Licence: GPL | |
""" | |
import itertools as it | |
def ecdf(vw): | |
ans = [] |
View pretty-schema.py
""" | |
Create Asciidoc table of MySQL database schema | |
Usage: | |
pretty-schema.py <database> <username> [password] | |
If you have AsciiDoc installed you can use the following to produce a pretty HTML file of your database schema: | |
pretty-schema.py mydb myusr | asciidoc -a toc - > schema.html | |
""" |