Chennai by Cycle
This is a short writeup on my cycling experience in Chennai that I sent to a newspaper. It might not get published given the time elapsed since I sent it, so putting it up here.
Recent content on Codaholic
This is a short writeup on my cycling experience in Chennai that I sent to a newspaper. It might not get published given the time elapsed since I sent it, so putting it up here.
Just some fun working out relativistic rocket physics .. of the kind presented in Project Hail Mary. There, the protagonist is in a rocket turning 6g of mass into pure energy every second in order to accelerate and eventually also decelerate. The rocket apparently had about 2 million kg of “astrophage” as fuel and needed to cover a distance of about 12 light years to Tau Ceti.
Recently I got curious about p-adic numbers and was wondering how to construct them just using lambda calculus. Why? No real reason except to entertain myself. I realized that to do that I need to first represent modular numbers – i.e. numbers as equivalence classes of the natural numbers – and the arithmetic around them before I can proceed to do this. So this is a follow on to the…
Damn! Not a day goes by without pondering over the nature of CS-ed going forward, given “AI coding agents”. Status : DRAFT THOUGHT DUMP
I recently thought-encountered a physics situation in which all charges appear stationary and yet a magnetic field appears. Here I’ll try to examine this situation in a few different ways.
One day I just happened to wake up thinking of Fermat’s last theorem and an urge to try and get a feel for why it is plausible at all. I don’t have the math chops to grok Wiles’ proof, but was just reaching for something which could suggest to me why it might be true at all. This is what I came up with.
Status : Draft (and will likely remain so due to the spirit of the thing) I came across mathematician Timothy Gowers’ youtube video - A strange determinant some time ago. 1 In that video, he captures in real time his approach to a maths problem he hadn’t solved earlier. I really appreciated what he did there as this has been inspirational at so many levels and I’ve been citing…
Will Crichton in Evaluating Human Factors Beyond Lines of Code recapped and outlined how programmers are users too and so programming languages need to be looked at through the HCI lens. He suggests using more precise vocabulary than “usability” and mentioned the cognitive dimensions of notation paper as providing some to consider. I thought it might be a useful exercise to try and…
Matrix exp and log calculations typically involve eigen-decomposition which is not very GPU friendly. For matrices with “well behaved” eigenvalues, the calculation approaches in this post seem to work sufficiently well without using eigen decomposition or matrix inverse.
Sort of a fun “what if?” question in physics – What if we considered gravity to be approximated by a weaker “secondary” force in addition to the usual attractive force … similar to how the magnetic field relates to the electric field, and let it obey similar equations?
Ok, I was nerd-sniped by the problem at https://xkcd.com/356/ . But I’m wondering if I managed to survive it somehow.
( Status : draft) I’ve long held a view in my mind that the very well known Pythagorean “theorem” is not a “theorem” – in the sense of being able to be derived from a set of axioms through logical deduction. I want to jot down this thinking here because I think it is important for pedagogical reasons … but mostly I just want to get it off my chest even if…
I’ve never quite felt that I understood what “measurement” means in quantum mechanics and my recent engagement with quantum computing surfaced this rather starkly. I’m not talking at the handwaving level of “wavefunction collapse” and such esoteric things. I just want an ordinary close hand-lens view understanding of what measurement is, even if incomplete at…
(This post was originally posted on the Imaginea blog on 27 May 2016 . That blog now no longer exists, so I’m reposting it here. I have The Internet Archive to thank for keeping a copy of the text and my colleague Srikant Patil for his help recovering the images originally presented in this post from an archive.)
Constrained randomness is useful in adding a dash of variety to computer composed music. Picking values that fit a parametric probabilty distribution whose parameters are used for control is therefore a common case. Here I describe how to do that given access to only a uniform random number generator in the unit interval.
There is no dearth of explanations of the Fourier transform on the internet. Being a believer in understanding a concept from as many perspectives as possible, I welcome all of them. Here I offer yet another perspective that is “intuitive” in its own way and yet is not something I’ve seen presented often or presented in yet more mysterious ways.
Kurals are posted in public transport in Chennai - trains as well as buses. When taking them pre-covid to work, I used to amuse myself by translating them into techie parlance. These are gathered from my tweets. Maybe I should expand the collection and maybe I will, but for now, here it is. I feel the fun of doing this is spoilt if I provide the actual translation in English too.
In issues of policy and negotiations between countries on actions to be taken to mitigate climate change, the country-level figures that get discussed are either total emissions or per capita emissions. While total emissions is an important figure, per capita emissions gets all the attention. I’m starting to think that might be the wrong number to focus on.
(This note on Alain Aspect getting the 2022 Nobel prize was shared by Prof. Sivakumar Srinivasan of Krea University. I’m posting this note here with his permission. I’ve taken a bit of liberty to split into paragraphs for easier reading. No other changes to his note.)
Alonzo Church’s insight that lambda is sufficient to express all of computation is a non-intuitive stunning revelation. Showing that numbers can be represented using lambda alone using what’s come to be known as “Church numerals” is also brilliant. However, subtraction was a problem with plain Church numerals. Kleene solved that by using a pair of numbers instead. However…
THIS IS A DRAFT v1 as of 9 June 2022 . Posting it early. Beware of bugs/errors. Will remove this notice once they’re cleaned up. Will also post full code soon. I present the transformer architecture from ground up in Julia in this post. While my main purpose is to understand it in all detail without relying on any framework, I’m also hoping to try this out a way to teach machine…
This is a post by my kid, His first post! The rest of the text below is his attempt at explaining odd and even numbers.
My kid’s math teacher recently posted a puzzle for the parents that got me down a rabbit hole of sorts and made me reflect on a number of things. This post is about that … and I mix the math and programming bits. I describe the puzzle in the first section and then the rest reveal aspects of the solution. So if you want to avoid the spoilers, you should stop reading after the first…
When talking about vector spaces, the notion of a dual vector space seems to often be introduced via postulates, such as in the excellent theoretical minimum series by eminent physicist Dr. Leonard Susskind. While that’s fine, I like an approach using linear functions, which I’ll present here. I learnt this from somewhere obviously, though I don’t recall where from.
As a TLA+ newbie, I found the fairness (weak and strong) formulae in TLA+ a bit hard going initially, so sharing the way I managed to wrap my head around it in case it is of help to others. What I’m hoping to get to is to be able to “read” the formulae in a chunked manner so that they make logical sense to me.
(originally posted on the Imaginea Labs blog - https://labs.imaginea.com/inai-rest-in-the-small/ ) The Inai project (forked here ) began as a light hearted attempt to explore the consequences of bringing REST principles to organizing components within a single server node. It started off with the following question - Given we know that REST principles are useful to organize the development,…
The Matrix Calculus You Need For Deep Learning (MCYNDL) is a great summary of what you need and expands starting from pretty much the basics. However, I’ve always felt that introducing the index notation used in physics can help simplify what looks like complicated math, even in that simplified intro. So here is my attempt at re-presenting the material in that paper, but using the simplified…
Tools in the “Scientific Machine Learning” (SciML) space have been getting more sophisticated and general purpose. While going through some material regarding “universal differential equations”, I couldn’t help dream up potential applications to tough problems in physical modeling synthesis of musical instruments .. particuarly interested in the vina family of…
The async/await facility in ES5 is perhaps the single biggest readability boost to async code in Javascript - both in NodeJS and in client-side JS code. With async/await , code that does async activities starts to read like synchronous code with the keywords async and await thrown in at appropriate points. But don’t lose sight of opportunities for concurrency while settling into the comfort…
This is a stub post linking to material presented during my talk titled “I’m LisP. I’m inevitable.” at the first Chennai Clojure meetup at Pramati Technologies.
I gave a talk at the “Mixed Nuts @ Pramati” meetup on 2019-08-24 10am-12pm on WebAssembly. This post contains notes from the talk - sort of almost-transcript. Simul-posted at https://labs.imaginea.com/talk-the-nuts-and-bolts-of-webassembly/
A prized principle of design is the hiding of unimportant details from the users of a product that enables them to work with it without getting overwhelmed by its possibly complex inner workings. This act of deciding that something is unimportant and hiding it behind a simpler facade is what abstraction is about. In this sense, abstraction, when it works, is considered A Good Thing™.
It’s hard these days to impress kids with stuff computers can do that felt like magic back in the early days. Turtle graphics, even the venerable Scratch don’t have the wow factor from the get go because .. the kids have seen too much already. Here is how I (re)discovered something magical in a moment of resistant engagement with my 6-yr old when he persistently asked me to…
Collecting a bag of what I think are good ideas in the history of programming, which lead to better thinking about system design, implementation and evolution. Note : This post will continously be edited to include ideas as they come to my mind as worthy of being included here. Also, the ideas are in no particular order and this is just a brain dump.
(Status: Draft) We saw how we can try to calculate derivates of a function while evaluating the function in the first and second posts on automatic differentiation. Those dealt with only functions of a single real number. While that is illustrative of the approach, it was merely warm up so we can deal with differentiable functions of multiple variables that yield multiple values - i.e. vector…
In the earlier post , we saw how we can calculate the derivative of a function as a function itself. We may not need to do that, but may want the value of a function’s derivative to be calculated while the function expression is being evaluated.
At Pramati Chennai, we’ve been having a series of sessions on math. The purpose is to try and connect many concepts usually considered as separate. We’re currently on a track to understand functions of multiple variables and their calculus. Along the way, I thought it might be a good idea to try and introduce automatic differentiation in a programmatic way so people have a taste of how…
(This was originally written on May 25, 2015. Publishing it ‘cos a former colleague actually recalled it after all this time when even I had forgotten about it.)
I gave a talk last evening at a meetup at Navis giving a soft introduction to machine learning for an audience of mostly developers and QA engineers. I’m sharing the slide deck and also some corrections of mistakes I did in the talk.
ECMAScript’s new async functions and generators simplify working with concurrent I/O code. While they work hand-in-hand with Promises, there are some subtleties that either seem to be underspecified in the language or not talked about much.
My son is learning about integers at school. It is quite a challenging topic to come to, especially as, thus far, for him, trying to understand it purely based on the familiar is both a necessity and a tough challenge due to the novelty of the idea.
I loved Naseeruddin Hodja stories when I was a kid. Heck I love them now too. They give me a good laugh and, as is common with good humour, manage to point at some truth once in a while. One of these is a story where Hodja is searching for something in the garden. His wife asks him what he’s searching for and he replies he’s searching for his ring. She then asks him about where…
I happened to have picked up quantum mechanics from Feynman’s lectures and Dirac’s book before I got around to my main stream theory of linear filters during my B.Tech. So I went through a somewhat weird path of understanding the math around filter theory based on the quant-mech math I’d picked up. I do think it is clearer than the way linear filter theory books deal with the…
async and await are, I think, the best thing to happen to Javascript, though I’d very much like something like sweet.js so I can invent it when I needed it most. However, I mostly see them being described in terms of promises. Here, I show how you can implement CSP style channels using them without using promises.
(Cross posted from Imaginea Labs ). The distributed ledger protocol used by blockchains has resulted in systems where we do not have to place trust in particular parties involved in maintaining these ledgers. Moreover the ledgers are programmable with “smart contracts” - transactors whose state changes are recorded and validated on the blockchain. A collection of smart contracts describes a system…
Blockchain tech, especially smart contracts, are the hot new “internet”. Post the creation of Bitcoin, we’ve seen the rise of the public smart contract system Ethereum and several private systems like Linux Foundation’s Hyperledger. These distributed ledgers have become the brand new foundation to build apps on. This is as app developers hope to leverage the additional…
Can we have a signin/signup flow that is email-based and passwordless similar to a “forgot password” flow but where the URL will work only for the initiator, and only once per signin? This is the scheme I’ve implemented on Patantara and I describe its innards here.
Recently, many techies have spilt words against doing the Google interview process. Broadly they feel their real and demonstrated abilities are not being valued. The most famous of these cases is Max Howell - the developer of homebrew - being rejected in the interview. Following Google, Amazon and the like, much smaller companies have also begun to subject interview candidates to such…
When asking software engineers for an estimate of the time required to build something, I often find them guessing the time taken instead of doing the work to estimate it. Yes, estimates come with their own caveats but, like planning, if you don’t estimate well, you may not have an idea of what you’re actually dealing with. Here is something that I did with my kid yesterday that…
Traffic in any major Indian city can seem crazy to an outsider. Crazy, scary, impossible, noisy, unruly, chaotic, .. and you can keep on rattling adjectives without ever ending up in a jam. Of these cities, Chennai is perhaps the craziest .