The Open Source swear jar
May 22, 2008
Jeff Atwood this week offered the world an article on the fact that “PHP sucks [but it doesn't matter.]” For a man who’s usually quite thoughtful, the critique presented in the article made it look like he’s been stuck on the LOST island with cached Slashdot discussions for a few years and he hit his head really hard and lost the ability to tell whether he’s actually saying anything of value or not. The substance of the apologia on the other hand – that in spite of sucking, PHP powers the web’s biggest and busiest – was put forth much more ably by Terry Chay in his thesis on the science fiction mythology behind the enterprise of the Enterprise.
However, I think Atwood has been redeemed by the fact that his piece provoked the following gem from Stanislav Malyshev: “I wish for every 50 ‘PHP sucks’ blogs people would write one good RFC.”
Read the rest of this entry »
Letting go of normalization – an introduction
May 21, 2008
The Google App Engine discussion list has been fairly active with people trying to rework/rehabilitate their relational database habits and knowledge to the strengths and shortcomings of App Engine’s Bigtable-based Datastore. For many, the pondering starts with “um, OK, how about JOINS?” That question keeps coming up, and there have been a few proposed substitutes.
If one even slightly “gets it” though, the next step is to try to figure out the new paradigm at work here. How do we need to be thinking about the design of our queries, our models, and our applications as a whole? There’s a dearth of documentation, successful code examples, and explicated best practices. The discussion list has been slowly filling up that hole. At the heart of much of the advice being gathered there is the need to denormalize data. All data should be accessed via models designed with a view towards the ways in which the data will actually be used. A little extra effort should be applied while storing data to optimize it to be ready for use on read, so as to avoid complicated joins and unnecessary hits to the datastore. And other such points counterintuitive to the relationally-trained mind.
Now Todd Hoff has written the best overview of the issues I’ve seen to date, titled “How I Learned to Stop Worrying and Love Using a Lot of Disk Space to Scale.” This is definitely recommended reading for anyone starting out with App Engine, required reading if you’re thinking of porting an app (say one based on Django with a MySQL back-end), and remedial reading if you built (or started to build) an app where you tried to emulate what works in relational databases, and found something off.
With the good comes the bad
May 13, 2008
Adding temporary space to /var for apt
May 11, 2008
Say you have /var on a separate partition for whatever reason, and the space is enough for your usual needs, but you all of a sudden have to install a massive set of new packages all at once, most likely for a version upgrade. If you’re in an apt-based system (Debian, Ubuntu, and friends) you’ll likely see a message like this:
E: You don't have enough free space in /var/cache/apt/archives/.
Fortunately it’s fairly easy to fix this temporarily without worrying about resizing the partition. You’ll need a partition or external storage at least as large as the amount of archives it says it needs to get. We’ll assume you mounted this at /media/bighonkindrive. Now all you have to do is:
$ sudo mv -i /var/cache/apt /media/bighonkindrive
$ sudo ln -s /media/bighonkindrive/apt /var/cache/apt
(Or switch to a root shell and drop the sudo. And the -i just makes sure anyone reading this who happens to have an “apt” file or directory in their bighonkindrive doesn’t curse my name. And you could presumably do the same for just the /archive directory, but why not keep it all together? ) Then run your upgrade. When it’s done you can do:
$ sudo apt-get clean
$ sudo unlink /var/cache/apt
$ sudo mv /media/bighonkindrive/apt /var/cache
And we’re done. Yes, this should be obvious, but sometimes the brain sticks. If this is really stupid, or there’s a better way, or whatever, please let me know.
TabMixPlus is one of the most useful AddOns for Firefox. There are regular builds of the extension which you can install in Firefox 3. But if alpha AddOns to beta software is a little too much inconsistency in your work flow, you can replicate some of its behavior through about:config, the control panel for just about every setting in Firefox. There are two main settings I don’t think I can live without, so I set out to fix them:
- The close button on the tab bar. You can access this with “browser.tabs.closeButtons“. The values for this are:
- 0: Close button on active tab only.
- 1: Close button on all tabs. (Default.)
- 2: No close buttons at all.
- 3: Close button on tab bar.
If I remember correctly, TabMixPlus allows me to set close buttons on both the tab bar and the tabs. I haven’t figured out a simple way to set this. I still prefer the button on the bar to on the tabs themselves, because with lots of tabs open it can be hard to hit the right one. The close button on the tab bar has the same effect as CTRL-W – it closes the active window. Having them on the tabs, though, has the advantage of allowing you to close a tab without first switching to it – assuming your aim is true.
- Opening results from the search bar in a new tab. This is controlled with “browser.search.openintab“. The default is “false” which opens the results in the current tab. Toggling this to “true” opens a new tab. I couldn’t find similar options to control the behavior of links clicked in the bookmarks and history menus, or the bookmarks toolbar – although middle clicking on links in the menus does open them in a new tab by default.
You open about:config by entering just that into the location bar. You then use the filter bar to narrow down the list of preferences, find the one you want, right click on the value, and choose toggle or modify depending on the type of value.
I suppose I’ll update this if and when i figure out any other fixes. Losing the TabMixPlus session manager, though – that’s something to cry about. Or it’s reason enough to turn off the security check (instructions here and here) or use the Nightly Tester Tools AddOn.
Sen. Wyden in defense of Net Neutrality
May 8, 2008
Senator to ISPs: “Think twice” about Net neutrality… or else (Ars Technica)
Pledging to use “every ounce of my energy to protect network neutrality,” Wyden had a message for ISPs who might be pondering new charges for various forms of access: “think twice.” If ISPs start down that road, they might soon find that they lose key legal protections including “safe harbors” and tax freedom.
Thank you Senator Wyden. This really hits right to the heart of what’s wrong with libertarian arguments against Net Neutrality and other issues relating to deregulation of utilities and communication industries. While “we own the pipes” may seem like a common sense argument, all of these infrastructures were established with massive public investment in the form of tax breaks, monopoly grants, regulatory exemptions, eminent domain seizures, and outright subsidies. The industries exist from the beginning in a context of non-competitive (non-free) and distorted markets. “Free market” and small government arguments for further deregulation to the detriment of the public interest are extrUsing femely disingenuous in these cases, and it’s disappointing when otherwise intelligent conservatives fail to recognize this and reflexively argue the pro-corporate (but actually anti-market and anti-consumer) position.
Google Translate now includes Hindi-English and English-Hindi. It works as well as machine translation is likely to. If using short phrases, make sure to use punctuation. That seems to prevent it from treating the phrase as a clause. You can use the Indic transliteration tool if typing is tedious or you’re not a frequent Indic script typist. There used to be some online Urdu-Hindi transliteration tools out there, but I can’t find them. Combined you could have Urdu to English machine translation, I suppose.
One cool thing is that Hindi pages turning up in Google results now have “Translate this page” links. For example, the Google translated front page of BBC Hindi. Not bad at all, though this leaves me wondering about the viability of my Urdu to English hack:
A British study found that people of Indian origin in a particular gene क़िस्म because of obesity is likely to be more …
+ Declining not डाइटिंग of obesity
“क़िस्म ” is just the Hindi transliteration of Urdu “قسم” meaning type. The Google typing tool doesn’t seem to have a way to get the letters with dots used to represent qaf, fa, etc. in Hindi, so maybe Google just plain doesn’t recognize them.
The other untranslated word there (“डाइटिंग”) is also a transliteration, this time of the English word “dieting.” The original sentence was “Obesity not reduced by dieting.”
All in all, good fun with maybe an occasional practical use. I could recommend what I did with the BBC page there as a useful way for future NYT Delhi bureau chiefs (who cover everything from Dhaka to Peshawar and Kashmir to Kanyakumari) as a way of supplementing their usual diet of scanning the headlines of the Hindu and Indian Express and calling up Sonia to ask “what’s up?” Of course, don’t do it with the BBC site. (Although the BBC editors could really use some automated Urdu to English translation to examine some of the sketchy stuff that makes it onto their Urdu site. For some reason the Urdu one seems to be the only one I check regularly with original reporting which occasionally differs radically from what I imagine the BBC’s official policy to be. I think I’ve covered this before.)
Noticed via Pravin Satpute’s blog.
Hunzakuts Rejoice!
May 5, 2008
The Unicoders are looking out for you. You even got first mention in “Other Changes,” and all sorts of excitement around your BAREE YEH. (I had to emulate the caps thing, but YEH BAREE is just too weird, even for me.)
Of more general interest (if you can call it that:)
Chapter 8: Middle Eastern Scripts
ArabicA number of Arabic character were added in Version 5.1 in support of minority languages, four Quranic Arabic characters were added, and the Arabic math repertoire was greatly extended. Sixteen characters were added in support of the Khowar, Torwali, and Burushaski languages spoken primarily in Pakistan, and a set of eight Arabic characters were added in support of Persian and Azerbaijani. The 27 newly added Arabic math characters include arrows, mathematical operators and letterlike symbols.
Chapter 9: South Asian Scripts-I
IndicA number of useful characters were added to Indic scripts. The Devanagari candra-a, Gurmukhi udaat and yakash, and additional Oriya, Tamil, and Telugu characters were added. These new characters expand the support of Sanskrit in those scripts, further the support of minority languages, and encode old fraction and number systems.

Burushaski speakers celebrating the release of v. 5.1.0 of the Unicode Standard.
(There are some amazing pictures in this CC-licensed photo set by Janice Lane. Some of them would have made for much better jokes, but it’s not nice to make fun of people. And I really wanted to use this incredible photo, but I try to be a copyright goody-two-shoes, and I’m too lazy to write. And seriously, Hunza is a beautiful place, and if anyone wants to teach me Burushaski, I’m ready. And thanks to Unicode we’ll be able to do it over email or IM.)
NYT on Pakistan’s Gülen schools
May 5, 2008
Turkish Schools Offer Pakistan a Gentler Vision of Islam – New York Times
Sabrina Tavernise is following in the grand tradition of NYT bureau chiefs reporting on Pakistan from the comfort of their home base in anywhere-but-Pakistan. In this case she at least had someone (Sebnem Arsu) who apparently spent some time in the country send her a quote or two rather than just regurgitating what the English press had to say. In this case, both the reporting and the analysis were uniquely shabby. Read the rest of this entry »