Iterated Local Search is a stochastic global optimization
It involves the repeated using of a local search algorithm to
modified versions of a good solution found previously. In this way,
it is like a clever version of the stochastic hill climbing with
random restarts algorithm.
Simple Python Profiling with the @profile Decorator
A way of analyzing the performance of any given function or program
is to use profilers during its execution. Profilers can help us
understand timing, memory usage, and other pertinent information
about code. The key to using profilers is to determine which portion
of the code is slow or computationally expensive and assist the
process of catching errors for optimization.
You know that question you can get asked casually by a person you’ve
never met before or even by someone you’ve known for a long time but
haven’t really talked to about this before. Perhaps at a social
event. Perhaps at a family dinner.
Welcome to the world of Git. I hope this document will help to
advance your understanding of this powerful content tracking system,
and reveal a bit of the simplicity underlying it — however dizzying
its array of options may seem from the outside.
In this article, we’ll develop a Haskell library for continued
fractions. Continued fractions are a different representation for
real numbers, besides the fractions and decimals we all learned
about in grade school. In the process, we’ll build correct and
performant software using ideas that are central to the Haskell
programming language community: equational reasoning, property
testing, and term rewriting.
or better or worse, extruded text was a staple of the mid-90s
desktop publishing design landscape. It was rare for a party
invitation or gaming fanzine not to be blessed by this 3D text
effect on its way out the printer.
As design was increasingly destined for screen rather than page,
extrusion fell out of favour. But recently, I've noticed a quiet
Accessibility is a critical skill for developers doing work at any
point in the stack. For front-end tasks, modern CSS provides
capabilities we can leverage to make layouts more accessibly
inclusive for users of all abilities across any device.
Usually when I start a new project, I either copy the HTML structure
of the last site I built or I head over to HTML5
Boilerplate and copy their
boilerplate. Recently I didn’t start a new project, but I had to
document the structure we use at work for the sites we build. So,
simply copying and pasting wasn’t an option, I had to understand the
choices that have been made. Since I spent quite some time
researching and putting the structure together, I decided to share
it with you.
I set out to build the smallest container image that I could that
was still able to do something useful. By taking advantage of
multistage builds, the scratch base image, and a tiny assembly
based http server, I was able to get it down to 6.32kB!
In the afternoon my aunt messaged me that firebugs, Pyrrhocoris
apterus, could be found close to her house. Later, Esme and I walked
to her house and I took a photo of the colorfull insects.
Onboarding with an M1
This is my first week at Authzed as a software engineer and I’ve
been provided with a new M1-based MacBook Pro as my primary
development machine. Apple’s new M1 chip has been receiving high
for being quiet, battery efficient, and performant, so naturally I
was excited to use my new laptop. Turns out, I wasn’t the only one
excited to start using M1 MacBook Pros…
There are many great articles written about the Seam Carving
algorithm already, but I couldn't resist the temptation to explore
this elegant, powerful, and yet simple algorithm on my own, and to
write about my personal experience with it. Another point that drew
my attention (as a creator of
repo) was the fact that Dynamic Programming (DP) approach might be
smoothly applied to solve it. And, if you're like me and still on
your "learning algorithms" journey, this algorithmic solution may
enrich your personal DP arsenal.
So, with this article I want to do three things:
Provide you with an interactive content-aware resizer so that
you could play around with resizing your own images
Explain the idea behind the Seam Carving algorithm
Explain the dynamic programming approach to implement the
algorithm (we'll be using TypeScript for it)
Google recently announced the rollout of their Federated Learning of
Cohorts (FLoC), a new advertising-surveillance initiative that seeks
to replace third-party cookies with a new user profiling technique
that garners data generated by the browser itself.
Let’s implement an immutable, singly-linked list. Singly-linked
means that each node contains a reference to the next node, but not
vice versa. To make this data structure really performant, let’s use
plain references instead of heap-allocated types. This would be
dangerous in memory-unsafe languages like C, because it could easily
cause vulnerabilities because of dangling pointers, but Rust’s
lifetimes protect us from this. We’ll see what this means in a
I've been a freelance developer for 12 years, and Emacs has been at
the center of my working environment for 10 of those. I use it for a
lot of things - including writing this post - but today I'm
concentrating on my workflow.
Here's how I use Emacs and org-mode during a regular day.
Org-Mode Is One of the Most Reasonable Markup Languages to Use
Disclaimer: this is a very nerdy blog entry. It is about
and why I think that Org mode is the best lightweight markup
language for many use-cases. And with lightweight markup language, I
do mean the syntax, the way you express headings, lists, font
variations such as bold face or italic, and such things.
You might have heard people say that functional programming is more
academic, and real engineering is done in imperative style. I’m
going to show you that real engineering is functional, and I’m going
to illustrate it using a computer game that is designed by engineers
for engineers. It’s a simulation game called Factorio, in which you
are given resources that you have to explore, build factories that
process them, create more and more complex systems, until you are
finally able to launch a spaceship that may take you away from an
inhospitable planet. If this is not engineering at its purest then I
don’t know what is. And yet almost all you do when playing this game
has its functional programming counterparts and it can be used to
teach basic concepts of not only programming but also, to some
extent, category theory. So, without further ado, let’s jump in.
article by Bartosz Milewski.
Say Hello To CSS Container Queries
I haven’t been more excited for a CSS feature like I’m now in the
past six years I spent as a front-end developer. The prototype of
container queries is now available behind a flag in Chrome
Canary. Thanks to efforts from smart people like Miriam
Suzanne and other
I remember seeing a lot of jokes about the support for CSS container
queries, but they are finally there. In this article, I will walk
you through why we need container queries, how they will
make your life easier, and most importantly, you will achieve more
powerful components and layouts.
n this post I’ll showcase a real-life example of debugging a
seemingly weird database performance degradation. While I obviously
intend to share the solution and what to avoid, I’d also like to
take you through the journey and show you some tools & processes
that can help you dig into SQL performance.
The goal of this post is to learn how CPython implements hash
tables. But understanding all the aspects of hash table design can
be hard, and CPython's implementation is especially sophisticated,
so we'll approach this topic gradually. In the first part of this
post, we'll design a simple fully-functional hash table, discuss its
capabilities and limitations and outline a general approach to
design a hash table that works well in practice. In the second part,
we'll focus on the specifics of CPython's implementation and finally
see how Python dictionaries work behind the scenes.
In this interview, I talk with Thomas Payet, the co-founder and COO
of MeiliSearch. MeiliSearch is an
open-source search engine that is among the top 20 most starred Rust
projects on GitHub at the time of writing. We talk about MeiliSearch
and how Rust and its ecosystem have helped them create it.
Read further to learn about their experience with Rust and discover
tips for starting your own open-source project.
In this tutorial, you’ll get a thorough introduction to the
k-Nearest Neighbors (kNN) algorithm in Python. The kNN algorithm is
one of the most famous machine
algorithms and an absolute must-have in your machine learning
toolbox. Python is the go-to programming language for machine
learning, so what better way to discover kNN than with Python’s
famous packages NumPy and
The instructions below will explain how to build a Linux environment
for a Raspberry Pi 3B from scratch, focusing on extreme
minimalism. I will build most components from source code and use
BusyBox as the only user application on the target. The focus is on
minimalism for the sake of learning. Optimizations like network
boot, secondary bootloaders, compressed filesystems, etc.. will not
The fundamental principle of the switch true pattern is that you
can match against expressions as well as values. An expression in
a case will be evaluated before matching. If the expression in
your case evaluates to true - it will be matched.
A Bloom filter is a probabilistic data structure present in many
common applications. Its purpose is answering the question: "is this
item in the set?" very fast and not using a lot of space. The
answers can be NO, or MAYBE YES.
Bugs in ML code are notoriously hard to fix - they don’t cause
compile errors but silently regress accuracy. Once you have endured
the pain and fixed one of these, the lesson is forever etched into
your brain, right?
Wrong. Recently, an
old foe made a comeback - a familiar bug bit me again! As before,
the performance improved significantly after fixing it.
The bug was subtle and easy to make. How many others has it done
damage to? Curious, I downloaded over a hundred thousand
repositories from GitHub that import PyTorch, and analysed their
source code. I kept projects that define a custom dataset, use
NumPy’s random number generator with multi-process data loading, and
are more-or-less straightforward to analyse using abstract syntax
trees. Out of these, over 95% of the repositories are plagued by
this problem. It’s inside PyTorch’s official
falling prey to it.
In this article I will show that Rust async functions are colored,
by both the original definition and in practice. This is not meant
as an criticism of Rust async, though – I don’t see function colors
as an insurmountable issue, but as a reflection of the fundamental
difference of async and sync models of the world. Languages that
hide that difference do so by introducing compromises that might not
be acceptable in a systems language like Rust or C++ – for example,
by entirely forbidding the use of system threads, or by complicating
the invocation of foreign or OS-level blocking calls. Colored
functions are also present in at least C#, Python, Kotlin, and C++,
features of Rust async do make it easier to connect async code with
traditional blocking code, something that is just not possible in
This article covers some best practices for writing SQL queries for
data analysts and data scientists. Most of our discussion will
concern SQL in general, but we’ll include some notes on features
specific to Metabase that make writing SQL a breeze.
its behavior may appear very strange, especially if you are familiar
with similar constructs in other languages, for example this in
Java, or self in Python.
At Channable we use Nix to build and deploy our services and to
manage our development environments. This was not always the case:
in the past we used a combination of ecosystem-specific tools and
custom scripts to glue them together. Consolidating everything with
Nix has helped us standardize development and deployment workflows,
eliminate “works on my machine”-problems, and avoid unnecessary
rebuilds. In this post we want to share what problems we encountered
before adopting Nix, how Nix solves those, and how we gradually
introduced Nix into our workflows.
Here is an example to help you understand the importance of
cherry-picking. Suppose you have made several commits in a branch,
but you realize it's the wrong branch! What do you do now? Either
you repeat all your changes in the correct branch and make a fresh
commit, or you merge the branch into the correct branch. Wait, the
former is too tedious, and you may not want to do the latter. So, is
there a way? Yes, Git's got you covered. Here is where
cherry-picking comes into play. As the term suggests, you can use it
to hand-pick a commit from one branch and transfer it into another