I asked ChatGPT to format php datetime as “Fri 24 Mar 2023” and it “understood” what I meant and gave me the answer that I wanted! If that’s not intelligence I don’t know what is…
Category Archives: Programming
Server programming challenge
This looks like fun: protohackers.com. If I had more time I would definitely do this. If… :P
The 1969 Apollo Guidance Computer
Here’s a great talk about the Apollo Guidance Computer: Light Years Ahead | The 1969 Apollo Guidance Computer.
RTL
The initialism “RTL” can stand for both “Register Transfer Level” and “Resistor-Transistor Logic” as explained by ChatGPT.
Critical Path != Critical Section
I always get the concepts “critical path” and “critical section” confused.
The “critical section” is the part in your algorithm which you must hold a lock for; whereas the “critical path” is an idea from hardware design which relates to the time taken for the longest combinatorial logic that needs to be processed during a clock cycle, thus limiting the frequency you can run your clock at.
Although the terminology “critical path” came from hardware, the same terminology is used in software. ChatGPT has a fairly good write-up on the two uses of the term “critical path”.
I learned a little more about this in Introduction to VHDL for FPGA and ASIC design.
CRC
I watched Ben Eater’s videos How do CRCs work? and Checksums and Hamming distance (the full course is Learn about error detection) then found the Wikipedia page: Cyclic redundancy check.
Also of interest:
HP-16C
I was watching Ben Eater’s video Build an 8-bit decimal display for our 8-bit computer and I was interested in what calculator he was using. Seems to be an HP-16C.
YouTube channel logo
I wanted a new logo to go with my YouTube channel to replace a very old photo of me. So I asked ChatGPT and it didn’t let me down!
Target then source
I’m surprised it took me this long to figure this out. But there’s a very big problem with a command like this:
rsync var/data/ target:/var/data/
The problem is that in order to type that command, you first have to type the first part of the command, which includes this command:
rsync var/data/ target:/
That first part of the command is in fact a valid command, and if you pressed ENTER accidentally before you had finished typing the whole command, then rsync would begin to replace your entire root file system with the contents of var. That’s the sort of thing that will ruin your day.
So from now on, when I write command-line tools, I will nominate the target *before* the source, and if both the target and source are not specified then I will return an error.
p.s. Yes, the reverse problem exists, that when you nominate the target first you can still fuck up with the source, but given that you are operating on the target from the source, if you get the source wrong, you can just fix your command and run it again and it will be fixed up.
Falsehoods programmers believe about programming
Just re-enjoying this old chestnut: Falsehoods programmers believe about programming.