Top 10+ Favorite Books

My favorite books, in no particular order.  For me, these are books to live by.  They inspire me, educate me, and pick me up when I’m down.

  1. “They Call Me Coach” by John Wooden
  2. “Jonathan Livingston Seagull” by Richard Bach
  3. “The Power of Now” by Eckhart Tolle
  4. “Illusions” by Richard Bach
  5. “Tao Te Ching” by Lao-Tzu (translated by Jane English and Gia-Fu Feng)
  6. “Plain Speaking: An Oral Biography of Harry S. Truman” by Merle Miller
  7. “The Inner Game of Tennis” by W. Timothy Gallwey
  8. “The Hobbit” by J. R. R. Tolkien
  9. “Walden Two” by B.F. Skinner
  10. “Don’t Shoot the Dog!” by Karen Pryor
  11. “On Writing” by Stephen King
  12. “The Elements of Style” by Strunk & White
  13. “Getting to Yes: Negotiating Agreement Without Giving In” by Roger Fisher &  William L. Ury
  14. “The Autobiography of Benjamin Franklin” (by guess who?)

July 6, 2011 at 10:44 pm Leave a comment

Define XML Element to Hold Text and Any Elements with XML Schema

Every couple years I end up needing to define an XML element to hold text and other elements, typically HTML markup elements. Here’s one way to define it in XML Schema:

 <xs:complexType name="MixedTextAndAnyElementsType" mixed="true">
   <xs:sequence>
     <xs:any namespace="##any" processContents="skip"
         minOccurs="0" maxOccurs="unbounded"/>
   </xs:sequence>
 </xs:complexType>


		

April 8, 2011 at 3:29 pm Leave a comment

How to Set an HTTP Header in a Tomcat Valve

In Tomcat 6.0, it’s not obvious how to set an HTTP header in a valve (container-wide filter).  You might think you could do it inside the invoke() method by calling the Request object’s addHeader(key,value) method, but you’d be wrong:-(

In the Tomcat source code, the addHeader() method is empty!  It doesn’t even throw an exception to say it does nothing.  That’s a nasty surprise left for you to discover by the Tomcat developers.  Any way, here’s code for setting a header:


public void invoke(Request req, Response resp)
    throws IOException, ServletException
{
    MessageBytes mb =
        req.getCoyoteRequest().getMimeHeaders().addValue("FOO");
    mb.setString("BAR");
    getNext().invoke(req, resp);
}

If you’re using Maven, you’ll need at least these two dependencies in your valve project:

<dependency>
    <!-- has valve interface -->
    <groupId>org.apache.tomcat</groupId>
    <artifactId>catalina</artifactId>
    <version>6.0.26</version>
    <scope>provided</scope>
</dependency>

<dependency>
    <!-- has ...coyote.Request -->
    <groupId>org.apache.tomcat</groupId>
    <artifactId>coyote</artifactId>
    <version>6.0.26</version>
    <scope>provided</scope>
</dependency>

Thanks to Mark Thomas’s response to a related post way back in 2006.  Not being an HTTP protocol wizard, I’d not have connected HTTP headers with MIME types.

September 14, 2010 at 5:24 pm Leave a comment

Compiling Nano on Cygwin

To compile and install the latest Nano text editor on Cygwin, don’t forget to use the UTF-8 version of libncurses-devel.

Continue Reading August 27, 2010 at 11:41 pm Leave a comment

Boycott Apple Arrogance [Boycott Finished - We won!]

Boycott Apple. If Apple disrespects and overly restricts software developers, let’s stop buying and using their products. And let’s not create applications for Apple hardware. Lower profits and growth rates are the only things that will pierce Apple’s arrogance bubble.

Continue Reading April 30, 2010 at 6:19 pm 3 comments

Seattle for Visitors

If someone comes to visit you from off world or even out of state, here are some places to go to make their stay more memorable.

  • The Experience Music Project (EMP).  I’ve heard good and not so good reviews about it.  Nevertheless, I’d like to see the inside of it.  (I wish I didn’t have to look at the outside of it;-)
  • The Museum of Flight: I’ve only heard good things about this place.
  • University of Washington:  I love those gothic buildings around Red Square.  The spring time cherry tree blossoms are definitely worth a walk through.
  • Top of Queen Anne: A great views of Seattle.
  • Alki Beach:  A nice view of Seattle.  But don’t go to Salty’s.  It’s dreadful and expensive the last couple years:-(
  • Seattle Art Museum
  • Seattle Asian Art Museum
  • Pacific Science Center
  • Space Needle: You can visit the top for a quick view and/or have dinner there.  The food is nothing to write home about and it’s pricey.  But because the whole restaurant revolves 360 degrees every hour, it’s a great way to see Seattle in a relaxed way.
  • Deception Pass:  A ways north of Seattle, but quite spectacular.
  • Chuckanut Drive: If you’re visitors are heading up to Vancouver BC, you might as well go up or come back on the scenic Chuckanut Drive. Also, if you like east coast quality bagels, stop in at the Bagelry in Bellingham, near where a north bound drive on Chuckanut will dump you.
  • Olympia Pizza on 15th in Capital Hill:  It’s my favorite pizza place for thicker crust pizza.  BUT, make sure to order “lite” cheese on the pizza, or you may be overwhelmed by the monstrous amount of cheese they usually put on.  If the weather is nice, you can eat outside in front of the restaurant and enjoy the laid back 15th Ave scene.
  • Bruce Lee’s Grave:  He and his son are buried in the graveyard at the top of Capital Hill.  You can get to via 15th Ave.  It’s near the Asian Art Museum.  Not for everyone, but some people would enjoy visiting it.  If you’re into famous graves, you could also visit Jimi Hendrix in Renton.
  • Safeco Field:  I’m not much into baseball, but a warm summer evening at this baseball park is very enjoyable.   Buy the cheapest tickets you can. Then spend most of your time walking around the stadium and sit in any empty good seat you want.  They kettle corn they sell outside the stadium is pretty darn good too.

What places do you like to take your out of town visitors to?

July 26, 2009 at 3:00 pm Leave a comment

Java Wish List

Things I wish Java had:

  • A way to get the currently running method name, i.e. Thread.getCurrentThread().getCurrentMethodName().  This would help in unit tests, where I often use the test method name as the basis for usernames, log traces, database values, and directory names etc.  For example, when my test needs to login to some service, I’ll create a username like this “<testMethodName>-username”.  There are ways to get the current method name, but they involve using unsupported Sun methods or extracting it from a stack trace, both of which are non portable.
  • Hmmm…what else?

June 3, 2009 at 10:56 am Leave a comment

GroovyWS HTTP Proxy Configuration

Here’s the story of how I got Groovy 1.6.3 and GroovyWS 0.5.0 to call a SOAP service through an HTTP proxy.

As of 28-May-2009, the GroovyWS website said…

Using proxies

If you are using a proxy for accessing internet, you can use the following environment variables to get rid of it:

  • proxyHost
  • proxyPort
  • proxy.user
  • proxy.password

or directly use the following in your proxy.setproxypropertie([:])

I tried to make HTTP proxy configuration work by following their instructions.  Unfortunately, the following three ways didn’t work :-(   I used various property naming conventions I saw in the GroovyWS javadocs and other online examples.

//A
proxy.setProxyProperties( [ "proxyHost":"proxy.foo.org", proxyPort:"8080", "proxy.user":"myUsername", "proxy.password":"myPassword" ] )

//B
proxy.setProxyProperties( [ "http.proxyHost":"proxy.foo.org", "http.proxyPort":"8080", "http.proxy.user":"myUsername", "http.proxy.password":"myPassword" ] )

//C
proxy.setProxyProperties( [ proxyHost:"proxy.foo.org", proxyPort:"8080", "http.proxy.user":"myUsername", "proxy.password":"myPassword" ] )

However, these two ways did work :-)

//D
System.setProperty(“http.proxyHost”, “proxy.foo.org”)
System.setProperty(“http.proxyPort”, “8080″)
System.setProperty(“http.proxy.user”, “myUsername”)
System.setProperty(“http.proxy.password”, “myPassword”)

//E
System.setProperty(“proxyHost”, “proxy.foo.org”)
System.setProperty(“proxyPort”, “8080″)
System.setProperty(“proxy.user”, “myUsername”)
System.setProperty(“proxy.password”, “myPassword”)

My conclusion is that either I called setProxyProperties() incorrectly or that it doesn’t work.  Setting the system properties directly was the only way I got GroovyWS to work through an HTTP proxy.

Here is the final working script:

import groovyx.net.ws.WSClient

System.setProperty("proxyHost",      "proxy.foo.org")
System.setProperty("proxyPort",      "8080")
System.setProperty("proxy.user",     "myUsername")
System.setProperty("proxy.password", "myPassword")

WSClient proxy = new WSClient("http://www.w3schools.com/webservices/tempconvert.asmx?WSDL", this.class.classLoader)
proxy.initialize()
def result = proxy.CelsiusToFahrenheit(0)
println "You are probably freezing at ${result} degrees Farhenheit"

NOTE: I used the GroovyWS uber jar: groovyws-standalone-0.5.0.jar.  Because it was taking too long, I gave up on trying use the GroovyWS minimal jar and then figuring out which CXF dependencies were needed for a simple SOAP client.

May 28, 2009 at 3:03 pm 3 comments

Make Subversion Ignore Directories Completely

I want to exclude “log” and other transient directories from SVN.  As far as I can tell, SVN’s global ignore example does not show how to exclude a directory itself.  But there is a way. 

To make SVN completely ignore a directory named “log” and all its contents, add log to the global-ignores line in the ~/.subversion/config file.

This is the only way I’ve found to make SVN 1.5.x & 1.6.x to not show the log directory when I run the svn status command.

April 20, 2009 at 10:46 am Leave a comment

Ted’s Steak Making Method

My friend Ted Neyer makes just about the best damn steak in Seattle.   He makes steak better than El Gaucho, The Met, Ruth’s Chris Steakhouse, and Daniel’s Broiler.  The only restaurant that makes steak better than Ted is Morton’s Steakhouse, and that is probably due to their superior meat.

The steaks Ted cooks to perfection are from Costco.  They have really good prices compared to grocery stores.  Also, they sell so much meat so fast, that you can be sure it’s fresh.

There is nothing fancy about how Ted cooks steak, except how it tastes.  He uses a big cast iron frying pan on a gas stove top, but can do just as well on an electric stove top.  The only fancy thing that Ted needs to cook steak is a powerful exhaust fan because, with exception of Filet Mignon, steak cooked at  high temperatures puts out a lot of greasy smoke.

The Method

  1. Buy steaks from Costco:  New York, Filet Mignon, or best of all Rib Eye.  Don’t be shy, buy thick ones.
  2. Take the steak out of the fridge and let it sit until it reaches room temperature.
  3. Soak the steak in light olive oil, Johnny’s Seasoning, & ground pepper for about 20 minutes.  (I used to not like pepper on steak, but Ted showed me the error of my ways)
  4. Heat up your cast iron frying pan until it just starts to smoke.  In other words, it ought to be pretty dang hot.
  5. Cook the steak 4 minutes per side.  The goal is to create a black crust that seals in the flavor, but leaves the center rare to medium rare.
  6. If you’re concerned that you didn’t cook it enough, you can put it in a 350º-375º oven.  Use an electronic thermometer to watch the temperature.  For rare-ish steak, keep it in until it reaches 115º.  For medium rare to medium, let it reach 135°.
  7. After taking it out of the pan or oven, don’t eat it yet!  Let it rest, under a foil tent, for about 5 minutes.  It needs time for the juices to settle down and soak back in.   If you don’t wait, when you cut into it the steak, the juice will flow out onto the plate, where it won’t be able to add flavor to the meat.

When all is said and done, but before the eating begins, you could end up with this.

filet mignon, ricotta, and asparagus

filet mignon, ricotta, and asparagus

If steak ends up becoming a big part of your diet, then you may be interested in one of these.

March 31, 2009 at 9:58 pm Leave a comment

Older Posts


Recent Posts

Categories


Follow

Get every new post delivered to your Inbox.