<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rusty Razor Blade &#187; java</title>
	<atom:link href="http://www.rustyrazorblade.com/category/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rustyrazorblade.com</link>
	<description>Tech Thoughts, Mostly on LAMP - by Jon Haddad</description>
	<lastBuildDate>Fri, 03 Feb 2012 20:03:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Another Attempt At Python</title>
		<link>http://www.rustyrazorblade.com/2011/04/another-attempt-at-python/</link>
		<comments>http://www.rustyrazorblade.com/2011/04/another-attempt-at-python/#comments</comments>
		<pubDate>Fri, 22 Apr 2011 20:32:13 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[erlang]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=1390</guid>
		<description><![CDATA[<p>I tried Python out a while ago, but stopped trying it to learn it after some major frustrations. Maybe I didn&#8217;t dig deep enough into it. I found the documentation hard to read, and the module layout seemed a little random at times. For some reason I found <a href="http://docs.python.org/library/subprocess.html">executing an external process</a> and getting [...]]]></description>
			<content:encoded><![CDATA[<p>I tried Python out a while ago, but stopped trying it to learn it after some major frustrations.  Maybe I didn&#8217;t dig deep enough into it.  I found the documentation hard to read, and the module layout seemed a little random at times.  For some reason I found <a href="http://docs.python.org/library/subprocess.html">executing an external process</a> and getting the results to be a little convoluted.  (Since then I&#8217;ve learned to use popen(..).communicate())</p>
<p><a href="http://www.rustyrazorblade.com/wp-content/uploads/2011/04/Cover-Image-For-Seven-Languages-in-Seven-Weeks.jpeg"><img src="http://www.rustyrazorblade.com/wp-content/uploads/2011/04/Cover-Image-For-Seven-Languages-in-Seven-Weeks.jpeg" alt="" title="Cover Image For Seven Languages in Seven Weeks" width="190" height="228" class="alignright size-full wp-image-1411" /></a>I ended up messing with other languages to try to find one that suits my tastes, like <a href="http://www.erlang.org/">Erlang</a> and <a href="http://www.digitalmars.com/d/index.html">D</a>.  I read through <a href="http://pragprog.com/titles/btlang/seven-languages-in-seven-weeks">7 languages in 7 weeks</a>, and not really getting a lot out of it.  I didn&#8217;t fall in love with <a href="http://www.ruby-lang.org/en/">ruby</a> at all and I&#8217;m not going to actually use <a href="http://www.swi-prolog.org/">Prolog</a> anywhere, even if I thought it was pretty cool.  I never liked <a href="http://www.java.com/en/">Java</a>, and I wasn&#8217;t impressed with <a href="http://www.scala-lang.org/">Scala</a>. </p>
<p>The closest I&#8217;ve gotten to a new favorite is Erlang.  I&#8217;ve written a <a href="/category/erlang/">whole slew of posts</a> about it.  I like Erlang&#8217;s process management, message passing, and the OTP libraries.  I like talking about it with people and I advocate it&#8217;s advantages.  But when it comes time to write it, I find it to be clumsy and awkward, the syntax annoying and the external libraries painful.  For instance, trying to work with a MongoDB database just doesn&#8217;t feel right.  My mind likes OO code, and I&#8217;m done fighting it.  So time to try something else.</p>
<p>I thought D was really interesting, but unfortunately it looks like no one is using it.  It&#8217;s not even clear which compiler I should use, and the installation instructions were incorrect when I tried to set it up.  Not a big selling point, and I gave that up pretty quickly.</p>
<p><a href="http://www.rustyrazorblade.com/wp-content/uploads/2011/04/python-logo.gif"><img src="http://www.rustyrazorblade.com/wp-content/uploads/2011/04/python-logo.gif" alt="" title="python-logo" width="211" height="71" class="alignright size-full wp-image-1408" /></a>So, another look at Python.  Working with threads in Python kind of sucks.  If you have multiple cores, it doesn&#8217;t really care.  That&#8217;s unfortunate.  However, after reading through convos in IRC (#python on freenode) I&#8217;ve found a few things that are making me give it another look.  For instance, the <a href="http://docs.python.org/library/multiprocessing.html">multiprocessing module</a> seems to address my gripes about processes / threads.  Yes we&#8217;re creating OS processes, but I really only need a few (5, 10 maybe?) so having a few running shouldn&#8217;t be a problem, and the OS will take care of loading up my cores for me.  It&#8217;s got great support for MongoDB (my shiny new toy) and I like it&#8217;s clean syntax.  I think tornado looks really cool and I&#8217;m excited to write a stand alone server that I can bundle instead of requiring nginx configs and complicated setups.</p>
<p>So&#8230; I&#8217;m back writing Python.  We&#8217;ll see how it goes.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2011/04/another-attempt-at-python/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to Install the Lucene Search Engine using Solr</title>
		<link>http://www.rustyrazorblade.com/2008/03/how-to-install-the-lucene-search-engine-using-solr/</link>
		<comments>http://www.rustyrazorblade.com/2008/03/how-to-install-the-lucene-search-engine-using-solr/#comments</comments>
		<pubDate>Sat, 15 Mar 2008 17:01:26 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[lucene]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[solr]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/2008/03/15/how-to-install-the-lucene-search-engine-using-solr/</guid>
		<description><![CDATA[<p>I&#8217;m going to go through the steps necessary to install and start using <a href="http://lucene.apache.org/solr/">Solr</a>. I&#8217;ve always been interested in trying out Lucene, but I never felt like dealing with writing my own wrapper around the classes. Solr simplifies this by creating a fully working search engine as a web service.</p> <p>Let&#8217;s get started. You&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m going to go through the steps necessary to install and start using <a href="http://lucene.apache.org/solr/">Solr</a>.  I&#8217;ve always been interested in trying out Lucene, but I never felt like dealing with writing my own wrapper around the classes.  Solr simplifies this by creating a fully working search engine as a web service.</p>
<p>Let&#8217;s get started.  You&#8217;ll need to check to see if Java is up to date.  Run the below to find out.</p>
<blockquote><p>java -version </p></blockquote>
<p>You need to be running at least Java 1.5.  Next is to check to see if Ant is installed.  Do that with.</p>
<blockquote><p>ant -version</p></blockquote>
<p>I&#8217;m doing this on my Mac using Leopard.  <a href="http://dita-ot.sourceforge.net/doc/DITA-setupant.html">Here&#8217;s some instructions on setting up Ant</a> if you aren&#8217;t using Leopard.</p>
<p>Java was up to date, and ant is built in.  Sweet.  However, I need to install JUnit.  I&#8217;ll do that first.</p>
<p><a href="http://www.junit.org/">Download JUnit.</a>  You&#8217;ll need to put it somewhere that&#8217;s accessible by the $CLASSPATH variable.  There&#8217;s more information on the <a href="http://junit.sourceforge.net/doc/faq/faq.htm#started_2">JUnit FAQ</a>.</p>
<p>I threw it in /usr/share and left the name as junit-4.4.jar and set my CLASSPATH to point to that file (not the directory)</p>
<blockquote><p>export CLASSPATH=$CLASSPATH:/usr/share/junit-4.4.jar</p></blockquote>
<p>I ran that, as well as put it in my /etc/bashrc file (which you must be root to edit) so I don&#8217;t have to deal with it again.</p>
<p><strong>Compile Solr</strong></p>
<p>Switch back to the directory containing the solr files, and run:</p>
<blockquote><p>ant compile</p></blockquote>
<p>You should see something like this:</p>
<blockquote><p>Buildfile: build.xml</p>
<p>init-forrest-entities:</p>
<p>checkJunitPresence:</p>
<p>compile:<br />
    [javac] Compiling 185 source files to /Users/jhaddad/src/apache-solr-1.2.0/build<br />
    [javac] Note: Some input files use or override a deprecated API.<br />
    [javac] Note: Recompile with -Xlint:deprecation for details.<br />
    [javac] Note: Some input files use unchecked or unsafe operations.<br />
    [javac] Note: Recompile with -Xlint:unchecked for details.</p>
<p>BUILD SUCCESSFUL<br />
Total time: 3 seconds</p></blockquote>
<p>I then ran: </p>
<blockquote><p>ant dist</p></blockquote>
<p>Which outputted something like this:</p>
<blockquote><p>Buildfile: build.xml</p>
<p>init-forrest-entities:</p>
<p>checkJunitPresence:</p>
<p>compile:</p>
<p>make-manifest:<br />
    [mkdir] Created dir: /Users/jhaddad/src/apache-solr-1.2.0/build/META-INF</p>
<p>dist-jar:<br />
      [jar] Building jar: /Users/jhaddad/src/apache-solr-1.2.0/dist/apache-solr-1.2.1-dev.jar</p>
<p>dist-war:<br />
      [war] Building war: /Users/jhaddad/src/apache-solr-1.2.0/dist/apache-solr-1.2.1-dev.war</p>
<p>dist:</p>
<p>BUILD SUCCESSFUL<br />
Total time: 0 seconds</p></blockquote>
<p>You can run the example by going to the example directory and running </p>
<blockquote><p>java -jar start.jar</p></blockquote>
<p>Then go here: <a href="http://localhost:8983/solr/admin/">http://localhost:8983/solr/admin/</a> and check out your admin.</p>
<p>Load a few sample docs by going here:</p>
<blockquote><p>/example/exampledocs </p></blockquote>
<p>and running </p>
<blockquote><p>java -jar post.jar solr.xml monitor.xml </p></blockquote>
<p>I will post a follow up on how to get Solr running in Tomcat, as well as examples on how to use the server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2008/03/how-to-install-the-lucene-search-engine-using-solr/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

