Computer programming for fun and profit

5 Likes
12 Likes

Needs the lights and switches.

3 Likes

(Moved over here, off the Coronavirus main track.)

My first computer is a 3MHz 8085. Burn the code into EPROMs, and it could do it.

Besides lacking even a watchdog timer, another problem is that Raspbian isn’t a good choice for that kind of real-time. For example, the classic dumb way to read the value of a game paddle is to discharge a capacitor through the paddle’s resistor and do a busy-wait counting loop. Try that with Raspbian and the values are all over the place, even on a multi-core Pi. There’s just too much other stuff going on in the background. (I offloaded the task to a MCP3008 ADC chip, but still.)

Sometimes gobs of processor power are no substitute for a simple real-time control program and good interrupts.

eta: BTW, Pathfinder’s Dataradio had a 6800, possibly a 6809, running compiled Forth.

5 Likes

You don’t need to run Raspbian on a Pi. There is even at least one bare metal Forth. I’ve been tempted to try to move some of my old Forth projects onto my Pi (which has been unused for some time now), but I’m afraid the SSDD 5.25" disks on which they reside will have degraded by now.

2 Likes

FAQ

Q: How does this work?

A: Regular regexes (i.e. no backreferences and similar advanced features) can be turned into a so called DFA (deterministic finite automaton). This is basically a bunch of arrows going between states, where an arrow is labeled with a letter so that a letter in a state causes the current state to go along the arrow to another state, with a subset of states being accepting. Yes, I’m bad at explaining, you’re better off reading the wikipedia article on DFAs if you don’t know what it is.

Because I’m lazy, I used BurntSushi/regex-automata to get an DFA from a regex.

While Fat32 normally has a tree-like structure, each directory just references blocks anywhere on the file system, so the same block can be referenced from multiple directories. The directories also have no explicit field for parent directories, so one can leave .. out. This allows for graph structures inside a file system, which a DFA basically is.

Q: Should I use this in production anywhere?

A: No, but I can’t stop you.

Q: Does this actually work?

A: I’ve tried it on Windows 10 and Linux so far. It seems to work flawlessly on Windows as far as I’ve tested.

On Linux, the fat32 code claims an directory is invalid if there are two dentries with the same directory name and the same parent in a loop (or something like that), so some paths are forbidden.

Might be fun to try on some embedded devices.

Q: NOOOOOOOOOOO!!! YOU CAN’T TURN A DFA INTO A FAT32 FILE SYSTEM!!! YOU CAN’T JUST HAVE A DIRECTORY WITH MULTIPLE PARENTS!!! YOU ARE BREAKING THE ASSUMPTION OF LACK OF LOOPERINOS NOOOOOOOOO

A: Haha OS-driven regex engine go brrrrr

2 Likes

8051Enthusiast/regex2fat

Did you ever want to match a regex, but all you had was a fat32 driver? Ever wanted to serialize your regex DFAs into one of the most widely supported formats used by over 3 billion devices?

Worry no more, with regex2fat this has become easier than ever before!

rofl.

1 Like

Cloudflare goes retro with COBOL delivery service. Older coders: Who’s laughing now? Turns out we’re still vital

1 Like
1 Like

Source code for seminal adventure game Zork circa-1977 exhumed from MIT tapes, plonked on GitHub

Source code for seminal adventure game Zork, dating back to 1977 and recovered from MIT tapes, was published this week on GitHub.

While classic adventure games (aka interactive fiction) are well represented in the Internet Archive – there’s plenty of playable Zork versions here – this latest trove is source code retrieved from the US university’s Department of Distinctive Collections (DDC)'s Tapes of Tech Square (ToTS) collection.

If you access the repo and its README you’re told the source was written “in the MDL programming language written on a PDP-10 timeshare computer running the ITS operating system.”

5 Likes

rocking! thanks for sharing.

if you’re interested in this kind of stuff i also recommend reading knuth’s c-web port of adventure. Literate Programming - CWEB

it’s highly readable, and would actually be pretty handy in writing a one-off text adventure if you’re into that sort of thing. :raising_hand_woman:

2 Likes

Interesting, thanks!

2 Likes

Need some weekend reading? How about the source code for UK, Australia’s coronavirus contact-tracing apps

The NHSX, a technology group within the UK government’s National Health Service, has released the source code for its Android and iOS COVID-19 coronavirus contact-tracing apps in an effort to allay privacy concerns and improve the code.

Developers who have examined the blueprints have not been entirely mollified, and have called out several potential problems.

For example, the apps, which are supposed to be pro-privacy, use Google Analytics and the Firebase Analytics framework, configured in a way to allow personalized web advertisements. Also, they generate a private key that’s not private because it gets created on a remote server rather than on the user’s device. And they link to insecure HTTP resources.
 

2 Likes

A few minutes ago I walked through the living room just as Space Force did the scene with the monkey and “No, that tool!”. (Trust me, when you see the scene setup, you’ll realize that was not a spoiler in the least.)

After another thirty seconds of them passing commands to the monkey, to the point that everybody on both sides of the camera is ready to burst each others’ arteries, I told my partner “Yep, that’s just what writing code feels like.”

1 Like

Things I initially didn’t get about COBOL:

  • How it works
  • Why anyone would want to use it
  • How to code in it

After about a week into my COBOL course in college in 1999, something clicked. It’s programming for non-programmers. It’s like going sane in a crazy world. It’s actually really easy compared to even something like VB6.

Granted, I only ever took one COBOL course, but it was easier than BASIC once you have that epiphany. I’m not sure why it is hard to train up new COBOL programmers…

Am I missing something? I don’t think I am. I am not a great programmer, or even a good programmer. I am an OK programmer. I prefer the Microsoft stack (.Net, Powershell), except for VC++ which needs to DIAF.

7 Likes

Damn, you’ve got me kinda COBOL-curious now… is there anything you can recommend with zero or fewer devops required?

3 Likes

80-characters-per-line limits should be terminal, says Linux kernel chief Linus Torvalds

1 Like

Microsoft is sending your development code to the cloud, again.

Block at first sight only uses the cloud protection backend for executable files and non-portable executable files that are downloaded from the Internet, or that originate from the Internet zone. A hash value of the .exe file is checked via the cloud backend to determine if this is a previously undetected file.

They’re wrong about only checking downloaded or Internet Zone files. (Ask me how I know!)

If the cloud backend is unable to make a determination, Windows Defender Antivirus locks the file and uploads a copy to the cloud. The cloud performs additional analysis to reach a determination before it either allows the file to run or blocks it in all future encounters, depending on whether it determines the file to be malicious or safe.

Obviously my own software isn’t going to be recognized, so it’ll send the whole thing to the cloud. And send it again when I recompile. It’ll be big too, if I’m including all the debug info in the executable.

I have switched off this “feature” so many times…

eta: They turned on Remote Desktop again too. Fuuuuuuuck!

3 Likes

Apparently Apple is doing the same.

https://sigpipe.macromates.com/2020/macos-catalina-slow-by-design/

I hate modern computing sometimes.

4 Likes

what’s especially great is if you’re using custom built software to say… run a cash register on windows ( unfortunately this is more common than you’d think )… windows defender will helpfully do things like quarantine your drivers, rendering your cash register inoperable in the middle of a busy, mask wearing, stress filled, pandemic day.

did i mention that they’re talking about the national guard? they’re not coming for our software. unfortunately.

( i’m just a cashier. not responsible for the software. somehow i feel this is necessary to point out :joy_cat: )

3 Likes