Long Form Posts The RSS feed for Long Form Posts.

  • Writing Good Data Migration Scripts

    I’m waiting for a data migration to finish, so I’ve naturally got migration scripts on my mind. There’s an art to writing a good migration script. It may seem that simply throwing together a small Python script would be enough; and for the simpler cases, it very well might be. But it’s been my experience that running the script in prod is likely to be very different than doing test runs in dev. Continue reading →

  • On Sharing Too Much About Too Little

    Manuel Moreale wrote an interesting post today about sharing stuff online: Life can be joyful and wonderful and marvellous. But it can also be a fucking nightmare. And yes, it’s important to celebrate the victories and to immortalise the glorious moment. But it’s also important to document the failures, the shitty moments, the dark places our minds find themselves stuck in. It’s all part of what makes us unique after all. Continue reading →

  • As Someone Who Works In Software

    As someone who works in software… I cringe every time I see society bend to the limitations of the software they use. It shouldn’t be this way; the software should serve the user, not the other way around. I appreciate a well designed API. Much of my job is using APIs built by others, and the good ones always feel natural to use, like water flowing through a creek. Conversely, a badly designed API makes me want to throw may laptop to the ground. Continue reading →

  • The Perfect Album

    The guys on Hemispheric Views have got me blogging once again. The latest episode bought up the topic of the perfect album: an album that you can “just start from beginning, let it run all the way through without skipping songs, without moving around, just front to back, and just sit there and do nothing else and just listen to that whole album”. Well, having crashed Hemispheric Views once, I’d thought it’s time once again to give my unsolicited opinion on the matter. Continue reading →

  • Favourite Comp. Sci. Textbooks

    John Siracusa talked about his two favourite textbooks on Rec Diffs #233: Modern Operation Systems, and Computer Networks, both by Andrew S. Tanenbaum. I had those textbooks at uni as well. I still do, actually. They’re fantastic. If I were to recommend something on either subject, it would be those two. The two Tanenbaums. I will add that my favourite textbook I had during my degree was Compilers: Principal, Techniques and Tools by Alfred V. Continue reading →

  • Thou Doth Promote Too Much

    Manual Moreale wrote an interesting post about self promotion, where he reflects on whether closing out all his People and Blogs post with a line pointing to his Ko-Fi page is too much: And so I added that single line. But adding that single line was a struggle. Because in my head, it’s obvious that if you do enjoy something and are willing to support it, you’d probably go look for a way to do it. Continue reading →

  • Crashing Hemispheric Views #109: HAZCHEM

    Okay, maybe not “crashing”, a.la Hey Dingus. But some thoughts did come to me while listening to Hemispheric Views #109: HAZCHEM that I’d though I share with others. Haircuts I’m sorry but I cannot disagree more. I don’t really want to talk while I’m getting a haircut. I mean I will if they’re striking up a conversation with me, but I’m generally not there to make new friends; just to get my hair cut quickly and go about my day. Continue reading →

  • On Micro.blog, Scribbles, And Multi-homing

    I’ve been ask why I’m using Scribbles given that I’m here on Micro.blog. Honestly I wish I could say I’ve got a great answer. I like both services very much, and I have no plans of abandoning Micro.blog for Scribbles, or visa-versa. But I am planning to use both for writing stuff online, at least for now, and I suppose the best answer I can give is a combination of various emotions and hang-ups I have about what I want to write about, and where it should go. Continue reading →

  • Moan-routine: Stripe Prices

    I love coding and anything computers. I’ve spent, and continue to spend, a significant amount of my life writing code. And on the whole, it’s been a magical experience. But not always. Sometimes I encounter something that makes me wonder why? Why was that designed that way? Why doesn’t it work? Why couldn’t this be easier? You encounter something that blocks you or puzzles you, maybe even questions how anything in computers can work at all. Continue reading →

  • Small Calculator Commands

    This page documents the extra commands from Small Calculator. These were taken from source code, pretty much as is, but styled to suite the web, and any spelling mistakes fixed. These were retrievable from the application itself by typing “help” follow by the command. Available Commands The list of available commands are as follows BLOCK <statements> Executes a block of statements HELP [topic] Display help on topic DEFFNC <function> Defines a new function ECHO <text> Displays text on the line ECHOEXPR <cmd> Executes a command and displays the result EXEC <file> Executes a file of commands FUNCTIONS Displays all predefined functions IF <pred> Does a command on condition RETURN <val> Sets the return value RETURNEXPR <cmd> Sets the return value to the result of <cmd> Type "HELP <command>" to see infomation on a command BLOCK BLOCK {<cmd1>} {<cmd2>} . Continue reading →

  • Small Calculator

    Date: Unknown, but probably around 2005 Status: Retired Give me Delphi 7, a terminal control, and an expression parser, and of course I’m going to build a silly little REPL program. I can’t really remember why I though this was worth spending time on, but I was always interested in little languages (still am), and I guess I though having a desk calculator that used one was worth having. I was using a parser library I found on Torry’s Delphi Pages (the best site at the time to get free controls for Delphi) for something else, and after getting a control which simulated a terminal, I wrote a very simple REPL loop which used the two. Continue reading →

  • Self-Driving Bicycle for The Mind

    While listening to the Stratchery interview with Hugo Berra, a thought occurred to me. Berra mentioned that Xaomi was building an EV. Not a self-driving one, mind you: this one has a steering wheel and peddles. He made the comment that were Apple to actually go through with releasing a car, it would look a lot like what Xaomi has built. I haven’t seen either car project myself so I’ll take his word for it. Continue reading →

  • On Post Headers

    My answer to @mandaris question: How many of you are using headers in your blogging? Are you using anything that denotes different sections? I generally don’t use headers, unless the post is so long it needs them to break it up a little. When I do, I tend to start with H2, then step down to H3, H4, etc. I’d love to start with H1, but most themes I encounter, including those from software like Confluence, style H1 to be almost the same size as the page title. Continue reading →

  • Sorting And Go Slices

    Word of caution for anyone passing Go slices to a function which will sort them. Doing so as is will modify the original slice. If you were to write this, for example: package main import ( "fmt" "sort" ) func printSorted(ys []int) { sort.Slice(ys, func(i, j int) bool { return ys[i] < ys[j] }) fmt.Println(ys) } func main() { xs := []int{3, 1, 2} printSorted(xs) fmt.Println(xs) } You will find, when you run it, that both xs and ys will be sorted: Continue reading →

  • Adding A Sidebar To A Tiny Theme Micro.blog

    This is now a standalone Micro.blog Plugin called Sidebar For Tiny Theme which adds support for this out of the box. The method documented below no longer works, but I'm keeping it here for posterity reason. I’d though I’d write a little about how I added a sidebar with recommendations to my Tiny Theme’ed Micro.blog, for anyone else interested in doing likewise. For an example on how this looks, please see this post, or just go to the home page of this site. Continue reading →

  • Photo Bucket Update: Exporting To Zip

    Worked a little more on Photo Bucket this week. Added the ability to export the contents of an instance to a Zip file. This consist of both images and metadata. I’ve went with lines of JSON file for the image metadata. I considered a CSV file briefly, but for optional fields like captions and custom properties, I didn’t like the idea of a lot of empty columns. Better to go with a format that’s a little more flexible, even if it does mean more text per line. Continue reading →

  • Photo Bucket Update: More On Galleries

    Spent a bit more time working on Photo Bucket this last week1, particularly around galleries. They’re progressing quite well. I’m made some strides in getting two big parts of the UI working now: adding and removing images to galleries, and re-ordering gallery items via drag and drop. I’ll talk about re-ordering first. This was when I had to bite the bullet and start coding up some JavaScript. Usually I’d turn to Stimulus for this but I wanted to give HTML web components a try. Continue reading →

  • Complexity Stays At the Office

    It’s interesting to hear what others like to look at during their spare time, like setting up Temporal clusters or looking at frontend frameworks built atop five other frameworks built on React. I guess the thinking is that since we use it for our jobs, it’s helpful to keep abreast of these technologies. Not me. Not any more. Back in the day I may have though similar. I may even have had a passing fancy at stuff like this, revelling in its complexity with the misguided assumption that it’ll equal power (well, to be fair, it would equal leverage). Continue reading →

  • Message Simulator Client

    Years: 2017 — 2020 Status: Gone I once worked at a company that was responsible for sending SMS messages via an API. Think one time passwords when you log into websites, before time-based OTP apps were a thing. And yeah, this did involve some “marketing” messages, although we were pretty strict about outright spam or phishing messages. Anyway, since sending messages costed us money, we had a simulator setup in our non-prod environments which we used for testing. Continue reading →

  • Implicit Imports To Load Go Database Drivers Considered Annoying (By Me)

    I wish Go’s approach to loading database drivers didn’t involve implicitly importing them as packages. At least that way, package authors would be more likely to get the driver from the caller, rather than load a driver themselves. I’ve been bitten by this recently, twice. I’m using a GitHub Linux driver to build an ARM version of something that needs to use SQLite. As far as I can tell, it’s not possible to build an ARM binary with CGO enabled with these runners (at-least, not without installing a bunch of dependencies — I’m not that desperate yet). Continue reading →

  • Rubber-ducking: On Context

    I’m torn between extracting auth credentials in the handler from a Go Context and passing them as arguments to service methods, or just passing the context and having the service methods get it from the Context themselves. Previously, when the auth credentials just had a user ID, we were doing the former. But we’re now using more information about what the user has access to and if we were to continue doing this, we’ll need to pass more parameters through to the service layer. Continue reading →

  • Rubberducking: On Context

    I’m torn between extracting auth credentials in the handler from a Go Context and passing them as arguments to service methods, or just passing the context and having the service methods get it from the Context themselves. Previously, when the auth credentials just had a user ID, we were doing the former. But we’re now using more information about what the user has access to and if we were to continue doing this, we’ll need to pass more parameters through to the service layer. Continue reading →

  • Goland Debugger Not Working? Try Upgrading All The Things

    I’ve been having occasional trouble with the debugger in Goland. Every attempt to debug a test would just fail with the following error: /usr/local/go/bin/go tool test2json -t /Applications/GoLand.app/… API server listening at: 127.0.0.1:60732 could not launch process: EOF Debugger finished with the exit code 1 My previous attempts at fixing this — upgrading Go and Goland — did get it working for a while, but recently it’s been happening to me again. Continue reading →

  • People Are More Interested In What You're Working On Than You Think

    If anyone else is weary about posting about what projects they’re working on, fearing that others would think they’re showing off or something, here’s two bits of evidence that I hope would allay these fears: Exhibit 1: I’m a bit of a fan of the GMTK YouTube channel. Lots of good videos there about game development that, despite not being a game developer myself, I find facinating. But the playlist I enjoy the most is the one where Mark Brown, the series creator, actually goes through the process of building a game himself. Continue reading →

  • Github Actions, Default Token Permissions, And Publishing Binaries

    Looks like Github’s locked down the access rights of the GITHUB_TOKEN recently. This is the token that’s available to all Github actions by default. After taking a GoReleaser config file from an old project and using it in a new one, I encountered this error when GoReleaser tried to publish the binaries as part of a Github Release: failed to publish artifacts: could not release: PATCH https://api.github.com/repos/lmika/<project>/releases/139475588: 403 Resource not accessible by integration [] After a quick search, I found this Github issue which seemed to cover the same problem. Continue reading →