Whenever I mention that I don't use Interface Builder, Storyboards
or Auto Layout, developers, especially newer developers, ask me how
it's even possible to write UIKit apps like that. So many iOS
tutorials dump you straight into Interface Builder and
constraint-building, and while that does have benefits at the
mid-to-high-end, like with localization and right-to-left languages,
it's still a fairly sharp learning curve and mental overhead that
leaves many beginners not really understanding what is going on
under the hood. It's no wonder that SwiftUI seems so refreshing and
easy to use, in comparison.
Garbage collection is considered one of the more shark-infested
waters of programming, but in this post, I’ll give you a nice kiddie
pool to paddle around in. (There may still be sharks in it, but at
least it will be shallower.)
When we started Goliath, no one on the team knew Go beyond the
experiments we ran to validate that Go would be a better choice for
us than our other options. Today, all of our backend and full-stack
engineers write Go, and our incremental delivery of Goliath has
vaulted us over a big milestone: More than 500,000 lines of Go now
running in production. This seemed like a good point to reflect on
Let's face facts. Git is not fun. Git is not friendly. No. It's just
infuriatingly useful, so we're stuck with it. But what if you could
make git more friendly? More convenient? Would that make your day a
little less stressful?
OpenZFS stands out in its snapshot design, providing powerful and
easy-to-use tools for managing snapshots. Snapshots complement a
backup strategy, as they are instantaneous and don’t require a
backup window. Since snapshots are atomic, they are not affected by
other processes and you don’t have to stop any running applications
before taking a snapshot.
Fluent in Django: Get to know Django models better
Django is an MTV framework. Instead of MVC (Model, Views,
Controller), it uses Model, Template, and View. The View is a Python
function that takes a Web request and returns a Web response (in
MVC, this would be a Controller). But the heart of your application
is the Model.
Interfaces and Nil in Go, or, Don't Lie to Computers
In fact the root problem here isn't about Go specifically. This is a
general problem that you can encounter in any language, and in fact,
even beyond. When you lie to your code, there will be
pprof++: A Go Profiler with Hardware Performance Monitoring
Golang is the lifeblood of thousands of Uber’s back-end services,
running on millions of CPU cores. Understanding our CPU bottlenecks
is critical, both for reducing service latencies and also for making
our compute fleet efficient. The scale at which Uber operates
demands in-depth insights into codes and microarchitectural
Actors offer data isolation within a type in such way that the code
you write cannot create data races. In other words, thread-safety is
built into the type system. Similarly to how mutability is - you
simply cannot compile code that mutates immutable data.
We are happy to announce that the third edition of the Rust
language, Rust 2021, is scheduled for release in October. Rust 2021
contains a number of small changes that are nonetheless expected to
make a significant improvement to how Rust feels in practice.
In terms of simplicity, Alpine Linux is unpeered. Alpine is the only
Linux distribution that fits in my head. The pieces from which it is
built from are simple, easily understood, and few in number, and I
can usually predict how it will behave in production. The software
choices, such as musl libc, are highly appreciated in this respect
as well, lending a greater degree of simplicity to the system as a
Have you heard “legacy code” as the reason when something went wrong
in a software project? Understanding legacy code is crucial because
it occurs in every project sooner or later. We use the term loosely
to describe old code that we don’t like but what is legacy code
really and even more importantly how can we avoid it?
I spend a lot of my time at work writing Go services that talk to
other Go services over HTTP. Much of the time, everything works as
expected, but every now and then a situation arises where I’m
struggling to understand why my program is receiving a specific
value. Is my request not being built correctly? Am I not properly
deserializing the response? Logging can be helpful, but sometimes I
really just want to look at the HTTP traffic between services.
Green threads, userland threads, goroutines or fibers, they have
many names but for simplicity's sake I'll refer to them all as green
threads from now on.
In this article I want to explore how they work by implementing a
very simple example where we create our own green threads in 200
lines of Rust code. We'll be explaining everything along the way so
our main focus here is to understand them and learn how they work by
using simple, but working example.
I’ve worked on websites for several years, both professionally and
for side projects. One day, I reflected on the fact that all of my
web development education had come from actually making websites. In
most cases, I’d have a specific problem, Google how to solve it, and
learn something new in the process.
I wondered what I was missing by never learning HTML in a
raw HTML. It might seem silly to go back to such a basic aspect of
web development after a decent amount of experience, but it’s easy
to become overconfident with a skill just because you know enough to
do a few useful things.
SQLite Pragma Cheatsheet for Performance and Consistency
SQL pragma are statements (like SELECT … or CREATE TABLE …) that
change the database behaviors or call a special functions. This post
is a short list of SQLite pragma I use in my
projects built on SQLite, to get better performance and more
Tom Witowsky (@devgummibeer)
shared on Twitter a scaling issue with his service
opendor.me, which helps any developer share
and highlight their open source work. As the service grows, more and
more data is stored in the database and needs to be browsed. One
particularly slow query that he needed help optimizing is fetching
random users, organizations, and repositories that are already part
of the service.
What if I needed to shuffle a list but couldn't hold the whole thing
in memory? Or what if I didn't want to shuffle a list, but just
traverse it in a shuffled manner? (That is, visit each element once
and only once, in a randomized way.) What if I wanted to traverse
it, but didn't want to precompute or store the traversal for some
This would allow me to publish items from a list in an order that
was unpredictable from the outside, but in fact deterministic and
based on a secret key, and without precomputing anything (or
worrying about collisions). Or I could use it to assign small
non-sequential IDs that would eventually saturate the space of
n-character strings in a pseudorandom order, obscuring the true size
of the set for anyone who could just view some subset of the
assigned IDs. They wouldn't even be able to tell if there were gaps
in the list of IDs they could observe.
The Rustonomicon digs into all the awful details that you need to
understand when writing Unsafe Rust programs.
Should you wish a long and happy career of writing Rust programs,
you should turn back now and forget you ever saw this book. It is
not necessary. However if you intend to write unsafe code — or just
want to dig into the guts of the language — this book contains lots
of useful information.
Facebook has released Cinder, used internally in Instagram to
improve Python performance, while another faster Python, called
Pyston, has released version 2.2 and made the project open source
Python is the world's second most popular programming language
but it is by no means the fastest. A glance at
tells us that Python 3 computation is often many times slower than
compiled languages like C and Go, or JIT (Just-in-Time) compiled
One reason is that the official implementation of Python, called
CPython, is an interpreted, dynamic language, and its creator Guido
Van Rossum has resisted optimising it for performance, saying in
that "Python is about having the simplest, dumbest compiler
imaginable, and the official runtime semantics actively discourage
cleverness in the compiler like parallelizing loops or turning
recursion into loops."
Making the Internet more secure one signed container at a time
With over 16 million pulls per month, Google’s distroless base
widely used and depended on by large projects like Kubernetes and
Istio. These minimal images don’t include common tools like shells
or package managers, making their attack surface (and download
size!) smaller than traditional base images such as ubuntu or
alpine. Even with this additional protection, users could still
fall prey to typosquatting attacks, or receive a malicious image if
the distroless build process was compromised – making users
vulnerable to accidentally using a malicious image instead of the
actual distroless image. This problem isn’t unique to distroless
images – until now, there just hasn’t been an easy way to verify
that images are what they claim to be.
In the afternoon I noticed that Adam's Acanthoscurria
geniculata was upside
down. It was about to molt soon. It had webbed a mat on top of its
burrow and a plastic leaf the previous night.
The spider had been lethargic for weeks, a possible sign of an
upcoming molt (ecdysis).
When I checked again on the tarantula, slightly over 4 hours later, it
was resting upside down next to its molt (exuviae). It's best to leave
the spider in peace as much as possible during this delicate process.
In the evening I carefully removed the exuviae. This can be used to
determine the sex of the
tarantula was bought as a female and now I could confirm this by
examining the inside of the abdomen between the first pair of book
In the above photo, taken with an iPhone 6S and macro lens the
spermathecae are barely visible. But good enough to confirm that this
is indeed a female.
Now the spider has to harden out before it can get its first
meal. Best is to wait about 2 weeks.
awk is the coolest tool you don't know
awk, named for its authors Aho, Weinberger, and Kernighan, is a very
cool little tool that you know exists and is installed on your
system, but you have never bothered to learn how to use. I’m here to
tell you that you really ought to!
If I stop for a moment to ponder the question, “what is the coolest
tool in Unix?”, the immediate answer is awk. If I insist on
pondering it for longer, giving each tool a moment for fair
evaluation, the answer is still awk. There are few tools as
perfectly suited to their problem as awk is.
Server-sent events in Flask without extra dependencies
(SSE) is a
mechanism for sending updates from a server to a client. The
fundamental difference with
WebSockets is that the
communication only goes in one direction. In other words, the client
cannot send information to the server. For many usecases this is all
you might need. Indeed, if you just want to receive
notifications/updates/messages, then using a WebSocket is
overkill. Once you’ve implemented the SSE functionality on your
me, it’s very straightforward.
The Simple Tricks to Make Your Website Blazing Fast
Web application load speed is the most basic part of UX. Neglecting
performance (load time) of your website can drive away users,
because most people tend to leave the page after about 3 seconds if
it doesn't load, therefore it's very important to make sure that
your application loads as fast as possible. But how can you achieve
that? There are many tricks and techniques for speeding up load time
of an application and most of them don't involve any actual code
change. In some cases, just a single line of config can give you a
huge performance improvement. So, in this article we will explore
the simplest and most effective tricks that will help you make your
web application load as fast as possibly can!
In this post, I will be sharing my favorite commandline one liners
that have made my workflow productive and more efficient. As a
regular Linux user, I have been using commandline extensively to
perform daily tasks such as creating files, navigating through
directories , moving files and editing files using vim.
The art of solving problems with Monte Carlo simulations
This article will explore some examples and applications of Monte
Carlo simulations using the Go programming language. To keep this
article fun and interactive, after each Go code provided, you will
find a link to the Go Playground, where you can run it without
installing Go on your machine.
Why model calibration matters and how to achieve it
Calibrated models make probabilistic predictions that match real
world probabilities. This post explains why calibration matters, and
how to achieve it. It discusses practical issues that calibrated
predictions solve and presents a flexible framework to calibrate any
classifier. Calibration applies in many applications, and hence the
practicing data scientist must understand this useful tool.
One of the ideas of functional programming is having pure functions,
functions that have no side effects. But writing programs made
exclusively from functions without side effects can't be useful in
the real world, because programs have to affect the real world
somehow. Inevitably, this means some parts of our programs must be
effectful for the program to be useful.
Images have also been a key part of the web. They communicate ideas
instantly, but they are also a lot heavier than text to load. This
means that it’s essential to get loading and displaying them right,
if you want to give your users a fantastic first impression.
This is a bit of a dumb project, there's all sorts of bugs and
they're the horrifying kind. Shell scripts have access directly to
the computer and so you can do all sorts of strange and harmful
things. But this all makes me smile that it all even works.
Present-day Deep Learning models are scaling their computational
requirements much faster than the growth rate of computing
resources. They rely on huge sets of parameters that make them much
greater tools compared to older methods. To beat this challenge, we
may need to have new perspectives on our architectures, possibly on
a fundamental level, to make them smaller scale but still high
performance. On the other hand, we may develop new types of hardware
that will be able to keep up with the requirements of DL