Better HN
topnewbestaskshowjobs
Log inSign up

substack

1,135 karma · joined Mar 22, 2009 (17y ago) · 212 submissions

Whatever.
Submissions

comment 15y ago · link · parent

There's also the pushd and popd commands which are part of bash already.

And there's a wikipedia entry for this even: http://en.wikipedia.org/wiki/Pushd_and_popd

comment 15y ago · link · parent

Referencing objects isn't a problem since dnode doesn't do replication, it just makes copies, but referencing functions when the client disconnects can occasionally be bothersome. You do get a hook when the client disconnects:

    conn.on('end', fn)
so that helps. At browserling.com all of our backend and frontend spanning lots of processes over several servers is tied together with dnode, and we haven't had any big problems tracking references that I can think of.

comment 15y ago · link · parent

You can pass functions around in your JSON.

comment 15y ago · link · parent

I can think of a few, but "linear/nonlinear" doesn't seem like the right way to look at it. From what I've read, productivity has more to do with statistical distributions: http://xw2k.nist.gov/dads/HTML/lotkaslaw.html

Very curiously, these distributions are self-similar in that even when you restrict the sample to top-tier academics for instance, they still hold.

comment 15y ago · link · parent

Also check out node-binary: https://github.com/substack/node-binary which has a similar interface but nicer internals and only needs to keep 2 buffers in memory at any given time instead of a linked list like bufferlist.

156.

Sesame - persistent http sessions using harmony proxies in node.js(substack.net ↗)

4 points · by substack · 15y ago · discuss

157.

Graph of node.js package dependencies(substack.net ↗)

4 points · by substack · 15y ago · discuss

comment 15y ago · link · parent

I wonder if the decrease in brain size is due in part to infant mortality and trauma in childbirth. Big brains don't exactly... fit as well coming out, although it's also not clear how much early brain size influences brain size later in life.

comment 15y ago · link · parent

For extra fun, type this in the address bar while on the github 404 page:

    javascript:var theta = 0; setInterval(function () { theta += 0.05; parallax({ pageX : (Math.sin(theta) + 1) * 1000, pageY : (Math.cos(theta) + 1) * 1000}) }, 50)

comment 15y ago · link · parent

If America is in a period of Byzantinian decline then how do the great tech-hub city-states like San Francisco and New York play into this narrative? This doesn't seem consistent.

comment 15y ago · link · parent

Frankly I've found python to be quite antagonistic to functional programming with very weak lambdas and poor building blocks for building interfaces in monadic pipeline style. I guess coming from java it would seem refreshing but coming back from haskell or even just javascript it feels like a straitjacket.

comment 15y ago · link · parent

At StackVM we use an IRC bot to tell us when the servers are down. In our case the bot is just a DNode service so all the backend needs to do is connect to the IRC service, post its message, and disconnect.

http://github.com/substack/rowbit

It's a pretty great fit since we already use IRC a ton to coordinate development so we see the notifications right away.

163.

Optimist: option parsing for node.js that gets out of your way(substack.net ↗)

2 points · by substack · 15y ago · discuss

comment 15y ago · link · parent

I like how there's a command line interface plus an application interface, so I can tie forever process management into my web interface and backend control interface. Right now the processes are just sitting in a `while true` bash loop.

165.

Seq: chainable asynchronous flow control for node.js(substack.net ↗)

7 points · by substack · 15y ago · 1 comment

comment 15y ago · link · parent

Which browser are you using?

comment 16y ago · link · parent

Glad you like it! Easter egg: http://browserling.com/queue

comment 16y ago · link · parent

Sorry about that! When the API servers go down (these interface with our windows servers) it tells everybody in the queue "time's up" instead of a more informative message since we're using connection drops as a poor way of passing along the session expiry event.

comment 16y ago · link · parent

Since the article uses evolution metaphors, how about this: forks can be a good way to help organisms (read: projects) navigate a complex multivariate fitness landscape. Abandoned forks then serve as concrete markers of particular design decisions that can be revisited later if a similar kind of problem comes up.

We often don't know ahead of time how a decision will work out, so calling these forks "wasted effort" seems to miss their utility as experiments that can drive the direction of future development indirectly.

comment 16y ago · link · parent

Instead of reading in static files yourself, you can just use connect (or s/connect/express/g and it'll also work):

    var connect = require('connect');
    var server = connect.createServer(connect.staticProvider(__dirname + '/static')).listen(4000);
Pow, that was easy! Plus, since connect (and express) are just up the prototype chain from http.Server, it works great with socket.io.

171.

Roll your own PubSub with DNode in node.js(substack.net ↗)

16 points · by substack · 16y ago · discuss

comment 16y ago · link · parent

Each approach has liabilities that should be recognized. Intuitive decisions might "feel right" but there are so many cognitive biases that can make something intuitively appealing but surprisingly wrong. Analytical, rational approaches are likewise poor at developing creative solutions but is good at removing bias from reasoning by clearly stating every step.

comment 16y ago · link · parent

RPC is a domain where functional patterns really shine since the high-latency nature of network traffic is well suited to asynchronous, callback-oriented event systems which are themselves inherently functional.

My own RPC system enforces continuation passing style exclusively to unify the calling and return-value semantics. With this functional pattern in place it was pretty straight forward to transparently wrap arbitrarily many closures arbitrarily deeply in callback argument lists and method requests (which are the same thing under continuation passing style).

comment 16y ago · link · parent

I personally can't stand office chairs. Give me a sofa and a short table or a barstool and a counter, ideally both so I can switch between them, and I'm content. The article just assumes that everybody works best in chairs, but there are variations in how programmers best get work done. It's not simply a matter of running a cost-benefit analysis on how much to spend.

comment 16y ago · link · parent

I've messed with TreeBuilder before but it looks like I should give this XPath business a look the next time I need to parse some HTML.

I was a bit confused when I hit the "quote-likes" section until I realized it was an aside however. A different colored box might be good for those.

comment 16y ago · link · parent

This article says nothing about how lifespans are far longer now, as the comments section points out. Cancer is what you die of when everything else fails to kill you. Cancer is only "purely man-made" in the same sense that increased life expectancy is "man-made" too.

comment 16y ago · link · parent

In this case it was a derivative work based upon source code from the book, which is permitted under the terms but precludes open dissemination. Further, the rest of the codebase was very tightly coupled to the algorithms since since the algorithms updated state in-place instead of returning values, so dropping in an open version of these algorithms was very non-trivial.

comment 16y ago · link · parent

Another neat thing about this module is that Lazy() can take an EventEmitter as an argument and custom event names, so you can wrap a Lazy() chain around existing streaming interfaces pretty easily.

comment 16y ago · link · parent

Further, open code means that other researchers can come along and write unit tests. It amazes me how much code is still verified manually if at all in the sciences.

comment 16y ago · link · parent

One time I worked on a power grid simulation that wanted to release its code but it couldn't because it used algorithms from «Numerical Recipes: The Art of Scientific Computing» which has a pretty asinine copyright policy with respect to openness : http://www.nr.com/com/info-permissions.html

Even worse are the researchers who keep their models and data sets secret due to paranoia that some colleague will publish first, which admittedly does happen.

Cultivating a spirit of genuine cooperation and sharing in academia would do wonders for the progress of the sciences, but there are so many hurdles that need to be removed. It's not just a matter of knowing that it's good to release source code or feeling confident in including it as the article suggests.

1
45678