April 27th, 2008

More photos: BMW M3 head photo set
The M3 head just came back from the machinist about a week ago and it looks wonderful but unfortunately I didnt send off the cam case and other parts to be media blasted along with the head. So this Saturday I spent the day with the parts cleaner at my friends shop A1 Imports Autoworks in San Rafael. It saved me a little bit of money and I had to inventory anyway. I cant wait to put it together!
Posted in Cars | No Comments »
April 22nd, 2008
Rrecently I took one of my favorite drives up towards Mt Tamalpais and eventually ended up at Point Reyes where we drove through the farms. Here are some of the photos from the trip, as well as some random ones from my various trips over the years. You can see the rest of these photos on the new flickr site for John Clarke Mills!

Here is one of the 2002 I really liked. This was a beautiful back road leading down Mt Tamalpais toward Stinson Beach. Fern-covered forests down redwood lined streets for miles and miles. The farm roads in Point Reyes are just as enjoyable.

Posted in Photography | 1 Comment »
April 10th, 2008
Today I came across an interesting concurrency problem while deleting objects from the Social Graph (Semantic Web remember?). I have been tasked with mass deletes throughout our system, including exporting the objects in case they ever need to be reassembled again. Since our graph is so large, and we could potentially be deleting 10’s of thousands of triples at a time, the serialized XML would be about 10 times that many lines per triple represented in a file. In order to write the output to a file as fast as can be there was no need to store the serialized XML in memory. The best thing to do was to pipe the output stream to our binary store.
Now in order to do this, I need two threads, one to write and one to read. If you were to do this with one thread you would most likely run into a nasty deadlock situation. Anyway, here’s what I came up with:
public InputStream openStream() throws IOException {
final PipedOutputStream out = new PipedOutputStream();
Runnable exporter = new Runnable() {
public void run() {
tupleTransformer.asXML( tuples, out );
IOUtils.closeQuietly( out );
}
};
executor.submit( exporter );
return new PipedInputStream( out );
}
Can anyone see the problem? Well unfortunately I couldnt either for over an hour. My unit tests would pass sometimes and fail others which led me to believe I was dealing with a timing issue. Turns out, sometimes the PipedOutputStream was completed before the PipedInputStream was even instantiated, completely missing the stream of the out.close(). The trick was to instantiate the two streams, in and out, at the same time then start the output with another thread. Problem solved. Here is what the finished product looks like:
public InputStream openStream() throws IOException {
final PipedOutputStream out = new PipedOutputStream();
PipedInputStream in = new PipedInputStream( out );
Runnable exporter = new Runnable() {
public void run() {
tupleTransformer.asXML( tuples, out );
IOUtils.closeQuietly( out );
}
};
executor.submit( exporter );
return in;
}
Posted in Computers, Semantic Web | No Comments »
April 1st, 2008
For a long time now I have been interested in vacuum tubes. I love their simplicity, sound, and the fact that the design hasnt changed since the early 1900’s. They also were used as transistors in early computers before the solid state transistor was invented. 50 years ago it would take an entire room of these to power a computer with less memory than a Casio wristwatch.
Anyway, this is a beautifully hand made oil-filled-cap integrated amplifier than runs in 80-watt Class A/B ultra-linear mode and 40-watt triode mode. I have it fitted with a set of Russian Electro-Harmonix tubes, the power coming from two sets of KT88’s. The sound is quite crisp with little to no hum or background noise which is surprising considering tubes are known for these issues. This paired with a set of Kef iQ5 floor standing speakers are wonderfully crisp and clean, especially with vocals. Now, to fix the weak link, the 5 dollar garage-sale bought record player. More to come on the DIY record player later.
Posted in Audiophile, Electronics | 3 Comments »
March 21st, 2008
For the past day or two I had been struggling at work to figure out why Internet Explore 7 would not pay attention to the response headers stating not to cache the response. First, I tried setting the date header to expire instantly, with a value of -1. QA confirmed that this solved the problem in some revisions of IE 7 but not all. After digging around the web it turns out that you have to set a few more headers, one of which I had never even heard of. Here’s what solved the problem for me. This snippet is in Java but could apply to any language:
response.setDateHeader( "Expires", -1 );
response.setHeader( "Cache-Control", "private" );
response.setHeader( "Last-Modified", new Date().toString() );
response.setHeader( "Pragma", "no-cache" );
response.setHeader( "Cache-Control", "no-store,
no-cache, must-revalidate" );
Posted in Computers, Software | No Comments »
February 28th, 2008
Today I came across an issue at work regarding the made up MIME type of ‘image/pjpeg’ while uploading images from IE 7. Java’s ImageIO was choking while trying to upload this type of file because it is not in the list of supported MIME types. The supported MIME type list can be viewed by invoking ImageIO.getReaderMIMETypes(). After reading many blogs of others pounding their head, making fun of Microsoft, and using other solutions like ImageMagick, I found a solution. Add this to your list of supported types and move on. This format is made up and will not cause any problems. Pass the input stream onto your File IO and be done with it. Microsoft owes me half an hour of my life back.
Posted in Computers, Software | 2 Comments »
February 12th, 2008

In my quest for a great sounding stereo and my annoying need to build things I have decided to build my own turntable. Luckily my friend Mark, microelectronics expert extraordinaire, will be teaching me the finer points of circuitry. I will be handling the sourcing, fabrication, and/or assembly of the plinth, bearing, and tonearm. This is a very exciting project for me because I have a limited knowledge when it comes to creating my own circuits. This is one of the last nagging things that I have been dying wrap my head around. More to come as the project progresses. As always I will delving further into the details on my wiki.
Posted in Electronics | 6 Comments »
November 12th, 2007
Recently I have concluded the bulk of the exterior work on the car. The paint isnt perfect buts its actually pretty good especially for a street car. The added side skirts and bullet mirrors help tie it all together. Now to focus on some of the electronics, as well as the new motor. (click the thumbnails for larger pictures)
Posted in Cars | No Comments »
September 18th, 2007

Even though I havent even put 7,000 miles on my first motor install I purchased a cheap S14 2.3- liter motor from the first M3. In combination with my other parts lying around, I am going to build a 2-liter M3 motor with the bottom end (M10) from the 2002. Actually, the blocks are identical except for displacement but machining will probably be required to get all the oil and coolant passages to line up. The M10 block has been in production for over 20 years. My friend and mechanic JP Cadoux will be teaching me how to hand build my first motor and I will be teaching him to control fuel and spark delivery with MegaSquirt open-source software.
I dont want to reveal too many details yet because I am not sure what is possible but I have some very exciting ideas. This motor will be completely custom from the machine work to get everything to mate up to the pistons and rods. For what I am trying to build I dont think I’m going to find anything off the shelf. I am going to attempt to use the same camshafts and valve train as well as the M10 2.0 crank of course. Once the machinist has his hands on it I will know more.
Posted in Cars | 3 Comments »
September 7th, 2007
I have never blogged about Burning Man before so I figured I may as well start now as I did found a theme camp and have helped to run it for the past two years. Our name is the Duck Pond, named for the night when myself and the other founders met and stuck together for a long night keeping “all of our ducks in a row”. Anyway, this year, one of my many projects was signage. Last year people had a hard time finding us so this year I made sure that wouldn’t happen. Turns out you could see this thing from a mile away! Problem solved. Thanks to everyone who helped make it happen from the seamstresses to the tower builders.

Here is a photo of it at night. It really was tremendously bright, especially considering it was powered by only three 75-watt compact fluorescent bulbs.

Posted in Burning Man | No Comments »