Iterators VS Generators: Go’s latest YAGNI feature
The new release of Go v1.23 brought us this new feature called “iterators”, or “rangefuncs”, or “range-over-funcs”. Nobody knows what the real name is but you might have seen them around the interwebz. Recently I saw it shared on LinkedIn and every time I see it, there’s always the same textbook example:
func Backward[T any](s []T) func(func(int, T) bool) { return func(yield func(int, T) bool) { for i := len(s)-1; i >= 0; i– { if !
LeMuR: a way to “ship your machine to customers”
When someone says “It works on my machine”, the consensus achieved by the Internet Hive Mind is to reply with “we won’t ship your machine to the client”… Ugh, computer nerds think they have a sense of humor.
I am here to tell you that yes, we can ship your machine to the client. We’ve had that technology for years! And no, I’m not talking about containers, this tech is even older!
Meet PinguL: A Programming Language I created
I took a Compiler Design course during my Masters. We were tasked to create a compiler for a subset of Java, they called it “MiniJava”. It’s somewhat of a “rite of passage” and funnily enough, for a lot of my peers, the course was their introduction to Finite State Automata and Regular Expressions. I was already a skilled RegEx craftsman at that point, and reading RegEx on a whiteboard was never something I appreciated… Suffice to say I skipped most of the classes.
Caboose: a Redis-compliant Afternoon’s Work of Genius
TL;DR: I built an In-Memory, Redis-compliant (to some extent, don’t get your hopes high) Key-Value Data Store. It took me a bit over 2 hours, but it works and it sucks at the same time. You can find it in my GitHub: aziflaj/caboose
Obligatory Backstory My experience with badly written databases goes way back to 2012, when I wanted to develop a social network in C++ (however crazy that sounds). I had no idea SQL was a thing, so I implemented the persistence layer myself in binary files and spaghetti code – you might even call it an “Object-Oriented DataBase Management System”, an OODBMS.
Solving the Schönbrunn Puzzle using Depth-First Search
During my Eurotrip this July, I visited a few cities around Central Europe. One of my destinations was Vienna and as any other boring tourist, I decided to take a stroll at the Schönbrunn Palace, Habsburgs’ summer residence. I will spare you the touristy mumbo jumbo and tell you about this nice little puzzle I found in their maze garden.
It’s a little math puzzle that looks like this:
And the rules are simple: you start at 1 – the middle tile of the bottom row – and you walk around the board as many cells as the number says (ignoring the sign), without stepping twice on a tile, until you reach the middle tile.
The Curious Case of Port 6000: A Comedy of Errors and Chromium’s Shenanigans
A while ago I started working on a side project, mainly to experiment with some technologies I don’t use on a daily basis. I had been working on a REST API for a while, had it running on a container on port 3000, as you usually do; there’s a nice ring to 3000. It works for Andre 3000, why wouldn’t it work for me? I also had it tested, both with automated testing and some manual testing via Insomnia, and when things started looking good, I moved to the frontend.
Little Space for Things of Little Importance - Tinkering with Compression
I was watching this video from Numberphile where Zoe Griffiths tries to memorize the sequence of Red and Black cards. And I was thinking, “this is a good example to explain how compression works”.
A compression algorithm can either be a lossless or a lossy algorithm. A compression algorithm is considered lossless when there is no information reduction after compressing; these kind of algorithms work by reducing statistical redundancy, e.g. by back-referencing repeated portions of the data.
The No-Bullshit Guide into Building Software
Yesterday I did a presentation titled “The No Bullshit Guide into Building Software”, as a way to share my experience in the industry regarding what I’ve seen is a good approach when building, or helping engineers build better software. This blogpost is created by reusing the notes I wrote before the presentation, and what was said during the event doesn’t go far away from what is written here. You can find the slides here
How do I Vim
My first editor was Notepad. Not the ++ version, the plain old white one that lacks syntax highlighting, smart indentation, and basically everything you need to write code. All it did was help me create files with different extensions. That’s not a big deal when all you’re writing are Windows Batch scripts, but it does get harder when you go beyond the script kiddie stage. Since then, I have switched through a handful of code editors and used them for a while before deciding they were garbage and moving on to the next one.
Designing a Better User Experience for My Fingers
Those of you who know me must be surprised I’m even considering writing about UX. For those who don’t know me, I believe an introduction is due. I am one of those people who stare at the terminal for hours every day, either fixing bugs or writing them. Sometimes I have to do some clicking around to manually test the code I wrote, but most of my time is spent either executing commands in a terminal, or writing code in a terminal-based editor.