ne of the ways in which Swift helps us write more robust code is
through its concept of value types, which limit the way that state
can be shared across API boundaries. That’s because, when using
value types, all mutations are (by default) only performed to local
copies of the values that we’re working with, and APIs that actually
perform mutations have to be clearly marked as mutating.
In this article, let’s explore that keyword, as well as its
nonmutating counterpart, and the sort of capabilities that those
language features provide.
Functional programming is a great discipline to learn and apply when
writing JavaScript. Writing stateless, idempotent, side-effect free
code really does solve a lot of problems:
There’s a lot of tribal knowledge surrounding #[inline] attribute in Rust. I often find myself teaching how it works, so I finally decided to write this down.
Caveat Emptor: this is what I know, not necessary what is
true. Additionally, exact semantics of #[inline] is not set in
stone and may change in future Rust versions.
When I write about programming, I spend a lot of time trying to come
up with good examples. I haven’t seen a lot written about how to
make examples, so here’s a little bit about my approach to writing
examples!
The basic idea here is to start with real code that you wrote and
then remove irrelevant details to make it into a self-contained
example instead of coming up with examples out of thin air.
I’ll talk about two kinds of examples: realistic examples and
suprising examples.
The dwarves, along with Bilbo Baggins and Gandalf the Grey, continue
their quest to reclaim Erebor, their homeland, from Smaug. Bilbo
Baggins is in possession of a mysterious and magical ring.
In the last tutorial we learned how to leverage the Scrapy
framework
to solve common web scraping problems. Today we are going to take a
look at Selenium (with Python ❤) in a step-by-step tutorial.
A pretty interesting conversation took place on a series of
Tweets
a while back on Rust closures. This was (and still is, although less
than before) a confusing topic for me as a Rust newbie. So I was
expecting some help from the Rust Twitter community. What I'm about
to discuss today comes as a side effect out of that discussion; it
wasn't my line of query initially.
Minions Stuart, Kevin, and Bob are recruited by Scarlet Overkill, a
supervillain who, alongside her inventor husband Herb, hatches a
plot to take over the world.
In the evening Adam and I watched
Minions. The movie is OK and
I give it a 7 out of 10.
...though it's not the flagship borrow checking that's at
fault. What I noticed, and would like to share with you today, is
that the exhaustiveness checking performed by the Rust compiler on
match patterns is a superset of the
SAT
problem.
Have you ever wondered how bugs are born? I'm not talking about the
trivial kind you can catch with simple unit testing. I'm talking
about bugs that may not be apparent on first sight, but are so
obvious in retrospect.
Call, Apply, and Bind help keep our code clean. And they
make possible some advanced design patterns in JavaScript.
Also, they are extremely powerful tools in functional programming in
JavaScript. They all have a relationship with the this variable
in
JavaScript
and they can be applied in concepts such as function currying,
function borrowing, and function binding.
From the outset, Mac OS X and macOS have been designed around a
relatively small kernel which is given additional capabilities by
kernel extensions. The kernel itself runs at a highly privileged
level, giving it most direct access to resources such as the
processor, memory and hardware devices, often known as
Ring 0. Kernel extensions operate at a close level of privilege
(Ring 1) so that they too can make hardware such as ethernet and
Thunderbolt ports work, and they’re loaded once the kernel itself is
running, before the rest of macOS. Big Sur’s kernel has just over
550 standard kernel extensions which extend it to make everything
else work.
The most popular programming approach within the declarative family
is a functional paradigm, with its more conservative cousin — pure
functional programming. Writing programs in this manner requires
using composable functions encompassing conditions and
expressions, preferably without side effects. Those functions are
treated as first-class citizens and thus are valid arguments for
other functions. It is common to construe logic where one parameter
(data) is treated as an argument for the other parameter
(function). This concept is present in implementations of map,
reduce or fold, widespread across the programming world, and
based on a functional approach.
In realtime applications
it goes without saying that we need information from our servers as
soon as it’s available – and, fundamentally, the classic HTTP
request/response paradigm isn’t up to the job. That’s because the
server will be silent, new data or not, unless or until a consumer
requests an update.
Stories of Your Life and Others delivers dual delights of the
very, very strange and the heartbreakingly familiar, often
presenting characters who must confront sudden change—the inevitable
rise of automatons or the appearance of aliens—with some sense of
normalcy. With sharp intelligence and humor, Chiang examines what it
means to be alive in a world marked by uncertainty, but also by
beauty and wonder. An award-winning collection from one of today's
most lauded writers, Stories of Your Life and Others is a
contemporary classic.
Seeing disable comments in code has always made me feel
uneasy. Whenever I encounter one, a bunch of questions pop into my
head. What kind of error did the static analysis tool report? Was it
something that didn’t apply? Why did the developer choose to ignore
it? Were they being lazy? Did they understand the error? What is the
risk of keeping it ignored? If it’s being ignored, why is the rule
even enforced?
The support of CSS Grid in modern browsers has opened up layout
possibilities like never before. We can create more complex designs
with fewer elements than we could with Flexbox alone. But when you
think of CSS Grid, you generally think of a boxy layout, right?
I spent several days digging through the entire history of the Git
mailing list in order to document all the discussions related to
git pull and its default mode. It’s a long story, so grab some
coffee (a whole pot of it).
Writing better pull requests is one of the best improvements you can
make as a software engineer. Well written pull requests create a
smoother review process, help get your PRs merged faster and
increase the level of trust and respect you earn from your
team. This guide will present several easy to implement ideas that
will help you write better pull requests.
In the evening I finished Split
Second,
King and Maxwell Book 1 by David Baldacci. It was disappointed by the
story: chaotic and not realistic. Not sure if I am going to give the
second book in the series a try; probably not.
The goal of this tutorial is to describe Python development
ecosystem. It can be helpful for someone coming to Python from
another programming language.
No crash or panic should ever happen, kernel panics least of
all. What happens in a kernel panic is so seriously damaging to the
macOS kernel that it simply can’t recover, so forces your Mac to
restart (or, sometimes, to shut down). This article describes how to
recognise and diagnose kernel panics, and what you should do about
them.
In this short post I will try to convince you of how easy it is to
find performance issues in your Python code and how you should
develop the habit of profiling your code before you ship it.