Simon Willison’s Weblog

Subscribe

Entries in Oct, 2010

Filters: Type: entry × Year: 2010 × Month: Oct × Sorted by date


If I have data that loads using  json / JavaScript will it get indexed by Google?

No. Personally I dislike sites with content that is only accessible through JavaScript, but if you absolutely insist on doing this you should look in to implementing the Google Ajax Crawling mechanism: http://code.google.com/web/ajaxc...

[... 56 words]

What are people’s experiences using Memcached?

That it’s so obviously a good idea (and works so well) that you’d be crazy not to use it. As far as I’m concerned, it’s part of the default stack for any web application.

[... 46 words]

Is there a good online calendar for upcoming technology conferences?

We’re trying to build exactly this with http://lanyrd.com/—not just for technology conferences, but they are definitely our largest niche.

[... 208 words]

What is the best JS library for automated cropping?

Not entirely clear what you’re looking for, but if you mean a UI tool for letting people resize and crop an image Jcrop is really nice http://deepliquid.com/content/Jc...

[... 43 words]

Is there a blog that covers open source Python projects?

No, but I wish there was.

[... 29 words]

What is the best way to integrate MongoDB with Django?

Personally, I just “import pymongo” and start calling the regular Python API—no need for any special treatment to get it working with Django.

[... 41 words]

What are all the advantages of jQuery?

jQuery’s API is astonishingly well designed. It’s extremely consistent once you learn its rules (e.g. methods often take one argument to read a value and two arguments to set one, e.g. .css(), .attr(), .width(), .height()) and its functionality is so complete that the last few major releases of the library have hardly added any new methods at all.

[... 166 words]

Why does Python load imported modules separately for different files, unlike C or PHP? Isn’t that inefficient in terms of memory usage?

It doesn’t—you’re misunderstanding how Python’s module system works. If two different places have “import os” in them, the os module is only imported and executed once—it’s cached in the sys.modules dictionary so you can see it happen if you want to. The key thing to understand is that “import os” attaches the os module to the “os” symbol within the current file’s scope, loading it only if it hasn’t been loaded already.

[... 104 words]

What is the best lightweight jQuery tooltip plugin? Why?

Last time I went looking, I was very impressed by qTip: http://craigsworks.com/projects/...

[... 28 words]

What is the story of Advogato?

There’s a Google Tech Talk about Advogato: http://video.google.com/videopla...

[... 21 words]

What’s a good book about basic usage techniques and patterns in Python? (a la Effective Java/C++)

Dive into Python 3 is well worth a look: http://diveintopython3.org/

[... 48 words]

What are some of your favorite complicated diagrams?

This one’s pretty nuts:

[... 25 words]

Is it a good idea for new start-up to outsource Software/App Development?

It depends on what you mean by “outsourcing”.

[... 130 words]

What is the best Mac OS X text editor for a web developer? And what makes it great?

It’s still TextMate for me. It gets the basics right—syntax highlighting, sensible indentation, a good project pane (I use “mate ~/Development/my-project” at the terminal to open TextMate with my entire folder hierarchy), solid extensions and good unix integration (Filter selection through command).

[... 77 words]

What are the best APIs for creating location-based Wikipedia mashups?

GeoNames has a fantastic API for finding Wikipedia articles near a specific latitude/longitude pair:

[... 32 words]

What is the best way to maintain a API wrapper class across multiple languages?

1. Use JSON for your API. That takes away a lot of the necessity for an API wrapper, since it means you’re automatically returning native data types (hashes, lists, strings etc) for most programming languages.

[... 175 words]

What does an ideal Django workflow setup look like?

Short answer: virtualenv, pip, south for migrations, fabric for deployment.

[... 57 words]

Is it possible to make API calls without cURL installed?

Yes:

[... 26 words]

What is the best way to hire Solr developers?

Do you really need to hire a Solr specialist? It shouldn’t take a competent developer more than a few days to get familiar with Solr—the HTTP API is extremely easy to work with in my experience. You can always hire in a consultant from one of the companies that provide commercial Solr support for a few days to help your developers get up to scratch.

[... 82 words]

Why do some websites implement their logout link as a form post via JavaScript versus a plain old GET request?

Probably because if you implement logout as a GET action, I can force you to log out of a site by tricking you in to visiting a page with an <img src="http://yoursite.com/logout/" width="1" height="1"> element on it.

[... 64 words]

Did you mean rel=shortlink vs. rel=shorturl?

That was the cute trick in the initial proposal: it’s REV=canonical, not REL=canonical, suggesting a reverse relationship.

[... 29 words]

What are the main weaknesses of Java as a programming language?

A cultural bias towards over-engineering. In my experience Java code often ends up a huge network of Factories and AbstractFactories and Visitors and XML configuration files and every design pattern you care to mention, dozens of classes many of which contain hardly any procedural code at all. A lot of Java projects are essentially impossible to navigate without an IDE.

[... 77 words]

Is there any consensus yet on link rel=shorturl vs rev=canonical?

It’s pretty clear from the answers that rev=canonical v.s. rel=canonical is way too confusing—so it’s down to rel=shortlink v.s. rel=shorturl.

[... 38 words]

What are the main weaknesses of Ruby as a programming language?

Ruby still has a cultural tendency towards monkey-patching, aka action-at-a-distance. There are plenty of gems which modify existing classes—sometimes in ways that can break working code.

[... 45 words]

What are the best websites for finding out about events in San Francisco in advance, i.e., before they take place?

PlanCast is your best bet for general events, but if you’re interested in conferences we have a growing list on http://lanyrd.com/places/san-fra...

[... 48 words]

Twitter.com 2010 Redesign: What things don’t people like about #newTwitter?

I absolutely love the improved functionality, but I don’t like the way it’s implemented as a heavy single-page JavaScript application. It’s extremely slow to load, which is a big problem for me because I habitually open new tabs with e.g. twitter.com/username in them, and each of those tabs now takes far longer to load and show me information than old Twitter did (especially since I’ve been suffering on very slow hotel WiFi connections recently).

[... 133 words]

Who is the most recognizable person in the world (real or fictional; alive or dead)?

I’d guess Jesus, then Ronald McDonald, then Mickey Mouse.

[... 30 words]

Why is software effort estimation still based on thumb rules and gut feels? How come no one has come up with an accurate estimation model?

For a truly accurate estimation, you need to have built the software before. If you’ve built it before, why are you building it again?

[... 55 words]

Simon Willison: How do you configure the Apache server you describe in What are the advantages of running Apache behind nginx as opposed to just Apache by itself?

It took me a while to figure out the single threaded bit (Andrew Godwin helped me sort that out)—on an Ubuntu system, you need to run “apt-get install -y apache2-mpm-prefork” to ensure you’re running the prefork Apache MPM.

[... 82 words]

To what extent is it still valid to assume that your web app users are stupid?

They’re not stupid, but they’re probably WAY less web literate than you might expect—unlike you, they haven’t spent their entire career learning how the web works. See the famous “What is a browser?” video the Google Chrome team released:

[... 71 words]