Fight the Smears

The last paper I ever wrote in college was for my Power and Propaganda course, and addressed the propaganda being hurled against Obama. One thing I addressed was that many of the criticisms of him were blatant lies. It’d be like if I started posting here that John McCain said, “Thank God for the Nazis!” and President Bush met with McCain and used “the N-word” to refer to Obama. Total fabrications as part of a smear campaign.

The problem is that they work. I’m going from memory, but if memory serves me correctly, 13% of people in a recent poll said that they thought Obama was a Muslim. Soon it was being reported that he was sworn in on the Qu’ran, too. Of course, the Muslim rumors would soon be contradicted by trying to label him racist because his pastor said some crazy things, and the fact that he was sworn in on the Qu’ran would be refuted by photographs showing him with his hand on the Bible when being sworn in.

Obama Singing the National AnthemThere was also the big row over the photograph of him “refusing to say the pledge,” with some versions of the chain letter or website alleging that he refuses to do it for religion reasons; one even said that he didn’t know the words. In actuality, Obama was singing the national anthem, as a video of the event shows.

There’s another one about him hiding his birth certificate because he’s not actually a citizen. (If you want to get technical, John McCain is the one who wasn’t born in the US… Though it’d be asinine to argue that he’s not a US citizen because he was born on a US military base.)

The Obama campaign has finally launched Fight the Smears, a page refuting the utter falsehoods against him. The latest one seems to be alleging a videotape of Michelle Obama using the word “whitey.” Frankly, I could see this being done in a non-racist manner, but it’s a moot point, because none of the reputable sources claiming to have seen / possessing the tape have released it, and because one person has some pointed allegations of exactly where the tape was filmed, most of which seem fabricated.

It’s totally cool with me if you’d prefer to vote for McCain. (Well, I’d still disagree, but I’d at least respect that you had a rational difference of opinion.) Obama isn’t a Muslim, terrorist, or unpatriotic. John McCain isn’t a rapist and he doesn’t eat babies for breakfast. In a time when the truth is so sorely missing, can we please try to stick to reality this election?

On Religion

Today’s Cold Case Files included a bit with a guy who described himself as a devout member of the “religious right.” A poor man, a comparatively wealthy farmer let him stay in his home. The poor, religious person decided that the farmer was mean and shot him in the back of the back of a head with a rifle.

He then disposed of the body, and neighbors approached him to ask what was going on. He fled–taking his Bible with him. He actually hid very well, and was found decades later. Officers said that it was hard to get him to talk about anything other than the saving power of Jesus Christ. He eventually confessed, saying that he felt no remorse for the killing. His reason? He thought the guy was mean, and he was doing the world a favor.

Although I surely remain ignorant about many complex belief systems, could I boldly propose that any time your religion seems to justify killing someone, you’re grossly misunderstanding your scripture? I know the Christian Bible does not condone shooting mean people in the back of a head with a rifle, and I’m pretty sure that blowing up abortion clinics is missing the point, albeit in a very ironic situation. And while I’m not all that familiar with it, it seems that the Qu’ran also warns against blowing up buildings.

It just boggles my mind that religions with basic tenets such as “Love your neighbor as yourself” and “Thou shall not kill” (and the Qu’ran, if I understand it, is similar!) get twisted into promoting such atrocities.

Location Error vs. Time Error

This post christens my newest category, Thinking Aloud. It’s meant to house random thoughts that pop into my head, versus fully fleshed-out ideas. Thus it’s meant more as an invitation for comments than something factual or informative, and is likely full of errors…

Aside from “time geeks,” those who deal with it professionally, and those intricately familiar with the technical details, most people probably are unaware that each of the GPS satellites carries an atomic clock on board. This is necessary because the way the system works, in a nutshell, by triangulating your position from various satellites, where an integral detail is knowing precisely where the satellite is at a given time. More precise time means a more precise location, and there’s not much margin of error here. The GPS satellites are also syncronized daily to the “main” atomic clock (actually a bunch of atomic clocks based on a few different standards), so the net result is that the time from a GPS satellite is accurate down to the nano-second level: they’re within a few billionths of a second of the true time. Of course, GPS units, since they don’t cost millions of dollars, rarely output time this accurately, so even the best units seem to have “only” microsecond accuracy, or time down to a millionth of a second. Still, that’s pretty darn precise.

Thus many–in fact, most–of the stratum 1 NTP servers in the world derive their time from GPS, since it’s now pretty affordable and incredibly accurate.

The problem is that GPS isn’t perfect. Anyone with a GPS probably knows this. It’s liable to be anywhere from a foot off to something like a hundred feet off. This server (I feel bad linking, having just seen what colocation prices out there are like) keeps a scatter plot of its coordinates as reported by GPS. This basically shows the random noise (some would call it jitter) of the signal: the small inaccuracies in GPS are what result in the fixed server seemingly moving around.

We know that an error in location will also cause (or, really, is caused by) an error in time, even if it’s miniscule.

So here’s the wondering aloud part: we know that the server is not moving. (Or at least, we can reasonably assume it’s not.) So suppose we define one position as “right,” and any deviation in that as inaccurate. We could do what they did with Differential GPS and “precision-survey” the location, which would be very expensive. But we could also go for the cheap way, and just take an average. It looks like the center of that scatter graph is around -26.01255, 28.11445. (Unless I’m being dense, that graph seems ‘sideways’ from how we typically view a map, but I digress. The latitude was also stripped of its sign, which put it in Egypt… But again, I digress.)

So suppose we just defined that as the “correct” location, as it’s a good median value. Could we not write code to take the difference in reported location and translate it into a shift in time? Say that six meters East is the same as running 2 microseconds fast? (Totally arbitrary example.) I think the complicating factors wouldn’t whether it was possible, but knowing what to use as ‘true time,’ since if you picked an inaccurate assumed-accurate location, you’d essentially be introducing error, albeit a constant one. The big question, though, is whether it’s worth it: GPS is quite accurate as it is. I’m a perfectionist, so there’s no such thing as “good enough” time, but I have to wonder whether the benefit would even show up.

Building an Improvised CDN

From my “Random ideas I wish I had the resources to try out…” file…

The way the “pretty big” sites work is that they have a cluster of servers… A few are database servers, many are webservers, and a few are front-end caches. The theory is that the webservers do the ‘heavy lifting’ to generate a page… But many pages, such as the main page of the news, Wikipedia, or even these blogs, don’t need to be generated every time. The main page only updates every now and then. So you have a caching server, which basically handles all of the connections. If the page is in cache (and still valid), it’s served right then and there. If the page isn’t in cache, it will get the page from the backend servers and serve it up, and then add it to the cache.

The way the “really big” sites work is that they have many data centers across the country and your browser hits the closest one. This enhances load times and adds in redundancy (data centers do periodically go offline: The Planet did it just last week when a transformer inside blew up and the fire marshalls made them shut down all the generators.). Depending on whether they’re filthy rich or not, they’ll either use GeoIP-based DNS, or have elaborate routing going on. Many companies offer these services, by the way. It’s called CDN, or a Contribution Distribution Network. Akamai is the most obvious one, though you’ve probably used LimeLight before, too, along with some other less-prominent ones.

I’ve been toying with SilverStripe a bit, which is very spiffy, but it has one fatal flaw in my mind: its out-of-box performance is atrocious. I was testing it in a VPS I haven’t used before, so I don’t have a good frame of reference, but I got between 4 and 6 pages/second under benchmarking. That was after I turned on MySQL query caching and installed APC. Of course, I was using SilverStripe to build pages that would probably stay unchanged for weeks at a time. The 4-6 pages/second is similar to how WordPress behaved before I worked on optimizing it. For what it’s worth, static content (that is, stuff that doesn’t require talking to databases and running code) can handle 300-1000 pages/second on my server as some benchmarks I did demonstrated.

There were two main ways to enhance SilverStripe’s performance that I thought of. (Well, a third option, too: realize that no one will visit my SilverStripe site and leave it as-is. But that’s no fun.) The first is to ‘fix’ Silverstripe itself. With WordPress, I tweaked MySQL and set up APC (which gave a bigger boost than with SilverStripe, but still not a huge gain). But then I ended up coding the main page from scratch, and it uses memcache to store the generated page in RAM for a period of time. Instantly, benchmarking showed that I could handle hundreds of pages a second on the meager hardware I’m hosted on. (Soon to change…)

The other option, and one that may actually be preferable, is to just run the software normally, but stick it behind a cache. This might not be an instant fix, as I’m guessing the generated pages are tagged to not allow caching, but that can be fixed. (Aside: people seem to love setting huge expiry times for cached data, like having it cached for an hour. The main page here caches data for 30 seconds, which means that, worst case, the backend would be handling two pages a minute. Although if there were a network involved, I might bump it up or add a way to selectively purge pages from the cache.) squid is the most commonly-used one, but I’ve also heard interesting things about varnish, which was tailor-made for this purpose and is supposed to be a lot more efficient. There’s also pound, which seems interesting, but doesn’t cache on its own. varnish doesn’t yet support gzip compression of pages, which I think would be a major boost in throughput. (Although at the cost of server resources, of course… Unless you could get it working with a hardware gzip card!)

But then I started thinking… That caching frontend doesn’t have to be local! Pick up a machine in another data center as a ‘reverse proxy’ for your site. Viewers hit that, and it will keep an updated page in its cache. Pick a server up when someone’s having a sale and set it up.

But then, you can take it one step further, and pick up boxes to act as your caches in multiple data centers. One on the East Coast, one in the South, one on the West Coast, and one in Europe. (Or whatever your needs call for.) Use PowerDNS with GeoIP to direct viewers to the closest cache. (Indeed, this is what Wikipedia does: they have servers in Florida, the Netherlands, and Korea… DNS hands out the closest server based on where your IP is registered.) You can also keep DNS records with a fairly short TTL, so if one of the cache servers goes offline, you can just pull it from the pool and it’ll stop receiving traffic. You can also use the cache nodes themselves as DNS servers, to help make sure DNS is highly redundant.

It seems to me that it’d be a fairly promising idea, although I think there are some potential kinks you’d have to work out. (Given that you’ll probably have 20-100ms latency in retreiving cache misses, do you set a longer cache duration? But then, do you have to wait an hour for your urgent change to get pushed out? Can you flush only one item from the cache? What about uncacheable content, such as when users have to log in? How do you monitor many nodes to make sure they’re serving the right data? Will ISPs obey your DNS’s TTL records? Most of these things have obvious solutions, really, but the point is that it’s not an off-the-shelf solution, but something you’d have to mold to fit your exact setup.)

Aside: I’d like to put nginx, lighttpd, and Apache in a face-off. I’m reading good things about nginx.

Flip-Flopper

While looking at job postings on Craiglist, I somehow ended up at Craig Newmark’s personal blog. (He founded Craigslist.) He linked to this YouTube video.

For some reason I’m reminded of Hillary’s tall tale of ducking sniper fire. I respect McCain as a decorated soldier and a Senator who understands bipartanship, but after eight years of the Commander in Chief misleading* us about Iraq, I’d really prefer to not elect a president who will do more of the same.

  • Whether it was intentional lies or him being fed false information I’m not sure, but either way, we were misled.

Broken Windows

Last night we were unloading a shopping cart. When done, the place to put it away was pretty far away. But there were about ten other shopping carts littering the parking lot nearby, so I said, “Meh, what’s one more?”

As we got in the car, I proclaimed, “Broken Windows in action!” I think people were confused and assumed I was referring to a literal window which was broken. Instead, I was referring to the Broken Windows Theory, which is an interesting read. The basic premise is that researchers watched an abandoned warehouse. For weeks, no one vandalized the building. One day, one of the researchers (deliberately) broke one of the windows. In short order, vandals knocked out the rest of the windows. The theory is used a lot in policing, but I think it has applications in many other places. Such as parking lots: if you’re diligent in bringing in carts, I’d argue that you’d avoid people doing whta I did. (I also felt the same way at the bowling alley: if we frequently picked up candy wrappers and popcorn from the floor, the place seemed pretty clean. If we slacked, it felt like the place was being trashed by everyone in short order.)

The theory does have its detractors, but it also has strange people who see applications of their theory in parking lots. Enjoy the photo of chives, which have nothing to do with anything, but I just took it and I like it.

title=”Chives by n1zyy, on Flickr”>Chives

Takin’ Care of Children

From the first two pages of today’s Nashua [NH] Telegraph:

  • A firefighter in Concord was commended after saving the lives of two children in a trailer home. He explained that he drove by and saw smoke pouring out of an attached shed, with the father of the children attempting to extinguish it with a garden hose. The firefighter ran into the burning house and got the kids–who were in their cribs–out.
  • A 20-year-old man was arrested in Derry for allegedly sexually assaulting a 4-year-old. Strangely, he was arrested in the library. He was reading, of all things, a book called Encyclopedia of Rape. Just… wow, dude, you have problems.
  • A man in Brentwood was arrested for beating his 6-month-old son, apparently breaking “more than two dozen bones” on the boy. At his sentencing, his wife spoke saying that he had never hurt the boy.
  • On the front page, a babysitter was arrested with 26 counts each of kidnapping and child endangerment, and felony theft. Before you think she had a warehouse of babies she’d kidnapped, she was actually outsourcing her babysitting. She’d agree to babysit the kid, and then find other babysitters on Craigslist to provide the care. Unfortunately for her, “personal contracts” cannot be assigned/transferred, and I’m pretty sure that child care, unlike lawn mowing, counts as a personal contract. However, I’d contest that kidnapping is a reach, and felony theft is utterly wrong: the services were received, just provided by someone else. It might be a tort, but I’m not sure that subcontracting can be considered theft, even if subcontracting wasn’t permissible. Child endangerment, though, is probably a pretty fitting charge. The parents have a brief statement encouraging other parents to do random, unannounced visits of their child to make sure that they’re actually there. I suppose, in this case, it’d have been appropriate, but it seems somewhat preposterous that one would have to do that, especially since most people hire babysitters because they’re unable to be there.

Also, is there any crime that isn’t committed on Craigslist? Browse around enough and you’ll find flagrant prostitution and drug sales. (You’ll also periodically see people arrested for this stuff in the newspaper… I’d love to work in a police department’s “Craiglist Division,” which might just be a full-time job.) Apparently you now have babysitting-outsourcers.