HNHacker News
TopNewBestAskShowJobs

naftaliharris

1,184 karma · joined July 22, 2012

www.naftaliharris.com https://twitter.com/naftaliharris
submissionscomments
naftaliharris··on Don't Double Major
> You believe that you understand ekm2's situation and goals better than ekm2 does?

No, I don't believe that. My suggestion about the graduate schools in the fields ekm2 named comes from having thought of some of those graduate schools myself, but of course ekm2 would know about the specific schools and programs ekm2 is interested in better than I would.

My question to ekm2 about why one would choose to double major vs. single major was sincere, and the answer enlightening: in ekm2's case, the double-major ensured that there wouldn't be scheduling conflicts or prerequisite issues.

> My question to you is, why get a degree at all?

Because the difference between having a degree and not having one is an order of magnitude larger than the difference between graduating with a single major and graduating with a double major, enough to make the utility loss worth it for most people.

naftaliharris··on Don't Double Major
> What if you take all of the courses which interest you, and that just happens to be enough for both a math and CS degree?

That's great! This means, of course, that the maximum utility schedule happened to lie in the subset of schedules satisfying both constraints, and you so there is no utility loss. The double-major in this case is just an added bonus of doing what you wanted to do, and I'm happy for people lucky enough to find themselves in that situation. From my time in college, though, I remember a number of people who were reasoning along the lines of "Well, I'm just three boring classes away from a double major... might as well pick it up I guess." For people in that situation, where they don't really want to take the extra three required classes, I'm arguing that the double major isn't worth the utility loss.

> Degree requirements exist because the degree committee (and accreditation organization) believe they have have a better sense of overall utility than most students.

Indeed, and good point: If you don't have a good sense of your utility function, then the decision to double major is roughly equivalent to using the implied utility function of the degree committee to help estimate your own utility. However in this case, I'd argue that you would probably get better results from asking a trusted professor or mentor for advice on classes to take, since the person you ask for advice would know you better than the degree committee.

naftaliharris··on Don't Double Major
I'd argue that your ability to program is the direct result of taking CS classes, not the direct result of majoring in CS. Similarly, I'd argue that your ability to go to graduate school in those fields is a consequence of taking math classes, rather than of majoring in math. (With the possible exception of math grad school, I will admit).

The question is: By fulfilling the requirements for a double major, what does one gain above and beyond what one would have gained by majoring in Math, but taking a lot of CS classes? Or majoring in CS, but taking a lot of math classes?

naftaliharris··on Google splits into GOOG and GOOGL today
Yeah, the first thing I thought about when I heard this is that these two shares would be ideal for pairs trading! (Though presumably this will be arbitraged away quickly).
naftaliharris··on Why Don’t We Have a General-Purpose Tree Editor?
I've made "proof graphs" with GraphViz, but honestly it was something of a challenge to make them look how I wanted them to. Compared to the time I spent drawing the graph on paper, (ie, collecting the statements and theorems), making the GraphViz version look okay took a long time.

http://www.naftaliharris.com/blog/mc-graph/

http://www.naftaliharris.com/blog/mg-graph/

naftaliharris··on Out of 15M brackets, none remains to win Warren Buffet's $1B March Madness bet
That would be the case if each of the games were played between truly equal teams. In fact, many of the games are much easier to predict than 50/50 since one team is better than another. So the expected value is actually higher, (though presumably still quite small, of course!)
naftaliharris··on Python 3.4.0 released
A few months ago I wrote a C implementation of a lazy "sorted" function, (https://github.com/naftaliharris/lazysort). One of the things you can use it for is computing medians, with the same "sort-then-take-the-middle-element" algorithm that the statistics module uses. Internally, however, what will happen is that the lazy data-structure that results from a call to the lazy "sorted" function will find the middle element with quickselect.

For lists of size 10M, I got a 7.3x speedup vs using the sorted function, and a 1.6x speedup vs using numpy.median. The sorted function was faster up until lists of size 100, presumably due to lower overhead. (The lazily-sorted list data-structure also keeps track of the pivots resulting from partitions, so that later method calls run faster by exploiting the partially-sorted structure that remains from earlier method calls).

Here's a plot of the time to compute the median for these different algorithms, (taken from a paper I wrote that's under review): http://imgur.com/oX1QLnS

naftaliharris··on How I Got a 2x Speedup With One Line of Code
Thanks! I tried -fprefetch-loop-arrays before figuring out that it only prefetches the array memory, (ie, memory with addresses like &ob_item[i]), rather than the memory referenced by the array memory, (ie, memory with addresses like ob_item[i]). And empirically adding -fprefetch-loop-arrays got me no speedups.

I didn't try any other GCC command line arguments because I honestly didn't know what other relevant options there were.

naftaliharris··on How I Got a 2x Speedup With One Line of Code
Yeah, you're right: had I not written the code myself, it would not have been clear to me what that special line did or why i+3 without documentation. Your proposed comment describes it nicely; I've added it verbatim:

https://github.com/naftaliharris/lazysort/commit/a56f30adef7...

naftaliharris··on How I Got a 2x Speedup With One Line of Code
Thanks!

Oh, thanks for pointing out the oversight! They were floats generated with random.random() and then shuffled with random.shuffle(.) Shuffling them removes any locality that might have arisen when the floats were being generated, even though the distribution remains uniform on (0, 1). (And indeed, empirically the code runs faster if you don't shuffle them).

Yeah, I'm not sure how well this would work if you were sorting different objects. I would guess that it depends on two things--how large the objects are in memory, and how long it takes to compare them.

naftaliharris··on How I Got a 2x Speedup With One Line of Code
Neat! A quick skim of the referenced article in that comment (http://ieeexplore.ieee.org/xpls/icp.jsp?arnumber=6193457) shows that it solves a problem I'd wondered about for a while now, about how to optimally choose the pivots when computing order stats. (Yeah, I'm just doing median of 3 right now). If you want to sort the whole list, then clearly you want the pivots to be as near to the median as possible. But if you just want an order stat, then that's not necessarily true; if you wanted, say, the 10th percentile, my gut feeling would be that you should aim for your first pivot to be roughly the 20th percentile or so. I'll read that article more closely and see if I can improve even more.

Thanks, that's really helpful!

naftaliharris··on How to hire your first employees
Harry, do you pay the prospective employees during the trial run? The blog post implies that it's a week long, ("We’ve been able to spot problems during the week..."). While the information gained by both parties during a week of working together is no doubt very valuable for them both, a week is a long time to work for no pay.

EDIT: Oh, I see your edit, these trials runs typically aren't a full week long. But in any case, if someone is going to give up a substantial amount of time, I hope you pay them for it.

naftaliharris··on Scientists Back Kiera Wilmot by Tweeting About All the Stuff They've Blown Up
I put a capacitor in backwards once, went away from my circuit, and came back to smell and see it smoking and flaming.
naftaliharris··on NASA has three smartphones orbiting the earth as mini-satellites
The picture on that article is really misleading--it looks like you're seeing the curvature of the earth, and are therefore high up in space, but it's probably just the effect of a fish-eye lens, as evidenced by the curved upper surface and the distorted box.
naftaliharris··on Free Statistical Consulting at Stanford
This link I submitted is partially out-of-date and really does not do the consulting service justice:

1) The service is open to everyone, not just to Stanford affiliates--we'd love to hear about statistical problems that startups are facing. 2) The talk about first and second meetings is nonsense--the consulting service is friendly and informal and some people come week after week. 3) The times and locations, however, are accurate, and the service is completely free.

Personally, I work at the Friday 2:30-4:30 session. I'd love to hear about Statistical or data-science problems you have and help you to solve them!

naftaliharris··on Python Number Conversion Chart
Sure, I'm glad you like it! :)

str2num parses words by iterating through them once and keeping state about the result so far and what I call the "magnitude". So, for example, when you feed it "three and three thirds", it initializes magnitude and result to zero, chomps the first "three", and then sets magnitude = 3.

If the next word were "million", then it would know that magnitude refers to million, and so it would multiply 3 by 1 million. But the next word is "and", which flushes the magnitude to result, (ie, result += magnitude), and resets the magnitude to zero.

The next word is "three", which, as before, sets magnitude to three. Then the next word is "thirds", so you know that magnitude refers to "thirds", and so you multiply the magnitude by Fraction(1, 3) and add it to result.

  >>> str2num("three and three thirds")
  Fraction(4, 1)
The source for this is here: https://github.com/naftaliharris/numutil/blob/master/numutil...
naftaliharris··on Python Number Conversion Chart
And for people who want to convert user entered numbers, like "3.2 million", into strings, I wrote a package especially for that: https://github.com/naftaliharris/numutil

    >>> from numutil import str2num, num2str
    >>> str2num('1.3 million')
    1300000
    >>> str2num('three and a half')
    Fraction(7, 2)
    >>> str2num('123,456.789')
    123456.789
    >>> num2str(1234567, style='newspaper')
    '1.23 million'
    >>> num2str(1234567, style='words')
    'one million, two hundred thirty four thousand, five hundred sixty seven'
naftaliharris··on World’s top supercomputer from ‘09 is now obsolete, will be dismantled
Something about these numbers doesn't quite make sense. The reason cited for dismantling the machine is that "it isn't energy-efficient enough to make the power bill worth it." But the supercomputer uses 2345 kilowatts, which at US prices of around 15 cents per kWh would cost $352 / hour to run in energy costs. By comparison, the $120 million cost of building roadrunner, amortized over the four years it's been running, comes out to $3400 / hour. The article makes it sound like the power bill is costing them a fortune, at $3 million a year, it isn't that much at all next to the $120 million price tag.
naftaliharris··on Remapping Caps Lock on OS X Mountain Lion
My caps-lock gets mapped to escape. On linux, or at least the flavors I'm using, this is super easy: Just drop the following into ~/.Xmodmap

    !! Delete the caps lock key
    clear lock
    !! Make caps lock map to <esc>
    keycode 0x42 = Escape
naftaliharris··on The Summly deal makes no sense
But at only 1 million downloads, they've paid $30 per download. If they were mostly interested in the traction, that would seem quite excessive to me.
naftaliharris··on Fernando Pérez of IPython fame wins the Free Software Foundation Award
I heard him speak at Stanford a few weeks ago. He made some great points about academia having a lot to learn from the open-source community. In summary, he said that academics should strive to make their research more open and reproducible, and that version control tools like git and presentation tools like IPython can help make that happen.

The talk was broadly similar to the slides I found here: http://www.stanford.edu/~vcs/AAAS2011/1102_aaas_reproducibil...

If Fernando is able to convince academics to foster the same sort of culture that the open-source community has, his influence would be very great indeed.

naftaliharris··on 6÷2(1+2)=?
> In the real world of mathematics, this is as stupid a question as me asking “Is there a mathematical size bigger than the amount of integers but less than the amount of real numbers?” [1] because you can’t answer it without going through a lot of trouble to specify the “axioms” (basic assumed rules for doing mathematics) you want used on the problem.

I don't think this analogy holds very well--a curious student could reasonably and earnestly ask about the continuum hypothesis, since it's not at all obvious from first principles that the answer depends so heavily on obscure set axioms. On the other hand, the order of operations question seems to have been designed to confuse people and stir up meaningless, unresolvable arguments over PEMDAS.

naftaliharris··on We searched for Porn. We found you
Those were my thoughts too. If you click on the "paintings" tab, they only show you three of them, (not the 100,000 claimed), and it looks like they dressed them up manually.

Also, by paying them 10 Euro to search for your phone number, you've already self-identified as a sucker, so the unscrupulous people running this site will I'm sure be happy to take advantage of that.

naftaliharris··on Python.org Redesign Preview
It looks a lot better than the current site! A few criticisms:

1) The line numbers and spacings on the list example are confusing: The examples come from an interactive session, but the presence of line numbers suggest that it's a script. Also the spacing is inconsistent with what you'd get if you typed that into the standard python shell.

2) I think the drop down menus from the top of the page are much bigger and obtrusive than they need to be. When I opened the page, my mouse went over the "Success Stories" tab, and I saw a big white "Google" logo in the middle of the page. The eye is naturally drawn to it, and I spent a second or two like, "What is that doing there?" until I figured it out.

3) Maybe I would have a slideshow or "arrow-buttons" with more python examples than just the list. Basic usage of a list doesn't sell python as hard as, say, list comprehensions, arbitrarily large integers, and/or manipulating sets.

naftaliharris··on Startups Anonymous
> "sometimes, a coffee can mean the world."

It's true--I can definitely still remember small but sincere acts of kindness that I've received from friends or acquaintances over the years. Seriously, the $8 it costs to buy some overpriced coffee and the value of a half hour of your time are repaid many times over by the gratitude the other person feels and the good you'll have done for their life.

naftaliharris··on Google removes AdBlock for Android from Google Play
I imagine that Google, Facebook, and other companies that make much of their money from online ads must be pretty scared that this huge revenue stream depends on the general public not taking the two minutes that are required to install an adblocker. I mean, if adblockers really caught on, these companies would lose tons of revenue.

Perhaps the key thing is that people who are most bothered by ads are the ones who never click on them and then install adblockers, so that the loss of these users does not represent much revenue loss.

naftaliharris··on How to Hire More Women at Your Startup
If I were running a company, I think I'd try the following approach to hiring: Every time I received a resume or job application, I would run it through some script that would find the individual's name, store it somewhere hidden, and then replace it with a unique id. Only after the applicants' names were blocked out like this would I read through the resumes or job applications.

I think not knowing a person's name would prevent some of our unconscious biases about the person's gender or race from entering into the early-stage hiring process, and promote a culture of meritocracy. Of course, this only works until you give somebody a phone screen or invite them in for an interview, but it's a step towards a more meritocratic hiring process.

naftaliharris··on GitHub is getting DDoSed again
Reading status.github.com over the last few weeks, I found it interesting how often little things were broken at Github. It's like every few days, a small part of the site is unavailable or the sysadmins are investigating this or that connectivity issue. I guess when you're as big as Github, keeping your site live and operational is completely nontrivial.
naftaliharris··on Eric Holder sends a follow-up letter to Rand Paul [pdf]
I've long been curious about this: In the Civil War, the United States killed hundreds of thousands of Confederate soldiers, (without a trial, of course). Yet the fifth amendment explicitly states that "No person shall be ...deprived of life, liberty, or property, without due process of law;"

Does anybody know how the Lincoln administration justified the use of deadly force during the Civil War? Presumably this would be a reasonable precedent to look at when determining the legality of killing American citizens without a trial.

naftaliharris··on The babies who nap in sub-zero temperatures
What I found most interesting about this article is that parents felt so strongly about having their kids nap outside, despite the fact that the scientific evidence presented in the article that this is actually better than napping indoors is mixed at best.

The article cites a survey of parents who say their kids nap better outdoors, (with a broken link), but surveys are far less convincing than experiments. In this case, parents should not use this survey as a reason to have their kids nap outside, because the survey is just a reflection of their own opinions. Following it would be like eating their own dog food.

As for more scientific evidence, according to the article "Paediatrician Margareta Blennow says reports from the Swedish Environmental protection agency show conflicting results."

So from the article, it doesn't appear that there is substantial scientific evidence that sleeping outdoors is any better for the children. Why do parents continue to do so anyway? I think it's just a cultural thing. I think many cultures have basically random opinions along the lines of "Doing X is better for your health". As long as X isn't actually very bad for you, people will continue to do X despite the lack of evidence that it's actually good for you.

← PreviousPage 2 of 3Next →