Posts

Timeline of Sikh Affairs & Experiments with AI

Image
I wrote an AI-assisted Python program to take my Web-based  timeline of Sikh affairs and convert it into a 169-slide PDF for easy viewing.  I started this project as a way to create a more user-friendly way for people to consume the timeline I created years ago based on  many hours of research and analysis over a number of years. My goal was to improve the formatting and add images for a more informative viewing experience . In other words, how to use the content you have and breathe new life into it . The programming effort took a couple of half days and some 500 odd lines of Python code. I used AI (Claude, ChatGPT, Perplexity) to provide suggested approaches and code, but didn't directly integrate it into my editor. I use Sublime for editing and selectively cut and paste recommended code as needed. The alternative is too intrusive and AI has free reign to make changes to your code wherein you eventually lose track and control over your program and no longer fully u...

Working with Markdown and PDF

Image
  Further to my previous post on Claude AI , since most of the GenAI tools (e.g. ChatGPT, Claude) present their default results in markdown, I have been looking for a reliable way to render the markdown.  Additionally, I want to be able to highlight, annotate and save the results for future reference. I reviewed a number of PDF tools. Adobe Acrobat (too expensive) Foxit PDFExpert (doesn't handle PDFs generated from markdown too well; while trying to highlight, it keeps selecting two lines instead of one) PDFGear (great for structuring if you want to add bookmarks like I did for Saurabh Mahapatra's thesis on Adobe Experience Platform's Data Distiller, but not much else) Skim , the most unpretentious on the tools on the list. But it handles highlighting on PDFs generated from markdown just fine. But more importantly, it refreshes when I update the PDF from markdown. My choice of Skim requires further elaboration. When I am researching a topic on Claude, I am constantly upd...
Image
  I spent the Saturday assembling a cedar planter, catching up with a college friend from IIT Roorkee, and exploring Anthropic's new model context protocol for their AI tool Claude.  Yup, that's how I roll! Claude now has richest set of MCP servers  that can be integrated into Claude to augment its capabilities to, for example, search the web (think of it as a sort of RAG), search your filesystem, search your Google Drive, and best of all, save memories about your preferences that Claude can recall and leverage in future exchanges. Think of MCP servers as Anthropic's open-source framework aimed providing a bridge for AI agents or agentic AI to access real world data . In large language models (LLMs), "context" refers to the information the model can "remember" during a single interaction — typically the prompt, any system instructions, and previous exchanges. This is often measured in tokens . One more thing, unless you're running a quantum ...

Solve It! Getting the kitchen sink to drain reliably

Image
  How To Solve It by G Polya I am starting a new "Solve It!" series of blog posts. This book came highly recommended to me many years ago and sadly I never gave it enough of my time. If I can still find it in my shed, I will give it another attempt. It thought of the book because I was reminded of it while trying to come up with a title for this series of blog posts. The book talks about problem solving strategies in mathematics. I won't discuss math here, but the idea is the same. You have to be a deep thinker to solve everyday problems. Contrary to Nobel Prize winners and such, my fascination in life has been with solving the common problems that plague us. The problems are common but the solutions often seem to evade us. This blog series will provide a few examples. Getting the kitchen sink to drain reliably If this sounds like a trivial problem to you, it is likely because you don't cook much or you just call the plumber. Here are the key elements to consider. The...

The Rage That Is Raita

Image
  (The stock images of raita above are lame. But they will have to do until I can replace them with one of my own.) (Madani, used in India as a whisk to turn the yogurt into a homogenous state.) (Homemade yogurt.) (Boondi strainer.) My Distaste for Milk My obsession with raita might have its origins in the distaste I developed for milk after moving from Canada to India at the age of 3. Canada generally uses cow milk and India uses mostly buffalo milk, since cows are considered scared in India.  Furthermore, in Canada milk arrived in pasteurized form from the supermarket. Whereas in India the milk arrived at your doorstep in the form known as raw (or unpasteurized) in the West.  So, my mom would boil it, which would result in the formation of malai (clotted cream) on top of the container of boiled milk once it was left to cool off. I never liked malai and was constantly struggling to remove it from my glass of milk. Furthermore, to make my life even more miserable, we were...

Multitasking Is Good

Image
  Over the last decade or more I've gotten into the habit of reading multiple books at once .  I'm using the multitasking analogy from how computers appear to be running multiple applications or programs at once. Let's consider a scenario . You're writing a report using Microsoft Word and you're also searching on Google to get answers to questions you want to address in your report. Your Chrome browser is also running a tab with Gmail and just alerted you to inform you that you have a reminder email letting you know that your report is due tomorrow.  All of this is seemingly happening concurrently . That is what we generally mean when we talk about multitasking. To keep things simple, let's take the single processor (CPU) example. Since it's a single processor, it can really only be running one application at a time. So, what's actually happening is that the processor is switching between the three applications (Word, Google Search, and Gmail) several t...

How LLMs Work

Image
If you want to understand how LLMs work, this video is BOMB. Will you be writing your own LLMs soon? You could. But better to think of it as the equivalent of being able to see the list of recommended actions suggested by your dealership during your next oil change and feeling confident enough to say, "Do these 2 now and let's defer the rest until next time." If you really did want to build your own LLM, this book with code on GitHub  is probably one of the best resources. But an even better approach is to learn from the video and the book and then "teach" it (little or no coding, once you understand the levers available to you) to do your bidding. Good luck!