Instant chai

I am blessed to live in an area with a diverse population and an equally diverse selection of ethnic grocery stores.

Last night, I checked out Madras Grocery, where I was greeted with a vast array (to me at least) of Indian food products (and probably California produce). I ended up buying some Punjabi Mix (a snack mix made by Surati… I was venturing outside my comfort zone of haldirams), some ready-to-eat paneer dishes, and some instant chai.

Here’s a picture of the box of chai.

First experience with instant chai

First experience with instant chai

At $4 per box GeeBees Chai Gold Masala Sweetened pre-mix costs more than your basic tea sachets, but it’s actually pretty good. The ingredients list is refreshingly simple, from the perspective of an American resident used to synthetic food additives: milk powder, sugar, tea extract, ginger, black pepper, cardamom, and clove. And I see that it sells for $28/3 boxes online, shipping included.

I’m drinking it right now as I write code in my office. 🙂

If anyone has any recommendations on other chai brands I should try (there were a few represented at the store) or other Indian mass-market “delicacies” I should try (the Surati Punjabi mix is pretty good, and lives up to its “extra hot” subtext), do let me know! 🙂

Good service from Delta

Usually, when folks talk about airlines and flights, the topic is one of these:
* being delayed and its consequences (flight was cancelled, missed connection, stuck on the ground pre-takeoff)
* ticket prices (expensive fares or secret special deals)
* uncomfortable seats (and dreams of flying in business or first class)
* fees/surcharges (esp. with low cost carriers)
* bad food

It always seems that people rarely have good things to say about air travel experiences. But here is one good experience.

Recently, I flew on an overseas KLM-ticketed Delta-operated flight, and upon retrieving my bag at the baggage claim, I found a handle broken off. This was disappointing. Immediately, I went to Delta’s baggage service counter and pointed out the broken handle.

The bag already had a broken latch from another flight on another airline, which I noticed too late, plus the extending/retracting rollaway handle was worn and prone to jamming (hey, it’s probably worn from flying 100k miles). Otherwise, the bag was in nice shape, having no stains, rips, holes, tears, or abrasions. Still, I was going to report this damage immediately and see what sort of recompense was possible. I did see a sign at the counter disclaiming responsibility for any damage to retractable handles, but on this flight, the damage was a handle that had pulled and ripped away from one of its attachment points.

The nice lady at the counter said that she could go find me a replacement bag, or give me a credit voucher to spend on a future flight. I declined, saying that what I really wanted was a bag of a similar size with similar features without a broken handle. She said she would look around. A few minutes later, she returned and said that she could have my bag sent in for repair, but it would take a few weeks. I winced, but honestly, I just want a fixed bag. So she did some electronic paperwork, and as she filled out the forms, I asked whether I could get the other damage fixed, how I would request that and how I would pay. She went beyond and just offered to add it to the repair request. I smiled, and she added the broken latch. As for the retracting handle, I was just going to leave that alone, since the airline explicitly disclaimed responsibility for those. She gave me a large plastic bag and a shipping airbill, and said it might take a few weeks to get it back, and I told her I would manage somehow.

Anyway, two weeks later, here I am, and my returned bag is in great shape with everything fixed, including the retracting part that wasn’t specified. The contracted luggage service company, Rynn’s Luggage and More, seems to have gone beyond the requested repairs, and I’m thankful to them, as well as Delta, who chose a great luggage service company, and the nice baggage counter lady who was helpful and efficient.

This was a good airline experience that impressed a guy who always snickers when hearing the “sit back and relax” announcement from the pilot while sitting in economy seats, which don’t really allow anything that can be credibly called “sitting back”.

Being yourself

Good blog post fitting-in (or not) in high school.

“That’s why you don’t have any friends”

Honestly, I gotta say that, having gone to brand-name universities and working with people who many consider the best in their disciplines, I’ve found that the most successful, the most brilliant, the people who are admired by everyone–nearly all of them were thought ‘weird’ growing up. They spent less energy trying to fit in, and more time being themselves and doing what they thought was best.

Anyway, read the story. It’s good.

Fix for preupgrade-cli on Fedora 12

Background:
I had been running Fedora 12 on my home server with a 5-year old CPU and Nvidia video card. Last weekend, I decided to modernize with fancy new hardware, an Intel G6950 dual-core with integrated graphics. This is great, but Fedora 12 has graphics drivers that like to crash with Intel integrated graphics hardware, so once I changed the hardware, my desktop would freeze, about 30 seconds after logging in. So I decided to upgrade to Fedora 13.

The generally recommended way to upgrade on Fedora is to use the preupgrade tool, which would be nice, graphical, and great if my graphical desktop didn’t crash (and if it didn’t, I’d be sticking with F12 for now). So the alternative is supposed to be “preupgrade-cli”. This would work, because I could boot and do a console (non-graphical) login, so the video driver couldn’t muck things up (as easily?).

Problem: preupgrade-cli doesn’t work in Fedora 12.
(Okay, maybe it will for you, because you have executive platinum status with Fedora.) I got this error, which is pasted below:
# preupgrade-cli
Loaded plugins: blacklist, dellsysidplugin2, priorities, versionlock, whiteout
No plugin match for: rpm-warm-cache
No plugin match for: auto-update-debuginfo
No plugin match for: refresh-packagekit
No plugin match for: presto
Traceback (most recent call last):
File "/usr/share/preupgrade/preupgrade-cli.py", line 316, in
pu = PreUpgradeCli()
File "/usr/share/preupgrade/preupgrade-cli.py", line 52, in __init__
PreUpgrade.__init__(self)
File "/usr/lib/python2.6/site-packages/preupgrade/__init__.py", line 80, in __init__
self._getConfig()
File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 282, in _getConfig
startupconf.pluginconfpath,disabled_plugins,enabled_plugins)
File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 465, in doPluginSetup
plugin_types, confpath, disabled_plugins, enabled_plugins)
File "/usr/lib/python2.6/site-packages/yum/plugins.py", line 160, in __init__
self.run('config')
File "/usr/lib/python2.6/site-packages/yum/plugins.py", line 177, in run
func(conduitcls(self, self.base, conf, **kwargs))
File "/usr/lib/yum-plugins/versionlock.py", line 153, in config_hook
conduit.registerCommand(VersionLockCommand())
File "/usr/lib/python2.6/site-packages/yum/plugins.py", line 499, in registerCommand
self._base.registerCommand(command)
File "/usr/share/yum-cli/cli.py", line 106, in registerCommand
if name in self.yum_cli_commands:
AttributeError: 'PreUpgradeCli' object has no attribute 'yum_cli_commands'

Apparently the anonymous poster at the How to Upgrade page had the same problem. Perhaps we are the only two to bother with the “arcane” command-line preupgrade tool. I am curious as to whether anyone (at all) succeeded with preupgrade-cli for Fedora 12 to Fedora 13.

Solution: Patch preupgrade-cli.py. If you don’t have experience writing code on Linux, this is probably not for you. But it’s pretty straightforward. You need to change the definition of the PreUpgradeCli class so that it self.yum_cli_commands is valid. Do this by replacing the line:

class PreUpgradeCli(PreUpgrade, YumUtilBase):

with

class PreUpgradeCli(PreUpgrade, YumUtilBase, YumBaseCli):

so that it inherits from a class with such an attribute and insert this line:

        YumBaseCli.__init__(self)

as the first line of the initializer, below

    def __init__(self):

and before

        PreUpgrade.__init__(self)

so that the parent class's initializer gets called and self.yum_cli_commands gets populated. The file is found at /usr/share/preupgrade/preupgrade-cli.py

Remember, this is Python, so line indentation is important. There you go. preupgrade-cli should work as normal now.

Note: I don't know whether this is the Right Way To Fix It, but it seemed reasonable to me, and I got the result I wanted. I will probably point the developer of preupgrade-cli.py to this page so he/she can compose a better fix.

Update (6/13/2011): This fix has been accepted officially (see comments), thanks to the efforts of Andrew Meredith, who opened the bug on Red Hat's bugzilla, and Martin Dengler who opened a ticket in preupgrade's own Trac site.

Miscellaneous Solaris build problems

I’m sure these things are obvious to seasoned Solaris developers, but here are a few things I’ve learned today:

  • gcc 3.4.3 does not support threads on Solaris. The “-pthread” option doesn’t exist for Solaris except in later versions, so upgrade your compiler or use the Sun compiler (where you’ll use “-mt” to request threaded code).
  • scons on Solaris assumes you are using a Sun compiler and applies flags as such, even when you’re using gcc. Yes, even if it detects and uses gcc. See the note about “-KPIC” in the scons changelog.
  • boost doesn’t really compile on Solaris with Sun C++ 5.8, but you can hack stuff to make it sorta work.
    This relates to boost 1.40.0. There are two main issues:

    • int64_t and friends don’t get defined. You’ll have to patch cstdint.hpp. Here’s my hacked replacement.
    • The Sun compiler doesn’t do return object optimization, which means that code like:

      class Foo {
      private:
      Foo(Foo& f);
      public:
      explicit Foo(int i);
      };

      Foo bar(int x) {
      return Foo(x);
      }

      doesn’t work. The call to Foo(x) works fine, but the compiler thinks you need to copy the resulting Foo object in the act of returning it to the caller, which is commonly optimized out these days. Here’s a replacement for the affected boost/thread/detail/thread.hpp. Of course boost 1.41 doesn’t have the same problem since the return type for the affected function is different.

For reference, a couple of illustrative error messages:

  • int64_t problem:

    "/home/daniel/boost_1_40_0/boostdir/include/boost/date_time/time_duration.hpp", line 264: Error: int64_t is not a member of boost.
    "/home/daniel/boost_1_40_0/boostdir/include/boost/date_time/time_resolution_traits.hpp", line 48: Error: int64_t is not a member of boost.
  • Return value optimization problem:

    "/home/daniel/boost_1_40_0/boostdir/include/boost/thread/detail/thread.hpp", line 344: Error: boost::thread::thread(boost::thread&) is not accessible from boost::move(boost::detail::thread_move_t).

I’m sure that most of my audience will find this incomprehensible, but I have high hopes that Google will index this properly and find it for a poor head-scratching soul with similar frustrations.

Have a nice day!

The Dedicated Link Cable

There’s a market for everything, isn’t there? Especially for Dedicated Link Cables. I never knew I needed one. But of course! When I crimp those RJ45s onto CAT5, I am just making an ethernet cable, but the Denon AKDL1 Dedicated Link Cable is capable of time-travel. It even extends the digital signal beyond 1’s and 0’s to *2*! Of course, this only works if you connect it in the right direction, otherwise you will add -1 instead, and we all know negative is bad.

Maybe I’ll save up for the used one on sale for $2,499.98. I don’t have the proper equipment to perform “burn-in,” so it might be worth paying the extra $1,999.98.

Check out the reviews. Who knew that reviews could be so much fun to read. ;-D One reviewer talks about how the cable solved global warming, but I don’t think that’s possible unless he had it professionally installed in triplets.

Fixing nautilus-open-terminal to revert to “t”

I was very, very annoyed that the 0.10 release of nautilus-open-terminal changed the accelerator from “t” to “e”, meaning that I could no longer right-click on my gnome desktop and press “t”.

Rather than unlearn years of muscle memory and learn to press “e” instead, I built my own version that reverts the change.

Here’s the fixed SRPM and RPM for Fedora 11 i586:
source: nautilus-open-terminal-0.13-2ac.fc11.src.rpm
binary: nautilus-open-terminal-0.13-2ac.fc11.i586.rpm

I know, the accelerator got changed to fix some bug that was filed against Ubuntu, but I don’t use “New Tab” (nor can I find it anywhere in nautilus). So I achieved victory by getting the source, changing a few lines, and rebuilding, since this is open source. Hooray!

Have a nice day.

(footnote: The problematic change was noted as: ‘Change “Open in Terminal” accelerator to “e”, for not conflicting with “New Tab”‘)

Update:
Versions for Fedora 12 (beta right now):
RPM: nautilus-open-terminal-0.17-4ac.fc12.i686.rpm
SRPM: nautilus-open-terminal-0.17-4ac.fc12.src.rpm

Word of the day: sexagesimal

I didn’t know sexagesimal was a word until today.  Indeed, I think that most spell checkers will flag it as a misspelling.  Yet it is real.  And you can probably guess what it means: base-60 numeric.

It didn’t occur to me that anyone would formalize it as a number system, but apparently it did to the Babylonians and Sumerians.

Apparently it’s common in astronomy.

Just saw a shooting star!

I think I just saw a shooting star!  I went outside to check out the Perseid meteor shower, which was supposed to peak last night, and saw a very bright point trace itself across the sky.  It left a trail about 15-20 degrees long in my field of view, which stayed lit for about a quarter second. The last time I thought I saw one, it was very faint, but this time, it was very bright.

I suppose it could’ve been a satellite in low earth orbit which happened to light itself for that short arc across my vision, or fragment from some fireworks, but the former seems unlikely, and the latter should’ve been accompanied by some sound and other light trails.

Wow.  I’ve never seen one so bright and so obvious.  It definitely helped to fire up Stellarium, and locate the Perseus constellation.  But what helped more was to get the RA and DEC (right ascension and declination) for the shower (RA 03h 04m Dec +58°), and to see the real location in the sky in relation to the other constellations (turn on azimuthal grid and equatorial grid).  Stellarium tells you where to look in the sky, depending on where you are and what time it is.  You can even advance/backtrack in time so you know when it’s above the horizon and when it’s close/far from the moon.

Infinite Summer

Infinite Summer is now underway, and I’m pleased to see that a book I’m reading has spawned its own internet book club for the duration of this summer.

Infinite Jest is a book about a many things.  It’s an epic saga.  It’s really, really long.  It’s by the late David Foster Wallace whose Consider the Lobster essay (commissioned by Gourmet magazine, hailed by PETA in their fight against lobster consumption) I found enlightening, well-written, and plain fun.  His writing is clever and engaging, and his mixing of SAT words with colloquialisms should feel gratifying to all who ever had vocabulary flash cards.
I’m told that Infinite Jest has been read by everyone in UCI‘s English department.

In my case, I’ve not finished the book, though I’m around page 850 or so.  That’s about September in the Infinite Summer syllabus, which allows about 75 pages per week, not including footnotes.  You should know that some of the footnotes are short-story length.  Some footnotes have their own footnotes.

Many of the book’s ideas are literally ridiculous. Yet it treats a number of serious themes on life and humanity, so I usually end up feeling more human after reading its pages.

So, in summary, I think the book is great, and the whole Infinite Summer idea is great too (you will be part of a big effort with a bunch of other people, happening right now).   If you’re interested, check out his lobster essay first, because that’s article-length, rather than Bible-length.