John Bafford's journal

> recent entries
> calendar
> friends
> profile
> previous 20 entries

Thursday, May 22nd, 2008
8:52 pm - Random Science Fact
Wikipedia: "Because the cross section in weak nuclear interactions is very small, neutrinos can pass through matter almost unhindered. For typical neutrinos produced in the sun (with energies of a few MeV), it would take approximately one light year (~1016 m) of lead to block half of them. Detection of neutrinos is therefore challenging, requiring large detection volumes or high intensity artificial neutrino beams." (emphasis mine)

It takes a light year of solid lead to block half of the neutrinos from the sun, and that's only challenging? Ridiculousness of the scale of such a thing aside, what then, does Wikipedia consider to be difficult?

current mood: amused

(1 comment | comment on this)

Wednesday, April 16th, 2008
7:11 pm - yum yum ZZZ ZZZ
The hotel's restaurant, of which blissfully I am the only patron at present, has a sign indicating a maximum occupancy of 31. There are, however, 16 tables of 4 chairs (for a total of 64 seats).

current mood: tired

(1 comment | comment on this)

Monday, August 6th, 2007
12:59 am - iPhone Hacking
I have developed a patch for the iPhone MobileTerminal that enables the beginning of proper event processing.

Part of the problem was a lot of trial and error, involving two major realizations:
1) iPhone apps don't get orientation-changed events unless they're launched from the GUI
2) Figuring out where in the __GSEvent structure the eventType parameter is.

This patch introduces a number of problems into MobileTerminal, namely causing it to not exit properly, causing it to exit on iPhone sleep, and causes it to (intentionally, because it's only temporary debug code) leak memory when printing event alerts.

current mood: happy

(1 comment | comment on this)

Tuesday, April 24th, 2007
11:51 pm - "I underestimated the fiendish charm of the Waxman, and now Arthur is ensconced in the waxy, wax-like waxiness of her wax."
"Would you not agree that, as the embodiment of America's commitment to truth, that Captain Liberty herself is subject to the Freedom of Information Act?

"You say that it's a disgrace to this country that its symbol can be seen in the flesh, but is she not also the symbol of an open society that is the envy of every nation on the earth?

"And therefore, as that very symbol I ask you, would it be appropriate for Captain Liberty to be photographed in anything
less than the nude?

"In fact, isn't it an insult that she's not naked right now?"

-- Batmanuel, "The Tick"

(1 comment | comment on this)

Tuesday, February 6th, 2007
4:23 pm - Steve Jobs: "Thoughts on Music"
Apple CEO Steve Jobs has written an interesting essay, "Thoughts on Music", in which he explains why Apple has refused to license its FairPlay DRM scheme, and calls out to the music industry to end copy protection. Jobs also points out that the vast amount of music on iPods is DRM-unencumbered, and argues that the 3% of music on iPods which is DRM-encumbered is hardly enough to lock users into the iPod platform.

It will be interesting to see the fallout from this essay, both from the music industry (which has recently shown signs of re-thinking DRM), and the European countries like Norway, which has declared Apple's DRM illegal.

(Also posted on AppleGeeks)

(comment on this)

Friday, February 2nd, 2007
11:39 am - Making Fun of News
CNN Headline: "Suspected tornadoes kill at least 14 in Florida".

So, on the one hand, we have lite-brites that are guilty even after being proven innocent, but the weather still has innocent until proven guilty privileges?

What's next? Some city panicking because of suspicious shoes on critical infrastructure?

(comment on this)

Tuesday, January 30th, 2007
10:45 am - Mandatory Draft for Everyone?
If I"m reading HR 393 correctly, it has been proposed that everyone aged 18 - 42 will be required to perform two years of "national service", either in the armed forces, or in some other capacity as determined by the President. This would also ammend the Selective Service Act to incorporate women as well.

(5 comments | comment on this)

Wednesday, December 27th, 2006
9:24 pm - National Museums of Bag Search and X-Ray
I wandered over to the National Mall on Tuesday and went through a few of the museums, spending most of my time in the Natural History and Air and Space museums, before walking over to the Capitol and the Washington Monument, before high winds and dark suggested I return home, which involved running into Shimin on the metro.

Overheard at the National Museum of Natural History:
Child (quite calmly): "I request that we go home."
Parent (puzzled): "Then why did you want to come?"

According to the Hirshhorn Museum and Sculpture Garden, what passes for art today is a 3 ft x 5 ft tall solid black oil painting, and a 6 ft or so solid black sphere with one eighth missing. (I think it was solid black. It was kind of hard to focus on it, what with there being almost no illumination anyway.)

I took a bunch of pictures with my new camera, but the only ones I really liked are one of amethyst, one of a mammoth fossil, and one of the Washington Monument at sundown. I thought the amethyst was going to make a nice desktop background, but it's too busy for my tastes. If anyone wants the full-res version, let me know.

As I was going through the pictures I took, I was slightly amused to discover that several birds I took pictures of had actually been tagged.

(comment on this)

Sunday, December 10th, 2006
11:39 am - Son of Mechatable
bludstone: Son of Mechatable.

(comment on this)

Tuesday, November 28th, 2006
7:48 am - titan is down
It appears that titan has suffered some kind of massive failure and won't turn on. I'm hoping it's just a power supply problem, which if it is, is easily remedied since I have a spare. I can't fix this until tonight, though.

The "only" thing affected is mail for the several domains titan hosts. Websites are all on vortex, and are fine.

Hopefully I can get it back up tonight, but in any case, I'm going to get mail services transferred over to vortex ASAP.

I'm reasonably confident no data has been lost, and in the worst case, I can directly attach titan's hard drive to vortex and copy the data.

current mood: annoyed

(3 comments | comment on this)

Friday, November 24th, 2006
7:37 pm - Final Fantasy XII-2
Still enjoying the game.

1) Guest party members make everything so much easier. Especially killing marks. And though the game sets you up for disliking the Ultan-Yensa, I kinda feel sorry for running through their territory and slaughtering them all. It's a slaughter. I run near one of them, and since they're hostile, my three PCs and the guest all run up and go slash-slash-slash-slash-dead-who's next?

2) An extension of #1: except for the plot, boss fights and marks, and wandering around looking at the pretty scenery, this game is really boring. I mean, with gambits, I don't even have to think in order to decimate the inhabitants of the world. I just have to run near them. I can wade into the middle of a tunnel filled with skeletons, go make dinner, come back, the party's killed everything and healed themselves. All the game doesn't do for me is move the characters on to the next area to do more bad-guy slaying. There's only been one area where I actually had to watch their health and pull them out of combat because the security guards were auto-respawning quicker than the party could kill them. I know the game's got a kill counter. I wish it'd show me the actual number. I may be single-handedly responsible for the near-extinction of a few species of animals and sentient humanoids.

3) And just when I was starting to congratulate the villains on having a complex, well thought out, and successful plan, without any hints of gross incompetence, it's time for another Good Idea/Bad Idea.

Good Idea: Testing the magic crystal you took from the good guys to ensure you don't return home with a dud.

Bad Idea: Testing the magic crystal you took from the good guys, against orders, in your airship's most sophisticated testing facility available: the engine.

The End.

4) I'm liking the place names in this game. I want to steal them and claim they were my own.

5) The skycity of Bhujerba, apparently located on a cloud, also apparently has giant wings. It is also the location of the Lhusu Mines, where they extract magicite from the mines. Also in the clouds. One of the city's random moogles made the comment that the magicite is what enables the city to fly, and wondered about what happens when all the magicite is mined. (The mines are almost depleted.) Quite clearly, this city is doomed.

6) Does Fran speak more later in the game? I really like her voice, though I can't pin down the accent. And Balthier's british accent has just the right amount of arrogance to make his opening quip "I'm the leading man" perfectly believable. This voice acting rocks, compared to the last game I played, Xenosaga 3, in which the voiceovers randomly paused in the middle. Of sentences, or at the end. Of a page of text.

7) I forgot about this, until Balthier asked the same thing: WTF is Vaan doing on the adventure? He's been drawn into things because when he was doing his noble thievery schtick he's a (noble) thief stealing from the castle, and just happens to fall into an on-going plot that he's only tangentially involved in because of his brother, and then becomes further involved only because his not-really GF gets kidnapped. But apart from that, why is he even there? He hasn't done anything particularly noteworthy, and nothing he's done has really affected anything anyway. He really does start this game as a nobody, even more so than Zidane or "This is MY story" Tidus. Why exactly are we supposed to like Vaan?

8) Maybe it's too early in the game, but aside from the pre-existing friendship between Vaan and Penelo, there hasn't been any sort of love interest mentioned on part of any character. Doesn't the main male character in FF games usually fawn over the main female character? Or am I only assuming that's the case because I've only played FF 9 and 10? (In any case, it's fine, because I see no reason at all for Vaan to get the girl. I'm just unclear as to whether the girl is Penelo or Ashe)

9) I know it's more "realistic" this way, but it's also really annoying that, in towns, in order to buy stuff, I have to go to seven different shops because they only sell one kind of thing (weapons, armor/shields, accessories, items, magic, techniques, and gambits).

10) I wish the game would tell me which tile on the license board I have to purchase to use a given piece of equipment.

11) I don't have enough money, to the point that I'm actually hampered by it. Don't really recall this happening to this extent in any other RPG I've played. Maybe I need to steal more?

12) On gambits: maybe that's the whole point of this game: develop a complex enough gambit rules list to ensure that your characters can take down bosses with your eyes closed? In that case, I need a "run around in circles" gambit action so my party restores their magic after combat, and a "crap, we're all dead, switch to backup party" gambit. I also need to assign additional conditions, e.g. "If ally HP <= 20%, Hi-Potion, but only in combat", so I don't use up my potions out of combat.

(3 comments | comment on this)

Wednesday, November 22nd, 2006
11:54 am - Final Fantasy XII
Dear Square-Enix,

1) The next time you make me run around town proclaiming "I am THE Basch von Rosenburgh of Dalmasca" to everyone, please come up with more than five different things to say, or I will find a way to make your computers say nothing but.

2) Gambits are more useful than I was expecting. But when I turn off Gambits, I'd like the game to prompt me for a character's next action when ready, rather than just assuming I'd like the character to attack.

3) On the other hand, when I'm running away, I'd much rather my characters still do things that might prolong the running-away, such as using their healing gambits. Also, stop putting my character's weapons away. It lets the bad guys catch up.

4) When I am making with the running-away, it is counter-productive to have one member of the party hang out far out of range, so that if I am in need of emergency healing, I can't tell them to do so. It is doubly counter-productive if the laggard is the healer, and almost dead because I can't tell them to heal themselves because they're too far away. It helps to follow the lead character's path (which I know the game saves, since it draws it on the map), rather than blindly running straight towards them. The sides of stairs and walls will thank you.

5) The license board concept is interesting, but it's also kind of irritating. Especially when the monsters only drop 1 or 2 LP each. And leveling up is too slow, unless the marks are intentionally placed well beyond my current capacity to fight them.

6) I have taken 75,307 steps in just under 14 hours of gameplay. Assuming a 3 ft. stride, I have run 42 miles in-game. I don't know why you bothered to put that counter there, but, cool.

7) Granted, the first things out of Vaan's mouth was "I wanna be a sky pirate!", but, airship this early in the game already?

8) The navigation controls are fine, until I start trying to run around town using only the on-screen map, at which point Vaan inevitably winds up having a seizure against a wall.

9) Some of the music feels like FF Tactics. Which isn't bad, but I've always thought the Tactics music felt delicate and likely to break in half on a whim, so it's a little odd to get that feeling too here.

10) Thek wordks "Magick" ankd "techniks" dok nokt kneedk thek lettekr "k" tok sounkd magickal.

11) It's neat that I can select a party of one or two characters, instead of the full three. Don't see the utility, unless it's for some single plot point later, or to facilitate levelling up one or two characters. (But better that than what I'd occasionally do, which is leave a dead member of the party in the party so that they'd continue to die and give more XP to the survivors.) But, on that note, why, when Vaan is dead and/or petrified, is he leading the party in town?

12) Thank you thankyou thankyou thankyou for solving the problem where, in every other RPG I've ever played, the entire reserve party commits seppuku when the active party dies. You're still killing me, but at least you've killed all my characters before game-over.

(6 comments | comment on this)

Monday, November 13th, 2006
1:09 am - Hushpuppies
At lilinthra's D&D game on Sunday, arterich said something about me trying to argue that bread was six-sided instead of two-sided at Shimin's party on Saturday.

Although I will admit the possibility of making that argument at some point in the past, being that it would be a typical silly thing I'd try to argue, I'm fairly certain I wasn't arguing that this weekend.

Which got me thinking, just now as I'm trying to be asleep, about how one might turn six-sided bread into two-sided bread, by shaving off pieces of the bread in a fashion that removes the crust sides of the bread in a way that the front side tapers to a point before becoming the back side. (Probably, this would involve making the tapering transition rounded so as to prevent someone from claiming you have pyramid-shaped five-sided piece of bread.)

Which led to me wondering about how you would get one-sided bread, to which I concluded it would have to be spherical. I then wondered exactly what kind of bread-making device you would need to make round bread.

I then remembered hushpuppies.

It's been years since I've had some. Anyone know anywhere in/around MD where I can obtain some, or am I going to have to road-trip to a southern seafood restaurant to get some?

current mood: hungry

(5 comments | comment on this)

Thursday, November 9th, 2006
11:53 pm - Üñíçød̼ê ìs̿ w̓e̢ir̯͋d͍

For some reason, I looked up Spın̈al Tap in Wikipedia. The article made reference to the fact that it is properly spelled with a dotless i and an umlaut over the n. But I noticed that the umlat wasn't properly rendering in Safari (it was showing up as a grey square next to the n). So I dragged the square into the character palette and it dropped me into the middle of the combining marks set.

Mac OS X has glyphs for 124 combining marks. Assuming I applied them all, once, to a single character, the result is the mess on the right - a 24 pt. letter "q" becomes a 54x832 pixel beast. (Click for a full-sized image.) I'm going to go out on a limb and say that this is the tallest unicode character ever created.

current mood: amused

(comment on this)

Friday, November 3rd, 2006
6:58 am - I'm Home. Yay.
Not doing a long writeup of the final keynote, "From Lancelot to Lovelace, and Beyond" by Robert 'r0ml' Lefkowitz. In short, Lefkowitz asserts that to be computer literate, one has to be able to read and write the language of computers (e.g. read and write code), and that, currently, we're effectively in the 13th century with respect to the percentage of people who are computer literate.

And now, I become one with my bed. ZZZ.

(comment on this)

Thursday, November 2nd, 2006
1:08 pm - ZendCon Session Notes - Zend Framework
Presented by John Cogeshall (Zend)

The Zend Framework is a modular collection of PHP classes, based on PHP 5, to simplify common tasks. It's a smaller component of the PHP Collaboration Project. It's also supposed to be a demonstration of PHP 5 best practices.

The Framework is intended to be E_STRICT compatible (that is, returning no warnings when E_STRICT is enabled). It's also completely PHP 5-powered, requiring as few external PHP extensions as necessary.

One of the goals behind the Framework is to provide "clean" IP to enable commercial use: real companies can't just borrow code from the internet without clear licensing. The framework is licensed using a PHP/BSD style license, so anyone can use it for anything, with no strings attached. Contributors also have to sign an agreement saying that any code they commit, they either created or had the rights to contribute.˜

John reiterated the "easy things should be easy, complex things should be possible" quote I've mentioned in earlier entries.

One of the features of the Zend Framework is that you don't need to use all of it to use part of it. It's also supposed to be entirely self-contained: there are no functions or constants at the global level: everything is inside classes.

John then went on to demonstrate how this could be used to set up a blog site quickly, but because the start of his session was delayed, he didn't get to do all of the presentation he wanted to do.

(comment on this)

12:48 pm - ZendCon Session Notes - Unicoding With PHP6
Presented by Andrei Zmievski (Yahoo!)

Today is Andrei's birthday, so his birthday present is getting to present an 8:30 session. Coincidentally (or not), this is also session number 2-11.

Tower of Babel
Dealing with multiple languages and encodings is a pain, but it can't be avoided.

In the past, PHP has always been a binary processor; the string type is byte-oriented and used for everything from text to images. The core language doesn't know anything about text encodings and multilingual data. And while they're a help, the iconv and mbstring extensions are not completely sufficient.

Andrei spent some time talking about some of the features of Unicode. Unicode by itself doesn't mean internationalization. I18N and L10N (localization) rely on consistent and correct local data. Locale is an identifier (like en_us) that record characteristics like date/time formats, number/currency formats, sorting order, character direction, etc. PHP uses the Unicode Common Locale Data Repository, which contains 360 locales covering 121 languages and 142 territories.

Goals for Unicode in PHP 6
Have a native unicode string type, and a distinct binary string type (that works like PHP's existing string type); update the language semantics to work correctly with unicode strings; maintain backwards compatibility.

PHP 6 uses ICU: International Components for Unicode (provided by IBM), which provides encoding conversions, collation, unicode text processing, and a large number of other features.

Introduced in PHP 6 is a new configuration option, unicode.semantics. No changes to program behavior unless it's enabled; but you can still use Unicode when it's disabled. When it's enabled, PHP converts strings into an internal unicode representation.

With unicode off, 1 character in a string is 1 byte. With unicode on, 1 character may be more than 1 byte: strlen() would return the proper number of characters. To determine the size in bytes of a unicode string, you need to use a different function. (I'm wondering if this means that, for binary safety, you can no longer rely on strlen() when you need to pass a sequence of bytes and a length to an API.)

In strings, you can use \u or \U and specify the codepoint (e.g. \u05D0), or \C{HEBREW LETTER ALEF} when you don't know the code point but do know the unicode character name.

PHP can automatically change the data encoding for different input and output sources. It will automatically convert string literals to UTF-8, unless declare(encoding="iso-8859-1"), and that code file is interpreted in that character set.

Procesing data retrieved from the browser poses a special problem: GET requests have no encoding at all, and POST only rarely comes marked with encoding. However, browsers are supposed to submit data in the same encoding as the page the form was on, and PHP will attempt to decode based on the unicode.output_encoding setting; but if decoding fails, PHP will populate request arrays with raw binary extension. Applications can then use the filter extension to decode the text.

When there is a conversion error to or from Unicode, you can specify how PHP is to handle the error, and even provide an error function so that you can handle the error via PHP code.

Also new is the TextIterator, which allows for fast iteration, forwards and backwards, over text. It allows you to iterate based on code point, character, words, lines, or even sentences.

To date, about 40% of PHP's 3070 built-in functions have been upgraded to handle unicode text.

There should be a preview release of PHP 6 in December.

(comment on this)

Wednesday, November 1st, 2006
5:14 pm - ZendCon Session Notes - PHP Data Objects
Presented by Wez Furlong (Omni TI)

Problems with PHP Databases APIs
There's no consistency of API between DB extensions. Sometimes, the DB extensions aren't even internally consistent. This also means that there's code duplication in PHP internals, and also leads to high maintenance.

The PDO Solution
Move PHP-specific stuff into one extension, database specifics in their own extensions, and create data access abstraction, rather than database abstraction.

Most people aren't using abstraction layers, or are using home-brew layers because existing generally available abstraction layers are too slow, do too much, or are too complicated.

PDO Features
Native C code, rather than a PHP-based abstraction helps performance. It also takes advantage of improvements in the PHP 5 internals.

PDO has common database features as a base, and database-specific features are also available.

What Can PDO Do?
In summary: prepared statements, bound parameters, transactions, LOBs, SQLSTATE error codes, flexible errorhandling, and database portability.

PDO supports MySQL. PostgreSQL, ODBC, DB2, OCI, SQLite, and Sybase/FreeTDS/MSSQL.

Wez then talked about how to use PDO. I'll spare you pages and pages of PHP code, which I'm sure is given in examples on the PHP website.

PDO maps error codes from the database-specific format to standard ANSI SQLSTATE error codes. In the case of errors, PDO also has three error handling strategies: silent (by defaut), displaying warnings, and throwing exceptions.

PDO implements forward-only cursors by default. (This is similar to mysql_unbuffered_query.) This makes them fast, since you don't have to wait for all the data to come from the network, but it also means that you don't know how many rows there are until you've fetched all the data. It also means that you can't initiate another query until you finish fetching all the data, and it's possible that it might cause other queries to block because the database is still busy servicing your initial query. You can also request buffered queries (like mysql_query) instead.

PDO implements iterators: foreach($dbh->query(...) as $row) {}. Kinda neat, especially since 95% of the time, I wind up doing while($row = mysql_fetch_*()) anyway.

PDO handles LOB support via streams. Database support permitting, you can potentially stream content to or from the database without first having to load it entirely in PHP. For example, you could select an image from the database and fpassthru() it to the browser, or fopen() a file from the filesystem and stream it into the database without having to file_get_contents(). This cuts down on both memory usage and latency.

This talk actually has me excited about PDO now, and I'm going to look into implementing it in my applications where possible.

(comment on this)

4:05 pm - ZendCon - Movable Walls
It's a rather interesting experience to be sitting in a room, and have its configuration change by having the movable walls expand or collapse. One moment, you're in a giant, cavernous room; the next, you're in a room a third its size, with a wall 10 feet away.

On the plus side, it turns out that there's a power strip plugged in in the middle of the room. And fortunately, all the sessions I've been to today have been in that part of the conference room, so I've not had the power issues today that I did yesterday.

The wireless mikes are still having issues, though. I don't think I've been to a single session or talk today where the mikes didn't have an issue at some point.

(comment on this)

4:00 pm - ZendCon Session Notes - Keynote - The MashUp Economy: What are you waiting for?
Presented by David Berlind (ZDNet)

David's Law of Economics
"Those who handle the most amount of heavy lifting, but do the least amount of it win big*"

*If you're in bettween, perhaps it's time to rethink life.

Ecosystems are a cycle, starting with artists, who create a user experience, which attracts consumers, which generate additional artists.

A healthy ecosystem also generates an arms race of technologies and companies using it; media interest; research; venture funding; and conferences and events.

Mashup Defined
Two or more disparate sources of content* or functionality are blended** to form a unique user experience*** that's usually substantially different from any of the original sources

*Dave's opinion: data qualifies as content. (I share this opinion; it seems almost obvious.)
** sometimes refered to as remixing
*** audio, visual, or a combination thereof qualifies

"Mashups" are just a trendy term; we've been doing similar things for years: newspaper articles that quote other press; productions like Forest Gump (where Gump is shown shaking hands with the president); consumer video and animation; music (which is where the term originated); software.

Key Enabler
The better the tools are, the easier it is for anyone to do it. (This reminds me of the quote "Make easy things easy; make hard things possible.")

David talked about "ecosystems" - the various different software platforms (Mac, Linux, Windows, PHP, Perl, etc), and how they all can be replaced with "The Internet". With the Internet, anyone can add an API (new web service, etc) and have it available to everyone; whereas, all the other platforms are relatively closed - they're only controlled by a few people. For example, while anyone can start a new Linux distribution, that doesn't mean that new APIs you might add to that distribution will be picked up and distribtued in other kernels. is a website for creating and sharing mashups. It apparently makes it easy enough to create mashups that 5-year-olds can do so.

David also mentioned that there are potential legal issues. It's a giant grey area; the legality of mashups isn't yet worked out. But, if you make available interesting data without an API to access it, the chances are very high that someone else will. This is something that potential mashup authors need to keep in mind. During the Q&A session, David gave an example of a mashup that got shutdown: it was mapping 911 calls and response times, and apparently, the city whose data was being used was unhappy about this because potential terrorists could use that information to know when to attack emergency responders. provides list of artists playing concerts in a geographical area. From there, you can listen to MP3s to decide whether or not you want to actually attend those concerts. This is, of course, breaking the stranglehold of the media companies who like to be able to explicitly present a particular image for a given band or concert.

Google Maps make up 50% of mashups on programmableweb. Flickr is next (11%), followed by Amazon (9%) and YahooMaps (5%).

Mashups in the media: David set up a Google Alert for the term Mashups; in one year, he went from getting seven alerts per week, to seven alerts per day.

David also mentioned that mashups is starting to show up in fiction: Mashup Corporations.

(3 comments | comment on this)

> previous 20 entries
> top of page