apocryph.org Notes to my future self

19Apr/060

The new IE ActiveX non-security patch

Microsoft recently rolled out patch 912945 in the security bulletin MS06-013. This patch subtly breaks the way IE handles embedded ActiveX controls, otensibly as a result of the settlement of the patent infringement suit with Eolas a while back.

As a result, when I use BearingPoint’s Outlook Web Access to view my company mail, I have to click in the message window or hit SPACEBAR or ENTER in order to activate the control. This is annoying and maddeningly stupid. Clearly, justice has been done.

17Apr/060

Project Idea: Tor server map

Lately I’ve been bored and looking for small, quick-win tech projects to keep me on my toes. I’ve run across just the thing:

One of the items on the list of Tor Volunteer tasks which the Tor team have requested volunteers take care of is the development of a map of Tor servers around the world. As it happens, I’ve been wanting to try out the new Yahoo! Maps API, and this seems like just the opportunity I’ve been waiting for.

My plan thus far is to write some Ruby script to download the Tor server list and dump it into a sqlite3 database. All entries in the database will then be geocoded, initially with the [hostip.info IP city/country lookup], maybe later with the MaxMind GeoLite City database. A cron job will periodically update the list to reflect new servers and updated geocoding.

The information in this database will then be exposed as a GeoRSS feed, which can then be overlayed onto a Yahoo! map.

Should be an easy and yet spiffy project…

15Apr/060

Encoding gotchas with Arabic in Visual Studio 2005

My current project in Iraq is the first time I’ve developed software in another language, and more to the point, in a non-Latin character set.

Our alphabet, which we share with the Latin-based languages of Western Europe and South America, is based on the Latin alphabet of Roman times, which is why we call our character set ‘Latin’ and not ‘English’ or whatever. There are plenty of other alphabets out there, including Cyrillic (used by Russian, among others) and Arabic.

Each of these alphabets, in order to be represented in digital form, has at least one (and, confusingly, sometimes more than one) ‘code page’, which simply means a standard translation of each letter in the alphabet into a number. So, a latin ‘A’ in almost all Latin code pages is assigned the number 65, while the Arabic beh (ب) is assigned its own number in Arabic code pages.

Not surprisingly, if the code page in which a document was written doesn’t match the code page a computer is using to render the characters in the document, garbage ensues.

Getting back to the gotcha at hand, the Iraqis have written both ASPX and C# files with a combination of the Latin alphabet (HTML and C# are both expressed stricly with the Latin alphabet) and Arabic script. Initially, they were using the Arabic code page (which contains the standard Latin characters as well as Arabic), and all was well.

Then, inexplicably, when we deployed the app to the Windows 2k3 servers back in the States where QA was being performed, the QA team reported garbage where we were seeing Arabic script. I had the developers use the ‘Advanced Save Options’ menu item in Visual Studio 2005 to save all the ASPX and C# files as UTF-8 with signature (UTF-8 being a magical codepage which can represent all character sets), and felt quite proud of myself. The problem went away and all was well.

But, repeatedly, the problem would crop back up in some pages but not others; never appearing on their machines (presumably because they had the Arabic codepage installed) but always appearing stateside. The devs would go to Advanced Save Options and the pages would be back to the Arabic codepage, despite being set to UTF-8 previously.

Finally, it clicked. I checked the properties in SourceSafe for the files which exhibited the problem, and found their character set had been incorrectly detected as ANSI/MBCS, while those pages which worked were Unicode UTF-8. I had the devs go through all the files, ensure they were in VSS as UTF-8, then convert them all to UTF-8 via Advanced Save Options, once and for all.

I don’t know why VSS failed to detect the codepage for some files but not others, but now that all the files have been set explicitly to UTF-8, we’ve not had any trouble.

14Apr/060

Iraq Day 82

It’s starting to feel like summer in earnest here in Baghdad. We had a bit of rain last Wednesday, which made for an uncharacteristically rich sunset (see below), but otherwise it’s been dry and ever-warmer.

An unusually lovely Baghdad sunset

I took the above picture while walking to the BE camp for burger night. To the left of the frame is the perimeter wall of the BearingPoint camp. The street in the photo is a main drag which runs through the IZ and right in front of the palace compound. The jersey walls divide the unmarked roadway into lanes, and the speed bumps from hell force all vehicles to slow to just over 0 MPH before proceeding.

As I noted above, this was taken after an afternoon rain, so the streets were wet, and there were clouds in the sky; two unusual occurrences.


The conference we’re hosting in Irbil, in the Kurdish region of Iraq to the north, is coming up in about a week. It should be a stressful time as we make last-minute preparations, but once we’re up there it will hopefully be relaxing.

The Kurds are pretty squared away, so the security situation up there is much better. We’ll stay in a hotel/resort overlooking a valley just outside the city of Irbil, we’ll eat local food (for better or worse), and we’ll mingle w/ the locals at the markets. I can’t wait.


I’ve postponed my RRB again, until mid-May. I’ve decided to take it at the same time I take my R&R back home, making for a three-week hiatus from the rigors of Baghdad life. I’ll meet Rebecca in Amman as previously planned, then we’ll spend about a week in Jordan, either in Amman, at the Dead Sea, Aquba, or whatever. We’ll then fly back to Virginia together, and I’ll spend a couple weeks at home, where I will, among other things, attend my mother’s graduation from her Master’s program at Hopkin’s.


I feel like I’m adjusting to life in Baghdad to the point that it’s difficult to imagine returning home. Though I miss my family and friends (and cat), I find the idea of coming home for good to be somewhat unerving.

Multiple factors combine to create this effect. First, I was not particularly happy with my job before I left; it was only the opportunity in Iraq which kept me with the company. Second, I had/have no idea what I will do next, so there’s nothing professional to come home to. Third, the work I’m doing here is almost certainly the most significant, most rewarding, and most well-compensated work I will do in my life, therefore when I come home I will almost certainly feel a multi-faceted sense of loss which accompanies the knowledge that the best times are behind you.

Obviously, this isn’t unique to my situation. I’ve spoken with a few of the veterans who went home for a while then came back, and they confirm my suspicions about the difficulty of returning to one’s dull, mediocre existence. Even assuming infinite capacity to endure this environment, I will go home sooner or later, and when I do I suspect there will be some considerable distress as I re-adjust to my former life.


It’s Good Friday, so I’m fasting and abstaining. I’ll probably go to the 1630 Good Friday liturgy at the palace, which is no great discipline as I’ve nothing else to occupy my time. I think on Sunday I’ll allow myself some ice cream.


I’ve learned about another Iraqi/Arab food: kaag is a crispy bread stick, dipped in tea (chai) or coffee much like Italian biscotti. The kaag I had was rather bland and not particularly worth the calories, but I’m sure there are more flavorful varieties as well.


I’ve lived here so long that I had to conduct a purge of my trailer today, cleaning up and expunging all the crap which had accumulated since I arrived. It turns out that dailing cleanings by a diligent Filipino houseboy are not sufficient to stem the tide of clutter which inevitably follows anywhere I put down roots for more than a few days. The problem is only magnified by the small quarters and minimal storage space; it got to the point where walking to the bathroom was a journey fraught with peril due to various half-put-away bags of clean laundry, boxes from home in assorted states of unpacking, and mail-order boxes strewn about awaiting the inevitable cutting down and folding which befalls them all in the end.

On the plus side, my walls are much more colorful now, with a wide assortment of posters and wall-hangings from geek chic to Iraqi kitsch. Now I just need an Arabic alphabet poster to complete the ensemble.


Taxes are due tomorrow, but I’ve learned of an automatic two-month extension conferred upon those living and working overseas. I’ll do mine when I return home in May. I suspect I’ll be due a refund, in which case my procrastination constitutes yet more generosity towards the expansive federal government atop a banner year of civic largesse, but due to some unfortunate and catastrophic failures of prospertine back home, I don’t have access to all the financial data I need to complete my return.

Upon reflection, I rather admire the Iraqi tax system: 12% of gross pay withheld for income tax, and 5% withheld for ‘retirement’. One can only assume that the Arabic words for ‘retirement’ and ‘graft’ are easily confused, or the Iraqi government has a wicked sense of humor.

12Apr/060

Upgrading MCSD .NET to MCPD: Enterprise Applications Developer

Since May of ’04, I’ve held an MCSD for .NET credential. Now, however, MS have refactored their cert regime yet again, and come up with a new set of terms for employers and certification seekers to confuse and misunderstand.

The new equivalent of my top-of-the-pile MCSD cert is MCPD: Microsoft Certified Professional Developer. Within MCP there are three strata: Web, Windows (both roughly equivalent to MCAD), and Enterprise Apps, with Enterprise Apps being sort of a combination of the previous two.

Fortunately, MS are offering upgrade exams to us MCSDs. To go from MCSD to MCPD: Enterprise Apps, one must sit for two exams: 70-553 and 70-554. Both appear pretty rigorous, and will definitely require study, espectially since alot of the spiffy data access crap isn’t available to me since my project is using MySQL instead of SQL Server.

To further kink things up, I read somewhere that 70-553 is scheduled for availability on 26 May 2006, and God only knows when 70-554 will come online. So, it’ll be a while before I can get the upgrade process squared away.

11Apr/060

Maildir scalability sucks

I’ve been running my own mail system for a couple years now. I currently run it on an OpenBSD 3.8-STABLE box, with postfix, courier-imap, and whatever webmail tool I hate the least at any given moment.

However, as is my custom, I do not delete email, so I have accumulated tens of thousands of messages. The maildir format used by my mail system, wherein each mail folder is a filesystem folder and each message is a file, does not scale well to this volume. As a result, my mail tools all suck wind while CPU and disk usage on my mail server spike, just to get new messages or move some email to a different folder. It sucks.

Maildir isn’t exactly new, and was conceived as huge improvement over the even more amazingly shitty UNIX mail storage technology, mbox, in which each folder is a file and each message in the folder is concatenated to the file.

However, it being the 21st century and all, it seems somewhat obvious to everyone except developers of UNIX mail systems that a high-performance relational database is a good way to store email. Exchange has had an RDBMS backend since 2000 at least; Notes as I understand it has had it since inception.

Sadly, the UNIX mail world has a while to wait for this particular cutting edge innovation. The DBMail project has the right idea, but it’s very immature, and doesn’t even support SSL yet.

So, unless I go off the reservation and embrace a proprietary system like Zimbra, I would appear to be screwed.

7Apr/060

Ass handed to me in TopCoder Intel Multithreading Competition 3

Well, I failed to even place in the 3rd Intel Multithreading competition over at TopCoder. I realized early on that the native brute-force algorithm would not work, but I foundered finding an alternative. I intuitively recognized that the index into S from which each random u was derived would be the index with the shortest distance, to a high probability.

Unfortunately, I lacked the stats background to satisfy myself of this analytically, and determine the extent to which it was probable and under what conditions. I ran a few tests but they must have been buggy as they indicated no such relationship.

At any rate, with all that’s gone on last week I hadn’t had time to work on it after the initial foray, and the contest closed yesterday. Most of the winners not only did a rigorous stats analysis, but also tweaked their C++ code with inline assembly, using SSE and instruction ordering to squeeze every last ounce of performance out of their implementations.

On the plus side, I dropped the JetBrains .NET profiler lack a bad habit, and came home to the ANTS profiler, which is source-level and vastly more useful. It helped me tweak my (native, brute-force, untenable) implementation down to a high-performance machine (though the brute-force algorith was still so slow it’d take at least 10x the alloted time limit on the four-way dual-core box to complete the calculation).

Oh well. There’s always next month’s competition…

7Apr/060

Iraq Day 75

With my Chief of Party administration coming to a close, it’s been a fairly eventful term. Mild crises have cropped up regarding our trip to Kurdistan, hiring staff, and camp accomodations. This latter issue remains significant and outstanding, as the Army bureaucrats which decide who can use what land in the IZ evidently have conducted a purge of sorts, serving a variety of camps–including ours–with eviction notices on the dubious basis of incorrect/insufficient paperwork.

Though the US military is the most powerful, professional, capable military force the world has ever known, it churns out some seriously officious, close-minded, unimaginative bureaucrats. Now we’re forced to supplicate the relevant officials in the hopes of a reprieve, else we start hunting for a new home. Needless to say, this puts a kink in our operations. Equally needless to say, if we end up getting evicted, damned if we’re not trashing the camp on the way out!


I’ve posted a new traunche of pictures, though none are particularly inspired.


Last week Secretary Rice visited Baghdad briefly, presumably to pressure the Iraqi government to get on with it already. She held a brief meet-and-greet at the Green Bean in the palace, with Ambassador Zalmay ‘Zal’ Khalilzad. I posted a few pictures, but I couldn’t get close due to the huge crowd of people. I’m told the John Kerry visit last December was slightly less crowded, and limited primarily to DoS employees…


I had a rather embarassing experience w/ one of the Iraqi developers last week. Y, who is younger than me and learned English largely by listening to rap music, has asked me to correct him whenever his English is not proper. He also, along w/ the rest of the team, often asks me to define obscure or slang words.

One of Y’s favorite rap songs makes extensive use of the slang term ‘skeet’. I had not ever heard this particular slang term before, and thus couldn’t help him define it. However, undaunted, he looked up ‘skeet’ in the urban dictionary. His next question, somewhat predictably, was the correct pronunciation and definition of ‘ejaculate’.

Needless to say, I struggled to define this term, both because of my own embarassment and an inability to find alternative words which he understood. Finally he had to go to Steve to get it explained properly. Oh well. What are the youth of Baghdad coming to, listening to that vile rap music…


Speaking of the Iraqis, they’re coming along wonderfully. We couldn’t travel this week, so they handled all of our meetings, flawlessly. We also recently hired N, U’s younger brother, as a sysadmin. Together with A he has been learning remarkably quickly, and they are now largely responsible for running our little LAN.

The devs are also moving along. The bug count is down below five, with nothing more critical than a couple of would-be-nice bugs. CRD was pleased with the requested changes we made, and have asked for more. As long as we can diffuse the political situation surrounding Oracle, I think the CRD iteration is shaping up to be a brilliant success. inshallah.


I’ve tentatively rescheduled my RRB for late April. Since I have an R&R back to the states in late May, I’ve got alot of traveling to look forward to. I’m finding myself really looking forward to my homecoming, though I’ll look forward to the final homecoming more than the visit.

Delicious Bookmarks

Recent Posts

Meta

Current Location