Rust tokio task cancellation patterns

Update: 19/04/2024 colorfulchew correctly pointed out on Reddit that using drop on the task handle does not actually cancel the task – you must use abort() to cancel the task instead. abcSilverline mentioned that I misread the official documentation that explicitly says that “when it is dropped, which means that there is no longer any handle to the task, and no way to join on it.” I have been trying to pick up Rust again recently. [Read More]

Circular Buffer Performance Trick

UPDATE 12/04/2024: I’ve received some great feedback from various communities about this post and I’ve incorporated some of it into this post. Speficially, I’ve added: alternative Rust implementations skipping the usage of Vec<String> in favour of String using std::collections::VecDeque instead of implementing it by hand mention of a Go module that implements deque I have been hacking on AI agents recently for both fun and profit as part of the work I’m doing for one of my clients. [Read More]

A Small Tool for Exploring Text Embeddings

Last year I wrote about the superpowers text embeddings can give you and how I tried using them to compare the song lyrics of some music artists. Though the results failed to paint the picture I hoped for – this was due to the methodology, or rather lack thereof – it made me appreciate the importance of simple open source tools (OSS) in the currently booming AI/LLM space. To get to the point of displaying the embedding projections in the blog post I had to jump through some hoops and combine a lot of different Go modules before I could finally generate the nice interactive plots from the computed data. [Read More]

On The Importance of Getting The Foundations Right

Throughout my career, I’ve learnt, usually the hard way, the importance of getting the foundations of whatever I was working on right. Or at least as right as possible. I learnt how fundamental it is for setting your project — and by proxy, your team — up for success. I’d argue it’s one of the most important things you should pay attention to. Getting the basics right is notoriously hard due to the inevitability of changing requirements, external factors, etc. [Read More]

Fun With AI Embeddings in Go

Update 9th January, 2024: Changed the title to “Fun With AI Embeddings in Go” Before the end of last year, I visited San Francisco (SF) for a few weeks. It felt great meeting some old friends and ex-colleagues face-to-face after a long hiatus. There is something incredibly refreshing about being in the same room with the folks you’ve spent chatting to so much time over the past few years on Zoom or Slack. [Read More]

Some [career] advice for engineers

This blog post is a collection of advice or rules I’ve learnt to live by as a software engineer. It’s an accumulation of experiences I’ve gained through working for software organizations of various sizes. Most of the advice in this post is aimed at software engineers, but some may be applicable to other roles and industries. Understand the problems you are solving This isn’t a revolutionary idea. But the very sad reality of life is that it still hasn’t been internalised by so many engineers and organisations that it’s worth reiterating. [Read More]

A Few Counterintuitive Ideas

UPDATE: 4th January, The way out of burnout The beginning of 2021 marked the point when some of us were bracing with hope for the year that lied ahead. The year that we hoped to be “better” than the one that we were leaving behind. Little did we know we should have braced for impact instead. For me personally, if 2020 was bad enough then 2021 wiped the last shreds of whatever mental resilience or energy I had left in me. [Read More]

Getting Started With LDAP in Go

Recently I had to write a fair amount of Go code which interacts with Active Directory (AD) for one of my clients. AD uses Lightweight Directory Access Protocol (LDAP) [1] for client-server communication. LDAP is a very mature and powerful protocol to interact with directory services, though some of my friends argue that it’s a bit of a relic of past at this point. I disagree with this sentiment, but my explanation why would probably take a whole another blog post. [Read More]

Build a Graph of Kubernetes API Objects in Go

Over the past few months, I have been rekindling my interest in graph theory. I’m not quite sure what has caused this shift in my mind as I didn’t play with graphs too much since I graduated many moons ago, besides the occasional interview preparation. Maybe it was my reading about all the new graph databases that have come to existence over the past few years, or maybe it was my interest in the Graph Neural Networks which also seem to have (re)gained a lot of attention in the research community or maybe, stimulated by the recent coronavirus outbreak, it was the result of my random thinking of the ever so increasingly interconnected nature of our world. [Read More]

Happy 5th Birthday Kubernetes London

On 26th March Kubernetes London Meetup planned to host another event. It was supposed to be our 5th birthday so we had worked hard to make the event, to quote Kelsey Hightower, “Dope”. Unfortunately, it wasn’t to be as the coronavirus disrupted all levels of public life in a way our generation never experienced before. This blog post is the long version of the short talk I wanted to give at the event to walk through some of the most memorable experiences I’ve had in the past 5 years as one of the Meetup organizers. [Read More]