HNHacker News
TopNewBestAskShowJobs

wpears

57 karma · joined August 9, 2013

submissionscomments
wpears··on Arctic Summer Melt Shows Ice Is Disappearing Faster Than Normal
I took the parent comment to be making the assumption that politically attractive options for responding to emissions and climate change tend to be "market-based" solutions or activities that are picking winners between industries (say solar manufacturers and installers vs. coal plant workers). If there is a choice where there is a "winner" with money on the line there will also be lobbying money put toward that effort and so consensus building is easier.

There isn't necessarily anything nefarious about this, just that it may be incapable of dealing with the enormity of climate climate and also, as OP intimates, there may be a class of solutions that are better/cheaper/more efficient from a policy perspective, but that don't have anyone positioned to gain financially from them and so are harder to garner support for.

wpears··on The People’s Code
Link to PDF of policy[1]

[1] http://www.whitehouse.gov/sites/default/files/omb/memoranda/...

wpears··on Stack Overflow Outage Postmortem
Where x can be any combination of letters of any length?
wpears··on Wild flower blooms again after 30,000 years on ice (2012)
If the DNA in a seed is still in good enough shape to support blooming after being frozen 30,000 years, perhaps a seed frozen in a meteorite [1] could also survive long enough to be spread between solar systems.

[1] maybe after glancing off a planet or created by the collision of two large objects

wpears··on New debugging method found undetected security flaws in popular web apps
Ruby. Rails is the web framework, Ruby is the language and thus the thing that is interpreted.
wpears··on An interesting data structure with search time O(sqrt n)
BST is O(n) in the worst case (when a tree is completely unbalanced and is essentially a linked list)
wpears··on Out of the Darkness: How two psychologists and CIA devised torture program
Mirror via the wayback machine: https://web.archive.org/web/20150409042753/http://www.intell...
wpears··on 18F launches cloud.gov
The video at the "byzantine regulatory framework" link[1] is worth a watch (at least the first 10 minutes to get a taste). One of the most valuable offerings of cloud.gov is (hopefully) the ease with which it can go through the ATO and FISMA processes because it was designed with them in mind.

[1]https://www.youtube.com/watch?v=T1S52B1-NT4

wpears··on Go in Go
Nice explanation at http://grammarist.com/usage/all-but/
wpears··on Real-World JavaScript Anti-Patterns
His second bind example is incorrect.

  function handleClick(i) {  
    this.innerHTML = i;
  }

  for (i = 0; i < elems.length; i++) {  
    elems[i].addEventListener("click", handleClick.bind(this, i));
  }
In the for loop, the this value refers to the global object. To get the desired effect, it should be changed to elems[i] (this piece of code is trying to bind a handler to an element).
wpears··on V8 Optimization Killers
Not the friendliest program but http://mrale.ph/irhydra/1/ can display all sorts of intermediate representations spit out by v8
wpears··on How to: code JavaScript using Twitter bootstrap best practices
You mixed up your definitions of function declaration and function expression. In this case, if the '!' weren't there, it would indeed be a function declaration, but with improper syntax (removing the '!' would result in a syntax error).

What makes a function either an expression or declaration is simply whether the parser expects an expression or declaration in the given context. The grouping operator '()' and the NOT operator '!' both are parameterized by expressions, and so the Javascript parser treats functions passed to them as expressions. Unless located where an expression is expected, functions will default to declarations.

wpears··on Gravity waves from Big Bang detected
r is a model parameter that affects the strength of gravity waves. r=0.2 was much higher than expected. See http://www.reddit.com/r/science/comments/20mrz4/cosmic_infla...
wpears··on Squirt.io – Readability Meets Spritz Speed Reading
You're quite correct that cadence is diminished, though that can be mitigated by adding a delay to each word based on its length.
wpears··on Squirt.io – Readability Meets Spritz Speed Reading
That's what I did with Spree [1] (also posted below). Just a simple word.length*8 seemed to have quite a nice effect on readability.

1. https://chrome.google.com/webstore/detail/spree/aehoaolhojlm...

wpears··on Squirt.io – Readability Meets Spritz Speed Reading
Similar to what I did with the chrome extension Spree [1]. Though I find your pauses on periods to be a bit much. Code for Spree available on github [2]. The IIFE in spree.js can also function as a bookmarklet.

Also, Spree doesn't walk to an element's parent, which usually keeps it from getting into JS and ads, while still reading all of, say, a news article.

On another tack, quite a lovely site.

1. https://chrome.google.com/webstore/detail/spree/aehoaolhojlm...

2. https://github.com/wpears/spree

wpears··on Turn any application that uses stdin/stdout into a WebSocket server
If the socket is terminated mid-command (thus emitting 'close'), one would want the process to be killed. Also, the socket doesn't know that no more transmission is required just because one particular stream is over. That is why close is called manually on the socket after the stream emits a 'close'.

This all provided you use a streaming web socket module like https://github.com/maxogden/websocket-stream

wpears··on A spreadsheet in fewer than 30 lines of JavaScript, no library used
The getter is wrapped in a try/catch, so the circular reference hits the max call stack size and errors out silently.