There was quite a bit of code duplication between the two Emacs
shells I had just written. At the same time, I started hearing from
folks about integrating other tools, some cloud-based, some local,
proprietary, open source.. There's
Cody,
invoke-ai,
llama.cpp,
alpaca.cpp, and the
list continues to grow.
With that in mind, I set out to reduce the code duplication and
consolidate into a reusable package. And so shell-maker was born,
a maker of Emacs shells.
Suppose you’re connected to a remote host with SSH and after a while
the SSH session goes stale. The terminal is unresponsive and no
keypress seem to take effect. There might be something with the
network, the remote host is restarting or maybe your machine has
been in hibernation, there could be multiple reasons for a stale
session.
The first solution that might come to mind is to just close the
terminal emulator and create another one, but there is a better
way.
I did a line-for-line port of my eval library from Go to Rust, and
right away it was 5x faster; I was pretty happy. But when I
tried to further improve performance using techniques from other
languages, it got slower... and the harder I tried, the slower it
got! Rust performance was not intuitive to me.
Finally, after learning why my code was slow, I was able to boost
performance 12000x, and my library was worthy of a new name:
fasteval.
An oddball group of cops, criminals, tourists and teens converge on
a Georgia forest where a huge black bear goes on a murderous rampage
after unintentionally ingesting cocaine.
In the evening Alice, Esme, and I watched Cocaine
Bear. I liked the movie a lot
and give it an 8 out of 10.
We are shipping WebAssembly tail calls in V8 v11.2! In this post we
give a brief overview of this proposal, demonstrate an interesting
use case for C++ coroutines with Emscripten, and show how V8 handles
tail calls internally.
I think people reach for ORMs because they are afraid of making
mistakes, they do not want to learn SQL, or both. People assume that
their ORM of choice will generate correct (i.e. does what they
intended), valid (i.e. running it won't produce an error, such as a
syntax error), and performant SQL for the queries they need to make,
and that they can do this without learning SQL itself. I think
wanting to avoid mistakes is a very noble goal, but I do not think
ORMs are the right way to acheive it. I also think learning SQL is
unavoidable, and reliance on ORMs are a net hinderance for yourself
and other maintainers. Allow me to explain why I think these things,
and perhaps convince you as well.
Python installation experience is lacking. This is not because
nobody wants to fix it. A lot of work has been done to improve it
already. But the age and popularity of the language make the task
extremely complicated.
Nevertheless, providing a cross-platform installer shipping
self-contained binaries and normalizing how you run the executable
would help a lot. Several projects are experimenting with those
ideas.
Recent browsers use the
prefers-color-scheme
option to automatically choose light or dark mode CSS styles, if the
website supports it. And my website did support it, not that I knew
it until people started commenting that my syntax-highlighted code
blocks were unreadable! I figured out how to toggle light/dark mode
in Firefox (ctrl+shift+I to open the inspector pane then click the
sun/moon icons), perused my website, and found an even greater
problem: my treasured vector diagrams that I put so much time &
effort into were completely invisible against a dark background!
Here’s a quick post about supporting dark mode on my blog by
inlining SVGs and setting their color with the currentColor CSS
variable.
I think the packaging best practices should be revisited, there are
lots of good tools now-days that are either unused or
underused. It's generally a good thing to re-evaluate best practices
all the time.
I assume here that your package is to be tested on multiple Python
versions, with different combinations of dependency versions,
settings etc.
And few principles that I like to follow when packaging:
If there's a tool that can help with testing use it. Don't waste
time building a custom test runner if you can just use
py.test or
nose. They come with a
large ecosystem of plugins that can improve your testing.
When possible, prevent issues early. This is mostly a matter of
strictness and exhaustive testing. Design things to prevent common
mistakes.
Collect all the coverage data. Record it. Identify regressions.
PostgreSQL 10 came with the welcome addition of the logical
replication feature. This provides a more flexible and easier means
to replicate your tables than the regular streaming replication
mechanism. However, it does have some limitations that may or may
not prevent you from employing it for replication. Read on to learn
more.
Jake Sully lives with his newfound family formed on the extrasolar
moon Pandora. Once a familiar threat returns to finish what was
previously started, Jake must work with Neytiri and the army of the
Na'vi race to protect their home.
In the evening Alice, Esme, and I watched Avatar: The Way of
Water. A beautifully made
movie. I liked it a lot and give it a solid 9 out of 10.
Polars has two fundamental APIs, each of which is useful in
different situations:
“Eager” mode, which is similar to how Pandas works, is well-suited
for initial and exploratory data analysis.
For production use, “lazy” mode often execute much faster, with
lower memory usage, at the cost of not giving you access to
intermediate result.
In this article we’ll use both two APIs and see how Polars lets you
transition from looking at the data to something we can run even
more efficiently in production.
When you spin up a new VM or bare metal server at some cloud
provider, what is the fastest and easiest way to get the server to
run a certain configuration? In this article, I show how to do the
partitioning, formatting, and installing a fully configured
NixOS, starting from a random rescue system,
in 5 minutes and with literally a single command:
nixos-anywhere.
For the longest time, I thought that "sealed trait" in Rust was a
singular concept implementable in one specific way. To prevent
downstream crates from implementing your traits, you make the traits
sealed — done, end of story. I was wrong!It turns out there
are multiple ways to seal
traits, forming a
pleasant spectrum of options.
Your default hash table should be open-addressed, using Robin Hood
linear probing with backward-shift deletion. When prioritizing
deterministic performance over memory efficiency, two-way chaining
is also a good choice.
Pydantic is an open-source Python library that provides powerful
data parsing and validation — including type coercion and useful
error messages when typing issues arise — and settings management
capabilities.
I ran into an odd out-of-memory problem the other day when
attempting to debug an iOS app on device. The app consistently
crashed shortly after launch, preventing me from investigating the
bug. To unblock myself, I learned a lot about the iOS virtual memory
implementation and journaled my findings (including a fix!) here.
In this tutorial, I’ll walk you through adding DRF to your Django
project, creating an example POST endpoint with Basic
Authentication, and an example GET endpoint without any
authentication.
Git stores all the code and commits in your repo in a
content-addressable store. That means that if you know the hash of
something, you can retrieve it from the store. This allows Git to do
cool things like syncing and deduplication, but it's also the source
of some of the weirder parts of Git's behavior from a beginner's
perspective. Once I learned about the internals, I found it a lot
easier to reason about what it was doing. If you're learning about
them for the first time now, I hope you have a similar experience!
trurl is a small command line tool that parses and manipulates URLs,
designed to help shell script authors everywhere.
URLs are tricky to parse and there are numerous security problems in
software because of this. trurl wants to help soften this problem by
taking away the need for script and command line authors everywhere
to re-invent the wheel over and over.
trurl uses libcurl’s URL parser and will thus parse and understand
URLs exactly the same as curl the command line
tool does – making it the perfect companion tool.
Last week, while brainstorming with a colleague, I discovered a few
interesting options with regard to OpenSSH public key authentication
mechanisms, specifically how OpenSSH resolves which public keys are
allowed for a particular user.
The Django team is happy to announce the release of Django 4.2.
This version has been designated as a long-term support (LTS)
release, which means that security and data loss fixes will be
applied for at least the next three years. It will also receive
fixes for crashing bugs, major functionality bugs in
newly-introduced features, and regressions from older versions of
Django for the next eight months until December 2023.