2022 in Review

kuniga.me > NP-Incompleteness > 2022 in Review

2022 in Review

01 Jan 2023

This is a meta-post to review what happened in 2022.

Posts Summary

Speech Recognition

In the beginning of the year I was still hanging on studying machine learning for speech recognition. I was mostly still looking at “classic” algorithms related to Hidden Markov Models.

I started with learning about Dynamic Time Warping and tried to apply it with some degree of success Single Digit Speech Recognition via LPC + DTW.

I struggled a bit to follow the theory behind the Baum-Welch algorithm so I decided to brush up my intuition of probability via Discrete Probability As Counting. Then I wrote about the Baum-Welch Algorithm itself following up a Python implementation.

Finally I spent some cycles studying MacOS APIs for capturing Audio Data from Microphone.

Side Goals

One of my side goals for this year was to learn about the proof assistant Lean. I started with the “Hello World” of proofs, by working with the Peano Axioms and went a bit further by proving the correcteness of the Euclidean Algorithm.

Another side goal was learning about Topology. I read the book Introduction to Topology by Bert Mendelson and wrote about Topological Equivalence.

Work

Until March I was building a notebook-like tool at work, so I took a look at Jupyter’s Architecture for inspiration. I also published a post on Meta’s blog and posted about my personal experience developing SQL Notebooks.

In March I made a big transition! I’ve been doing mostly web frontend work (Hack/JavaScript) for over 10 years and decided to switch to distributed systems backend (C++/Python). I devoted a lot of posts to document my ramp up studies, in particular in C++ and Distributed Systems.

I had last worked with C++ in 2011, having used it in programming contests, during my Master’s and for my Google Summer of Code project. I missed the big changes that happened with C++11 so I was mostly catching up.

I focused on concepts I found confusing while reading/writing code such as Moving Semantics, Memory Management Choices, Smart Pointers and Type Traits. I also read cover-to-cover the book Effective Modern C++ by Scott Meyers and it was very helpful.

I’ve been reading Distributed System papers on and off for a few years already, but this year I had a specific motivation to read them! I read about Google’s FlumeJava and Photon, Flink’s State Management, Spark’s RDDs and Watermarks in Stream Processing.

I also read two great books on Distributed System: Designing Data Intensive Applications by Martin Kleppmann and Streaming Systems by Tyler Akidau, Slava Chernyak and Reuven Lax.

Leisure

I had great fun in writing a solver for a Calendar Puzzle I got as a gift. I also enjoyed learning about generating Random Points in Circumference and Buffon’s Needle.

I’ve rekindled my interest in Matroids and wrote about the Hungarian algorithm and Partition Matroids.

Personal

I usually don’t write personal posts except for retrospectives like this one, but I felt like writing about My Favorite Subjects and Memory.

The Blog in 2022

I kept the resolution to have at least one post a month on average, by writing 31 posts. The blog completed 12 years with 193 posts (some of which were ported and translated from my old blog in Portuguese).

The post Linear Predictive Coding in Python continued to be the most popular post and received 3.5k unique visits. Overall the blog had a total of 11.6k visitors.

This year the blog got its first external contribution: @adql fixed issues with the An Introduction to the Parsec Library post.

Resolutions for 2023

This year I dropped my resolution of studying machine learning for speech recognition midway due to having to ramp up on my new team and being generally unfocused, but I want to keep the resolution for next year.

I did accomplish my two side goals last year, so I’ll commit to two side goals again: I want to read a textbook on differential geometry or measure theory and learn TLA+, a formal specification language for concurrent and distributed systems.

Personal

The end of the year is a good time to look back and remember all the things I’ve done besides work and the technical blog.

Trips

In April we went on a trip to Kauai in Hawaii. It’s a really great island for hikers. We backpacked the Kalalau trail, a 20 mile hike that requires getting a permit.

a collage of photos from a road trip in Colorado
Top: 1. Taro field overlook; 2. Kuilau Ridge Trail; 3. Rainbow at Queen's Bath. Bottom: 4. View of the Kalalau valley from above; 5. A pair of goats during the Kalalau trail; 6. At the campground in Kalalau valley

In September we visited Banff and Jasper National Parks in Canada. It was my first international trip since the pandemic. Despite the shoulder season we got lucky with the weather.

I was in Banff in 2008 for the ICPC World Finals but it was during winter. It looks a lot more beautiful during the summer.

a collage of photos from a trip to Banff and Jasper
Top: 1. Peyto Lake; 2. Athabasca River in Jasper; 3. Medicine Lake; Bottom: 4. Sentinel Pass / Larch Valley trail. 5. Lake Louise and the Fairmont Hotel 6. Walkway in Canmore;

In October we went to Arizona and Utah to hike the wave and visit other places like the Antelope Canyon and the Horseshoe Bend. The wave is a really difficult permit to get and we had been entering the lottery for a long time, but it was worth the wait.

a collage of photos from a road trip in Arizona, Utah
Top: 1. The subway in Zion National Park; 2. Monument Valley; 3. The Wave. Bottom: 4. Antelope Canyon; 5. Horseshoe Bend; 6. Badlands

I also went back to visit Brazil after many years.

Books

History and Memoirs

History of the Peloponnesian Wars by Thucydides. He wrote his account of the Peloponnesian War, that between Athens and Sparta. Thucydides himself was a general on the Athenian side so some of his accounts were first-hand experience. While not the first historian, he's considered the first to seek accuracy and truthiness in describing events.

I learned a lot about Greece's geography, for example that the isolated land mass west of Athens is known as the Peloponnese, where Sparta is located (Athens is located in the region called Attica). I also didn't know that besides nowadays Turkey, Greece has settlements in Sicily and even some parts of Italy.

One thing I didn't know and would have made me reconsider reading the book is that it's incomplete, it actually doesn't include the end of the war, even though Thucydides lived past it.
book cover for the entry on the left column
The Ohlone Way by Malcolm Margolin. The Ohlone was one of the Native American tribes in the San Francisco Bay Area. There are a few things named after them, like the Ohlone college and the Ohlone trail, so when I saw the book cover it caught my attention. The book describes the way of life of this native tribe based on records from jesuits.

One interesting bit I learned is that being semi-nomadic (i.e. moving constantly but not going too far) they couldn't own heavy clay pottery, so they weaved baskets that were tight enough to hold water. To boil it they would heat a stone on fire and drop it inside, since baskets can't go directly over fire.
book cover for the entry on the left column
Shoal of Time by Gavan Daws. I read this to learn about the history of Hawaii during the trip to Kauai. It starts from around the first encounter with the expedition led by Captain Cook, who was killed in one of the islands. After acquiring weapons from Europeans, Kamehameha was able to unified the islands and start a dynasty, which gradually lost power to colonizers who had competing interests. The book also covers Asian immigration (which I had learned a bit from The Making of Asian America). Sugar plantation owners wanted statehood to get better deals on their sales, but it was rejected many times because it would make too many non-whites citizens. The inclusion of Alaska as state created the necessary precedent for Hawaii.

One trivia I learned: the C&H sugar company which we often see in grocery stores stands for California and Hawaii. The deal was that Hawaii planted the sugar canes and California refined it.
book cover for the entry on the left column
The Silverado Squatters by Robert Louis Stevenson. I had this book lined up for a trip I did last year to Napa Valley but was only able to finish this year. Stevenson is known for the Strange Case of Dr Jekyll and Mr Hyde. He lived in the Bay Area and spent some time in Mount Saint Helena in the Napa Valley region in hopes to alleviate his breathing problems. He occupied an abandoned (i.e. squatted) lodging in the mountains around the Silverado mine and describes his interacion with locals around the area. I enjoyed his poetic depictions of the surrounding landscape. book cover for the entry on the left column
Crying in H Mart (Audiobook) by Michelle Zauner. It's a memoir by Zauner, a half-white half-Korean singer of the band Japanese Breakfast. It recounts her struggle with her parents, her identity and later supporting her mother with cancer and dealing with the loss of a loved one. It's an overall sad and touching story. The book is engaging and well written. The audiobook is narrated by Zauner herself. book cover for the entry on the left column
Saladin by John Man. In 2019 I visited the Saladin Citadel in Cairo, Egypt and thought the book could be a good complement to that experience. Saladin was born in present day Iraq and was a Sunni muslim of Kurdish ethnicity. He ended the Fatmid caliphate (Shia islamic) in Egypt and reconquered multiple cities from the crusaders, including Jerusalem. He estabilished the Ayyubi dynasty (named after his father Ayyub) which encompassed both Egypt and Syria. Saladin is depicted as a patient leader and a strategist by Man. The book doesn't devote much space to his time in Egypt, but it does mention the construction of the citadel in Cairo.

One interesting bit described by the book is the pigeon communication protocol. Pigeons can only carry messages one way (they only know how to return home), so the receiver has to send (by land/sea) a lot of trained pigeons to its senders upfront. Piegons can die or get lost during the way, so when sending messages there must be redundancy.
book cover for the entry on the left column
A History of Canada in 10 maps by Adam Shoalts. I read this book during the trip to Banff & Jasper. I didn't know much about Canada's history so I wanted a general history book. I don't think I learned much about Canada but this book provides very interesting accounts of explorers like Samuel Hearne and Alexander Mckenzie, the latter being the first person known to cross from the Atlantic to the Pacific north of Mexico.

Another page turner is the story of John Franklin, deemed an incompetent explorer on his quest to learn more about the Arctic ocean and which ended up killing part of his expedition.
book cover for the entry on the left column
Men For The Mountains by Sid Marty. I was planning to bring this book for the trip to Banff and Jasper but as luck would have it, Amazon delayed the delivery, so I went with Shoalts' book. I ended up buying it in Banff but read only after the trip.

Marty was a park ranger in Banff and Jasper National Parks for most of his career and his memoir provides many facets of the job of a park ranger through some his own experiences. This includes not only maintaining the trails by cutting trees, fixing fences and signs, but also tracking bears, forest firefighting, rescuing dead bodies in snow and rapids. The book is interspersed with a longing for the simpler past and a distaste for tourist crowds.
book cover for the entry on the left column
O Súdito (in Portuguese) by Jorge Okubaro. I read this book during my trip to Brazil and it was the first time reading a book in Portuguese in about 10 years!

Jorge is the youngest son of Massateru Okubaro, a Japanese/Okinawan who emigrated to Brazil in the early 20th century. The book recounts his life since coming to Sao Paulo as a teenager, with the false belief that Brazil was the land of opportunity and one could get rich quickly and return to Japan. The reality is that he struggled financially and was never to set foot back in his hometown in Okinawa.

Massateru was a nationalist who, among many, refused to believe Japan lost WWII and ended up being implicated in an investigation of terrorism attacks to other Japanese immigrants who accepted the defeat. He had a big family of 8 children, 2 of them adopted from a distant cousin who was murdered. In an interesting turn of events, his eldest son became part of the Brazilian military and he was very proud, being the apex of his gradual transition into a Brazilian citizen.

This book provides some great detail (to a fault, when it discusses the investigation process in too technical terms) on the Japanese immigration to Brazil. My ancestors were also Japanese (Okinawan from my dad's side) immigrants to Brazil, so this bit of history is particularly interesting to me.
book cover for the entry on the left column

Science and Technical Books

Superintelligence by Nick Bostrom. This book is about the potential dangers of an artificial intelligence. The gist of the book is that there's a possibility that we won't see the singularity coming because towards the end AI might improve itself at exponential speed and if we've not put safety controls in place, the AI can lead catastrophic outcomes for humans. The author argues that making sure AI is benign to humans is non trivial and even if we put our best effort towards that it can backfire. Bostrom is very technical and even includes a differential equation to show how a self-reinforcing feedback loop leads to exponential growth.

A thought provoking question posed is: if you as an individual had the choice of seeing AI singularity happen in your lifetime but at a great existential human risk vs. forgoing witnessing it at all, to make sure more harnesses were added to mitigate risks. Which would you choose?
book cover for the entry on the left column
How Not To Be Wrong by Jordan Ellenberg. My initial assumption from the title of the book was that it's about using math to win arguments. The book is more on how to avoid fallacies, especially in probability and statistics, where our intuition is often wrong. The book covers many real-life topics including p-hacking, fair voting, correlation vs. causation, lotteries. I especially liked the topic on Buffon's needle, so much so I decided to write a post about it.

I came out from this book a bit more cynical about medical experiments. It seems like besides lack of causality there's a lot of statistical flukes that are hard to catch, so there's a lot of noise coming from them.
Working Effectively With Legacy Code Book Cover
The Effective Engineer by Edmond Lau. Lau provides several concrete tips for improving productivity as a individual contributor. Topics include: optimize for learning, invest in iteration speed, measure what you want to improve, validate your ideas early and often, improve project estimation skills, and balance quality with pragmatism. A lot of these are common good practices but it's nice to have them explicitly organized. book cover for the entry on the left column
Spillover (Audiobook) by David Quammen. Spillover is the phenomena in which a disease originally endemic to other animal species spills over to humans. Most times it infects a few individuals and disappears, but it eventually becomes endemic to humans as well. The book describes many diseases including hendra virus, AIDS, ebola, influenza, coronavirus, lyme, etc.

One interesting fact I learned is that a disproportionate number of diseases originate in bats (even when transmitted via horses, monkeys or ticks). The author also makes the eerie observation that sick people from these diseases show visible symptoms, making it easier to avoid them and prevent spread, but if a disease were to spread asymptomatically we would have a hard time (this book was written before the Covid pandemic).
book cover for the entry on the left column
Designing Data Intensive Application by Martin Kleppmann. I wrote a post about it. book cover for the entry on the left column
Effective Modern C++ by Scott Meyers. I wrote a post about it. book cover for the entry on the left column
Streaming Systems by Tyler Akidau, Slava Chernyak and Reuven Lax. I wrote a post about it. book cover for the entry on the left column
Introduction to Topology by Bert Mendelson. This short book covers basic concepts from set theory, metric spaces and topological spaces. It discusses properties like connectedeness, compacteness and topological equivalence (which I wrote about).

It mostly contains definitions, theorems, proofs and examples with some occasial discussion in between. It's not too hard to follow in general, but I don't think I got a grasp of identification or quotient topology, so I might need to consult other materials. I skipped many of the proofs and all the exercises.
book cover for the entry on the left column

Misc

Deceit, Desire and the Novel by René Girard. I never thought I'd read a book on comparative literature but I was interested in learning about Girard's theory of mimetic desire. It involves a triangular relationship: the object of desire, the subject who desires and the mediator, who either owns the object or is also interested in it. Girard argues that the subject only desires the object because of the mediator, hence the "mimetism" (copying).

The intensity of the desire depends on how close the subject is to the mediator. Closeness in this case is with respect to similarity: a peasant and a king would be further apart than two rival peasants. Girard uses several works of literature to make the case for his theory such as Stendhal's The Red and the Black, Dostoyevsky's the The Underground Man, Proust's Remembrance of Things Past and Cervantes' Don Quixote.

I feel like this book is rather repetitive and could have been a lot shorter, but it got me very interested in reading some of the works mentioned.
book cover for the entry on the left column
The Death and Life of Great American Cities by Jane Jacobs. Jacobs wrote this book in 1961 and discusses what makes parts of big cities thrive while others be ridden with crime and poverty. She debunks myths on the cause of failures in cities, including racial and income reasons.

The core principle for city success is diversity. This includes diversity of usage (e.g. mix of residential, leisure and business), income (poor and rich in the same neighborhood) and buildings age and look (old and new constructions, short and tall buildings). A corollary of these points is that planned cities or housing projects are doomed to fail since they segregate by income and usage and usually consists of new buildings all looking the same.

Jacobs uses New York as a major example, but she also mentions Boston, San Francisco and Los Angeles. She often uses San Francisco's civic center as a counter-example to diversity and it's interesting to see how this perpetuates to this day, with lots of homeless and drug usage around that area which contrasts with the gradiose of its surrounding buildings and upscale stores. Another interesting bit about SF is that its hills are a feature for diversity because it occludes the view and is a natural break to sameness. I can't help constrasting this with flatter areas of SF such as the Sunset where we see long blocks of similar looking residential buildings.

This was a strange read because I disliked reading it and slougged through to finish, but on the other hand there are many interesting things I learned and it changed the way I view cities and I keep thinking back to it. I think one reason for the dislike is that this book feels very repetitive, much like Girard's Deceit, Desire and the Novel.
book cover for the entry on the left column