Gun n00b

Although the citizen’s police academy here formally wrapped up a couple weeks ago, they’d set up an appointment at the local police department’s gun range for us. After about 2 hours of reviewing the functioning of a gun, gun safety, and such, they brought us into the range.

Their standard department weapon is the Glock 23, a .40-caliber handgun. A few comments:

  • They’re very strict about gun safety. (As they should be.) As they talked to us in their classroom, he began with a safety note: all the officers in their room had locked their guns up. The “guns” he used in class were non-functioning demonstration units. He had real ammunition, but, because they would later bring a .40-caliber pistol into the room, had only a single, orange, rubber bullet in the .40-caliber size. The “Range Master” came in later with his unloaded weapon, being very careful to demonstrate that it was unloaded. As he demonstrated proper technique holding the weapon, he was insanely cafeful to never point the weapon, which he had all just witnessed was unloaded, at anyone. When we finally got into the range, they stood right beside us in the booth.
  • He had us determine our “dominant eye.” I’m right-handed. My right eye has decent vision (maybe 20/40 uncorrected, but 20/15 with contacts), but my left eye is comically bad, 20/300 uncorrected. As he joked, I’m “one of those weirdos” whose dominant eye is different from their handedness (that’s an actual word?!). The way he had us determine it was interesting: hold your arms out and make a hole about the size of a golf ball, and focus on some distant object. And then slowly pull your arms back to you, maintaining the gap you’re looking through. Eventually, your hands end up in front of one of your eyes. That’s your dominant eye. An added wrinkle to the fact that I can’t see out that eye all that well is that, being right-handed, the instinct is to hold the gun towards the right side of your body, and you end up pulling your head over to your right. Of course this must look ridiculous, and the proper thing to do is bring the gun more to your left, keeping your head steady. But as he pointed out, it’s not intuitive.
  • He said it’s “optically impossible” to keep the rear sight, front sight, and the target all in focus. Thus, even if it weren’t for my poor vision in my left eye, I’d still have ended up doing what I was doing: focusing on the target as I bring the gun up, and then focusing on the gun’s sights, firing at a blob in the distance.
  • Recoil! It’s pretty common knowledge that the gun will recoil and ‘kick back.’ But until you’ve tried it, it doesn’t do it in the way you imagine. He joked about the stereotypical fear of the gun flying back and hitting you in the face. In actuality, the gun goes more upward; in my case, a little to the left. He mentioned that, with most people who’ve never shot before, their first round will hit dead-center, but then we start trying to “compensate” for the recoil which screws us up. And that’s exactly what I did. I took time to aim each of my five shots perfectly, so my shots are pretty much in a perfect vertical line. Just seeing someone shooting, it’s tempting to think, “What idiots! If you hold the gun a little more steady, you can hold it steady when you fire.” You can’t. You hold the gun nice and firm, and, as soon as you pull the trigger, you’re holding the gun in a totally different place. You see people firing one-handed in movies; I think the gun would fly off your hand if you tried that. In addition to being impossible to prevent the gun from recoiling, he pointed out that it’s actually bad to try to control it: you end up pushing the gun down right before you fire, which throws your accuracy off.
  • I think shell casings are something that’s viewed like recoil: people know that shell cases get ejected out the side, but don’t give them too much thought. I was firing to the right of someone else. My biggest fear wasn’t that I was holding a loaded firearm with no experience, that I was going to shoot myself in the foot, or that I was going to get my finger sliced as the gun’s slide moved. No, my biggest fear was that one of the red-hot shell casings from the guy next to me was going to hit me. They didn’t, but it’s apparently a fairly common occurrence, hence why they’re big on wearing eye protection. One of the officers we were with was telling us that last time he went to the range, he was wearing a shirt tucked-in but with a loose collar, and ended up getting a shell casing down his shirt, which was apparently not an enjoyable experience. Further, my mental image was that the shell casing would just kind of flop out the side onto the floor. They actually go flying out the side, probably at least six feet.

Anyway, it was kind of fun, but now I see why they spend so much time training: there are so many little things that you need to practice before you’re able to pick a gun up and fire it (with any hopes of hitting your target) in under, say, ten seconds. Which, if you actually need to fire a gun, would probably be the situation.

As an aside, the target was a vaguely human-shaped “blob,” with a very faint “Q” in the middle of it. (They didn’t explain why it had a Q on it.) Part of me wonders if anyone has ever made a T-shirt that just has a very faint “Q” in the center. You’d just have to be careful where you wore it…

The Dream Network

Periodically I come across deals for computers that are very tempting. I’m not necessarily in the market right away: I’m going to keep my laptop until I’ve been working long enough that I can afford something stellar. It’s silly to “upgrade” a little bit. But every time I see these deals, I think of the various ways I could set things up… My “ideal (but realistic) computer” would actually be a network:

  • Network infrastructure: Gigabit Ethernet, switched, over Cat6. 10GigE and fiber are cool, but really not worth the cost for a home network.
  • A server machine. It needn’t be anything too powerful, and could (should) be something that doesn’t use a ton of electricity. The machine would run Linux and serve multiple rolls:
    • Fileserver. It’d have a handful (4-6?) of 500GB disks, running RAID. While performance is important, it’s important to me that this thing be very ‘safe’ and not lose data. (Actually, in a very ideal setup, there’d be two fileservers for maximum redundancy, but my goal with this setup is to be reasonable. What interests me, though, is that I think it’d be possible to use an uncommon but awesome network file system like Coda or AFS, but also have some network shares on top of that service that ‘look normal,’ so Windows could just merrily connect to an M: drive or whatnot, merrily oblivious to the fact that the fileserver is actually a network of two machines.) It’s important that the machine have gobs of free space, so that I can merrily rip every CD and DVD I own, save every photo I take, and back up my computers, without every worrying about being almost out of disk space. It’s also important to be hyper-organized here, and have one “share” for music, one “share” for photos I’ve taken, etc.
    • Internet gateway. It’d act as my router/firewall to the Internet, and also do stuff like DNS caching. It may or may not serve as a caching proxy; I tend to only notice caches when they act up, but then again, it might be quite helpful.
    • Timeserver. For about $100 you can get a good GPS with PPS (pulse-per-second) output and keep time down to a microsecond. Hook it up to the serial port of this machine, and have your local machine sync to that for unnecessarily accurate time. (Actually, it looks like you can do PTP in software with reasonable accuracy?)
    • Asterisk machine, potentially taking in an analog phone line and also VoIP services, and giving me a nice IP-based system to use, blending them all so it’s transparent how they’re coming in. It would also do stuff like voicemail, call routing/forwarding, etc. For added fun, it could be made to do faxes: receive them and save them as a PDF, and act as a “printer” for outgoing faxes. The code’s there to do this already.
    • Printserver. If you have multiple machines, it’s best to hang your printer(s) off of an always-on server. It could speak CUPS or the like to Linux, and simultaneously share the printer for Windows hosts.
    • MythTV backend? But most likely not; I’d prefer to offload that to a more powerful machine, rather than bogging down a server.
  • Primary desktop. Surprisingly, a quad-core system, 4 GB of RAM, and a 24″ LCD can be had for around $1,000 these days. That’s all I need in a system. I have my Logitech G15, which is all the keyboard I need. My concern is with what to run… These days I make use of Windows and Linux pretty heavily. I think virtualization will be mature enough by the time I’m actually going for a setup like this to allow me to get a Linux-based Xen host and run Windows inside of a virtual machine with no performance degradation. (This is actually mostly possible already, but as Andrew will attest, Xen can still have some kinks….) The system should have a big monitor. It’d be interesting to put something like an 8GB solid-state drive in it and use that for a super-fast boot, but the jury’s still out on whether it’s worthwhile. (I guess that some places are pushing SSD under some special name to make Windows boot instantly, but the reviews I’ve heard suggest that it gives a nominal improvement at best.)
  • Secondary desktop. Pay attention for a while to the short bursts of time when you can’t use your computer. The system locks up for a bit, or it’s just unbearably slow while the disks spin up and get a massive file, or you have to reboot, or you’re playing a full-screen game and die and wait 15 seconds to respawn, or….. In this “ideal setup,” I’d have a second machine. It needn’t be anything special; in fact, it could be the cheapest machine possible. It’d basically run Firefox, AIM/IRC, Picasa (off of the network fileserver), iTunes, and the like. For the sake of completeness, it should probably run whatever the other system doesn’t, out of Linux, XP, and Vista.

Long-distance NTP

It’s widely-believed that geographic proximity is the main factor determining the accuracy of NTP. While I’m not necessarily disputing its importance, I wanted to mention some interesting tests I’ve done.

As I mentioned earlier, my (“our,” really — @ co-owns it, and keeps paying the bill without sending me his PayPal address… *g*) NTP server was incorrectly, and pretty randomly, labeled as being in Brazil, and thus set to serve time to people in Brazil and, more generally, South America. But the server is in Pennsylvania.

Surely, then, with such a long distance, quality must be terrible? I decided to measure it in reverse: I did a “mock sync” to the South American pool from my server in Texas. The command ntpdate -q servername will “sync” to a server (or set of servers) via NTP, but only show you the offset it would have applied, rather than actually adjusting your clock. I ran this on a server that’s a stratum 2 server that’s been very stable on time: when it syncs with GPS-stabilized clocks every 1024 seconds, it’s rare for it to shift the time more than 10ms. So by syncing to the South American pool, I was able to, more or less, determine the effect of the long-distance, high-latency synchronization:

oxygen ~ # ntpdate -q south-america.pool.ntp.org
server 200.192.232.8, stratum 2, offset 0.021524, delay 0.23042
server 146.83.183.179, stratum 2, offset -0.002081, delay 0.17311
server 201.84.224.130, stratum 3, offset 0.004254, delay 0.19417
26 Apr 00:33:31 ntpdate[5828]: adjust time server 146.83.183.179 offset -0.002081 sec

(First of all, no, my US server is not in that list.) You can see that it selected three servers from the South American pool, and synced to each of them. I had pings of 230ms (0.23042 seconds), 173ms, and 194ms. I had offsets of 21ms, -2ms, and 4ms. Given the three choices, ntpdate deemed the middle the most accurate, indicating that, even with almost 200ms latency crossing continents (or arbitrary divisions thereof), it could be accurate to 2ms.

NTP “subtracts” latency from the times, so that a high-latency connection won’t affect the accuracy of the time. (What does break things, though, is highly-variable, or highly-asymmetric, latency, which is pretty much impossible to “calculate.”) Still, I was surprised by just how good it was.

I then tried a test synchronization to the US pool:

oxygen ~ # ntpdate -q us.pool.ntp.org
server 66.191.139.147, stratum 2, offset 0.001096, delay 0.07080
server 65.111.164.223, stratum 2, offset -0.003190, delay 0.07475
server 66.250.45.2, stratum 3, offset 0.013041, delay 0.07225
server 63.89.76.60, stratum 2, offset 0.005535, delay 0.07397
server 209.67.219.106, stratum 3, offset 0.003419, delay 0.02605
26 Apr 00:34:36 ntpdate[6216]: adjust time server 66.191.139.147 offset 0.001096 sec

This time we got 5 servers (as is normally the case: I think the set of 3 is just given out for groups with only a handful of total servers). Four of them has pings around 70ms, and the last had a ping of 26ms. The middle server had na offset (time difference) of 13ms, but the other four were pretty close. (And when one server is “way” off, NTP disregards it anyway. Plus, it was a stratum 3 mixed in with mostly stratum 2’s, which is another count against it.) It suggested advancing my clock by 1 millisecond. (When the code is good enough to discard a 13ms difference as ‘wildly inaccurate,’ you know it’s good.)

So we have a 1ms “error” in the US, and a 2ms to South America. Africa is served by a mere 5 NTP servers. How did that go?

oxygen ~ # ntpdate -q africa.pool.ntp.org
server 41.223.43.5, stratum 2, offset 0.086558, delay 0.62405
server 196.43.1.14, stratum 3, offset 0.005741, delay 0.32759
server 196.25.1.9, stratum 2, offset -0.006428, delay 0.29601
server 196.43.1.9, stratum 2, offset -0.007126, delay 0.32123
server 196.25.1.1, stratum 2, offset -0.004245, delay 0.29314
26 Apr 00:31:07 ntpdate[4913]: adjust time server 196.25.1.1 offset -0.004245 sec

Oddly, I was served all five servers in the zone. If you look at pings, they ranges from 293ms to 624ms. That’s really bad. And the first server gave terrible time: essentially wanting to advance my clock 87ms. But again, with multiple servers present, NTP did a great job of working out the right time. It ended up trying to move my clock back 4ms.

300ms (best case) pings, going from the US to Africa, and it’s accurate to 4ms?

Some conclusions, caveats, and comments to consider:

  • “Accuracy” and “error” are really not appropriate terms. Because the server doesn’t have a time source connected directly (e.g., a GPS receiver with pulse-per-second output, a WWV receiver, or a cesium / rubidium reference recently synced to the atomic clock), the server really doesn’t know the true time. Thus we can only measure how the time differences compare. In this, I essentially just assume that my server has the accurate time, which is a dubious claim.
  • The main conclusion here is that NTP is really good at dealing with long pings. The fact that my data is crossing the ocean doesn’t really matter: it can calculate round-trip error. In light of this fact, and ignoring other information, geography is not important.
  • The server I took these measurements from sits in a data center on a nice fat backbone to lots of other providers. Thus it could be argued that it may have a much better connection that a home user might. It would be interesting to try these measurements from a normal PC on a “normal” home line.
  • Thus, my point isn’t so much that “Geography doesn’t matter” as it is, “Even if geography works against you, you can still get really good time with NTP.”

Google Charts

Have you guys seen Google Charts? It’s a quirky little API I didn’t know existed until I saw a passing allusion to it. Essentially, you pass it a specially-crafted URL (essentially the definition of an API) and it will generate a PNG image.

Here’s a fairly random line graph. My labeling of the axes makes no sense, but it was nonsensical data anyway.

One of the cooler things they support is a “map” type of chart, like this US map. The URL is a bit tricky, though this one of South America is easier to understand: chco (presumably “CHart COlor”) sets the colors, with the first being the ‘default’ color. chld lists the countries, as they should map up to the colors: UYVECO is “Uruguay,” “Venezuela,” and “Colombia.”

What has me particularly interested is that I’ve recently installed code to watch connections to my NTP servers. Here’s my Texas box, a stratum 2 server in the NTP pool (pool.ntp.org). I bumped it up to list a 10 Mbps connection speed to signal that I could handle a lot more queries than the average, although it’s still nowhere near its limit. In addition to the stats you see there, it keeps a “dump file” of every single connection. (As an aside, this strikes me as inefficient and I want to write an SQL interface to keep aggregate stats… But that’s very low-priority right now.)

Further, I have some IPGeo code I played with. More than meets the eye, actually: a separate database can give a city/state in addition to the country. (It comes from the free MaxMind GeoLite City database.) Thus I could, in theory, parse the log file created, match each IP to a state, and plot that on a US map.

This reminds me that I never posted… I set up NTP on the second server Andrew and I got, where we’re intending to consolidate everything, but haven’t had time yet. It sat unused for a while, keeping exceptionally good time. So, with Andrew’s approval, I submitted it to the NTP pool. I set the bandwidth to 3 Mbps, lower than the 10 Mbps my Texas box is at.

I was somewhat surprised to see it handling significantly more NTP queries. (They’re not online, since the box isn’t running a webserver, but for those in-the-know, ~/ntp/ntp_clients_stats | less produces the same type of output seen here.) It turns out that a flaw in the IPGeo code assigning the server to the right ‘zones’ for some reason thought our server was in Brazil. Strangely, while the United States has 550 (at last count) servers in the pool, South America has 16. Thus I got a much greater share of the traffic. It’s still low: at its peak it looks like me might use 2GB of bandwidth.

So there are a few graphs I think would be interesting:

  • A line graph of the number of clients served over time. Using Google Charts would save me from having to deal with RRDTool / MRTG.
  • A map of South American countries, colored to show which of the countries are querying the server most frequently. (The same could be done for my US server, on a state-by-state basis.)

American Auto

What is it with American auto companies and so utterly failing with hybrids? Gas it $3.50/gallon and up right now as I post this. There’s a big green movement. In short, people really care about getting halfway decent gas mileage.

So American auto finally got with the program and offered a couple hybrids. The Ford Escape hybrid, for a long time, was the only one. Tree-huggers and penny-pinchers alike can…. uhh…. marvel at the utter contradiction that is a hybrid SUV.

Of course, Chevy didn’t want to be left out, so they joined. Except that seem to have missed the memo even more. Calling it the “Green Car of hte Year,” they introduced “America’s first full-size hybrid SUV.” It gas mileage is exactly the same as my non-hybrid Toyota Highlander: 20-22 MPG.

Seriously, guys?

News Anchors, Awesome

Wasting time on YouTube:

  • Insane News Man” is pretty funny. Not until about the seventh time watching it did it occur that it was maybe a teleprompter problem, and the transition into his co-anchor being absent and a man being “murdered and then set on fire while celebrating his birthday” were two separate things.
  • This talkshow clip is in a foreign language (Dutch?), but I still can’t help but crack up laughing every time I watch this. You don’t need to understand what’s being said.
  • This weatherman is a classic. It’s a college station. Someone eventually interviewed him; it was his first time and the director kept distracting him by trying to give him cues, which just made things worse.
  • Off the topic of news anchors, “The worst hockey player!” is hilarious, if only because it would be me if I played hockey.
  • Worst Hockey Fight” is almost as good, although the first 20 seconds or so are worthless.
  • You might have seen this Home Shopping blooper before, but I’d never seen the full version before, which is where the hilarity lies. Long after it’s obvious that the horse picture he’s referring to is actually a butterfly / month, he continues calling it a horse, and even starts pointing out imaginary details.
  • This one, though, is even funnier, albeit much older. They’re selling “safety jumper cables” while the model shows off a poncho for no apparent reason, before the anchor very deliberately… Well, just watch.

Laws

A long time ago I coined Wagner’s Law: “While driving, the probability of encountering a bicyclist is exponentially higher when approaching a blind curve.” Why this is, I have no idea, but the world’s bicyclists always seem to be entering blind curves when I’m driving. I very rarely get to pass a bicyclist on a long stretch of straight road where I can see that it’s clear to pass. Instead, I’m entering a blind curve, where I’m forced to slow down and stay behind the bicyclist. This probably drives the people behind me crazy, but the only alternative would be to drift into the other lane, which is downright suicidal since I can’t see oncoming traffic.

Today, I’d like to coin Wagner’s Second Law: “As an organization grows, the percentage of unnecessary members rises.” By the time you’re a college, you probably have a lot of jobs that, frankly, aren’t necessary. We were joking yesterday about how the school ought to cut about 15 jobs and merge them into a single person’s job, with the title, “Director of Pointless Memos.” They can be the one that’s in charge of taking an e-mail sent to the whole campus and forwarding it… to whole campus… And the one in charge of sending us an e-mail informing us that the work order system for submitting maintenance issues is “now available,” even though it’s been available for at least two years and was not previously unavailable, and so forth.

Yesterday I got a notice in my mailbox informing me to make sure to update my mailing address with people sending me mail over the summer. We’ve been debating whether one line was a typo, or whether it was deliberate… One assumes the former, but after getting a sufficient amount of utterly pointless memos, we’re not entirely convinced that they didn’t mean to tell us exactly what it says:


The U.S. Post Office change of address form does not apply to our campus e-mail addresses.

Accuracy

I haven’t been paying too much attention to my NTP server, but some e-mails on the list about problems with the monitoring server got me to look at my server’s stats. Apparently the monitor experienced a bit of network turbulence and started considering everyone to be way off.

I was looking a bit at my local NTP stats. The last polling interval stepped my clock forward 5.024ms. This is perhaps more than I’d like; sometimes the offset is less than a millisecond.

So I started wondering what sort of accuracy this was. My server was happy with its sources, so it’s at the longest polling interval: once every 1,024 seconds, it’ll check. Thus, over 1,024 seconds, I lost 5.024ms.

Some quick calculations show that this is a 0.000491% error. I guess I’ll take it.

Awesome

There were a couple people screaming profanities outside my window. After about ten minutes one of them shouted, “Come drink with us” at some girl, and I looked out and saw that they had beer bottles.

Sufficiently irritated at this point, I called Campus Police. The dispatcher said, “I just sent someone up that way for this,” so I turned on my radio.

Sadly, the officers had the wrong location and missed them. But I was observing the whole thing through my window listening to them. I had to find a way to call back without divulging that I was listening to them, so I just stated that I’d seen the officers look in the wrong spot and leave. She asked me for a better description of their attire, in addition to my exact description of their location. I watched a couple cops slowly approach, observed the people I’d called about, and swooped in.

At this point I expected the students to stop yelling, apologize, and be asked to move back into their room. Instead, one of the students, upon seeing the police, threw his bottle down, screamed, and took off, with the second kid following him. The officers initially chased them into the woods.

One officer stopped chasing them as they got into the woods. I was slightly disappointed to see them get away, except that all I really wanted in the first place was for them to stop yelling profanities and derogatory comments at people. So I was happy.

But I was even happier when another officer radioed in that he had seen the kids come out of the woods and was picking up the chase.

At this point my batteries died, so I’m not yet sure how this ended. But suffice it to say that it ended up significantly more interesting than I’d initially expected. And the drunken jerks are gone.

As an aside, the school’s 100W repeater (into a high-gain antenna, it seems) seems to overload my poor little VX-2. I tried enabling its attenuator feature, but it still didn’t seem to cut it. I then tried removing the antenna, but then the signal was too weak. (Although still audible.) My IC-W32 holds up much better to the overwhelming nearby signal, but its batteries don’t. And my ASTRO Saber is entirely unphased by the signal, but its batteries died the other day and I hadn’t recharged them…