Posts
Kind of method overriding in Go
Go’s approach to Object Go is a fairly simplistic language and doesn’t come with inbuilt classes and other features that most object oriented programming languages have. It gives you building blocks in the form of structs and it’s upto programmer to design the abstraction around it. There is no inheritence - Go takes a very strong stance on composition over inheritence camp. (even other languages have practitioners who preach composition over inheritence but it’s not strictly enforced).
read morePosts
Thinking about Gall's law - Designing Systems
I encountered this quote while reading Martin Klepmann’s Designing Data-Intensive Application which got me thinking:
A complex system that works is invariably found to have evolved from a simple system that works. The inverse proposition also appears to be true: A complex system designed from scratch > never works and cannot be made to work.
John Gall, Systemantics (1975) This is a famous “law” in software engineering. (although the original context in which the author said this is in regards to general systems (mechanical systems like Titanic ship or human systems like an organization; come to think of it, even software systems are just an extension of such systems).
read morePosts
Notion of time; Distributed Systems
Time is not just an abstraction Of course time as we know in a day to day sense is an abstract thing. It’s a concept we defined to measure something. (like we defined length to measure how long something is or weight to define how heavy something is). But behind that abstraction is a physical reality. Events are a manifestation of that reality which really give us a sense of time.
read morePosts
Geo Routing (Craigslist Example)
Geo-Routing (Case Study on Craigslist) When you open craigslist.org it does a couple of redirection before finally landing on the subdomain closest to your city. Having separate sub-domain and listings for those particular cities is partly how it seems to handle the distribution of the content. (making it more scalable)
Give it a try: https://craigslist.org
Here is the journey of the request:
curl -I craigslist.org HTTP/1.1 301 Found Location: https://www.craigslist.org/ redirected to https://www.
read morePosts
ChatGPT Notebook - A Chrome Extension
Trend of LLM Large Language Models continue to find new use cases. Though they started off as smart chatbots developers are using the open source models (thanks to corporates like Meta who open source models and no thanks to OpenAI) and fine tuning them to be used for specific domains. It’s so obvious that in the future these LLM are going to be our personal copilot, our wingman each tailored to each individual.
read morePosts
Literate Programming
Literate Programming Python notebooks are so ubiquitous in the Machine learning community. All the cloud providers have dedicated services to run these notebooks: Jupyter on AWS, Jupyter on Azure, and Google Collab. These are popular largely because of how we can accommodate both code and instructional text in the same file. With each individual cell as an executable code block or a properly formatted markdown text, this makes it much easier to present information, document the information and make it a better educational material.
read morePosts
Quirks of Query Planner
Query Planning Every SQL database (postgres,mysql) has a query planner built into it whose job is to find the best strategy to come up with the results given the query, its predicates and other expressions. Following examples are from postgres where I explore around how query planner makes its decision based on the data size in the table and the state of the database even in the presence of index.
read morePosts
Using taskwarrior to stay disciplined with side projects
Taskwarrior Taskwarrior is an OSS CLI (to make it fancier, let’s call it TUI - terminal UI) based task manager. I have been using it for sometime and it works great for my use case.
My Earlier Post on setting GUI notifications
I wanted some discipline in progressing with my side projects most of which are on github and here’s what I did:
set up a script which overrides task warrior’s data directory to current directory if it’s a git repository, this is so that I can segregate my todo tasks
read morePosts
SQL Injection - 101
SQL Injection Starting off with one of my favorite xkcd comic
SQL Injection is a way where a user is able to send some ‘code’ as part of the input data to the server all the way back to the database. (UI layer doesn’t sanitize/validate, API layer let’s the malicious ‘code’ reach the database because it’s not mindful in how to separate ‘query’ and ‘data’).
Taking the example from xkcd:
read morePosts
Currying in functional programming
Currying Currying is an idea of decomposing a function and making the expression more clearer. (Note: it’s just expression decomposition and not execution)
Example In Go: package main import ( "fmt" "strings" ) func main() { fmt.Println(someComplexOperation("hello", "there", "programmer")) fmt.Println(someComplexOperation("hello", "there", "manager")) fmt.Println(someComplexOperation("hello", "there", "CEO")) // Currying this function // By looking at the fuction we see that it can be decomposed, first step of computing from first 2 arguments // can be done and reused.
read more