Archive for the ‘tech’ Category

Customizing your Android phone

Friday, July 2nd, 2010

Some of my friends recently bought Android phones and I started writing an email to them recommending some apps and different widgets, when it occurred that it might be more useful if I put them up here.

I’ve had a Motorola Droid since the weekend they came out, so have gotten pretty comfortable with the device. And so away we go…

Wallpaper

A wallpaper graphic on the Droid, at least, needs to be 960X854 in pixels. One way to put a cool background in there is to search the web for images in that size, then hold your finger on the image to get the context menu asking you to save the picture. Another way is to just take a picture with the camera (which is what I did). Any picture you have in your photo gallery can be made wallpaper by viewing the picture, then press “more”, choose “set as”, and then “wallpaper”. That’s also how you replace your phone contacts default droid picture with a picture of them. (Or if your friend leaves their Android phone lying around, replace the picture that shows up when her mom calls with a picture of something obscene.) If the picture you want to set as wallpaper isn’t the right size, it prompts you to crop it to the correct dimensions.

Apps

Here are the applications that I use the most, not including Facebook, camera, and other stuff that comes pre-installed. Just launch “Market” and you can search for them:

  • “Live Scores” by Sportacular —Good sports application
  • Weather Channel
  • BatteryTime Lite
  • DroidLight by Motorola—a flashlight
  • Compass by Snaptic
  • Aldiko, an e-book reader
  • Advanced Task Killer Free—good for freeing up memory on occasion
  • Proxoid—use your phone’s 3g network on the laptop via USB, great in a pinch.
  • Connectbot—excellent ssh client and the main reason I bought the phone
  • AndFTP—excellent sftp client
  • MLB At Bat—worth every penny of the fifteen bucks or so
  • XKCD Viewer—quick, convenient laughs.

Here’s some stuff that I don’t use that often, but are very cool and worth having around:

  • Metal Detector—uses the magnets in the back that detect whether the phone is in a dock to see if there’s any iron nearby. I’ve used it to find little screws.
  • Google Sky Maps—just download it and be amazed.
  • Google Translate—it prompts you also to add…
  • TTS Service Extended—a speech synthesizer (your phone can now order beers and pick fights in thirty languages)
  • Google Voice—transcribes my voicemails
  • Google Earth—pretty world
  • OI File Manager—A good filesystem browser

And I also have some pretty fun games, in order of my favorites:

  • Phit Droid by mToy
  • SNesoid Lite—free SNES emulator. Awesome.
  • Cavedroid by Rob Everest
  • Grid Droid—mToy
  • Blocked Stone by mToy
  • Shot 3 by mToy
  • Bebbled by Nikolay Ananiev
  • Labyrinth by Illusion Labs

I also have a silly lightsaber thing, just because some of the iPhone kids in the office have fake sword fights with theirs. I don’t think I’ve ever had to jump in and break up a war.

Widgets

I have three widgets installed on my desktop or whatever you call the workspace on the phone. Widgets are things that look sort of like Application launch icons, but they have interactive behavior. On the center desktop panel, I have the Weather Channel’s large widget instead of having the Weather Channel app launcher. The widget shows the current temperature and conditions, which is much more useful than the static app icon. I also have the new BatteryTime Light widget, that shows what percentage of battery I have remaining. If you press the widget, it launches the application, which estimates how much talk-time, video watching time, etc. you have left before you’d need to charge.

On the left panel, I have a big ol’ Power Control widget, which lets you dim or brighten the screen, turn on and off wi-fi, bluetooth, gps, etc., in order to conserve battery or make the screen easier on the eyes. It takes up a whole row on the panel.

To add a widget, you just hold your finger down on a blank spot of the home screen until a menu pops up, asking you what you want to “add to home screen”, with Widgets as an option.

That’s pretty much what I have installed on my phone, plus WordPress (which I obviously never use) and Twitter (which I read quite a bit while contributing very little).

Later update: I’d also recommend setting your default alert sound to “None.” Some of the more poorly designed applications don’t allow you to customize the sound (I’m looking at you, weather channel) and so you get a bunch of ambiguous bleeps and bloops from the pocket.

YouTube Programmer discusses HTML5 & Flash

Wednesday, June 30th, 2010

The essay covers many of the strangely disregarded inadequacies of the HTML5 “video tag” project that I discussed long ago in this post, as well as a few I wasn’t aware of.

Here it is.

I’ve got a post coming with some thoughts on the WebM project, mentioned in there. As a preview, I’ve got their VP8 encoder compiled on my research server and have been extremely impressed with the quality of the output, although haven’t yet dug through the source code enough to figure out how to map ffmpeg flags to some of the really useful features of the codec.

Writing an academic paper, though, and working on the dissertation—priorities are priorities.

In Search of Late Life

Monday, May 17th, 2010

[This is a case of thinking a little bit too hard about something outside your field. What follows is largely wrong to the point of the absurd. The "Rates of Decay" hypothesis is probably not baloney and worth thinking about.

However, the kind of exotic rotation I propose in the "You're Thinking Too 2-Dimensional, Marty" hypothesis is implausible to the extreme without an elaborately doctored baseball and, furthermore, completely unnecessary. I neglected to consider the most basic mechanics equation, F=MA, that forces cause acceleration, and so no exotic spin is needed for the ball to be deflecting more rapidly as it approaches the plate (both due to the constant force of gravity and the magnus, which decreases as velocity and spin rate decrease.)

There's no harm in making a mistake except when you're looking for mistakes. With a little help from an expert on this, my error's found and I like the "Back to the Future" joke, so am not erasing the post. Also, the rate of decay hypothesis has some merit, I think. The correct lesson to take away from it, though, is the more obvious one that a baseball has to be given a very fast initial spin to maintain accelerating deflection late in the trajectory as velocity and spin-rate decrease at some unknown, but measurable, quantity.

As for the distinction between "frisbee" sliders and regular-old sliders, that's something that my research specialty can address: just need to find cases where people refer to a slider as a frisbee slider and see whether the pitch was actually thrown differently than for normal sliders. My guess is that the angle of rotation would be flatter to the horizontal. And maybe in the case of a sinking fastball, it has less backspin so that it falls faster than another fastball. Data exists publicly to evaluate both claims in a later post.]

When someone who is the best in the world at performing a given task says that they failed at it for a particular reason, I’m biased to believe their explanation. So when great baseball players all claim that late movement is what caused them to miss a pitched baseball or to hit it poorly, I’m inclined to believe that pitches really can break late, and that their explanation is not related to some psychological factor of human perception that causes us to misidentify a rapidly spinning object’s true trajectory. In this post, I’ll present two ideas on late break, the first is probably testable on existing data, the second requires unavailable data.

Pitch movement

Once a pitch leaves the pitcher’s hand three forces continue to act on the ball after the initial conditions set by the pitcher to cause the ball to deflect from its initial trajectory. Two of them are out of the pitcher’s control: gravity pulling the ball downwards and drag slowing the pitch’s velocity. The third force is the Magnus force that is exerted on the ball perpendicular to the direction that it is thrown in the plane of its axis of rotation and in the direction that the front of the baseball is spinning towards. A fastball thrown over the top leaves the fingers with backspin, and so the magnus force opposes gravity and keeps the ball from dropping as fast as it would without the magnus force; a curveball thrown with a snap of backspin has a magnus force that makes the ball drop more than it would by gravity alone; cutters, sliders, and screwballs have sidespin that make the ball move in a sideways direction. The best publicly-available quantitative study of magnus forces was done by Prof. Nathan of the University of Illinois Physics department, the paper, The Effect of Spin on the Flight of a Baseball, and slides from a talk on the paper are available from his Physics of Baseball website. In that paper, a major conclusion (which contradicts predictions of the aerodynamic model of Robert Adair, the first official physicists to the National League) is that for the pitch velocity range for baseballs thrown by professional baseball pitchers (between 50 and 100 mph), the amount of magnus force is not strongly dependent on the velocity. [This is badly mis-stating the conclusion: "the lift coefficient does not depend
strongly on velocity at a fixed value of omega/v, where omega is the spin rate and v is the velocity."
]

Rates of decay

One way that a baseball could deflect more late in its trajectory than early in its trajectory is if you define break as units of movement in the X and Z dimensions per unit movement in Y, where Y is the horizontal dimension from the pitcher’s mound to home plate, X is the horizontal dimension to the catcher’s left and right, and Z is the vertical dimension.

Take, for example, a fairly typical slider thrown with an initial velocity of 90 mph (call it 130 fps—the figures here are back-of-the-napkin stuff just to illustrate differing proportions) and crossing the plate at 80 mph (~115 fps). It’s moving in the Y dimension 12% slower as it crosses the plate than when it left the pitcher’s hand. Let’s imagine for the moment that the spin of the ball doesn’t change as it travels from pitcher to catcher. We know from Prof. Nathan’s work that the magnus force is not dependent on velocity—only rate of spin—at these speeds [See note in above section], so if the ball breaks 6 inches in the X dimension due to magnus force during the trajectory from mound to home plate, it’s breaking at a uniform rate of 1fps in X at all times during flight. Thus, if we define break as rate of spin-induced movement per unit velocity to plate, the break does in fact increase late in the trajectory (1x/130y < 1x/115y). In a game of inches, perhaps enough.

The ball's spin rate no doubt does decrease during its flight due to drag, but if the ball's spin-rate decreases at a normalized rate less than the ball's velocity decreases, then this sort of late-movement is real.

You’re Thinking Too 2-Dimensional, Marty

A second idea of how a pitch might deflect more at various points in its trajectory towards home plate, and one that I find more likely [see note at top], is that the plane of rotation changes while the baseball is in flight. The example I have in mind here is the perfect sinking fastball. When it leaves the pitcher’s hand, it’s thrown with (say 2000rpm of) backspin, so that the direction of magnus force is upwards, significant and working against gravity. Suppose that the pitch is also thrown such that its axis of spin rotates 180 degrees clockwise from the batter’s perspective over the distance from the pitcher’s hand to home plate. In this scenario, the ball would have “hop” for the first third of its trajectory, would slightly break horizontally for the middle third, then drop dramatically for the last third. This is because the direction of magnus force would turn uniformly from up, working against gravity; to the side, neutral with respect to gravity; then downwards as it approached the plate, in concert with gravity.

If it seems far-fetched that a pitcher has the kind of fine motor skill needed to impart such a finely controlled spin on a baseball, consider that knuckleball pitchers typically throw the ball such that it makes a half rotation from pitcher’s hand to catcher’s glove. This is known because the ball is spinning slowly enough to measure the spin with high speed video. A pitcher who puts late movement on his fastball has to impart that same amount of spin while also adding a component of very fast spin in the perpendicular direction (and another twenty miles per hour of initial velocity or so). If you are still not convinced, pay careful attention to the athletes themselves, as in this postgame recap from 2007:

The change in Halladay’s cutter wasn’t drastic, by any means. Fasano said that he offered a few tips about varying finger pressure with the grip that creates different types of movement with the pitch.

That’s recounting advice from backup catcher Sal Fasano to Roy Halladay, a pitcher to whom late movement is frequently attributed, as in this story by a different catcher of Doc’s:

“A lot of guys, they’re just kind of surprised,” Barajas said. “The pitches that are coming in, they look like balls. I’m sure they go up and they look at the videos and the pitches aren’t exactly where they thought they were going to end up, because he has so much late movement — late life.

Subtle changes in finger pressure to create different types of movement is the sort of tweak that, with a lot of practice and natural skill, would seem to add that crucial spin component that’s worth all those tens of millions of dollars.

So a perfect sinking fastball’s plane of rotation would make a half rotation from pitcher to plate, perpendicular to the direction the ball is thrown; a perfect cutter would make a quarter rotation, etc. This seems intuitively correct to me in considering that you can throw a cutter from the same arm slot as a straight fastball; and that a frisbee slider thrown with a fixed sidespin moves differently than a late-breaking slider with a slowly rotating angle of rotation.

I believe late movement is a real, measurable phenomenon in baseball, but it’s not to be found in the published Pitch F/X data, which is post-processed to give a smoothed, average trajectory assuming a fixed angle of rotation. Perhaps if all the in-flight pitch location recorded were available, it may be possible to estimate the angle of the ball’s rotation, but I’m not sure. What you’d really need is an incredibly high-resolution, high frequency doppler measurement so you could tell which side of the baseball is moving fastest and thus what the ball’s angle of rotation is for many samples during its flight.

Configuring a Multi-boot System

Saturday, May 8th, 2010

I’m going to sort of live-blog my process of configuring my new office computer so that it’s a dual-boot Windows 7 and Linux machine. The first thing you need to do is select your preferred linux distribution and download the installation media. You can learn about pretty much every distribution out there from DistroWatch.com. A distribution is the set of standard applications, package installers, and configuration tools that different development teams maintain and distribute, wrapped around the Linux kernel. At work, we use the commercially maintained Suse. Many people I know use the community maintained Ubuntu. I use Slackware, which is maintained primarily by Patrick Volkerding. If you’re interested in having a Linux system that’s very painless to use and customize, I’d probably recommend Ubuntu. If you want to learn a lot about how Linux in specific and operating systems in general work, you’ll have a lot of fun with Slackware, which works just fine out of the box, too.

On we go:

1. You need to have some unallocated space on an installed hard disk. You can either slot a new one into your box or resize the existing disk partition. In the past, I’d use Partition Magic, which you can get on Hiren’s boot CD. Windows 7 has a very welcome “Shrink partition” routine, accessible by right-clicking “computer” in the start menu, and choosing “manage” in the context menu. Click the Disk Management submenu, then right-click on the system volume and choose “Shrink volume”. My computer came with a 1tb disk. I’m sacrificing 216gb for the Linux installation. 200 of that will be the linux partition and the other 16 will be a swap partition. When an OS runs out of available memory, it stores some of the data that was to be kept in memory to the hard disk in what’s called a page file. Windows stores page files on the system disk. Linux uses a dedicated disk to swap excess data from memory to. A sound rule of thumb is to allocate twice the amount of RAM for the swap disk and you’ll likely never see your system crash for lack of available memory.

2. Put the linux installation disk into your optical tray and restart the computer, booting off that disk. How to do that depends on your computer’s BIOS: some automatically boot from a CD when one is present, mine requires me to press F12 at boot time. I originally learned how to install Slackware (and a bunch of other stuff) from Grogan at BitBenderForums, although much has changed since then—notably, there’s no real point in partitioning your disks the way he did back when he wrote that. You just need one disk partition for the system and the swap partition. This is my first time installed Slackware since version 11, I think, and supposedly much has improved in the current release, which is 13. Grogan’s procedure is still a good guide: use fdisk to create your two partitions from unallocated space, change the swap partition’s id to 82, then run the slackware installer with setup. My computer came with 3 partitions installed, two of them for rescue partitions, one for Windows 7. I created an extended partition with the two logical partitions inside.

3. A few things have changed in the installer already. The EXT4 disk format is now available. Surprisingly Reiserfs is still, too, in spite of its author’s murderous ways. NTFS support is available now, too. The installer recognized the windows disks that are on this machine and asked whether I want to be able to see them when booted to Linux, I opted to allow users read-only access and to give root RW privileges. I did the full distro installation and enabled a few of the network servers like samba and nfs. After setup is done, you restart the computer and choose Linux in Lilo’s boot menu. In the past, I’d had to edit Lilo pretty extensively, but it appears to have installed nicely this time automatically. I create a non-root user for myself using the adduser script, then configure audio with alsaconf.

4. Everything works great out of the box. Slackware is configured to boot up to a bash shell. Since I’ll be using this as a desktop workstation, I’m changing that so it’ll boot up into the KDE graphical environment. To do that, you edit /etc/inittab using vim or emacs, and changing the line that reads:
# Default runlevel. (Do not set to 0 or 6)
id:3:initdefault:

to this:
# Default runlevel. (Do not set to 0 or 6)
id:4:initdefault:

With that done, I issue the command:
shutdown -r now
to restart the computer and boot it up to Slackware in KDE using the user I created. (And the current version of KDE is quite beautiful out of the box).

That’s it. I’m done. Took me about an hour start to finish.

Later: Turned out that the installation killed my ability to boot to windows. Remember those utility partitions I mentioned? Lilo automatically assumed the windows system partition was sda1, which was a diagnostic partition. Editing /etc/lilo.conf to make windows boot to sda2 instead fixed that. I’ve also got the proprietary driver installed for my ATI graphics card, so I’m rolling along at full 1920X1080. I also had a weird problem with the network that sorted itself somehow after a bunch of poking at stuff.

On the Future of Personal Computing

Thursday, April 29th, 2010

Eric S. Raymond wrote a compelling pair of essays a short while ago about how Smartphones could replace desktop computers and how the competing smartphone markets spell good news for the open-source movement:

How smartphones will disrupt PCs
Greed kills: Why smartphone lock-in will fail and open source win

The first essay describes a near-future scenario where your home computer setup is basically a good monitor, a full-size keyboard, mouse, and a docking station for your smartphone to interface with those devices. Your work setup would be the same, and plugging your phone in at the office provides you with the same computing environment you have at home, and, in a more restricted mode, while on your way to the office.

The second is how Apple’s strategy to lock their customers into using only software approved by the company (and deemed non-threatening to opportunities for in-house profit) is doomed to failure, making a loose analogy to how IBM’s hardware designs came from behind to win out over Apple’s, back in the day. Their walled-garden model, I think they like to call it.

I find the main argument of both essays to be completely persuasive and have a bit to add about how I see computing going in the near future.

First, a bit of introduction: I have no dog in the Apple vs. Microsoft hunt. I think they’re both pretty crappy companies that I wouldn’t want to work for. I tend to prefer Windows to Mac, for the sole reason that everyone knows Windows is garbage, but some people seem to think Macs are significantly better. Mac OSX is no better than a severely broken linux distribution (with an extremely hands-off, generally successful package handler) as far as I have investigated and the shell environment needs almost as much augmentation as a Windows build in order to function usefully. My personal computers are all dual-boot Windows XP and Slackware. At work, my workstations run Windows XP, except one Mac that I use for audio ( since Bias makes some nice software for that platform)…

Over the past few years, I’ve worked hard to move as much heavy-lifting computing work onto dedicated linux servers to free up resources on my and my colleague’s workstations for creative work. That’s the key of where I see computing going. We’re going back to a terminal-mainframe system, in which ERS’s idea of evolving smartphones works great.

An obvious example of this is my own smartphone, the Droid. I’ve got an application called ConnectBot installed on it that let’s me run secure shells on any server I have access to in the world. I have access to enormous computing power at all times from a pocket-sized, ubiquitously networked device.

Another, slightly further-off example of the return to terminal-mainframe computing is in thin clients. I could easily see cable companies and other ISP’s offering thin clients in the near future, where the company maintains a small server cloud and rents thin client boxes and peripherals to customers that access it. They’d no doubt offer subscription tiers that give the customers access to different software packages. If they were to adopt an Apple-like model, where customers would only be allowed to install “signed” software that wouldn’t infringe on their tiered subscription business model, it would be an unpopular service. If the tiers were worked more like the standard cable subscription model, where customers who pay more would get access to bundles of services that they’d already have to pay for (like ESPN360 access and other services like that), it would make sense for a lot of people, who’d free themselves from a lot of problems like keeping their hardware up to date, maintaining a secure computing environment with redundant data storage, and having access to a routinely scaling amount of computing power and storage with very little trade-off: they’d just be giving their money to Comcast instead of Best Buy.

As a quick aside before getting to the point of this essay, I don’t have much faith in the future of iPads or the Android tablets coming out; or for the existing netbooks. They strike me as half-measures: I want a portable, inobtrusive computing machine and I want it to be integrated seamlessly with my desktop workflow. The screen should be in my hand or on a big screen, not perched on my knees, girlishly pinched together.

To sum up, a vision of the very near future: ESR argues that smartphones can displace desktop workstation boxes and that closed software markets are likely to fail in competition with freer alternatives; I observe that thin-client type devices might fill the void more quickly than smartphone computing power can keep up (and satisfy marketplace demand given telecom contracts and what-not), thus moving smartphones into that sort of a terminal-server constellation.

So where does Flash fit in to this equation, at the risk of raising the ire of the early-adopter Apple segment?

I don’t want to get into the Flash vs. Apple war, which I find to be overheated, to put it mildly. I do want to make some observations and predictions on the future of Flash, however.

While Flash is largely closed and proprietary, it does allow content developers to make applets that work on any platform that has the Flash plug-in—and that’s a very good thing. I hope that Flash 10.1 works well on phones. Almost certainly it’ll work better on Android than on PalmOS or Windows Mobile 7, for the simple reason that Android developers uniquely have no profitability motive to close off access from the eventual Flash plug-in for Android devices from the hardware video decoders available on the device.

And somewhat counter-intuitively, I believe it to be an advantage that Flash is largely closed and proprietary. You can do things with Flash that you can’t do with any HTML5 video player, most importantly, you can play streaming video from an RTMP server like FMS, Wowza, or Red 5; and you can serve up copyrighted materials in a way that makes it as difficult as possible for people to steal the content and save it to their own computers. You need a proprietary plug-in if you want to do that. (Which I need to do.) Hulu and many Universities will continue to depend on Flash because there is no viable alternative. Without a closed plug-in (and some other things) there’s really no way to make copyrighted materials available and protected.

The non-philosophical complaints that I see about Flash most often are: “I hate advertisements!”, “My scroll wheel stops working when my pointer hits Flash objects!”, and “It’s inaccessible to the blind!” The first one is a bogus complaint: there will always be advertisements and you can do things even more obnoxious with javascript than what you can do with Flash. The second one is more of a browser problem than a Flash problem as far as I know. That happens with Firefox, but not with IE. And seems a pretty damned trivial complaint to me. The last one is just a fact about the priorities that Flash programmers seem to have, because Adobe puts a lot more effort into making their products support accessibility features than most companies out there. There’s a fourth complaint that I don’t hear much about, that it’s pretty hard to embed flash with w3c compliant code and make it work in all browsers, but that’s a solved problem.

I’m sure that Flash will stick around for online video because I believe the HTML5 video tag is somewhat misguided or at least that the direction HTML5 is heading has been hijacked somewhat by folks with non-altruistic interests. (As background, one of the new features in HTML5 is a video tag that is intended to allow web designers to add video to their pages as easily as they add pictures. They don’t need to design a player, that work will presumably be performed by the browser itself, although they can use javascript to override whatever the browser wants to do. The way it’s done pre-HTML5 is by using a plug-in like Flash, quicktime, or windows media player that has controls and can decode and play the video file that you send to it. Since HTML5 pushes the problem onto the browser developers, you have the problem of these competing organizations having to agree on what codecs are supported. Firefox basically won’t support any codecs that anyone uses—just VP3 which is probably patent-free, Safari will support the patent-encumbered h.264 and some prorietary mac stuff, IE will support h.264 and windows media stuff. The Flash plug-in can decode h.263, h.264, and VP6 video in MP4 or FLV containers.) I’ve avoided encoding video to MP4 containing h.264/aac because I’m not certain where the University of Illinois sits with respect to MPEG-LA’s potential royalty claims. Apple and Microsoft both have financial interests in pushing h.264 since they’re members of MPEG-LA. I’ve been using h.263 (Sorensen Spark) in FLV containers, since nobody seems to pursue Lucent’s IP on it. I also prefer the way it renders text on a chalkboard to VP6 and like how fast it encodes relative to h.264. I don’t know whether any browsers will support h.263, but I don’t care, because I’ll be delivering it via the Flash plug-in.

So my prediction is that Flash sticks around and that eventually, Apple and Adobe will compromise by allowing a stripped down Flash plug-in that only includes the features needed to decode and render video and that requires HTML5 style controls to manipulate. That’s assuming, of course, that Flash 10.1 works as well as it needs to on mobile devices.

2010 Version of Pitch F/X

Monday, April 26th, 2010

I checked out the Pitch F/X data for today’s Cardinals at Giants game to see if there was any new fielding information included, thinking that if it’d show up in the DB, that’s where it’d be since AT&T had the additional cameras installed late last season.

No dice.

However, the database has a few new features and is organized a little bit more nicely. The most interesting features that jump out are a “nasty” attribute to each pitch and a timestamp parameter, “start_tfs” to each event node. I’ll be interested in seeing what kind of observations “nasty” makes; it’ll be fun to be able to calculate which pitchers are the fastest and slowest working with the timestamps, among other things. These additions make the database more useful for other uses, too, and the overall re-organization makes it more user friendly.

A little bummed that the field f/x data’s not included. Once it is, I expect Gameday will start to look much like an old NES baseball game. I mean that in the best possible way.

Small update: Someone more knowledgeable than I pointed out that timestamps are present on all pitches for older data, too, in the sv_id attribute. Fantastic.

DVRCast for FMS 3.5

Monday, April 19th, 2010

Today, I installed the DVRCast application on the Flash Media Server at work and ran into a little bit of an underdocumentation problem. We run our FMS in an origin/edge architecture and the supplied documentation for DVRCast only explains how to install on a single-node, origin-only server setup. The installation archive comes with two different application folders, dvrcast_origin and dvrcast_edge. It was pretty obvious what the two were for, but didn’t have anything to go off of on how to install dvrcast_edge to the edge servers.

A quick internet search revealed that someone else had encountered the same problem, but didn’t see a solution given.

What I did was install dvrcast_origin to the origin server per the instructions, but renamed it dvrcast. Then I rewrote the host.ini file in dvrcast_edge from this:

#name primaryIP;secondaryIP
server1 localhost;localhost dvrcast_origin

to this, using the correct name and IP address for the origin server, of course:

#servername primaryIP;(secondaryIP) app_name
origin.server.com 123.456.789.012 dvrcast

Works like a charm. The parents are going to be so happy at commencement…

As a side effect of getting this up and running, I also have multi-rate streaming ready to go. Pretty successful day one of programming week.

Nimrod’s Ploy

Tuesday, March 30th, 2010

I gave a guest lecture this morning on Machine Translation. To keep the talk as entertaining as I was able, last night I wrote a cgi script (that I named Nimrod’s Folly) that takes an input sentence in English, queries Yahoo’s Babelfish web-app to translate it to German, translates the German to French, and the French back to English. The toy isn’t meant to pick on the Babelfish system, which is quite state-of-the-art, it uses that one simply because it has a simple interface that doesn’t print the translation using javascript like Google’s does. Machine translation is a very difficult task, and the state-of-the-art systems suppress dealing with some of the complexity for very good engineering reasons.

Nimrod’s Folly is a variation on the Babelizer java program.

If you find a particularly entertaining sentence, let me know. Getting the students to suggest difficult-to-translate sentences was like pulling teeth.

I may re-write the script to translate everything back into English before translating to a new language, just so that limitations in the French-German dictionary not present in the French-English and German-English dictionaries won’t produce occasional screwy results.

Bread and Circuses

Wednesday, March 10th, 2010

Unwanted men, we need you to curb the welfare Amazons The editor who wrote the headline did a poor job comprehending the essay, which is worth reading.

On a related note, I’m not sure whether I was unable to read the sequels to Beggars in Spain because they simply aren’t as good as the first one, whether the imagined underclass dialect of English was too linguistically improbable and distracting, or because the vision of a future with a massive unproductive and aristocratic underclass dependent on bread and circuses was simply too depressing. The first book in the series is required reading for hard SF fans, though.

I’m not Laughing Either

Thursday, February 11th, 2010

When I first started watching college basketball, I found the statistics kept fairly useless. Naturally, coming from a baseball background. (As a fan, the only sports I know I’m able to perform at better than the average person my age are hockey and swimming [I'm also terrible at softball].) Ken Pomeroy and Jon Gasaway, both now writers at Basketball Prospectus introduced me to tempo-neutral statistics. Traditionally, basketball players are measured by the number of events per game: points per game, rebounds per game, etc.. Tempo-neutral statistics use as the denominator possessions instead of games: points per possession, rebounds per possession, etc.. This is a major improvement in perspective because not all teams play the same style. A fast-tempo team like Texas is currently averaging 75.4 possessions per 40 minutes on the floor, their offensive philosophy can be inferred to be that the first good shot available should be taken. A slow-tempo team like (prototypically) Air Force averages 60.1 possessions per 40 minutes. They attempt to eat clock by moving the ball around until the shot clock starts to run out while denying their opponents high percentage shot opportunities on defense.

A player on Air Force could theoretically be the best shooter in the country and still not make point-per-game leaderboards, which means that the PPG statistics aren’t capturing the information that you would value when evaluating top shooters. Tempo-free shooting would reveal his prowess.

The point is that in data analysis, it’s important to neutralize contextual factors, when possible. This article is an egregious example offailure to perform even the most obvious context neutralization, i.e. dividing something you’re counting by some other number that gives you a rate that captures the facts that you want to understand.

The article reports on a quick and dirty corpus analysis of the token ‘(laughter)’ in White House presser transcripts to estimate how receptive the press corps is to the white house press secretary. The formula apparently chosen is laugh_count / days . I don’t listen to politicians and their flacks any more frequently than they read the laws they pass, so I don’t know if it is true that the press secretary speaks with the press for the same amount of time every day, but I find it unlikely in the extreme, especially when the article quotes a Washington Times correspondent with, “Robert’s little digs and evasions have lost their power to amuse — particularly since we haven’t had a presser since July.”

If true (and it can’t be) that’d be like measuring a basketball player not by points per possession, or points per game, but by points per week. Some weeks his or her team doesn’t play, but that doesn’t mean he’s missing shots.

The moral of the story is that if you’re going to do a corpus analysis, even if it’s for a silly piece like that, you have to count the right things, plug them into the right formula, and report the result accurately. Presenting your source code is always a great idea.

Some Things I Learned in the Past Week (Part I)

Tuesday, December 8th, 2009

It turns out that men-on-base information isn’t preserved in the Gameday database. I hadn’t ever noticed it before, but if you load up an old game like this one between the Angels and Blue Jays from 5/7/9 and look at any plate appearance aside from the final one, you’ll find that the Runners on: dialog will never change to reflect the PA you’re looking at, nor will the little dots appear on the field schematic to indicate a player’s occupying the base.

The only place where that shows up, in fact, is in the gameday_Syn.xml file loaded by Gameday. There’s a subtree in the file containing information about the next two batters and the current (final) pitch sequence, as well as containing nodes for the three bases with Boolean attributes to indicate occupation. That came as something of a snag for me this past week, but it’s an intriguing one.

In any case, I’ve got to do something far more interesting than table-lookup for this part of the project to work but have a plan. So far, it’s looking good—should have something quite amazing built by the time I hit the sheets tomorrow night.

Update: Some more stuff I learned this week: my data indicates that there were 283,862 plays or personnel changes made during the course of the 2009 MLB season. Of those, the most frequent were assisted groundball outs at 32,655 that didn’t advance a runner, followed by 31,267 fly ball outs that didn’t advance a runner. The third most frequent play type was the swinging strikeout: 26,918 of them. There were 13,726 walks issued with 1st base unoccupied and 7,861 pop outs. The most common hits were bases-empty singles on line drives followed by ground ball singles at 7,830 and 7,172, respectively. There were 3,602 two-throw double plays with outs at 1st and 2nd. 1933 batters struck out on foul tips. There were 9,896 pitching changes not involving a defensive switch. One batter lined into an unassisted triple play. Six other players hit into a triple play, four on liners, two on ground balls. Fifteen players hit inside the park home runs. 862 play-types occurred only once, out of 2,300 different play-types (suppressing player and position names).

Amazingly, this information has non-trivial uses… Trust me!

(Re-ran the data set, so the numbers changed at 10:23 from an hour or two earlier.)
((Turns out those numbers were wrong, but I do have them correctly now.))

Final update: I noticed what seemed to be some odd inconsistencies with that dataset and figured it out. Those counts include spring training and WBC games, so those numbers (and some of the underlying data) are a slightly screwy.

Coolest. Thing. Ever.

Thursday, May 14th, 2009

The World’s Best Illusion may explain why a curveball is so difficult to hit.

Need a little help

Friday, April 10th, 2009

Thanks to everyone who participated. We got excellent data and are looking forward to providing live streaming services to the University of Illinois.

Garbage

Wednesday, November 5th, 2008

I’d like to take this time to point out that Realplayer 11 is a piece of garbage, shitware of the worst sort. The Mac version is almost completely non-functional; the Windows version isn’t much better.

And Realnetworks makes it hard to find the older versions, the bastards. If you need to use RealPlayer for any reason, I highly recommend you downgrade to version 10, available here for Windows and here for Macs. I very rarely watch movies on my linux machines, but would guess that compiling an MPlayer would be a better way to go. The last version of Realplayer for linux wasn’t too impressive.

Myco-diesel

Tuesday, November 4th, 2008

This gentleman Gary Strobel and his students are doing exciting work. See here.

Stink-Detector

Tuesday, September 9th, 2008

A San Diego startup is releasing a toolbar that’ll highlight in red phrases in a news story that violate journalistic ethical standards or (soon) that are suspiciously similar to official press releases.

Ordinarily I’d speculate on what sort of a similarity scoring algorithm they used to identify text cut-n-pasted from press releases but instead I’ll joke that all that red will be high on the eyes.

Clarification: I’m not joking.

BigDog

Thursday, July 10th, 2008

This is a very cool robot.

Check out the clip in the video when the handler kicks it.

And this is a brilliantly funny spoof.

Note to Self

Thursday, July 10th, 2008

See if this works.

About three or four years ago, I’d been up all night writing a piece of software for a research project. I finished at around 4 or 5 in the morning and was very pleased with myself. Crashed for a few hours then went to get the work off my laptop. The laptop wouldn’t boot, though. After about an hour of cussing and googling, I found that my hard disk had somehow platter locked itself, meaning that it had physically locked down the disk until I keyed in some password. At the time, it looked pretty much un-breakable: the disk had to be powered down after five failed attempts to guess the password so a brute-force method wouldn’t have worked to crack it back open. The best I could find was a solution to get an identical, unlocked disk and swap out the platters.

Searching around just now, I came across that very simple solution that people in several online forums report to work very well. Apparently the platter lock mechanism has two different passwords, one set by the user and a master password set at the factory. If true, I’ll have access again to a huge amount of pictures and music that’d been lost to me for a long, long time—in addition to that since re-written piece of software.

Way to Go, Comcast, Ya Jerks!

Tuesday, June 17th, 2008

My cable provider, Comcast, is on the verge of picking up the Big Ten Network, which will allow me to watch all sorts of Illini basketball, football, volleyball, etc., at home instead of needing to go to satellite-equipped bars (two of which are in my top three bars in town, anyways). That’s outstanding.

I understood both sides of the stand-off. The BTN didn’t want their channel shunted off to an extra sports-tier package where it wouldn’t be seen by most of the fans and Comcast didn’t want to pay through the nose for the programming. The prolonged negotiations dropped the price Comcast is paying almost in half which would certainly be passed on to the customer—and then some. The thinking around here was that no deal would get done after the football season came and went—that Comcast had weathered the storm and the BTN would fold. That would’ve been a lousy outcome. The network’s going to be a great success now that it’ll actually be seen.

Of course, at about the same time, I find out that my cable internet provider, Comcast, is considering going to a monthly 250GB cap on bandwidth usage with big charges for going over. If the big ISPs do this, I could see a serious chilling effect on content providers, with webpages scaling back on the multimedia delivered on their pages, not to mention what it could do to distance education and such that I work on professionally. They’d need to provide some kind of method for customers to check how much bandwidth they’ve used so far each month. I’d guess they’d implement that with some kind of shoddy spyware. If it were my job, I’d just put a section on their billing website where you could check and offer a desktop tool to monitor a secure feed from it or something.

Fortunately, most of my work from home involves nothing more than a plain-text ssh connection. I doubt I use 250GB… That’d probably mostly effect people with lots of roommates sharing a connection more than anything else. I could see the next generation of consumer routers implement caching.

Pitch F/X

Thursday, April 24th, 2008

From jnai at Sons of Sam Horn, a handy primer for Pitch F/X data. The data is generated by an array of high-speed cameras installed in all MLB parks last season and streams to the gameday applets to show the path of each pitch thrown in a game.

This tool is an easy way to take a look at the information.