HN user

kiwidrew

1,182 karma

I know far too much about Python, PostgreSQL, and interfacing with odd systems. I have^H^H^H^H^H once had a tendency to book international flights with less than 48 hours' notice.

Contact me: andrew AT kiwidrew DOT com

Posts10
Comments327
View on HN

The game engines for C&C and Red Alert are full of Dune II references; as just one example, the factions (GDI/Nod or Allies/Soviets) are still called "houses" in the internal configuration files of C&C/RA.

C&C is pretty much what you get when you want to produce a sequel to Dune II but can't (or don't want to) license the Dune I.P. again so everything has to be re-skinned...

Z80 vs. 8088 Speed 3 years ago

The 8088 has a four-byte instruction queue, and at times when the data bus would otherwise be idle the bus interface unit will prefetch the next instruction byte. So fetch and decode/execute are already overlapped.

What really slows down the 8088 is that each 8-bit transfer on the data bus requires four clock cycles. That means simply fetching the two-byte instruction requires eight clocks! Instruction fetch is so slow on the 8088 that it's virtually impossible to achieve the published instruction timing.

it's missing many many culturally specific things like accents and other diacritics

fun fact: some of the symbols included in ASCII were intended to be used as (non-spacing) diacritical marks, specifically the tilde/caret/backquote characters...

[too lazy to dig up a proper source at the moment but the Wikipedia ASCII article covers some of this]

This is fascinating, I really did not think it was possible to implement even a tiny subset of C in just 512 bytes of x86 code. Using atoi() as a generic hash function is a brilliantly awful hack!

Norman Wildberger's "Wild Linear Algebra" series

https://www.youtube.com/playlist?list=PLIljB45xT85BhzJ-oWNug...

His geometry-centric approach to linear algebra was exactly what I needed to finally grok the subject. Topics like matrix multiplication and discriminants went from "why are they defined like this? it makes no sense?" to "of course that's how you multiply matrices because it's the only logical answer".

It's only later that I discovered Wildberger has some ~strange~ very interesting ideas regarding imaginary numbers, but these ideas don't detract one bit from his presentation of linear algebra. Highly recommended viewing for anyone who is keen on neural networks and machine learning but struggles with understanding the underlying mathematics.

If you have a "stock" IBM PC, just the standard dual 360K floppy drives without a hard drive, it's actually possible to run this demo!

Use DOS 3.30 and FORMAT /S a blank floppy, copy APPEND.EXE to the floppy, and copy as many of the AREA5150 demo files as will fit. Then copy the remaining files to a second floppy. Put first floppy in A: and boot off it, put second floppy in B:, and then run APPEND B: followed by AREA5150. Behold, it works!

You absolutely do need the full 640K of RAM though, refuses to run with only 512K.

Yep, there was a (brief) period of time -- before MS-DOS became wildly popular -- when Microsoft was pitching Xenix as the future operating system for the PC.

(Also worth noting is that MS-DOS 2.0 was a nearly complete rewrite of the 1.x codebase...)

CP/M was (mostly) written in the PL/M language and ran on the 8-bit 8080/Z80 processors. 86-DOS was written in pure assembly language and ran on the 16-bit 8086 processor. Tim Paterson, its author, wrote an 8086 assembler and an 8080-to-8086 source code translator that ran on a CP/M machine. He used these tools to bootstrap 86-DOS.

86-DOS was intentionally designed to mimic the CP/M APIs to make it easy to port CP/M applications to 86-DOS through mechanical translation of the source code.

(And, surprise surprise, much of the business software that was available for IBM PC-DOS in the first couple of years were direct ports of existing CP/M applications: SuperCalc, WordStar, dBase II, etc.)

Did any terminal ever implement the ANSI escape codes for block mode (i.e. form) fields?

The block mode terminals on IBM mainframes (e.g. the 3270) have all the functionality of a basic HTML form if you squint hard enough: the screen is divided into form fields and labels, the user can fill out the fields (and tab the cursor between them) while the terminal is offline/not communicating with the server, and then when the user presses one of the special 'submit' keys the terminal sends all of the data from the form fields to the server and awaits instructions on what to do next.

The 3270 even had hidden fields, so the server could stuff a bit of state information (like a session ID) into the form, which the terminal would dutifully echo back to the server when submitting the form....

It's a very different style of interaction as compared to the conventional Unix/PC character-by-character terminals, and leads to some pretty weird user interface conventions: https://www.youtube.com/watch?v=9qwFSJZSjeA

Originally HTML just had the <isindex> element, which was very similar to Gopher's primitive "search" functionality. Adding the <form> element with named input fields was a pretty obvious next step, and the fact that HTTP/HTML evolved to support it while Gopher did not says quite a bit about the culture behind these two protocols.

the 'whitespace operator' for concatenating two strings with a space

Very interesting, awk(1) also does this style of string concatenation; does anyone know of other languages with a similar design?

(I'm aware that many functional languages treat whitespace as function application.)

Actually the cross-platform Tk widgets use an internal "option database" which is essentially just Tcl-flavoured X11 resources. The typical usage is to just set the various options in the application's code, but it's also possible to merge in the display's existing X resources.

At the end of the day X resources are just key-value pairs and the file allows for wildcards, includes, etc

If you squint a little bit, X resources are proto-CSS for the desktop: the clients have a tree of widgets (each widget having a class and a name) and query the resource database for style properties that apply to this tree; the resource database is composed of patterns ("selectors") and values for the various style properties; and applications have a default set of resources baked in which the user's resource database may override. Resource values are also typed (e.g. font, colour, screen position) and there is a rich syntax for specifying things like colours. It's all very elegant, but depends critically upon the X client (or its toolkit) actually bothering to implement this scheme. Qt never bothered and Gtk let its support slowly rot away.

Modern PHP 4 years ago

I used to look down on PHP, but after being forced to use it for a while I begrudgingly came to admire it for all the reasons that you've pointed out. And I started using PHP by choice, generally for writing small scripts (no frameworks or libraries) that I could "deploy" simply by copying the .php file into /var/www. It's a very productive language when used as intended.

PHP scripts on shared webhosting was the original "serverless" and you didn't have to be too careful about object lifetimes and leaking database connections because as soon as the request was finished the entire process was nuked from orbit.

But "modern PHP" is the complete antithesis of everything that I grew to admire about PHP because it's just another Java or C# with awful syntax and weird equality rules and gigantic frameworks with thousands of classes and interfaces.

I would very much like to see a version of PHP that dropped all the nasty namespace and object-oriented misfeatures and just focused on cleaning up the language semantics and enhancing the built-in framework features...

On the Nissan Leaf, the CHAdeMO fast charging port connector exposes (one of) the car's CAN busses (a little in-car network). It's unauthenticated and has commands for charging and discharging the battery. The car doesn't need to be turned on, the vehicle computer wakes up any time that a charging cable is connected. The only security is a small door that covers the charging port, but I'm certain it could be jimmied open with a bit of patience.

So yeah, it's absolutely possible to just walk up to a random Leaf on the street and extract DC power from it (e.g. to charge another EV or power an AC inverter) but you'd need to build your own cable and controller, and also 500VDC at 100A is extremely lethal so it's a terrible idea....

2nd this. In addition, it's easy to obtain the service manuals for the older Leaf models (up to around 2018). The design of the Leaf is very similar to other Nissan vehicles, so working on the car's non-drivetrain components is easy. The electric drivetrain itself has proven to be very reliable so far.

Unfortunately it's not possible, because TLS negotiates a symmetric key which is then used to encrypt and authenticate the rest of the session. If you post the transcript of a TLS session in an attempt to "prove" that you retrieved a specific document, a third party can verify that you did in fact negotiate a symmetric key with the correct server; but since it's a symmetric key, anyone with knowledge of the key can arbitrarily modify the transcript of the session [well, the part of the session where the HTTP request and response happen]. This obviously includes the original prover, and so a TLS transcript proves nothing at all.

I didn't encounter DSE until the mid 2000s when I moved to NZ, but the Jaycar of today stocks way more components than did the DSE of 20 years ago. Jaycar even keeps a stock of 74LS TTL chips behind the counter!