I like to use scrollbars. I move my mouse cursor to the scrollbar handle and move it about – scrolling like this is so much faster than with the wheel if you want to scroll more than a few lines. I didn’t notice how often I did this until sites started breaking this. It seems to be fashionable to put a margin around the entire document, resulting in the scrollbar no longer being aligned to the…
The Chesterton’s fence analogy says that you need to be careful to change things if you don’t understand why things are the way they are, because there may be good reasons you haven’t considered yet. This is broadly good advice in many different contexts, including programming where it can be easy to “fix” some weird code only to discover there was a reason for the weirdness later on when things…
I’ve been writing Ruby at my new $dayjob in the last month. After spending most of the last decade writing Go it’s been a fun change of scenery. I did Ruby before (years ago) and I can’t really tell you which is “better” – Ruby is very different from Go in almost every respect and I find both quite effective in getting stuff done in their own way. One aspect where I do feel Go is clearly better is…
I’d like to know what the “best” compression tool is for storing archives (backups, data files). So I wrote a tool to compare them: cmp-compress . My tl;dr take-away is: zstd -3 for fast compression (the default). xz -7 for the best ratio use; -8 or -9 sometimes compress better but often don’t. You probably want to test this. zstd -12 for a good trade-off that leans towards fast. zstd -17 for a…
I have come to believe that by and large “best practices” are doing more harm than good. Not necessarily because they’re bad advice as such, but because they’re mostly pounded by either 1) various types of zealots, idiots, and assholes who abuse these kind of “best practices” as an argument from authority, or 2) inexperienced programmers who lack the ability to judge the applicability, Everyone…
The Go compiler skips files ending with _test.go during normal compilation. They are compiled with go test command (together will all other .go files), which also inserts some chutney to run the test functions. The standard way to do testing is to have a foo.go and foo_test.go file next to each other. If you have a file that appears to end with _test.go but doesn’t actually end with _test.go ,…
A long time ago when the Unix greybeards were slightly less grey beards everyone was using hardware terminals to talk to some mainframe. Those terminals had wildly different feature sets and ways to implement them, which you needed to know about if you wanted your program to run on more than one type of terminal. Hence systems like terminfo and termcap. The TeleVideo 955 used \x1b[=5l for bold…
You would expect this to work, no? bash% echo $(( .1 + .2 )) bash: .1 + .2 : syntax error: operand expected (error token is ".1 + .2 ") Well, bash says no, but zsh just works: zsh% echo $(( .1 + .2 )) 0.30000000000000004 # Well, "works" insofar IEEE-754 works. There is simply no way you can do calculations with fractions in bash without relying on bc , dc , or some hacks. Compared to simply being…
This describes how to create RimWorld mods on Linux; this is an introduction to both RimWorld modding and developing C♯ with Mono; it’s essentially the steps I followed to get started. This doesn’t assume any knowledge of Unity, Mono, or C♯ but some familiarity with Linux and general programming is assumed; if you’re completely new to programming then this probably isn’t a good resource. A lot of…
So Richard Stallman is back at the FSF, on the board of directors this time rather than as President. I’m not sure how significant this position is in the day-to-day operations, but I’m not sure if that’s really important. How anyone could have thought this was a good idea is beyond me. I’ve long considered Stallman to be a poor representative of the community, and quite frankly it baffles me that…