<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2576631677249373783</id><updated>2012-01-23T18:55:41.903-08:00</updated><title type='text'>Open Source Tips</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://opensourcetips.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default?start-index=101&amp;max-results=100'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>238</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-616583733184025225</id><published>2012-01-23T18:50:00.000-08:00</published><updated>2012-01-23T18:55:41.913-08:00</updated><title type='text'>Superb Spring Info</title><content type='html'>Superb Spring blog
&lt;a href="http://www.baeldung.com/"&gt;http://www.baeldung.com/&lt;/a&gt;
&lt;br/&gt;&lt;br/&gt;
&lt;a href="http://www.theserverside.com/news/thread.tss?thread_id=63463"&gt;Simplifying the Data Access Layer&lt;/a&gt;
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-616583733184025225?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/616583733184025225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/616583733184025225'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2012/01/superb-spring-blog.html' title='Superb Spring Info'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-6306403525893086242</id><published>2012-01-01T13:52:00.000-08:00</published><updated>2012-01-01T13:52:01.295-08:00</updated><title type='text'>Movie Theater Engagement Database</title><content type='html'>This is a similar database to that one created yesterday but may clarify some of the design decisions.  By naming the JOIN table 'Engagement', I think its purpose is clearer than the JOIN table in the Recipes database, 'RecipeIngredient'.

&lt;script src="https://gist.github.com/1548422.js?file=MovieEngagement.sql"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-6306403525893086242?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6306403525893086242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6306403525893086242'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2012/01/movie-theater-engagement-database.html' title='Movie Theater Engagement Database'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-4928743457641485162</id><published>2011-12-31T22:44:00.000-08:00</published><updated>2011-12-31T22:44:25.520-08:00</updated><title type='text'>MySQL Database for Cookbook</title><content type='html'>Today I saw a good Ruby on Rails video that addressed a similar problem.
&lt;script src="https://gist.github.com/1546514.js?file=cookbook.sql"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-4928743457641485162?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/4928743457641485162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/4928743457641485162'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/12/mysql-database-for-cookbook.html' title='MySQL Database for Cookbook'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-1852095757321803055</id><published>2011-12-27T20:31:00.000-08:00</published><updated>2011-12-27T20:31:07.173-08:00</updated><title type='text'>Spring Persistence with Hibernate</title><content type='html'>The book "Spring Persistence with Hibernate" is a little hard to follow so I diagrammed a bit of the code:
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-ofu3Y0oospI/Tvqa9HtC4uI/AAAAAAAAAEs/F2bWTHDBTRs/s1600/spring_persistence_with_hibernate.png" imageanchor="1" style="clear:left; float:left;margin-right:1em; margin-bottom:1em"&gt;&lt;img border="0" height="320" width="258" src="http://3.bp.blogspot.com/-ofu3Y0oospI/Tvqa9HtC4uI/AAAAAAAAAEs/F2bWTHDBTRs/s320/spring_persistence_with_hibernate.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-1852095757321803055?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/1852095757321803055'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/1852095757321803055'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/12/spring-persistence-with-hibernate.html' title='Spring Persistence with Hibernate'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-ofu3Y0oospI/Tvqa9HtC4uI/AAAAAAAAAEs/F2bWTHDBTRs/s72-c/spring_persistence_with_hibernate.png' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-7281460483168775216</id><published>2011-12-26T10:48:00.000-08:00</published><updated>2011-12-26T11:04:08.703-08:00</updated><title type='text'>StreamReaderHelper.java</title><content type='html'>I was using Apache HTTPComponents and needed to get the content from the response InputStream.  It seemed like a lot of code and thus, needed a test.&lt;br /&gt;
&lt;p id='code'&gt;&lt;script src="https://gist.github.com/1521810.js?file=StreamReaderHelperTest.java"&gt;&lt;/script&gt;&lt;/p&gt;&lt;br /&gt;
&lt;p id='code'&gt;&lt;script src="https://gist.github.com/1521796.js?file=StreamReaderHelper.java"&gt;&lt;/script&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-7281460483168775216?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/7281460483168775216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/7281460483168775216'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/12/streamreaderhelperjava.html' title='StreamReaderHelper.java'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-7473477856369898415</id><published>2011-12-21T20:42:00.000-08:00</published><updated>2011-12-26T11:25:39.727-08:00</updated><title type='text'>Test Using Apache HTTPComponents</title><content type='html'>My project has a servlet that does nothing more than call a stored procedure and return the results returned from the stored procedure.  It requires a different kind of test.  I enjoyed working with HTTPComponents even if the test is not yet all I want it to be.  This first version only tests to ensure the HTTP request can be completed. :(&lt;br/&gt;&lt;br/&gt;&lt;br /&gt;
&lt;div id="code"&gt;&lt;script src="https://gist.github.com/1521956.js?file=TestStoreForward.java"&gt;&lt;/script&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-7473477856369898415?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/7473477856369898415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/7473477856369898415'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/12/test-using-apache-httpcomponents.html' title='Test Using Apache HTTPComponents'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-6000233368680163595</id><published>2011-12-19T20:25:00.001-08:00</published><updated>2011-12-26T12:34:24.603-08:00</updated><title type='text'>Ruby Hash</title><content type='html'>&lt;script src="https://gist.github.com/1522023.js?file=using_ruby_hash.rb"&gt;
&lt;/script&gt;&lt;br /&gt;
and using the CodeRunner app is pretty cool . . . &lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-Mi1RMhlPPPY/TvjT7rsCsUI/AAAAAAAAAEg/qwfrpM-GNMg/s1600/using_ruby_hash.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="266" src="http://2.bp.blogspot.com/-Mi1RMhlPPPY/TvjT7rsCsUI/AAAAAAAAAEg/qwfrpM-GNMg/s400/using_ruby_hash.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-6000233368680163595?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6000233368680163595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6000233368680163595'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/12/ruby-hash.html' title='Ruby Hash'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-Mi1RMhlPPPY/TvjT7rsCsUI/AAAAAAAAAEg/qwfrpM-GNMg/s72-c/using_ruby_hash.png' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-2342362941502532808</id><published>2011-12-17T13:20:00.000-08:00</published><updated>2011-12-17T13:20:59.631-08:00</updated><title type='text'>Uniform Level of Abstraction</title><content type='html'>Glenn Vanderburg's presentation, &lt;a href='http://lsrc2008.confreaks.com/17-glenn-vanderburg-tactical-design.html'&gt;Tactical Design&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Very good stuff.&lt;br /&gt;
&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-2342362941502532808?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/2342362941502532808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/2342362941502532808'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/12/uniform-level-of-abstraction.html' title='Uniform Level of Abstraction'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-8729548234723976522</id><published>2011-12-13T15:41:00.000-08:00</published><updated>2011-12-26T12:29:34.484-08:00</updated><title type='text'>Mockito</title><content type='html'>I created a tiny project with which to quickly refresh my memory of Mockito.  Knowing I would blog this code, I made the classes as concise as possible. &lt;br /&gt;
&lt;p&gt;&lt;script src="https://gist.github.com/1522044.js?file=ProgrammableTest.java"&gt;&lt;/script&gt;&lt;/p&gt;&lt;p&gt;&lt;script src="https://gist.github.com/1522045.js?file=Programmable.java"&gt;&lt;/script&gt;&lt;/p&gt;&lt;p&gt;&lt;script src="https://gist.github.com/1522052.js?file=build.xml"&gt;&lt;/script&gt;&lt;/p&gt;&lt;br /&gt;
&lt;div id='code'&gt;&lt;pre&gt;[Programmable_with_Mockito] ant
Buildfile: /Users/javapro/dev/src/java/Programmable_with_Mockito/build.xml

clean:
   [delete] Deleting directory /Users/javapro/dev/src/java/Programmable_with_Mockito/bin

init:
    [mkdir] Created dir: /Users/javapro/dev/src/java/Programmable_with_Mockito/bin

compile:
    [javac] Compiling 3 source files to /Users/javapro/dev/src/java/Programmable_with_Mockito/bin
    [javac] Note: /Users/javapro/dev/src/java/Programmable_with_Mockito/src/us/home/electronics/ProgrammableTest.java uses or overrides a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.

test:
    [junit] Running us.home.electronics.ProgrammableTest
    [junit] Testsuite: us.home.electronics.ProgrammableTest
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.312 sec
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.312 sec
    [junit] 
    [junit] Testcase: testBeepBeep took 0.276 sec

BUILD SUCCESSFUL
Total time: 1 second
[Programmable_with_Mockito]&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-8729548234723976522?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/8729548234723976522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/8729548234723976522'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/12/mockito.html' title='Mockito'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-393280927667577713</id><published>2011-12-07T14:46:00.000-08:00</published><updated>2011-12-07T14:46:12.205-08:00</updated><title type='text'>Tweet</title><content type='html'>Not sure why this is so great ...&lt;br /&gt;
&lt;div id='code'&gt;Want an IRB console in any maven project? Try "mvn org.jruby.plugins:jruby-rake-plugin:irb". No need to modify POM!&lt;/div&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-393280927667577713?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/393280927667577713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/393280927667577713'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/12/tweet.html' title='Tweet'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-5958337998488849427</id><published>2011-12-01T04:28:00.000-08:00</published><updated>2011-12-01T04:32:09.760-08:00</updated><title type='text'>Processing.js Horror</title><content type='html'>Processing.js reminds me of RPG code.  The fill() function in the code below is a mystery.  fill() offers no hint of what context the fill is to apply to. &lt;div id='code'&gt;&lt;pre&gt;if(count &lt;= 90) {
      letter = char(65+counter);
      if(letter == 'A' || letter == 'E' || letter == 'I' || 
         letter == 'O' || letter == 'U') {
           fill(204, 204, 0);
      } else {
        fill(255);
      }
    } else {
      fill(153);
      letter = char(48+counter);
    }&lt;/pre&gt;
&lt;/div&gt;By running the code, one can see that the fill does indeed apply to the letter.  It appears that fill() can be called either before or after the letter is created but who can be sure?  In this code, a letter is created and the fill is defined but we never see how the two are brought together.  Object oriented development avoids this problem.
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-5958337998488849427?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/5958337998488849427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/5958337998488849427'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/12/processingjs-horror.html' title='Processing.js Horror'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-4635297383769787841</id><published>2011-11-30T19:43:00.000-08:00</published><updated>2011-11-30T19:43:34.614-08:00</updated><title type='text'>Beginner's Mind</title><content type='html'>Matthew McCullough gave an excellent talk this evening at Rich Web Experience.  Reviewing Matt's slides from another talk, I found a great quote: &lt;div id='code'&gt;&lt;pre&gt;In the beginner's mind, there are many possibilities.  In the expert's mind, there are few.&lt;/pre&gt;&lt;/div&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-4635297383769787841?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/4635297383769787841'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/4635297383769787841'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/11/beginners-mind.html' title='Beginner&apos;s Mind'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-2254844327695330855</id><published>2011-11-25T05:55:00.000-08:00</published><updated>2011-11-25T05:55:27.190-08:00</updated><title type='text'>Two Lists</title><content type='html'>&lt;h3&gt;Long time ago, I memorized 2 lists of 4 items each&lt;/h3&gt;Objects have identity, lifetime, state and behavior.  Object oriented development utilizes inheritance, polymorphism, encapsulation and abstraction. &lt;br /&gt;
&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-2254844327695330855?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/2254844327695330855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/2254844327695330855'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/11/two-lists.html' title='Two Lists'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-1098826350002594629</id><published>2011-11-24T19:46:00.000-08:00</published><updated>2011-12-26T16:35:22.656-08:00</updated><title type='text'>jQuery Selectors</title><content type='html'>&lt;script src="https://gist.github.com/1522347.js?file=selectors.html"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-1098826350002594629?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/1098826350002594629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/1098826350002594629'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/11/jquery-selectors.html' title='jQuery Selectors'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-751718563759000380</id><published>2011-11-23T13:32:00.000-08:00</published><updated>2011-11-23T13:32:37.244-08:00</updated><title type='text'>Javascript - One Image, Two Buttons</title><content type='html'>Downloading one image instead of several is one way to optimize web performance.  This code shows how to use different portions of the image at various points in the page. &lt;br /&gt;
&lt;div id='code'&gt;&lt;pre&gt;&amp;lt;html&gt;
    &amp;lt;head&gt;
         &amp;lt;style type="text/css"&gt;
            .button-up {
                position: absolute;
                clip: rect(215px 49px 270px 0);
            }
            .button-down {
                position: absolute;
                clip: rect(0 49px 50px 0);
            }
        &amp;lt;/style&gt;

    &amp;lt;/head&gt;
    &amp;lt;body&gt;
        &amp;lt;div id="content"&gt;
                &amp;lt;span id="upButton" style="position:absolute;top:-215;left:200;width:50px;height:50px;"&gt;
                    &amp;lt;img src="UpAndDownButtons.jpg" class="button-up" onclick="pressButton('upButton', 'downButton')"/&gt;
                &amp;lt;/span&gt;
                &amp;lt;span id="downButton" style="position:absolute;top:2;left:200;width:50px;height:50px;"&gt;
                    &amp;lt;img src="UpAndDownButtons.jpg" class="button-down" onclick="pressButton('downButton', 'upButton')"/&gt;
                &amp;lt;/span&gt;
        &amp;lt;/div&gt;
        &amp;lt;script type="text/javascript"&gt;

            function pressButton(fromButton, toButton) {
                var from = document.getElementById(fromButton);
                from.style.display = "none";

                var to = document.getElementById(toButton);
                to.style.display = "block";
            }

            function initPage() {
                var up = document.getElementById("upButton");
                up.style.display = "block";
                var down = document.getElementById("downButton");
                down.style.display = "none";
            }

            initPage();
        &amp;lt;/script&gt;
    &amp;lt;/body&gt;
&amp;lt;/html&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-751718563759000380?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/751718563759000380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/751718563759000380'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/11/javascript-one-image-two-buttons.html' title='Javascript - One Image, Two Buttons'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-8198955697710581366</id><published>2011-11-13T16:10:00.000-08:00</published><updated>2011-12-26T16:13:11.667-08:00</updated><title type='text'>Clojure Lists, Maps and Sets</title><content type='html'>Define the unless function on the first line of 'unless.clj' and then, use it in a few expressions: &lt;br /&gt;
&lt;p&gt;&lt;script src="https://gist.github.com/1522329.js?file=unless.clj"&gt;&lt;/script&gt;&lt;/p&gt;&lt;div id='code'&gt;&lt;pre&gt;[clojure] java -cp .:$CLOJURE_HOME/clojure-1.3.0.jar:$CLOJURE_HOME/jline-1.0.jar jline.ConsoleRunner clojure.main
Clojure 1.3.0
user=&gt; (load-file "unless.clj")
nil
"it's good to be 12"
"6 it's good to be 6"
"5 "
nil
user=&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
I found out about transactional Clojure in the book Practical Clojure by Luke VanderHart:&lt;br /&gt;
&lt;p&gt;&lt;script src="https://gist.github.com/1522324.js?file=do_sync.clj"&gt;&lt;/script&gt;&lt;/p&gt;&lt;div id='code'&gt;&lt;pre&gt;user=&gt; (load-file "dosync.clj")
b
c
d
nil
user=&gt; &lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
Often, single data items don't require names because they are stored in a list, map or set and can be worked on in sequence.  In this example, three accounts are stored in the account-info datastructure.&lt;br /&gt;
&lt;br /&gt;
Another test of a loop-thru function coded in loop-thru-maps.clj:&lt;br /&gt;
&lt;p&gt;&lt;script src="https://gist.github.com/1522322.js?file=loop-thru-maps.clj"&gt;&lt;/script&gt;&lt;/p&gt;&lt;div id='code'&gt;&lt;pre&gt;user=&gt; (load-file "loop-thru-maps.clj")
{:balance 11.59, :member-since "2009-22-02", :username "jak"}
{:balance 13.59, :member-since "2009-02-01", :username "zak"}
{:balance 12.59, :member-since "2011-02-02", :username "mak"}
clojure.lang.PersistentHashMap
{:balance 11.59, :member-since "2009-22-02", :username "jak"}
{:balance 13.59, :member-since "2009-02-01", :username "zak"}
{:balance 12.59, :member-since "2011-02-02", :username "mak"}
nil
user=&gt; &lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-8198955697710581366?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/8198955697710581366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/8198955697710581366'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/11/clojure-maps.html' title='Clojure Lists, Maps and Sets'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-8335492349861580814</id><published>2011-11-10T17:30:00.000-08:00</published><updated>2011-12-26T13:18:09.919-08:00</updated><title type='text'>Old School JDBC-ODBC</title><content type='html'>I think I did this once 12 years ago but today I wanted to test the accessibility of a SQL Server 6.5 database.  After creating a ODBC datasource in Windows for the remote database, the following code ran perfectly.  Recall that the JdbcOdbcServer.class is included in rt.jar so it is available without listing any jar in the classpath.&lt;br /&gt;
&lt;p&gt;&lt;script src="https://gist.github.com/1522128.js?file=OldSchoolJDBC.java"&gt;
&lt;/script&gt;&lt;/p&gt;This proved to me that the database was not the issue causing the Windows 95 application to fail.&lt;br /&gt;
&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-8335492349861580814?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/8335492349861580814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/8335492349861580814'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/11/old-school-odbc.html' title='Old School JDBC-ODBC'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-271275617044116755</id><published>2011-11-06T07:07:00.000-08:00</published><updated>2011-11-06T07:07:57.899-08:00</updated><title type='text'>Postgresql Server Management</title><content type='html'>&lt;div id='code'&gt;&lt;pre&gt;[pgsql-9.0] cd bin
[bin] cd /usr/local/pgsql-9.0/bin
[bin] initdb /Users/javapro/dev/database/postgres_data/petstore
The files belonging to this database system will be owned by user "javapro".
This user must also own the server process.
. . . 
Success. You can now start the database server using:

    postgres -D /Users/javapro/dev/database/postgres_data/petstore
or
    pg_ctl -D /Users/javapro/dev/database/postgres_data/petstore -l logfile start

[bin] pg_ctl -D /Users/javapro/dev/database/postgres_data/petstore -l logfile start
server starting
&lt;/pre&gt;&lt;/div&gt;Manage the server using other options of pg_ctl  &lt;br /&gt;
&lt;div id='code'&gt;&lt;pre&gt;pg_ctl start [-w] [-t seconds] [-s] [-D datadir] [-l filename] [-o options] [-p path] [-c]
pg_ctl stop [-W] [-t seconds] [-s] [-D datadir] [-m s[mart] | f[ast] | i[mmediate] ]
pg_ctl restart [-w] [-t seconds] [-s] [-D datadir] [-c] [-m s[mart] | f[ast] | i[mmediate] ] [-o options]
pg_ctl reload [-s] [-D datadir]
pg_ctl status [-D datadir]
pg_ctl kill signal_name process_id
pg_ctl register [-N servicename] [-U username] [-P password] [-D datadir] [-w] [-t seconds] [-s] [-o options]
pg_ctl unregister [-N servicename]
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div id='code'&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div id='code'&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-271275617044116755?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/271275617044116755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/271275617044116755'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/11/postgresql-server-management.html' title='Postgresql Server Management'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-762249481839032287</id><published>2011-10-24T01:53:00.000-07:00</published><updated>2011-10-24T02:19:05.956-07:00</updated><title type='text'>Clojure recursion and recur</title><content type='html'>I'm still trying to find good explanations of this stuff but for now, trial and error provides results.&lt;br /&gt;
&lt;div id="code"&gt;&lt;pre&gt;(defn loopthru1 [n]
  (if-not (empty? n) (do
       (println (first n))
       (loopthru1 (rest n))
  ))
)
(loopthru1 [1 2 3 4 5 6])

(def pack
  [ { :name "Bichon Frise"
      :description (list "small" "white" "even-tempered")}
    { :name "Australian Shepherd"
      :description (list "medium" "mottled" "even-tempered")}
  ])
(loopthru1 pack)&lt;/pre&gt;&lt;/div&gt;loopthru 1 (above) explicitly calls itself whereas loopthru2 (below) uses recur.&lt;br /&gt;
&lt;div id="code"&gt;&lt;pre&gt;(defn loopthru2 [n]
  (if-not (empty? n)
    (do (println (first n))
     (recur (rest n)))))
(loopthru2 [1 2 3 4 5 6])&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div id="code"&gt;&lt;pre&gt;(defn loopthru3 [n]
  (when (seq n)
    (println (first n))
    (recur (rest n))))
(loopthru3 [1 2 3 4 5 6])&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-762249481839032287?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/762249481839032287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/762249481839032287'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/10/clojure-recursion-and-recur.html' title='Clojure recursion and recur'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-1694320961431433107</id><published>2011-10-15T11:02:00.000-07:00</published><updated>2011-10-15T11:03:16.077-07:00</updated><title type='text'>Top 10 Vulnerabilities</title><content type='html'>OWASP, Open Web Application Security Project, identifies risks and provides tutorials showing how to protect against the threats.&lt;br /&gt;
&lt;br /&gt;
&lt;a href='https://www.owasp.org/index.php/Top_10_2010-Main'&gt;https://www.owasp.org/index.php/Top_10_2010-Main&lt;/a&gt;&lt;br /&gt;
&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-1694320961431433107?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/1694320961431433107'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/1694320961431433107'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/10/top-10-vulnerabilities.html' title='Top 10 Vulnerabilities'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-8983440190669564494</id><published>2011-09-27T20:10:00.000-07:00</published><updated>2011-10-05T20:31:47.475-07:00</updated><title type='text'>Baseball Chat</title><content type='html'>I'm using MAMP and liking it.&lt;br /&gt;
&lt;h3&gt;styles.css&lt;/h3&gt;&lt;div id='code'&gt;&lt;pre&gt;body {
    background-image: url('../images/background.png');
    font-family: Helvetica, Arial, sans-serif;
    font-size: 10pt;
    color: white;
    margin-top: 10px;
}

.messagePanel {
    position: absolute;
    top: 95px;
    left: 420px;
    padding: 15px 15px 15px 15px;
    color: black;
}

.inputPanel {
    overflow: auto;
    background: white;
    padding: 10px 10px 10px 10px;
    margin-bottom: 10px;
    border-radius: 10px;
    -moz-border-radius: 10px;
}

.outputPanel {
    background: white;
    height: 317px;
    width: 528px;
    overflow: auto;
    padding: 15px 15px 15px 15px;
    -moz-border-radius: 10px;
}

.buttonBar {
    position: absolute;
    top: 65px;
    left: 15px;
}

.roster {
    background: white;
    color: black;
}
&lt;/pre&gt;&lt;/div&gt;&lt;h3&gt;chat.html&lt;/h3&gt;&lt;div id='code'&gt;&lt;pre&gt;&amp;lt;!DOCTYPE html&gt;
&amp;lt;html&gt;
  &amp;lt;head&gt;
      &amp;lt;title&gt;Let's Go BlueSox!&amp;lt;/title&gt;
      &amp;lt;meta http-equiv="content-type" content="text/html; charset=utf-8"&gt;
      &amp;lt;link href='stylesheets/styles.css' rel='stylesheet' type='text/css' /&gt;
      &amp;lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"&gt;&amp;lt;/script&gt;
  &amp;lt;/head&gt;
  &amp;lt;body&gt;
 
      &amp;lt;img src='images/logo_990x80.png' width='990' height='80' /&gt;
      &amp;lt;p&gt;Loading ...&amp;lt;/p&gt;

      &amp;lt;div class='messagePanel'&gt;
          &amp;lt;div id='messages' class='inputPanel'&gt;
              &amp;lt;input type='text' id='author' placeholder='Name' size='10'/&gt;
              &amp;lt;input type='text' id='contents' placeholder='Your Message' size='57'/&gt;
              &amp;lt;input type='button' id='sendButton' value='Send'/&gt;
          &amp;lt;/div&gt;
          &amp;lt;div class='outputPanel'&gt;
              &amp;lt;div id='roster' class='panel'&gt;&amp;lt;/div&gt;
          &amp;lt;/div&gt;
      &amp;lt;/div&gt;

      &amp;lt;script type="text/javascript"&gt;

      $(document).ready(function() {
          $('p').text('Ready');

          $('#sendButton').click(function() { 
              sendMessage();
          });
            
          var sendMessage = function() {
              var author = $('#author').val();
              var contents = $('#contents').val();
          
              var data = "author=" + escape(author) + "&amp;contents=" + escape(contents);
           
              if (author != '' &amp;&amp; contents != '') {
                  $('#roster').append( author + ':' + contents + '&amp;lt;br/&gt;');
                
                  $('#contents').val("");
                  $('#contents').focus();
    
                  $('p').text('Sending');

                  $.ajax({
                      type: 'POST',
                      url: 'post_message.php',
                      data: data,
                      success: $('p').text('Success')
                  });
              }
          }
      });
      &amp;lt;/script&gt;

    &amp;lt;/body&gt;
&amp;lt;/html&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;h3&gt;post_message.php&lt;/h3&gt;&lt;div id='code'&gt;&lt;pre&gt;&amp;lt;?php
    $link = mysql_connect('localhost','root','root') or die('Cannot connect to the DB');
    mysql_select_db('ChatterDB',$link) or die('Cannot select the DB');

    $author = $_POST["author"];
    $contents = $_POST["contents"];

    $sql='INSERT INTO messages (author, contents)
    VALUES
    ("' . $author . '","' . $contents . '")';
    
    if (!mysql_query($sql,$link)) {
        die('Error: ' . mysql_error());
    }
    
    mysql_close($link);
    
    //sleep(5);
?&gt;&lt;/pre&gt;&lt;/div&gt;To use MAMP's MySQL from the command line, use the following command: &lt;br /&gt;
&lt;div id='code'&gt;&lt;pre&gt;[~] /Applications/MAMP/Library/bin/mysql -u root --password=root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 53
Server version: 5.5.9 Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql&gt; show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| ChatterDB          |
| mysql              |
| performance_schema |
+--------------------+
4 rows in set (0.03 sec)

mysql&gt; &lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-8983440190669564494?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/8983440190669564494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/8983440190669564494'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/09/baseball-chat.html' title='Baseball Chat'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-2222697260253011572</id><published>2011-07-24T13:19:00.001-07:00</published><updated>2011-07-24T13:19:48.214-07:00</updated><title type='text'>Motivation</title><content type='html'>&lt;a href="http://www.ted.com/talks/dan_pink_on_motivation.html"&gt;TED Talk on Motivation&lt;/a&gt;&lt;br /&gt;
&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-2222697260253011572?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/2222697260253011572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/2222697260253011572'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/07/motivation.html' title='Motivation'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-6139501134654397233</id><published>2011-07-22T04:33:00.000-07:00</published><updated>2011-07-22T04:33:10.393-07:00</updated><title type='text'>Maven Archetypes on Webtide</title><content type='html'>&lt;a href="http://www.webtide.com/resources/maven.jsp"&gt;Webtide's Archetypes&lt;/a&gt;&lt;br /&gt;
&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-6139501134654397233?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6139501134654397233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6139501134654397233'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/07/maven-archetypes-on-webtide.html' title='Maven Archetypes on Webtide'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-4142137303414387954</id><published>2011-07-18T18:07:00.000-07:00</published><updated>2011-07-18T18:39:51.432-07:00</updated><title type='text'>First Evidence</title><content type='html'>Elah Valley, Israel &lt;a href="http://www.cnn.com/2011/WORLD/meast/07/14/israel.cityofdavid.archeology/index.html?hpt=wo_mid"&gt;(CNN)&lt;/a&gt; -- Archaeologists in Israel have found remains which may be the biblical City of King David, the first evidence that the ancient Jewish empire actually existed.  The bible refers to a powerful 10th century B.C. Kingdom of David, Israel's second king, stretching from Egypt to the Euphrates, but little evidence of its existence has ever been found.&lt;br /&gt;
&lt;br /&gt;
Now, an archaeological discovery at Khirbet Qeiyafa, in Elah Valley, 30 km from Jerusalem, appears to show signs of a Jewish settlement.  Professor Yosef Garfinkel ... added: "We do have animal bones. Thousands of animal bones were on site. We have sheep, cattle and goats. But we have no pigs at all. In Canaanite and Philistine cities you will find up to 20% pig bones."&lt;br /&gt;
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-4142137303414387954?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/4142137303414387954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/4142137303414387954'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/07/first-evidence.html' title='First Evidence'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-5851415991641808939</id><published>2011-07-18T17:54:00.000-07:00</published><updated>2011-07-18T17:54:24.702-07:00</updated><title type='text'>Neanderthals</title><content type='html'>&lt;a href="http://www.sciencedaily.com/releases/2011/07/110718085329.htm"&gt;ScienceDaily&lt;/a&gt; (July 17, 2011) — &lt;br /&gt;
Some of the human X chromosome originates from Neanderthals and is found exclusively in people outside Africa, according to an international team of researchers led by Damian Labuda of the Department of Pediatrics at the University of Montreal and the CHU Sainte-Justine Research Center. The research was published in the July issue of Molecular Biology and Evolution.&lt;br /&gt;
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-5851415991641808939?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/5851415991641808939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/5851415991641808939'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/07/neanderthals.html' title='Neanderthals'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-1454995286154192869</id><published>2011-06-14T14:57:00.000-07:00</published><updated>2011-06-14T15:04:21.048-07:00</updated><title type='text'>CoffeeScript</title><content type='html'>CoffeeScript, the Ruby of JavaScript. This first line calls parseRawDescription, passing one argument which is one string with two values concatenated.  The second block is the function definition.&lt;br /&gt;
&lt;div id='code'&gt;&lt;pre&gt;[all, @title, @price] = @parseRawDescription rawDescription
&lt;/pre&gt;&lt;/div&gt;&lt;div id='code'&gt;&lt;pre&gt;parseRawDescription: (rawDescription) -&gt;
    pattern = ///
        ([^$]+)         #title 
        (\$\d+\.\d+)    #price
    ///
    result = rawDescription.match pattern 
    r.trim() for r in result
&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-1454995286154192869?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/1454995286154192869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/1454995286154192869'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/06/coffeescript.html' title='CoffeeScript'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-6820692497399252610</id><published>2011-05-31T18:44:00.000-07:00</published><updated>2011-05-31T18:44:22.342-07:00</updated><title type='text'>JavaScript Web Applications</title><content type='html'>O'Reilly offers early access to the book "JavaScript Web Applications" by Alex MacCaw.  Final release is September 2011.  A portion of O'Reilly's description of the book follows: &lt;br /&gt;
&lt;br /&gt;
Building rich JavaScript applications that bring the desktop experience to the Web is now possible, thanks to powerful JavaScript engines and the CSS3 and HTML5 specifications. The key is moving state from the server to the client side; but that's no simple task.... Explore MVC and how to best structure and manage dependencies inside your application.  Get an introduction to templating and data binding....&lt;br /&gt;
&lt;br /&gt;
This is extremely compelling. &lt;br /&gt;
&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-6820692497399252610?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6820692497399252610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6820692497399252610'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/05/javascript-web-applications.html' title='JavaScript Web Applications'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-6415241835259314037</id><published>2011-05-23T19:12:00.000-07:00</published><updated>2011-05-23T19:12:44.846-07:00</updated><title type='text'>Violet UML Editor</title><content type='html'>&lt;a href="http://violet.sourceforge.net"&gt;&lt;u&gt;Download&lt;/u&gt;&lt;/a&gt; Violet UML editor from sourceforge. &lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.aosabook.org/en/violet.html"&gt;&lt;u&gt;Design decisions&lt;/u&gt;&lt;/a&gt; made in the development of Violet. &lt;br /&gt;
&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-6415241835259314037?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6415241835259314037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6415241835259314037'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/05/violet-uml-editor.html' title='Violet UML Editor'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-3766494610931187055</id><published>2011-05-20T19:53:00.001-07:00</published><updated>2011-05-20T23:39:33.795-07:00</updated><title type='text'>Why Does This Work?</title><content type='html'>&lt;div id='code'&gt;&lt;pre&gt;class Person {
    def name
    def age
}

jill = new Person(name: 'Jill', age: 21) 
john = new Person(name: 'John', age: 12)
jorge = [name: "Jorge", age: 3]

def printPerson(x) {
    println "This is ${x.name} who is ${x.age}"
}

printPerson(jill)
printPerson(john)
printPerson(jorge)
&lt;/pre&gt;&lt;/div&gt;&lt;div id='code'&gt;&lt;pre&gt;This is Jill who is 21
This is John who is 12
This is Jorge who is 3
&lt;/pre&gt;&lt;/div&gt;&lt;h4&gt;Now, a slightly different version shows the accessor is called implicitly when using the field name&lt;/h4&gt;&lt;div id='code'&gt;&lt;pre&gt;class Person {
    def name
    def age
    
    String getName() {
        return "Calling the accessor ..."
    }
}

jill = new Person(name: 'Jill', age: 21) 
john = new Person(name: 'John', age: 12)
jorge = [name: "Jorge", age: 3]

def printPerson(x) {
    println "This is ${x.name} who is ${x.age}"
}

printPerson(jill)
printPerson(john)
printPerson(jorge)
&lt;/pre&gt;&lt;/div&gt;&lt;div id='code'&gt;&lt;pre&gt;This is Calling the accessor ... who is 21
This is Calling the accessor ... who is 12
This is Jorge who is 3
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
When the groovy code is compiled and javap run on the class, I find that there is no getName() method.  There is however, a getProperty(java.lang.String) method that returns an object.  Going out on a limb, I'm guessing that getProperty is called with the field name passed to it, something like java.util.Calendar.get(java.util.Calendar.DAY_OF_MONTH).&lt;br /&gt;
&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-3766494610931187055?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/3766494610931187055'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/3766494610931187055'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/05/why-does-this-work.html' title='Why Does This Work?'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-5961658269304005478</id><published>2011-05-18T21:56:00.000-07:00</published><updated>2011-05-18T21:58:45.696-07:00</updated><title type='text'>Manning's New Book - Entity Framework 4 in Action</title><content type='html'>Quote from the book - &lt;i&gt;&lt;br /&gt;
In the Java world, a structure like the dataset has always existed, but its use is now discouraged except for the simplest applications. In the .NET world, we’re facing the beginning of this trend too. &lt;/i&gt;&lt;br /&gt;
&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-5961658269304005478?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/5961658269304005478'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/5961658269304005478'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/05/mannings-new-book-entity-framework-4-in.html' title='Manning&apos;s New Book - Entity Framework 4 in Action'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-6851495890803122948</id><published>2011-05-17T16:40:00.000-07:00</published><updated>2011-05-17T16:43:47.163-07:00</updated><title type='text'>60 Minutes</title><content type='html'>In his interview on Sunday's 60 Minutes, Robert Gates said his greatest frustration was that he lead a department that is organized to plan for war but not to fight a war.&lt;br /&gt;
&lt;br /&gt;
Today at Rails Conf 2011, Eric Ries, the creator of the Lean Startup methodology and the author of the popular entrepreneurship blog Startup Lessons Learned, noted that waterfall methodology is similar in that waterfall is great for creating a plan for the development of a really bad product.&lt;br /&gt;
&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-6851495890803122948?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6851495890803122948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6851495890803122948'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/05/60-minutes.html' title='60 Minutes'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-6338363736684468283</id><published>2011-05-15T08:07:00.000-07:00</published><updated>2011-12-26T19:35:32.655-08:00</updated><title type='text'>SQLite and ANT</title><content type='html'>&lt;script src="https://gist.github.com/1522639.js?file=build.xml"&gt;&lt;/script&gt;&lt;br /&gt;
The targets that can be run are: &lt;br /&gt;
&lt;div id='code'&gt;&lt;pre&gt;$ ant sqlcreate
$ ant sqlschema
$ ant sqlpopulate
$ ant sqlselect
$ ant sqldrop
&lt;/pre&gt;&lt;/div&gt;The SQLSCHEMA target in the ANT file displays the tables in an SQLite database with this command:&lt;br /&gt;
&lt;div id='code'&gt;&lt;pre&gt;sqlite&gt; SELECT name FROM sqlite_master WHERE type='table';
&lt;/pre&gt;&lt;/div&gt;Other Common Commands&lt;br /&gt;
&lt;div id='code'&gt;&lt;pre&gt;sqlite&gt; .tables
sqlite&gt; .schema [TABLE] (such as Customers table)
sqlite&gt; explain [SQL COMMAND] 
sqlite&gt; .separator [CHARACTER] (such as comma or vertical bar)
sqlite&gt; .databases
sqlite&gt; .read [FILENAME]
&lt;/pre&gt;&lt;/div&gt;Termination Commands to terminate a line &lt;br /&gt;
&lt;div id='code'&gt;&lt;pre&gt;semicolon ;
GO
forward slash /&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-6338363736684468283?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6338363736684468283'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6338363736684468283'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/05/sqlite-and-ant.html' title='SQLite and ANT'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-5267700868117252805</id><published>2011-05-08T09:53:00.000-07:00</published><updated>2011-05-08T12:24:26.758-07:00</updated><title type='text'>Geronimo Server</title><content type='html'>I was very happy to see that Geronimo works with Jetty.&amp;nbsp; I &lt;a href="http://geronimo.apache.org/downloads.html"&gt;&lt;u&gt;downloaded&lt;/u&gt;&lt;/a&gt; the archive and extracted the app then started the console.&lt;br /&gt;
&lt;br /&gt;
&lt;div id='code'&gt;&lt;pre&gt;[greg:bin] ./geronimo run
Using GERONIMO_HOME:   /Users/javapro/dev/bin/geronimo-jetty8
Using GERONIMO_TMPDIR: var/temp
Using JRE_HOME:        /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
                                                          
     ______                       _                       
    / ____/___  _________  ____  (_)____ ___  ____        
   / / __ / _ \/ ___/ __ \/ __ \/ // __ `__ \/ __ \  
  / /_/ //  __/ /  / /_/ / / / / // / / / / / /_/ /       
  \____/ \___/_/   \____/_/ /_/_//_/ /_/ /_/\____/    

  Apache Geronimo (3.0-M1)

Hit '&lt;tab&gt;' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '&lt;ctrl-d&gt;' or 'osgi:shutdown' to shutdown Geronimo.

geronimo&gt; Booting Geronimo Kernel (in Java 1.6.0_24)...
. . . 
&lt;/pre&gt;&lt;/div&gt;I downloaded the example so I could verify the installation.  In another command window, I entered the command to deploy the WAR file. &lt;br /&gt;
&lt;div id='code'&gt;&lt;pre&gt;[greg:geronimo-jetty8] cd bin
[greg:bin] ./deploy --user system --password manager deploy ~/dev/bin/HelloWorld.war
Using GERONIMO_HOME:   /Users/javapro/dev/bin/geronimo-jetty8
Using GERONIMO_TMPDIR: var/temp
Using JRE_HOME:        /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
    Deployed org.apache.geronimo.samples/HelloWorldApp/1.0/war @ /hello
[greg:bin] &lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
Now for the EJB project described in the &lt;a href="http://repo.exist.com/dist/maestro/1.7.0/BetterBuildsWithMaven.pdf"&gt;&lt;u&gt;Better Builds with Maven&lt;/u&gt;&lt;/a&gt; guide.&lt;br /&gt;
&lt;div id='code'&gt;&lt;pre&gt;[greg:java] svn co http://svn.apache.org/repos/asf/geronimo/daytrader/trunk/ 
. . . 
 U   trunk
Checked out revision 1100785.
[greg:java] mv trunk daytrader
[greg:java] cd daytrader 
&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-5267700868117252805?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/5267700868117252805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/5267700868117252805'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/05/geronimo-server.html' title='Geronimo Server'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-2021348718723518150</id><published>2011-05-03T19:49:00.001-07:00</published><updated>2011-05-03T19:50:39.472-07:00</updated><title type='text'>Trader Joe’s</title><content type='html'>Trader Joe’s will open several locations in the Dallas area by the end of 2011.&lt;br /&gt;
&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-2021348718723518150?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/2021348718723518150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/2021348718723518150'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/05/trader-joes.html' title='Trader Joe’s'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-4540985348805527839</id><published>2011-05-01T12:12:00.001-07:00</published><updated>2011-05-02T18:37:40.596-07:00</updated><title type='text'>Who Makes This Stuff Up?</title><content type='html'>&lt;marquee width="100%" behavior="scroll" scrollamount="5" direction="left"&gt;&lt;a href="http://www.mynameonfire.com"&gt;&lt;img src="http://www.mynameonfire.com/gimg/1/h.gif" border="0"&gt;&lt;/a&gt; &lt;a href="http://www.mynameonfire.com"&gt;&lt;img src="http://www.mynameonfire.com/gimg/1/o.gif" border="0"&gt;&lt;/a&gt; &lt;a href="http://www.mynameonfire.com"&gt;&lt;img src="http://www.mynameonfire.com/gimg/1/l.gif" border="0"&gt;&lt;/a&gt; &lt;a href="http://www.mynameonfire.com"&gt;&lt;img src="http://www.mynameonfire.com/gimg/1/l.gif" border="0"&gt;&lt;/a&gt; &lt;a href="http://www.mynameonfire.com"&gt;&lt;img src="http://www.mynameonfire.com/gimg/1/y.gif" border="0"&gt;&lt;/a&gt; &lt;a href="http://www.mynameonfire.com"&gt;&lt;img src="http://www.mynameonfire.com/gimg/-.gif" border="0"&gt;&lt;/a&gt; &lt;a href="http://www.mynameonfire.com"&gt;&lt;img src="http://www.mynameonfire.com/gimg/1/i.gif" border="0"&gt;&lt;/a&gt; &lt;a href="http://www.mynameonfire.com"&gt;&lt;img src="http://www.mynameonfire.com/gimg/1/s.gif" border="0"&gt;&lt;/a&gt; &lt;a href="http://www.mynameonfire.com"&gt;&lt;img src="http://www.mynameonfire.com/gimg/-.gif" border="0"&gt;&lt;/a&gt; &lt;a href="http://www.mynameonfire.com"&gt;&lt;img src="http://www.mynameonfire.com/gimg/1/s.gif" border="0"&gt;&lt;/a&gt; &lt;a href="http://www.mynameonfire.com"&gt;&lt;img src="http://www.mynameonfire.com/gimg/1/o.gif" border="0"&gt;&lt;/a&gt; &lt;a href="http://www.mynameonfire.com"&gt;&lt;img src="http://www.mynameonfire.com/gimg/-.gif" border="0"&gt;&lt;/a&gt; &lt;a href="http://www.mynameonfire.com"&gt;&lt;img src="http://www.mynameonfire.com/gimg/1/c.gif" border="0"&gt;&lt;/a&gt; &lt;a href="http://www.mynameonfire.com"&gt;&lt;img src="http://www.mynameonfire.com/gimg/1/o.gif" border="0"&gt;&lt;/a&gt; &lt;a href="http://www.mynameonfire.com"&gt;&lt;img src="http://www.mynameonfire.com/gimg/1/o.gif" border="0"&gt;&lt;/a&gt; &lt;a href="http://www.mynameonfire.com"&gt;&lt;img src="http://www.mynameonfire.com/gimg/1/l.gif" border="0"&gt;&lt;/a&gt; &lt;a href="http://www.mynameonfire.com"&gt;&lt;img src="http://www.mynameonfire.com/gimg/-.gif" border="0"&gt;&lt;/a&gt; &lt;/marquee&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-4540985348805527839?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/4540985348805527839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/4540985348805527839'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/05/who-makes-this-stuff-up.html' title='Who Makes This Stuff Up?'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-4690146623409238007</id><published>2011-04-30T13:47:00.000-07:00</published><updated>2011-04-30T23:05:11.520-07:00</updated><title type='text'>A Little Python</title><content type='html'>&lt;div id='code'&gt;&lt;pre&gt;class Hello():
 
 def __init__(self):
  self.nbrTimes = 5
  
 def sayHello(self):
  for x in range(self.nbrTimes):
   print('Hello')
   
hello = Hello()
hello.sayHello()
&lt;/pre&gt;&lt;/div&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-4690146623409238007?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/4690146623409238007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/4690146623409238007'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/04/little-python.html' title='A Little Python'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-6832395771899321771</id><published>2011-04-01T17:06:00.001-07:00</published><updated>2011-04-01T17:07:06.475-07:00</updated><title type='text'>An Engineer</title><content type='html'>An engineer is a person who can do for a dime what any fool can do for a dollar.&lt;br /&gt;
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-6832395771899321771?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6832395771899321771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6832395771899321771'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/04/engineer.html' title='An Engineer'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-6812268744599812631</id><published>2011-03-25T22:16:00.000-07:00</published><updated>2011-03-25T22:16:12.080-07:00</updated><title type='text'>Tapestry 5</title><content type='html'>The directions on &lt;a href="http://tapestry.apache.org/tapestry5/quickstart/"&gt;&lt;u&gt;this page&lt;/u&gt;&lt;/a&gt; are no good.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://tapestry.apache.org/getting-started.html"&gt;&lt;u&gt;These&lt;/u&gt;&lt;/a&gt; did work.&lt;br /&gt;
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-6812268744599812631?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6812268744599812631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6812268744599812631'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/03/tapestry-5.html' title='Tapestry 5'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-9082856105374767681</id><published>2011-03-25T21:06:00.000-07:00</published><updated>2011-03-27T08:33:39.553-07:00</updated><title type='text'>My Opinion</title><content type='html'>&lt;b&gt;Programming, it turns out, is hard.&lt;/b&gt;  &lt;i&gt;Eloquent Javascript by Marijn Haverbeke&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
My opinion: Programming, it turns out, is &lt;b&gt;not&lt;/b&gt; difficult but, it does take effort.&lt;br /&gt;
&lt;br /&gt;
With Bitnami stacks, that effort required to create a Java Web development environment is greatly reduced. &lt;br /&gt;
&lt;br /&gt;
It includes ready-to-run versions of Apache, Tomcat, MySQL and Java and required dependencies.  The process is simple - just download, click next-next-next and you are done!  It is completely self contained and will not interfere with other software on your system. &lt;br /&gt;
&lt;br /&gt;
Download from here:  &lt;a href="http://bitnami.org/stack/tomcatstack"&gt;&lt;u&gt;http://bitnami.org/stack/tomcatstack&lt;/u&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-9082856105374767681?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/9082856105374767681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/9082856105374767681'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/03/my-opinion.html' title='My Opinion'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-796714053051588290</id><published>2011-03-08T04:04:00.000-08:00</published><updated>2011-04-17T09:53:41.737-07:00</updated><title type='text'>Naked Objects</title><content type='html'>&lt;a href="http://confreaks.net/videos/469-rubyconf2010-putting-on-your-birthday-suit"&gt;&lt;u&gt;Naked Objects in Ruby&lt;/u&gt;&lt;/a&gt; by Glenn Vanderburg.  Must see TV!&lt;br /&gt;
&lt;br /&gt;
Glenn's presentation of &lt;a href="http://www.infoq.com/presentations/vanderburg-state-of-dsl-ruby"&gt;&lt;u&gt;DSLs in Ruby&lt;/u&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Glenn's &lt;a href="http://www.infoq.com/presentations/vanderburg-power-of-javascript"&gt;&lt;u&gt;The Power of Javascript&lt;/u&gt;&lt;/a&gt; presentation.&lt;br /&gt;
&lt;br /&gt;
Glenn's &lt;a href="http://lsrc2008.confreaks.com/17-glenn-vanderburg-tactical-design.html"&gt;&lt;u&gt;Tactical Design&lt;/u&gt;&lt;/a&gt; presentation. &lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-796714053051588290?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/796714053051588290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/796714053051588290'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/03/ruby-gems.html' title='Naked Objects'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-6722286922908619856</id><published>2011-02-19T20:36:00.000-08:00</published><updated>2011-03-05T20:10:19.885-08:00</updated><title type='text'>DeMarco</title><content type='html'>Kent Beck and Venkat Subramaniam are tweeting about how great &lt;a href='http://www2.computer.org/cms/Computer.org/ComputingNow/homepage/2009/0709/rW_SO_Viewpoints.pdf'&gt;&lt;u&gt;Tom DeMarco's mea culpa&lt;/u&gt;&lt;/a&gt; is. &lt;br /&gt;
&lt;br /&gt;
DeMarco says "software engineering is an idea whose time has come and gone" and explains that the specific practices that are understood to be what the term 'software engineering' means have little value when exercised in the common contexts in which software is developed today.&lt;br /&gt;
&lt;br /&gt;
Glenn Vanderburg gave an excellent &lt;a href='http://confreaks.net/videos/282-lsrc2010-real-software-engineering'&gt;&lt;u&gt;presentation&lt;/u&gt;&lt;/a&gt; in which he spoke for more than an hour about the evolution of 'software engineering' and never mentioned DeMarco.&lt;br /&gt;
&lt;br /&gt;
&lt;/br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-6722286922908619856?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6722286922908619856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6722286922908619856'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/02/demarco.html' title='DeMarco'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-1875478889332298091</id><published>2011-02-19T17:00:00.000-08:00</published><updated>2011-02-21T09:51:26.124-08:00</updated><title type='text'>Using Homebrew to Install Postgresql</title><content type='html'>&lt;div id='code'&gt;&lt;pre&gt;[greg:local] brew install postgresql
==&gt; Downloading ftp://ftp.ossp.org/pkg/lib/uuid/uuid-1.6.2.tar.gz
######################################################################## 100.0%
. . . &amp;lt;&amp;lt;many lines logged from the install process&gt;&gt;
Success. You can now start the database server using:

    postgres -D /usr/local/var/pg_data
or
    pg_ctl -D /usr/local/var/pg_data -l logfile start

[greg:local] pg_ctl -D /usr/local/var/pg_data -l /tmp/logfile start
[greg:local] createdb test
[greg:local] psql test
psql (9.0.3)
Type "help" for help.

test=# CREATE TABLE authors (id INT PRIMARY KEY, name VARCHAR);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "authors_pkey" for table "authors"
CREATE TABLE
test=# CREATE TABLE books (id INT PRIMARY KEY, title VARCHAR, pages INT);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "book_pkey" for table "book"
CREATE TABLE
test=# CREATE TABLE booksauthors (book_id INT, author_id INT);
CREATE TABLE
test=# INSERT INTO authors VALUES (1, 'Craig Walls');
INSERT 0 1
test=# INSERT INTO authors VALUES (2, 'Ryan Breidenbach');
INSERT 0 1
test=# CREATE TABLE booksauthors (book_id INT REFERENCES books(id), author_id INT REFERENCES authors(id));
CREATE TABLE
test=# INSERT INTO booksauthors VALUES (1,1), (1,2);
INSERT 0 2
test=# SELECT books.title, authors.name FROM books JOIN booksauthors ON books.id = booksauthors.book_id 
JOIN authors ON authors.id = booksauthors.author_id;
      title       |       name       
------------------+------------------
 Spring in Action | Craig Walls
 Spring in Action | Ryan Breidenbach
(2 rows)

test=#
\q
[greg:rails] rails new rails_and_pg --database postgresql
[greg:rails] cd rails_and_pg
[greg:rails_and_pg] mate .
[greg:rails_and_pg] bundle install
[greg:rails_and_pg] rake db:create:all
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
Starting and stopping Postgresql can be accomplished with these scripts: &lt;br /&gt;
&lt;div id='code'&gt;&lt;pre&gt;[greg:rails_and_pg] sudo launchctl load /Library/LaunchDaemons/org.postgresql.postgres.plist
Password:
org.postgresql.postgres: Already loaded
[greg:rails_and_pg] sudo launchctl unload /Library/LaunchDaemons/org.postgresql.postgres.plist
&lt;/pre&gt;&lt;/div&gt;After installing the PROJ and GEOS frameworks, PostGIS can be installed on Postgresql.  These are available from &lt;a href='http://www.kyngchaos.com/software/frameworks'&gt;&lt;u&gt;this site&lt;/u&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Then, to start PostGIS: &lt;br /&gt;
&lt;div id-'code'&gt;&lt;pre&gt;psql -d postgres -U postgres&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-1875478889332298091?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/1875478889332298091'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/1875478889332298091'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/02/using-homebrew-to-install-postgresql.html' title='Using Homebrew to Install Postgresql'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-2032269168213218013</id><published>2011-02-05T20:54:00.000-08:00</published><updated>2011-02-05T20:55:16.026-08:00</updated><title type='text'>IN-N-OUT Burger Coming Soon to Frisco TX</title><content type='html'>2800 Preston Rd.&lt;br /&gt;
Frisco, TX 75034&lt;br /&gt;
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-2032269168213218013?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/2032269168213218013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/2032269168213218013'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/02/in-n-out-burger-coming-soon-to-frisco.html' title='IN-N-OUT Burger Coming Soon to Frisco TX'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-7637609429465453224</id><published>2011-02-05T18:42:00.000-08:00</published><updated>2011-02-06T06:42:00.157-08:00</updated><title type='text'>SOLID Ruby</title><content type='html'>Sandi Metz's &lt;a href='http://confreaks.net/videos/240-goruco2009-solid-object-oriented-design'&gt;&lt;u&gt;presentation&lt;/u&gt;&lt;/a&gt; of Bob Martin's SOLID design principles for Ruby developers and her &lt;a href='http://skmetz.home.mindspring.com/img29.html'&gt;&lt;u&gt;slides&lt;/u&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Sandi used DI to setup her opportunity to mock the downloader.&lt;br /&gt;
&lt;div id='code'&gt;&lt;pre&gt;class PatentJOB 
  attr_reader :downloader

  def initialize(downloader = PatentDownloader.new)
    @downloader = downloader
  end

  def run 
    temp = downloader.download_file
  end
end
&lt;/pre&gt;&lt;/div&gt;&lt;div id='code'&gt;&lt;pre&gt;require 'tempfile'
class PatentDownloader
  def download_file 
    temp = Tempfile.new('patents')
    tempname = temp.path
    temp.close

    Net::FTP.open('localhost', 'foo', 'foopw') do |ftp|
      ftp.getbinaryfile('Public/prod/patents.csv', tempname)
    end
    tempname
  end 
end
&lt;/pre&gt;&lt;/div&gt;And she provides this YAML and a class that uses that YAML to create &lt;br /&gt;
&lt;div id='code'&gt;&lt;pre&gt;defaults: &amp;defaults 
  ftp_host:      localhost
  ftp_login:     foo
  ftp_password   foopw
  ftp_filename:  patents.csv
  ftp_path:      Public/test

test: 
  &lt;&lt;: *defaults

development:
  &lt;&lt;: *defaults

production:
  ftp_path:     Public/prod
  &lt;&lt;: *defaults
&lt;/pre&gt;
&lt;/div&gt;&lt;div id='code'&gt;&lt;pre&gt;class Config 
  attr_reader :data :env
  def self.config_path 
    file.join('config', 'external_resources')
  end

  def initialize(opts) 

  end 

  def define_methods_for_environment(names) 
    names.each do |name| 
      class_eval &lt;&lt;-EOS
        def #{name} 
          data[env]['#(name)']
        end
        EOS 
      end
    end
  end
&lt;/pre&gt;
&lt;/div&gt;And this allows us to refactor to more a loosely coupled design:
&lt;div id='code'&gt;&lt;pre&gt;require 'tempfile'
class PatentDownloader 
  attr_reader :config
  
  def initialize(config=Config.new(:filename =&gt; 'patent.yaml'))
    @config = config
  end

  def download_file
    temp = Tempfile.new(config.ftp_filename)
    tempname = temp.path
    temp.close

    Net::FTP.open(config.ftp_host, config.ftp_login, config.ftp_password) do |ftp|
      ftp.getbinaryfile(config.ftp_path, tempname)
    end
    tempname
  end
end
&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-7637609429465453224?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/7637609429465453224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/7637609429465453224'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/02/solid-ruby.html' title='SOLID Ruby'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-4414382562197832187</id><published>2011-02-05T16:29:00.000-08:00</published><updated>2011-07-05T20:27:01.905-07:00</updated><title type='text'>Hello JSF</title><content type='html'>I'll try to create a Hello World project using Maven 3 and JSF.&lt;br /&gt;
&lt;div id='code'&gt;&lt;pre&gt;[greg:mvnsrc] mvn archetype:generate -DarchetypeCatalog=http://myfaces.apache.org
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] &gt;&gt;&gt; maven-archetype-plugin:2.0:generate (default-cli) @ standalone-pom &gt;&gt;&gt;
[INFO] 
[INFO] &lt;&lt;&lt; maven-archetype-plugin:2.0:generate (default-cli) @ standalone-pom &lt;&lt;&lt;
[INFO] 
[INFO] --- maven-archetype-plugin:2.0:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: http://myfaces.apache.org -&gt; myfaces-archetype-helloworld (myfaces-archetype-helloworld)
2: http://myfaces.apache.org -&gt; myfaces-archetype-helloworld-facelets (myfaces-archetype-helloworld-facelets)
3: http://myfaces.apache.org -&gt; myfaces-archetype-helloworld-portlets (myfaces-archetype-helloworld-portlets)
4: http://myfaces.apache.org -&gt; myfaces-archetype-helloworld20 (myfaces-archetype-helloworld20)
5: http://myfaces.apache.org -&gt; myfaces-archetype-helloworld20-owb (myfaces-archetype-helloworld20-owb)
6: http://myfaces.apache.org -&gt; myfaces-archetype-jsfcomponents (myfaces-archetype-jsfcomponents)
7: http://myfaces.apache.org -&gt; myfaces-archetype-trinidad (myfaces-archetype-trinidad)
8: http://myfaces.apache.org -&gt; myfaces-archetype-trinidad20 (myfaces-archetype-trinidad20)
Choose a number: : 1
Downloading: http://myfaces.apache.org/org/apache/myfaces/buildtools/myfaces-archetype-helloworld/1.0.2/myfaces-archetype-helloworld-1.0.2.jar
Downloading: http://repo1.maven.org/maven2/org/apache/myfaces/buildtools/myfaces-archetype-helloworld/1.0.2/myfaces-archetype-helloworld-1.0.2.jar
Downloaded: http://repo1.maven.org/maven2/org/apache/myfaces/buildtools/myfaces-archetype-helloworld/1.0.2/myfaces-archetype-helloworld-1.0.2.jar
Downloading: http://myfaces.apache.org/org/apache/myfaces/buildtools/myfaces-archetype-helloworld/1.0.2/myfaces-archetype-helloworld-1.0.2.pom
Downloading: http://repo1.maven.org/maven2/org/apache/myfaces/buildtools/myfaces-archetype-helloworld/1.0.2/myfaces-archetype-helloworld-1.0.2.pom
Downloaded: http://repo1.maven.org/maven2/org/apache/myfaces/buildtools/myfaces-archetype-helloworld/1.0.2/myfaces-archetype-helloworld-1.0.2.pom
Define value for property 'groupId': : org.greg.helloworld
Define value for property 'artifactId': : firstJSF
Define value for property 'version':  1.0-SNAPSHOT: : 1.0
Define value for property 'package':  org.greg.helloworld: : 
Confirm properties configuration:
groupId: org.greg.helloworld
artifactId: firstJSF
version: 1.0
package: org.greg.helloworld
 Y: : 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:34.604s
[INFO] Finished at: Sat Feb 05 17:59:28 CST 2011
[INFO] Final Memory: 9M/81M
[INFO] ------------------------------------------------------------------------
[greg:mvnsrc] cd firstJSF
[greg:firstJSF] mvn clean package jetty:run -Djetty.port=8181
[greg:firstjsf] open http://localhost:8181/firstJSF
[greg:firstjsf] 
&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-4414382562197832187?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/4414382562197832187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/4414382562197832187'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/02/hello-jsf.html' title='Hello JSF'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-4968737272993541286</id><published>2011-01-30T17:25:00.000-08:00</published><updated>2011-01-30T17:25:34.179-08:00</updated><title type='text'>C++ Cookbook</title><content type='html'>I used the commands below to compile the first exercise in O'Reilly's C++ Cookbook.  The book provides the commands to compile and link for several different compilers.  I had difficulty finding the command to link to the dynamic library when creating the executable.  To compile a module with dependencies on the newly created dynamic library, use the highlighted command below. &lt;br /&gt;
&lt;br /&gt;
libjohnpaul.a is statically linked.  libgeorgeringo.dylib is dynamically linked.  In order for hellobeatles to run, libgeorgeringo.dylib must be copied into the same folder as the hellobeatles executable.  &lt;div id='code'&gt;&lt;pre&gt;[&lt;span style='color:#008000'&gt;greg:johnpaul&lt;/span&gt;] g++ -c -o john.o john.cpp
[&lt;span style='color:#008000'&gt;greg:johnpaul&lt;/span&gt;] g++ -c -o paul.o paul.cpp
[&lt;span style='color:#008000'&gt;greg:johnpaul&lt;/span&gt;] g++ -c -o johnpaul.o johnpaul.cpp
[&lt;span style='color:#008000'&gt;greg:johnpaul&lt;/span&gt;] ar ru libjohnpaul.a john.o paul.o johnpaul.o
[&lt;span style='color:#008000'&gt;greg:johnpaul&lt;/span&gt;] ranlib libjohnpaul.a
[&lt;span style='color:#008000'&gt;greg:johnpaul&lt;/span&gt;] cd ../georgeringo
[&lt;span style='color:#008000'&gt;greg:georgeringo&lt;/span&gt;] g++ -c -o george.o george.cpp
[&lt;span style='color:#008000'&gt;greg:georgeringo&lt;/span&gt;] g++ -c -o ringo.o ringo.cpp
[&lt;span style='color:#008000'&gt;greg:georgeringo&lt;/span&gt;] g++ -c -o georgeringo.o georgeringo.cpp
[&lt;span style='color:#008000'&gt;greg:georgeringo&lt;/span&gt;] g++ -dynamiclib -fPIC -o libgeorgeringo.dylib george.o ringo.o georgeringo.o
[&lt;span style='color:#008000'&gt;greg:georgeringo&lt;/span&gt;] cd ../hellobeatles
[&lt;span style='color:#008000'&gt;greg:hellobeatles&lt;/span&gt;] &lt;span style='color:#800000'&gt;g++ -c -I.. -o hellobeatles.o hellobeatles.cpp&lt;/span&gt;
[&lt;span style='color:#008000'&gt;greg:hellobeatles&lt;/span&gt;] g++ -o hellobeatles hellobeatles.o -L../johnpaul -L../georgeringo -ljohnpaul -lgeorgeringo
[&lt;span style='color:#008000'&gt;greg:hellobeatles&lt;/span&gt;] cp ../georgeringo/libgeorgeringo.dylib libgeorgeringo.dylib
[&lt;span style='color:#008000'&gt;greg:hellobeatles&lt;/span&gt;] ./hellobeatles
John, Paul, George, and Ringo
[&lt;span style='color:#008000'&gt;greg:hellobeatles&lt;/span&gt;] 
&lt;/pre&gt;&lt;/div&gt;The book, including the source for each Beatle, can be found &lt;a href='http://cpp-cookbook.info/O.Reilly-CPP.Cookbook/0596007612/ch01-20337.html'&gt;&lt;u&gt;online&lt;/u&gt;&lt;/a&gt;.  The online version has some significant differences with the PDF available from O'Reilly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-4968737272993541286?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/4968737272993541286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/4968737272993541286'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2011/01/c-cookbook.html' title='C++ Cookbook'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-3743150750283991464</id><published>2010-11-17T17:52:00.000-08:00</published><updated>2010-11-17T17:52:35.046-08:00</updated><title type='text'>Code Metrics</title><content type='html'>Transformative aspects of the &lt;a href='http://theagileexecutive.com/2010/10/28/the-nine-transformative-aspects-of-the-technical-debt-metric/'&gt;&lt;u&gt;technical debt metric&lt;/u&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-3743150750283991464?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/3743150750283991464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/3743150750283991464'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/11/code-metrics.html' title='Code Metrics'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-2141712503164697091</id><published>2010-11-15T18:53:00.000-08:00</published><updated>2010-11-15T19:12:12.960-08:00</updated><title type='text'>Scala in Stalled</title><content type='html'>A play on the Scala in Action title of the Manning book. :)&lt;br /&gt;
&lt;br /&gt;
I have started using Homebrew and it is pretty close to perfect.  The Scala install is the first issue I've had.&lt;br /&gt;
&lt;div id='code'&gt;&lt;pre&gt;[greg:local] brew install scala
==&gt; Downloading http://www.scala-lang.org/downloads/distrib/files/scala-2.8.1.final.tgz
######################################################################## 100.0%
/usr/local/Cellar/scala/2.8.1: 113 files, 22M, built in 2 seconds
[greg:local] scala
-bash: /opt/scala-2.7.5.final/bin/scala: No such file or directory
[greg:local] sudo scala
Password:
Welcome to Scala version 2.8.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_22).
Type in expressions to have them evaluated.
Type :help for more information.

scala&gt; 1 + 2
res0: Int = 3

scala&gt;&lt;/pre&gt;&lt;/div&gt;Now we know what makes it work and how to correct the issue: &lt;br /&gt;
&lt;div id='code'&gt;&lt;pre&gt;[greg:local] chmod 755 /usr/local/Cellar/scala/2.8.1/bin/*
[greg:local] scala
Welcome to Scala version 2.8.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_22).
Type in expressions to have them evaluated.
Type :help for more information.

scala&gt; 1 + 9
res0: Int = 10

scala&gt; val myList = new java.util.ArrayList[String]()
myList: java.util.ArrayList[String] = []

scala&gt; myList.add("Hello") 
res1: Boolean = true

scala&gt; myList.add("World")
res2: Boolean = true

scala&gt; myList
res3: java.util.ArrayList[String] = [Hello, World]

scala&gt; myList.&amp;lt;TAB&gt;

add              addAll           asInstanceOf     clear            clone            contains
containsAll      ensureCapacity   get              indexOf          isEmpty          isInstanceOf
iterator         lastIndexOf      listIterator     remove           removeAll        retainAll
set              size             subList          toArray          toString         trimToSize

scala&gt; 1.&amp;lt;TAB&gt;     

%              &amp;              *              +              -              /              &gt;
&gt;=             &gt;&gt;             &gt;&gt;&gt;            ^              asInstanceOf   isInstanceOf   toByte
toChar         toDouble       toFloat        toInt          toLong         toShort        toString
unary_+        unary_-        unary_~        |

scala&gt; 1.
&lt;/pre&gt;&lt;/div&gt;Enter the name of a variable and the dot operator and press TAB to list the object's methods.&lt;br /&gt;
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-2141712503164697091?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/2141712503164697091'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/2141712503164697091'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/11/scala-in-stalled.html' title='Scala in Stalled'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-1482077398479748853</id><published>2010-11-14T15:11:00.000-08:00</published><updated>2011-07-05T20:25:07.168-07:00</updated><title type='text'>Remember Jython?</title><content type='html'>&lt;h3&gt;TestClass.java&lt;/h3&gt;&lt;div id='code'&gt;&lt;pre&gt;import org.python.util.PythonInterpreter;
import org.python.core.*;

public class TestClass {

 public static void main(String[] args) {
  try {
   PythonInterpreter py = new PythonInterpreter(); 
   py.execfile(args[0]);
  } catch(Exception e) {
   e.printStackTrace();
  }
 }
}
&lt;/pre&gt;&lt;/div&gt;&lt;h3&gt;mypy.py&lt;/h3&gt;&lt;div id='code'&gt;&lt;pre&gt;print 'Hello, World'
&lt;/pre&gt;&lt;/div&gt;&lt;h3&gt;Terminal&lt;/h3&gt;&lt;div id='code'&gt;&lt;pre&gt;[greg:py] javac -cp .:${HOME}/dev/bin/jython2.5.2/jython.jar TestClass.java
[greg:py] java -cp .:/${HOME}/dev/bin/jython2.5.2/jython.jar TestClass mypy.py
Hello, World
[greg:py]
&lt;/pre&gt;&lt;/div&gt;&lt;h3&gt;Interactive Swing&lt;/h3&gt;Create a Swing UI Without Compiling&lt;br /&gt;
&lt;div id='code'&gt;&lt;pre&gt;[greg:local] jython
Jython 2.5.1 (Release_2_5_1:6813, Sep 26 2009, 13:47:54) 
[Java HotSpot(TM) 64-Bit Server VM (Apple Inc.)] on java1.6.0_22
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; print 'Hello, World'              
Hello, World
&gt;&gt;&gt; from javax.swing import JButton, JFrame
&gt;&gt;&gt; frame = JFrame('Hello Jython', defaultCloseOperation = JFrame.EXIT_ON_CLOSE, size=(300,300))
&gt;&gt;&gt; def change_text(event):
...    print 'Clicked!'
... 
&gt;&gt;&gt; button = JButton('Click Me', actionPerformed = change_text) 
&gt;&gt;&gt; frame.add(button)
javax.swing.JButton[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.5,border=com.apple.laf.AquaButtonBorder$Dynamic@32a6faa9,
flags=288,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,
margin=javax.swing.plaf.InsetsUIResource[top=0,left=2,bottom=0,right=2],paintBorder=true,paintFocus=true,
pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=Click Me,
defaultCapable=true]
&gt;&gt;&gt; frame.visible = True
&gt;&gt;&gt; [greg:local]
&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-1482077398479748853?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/1482077398479748853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/1482077398479748853'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/11/remember-jython.html' title='Remember Jython?'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-3737175835017305284</id><published>2010-11-10T23:07:00.000-08:00</published><updated>2010-11-11T14:42:41.967-08:00</updated><title type='text'>Gradle</title><content type='html'>Hibernate team has &lt;a href="http://community.jboss.org/wiki/Gradlewhy"&gt;&lt;u&gt;listed some compelling reasons&lt;/u&gt;&lt;/a&gt; to switch to Gradle.&lt;br /&gt;
&lt;/br&gt;&lt;/br&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-3737175835017305284?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/3737175835017305284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/3737175835017305284'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/11/gradle.html' title='Gradle'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-3179276879299550158</id><published>2010-11-09T17:29:00.000-08:00</published><updated>2010-11-09T17:55:06.156-08:00</updated><title type='text'>Metrics</title><content type='html'>The transformative power of &lt;a href='http://agile.dzone.com/news/nine-transformative-aspects'&gt;&lt;u&gt;identifying technical debt&lt;/u&gt;&lt;/a&gt;. &lt;br /&gt;
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-3179276879299550158?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/3179276879299550158'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/3179276879299550158'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/11/metrics.html' title='Metrics'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-5100096397410624242</id><published>2010-10-30T16:39:00.000-07:00</published><updated>2010-10-30T20:33:06.022-07:00</updated><title type='text'>Gray Hat Python</title><content type='html'>The book &lt;span style="font-weight:bold"&gt;Gray Hat Python&lt;/span&gt; is as cool a book as I've ever read. Instead of showing how Windows works from the ground up, the author, Justin Seitz, shows how to investigate and manipulate programs and components.  The book provides the details only when they are relevant to the problem at hand.&lt;br /&gt;
&lt;br /&gt;
Here are the purposes of the X86 registers: &lt;br /&gt;
EAX - the Accumulator stores return values from function calls and is used for calculations&lt;br /&gt;
EDX - the Data register is used in conjunction with EAX&lt;br /&gt;
ECX - the Count register is used in looping operations&lt;br /&gt;
ESI - the Source Index register is used in data operations&lt;br /&gt;
EDI - the Destination Index is also used in data operations&lt;br /&gt;
EBP - the stack base pointer&lt;br /&gt;
ESP - the stack pointer&lt;br /&gt;
EBX - has no specific purpose &lt;br /&gt;
DR0 thru DR7 are the hardware debug registers &lt;br /&gt;
&lt;br /&gt;
Hardware breakpoints use Interrupt 1 and software breakpoints use Interrupt 3.  Stepping through instructions is accomplished with Interrupt 1.&lt;br /&gt;
&lt;br /&gt;
The book provides knowledge of Windows security and how it is overcome and then goes on to provide the means to overcome malware with important tips like why it is important to use hardware breakpoints instead of soft breakpoints. &lt;br /&gt;
&lt;br /&gt;
Here's a surprising example:&lt;br /&gt;
&lt;div id='code'&gt;&lt;pre&gt;from ctypes import *
msvcrt = cdll.msvcrt
message = "1. Hello, World\n"
msvcrt.printf("Testing %s", message)

hello = c_char_p("2. Hello world")
print hello
print hello.value
&lt;/pre&gt;&lt;/div&gt;&lt;div id='code'&gt;&lt;pre&gt;c_char_p("2. Hello world")
2. Hello world
Testing 1. Hello, World
&lt;/pre&gt;&lt;/div&gt;The book is a very interesting way to learn some Python, Windows OS and APIs and X86 Assembler and how these pieces fit together to provide or circumvent computer security.  Nothing I've seen makes Windows come alive like this.&lt;br /&gt;
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-5100096397410624242?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/5100096397410624242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/5100096397410624242'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/10/gray-hat-python.html' title='Gray Hat Python'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-4827856970316541776</id><published>2010-09-27T16:31:00.000-07:00</published><updated>2010-09-27T16:35:21.603-07:00</updated><title type='text'>Open Source Integration</title><content type='html'>&lt;a href='http://techblog.zabuchy.net/2010/spring-hibernate-maven-struts2-integration-tutorial/'&gt;&lt;u&gt;Tutorial&lt;/u&gt;&lt;/a&gt; about Spring, Hibernate, Maven and Struts2 integration.  And a pretty well named blog.
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-4827856970316541776?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/4827856970316541776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/4827856970316541776'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/09/open-source-integration.html' title='Open Source Integration'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-7034467445998982502</id><published>2010-09-24T15:07:00.000-07:00</published><updated>2010-09-25T17:37:16.302-07:00</updated><title type='text'>SQL Server XML Support</title><content type='html'>I'm modifying an application that calls stored procedures which return XML.  Naturally, more than just the Java has to be modified.  I'm finding that I really enjoy working with SQL-Server, especially its more esoteric features.  My first attempt FAILED! but, with the help of Microsoft forums, the second attempt WORKED! 
&lt;br/&gt;&lt;br/&gt;I started with this:
&lt;div id='code'&gt;&lt;pre&gt;
SELECT 'Jon Stewart'       as "Employee/name",
       'home'              as "Employee/contact/phone/@type",
       '(555) 555-1212'    as "Employee/contact/phone",
       'cell'              as "Employee/contact/phone/@type",
       '(555) 555-1212'    as "Employee/contact/phone",
       '123 Main Street'   as "Employee/contact/street",
       null                as "Employee/contact/street2",
       'Dallas'            as "Employee/contact/city",
       'TX'                as "Employee/contact/state",
       '75025'             as "Employee/contact/zip"
FOR XML PATH('Employees'), ROOT('doc');
&lt;/pre&gt;&lt;/div&gt;which I thought would give me:&lt;div id='code'&gt;&lt;pre&gt;
&amp;lt;doc&gt;
  &amp;lt;Employees&gt;
    &amp;lt;Employee&gt;
      &amp;lt;name&gt;Jon Stewart&amp;lt;/name&gt;
      &amp;lt;contact&gt;
        &amp;lt;phone type="home"&gt;(555) 555-1212&amp;lt;/phone&gt;
        &amp;lt;phone type="cell"&gt;(555) 555-1212&amp;lt;/phone&gt;
        &amp;lt;street&gt;123 Main Street&amp;lt;/street&gt;
        &amp;lt;city&gt;Dallas&amp;lt;/city&gt;
        &amp;lt;state&gt;TX&amp;lt;/state&gt;
        &amp;lt;zip&gt;75025&amp;lt;/zip&gt;
      &amp;lt;/contact&gt;
    &amp;lt;/Employee&gt;
  &amp;lt;/Employees&gt;
&amp;lt;/doc&gt;
&lt;/pre&gt;&lt;/div&gt;but, the duplication of phone and phone/@type in the above SELECT statement resulted in an error and I had to use the following SELECT statement instead:&lt;div id='code'&gt;&lt;pre&gt;
SELECT 
  (SELECT 'Jon Stewart' as "name",
    (SELECT 
      (SELECT 
        'home' as "phone/@type",
        '(555) 555-1212' as "phone"
      FOR XML PATH(''),TYPE),
      (SELECT 
        'cell' as "phone/@type",
        '(555) 555-1212' as "phone"
      FOR XML PATH(''),TYPE),
      '123 Main Street' as "street",
      null as "street2",
      'Dallas' as "city",
      'TX' as "state",
      '75025' as "zip"
    FOR XML PATH('contact'), TYPE)
  FOR XML PATH('Employee'),TYPE)
FOR XML PATH ('Employees'),ROOT('doc')&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-7034467445998982502?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/7034467445998982502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/7034467445998982502'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/09/sql-server-xml-support.html' title='SQL Server XML Support'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-8096313332208607321</id><published>2010-09-22T16:01:00.000-07:00</published><updated>2010-09-22T16:25:57.762-07:00</updated><title type='text'>Monofesto</title><content type='html'>I've played around with C# and F# on the Mac through the use of &lt;a href='www.mono-project.com'&gt;&lt;u&gt;Mono&lt;/u&gt;&lt;/a&gt; (open-source .Net) and I saw that Mono could be used to run .Net on the iPhone but yet another surprise has been unveiled.  A web framework, &lt;a href='http://github.com/jacksonh/manos/blob/master/docs/tutorial/page-1.md'&gt;&lt;u&gt;Manos de Mono&lt;/u&gt;&lt;/a&gt; 
has been announced in this &lt;a href='http://jacksonh.tumblr.com/post/1159500924/manos-de-mono-the-manifesto'&gt;&lt;u&gt;Monofesto&lt;/u&gt;&lt;/a&gt;.
&lt;br/&gt;&lt;br/&gt;
I believe a new Mac will be needed for this.
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-8096313332208607321?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/8096313332208607321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/8096313332208607321'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/09/monofesto.html' title='Monofesto'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-6301619486132245858</id><published>2010-09-20T16:58:00.000-07:00</published><updated>2010-09-21T20:16:06.411-07:00</updated><title type='text'>Best Job Ever</title><content type='html'>I have the best job ever: home by 4:30, working with both Java and Microsoft technology, clean legacy code, consistent and sophisticated change management and deployment. 
&lt;br/&gt;&lt;br/&gt;
At my previous employer the code isn't as nice.  They have a Java architect who wrote this code and had to have it explained twice what change was needed and why:
&lt;div id='code'&gt;&lt;pre&gt;
    try {
        resultset.close();
        statement.close();
        conn.close();
    } catch ...
&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-6301619486132245858?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6301619486132245858'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6301619486132245858'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/09/best-job-ever.html' title='Best Job Ever'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-5731838394824174633</id><published>2010-09-07T08:26:00.000-07:00</published><updated>2010-09-07T23:29:54.109-07:00</updated><title type='text'>OSGi for Low Coupling and High Cohesion</title><content type='html'>Cohesion is an internal metric of a module’s focus.  Coupling is an external metric of the degree to which each program module relies on other modules.  The benefits of low coupling are (1.) little change is required to an application when a module is replaced with another and (2.) changes within a module do not effect other modules in the application.  
&lt;br/&gt;&lt;br/&gt;

Both Java and OSGi originally focused on small hardware devices.  Java's attraction came from its promise "write once, run anywhere" which appealed to hardware vendors but, it was soon found that in Java applications dependencies were difficult to sort out, especially in regards to the classpath.  Often it was found that different versions of the same jar were needed by different parts of the application.  In short, jars are not a complete solution for providing modularity for Java applications.  
&lt;br/&gt;&lt;br/&gt;

OSGi is designed as a universal integration platform for the interoperability of applications and services.  OSGi makes it possible for different components of an application to depend on different versions of a jar.  
&lt;br/&gt;&lt;br/&gt;

The use case of an application consuming services provided through OSGi requires both the consumer and the provider publish manifests.  The manifest required is, in most ways, a standard jar manifest stored in the jar as META-INF/MANIFEST.MF.  The jar which provides the service will export the package(s) in which the Java classes are found with a statement in the jar's manifest such as &lt;span style='font-weight:bold'&gt;Export-Package: com.company.search&lt;/span&gt;.  This statement only effects the Java components registered in the OSGi registry.  It exposes all the public classes in the package.
&lt;br/&gt;&lt;br/&gt;

The manifest in the jar file of the consumer will have an import like &lt;span style='font-weight:bold'&gt;Import-Package: com.company.search&lt;/span&gt;.  This statement imports all the public classes in the package. 
&lt;br/&gt;&lt;br/&gt;

Below I have created a MessagePrinter function that consumes messages produced by the HelloGoodbyeProducer.  There are three modules, the activator, the producer and the consumer; each module is a separate project created in its own folder.
&lt;div id='code'&gt;&lt;pre&gt;package com.activator;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;

import com.producer.HelloGoodbyeProducer;
import com.producer.impl.HelloGoodbyeImpl;
import com.consumer.MessagePrinterService;
import com.consumer.impl.MessagePrinterServiceImpl;

public class HelloWorldActivator implements BundleActivator {

    public void start(BundleContext context) throws Exception {
        HelloGoodbyeProducer producer = getHelloGoodbyeProducer(context);
        MessagePrinterService printer = getMessagePrinter(context);
        printer.printMessage(producer.getHelloMessage());
    }

    public void stop(BundleContext context) throws Exception {
        HelloGoodbyeProducer producer = getHelloGoodbyeProducer(context);
        MessagePrinterService printer = getMessagePrinter(context); 
        printer.printMessage(producer.getGoodbyeMessage());
    }

    private HelloGoodbyeProducer getHelloGoodbyeProducer(BundleContext context) {
        ServiceRegistration reg = 
            context.registerService(HelloGoodbyeProducer.class.getName(), new HelloGoodbyeImpl(), null);
        HelloGoodbyeProducer producer = (HelloGoodbyeProducer) context.getService(reg.getReference());
        return producer;
    }

    private MessagePrinterService getMessagePrinter(BundleContext context) {
        ServiceRegistration reg = 
            context.registerService(MessagePrinterService.class.getName(), new MessagePrinterServiceImpl(), null);
        MessagePrinterService printer = (MessagePrinterService) context.getService(reg.getReference());
        return printer;
    }
}&lt;/pre&gt;&lt;/div&gt;

&lt;div id='code'&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;src/META-INF/MANIFEST.MF&lt;/h3&gt;
&lt;div id='code'&gt;&lt;pre&gt;Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: HelloActivator
Bundle-SymbolicName: com.activator.HelloWorldActivator
Bundle-Version: 1.0.3
Bundle-Activator: com.activator.HelloWorldActivator
Import-Package: com.producer, com.producer.impl, com.consumer, com.consumer.impl, org.osgi.framework 
&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;ANT build.xml for the Activator&lt;/h3&gt;
&lt;div id='code'&gt;&lt;pre&gt;&amp;lt;project name="activator" default="jar" basedir="."&gt;

    &amp;lt;property name="src.dir"           location="src"/&gt; 
    &amp;lt;property name="build.dir"         location="bin"/&gt;
    &amp;lt;property name="target.dir"        location="target"/&gt;
    &amp;lt;property name="osgi.dir"          location="${user.home}/dev/bin/equinox-sdk-3"/&gt;
    &amp;lt;property name="consumer.jar"      value="../consumer/target/consumer.jar"/&gt;
    &amp;lt;property name="producer.jar"      value="../producer/target/producer.jar"/&gt;
    &amp;lt;property name="manifest"          location="${build.dir}/META-INF/MANIFEST.MF"/&gt;

    &amp;lt;path id="classpath"&gt;
        &amp;lt;pathelement location="${build.dir}"/&gt;
        &amp;lt;pathelement location="${osgi.dir}/plugins/org.eclipse.osgi_3.5.2.R35x_v20100126.jar"/&gt;
        &amp;lt;pathelement location="${consumer.jar}"/&gt;
        &amp;lt;pathelement location="${producer.jar}"/&gt;
    &amp;lt;/path&gt;

    &amp;lt;target name="clean"&gt;
        &amp;lt;delete dir="${build.dir}"/&gt;
        &amp;lt;delete dir="${target.dir}"/&gt;
    &amp;lt;/target&gt;

    &amp;lt;target name="init" depends="clean"&gt;
        &amp;lt;mkdir dir="${build.dir}"/&gt;
        &amp;lt;mkdir dir="${target.dir}"/&gt;
    &amp;lt;/target&gt;

    &amp;lt;target name="compile" depends="init"&gt;
        &amp;lt;javac srcdir="${src.dir}" 
            destdir="${build.dir}" 
            classpathref="classpath"/&gt;
        &amp;lt;copy file="src/META-INF/MANIFEST.MF" todir="${build.dir}/META-INF"/&gt;
    &amp;lt;/target&gt;

    &amp;lt;target name="jar" depends="compile"&gt;
       &amp;lt;jar jarfile="${target.dir}/${ant.project.name}.jar" 
            basedir="${build.dir}" manifest="${manifest}"/&gt;
    &amp;lt;/target&gt;
&amp;lt;/project&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Java Code for the Message Producer&lt;/h3&gt;
&lt;div id='code'&gt;&lt;pre&gt;package com.producer; 

public interface HelloGoodbyeProducer {
   String getHelloMessage();

   String getGoodbyeMessage();
}&lt;/pre&gt;&lt;/div&gt;
&lt;div id='code'&gt;&lt;pre&gt;package com.producer.impl; 
import com.producer.HelloGoodbyeProducer;

public class HelloGoodbyeImpl implements HelloGoodbyeProducer { 
    
    public String getHelloMessage() {
        return "Hello World!"; 
    }
    
    public String getGoodbyeMessage() { 
        return "Goodbye World!";
    }
}&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;src/META-INF/MANIFEST.MF&lt;/h3&gt;
&lt;div id='code'&gt;&lt;pre&gt;Manifest-Version: 1.0 
Bundle-ManifestVersion: 2 
Bundle-Name: HelloGoodbye
Bundle-SymbolicName: com.producer.HelloGoodbyeProducer
Bundle-Version: 1.0.3
Bundle-Activator: com.activator.HelloWorldActivator
Export-Package: com.producer, com.producer.impl&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;ANT build.xml for the Producer&lt;/h3&gt;
&lt;div id='code'&gt;&lt;pre&gt;&amp;lt;project name="producer" default="jar" basedir="."&gt;

    &amp;lt;property name="src.dir"           location="src"/&gt; 
    &amp;lt;property name="build.dir"         location="bin"/&gt;
    &amp;lt;property name="target.dir"        location="target"/&gt;
    &amp;lt;property name="manifest"          location="${build.dir}/META-INF/MANIFEST.MF"/&gt;

    &amp;lt;path id="classpath"&gt;
        &amp;lt;pathelement location="${build.dir}"/&gt;
    &amp;lt;/path&gt;

    &amp;lt;target name="clean"&gt;
        &amp;lt;delete dir="${build.dir}"/&gt;
        &amp;lt;delete dir="${target.dir}"/&gt;
    &amp;lt;/target&gt;

    &amp;lt;target name="init" depends="clean"&gt;
        &amp;lt;mkdir dir="${build.dir}"/&gt;
        &amp;lt;mkdir dir="${target.dir}"/&gt;
    &amp;lt;/target&gt;

    &amp;lt;target name="compile" depends="init"&gt;
        &amp;lt;javac srcdir="${src.dir}" 
            destdir="${build.dir}" 
            classpathref="classpath"/&gt;
        &amp;lt;copy file="src/META-INF/MANIFEST.MF" todir="${build.dir}/META-INF"/&gt;
    &amp;lt;/target&gt;

    &amp;lt;target name="jar" depends="compile"&gt;
       &amp;lt;jar jarfile="${target.dir}/${ant.project.name}.jar" 
            basedir="${build.dir}" manifest="${manifest}"/&gt;
     &amp;lt;/target&gt;
&amp;lt;/project&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Java Code for the Consumer&lt;/h3&gt;
&lt;div id='code'&gt;&lt;pre&gt;package com.consumer; 

public interface MessagePrinterService {
   public void printMessage(String message);
}&lt;/pre&gt;&lt;/div&gt;
&lt;div id='code'&gt;&lt;pre&gt;package com.consumer.impl; 
import com.consumer.MessagePrinterService;

public class MessagePrinterServiceImpl implements MessagePrinterService {
    public void printMessage(String message) {
        System.out.println(message);
    }
}&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;src/META-INF/MANIFEST.MF&lt;/h3&gt;&lt;div id='code'&gt;&lt;pre&gt;Manifest-Version: 1.0 
Bundle-ManifestVersion: 2 
Bundle-Name: HelloGoodbye
Bundle-SymbolicName: com.producer.HelloGoodbyeProducer
Bundle-Version: 1.0.3
Bundle-Activator: com.activator.HelloWorldActivator
Export-Package: com.producer, com.producer.impl&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;build.xml for the Consumer&lt;/h3&gt;&lt;div id='code'&gt;&lt;pre&gt;&amp;lt;project name="consumer" default="jar" basedir="."&gt;
    
    &amp;lt;property name="src.dir"           location="src"/&gt; 
    &amp;lt;property name="build.dir"         location="bin"/&gt;
    &amp;lt;property name="target.dir"        location="target"/&gt;
    &amp;lt;property name="manifest"          location="${build.dir}/META-INF/MANIFEST.MF"/&gt;

    &amp;lt;path id="classpath"&gt;
        &amp;lt;pathelement location="${build.dir}"/&gt;
    &amp;lt;/path&gt;

    &amp;lt;target name="clean"&gt;
        &amp;lt;delete dir="${build.dir}"/&gt;
        &amp;lt;delete dir="${target.dir}"/&gt;
    &amp;lt;/target&gt;

    &amp;lt;target name="init" depends="clean"&gt;
        &amp;lt;mkdir dir="${build.dir}"/&gt;
        &amp;lt;mkdir dir="${target.dir}"/&gt;
    &amp;lt;/target&gt;

    &amp;lt;target name="compile" depends="init"&gt;
        &amp;lt;javac srcdir="${src.dir}" 
            destdir="${build.dir}" 
            classpathref="classpath"/&gt;
        &amp;lt;copy file="src/META-INF/MANIFEST.MF" todir="${build.dir}/META-INF"/&gt;
    &amp;lt;/target&gt;

    &amp;lt;target name="jar" depends="compile"&gt;
       &amp;lt;jar jarfile="${target.dir}/${ant.project.name}.jar" 
            basedir="${build.dir}" manifest="${manifest}"/&gt;
     &amp;lt;/target&gt;
&amp;lt;/project&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;It's Showtime!&lt;/h3&gt;
&lt;div id='code'&gt;&lt;pre&gt;[greg:equinox-SDK-3] java -jar plugins/org.eclipse.osgi_3.5.2.R35x_v20100126.jar -console

osgi&gt; ss

Framework is launched.

id     State       Bundle
0      ACTIVE      org.eclipse.osgi_3.5.2.R35x_v20100126

osgi&gt; install file:producer.jar
Bundle id is 4

osgi&gt; install file:consumer.jar
Bundle id is 5

osgi&gt; install file:activator.jar
Bundle id is 6

osgi&gt; ss

Framework is launched.

id     State       Bundle
0      ACTIVE      org.eclipse.osgi_3.5.2.R35x_v20100126
4      RESOLVED    com.producer.HelloGoodbyeProducer_1.0.3
5      RESOLVED    com.consumer.MessagePrinterService_1.0.3
6      RESOLVED    com.activator.HelloWorldActivator_1.0.3

osgi&gt; start 6
Hello World!

osgi&gt; stop 6
Goodbye World!

osgi&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-5731838394824174633?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/5731838394824174633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/5731838394824174633'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/09/osgi-for-low-coupling-and-high-cohesion.html' title='OSGi for Low Coupling and High Cohesion'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-699024290530214252</id><published>2010-09-02T14:42:00.000-07:00</published><updated>2010-09-02T14:46:36.119-07:00</updated><title type='text'>Charity</title><content type='html'>Almost forty percent of U.S. households made donations for Haiti this year.
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-699024290530214252?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/699024290530214252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/699024290530214252'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/09/charity.html' title='Charity'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-6942578974216106361</id><published>2010-08-31T08:13:00.000-07:00</published><updated>2010-08-31T18:21:24.395-07:00</updated><title type='text'>Getting to Know Threads</title><content type='html'>Threads have six possible states:&lt;br/&gt;
new, runnable, blocked, waiting, timed waiting, terminated
&lt;br/&gt;&lt;br/&gt;

A thread terminates when its &lt;b&gt;run()&lt;/b&gt; method returns.
&lt;br/&gt;&lt;br/&gt;

&lt;b&gt;interrupt()&lt;/b&gt; can interrupt a thread (or, it may cause a SecurityException to be thrown).   If the thread is in a non-blocked status, it can call &lt;b&gt;Thread.getCurrentThread().isInterrupted()&lt;/b&gt; to check if interrupt has been called.  If the thread is in a blocked status such as sleep, another thread's call to &lt;b&gt;interrupt()&lt;/b&gt; will cause an InterruptedException which will cause the thread to exit sleep or wait.
&lt;br/&gt;&lt;br/&gt;

The functionality of the &lt;b&gt;synchronized&lt;/b&gt; keyword has been extended with &lt;b&gt;java.util.concurrent.locks.Lock&lt;/b&gt;.
&lt;br/&gt;&lt;br/&gt;

Below is code which shows two means of creating threads.  The code performs the simplest use case for threads, no shared state. 
&lt;div id='code'&gt;&lt;pre&gt;public class Main extends Thread {
    
    public Main(String name) {
        super(name);
    }
    
    public static void main(String[] args) throws Exception {
        Main m = new Main("1st");
        m.start(); 
        
        new Thread(new Runnable() {
            @Override
            public void run() {
                for (int x = 0; x &lt; 5; x++) { 
                    System.out.println("Runnable:  name=" + Thread.currentThread().getName() + ": x=" + x);
                    try { 
                        sleep(10);
                    } catch(InterruptedException e) {
                        System.out.println("Runnable interrupted");
                    }
                }
            }
        }, "2nd").start();
    }
    
    @Override
    public void run() {
        for (int x = 0; x &lt; 5; x++) { 
            System.out.println("Thread:    name=" + Thread.currentThread().getName() + ": x=" + x);
            try { 
                sleep(10);
            } catch(InterruptedException e) {
                System.out.println("Thread interrupted");
            }
        }
    } 
}&lt;/pre&gt;&lt;/div&gt;
&lt;div id='code'&gt;&lt;pre&gt;&amp;lt;project name="java_concurrency" default="run" basedir="."&gt;
    &amp;lt;property name="src.dir"           location="src/main/java"/&gt; 
    &amp;lt;property name="test.src.dir"      location="src/test/java"/&gt;
    &amp;lt;property name="build.dir"         location="build"/&gt;
    &amp;lt;property name="classes.dir"       location="build/classes"/&gt;
    &amp;lt;property name="tests.dir"         location="build/tests"/&gt;
    &amp;lt;property name="junit.jar"         location="lib/junit/junit-4.8.2.jar"/&gt;
    &amp;lt;path id="compile.classpath"&gt;
        &amp;lt;pathelement location="${classes.dir}"/&gt;
    &amp;lt;/path&gt;

    &amp;lt;path id="test.classpath"&gt;
        &amp;lt;pathelement location="${classes.dir}"/&gt;
        &amp;lt;pathelement location="${junit.jar}"/&gt;
        &amp;lt;pathelement location="${tests.dir}"/&gt;
    &amp;lt;/path&gt;
    
    &amp;lt;path id="run.classpath"&gt;
        &amp;lt;pathelement location="${classes.dir}"/&gt;
    &amp;lt;/path&gt;

    &amp;lt;target name="clean"&gt;
        &amp;lt;delete dir="${build.dir}"/&gt;
    &amp;lt;/target&gt;

    &amp;lt;target name="init" depends="clean"&gt;
        &amp;lt;mkdir dir="${classes.dir}"/&gt;
        &amp;lt;mkdir dir="${tests.dir}"/&gt;
    &amp;lt;/target&gt;

    &amp;lt;target name="compile" depends="init"&gt;
        &amp;lt;javac srcdir="${src.dir}" 
            destdir="${classes.dir}" 
            classpathref="compile.classpath"/&gt;
        &amp;lt;javac srcdir="${test.src.dir}" 
            destdir="${tests.dir}" 
            classpathref="test.classpath"/&gt;
    &amp;lt;/target&gt;
  
    &amp;lt;target name="test" depends="compile"&gt;
        &amp;lt;junit fork="yes" printsummary="yes"&gt;
            &amp;lt;classpath refid="test.classpath"/&gt;
            &amp;lt;formatter type="plain" usefile="false"/&gt;
            &amp;lt;test name="MainTest"/&gt;
        &amp;lt;/junit&gt;
    &amp;lt;/target&gt;
    
    &amp;lt;target name="run" depends="compile"&gt;
        &amp;lt;java fork="true" dir="${classes.dir}" classname="Main" classpathref="run.classpath"/&gt;
    &amp;lt;/target&gt; 
&amp;lt;/project&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div id='code'&gt;&lt;pre&gt;[greg:java_concurrency] ant
. . . 
run:
     [java] Runnable:  name=2nd: x=0
     [java] Thread:    name=1st: x=0
     [java] Runnable:  name=2nd: x=1
     [java] Thread:    name=1st: x=1
     [java] Runnable:  name=2nd: x=2
     [java] Thread:    name=1st: x=2
     [java] Runnable:  name=2nd: x=3
     [java] Thread:    name=1st: x=3
     [java] Runnable:  name=2nd: x=4
     [java] Thread:    name=1st: x=4
[greg:java_concurrency]&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-6942578974216106361?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6942578974216106361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6942578974216106361'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/08/getting-to-know-threads.html' title='Getting to Know Threads'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-6155171044615721818</id><published>2010-08-30T06:37:00.000-07:00</published><updated>2010-08-30T07:04:43.774-07:00</updated><title type='text'>Magic for Rails</title><content type='html'>No, this magic is not a new gem, just a solution for updating Rails 3.&lt;br/&gt;&lt;br/&gt;

My Rubygems failed when I tried to update Rails to Rails 3 this morning.  I found that running &lt;b&gt;sudo gem cleanup&lt;/b&gt; did all that was necessary for the Rails 3 update to run successfully. &lt;br/&gt;&lt;br/&gt;

See the &lt;u&gt;&lt;a href='http://railstutorial.org/book'&gt;Ruby on Rails 3 Tutorial&lt;/a&gt;&lt;/u&gt; for information on the new version of the framework.
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-6155171044615721818?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6155171044615721818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6155171044615721818'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/08/magic-for-rails.html' title='Magic for Rails'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-354664648356126072</id><published>2010-08-28T13:49:00.000-07:00</published><updated>2010-08-29T14:34:29.482-07:00</updated><title type='text'>JUnit, DateFormat, Calendar and ANT</title><content type='html'>It is not necessary to test Java's DateFormat class but, as a means of verifying our knowledge, this code does just that. 
&lt;h3&gt;DateAndTimeFormattingTest.java&lt;/h3&gt;
&lt;div id='code'&gt;&lt;pre&gt;import java.text.DateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Date;
import org.junit.*;
import static org.junit.Assert.*;

public class DateAndTimeFormattingTest {
    DateFormat dateOnly = DateFormat.getDateInstance(DateFormat.MEDIUM);
    DateFormat dateAndTime = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);
 
    @Test 
    public void testDateOnly() {
        Calendar cal = new GregorianCalendar(2010, 11, 31);
        Date date = cal.getTime();
        assertEquals("Dec 31, 2010", dateOnly.format(date));
    }
 
    @Test 
    public void testDateAndTime() {
        Calendar cal = new GregorianCalendar(2010, 11, 31);
        Date date = cal.getTime();
        assertEquals("Dec 31, 2010 12:00:00 AM", dateAndTime.format(date));
    }
}&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;build.xml&lt;/h3&gt;
&lt;div id='code'&gt;&lt;pre&gt;&amp;lt;project name="calendar_test" default="test" basedir="."&gt;
    &amp;lt;property name="src.dir"       location="src/main/java"/&gt; 
    &amp;lt;property name="test.src.dir"  location="src/test/java"/&gt;
    &amp;lt;property name="build.dir"     location="build"/&gt;
    &amp;lt;property name="classes.dir"   location="build/classes"/&gt;
    &amp;lt;property name="tests.dir"     location="build/tests"/&gt;
    &amp;lt;property name="reports.dir"   location="build/reports"/&gt;
    &amp;lt;property name="junit.lib"     location="lib/junit/junit-4.8.2.jar"/&gt;
    &amp;lt;path id="classpath"&gt;
        &amp;lt;pathelement location="${classes.dir}"/&gt;
    &amp;lt;/path&gt;

    &amp;lt;path id="test.classpath"&gt;
        &amp;lt;pathelement path="${classpath}"/&gt;
        &amp;lt;pathelement location="${junit.lib}"/&gt;
        &amp;lt;pathelement location="${tests.dir}"/&gt;
    &amp;lt;/path&gt;

    &amp;lt;target name="clean"&gt;
        &amp;lt;delete dir="${build.dir}"/&gt;
    &amp;lt;/target&gt;

    &amp;lt;target name="init" depends="clean"&gt;
        &amp;lt;mkdir dir="${classes.dir}"/&gt;
        &amp;lt;mkdir dir="${tests.dir}"/&gt;
        &amp;lt;mkdir dir="${reports.dir}"/&gt;
    &amp;lt;/target&gt;

    &amp;lt;target name="compile" depends="init"&gt;
        &amp;lt;javac srcdir="${src.dir}" 
             destdir="${classes.dir}" 
             classpathref="classpath"/&gt;
        &amp;lt;javac srcdir="${test.src.dir}" 
             destdir="${tests.dir}" 
             classpathref="test.classpath"/&gt;
    &amp;lt;/target&gt;
  
    &amp;lt;target name="test" depends="compile"&gt;
        &amp;lt;junit fork="yes" printsummary="yes"&gt;
            &amp;lt;classpath refid="test.classpath"/&gt;
            &amp;lt;formatter type="plain" usefile="false"/&gt;
            &amp;lt;test name="DateAndTimeFormattingTest"/&gt;
        &amp;lt;/junit&gt;
    &amp;lt;/target&gt;

&amp;lt;/project&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Running ANT&lt;/h3&gt;
&lt;div id='code'&gt;&lt;pre&gt;[greg:DateAndTimeFormattingTest] ant
Buildfile: build.xml

clean:
   [delete] Deleting directory /Users/greghelton/dev/src/java/DateAndTimeFormattingTest/build

init:
    [mkdir] Created dir: /Users/greghelton/dev/src/java/DateAndTimeFormattingTest/build/classes
    [mkdir] Created dir: /Users/greghelton/dev/src/java/DateAndTimeFormattingTest/build/tests
    [mkdir] Created dir: /Users/greghelton/dev/src/java/DateAndTimeFormattingTest/build/reports

compile:
    [javac] Compiling 1 source file to /Users/greghelton/dev/src/java/DateAndTimeFormattingTest/build/tests

test:
    [junit] Running DateAndTimeFormattingTest
    [junit] Testsuite: DateAndTimeFormattingTest
    [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 0.023 sec
    [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 0.023 sec
    [junit] 
    [junit] Testcase: testDateOnly took 0.009 sec
    [junit] Testcase: testDateAndTime took 0 sec

BUILD SUCCESSFUL
Total time: 1 second
[greg:DateAndTimeFormattingTest] &lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-354664648356126072?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/354664648356126072'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/354664648356126072'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/08/junit-dateformat-calendar-and-ant.html' title='JUnit, DateFormat, Calendar and ANT'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-4164670242351791514</id><published>2010-08-17T11:58:00.000-07:00</published><updated>2010-08-19T05:44:53.752-07:00</updated><title type='text'>Erlang, RabbitMQ and Spring</title><content type='html'>Erlang was selected for use as the development language for RabbitMQ because of its &lt;u&gt;&lt;a href='http://www.infoq.com/news/2010/03/amqp_support_spring_integration'&gt;excellent threading and multicore capabilities&lt;/a&gt;&lt;/u&gt;.  &lt;u&gt;&lt;a href='http://blog.springsource.com/2010/04/13/springsource-acquires-rabbitmq/'&gt;SpringSource acquired&lt;/a&gt;&lt;/u&gt; RabbitMQ in April 2010 for incorporation into &lt;u&gt;&lt;a href='http://www.springsource.org/spring-integration'&gt;Spring Integration&lt;/a&gt;&lt;/u&gt;.
&lt;p&gt;
After installing Erlang, save the following code in a file named 'math1.erl':
&lt;div id="code"&gt;&lt;pre&gt;-module(math1).
-export([factorial/1]).

factorial(0) -&gt; 1;
factorial(N) -&gt; N * factorial(N-1).&lt;/pre&gt;&lt;/div&gt;

Start the Erlang console, compile the module and run the function:
&lt;div id="code"&gt;&lt;pre&gt;[greg:erlang] erl
1&gt; c(math1.erl).                  
{ok,math1}
2&gt; math1:factorial(25).
15511210043330985984000000
3&gt; &lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Setup RabbitMQ&lt;/h3&gt;
Once Erlang works, you can run RabbitMQ.  After downloading and extracting the archive, I created 'log', 'mnesia' and 'config' folders in my rabbitmq_server folder and then set these environment variables.
&lt;div id="code"&gt;&lt;pre&gt;export RABBIT=/bin/rabbitmq_server-1.8.1
export RABBITMQ_MNESIA_BASE=$RABBIT/mnesia
export RABBITMQ_LOG_BASE=$RABBIT/log
export RABBITMQ_NODENAME=gregs
export RABBITMQ_NODE_IP_ADDRESS=0.0.0.0
export RABBITMQ_NODE_PORT=5672
export RABBITMQ_CLUSTER_CONFIG_FILE=$RABBIT/config/rabbitmq_cluster.config
export RABBITMQ_CONFIG_FILE=$RABBIT/config/rabbitmq&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Run RabbitMQ&lt;/h3&gt;
&lt;div id="code"&gt;&lt;pre&gt;[greg:rabbitmq_server-1.8.1] ./sbin/rabbitmq-server&lt;/pre&gt;&lt;/div&gt;&lt;h3&gt;Client Code&lt;/h3&gt;
Examples of Groovy clients using the RabbitMQ server are shown &lt;u&gt;&lt;a href='http://ndpar.blogspot.com/2010/03/get-started-with-rabbitmq.html'&gt;here&lt;/a&gt;&lt;/u&gt;. &lt;br/&gt;&lt;br/&gt;
Java client code is explained &lt;u&gt;&lt;a href='http://static.springsource.org/spring-integration/reference/htmlsingle/spring-integration-reference.html#message-interface'&gt;here&lt;/a&gt;&lt;/u&gt;. 
&lt;h3&gt;Running the Included LoanBroker Example&lt;/h3&gt;
&lt;div id="code"&gt;&lt;pre&gt;[greg:~] cd spring-integration-2.0.0.M6/samples/loanbroker 
[greg:loan-broker] mvn compile
[greg:loan-broker] mvn test
. . . 
INFO : org.springframework.integration.samples.loanbroker.demo.LoanBrokerSharkDetectorDemo - 
********* Best Quote: 
====== Loan Quote =====
Lender: StubBank-13
Loan amount: $253,664
Quote Date: Wed Aug 18 08:44:37 CDT 2010
Expiration Date: Sat Sep 11 08:44:37 CDT 2010
Term: 19 years
Rate: 5.130192%
=======================

INFO : org.springframework.integration.samples.loanbroker.stubs.CreditBureauStub - Credit Score: 797
INFO : org.springframework.integration.samples.loanbroker.demo.LoanBrokerSharkDetectorDemo - 
********* All Quotes: 
INFO : org.springframework.integration.samples.loanbroker.demo.LoanBrokerSharkDetectorDemo - 
====== Loan Quote =====
Lender: StubBank-0
Loan amount: $272,807
Quote Date: Wed Aug 18 08:44:37 CDT 2010
Expiration Date: Mon Aug 23 08:44:37 CDT 2010
Term: 19 years
Rate: 5.1708126%
=======================
. . .&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-4164670242351791514?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/4164670242351791514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/4164670242351791514'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/08/erlang.html' title='Erlang, RabbitMQ and Spring'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-309850794478676293</id><published>2010-08-15T20:15:00.000-07:00</published><updated>2010-09-17T19:17:58.334-07:00</updated><title type='text'>GRASP Patterns</title><content type='html'>&lt;h3&gt;GRASP Patterns&lt;/h3&gt;
&lt;ol&gt;&lt;b&gt;*&lt;/b&gt;&amp;nbsp;Information Expert - assign a responsibility to the class that has the information necessary to complete the responsibility&lt;/ol&gt;
&lt;ol&gt;&lt;b&gt;*&lt;/b&gt;&amp;nbsp;Controller - assign the responsibility for handling a system message to a class that represents the overall system or represents a use case&lt;/ol&gt;
&lt;ol&gt;&lt;b&gt;*&lt;/b&gt;&amp;nbsp;Creator - assign the responsibility to create A to B if B aggregates, contains or closely uses A&lt;/ol&gt;
&lt;ol&gt;&lt;b&gt;*&lt;/b&gt;&amp;nbsp;Low Coupling - assign a responsibility so that coupling remains low&lt;/ol&gt;
&lt;ol&gt;&lt;b&gt;*&lt;/b&gt;&amp;nbsp;High Cohesion - assign a responsibility so that cohesion remains high&lt;/ol&gt;
&lt;ol&gt;&lt;b&gt;*&lt;/b&gt;&amp;nbsp;Polymorphism - use when related behaviors vary by type&lt;/ol&gt;
&lt;ol&gt;&lt;b&gt;*&lt;/b&gt;&amp;nbsp;Indirection - assign a responsibility to an intermediate object to mediate between components&lt;/ol&gt;
&lt;ol&gt;&lt;b&gt;*&lt;/b&gt;&amp;nbsp;Pure Fabrication - assign a highly cohesive set of responsibilities to a class that does not represent a domain concept&lt;/ol&gt;
&lt;ol&gt;&lt;b&gt;*&lt;/b&gt;&amp;nbsp;Protected Variations - identify points of predicted variation and create a stable interface around them&lt;/ol&gt;

I originally thought it was a shame that the principles of high cohesion and low coupling had to be explicitly listed as design patterns.  I suppose that at some point Mr. Larman had to direct a student to apply what he had learned to the benefit of his code. 

&lt;h3&gt;7 Wastes of Software Development&lt;/h3&gt;
Mary and Tom Poppendieck identified these seven wastes:
&lt;ol&gt;&lt;b&gt;*&lt;/b&gt;&amp;nbsp;Partially Done Work&lt;/ol&gt;
&lt;ol&gt;&lt;b&gt;*&lt;/b&gt;&amp;nbsp;Extra Features&lt;/ol&gt;
&lt;ol&gt;&lt;b&gt;*&lt;/b&gt;&amp;nbsp;Relearning&lt;/ol&gt;
&lt;ol&gt;&lt;b&gt;*&lt;/b&gt;&amp;nbsp;Handoffs&lt;/ol&gt;
&lt;ol&gt;&lt;b&gt;*&lt;/b&gt;&amp;nbsp;Delays&lt;/ol&gt;
&lt;ol&gt;&lt;b&gt;*&lt;/b&gt;&amp;nbsp;Task Switching&lt;/ol&gt;
&lt;ol&gt;&lt;b&gt;*&lt;/b&gt;&amp;nbsp;Defects&lt;/ol&gt;

Does it all boil down to "Think Globally, Act Locally"?
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-309850794478676293?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/309850794478676293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/309850794478676293'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/08/grasp-patterns.html' title='GRASP Patterns'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-946192928998367710</id><published>2010-08-13T06:30:00.001-07:00</published><updated>2010-08-13T06:31:52.642-07:00</updated><title type='text'>Spring Framework API JavaDoc</title><content type='html'>&lt;u&gt;&lt;a href='http://www.jarvana.com/jarvana/view/org/apache/xbean/xbean-spring/3.0.1/xbean-spring-3.0.1-javadoc.jar!/index.html'&gt;Spring Framework API JavaDoc&lt;/a&gt;&lt;/u&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-946192928998367710?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/946192928998367710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/946192928998367710'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/08/spring-framework-api-javadoc.html' title='Spring Framework API JavaDoc'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-4446761611815966932</id><published>2010-08-06T16:46:00.000-07:00</published><updated>2010-08-07T10:50:09.268-07:00</updated><title type='text'>So Long IronRuby</title><content type='html'>Microsoft has done a good job with languages but that seems to be &lt;u&gt;&lt;a href='http://blog.jimmy.schementi.com/2010/08/start-spreading-news-future-of-jimmy.html'&gt;changing&lt;/a&gt;&lt;/u&gt;.  A former Microsoft employee talks about the evolution of Ruby on .Net, "Overall, I see a serious lack of commitment to IronRuby, and dynamic language on .NET in general.  IronRuby’s IDE support in Visual Studio hasn’t been released yet." 
&lt;br/&gt;&lt;br/&gt;
I wonder what this means for F#?
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-4446761611815966932?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/4446761611815966932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/4446761611815966932'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/08/so-long-ironruby.html' title='So Long IronRuby'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-7658754503905933345</id><published>2010-08-06T12:45:00.000-07:00</published><updated>2010-08-15T06:36:07.555-07:00</updated><title type='text'>Refactoring</title><content type='html'>A poorly designed system is hard to change.  Hard because it is hard to figure out where the changes are needed.&lt;br/&gt;
&lt;i&gt;Refactoring&lt;/i&gt; by Martin Fowler
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-7658754503905933345?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/7658754503905933345'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/7658754503905933345'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/08/refactoring.html' title='Refactoring'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-5177320944118928688</id><published>2010-08-05T16:31:00.000-07:00</published><updated>2010-08-06T15:14:52.380-07:00</updated><title type='text'>Jetty and ANT</title><content type='html'>&lt;div id='code'&gt;&lt;pre&gt;&amp;lt;project name="beers" default="war" basedir="."&gt;
 &amp;lt;property name="src"       location="src/main/java"/&gt; 
 &amp;lt;property name="test.src"  location="src/test/java"/&gt;
 &amp;lt;property name="classes"   location="build/classes"/&gt;
 &amp;lt;property name="tests"     location="build/tests"/&gt;
 &amp;lt;property name="jetty"     location="../jetty-6.1.25/lib"/&gt;
 &amp;lt;property name="warfile"   value="beers.war"/&gt;
 &amp;lt;property name="server.webapps.dir" location="..\jetty-6.1.25\webapps"/&gt;
 
  &amp;lt;path id="classpath"&gt;
      &amp;lt;pathelement location="${classes}"/&gt;
      &amp;lt;fileset dir="${jetty}" includes="**/*.jar"/&gt;
  &amp;lt;/path&gt;

  &amp;lt;path id="test.classpath"&gt;
      &amp;lt;pathelement path="${classpath}"/&gt;
      &amp;lt;pathelement location="lib/junit/junit-4.8.2.jar"/&gt;
      &amp;lt;pathelement path="${tests}"/&gt;
  &amp;lt;/path&gt;

  &amp;lt;target name="clean"&gt;
      &amp;lt;delete dir="build"/&gt;
  &amp;lt;/target&gt;
 
  &amp;lt;target name="init" depends="clean"&gt;
      &amp;lt;mkdir dir="${classes}"/&gt;
      &amp;lt;mkdir dir="${tests}"/&gt;
  &amp;lt;/target&gt;

  &amp;lt;target name="compile" depends="init"&gt;
      &amp;lt;javac srcdir="${src}" 
        destdir="${classes}" classpathref="classpath"/&gt;
      &amp;lt;javac srcdir="${test.src}" 
        destdir="${tests}" classpathref="test.classpath"/&gt;
  &amp;lt;/target&gt;
  
  &amp;lt;target name="war" depends="compile"&gt;
      &amp;lt;war destfile="${warfile}" webxml="src/metadata/web.xml"&gt;
          &amp;lt;fileset dir="src/jsp"/&gt;
          &amp;lt;lib dir="lib"/&gt;
          &amp;lt;classes dir="build/classes"/&gt;
      &amp;lt;/war&gt;
      &amp;lt;copy file="${warfile}" todir="${server.webapps.dir}"/&gt;
  &amp;lt;/target&gt;

&amp;lt;/project&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;br/&gt;
Jetty is started by the command:&lt;div id='code'&gt;&lt;pre&gt;C:\path-to-jetty\jetty-6.1.25&gt;java -jar start.jar&lt;/pre&gt;&lt;/div&gt;
&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-5177320944118928688?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/5177320944118928688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/5177320944118928688'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/08/i-can-always-count-on-jetty.html' title='Jetty and ANT'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-864509148707496203</id><published>2010-08-05T13:18:00.000-07:00</published><updated>2010-09-19T07:03:35.895-07:00</updated><title type='text'>JRuby</title><content type='html'>Reading the Pragmatic Programmers' RSpec and JRuby books simultaneously. 
&lt;br/&gt;&lt;br/&gt;
&lt;u&gt;&lt;a href='http://spin.atomicobject.com/2010/02/01/running-a-ruby-application-with-jruby-complete'&gt;JRuby Complete&lt;/a&gt;&lt;/u&gt; looks like a winner. 
&lt;br/&gt;&lt;br/&gt;
As does this free, &lt;a href='http://ruby.runpaint.org/'&gt;&lt;u&gt;online book&lt;/u&gt;&lt;/a&gt; about Ruby 1.9.
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-864509148707496203?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/864509148707496203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/864509148707496203'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/08/jruby.html' title='JRuby'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-5605003456580445368</id><published>2010-08-04T14:03:00.000-07:00</published><updated>2010-08-04T14:49:24.531-07:00</updated><title type='text'>Lax Website Security</title><content type='html'>A large sampling of websites' authentication and password security implemented with &lt;u&gt;&lt;a href='http://en.wikipedia.org/wiki/Cryptographic_hash_function'&gt;cryptographic hashes&lt;/a&gt;&lt;/u&gt;, &lt;u&gt;&lt;a href='http://en.wikipedia.org/wiki/Salt_(cryptography)'&gt;salting&lt;/a&gt;&lt;/u&gt; and TLS (&lt;u&gt;&lt;a href='http://en.wikipedia.org/wiki/Transport_Layer_Security'&gt;Transport Layer Security&lt;/a&gt;&lt;/u&gt;) is the subject of this &lt;u&gt;&lt;a href='http://www.jroller.com/sebastianKuebeck/entry/study_password_practices_in_the'&gt;blog post&lt;/a&gt;&lt;/u&gt;.
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-5605003456580445368?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/5605003456580445368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/5605003456580445368'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/08/lax-website-security.html' title='Lax Website Security'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-5678476426144163779</id><published>2010-08-03T17:14:00.000-07:00</published><updated>2010-08-03T17:23:05.502-07:00</updated><title type='text'>Call Me Proficient</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_nsKvsU8iqd0/TFiywuHd_8I/AAAAAAAAAC0/mc6TnrmCUXM/s1600/Java+Test+Proficiency.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 314px; height: 320px;" src="http://2.bp.blogspot.com/_nsKvsU8iqd0/TFiywuHd_8I/AAAAAAAAAC0/mc6TnrmCUXM/s320/Java+Test+Proficiency.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5501343494915882946" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-5678476426144163779?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/5678476426144163779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/5678476426144163779'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/08/call-me-proficient.html' title='Call Me Proficient'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_nsKvsU8iqd0/TFiywuHd_8I/AAAAAAAAAC0/mc6TnrmCUXM/s72-c/Java+Test+Proficiency.png' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-2851970450557403809</id><published>2010-08-01T14:34:00.000-07:00</published><updated>2010-08-01T15:18:06.583-07:00</updated><title type='text'>GRAPE</title><content type='html'>GRAPE, the '&lt;u&gt;&lt;a href='http://groovy.codehaus.org/Grape'&gt;Groovy Adaptable Packaging Engine&lt;/a&gt;&lt;/u&gt;' allows an application's dependencies to be specified in the code or as arguments on the command line and, at runtime, the dependencies will be downloaded and added to the application's classloader.
&lt;br/&gt;&lt;br/&gt;
An &lt;u&gt;&lt;a href='http://lexecorp.com/2010/07/28/persistently-groovy/'&gt;example&lt;/a&gt;&lt;/u&gt; of Groovy, Hibernate (not GORM), HSQL and SLF4J. 
&lt;br/&gt;&lt;br/&gt;
The following example is from the GRAPE homepage.
&lt;br/&gt;&lt;br/&gt;
&lt;div id='code'&gt;&lt;pre&gt;import org.mortbay.jetty.Server
import org.mortbay.jetty.servlet.*
import groovy.servlet.*

@Grab(group = 'org.mortbay.jetty', module = 'jetty-embedded', version = '6.1.0')
def runServer(duration) {
    def server = new Server(8080)
    def context = new Context(server, "/", Context.SESSIONS);
    context.resourceBase = "."
    context.addServlet(TemplateServlet, "*.gsp")
    server.start()
    sleep duration
    server.stop()
}

runServer(10000)&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-2851970450557403809?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/2851970450557403809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/2851970450557403809'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/08/grape.html' title='GRAPE'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-6008293551285035992</id><published>2010-07-28T06:10:00.000-07:00</published><updated>2010-07-28T06:11:21.562-07:00</updated><title type='text'>Online Programming Books</title><content type='html'>&lt;u&gt;&lt;a href="http://suicidalpanda.com/books"&gt;Online Programming Books&lt;/a&gt;&lt;/u&gt;
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-6008293551285035992?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6008293551285035992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6008293551285035992'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/07/online-programming-books.html' title='Online Programming Books'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-8721680022239514106</id><published>2010-07-22T18:03:00.000-07:00</published><updated>2010-07-22T18:06:39.848-07:00</updated><title type='text'>CSS Zen Garden</title><content type='html'>&lt;a href="http://csszengarden.com/?cssfile=http://www.brucelawson.co.uk/zen/sample.css"&gt;&lt;u&gt;1996 Geocities.&lt;/u&gt;&lt;/a&gt;   What a hoot.
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-8721680022239514106?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/8721680022239514106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/8721680022239514106'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/07/css-zen-garden.html' title='CSS Zen Garden'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-2110649664147268513</id><published>2010-07-13T09:31:00.000-07:00</published><updated>2010-08-18T21:27:28.027-07:00</updated><title type='text'>Dependency Inversion Principle</title><content type='html'>&lt;i&gt;"traditional software development methods, such as Structured Analysis and Design, tend to create software structures in which high level modules depend upon low level modules, and in which abstractions depend upon details."&lt;/i&gt; Robert C Martin, &lt;u&gt;&lt;a href="http://www.objectmentor.com/resources/articles/ocp.pdf"&gt;'The Dependency Inversion Principle'&lt;/a&gt;&lt;/u&gt;, C++ Report, 1996
&lt;br/&gt;&lt;br/&gt;
Top-Down design causes developers to create code in which high level business rules depend on low level functions like IO.  This means the business functionality is not reusable because it is coupled to the IO functionality.
&lt;br/&gt;&lt;br/&gt;
Adding conditional statements so that the business function can use one set of IO routines in one case and another set in a second case soon this becomes difficult to manage.  This strategy of modifying code to make it dependent on even more low level routines violates another principle, &lt;u&gt;&lt;a href='http://www.objectmentor.com/resources/articles/ocp.pdf'&gt;the Open Closed Principle&lt;/a&gt;&lt;/u&gt; which Mr. Martin also wrote about. 
&lt;br/&gt;&lt;br/&gt;
Of course, any number of people will say that one design is as good as another, that it is okay to duplicate the business logic and couple the new copy to a different set of low level components.  Unfortunately, it is rare that one person can change the mind of another as evidenced by today's news: &lt;i&gt;Researchers at the University of Michigan found that when misinformed people were exposed to facts, they rarely changed their minds and they often became even more strongly set in their beliefs.&lt;/i&gt;
&lt;br/&gt;&lt;br/&gt;
This phenomenon was commented on by Darwin in 1871:  
&lt;br/&gt;
&lt;i&gt;Ignorance more frequently begets confidence than does knowledge&lt;/i&gt;
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-2110649664147268513?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/2110649664147268513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/2110649664147268513'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/07/dependency-inversion-principle.html' title='Dependency Inversion Principle'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-7007976995608877541</id><published>2010-07-09T14:00:00.000-07:00</published><updated>2010-07-09T18:42:04.187-07:00</updated><title type='text'>Loading a Clojure Script</title><content type='html'>Create &lt;span style='font-weight:bold'&gt;hello.clj&lt;/span&gt;
&lt;div id='code'&gt;&lt;pre&gt;(defn hello 
   "Writes hello message to *out*. Calls you by username" 
   [username] 
   (println (str "Hello, " username)))&lt;/pre&gt;&lt;/div&gt;
Run the Clojure script from within the Clojure REPL by executing the following: 
&lt;div id='code'&gt;&lt;pre&gt;java -cp .:clojure.jar:clojure-contrib.jar:jline-0.9.94.jar jline.ConsoleRunner clojure.main
Clojure 1.2.0-master-SNAPSHOT
user=&gt; (load-file "hello.clj")
#'user/hello
user=&gt; (hello 'Greg)
Hello, Greg
nil
user=&gt; &lt;/pre&gt;&lt;/div&gt;

A similar but different alternative. 
&lt;div id='code'&gt;&lt;pre&gt;(defn hello 
 "Displays hello message as function result" 
 [username] 
 (str "Hello, " username " and goodbye ")
)&lt;/pre&gt;&lt;/div&gt;

&lt;div id='code'&gt;&lt;pre&gt;user=&gt; (load-file "hello.clj")
#'user/hello
user=&gt; (hello "Greg")         
"Hello, Greg and goodbye "
user=&gt; &lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-7007976995608877541?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/7007976995608877541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/7007976995608877541'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/07/loading-clojure-script.html' title='Loading a Clojure Script'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-5395839517049930898</id><published>2010-07-06T19:51:00.000-07:00</published><updated>2010-07-06T19:53:11.827-07:00</updated><title type='text'>Cheat Sheet Roundup</title><content type='html'>&lt;u&gt;&lt;a href="http://www.smashingmagazine.com/2006/10/30/cheat-sheet-round-up-ajax-css-latex-ruby/"&gt;from Smashing Magazine&lt;/a&gt;&lt;/u&gt;
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-5395839517049930898?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/5395839517049930898'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/5395839517049930898'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/07/cheat-sheet-roundup.html' title='Cheat Sheet Roundup'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-8406563657268437243</id><published>2010-07-02T07:54:00.000-07:00</published><updated>2010-07-06T20:32:24.947-07:00</updated><title type='text'>Yellowstone</title><content type='html'>&lt;u&gt;&lt;a href="http://www.facebook.com/album.php?aid=5223&amp;id=100001261383361"&gt;Yellowstone Trip&lt;/a&gt;&lt;/u&gt; photos
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-8406563657268437243?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/8406563657268437243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/8406563657268437243'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/07/yellowstone.html' title='Yellowstone'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-7559198950359782132</id><published>2010-05-29T17:18:00.000-07:00</published><updated>2010-08-12T22:41:02.746-07:00</updated><title type='text'>Wiring Spring Beans</title><content type='html'>Spring in Action (3rd edition) by Craig Walls is superb.  (&lt;a href="http://www.springsource.org/documentation"&gt;&lt;u&gt;Spring's documentation&lt;/u&gt;&lt;/a&gt; is also eminently practical.)  In this article, I take Craig's example of a knight, a minstrel and a quest for the holy grail and extend it in order to get a little practice wiring beans together.

&lt;br/&gt;&lt;br/&gt;
I took the example from the first chapter of Spring in Action and added the class QuestExpedition to separate the behavior of how the quest is achieved from the quest as an objective or goal.  One design being better than the other would depend on the ubiquitous language of the domain driven design.  As I envision it, the personnel participating in the quest and the itinerary belong to a separate concern.  I created QuestExpedition to encapsulate such concerns.  

&lt;br/&gt;&lt;br/&gt;
In Craig's code, the knight knows upon which quest he is embarked.  In real life a knight would know the details of a quest on which he might embark but, in software, we only model the required behavior of the application, not real life.  I removed the Knight.embarkOnQuest() method because it only calls Quest.embark().  In my application, I have the QuestExpedition embark rather than have the Knight embark. 
&lt;h4&gt;QuestApp.java&lt;/h4&gt;
&lt;div id="code"&gt;&lt;pre&gt;import org.springframework.context.ApplicationContext; 
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class QuestApp { 
  public static void main(String[] args) {
    ApplicationContext ctx = new ClassPathXmlApplicationContext("beans.xml");
    QuestExpedition expedition = (QuestExpedition)ctx.getBean("expedition");
    expedition.embark();
    expedition.reportStatus();
  }
}
&lt;/pre&gt;&lt;/div&gt;
&lt;h4&gt;QuestExpedition.java&lt;/h4&gt;
&lt;div id="code"&gt;&lt;pre&gt;import java.util.*; 

public class QuestExpedition {
  Quest quest;
  List&lt;Knight&gt; knights;
  List&lt;Minstrel&gt; minstrels;
  List&lt;String&gt; destinations;
 
  public void embark() {
    System.out.println(toString());
  }
 
  public void setQuest(Quest quest) {this.quest = quest;}
  public void setKnights(List&lt;Knight&gt; knights) {this.knights = knights;}
  public void setMinstrels(List&lt;Minstrel&gt; minstrels) {this.minstrels = minstrels;}
  public void setDestinations(List&lt;String&gt; destinations) {this.destinations = destinations;}
 
  public void reportStatus() {
    for (Minstrel m : minstrels) 
      for (Knight k : knights) 
        m.praiseKnight(k, quest); 
  }
 
  @Override
  public String toString() { 
    String comma = "";
    StringBuilder sb = new StringBuilder(); 
    sb.append("Embarking on quest to " + quest.toString());
    sb.append("\n with Knights: ");
    for (Knight k : knights) {  
      sb.append(comma + k.toString());
      comma = ", ";
    }
    sb.append("\n and with Minstrels: ");
    comma = "";
    for (Minstrel m : minstrels) {  
      sb.append(comma + m.toString());
      comma = ", ";
    }
    sb.append("\n Itinerary: ");
    comma = "";
    for (String dest : destinations) {
      sb.append(comma + dest);
      comma = ", ";
    }
    return sb.toString();
  }
}
&lt;/pre&gt;&lt;/div&gt;
&lt;h4&gt;beans.xml&lt;/h4&gt;
&lt;div id="code"&gt;&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&gt; 

&amp;lt;beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd"&gt; 

  &amp;lt;bean id="expedition" class="QuestExpedition"&gt;
   &amp;lt;property name="quest" ref="quest"/&gt;
   &amp;lt;property name="knights"&gt;
    &amp;lt;list&gt;
     &amp;lt;ref bean="count"/&gt;
     &amp;lt;ref bean="duke"/&gt;
     &amp;lt;ref bean="earl"/&gt;
    &amp;lt;/list&gt;
   &amp;lt;/property&gt;
   &amp;lt;property name="minstrels"&gt;
    &amp;lt;list&gt;
     &amp;lt;ref bean="troubadour"/&gt;
    &amp;lt;/list&gt;
   &amp;lt;/property&gt;
   &amp;lt;property name="destinations"&gt;
    &amp;lt;list&gt;
     &amp;lt;value&gt;Rome&amp;lt;/value&gt;
     &amp;lt;value&gt;Crete&amp;lt;/value&gt;
     &amp;lt;value&gt;Malta&amp;lt;/value&gt;
    &amp;lt;/list&gt;
   &amp;lt;/property&gt;
  &amp;lt;/bean&gt;
  
  &amp;lt;bean id="quest" class="SlayDragonQuest"&gt;
   &amp;lt;constructor-arg value="Puff" /&gt;
  &amp;lt;/bean&gt;
  &amp;lt;bean id="count" class="Knight"&gt;
   &amp;lt;constructor-arg value="Count" /&gt;
   &amp;lt;constructor-arg value="Chuck" /&gt;
  &amp;lt;/bean&gt;
  &amp;lt;bean id="duke" class="Knight"&gt;
   &amp;lt;constructor-arg value="Duke" /&gt;
   &amp;lt;constructor-arg value="Danny" /&gt;
  &amp;lt;/bean&gt;
  &amp;lt;bean id="earl" class="Knight"&gt;
   &amp;lt;constructor-arg value="Earl" /&gt;
   &amp;lt;constructor-arg value="Earle" /&gt;
  &amp;lt;/bean&gt;
  &amp;lt;bean id="troubadour" class="Minstrel"&gt;
   &amp;lt;constructor-arg value="Troubadour" /&gt;
   &amp;lt;constructor-arg value="Steve" /&gt;
  &amp;lt;/bean&gt;
&amp;lt;/beans&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h4&gt;Quest.java&lt;/h4&gt;
&lt;div id="code"&gt;&lt;pre&gt;public abstract class Quest {
  String name;
  String description;
  @Override
  public String toString() {
    return description + " " + name;
  }
}
&lt;/pre&gt;&lt;/div&gt;
&lt;h4&gt;HolyGrailQuest.java&lt;/h4&gt;
&lt;div id="code"&gt;&lt;pre&gt;public class HolyGrailQuest extends Quest {
  HolyGrailQuest(String name) {
    this.name = name;
    this.description = "find and acquire the grail"; 
  }
}
&lt;/pre&gt;&lt;/div&gt;
&lt;h4&gt;RescueDamselQuest.java&lt;/h4&gt;
&lt;div id="code"&gt;&lt;pre&gt;public class RescueDamselQuest extends Quest {
  RescueDamselQuest(String name) {
    this.name = name;
    this.description = "rescue the damsel";
  }
}
&lt;/pre&gt;&lt;/div&gt;
&lt;h4&gt;SlayDragonQuest.java&lt;/h4&gt;
&lt;div id="code"&gt;&lt;pre&gt;public class SlayDragonQuest extends Quest {
  SlayDragonQuest(String name) {
    this.name = name;
    this.description = "slay the dragon";
  }
}
&lt;/pre&gt;&lt;/div&gt;
&lt;h4&gt;Person.java&lt;/h4&gt;
&lt;div id="code"&gt;&lt;pre&gt;public class Person {
  final private String name;
  final private String honorific;
  Person(String honorific, String name) {
    this.name = name;
    this.honorific = honorific;
  }
  @Override
  public String toString() {
    return honorific + " " + name;
  }
}
&lt;/pre&gt;&lt;/div&gt;
&lt;h4&gt;Minstrel.java&lt;/h4&gt;
&lt;div id="code"&gt;&lt;pre&gt;public class Minstrel extends Person {
  Minstrel(String honorific, String name) {
    super(honorific, name); 
  }
  public void praiseKnight(Knight knight, Quest quest) {
    System.out.println("Bold " + knight.toString() + " pledged himself to " + quest.toString());
  }
}
&lt;/pre&gt;&lt;/div&gt;
&lt;h4&gt;Knight.java&lt;/h4&gt;
&lt;div id="code"&gt;&lt;pre&gt;public class Knight extends Person { 
  Knight(String honorific, String name) {
    super(honorific, name);
  }
}
&lt;/pre&gt;&lt;/div&gt;
&lt;h4&gt;ANT build.xml&lt;/h4&gt;
&lt;div id="code"&gt;&lt;pre&gt;&amp;lt;project name="GrailsQuest" default="run" basedir="."&gt;
 &amp;lt;property name="src"       location="src/main/java"/&gt; 
 &amp;lt;property name="test.src"  location="src/test/java"/&gt;
 &amp;lt;property name="build"     location="build/classes"/&gt;
 &amp;lt;property name="tests"     location="build/tests"/&gt;
 &amp;lt;property name="spring"    location="${user.home}/dev/lib/spring-framework-3"/&gt;
 
  &amp;lt;path id="classpath"&gt;
    &amp;lt;pathelement location="${build}"/&gt;
    &amp;lt;fileset dir="${spring}" includes="**/*.jar"/&gt;
  &amp;lt;/path&gt;

  &amp;lt;path id="test.classpath"&gt;
    &amp;lt;pathelement path="${classpath}"/&gt;
    &amp;lt;pathelement location="${user.home}/dev/lib/junit/junit-4.6.jar"/&gt;
    &amp;lt;pathelement path="${build}"/&gt;
    &amp;lt;pathelement path="${tests}"/&gt;
  &amp;lt;/path&gt;

  &amp;lt;target name="clean"&gt;
    &amp;lt;delete dir="${build}"/&gt;
  &amp;lt;/target&gt;
 
  &amp;lt;target name="init" depends="clean"&gt;
    &amp;lt;mkdir dir="${build}"/&gt;
    &amp;lt;mkdir dir="${tests}"/&gt;
  &amp;lt;/target&gt;

  &amp;lt;target name="compile" depends="init"&gt;
      &amp;lt;javac srcdir="${src}" 
             destdir="${build}" classpathref="classpath"/&gt;
    &amp;lt;javac srcdir="${test.src}" 
            destdir="${tests}" classpathref="test.classpath"/&gt;
  &amp;lt;/target&gt;

  &amp;lt;target name="run" depends="compile"&gt;
    &amp;lt;java classname="QuestApp"&gt;
      &amp;lt;classpath&gt;&amp;lt;path refid="classpath"/&gt;&amp;lt;/classpath&gt;
    &amp;lt;/java&gt;
  &amp;lt;/target&gt;
&amp;lt;/project&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h4&gt;Running the ANT Command for the Project&lt;/h4&gt;
&lt;div id="code"&gt;&lt;pre&gt;[greg:Quest] ant
. . .
     [java] Embarking on quest to slay the dragon Puff
     [java]   with Knights: Count Chuck, Duke Danny, Earl Earle
     [java]   and with Minstrels: Troubadour Steve
     [java]   Itinerary: Rome, Crete, Malta
     [java] Bold Count Chuck pledged himself to slay the dragon Puff
     [java] Bold Duke Danny pledged himself to slay the dragon Puff
     [java] Bold Earl Earle pledged himself to slay the dragon Puff

BUILD SUCCESSFUL
Total time: 5 seconds
&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-7559198950359782132?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/7559198950359782132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/7559198950359782132'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/05/wiring-spring-beans.html' title='Wiring Spring Beans'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-1779680777579380990</id><published>2010-05-22T15:50:00.000-07:00</published><updated>2010-05-22T15:51:17.917-07:00</updated><title type='text'>ADHD</title><content type='html'>Scientists at the University of Montreal and Harvard University have found a connection between exposure to organophosphate pesticides, at levels common among US children, and increased risk of Attention-Deficit Hyperactivity Disorder.
&lt;br/&gt;&lt;br/&gt;
Prevalence of ADHD varies among states, with Colorado having the lowest rate at 5% and Alabama having the highest rate of 11.1%.
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-1779680777579380990?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/1779680777579380990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/1779680777579380990'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/05/adhd.html' title='ADHD'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-6312983989234316342</id><published>2010-05-18T17:54:00.000-07:00</published><updated>2010-05-19T10:08:03.725-07:00</updated><title type='text'>Hudson Continuous Integration</title><content type='html'>&lt;h3&gt;Start with Subversion&lt;/h3&gt;
Create a temporary project structure: 
&lt;div id="code"&gt;&lt;pre&gt;[greg:~] mkdir /tmp/taxi /tmp/taxi/trunk /tmp/taxi/branches /tmp/taxi/tags&lt;/pre&gt;&lt;/div&gt;

Import the temporary project structure then delete it and switch to the source folder:
&lt;div id="code"&gt;&lt;pre&gt;[greg:~] svnadmin create /Library/Subversion/Repository/taxi 
[greg:~] svn import /tmp/taxi file:///Library/Subversion/Repository/taxi -m 'initial import'
Adding         /tmp/taxi/trunk
Adding         /tmp/taxi/branches
Adding         /tmp/taxi/tags

Committed revision 1.
[greg:~] rm -rf /tmp/taxi
[greg:~] cd dev/src/java/taxi
[greg:taxi] cd ..&lt;/pre&gt;&lt;/div&gt;

Checkout the empty project:
&lt;div id="code"&gt;&lt;pre&gt;[greg:java] svn co file:////Library/Subversion/Repository/taxi 
A    taxi/trunk
A    taxi/branches
A    taxi/tags
Checked out revision 1.&lt;/pre&gt;&lt;/div&gt;

Finally, start the server and list the projects:
&lt;div id="code"&gt;&lt;pre&gt;[greg:java] svnserve -d -r /Library/Subversion/Repository
[greg:java] svn list svn://localhost/taxi
branches/
tags/
trunk/
[greg:java] cd taxi &lt;/pre&gt;&lt;/div&gt;
Create the source and commit it:
&lt;div id="code"&gt;&lt;pre&gt;[greg:taxi] svn add trunk/src
A         trunk/src
A         trunk/src/main
A         trunk/src/main/java
A         trunk/src/main/java/Taxi.java
[greg:taxi] svn commit -m 'added swing program'
Adding         trunk/src
Adding         trunk/src/main
Adding         trunk/src/main/java
Adding         trunk/src/main/java/Taxi.java
Transmitting file data .
Committed revision 2.
[greg:taxi] 
[greg:taxi] svn add trunk/taxi.png
A  (bin)  trunk/taxi.png
[greg:taxi] svn commit -m 'added taxi icon'
Adding  (bin)  trunk/taxi.png
Transmitting file data .
Committed revision 3.
[greg:taxi] 
&lt;/pre&gt;&lt;/div&gt;

Start Hudson by using the Java Web Start instance found at http://www.continuous-integration-with-hudson.org or by running the jar as follows:
&lt;div id="code"&gt;&lt;pre&gt;[greg:hudson] java -jar hudson.war --httpPort=8282&lt;/pre&gt;&lt;/div&gt;
And now, open your browser to http://localhost:8282 and click on the "Manage Hudson" link and then the "Configure System" link.  Here. I simply unselected the checkbox for "Install Automatically" and entered the values for Maven home and Java home.  Save your changes.

&lt;br/&gt;&lt;br/&gt; 
Now, click on the "New Job" link.  All that is required here is to enter a project name and, under 'Source Code Management', select Subversion and enter the value for the project's repository URL.  I entered the value I used above: &lt;br/&gt;
&lt;b&gt;file:////Library/Subversion/Repository/taxi&lt;/b&gt;

&lt;br/&gt;&lt;br/&gt;
I saved my changes and ran a manual build which ran satisfactorily.  Then, I clicked on the 'Configure Job' link and selected a build trigger of 'Poll SCM' which caused the display of the 'Schedule' prompt.  Clicking on the question mark brought up helpful hints and examples.  I selected the choice for 'every minute' and pasted it in the Schedule input field.  Click 'Save'.

&lt;br/&gt;&lt;br/&gt;
Now, simply commit a source file and, in less than one minute, Hudson shows a new build has been completed. 

&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-6312983989234316342?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6312983989234316342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/6312983989234316342'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/05/hudson-continuous-integration.html' title='Hudson Continuous Integration'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-7651321802788106912</id><published>2010-05-15T08:53:00.000-07:00</published><updated>2010-05-15T09:14:17.290-07:00</updated><title type='text'>First github repo</title><content type='html'>Generate a ssh key per &lt;u&gt;&lt;a href="http://help.github.com/mac-key-setup/"&gt;these instructions&lt;/a&gt;&lt;/u&gt;.  Then run the following two commands to cache the credentials for the session. 

&lt;div id="code"&gt;&lt;pre&gt;
[greg:taxi] eval 'ssh-agent'
. . .
echo Agent pid 18284;
[greg:taxi] ssh-add
Enter passphrase for /Users/greghelton/.ssh/id_rsa: 
Identity added: /Users/greghelton/.ssh/id_rsa (/Users/greghelton/.ssh/id_rsa)
&lt;/pre&gt;&lt;/div&gt;
Then, add the project to the github repo: 
&lt;div id="code"&gt;&lt;pre&gt;
[greg:taxi] mkdir ../taxi_bkup
[greg:taxi] cp -R *  ../taxi_bkup
[greg:taxi] git init
Initialized empty Git repository in /Users/greghelton/dev/src/java/taxi/.git/
[greg:taxi] git add .
[greg:taxi] git commit -m 'first commit'
[master (root-commit) 3563bb5] first commit
 2 files changed, 128 insertions(+), 0 deletions(-)
 create mode 100644 src/main/java/Taxi.java
 create mode 100644 taxi.png
[greg:taxi] git remote add origin git@github.com:greghelton/taxi.git
[greg:taxi] git push origin master
Counting objects: 8, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (8/8), 4.00 KiB, done.
Total 8 (delta 0), reused 0 (delta 0)
To git@github.com:greghelton/taxi.git
 * [new branch]      master -&gt; master
[greg:taxi] 
&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-7651321802788106912?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/7651321802788106912'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/7651321802788106912'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/05/first-github-repo.html' title='First github repo'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-8731672510567287071</id><published>2010-05-12T15:19:00.000-07:00</published><updated>2010-05-12T15:26:45.953-07:00</updated><title type='text'>Obtaining a Secure  Socket</title><content type='html'>First, initialize a keystore. 
&lt;div id="code"&gt;&lt;pre&gt;[greg:secure] keytool -genkey -alias servercert -keyalg RSA -keysize 1024 
 -dname "CN=FederalReserveBank,OU=DRE,O=BEA,L=Dallas,S=TX,C=US" -keypass password 
 -keystore keystore.jks -storepass password
[greg:secure] keytool -list -v -keystore keystore.jks
Enter keystore password: password 
Keystore type: JKS
Keystore provider: SUN

Your keystore contains 1 entry

Alias name: servercert
Creation date: May 12, 2010
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=FederalReserveBank, OU=DRE, O=BEA, L=Dallas, ST=TX, C=US
Issuer: CN=FederalReserveBank, OU=DRE, O=BEA, L=Dallas, ST=TX, C=US
Serial number: 4beb2922
Valid from: Wed May 12 17:18:10 CDT 2010 until: Tue Aug 10 17:18:10 CDT 2010
Certificate fingerprints:
  MD5:  98:A4:50:E3:27:7A:F3:AC:55:4B:B4:C1:C6:A4:B3:04
  SHA1: 37:72:D3:1B:01:70:30:10:24:D0:EF:27:BE:65:1C:B5:FA:F6:77:1B
  Signature algorithm name: SHA1withRSA
  Version: 3


*******************************************
*******************************************


[greg:secure]&lt;/pre&gt;&lt;/div&gt;
&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-8731672510567287071?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/8731672510567287071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/8731672510567287071'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/05/obtaining-secure-socket.html' title='Obtaining a Secure  Socket'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-3528787474854407601</id><published>2010-05-05T20:27:00.000-07:00</published><updated>2010-05-05T20:29:59.886-07:00</updated><title type='text'>Assigning Hudson A Port</title><content type='html'>&lt;div id='code'&gt;&lt;pre&gt;[greg:hudson] java -jar hudson.war --httpPort=8282
&lt;/pre&gt;&lt;/div&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-3528787474854407601?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/3528787474854407601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/3528787474854407601'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/05/assigning-hudson-port.html' title='Assigning Hudson A Port'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-7422211059628011894</id><published>2010-05-05T20:08:00.000-07:00</published><updated>2010-05-05T20:09:52.741-07:00</updated><title type='text'>Assigning Jetty A Port</title><content type='html'>&lt;div id='code'&gt;&lt;pre&gt;[greg:jetty-6.1.21] java -jar -Djetty.port=8181 start.jar
&lt;/pre&gt;&lt;/div&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-7422211059628011894?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/7422211059628011894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/7422211059628011894'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/05/assigning-jetty-port.html' title='Assigning Jetty A Port'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-2238318784403170228</id><published>2010-04-26T19:39:00.000-07:00</published><updated>2010-04-26T19:58:57.518-07:00</updated><title type='text'>Clojure 1.2 Protocols</title><content type='html'>Stuart Halloway's &lt;u&gt;&lt;a href="http://vimeo.com/11236603"&gt;video&lt;/a&gt;&lt;/u&gt; on Clojure 1.2 Protocols.
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-2238318784403170228?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/2238318784403170228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/2238318784403170228'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/04/clojure-12-protocols.html' title='Clojure 1.2 Protocols'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-3610881779479134056</id><published>2010-04-20T11:18:00.000-07:00</published><updated>2010-06-01T09:25:03.746-07:00</updated><title type='text'>java.sql And Clojure</title><content type='html'>Clojure has a SQL package that wraps the native Java classes with LISP-like syntax.  I however want to learn Clojure-Java interop so, this example makes direct calls to the Java API from Clojure.  I'll use HSQL and create and populate a table then, with Clojure, attempt to read from the table.

&lt;h4&gt;Start HSQL&lt;/h4&gt;
&lt;div id="code"&gt;&lt;pre&gt;[greg:hsqldb] java -cp lib/hsqldb.jar org.hsqldb.server.Server --database.0 file:myclojuredb --dbname.0 clojuredb
&lt;/pre&gt;&lt;/div&gt;


&lt;h4&gt;Start the SqlTool Commandline Client&lt;/h4&gt;
&lt;div id="code"&gt;&lt;pre&gt;[greg:hsqldb] java -jar lib/hsqldb.jar --inlineRc URL=jdbc:hsqldb:hsql://localhost,USER=sa
&lt;/pre&gt;&lt;/div&gt;

&lt;h4&gt;Or, Start the Swing HSQL client&lt;/h4&gt;
&lt;div id="code"&gt;&lt;pre&gt;[greg:hsqldb] java -cp lib/hsqldb.jar org.hsqldb.util.DatabaseManagerSwing&lt;/pre&gt;&lt;/div&gt;
In the Swing HSQL client, I connect to the myclojuredb and run these statements:
&lt;div id="code"&gt;&lt;pre&gt;create table Authors (id INT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, firstName VARCHAR(50), lastName VARCHAR(50));
insert into Authors VALUES(NULL, 'Kurt', 'Vonnegut');
insert into Authors VALUES(NULL, 'John', 'Steinbeck');
select * from Authors;&lt;/pre&gt;&lt;/div&gt;

&lt;h4&gt;Start the Clojure REPL&lt;/h4&gt;
&lt;div id="code"&gt;&lt;pre&gt;[greg:clojure-1.1.0] java -cp .:clojure.jar:jline-0.9.94.jar:../hsqldb/lib/hsqldb.jar jline.ConsoleRunner clojure.main&lt;/pre&gt;&lt;/div&gt;
&lt;h4&gt;Run the Clojure - Java Interop to Execute the JDBC&lt;/h4&gt;
&lt;div id="code"&gt;&lt;pre&gt;user=&gt; (import '(java.sql Connection DriverManager Statement ResultSet))
java.sql.ResultSetMetaData
user=&gt; (Class/forName "org.hsqldb.jdbc.JDBCDriver")                                                    
org.hsqldb.jdbc.JDBCDriver
user=&gt; (def conn (DriverManager/getConnection "jdbc:hsqldb:hsql://localhost/clojuredb", "SA", ""))     
#'user/conn
user=&gt; (def stmt (.createStatement conn))                                                              
#'user/stmt
user=&gt; (def rs (.executeQuery stmt "SELECT * FROM Authors"))                                           
#'user/rs
user=&gt; (.next rs)
true
user=&gt; (.getInt rs 1)
0
user=&gt; (.getString rs 2)
"Kurt"
user=&gt; (.getString rs 3)
"Vonnegut"
user=&gt; 
&lt;/pre&gt;&lt;/div&gt;
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-3610881779479134056?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/3610881779479134056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/3610881779479134056'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/04/javasql-and-clojure.html' title='java.sql And Clojure'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-3891309156273912946</id><published>2010-04-16T06:35:00.000-07:00</published><updated>2010-04-22T19:59:20.785-07:00</updated><title type='text'>JRuby Steps 4 and 5</title><content type='html'>The JRuby 'Getting Started' page lists three steps: 
&lt;div id="code"&gt;&lt;pre&gt;
1. Download JRuby: Visit the download page and grab the binaries for the latest JRuby release.
2. Unpack JRuby: Unpack the file you downloaded. You’ll then have a "jruby-&lt;version&gt;" directory.
3. Run JRuby: The JRuby startup script lives in the "bin" directory. Run "bin/jruby -v" to confirm it.&lt;/pre&gt;&lt;/div&gt;

&lt;h4&gt;I found that the following steps are also required:&lt;/h4&gt;
&lt;div id="code"&gt;&lt;pre&gt;
[greg:jruby-1.5.0.RC1] export JRUBY_HOME=/Users/greghelton/dev/bin/jruby-1.5.0.RC1
[greg:jruby-1.5.0.RC1] export PATH=$PATH:$JRUBY_HOME/bin&lt;/pre&gt;&lt;/div&gt;

&lt;h4&gt;Then, to run jirb:&lt;/h4&gt;
&lt;div id="code"&gt;&lt;pre&gt;
[greg:jruby-1.5.0.RC1] bin/jirb&lt;/pre&gt;&lt;/div&gt;

&lt;h4&gt;Or, to run sinatra, first edit hi.rb&lt;/h4&gt;
&lt;div id="code"&gt;&lt;pre&gt;
require 'rubygems'
require 'sinatra'
get '/hi' do
  "Hello World!"
end
&lt;/pre&gt;&lt;/div&gt;

&lt;h4&gt;and run the class&lt;/h4&gt;
&lt;div id="code"&gt;&lt;pre&gt;
[greg:project1] sudo jgem install sinatra
[greg:project1] jruby ./hi.rb
== Sinatra/0.9.4 has taken the stage on 4567 for development with backup from WEBrick
[2010-04-16 18:09:50] INFO  WEBrick 1.3.1
[2010-04-16 18:09:50] INFO  ruby 1.8.7 (2010-04-14) [java]
[2010-04-16 18:09:50] INFO  WEBrick::HTTPServer#start: pid=4475 port=4567
&lt;/pre&gt;&lt;/div&gt;

&lt;h4&gt;then open your browser to ... &lt;/h4&gt;
&lt;div id="code"&gt;&lt;pre&gt;
http://localhost:4567/hi
&lt;/pre&gt;&lt;/div&gt;

&lt;h4&gt;Installing activerecord for JRuby&lt;/h4&gt;
&lt;u&gt;&lt;a href="http://www.rubyinside.com/rails-3-0s-activemodel-how-to-give-ruby-classes-some-activerecord-magic-2937.html"&gt;This site&lt;/a&gt;&lt;/u&gt; is a big help but I had to do things a little differently. The command &lt;b&gt;'rake jgem'&lt;/b&gt; didn't work but &lt;b&gt;'rake gem'&lt;/b&gt; did then, strangely, &lt;b&gt;'jgem install ...'&lt;/b&gt; worked as the next step.  

&lt;div id="code"&gt;&lt;pre&gt;
[greg:ruby] export JRUBY_HOME=/Users/greghelton/dev/bin/jruby-1.5.0.RC1
[greg:ruby] export PATH=$PATH:$JRUBY_HOME/bin
[greg:ruby] mkdir active
[greg:ruby] cd active
[greg:active] git clone git://github.com/rails/rails.git
Initialized empty Git repository in /Users/greghelton/dev/src/ruby/active/rails/.git/
remote: Counting objects: 163266, done.
remote: Compressing objects: 100% (36468/36468), done.
remote: Total 163266 (delta 125957), reused 162169 (delta 125035)
Receiving objects: 100% (163266/163266), 28.37 MiB | 326 KiB/s, done.
Resolving deltas: 100% (125957/125957), done.
[greg:active] cd rails
[greg:rails] rake gem
             ... many lines reported by the build ...
[greg:rails] ls -al activesupport/pkg
total 584
drwxr-xr-x   3 greghelton  staff     102 Apr 22 01:19 .
drwxr-xr-x  12 greghelton  staff     408 Apr 22 01:19 ..
-rw-r--r--   1 greghelton  staff  295424 Apr 22 01:19 activesupport-3.0.0.beta3.gem
[greg:rails] sudo jgem install ./activesupport/pkg/activesupport-3.0.0.beta3.gem
Password:
Successfully installed i18n-0.3.7
Successfully installed tzinfo-0.3.20
Successfully installed memcache-client-1.8.2
Successfully installed activesupport-3.0.0.beta3
4 gems installed
Installing ri documentation for i18n-0.3.7...
Installing ri documentation for tzinfo-0.3.20...
Installing ri documentation for memcache-client-1.8.2...
Installing ri documentation for activesupport-3.0.0.beta3...
Installing RDoc documentation for i18n-0.3.7...
Installing RDoc documentation for tzinfo-0.3.20...
Installing RDoc documentation for memcache-client-1.8.2...
Installing RDoc documentation for activesupport-3.0.0.beta3...
[greg:rails] ls -al activemodel/pkg
total 72
drwxr-xr-x   3 greghelton  staff    102 Apr 22 01:19 .
drwxr-xr-x  11 greghelton  staff    374 Apr 22 01:19 ..
-rw-r--r--   1 greghelton  staff  33792 Apr 22 01:19 activemodel-3.0.0.beta3.gem
[greg:rails] sudo jgem install ./activemodel/pkg/activemodel-3.0.0.beta3.gem
Successfully installed activemodel-3.0.0.beta3
1 gem installed
Installing ri documentation for activemodel-3.0.0.beta3...
Installing RDoc documentation for activemodel-3.0.0.beta3...
[greg:rails] jirb
&lt;/pre&gt;&lt;/div&gt;
&lt;div id="code"&gt;&lt;pre&gt;
irb(main):013:0&gt; require 'active_model'
=&gt; true
irb(main):014:0&gt; class Person                                       
irb(main):015:1&gt;   include ActiveModel::Validations                 
irb(main):016:1&gt;   validates_presence_of :first_name, :last_name    
irb(main):017:1&gt;   attr_accessor :first_name, :last_name            
irb(main):018:1&gt;   def initialize(first_name, last_name)            
irb(main):019:2&gt;     @first_name, @last_name = first_name, last_name
irb(main):020:2&gt;   end                                              
irb(main):021:1&gt; end                                                
=&gt; nil
irb(main):022:0&gt; a = Person.new("Barney", "Rubble")
=&gt; #&lt;Person:0x464d28c7 @last_name="Rubble", @first_name="Barney"&gt;
irb(main):023:0&gt; a.valid?
=&gt; true
irb(main):024:0&gt;
&lt;/pre&gt;&lt;/div&gt;
Super! 
&lt;br/&gt;&lt;br/&gt;

&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-3891309156273912946?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/3891309156273912946'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/3891309156273912946'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/04/jruby-steps-4-and-5.html' title='JRuby Steps 4 and 5'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-8896841413321435232</id><published>2010-04-12T11:20:00.000-07:00</published><updated>2010-04-12T12:13:25.364-07:00</updated><title type='text'>Use SQL Relationally</title><content type='html'>&lt;a href="http://oreilly.com/catalog/0636920002710"&gt;&lt;u&gt;C. J. Date's intro video&lt;/u&gt;&lt;/a&gt; describing the relational model.  The forty minute course intro is free and very helpful. 
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-8896841413321435232?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/8896841413321435232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/8896841413321435232'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/04/use-sql-relationally.html' title='Use SQL Relationally'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-5343948339696756858</id><published>2010-04-10T08:26:00.000-07:00</published><updated>2010-08-15T06:44:41.161-07:00</updated><title type='text'>Clojure Is LISP</title><content type='html'>Clojure 1.1 release candidate is available.  clojure.lang.Repl is deprecated.  Use clojure.main 
&lt;div id="code"&gt;&lt;pre&gt;cd dev/lib/clojure-1.1.0
java -cp .:clojure.jar:jline-0.9.94.jar jline.ConsoleRunner clojure.main
&lt;/pre&gt;&lt;/div&gt;

&lt;div id="code"&gt;&lt;pre&gt;
user=&gt; (def r 5)
#'user/r
user=&gt; r
5
user=&gt; (+ r 3)
8
user=&gt; (def clojure 'lisp)
#'user/clojure
user=&gt; clojure
lisp
user=&gt; (def s [5 6 7])
#'user/s
user=&gt; s
[5 6 7]
user=&gt; (first s)         
5
user=&gt; (rest s) 
(6 7)
user=&gt; (def t {"a" 1 "b" 2 "c" 3})
#'user/t
user=&gt; (get t "a")
1
user=&gt; (first t)
["a" 1]
user=&gt; (def u {:a 1 :b 2 :c 3})   
#'user/u
user=&gt; (get u :a)              
1
user=&gt; (let [x 2] (+ x 8))
10
user=&gt; (new BigDecimal 10)
10M
user=&gt; (new BigDecimal 1) 
1M
user=&gt; (new File "temp.clj")
java.lang.IllegalArgumentException: Unable to resolve classname: File (NO_SOURCE_FILE:61)
user=&gt; (import 'java.io.File)
java.io.File
user=&gt; (new File "temp.clj") 
#&amp;lt;File temp.clj&gt;
user=&gt; (def y ["one" "two"])       
#'user/y
user=&gt; (def z (cons "zero" y))
#'user/z
user=&gt; z
("zero" "one" "two")
user=&gt; (cons "zero" ("one" "two")) 
java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn (NO_SOURCE_FILE:0)
user=&gt; (cons "zero" '("one" "two"))    
("zero" "one" "two")
user=&gt; (nth z 2)
"two"
user=&gt; (new java.util.HashMap {"one" 1 "two" 2 "three" 3})
#&lt;HashMap {two=2, one=1, three=3}&gt;
user=&gt; (java.util.HashMap. {"one" 1 "two" 2 "three" 3})
#&lt;HashMap {two=2, one=1, three=3}&gt;
(def cars ['Ford 'Chevy 'Dodge])
#'user/cars
user=&gt; (rest cars)
(Chevy Dodge)
user=&gt; (first cars)
Ford
user=&gt; (first (rest cars))
Chevy
user=&gt; (def broken (first (rest cars)))                 
#'user/broken
user=&gt; broken
Chevy
user=&gt; (def cars (cons 'GMC cars))
#'user/cars
user=&gt; cars
(GMC Ford Chevy Dodge)
user=&gt; (def stooges (sorted-set 'larry 'mo 'curly))
#'user/stooges
user=&gt; stooges
#{curly larry mo}
user=&gt; (first stooges)                             
curly
user=&gt; (rest stooges)                              
(larry mo)
user=&gt; (def stooges (sorted-map :a 'larry :b 'mo :c 'curly))
#'user/stooges
user=&gt; (stooges :a)                                         
larry
user=&gt; 
&lt;/pre&gt;&lt;/div&gt;

&lt;h4&gt;Function Definition&lt;/h4&gt;
(defn function-name doc-string? attr-map? [parameter-list] &lt;br/&gt;
  (expressions))
&lt;div id="code"&gt;&lt;pre&gt;
user=&gt; (defn add [a b] (+ a b)) 
#'user/add
user=&gt; (add 1 2)
3
user=&gt; (defn biggerthanabreadbox? [thing] (&gt; thing 3))
#'user/biggerthanabreadbox?
user=&gt; (biggerthanabreadbox? 5)                       
true
user=&gt; (biggerthanabreadbox? 1)
false
user=&gt; (defn total-cost [price quantity] 
   (* price quantity)) 
#'user/total-cost
user=&gt; (total-cost 3 2)
6
&lt;/pre&gt;&lt;/div&gt;
&lt;h4&gt;More Examples&lt;/h4&gt;
&lt;div id="code"&gt;&lt;pre&gt;
user=&gt; (defstruct book :title :author) 
#'user/book
user=&gt; (def b struct) 
#'user/b
user=&gt; (def b (struct book "Alice in Wonderland" "Lewis Carroll"))
#'user/b
user=&gt; (:title b)
"Alice in Wonderland"
user=&gt; (defmulti prt class)     
#'user/prt
user=&gt; (defmethod prt String [s]
(.write *out* s))        
#&lt;MultiFn clojure.lang.MultiFn@4f2b6c89&gt;
user=&gt; (prt "Clojure is Cool!")
Clojure is Cool!nil
user=&gt; (derive ::bronze ::basic)
nil
user=&gt; (derive ::silver ::basic) 
nil
user=&gt; (derive ::gold ::premier)
nil
user=&gt; (derive ::platinum ::premier)
nil
user=&gt; (isa? ::bronze ::premier)
false
user=&gt; (isa? ::gold ::premier)  
true
&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-5343948339696756858?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/5343948339696756858'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/5343948339696756858'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/04/lisp.html' title='Clojure Is LISP'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-2670542885487410518</id><published>2010-04-03T10:25:00.000-07:00</published><updated>2010-05-19T10:07:11.782-07:00</updated><title type='text'>Testing Identity</title><content type='html'>A quick review of hashCode().  The commonly stated rules are: &lt;br/&gt;
1. hashCode() must be overridden when equals() is overridden&lt;br/&gt;
2. when objects are equal then their hash codes should be as well&lt;br/&gt;
&lt;br/&gt;

We begin with the the Car class that relies on default equality inherited from the Object class wherein the equals() method is simply a reference comparison. 
&lt;div id='code'&gt;&lt;pre&gt;package com.cars;
public class Car {
 private int vin; //Vehicle ID Number
 public Car(int vin) {
  this.vin = vin;
 }
 public int getVin() { 
  return vin;
 }
}&lt;/pre&gt;&lt;/div&gt;
And we test this using Java assertions (a review of Java assertions never hurt). 
&lt;div id='code'&gt;&lt;pre&gt;package com.cars;
public class TestingIdentity {  
 public static void main(String[] args) {
  Car car1 = new Car(1);
  Car car2 = new Car(1);
  assert car1 != car2;       // line 6
  assert car1.equals(car2);  // line 7
}&lt;/pre&gt;&lt;/div&gt;
On line 6 of TestingIdentity, we know the objects are not the same object but on line 7, two objects having the same values are unequal too so the assertion fails when we compile and run the code.
&lt;div id='code'&gt;&lt;pre&gt;javac -sourcepath src -classpath ./build -d build src/com/cars/Car.java
javac -sourcepath src -classpath ./build -d build src/com/cars/TestingIdentity.java
java -ea -classpath ./build com.cars.TestingIdentity
Exception in thread "main" java.lang.AssertionError
 at com.cars.TestingIdentity.main(TestingIdentity.java:7)
&lt;/pre&gt;&lt;/div&gt;
In the semantics of our application, we would like instances having the same VIN to be equal.  Let's write that code.
&lt;div id='code'&gt;&lt;pre&gt;package com.cars;

public class Car {
 private int vin;
 public Car(int vin) {
  this.vin = vin;
 }
 public int getVin() { 
  return vin;
 }
 
 @Override
 public boolean equals(Object o) {
  if (o == null) 
   return false;
  if (this == o) 
   return true;
  if (o.getClass() != this.getClass())
   return false;
  Car car = (Car)o;
  if (car.getVin() == this.vin) 
   return true;
  return false;
 }
}
&lt;/pre&gt;&lt;/div&gt;And when we run this code, we get no complaints from the line &lt;b&gt;assert car1.equals(car2);&lt;/b&gt;.  So, are we done?  Well, we are always told that we must override hashCode() whenever we override equals().  Let's explore hashCode() to see why it must be overridden.  The documentation of the HashSet.add() method states that the method "Adds the specified element to this set if it is not already present".  Let's prove that failing to override hashCode() causes HashSet to fail to perform it's prescribed behavior.
&lt;div id='code'&gt;&lt;pre&gt;package com.cars;
import java.util.Set;
import java.util.HashSet;
public class TestingIdentity {  
 public static void main(String[] args) {
  Car car1 = new Car(1);
  Car car2 = new Car(1);
  assert car1 != car2;       // line 8
  assert car1.equals(car2);  // line 9
  
  Set&lt;Car&gt; set = new HashSet&lt;Car&gt;();
  set.add(car1);
  set.add(car2);
  assert set.size() == 1;  // line 14
 } 
}
&lt;/pre&gt;&lt;/div&gt;Because the objects are 'equal', we expect only one instance to be in the HashSet.  When we run the code however, we get the trouble we've been looking for.  The new assertion in the code above fails because the HashSet relies on hashCode() in its determination of whether the object already exists in the Set. 

&lt;div id='code'&gt;&lt;pre&gt;javac -sourcepath src -classpath ./build -d build src/com/cars/TestingIdentity.java
java -ea -classpath ./build com.cars.TestingIdentity
Exception in thread "main" java.lang.AssertionError
 at com.cars.TestingIdentity.main(TestingIdentity.java:14)
&lt;/pre&gt;&lt;/div&gt;
To attempt to solve this problem, we follow the admonition and override hashCode() in the Car class:
&lt;div id='code'&gt;&lt;pre&gt;
 @Override
 public int hashCode() {
  return vin;
 }
&lt;/pre&gt;&lt;/div&gt;
The code above now runs without violating the assertions because hashCode() is overridden so that whenever a.equals(b), then a.hashCode() == b.hashCode()
&lt;br/&gt;&lt;br/&gt;
The solution is a little simplistic but it does work for the given problem.  A better solution is to use org.apache.commons.lang.builder.HashCodeBuilder. 
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-2670542885487410518?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/2670542885487410518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/2670542885487410518'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/04/testing-identity.html' title='Testing Identity'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-226578688316419985</id><published>2010-04-02T18:55:00.000-07:00</published><updated>2010-04-02T18:58:23.531-07:00</updated><title type='text'>The Future of the Wave</title><content type='html'>From MIT Media Lab and the creator of jQuery, we get &lt;a href="http://processingjs.org/learning/basic/noisewave"&gt;&lt;u&gt;some cool stuff for the browser&lt;/u&gt;&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-226578688316419985?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/226578688316419985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/226578688316419985'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/04/future-of-wave.html' title='The Future of the Wave'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-538156679797376070</id><published>2010-03-24T21:41:00.000-07:00</published><updated>2010-04-21T18:48:46.120-07:00</updated><title type='text'>eBay Scalability</title><content type='html'>Discussing SQL with a friend a few days ago, it occurred to me that the design of some databases could be described as procedural instead of relational.  These procedural databases do a few things well but such a database design is found to be a hindrance when the time comes to add new features to the application.  That is the negative view but, &lt;u&gt;&lt;a href="http://highscalability.com/blog/2010/3/23/digg-4000-performance-increase-by-sorting-in-php-rather-than.html"&gt;this article&lt;/a&gt;&lt;/u&gt; makes the case for just such a design. 
&lt;br/&gt;&lt;br/&gt;

Point 4 in the article states"To scale at Digg they followed a set of practices very similar to those used at eBay. No joins, no foreign key constraints (to scale writes), primary key look-ups only, limited range queries, and joins were done in memory".  (Note how much this design mirrors the design used in most AS/400 RPG applications.)
&lt;br/&gt;&lt;br/&gt;

The article's point 2 directs the designer to restrict what the user can do and to have no intention of having a generic database.  &amp;nbsp;The article doesn't state that point 2 is prerequisite to point 4 but I think it must be.  &amp;nbsp;Such a design may sometimes be necessary but electing to omit normalization from the database design reduces the potential for extension of that database.

&lt;br/&gt;&lt;br/&gt;
Both a relational design and the design used at Digg are legitimate but, as with all design decisions, there are trade-offs.  The design can be generalized and thus extensible or it can be performance optimized and specialized to do fewer business functions with limited potential for reuse without redesign.  &amp;nbsp;To get both the generalized extensibility and the functionality optimized for critical performance requirements, consideration should be given to dividing the problem and solving it with two designs.
&lt;br/&gt;&lt;br/&gt;

A quote from &lt;a href="http://www.infoq.com/articles/ebay-scalability-best-practices"&gt;&lt;u&gt;this article&lt;/u&gt;&lt;/a&gt; gives food for thought about when and how to address scalability:&lt;br/&gt;
&lt;span style="font-style:italic;"&gt;Scalability is about how resource usage changes as units of work grow in number or size. &amp;nbsp;Said another way, scalability is the shape of the price-performance curve, as opposed to its value at one point in that curve.&lt;/span&gt;
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-538156679797376070?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/538156679797376070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/538156679797376070'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/03/ebay-scalability.html' title='eBay Scalability'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-1721802609689277217</id><published>2010-03-22T16:44:00.000-07:00</published><updated>2010-04-03T11:19:54.582-07:00</updated><title type='text'>Size of MySQL Database and More</title><content type='html'>&lt;h3&gt;Get the size of the xyz database&lt;/h3&gt;
&lt;div id="code"&gt;&lt;pre&gt;
du -ch data/xyz/* | grep total
808K&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Create a User and Grant Him Privileges &lt;/h3&gt;
&lt;div id="code"&gt;&lt;pre&gt;
mysql&gt; use xyz; 
Database changed

mysql&gt; show tables;                                                                                                                                                                                                             
+------------------+
| Tables_in_xyz    |
+------------------+
| actor            | 
+------------------+
1 row in set (0.00 sec)

mysql&gt; create user 'clerk'@'localhost' identified by 'aPassword';
Query OK, 0 rows affected (0.01 sec)

mysql&gt; grant delete,insert,select,update on xyz.actor to 'clerk'@'localhost'; 
Query OK, 0 rows affected (0.00 sec)
&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Alternatively, Grant All &lt;/h3&gt;
&lt;div id="code"&gt;&lt;pre&gt;
mysql&gt; grant all on xyz.* to ’clerk’@'localhost';
&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Change the User's Password and the Necessary Subsequent Step&lt;/h3&gt;
&lt;div id="code"&gt;&lt;pre&gt;
mysql&gt; update mysql.user set password = Password('aPassword') where user = 'clerk'@'localhost'; 
Query OK, 1 row affected (0.00 sec)

mysql&gt; flush privileges;
Query OK, 0 rows affected (0.04 sec)
&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Alternative for Setting Password&lt;/h3&gt;
&lt;div id="code"&gt;&lt;pre&gt;mysql&gt; set password for 'clerk'@'localhost' = Password('aPassword');&lt;/pre&gt;&lt;/div&gt; 

&lt;h3&gt;Verify the User Exists &lt;/h3&gt;
&lt;div id="code"&gt;&lt;pre&gt;
mysql&gt; select user, host from mysql.user;
&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Verify Privileges Granted a User &lt;/h3&gt;
&lt;div id="code"&gt;&lt;pre&gt;
mysql&gt; select * from information_schema.table_privileges where GRANTEE = '''clerk''@''localhost''';
+-----------------------+---------------+--------------+------------+----------------+--------------+
| GRANTEE               | TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | PRIVILEGE_TYPE | IS_GRANTABLE |
+-----------------------+---------------+--------------+------------+----------------+--------------+
| 'manager'@'localhost' | NULL          | xyz          | staff      | SELECT         | NO           | 
| 'manager'@'localhost' | NULL          | xyz          | actor_info | SELECT         | NO           | 
| 'manager'@'localhost' | NULL          | xyz          | actor_info | INSERT         | NO           | 
| 'manager'@'localhost' | NULL          | xyz          | actor_info | UPDATE         | NO           | 
| 'manager'@'localhost' | NULL          | xyz          | film_list  | SELECT         | NO           | 
| 'manager'@'localhost' | NULL          | xyz          | actor      | SELECT         | NO           | 
| 'manager'@'localhost' | NULL          | xyz          | actor      | INSERT         | NO           | 
| 'manager'@'localhost' | NULL          | xyz          | actor      | UPDATE         | NO           | 
| 'manager'@'localhost' | NULL          | xyz          | actor      | DELETE         | NO           | 
| 'manager'@'localhost' | NULL          | xyz          | payment    | SELECT         | NO           | 
+-----------------------+---------------+--------------+------------+----------------+--------------+
10 rows in set (0.00 sec)
&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Column Level Security&lt;/h3&gt;
&lt;div id="code"&gt;&lt;pre&gt;
mysql&gt; revoke all on xyz.staff from 'manager'@'localhost';
Query OK, 0 rows affected (0.01 sec)

mysql&gt; grant select(staff_id, first_name, last_name, address_id, picture, email, 
store_id, active, username, last_update) on xyz.staff to 'manager'@'localhost';
Query OK, 0 rows affected (0.01 sec)

&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Quickest Way To Run a MySQL Command&lt;/h3&gt;
&lt;div id="code"&gt;&lt;pre&gt;mysql -t --user=ghelton --password=aPassword -e "select * from classicmodels.Orders;"&lt;/pre&gt;&lt;/div&gt;
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-1721802609689277217?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/1721802609689277217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/1721802609689277217'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/03/size-of-mysql-database.html' title='Size of MySQL Database and More'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-4636711093070789643</id><published>2010-03-21T19:46:00.000-07:00</published><updated>2010-03-21T19:48:11.628-07:00</updated><title type='text'>Google's Python Class</title><content type='html'>&lt;a href="http://code.google.com/edu/languages/google-python-class/"&gt;Google's Python Class&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-4636711093070789643?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/4636711093070789643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/4636711093070789643'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/03/googles-python-class.html' title='Google&apos;s Python Class'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-8353923690606170465</id><published>2010-03-14T09:38:00.000-07:00</published><updated>2010-03-14T09:50:00.891-07:00</updated><title type='text'>MySQL FULLTEXT</title><content type='html'>TEXT columns in a MySQL ISAM table can be searched using the MATCH keyword which is similar to LIKE.
&lt;div id="code"&gt;&lt;pre&gt;
Select Name, Description from Artists where match(Description) AGAINST ('American'); 

+------------------+-------------------------------------+
| Name             | Description                         |
|------------------+-------------------------------------+
| Ray Charles      | Unsurpassed American Musician       | 
+------------------+-------------------------------------+
&lt;/pre&gt;&lt;/div&gt;
&lt;br/&gt;
&lt;b&gt;&lt;i&gt;Here's the Kicker&lt;/i&gt;&lt;/b&gt;
&lt;br/&gt;
The results can be expanded with natural language capabilities by adding WITH QUERY EXPANSION to the AGAINST clause of the MATCH.  The Buddy Holly record does not include the search word but because 'unsurpassed was in proximity to the searchword 'American' found in the Ray Charles record, the search results include records which have 'unsurpassed' as well.
&lt;div id="code"&gt;&lt;pre&gt;
Select Name, Description from Artists where match(Description) AGAINST ('American' WITH QUERY EXPANSION); 

+--------------------+-------------------------------------+
| Name               | Description                         |
|--------------------+-------------------------------------+
| Ray Charles        | Unsurpassed American Musician       | 
| Buddy Holly        | Buddy had unsurpassed promise.      | 
+--------------------+-------------------------------------+

&lt;/pre&gt;&lt;/div&gt;
Prereqs:
&lt;div id="code"&gt;&lt;pre&gt;
ALTER TABLE Artists ENGINE=MyISAM;
ALTER TABLE Artists ADD FULLTEXT (Description);
&lt;/pre&gt;&lt;/div&gt;
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-8353923690606170465?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/8353923690606170465'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/8353923690606170465'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/03/mysql-fulltext.html' title='MySQL FULLTEXT'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-8238005498285654155</id><published>2010-02-12T20:42:00.000-08:00</published><updated>2010-04-09T13:07:51.739-07:00</updated><title type='text'>Objective C Project - See the Movie</title><content type='html'>Unit testing Objective-C code in a 15 minute movie by Brett Schuchert - &lt;a href="http://schuchert.wikispaces.com/tdd.objectivec.XCodeProjectSetup "&gt;&lt;u&gt;http://schuchert.wikispaces.com/tdd.objectivec.XCodeProjectSetup&lt;/u&gt;&lt;/a&gt;
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-8238005498285654155?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/8238005498285654155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/8238005498285654155'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/02/objective-c-project-see-movie.html' title='Objective C Project - See the Movie'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-4655524166015877587</id><published>2010-02-09T23:10:00.000-08:00</published><updated>2010-08-15T06:51:43.979-07:00</updated><title type='text'>Scientific American</title><content type='html'>&lt;a href="http://www.scientificamerican.com/article.cfm?id=advantages-of-helpless"&gt;&lt;u&gt;An article in Scientific American&lt;/u&gt;&lt;/a&gt; posits the idea that the extended helpless state of human infants compared to other animals is the catalyst that allows humans to develop the skills to elicit assistance and to work with others.

&lt;br/&gt;&lt;br/&gt;

Often, components that do less are more powerful.  REST has six operations, SQL four and MQ two.  LISP uses only nine words to define the whole of computing.  Most would agree that additional features and responsibilities in these applications would be detrimental.  Developers should use the same care to avoid overloading a class with more than one responsibility. 

&lt;br/&gt;&lt;br/&gt;

OO is all about responsibility assignment: 
&lt;li&gt;Class Responsibility Collaboration (CRC) cards, 1989 by Beck and Cunningham
&lt;li&gt;Single Responsibility Principle, 1996 by Bob Martin
&lt;li&gt;GRASP (general responsibility assignment software patterns), 1999 by Craig Larman&lt;br/&gt;&lt;br/&gt;
Responsibilities are not the sort described by "allow the user to enter and save customer information" (that's the use case) but are discrete, divided among the application layers (presentation, domain and persistence) and assigned at the component level. 

&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-4655524166015877587?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/4655524166015877587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/4655524166015877587'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/02/scientific-american.html' title='Scientific American'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-210706368143496347</id><published>2010-02-09T08:51:00.000-08:00</published><updated>2010-04-09T21:45:18.704-07:00</updated><title type='text'>HTTP &amp; REST &amp; SOAP</title><content type='html'>&lt;b&gt;HTTP&lt;/b&gt; - Hypertext Transfer Protocol&lt;br/&gt;
POST - submits data to be processed (e.g., from an HTML form) to the identified resource&lt;br/&gt;
GET - requests a representation of the current state of this resource&lt;br/&gt;
PUT - (idempotent) create or update this resource with the accompanying representation&lt;br/&gt;
DELETE - (idempotent) remove this resource &lt;br/&gt;
HEAD - like GET but only response headers are returned&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;REST&lt;/b&gt; - Representational State Transfer &lt;br/&gt;
a style of software architecture for distributed hypermedia systems

&lt;br/&gt;&lt;br/&gt;
&lt;b&gt;SOAP&lt;/b&gt; - Simple Object Access Protocol.  Performs Remote Procedure Calls (RPC) based on information in XML documents. 

&lt;br/&gt;&lt;br/&gt;
&lt;b&gt;Atom Publishing Protocol&lt;/b&gt; (based on REST)&lt;br/&gt; 
POST - create content&lt;br/&gt;
GET - retrieve content&lt;br/&gt;
PUT - edit content&lt;br/&gt;
DELETE - delete content&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-210706368143496347?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/210706368143496347'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/210706368143496347'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/02/http-rest-soap.html' title='HTTP &amp; REST &amp; SOAP'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-5638774291298554147</id><published>2010-02-01T17:20:00.001-08:00</published><updated>2010-02-01T17:20:51.780-08:00</updated><title type='text'>Another Quote</title><content type='html'>“The physicist's greatest tool is his wastebasket.” -- Albert Einstein 
&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-5638774291298554147?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/5638774291298554147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/5638774291298554147'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/02/another-quote.html' title='Another Quote'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2576631677249373783.post-1138187053520327967</id><published>2010-01-28T21:17:00.000-08:00</published><updated>2010-01-28T21:18:46.361-08:00</updated><title type='text'>Things Go Better With CSS</title><content type='html'>&lt;a href="http://www.romancortes.com/blog/pure-css-coke-can/"&gt;&lt;u&gt;Scrolling coke can&lt;/u&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2576631677249373783-1138187053520327967?l=opensourcetips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/1138187053520327967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2576631677249373783/posts/default/1138187053520327967'/><link rel='alternate' type='text/html' href='http://opensourcetips.blogspot.com/2010/01/things-go-better-with-css.html' title='Things Go Better With CSS'/><author><name>Greg Helton</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>
