Stepping Up Your Python Printf Debugging Game

Debuggers come in all shapes and sizes, offering a variety of options to track down your software problems and inspecting internal states at any given time. Yet some developers have a hard time breaking the habit of simply adding print statements into their code instead, performing manual work their tools could do for them. We say, to each their own — the best tools won’t be of much help if they are out of your comfort zone or work against your natural flow. Sometimes, a retrospective analysis using your custom-tailored debug output is just what you need to tackle an issue.

If the last part sounds familiar and your language of choice happens to be Python, [Alex Hall] created the Bird’s Eye Python debugger that records every expression inside a function and displays them interactively in a web browser. Every result, both partial and completed, and every value can then be inspected at any point inside each individual function call, turning this debugger into an educational tool along the way.

With a little bit of tweaking, the web interface can be made remote accessible, and for example, analyze code running on a Raspberry Pi. However, taking it further and using Bird’s Eye with MicroPython or CircuitPython would require more than just a little bit of tweaking, assuming there will be enough memory for it. Although it wouldn’t be first time that someone got creative and ran Python on a memory limited microcontroller.

MIT Breaks Autonomous Drone Speed Limits By Not Sweating Obstacles

How does one go about programming a drone to fly itself through the real world to a location without crashing into something? This is a tough problem, made even tougher if you’re pushing speeds higher and high. But any article with “MIT” implies the problems being engineered are not trivial.

The folks over at MIT’s Computer Science and Artificial Intelligence Laboratory (CSAIL) have put their considerable skill set to work in tackling this problem. And what they’ve come up with is (not surprisingly) quite clever: they’re embracing uncertainty.

Why Is Autonomous Navigation So Hard?

Suppose we task ourselves with building a robot that can insert a key into the ignition switch of a motor vehicle and start the engine, and could do so in roughly the same time-frame that a human could do — let’s say 10 seconds. It may not be an easy robot to create, but we can all agree that it is very doable. With foreknowledge of the coordinate information of the vehicle’s ignition switch relative to our robotic arm, we can place the key in the switch with 100% accuracy. But what if we wanted our robot to succeed in any car with a standard ignition switch?

Now the location of the ignition switch will vary slightly (and not so slightly) for each model of car. That means we’re going to have to deal with this in real time and develop our coordinate system on the fly. This would not be too much of an issue if we could slow down a little. But keeping the process limited to 10 seconds is extremely difficult, perhaps impossible. At some point, the amount of environment information and computation becomes so large that the task becomes digitally unwieldy.

This problem is analogous to autonomous navigation. The environment is always changing, so we need sensors to constantly monitor the state of the drone and its immediate surroundings. If the obstacles become too great, it  creates another problem that lies in computational abilities… there is just too much information to process. The only solution is to slow the drone down. NanoMap is a new modeling method that breaks the artificial speed limit normally imposed with on-the-fly environment mapping.

Continue reading “MIT Breaks Autonomous Drone Speed Limits By Not Sweating Obstacles”

4-Stroke Clock Fires On All Cylinders

We love a good clock build around here, especially if it tells time in a unique way. This 4-stroke digital clock designed by [lagsilva] takes the checkered flag in that category. As it displays the time, it also demonstrates the operation of an internal combustion engine. The numbers take the form of pistons and dance an endless repetition of intake, compression, combustion, exhaust.

The clock’s digits are made from two LED matrices driven by an Arduino Uno and a couple of MAX7219 driver boards. The dots that form the digits move up and down the matrices in 1-3-4-2 firing order. As each piston-digit reaches top dead center, its number lights up. This makes it easy to see the firing order, even at higher RPM values.

Our favorite thing about this clock is the variable RPM setting. There’s a 10k pot around back that adjusts the speed of the pistons between 100 and 800 RPM, and it’s configured to accurately represent piston movement at each increment. Floor it past the break to watch the clock rev up and slow back down.

Although it’s difficult to read the time at 800 RPM, it’s awesome to see a real-time visualization of cylinder movement at the average idle speed of a passenger car. We think it might be neat to rev the engine another way, like with an arcade throttle lever or a foot pedal.

If you like the idea of a constantly-moving clock but prefer an analog readout, take a minute to look at this clock without a face.

Continue reading “4-Stroke Clock Fires On All Cylinders”

IBM 1401 Runs FORTRAN II Once More

The IBM 1401 is undeniably a classic computer. One of IBM’s most “affordable” mainframes, it ruled the small business computing world of the 1960’s. Unfortunately, computers aren’t often thought of as treasured heirlooms, only a handful of these machines survive today. The computer history museum has two machines. One from Germany, and the other recovered from a basement in Connecticut back in 2008. [CuriousMarc] and the rest of the team at the museum have been working diligently to restore the 1401, and they’ve hit quite a milestone — They can now compile and run FORTRAN II code.

Getting the 1401 to run FORTRAN II itself is quite an accomplishment. The hardest part was dealing with the 729 vacuum column tape drives. The team spent years building a hardware emulator which takes the place of the real drives. The emulator is driven by an old PC running windows. Tape images are stored as files, which can be loaded, rewound, and run just like a real 729.

Emulators are great, but [Mark] and his team wanted this to run on the real hardware. They first had to re-create a FORTRAN compiler tape. They ran a tape copier program on the 1401, then loaded an image of the compiler on their emulator. The computer dutifully copied the image to a real tape drive.

The team also needed a punched card deck of FORTRAN source code to compile and run. The first example in the FORTRAN manual is a Hilbert Matrix program. The team could have used a keypunch machine to punch the cards for the program, but that is a painstaking and error-prone process. One mistake, and they would have to re-punch an entire card — much like using an old typewriter with no White-Out or correction ribbon. Instead, they typed the source into a PC, then converted the file to a tape image. A small program instructed the 1401 to punch the source code out on cards for them.

At the moment of truth, shown first in the video, the 1401 reads FORTRAN II from tape, pulls in the source code from punched cards, compiles, runs, and then prints the result on its line printer. All the original hardware singing along just like it did in 1959.

If you haven’t been to the Computer History Museum yet, check it out! It’s also the site of Vintage Computing Festival West.

Continue reading “IBM 1401 Runs FORTRAN II Once More”

Hackaday Links Column Banner

Hackaday Links: February 11, 2018

Are you a student? Are you part of a hackerspace? We have a contest going on right now where you can win a fancy new Prusa i3 MK3. The Repairs You Can Print contest is a challenge to do something useful with that machine that spits out tugboats. We’re looking for functional repairs of items around your house, office, or garage. Did you repair something with a 3D printer? Then you too can get in on the action! Enter now! Check out the entries!

You may know Flite Test as the group who do everything surrounding remote control flight (mostly fixed wings, a nice counter to the quadification of the hobby over the last few years). Flite Test designs and sells airplanes made out of Dollar Tree foam board, they have yearly, bi-coastal meetups, and they’re all-around awesome dudes. Now, they want to build the Disneyland of RC flight. [Josh Bixler], the face of Flite Test and a guy who has a plane named after him, wants to buy a golf course and turn it into the world’s best RC flying park, with a ~2000 foot grass strip for general aviation. We’re looking at their crowdfunding campaign, and it looks promising it might be funded by the time this goes live.

A while ago, [Peter Jansen], the guy who built a tricorder and a laser-cut CT scanner, made a magnetic camera. This Hall Effect camera is a camera for magnetism instead of light. Now, this camera has been fully built and vastly improved. He’s capturing ‘frames’ of magnetism in a spinning fan at 2000 Hz (or FPS, terminology kind of breaks down here), and it’s beautiful.

Oh thank God we can finally buy GPUs again. Try buying them with Bitcoin.

In the last few years, CITES, the Convention on International Trade in Endangered Species of Wild Fauna and Flora, has expanded. Originally, this was one of the treaties that banned the import or export of rhino horn, but recently this expanded to the export of rosewood thanks to increased demand in China for rosewood furniture. The laws of unintended consequences kicked into effect, and importing anything made out of rosewood is now a mess of permits and inspections at the border, including musical instruments. Travelling orchestras, for example, are at risk of having their string section confiscated because of rosewood tuning pegs. Cooler minds may now be prevailing, and there’s some hope the regulations may be changed during the next meeting of the CITES convention next year.

As noted a few months ago, there was a possibility of Broadcom buying Qualcomm for one… hundred… Billion dollarsThis offer was rejected, with Qualcomm saying the offer wasn’t high enough. Broadcom fired back with an offer of $82 per share, or $121B. This offer was rejected this week.

Need some EMC testing? [Zach]’s got your back. He’s reserved some time in a 10m EMC chamber for testing NeuroBytes this week. If you have an Open Source project that needs a pre-test scan for unintentional radiator, you can get in on the action. This is just a pre-test, you’re not getting certification, and you’re not going to test anything with radios, and you need to ship [Zach] your stuff. But still, free test time. Woo.

Flood Damaged 386 Gets A Modern Rebuild

Until a flood claimed its life, the 386 tower [Tylinol] found on the side of the road served him well as a DOS gaming rig. In the aftermath of the flood, the machine was left with ruined internals and a rusted case; it ended up being tossed in storage where it was slowly rotting away. But a recent idea got him to drag this old dinosaur back out into the light of day and give it a new lease on life with some modern gear.

For our viewing pleasure [Tylinol] documented the restoration of the computer, dubbed SErEndIPITy, from start to finish. The rebuild starts with tearing the machine down to the steel frame and sanding all the rust off. Luckily it looks like no structural damage was done, and a coat of engine enamel got the frame looking more or less like new. The original motherboard mounting solution wouldn’t work for his modern board, so he ended up riveting a piece of sheet metal in and drilling new holes for standoffs to thread into.

A nice element of this rebuild is that [Tylinol] didn’t want to drastically change the outward appearance of the machine. The customary yellowed plastic was left alone, and wherever possible the original hardware was reused. Rather than blow a hole in the case, he took his Dremel to the decorative ribbed design of the front panel and turned it into a stock-looking vent.

The real star of this rebuild is the LED CPU “Speed” display on the front of the case. In its original form, this was a fake display that simply cycled through predefined digits when you pressed the “Turbo” button on the front panel. By grounding them one at a time, [Tylinol] figured out which lines on the PCB controlled each segment of the display and wired it up to a Teensy 3.5. He was then able to write a C# plugin for CoreTemp to display the temperature.

The rebuilt machine is packing an i5-6500 processor, GTX 970 video card, and 8 GB of DDR4 RAM. Not exactly a speed demon compared to some of the modern desktops out there, but it certainly beats the original hardware. Incidentally, so does the Teensy 3.5 controlling the front panel display. There’s a certain irony there…

Cramming modern hardware into the carcass of an outdated computer is nothing new, of course. But we especially like the builds that take the time to make it all look stock.

[via /r/DIY]

Will John Deere Finally Get Their DMCA Comeuppance?

When it comes to activism, there are many different grades of activist aside from the few who you may encounter quietly and effectively working for change in their field. There are the self-proclaimed activists who sit in their armchairs and froth online about whatever their Cause is, but ultimately aside from making a lot of noise are pretty ineffectual. Then there are the Rebels With A Cause, involved in every radical movement of the moment and always out on the streets about something or other, but often doing those causes more harm than good. Activists can be hard work, at times.

If you are within whatever Establishment that has aroused the collective ire it is not the screamers and banner-wavers that should worry you, instead it is the people who are normally quiet. When people who spend their lives getting things done rather than complaining turn round en masse and rebel, it’s time to sit up and take notice. If people like the farmers or the squaddies are on the streets, the probability of your ending up on the wrong side of history has just increased exponentially and maybe it’s time to have a little think about where you’re going with all this.

The video below the break follows a group of Nebraska farmers fighting for the right to maintain their farm machinery, in particular the products of John Deere. Since all functions of a modern Deere are tied into the machine’s software, the manufacturer has used the DMCA to lock all maintenance into their dealer network. As one farmer points out, to load his combine harvester on a truck and take it on a 100-mile round trip to the dealer costs him $1000 every time a minor fault appears, and he and other farmers simply can’t afford that kind of loss. We’re taken to the Nebraska State Legislature and shown the progress of a bill that will enshrine the right to repair in Nebraskan law, and along the way we see the attempts by lobbyists to derail it.

We normally write Hackaday stories in the third person, but it’s worth saying that this is being written from a small farming community in Southern England, and that there is a green and yellow tractor parked outside somewhere. Thus it’s from first-hand experience that you can be told that Deere is in danger of becoming a damaged brand among its staunchest supporters. They still make damn fine tractors, but who wants to be caught with brief weather window to get on the land, and a machine that’s bricked itself? It’s hardly as though Deere are the only manufacturer of agricultural machinery after all.

This video is quite important, because it is a step towards the wider story becoming more than just a concern to a few farmers, hardware hackers, and right-to-repair enthusiasts. The last word should go to one of the farmers featured, when he points out that all his older tractors are just as capable of going out and doing the same day’s work without the benefit of all the computerized technology on their modern siblings.

Continue reading “Will John Deere Finally Get Their DMCA Comeuppance?”