astradele

Archive for November, 2005

Houseboat vacation - Day 0

Posted by GJ on November 23, 2005

A friend invited/persuaded me to attend a houseboat trip over American Thanksgiving. Blogging has waned recently as I prepared myself for the trip - I only had a couple weeks to put my work and personal life in order.

Today was the first day, the flight down. I was hesitant at first, but now that I’m here, I’m enjoying being away. Some fun thoughts/events that occured to me today:

  • Disregard the notion of arriving three hours early to the airport. I’ve yet to experience anything that even came close to deserving such paranoia.
  • Do not bring fold-up sewing scissors on your keychain to the airport. I keep losing this useful, but thankfully cheap, tool this way.
  • A seat in the back is worthwhile, to board early and guarantee overhead space for carry-ons, for the leg room.
  • Line up before your row is called, but late enough so that you’re still in line when your row is called. This, too, is to get that overhead space and thus leg room.
  • Never take a pressure-based, liquid pen on the airplane. I received a nasty surprise that could have been much uglier.
  • Flights are so much more tolerable if you can sleep through it. I wasn’t sleepy this time, and found it boring and uncomfortable, despite the laptop, printouts, and magazines I brought.

I didn’t bother with the inflight movie. Based on occasional visuals, it seemed to involve a pair of muscular pool cleaners, dirt bikes, and scantily clad women.

Now that Air Canada doesn’t serve complementary food anymore, I kind of miss the inoffensive, light meals. It staved off the hunger without interfering much with eating schedule. I can buy food, but the prices seem exhorbitant, even though they were likely included in the ticket price before. Funny enough, freshly heated pizza was made available at the same time the televisions were playing a cooking show.

Posted in everyday | No Comments »

Unusually good online whiteboard - from GE!

Posted by GJ on November 14, 2005

Certainly not what I would expect from GE, an online, collaborative whiteboard. Very polished. Flash based, you’ll want to take a look if you’ve ever wished to be in a whiteboard room as another discussion participant. The UI is certainly better than the software I previously used, Drawboard.

Posted in techie | No Comments »

Creamy Peach Sorbet

Posted by GJ on November 14, 2005

I have a very nice ice cream maker that I rarely use. Considering that I’m trying to be very healthy in my eating habits, that’s no surprise. I figured, however, that I should try to do something with it.

After freezing the ice cream maker container for several days (it doesn’t take that long, I was indecisive), I poured out some sugar, mixed in a little hot water, some cold, and poured that and the remainder of my peach juice (originally from Welch concentrate) into the ice cream bowl and started the mixer. I wasn’t measuring, since the ingredients weren’t that expensive to toss out if it was really bad. On a whim, part way through I added the contents of a small can (160 mL) of evaporated milk. I ran the mixer awhile and then put the concoction in the freezer.

It turned out surprisingly well. Not too sweet as in previous sorbet attempts (equal parts sugar and water, hah!). Initially the sorbet was a little “fluffy” (from being mixed too long?), so I tasted mostly air, some peach, and a lot of evaporated milk. A few days later, however, it had frozen quite solid and was pretty good. Probably about the same as crushed ice, with some peach juice and evaporated milk on top - but more thoroughly mixed.

It’s fun trying random things - when it turns out anyway. :)

Posted in everyday | Tagged: | No Comments »

User permissions in Java

Posted by GJ on November 13, 2005

As part of the software I’m working on, I need user-based permissions. It’s a servlet based app, and each HTTP request represents an operation that occurs under the context of a particular user. I found learning how to use Java’s security support somewhat confusing, and the documentation I found with Google wasn’t entirely sufficient.

Part of the confusion stems from the legacy aspect of Java’s design. At one point, there was no concept of permissions for the purpose of a single operation, only the security permissions for the entire VM. e.g. whether the VM was permitted to write to a particular file. I went down a few dead ends reading the wrong documentation or learning about the wrong class. I also feel the current design is somewhat awkward due to the need to support the old way of doing things.

In the end, I determined the relevant classes were AccessControlContext and ProtectionDomain. Reading up about JAAS, which handles user authentication and association of permissions with a user, was useful, too. I didn’t use JAAS, as my user management system is custom and very simple; it was easier to do a custom work rather than implement the necessary interfaces to represent my user management system.

For each operation that needs to occur under a special context, I need to create an AccessControlContext. There are a few ways to get one: through AccessController to get the current thread’s context, and two different AccessControlContext constructors. One of the constructors involves the use of a DomainCombiner, which allows you to “merge” AccessControlContexts. The other constructor lets you specify the ProtectionDomains specifically.

ProtectionDomain gave me a bit of a headache, as I couldn’t figure out how to create one that had just the permissions I wanted. What’s not clear for the documentation for the ProtectionDomain constructors is that the CodeSource can be null. My epiphany was realizing that ProtectionDomain was the same as the “grant” sections of a java policy file. Like the “grant” sections, ProtectionDomains apply to those classes that come from a particular code source (e.g. a JAR or URL).

For awhile, I thought I had to obtain the current thread’s context and somehow copy it or merge it (with a combiner) to create a new AccessControlContext. This wasn’t the case, and as far as I can figure out, the combiners are present mainly so that JAAS can merge the user-specific ProtectionDomain with the “base” system ProtectionDomain once the user authenticates.

Putting it all together, an AccessControlContext allows us to execute code under a special context. An AccessControlContext itself does not have permissions associated with it. Instead, it is composed of ProtectionDomains which have permissions that only apply to security checks originating from certain classes, based on where the classes was loaded from (i.e. security check requests from a particular codebase). So to achieve what I want , I needed to create a ProtectionDomain that applied to all classes (null CodeSource). I’ll have to figure out which permissions the VM needs (e.g. file access), in addition to creating my own custom set of Permission implementations to represent my app-specific operations.

I do wonder if I’m missing an easier way of accomplishing this, but it took awhile to figure out even this much, so I’m not inclined to keep looking now that I have a reasonable solution.

The code I came up with looks like this:

Permissions permissions = new Permissions(); // TODO populate the permissions collection. // TODO shouldn't be giving all permissions permissions.add(new AllPermission()); ProtectionDomain userDomain = new ProtectionDomain(null, permissions); AccessControlContext userContext = new AccessControlContext(new ProtectionDomain[] {userDomain} ); try {   opDocument = ( Document ) AccessController.doPrivileged(     new PrivilegedExceptionAction () {     public Document run() throws Exception {       return command.execute();     }   }, userContext); } catch (PrivilegedActionException pae) {   throw pae.getException(); }

Posted in techie | No Comments »

Little Tibet Restaurant

Posted by GJ on November 12, 2005

Little Tibet Restaurant has a good memory with me of the food, so going back for pictures was appealing. I passed on the tea with salt and butter this time, though - very much like the Indian version, and I don’t care for that either.

I started with the Tentuk, a hearty soup with handmade noodles and slices of beef, garnished with fresh spinach and coriander:

Good, but not that unusual. Basically a light tomato/vegetable broth soup, though I was fond of the coriander that was added. Certainly better than what I’d get from a can, and a pleasant, simple starter.

The menu has about 8 different versions of the Momo dish. I went with the one labelled “Tibet’s most popular dish”. Named simply “Momo”, it’s described as steamed handmade beef dumpllings served with seasonal greens:

The beef in the dumping was slightly spicy, and the salad was fresh with a sweet, light dressing. I didn’t use the tomato-based dipping sauce (?) much - it didn’t add to the taste for me. A simple dish that’s filling and satisfying, but not particularly unusual, especially if you’re used to Oriental foods. Aside from the spices, the dumplings didn’t seem that much different than you might find at an Oriental grocery store.

For dessert was the Mindha, an all natural rice and dried fruit dessert originally served in monasteries in Tibet:

Quite sweet, cinnamon-y. The rice was softer than I would have liked (I like my pastas, rice, and noodles firm). I believe the dried fruit was raisins. I didn’t dislike it, but I wasn’t that interested in it either.

Overall, I don’t know why I recalled this restaurant so fondly. The food is simple, filling, and refreshing, and you certainly avoid the effects of eating heavy or rich meals like steak. However, the dishes were quite simple - I guess that’s appropriate for the monasteries of Tibet.

Another review of this restaurant noted that Tibetan cuisine borrowed from its Indian and Chinese neighbours. I’d say that’s true, which removes some of the novelty if you’re familiar with those cuisines.

If I go back, I’ll have to remember to ignore the dishes labelled as popular in Tibet, and try the unusual ones. While the food was good, and I certainly had no complaints, they’re pretty simple, pleasant foods, but at prices a little higher than I’m comfortable with. Those prices btw, were: Tentuk (3.95), Momo (9.50), Mindha (5).

Posted in everyday | Tagged: | No Comments »

Hiro Sushi: good fish, interesting menu, expensive

Posted by GJ on November 2, 2005

This time Hiro Sushi was open, and not particularly crowded when I got there. Some of the reviews raved about the authenticity and quality, despite the expense, so I was looking forward to something different and delectable.

The decor was definitely intersting. Here’s a picture of Hiro (presumably) behind the intriguingly designed sushi bar:

I also noted the unusual settings at each seat:

The use of a peanut to as a chopstick holder is memorable, and notice the table is branded with Hiro’s mark. The paper napkins are also stamped with the same mark.

The daily specials were pretty interesting sounding (e.g. Bluefin Tuna entree), but at a new restaurant for a familiar cuisine style, I prefer to stick with the “basics”, i.e. sushi. I had the omakase (market price). To quote the menu:

Omakase is a style of eating, and is founded on trust between the customer and the chef … Hiro will select your dishes and the order in which they are served to create a traditional Japanese culinary experience.

I received an unusual container of soy sauce, and a plate filled with a numerous variety of nigiri.

My photography skills need work, but at least I sensed that I might end up with a depth of field issue, so I took a second picture that moved the focal area up a bit:

From upper left proceed rightwards: Yellowfin(?), Fluke, Salmon, Tuna, White Tuna, Octopus, Shrimp, Scallop, Roasted Salmon, Salmon Roe, Shitake, Unagi, Tuna Make w/ Green Onions, Cucumber Maki (w/ capers?).
The soy sauce container was interesting, too, being delivered in a cup with a wooden bucket-like utensil:

I tried to eat the nigiri “properly”, i.e. not dipping it into the soy sauce, touching soy sauce to the nigiri with my chopsticks instead. I’m not much for wasabi, so a couple times I found a pockets in the nigiri that were a bit much, but frequent wasabi consumers wouldn’t have trouble I’m sure. My significant impressions that I remember:

  • The texture of the salmon was soft-like, it “tore” easily. Not sure if I’m only used to the texture when it’s cut as thicker sashimi slices, but it wasn’t unpleasant by any means.
  • Octopus, shrimp, scallop: good, normal. I’ve never had any of those three that really blew me away in any cuisine, so I can only say it’s as good as I’ve encountered.
  • The salmon roe reminded me why I don’t like caviar much. Fishy and very salty.
  • Neutral towards the roasted salmon. Interesting, not unpleasant, but I don’t care much about it.
  • The cucumber maki was a little unusual. I’m still not sure what was in there, the closest thing I could think of was capers. Not unpleasant, merely different.
  • The unagi was awesome. I’ve had it elsewhere where it was much softer and with a lot more sweet sauce on it. I liked it this way, a little firmer, less (none?) of that sauce compared to other places I’ve gone.

If I went back, I’d be more selective and get the unagi, and the top row of fluke, salmon, tuna, etc. Perhaps as sashimi, since the rice, while good, isn’t really what I’m there for. :)

The staff are Japanese (majority of Japanese restaurants around Toronto are actually Chinese run), with some Japanese speakers that stayed at the sushi bar and chatted with the chef. Having never been to Japan, I take that as a good indicator of authenticity. One of the waitresses had trouble understanding what I was asking, though (”what’s in the cucumber maki?”).

I was a little surprised at the final bill: miso soup ($3), green tea ice cream ($3), omakase ($38). However, if you count what I had on my plate (11 nigiri, 2 maki, and the roe) it’s not too excessive (for downtown Toronto). Naturally, one doesn’t usually get stuffed on sushi alone, and Hiro’s a little more expensive than most, but the quality of the food seemed quite good. All in all, I liked the restaurant, but I’ll be more discriminating in what I order next time.

Next: haven’t decided yet
[Updated 2005/11/06] Little Tibet Restaurant

Posted in everyday | Tagged: | No Comments »

How Advanced Can a Civilization Become?

Posted by GJ on November 1, 2005

I stumbled across a rather fascinating article/interview for sci-fi fans, via http://del.icio.us/popular. The piece talks about rating civilizations based on energy consumption, and discusses some of the implications as these civilizations become progressively more advanced.

An excerpt:

Currently, our energy output qualifies us for Type 0 status. We derive our energy not from harnessing global forces, but by burning dead plants (e.g. oil and coal). But already, we can see the seeds of a Type I civilization. We see the beginning of a planetary language (English), a planetary communication system (the Internet), a planetary economy (the forging of the European Union), and even the beginnings of a planetary culture (via mass media, TV, rock music, and Hollywood films). By definition, an advanced civilization must grow faster than the frequency of life-threatening catastrophes. Since large meteor and comet impacts take place once every few thousand years, a Type I civilization must master space travel to deflect space debris within that time frame, which should not be much of a problem. Ice ages may take place on a time scale of tens of thousands of years, so a Type I civilization must learn to modify the weather within that time frame.

If you have fond memories of reading novels from Isaac Asimov or Arthur C. Clarke, I think you’ll enjoy this article, How Advanced Can a Civilization Become?

Posted in everyday | No Comments »