Tuesday, May 27, 2014

Desaturation bookmarklet

I recently needed to protect my eyes from a web site whose editors just love saturation. I figured there should be an easy fix for that, so I quickly found the Desaturate extension for Chrome. Nevertheless, nowadays I prefer to install as few extensions as possible since malicious parties figured out how to exploit Chrome extensions for profit. Luckily, many extensions are simple Javascripts that can be replaced by a bookmarklet. So here it goes, a bookmarklet to desaturate a page:


Just drag it to your bookmarks bar and you're done.

Update: clicking the button a second time now returns the page to full color.

Wednesday, March 19, 2014

Machine learning and cryptocurrencies

Here's a thought on cryptocurrencies. It's fairly well known that the proof-of-work required to discover new blocks is actually just a bunch of calculations that typically don't serve any other purpose than producing a hash. And it is a lot of computation power, check for yourself. Some cryptocurrencies like Riecoin try to make block discovery useful outside of the cryptocurrency world as well by making it solve an additional purpose, like finding prime numbers.

Discovering a block is basically done by solving a problem that is hard to solve, but easy to check (think a really hard sudoku). There are still a myriad of problems that fit this description but that are not used in cryptocurrency hashing.

So here's the thought. Why not use the proof-of-work calculations to solve a problem in machine learning? Many problems in machine learning are hard to solve but easy to check. One such problem is training a machine, e.g. a big neural network. Discovering a block would be mean producing a set of weights that allow the network to validate a test data set correctly. (I'm leaving out many practical details here, such as how to treat hashes.)

Another approach may be to treat the entire network of crypto miners as the machine itself, and use it e.g. to detect interesting instances, such as in SETI, though that example may be too esoteric.


[Update 2014/07/29: I'll be pasting some remarks here that have appeared on other social networks in an effort to centralize ideas.]

Specific properties of the computations in typical proof-of-work:

  • Solution is hard to obtain but easy to verify;
  • Input data for the computation depends on the block / transaction data;
  • A small change in the input data triggers a big change in the solution.
A meta-remark by Kevin Peno:
"Block-finding is like winning the lottery and mining throughput is proportional to the number of tickets bought."
So how about formulating a problem that rewards intelligence instead of computational power, possibly maintaining some of the properties listed above?

Tuesday, February 25, 2014

New Chrome extension: 'Nuff Tabs

I wrote a Chrome extension to limit the amount of tabs in Google Chrome. It's called 'Nuff tabs. There were already some extensions in the wild that do something similar, but none with the properties I was looking for (lightweight, specific options, etc.).

It works as follows. In the options you can specify the maximum number of open tabs. When you open one more tab, the extension will automatically close a previous tab. In the options you can also specify which rule it must follow to determine which tab to close: either close the oldest tab, the least recently used tab, the least frequently used tab, or a random tab. My current favorite setting is the "least recently used" tab, as this way I don't have to worry about losing older tabs that are still relevant.

You can also choose to display the number of open tabs in the extension icon.

Install it and let me know what you think.

Chrome store link: https://chrome.google.com/webstore/detail/nuff-tabs/kemeihccgedidlokcbfhdekcfojpjjmp

Source code: https://github.com/steven2358/NuffTabs