What are you coding?

Is it coding https://nandgame.com ?
(Beware it’s a Zeitgrab albeit a small one if you know what you’re doing, the one that took me longest was the first adder with the carry bit)

1 Like

Reminds me of MHRD on Steam (which I’ve played through twice because it’s so laid-back and chill)

And done. What a productive morning! (my boss may disagree, but he’s out of the office today)

I also had trouble where you did. And I guess-and-checked my way through the opcodes… I got probably about half of them on first guess, the rest I just fiddled with the bits until it checked out

1 Like

I only had experience up until the clock was introduced, at which point I had to switch my brain from vaguely remembering computing lectures to vaguely remembering Minecraft redstone.
After we got to counters my brain hit a bit of a wall but I’ll come back tomorrow…

2 Likes

many moons ago, I had an assignment to do some numerical analysis stuff. The restriction was I had to use the resources provided by the the department. the most capable machine available was the laser printer…

So, I did a bunch of math in postscript. Lots of desk checking for that, given the turn around times. So much different now, you can just do whatever, and compile, test in a few minutes tops.

4 Likes

I’ve coded my first Python program. It is very simple — it cues the user for an integer n, extracts the nth line from a star catalogue in a csv file, splits the line into a list of data, creates a “dictionary” of the data in the line, suitably typed and keyed by strings describing the data, then prints out a summary sentence to standard output — but it is the first program that I have written in a new language for over twenty-five years.

5 Likes

Sounds like a great start.

I am known to sometimes speak python, so let me know if you have any questions.

I can offer (only) one piece of advice for Python programming, which is that the ipdb debugger is much nicer than the standard pdb debugger, with a better shell, tab-completion, and other general niceties. So if you find yourself using pdb, stop and take the time to figure out how to use ipdb instead.

1 Like

As a near-beginner in Python I have to say that while it’s not yet my first choice for anything it feels like a steady get-the-job-done sort of language. (While Ruby is “Perl, only more so” and Rust is “my god it’s full of stars”.)

3 Likes

Thread necromancy…

It’s Advent of Code time again!

Day 1: pretty quick and simple. Did it in Rust. Used a VecDeque because I could.

2 Likes

Oooh, I had forgotten (even though I was thinking about it over the weekend!)

Day 1: simple. Part 2 made me think twice because I knew there was a more elegant approach (it’s probably in itertools; there’s always something in itertools to do what you need), but I just did a bit of leg work. I’d do it differently now using a more complicated data structure than the approach I used.

1 Like

Ooh, I like day 6. In other words I spotted, while writing my solution for part 1, the optimisation that I would otherwise have had to come up with in part 2.

Basically instead of tracking each fish individually I bucket them by timer into a list, so ( count of timer-0 fish, count of timer-1 fish, … ) Then for each generation, shift the timer-0 count off the front, push a zero on the back, then increment elements 6 and 8 by the old timer-0 count.

The only change I had to make to my code for part 2 was to switch to 64-bit ints.

So far I’ve done every day in Rust. My previous record was falling back to Perl on day 3.

1 Like

Day 6

I was suspecting the “here’s a simple algorithm, and we’ll even show you how it works in the instructions; but, oh wait! Now do it so many iterations that your processor overheats!” as I was working on the day6. So, I still did it naively, but it didn’t go out of my way to do my usual over-engineered robust code (building classes with class inheritance and a full suite of methods. Sure enough, day6 part2 met my expectations and I considered just letting my CPU bruteforce through it, but I got bored at about day 143.

So then I decided to try to generalize the groups and do a strictly analytical solution of analyzing the groups and determining how big each group would be by the end…

But I grew tired of that quickly. So I ended up doing what you did in the first place.

Yesterday I wrote my first Kotlin program. (Not for AoC, which I’m still doing in Rust.) Why did I do that?

(1) I’ve never done Java, or any JVM language, and I thought it was time to change that.

(2) It seems to be the preferred language for Android app development, which is a thing I’d like to do a bit of.

Goodness, they really want you do use an IDE. Fortunately I have emacs. (Also about half the books I’ve looked at bang on about “Java does it this bad way, Kotlin is better”, in much the same way that many Rust books say “C does it this bad way, Rust is better” – yes, but I’m not moving over from Java or C so I don’t care.)

3 Likes

IDEs are nice.
I like IDEs.

So I got to write a bit of code today.

My colleagues suggested I fix this one bug so I would get to have an Erfolgserlebnis (“a success event”–there really is not a good translation I can think of) because I was so frustrated.

It was a bug that was fixed by applying a regex :slight_smile: I love me some regex (many devs don’t for some unfathomable reason). This was a simple one: just filter all obviously illegal characters from a potential filename. (Also I am lazy and use regex101.com to help me debug the stuff before even going to my editor)

I was very good and wrote the test to reproduce the bug first. Then wrote a test for the regex and then integrated the code to fix the bug, discovered an additional bug hiding behind the first (just an NPE) and fixed that too and now I get to close a ticket :smiley:

3 Likes

Tests! Tests are wonderful.

When I forked dorthu’s dice roller to use here, the first thing I did was add a huge pile of tests. (All right, the first thing I did was find out how to wrap a test harness round a Ruby-on-Rails plugin without actually running RoR.) They’re not sufficient but I can at least run them in a few seconds, before I go to the second stage of testing on a private Discourse instance.

3 Likes

In the language of my cow-orkers, they would call that “a win”.

Tuesday, I realized that a service I was sucked into owning sucks even more than I thought. (And I thought it sucks lots. it uses our fancy distributed processing infrastructure to make calls into a static service, which then does the actual work. Sensible, the distributed workers could do the work themselves, with no server component (or just as a control plane.)) The static server component, the actual work of the service, is all network IO bound. My tuesday realization was that the server component does the network IO synchronously, which means it can handle only a single request at a time. Since some of the requests take hours to do, clients get queue timeouts waiting for the server to do work; to keep that from happening, the previous maintainer had set the server reservation to have ~200 hosts. I spent an hour making the important bits of the server async, let it soak in testing yesterday, and deployed it this morning. Tomorrow, I’ll see how how much I can can reduce the server reservation. I expect probably to six or eight…

4 Likes

It could be worse. I once saw someone’s first pass at a control plane that blocked the entire time a worker was working a task.

I first read this as “satanic service” and wondered just what exactly your job was. :slight_smile:

4 Likes

Making sure infernal devices are up to date.

1 Like