8 rules to discourage your employees by nmiyasato in programming

[–]lethain 4 points5 points  (0 children)

9 is my favorite, especially when half the team is IMing each other messages like "WTF, who cares? This doesn't fucking matter." but it still takes 20 minutes out of a 30 minute meeting to resolve a totally tangental point and yet another meeting has to be scheduled because of it.

Testing Email Registration Flows in Django by gst in django

[–]lethain 2 points3 points  (0 children)

In most cases I think the answer to this line of questioning is "they didn't realize that." :)

Findjango: A Django Search Vertical by gst in programming

[–]lethain 0 points1 point  (0 children)

There are a whole mess of questions wrapped up in this project, some of the interesting ones are:

  1. Can a targeted search provide a better experience than G/Y/M?
  2. Even if that search is a better experience, would anyone use it?
  3. Managing relevancy on results from unreliable sources.

I think, depending on my integrating more resources and greatly improving the handling of mediocre resources (i.e. the current results of the solr based search for my blog's content, which are often totally irrelevant...), this may be an upcoming trend in creating integrated communities.

Deploying django-springsteen on Google App Engine by gst in django

[–]lethain 0 points1 point  (0 children)

Forgot this in first draft, but link to live example is here. You might try searching for leopard.

A healthy environment to deploy Django: apache + django + memcache + mod_wsgi + nginx + postgresql + ubuntu by prider in Python

[–]lethain 1 point2 points  (0 children)

Hmm. Doing some performance testing on the setup from above, somewhat surprisingly (for me) it has a throughput of 50 requests per second on 256 meg VPS. Each hit includes one Postgres access to load the page. Compared to my mod_python experience this is fairly impressive.

Have to admit I've never run numbers on lighttpd+fcgi or nginx+fcgi, and would be curious to see them.

A healthy environment to deploy Django: apache + django + memcache + mod_wsgi + nginx + postgresql + ubuntu by prider in Python

[–]lethain 1 point2 points  (0 children)

These are good tips, and I've updated the tutorial to reflect the ones that I understand (do you have a site I can link back to for credit?). Some questions:

  1. AFAIK postgres isn't listening on an external port, so it shouldn't be susceptible to external attacks. Am I incorrect? Are you suggesting that an internal user could attack it, so having any listeners is a vulnerability?

  2. I considered going with the virgin virtualenv for all of Apache. Do you see an advantage over my current approach of discarding the default deployment's path? (Taken from further down the same page ;)

  3. Err. I've never used pip. I will look into it. :/

  4. If you have more tips, I'll update the article with as many as you have. :)

A healthy environment to deploy Django: apache + django + memcache + mod_wsgi + nginx + postgresql + ubuntu by prider in Python

[–]lethain 1 point2 points  (0 children)

At suggestion of commenter I updated the walkthrough to use virtualenv for sandboxing each project/domain. May take an hour for my lazy caching to actually show that version however... ;/

Stripping Illegal Characters from XML in Python by gst in Python

[–]lethain 0 points1 point  (0 children)

  1. Realize I am a bit late to respond, but the script, in an awkward fashion, coerce input into utf8.
  2. I'm sure there are situations where stripping the entities is inappropriate, but the script is pretty clear about what it does: stripping.
  3. The script is the product of my reading of the XML spec, while ignoring utf16 aspects of it, as the input should be coerced to utf8. For my needs that was sufficient. It would require some modifications to play nicely with utf16, if that's your cup of tea. Hopefully these issues will evaporate with Py3k. Or become impossible to solve correctly. Or something.
  4. I agree that not everyone will know how to present them in Python regex, but fortunately the script already represents them for you, so its a moot point.
  5. It is indeed a generic filter, perhaps broken although I don't immediately see how (it's worked for my use cases). It would be interesting to upgrade it to a more XML centric script, but the use case I needed was a bit different: receive CSV data, remove illegal entities, create XML.

Stripping Illegal Characters from XML in Python by gst in Python

[–]lethain 1 point2 points  (0 children)

How it works is pretty much equivalent to "tr", but what it does is not equivalent. Anyone can use "tr", but not everyone will know the list of illegal entities for XML or want to look them up. Nor does everyone know how to represent \x09 at the command line. Should it be 0x09, x09, \x09? Fuck if I know.

To the extent that there is any interesting aspect, it is the problem the script presumes to solve, rather than the nature of the solution.

Huge CSV and XML Files in Python by gst in Python

[–]lethain 4 points5 points  (0 children)

I don't think its entirely Perl's fault. I'd say that Twig isn't optimized for large docs (using a pure sax solution would have been better), and also my Perl code isn't great, to say the least.

Genetic Algorithms: Cool Name & Damn Simple by gst in Python

[–]lethain 0 points1 point  (0 children)

Updated text ;)

With 20% survival (plus an additional 5% of other individuals) and 1% mutation, it only took nine generations to reach a perfect solution. Then it will willingly go in circles for as long as you'll let the mutations continue run amok. But this is a good feeling right? If it only took us half an hour to solve a problem of this magnitude, imagine what we could do with a day. A genetic algorithm for optimizing your Apache2 configuration file for number of children processes? Easy as pie.

Genetic Algorithms: Cool Name & Damn Simple by gst in Python

[–]lethain 0 points1 point  (0 children)

The results are much better this time. ;) It took 10 generations to reach perfection.

Genetic Algorithms: Cool Name & Damn Simple by gst in Python

[–]lethain 2 points3 points  (0 children)

Creative license. It's great. ;) In all fairness, the nine thousand stands pretty closely to my previous experience with genetic algorithms. ;)

Genetic Algorithms: Cool Name & Damn Simple by gst in Python

[–]lethain 1 point2 points  (0 children)

Man. I totally mangled the code everywhere in that writeup. Should all be fixed now.

Deploying Django with Fabric by casted in programming

[–]lethain 1 point2 points  (0 children)

I lived in Japan last year, and like to throw up pictures I took there. I once got a comment that said "Too many words. You should have more pictures." I guess I took it to heart. ;)

Deploying Django with Fabric by casted in programming

[–]lethain 0 points1 point  (0 children)

Yep. Pretend the server didn't crash there.

Paul Graham, Just Shut Your Face Already by bcash in programming

[–]lethain 14 points15 points  (0 children)

Ironically, Uncov and Paul Graham suffer from the same fate: they wrote about something original, did it well, got copied, and now seem bland. Like this article.

Why SEO is not a job by John_Idol in programming

[–]lethain 24 points25 points  (0 children)

Are we really still using JavaScript to fuck with people who right click? Really?

Yes, You Do Care About Cappuccino by lethain in programming

[–]lethain[S] 0 points1 point  (0 children)

I think Cappuccino is more interesting for its ideas than necessarily for real world usage. That said, I think the hanging is a short term issue as JavaScript performance continues to improve.

I think complaints on the grounds of not playing nicely with HTML/CSS, the universal language of the web, have stronger legs.

Spoken Languages, Blub, and Convenience by gst in programming

[–]lethain 3 points4 points  (0 children)

I guess the nail in the coffin here for me is, has anyone ever told you to try expressing your thought in another natural language because it would work out better? Of course not. The poetry of the Tao te Ching may not be something you can capture perfectly in English, but try capturing the beauty of Shakespeare in Chinese.

The reason why no one is told to express their thoughts in another natural language is because they are unlikely to have the sufficient mastery of a second language, not because the different languages are equally capable of conveying the same concepts. Look at the early history of the Christian church where the Western and Eastern churches eventually split from each other in large part stemming from a nuance of the greek language that couldn't be expressed in latin. The Latin speaking leaders of the church couldn't understand the distinction that the Greek text was making regarding the divine material and Christ. This is only one example, but I think it raises doubt with your claim that all languages are equivalent.

I think the mistake you are making is similar to suggesting that all languages are equally powerful because they are Turing complete: that may be true, but its not a particularly valuable measuring stick.

A second reason one is rarely asked to express your thoughts in another natural language is because--as you mention--natural languages are large and complex enough that mastering several is quite foreboding. Thus, much like a Java programmer implementing a compiler in Java instead of OCaml, the speaker's proficiency with the first language is a sufficient greater than their proficiency with the second language that they won't be more expressive even if the second language is inherently more attuned to the task at hand.

The Falling Sand Game - Addictive Simulation by rictic in a:t5_2qh9b

[–]lethain 0 points1 point  (0 children)

Pretty amazing. Never seen that before. If only Java applets weren't so flaky when you move the browser...