Learn To Loop The Python Way: Iterators And Generators Explained

If you’ve ever written any Python at all, the chances are you’ve used iterators without even realising it. Writing your own and using them in your programs can provide significant performance improvements, particularly when handling large datasets or running in an environment with limited resources. They can also make your code more elegant and give you “Pythonic” bragging rights.

Here we’ll walk through the details and show you how to roll your own, illustrating along the way just why they’re useful.

Continue reading “Learn To Loop The Python Way: Iterators And Generators Explained”

Inductive Loop Vehicle Detector Gets Modernized

Much like George Lucas and the original Star Wars films, many of us may find that our passion projects are never quite finished, especially when new technology comes around or we just want to make some improvements for their own sake. [Muris] was featured a while back for a vehicle detecting circuit, but is back with some important upgrades to his project. (Which, luckily, do not include any horrible CGI aliens.)

For starters, the entire project has been reworked from the ground up. For anyone unfamiliar with the original project, the circuit detected a vehicle via an inductive loop and was able to perform a task like opening a gate. It now has two independent channels which are polled separately, yet has a reduced parts count which should make construction simpler. The firmware has also been reprogrammed, and in addition to sensing a vehicle’s presence can now also measure the speed of any vehicles passing by.

The complete list of improvements can be found on the project page, and an extensive amount of documentation is available on this if you want to try to roll out your own inductive loop vehicle detector. Of course, this isn’t the only way to detect a vehicle’s presence if inductive loops aren’t really your style.

Continue reading “Inductive Loop Vehicle Detector Gets Modernized”

Megabots, Colliders, Rockets, Tunnels Underground, And Other Big Dumb Ideas Will Save Us

Humanity is a planetwide force. We have the power to change our weather. We have the power to change the shape of the land. We have the power to selectively wipe a species from this earth if we choose.  We’ve had this power for a while and we’re still coming to terms with it. Many of us even deny it.

With such power, what do we do? We have very few projects which are in line with our ability. Somewhere in the past few years, I feel like most of us have lost our audacity. We’ve culturally come to appreciate the safe bet too much. We pull the dreamers and doers down. We want to solve the small problems first, and see if we have time for the big problems later. We don’t dream big enough, and there is zero reason for this hesitation. We could leverage our planetwide power for planetwide improvements. Nothing is truly stopping us. No law, no government, nothing.

To put it simply, as far as technology goes, everything is still low-hanging fruit. We’ve barely done anything. Even some of our greatest accomplishments can happen randomly in nature. We’ve not left our planet in any numbers or for any length of time. Our cities are disorganized messes. In every single field today, the unexplored territory is orders larger than the explored. Yet despite this vast territory, there are very few explorers. People want to optimize the minutia of life. A slightly faster processor for a slightly smaller phone. It’s okay.

Yet that same small optimization applied to a larger effort could have vast positive impact. Those same microprocessors could catalog our planet or drive probes into space. The very same efforts we spend on micro upgrades could be leveraged if we just look at the bigger picture then get out of our own way. All that is lacking is ambition. Money, time, skill, industry, and people are all there, waiting. We have the need for and have the resources to support ten thousand Elon Musks, not just the one.

Big projects make us bigger than our cellphones and Facebook. When you see a rocket launch into the sky, suddenly, “the world” becomes, simply, “a world.” Order of magnitude improvements reduce the order of our perception of previously complex problems. They should be our highest goal. Whatever field you’re in, you should be trying to be ten times better than the top competitor.

However, there are some societal changes that have to occur before we can.

Continue reading “Megabots, Colliders, Rockets, Tunnels Underground, And Other Big Dumb Ideas Will Save Us”

Loop Antenna Is Portable

We don’t know if [OH8STN] has a military background, but we suspect he might since his recent post is about a “DIY Man Portable Magnetic Loop Antenna.” “Man-portable” is usually a military designation, and — we presume — he wouldn’t object to a woman transporting it either.

[OH8STN] started with a Chameleon antenna starter kit. This costs about $100 and is primarily a suitable variable capacitor with a 6:1 reduction drive premounted and soldered. Of course, you could source your own, but finding variable capacitors that can handle transmit duty (admittedly, these can apparently handle about 10 W continuous or 25 W on single sideband) can be tricky, especially these days. Although he started with a kit, he did modify the antenna to switch between two different sets of ham radio bands. You can see the antenna in the video below.

Loop antennas aren’t ideal–but neither is any other small antenna. Because the loop is tightly tuned to a particular frequency, it requires retuning for even relatively small frequency changes, even though it can operate on many different frequencies. If you want more technical details, you might enjoy this recent presentation from [W4RAX]. The links at the end are worth checking out, too.

Continue reading “Loop Antenna Is Portable”

Hyperloops And Robot Cars, A Glimpse Into The Future

His mobile blooped at him with one of those noises a company spent money to get. A timer started on the screen as he rushed to put his shoes on. He finished and pushed open his door, running down the stairs two to a bound. By the time he reached the bottom of the stairs he had his backpack slung over both shoulders, which he mentally cursed himself for since he’d just have to take the dang thing off again.

It was morning on January first, and he was due at his parent’s house for a new year’s dinner fifteen hundred miles away. He should have booked a plane weeks ago, but now the Loop was his only option. The Loop didn’t really have peak rates, and while the plane would be a little faster, more direct, and cheaper IF he had remembered to book it in time, the Loop would take him the same distance today. Plus, the seats were comfier. They reclined nicely, and he intended to nap on the way. Hopefully, by the time he got there, the bleariness from last night’s celebration would be undetectable by parental senses.

He locked the door to his apartment complex, a reassuringly square assembly from the seventies, and walked to the sidewalk where a friendly light blue car waited for him. When he got close, his mobile vibrated and made another distressingly cheery noise. The doors of the car swung open opposite of each other to expose the space inside. The car displayed two rows of inward facing bench seats, a panoramic row of windows around the entire perimeter of the vehicle, and… yes, his nose was telling him before his eyes fixed on it, a very unsettling amount of vomit in the center of the floor.

He turned around, a bit squeamish, and took out his mobile. He navigated through the controls. Where is the menu option? What year is it now? Why is this still hard? Three awkward menus deep and he finally found and selected the option to let the dispatch know the car had an issue which made it uninhabitable. The car immediately began to chirp warnings and the doors soon started to close. In a moment, a human somewhere in the city would be looking at a video of the inside of the car, determining him a liar or not. As expected, a few seconds later, the little car began to drive off. The lights on the rear of the car turned from bright red to the yellow amber of headlights as it decided its front would be its back. It drove off to the dispatch center for cleaning and repair. Someone would be eating a 100 dollar cleaning bill today. He didn’t feel sorry for them.

His phone began to vibrate. He picked it up to answer a call from a bored customer service representative who was trying hard to sound earnest. “Sorry for the trouble sir, the ride today will be free. We have another car on its way”

Continue reading “Hyperloops And Robot Cars, A Glimpse Into The Future”

Hyperloop Test Track To Be Built In California

Next year Hyperloop Transportation Technologies is planning on breaking ground on a five mile test track for the Hyperloop concept as originally proposed by [Elon Musk] back in 2013.

It’s being built around Quay Valley, which is a large real-estate development in California. In addition to serving as a test-bed for different pod designs and to further the technology as a whole, they’re planning on being able to transport passengers at mind-boggling speeds (how’s 760mph sound?) by as soon as 2018. While [Elon Musk] has no real involvement in the company, he is extremely supportive of the company and seeing his idea come to life — who wouldn’t? He once described the Hyperloop concept rather eloquently…

If the Concorde, a rail gun and an air-hockey table had a three-way, the Hyperloop would be the love child.

That’s certainly one love child we’d like to see. Oh and the cost? Apparently only $150 million. Seems about right.

[via Popular Science]

We Have A Problem: Shower Feedback Loop

Hackaday, we have a problem. Clean water is precious and we want to come up with some ideas to help conserve it. Today’s topic is water wasted while showering. Let’s kick around some ideas and prompt some new builds for The Hackaday Prize.

We’ve all done it; your mind wanders and before you know it you’ve been standing in the shower for far too long. How much water have you wasted? Who know’s, there’s no feedback loop in the shower. But we think adding a little bit of feedback is a fantastic avenue to help combat wasteful habits.

Color Changing Showerheads

shower-feedback-color-idea

What if the showerhead changed colors based on how much water had flowed through it? We’ve already seen consumer showerheads that have the LEDs inside of them, and flow meters are readily available. Start your shower off in the green, as you lather up the suds it moves through blue, purple, orange, red, and finally to flashing red. It doesn’t have to be annoying, but just enough to help quantify how much is pouring down the drain.

Shower Beats

We were big fans of the game SSX Tricky back in the day. The better you were at tricks, the better the music was. If you crashed hard, you’d be listening to nothing more than hi-hat and subdued bass. Apply this to shower time. What if that flow meter you installed on your shower head was connected to a shower radio? Start it off with the best music in the world and progress to the lamest as you run the reservoir dry (ymmv on these selections of course).

Now You Try

If you shave off 5 seconds from your shower it will have a tiny impact in your household. But imagine the aggregate of every household in the world doing so.

This is part of what the 2015 Hackaday Prize is all about. Get the idea machine rolling. Tell us your riff on the shower feedback loop in the comments below. Put up a new project on Hackaday.io, write down an idea, and tag it “2015HackadayPrize”. We’re on the lookout for the best seed ideas and will be giving away shirts and stickers to the ones that show real promise. We’ll be featuring some of these in future installments of “Hackaday, We Have Problem” and if we choose yours it’ll land you with some swag of your own.


The 2015 Hackaday Prize is sponsored by: