Problems

Here are the types of things my mind picked up on today that no one else on the face of the planet would notice, much less care about:

  • mot.com (MOT is Motorola’s stock ticker) resolves to 192.168.0.110, a non-routable internal IP.
  • Doing a traceroute from here to mot.com, it goes through six routers (four at school, two upstream) before they start dropping packets. Every single router, in my mind, should be checking for impossible conditions like that and dropping packets. But, if nothing else, our edge router should do this filtering, as should the first upstream router.
  • One of Waltham’s firefighters transmits a sidetone when he keys up, in addition to his MDC data. This is a weird problem. (What’s supposed to happen is that the radio transmits a little data burst at the start of each transmission, identifying his radio. The exchange takes about 200ms, so, while the radio transmits this, it beeps at the user to indicate that they shouldn’t start talking yet. When it stops, it starts transmitting his audio.) In this case, the sidetone and data burst are both getting transmitted.

School

For reasons that even I don’t understand, I find myself thinking a lot about improving schools. And yesterday was one of those joyous experiences where several different thoughts suddenly overlapped, forming something new.

One of my professors is an adjunct professor who teaches at several different schools. And she was talking about how it seemed to her that a decent number of prestigious schools focus too much on theoretical and abstract concepts, but no so much on real-life applications. This nicely sums up one of the areas in which I’d like to see grade schools improved.

  • Gym class was universally an utter waste of time. I suppose it got me moving a little bit. But watching football or basketball on TV, I realize that I still don’t understand the finer points of the game. How come this never came up in gym class? And, perhaps more significantly, I’ve been exercising a bit. I lift weights a few times a week, and am looking forward to nicer weather so I can take up jogging again. (Yes, I should just go to the gym and use a treadmill. But it’s not the same.) Why didn’t I do this in gym class? Why did we spend so much time on badminton? Why is there an “n” in the middle of badminton?
  • I can’t speak for others, but trigonometry was among my least favorite classes ever. Furthermore, I’ve never applied it anywhere. The only time it came up in subsequent classes was when we integrated trigonometric functions, and at that point, no one had any clue what we were doing anyway. But why not replace a math class with zero practical applications with a finance course? Not until I took a finance course here in my sophomore year did I truly learn about things like compound interest and the time value of money. Every person in America needs to know this. You have $1,000 sitting in your bank account. How much will you make if you put it in a one-year CD at 4.25%? And you graduate and go to buy a $250,000 condo, taking out a 30-year mortgage. What will be your monthly payments at 6% interest? What if you get 4.5%? What if you get stuck at 8%? And, when you’re done with that, how much do you pay over the lifetime of the mortgage? (Hint: at 6% annual interest, you pay almost exactly $1,500/month, for $539,000+. That means that your interest is more than 100% of the principal.) You can bring up usury laws, and the fact that national banks, et alia, got themselves exempted from them, and segue into credit cards. Why did no one teach me to balance a checkbook? (Okay, it’s easy. But still…)
  • I want to learn either the guitar or the piano. And I suspect that, if you went to middle or high school, you’d find lots of people who shared my interest. What the heck happened in music class? How did I pass music class without understanding how to read music, and without being able to play anything other than the recorder in 5th grade?
  • What are geography classes teaching people? Why, when I graduated high school, did I still have no clue where Iraq was on the map? Similarly, what the heck happens in  civics and such? Why wasn’t I made to read the Declaration of Independence? Why don’t I know the Amendments cold? I think I should be able to yell “14th Amendment!” to any high school graduate and have them talk about its exact meaning, including due process and equal protection. 22nd Amendment? What President was it enacted in response to? When (ballpark) was it ratified? What states refused to ratify it? (Hint: Massachusetts was one of two.) What’s required to add a Constitutional Amendment?
  • Why are we so reliant on calculators? Last semester we were looking to bring a Presidential speaker, and contemplated opening it to the public to make sure we filled the crowd. A friend pulled out a calculator. “If we charge $5 a ticket, and get 100 people…” He plugged the numbers in. “That’s $500 to defray the costs.” Not until I called him on what he’d done did he even realize the absurdity of using a calculator for 5 x 100. But it’s not that he’s stupid. It’s that we’re all so dependent on them. All the time I’ll start to plug some numbers into a calculator and solve it in my head before I finish typing it in. I think higher math classes need to give Math Minutes again. The kids might think you’re nuts for doing it in calculus class, but it’s necessary!

Pollution

I don’t consider myself a ‘hardcore environmentalist,’ but I’m not sure there’s anyone on the planet who wouldn’t agree that this is absurd.

It could be easily fixed, too, if someone (Indonesian government? UN? Environmental groups?) were willing to pay a bit. Hand out nets, and offer a nominal amount of money for each pound of garbage pulled out of the river. 5 cents a pound? Figure that they can get at least 100 pounds of garbage in a big net, in probably twenty minutes of work. You just need to drag it behind you until it’s full.

I’m sure that pulling all the garbage out of the river won’t instantly cure it of its problems. (Currently, even fish can’t live in it.) But I’m also pretty confident that pulling all of the garbage out of the river would be an improvement over leaving it in…

This is How We Do

I finally got around to processing some of the pictures I took this past weekend. I wanted to share a few.

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

How does that one look? I like to think it passes as a ‘normal’ shot. What’s not evident is that it was underexposed, poorly metered, had a nasty green color cast, and had everything in perfect focus. Tweaking photos in Photoshop requires striking a delicate balance. Too little touch-up and the image doesn’t look that great, and too much and the image looks pathetically artificial.

I like to think this one is a good compromise. I used Levels as well as the Shadows & Highlights tool to bring out a lot of the detail that was lost: some areas were too dark (people), and others were too bright (the court). I bumped up saturation and contrast every so slightly (that’s an easy one to take too far), and then used my new favorite Photoshop tool, a ‘smart selector,’ which let me easily select the crowd, and nothing else. It worked remarkably well at letting me not get any of the players or the court. With that, I applied a slight Gaussian blur to the crowd, to throw them a little bit out of focus. It’s what it should have looked like anyway, had it been shot with a faster lens.

Here’s the same shot straight out of the camera. You can see that it’s not really bad, and, side-by-side, it actually look a little more “natural.” But the players are a little too pale, the crowd is a little too distracting, and so forth.

title=”No Post-Processing by n1zyy, on Flickr”>No Post-Processing

Now here’s another one I took:

title=”The Shot by n1zyy, on Flickr”>The Shot

At a glance, this looks like a decent photo. Your eyes should be drawn right to the player as he makes his shot (I love shooting a camera with negligible shutter lag!) (The motion blur on the ball which looks kind of cheesy to me is actually legitimate.) The players, the rim, and the backboard all look nice and sharp. But if your eyes wander the crowd, you can quickly see that my attempt at a few tiers of Gaussian blur were amateurish. Having stuff like the open doors and scaffolding in the back of the gym is distracting. Again, had I been shooting a nice 200mm f/2.0 (not yet released, much less within my budget), it would have been thrown out of focus. But I was shooting with a lens at f/5.6, leaving stuff like that remarkably in focus. I started by selecting all the background junk and applying a Gaussian blur, but to mimic real life blur gets complicated in this setup. I wanted to throw the fans near the court slightly out of focus, but let the doors and walls be further blurred. This required multiple tiers of blurring, and left some strange effects. You’ll notice a few people with bodies that are mostly in focus, but heads that are exceptionally blurry. With a little more time, I could probably improve on this, but this was one of my first attempts at working seriously to manage background blur, so I instead offer it, with its myriad flaws, as an example.

Do you have the time?

I’ve been running an NTP server on this host for quite some time now. But as of yesterday, I’m a member of the pool.ntp.org group. pool.ntp.org is a round-robin-ish DNS service where requests for pool.ntp.org are given IPs from a huge block of listed nameservers, balancing the load across a pool of about 1,500 NTP servers across the world. The official “entry” for this server is my IP (72.36.178.234), but ntpd is actually listening on all IPs right now, so using blogs.n1zyy.com or ttwagner.com will work.

I’m currently synced to Stratum 2 servers, but I think that, after I finish up some open tasks (“real work,” versus playing with time servers), I’m going to look at requesting permission to sync to Stratum 1 servers. (Stratums, err, strata, are basically tiers. “Stratum 1” refers to a server directly connected to something like a GPS (which obtains extremely accurate time: having the correct time is an important part of how GPS works, so GPS actually broadcasts the time from the atomic clock) or from WWV (transmitted over HF radio). Stratum 2 servers get their time from Stratum 1 servers, and so on. As I sync to a network of stratum 2 clocks, I become a stratum 3 server. Moving up a stratum generally implies more accurate time, as there are fewer intermediaries to skew results. (Although we’re talking milliseconds of difference.) There aren’t an awful lot of stratum 2 servers, so syncing to a stratum 1 server would help to round out the stratum 2 list. (It would be fun to become a stratum 1 server, but as a stratum 2 host says of his data center, “they’re not going to let me drill a hole in the ceiling to run an antenna [for the GPS] to the roof.”)

For those of you with UNIX systems, take advantage of this! You can sync to me directly (72.36.178.234), or indirectly (the pool.ntp.org cluster). (Windows can sync to an NTP server as well, it’s just not a standard feature.)

Web Design

I’ve redone ttwagner.com. It’s no longer a random integer between 0 and 255, but instead, a decent-looking site. I’ve integrated some of the cool things I’m hosting there as well. I came across a few interesting things I wanted to point out.

The world DNS page is incredibly intensive, and, since it’s not dynamic, there’s no sense in “generating” it each time. So I used the command wget http://localhost/blah/index.php -O index.html to “download” the output, and save it as index.html in the web directory. Viola, it serves the HTML file rather than executing the script.

But the HTML output was frankly hideous. The page was written as a, “You know, I bet I could do…” type thing, written to fill some spare time (once upon a time, I had lots of it). So I’d given no attention to outputting ‘readable’ HTML. It was valid code and all, it just didn’t have linebreaks or anything of the sort, made it a nightmare to read. But I really didn’t want to rewrite my script to clean up its output so that I could download it again….

So I installed tidy (which sometimes goes by “htmltidy,” including the name of the Gentoo package). A -m flag tells it to “modify” the file in place (as opposed to writing it to standard output). The code looks much cleaner; it’s not indented, but I can live with that!

I also found that mod_rewrite is useful in ways I hadn’t envisioned using it before. I developed everything in a subdirectory (/newmain), and then just used an htaccess override to make it “look” like the main page (at ttwagner.com/ ). This simplifies things greatly, as it would complicate my existing directory structure. (It’s imperfect: you “end up” in /newmain anyway, but my goal isn’t to “hide” that directory, just to make the main page not blank.)

I’ve also found I Like Jack Daniel’s. (Potential future employers: note the missing “that” in that sentence, which changes the meaning completely!) The site is a brilliant compendium of useful information, focusing on, well, Apache, PHP, MySQL, and gzip, generally. The “world DNS” page was quite large, so I decided to start using gzip compression. He lists a quick, simple, and surefire way to get it working. (The one downside, and it’s really a fundamental ‘flaw’ with compression in general, is that you can’t draw the page until the whole transfer is complete. This has an interesting effect as you wait for the page to load: it just sits there not doing much of anything, and then, in an instant, displays the whole page.) It may be possible to flush the ‘cache’ more often, resulting in “progressive” page loading, but this would be complicated, introduce overhead, and, if done enough to be noticeable, also defeat the point of compression. (Extreme example: Imagine taking a text file, splitting it into lots and lots of one-byte files, and then compressing each of them individually. Net compression: 0. Net overhead: massive!)

Gnome’s Trash Folder

Gnome (the desktop environment, not the creepy garden fixtures) has a “Trash Folder,” which is the functional equivalent of the Windows Recycle Bin. This is slightly problematic for those of us who are used to file “deletion” on Linux instantly unlinking the file, who don’t expect that the files are being moved somewhere. Especially as the developers made the icon a little more obscure, putting it in the very bottom right corner of the taskbar, where I overlooked it for quite some time. Now that I know it’s there, it’s easy to purge, just like I empty the trash bin.

But for geeks like me, you’ll be happy to know that the “Trash Bin” is nothing more than a directory, ~/.Trash. Thus you can empty it fairly easily, with “rm -rf ~/.Trash/*”  And you can use all the routine Linux filesystem tools: “ls” to show what’s in it, and “du -sh ~/.Trash” to list its contents and show the total size.

Update: Newer distros are putting it in ~/.local/share/Trash/files/ instead of ~/.Trash

Flash Plugin for Ubuntu

In the hopes of helping someone else…  Ubuntu has two options for a plugin for Firefox to play Flash. There’s the open-source Gnash and “the real thing” from Adobe. Of course what Adobe provides is closed-source, so there seems to be a tendency to push Gnash. But having used Gnash, it’s awful. I give them enormous credit for their work, but when I have a load average of 2.5 playing a 2-minute YouTube video, get lots and lots of dropped frames, and have random 0’s (a big ‘zero’) superimposed over the video, it’s alpha-level code. It’s not usable.

In theory, Ubuntu makes it easy to install the proprietary one, too. They can’t distribute the player itself, per Adobe’s license terms. So they have a package, flashplugin-nonfree, which downloads it from Adobe. The problem is that Adobe updated their version, so the script fails, citing an MD5 mismatch. (The file’s signature has changed, since it’s, you know, a different version.) Worst of all, it doesn’t handle this error appropriately: it tells you that the package installed successfully, when, in actuality, it aborts due to the error.

This happened in early December. The Ubuntu developers have been squabbling, yet to release an update: apparently the new version doesn’t work in Konquerer. As one person on the developers’ list points out, status quo is the worst case: Flash doesn’t work for anyone. But the developers seem unwilling to use a simple patch to handle the new version, because then Konqueror wouldn’t work. So some grandiose task is under way to try to integrate it with Konqueror, apparently. Meanwhile, no one can use Ubuntu’s package manager to install Flash player.

Fortunately, it’s easy to do yourself. Download the .tar.gz file here, and extract it somewhere. Pull up a terminal, go into the extracted directory, and type “sudo flashplayer-installer,” and follow the on-screen instructions. It’ll take about fifteen seconds. When asked for the location, you probably want /usr/lib/firefox (assuming you use Firefox, and are on Gutsy). You have to close your browser to do this.

Photography

An awesome comment on Ask MetaFilter gives some incredibly well-worded advice:

The camera matters not a whit. The lens matters quite a bit. The flash matters most in the kit… …if you expect your models to be well-lit.

Of course, I have a good camera and a pretty good lens, but just the on-camera flash. I’ve had some pretty good luck with it, mostly with improvised solutions (that’s almost identical to mine: similar camera, exact same gold foil) to bounce light off the ceiling / walls. It looks dorky, sure, but it works.

But you should check this out. Not only is this guy an amazing photographer, but he gives a lot of great tutorials. I think my future photo-taking is going to work on finding skillful ways to use the flash for lighting. I’m sure there’s lots more that can be done with high-end flashes and radio slaves, but I want to start by mastering the built-in flash.