HNHacker News
TopNewBestAskShowJobs

jwmerrill

1,598 karma · joined April 5, 2012

Physicist, probability and geometry enthusiast, and software developer at https://www.desmos.com.

You can reach me at jwmerrill@gmail.com

submissionscomments
jwmerrill··on Switching from imperative to functional programming with games in Elm
Heads up for anyone trying to run the example code here: the syntax for importing modules changed in Elm 0.15.

https://github.com/elm-lang/elm-compiler/blob/master/changel...

jwmerrill··on SML and OCaml: Why was OCaml faster?
I understand that v8 is using this algorithm, and Julia also now uses it thanks to work by Jacob Quinn https://github.com/JuliaLang/julia/tree/master/base/grisu
jwmerrill··on Using least squares regression to calculate a circle from a freehand drawing
Quick version in Desmos:

https://www.desmos.com/calculator/7dpcup8iwk

Here you move the points by dragging instead of creating them by drawing, which I find more fun in some ways, and less fun in others.

Edit: constraining the radius makes the system behave like a hoop attached to springs https://www.desmos.com/calculator/a2pfwqrtmb

jwmerrill··on Why the sun is a poor dumping ground for nuclear waste (2010)
> But aren't the vast majority of possible orbits unstable?

No. Ignoring perturbations from other planets, planetary orbits are stable ellipses with the sun at one focus.

http://en.m.wikipedia.org/wiki/Kepler's_laws_of_planetary_mo...

jwmerrill··on Closures and Objects Are Equivalent
You can have several different functions that all close over the same state. This situation is analogous to an object with several different methods.
jwmerrill··on Dunning-Kruger and Other Memes
It is not the same damn graph--the two "logical reasoning" graphs show two separate studies that measured same quantities. The points on these graphs are not the same, even though the axes and captions are (except that the captions mention that they are two separate studies).

Edit: based on other comments, it sounds like maybe the 3rd and 4th graphs were identical, but the author has now corrected the error.

jwmerrill··on Zeno's Paradox and Planck Units
Here's one resolution to the Arrow paradox:

Zeno imagines that the state of the arrow must be represented by a single number--its position. But if its state includes a second number, velocity, the paradox goes away.

Imagine the arrow's life is a game played on a checkerboard. Its column represents its position in space, and its row represents its velocity. On each turn, if the arrow is in the first row, it moves one column to the right; if it is in the second row, it moves two columns to the right; in the third row three columns, and so on.

This game is easy enough to imagine, and represents both time (turns) and space (columns) discretely. No paradox here. No quantum mechanics either.

jwmerrill··on The harm done by tests of significance (2003) [pdf]
> Without [inferential statistics], how are you supposed to reason about (for example) study results? Appeal to intuition?

The alternative, which the author of the linked article mentions, but doesn't really emphasize, is to report a best estimate of whatever effect you are trying to measure, along with some measure of uncertainty in that estimate.

For example, instead of "we failed to find significant evidence that right turn on red increases the expected number of fatalities," you say "our best estimate of the expected increase in fatalities due to right turn on red is 200 +/- 210."

This approach puts the most relevant information front and center, and it seems to me, encourages better intuitive reasoning. It's what engineers and most of the hard sciences do most of the time.

You do also need to say something about the meaning of your uncertainty estimate (e.g. it's 1 sigma, or 2 sigma, or 95%), or alternatively, there needs to be an understood convention for your field.

jwmerrill··on Introduction to Automatic Differentiation
AD is a way (actually ways) of organizing a computation. There are many different ways to organize the computation and evaluation of a Taylor series at a point.

As an exercise, try to explain the difference between symbolic differentiation, forward mode AD, and reverse mode AD. You will find that there is more content here than just a new name.

jwmerrill··on Web typography for non-designers
The picture in the "measure" section has a red "x" over 99 characters per line and suggests 45 to 75 characters per line. But the article's paragraphs have about 95 characters per line.

Do as I say, not as I do.

jwmerrill··on Statements about the Mobile Web
If you could run at a perfectly consistent 24 fps, that would probably often be okay. But the typical failure mode is not running at a perfectly consistent lower frame rate; instead, it's variable length pauses with the tail of them being painfully long.
jwmerrill··on Experience report: Rocket lander in Elm
Canvas doesn't work that way. It's immediate mode, so unless you are doing something purely additive, you reissue all draw calls on every frame. Compare to SVG, which is retained mode.
jwmerrill··on Show HN: A Sierpinski Valentine in 4 equations
You can send this graph as a valentine, or make your own at http://mathogram.desmos.com/

Disclosure: I'm one of the engineers at Desmos.

jwmerrill··on Holy Shit, I Interviewed the President
> the principal reason that political journalism exists: to hold decisionmakers accountable to the public

Green's point in this article is that traditional political journalism has made a mockery of this responsibility, and I for one agree with him.

We can't have Walter Cronkite anymore because political media has completely debauched itself. I'd rather have earnest if naive amateurs than however you want to describe what happens on Fox News and MSNBC. Maybe not exclusively, but at least as a counterbalance.

jwmerrill··on Automatic Algorithms Optimization via Fast Matrix Exponentiation
This is great when your inner loop is calculating the nth Fibonacci number, but I'm skeptical that there are all that many practically occurring inner loops that are linear recurrences where the author of the code has not already recognized them as such.
jwmerrill··on Speaking While Female
It's pretty common that in any given group, the subset of people who have good ideas and the subset of people who are comfortable dominating a group conversation are not entirely the same.

One strategy that I've found is sometimes helpful that recognizes this fact is to start group decision making by having everyone write ideas down independently on sticky notes for, say, 5 minutes. This means every person present ends up with a physical representation of the fact that they have ideas, sitting in front of them on the table.

Then, in a second phase, you can put them on a board and organize them, evaluate them, vote on them, etc. Since the ideas are now sticky notes on a board, they can be evaluated (more) independently of the person who articulated them.

The first time I participated in something like this, it felt like Kindergarten, and I didn't really appreciate it. But after some practice, I've come to appreciate that it gives every member of a group the chance to contribute ideas, without having to simultaneously finesse the holding-the-floor game.

jwmerrill··on For Sale: “Your Name Here” in a Prestigious Science Journal
> Even worse, increasingly automated systems are relying on journal articles for automated diagnosis.

Where can I learn more about this? Without hearing more, it sounds like a terrible idea.

As a scientist, if my beliefs were based on an unweighted sample of claims made in journal articles, I can tell you, I would believe a lot of nonsense. I hope no one is practicing medicine that way.

jwmerrill··on Considering performance in the small is not “premature optimization”
That's fine, but it's exactly the opposite of the attitude expressed in the post.

"The ratio of bytes loaded to load time should be very close to the I/O throughput of the machine."

How do you think the bytes served for a few hundred requests a minute compares to the theoretical I/O throughput of the relevant machines?

And because no one can see my tongue in my cheek across the internet, I'll be explicit that I'm sure he is a user of his publishing environment, not it's author, and so it's fair to view this as just another symptom of the problem he's discussing.

jwmerrill··on Considering performance in the small is not “premature optimization”
You have made the considerable investment required to learn a language that allows making such a distinction, and when to use which. Other people have spent that time doing other things, and yet they are still sometimes able to produce software that is valuable to themselves or others.

One man's saw sharpening [1] is another man's yak shaving [2].

Personally, I like my saws very sharp, thank you very much, but I think it's important to also have sympathy for people with different backgrounds and priorities.

[1] http://c2.com/cgi/wiki?SharpenTheSaw [2] http://programmers.stackexchange.com/a/34788

jwmerrill··on Considering performance in the small is not “premature optimization”
This was a very nice essay, and I'm glad to have read it.

But it's impossible not to gloat at least a little bit about someone lecturing us about low level efficiencies from a site that can't manage to serve static blog content to a few hundred visitors a minute (or whatever it is that the top slot on HN drives these days).

jwmerrill··on Rise of the Scientific Programmer
Principle Investigators (i.e. professors that run labs) could establish a code review process for code that their group produces, just like any other manager can establish such a process.

Many PIs don't have the expertise to do that well, and many of them don't especially value style, performance, or idiomatic code. You have to remember that most academic code gets used by 1-5 people, and is run something like 1-50 times total. In those cases, it's actually kind of ok that that code doesn't end up being maintainable.

The important risk, of course, is erroneous results. But good researchers generally find many independent ways to check their results, so ideally, bugs that affect results should get caught in that process.

I personally love writing high quality code, and I found the academic science attitude about code to be frustrating. But there are structural reasons for these attitudes, and it's wrong to imagine that you can change them by arguing in terms of things that software engineers find valuable. You'd need to make your case in terms of things that science PIs find valuable, and in the process of trying to do that, you might actually discover that what you wanted to argue for isn't so critical after all.

jwmerrill··on Rise of the Scientific Programmer
I had the same experience in grad school, and I can tell you that giving people (good!) style advice when they don't ask for it is pretty pointless. It's kind of like giving grammar advice that wasn't asked for.

People need to be in the right frame of mind to learn new things. Otherwise, if they're getting their point across, just let them keep talking (or coding).

jwmerrill··on The Man Behind Common Core Math
> I just spent some time reading through /Math/Content/K/ on corestandards.org. Most of it is, IMO, complete trash and not at all aligned with how kids in kindergarten actually learn this shit. As a "spec" it's writing is sloppy, poorly defined, and highly ambiguous.

I respect that you took the time to read the document, but your criticism isn't very specific. Are you bothered by the fact that it uses words that aren't appropriate for Kindergartners to describe what they should know? Or that it says what they should know, but not always how to teach it?

I think the "spec" analogy is a good one. The goal of a spec is to lay out requirements, not implementation. Same idea here, which strikes me as the right choice.

The actual expectations are to know a few things about counting, numbers, and shapes. That seems developmentally appropriate to me (admitting that I don't have much recent experience with kids this age).

What do you think Kindergartners should know?

Re: the practices part, these same practices are mentioned at every grade level through high school. I agree that the practices sound way too advanced for Kindergarteners, but the goal is to get students to do them well by the end of high school, not by the end of Kindergarten.

jwmerrill··on The Man Behind Common Core Math
The common core Mathematics standards are available for anyone to read here:

http://www.corestandards.org/Math/

I would encourage anyone who is really interested in this issue to spend some time reading, or even skimming just a few sections. I find the standard is generally quite readable (conceding that it's a non-trivial commitment to read more than 1 grade level, but then again, there's a lot to know about math...) and I also tend to agree with many of the ideas in it.

I've been disappointed, but in hindsight not very surprised by the anti-intellectualism in the public response to the common core. I'm more surprised to see similar anti-intellectualism here. I expect better from you, HN!

It's true that the common core places more emphasis on critical, analytical, and sometimes even abstract thinking than the "traditional" math curriculum (whatever that is...). But as people who read hacker news, doesn't that sound good to you?

It's also important to know that the Common Core standards are a set of expectations, and that's actually all they are. They are not worksheets or standardized tests. If you see a bad "Common Core" worksheet, it is a bad response to the Common Core, but it isn't actually the Common Core itself. If you want to criticize the Common Core itself, choose a part of the document above and criticize it. Or failing that, criticize the process that led to its creation and dissemination. But criticizing a few oddball problems is not a powerful argument.

My own criticism-in-hindsight is that the Common Core is trying to do two things at once. Maybe it would be succeeding better if it only tried to do one of them at a time.

The first is to provide a nationally standardized set of grade level expectations. Many people have an interest in this goal because it makes it easier to prepare teaching materials for a large group of students, and to compare education effectiveness across regions. In an alternate world, this could have been done descriptively instead of prescriptively. The standards could have simply described what was happening in the largest fraction of the country's classrooms.

The second goal is to improve math pedagogy in the U.S. and bring it up to the best international standards, including tying math more strongly to critical, analytical, and abstract thinking skills. This is a prescriptive goal.

If the standard was a process, we could have started with 1, and moved to 2 incrementally. But I suggest this only half-heartedly, because I think 2 is a great goal, and I think the Common Core (as a document) does a pretty good job of it.

Now to be clear about my own biases:

I don't have any children (school age or otherwise). If my first exposure to the Common Core was seeing my child assigned problems that looked unfamiliar, unimportant, or even that I didn't know how to do, I'll concede that I might have reacted negatively too.

I do have a physics Ph.D. (i.e. math background), I do think and care a lot about how people understand math, and I do work on a software tool that tries to help children think about (part of) math more powerfully.

jwmerrill··on The Man Behind Common Core Math
It's hard for me to imagine a world view where adding critical thinking to a subject might make it worse.

> It's as if English class now also included Latin.

I think a better analogy would be "it's as if English class now included critical thinking." Or "it's as if Science class now included critical thinking." Or "it's as if History class now included critical thinking."

All of those sound unambiguously good to me.

jwmerrill··on What if Finland’s great teachers taught in U.S. schools?
Really insightful comment.

> the impact of both poor and excellent teachers is way overestimated, and the impact of poor and excellent administrations (both the school principal and the district leadership) is tremendously underestimated.

Why do you think this happens?

I'll speculate: most people form their opinion about what's important in a school by reflecting on their experience as a student.

Most students attend only one school of each kind (e.g. elementary, junior, and high school), so they don't have a great frame of reference about the results of different school administrations.

But everyone experiences many different teachers, and as a student, you really perceive the differences between the better ones and the worse ones.

I bet if you reflect on your own experience as a student, leaving aside the context of your spouse's experience as a teacher, you will have much more vivid memories and opinions about teachers than administrators.

I totally agree that it's likely to be much more effective to try to create environments that help all teachers do their jobs more effectively than it is to try to change who we're hiring. I wonder what the best way is to make people "feel" the difference between good administrators and bad ones like they "feel" the difference between their favorite teachers and their least favorite ones.

jwmerrill··on JavaScript Equality Table
For another surprise, try assigning those empty objects to variables before adding. By itself,

{}+{}

doesn't mean what you might think it means.

jwmerrill··on Grinch about the array.length caching
> nothing ever leaves your local computer. There is no server component in IRHydra.

Wow, cool!

jwmerrill··on Grinch about the array.length caching
IRHydra is awesome, but there is still a lot more friction to using it compared to the built in dev tools. You have to run v8 with special flags and upload files to a web page. In some ways, this is still quite simple compared to getting rolling with debugger/disassembler tools for many other languages/environments.

But imagine a workflow where I'm profiling my real application in the browser, and I see that some function comes up hot. If I could just click its name and get this kind of information, I believe I would do this kind of analysis much more often.

That said, as a person who makes websites, I'm sensitive to the fact that people who claim they would use a feature if you built it won't actually always use the feature when you build it...

jwmerrill··on Grinch about the array.length caching
The first place I got the impression that it was a good idea to cache the array length and/or reverse loops was in Zakas, "High Performance Javascript" [1]. The book was written in 2010, and I have a feeling that compiler advances have laid waste to huge swaths of it. Some of it may have already been outdated when it was written. Even so, performance folklore is slow to disappear.

I've found everything that Egorov (author of this post) has written is well worth reading.

If there's one overall theme of his work, it's that it is generally highly unreliable to extrapolate the result of micro-benchmarks to real code. Instead, you need to measure potential optimizations in your actual code base. And you might need to do it again next year, because compilers are constantly changing and usually improving.

If there's a second overall theme, it's that you can and should examine the code that your JS compiler is producing, rather than relying completely on black box benchmarks. It would be great if browser dev tools would make this easier to do directly. Currently, I find the external tools for doing this hard enough to set up and manage that it isn't really very economical to do this kind of analysis frequently.

Compare to Julia, where you can call code_llvm(fn, (argtypes...)) to see the LLVM IR of a piece of code right from the REPL, or code_native(fn, (argtypes...)) to see the generated machine code for your architecture.

[1] http://books.google.com/books?id=ED6ph4WEIoQC&lpg=PA64&vq=th...

← PreviousPage 5 of 8Next →