Visualize Regular Expressions With Marbles

If you are one of those people who visualize things physically better than in the abstract, then Regex Marble Run by [bottomless] might be for you. You enter a test expression and a string, and the site generates a virtual marble machine that lets you see the regular expression pick apart the string in a physical way.

Click this link, and you’ll see the regular expression “^[hH]ack.[dD][^0-9]*$” which, if you aren’t a regular expression user, might seem a bit cryptic. However, it is fairly simple if you take it bit-by-bit.

The caret character tells it to match the start of the string. So “^dog” will match “dog” and “dog food” but won’t match “food for a dog.” The following bit “[hH]” will match either “h” or “H”. Then there is “ack” which is just what you think it is. So a string starting with “hack” or “Hack” might match (depending on the rest of the expression.

The period means match any single character. Then there’s another “[]” but this time with “dD” to match any kind of D. The next “[]” character class is a range from 0-9, but since there is a caret, the match is negated. So “[^0-9]” means match anything except a digit from 0 to 9. The “*” means we can have zero or more of these. So “HackxD” matches, but so does “HackxDXYZabc” for now. Trick question: Does “HackxDXYZabc123” match? So far, yes, but it only matches to the lowercase “c” character.

The final character, “$” means end of string. So now “HackxDXYZabc123” does not match because we are still in the middle of the string. However, “HackxDXYZabc” will match since the previous “*” “ate” the rest of the string.

Head spinning? The site will let you see each letter of a test string as a marble that falls through the different parts of the regular expression. Balls that pass wind up in the left-hand box, while failures are in the right-hand box. Will it help you? We don’t know, but it is fun to watch.

Want a refresher on regular expressions? Or perhaps you want some practice?

An Open Micro-Maniplulator Improved

If you need a micro-manipulator, you probably already have a good idea of what it does. For example, you might be moving a probe over an IC die or wafer. You might be looking at something through a microscope. The key is moving something in very small, precise increments along three axes. An open-source design for a micro-manipulator has seen significant improvements lately. You can see several videos about the device below.

The device uses stepper motors, parallel kinematics, and miniature ball joints to achieve precise motion. The recent version 4.0 update fixes a few problems. According to the GitHub page:

  • Self-collision during homing fixed.
  • Connection of the ball joint block with screws only was not well constrained and could be rotated a bit.
  • No reliable way to ensure consistent linkage rod length
  • Unnecessary ball joint friction
  • Accurate ball position heavily dependent on print quality and corner rounding
  • Rubber bands could not be changed or removed once glued in.

Continue reading “An Open Micro-Maniplulator Improved” →

An LCR Meter With Compromises

YouTube, like the Internet, has its plusses and minuses. On the plus side, you can find information on just about anything. On the minus side, you don’t always know if that information is of any value. On the plus side, you can connect to experts who have an uncanny knack for explaining things. On the negative side, you can find people who — let’s just say aren’t. Lucky for us, [Kerry Wong] is very knowledgeable about test instruments, so when we see a review from him, like the one for the ZOYI ZT-XC1 LCR meter and multimeter, we know we will get good information. Check out that review in the video below.

It used to be unusual to have an LCR meter that could measure inductance or capacitance in a home lab. But now it isn’t a big deal, and many multimeters and testers can at least attempt to read these quantities.

Continue reading “An LCR Meter With Compromises” →

A Plasma Donut

We know [The Action Lab] always has something hands-on. This time, the video shows a toroidal plasma demo and how it relates to nuclear fusion. Plasma has a high temperature, and if you use physical electrodes to excite the plasma, this high temperature tends to destroy the electrodes. But thanks to the relationship between electricity and magnetism, you can create plasma with an alternating magnetic field instead of physical electrodes.

The actual practical device is a 10 MHz source with a coil and a low-pressure globe full of xenon gas. It looks pretty cool. Of course, the little tabletop demo isn’t strong enough to drive a fusion reaction. But if you scale it up and make some modifications, including using hydrogen, you get a tokamak reactor.

Continue reading “A Plasma Donut” →

Simplifying Slide Rule Calculations With Trig

[Bob the Science Guy] remembers how to use a slide rule. Even after all these years, it is pretty easy to remember how to multiply and divide. If you can’t remember, you can usually work it out, as long as you understand how slide rules work. But what about sine, cosine, and quadratics? [Bob’s] been making videos about topics like this, and if you’ve wanted to put your slide rule collection to practical use, you’ll enjoy these videos. You can see one below.

The trick to the slide rule is that it is deceptively simple. You are in effect adding logarithms and then taking an antilog. The issue is that you still have to have some intuition about the scale of the answer since 2×3 works out the same as 2×3000 or 200×300.

Continue reading “Simplifying Slide Rule Calculations With Trig” →

The 10€ Gamepad

We aren’t sure what [Lazy_Duck] is doing with video games, but it must require a lot of controllers. Dismayed at the cost and complexity of commercial gamepads, they started soldering and 3D printing to get a cheaper basic controller.

The emphasis is on throwing things together, so there’s no dedicated PCB. Just a protoboard with an RP2040-Zero, a joystick, a few buttons, and a microswitch. A 3D-printed case rounds out the project.

Continue reading “The 10€ Gamepad” →

What’s A Nonius?

If you already know what a nonius is, you can probably skip this post. But, if like us, you would have to look it up, we’ll tell you what we found out. It turns out, a translation mistake taught us a new word and some history we weren’t aware of.

In the manual, this is captioned: Figure 4-7 Nonius Display (Standard Mode)

Have a look at the adjacent graphic from a waveform display. What would you call the vertical red lines at positions 139 and 200?

We’d probably call them markers. Or maybe cursors. The manual, however, calls each one a “nonius”. It refers to them that way multiple times.

Oddly, the manual also has sentences like “Select one nonius and right-click, and then select ‘Remove Marker’ in the next window to delete the nonius.”

So, clearly, a nonius is the vertical line marker or cursor. But that, of course, begs a question…

What is a Nonius?

“Nonio originale” by [Henrique Leitão]
Have you ever heard of the vernier scale? If you’ve done navigation, used a traditional caliper, or tuned an old shortwave receiver, you probably have. [Pierre Vernier] developed it in 1631 as a way to better interpolate values on a scale.

However, there was an earlier version used to improve measurements on astrolabes. A Portuguese navigator named [Pedro Nunes] created this type of astrolabe in 1542. The Latinized version of his name is [Petrus Nonius]. What are the odds of him inventing… oh wait, they named it after him. That does make more sense.

The nonius is a series of concentric circles traced on the instrument. Working towards the center, each circle has fewer divisions than the previous one. In fact, if the outer ring had 90 marks for 90 degrees, the next ring would have 89, and the following one would have 88.

Continue reading “What’s A Nonius?” →