<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Daniel R.</title>
    <link rel="alternate" type="text/html" href="http://life.neophi.com/danielr/" />
    <link rel="self" type="application/atom+xml" href="http://life.neophi.com/danielr/atom.xml" />
   <id>tag:life.neophi.com,2009:/danielr//1</id>
    <link rel="service.post" type="application/atom+xml" href="http://life.neophi.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1" title="Daniel R." />
    <updated>2009-06-24T02:42:55Z</updated>
    
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 3.3svn-20070408163858</generator>
 
<entry>
    <title>Complexity</title>
    <link rel="alternate" type="text/html" href="http://life.neophi.com/danielr/2009/06/complexity.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://life.neophi.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=1152" title="Complexity" />
    <id>tag:life.neophi.com,2009:/danielr//1.1152</id>
    
    <published>2009-06-24T02:38:06Z</published>
    <updated>2009-06-24T02:42:55Z</updated>
    
    <summary>I have a random note on my desk that I think came from a discussion at the Museum of Science Book Club for the Curious. I unfortunately didn&apos;t write down who said it but still find the thought intriguing enough...</summary>
    <author>
        <name>Daniel Rinehart</name>
        <uri>http://danielr.neophi.com/</uri>
    </author>
            <category term="Quotes" />
    
    <content type="html" xml:lang="en" xml:base="http://life.neophi.com/danielr/">
        <![CDATA[<p>I have a random note on my desk that I think came from a discussion at the <a href="http://www.mos.org/">Museum of Science</a> <a href="http://www.mos.org/events_activities/social_events&d=2938">Book Club for the Curious</a>. I unfortunately didn't write down who said it but still find the thought intriguing enough to capture it here.</p>

<blockquote>Is our ability to create complexity increasing faster than our ability to understand complexity?</blockquote>]]>
        
    </content>
</entry>
<entry>
    <title>How We Decide</title>
    <link rel="alternate" type="text/html" href="http://life.neophi.com/danielr/2009/06/how_we_decide.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://life.neophi.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=1151" title="How We Decide" />
    <id>tag:life.neophi.com,2009:/danielr//1.1151</id>
    
    <published>2009-06-21T22:00:01Z</published>
    <updated>2009-06-21T22:03:56Z</updated>
    
    <summary>&quot;How We Decide&quot; by Jonah Lehrer is an exploration of all the nuances that go into the decision-making process. It is an approachable blend of cutting edge science an anecdotes about how decisions people made influenced their lives (both in...</summary>
    <author>
        <name>Daniel Rinehart</name>
        <uri>http://danielr.neophi.com/</uri>
    </author>
            <category term="Books" />
    
    <content type="html" xml:lang="en" xml:base="http://life.neophi.com/danielr/">
        <![CDATA[<p>"How We Decide" by Jonah Lehrer is an exploration of all the nuances that go into the decision-making process. It is an approachable blend of cutting edge science an anecdotes about how decisions people made influenced their lives (both in life-and-death situations and the ordinary). He explores the decision making process through various facets, among them: dopamine, feelings, thinking, morals, internal argumentative dialog, and thinking about thinking. I suspect a second reading is in order as I usually find reading on airplanes to be a distracting.</p>]]>
        <![CDATA[<p>Some quotes from the book that I wanted to capture:</p>

<p>159: Herbert Simon said it best: "A wealth of information creates a poverty of attention."<br />
188: As Mother Teresa put it, "If I look at the mass, I will never act. If I look at the one, I will."<br />
244-249: the author lays out decision-making guidelines:<br />
<ul><br />
<li>Simple problems require reason</li><br />
<li>Novel problems also require reason</li><br />
<li>Embrace uncertainty</li><br />
<li>You know more than you know</li><br />
<li>Think about thinking</li><br />
</ul><br />
253: decision-making strategy known as <a href="http://en.wikipedia.org/wiki/Crew_Resource_Management">Cockpit Resource Management</a> (CRM)</p>

<p><iframe src="http://rcm.amazon.com/e/cm?t=neo06-20&o=1&p=8&l=as1&asins=0618620117&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr&npa=1" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe><br />
</p>]]>
    </content>
</entry>
<entry>
    <title>The True History of Tea</title>
    <link rel="alternate" type="text/html" href="http://life.neophi.com/danielr/2009/06/the_true_history_of_tea.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://life.neophi.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=1150" title="The True History of Tea" />
    <id>tag:life.neophi.com,2009:/danielr//1.1150</id>
    
    <published>2009-06-21T20:54:23Z</published>
    <updated>2009-06-21T21:07:56Z</updated>
    
    <summary>Victor H. Mair &amp; Erling Hoh explore one of favorite beverages in their book &quot;The True History of Tea.&quot; I read this book during my visit to China which allowed me to better connect with the material as I was...</summary>
    <author>
        <name>Daniel Rinehart</name>
        <uri>http://danielr.neophi.com/</uri>
    </author>
            <category term="Books" />
    
    <content type="html" xml:lang="en" xml:base="http://life.neophi.com/danielr/">
        <![CDATA[<p>Victor H. Mair & Erling Hoh explore one of favorite beverages in their book "The True History of Tea." I read this book during my visit to China which allowed me to better connect with the material as I was able to visit a tea planation and see statues of Lu Yu, who is a central figure in the book. While the general outline of tea's history was covered in <a href="http://life.neophi.com/danielr/2008/01/a_history_of_the_world_in_6_gl.html">A History of the World in 6 Glasses</a>, this book more richly follows its path through China, Japan, and the rest of the world. An approachable and rewarding read for any tea lover.</p>]]>
        <![CDATA[<p><iframe src="http://rcm.amazon.com/e/cm?t=neo06-20&o=1&p=8&l=as1&asins=0500251460&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr&npa=1" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe><br />
</p>]]>
    </content>
</entry>
<entry>
    <title>China</title>
    <link rel="alternate" type="text/html" href="http://life.neophi.com/danielr/2009/06/china.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://life.neophi.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=1149" title="China" />
    <id>tag:life.neophi.com,2009:/danielr//1.1149</id>
    
    <published>2009-06-21T20:03:34Z</published>
    <updated>2009-06-21T20:15:19Z</updated>
    
    <summary>At the end of May I took a two week trip with my Mother to China. As I&apos;ve been trying to do with most of my recent trips, I took a few pictures. My initial reaction to the trip was...</summary>
    <author>
        <name>Daniel Rinehart</name>
        <uri>http://danielr.neophi.com/</uri>
    </author>
            <category term="Kitchen Sink" />
    
    <content type="html" xml:lang="en" xml:base="http://life.neophi.com/danielr/">
        <![CDATA[<p>At the end of May I took a two week trip with my Mother to China. As I've been trying to do with most of my recent trips, <a href="http://photos.neophi.com/v/DanielR/China/">I took a few pictures</a>. My initial reaction to the trip was that it was good. The cultural sites in China are amazing. What disturbed me though was the visible environmental impact of China's growth. In particular visiting the Turtle-Head Peninsula it was hard to make out the islands only a few hundred yards away due to the smog in the area. I never got a good view of Shanghai's sky-line and the only nice day we had around Beijing was due to 30 MPH winds blowing all day.</p>]]>
        <![CDATA[<p>The tour company we went with is state owned but privately controlled. I felt like most of the material presented to us was overly sanitized and scripted, as evidenced by two guides telling us the same material independently. Needless to say while I went with an open mind the reenforcement of "stereotypical western demonization" was hard to escape at times. I'm glad I visited and I suspect that I'd want to return for a much more rural an unstructured exploration.</p>]]>
    </content>
</entry>
<entry>
    <title>Be wary of micro-benchmarks baring speed improvements</title>
    <link rel="alternate" type="text/html" href="http://life.neophi.com/danielr/2009/05/be_wary_of_microbenchmarks_bar.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://life.neophi.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=1148" title="Be wary of micro-benchmarks baring speed improvements" />
    <id>tag:life.neophi.com,2009:/danielr//1.1148</id>
    
    <published>2009-05-13T03:15:15Z</published>
    <updated>2009-05-13T11:08:02Z</updated>
    
    <summary>I&apos;ve seen some links recently to the Round up of ActionScript 3.0 and Flex optimization techniques and practices and I&apos;m afraid. I&apos;m afraid that entries on that list are going to become gospel and code that doesn&apos;t use the tricks...</summary>
    <author>
        <name>Daniel Rinehart</name>
        <uri>http://danielr.neophi.com/</uri>
    </author>
            <category term="Flex" />
            <category term="Programming" />
    
    <content type="html" xml:lang="en" xml:base="http://life.neophi.com/danielr/">
        <![CDATA[<p>I've seen some links recently to the <a href="http://www.insideria.com/2009/04/51-actionscript-30-and-flex-op.html">Round up of ActionScript 3.0 and Flex optimization techniques and practices</a> and I'm afraid. I'm afraid that entries on that list are going to become gospel and code that doesn't use the tricks listed will be labeled bad. <a href="http://doi.acm.org/10.1145/356635.356640">Knuth said it best</a>, "We <em>should</em> forget about small efficiencies say about 97% of the time: premature optimization is the root of all evil." While the author frames the discussion correctly stating "You have to learn when to use some techniques and when to leave some out." I don't think he does enough to call out the type of optimization each entry is, or more importantly, how these techniques were derived.</p>]]>
        <![CDATA[<p>One of the key tenants of any performance reporting is carefully detailing the environment and method used to construct the test. I'll focus first on the environment. With any ActionScript 3.0 and in particular Flex optimization techniques there are factors beyond the code that impact the effectiveness of a possible performance tweak. Depending on your target audience (e.g. intranet, internet, etc.) some of these techniques may work against you (i.e. your tweak makes your code run slower in certain cases).</p>

<p>The first is the Flex compiler. The same code compiled with different versions of the compiler will produce different performing SWFs. The Flex SDK is continually improving the optimizations applied to the generated SWF. That means that in some cases a performance tweak you made for the Flex 3.0 SDK may end up fighting the compiler and producing slower code with 3.2. As such keep track of any performance tweaks you make and be sure to test them whenever you change the tools you use to produce your SWFs. #19 is a classic example of a code pattern that in many cases the compiler could optimize automatically.</p>

<p>If we assume that the compilation tools are consistent the next big factor that will affect your performance is the Flash player itself. Remember one of the big advances that Adobe did with Flash 9 was introduce a virtual machine into the player that has <a href="http://blog.vivisectingmedia.com/2007/11/flash-internals-jit-and-garbage-collection-part-four/">just it time (JIT) compilation support</a>. Each version of the Player makes tweaks to the JIT that can impact how your code runs. That might mean code which ran one way in a previous version of the player now behaves differently possibly even running slower. #13 and #15 on the list are examples of how the player may impact performance.</p>

<p>Of course the other half of runtime in the machine that the Flash player is running on. While Adobe does a fantastic job of providing a consistent cross platform runtime, they don't have any hard guarantees about the performance across platforms or hardware. Maybe memory management on one machine makes your code page fault more frequently which will slow it down. Maybe hyper threading or hardware acceleration of <a href="http://labs.adobe.com/wiki/index.php/Pixel_Bender_Toolkit">Pixel Bender</a> filters helps the code run faster. The wide variability in hardware and software that the Flash player can run on means that there are many performance optimizations that could easily backfire in certain situations if you are really trying to eek out every millisecond of performance.</p>

<p>The other area I'd like to touch on beyond the environment is the testing methodology. The article gives almost no information about how each of the performance techniques was measured. While references are listed at the bottom the hints and tips are not cited well enough to easily track down the source. To take #1 "Array instantiation" as an example: Did someone write a single function that created X arrays using each technique and measure the total time taken? Were they two methods in the same SWF or were they different SWFs? Did they vary the order that the methods were called? How many times did they run the loop? Did they examine what happened when garbage collection started happening? Did they create these Arrays within the scope of a method, a class, as a static? What compiler did they use? What Flash Player was it tested on? What were the specifications of the machine that the tests were run on? That's just a sampling of questions that come to mind when I see a sample optimization technique. The answer to anyone of them could impact how helpful it might be to your code or even if it does anything in real code versus some micro-benchmark.</p>

<p>With all of that said my intent is not to dissuade you from thinking about performance optimizations but instead focus the discussion not at the micro-benchmark level but at the algorithmic level. What I mean is that for a given problem, I don't care how you initialize your Arrays, the fact that you are using <a href="http://en.wikipedia.org/wiki/Bubble_sort">bubble sort</a> instead of <a href="http://en.wikipedia.org/wiki/Heapsort">heap sort</a> means that for any reasonable implementation and application usage it will <strong>always be slower</strong>. That is the 97% that Knuth is referring to. Real world performance problems are almost always going to be inefficient algorithms long before your Array initialization technique starts taking up the majority of your time.</p>

<p>Scanning the list of techniques, I consider these to be more algorithmic focused and worth thinking about first:</p>

<ul>
<li>26: given that the <a href="http://livedocs.adobe.com/flex/3/langref/mx/core/UIComponent.html#setStyle()">Flex documentation continues to say</a> this I'm inclined to agree with this one</li>
<li>27: more objects to layout, more objects to keep in memory, etc. make this a good thing to keep in mind</li>
<li>37: it's much better to not even need to think about needing to draw something, I'd add that includeInLayout is another important setting</li>
</ul>

<p>A couple other observations:</p>

<ul>
<li>2: I'd say any object that you don't need is expensive so don't create what you don't need</li>
<li>12: ideally you're using polymorphism so you don't even need to do branching but if not the axiom of <a href="http://www.cs.iastate.edu/~prabhu/Tutorial/CACHE/common_case.html">Keeping the Common Case Fast</a> applies here keeping in mind there is still a chance that the compiler or JIT can impact performance</li>
</ul>

<p>I'm know my observations about items from the original list could be debated. I still think it is a great list of things to try, but in general don't treat it as gospel. Overall I want to emphasize that minor tweaks will not impact performance as much as algorithmic inefficiencies. Keep that in mind next time you need to speed up some code.</p>]]>
    </content>
</entry>
<entry>
    <title>Rapt</title>
    <link rel="alternate" type="text/html" href="http://life.neophi.com/danielr/2009/05/rapt.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://life.neophi.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=1147" title="Rapt" />
    <id>tag:life.neophi.com,2009:/danielr//1.1147</id>
    
    <published>2009-05-12T02:46:49Z</published>
    <updated>2009-05-12T03:18:29Z</updated>
    
    <summary>Rapt: Attention and the Focused Life by Winifred Gallagher is an exploration of attention. It drifts between reasoned discussion about what is going on in your brain backed by various sciences to anecdotal evidence presented in self-help new age manner....</summary>
    <author>
        <name>Daniel Rinehart</name>
        <uri>http://danielr.neophi.com/</uri>
    </author>
            <category term="Books" />
    
    <content type="html" xml:lang="en" xml:base="http://life.neophi.com/danielr/">
        <![CDATA[<p>Rapt: Attention and the Focused Life by Winifred Gallagher is an exploration of attention. It drifts between reasoned discussion about what is going on in your brain backed by various sciences to anecdotal evidence presented in self-help new age manner. Thankfully the book sticks more to the former than the latter. Overall the text is very approachable and offers insight into how we experience the world.</p>]]>
        <![CDATA[<ul>
<li>Your life consists of what you focus on [4]</li>
<li>The idle mind is the devil's workshop [13]</li>
<li>Change blindness [19]</li>
<li>Rashomon [22]</li>
<li>Magic is what happens when you are paying attention to something else [23]</li>
<li>To enjoy the kind of experience you want [...] take charge of your attention [28]</li>
<li>Negativity bias theory [32]</li>
<li>Positivity offset [35]</li>
<li>Weapons effect [36]</li>
<li>reactive, behavioral, and reflective brain parts [37-38]</li>
<li>W. H. Auden "Choice of attention - to pay attention to this and ignore that - is to the inner life what choice of action is to the outer. In both cases, a man is responsible for his choices and must accept the consequences, whatever they may be" [43]</li>
<li>William James "the art of knowing what to overlook" [50]</li>
<li>Multidimensional Personality Questionnaire (MPQ) [58]</li>
<li>Pearls Before Breakfast [67]</li>
<li>Mindfulness meditation [69]</li>
<li>Concentration on lower or upper status and its effect on you [85]</li>
<li>Noon on Sunday, most unhappy hour [109]</li>
<li>Thinking about your life versus your life experiences [118]</li>
<li>Attentional myopia [123]</li>
<li>The Paradox of Choice [127]</li>
<li>Energy flows where attention goes [161]</li>
<li>Work 90 minutes on a task then switch [172]</li>
<li>Plan how you'll act in advance [183]</li>
<li>The truth is what works [191]</li>
<li>Wisdom, courage, temperance, justice, humanity (love), and transcendence [210]</li>
<li>Make yourself necessary to someone [212]</li>
</ul>

<p><iframe src="http://rcm.amazon.com/e/cm?t=neo06-20&o=1&p=8&l=as1&asins=1594202109&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr&npa=1" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe><br />
</p>]]>
    </content>
</entry>
<entry>
    <title>The Book of Merlyn</title>
    <link rel="alternate" type="text/html" href="http://life.neophi.com/danielr/2009/04/the_book_of_merlyn.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://life.neophi.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=1146" title="The Book of Merlyn" />
    <id>tag:life.neophi.com,2009:/danielr//1.1146</id>
    
    <published>2009-04-20T23:48:02Z</published>
    <updated>2009-04-21T00:27:16Z</updated>
    
    <summary>A couple of people I know convinced me that I should join Goodreads, so I did. I haven&apos;t decided how I&apos;m going to handle capturing book information here versus there. I suspect that I&apos;ll continue to write my more verbose...</summary>
    <author>
        <name>Daniel Rinehart</name>
        <uri>http://danielr.neophi.com/</uri>
    </author>
            <category term="Books" />
    
    <content type="html" xml:lang="en" xml:base="http://life.neophi.com/danielr/">
        <![CDATA[<p>A couple of people I know convinced me that I should join Goodreads, <a href="http://www.goodreads.com/danielr">so I did</a>. I haven't decided how I'm going to handle capturing book information here versus there. I suspect that I'll continue to write my more verbose reviews and notes here and just have the summary review (i.e. star rating) on Goodreads.</p>]]>
        <![CDATA[<p>Having recently read <a href="http://life.neophi.com/danielr/2009/01/the_once_and_future_king.html">The Once and Future King</a>, it seemed good to finish the series by reading T.H. White's The Book of Merlyn. I'm on the fence about posthumous works. I know that I take pride in the work that I release and half finished or working but rough ideas I have laying around I'm not sure I'd want released. Putting that aside, I didn't enjoy this book as much as the others. I think that is mostly due to wanting to treat it more as a continuation of the adventure instead of the philosophical bent it has.</p>

<p>The experiences Arthur has as animals fit better in this book but the tone is very different and doesn't make then as enjoyable as the spirit of childhood play and learning that the other book uses. Again I'm probably biased due to the untold viewings I had of the Disney movie. Many of the philosophical observations he makes in the book are good but not being in the proper mindset they were lost on me.</p>

<p><iframe src="http://rcm.amazon.com/e/cm?t=neo06-20&o=1&p=8&l=as1&asins=029270769X&fc1=000000&IS2=1&lt1=_top&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr&npa=1" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe></p>]]>
    </content>
</entry>
<entry>
    <title>Last Class &amp; Last Course</title>
    <link rel="alternate" type="text/html" href="http://life.neophi.com/danielr/2009/04/last_class_last_course.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://life.neophi.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=1145" title="Last Class &amp; Last Course" />
    <id>tag:life.neophi.com,2009:/danielr//1.1145</id>
    
    <published>2009-04-16T02:43:53Z</published>
    <updated>2009-04-16T03:34:51Z</updated>
    
    <summary>After many a late night and busy weekend I&apos;m elated to have finished tonight the last class in the last course of my Master of Science in Computer Science from Northeastern. I&apos;ll be graduating the 1st of May! It hasn&apos;t...</summary>
    <author>
        <name>Daniel Rinehart</name>
        <uri>http://danielr.neophi.com/</uri>
    </author>
            <category term="Kitchen Sink" />
    
    <content type="html" xml:lang="en" xml:base="http://life.neophi.com/danielr/">
        <![CDATA[<p>After many a late night and busy weekend I'm elated to have finished tonight the last class in the last course of my <a href="http://www.ccs.neu.edu/graduate/mscompsci.html">Master of Science in Computer Science</a> from <a href="http://www.neu.edu/">Northeastern</a>. I'll be graduating the 1st of May! It hasn't completely sunk in yet that I'm done. I started this journey 4 years ago in the cold winter of January of 2005 while I was at Towers Perrin and they had a sweet reimbursement deal. I had originally planned to complete the end of last year but ended taking a semester off when I learned I was being laid off from Ruckus and didn't want to be looking for a new job in the middle of my next course.</p>]]>
        <![CDATA[<p>In looking back I feel I was a better student as an undergraduate. I've lost track of the number of times I thought I wasn't going to make it through or just couldn't pull myself to get the work done on time. I don't remember those thoughts being as frequent as an undergraduate. Then again, at that time being a student was my full time job. Since I've been working full-time while pursuing my degree, and always put that first, I know I should have done better in a couple of my courses. On the flip side, it feels like I learned a lot more in my graduate work. That probably is mostly due to the fact that the majority of my courses were filling in gaps or delving deeper into topics that I studied as an undergraduate.</p>

<p>Now to figure out what to do with my new-found free time :) I should be able to get back to working on some projects I've <a href="http://life.neophi.com/danielr/2009/02/this_not_that.html">put to the back burner</a> while I helped build out <a href="http://www.reuters.com/article/pressRelease/idUS157447+24-Feb-2009+BW20090224">Allurent's latest offering</a> and finished this last course.</p>]]>
    </content>
</entry>
<entry>
    <title>HP SWF Decompiling and Security Analysis Tool</title>
    <link rel="alternate" type="text/html" href="http://life.neophi.com/danielr/2009/03/hp_swf_decompiling_and_securit.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://life.neophi.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=1142" title="HP SWF Decompiling and Security Analysis Tool" />
    <id>tag:life.neophi.com,2009:/danielr//1.1142</id>
    
    <published>2009-03-24T19:39:59Z</published>
    <updated>2009-03-24T19:43:11Z</updated>
    
    <summary>HP has released a tool called SWF Scan for decompiling and looking at SWFs for security issues. Available from http://www.hp.com/go/swfscan....</summary>
    <author>
        <name>Daniel Rinehart</name>
        <uri>http://danielr.neophi.com/</uri>
    </author>
            <category term="Flex" />
            <category term="Helpful" />
            <category term="Links" />
            <category term="Programming" />
    
    <content type="html" xml:lang="en" xml:base="http://life.neophi.com/danielr/">
        <![CDATA[<p>HP has released a tool called SWF Scan for decompiling and looking at SWFs for security issues. Available from <a href="http://www.hp.com/go/swfscan">http://www.hp.com/go/swfscan</a>.</p>]]>
        
    </content>
</entry>
<entry>
    <title>SimpleDateFormat is not thread safe</title>
    <link rel="alternate" type="text/html" href="http://life.neophi.com/danielr/2009/03/simpledateformat_is_not_thread.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://life.neophi.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=1141" title="SimpleDateFormat is not thread safe" />
    <id>tag:life.neophi.com,2009:/danielr//1.1141</id>
    
    <published>2009-03-16T20:30:34Z</published>
    <updated>2009-03-25T14:47:44Z</updated>
    
    <summary>It has always felt counter intuitive that there are classes which are not thread safe in the Sun JDK, but that is the case. One that I frequently see people trip up on is SimpleDateFormat. From the documentation: Date formats...</summary>
    <author>
        <name>Daniel Rinehart</name>
        <uri>http://danielr.neophi.com/</uri>
    </author>
            <category term="Programming" />
    
    <content type="html" xml:lang="en" xml:base="http://life.neophi.com/danielr/">
        <![CDATA[<p>It has always felt counter intuitive that there are classes which are not thread safe in the Sun JDK, but that is the case. One that I frequently see people trip up on is <a href="http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html">SimpleDateFormat</a>. From the documentation:</p>

<blockquote>
Date formats are not synchronized. It is recommended to create separate format instances for each thread. If multiple threads access a format concurrently, it must be synchronized externally.</blockquote>]]>
        <![CDATA[<p><strong>UPDATE</strong><blockquote>While SimpleDateFormat is not thread safe, as pointed out in the comments below, Spring seems to create new binders per request removing the need for this approach. In reviewing the documentation it isn't immediately clear that this is the case.</blockquote></p>

<p>I recently had to create a custom editor for a Spring Web MVC command and ran into this issue. One possible fix, without introducing a <a href="http://java.sun.com/javase/6/docs/api/java/lang/ThreadLocal.html">ThreadLocal</a>, is to just create a SimpleDateFormat every time. Hence this simple ThreadSafeSimpleDateFormat wrapper.</p><pre class="code"><span class="category1">import</span> java.text.DateFormat;
<span class="category1">import</span> java.text.FieldPosition;
<span class="category1">import</span> java.text.ParsePosition;
<span class="category1">import</span> java.text.SimpleDateFormat;
<span class="category1">import</span> java.util.Date;

<span class="category1">public</span> <span class="category1">class</span> ThreadSafeSimpleDateFormat <span class="category1">extends</span> <span class="category2">DateFormat</span> {
    <span class="category1">private</span> <span class="category2">String</span> pattern;
    
    <span class="category1">public</span> ThreadSafeSimpleDateFormat(<span class="category2">String</span> pattern) {
        this.pattern = pattern;
    }
    
    @Override
    <span class="category1">public</span> <span class="category2">StringBuffer</span> format(<span class="category2">Date</span> date, <span class="category2">StringBuffer</span> toAppendTo, <span class="category2">FieldPosition</span> fieldPosition) {
        <span class="category1">return</span> <span class="category1">new</span> <span class="category2">SimpleDateFormat</span>(pattern).format(date, toAppendTo, fieldPosition);
    }
    
    @Override
    <span class="category1">public</span> <span class="category2">Date</span> parse(<span class="category2">String</span> source, <span class="category2">ParsePosition</span> pos) {
        <span class="category1">return</span> <span class="category1">new</span> <span class="category2">SimpleDateFormat</span>(pattern).parse(source, pos);
    }
}</pre><p></p>

<p>Then to setup that as the editor handler for a command that has a date field, in my controller that uses the command I added the following:</p><pre class="code">@Override
<span class="category1">protected</span> <span class="category1">void</span> initBinder(HttpServletRequest request, ServletRequestDataBinder binder) <span class="category1">throws</span> <span class="category2">Exception</span> {
    super.initBinder(request, binder);
    binder.registerCustomEditor(Date.class, DATE_TIME, <span class="category1">new</span> CustomDateEditor(<span class="category1">new</span> ThreadSafeSimpleDateFormat(DATE_TIME_FORMAT), <span class="category1">false</span>));
}</pre><p><br />
</p>]]>
    </content>
</entry>
<entry>
    <title>Velocity and Spring Web MVC</title>
    <link rel="alternate" type="text/html" href="http://life.neophi.com/danielr/2009/03/velocity_and_spring_web_mvc.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://life.neophi.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=1140" title="Velocity and Spring Web MVC" />
    <id>tag:life.neophi.com,2009:/danielr//1.1140</id>
    
    <published>2009-03-16T19:00:07Z</published>
    <updated>2009-03-16T20:05:46Z</updated>
    
    <summary>The combination of Spring Web MVC with Velocity makes for easy view handling. One of the things that I&apos;m confused about though is getting the configuration up an running. I&apos;ve been very happy with this configuration so I thought I&apos;d...</summary>
    <author>
        <name>Daniel Rinehart</name>
        <uri>http://danielr.neophi.com/</uri>
    </author>
            <category term="Programming" />
    
    <content type="html" xml:lang="en" xml:base="http://life.neophi.com/danielr/">
        <![CDATA[<p>The combination of Spring Web MVC with Velocity makes for easy view handling. One of the things that I'm confused about though is getting the configuration up an running. I've been very happy with this configuration so I thought I'd share it.<br />
</p>]]>
        <![CDATA[<p>First part is to let the system know where to find Velocity templates. I store them all in a directory called velocity which is part of the web application.</p><pre class="code">
&lt;bean id=&quot;velocityConfig&quot; class=&quot;org.springframework.web.servlet.view.velocity.VelocityConfigurer&quot;&gt;
    &lt;property name=&quot;resourceLoaderPath&quot;&gt;
        &lt;value&gt;/WEB-INF/velocity/&lt;/value&gt;
    &lt;/property&gt;
&lt;/bean&gt;
</pre><p></p>

<p>Next up is letting Spring know that Velocity is the default View that will be used. This configures a few handy defaults that represent the common case response. That being is will be an XML response, the template name has no prefix and a .vm suffix, and we configure some custom tools to be available in the macros. </p><pre class="code">
&lt;bean id=&quot;viewResolver&quot; class=&quot;org.springframework.web.servlet.view.velocity.VelocityViewResolver&quot;&gt;
    &lt;property name=&quot;exposeSpringMacroHelpers&quot;&gt;
        &lt;value&gt;true&lt;/value&gt;
    &lt;/property&gt;
    &lt;property name=&quot;contentType&quot;&gt;
        &lt;value&gt;text/xml&lt;/value&gt;
    &lt;/property&gt;
    &lt;property name=&quot;prefix&quot;&gt;
        &lt;value&gt;&lt;/value&gt;
    &lt;/property&gt;
    &lt;property name=&quot;suffix&quot;&gt;
        &lt;value&gt;.vm&lt;/value&gt;
    &lt;/property&gt;
    &lt;property name=&quot;toolboxConfigLocation&quot;&gt;
        &lt;value&gt;/WEB-INF/toolbox.xml&lt;/value&gt;
    &lt;/property&gt;
&lt;/bean&gt;
</pre><p></p>

<p>The toolbox configuration file defines some handy tools and in particular defaults the format that dates should be in when converted to a String. In this case the format is what ActionScript 3 expects, since this is the back end for a Flex project.</p><pre class="code">
&lt;toolbox&gt;
    &lt;tool&gt;
        &lt;key&gt;esc&lt;/key&gt;
        &lt;scope&gt;application&lt;/scope&gt;
        &lt;class&gt;com.neophi.util.NullEscapeTool&lt;/class&gt;
    &lt;/tool&gt;
    &lt;tool&gt;
        &lt;key&gt;exceptionTool&lt;/key&gt;
        &lt;scope&gt;application&lt;/scope&gt;
        &lt;class&gt;com.neophi.util.ExceptionTool&lt;/class&gt;
    &lt;/tool&gt;
    &lt;tool&gt;
        &lt;key&gt;dateTool&lt;/key&gt;
        &lt;scope&gt;application&lt;/scope&gt;
        &lt;class&gt;org.apache.velocity.tools.generic.DateTool&lt;/class&gt;
        &lt;parameter name=&quot;format&quot; value=&quot;EEE MMM dd HH:mm:ss &#39;UTC&#39;Z yyyy&quot;/&gt;
    &lt;/tool&gt;
&lt;/toolbox&gt;
</pre><p></p>

<p>I've always felt like I'm missing some obvious configuration setting with Velocity that will make null values just show up as empty strings instead of being left as $model.attribute. Since I've not found that setting yet, the NullEscapeTool wraps the standard Velocity EscapeTool and sends back an empty string if the value was null.</p><pre class="code">@Override
<span class="category1">public</span> <span class="category2">String</span> xml(<span class="category2">Object</span> string) {
    <span class="category2">String</span> result = super.xml(string);
    <span class="category1">if</span> (result == <span class="category1">null</span>) {
        <span class="category1">return</span> <span class="quote">""</span>;
    }
    <span class="category1">return</span> result;
}</pre><p></p>

<p>The ExceptionTool exposes one method stackTrace() that converts the stack trace associated with an exception to a string so that it can be included in the view. Not necessarily something you want to expose in a production environment, but very handy when debugging.</p><pre class="code"><span class="category1">public</span> <span class="category2">String</span> stackTrace(<span class="category2">Exception</span> exception) {
    <span class="category2">ByteArrayOutputStream</span> byteArrayOutputStream = <span class="category1">new</span> <span class="category2">ByteArrayOutputStream</span>();
    <span class="category2">PrintStream</span> printStream = <span class="category1">new</span> <span class="category2">PrintStream</span>(byteArrayOutputStream);
    exception.printStackTrace(printStream);
    printStream.close();
    <span class="linecomment">// Closing a ByteArrayOutputStream has no effect, so don't do it which avoids the need to try/catch the IOException</span>
    <span class="category1">return</span> byteArrayOutputStream.toString();
}</pre><p></p>

<p>Lastly if you want to have Velocity also handle certain exceptions that your web application may throw the exception resolver facility is great for handling that. In this case the exception value that ServerException refers to is a Velocity template that incorporates the ExceptionTool mentioned above.</p><pre class="code">
&lt;bean id=&quot;exceptionResolver&quot; class=&quot;org.springframework.web.servlet.handler.SimpleMappingExceptionResolver&quot;&gt;
    &lt;property name=&quot;warnLogCategory&quot;&gt;
        &lt;value&gt;com.neophi.exception&lt;/value&gt;
    &lt;/property&gt;
    &lt;property name=&quot;defaultStatusCode&quot;&gt;
        &lt;value&gt;200&lt;/value&gt;
    &lt;/property&gt;
    &lt;property name=&quot;exceptionMappings&quot;&gt;
        &lt;props&gt;
            &lt;prop key=&quot;com.neophi.exception.ServerException&quot;&gt;exception&lt;/prop&gt;
        &lt;/props&gt;
    &lt;/property&gt;
&lt;/bean&gt;
</pre><p><br />
</p>]]>
    </content>
</entry>
<entry>
    <title>JUnit, Jetty, HtmlUnit, and Automated Testing</title>
    <link rel="alternate" type="text/html" href="http://life.neophi.com/danielr/2009/03/junit_jetty_htmlunit_and_autom.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://life.neophi.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=1139" title="JUnit, Jetty, HtmlUnit, and Automated Testing" />
    <id>tag:life.neophi.com,2009:/danielr//1.1139</id>
    
    <published>2009-03-16T18:06:32Z</published>
    <updated>2009-03-16T20:08:55Z</updated>
    
    <summary>I&apos;m a firm believer in automated testing. The more testing you can automate the less work you need to do to be sure you didn&apos;t break stuff each time you make a change. While most people think of unit testing...</summary>
    <author>
        <name>Daniel Rinehart</name>
        <uri>http://danielr.neophi.com/</uri>
    </author>
            <category term="Programming" />
    
    <content type="html" xml:lang="en" xml:base="http://life.neophi.com/danielr/">
        <![CDATA[<p>I'm a firm believer in automated testing. The more testing you can automate the less work you need to do to be sure you didn't break stuff each time you make a change. While most people think of unit testing when talking about automated testing, the higher up the interaction chain you can go while not making your tests brittle the better off you will be. On my current project unit test coverage is great, but given that ultimately all of the services get exposed as a web application, being able to automate testing at that level would be beneficial. Below is the approach I took to automate testing our web application.</p>]]>
        <![CDATA[<p>The key ingredients to the approach are <a href="http://www.junit.org/">JUnit</a> (testing framework), <a href="http://htmlunit.sourceforge.net/">HtmlUnit</a> (web request handler), and <a href="http://www.mortbay.org/">Jetty</a> (integrated application server). Each automated test is written as a JUnit test with a call to a centralized function to startup the web application. To fully isolate each test method you could switch this to an @Before annotation. I've found though that the automated tests are most accurately defined as integration tests. Having a single instance running for all tests simulates the ultimate environment better so I only ever startup one server. Each test method is responsible for setting up the environment (.i.e. test data) to match what it needs so that the order of test methods never matters.</p><pre class="code"><span class="category1">public</span> <span class="category1">class</span> SampleTest {
    @BeforeClass
    <span class="category1">public</span> <span class="category1">static</span> <span class="category1">void</span> startServer() <span class="category1">throws</span> <span class="category2">Exception</span> {
        ObjectMother.startServer();
    }
}</pre><p></p>

<p>The startServer() call in ObjectMother is responsible for starting the server if not already running. I startup the server on a random port to test that the configuration isn't port specific. The base URL for the web application is exposed so that tests making requests know what URL to start the call at. One issue I ran into is that you might need to play with the physical directory passed to WebAppContext as running from Eclipse versus Ant might have you starting in different working directories. To get around this issue there is a a little directory helper that searches for the target directory based on current, parent, and a couple other locations it could be found out. </p><pre class="code"><span class="category1">import</span> org.mortbay.jetty.Server;
<span class="category1">import</span> org.mortbay.jetty.webapp.WebAppContext;
<span class="category1">public</span> <span class="category1">class</span> ObjectMother {
    <span class="category1">public</span> <span class="category1">static</span> <span class="category2">String</span> baseUrl;
    <span class="category1">private</span> <span class="category1">static</span> Server server;
    
    <span class="category1">public</span> <span class="category1">static</span> <span class="category1">void</span> startServer() <span class="category1">throws</span> <span class="category2">Exception</span> {
        <span class="category1">if</span> (server == <span class="category1">null</span>) {
            server = <span class="category1">new</span> Server(0);
            server.addHandler(<span class="category1">new</span> WebAppContext(<span class="quote">"build/testapp"</span>, <span class="quote">"/sample-server"</span>));
            server.start();
            
            <span class="category1">int</span> actualPort = server.getConnectors()[0].getLocalPort();
            baseUrl = <span class="quote">"http://localhost:"</span> + actualPort + <span class="quote">"/sample-server"</span>;
        }
    }
}</pre><p></p>

<p>The creation of the "build/testapp" referenced above is done by Ant. When running within Eclipse an external tool builder is called to stage the web application like it would if it were to package it as a war. In particular the staging done for unit testing adjusts any deployment parameters so that they tuned for the test environment.</p>

<p>Now that the server is running requests can be made against it. This is where HtmlUnit gets used. A typical test looks something like this:</p><pre class="code">@Test
<span class="category1">public</span> <span class="category1">void</span> testBasic() <span class="category1">throws</span> FailingHttpStatusCodeException, <span class="category2">IOException</span>
{
    <span class="category2">List</span>&lt;NameValuePair&gt; parameters = <span class="category1">new</span> ArrayList&lt;NameValuePair&gt;();
    parameters.add(<span class="category1">new</span> NameValuePair(SampleCommand.CUSTOMER, ObjectMother.CUSTOMER));
    parameters.add(<span class="category1">new</span> NameValuePair(SampleCommand.URI, ObjectMother.URI));
    WebRequestSettings webRequestSettings = <span class="category1">new</span> WebRequestSettings(<span class="category1">new</span> <span class="category2">URL</span>(ObjectMother.baseUrl + <span class="quote">"/sample/"</span>));
    webRequestSettings.setRequestParameters(parameters);
    WebClient webClient = <span class="category1">new</span> WebClient();
    webClient.setThrowExceptionOnFailingStatusCode(<span class="category1">false</span>);
    Page page = webClient.getPage(webRequestSettings);
    
    assertEquals(HttpServletResponse.SC_OK, page.getWebResponse().getStatusCode());
    <span class="linecomment">// additional request specific assertions</span>
}</pre><p></p>

<p>Frequently the response is XML based, so for these the XmlPage wrapper is used instead.</p><pre class="code">assertEquals(ServerUtil.XML_CONTENT_TYPE, page.getWebResponse().getContentType());

XmlPage xmlPage = (XmlPage) page;
NodeList nodeList = xmlPage.getXmlDocument().getElementsByTagName(ObjectMother.FAILURE_ELEMENT_NAME);
assertTrue(nodeList.getLength() &gt; 0);</pre><p></p>

<p>Since Jetty is starting up within the JVM, instead of as a separate process, using Eclipse's debug as JUnit test just works. The web application startup catches Spring configuration errors quickly and ensures that all paths are what they should be.</p>]]>
    </content>
</entry>
<entry>
    <title>Building Muscular Graphical Editors in Flex (BFUG March 2009)</title>
    <link rel="alternate" type="text/html" href="http://life.neophi.com/danielr/2009/03/building_muscular_graphical_ed.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://life.neophi.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=1137" title="Building Muscular Graphical Editors in Flex (BFUG March 2009)" />
    <id>tag:life.neophi.com,2009:/danielr//1.1137</id>
    
    <published>2009-03-11T15:24:00Z</published>
    <updated>2009-03-11T15:27:39Z</updated>
    
    <summary>Joe Berkovitz is speaking about Building Muscular Graphical Editors in Flex. Focus on how people build and edit visual documents. Amazed at the problems that come up building visual editors like that....</summary>
    <author>
        <name>Daniel Rinehart</name>
        <uri>http://danielr.neophi.com/</uri>
    </author>
            <category term="Flex" />
            <category term="Programming" />
    
    <content type="html" xml:lang="en" xml:base="http://life.neophi.com/danielr/">
        <![CDATA[<p><a href="http://www.joeberkovitz.com/">Joe Berkovitz</a> is speaking about Building Muscular Graphical Editors in Flex.</p>

<p>Focus on how people build and edit visual documents. Amazed at the problems that come up building visual editors like that.<br />
</p>]]>
        <![CDATA[<p><br />
Ran into lots of issues while building <a href="http://www.noteflight.com">Noteflight</a>. Ended up creating <a href="http://code.google.com/p/moccasin/">Moccasin framework</a> for working with visual editors. Moccasin is also being used in <a href="http://www.infrared5.com/">InfraRed5's</a> new RedLine site editing tool.</p>

<p>He gave a quick demo of Noteflight. Tool for creating and sharing musical scores with a little social interaction thrown in. Selection has different modes: individual object, group of objects (sequence or collection), and a passage. Undo and redo are built in to almost everything.</p>

<p>Uses MVC with a few tweaks. Views emit events that are fed to Mediators which perform actions on a Controller which edits the Model. Models are abstract and non visual. Layouts are visual grouping of model but not drawn.</p>

<pre>
Undo History <- Document <- Layout Context <- View Context
           ^       ^            ^                ^
            \-> Model    <- Layouts        <- Views
</pre>

<p>Model, Layouts, and Views are collection of objects that are cooperating, but all belong to a single object, the context or document they are operation in.</p>

<p>Sometimes when you need to print you need to make visual tweaks so that it looks better, in this case just have a separate view context.</p>

<p>Don't like using events for what should be a function call.</p>

<p>Standard undo/redo wisdom is to use a command pattern. ICommand, execute(), undo(), and redo(). Commands are stateful, need to create them.</p>

<p>Instead constrain the model to only allow, property change, child add, or child remove. Bindable properties will dispatch events for you. For collections and change events you need to bubble them up in your model. Then you only need to listen to the root.</p>

<p>UndoHistory needs to open group/close group. Makes many micro modifications that are recorded. Undo or redo called on undo history controller.</p>

<p>How do you track dirty versus clean? Bookkeeping in undo history.</p>

<p>He gave a demo of InfraRed5's RedLine site builder which is also using Moccasin.</p>

<p>Moccasin is on Google Code. MVCS framework, XML based model, "smart wrappers", object selection management, group based undo/redo, mouse gesture/object handle support, scalable document views.</p>

<p>Moccasin wraps a model object to handle events. Moccasin includes simple world which is an application to show how the framework is used. Uses a feedback layer sitting in front of objects. Ran through an example of changing the Square object to have a width and height instead of just a size.</p>

<p>View registers mediators that it wants to use.</p>

<p>How to persist state of views? Have separate model that hte views manage.</p>

<p>Likes domain specific frameworks instead of monolithic frameworks.</p>

<p>Moccasin more focused on UI design and layout versus client/server work that Cairngorm uses.</p>]]>
    </content>
</entry>
<entry>
    <title>Ender Series</title>
    <link rel="alternate" type="text/html" href="http://life.neophi.com/danielr/2009/03/ender_series.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://life.neophi.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=1136" title="Ender Series" />
    <id>tag:life.neophi.com,2009:/danielr//1.1136</id>
    
    <published>2009-03-07T03:10:40Z</published>
    <updated>2009-03-07T03:12:16Z</updated>
    
    <summary>Last night I finished my obsessive tear through Orson Scott Card&apos;s Ender Series. I had read Ender&apos;s Game a number of years ago and throughly enjoyed it. Towards the end of January the lunchtime conversation at work turned to the...</summary>
    <author>
        <name>Daniel Rinehart</name>
        <uri>http://danielr.neophi.com/</uri>
    </author>
            <category term="Books" />
    
    <content type="html" xml:lang="en" xml:base="http://life.neophi.com/danielr/">
        <![CDATA[<p>Last night I finished my obsessive tear through Orson Scott Card's <a href="http://en.wikipedia.org/wiki/Ender_series">Ender Series</a>. I had read Ender's Game a number of years ago and throughly enjoyed it. Towards the end of January the lunchtime conversation at work turned to the most recent book in the series and that it was a good read. Since I wasn't really into my other reading options at the time, I thought I'd start reading the series. Rereading Ender's Game, which is one of only about half a dozen books I've ever reread, I became enamored with the characters and the idea of reading the rest of the series. If you haven't read the series I've probably let drop some spoilers below so be warned.</p>]]>
        <![CDATA[<p>The writing isn't highbrow by any means, which the author freely admits to, making the books quick reading. The themes introduced in Speaker for the Dead didn't feel as science fiction themed as Ender's Game but do explore humans interacting with an alien race perceived to be less technologically advanced. The action continues with Xenocide and Children of the Mind regaining some of the science fiction themes with the introduction of instantaneous travel, items created through thought, and adaptable viruses. The religious mumbo jumbo he starts to throw in with the Path world and the various people visited by Peter started to get annoying, but overall the first four books of the series are great reading.</p>

<p>Ender's Shadow starts a four book series focused around Bean, who was first introduced in Ender's Game. I find Bean as interesting a character as Ender but with this book the story line turns more towards Earth and starts a downward trend into focusing on religious and political themes. This trend continues in Shadow of the Hegemon and becomes overly religious in Shadow Puppets only to be equaled by an overly political Shadow of the Giant. Needless to say I only enjoyed the first of the Bean quartet.</p>

<p>First Meetings and particularly A War of Gifts: An Ender Story felt like the author needed a quick dollar or two. They are both short and while First Meetings does fill in the background of how major characters met, A War of Gifts is a complete throw away and could stand not to have been written. <a href="http://en.wikipedia.org/wiki/Star_Wars_Christmas_Special">Star Wars Holiday Special</a> anyone?</p>

<p>The latest book, Ender in Exile, gets back into a more science fiction themed world with new creatures and telepathy while helping fill out  various story lines introduced in earlier books. However, as with the entire series there are plenty of ideas mentioned that could themselves become books if they were ever explored. In general though Ender in Exile is a welcome return to the style of the first five books versus the other books in the shadow series.</p>

<p>Now that I'm caught up with the series I'm find myself brooding over what was brought to my attention while reading the series. I strongly disagree with Orson Scott Card's <a href="http://en.wikipedia.org/wiki/Orson_Scott_Card#Personal_views">personal views</a> on many issues. In retrospect, matching the timeline of when the some of his books were written to his political writings I find myself thinking that those shadow books I disliked so much seemed to be espousing his world views about marriage, religions, and politics.</p>

<p>My dilemma is this: Do I not read any of his future works because his view of the world doesn't agree with mine? How much of a hypocrite am I for having finished reading the series even though partway through it I became away of his injudicious personal views?</p>]]>
    </content>
</entry>
<entry>
    <title>Principle versus Taste</title>
    <link rel="alternate" type="text/html" href="http://life.neophi.com/danielr/2009/03/principle_versus_taste.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://life.neophi.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=1135" title="Principle versus Taste" />
    <id>tag:life.neophi.com,2009:/danielr//1.1135</id>
    
    <published>2009-03-07T02:01:46Z</published>
    <updated>2009-03-07T02:04:29Z</updated>
    
    <summary>Today for lunch we went to Legal Sea Foods in Kendall to wish a co-worker farewell as it was her last day. I ordered a gimlet and after asking what gins they had, asked for it with Bombay Sapphire. When...</summary>
    <author>
        <name>Daniel Rinehart</name>
        <uri>http://danielr.neophi.com/</uri>
    </author>
            <category term="Rant and Rave" />
    
    <content type="html" xml:lang="en" xml:base="http://life.neophi.com/danielr/">
        <![CDATA[<p>Today for lunch we went to <a href="http://www.legalseafoods.com/">Legal Sea Foods</a> in Kendall to wish a co-worker farewell as it was her last day. I ordered a <a href="http://en.wikipedia.org/wiki/Gimlet_(cocktail)">gimlet</a> and after asking what gins they had, asked for it with <a href="http://www.bombaysapphire.com/">Bombay Sapphire</a>. When my drink came it was very limey which was what I wanted. After a couple of sips, the waiter asked me about the drink to which I replied it was okay. He then informed me that he substituted <a href="http://www.tanqueray.com/">Tanqueray</a> for the gin (that being the cocktail menu stated drink) since it blended with their lime cordial better. </p>]]>
        <![CDATA[<p>My anger flared and I hurled back at him some snarky comment concerning that being the reason why I didn't taste as much <a href="http://en.wikipedia.org/wiki/Juniper_berries">juniper</a> as I was expecting. He offered to replace it, to which I continued my rant and replied that since that was what I had ordered I'd like that. Here enters the principle of the matter. I would rather have had him recommend that I try the drink with Tanqueray when I ordered it, instead of specifically ignoring my request.</p>

<p>Now <a href="http://life.neophi.com/danielr/2006/06/gin.html">I've demonstrated</a> that I'm not a super taster when it comes to gin. In fact I swapped Bombay Sapphire with Tanqueray when I did that blind tasting. This of course means that when my drink was replaced he could have just switched what he originally served me to another glass and I would have been none the wiser. I suspect he's either laughing his ass having done just that and remarking how rude and ignorant I was. Hence on the matter of taste, what gin the drink was served with really didn't matter.</p>

<p>With all of that said, I'm still fuming and my mind is still obsessing over the issue. I'm pissed off at myself for letting my anger flair so easily. I'm pissed off at the waiter for switching my order around. I'm pissed off at the fact that I'm still thinking about it even when I know I couldn't tell the difference. Turns out <a href="http://www.youtube.com/watch?v=a9J1b3MqiX8">nor can most people</a>. So there you have have it, a possibly nice lunch and the rest of my day distracted over something that really shouldn't have mattered. Grrrrr.</p>]]>
    </content>
</entry>

</feed> 

