Zero or Sign Extend
A while back I had to deal with a bit-packed format that contained a list of integer values encoded in one of a pre-defined sets of bit widths, where both the allowed bit widths and the signed-ness…
Every blog post that took off on Hacker News, ranked by the votes of its best submission. 14,545 posts.
A while back I had to deal with a bit-packed format that contained a list of integer values encoded in one of a pre-defined sets of bit widths, where both the allowed bit widths and the signed-ness…
THE 17x17 PROBLEM HAS BEEN SOLVED!!!!! On Nov 30, 2009 I posted here the following challenge: If someone emails me a 4-coloring of...
This is a guide on naming Clojure functions. There are exceptions to every rule. When you’re defining something based on natural language, there are more exceptions than rules. I break these rules more often than I follow them. This guide is just a starting point for thinking about how to name things.
Back in the day when Principia originally released for Windows in 2014, the game would run on versions as far back as Windows XP. Given that Principia 1.4 was released while Windows XP still had mainstream support, this of course made sense at the time, and there was no real reason not to support it given that the…
Some time ago i started to write series of blog posts about assembly programming for x86_64. You can find it by asm tag. Unfortunately i wa...
Last summer I spent a lot of time with Typst (at that point v0.11) and Pandoc, working on a flexible and reusable workflow to typeset markdown-formatted articles to PDF. I designed a Pandoc template for Typst that would do nice things with layout and typography, and I posted about that here .
On behalf of the Jython development team, I'm pleased to announce that the final release of Jython 2.7.0 is available! It's been a long road...
In Rust, one of the most common ways to implement core traits (like Debug , Display , and Clone ) is to #[derive(...)] them, e.g.:
Sometimes it's a good thing to be writing code that you expect to throw away in a couple of years time.
Dithering is still a surprisingly applicable technique, not just for practical reasons (such as preparing a full-color image for output on a non-color printer), but for artistic reasons as well. Dithering also has applications in web design, where it is a useful technique for reducing images with high color counts to…
I'm a huge fan of Unix as an IDE and so the terminal is the core of my computational environment: I run everything from my development tools and text editor to my chat apps and email. There are a variety of terminals out there with their own set of pros and cons, but here we'll find out how to build our own terminal…
In the first part of this series we discussed the mechanics of an exploit, the general concept of hardening, and the stack protector hardening technique in particular. Some of the concepts explained there will be
A beginner's exploration of the many layers of Common Lisp development environments.
Screentendo is a desktop application that allows you to turn a selection of your screen into a playable level of Super Mario Bros. I’ve never built a Cocoa app or used Sprite Kit before, so it was …
This is not a command line option of the week post, but I feel a need to tell you a little about our brand new addition! --write-out [format] This option takes a format string in which there are a number of different "variables" available that let's a user output information from the previous transfer. For … Continue…
This post describes the design and implementation of a runtime benchmark suite for measuring the performance of Rust programs, which was recently added into the Rust compiler suite. I have recently blogged about how the whole benchmark suite works, so feel free to read that post first if you want to gather a bit more…
I recommend using Python for data analysis, and I recommend Wes McKinney's book Python for Data Analysis. I prefer Python to R for mathematical computing because mathematical computing doesn't exist in a vacuum; there's always other stuff to do. I find doing mathematical programming in a general-purpose language is…
I love Ruby! I’ve used it every day for years and I’m not sick of it yet. It’s an easy language to love: it’s expressive, flexible and syntactically beautiful ; it has a unique combination of useful features like mixins , metaclasses and blocks ; it comes with a useful core library and comprehensive standard library …
In the OpenGL course I'm teaching at a university, my students learn that the GPU uses something called rasterization to draw stuff on the screen. Then, I explain how — in theory — rasterization works, e.g. how would one write the code to draw a fixed triangle on screen. Of course, the GPU does that for us, but it is…
Byte-code compilation is an underdocumented — and in the case of the recent lexical binding updates, undocumented — part of Emacs. Most users know that Elisp is usually compiled into a byte-code saved to .elc files, and that byte-code loads and runs faster than uncompiled Elisp. That’s all users really need to know…
Two services running on the same machine. One of them opens a listening TCP socket bound to localhost, the other one connects to that. They exchange data. Every now and then , the service that initiated the connection gets an ECONNRESET while reading data from the socket -- but no other errors show up in the logs, no…
A blog about software.
The C standard library includes a qsort() function for sorting arbitrary buffers given a comparator function. The name comes from its original Unix implementation, “quicker sort,” a variation of the well-known quicksort algorithm. The C standard doesn’t specify an algorithm, except to say that it may be unstable (C99…
Understanding a system or software architecture simply, truly, absolutely, undoubtedly requires an occasional sequence diagram. I left ...