rc3.org

Strong opinions, weakly held

Month: June 2005 (page 5 of 7)

I don’t want to hear it

The next time someone tells me about George W Bush’s grand vision of liberty for all people, they can save it. Anyone can make that argument as a post hoc justification for a war we started based on a big old lie or to berate countries that are already our “enemies” (hello, Syria). Standing by your principles when it might cost you something is the mark of character and commitment.

Nobody with a good car needs to be justified

Another pebble has dropped into the pond. Wonder if this one will cause any ripples?

And on another note, Billmon has done some initial legwork on what could be a major story — the Pentagon shovelling dollars toward Republican political consultants to work on propaganda projects in Iraq.

Managing controversy

John Udell has an interesting post on how Wikipedia managing articles that tend to be edited by partisans on both sides.

The trouble with PHP

Dave Megginson has a provocative post where he explains why he prefers PHP to Ruby on Rails. Here’s the case he makes in favor of PHP:

<

blockquote> After all that soul-searching, prototyping an app in PHP was like a cool breeze on a hot day. I wrote a few helper functions to automate escaping values to avoid SQL or HTML insertion attacks, but I managed to fight off the temptation to write a persistence layer in PHP. Instead, each page has some PHP code at the top that makes one or more SQL queries, followed by HTML markup with only minimal PHP added to insert dynamic results. It works, it actually seems scalable and maintainable, it

The good old days of NMD

I remember a few years ago when one of the things that frustrated me most about our government was its obsession with backing out of the Anti-Ballistic Missile Treaty and wasting billions of dollars on missile defense. Anyway, the blog ArmsControlWonk.com has obtained a copy of the final report issued by Missile Defense Agency’s Independent Review Team. In it, they actually recommend testing the system less in the future because repeated failures reduce the system’s deterrent effect. At this point we would have done just as well to have bought an inflatable missile defense system and just told everyone that we had tested it extensively in secret.

Concurrency ahead

Tim Bray has an interesting post arguing that multicore chips that work best with applications that can operate in multiple threads are the most likely vector for massive performance gains on the CPU side in the future, and that concurrency is something we’re all going to need to worry more about before too long.

Improving MySQL performance on case-insensitve searches

Let’s say you have a database that contains some strings that you want to search, like last names. This table accepts data entered via the Web, so someone might enter their last name as ‘smith’ or ‘Smith’ or ‘SMITH’ or even ‘smitH’. There’s no way to tell. When people search for the last name, they might do exactly the same thing. Bottom line — you need to do a case-insensitive search. In every application I’ve ever written, I’ve written the query like this:

SELECT last_name FROM people WHERE UPPER(last_name) = UPPER('smith')

With MySQL, and most other databases, using UPPER() on a column prevents the database from using indexes, so even if last_name is indexed, in this case the database will do a slow full table scan. What I learned this morning is that LIKE, by default, is case-insensitive. While I generally associate LIKE with ignoring indexes, if the expression doesn’t begin with %, MySQL will use an index if it’s available. So I rewrote the query above like this:

SELECT last_name FROM people WHERE last_name LIKE 'smith'

Now I get to take advantage of the index on last_name. (The query went from running in 11 seconds to .06 seconds.)

Taking it slow

Is there anything more nerve wracking than running a database operation that you expect might be slow and that blocks all other access to the database until it’s complete, particularly when the database in question is in production? In this case, the command was alter table my_big_table type = innodb. I guess the good news is you only ever have to do it once.

The state of the union

Hilzoy at Obsidian Wiings has written her own state of the union address, and it ought to be a must read for every American. Seriously.

Outsourcing’s not all it’s cracked up to be

CIO magazine’s blog notes a report from Deloitte pointing out that the results of outsourcing are a mixed bag. I still think that the number one reason behind the mass adoption of outsourcing is lack of good relations between corporations and their IT departments. If IT is crappy to work with, the rest of the company has an incentive to try to save a buck by farming the work out to someone who has to be nice to you if they want to keep your business.

Older posts Newer posts

© 2024 rc3.org

Theme by Anders NorenUp ↑