HNHacker News
TopNewBestAskShowJobs

NathanRice

136 karma · joined February 12, 2012

submissionscomments
NathanRice··on Bartosz Milewski - The Downfall of Imperative Programming
I hesitate to admit photons into the macro realm, considering they are elementary particles and essentially massless.

Given the de Broglie hypothesis, I must of course admit macroscopic objects do have wavelengths, and thus macroscopic uncertainty (your statelessness) is a nonzero vlue. For all intents and purposes though, the denominator of the equation causes the wavelength to go very close to 0, as the mass value dwarfs the Planck constant and velocity is always non-zero due to brownian motion.

Wave function collapse is interesting and I must admit when it is not induced by momentum, I don't understand it very well.

NathanRice··on Bartosz Milewski - The Downfall of Imperative Programming
My experience in user interface coding (though not really my favorite area) has been that event handling is pretty much code and ignore, until you want to do some big nasty thing, at which point you have to implement a callable/runnable interface (in java), queue things up and do some synchronization. This seems to be less of an issue in the browser, though I haven't looked at the implementation details.

I do agree that having some kind of multi-threaded greenlet/fiber dispatcher would be more efficient and handle corner cases better. I just don't think your average developer would notice a huge difference.

NathanRice··on Bartosz Milewski - The Downfall of Imperative Programming
I am a big fan of synchronous dataflow as a way to organize programs. It meshes well with the idea of modelling knowledge rather than "programming".
NathanRice··on Bartosz Milewski - The Downfall of Imperative Programming
I was thinking more along the lines of working around data-locality issues. For instance, imagine that you have code that requires very high latency fetches, or you are working with a data set that doesn't fit in memory. Typically, you have to develop modified algorithms that for these scenarios, but there is no reason that a minimal fiber scheduler couldn't adapt seamlessly. Even better, if your conditions change (like for instance, mobile devices moving from low throughput to high throughput links) a scheduler can adapt, but the hand rolled algorithm must be re-coded.
NathanRice··on Bartosz Milewski - The Downfall of Imperative Programming
One significant issue is that most programming languages are inherently temporally inexpressive, having either full order (imperative/impure functional) or no order (purely functional). Ideally the language would make it easy to organize statement in such a way that a programmer could indicate a partial ordering relation without having to use function composition. Additionally, a big problem with function composition in purely functional programming is that multiple long function compositions can only be ordered as monolithic units, however in many cases being able to order at the individual function level is desirable. If a language had an explicit notion of relative temporal index for statements (which could be adjusted) it would be a nice win for writing concurrent code. That would also let compiler writers lift a lot of the stuff they do up to the program source level as macros (which would be a HUGE win).
NathanRice··on Bartosz Milewski - The Downfall of Imperative Programming
In my opinion, there isn't really a palpable benefit to be gained from totally re-engineering GUI event handling. Processes that are so CPU intensive they cause the GUI to lag are uncommon (and easily dealt with when they do occur). Even if a re-engineering of the GUI event architecture did occur, that would be a systems level issue, and most developers could remain oblivious.

I like Clojure, I think Rich did a great job with the data structures. My only gripe is that it would be a lot more elegant if the notion of transients went away completely. I think transactions with automatic commit and branching on reference creation would be much nicer (and faster). Still a very well engineered language by and large.

NathanRice··on Bartosz Milewski - The Downfall of Imperative Programming
The reality is stateful on a macro-scale. I find the idea that the universe is actually stateful, and we do not completely understand behavior at quantum level far more parsimonious than the converse.
NathanRice··on Bartosz Milewski - The Downfall of Imperative Programming
While I agree with some things the author says, his conclusions are bullshit.

Very few processes want to be parallel. People who primarily do parallel programming think everything needs to be parallel, so they assume everyone must be going through the pain they are going through. This is false. Most people write sequential software.

Another issue is that purely functional programming is fundamentally flawed, because it attempts to eschew state. Many functional programmers will call this a virtue, but the world is stateful, and being able to reason about necessary state is how you do anything useful. Purely functional programming is great when you want a convenient test-bed for ideas, but Haskell as a practical programming language is a horrible idea. Ultimately, what we want is to eliminate unnecessary state, while reasoning about necessary state. Modern programming language researchers are doing this under the guise of "effects systems", however most of the research I've seen far has left me underwhelmed.

Eventually functional programming researchers are going to end up somewhere that is quite far from where they started, but just a few small steps from logic programming.

NathanRice··on Philippines: The country that never sleeps
In my experience Indian workers are a bad bet. The average quality of work I've gotten from Filipinos is higher, for slightly less money. Filipinos on average make more of an effort to understand requirements and seem to take more pride in their work. The best Indian talent is at a higher level than what you can generally find in the Philippines, but I wouldn't expect to get that.
NathanRice··on Philippines: The country that never sleeps
I have my face in a Burger Machine record book. I don't remember my exact time now, but it was like 1:05ish. I'm sure someone has beaten me by now but the staff sure was impressed when I did it :)
NathanRice··on Philippines: The country that never sleeps
Filipinos are great for business process outsourcing. They tend to have fairly good written and spoken English and have a decent work ethic.

I'm not as big a fan of them for software work. For coders, eastern Europe is your best bet, with Brazil picking up a lot of steam in the last few years as well.

NathanRice··on How Not To Sort By Average Rating
In the binary case the usual treatment in statistics is to use the logistic function (and logit) to work with real numbers, then transform back into probability space as the last step.

This is a little flakey for ordinal numbers, and the usual treatment is to use a learning algorithm to find a mapping from real numbers to ordinal values, either explicitly (if you need a "score") or implicitly. Support vector machines, radial basis functions and neural networks are typically used.

NathanRice··on How Not To Sort By Average Rating
By far my favorite book on the subject is conveniently available for free on the internet! "Information Theory, Inference and Learning Algorithms" by David MacKay is wonderfully written, well paced and comprehensive. If you like the book, you should purchase a copy, David is a great guy.

http://www.inference.phy.cam.ac.uk/mackay/itila/book.html

Videolectures has some very good videos as well. Zoubin Gharamani has a pretty solid lecture on Bayesian learning at http://videolectures.net/mlss05us_ghahramani_bl/ (he's a great researcher but not the most engaging speaker). Try Christopher Bishop's lecture at http://videolectures.net/mlss09uk_bishop_ibi/ as well, it might be slightly more palatable.

NathanRice··on How Not To Sort By Average Rating
You are absolutely correct that they are not mathematically identical. I struggled to word it in a way that would not mislead people, the distinction is important to emphasize.
NathanRice··on How Not To Sort By Average Rating
Yes, the explanation of "imaginary votes" is by far the simplest way of thinking about the situation. Having mathematical formalism and a rigorously studied methods makes me feel OK about doing it though, otherwise I would be very uncomfortable with the approach :)

I love Bayesian statistics from a conceptual point of view, but the ease with which one ventures into the land of analytic intractability kind of puts me off more complex models. MCMC is such a clumsy tool (in addition to taking forever); variational methods look interesting to me but I don't really feel they are quite there yet.

NathanRice··on How Not To Sort By Average Rating
Operations research and hard systems modeling are neat. The only gripe I have is that often times the models make simplifying assumptions which hold tenuously at best. One example of this is the Gaussian copula used in VAR. In actuality, neither the marginals nor the copula are Gaussian in the large majority of cases; they ARE stable distributions, but the tails can be absolutely HUGE. The Gaussian distribution is attractive because it is well behaved, and in most cases we don't have enough observations to properly understand the full tail structure of the underlying distribution. As a result, you get quants that make a model and call a small subset of points (which are completely valid) "outliers". Then when we observe the tails of the distribution, things fall apart because over-leveraged bankers made decisions based on the notion that the model accurately reflected reality.
NathanRice··on How Not To Sort By Average Rating
Absolutely! I just wrote a reply where I alluded to that, unfortunately I didn't refresh and see this post or I would have just plugged you instead.

The benefit of the Bayesian treatment here that I want to drill down on is how natural it is to adjust the prior to capture your beliefs about how items should be perceived in the presence of incomplete information. The frequentist approach is fine, but it does not provide such a pleasant, intuitive knob to tune.

NathanRice··on How Not To Sort By Average Rating
I don't think you have to resort to any overly complex machinery to achieve similar behavior. The simplest approach is to just use a non uniform prior. His pessimistic bound could be emulated by having an initial alpha that places more weight on low star ratings. The intuitive interpretation of that being "things are probably bad unless proven good" roughly. Another option would be to generate the prior based on the posterior distributions of other items. Just take the distribution of ratings observations for all products of a given type (perhaps only items produced by that company?) to get a sensible prior on a new item in that category.

The strength of priors here is that it is very easy to take intuitions and encode them statistically, in an understandable way. Taking the lower bound of a test statistic doesn't admit much in the way of intuition.

NathanRice··on How Not To Sort By Average Rating
I appreciate people who take the time to apply math to things in the real world, and share it with non academic crowds. Thanks for that.

5 star rating systems are obnoxious. From a mathematical perspective, if you treat them in an ordinal fashion they are poorly behaved, and if you treat them categorically, you lose the relationship between stars. There seems to be some popular movement towards binary rating systems, and I think that is great. Not only do people tend towards binary rating behavior in the real world (only rating a movie they thought was very good or very bad) but they admit a much cleaner mathematical treatment.

NathanRice··on How Not To Sort By Average Rating
Well, I try not to be dogmatic :)
NathanRice··on How Not To Sort By Average Rating
While I agree with the spirit of the article, this is one of those cases where a Bayesian treatment is conceptually much clearer.

Assume that ratings are being generated by a stable stochastic process where the underlying distribution is multinomial (ignoring the ordinal character of ratings, for the time being) and use a dirichlet conjugate prior. This gives you a posterior distribution over new ratings for an item. The benefit of a posterior here is that it lets you rank items by thinking in terms of the probability that the viewer would rank one item higher than another at random. By adjusting the magnitude of the alpha parameter to the dirichlet prior, you adjust your sensitivity to small numbers of observations. A small initial alpha will lead to rapid changes in the posterior upon observing ratings, whereas a large alpha requires a significant body of evidence.

The best part of the multinomial model with conjugate dirichlet prior is that the math is REALLY simple. The normalizing constant for the dirichlet distribution looks scary when stated in terms of the gamma function, but given this is the discrete case, just pretend everywhere you see the gamma(x), it is replaced with (x - 1)! and you will be ok.

Let me know if you would like to learn more, I would be happy to help.

NathanRice··on Graphs in Operations
This is actually an active area of research in the theory of computation, and computational semantics. Researchers have been hard at work trying to formulate an algebra of ubiquitous computation that can encapsulate the spatial and temporal arrangement of mobile processes (which in this case includes computer processes, physical processes, chemical processes, etc). Graphs (or variants) are the structure that is being used to model these systems. Processes are nodes (or sets of nodes) with an algebraic structure that permits composition and formal reasoning.

For an easy-ish overview, check out: -- edit -- this was the wrong set of slides... These are dense.

http://www.cl.cam.ac.uk/archive/rm135/Bigraphs-Lectures.pdf

The easy ones are here: http://lcs.ios.ac.cn/lectures/bigraphs-tutorial.pdf

NathanRice··on The Day Python Embarassed Imperative Programming
"Learn you a Haskell for great good" is probably the most approachable book on the subject you can read it online for free.

People who are confused should definitely check it out.

NathanRice··on Better than templates, building highly dynamic web pages
Actually, if you read between the lines a little bit, what the article suggests is somewhat analogous to a viewmodel/presenter. Creating an entire DOM in the way suggested would be bad form, but creating an abstracted viewmodel then transforming it programmatically is actually quite elegant.

Viewmodels let you use the same skeleton structure for different mediums. You can take a viewmodel and generate a native (read "app") interface easily, as long as you have transformations from abstract viewmodel to concrete view. Of course that would require the ability to compile Javascript to native on your platform of choice, but I don't think that is a pipe dream.

NathanRice··on Why so many Python web frameworks?
A lot of people will make snide remarks when someone says they are creating their own framework, but obviously if someone has evaluated the existing frameworks and still decides to do it, there is an unscratched itch. A lot of people who aren't happy with the larger monolithic frameworks have adopted flask (myself included) as a simple base to build more interesting things on.

There are a number of things no framework I have yet run into does well:

1. Unification of client side and server side events. With options like Backbone or (ugh) ExtJS on the client side, there is a lot to be gained from a coupled event subsystem over websockets, or via server sent events.

2. A true viewmodel based page composition framework, where components are abstract view elements with data bindings on the server side, which then have associated renderers for the output to the client.

I've played with both of these, and found them to have a lot of advantages over standard template + ajax + callbacks style of design, though creating a library for others is a lot more work than hacking something for yourself :)

← PreviousPage 2 of 2