What are you coding?

I solved 9.2 sometime on Friday.

Right now despite my plans to do more AoC today, I am writing code to write exif / iptc (or whatever) tags into the format that Darktable wants (early attempts had suggested using / for hierarchical tags was fine and now its not.

I also decided to try and hook up my IntelliJ IDE with a local LLM through LM Studio and suddenly I have tons of new GPU driver packages and … am definitely not getting anywhere close to AoC because while the script could be done I am trying to learn to use LM Studio at the same time and…

I think LLMs are really cool. My IDE just downloaded a tiny one specialized on python auto completion … no need for a fat GPU to use that one.

2 Likes

“I’ll just knock up a quick hex coordinate library to support the Talon game software I’ll be writing.”

Half an hour later…

impl Hex {
    pub fn offset(&self, dir: i32, d: i32) -> Hex {
        // offset [d] hexes in [dir], from E clockwise.
        match dir.rem_euclid(6) {
            0 => Hex{q: self.q + d, r: self.r},
            1 => Hex{q: self.q,     r: self.r + d},
            2 => Hex{q: self.q - d, r: self.r + d},
            3 => Hex{q: self.q - d, r: self.r},
            4 => Hex{q: self.q,     r: self.r - d},
            5 => Hex{q: self.q + d, r: self.r - d},
            _ => Hex{q: 0, r: 0}
        }
    }
    pub fn s(&self) -> i32 {
        // the secret hidden S coordinate
        -self.q - self.r
    }
    pub fn add(&self, other: &Hex) -> Hex {
        // sum of two displacements
        Hex{q: self.q + other.q, r: self.r + other.r}
    }
    pub fn delta(&self, other: &Hex) -> Hex {
        // displacement FROM self TO other, other - self
        Hex{q: other.q - self.q, r: other.r - self.r}
    }
    pub fn sub(&self, other: &Hex) -> Hex {
        // displacement FROM other TO self, self - other
        Hex{q: self.q - other.q, r: self.r - other.r}
    }
    pub fn range(&self, other: &Hex) -> i32 {
        // shortest path distance
        let dh = self.delta(other);
        ( dh.q.abs() +
            dh.r.abs() +
            dh.s().abs() ) / 2
    }
    pub fn rotate(&self, steps: i32) -> Hex {
        // rotate [steps] 60degree steps clockwise about (0, 0, 0)
        let ss = steps.rem_euclid(6);
        let mut c = vec![self.q, self.r, self.s()];
        if ss.rem_euclid(2) != 0 {
            c = vec![-self.q, -self.r, -self.s()];
        }
        let offset = ss.rem_euclid(3) as usize;
        Hex{q: c[offset], r: c[(offset + 1).rem_euclid(3)]}
    }
}
5 Likes

And a bit after that, an arc of fire calculator. With tests.

2 Likes

We have logs at work. Lots of logs. It’s not unusual to serve two million page requests in a day.

We have a protocol for doing log analyses. I wrote code for this a few years back. But for example it has to count the number of distinct (IP + user-agent) tuples, and that means they all have to be stored, generally in memory.

These days we have enough traffic that it doesn’t complete a year’s logs even in the 32G of my largest machine.

So I’ve just spent a day or so rewriting it, (a) into Rust so that it runs much faster and uses a bit less memory (even my not terribly ept Rust is about 10× the speed I was getting from Perl) (and, as it happens, it now correctly handles some IPv6 addresses it wasn’t before, because Rust has a good honest 128-bit integer data type and in Perl I have to do it in strings) and (b) with the possibility of a bit of segmentation so that I can do the analyses piecemeal and combine them later.

This is all working Remarkably Well. Hurrah.

6 Likes


This probably means very little. And it’s an absolutely minimum proof of concept. But it is a list of Advantages for a GURPS character, generated directly off the GCA5 file (standard GURPS character management software), entirely in Typst.

This opens the door to writing a full-on GURPS character sheet in Typst. (And the main thing that GCA5 has lacked, to my perception at least, is a character sheet layout as good as the one that a third party wrote for the previous version.)

6 Likes

The final step in this, by the way, was to stop using an actual IP address structure but just put my address categories into a list of (start, end, category ID) (sorted by start, shouldn’t overlap). Which lets me do a binary chop rather than checking each one individually. The entire process is now down to a few minutes.

2 Likes

But today’s Typst has been “take a knitting chart bitmap (like the one below), break it out into a usable data format, and generate a new chart with different colours and various other tweaks”. And the same data will soon generate a text pattern as well.

4 Likes

As mentioned elswhere I have been coding a new project with claude code. I hesitate to call it vibe coding because I am not letting it vibe. I may write down my observances on claude code at some point. I just came here to say that I am working with gradle for the first time and I have regrets of not using it at work … it seems so much faster …

3 Likes

Latest GURPS thing: take a template, randomly expand it into an immediately usable character. (I.e. it does all the “choose X points from trait list Y” choices.) Firedrake/gurps-template-expander: An automatic random expander for GURPS character templates. - Codeberg.org

3 Likes

Doing a refactoring on my Game Collection project … I am only half as fast without Claude assistence however… … I am also assured that this is much cleaner in the end.

4 Likes

Today, I learned… well but it is so technical I’d rather put it here: gitea has its own docker registry. Yay.

2 Likes

Rare that something I do at home gets to be useful at work.

This week I had to throw together some Python (mostly SciPy and NumPy) to produce spectrograms/FFTs of some ADC data.

I’ve spent a fair while unpicking and refactoring the ex-contractor’s code (as well as the help of a firmware engineer) to get the raw data to make sense so it was really nice this week to get to see some pretty pictures.

That’s also rare as an embedded software engineer.

5 Likes

I now have a personal api key for a (the) CVE database because even for a private project I feel the necessity to be aware. We have CVEs every couple of weeks at work with a similar tech-stack as I am using… and since I want to publish my project, I can’t be having any libraries with relevant CVEs in my local stack either.

2 Likes

Still working on my geekgroup.app clone thing.
I am close to feature complete.
Mostly I still want to parse the BgStats data I have and add that.
The rest is polish.

The project is not small anymore. I am at 190 java files and ~ 15k lines of code (not the best metric there is I know).

I am quite happy with the results and I learned an incredible amount of stuff about AI Coding, about a lot of libraries I use at work, hexagonal architectures, Thymeleaf (which I will need at work soon enough). And it’s all been so much fun.


I also got to write some code at work generating test-data from generated classes and render them into xml and json respectively. We need to make up our test-data as we are in an environment where no “real” data will ever be made available to us for testing.

3 Likes

How is this a real, “production-ready” ecosystem?
Run the “installer” (sus already, piping curl to bash)

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash
...
$ nvm install --lts

And then, of course, I need pnpm because npm is “slow”, so there’s the bit where it’s recommended I use npm to install pnpm:

$ npm install -g pnpm

added 1 package in 1s

1 package is looking for funding
  run `npm fund` for details
npm notice
npm notice New minor version of npm available! 11.13.0 -> 11.16.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.16.0
npm notice To update run: npm install -g npm@11.16.0
npm notice

I mean, why wouldn’t a freshly installed nvm-managed “lts” node instance offer an immediate notice that there’s a minor version update available.


Then I get to do the pnpm install which takes so long, I use a debug output modification to replace the “progress bar” with a JSON status update feed, so that I have a little more confidence that it’s actually doing something rather than just hanging indefinitely while it installs 2553 packages.

Completing the pnpm install actually takes several rounds of trial-and-error because what works with pnpm v10 changed syntax with pnpm v11, and then following those instructions shows that the v11 syntax changed again (at some point) and now the file you need to edit is different, so I update that…

Eventually, over 3 hours later, and restarting the install process several times after it failed, I have

$ du -sh node_modules/
2.4G    node_modules/

This includes many packages that alert that they are no longer supported, I would migrate to the recommended package alternatives, but that would trigger endless cascading dependency changes.


So, anyway, I like to host a static file version of GitHub - CorentinTh/it-tools: Collection of handy online tools for developers, with great UX. · GitHub on my internal network, but am working on deploying the forked version, GitHub - sharevb/it-tools: My additions (and of others) to it-tools! (Collection of handy online tools for developers, with great UX. ) · GitHub instead.

Compiling the static file version saves me the hassle of having a docker container that insists on having node running in a bloated docker image with 2.4G of packages.

The “coding” I find myself doing here is trying to match the correct versions of frameworks and packages in this awful ecosystem with something that has a label of “lts”, and desperately hoping that the “lts” means “longer than 6 months”.

2 Likes

what exactly is it that you are installing?

1 Like

Apparently it is “standard” now.

And I realise that a naughty deb package can do all the same things that can (preinstall scripts) but it feels wrong.

2 Likes

I’m building a static-file version of

2 Likes

Every time a new style of computing gets established, it has to learn the lessons of security all over again.

I’m someone who has done C amd assembler with digressions into other languages for over 40 years. I’m now having to port a mass of C/C++ code to WebAssembly, with testing in Node.js.

Oddly enough, I am highly adverse to dragging in JavaScript packages for Node to use. Where I need a bit of JS, I find out what’s needed and write a minimal version. So far, that amounts to four lines, and no extra dependencies.

6 Likes

Whenever I think about node packages, I always remember reading an article/post about is-even.

Using is-even creates a dependency on is-odd and simply returns !isOdd(i). This package has hundreds of thousands of downloads per week

4 Likes