A Tiny Q-learning Example in Python

I wanted to get a better sense of the temporal-difference update rule. So took some help from Claude and wrote a small Q-learning program. Just uses the python stdlib. The code lives in q-learning, managed with uv. ...

June 29, 2026 · 2 min · Bharath

A Tiny Agent, v2: Python and the Sarvam API

After the Go tiny coding agent, I rewrote the same thing in Python, this time pointed at the Sarvam API instead of Gemini. Sarvam is an Indian company which is trying to work Indian Sovereign. The models are strong on Indian languages, which made it interesting to target. The code lives in test-agent-v2, managed with uv. Functionally it is the same agent: a stdin-driven loop, the same three file tools (read_file, list_files, edit_file), the same Sudarshana ☸️ agent. I had typed out most of the v1 agent by hand with as little AI help as possible. I just wanted to get into the weeds of the mechanics, ser-deser, order of various operations, different data structures needed etc. This time I felt confident I could relate to the different parts of the agent. So I just asked Claude to rewrite it in python. ...

June 28, 2026 · 3 min · Bharath

How to use spark with anaconda python

The setup is spark 1.5.1 running on yarn (hadoop-2.6.0). # Install anaconda python on all nodes of the cluster. # Below we are installing anaconda's python-2.7 64-bit package. wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda2-2.4.1-Linux-x86_64.sh bash Anaconda2-2.4.1-Linux-x86_64.sh -b -f -p /usr/lib/anaconda2 # Run this on all nodes of the cluster and restart the ResourceManager/NodeManager daemons. echo "VIRTUAL_ENV_DISABLE_PROMPT=1 source /usr/lib/anaconda2/bin/activate /usr/lib/anaconda2" >> /usr/lib/hadoop2/etc/hadoop/hadoop-env.sh # Set some env vars and start pyspark. export PYSPARK_PYTHON=/usr/lib/anaconda2/bin/python export PYSPARK_DRIVER_PYTHON=/usr/lib/anaconda2/bin/python /usr/lib/spark/bin/pyspark --master yarn-client --executor-memory 512m --executor-cores 1 --num-executors 2

December 12, 2015 · 1 min · Bharath