This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Get Wikipedia watchlist as an RSS/ATOM feed | |
(c) Jyotirmoy Bhattacharya, 2007 | |
Usage: wikiwatch <username> <password> [format] | |
[format] is either 'rss' or 'atom' | |
""" | |
import sys | |
import xml.sax,xml.sax.handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A script to keep score for a version of Rosenthal's centipede game. | |
The rules are: | |
1. There are two players. | |
2. At the beginning of the game the players have 1 point each. | |
3. The players get turns alternately. | |
4. On their turn a player can choose to continue (C) or stop (S). | |
5. If the player chooses C, 1 point is taken from their account | |
and 2 points are added to the other player's account. | |
6. If the player chooses S, the game stops. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Calculate the weighted median | |
(c) Jyotirmoy Bhattacharya [[email protected]], 2011 | |
Licence: GPL | |
""" | |
import itertools as it | |
def ecdf(vw): | |
ans = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
Random walk on two-dimensional grid | |
(c) Jyotirmoy Bhattacharya, [email protected] | |
LICENSE: GPL3 | |
""" | |
import random | |
import gtk,gobject,cairo | |
import math |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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, [email protected] | |
The author has placed this program in the public domain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{amsart} | |
%include lhs2TeX.sty | |
%include lhs2TeX.fmt | |
\begin{document} | |
\title{Lazily Computing the \\Singular | |
Function of Bold Play} | |
\author{Jyotirmoy Bhattacharya} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
An implementation of Norvig's spelling corrector | |
Original: http://norvig.com/spell-correct.html | |
Author: Jyotirmoy Bhattacharya [[email protected]] | |
Must be compiled as C++14 (-std=c++1y for g++) | |
*/ | |
#include <iostream> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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, [email protected] | |
""" | |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys |
OlderNewer