HNHacker News
TopNewBestAskShowJobs

dnaquin

517 karma · joined November 28, 2007

Devin Naquin

Software Engineer & Engineering Manager, Facebook 2010-2015 Software Engineer, Disqus 2008-2009

devin@naqu.in

http://devin.naqu.in

submissionscomments
dnaquin··on Is 0 Odd or Even?
Gotta pick what you're defining and what you're deriving.
dnaquin··on Common Usability Mistakes
but regardless of whether the username is a correct one or not (in the database) - it should still persist in the UI.
dnaquin··on Ask HN: What do you do on weekend?
watch football.
dnaquin··on Why MIT now uses python instead of scheme for its undergraduate CS program
i didn't appreciate it to it's fullest at the time, but when i reread SICP and it seemed like a review, i was grateful for that semester.

even though i program python on a daily basis now, this is saddening.

dnaquin··on Eval() Isn't Quite Pure Evil
Is it just me or does the closure version read more clearly?
dnaquin··on College, all you can learn, $99/month
Sure Artin's Algebra has a prominent place on my bookshelf. That class was by no means called "College Algebra".
dnaquin··on College, all you can learn, $99/month
"College Algebra" always seemed like an oxymoron to me.
dnaquin··on A design pattern is an artifact of a missing feature in your chosen language
I can write methods that take blocks.

Sure I can do the same thing in python, but I either have to write a lambda that limits me to a single line or write a one-off named method. The latter being much less clear than do ... end.

dnaquin··on A design pattern is an artifact of a missing feature in your chosen language
One of the things I'm really liking about ruby during my python to ruby conversion is that it handles the visitor pattern for me.

Half the Java code I ever wrote was probably visitor pattern cruft. Ruby largely just handles it all for me.

dnaquin··on Twitter Exploit Still Works
Congratulations, you've just stopped one particular attack.

There'll be something you forget. Blacklisting is only a good idea if whitelisting isn't possible. (see the \w above)

eg. You forgot. javascript:alert(document.cookie) Which depends on click and in and of itself isn't dangerous but a symptom of a greater problem.

edit: except you need to allow more than \w.

dnaquin··on Twitter Exploit Still Works
PSA. Escaping html only helps if you're allowing user-generated text outside of any tag.

If you're allowing user-generated text into a html tag (ie. this case.) Escaping html tags won't help.

dnaquin··on Dropping Django
I really should start making a list of things horribly broken in Django. By design.

I write off and hack around problems almost daily.

dnaquin··on MongoDB 0.9.9 Released
I'm using it in production for a large bayesian filter. Amongst other things. Works great.
dnaquin··on What is so wrong with thinking of real numbers as infinite decimals?
The bottom line is. There are numerous, equivalent ways of defining the real numbers and each have the advantages and disadvantages in understanding. Any good introduction to analysis class will do a definition several times and prove equivalence.

Infinite decimals in particular bring up the equality problem. If you're willing to think of the real numbers as ONLY infinite decimals, you avoid this confusion. But it's silly to always write .999... instead of 1.

dnaquin··on Your World of Text, my current side project. Requires FF3+ or Safari 4, I think.
Cool buddy.
dnaquin··on Point nine recurring ...
power series.

0.999... = sigma 9/10^n n=1 -> inf = 9 * sigma 1/10^n n=1 -> inf = 9 * ((sigma 1/10^n n=0 -> inf) - 1) =

power series sigma 1/10^n n=0 -> inf = 1/(1-1/10)

= 9 * (1/(1-1/10) - 1) = 1

qed.

dnaquin··on Sphinx 0.9.9-rc2 is out
Sure. We're using it for a couple things.

It scales relatively well, though I wish we were getting sub-minute indexing, I'm pretty pleased with the 45 minute timespan we're seeing on a pretty large dataset.

Responses are quick, though I'm having a some problems with memory usage on my MBP, I've mostly fixed that with careful configuration.

Biggest problem is that django-sphinx is a piece of trash. I had to hack together a custom wrapper that we might consider open sourcing at some point.

dnaquin··on Are Tweets Copyrighted ?
http://twitter.com/devinjames/status/1420799605
dnaquin··on JavaScript Testing Does Not Scale
Doh, yes Selenium Grid uses Selenium. And the argument about no major JS using Selenium is not an argument to not use it.

Selenium is the flakiest test framework I've ever used.

Though, my solution would use the best of both worlds. jsunit tests fired off by Selenium on a grid.

dnaquin··on TheSixtyOne (YC W09) Is Building a Digg For Indie Music
Long time artist user of TheSixtyOne.

It has seriously driven more people to my music than anything else has. Granted, I don't play the myspace 'thanks for the add' game.

http://www.thesixtyone.com/devin/

dnaquin··on Becoming a Great Programmer: Use Your Trash Can
Seldom a good idea. And faulty in so many ways. eg.

It's long been a tenet at the Schindler bitranch that when you find a block of code with several bugs, it's time to dump the whole file and write it again from scratch. It's faster than trying to squash all the bugs in your bug factory.

So now you've traded bugs you know about for bugs you know nothing about.

The real key isn't rewriting, it's refactoring. And in my opinion, should be done almost continually.

dnaquin··on The most surprising thing I've seen in 2009, courtesy of Etherpad
Cute use of a Lisp comment as a temporary placeholder towards the end.
dnaquin··on Python Is Not Java

  jeff:disqus devin$ wc settings.py settings.xml
       1      15     142 settings.py
      16      19     461 settings.xml
      17      34     603 total
30% of the words. and, in my opinion, just as readable if not more.
dnaquin··on Python Is Not Java
well. it's mutable. your code can change it. don't do it (often). then you're just programming with lots of global state.
dnaquin··on A Lottery for People Who Are Good at Math
Absolutely. But even then, it's a good bet at some point.

That's the exact example I'm thinking of when I say avoid 12345, geometric progressions, etc. I believe that example was a simple pattern.

dnaquin··on Python Is Not Java
config.py:

  backup = [{
        'name': '/media/programming',
        'exclude': ['log_files', 'temp_files'],
    }, {
        'name': '/media/documents',
        'exclude': ['archive'],
    }]
of the top of my head.

*editted for formatting

dnaquin··on A Lottery for People Who Are Good at Math
Actually. Most lotteries become good bets when the jackpots get large enough. Assuming you don't split a pot with someone else, of course.

Avoid 12345, geometric progressions, etc.

dnaquin··on Rice professor sees probabilistic method revolutionizing computing
You're going to have trouble getting mathematicians interested in just a hunch. Earlier, you used the phrase: "I have a result which shows..." Which, in maths parlance, that would imply you have a proof. Which, if correct, would be rather interesting.

Though, without a proof, it's uninteresting. It's probably not true.

dnaquin··on Rice professor sees probabilistic method revolutionizing computing
"Let C(n) denote the number of Carmichael numbers less than n. ... The upper bound C(n)<n*exp(-(lnnlnlnlnn)/(lnlnn)) (4) has also been proved (R. G. E. Pinch)."

So that ratio isn't constant.

Key is "...of very large numbers...". Clearly larger than 100,000,000.

dnaquin··on Rice professor sees probabilistic method revolutionizing computing
“Numbers that fool the Fermat test are called Carmichael numbers, and little is known about them other than that they are extremely rare. There are 255 Carmichael numbers below 100,000,000. The smallest few are 561, 1105, 1729, 2465, 2821, and 6601. In testing primality of very large numbers chosen at random, the chance of stumbling upon a value that fools the Fermat test is less than the chance that cosmic radiation will cause the computer to make an error in carrying out a “correct” algorithm. Considering an algorithm to be inadequate for the first reason but not for the second illustrates the differences between mathematics and engineering.” footnote pg. 53 SICP
← PreviousPage 2 of 5Next →