Welcome to my dev journal. I mostly write about python and machine learning stuff.
Tokenisation
As we all know, neural networks understand one and only one thing i.e. numbers, so how are they able to work with text data like "what's your name?"? If that’s the case, then how do we convert text into numbers, what’s the best way to do it, and is one way better than another and why? We need a way to convert text into numbers and numbers back to text. ...
Hotfix 1: Redirect or Rewrite
This is the first edition of the Hotfix series, in which I document an issue I encountered in production and how I fixed it. We were in the midst of cleanup activities aimed at removing technical debt. Part of this effort focused on removing APIs that were no longer in use. It was silly of us not to properly define “no longer in use.” A proper definition should account for backward compatibility, especially when dealing with mobile apps rather than websites. Websites always fetch the latest version, so backward compatibility is not an issue, but there is no such guarantee with mobile apps because it depends on when users update the app. ...
Gemini Tool Call
Working with gemini-live-2.5-flash-native-audio (of course, naming things is not Google’s strongest suit—remember Bard?) has its own ups and downs. No doubt, the liveliness, expressiveness, and language capabilities are really good, but tool (function) calling had me thinking otherwise. Reducing unintentional tool calls is especially important for our use case, as it involves taking images via voice commands. A photo taken unintentionally makes it look like the device is taking photos by itself. ...
Websocket
If you go through weboscket.org, you will see the essential events are onopen, onmessage, onerror, onclose. Naively I assumed that authentication should happen in onopen event. But this resulted in an unanticipated security breach. But first the normal web requests. In a normal requests, I can send custom headers like Authorization: Bearer token. This works, because the browser makes the preflight request, asking the server "I am about to make this request with this header and this method, do you allow it?". At this stage the server can reject this request, if either the method or the header doesn’t exist. ...
Cognitive Load
With the recent update of claude (which is a significant improvement), like many, my programming style has also changed. Unlike the old days (it’s just been a few weeks, and it’s already old), I don’t write code “manually”, like laboriously typing def before every function — I simply ask claude to do it. Even for the smallest of tasks, I would much rather type "please commit the recent changes and push to remote" instead of git add . && git commit -m "(wip)" && git push. In other words, I have completely shifted to “Agentic Coding”. The advantages are clear: I am certainly writing more code and shipping faster, plus while claude is thinking and writing the code, I get mini breaks to scroll through Instagram slop. ...