From Florida and Only Florida

Brand loyalty is a finicky thing - strong enough to guide purchases over years and weak enough to evaporate in a flash. We had always been a Tropicana family, recently fending off a brief incursion of Simply Orange at the hands of a visiting nephew.

The brand is what gives the product its authenticity and credibility. The brand includes everything from the name, the look, the logo, the color and the package.

When you change the look of the packaging, you lose some of the power of the brand in the mind. It no longer looks authentic. And worse, consumers think you have also changed the contents.

We weren’t outraged by the change in packaging. We bought some of the new containers. But with the change we took a closer look at the package … and discovered that Tropicana includes oranges from Brazil.

All things being equal, we try to support local business. Which is why we’re now drinking Florida’s Natural - “From Florida and Only Florida”.

Someone Just Doesn't Get It

When I first read about the $18.4 billion in bonuses, my first thought was that “They Just Don’t Get It”. I was amazed that anyone who had witnessed the pillorying of the automobile executives would have the gall to sign off on those bonuses while the entire financial industry went down in flames.

At the time, I thought they had made a serious error. That if they had been properly acquiescent, then it would have business as usual next year. And that $4 billion in bonuses would poison the well for years to come.

But the more I read, the more I think that I was the one who didn’t get it. We may have just seen the end of an era. It’s always been possible for people to attain serious wealth by creating a business. But when it comes right down to it, the financial industry didn’t create a thing.

Over the past years, the financial industry has created vast wealth based upon a bit of an edge and a lot of leverage. Leverage was what allowed them to rake in the bucks. And leverage was what drove their massive losses when their edge was exposed.

After what we’re going through, it is going to be a long time before financial companies will be allowed to become so heavily leveraged. Maybe the financial execs didn’t care that they were poisoning the well because they knew that the well was going to dry up anyway. This was their last chance at a big payday and they were going to milk it dry.

Shanahan Fired

After giving this careful consideration, I have concluded that [a change in our football operations][4] is in the best interests of the Denver Broncos. This is certainly a difficult decision, but one that I feel must be made and which will ultimately be in the best interests of all concerned.

I appreciate the 21 years that Mike Shanahan has given to the organization as an assistant and head coach, and the two Super Bowl wins in that time. His contributions hold a special place in Broncos history.

I never expected this. Bowlen had always maintained that Shanahan would be his coach as long as he wanted the job.

I believe that the MasterMind is one of the best 2 or 3 offensive minds in football. If he has a failing, then it lies in his ability to evaluate defensive talent - in players and coaches.

This only makes sense if Bowlen asked for Shanahan to relinquish some of his authority and Shanahan refused. Anything else and Bowlen has made a huge mistake.

Wiki Fugue

Sudden, unexpected Wikipedia exploration, with inability to recall one’s path to the current topic.

Wikipedia is a fundamental part of my internet. One of the reasons I like Wikipedia so much is the potential for any visit to fall into “Wiki Fugue” . Wikipedia understands that links put the hyper into hypertext. And a simple visit can easily become a half hour diversion.

I borrowed “Clapton: The Autobiography” from one of my local libraries the other day. My followup at Wikipedia quickly lead me to the Yardbirds, Cream, Derek and the Dominoes, Jimmy Page, Stevie Ray Vaughn, and with a little more work “Rolling Stone Magazine’s 100 Greatest Guitarists of all time”. I hadn’t meant to take so long, but it was time well spent.

Building an executable jar with Ant

An executable jar file has a defined default class, allowing the default class to be invoked without explicitly identifying it via the command line. On a supporting OS (such as Mac OS/X or Microsoft Windows), this allows the class to be invoked by double-clicking the file.

I know that making a jar file executable requires an entry in the manifest file. I can usually remember that the attribute in question is Main-Class (although I’m usually fuzzy about the proper capitalization). The problem is remembering the correct command line options to insert my own MANIFEST.MF file into a jar file. All in all, it is much simpler to add a manifest element and let ant handle it for me.

Let’s start with the example from my Ant Hello World Revisited. I’ve added a manifest element that specifies “hello” as the default class to be executed. Note that I’ve also designated the “jar” task as the default task.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$ cat hello.xml
<project default="jar">
<target name="compile">
<javac srcdir="." />
</target>
<target name="jar" depends="compile">
<jar destfile="hello.jar"
basedir="."
includes="**/*.class">

<manifest>
<attribute name="Main-Class" value="hello" />
</manifest>
</jar>
</target>
</project>

As a reminder, here’s the java class:

1
2
3
4
5
6
7
$ cat hello.java
public class hello {
public static void main( String[] args )
{

System.out.println( "Hello World" );
}
}

Now we simply build our jar file:

1
2
3
4
5
6
7
8
9
10
11
$ rm *.jar
$ ant -f hello.xml
Buildfile: hello.xml

compile:

jar:
[jar] Building jar: /Tutorial/Ant/Jar/hello.jar

BUILD SUCCESSFUL
Total time: 2 seconds

And execute the default class by using the -jar command line option to java:

1
2
$ java -jar hello.jar
Hello World

Disclaimer: I don’t claim to be an expert on ant. Please send comments and corrections.

Java Web Services Message Client Redux

What’s the simplest thing that …

I’m sure that my colleagues are tired of me asking “What’s the simplest thing …”. But simple things are focused on just one thing. And when the simple thing fails, then there is just one thing to check. In furtherance of the “simplest thing”, here is an updated Java Web Services Message Client pointed at a publicly available web service. Thanks to Sean Collins of XML Me for allowing us to use their web service.

This client reads an input document from standard input, invokes a web service, and then prints the web service response. It has been updated to support the SOAPActionURI required by the Shakespeare web service and to force a newline between XML elements (changes are shown in bold). The results shown here use Java 1.4.2_11 and Axis 1.3.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.constants.Style;
import org.apache.axis.Message;
import org.apache.axis.message.SOAPEnvelope;


public class Invoke {

public static void main ( String[] args )
throws Exception
{

String endpoint = "http://www.xmlme.com/WSShakespeare.asmx";
String action = "http://xmlme.com/WebServices/GetSpeech";
/*
* Two optional command line arguments:
* the web service uri
* the web action uri
*/

switch(args.length) {
case 0:
break;
case 1:
endpoint = args[0];
action = null;
break;
case 2:
endpoint = args[0];
action = args[1];
break;
default:
System.out.println( "Usage java -cp $AXISCLASSPATH Invoke [WebServiceUri] [WebActionUri] < data.xml" );
System.exit(2);
}
/*
* Read input
*/

String document = streamToString( System.in );
System.out.println( document );
System.out.println( "Invoking " + endpoint + "\n" );
/*
* Pass to web service
*/

Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationStyle( org.apache.axis.constants.Style.MESSAGE );
if ( action != null ) {
call.setProperty(Call.SOAPACTION_USE_PROPERTY,Boolean.TRUE);
call.setProperty(Call.SOAPACTION_URI_PROPERTY,action);
}
SOAPEnvelope envelope = call.invoke( new Message(document) );
/*
* Print the Web Service return
*/

System.out.println( envelope.getBody().toString().replaceAll("><",">\n<") );
}

/**
* Utility to read textual data from in InputStream to a String
*/

public static String streamToString( java.io.InputStream is )
throws java.io.IOException
{

java.io.InputStreamReader ir = new java.io.InputStreamReader(is);
java.io.BufferedReader in = new java.io.BufferedReader(ir);

StringBuffer buffer = new StringBuffer();
{
String line = null;
while( (line=in.readLine()) != null ) {
buffer.append( line );
buffer.append( '\n' );
}
}
return buffer.toString();
}
}

And here is the client in action. For brevity, I’ve requested a Shakespeare speech containing those famous words “Hello, World”. You may want to request something more along the lines of: “dogs of war” or “unto the breach”.

1
12 $ javac -classpath $AXISCLASSPATH Invoke.java
13 $ java -classpath $AXISCLASSPATH Invoke < data/speech.xml
<?xml version="1.0" standalone="yes" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
               xmlns:ns="http://xmlme.com/WebServices">
  <soap:Body>
    <ns:GetSpeech>
      <ns:Request>Hello, World</ns:Request>
    </ns:GetSpeech>
  </soap:Body>
</soap:Envelope>

Invoking http://www.xmlme.com/WSShakespeare.asmx

<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<GetSpeechResponse xmlns="http://xmlme.com/WebServices">
<GetSpeechResult>&lt;MESSAGE&gt;Speech not found.&lt;/MESSAGE&gt;</GetSpeechResult>
</GetSpeechResponse>
</soapenv:Body>
14 $

9 Feb: Examing your Java app with a debugging proxy.

Going for Two

Bravo, Mike Shanahan, Bravo

With over 900 yards of offense in this game, overtime was going to be a 50-50 proposition. Win the flip and win the game or lose the flip and watch the other team take it in for the win.

Not today. With one play to either win the game outright or tie the game, the MasterMind goes for the win. And gets it.

Bravo Zappos, Bravo

It’s in the way that you use it.

It can’t be easy being Zappos. They have raised the bar. Now they have to meet it. Every time.

Thanks to the footbed incident, I finally had a need to call Zappos customer service. It is a much more soothing experience when a vendor starts by accepting their failure and moving forward to making things right.

Shame, Shame

To the person who returned the heat moldable footbeds which I just received from Zappos:

  • On what planet can you trim a size 11 footbed shorter than a size 10 and heat mold said footbeds and still assert that the footbeds are “in the condition that you received them?”
  • Was it really that difficult to exercise the manufacturer’s money back guarantee?
  • Or did that mean you would have to eat the shipping yourself instead of having the Zappos pay for the return shipping, the re-stocking, the shipping to me and the shipping of another set to me.

Every person has their price. The price for which they’re willing to sacrifice their ethics. Congratulations, it looks like your price is about $10.

Phelpsiad

Some may think that NBC is turning the Summer Olympics into the Michael Phelps story. But as far as I’m concerned, someone at NBC Sports has managed to put together a persona that is a very close match to my tastes - the quest for eight has got me glued to my seat.