3461 stories
·
56 followers

Cheap Flamethrower Is Predictably Worrying

1 Comment

We’d never criticize somebody for coming up with a creative way to save a few bucks. In truth, pickings would be pretty slim around here if we deleted every project or hack where cost savings was a prime motivator. That being said, there’s still some things you should probably spend a few extra dollars on. You know, the essential things in life that you need to know will be safe and reliable, like your car and…your flamethrower.

While we don’t have any information about what kind of car [Steve Hernandez] is driving, but over on Hackaday.io, he’s posted some info about his 3D printed wrist-mounted flamethrower. The final result does look pretty impressive, but given the subject matter and the lack of any safety gear, we would firmly plant it in the “Don’t try this at home” category.

At the heart of this flamethrower is a solenoid valve recovered from a Glade air freshener. Rather than spraying out the smell of lilacs, this valve has found a new purpose in life by squirting out butane from a pressurized can. The butane is then ignited by a spark gap made up two nails connected to a 300 kV boost coil.

[Steve] designed the frame of this creation in OpenSCAD, and printed it out in a single piece. It holds the butane can and solenoid in position, as well as keeping the nails in the proper orientation for the spark gap to function. Admittedly the head of his printed flamethrower does look very cool, but if there was ever a situation where you should be suspect of the heat tolerance of 3D printed plastic, a flamethrower is probably it.

What’s noticeably lacking of course is any method to keep the flame from potentially traveling back up through the valve and into the butane can. The high-speed flow coming out of the nozzle is probably enough to keep that from happening, but we still wouldn’t feel comfortable strapping his device to our wrist as-is.

You may be surprised to find that wrist-mounted flamethrowers are a relatively popular project here at Hackaday. We’ve covered quite a few over the years, but still aren’t convinced this is something we personally need to add to our collection of gear.


Filed under: hardware, wearable hacks





Read the whole story
jepler
18 hours ago
reply
a 3D printed flamethrower? nothing could possibly go wrong here.
Earth, Sol system, Western spiral arm
Share this story
Delete

Fast exact integer divisions using floating-point operations

1 Comment

On current processors, integer division is slow. If you need to compute many quotients or remainders, you can be in trouble. You potentially need divisions when programming a circular buffer, a hash table, generating random numbers, shuffling data randomly, sampling from a set, and so forth.

There are many tricks to avoid performance penalties:

  • You can avoid dividing by an arbitrary integer and, instead, divide by a known power of two.
  • You can use a divisor that is known to your compiler at compile-time. In these cases, most optimizing compilers will “optimize away” the division using magical algorithms that precompute a fast division routine.
  • If you have a divisor that is not known at a compile time, but that you reuse often, you can make use of a library like liddivide to precompute a fast division routine.
  • You can reengineer your code to avoid needing a division in the first place, see my post A fast alternative to the modulo reduction.

But sometimes, you are really stuck and need those divisions. The divisor is not frequently reused, and you have lots of divisions to do.

If you have 64-bit integers, and you need those 64 bits, then you might be in a bit of trouble. Those long 64-bit integers have a terribly slow division on most processors, and there may not be a trivial way to avoid the price.

However, if you have a 32-bit integers, you might have a way out. Modern 64-bit processors have 64-bit floating-pointer numbers using IEEE standards. These 64-bit floating-point numbers can be used to represent exactly all integers in the interval [0,253). That means that you can safely cast your 32-bit unsigned integers as 64-bit floating-point numbers.

Furthermore, common x64 processors have fast floating-point divisions. And the division operation over floating-point numbers is certain to result in the closest number that the standard can represent. The division of an integer in [0,232) by an integer in [1,232) is sure to be in [0,232). This means that you can almost replace the 32-bit integer division by a 64-bit floating point division:

uint32_t divide(uint32_t a, uint32_t b) {
  double da = (double) a;
  double db = (double) b;
  double q = da/db;
  return (uint32_t) q;
}

Sadly, if you try to divide by zero, you will not get a runtime error, but rather some nonsensical result. Still, if you can be trusted to not divide by zero, this provides a fast and exact integer division routine.

How much faster is it? I wrote a small program to measure the throughput:

64-bit integer division 25 cycles
32-bit integer division (compile-time constant) 2+ cycles
32-bit integer division 8 cycles
32-bit integer division via 64-bit float 4 cycles

These numbers are rough, but we can estimate that we double the throughput.

I am not entirely sure why compilers fail to exploit this trick. Of course, they would need to handle the division by zero, but that does not seem like a significant barrier. There is also another downside to the floating-point approach: it generates many more instructions.

Regarding signed integers, they work much the same, but you need extra care. For example, most processors rely on two’s complement notation which implies that you have one negative number that cannot be represented as a positive number. Thus implementing “x / (-1)” can cause some headaches. You probably do not want to divide signed integers anyhow.

I plan to come back to the scenario where you have lots of 64-bit integer divisions with a dynamic divisor.

Read the whole story
jepler
1 day ago
reply
this result is surprising to me. if you look at a block diagram of skylake https://en.wikichip.org/wiki/intel/microarchitectures/skylake_(client)#Individual_Core you'll see that FP DIV and INT DIV are both issued through port 0 to the same execution unit. This being the case, it's weird that the throughput of the 32-bit division is lower than the throughput of the 53-bit division!

Besides that, the test harness is an 'array / scalar' operation if I read the source right (and all the array elements are 0, but varying that didn't seem to vary the throughput). The reason that matters is that you can ignore the throughput and latency of the to- and from- FP conversions, while you can't if you wanted to code 'x = a + b/c' instead.

That said, Daniel usually knows his stuff and he has this benchmark on his side, so.
Earth, Sol system, Western spiral arm
Share this story
Delete

I set up, designed, and maintained a vanity blog for a bored, wealthy middle-aged woman.  After a...

1 Comment and 2 Shares

I set up, designed, and maintained a vanity blog for a bored, wealthy middle-aged woman.  After a few months she wanted analytics installed.

Client: You installed my analytics wrong.

Me: I’m sorry. Is it not tracking anything?

Client: It’s only tracking a couple of people.

I sign in and look to see everything working fine.

Me: I’m showing four page loads this week.  It seems to be tracking just fine.

Client:  Well it’s not. My husband says he reads it every day, and all of his employees do too. So do my friends and neighbors. And the other day, I went to Florida, and everyone there said they were reading it too! 

Knowing there is no way out of this conversation…

Me: I’ll take a look at it.

There’s no easy way to say “all your loved ones are lying to you.”

Read the whole story
jepler
1 day ago
reply
I guess you'll just have to generate some fake traffic...
Earth, Sol system, Western spiral arm
Share this story
Delete

Effective Altruist Consumer Reports: Apple’s 27-inch iMac Pro vs. Ten Years of Education for Two Underprivileged Nepalese Girls

1 Comment and 4 Shares

Where price is concerned, the 27-inch iMac Pro and twenty collective years of education for the underprivileged Nepalese girls will cost you the same amount of money (about 2,000 USD). So to decide on the right option, we need to turn to features.

The new iMac boasts a stunning display with over a billion colors and a 1200:1 contrast ratio. This puts Apple on the cutting edge of lifelike graphic technology. At the same time, being placed in a school will keep these two Nepalese girls safe from sex trafficking, which affects over 20,000 Nepalese girls from poor communities every year. While the new iMac has four USB 3 ports and a powerful 4.2GHz quad-core Intel Core i7 processor, the Nepalese girls, given the opportunity of education with an only 3% dropout rate, can become safe, empowered, and valued in their communities after graduation.

The education for the girls seems to be winning except for the fact that it’s you yourself (or a close family member) who will enjoy the iMac. This has been boasted by Apple as a clear advantage to the iMac. After all, the education and safety for two underprivileged Nepalese girls will be enjoyed by the two Nepalese girls, not by yourself.

Upon closer examination, however, the fact that it is you yourself who will enjoy the iMac actually doesn’t provide a rational basis for buying it, unless your happiness at having the computer were more important than the vast and sustained improvement in the quality of life for these girls.

To objectively pick the best product, the educations or the iMac, one must ask oneself what one would prefer in this situation from the perspectives of all parties involved and also determine whose preference is stronger. You know that you want the iMac. And you know that if you were one of the girls, you would prefer that the money be spent on the education. This means, as the philosopher Richard Hare notes, that you yourself have a current preference that the education would be bought if you were one of the girls. Since this preference probably outweighs, in strength, your other current preference for the iMac, we can rationally conclude that this is where you should put your money.

(We might also add in the preferences of the exploited factory workers who have tried to kill themselves only to be thwarted by the anti-suicide nets set up in Apple’s Foxcon factory. We can presume that they have a strong preference that you boycott Apple until conditions for workers improve).

So while the iMac’s Bluetooth 4.2 wireless technology is exciting, the improvement in the quality of life for two Nepalese girls wins out in the long run. Plus, you can get a tax credit if you get the education for the girls and buy the iMac anyway, if you want to have and eat your cake. Alternatively, there’s always the $100 Lenovo Thinkpad, which only costs one year of education for a Nepalese girl.

The iMac is available here.

And the education for the girls is available here.

Read the whole story
jepler
1 day ago
reply
Earth, Sol system, Western spiral arm
diannemharris
1 day ago
reply
Share this story
Delete
1 public comment
hannahdraper
1 day ago
reply
Jesus.
Washington, DC

Amazon will run a multi-season Lord of the Rings prequel TV series

1 Comment and 2 Shares

Enlarge / These two wander around for a long time. (credit: New Line Cinema)

Amazon has acquired the global television rights to The Lord of the Rings, and the Internet giant has already committed to a multi-season TV series rooted in author J.R.R. Tolkien's Middle-earth setting.

Both Amazon's own press release title ("Amazon to Adapt J.R.R. Tolkien's Globally Renowned Fantasy Novels... ") and earlier rumors suggested that the series would be a direct adaptation of the books, but that is now confirmed not to be the case. Rather, the series will introduce new stories that are set before The Fellowship of the Ring, the first book in the trilogy.

Tolkien estate and HarperCollins representative Matt Galsor said the series will "bring to the screen previously unexplored stories based on J.R.R. Tolkien's original writings." To Tolkien fans, it's unclear what that means exactly. Will characters and situations be based on unpublished Tolkien works? Many of those exist, but the author's son Christopher Tolkien has been editing and completing key works in those categories as published books for several years now. It's unclear what remains.

Read 5 remaining paragraphs | Comments

Read the whole story
jepler
4 days ago
reply
The best that can happen? I suppose a drama set during the stewardship era of Gondor could be greeted as though it were a weak sauce ripoff of that other fantasy TV show.
Earth, Sol system, Western spiral arm
Share this story
Delete

Gravitrack marble machines by Solarbotics

2 Comments

GraviTrack

Gravitrack is a fantastic new build-it-yourself desktop-scale marble machine kit from our friends at SolarBotics, and available now at our store.

Gravitrack is available in two versions: A no-soldering battery-powered version (shown above), or a soldering-required solar version. We also still carry the original SolarBotics Marble Machines, in battery and solar flavors.

Read the whole story
jepler
4 days ago
reply
kinda want
Earth, Sol system, Western spiral arm
Share this story
Delete
1 public comment
jprodgers
3 days ago
reply
Dat cam linkage. What a lovely movement.
Somerville, MA
Next Page of Stories