Links
Work & Stuff
Family
Friends
DorkSpaceBookr
Contact
|
Stuff You Might Want to Read
If you have a database of zipcodes and their latitudes and longitudes, you can use a version of this query to get the geographically closest zipcodes:
SELECT b.zipcode, b.city, b.state, b.latitude, b.longitude, ACOS(SIN(RADIANS(a.latitude)) * SIN(RADIANS(b.latitude)) + [...] I’m mostly a Perl guy (with secret love of Javascript), so I try to stay out of the Python stuff at dayjob where possible. But recently I’ve been taking the lead on a bunch of Memcached optimizations, which are starting to trickle over into the Python side.
A nice feature of the Perl Cache::Memcached module is [...] Yesterday at work someone was trying to pass traditional Apache SSI directives through an XSL transformation on a Google search appliance. Long story short, they vanished: HTML comments don’t make it out of that device.
Anyway…I had a simple solution. Since we were pumping the Google results through a Perl CGI anyway, there was no reason [...] mod_perl 2 has an annoying…feature. Because the system environ struct is not thread safe, mod_perl’s perl-script handler unties the %ENV hash from the actual environment. That means, anything that uses the C getenv/setenv/unsetenv functions to read the environment will not see changes that were made to %ENV.
An obvious example is Perl’s localtime function. It actually [...] I’ve been using Memcached for a few weeks, trying to offload some VERY heavy database load. It’s nice and blazing fast, but the implementation is sort of clunky. If I have this simple bit of code:
$key = "foobar";
$val = calculate_val($key);
It turns into this:
$key = "foobar";
$val = $memd->get($key);
if(! defined($val)) { $val = calculate_val($key); $memd->set($key, [...] Don't worry China...this is just to protect people. We're not going to shoot down your satellites. We could. But we won't. Honest. Sort of sappy (particularly with the soundtrack), but as a parent, it rings true. Beware, believers in this: http://tinyurl.com/2f8gld "If you think you can do better, why ain'cha rich?" |
|