Yearly Archives: 2004

6 posts

Convert a Java OutputStream to an InputStream

If you have ever programmed using Java IO, you will quickly run into a situation in which a class creates data on an OutputStream and you need to send it to another class that expects to read the data from an input stream. You'll soon be asking the question, "How do I convert an OutputStream to an InputStream?"

Nowhere in Java will you find a OutpStreamToInputStreamConverter class. Luckily, there are several ways to go about this.

Continue reading

Convert a Java Writer to a Reader

If you have ever programmed using Java IO, you will quickly run into a situation in which a class creates data on a Writer and you need to send it to another class that expects to read the data from a Reader. You'll soon be asking the question, "How do I convert a Writer to a Reader?"

Nowhere in Java will you find a WriterToReaderConverter class. Luckily, there are several ways to go about this.

Continue reading

Turning off the Maintenance Required Indicator on the Honda Insight

I recently got routine maintence done on my 2000 Honda Insight, but the mechanic neglected to turn off the "maintenance required" indicator on the dashboard that comes on every 6000 miles or so. Not a big deal, the owner's manual has instructions for doing so. You would need to be able to if you did maintence yourself. Except the instructions they have don't work. The manual states:

To reset the maintenance required indicator, turn the ignition switch to the LOCK position, then press and hold the trip meter reset button until the indicator resets.

First, the LOCK position isn't labeled as such (further in the manual they explain that it is position 0). Second, they forgot a step. Better directions would be the following:

Continue reading

The FJM

I bought a hybrid electric Honda Insight when they first came out in 2000. In addition to the amazing dual gas/electric technology, the car has a sleek aerodynamic design, wheel covers over the rear tires, flashy silver paint, and an antennae centered on the roof that give it a futuristic look. I call my car "The FJM". Here is the story of how it was named.

Continue reading

Tic-Tac-Toe Strategy

Zero Sum Game

If you know what you are doing, you can't lose at Tic-Tac-Toe. If your opponent knows what they are doing, you can't win at Tic-Tac-Toe. The game is a zero sum game. If both players are playing with an optimal strategy, every game will end in a tie.

Surpisingly few people know optimal Tic-Tac-Toe stategy. Yes there are some people (and computers) that you will never beat, but they are relatively rare. Knowing this, you can become a Tic-Tac-Toe master.

Continue reading