What are you coding?

What do I work with? Well, it’s down below all the other stuff, people don’t like to talk about it, and it can get pretty hot…

2 Likes

AOC day 15:

  • this looks like Dijkstra
  • I don’t have that immediately in my head
  • I’ll write my own brute force solver
  • OK, that seems to work
  • I might as well do it the proper way too
  • oh, the proper way takes over 60× as long

That was a bit unexpected…

(ETA: I’m assuming that this means my implementation of the proper way is grievously lacking, not that I am an algorithmic genius.)

3 Likes

As I recall, dijkstra’s algorithm is O(v + e log(v)) when done properly (which uses a queue), and v^2 when done with arrays, and there are some easy mistakes that make it v^3 or worse.

2 Likes

I finally caught up to AOC day 15 (work has been crazy busy):

Part 1’s sample was solved with a pretty rudimentary bruteforce recursive function; running the bruteforce approach on my puzzle input required me to increase the default recursion limit above 1000 levels. And was going to take… forever.

I don’t know what Dijkstra, but a cursory search lead me to believe my actual solution was Dijkstra-adjacent, using a naive queue-based heatmap flood-fill algorithm.

1 Like

Whereas I did a grid-fill: for each cell, look at all neighbours, see if any of them’s has a cost higher than our current cost + their value, if so set it and mark the pass dirty. Continue until a pass isn’t dirty. Dijkstra-inspired, but works cleanly with arrays rather than needing an efficient minimum-finder. May be better for this specific griddable case.

1 Like

Still doing it, but today’s was a real slog: it’s obviously Dijkstra plus a slightly fiddly legal move generator, and working that out is the fun bit. Then the rest is gruntwork.

Apparently the current answer to the thread’s question is “JavaScript”. I’d been planning to learn Rust+WebAssembly but there was a problem with the toolchain, so on 1 January I wrote my first JavaScript program, and now, well. (The draggy droppy stuff is largely borrowed from elsewhere, to be fair.)

2 Likes

I’ve just implemented quicksort in PostScript.

If this is ever actually useful to anyone, I’m very sorry.

5 Likes

You could use that to create a PostScript program that prints out the stages in a quicksort. Then you could create an animation from the output. That’s nearly useful.

4 Likes

I did my calculus homework in postscript a couple times. The most powerful processor I had access to was in the printer.

I do not miss those days.

4 Likes

I thought it was useful, but then I remembered that I have a bubble jet printer.

2 Likes

I have this database project I’m working on, where I (or my colleague Larry) transcribes Admiralty documents from the 17th Century into a database, and then researchers are able to use something built onto the side of a wordpress site to view the documents, or look up all references to a single ship, officer, or location (at least, where they are mentioned in the documents that have been transcribed).

At the moment, I’m putting the finishing touches on the newest version of the transcription interface- I’m having one… really annoying issue and I’ve spent several days trying to sort it out. The problem is a sort and it’s very annoying and I’m trying to sort it out and anyways bashing my head against PHP is … frustrating sometimes.

3 Likes

The “run it on the GPU” of its day. :slight_smile:

1 Like

Unit tests. I’ve been writing so many unit tests.
We have a big change in one of the main classes of our underlying model and we need to make sure it all behaves and as such unit tests just help to act as a specification to program against.

I really like a feature of testng (java lib) that I only encountered for the first time in this project. The “dataprovider” annotation allows me to hand an iterator to a unit test method and it uses those to parametrize and execute each test case as an actual unit even if it is just one method being filled with different datapoints. I love that. So my test cases become more or less a table of value combinations. This helps me define enough of them easily and not overlook certain combinations of possible inputs and we found our first bug within the first 16 test cases.

7 Likes

Same. We’re trying to improve our code coverage across the board at the start of the year so I’m trying to fill in some gaps. It’s been OK, though the workflow for getting the figures is awful so I’ve got someone looking at moving us to GTest in the meantime.

4 Likes

Yay for comprehensive test coverage! One of our software teams is doing an “upgrade” (read: nuke it from orbit) of an old, clunky piece of software which currently has… Almost no tests. Strangely enough people keep finding bugs!

3 Likes

Anyone who wants to add more tests to the forum dice roller, feel free! :slight_smile: (It had none when I forked it.)

5 Likes
4 Likes

I hate working with timeseries…

1 Like

Reminds me of when I installed Linux on a bunch of old iMacs (the original PPC ones that were funky colours) for a uni project and discovered that if you didn’t immediately set the time on first boot, any subsequent boot would fail because they thought it was 01/01/1900.

I’m also a big fan of the different epoch dates various systems use. Particularly where Lotus fucked it up and then Excel kept the fuck-up.

3 Likes