Weekly Code Confessions Digest #2: News, and Resources from Last Week
Curated Resources on Topics Around Bloom Filter, Numerical Algorithms, Rust, Numba, OpenAI Function calls, and DeepMind's AlphaDev
Hi and welcome to Confessions of a Code Addict, the newsletter dedicated to coding and computer science. This is the weekly digest edition of the newsletter where I share a selection of some of the most interesting links and resources from last week. Let’s get started!
In this week's digest:
Expected Performance of a Bloom Filter
Implementing Cosine in C from Scratch (without using any math lib)
Build a CI/CD Pipeline for a Serverless Application
Designing Modern UIs with Rust
JDK 21's Approach to Beginner-Friendly Programming in Java
How Understanding CPUs can help Speed Up Numba and NumPy Code
Introduction to the Tiny game engine
Understanding DeepMind's AlphaDev Breakthrough in Optimizing Sorting Algorithms
How to Use the Function Call Feature of OpenAI’s ChatGPT APIs to Write Your Own Plugins
Books and Courses at the end of the article
Read till the end of the article to find a bonus tip to improve your productivity
📰 Articles
Expected Performance of a Bloom Filter
Last week, I shared a link to an article on optimizing Bloom filters. This week, let's take a look at how to analyze the performance of a Bloom filter. This article is written by Daniel Lemire, a professor at Université du Québec who is well-known for his work on blazing-fast data structures and libraries such as simdjson. In this article, Daniel explains how a Bloom filter works and how to evaluate the expected performance for the hit and miss cases when doing a lookup in a typical Bloom filter. I hope you enjoy this article.
Implementing cosine in C from scratch
This is a high-quality article where the author takes you through the process of implementing the cosine function in C from scratch. “From scratch” means without using the standard math library. This is a fun read where you not only learn how cosine function is actually implemented in software, but also various ways to optimize it. Check it out here
Build a CI/CD Pipeline for a Serverless Application
If you are interested in learning how to automate the deployment of your application, then you are in luck. This well-written tutorial shows how to setup a complete CI/CD pipeline in Jenkins for deploying an AWS Lambda-based application. Check it out here.
Makepad: Designing modern UIs with Rust
Makepad is a toolkit for building native and web UIs in Rust. If you are a Rust fan and interested in building full-fledged UI-based applications with it, then checkout this tutorial.
JDK 21’s Approach to Beginner-Friendly Java Programming
Lately, Java has been gaining new features at such a rapid rate that sometimes it’s hard to keep track. One of the latest features coming in the JDK 21 release is the support for implicit classes and enhanced main methods. These changes are designed to make Java more beginner-friendly. This basically means that the canonical “hello, world” program in Java can just be written as:
void main() {
System.out.println("Hello, World!");
}
Check out the article for full details on this.
Understanding CPUs can help speed up Numba and NumPy code
If you do data science work, then you will appreciate this. Sometimes, due to the scale of the data, the code we write can be quite slow and take a long time to run. Data science is an area where we want to iterate through experiments quickly in order to find the right solution to the problem, and slow code does not help with that. Not only that, once you have the solution, you can't put it into production if it is extremely slow. This is where tools like Numba come into the picture. Numba is a JIT for optimizing numerical processing code in Python. However, to use it effectively, we need to have a good understanding of how the CPU works so that we can write code that takes full advantage of it. This article takes you through a quick tour of CPU internals and then shows how to use Numba and NumPy to write optimized code. Check it out here.
Tinkering with Tiny
Are you interested in coding your own computer game? Well, creating games is one of the most complex projects one can undertake—it's not for the faint-hearted. However, it's not impossible either if someone is there to guide you through the steps. Tom Halligan has you covered with his latest article, where he gives an introduction to a game engine called Tiny. Check out the article linked below, and I hope you have fun with it.
Understanding DeepMind's AlphaDev Breakthrough in Optimizing Sorting Algorithms
A little shameless plug here. I wrote a long-form article explaining the workings of the optimized sorting algorithms that were discovered by the AlphaDev model from DeepMind recently. This has been breaking news, and if you are interested in learning what the fuss is all about, then check out my article (if you haven't already).
Using the Function Call Feature of OpenAI’s ChatGPT APIs to Write Your Own Plugins
OpenAI recently introduced a new feature in their ChatGPT APIs (GPT-4 and GPT-3.5). This feature allows the ChatGPT model to accept a list of function calls as part of its input and it can generate a call to one of those functions in order to perform the task assigned to it. This opens up several new possibilities with ChatGPT. In my latest article I shared a tutorial on how to use this function call feature to build a plugin system in a ChatGPT like chat system. In the tutorial we build a toy chat app along with a web browsing and Python interpreter plugin. If this sounds exciting, then check it out.
📚 Books and Courses
The Little Book of Deep Learning
All of us want to learn deep learning, and why not? All the AI around is being built using it. However, it has become a vast field in itself and requires a lot of background for someone to get started in it. The Little Book of Deep Learning is an accessible introduction to the field. It provides you with enough background on the math, tools, and some of the basic models so that you can dive deeper. The book has been beautifully typeset and is designed so that you can read it on your phone. With just 158 small pages long, it is indeed a little book. Check it out here.
Learn Rust Programming
This is a 13-hour course that teaches Rust from the very beginning and covers all of the Rust syntax and the standard library. The course is from freeCodeCamp. Check it out.
Bonus Tip
As promised, here is a tip to improve your productivity.
Do you use Git from the command line? I know many people who prefer using Git from the CLI rather than through a UI. We normally use the git checkout
command to switch Git branches on the command line. For example:
git checkout my-topical-branch
Then, once we are done working on the branch, we again use the checkout
command to switch to the previous branch. However, this gets tedious. For example, I tend to frequently switch between master
and my feature branch because sometimes I need to fix bugs. There is a handy shortcut to switch to the previous branch without typing its full name. Here it is:
git checkout -
The hyphen tells Git to switch to the previously checked-out branch.
Here's another bonus tip for you: the same trick works with the cd
command. If you say `cd -`
, the shell switches to the previous directory you were in.
Wrapping Up
I hope you enjoyed the articles and other resources from this week. Let me know in the comments if you enjoyed something in particular, or if something bugged you. Also, if you have anything interesting that you would like to share with me, then do so in the comments, I would love to read it. As always, thanks for reading Confessions of a Code Addict.
Thanks for the shout-out!