Secure Handlebars

Even JavaScript needs to deal with escaping content for the web. The hard, but ideal, approach is to automatically escape data with the proper context. With that in mind I started reading about Secure Handlebars from Yahoo, which claims:

Automatic Contextual XSS Escaping made robust, easy, and fast

They support automatic escaping for HTML, HTML comments, HTML attributes, URI ( in HTML Attribute ), and CSS ( in HTML Attributes ) contexts.

Net Cost of Bitcoin Mining

With some rough math Aaron Toponce comes up with an estimate for Bitcoin Mining Rate and Waste:

At $0.15 USD per kWh, that’s $609 spent on electricity per Bitcoin mined. Bitcoin is currently trading at $376/BTC.

Using the ~$600 cost in electricity for current mining rates, Bitcoin would need to go back to the highs of 2013 and 2014 to have a net positive value.

Aaron is very direct in his conclusion:

I would argue that Bitcoin is the worst idea to come out of Computer Science in the history of mankind.

If this depends on the price per Bitcoin, then this conclusion needs to have more flexibility. It may be that we are too early in the history of Bitcoin to write a conclusion.

In terms of overall issues with Bitcoin, I don’t think this one is big enough by itself to kill Bitcoin. Combined with other issues though, it may prove unsustainable over all.

Swoole

Swoole is another effort to bring event-driven async features to PHP:

Swoole is an event-driven, asynchronous & concurrent networking communication framework with higher performance written only in C for PHP.

While I’m not sure about using this as an application server for PHP ( I have mixed feelings about PHP app servers in general ), I do like their TCP server example:

$serv = new swoole_server("127.0.0.1", 9501);
$serv->set(array(
    'worker_num' => 8,
    'daemonize' => true,
));
$serv->on('connect', function ($serv, $fd){
    echo "Client:Connect.\n";
});
$serv->on('receive', function ($serv, $fd, $from_id, $data) {
    $serv->send($fd, 'Swoole: '.$data);
    $serv->close($fd);
});
$serv->on('close', function ($serv, $fd) {
    echo "Client: Close.\n";
});
$serv->start();

Longevity On The Web

Michael Arestad laments the temporary web:

Everything I create on the web feels temporary and fragile.

Once again, I ask, is there a place for permanency on the web?

The comparison to books comes up. I suspect printing multiple copies, that individually are easy to transport long distances, is what gives some books reasonable odds at being around for a long time. It isn’t easy to be sure that you’ve destroyed every single copy of a book.

On the web many sites are hosted on a single server ( or service ), making them relatively easy to wipe out with one shot.

Perhaps the closest thing we have on the Internet today to the mass copy and disperse approach is BitTorrent.

Utah vs. Vanderhall Motor Works

Last year I mentioned that Tesla can’t sell cars from their store in Utah. This year takes that story and turns it up a notch, enter Vanderhall Motor Works.

Vanderhall is a building a custom three-wheel motorcyle. But they aren’t allowed to sell directly in Utah, despite the company being in Provo, because of the same dealership laws that snagged Tesla. They warn visitors from Utah about this on their site:

vanderhall-utah

It says:

Utah Residents Notice:
Under Utah law, you are not allowed to view, visit or contact Vanderhall for sales information. Move to another state, then contact us.

And if you want to see how things can get even weirder, go read about how their exhibit at the Utah International Auto Expo got walled off.

While I don’t see myself ever buying one of these, I think it is past time that we allow manufactures who want to sell directly to consumers to do so.