517 karma · joined November 28, 2007
Software Engineer & Engineering Manager, Facebook 2010-2015 Software Engineer, Disqus 2008-2009
devin@naqu.in
http://devin.naqu.in
even though i program python on a daily basis now, this is saddening.
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.
Half the Java code I ever wrote was probably visitor pattern cruft. Ruby largely just handles it all for me.
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.
If you're allowing user-generated text into a html tag (ie. this case.) Escaping html tags won't help.
I write off and hack around problems almost daily.
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.
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.
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.
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.
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.
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.
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.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.
backup = [{
'name': '/media/programming',
'exclude': ['log_files', 'temp_files'],
}, {
'name': '/media/documents',
'exclude': ['archive'],
}]
of the top of my head.*editted for formatting
Avoid 12345, geometric progressions, etc.
Though, without a proof, it's uninteresting. It's probably not true.
So that ratio isn't constant.
Key is "...of very large numbers...". Clearly larger than 100,000,000.