Prolog Via Pokémon

Like many people who read Hackaday, we are fairly fluent in a number of computer languages, but we have to admit it is easier to pick up languages that look like they group with things like Fortran. Sure, modern languages have all sorts of features, but the idea that you have a text file that executes in some order, variables, statements, and so on runs through most popular languages, but not all of them. Lisp and its variants are a different way of looking at things. And then there’s Prolog. [Alexander Petros] has an interesting way of explaining Prolog as a Pokémon game.

Prolog was “the next big thing” when AI meant expert systems. It is more of a specialized database where you define facts and rules that the computer can infer answers to queries. For example, if the facts say that Paul and Anna both have Mary as a parent, and a rule says that people with the same parent are siblings, then a query asking whether Paul and Anna are siblings will indicate that they are.

Continue reading “Prolog Via Pokémon”

Your Browser Probably Lies To The Big Sites (Blame Chrome)

When you visit certain large sites in Firefox or Safari, the browser may detect your visit and change its behavior. It could be as simple as lying about its identity, or it may totally change how it renders the page. But according to a post by [Den Odell], this isn’t a conspiracy between browsers and big Internet — rather, it is a byproduct of Chrome’s dominance.

Here’s how it goes. Chrome puts out a new feature and everyone rushes to implement it on their site. Maybe the new code breaks other browsers. Maybe the other browser supports the feature, but the website doesn’t detect it correctly or is unaware. Maybe it just relies on some quirk of Chrome. Regardless, Firefox and Safari will change to match the site rather than mess up the user’s experience.

If you want to check it out, Firefox will show you what it does and let you disable specific fixes if you visit the about:compat URL. For Safari, you’ll have to read code from a file named quirks. Bugzilla tracks the fixes for Firefox, if you want more details.

Browsers are huge and complex so even niche browsers, today, usually use one of a handful of rendering engines. It seems that the question isn’t if a big company should control the way the web works. It is more a question of which one is currently dominating.

Inside The Heathkit Factory

If you are a certain age, you doubtlessly remember Heathkit. They produced a wide array of electronic kits that were models of completeness and clear instructions. They started with surplus war parts in 1947 and wound up a major player in ham radio and early personal computers. But they made so many other things like TVs, radio control planes, and test equipment. All of it was made for you to build yourself. [Unseen History] released a video with the story of Heathkit from the start to the finish.

The company started out building kit airplanes, but after the war, they built a kit for an oscilloscope using military surplus. The less than $40 scope was still pricey in 1947 when a pound of bacon sold for 64 cents. But a “real” oscilloscope at the time would cost at least $400. The rest is history.

Continue reading “Inside The Heathkit Factory”

Hacking Hard Drive Firmware

You probably flash new firmware on a variety of devices regularly, even though that’s rare for non-technical types. But what about your hard drive firmware? Most of us don’t want to touch our operating drives, so unless you are dealing with surplus drives or have a special project in mind, you may not think much about the firmware running your spinning rust storage. [I Code 4 Coffee] uses hard drives in an unusual way to exploit Xbox 360s, and wound up reverse engineering some drive firmware with an eye to making changes.

The analysis started with three hard drives and an SSD. Looking for people who’ve done similar work wasn’t as productive as you might think. There isn’t much call for modifying hard drive firmware, and what data there is can be outdated.

One thing that was available was firmware dumps taken with a PC-3000 data recovery tool. What follows is a deep dive down the hard drive rabbit hole. There are backdoor vendor commands and connections to the diagnostic RS-232 port on some drives. You can find the technical artifacts on GitHub.

We learned a few things, and we bet you will too. Another way to get into the hard drive’s firmware is via JTAG.

Ask Hackaday: Do We Need A 21st Century Calculator?

The HP-41C analog on my phone gives the right answer.

Three resistors in parallel: 4.7 k,Ω 22 kΩ, and 3.3 kΩ. Quick! What’s the equivalent value? You can estimate it, of course, but if you want the actual 1.8 kΩ (approximately) answer, you probably reached for some kind of calculating aid. I have two slide rules on my desk, and plenty more a few steps away, but I don’t use them much, honestly. I have a very old HP-41C — arguably the best calculator ever made — but I am usually afraid to use it as it is almost 50 years old and difficult to repair. I also have an HP-28S on my desk, a replica HP-41C, and a few others in desk drawers. There are also dozens of calculators on my desktop computer, my phone –including the official HP Prime app — and the web browser.

I often see newer calculators from HP, like the Prime G2, or “new” HP-like calculators like the ones from SwissMicros, and think I should pick one up. Well, technically, HP licensed their calculators to Moravia, so even a “real” HP calculator isn’t from HP anymore. But, in the end, I always realize that my need for a physical calculator is so diminished that I can’t justify buying anything new, and I can barely even spring for a $10 one at the thrift store unless it is a real collectible.

Mind you, I’m not talking about RPN versus algebraic. I could say the same thing for TI, Casio, or Sharp calculators. I just don’t know why I need one anymore, even though I still, for some strange reason, want them.

The Prime seems impressive, if I could ever find time to finish reading the manual.

For the record, I did use an HP-41C to check the resistor math, but it was in the form of an app on my phone, not a real calculator. On the same computer I’m writing this on, I have HP-41C emulators, the Prime emulator, and a bunch of other calculators. Yet I still pick up my phone and use the familiar key layout of the HP-41C. I don’t know why. The replica 41C, unfortunately, has a landscape-oriented keyboard, so while I like it, it doesn’t satisfy my finger’s muscle memory.

Which leads to this Ask Hackaday. Do you use a calculator? Why? If you don’t, do you use a fake calculator on your phone or computer? Or do you just send your math to Google or Wolfram? I suspect some of the answer will be generational. I was in high school before calculators started showing up in schools, but they took over quickly.

There is something satisfying about having a purpose-built device to do your math. No long boot sequence. No switching apps. No messages coming in while you are typing in numbers. For the ultimate convenience, you could wear it on your wrist. The Apollo mission that docked with a Russian spacecraft carried an HP-65, and nine early Space Shuttle missions used an HP-41C. But even astronauts now don’t have a standard-issue calculator. Pilots sometimes use electronic E6Bs, but many still use the mechanical version.

Of course, I do collect slide rules, so maybe I just need to accept that calculators are yet another tech relic to collect. But someone is still buying them. I’d like to be one of them.

Continue reading “Ask Hackaday: Do We Need A 21st Century Calculator?”

LiDAR Matrix Sensor Sees In 3D

[Mellow_Labs] picked up a few LiDAR matrix sensors and found them very exciting. While a normal time-of-flight sensor can accurately determine a range,  the matrix sensor is like an array of 64 sensors that can build a 2D map of distances from 2 cm to 3.5 m. [Mellow] wanted to add the sensor to his robot to help it see what was in front of it. You can see how it worked out in the video below.

The robot in question is Zippy, a 3D printed tank-like robot with an ESP32. By default, the robot requires control inputs, but using the sensor will enable autonomous operation. For good or ill, the sensor mounted to Zippy was seeing the floor with about half of the rows. That means about 50% of the data went to waste. However, we think having a robot be able to see the floor in front of it might be a good thing.

[Mellow] used an LLM to write most of the code, so there were a number of iterations required to get things working. This required decimating even more of the data from the sensor. Still, pretty impressive.

Want to learn more about ToF sensors? Or if you want to focus on the practical, there’s code you can borrow.

Continue reading “LiDAR Matrix Sensor Sees In 3D”

How Did Apollo Separate?

If you’ve watched a Saturn V launch, you’ve probably seen how a large rocket will often jettison a stage on the way up. There are several reasons for this — there is no reason to haul an empty fuel container, for example. However, you can probably imagine how the separation works. You release something — probably explosive bolts — and gravity pulls the old stage away from you as you climb on the next stage’s engines. But what about on the way back? The command module drops the service module before reentry. [Apollo11Space] has a video explaining just how complicated that was to pull off. You can watch it below.

The main problem? The service module has almost everything you need: oxygen, a big engine, fuel, and electrical generation capability. If you’ve ever seen a real command module, they are tiny. Somehow, you need to get the command module prepared to be on its own for the amount of time it takes to land, and get the service module safely away.

Continue reading “How Did Apollo Separate?”