Where The Work Is Really Done – Casual Profiling

Once a program has been debugged and works properly, it might be time to start optimizing it. A common way of doing this is a method called profiling – watching a program execute and counting the amount of computing time each step in the program takes. This is all well and good for most programs, but gets complicated when processes execute on more than one core. A profiler may count time spent waiting in a program for a process in another core to finish, giving meaningless results. To solve this problem, a method called casual profiling was developed.

In casual profiling, markers are placed in the code and the profiler can measure how fast the program gets to these markers. Since multiple cores are involved, and the profiler can’t speed up the rest of the program, it actually slows everything else down and measures the markers in order to simulate an increase in speed. [Daniel Morsig] took this idea and implemented it in Go, with an example used to demonstrate its effectiveness speeding up a single process by 95%, resulting in a 22% increase in the entire program. Using a regular profiler only counted a 3% increase, which was not as informative as the casual profiler’s 22% measurement.

We got this tip from [Greg Kennedy] who notes that he hasn’t seen much use of casual profiling outside of the academic world, but we agree that there is likely some usefulness to this method of keeping track of a multi-threaded program’s efficiency. If you know of any other ways of solving this problem, or have seen causal profiling in use in the wild, let us know in the comments below.

Header image: Alan Lorenzo [CC BY-SA 3.0].

Punch The World With A Raspberry Pi

Robots have certainly made the world a better place. Virtually everything from automobile assembly to food production uses a robot at some point in the process, not to mention those robots that can clean your house or make your morning coffee. But not every robot needs such a productive purpose. This one allows you to punch the world, which while not producing as much physical value as a welding robot in an assembly line might, certainly seems to have some therapeutic effects at least.

The IoT Planet Puncher comes to us from [8BitsAndAByte] who build lots of different things of equally dubious function. This one allows us to release our frustration on the world by punching it (or rather, a small model of it). A small painted sphere sits in front of a 3D-printed boxing glove mounted on a linear actuator. The linear actuator is driven by a Raspberry Pi. The Pi’s job doesn’t end there, though, as the project also uses a Pi camera to take video of the globe and serve it on a webpage through which anyone can control the punching glove.

While not immediately useful, we certainly had fun punching it a few times, and once a mysterious hand entered the shot to make adjustments to the system as well. Projects like this are good fun, and sometimes you just need to build something, even if it’s goofy, because the urge strikes you. Continue reading “Punch The World With A Raspberry Pi”

Russian EBike Goes Everywhere, Possibly Legal

Electric bikes may be taking the world by storm, but the world itself doesn’t have a single way of regulating ebikes’ use on public roads. Whether or not your ebike is legal to ride on the street or sidewalk where you live depends mostly on… where you live. If you’re lucky enough to live in a place where a bicycle is legally defined as having fewer than four wheels and capable of being powered by a human, though, this interesting bike from Russia might be the best homemade ebike we’ve ever seen. (Video embedded below the break.)

While some of the details of this build might be lost on those of us who do not know any Slavic languages, the video itself shows off the features of this electric vehicle build quite well. It has a custom built frame with two wheels up front, each with its own independent suspension, allowing it to traverse extremely rough terrain with ease even a mountain bike might not be able to achieve. It seems to be powered by a relatively simple rear hub in the single rear wheel, and can probably achieve speeds in the 20 km/h range while holding one passenger and possibly some cargo.

The impressive part of this build isn’t so much the electrification, but rather the suspension components. Anyone looking for an offroad vehicle may be able to take a bit of inspiration from this build. If you’re more interested in the drivetrain, there are plenty of other vehicles that use unique electric drivetrains to check out like this electric boat. And, if you happen to know Russian and see some other interesting details in this build that the native English speakers around here may have missed, leave them in the comments for us.

Continue reading “Russian EBike Goes Everywhere, Possibly Legal”

I Love The Smell Of ABS Plastic In The Morning

One lesson we can learn from the Vietnam War documentary Apocalypse Now is that only crazy people like terrible smells just for fun. Surely Lt. Col. Kilgore would appreciate the smell of 3D printers as well, but for those among us who are a little less insane, we might want a way to eliminate the weird (and not particularly healthy) smell of melting ABS plastic.

While a simple solution would be a large fume hood or a filter to prevent inhaling the fumes, there are more elegant solutions to this problem. [Mark]’s latest project uses an electrostatic precipitator (ESP) to remove the volatile plastic particles from the air. Essentially it is a wire with a strong voltage applied to it enclosed in a vessel of some sort. The voltage charges particles, which then travel to a collecting electrode. Commercial offerings also include an X-ray generator to help clean the air, but [Mark] found this to be prohibitively expensive.

The ESP is built into a small tube through with the air can flow, and the entire device itself is housed in the printing enclosure. The pictures show the corona discharge in the device, and [Mark] plans to test it over the next few months to determine its effectiveness. He does note, however, that the electrostatic discharge creates ozone, which has its own set of problems, so he recommends against building one on your own. Ozone at least still smells like victory.

The South American Power Outage That Plunged 48 Million Into Blackout

A massive power outage in South America last month left most of Argentina, Uruguay, and Paraguay in the dark and may also have impacted small portions of Chile and Brazil. It’s estimated that 48 million people were affected and as of this writing there has still been no official explanation of how a blackout of this magnitude occurred.

While blackouts of some form or another are virtually guaranteed on any power grid, whether it’s from weather events, accidental damage to power lines and equipment, lightning, or equipment malfunctioning, every grid will eventually see small outages from time to time. The scope of this one, however, was much larger than it should have been, but isn’t completely out of the realm of possibility for systems that are this complex.

Initial reports on June 17th cite vague, nondescript possible causes but seem to focus on transmission lines connecting population centers with the hydroelectric power plant at Yacyretá Dam on the border of Argentina and Paraguay, as well as some ongoing issues with the power grid itself. Problems with the transmission line system caused this power generation facility to become separated from the rest of the grid, which seems to have cascaded to a massive power failure. One positive note was that the power was restored in less than a day, suggesting at least that the cause of the blackout was not physical damage to the grid. (Presumably major physical damage would take longer to repair.) Officials also downplayed the possibility of cyber attack, which is in line with the short length of time that the blackout lasted as well, although not completely out of the realm of possibility.

This incident is exceptionally interesting from a technical point-of-view as well. Once we rule out physical damage and cyber attack, what remains is a complete failure of the grid’s largely automatic protective system. This automation can be a force for good, where grid outages can be restored quickly in most cases, but it can also be a weakness when the automation is poorly understood, implemented, or maintained. A closer look at some protective devices and strategies is warranted, and will give us greater insight into this problem and grid issues in general. Join me after the break for a look at some of the grid equipment that is involved in this system.

Continue reading “The South American Power Outage That Plunged 48 Million Into Blackout”

Use A Digital Key To Deter Lockpicking

Spending an hour or two around any consumer-level padlock or house deadbolt lock with a simple lockpicking kit will typically instill a good amount of panic and concern about security. While it’s true that any lock can be defeated, it’s almost comically easy to pick basic locks like this. So, if you’re looking for a level of security that can’t be defeated in two minutes with a tiny piece of metal, you might want to try something a little more advanced.

This project stemmed from an idea to use a YubiKey, a USB hardware token typically used for two-factor authentication, for physical locks instead. The prototype was built around an Arduino UNO, and all of the code and build instructions are available on the project’s site. The creator, [rprinz08], does not have one built inside of a secure enclosure so that would remain an exercise for the reader, but the proof-of-concept is interesting and certainly useful.

While digital keys like this can have their own set of problems (as all locks do), this would be a great solution for anyone needing to lock up anything where physical keys are a liability or a nuisance, where logging is important, or where many people need access to the same lock. The open source code and well-known platform make it easy for anyone to build, too.

Hardware Notifications For ISS Flybys

Since Sputnik launched in the 1950s, its been possible to look outside at night and spot artificial satellites orbiting with the naked eye. While Sputnik isn’t up there anymore, a larger, more modern satellite is readily located: the International Space Station. In fact, NASA has a program which will alert anyone who signs up when the ISS is about to fly overhead. A better alert, though, is this ISS notifier which is a dedicated piece of hardware that guarantees you won’t miss the next flyby.

This notifier is built around the Tokymaker, a platform aimed at making electronics projects almost painfully easy to learn. Connections to various modules can be made without soldering, and programming is done via a graphical interface reminiscent of Scratch. Using these tools, [jaime_lc98] designed a tool which flips up a tiny paper astronaut whenever the ISS is nearby. The software side takes advantage of IFTTT to easily and reliably control the servo on the Tokymaker.

The project pages goes into detail about how to set up IFTTT and also how to use the block-style language to program the Tokymaker. It’s pretty straightforward to get it up and running, relatively inexpensive, and looks like a great way to get the miniature hackers in your life excited about space. If they happen to learn a little something in the proces, well, we won’t tell them if you won’t. It might also be a good stepping stone on the way to other ISS-related hacks.