astradele

Archive for April, 2006

Gmail helps with email subtleties

Posted by GJ on April 27, 2006

Let’s say you send out an email to several people, and a recipient does a Reply-All to say something, but adds yet another recipient at the same time. Would you notice? Would you want to notice, so you don’t accidentally say something you shouldn’t?

Gmail highlights these new recipients in bold. Presumably it inspects the previous emails in the “conversation” it’s a part of, and notices that some new people have joined the discussion. An innovative idea that solves a problem that I never even realized as a problem.

Now, if only they could do something about the accidental Reply-All…

Posted in techie | No Comments »

Building up to a home theatre

Posted by GJ on April 26, 2006

  1. Watching DVDs on the right monitor while tinkering on the left detracts from the quality of both activities.
  2. Seems pointless to buy a TV of a size that will give a reduced experience from what I’m used to.
  3. CRT TVs at 30″+ are very heavy, and I don’t have a car or much space.
  4. A TV box using non-CRT technologies (LCD, plasma, rear projection) is very expensive.
  5. A front projector costs less per inch of screen than non-CRTs at 30″+.
  6. Found a projector that comes with a built-in DVD player, built-in speakers, and rave reviews.
  7. The visuals are good, but the speakers lack punch.
  8. Surprise one-day online sale on speakers. Entry-level prosumer speakers are heavily discounted. The “quantity remaining” slowly counts down, and ten minutes left before an appointment.
  9. Speakers are more high-end than I’ve ever had. Each speaker needs its own input signal, so I need a receiver.
  10. Receiver’s nice, but how do I put the speakers at the right height? Need to get some stands.
  11. Speakers placement is okay, but the speaker wire it came with isn’t long enough. Time to buy some overpriced speaker cable.
  12. Oh right, I need to send the audio from the projector’s DVD player to the receiver. Go back for an overpriced optical cable.
  13. Four hours to measure distances, cut and strip cable, read the user manuals, and concoct protection for the high-priced cables from a certain feline terrorist.

Yay! It sounds great, it looks great, everything is pretty much secure and tucked away neatly. I’m very happy with the final result.

Although… a well-stuffed leather couch would make movie and video game marathons more comfortable…

Posted in everyday | No Comments »

XML transform bug in Java 1.5’s JAXP implementation

Posted by GJ on April 23, 2006

I’m a little bit disappointed. I try to always assume that I’m in the wrong, and the libraries, carefully selected with an eye to maturity, are in the right. Without trust in one’s foundations, development goes much slower.

In Java 1.5 (1.5.0_06), Sun integrated the JAXP api and an implementation of it (Xalan). I’ve already stumbled on a performance problem in that implementation. This new problem is less serious in real impact, but it’s more of a “real” bug in that it’s not a sliding scale like performance.

There’s very little difference between this program:

 public class DomViaDomTransform {      public static void main(String[] args) throws Exception {         File source = new File(args[0]);         File stylesheet = new File(args[1]);          StreamResult out;          DOMSource src = new DOMSource(              DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(               new FileInputStream(source)));         DOMSource style = new DOMSource(              DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(               new FileInputStream(stylesheet)));          out = new StreamResult(System.out);          TransformerFactory factory = TransformerFactory.newInstance();         Transformer xf = factory.newTransformer(style);          xf.transform(src, out);      } } 

and this program:

 public class StreamViaStreamTransform {      public static void main(String[] args) throws Exception {         File source = new File(args[0]);         File stylesheet = new File(args[1]);          StreamResult out;          StreamSource src = new StreamSource(new FileInputStream(source));         StreamSource style = new StreamSource(new FileInputStream(stylesheet));          out = new StreamResult(System.out);          TransformerFactory factory = TransformerFactory.newInstance();         Transformer xf = factory.newTransformer(style);          xf.transform(src, out);      } } 

However, if you run them with the default JAXP implementation in 1.5, the first program will not transform the input XML. You’ll still get output, but the output will be the stylesheet.

For instance, take this stylesheet:

 <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">  <!-- Default copy everything. --> <xsl:template match="node()|@*">   <xsl:copy>     <xsl:apply-templates select="node()|@*"/>   </xsl:copy> </xsl:template>  </xsl:stylesheet> 

which is a direct copy transformation. If we feed in the following as the input XML:

 <?xml version="1.0" encoding="UTF-8"?> <foo/> 

the second program (the one using StreamSource instances), will generate the same XML as output. With the first program (the one using DOMSource instances), you get the stylesheet as the output XML.

Silly bug, minor impact, easily worked around, but definitely broken. However, this is enough to convince me switch to Saxon, a drop-in JAXP replacement. The authour, Michael Kay, I understand to be very passionate and picky about all things XML, which is bad if you want to trade words I guess, but great for me as someone who wants a bug-free implementation of JAXP. I’m writing Java software in my spare time; I don’t have time to distrust my libraries.

Sun hasn’t recognized my bug submission yet, so it may be a duplicate of a known problem (none that I could find using the search engine, though), or I could be using the classes incorrectly. I don’t see how the latter is possible though, as putting Saxon on the classpath to become the new JAXP implementation corrects the problem, without recompilation.

Posted in techie | No Comments »

Ferrari @140mph through Paris

Posted by GJ on April 23, 2006

Saw this via digg while programming. Exciting, although of questionable sense.

Posted in everyday | No Comments »

Accented characters

Posted by GJ on April 19, 2006

It took me awhile, but it finally occurred to me to look up how to type the accented characters I usually simplify.

On Windows 2000 and up, to get accented characters:

 CTRL + , then c : ç CTRL + ` (accent under tilde) then a,e,i,o,u : à,è,ì,ò,ù CTRL + ' (apostrophe) then a,e,i,o,u : á,é,í,ó,ú CTRL + SHIFT + 6 then a,e,i,o, u : â,ê,î,ô,û CTRL + SHIFT + : (colon) then a,e,i,o,u: ä,ë,ï,ö,ü   

Courtesy of Google and this page.

Posted in techie | No Comments »

My first brev&eacute; latt&eacute;

Posted by GJ on April 19, 2006

I braved a new latté I’d heard about. I didn’t even know what it was called, I ordered a “latté with cream” from Starbucks, and she called out “brevé latté”. I had to get her to repeat the name.

It’s good. As disgusting as it may sound, it’s like drinking hot ice cream. Basically, it’s very creamy; like the difference between skim and whole milk. The cream coated my tongue for awhile afterwards though, despite all the water I was drinking. Something more astringent, like tea, may be necessary.

Funny enough, the cashier at Starbucks asked me to clarify if I wanted half and half cream, or whipped cream. I may have to go back.

Update: Over my second breve latte the next day, I looked up the nutritional data of a tall breve latte. Really good nutrition site, btw. The main takeaways: 426 calories, 37g of fat. 114% of the recommended daily value for saturated fat. I think this will be my last breve latte. :)

Posted in everyday | Tagged: | No Comments »

Where’s mrrrow food?

Posted by GJ on April 18, 2006

My poor cats… with the introduction of my new projector, all the fixtures of their world (i.e. my furniture) moved about considerably. I came home today to find them calling out to me in hunger, circling the barren space where their food dishes used to be.

Update: I stopped feeling sorry for my cats. The troublesome one figured out that if she applies enough pressure, the wooden pole that “bars” the kitchen door from opening will flex enough to let her slip in. <sigh> I guess if I was locked in the apartment all day with certain areas always forbidden to me, I’d spend my days thinking about how to get in, too.

Posted in everyday | No Comments »

Optoma DV10: a good projector at a good price

Posted by GJ on April 18, 2006

Happily, UPS not only delivered the Optoma DV10 I ordered just before the long weekend, I somehow didn’t get charged any customs taxes.  I don’t know what’s going on and I’m not going to ask!  If you need a projector or tv, you should give VisualApex a browse.  Not only did they have by far the most comments (and the most positive comments) at ProjectorCentral, I attest to their responsiveness over email and the speed at which my order became a shipment.

I’m happy with this projector.  I won’t rehash any information from the detailed review I referred to in my previous post.  I’ll try to add some more information of interest instead.

The sound is lacking in bass.  I really noticed while playing DDR.

You need the remote to work the projector.  There are buttons on the projector, but only the basics.

Power cord is a regular computer power supply cord.  That’s great for me,  in case my cat does in yet another cable.

Having such a large screen really shows any artifacts in the video.  It’s probably less noticeable with non-animated, modern movies, but my test animes (all I had on hand) were older, showing compression artifacts over the the many patches of solid colours.  It showed up as a distracting kind of “shimmer”… if I paused, I could see compression “splotches”.  Other, more modern DVDs (also anime) were fine.

It plays VCDs.  I found this useful for playing downloaded videos, instead of hooking up my video card and sound card.  Of course, the quality wasn’t that great, but it was tolerable.

The closes you can watch is at a distance that’s equal to or greater than the projector.  Much closer and you can see the distinct pixels.  Motion sickness is also likely having such a huge picture moving swiftly.

The Optoma DV10 comes with a very nice carrying case:

The projector needs to be set low to the ground.  At a distance of 8′ and height of 3″, it shoots a picture about 80″ diagonal (4:3) that starts 3′ off the ground.

The following pictures are 4:3.  I didn’t have any wide screen sources on hand.  These pictures were shot at night, so just a little bit of ambient downtown light.  The large black swath at the bottom of each picture is the area of wall that wasn’t used.

For reference, I took a picture with a significant amount of light (equivalent to a couple 60 watt incandescent bulbs).  Later tests confirmed the point - the projector can’t be until around dusk.  It doesn’t have to be pitch black, but at least “evening”.

If there was an unexpected downside, it would be a space organization concern.  While a large television would take up far space, I am somewhat constrained in the placement of my furniture in order to get sufficient throw distance, and keeping clutter clear.  i.e. with a television, I could have it in the middle of the room, and have something behind or holding it, like a shelf.

The sensitivity to ambient light wasn’t surprising, and my current curtains are pretty thin.  It even has the additional benefit of encouraging me to run errands and get things done instead of watching during the day.

As stated before, it’d be nice if the audio had punch, but I don’t think much else could be done given the size of the unit.

The Optoma DV10 is a very good projector, particularly for the price (U$1k).  A traditional television for an image half the size would be far more expensive.  It shoots very well even on a plain wall; using a proper projector screen would make it even better from the screen’s gain properties.  As a portable projector to entertain while visiting, it fits the bill admirably.  It’s far less dominating of the room than if I’d gotten a large television, although I admit to some creative furniture arrangement to keep the part of the room in front of the projector totally clear.  If you’re willing to consider alternatives to traditional box television, this is a very good one.

Posted in everyday | No Comments »

Apache on RedHat Fedora Core: proxy runs afoul of SELinux defaults

Posted by GJ on April 16, 2006

My Linux distro of choice is Debian, including its progeny.  I hadn’t used RedHat since version 6.  Unfortunately, RedHat’s installer kernel has better support for modern hardware, or at least Dell server hardware.  I had no desire to muck around with kernels anymore (time and opportunity cost issue), so I was “forced” to give RedHat another spin.  As you’ll read, I don’t much care for RedHat for vanilla server installs, and particularly I had trouble (admittedly born out of ignorance) setting up Apache to run as a proxy server.

I didn’t like that a minimal install of RedHat (Fedora Core 5) still has a lot of services and applications installed.  I don’t think it’s wrong to do so; I can see they were aiming for a Windows-like install and user experience.  However, like Windows, its good until you run into a problem, at which point one needs to figure out which of many services is the culprit.  It’s also wasteful (CPU, memory, administrative time) if you know exactly what you want, but that’s the Debian-on-obsolete-hardware veteran talking.

For me, the main stumbling block going to RedHat again is that RedHat follows the SELinux guidelines out of the box.  This means that it’s been somewhat hardened and uses ACLs.  It’s a fine idea, but clearly the default setup was configured with workstations in mind.  I wanted to do was set up Apache as a proxy server, but it wasn’t as easy as running yum.

The Apache error log showed a message every time someone external accessed the site, but it wasn’t helpful at all: [error] (13)Permission denied: proxy: HTTP: attempt to connect to 127.0.0.1:11235 (localhost) failed

It took me awhile to realize what was going on; when I started I wasn’t even aware of the use of ACLs.  Eventually, I’d read enough on semi-related SELinux and RedHat issues, including a newsgroup post in German, and figured that I needed to setsebool httpd_can_network_connect true to permit the Apache process to connect to other machines.  There’s some additional steps to make it “sticky” between reboots.

Knowing that string, httpd_can_network_connect, it’s easy to find references to the problem/solution.  Starting from the problem, however, was very frustrating.  So for the search engines: if you’re using RedHat Fedora Core, running Apache as a proxy server, and getting Permission denied: proxy errors, you may need to run setsebool httpd_can_network_connect true.

Perhaps an uncalled for comment, but if this was Debian, I’d have gotten a screen explaining the trade-offs during the installation process.  Surely making use of Apache’s fantastic proxy capabilities isn’t that uncommon, is it?

Posted in techie | No Comments »

Somce nice cars

Posted by GJ on April 16, 2006

I’m not a car person.  I appreciate a nice ride, and being in an expensive car is mildly interesting, but I barely know how combustion engines work, much less model numbers, designs, etc.

It’s an unfair coincidence then that my former employer once gave me the opportunity to see his impressive car collection while I was vacationing in his home city.  The following pictures are from his garage from that visit awhile ago.  I hope it’s not inappropriate for me to post them.  I’d forgotten about them, but it came up in conversation recently. Since it’s mostly friends and acquaintances that visit this blog, some of whom appreciate cars, I’ll post a few.


Some kind of Ferrari (I told you I don’t appreciate cars).


Readers will have to recognize this one on their own.  I wonder if this was the one that he told me ran on some strange fuel blend… alcohol or something like that?  Some of these cars were decades old yet went at speeds that would put many modern sports cars to shame.


An Aston Martin.  Being cautioned not to lean on the aluminium (?) chassis, because it dented easily, is probably why I remember it better.  The owner was kind enough to “pop the hood” (carefully removing a metal sheet) for a picture of the engine.


I think this is the guts of one of the older Ferrari models.  I was impressed by how unusual (for my experience) it was designed, e.g. engine in the back.


Another older Ferrari of some sort.


The “cockpit” of of one of the Ferrari race cars.  I got to sit in this one; it was incredibly difficult to get in and out, particularly with my boots - the inch of rubber heel caught on the edges of the tiny “doorway” (more of a chute).  The funny thing is that I was told these were considered “two seaters” (condition for the classification of cars being raced), yet you could only fit a baby or perhaps small child in the makeshift “passenger” seat.


Yet another Ferrari (notice a pattern?).  I thought this one looked particularly nice, but I’m biased by my limited experience seeing only modern race cars while channel flipping.

You can see all the pictures I took at Flickr, under “nicecars”.  Ignore the last one of the car on the street - that was just some random car.

Posted in everyday | No Comments »