<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.1" -->
<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/"
	>

<channel>
	<title>thomasknierim.com</title>
	<link>http://www.thomasknierim.com</link>
	<description>Software development with Java, Scala, and PHP</description>
	<pubDate>Fri, 03 Sep 2010 03:20:24 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
	<language>en</language>
			<item>
		<title>Gimme Gadgets</title>
		<link>http://www.thomasknierim.com/149/web-development/gimme-gadgets/</link>
		<comments>http://www.thomasknierim.com/149/web-development/gimme-gadgets/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 03:20:24 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
		
		<category><![CDATA[Internet]]></category>

		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.thomasknierim.com/149/web-development/gimme-gadgets/</guid>
		<description><![CDATA[There are quite a few reasons to like gadgets. They are usually free and open source by design. They use standard web technologies, such as HTML, CSS, and Javascript. They are -at least in principle- platform-independent and portable. Perhaps most importantly, they are easy to program and deploy, which makes them ideal for small personal [...]]]></description>
			<content:encoded><![CDATA[<p><img align="left" alt="" border="0" height="120" hspace="10" src="http://www.thomasknierim.com/wp-content/uploads/gadgets.jpg" width="120" />There are quite a few reasons to like gadgets. They are usually free and open source by design. They use standard web technologies, such as HTML, CSS, and Javascript. They are -at least in principle- platform-independent and portable. Perhaps most importantly, they are easy to program and deploy, which makes them ideal for small personal applications. I am thinking about keeping oneself informed about the scores of one&#39;s favourite sports team, displaying local bus schedules, or aggregating social network feeds into a custom-designed widget that sits on the desktop. I am sure that every computer user can come up with an idea for a mini-application that they always wanted but never found. Gadgets are the obvious solution, as they have web connectivity and web technology built in.</p>
<p>The first question for the budding gadget developer is then which gadget<br />
	technology to choose. In an ideal world, there would only be a single standardised package format and only a single standardised API. This would allow gadgets to be used on any platform and the question of choosing a format would not even arise. Alas, we don&#39;t live in an ideal world and therefore different platforms and markets have produced different gadget formats. For example, there are Windows desktop gadgets, Linux desktop gadgets, Google gadgets, and gadgets designed to be integrated into web portals. We will look at the different types of gadgets and their use in brief.</p>
<p><a href="http://gallery.live.com">Windows Gadgets<br />
	</a></p>
<p>Formerly known as Windows sidebar, Windows gadgets are based on the widget engine for Microsoft gadgets, which runs on the Windows platform only. A minimal gadget contains an XML configuration file (gadget.xml) and an HTML file (main.html). Other web files can be added. These are zipped for distribution and the resulting file is renamed to *.gadget. Windows gadgets have access to a special API divided into three parts. 1. Gadget objects provide gadget state and event handling. 2. System objects provide access to files, network and OS functions. 3. Presentation objects provide visual functionality, namely background, image, and text handling. Many Windows desktop gadgets can also be run (with slight modifications) inside a Windows Live homepage. The latter don&#39;t have access to the system API and cannot modify the page&#39;s DOM object tree.</p>
<p><a href="http://www.apple.com/downloads/dashboard/">Apple Dashboard<br />
	</a></p>
<p>Dashboard is an application that hosts widgets on a Mac Computer. The widgets are contained in an invisible layer that is activated by clicking on a dock icon, or by pressing a key. Like Windows gadgets, Dashboard widgets are based on standard web technologies. A typical dashboard gadget contains six files: a property list and a JavaScript containing the interactive functionality, and HTML and CSS files, a background image and an icon for the visual design. Dashboard implements a client server architecture with widgets running as clients. There are three classes of Dashboard widgets: Accessory widgets that are self-contained mini-applications like clocks, calculators, etc., application widgets that interact with an existing Mac application, and information widgets that retrieve information from the Internet.</p>
<p>	<a href="http://desktop.google.com/plugins">Google Gadgets</a></p>
<p>As is the case with Windows gadgets, Google gadgets come in different flavours. They are based on the Google Gadget API and run inside an iGoogle page or can be embedded into any web page, usually by loading content from a remote server. Google gadgets can also be run on the desktop if the <a href="http://desktop.google.com">Google Desktop</a> product is installed, which is a bit of a downer, because Google Desktop also contains desktop search functionality that constantly indexes your PC&#39;s filesystem and allows text searches on all of your files. The good news is that the latter functionality can be disabled. Furthermore, there are Google gadgets with enhanced capabilities for the (recently decommissioned) Google Wave application. Like Windows gadgets, Google gadgets consist of XML, HTML, JavaScript (lots of it) and other web files. The advantage over their Windows cousins is that Google gadgets are more platform-independent, since Google Desktop is available for Windows, Linux and Mac. Reusing web gadgets for the desktop (or vice versa) is also easier. The Java-like Google Gadgets API provides methods in the gadgets.* namespace for IO, string and JSON processing, skinning, and other functions. Developers can use the iGoogle gadget editor and gadget testing environment for creating gadgets.</p>
<p><a href="http://widgets.yahoo.com">Yahoo Widgets</a></p>
<p>	Google&#39;s competitor Yahoo also offers a gadget technology called Yahoo widgets based on the Konfabulator product. Yahoo widgets are primarily intended to run on the desktop rather than inside a web page and to that end, users must install the Yahoo widget engine. Unfortunately, this product is closed source and only available for Windows and Mac. Like their cousins, Yahoo widgets are comprised of XML, HTML, JavaScript, CSS (and optionally Flash) and are zipped into a single *.widget file for distribution. The comprehensive Yahoo Widgets API includes functions for event-driven GUI programming, DOM processing, downloading web pages, and access to Yahoo services. It is even possible to create and use an SQLite database with Yahoo widgets or access OS-specific functions by running shell scripts on Windows or AppleScript on the Mac.</p>
<p>	<a href="http://www.instantfundas.com/2007/10/8-widget-engines-for-linux-platform.html">Linux/Unix Gadgets</a></p>
<p>There is a variety of widget engines available for Linux and the market seems to be highly fragmented. For the already mentioned Google gadgets, Linux users can download the open source Google-Gadgets-For-Linux software that allows Google gadgets to be run without Google Desktop. In addition, there are the following widget engines, among others, for which a limited choice of existing widgets is available:</p>
<p>	<a href="http://www.gdesklets.de/">Gdesklet</a> - is a Gnome program for running gadgets on a Linux desktop. Despite its name, it can be also be used with other Desktop managers other than Gnome, like KDE or Xfce. Desklets are applets programmed in the Python language.</p>
<p>	<a href="http://netdragon.sourceforge.net/">SuperKaramba</a> - is a widget engine for the KDE desktop. The visual aspects of a SuperKaramba widget are specified in a text file, while its functionality can be programmed in either Python, Ruby, or JavaScript.</p>
<p>	<a href="http://www.screenlets.org">Screenlets</a> - is a X11/Compiz-based widget engine that is independent of the desktop environment. It supports Python applets with skins drawn in SVG and -more recently- web widgets written in HTML, CSS and JavaScript.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomasknierim.com/149/web-development/gimme-gadgets/feed/</wfw:commentRss>
		</item>
		<item>
		<title>iPhony</title>
		<link>http://www.thomasknierim.com/148/tech-trends/iphony/</link>
		<comments>http://www.thomasknierim.com/148/tech-trends/iphony/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 02:57:04 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
		
		<category><![CDATA[Tech Trends]]></category>

		<guid isPermaLink="false">http://www.thomasknierim.com/148/tech-trends/iphony/</guid>
		<description><![CDATA[One doesn&#39;t need to be a top-class industry analyst to notice that the sales of smart phones is currently exploding. These devices are simply everywhere. Shops are plastered with iPhones and Android phones. The word is that suppliers and manufacturers have difficulties coping with demand. Good times for smartphone makers, I suppose&#8230;
	Although I guess that [...]]]></description>
			<content:encoded><![CDATA[<p><img align="left" alt="" height="259" hspace="10" src="http://www.thomasknierim.com/wp-content/uploads/mobileshell3.jpg" width="194" />One doesn&#39;t need to be a top-class industry analyst to notice that the sales of smart phones is currently exploding. These devices are simply everywhere. Shops are plastered with iPhones and Android phones. The word is that suppliers and manufacturers have difficulties coping with demand. Good times for smartphone makers, I suppose&#8230;</p>
<p>	Although I guess that Android will grab the larger market share in the long run, the Apple iPhone has presently the edge. Apple is clearly the leader, not only in sales, but more importantly in design and technology, as well as in being the most expensive. And what do the other competitors do? Follow the leader, of course.</p>
<p>	As a consequence, one can find a growing number of &quot;i-phony&quot; applications that make your device look like an iPhone. The must have ingredients are: 1) jewel case look - shiny multi-coloured icons on a matt black background, 2) finger-tip sized GUI elements (retire your stylus), and 3) sliding dynamics that allow users to pan and scroll virtual sceens across the display without scroll bars.</p>
<p>	The old adage says: &quot;If you can&#39;t make it, fake it.&quot; If you happen to own a device with an aging operating system, such as Symbian or Windows Mobile, there are ways to jazz up your phone without shelling out half a month&#39;s salary for a new smart phone. <a href="http://www.spbsoftwarehouse.com/pocketpc-software/mobileshell/">SPB&#39;s Mobile Shell 3.5</a>, for example, will give your Pocket PC or phone a new coat of paint. It can&#39;t magically transform your device into an iPhone, but it&#39;s as &quot;i-phony&quot; as it gets without actually copying the Apple look.<br />
	&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomasknierim.com/148/tech-trends/iphony/feed/</wfw:commentRss>
		</item>
		<item>
		<title>NoSQL Databases</title>
		<link>http://www.thomasknierim.com/145/web-development/nosql-databases/</link>
		<comments>http://www.thomasknierim.com/145/web-development/nosql-databases/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 13:59:14 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
		
		<category><![CDATA[Software Engineering]]></category>

		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.thomasknierim.com/145/web-development/nosql-databases/</guid>
		<description><![CDATA[NoSQL databases have entered the radar of web application developers lately. While relational database management systems (RDBMS) have been powering almost every web application on the Internet for more than a decade, this is beginning to change. No longer is the selection of persistence technology a no-brainer. You have additional choices. Besides the old friend [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.thomasknierim.com/wp-content/uploads/2010/07/nosql.png" alt="NoSQL Databases" />NoSQL databases have entered the radar of web application developers lately. While relational database management systems (RDBMS) have been powering almost every web application on the Internet for more than a decade, this is beginning to change. No longer is the selection of persistence technology a no-brainer. You have additional choices. Besides the old friend RDBMS, there are object-oriented databases, graph-oriented databases, key-value stores, column-oriented databases, and other options. Many of the newer products in this area are known as NoSQL databases. NoSQL is a movement that promotes persistence technologies that break with the conventional relational model. NoSQL databases typically don&#8217;t have tables schemas, SQL support, and are designed to scale horizontally.</p>
<p>For those of you old enough to remember Dbase, the NoSQL moniker may not be much of an attention grabber, because after all, products like Dbase, FoxPro, Clipper and similar DB systems never had SQL support either. With these systems, relations had to be expressed implicitly in the application and &#8220;queries&#8221; had to be coded as retrieval sequences. By contrast, modern NoSQL systems depart from the relational model and in many cases also from the tabular data structure, in order to serve use cases where traditional RDBMS fail in one or another way. A typical example would be a sparsely populated table that contains very few data in rows and columns. Such a table -if it grows to a large size- presents an efficiency problem to most RDBMS with resulting performance loss. In the remainder of this article, we will look at a few selected NoSQL databases and see which use cases they cater to.</p>
<p><b>CouchDB</b></p>
<p><a href="http://couchdb.apache.org">Apache CouchDB</a> is a document-oriented database that represents documents as JSON objects. CouchDB supports all data types supported by JSON, or respectively by Javascript. The JSON objects are not required to comply with schemas and can therefore be defined freely, which means that each JSON object can have a different structure. CouchDB supports queries by views. Views are aggregate functions and filters programmed in Javascript that follow the MapReduce algorithm. Views are stored and indexed in the database. CouchDB provides a RESTful API where every object (and any other item) in the database can be retrieved by an URL. It uses the HTTP POST, GET, PUT, and DELETE methods for CRUD operations. Other features include ACID semantics on basis of multi-version concurrency control, similar to RDBMS, which is optimised for a high number of concurrent reads, and a distributed architecture that allows for easy bidirectional replication and offline usage. CouchDB is thus designed from ground up for Internet use.</p>
<p><b>Neo4J</b></p>
<p><a href="http://neo4j.org">Neo4J</a> is a graph database. As the name suggests, it is intended for use with the Java platform, which includes any language that runs on the JVM. Neo4J stores information in nodes and edges; the latter are called relationships in case of Neo4J. Relationships are always of a defined type. Both nodes and relationships can store properties, i.e. data. The Neo4J database is thus optimised for representing complex graph and network structures, such as a hierarchical object repository or a social network. It offers high-performance graph traversal operations for data access. Nodes can also be indexed and retrieved by key which enables more conventional style queries. Additional features include ACID transactions and transaction recovery, based on the Java Transaction API (JTA). Optional libraries can expose a Neo4J database as an RDF store where the node space can be queried using SPARQL. Neo4J is an embedded database with a small footprint that runs in the same JVM as the application.</p>
<p><b>Redis</b></p>
<p><a href="http://code.google.com/p/redis/">Redis</a> is a modern implementation of a persistent key-value store for general purpose use. Key-value store is a name for a simple key-based access mechanism that basically implements a dictionary (or map) data structure. Traditionally, such systems were used for caching and Redis holds its entire database in memory, which makes it ideal for applications that require ultra-fast data access. Redis allows not just plain string data but also allows sets and lists of strings in the data space. The system offers a number of special commands, such as atomic push/pop and add/remove operations for lists and set operations such as building union, intersection, and difference. Redis persists data either by asynchronously writing memory to disk, or by appending to a journalling file as data is written by clients. Additional features include easy master-slave replication and rudimentary sharding. Redis offers support for various languages, such as C/C++, Java, Scala, PHP and others through native drivers and APIs.</p>
<p><b>HBase</b></p>
<p><a href="http://hbase.apache.org">HBase</a> is a free implementation of Google&#8217;s BigTable written in Java. It is not the type of database you would use for a blog or a forum software. HBase is a tabular data storage designed for massive tables in the Petabyte range with billions of rows distributed over a number of physical machines and thus optimised for horizontal scaling. HBase is part of the Apache Hadoop project, a framework for data-intensive distributed applications, inspired by Google&#8217;s MapReduce and GFS technologies. Hadoop supports the database through its distributed filesystem HDFS which provides built-in replication and MapReduce traversal for HBase tables of arbitrary size. Features include optimised query push down via server-side scan and get filters, a high performance Thrift gateway, an XLM-based RESTful Webservice gateway, Hadoop cascading, per-column probabilistic Bloom filters, as well as data warehousing and data analysis modules. Since HBase saves column families rather than columns and since empty columns are not stored, it is ideal for sparse tables with semi-structured data. Typical use cases are cloud computing and applications that require massive storage using cheap commodity hardware.</p>
<p><b>Db4o</b></p>
<p><a href="http://www.db4o.com">Db4o</a> is an open-source object-oriented database system targeted at OOP developers. The idea behind Db4o is to enable programmers to create and persist a representation of the application object model directly in the database without the need for an object-relational mapping software layer. Object instances can then be stored and retrieved with a single line of code. Db4o provides a query mechanism called Native Query (NQ). This allows querying data with native OOP language constructs thus offering type safety for query expressions while eliminating the need for building query strings. Db4o is available for the Java and .NET platforms. If used with .NET languages, data can alternatively be queried with LINQ (language integrated query). The Db4o database is embeddable with a small footprint suitable to be deployed on mobile devices. Additional features include semi-automatic schema versioning, transaction support with ACID semantics, and  synchronisation/replication mechanisms that allow synchronisation between different Db4o instances and data export into SQL databases.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomasknierim.com/145/web-development/nosql-databases/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Onward To Lucid Lynx</title>
		<link>http://www.thomasknierim.com/144/management/onward-to-lucid-lynx/</link>
		<comments>http://www.thomasknierim.com/144/management/onward-to-lucid-lynx/#comments</comments>
		<pubDate>Wed, 05 May 2010 07:55:51 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
		
		<category><![CDATA[IT Management]]></category>

		<category><![CDATA[Open Source]]></category>

		<category><![CDATA[Tech Trends]]></category>

		<guid isPermaLink="false">http://www.thomasknierim.com/144/management/onward-to-lucid-lynx/</guid>
		<description><![CDATA[Ubuntu 10.04 alias Lucid Lynx has arrived and because this is a long-time support version, many users are bound to upgrade within the next few weeks. It seems like the GUI people from Canonical were unusually daring this time. Not only is this the first Ubuntu version that sports a graphical interface that is NOT [...]]]></description>
			<content:encoded><![CDATA[<p>Ubuntu 10.04 alias Lucid Lynx has arrived and because this is a long-time support version, many users are bound to upgrade within the next few weeks. It seems like the GUI people from Canonical were unusually daring this time. Not only is this the first Ubuntu version that sports a graphical interface that is NOT BROWN (shock!), but the window control buttons are on the wrong side, namely on the left (double shock!). Apparently, Mac OSX Leopard has godfathered here. Well, I am not going to get used window controls on the left side, so I applied a <a href="http://ftbeowulf.wordpress.com/2010/03/21/ubuntu-10-04-window-controls/">quick fix</a> which is amply documented on the Internet, as many people seem to feel the same way. Otherwise, the new look is a welcome change, as the permutations of brown and orange seemed to have been exhausted.</p>
<p>The only thing that turned out to be slightly trickier was the Tomcat upgrade to 6.0.24. A surreptitious installation of Apache 2 (the purpose of which eluded me) took possession of port 80 which on my machine was previously occupied by the system-wide Tomcat installation. This was rather easy to solve with the command: <b>sudo update-rc.d -f apache2 remove</b> to disable Apache on boot. It turned out, however, that the application launcher jsvc was removed in Ubuntu 10.04. Since Tomcat previously used jsvc to launch Tomcat on privileged ports, Tomcat was not able to bind to port 80 any longer. I was able to solve this by setting the <b>AUTHBIND</b> variable in <b>/etc/default/tomcat</b> to &#8216;yes&#8217;. After that Tomcat started up on port 80 without complaints. </p>
<p><img src="/wp-content/uploads/2010/07/ubuntudefaulttheme_01.jpg" alt="Ubuntu 10.04 Default Theme" title="Ubuntu 10.04 Default Theme" style="margin-left:10px; margin-right:10px; margin-bottom: 10px"/></p>
<p>During the upgrade, the system politely asked whether to replace or keep manually changed system configuration files. I have chosen to replace most files, because, the upgrade manager is kind enough to  create a copy of the existing configuration using the *.dpkg-old extension during the upgrade. That way I was able to diff configuration files later and incorporate any customisations into the new files. This method is superior to keeping the old files, because it allows for upgrading the configuration files in sync with the latest program versions, though, of course it takes a bit of work manually diffing and patching those files if you happen to have numerous customisations. You can alternatively keep the old files and then diff and patch the new files created by the upgrade manager with the *.dist extension. In summary, the upgrade was painless and took less than 90 minutes per machine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomasknierim.com/144/management/onward-to-lucid-lynx/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Scala Pages Released</title>
		<link>http://www.thomasknierim.com/143/scala/scala-pages-released/</link>
		<comments>http://www.thomasknierim.com/143/scala/scala-pages-released/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 03:45:57 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
		
		<category><![CDATA[Scala]]></category>

		<guid isPermaLink="false">http://www.thomasknierim.com/143/scala/scala-pages-released/</guid>
		<description><![CDATA[I am glad to announce the first release of the Scala Pages (SCP) lightweight web framework, which I wrote for a personal web application project. Although it&#8217;s still at a humble stage of development, I believe it is useful enough to be shared. I am planning to extend it in future and I hope that [...]]]></description>
			<content:encoded><![CDATA[<p>I am glad to announce the first release of the Scala Pages (SCP) lightweight web framework, which I wrote for a personal web application project. Although it&#8217;s still at a humble stage of development, I believe it is useful enough to be shared. I am planning to extend it in future and I hope that it will contribute to increased diversity in the Scala web development area. Software and manual can be downloaded from this page:</p>
<p><a href="http://www.thomasknierim.com/scala-pages-web-framework/" title="Scala Pages Web Framework">http://www.thomasknierim.com/scala-pages-web-framework/</a></p>
<p>The source code is included in the distribution zip file. Comments, suggestions, and constructive criticism are always welcome.</p>
<p>Addendum: I was asked to make a brief comparison to the Lift framework, so here&#8217;s my answer:</p>
<p>The approach that SCP takes is different. To put it in a nutshell, Lift is Rails-inspired, XML-oriented, and it abstracts from the Servlet API and the request/response model. SCP is inspired by traditional Java MVC frameworks; it is text-oriented, and it builds directly on the request/response model and the Servlet API.</p>
<p>Lift processes templates using the SAX-parser and presents Scala XML data structures to the programmer. By contrast, SCP reads templates as plain text from top to bottom, performs variable replacement and executes embedded instructions. Template processing with SCP thus consumes fewer resources. Lift uses prefixed XML tags; SCP uses processing instructions.</p>
<p>Lift wraps much of the Servlet API and presents a number of abstracted objects to the programmer, such as the S object, the SHtml object, LiftRules, and so on. SCP doesn&#8217;t do that. With SCP you get the familiar JEE objects such as HttpServletRequest, ServletContext, etc. and you use these directly from the Scala code. So, it&#8217;s easy to use if you&#8217;ve done Java web development.</p>
<p>The consequence is that you deal with the request/response model directly, which I personally prefer, because it keeps the control flow simple and clear. The only disadvantage of the MVC request/response model is that controllers tend to become bulky and difficult to reuse. The SCP solution to this problem is the same that Lift offers: snippets.</p>
<p>In SCP, snippets are processing instructions powered by a custom Scala class that the programmer provides. This means you can encapsulate application logic and/or complicated display logic into a snippet class which -if properly coded- is perfectly reusable. SCP also keeps template expressions very simple, because the more complex a template language becomes (many are even Turing-complete), the more likely it is for application logic to sneak into the view. Currently, iteration is the only supported type of control-flow.</p>
<p>Last but not least, Lift is huge compared to SCP. It has a lot of functionality that SCP does not offer, at least not at this time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomasknierim.com/143/scala/scala-pages-released/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Serve PHP with Tomcat</title>
		<link>http://www.thomasknierim.com/140/web-development/serve-php-with-tomcat/</link>
		<comments>http://www.thomasknierim.com/140/web-development/serve-php-with-tomcat/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 04:03:55 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.thomasknierim.com/140/web-development/serve-php-with-tomcat/</guid>
		<description><![CDATA[As you can gather from the title of this website, I create software in Java, Scala, and PHP. While Java and Scala compile to bytecode that runs on the same virtual machine, PHP is executed by a separate interpreter. The most efficient way to run PHP scripts is to integrate the interpreter directly into the [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.thomasknierim.com/wp-content/uploads/2010/02/tomcat-php01.png" alt="tomcat-php01.png" />As you can gather from the title of this website, I create software in Java, Scala, and PHP. While Java and Scala compile to bytecode that runs on the same virtual machine, PHP is executed by a separate interpreter. The most efficient way to run PHP scripts is to integrate the interpreter directly into the webserver. Hence, most PHP developers use a local Apache Httpd server with mod_php for development. If you also do Java programming, this raises the problem that you need two different web servers, namely Tomcat (or another web container or appserver) for Java development and Apache for PHP development.</p>
<p>Running two servers is a bit of a nuisance. Two servers consume more resources than one and you cannot run both on the same port. This problem can be solved in three different ways: you can only run one server at a time, you can use a different port number for one server which has to be included in the URLs, or you can integrate the two servers. There are again at least three different ways to accomplish the latter: you can proxy requests from Apache to Tomcat, you can proxy request from Tomcat to Apache, or you can use a connector module, such as mod_jk. Of course, maintaining two servers is is more complicated than maintaining one, and the integration adds additional complexity. Fortunately, there is an easier way to integrate PHP and Java web applications.</p>
<p>PHP/Java Bridge is a free open source product for the integration of the native PHP interpreter with the Java VM. It is designed with web applications in mind: Java servlets can &#8220;talk&#8221; to PHP scripts and vice versa. The official website describes it as an &#8220;implementation of a streaming, XML-based network protocol which is up to 50 times faster than local RPC via SOAP.&#8221; PHP/Java Bride requires no additional components to invoke Java procedures from PHP or vice versa. Although there are a number of different use cases, I am going to describe a particular one in this article, namely how to configure Tomcat with PHP/Java Bridge in order to have Tomcat serve PHP web pages. Let&#8217;s start with software requirements. We need the following software packages:</p>
<ul>
<li>A Java virtual machine (JRE is sufficient, but JDK recommended for developers)</li>
<li>A recent version of Apache Tomcat (<a href="http://tomcat.apache.org" target="_blank">http://tomcat.apache.org</a>)</li>
<li>A recent version of PHP (standalone, without Webserver: <a href="http://php.net" target="_blank">http://php.net</a>)</li>
<li>PHP/Java Bridge (<a href="http://php-java-bridge.sourceforge.net/pjb/" target="_blank">http://php-java-bridge.sourceforge.net/pjb/</a>)</li>
</ul>
<p>Follow the standard installation procedures for the JVM, Tomcat, and PHP. On Linux, you can use the standard packages for your distribution and on Windows you can use the regular installers. Make sure that both Tomcat and PHP are installed properly, which means that you should see Tomcat&#8217;s welcome web page at http://localhost:8080 and you should be able to execute a PHP script via the command line by invoking the standalone &#8220;php&#8221; command. The PHP/Java Bridge product does not use the regular executable, however, but fast CGI. The fast CGI executable is called php-cgi (or Php.cgi.exe on Windows), so you must make sure that your PHP installation contains it. Then you are all set to install and configure the PHP/Java Bridge.</p>
<p>The PHP/Java Bridge package comes with a sample web application named JavaBridge.war. Deploy the application in Tomcat, point your browser to http://localhost:8080/JavaBridge and try out the examples. If this works, you are half-finished. To provide the capability to execute PHP scripts server-wide, not just in a single web application, you need to make some changes to the Tomcat configuration. Find the three jar files named JavaBridge.jar, php-servlet.jar and php-script.jar (look in WEB-INF/lib) and move them to Tomcat&#8217;s shared library directory. This is usually found in $CATALINA_HOME/lib (or $CATALINA_HOME/shared in older Tomcat installations). Then edit Tomcat&#8217;s conf/web.xml configuration file and add the following lines:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
</pre></td><td class="code"><pre class="xml xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;listener<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;listener-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    php.java.servlet.ContextLoaderListener
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/listener-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/listener<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>PhpJavaServlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    php.java.servlet.PhpJavaServlet
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>PhpCGIServlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    php.java.servlet.PhpCGIServlet
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;init-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>prefer_system_php_exec<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>On<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/init-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;init-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>php_include_java<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>On<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/init-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>PhpJavaServlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>*.phpjavabridge<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>PhpCGIServlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>*.php<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>This adds the listeners and servlets required for PHP script execution to all web applications. While you are at it, you might also want to enable index.php files to display when a directory URL is requested. Simply add it to the list of welcome files in conf/web.xml. My list looks like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="xml xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;welcome-file-list<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;welcome-file<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>index.html<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/welcome-file<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;welcome-file<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>index.htm<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/welcome-file<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;welcome-file<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>index.jsp<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/welcome-file<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;welcome-file<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>index.php<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/welcome-file<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/welcome-file-list<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Now you can copy PHP scripts into the context root directory of any web application and type the script URL into your browser. I suggest you try a script with phpinfo(). It gives you plenty of useful configuration info. If this doesn&#8217;t work and you are on Unix, the problem might be file permissions. On my machine, I had to copy the contents of &#8220;java&#8221; directory in the JavaBridge webapp manually to the context root directory where PHP applications were installed. This directory contains two files Java.inc and JavaProxy.php. Normally, the PHP/Java Bridge software copies it automatically, but it might not be able to do so if it does not have proper permissions:</p>
<pre>~$ ls -lh /var/lib/tomcat6/webapps/ROOT/java
total 136K
-rw-rw-r-- 1 root root 64K 2009-12-30 14:14 Java.inc
-rw-rw-r-- 1 root root 64K 2009-12-30 14:14 JavaProxy.php</pre>
<p>Now try calling a PHP script. For example, a script containing the phpinfo() command displays information about the server:</p>
<p><img src="http://www.thomasknierim.com/wp-content/uploads/2010/02/tomcat-config.png" alt="tomcat-config.png" /></p>
<p>I have configured my machine to host all PHP web applications in Tomcat&#8217;s ROOT context. This eliminates the extra path component of the webapp context, since the ROOT&#8217;s context path is &#8220;/&#8221;. Then I softlinked the folder that contains all my PHP projects into the ROOT webapp directory, so that the actual source files are kept separate from the Tomcat installation. In order to enable Tomcat to follow symlinks, you need to edit the context.xml of the respective web application -in this case ROOT- and add the line: &lt;Context path=&#8221;/&#8221; allowLinking=&#8221;true&#8221; /&gt; .</p>
<p>Another possible gotcha is Tomcat&#8217;s security manager, which is enabled by default on Ubuntu, but not on Windows. Although a security manager is not necessary for most development scenarios, it is highly recommended for production. I consider it good practice to enable the security manager on the development machine, because it allows me to recognise security problems early during development, before the application is deployed on the production server. The downside is that additional configuration may be required, for PHP applications to function properly. The respective configuration files are located in $CATALINA_BASE/conf/policy.d. Most likely, you need to grant PHP web applications write access to files in the document root and possibly other permissions, such as opening sockets, etc. It&#8217;s probably safest to do this on a per-application basis.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomasknierim.com/140/web-development/serve-php-with-tomcat/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ubuntu Newbie Tips</title>
		<link>http://www.thomasknierim.com/136/open-source/ubuntu-newbie-tips/</link>
		<comments>http://www.thomasknierim.com/136/open-source/ubuntu-newbie-tips/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 07:55:16 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
		
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://www.thomasknierim.com/136/open-source/ubuntu-newbie-tips/</guid>
		<description><![CDATA[I&#8217;ve been using Linux on servers in various flavours since 1997, but I am relatively new to Ubuntu and I have just started using Ubuntu as a desktop OS. Despite some installation problems, the overall experience was very positive. I had made earlier attempts to switch over to Linux, but for one or another reason [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.thomasknierim.com/wp-content/uploads/2010/01/ubuntu.png" alt="ubuntu.png" />I&#8217;ve been using Linux on servers in various flavours since 1997, but I am relatively new to Ubuntu and I have just started using Ubuntu as a desktop OS. Despite some installation problems, the overall experience was very positive. I had made earlier attempts to switch over to Linux, but for one or another reason these were thwarted, mostly because of the professional necessity of testing software under Windows. Since I am now working on cross-platform applications that particular constraint has evaporated. I spend most of my day developing software and writing documentation. Before installing Ubuntu, I was slightly concerned that there would be a temporary decrease in productivity due to having to learn new software. However, this turned out to be largely unfounded.</p>
<p>Most of the key applications like Eclipse, Firefox, Thunderbird, and OpenOffice work exactly the same under Linux as they do under Windows. The only major change was replacing Notepad++ (which only runs on Windows) by vi/vim. These editors are suitable for programming in situations where you don&#8217;t want to fire up an IDE. Furthermore, I have made some customisations to ease the transition, which I&#8217;d like to share with you. If you are new to Linux, you might find one or another useful for your own work. The following list is by no means exhaustive or even comprehensive, just a number of things I stumbled across during my first two weeks with desktop Ubuntu.</p>
<p><strong>Repositories and download servers</strong><br />
Ubuntu maintains software packages with the Synaptic package manager. Because as a new user you are likely to make frequent use of this tool, one of the most useful things to do is to optimise its usage. This involves defining the repositories and the download server. Choose System/Administration/Software Sources from the main menu. In the first tab “Ubuntu Software”, select the four items marked with “main”, “universe”, “restricted” and “multiverse” for the widest choice of software packages. Next, optimise the download server. I wasted a whole day with downloading the 9.04-&gt;9.10 update, because of a slow server. Ubuntu can find the fastest server for you. Select “Other&#8230;” in the “Download from” dropdown-box. A dialogue with a list of servers shows on screen. Click on “Select Best Server” to let Ubuntu test all available servers for their response time and select the fastest one.</p>
<p><strong>Keyboard and language customisations</strong><br />
If you are -like me- frequently typing text in different languages, chances are that the default language and keyboard settings will not suit you. Fortunately, Ubuntu is easy to configure for international use, possibly even superior to Windows in this regard. First, I added Thai language support in System/Administration/Language Support. Then I configured two additional keyboard layouts, German and Thai, in System/Preferences/Keyboard/Layout. As I am using a Thai/English keyboard, I have to remember the German key mapping by heart which is only of limited use. On Windows I got used to producing international characters by typing ALT+num key sequences. On Linux, this is even easier thanks to the concept of the compose key. In the keyboard layout dialogue, click on “Layout Options” which will show you a number of intricate keyboard customisation options. Click on “Compose key position” and pick a key, for instance “Right Alt”. Now you can use this key to compose international characters. For example, type right Alt, double quotation marks, and letter &#8216;u&#8217; to produce the German Umlaut &#8216;ü&#8217;. Type right Alt, backtick and the letter &#8216;a&#8217; to produce the accent grave &#8216;à&#8217;. Voilà!</p>
<p><strong>Customising Nautilus</strong><br />
Nautilus is the Linux/Gnome equivalent to the Windows Explorer. In fact, I find it to be superior to the latter, because it supports protocols for remote access (such as ftp/sftp); it offers better search capability and better support for compressed files. If you prefer to work with a GUI rather than the command line, you would probably want to customise Nautilus in some way. The most obvious candidates for customisation are probably file associations. These can be defined by right-clicking on a file, selecting “Properties” from the context menu and switching to the “Open With” tab in the property dialogue. Here you can define alternative applications to use for opening a file, as well as the default application that is started upon double-click. If you need even more customisation options, install the package named “nautilus-actions”. This package lets you define custom actions for file entries in Nautilus which can be incorporated into the context menu. Predefined Nautilus extensions (aka shell extensions) for various file display and transformation purposes are also available.</p>
<p><strong>Command line and terminal customisations</strong><br />
Ubuntu comes with the bash (Bourne again shell) and the Gnome-Terminal as command line defaults. These are fine for me. However, there is one feature which I found missing in the terminal application. It is not possible to search the output buffer. For example, when I run applications that produce a large amount of diagnostic output, there is no intuitive way to search trough this data, other than piping it into a command like “less”. I have found a little program named “screen” which appears to solve this problem. After “screen” is started, virtual sessions can be created within the same terminal window, each with its own searchable buffer. “Screen” involves remembering some arcane keyboard commands, but that&#8217;s the best I could find so far. Another command line annoyance is that the “vi” editor runs in compatible mode by default. This will let the cursors keys produce character output in insert mode; in other words, the cursor keys are broken. There is an easy fix for this, however. Put a file named .vimrc in your home directory that contains a single line saying “set nocompatible” and the cursor keys will work again.</p>
<p><strong>Backup and antivirus software</strong><br />
Surprisingly, neither backup nor antivirus software packages are included in the default Ubuntu installation. Although viruses are probably not an immediate threat on a Linux system, I would rather not breed any of them on my machine. There is the open source software clamAV as well as a number of free-for-private-use commercial offerings for Linux. I am still evaluating antivirus software. So far I found clamAV and AVG quite usable, but not quite as convenient as under Windows. Backup software is an absolute necessity in my opinion, and I am surprised that it isn&#8217;t integrated in the original Ubuntu installation. Of course, individual backup needs differ, but a simple mirroring and archiving facility is probably required for even the most basic usage. Initially, I planned to hack a script based on rsync together for that purpose, but I have found something much nicer. The “backintime” package lets you create incremental backups with great ease and minimal storage requirements. Backintime revolves around the concept of snapshots; it is a GUI framework for rsync, diff, and cron. I highly recommend it.<ins datetime="2010-01-10T07:41:14+00:00"></ins></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomasknierim.com/136/open-source/ubuntu-newbie-tips/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Computing 2010</title>
		<link>http://www.thomasknierim.com/135/tech-trends/computing-2010/</link>
		<comments>http://www.thomasknierim.com/135/tech-trends/computing-2010/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 01:14:15 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
		
		<category><![CDATA[Tech Trends]]></category>

		<guid isPermaLink="false">http://www.thomasknierim.com/135/tech-trends/computing-2010/</guid>
		<description><![CDATA[Today, I came across an interesting article in the Forbes Magazine entitled &#8220;Computing 2010&#8243;. The interesting part is that this article was written ten years ago. The author, Kip Crosby, imagined what computers would look like in 2010: optical circuits instead of silicon, with a CPU running at 100 GHz, holographic mass storage offering several [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.thomasknierim.com/wp-content/uploads/2010/01/pc.jpg" alt="pc.jpg" />Today, I came across an <a href="http://www.forbes.com/asap/2000/0821/087.html" target="_blank">interesting article in the Forbes Magazine</a> entitled &#8220;Computing 2010&#8243;. The interesting part is that this article was written ten years ago. The author, Kip Crosby, imagined what computers would look like in 2010: optical circuits instead of silicon, with a CPU running at 100 GHz, holographic mass storage offering several TB capacity, 256 GB optoelectronic RAM,  biometric authentication, voice control, completely wireless and shaped like a frisbee. Whew! Looks like Kip was just a tad too optimistic. Optoelectronics hasn&#8217;t caught on and most computers are still boxy rather than frisbee-ish. In fact, todays&#8217;s PC looks pretty much like that of 2000, except that its capacity has increased roughly following Moore&#8217;s law. The only accurate prediction is about mass storage capacity, although that didn&#8217;t require optical technology.</p>
<p>Personally, I&#8217;ve begun the new computing year with a major upgrade, though still far away from Kip&#8217;s 2010 vision. I have replaced my 32-bit Windows OS with a 64-bit Linux OS, doubled RAM from 4 GB to 8 GB and added another external USB hard drive for backups. The Ubuntu installation turned out a little difficult, because Linux did not want to cooperate with the BIOS RAID-1 configuration, so I had to switch to SATA mode and wipe out the Windows installation. The rest was easy, however. I used to worry about not being able to make my 3G USB modem work with Linux, but our maid has solved this problem for me. She obliterated the device by putting it into the washing machine. Can&#8217;t really blame her for that. I probably shouldn&#8217;t have carried the modem in the pockets of my shorts.</p>
<p>Back to the topic. What are the computing trends in 2010? Just off the top of my head: cloud computing is becoming a mainstream technology (or perhaps a mainstream buzz; time will tell). Along with that, virtualisation is now widely used. Supercomputers have broken the petaflop mark and now operate in the range of large clouds (&gt; 1 PFlop). CRT monitors are quickly becoming relics of a past epoch. Single-core CPUs are headed the same way. Functional programming languages are beginning to catch on. 64-bit hardware and software are overtaking 32-bit systems in mainstream IT. Java 7 is announced for 2010. It surely looks like an interesting year.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomasknierim.com/135/tech-trends/computing-2010/feed/</wfw:commentRss>
		</item>
		<item>
		<title>JSP Nightmares</title>
		<link>http://www.thomasknierim.com/133/java/jsp-nightmares/</link>
		<comments>http://www.thomasknierim.com/133/java/jsp-nightmares/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 01:47:23 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.thomasknierim.com/133/java/jsp-nightmares/</guid>
		<description><![CDATA[Once upon a time as a Java newbie, I thought that Java Server Pages were great. Back then I had done web development in Perl and PHP and I was pleasantly surprised by the similarity of the development process. It&#8217;s as simple as write and run. No bothersome compiler runs and deployment cycles. Java Server [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.thomasknierim.com/wp-content/uploads/2009/12/jsp-nightmare.jpg" alt="jsp-nightmare.jpg" />Once upon a time as a Java newbie, I thought that Java Server Pages were great. Back then I had done web development in Perl and PHP and I was pleasantly surprised by the similarity of the development process. It&#8217;s as simple as write and run. No bothersome compiler runs and deployment cycles. Java Server Pages seemed like PHP on steroids. Actually, I still think this is a fairly accurate description. It&#8217;s what the designers of JSP intended - Java&#8217;s answer to dynamic web scripting languages. The question is whether the JSP design is sound. After having spent several years in the Java Enterprise world, and having maintained large amounts of JSP code, I am convinced that it isn&#8217;t. So I am writing this article to tell you the untold nightmares of JSP programming.</p>
<p>Before we are going into that, let&#8217;s briefly look at the bright side. JSP technology is tempting for several reasons. First, it is mainstream and it bears the official stamp of approval by Sun. Second, it is an integral part of JEE and widely supported by application servers and tools. Third, it it is relatively easy to whip up dynamic content with JSP. So, why not use Java Server Pages? Well, there are several problems, the biggest of which are scriptlets. Scriptlets are embedded Java code. Because JSP allows you to mix Java code with markup, you get hybrid files which tend to become messy and difficult to maintain. Few HTML designers understand what&#8217;s going on in a JSP file. Few programmers are comfortable with mixing their code with reams of markup.</p>
<p>The typical production process for a JSP-based application looks like this: the UI designers finish their protoypes and hand over the resulting markup to the programmers. The programmers tear apart the HTML to make it easier to insert code, repeat  sequences, and insert display logic. Once the programmers are finished, there is absolutely no chance that the designers will recognise the markup they produced. It is therefore also unlikely that they will ever touch it again. Even if the finished product contains no scriptlets, JSTL, expression language and (God help us) custom tags will confuse the hell out of designers. This means that the entire process has to be repeated,  everytime a change of visuals is requested. This is however not the worst problem.</p>
<p>The biggest drawback is that there is absolutely no way to prevent application logic from creeping into the JSPs which ultimately leads to spaghetti code. You might think, “Oh well, I know how to code my JSPs properly.” At this point you should remember Murphy&#8217;s law, especially the part that says: “if something can go wrong it will go wrong.” Perhaps you are a disciplined individual who wouldn&#8217;t even dream about putting application logic into a JSP file. But can you say the same about the other programmers in your team? What if work needs to be completed under time pressure? Can you resist the temptation to solve a problem quick-and-dirty by putting a hack into a JSP file along with a “will fix this later” note? I have seen way too many “will fix this later” notes in JSPs and most of them were several years old.</p>
<p>My project consisted of an application with roughly 1.5 million LOC where about half of the code was implemented in JSPs. That&#8217;s about 1500-2000 JSP files. Most files were less than 500 lines, but some were in excess of 2000 lines. Once you hit upon an XL-sized JSP, it&#8217;s a safe bet that some crucial functionality is buried in it. Reading and understanding a 2000 line JSP can take several hours. Modifying and maintaining it is quite another deal. The project did not attempt to separate business logic from display logic in JSPs, thus XML was liberally mixed with scriptlets. While this approach works OK for narrow functionality that can be coded  in a single JSP, it becomes very unwieldy for functionality that spans a larger problem space and, hence, many JSPs.</p>
<p>The “solution” for this was to use scriptlet fragments which are shared by multiple JSPs. This isn&#8217;t a real solution, however, because it forgoes almost all advantages of using an OOP language, such as abstraction, encapsulation, inheritance, and as a side effect it produces “ultra-tight coupling” between JSPs that use the same fragments. In theory, this can be made slightly less painful by defining inner classes in fragments for shared functionality. These class fragments are then included in the consuming JSPs at compile time. However, inner classes have their own limitations and compile time includes bulk up the resulting byte code. Since inner classes can access variables and methods in the outer scope, they lack proper encapsulation. Tying them to multiple consumers can lead to some weird dependencies and logical errors. Finally, there is no way to produce unit tests for scriptlets. The only way to test scriptlets is by inserting the test code directly into the JSP, which is obviously insane. In summary, there is no way to code scriptlets cleanly, so it&#8217;s best to avoid them.</p>
<p>But even without scriptlets, there&#8217;s plenty of trouble. For example, there is the Java standard tag library (JSTL) and the expression language (EL) which are supposed to replace scriptlets as coding instruments. In particular, the EL has been praised as enabling clean coding for MVC applications with Java Server Pages as view component. - Well, I disagree. - JSTL+EL are neither very clean nor very concise. What is worse, they are too powerful for their own good. JSTL+EL are Turing-complete, just like XSLT which they resemble, which means that replacing scriptlets with JSTL+EL is like jumping from the frying pan into the fire. In addition, JSTL provides tags that allow programmers to access a database and execute queries. If you see MVC going out of the window at this point, you have recognised the problem. In summary, JSTL+EL produce the same problems as scriptlets, but with an XML syntax.</p>
<p>In conclusion, Java Server Pages can lead to maintenance nightmares, especially when used in a large project. While it is possible to code JSPs cleanly, it is apparently not a widespread practice, which is probably Murphy&#8217;s law taking its toll. Hence, if you are building a new Java web application, think twice about using JSP. If you have a legacy application, you might want to replace JSPs by something more appropriate. In most cases, this can be done gradually whereas legacy JSPs can run side by side with an alternative view technology.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomasknierim.com/133/java/jsp-nightmares/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ant script for Scala with Lift</title>
		<link>http://www.thomasknierim.com/131/web-development/ant-script-for-scala-with-lift/</link>
		<comments>http://www.thomasknierim.com/131/web-development/ant-script-for-scala-with-lift/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 16:08:49 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
		
		<category><![CDATA[Scala]]></category>

		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.thomasknierim.com/131/web-development/ant-script-for-scala-with-lift/</guid>
		<description><![CDATA[Today I&#8217;d like to present another Ant script for Scala development. I promise it&#8217;s going to be the last one, but I felt this mini series wouldn&#8217;t be complete without it. This script is for developing a Lift application with Scala. I became interested in Lift in the first half of this year, but unfortunately, [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;d like to present another Ant script for Scala development. I promise it&#8217;s going to be the last one, but I felt this mini series wouldn&#8217;t be complete without it. This script is for developing a Lift application with Scala. I became interested in Lift in the first half of this year, but unfortunately, I wasn&#8217;t able to install it when I wanted to give it a try, because of some besetting problems with Maven. Deplorably, the Lift developers have made Maven a requirement for Lift. If you go to the <a href="http://liftweb.net/download.html" title="Lift Download Page" target="_blank">Lift download page</a>, you wont find a Lift package but a Maven package which you must install in order to retrieve Lift from the central repository. Alternatively, you can fetch the latest <a href="http://github.com/dpp/liftweb" title="Lift Sources" target="_blank">Lift sources from GitHub</a>, but then you still need Maven to get the examples to work. Since Maven and I have a difficult relationship, I mentioned this to the Lift community earlier this year. The community seemed quite pleased with Maven, however, and had little interest in supporting alternatives. Hence, I&#8217;ve adapted the Ant script from the last article in order to work with Lift and -while we are at it- replaced the Jetty server that is bundled with Lift with Tomcat.</p>
<p>I hope this will be useful for people interested in tinkering with Lift who want to avoid the aggravation of having to deal with Maven. As usual, you can <a href="/code/scala-lift-with-ant.zip" title="Download Ant file and Lift 1.0">download the project sekeleton and Ant build file</a> right here. I have packaged the Lift 1.0 jars as well as its dependencies (commons-fileupload.jar and log4j.ar), so that you can get the helloworld example to run without additional installation steps. If you plan to use this for your work, you should replace the Lift jars with the most recent versions from GitHub. The Ant script has the same target definitions as the one I presented for general Web development including deploy, undeploy and reload. The Lift dependencies are likewise handled in the same way, as the script uses everything it finds in the WEB-INF/lib directory. Your only responsibility is to put the right jars in there. The main difference consists of a different directory tree structure that reflects the layout of a standard Lift project. This means you won&#8217;t have to rearrange things if you move a project from Maven to Ant. In fact all of the Lift examples should run simply by dropping in the sources (I&#8217;ve tried this for a few but not all examples). So, here&#8217;s the Ant script:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
</pre></td><td class="code"><pre class="xml xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;hellolift&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;build&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
  <span style="color: #808080; font-style: italic;">&lt;!-- root directory of this project --&gt;</span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;project.dir&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;.&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
  <span style="color: #808080; font-style: italic;">&lt;!-- root directory of Scala installation --&gt;</span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;scala.home&quot;</span> </span>
<span style="color: #009900;">    <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;C:\\Program Files\\Scala&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
  <span style="color: #808080; font-style: italic;">&lt;!-- root directory of Tomcat installation --&gt;</span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;server.home&quot;</span> </span>
<span style="color: #009900;">    <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;C:\\path\\to\\Tomcat\\installation&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
  <span style="color: #808080; font-style: italic;">&lt;!-- URL for Tomcat's manager application --&gt;</span>  
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;server.manager.url&quot;</span> </span>
<span style="color: #009900;">    <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;http://dev:8080/manager&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
  <span style="color: #808080; font-style: italic;">&lt;!-- account name for Tomcat's admin account --&gt;</span>  
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;server.manager.username&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;admin&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
  <span style="color: #808080; font-style: italic;">&lt;!-- password name for Tomcat's admin account --&gt;</span>  
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;server.manager.password&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;admin&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
  <span style="color: #808080; font-style: italic;">&lt;!-- location of scalatest.jar for unit testing --&gt;</span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;scalatest.jar&quot;</span> </span>
<span style="color: #009900;">    <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;C:\\path\\to\\scalatest-1.0\\scalatest-1.0.jar&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;init&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
    <span style="color: #808080; font-style: italic;">&lt;!-- derived path names --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;source.dir&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${project.dir}/src&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;web.dir&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${project.dir}/web&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;classes.dir&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${web.dir}/WEB-INF/classes&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;lib.dir&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${web.dir}/WEB-INF/lib&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;webapp.dir&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${server.home}/webapps/${ant.project.name}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;test.dir&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${project.dir}/test&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
    <span style="color: #808080; font-style: italic;">&lt;!-- scala libraries for classpath definitions --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;scala-library.jar&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${scala.home}/lib/scala-library.jar&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;scala-compiler.jar&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${scala.home}/lib/scala-compiler.jar&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
    <span style="color: #808080; font-style: italic;">&lt;!-- classpath for the compiler task definition --&gt;</span>   
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;path</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;scala.classpath&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${scala-compiler.jar}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${scala-library.jar}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/path<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #808080; font-style: italic;">&lt;!-- classpath for project build --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;path</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;build.classpath&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> </span>
<span style="color: #009900;">        <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${server.home}/lib/servlet-api.jar&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${scala-library.jar}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${lib.dir}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;*.jar&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${classes.dir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/path<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #808080; font-style: italic;">&lt;!-- classpath for unit test build  --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;path</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;test.classpath&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;path</span> <span style="color: #000066;">refid</span>=<span style="color: #ff0000;">&quot;build.classpath&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${scalatest.jar}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/path<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #808080; font-style: italic;">&lt;!-- definition for the </span>
<span style="color: #808080; font-style: italic;">      &quot;scalac&quot; and &quot;scaladoc&quot; ant tasks --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> <span style="color: #000066;">resource</span>=<span style="color: #ff0000;">&quot;scala/tools/ant/antlib.xml&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;classpath</span> <span style="color: #000066;">refid</span>=<span style="color: #ff0000;">&quot;scala.classpath&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/taskdef<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #808080; font-style: italic;">&lt;!-- definition for the &quot;scalatest&quot; ant task --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;scalatest&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;org.scalatest.tools.ScalaTestTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;classpath</span> <span style="color: #000066;">refid</span>=<span style="color: #ff0000;">&quot;test.classpath&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/taskdef<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #808080; font-style: italic;">&lt;!-- definition for the &quot;reload&quot;, &quot;deploy&quot; </span>
<span style="color: #808080; font-style: italic;">      and &quot;undeploy&quot; Tomcat tasks --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;deploy&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;org.apache.catalina.ant.DeployTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;classpath</span> </span>
<span style="color: #009900;">        <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;${server.home}/lib/catalina-ant.jar&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/taskdef<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;reload&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;org.apache.catalina.ant.ReloadTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;classpath</span> </span>
<span style="color: #009900;">        <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;${server.home}/lib/catalina-ant.jar&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/taskdef<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;undeploy&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;org.apache.catalina.ant.UndeployTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;classpath</span> </span>
<span style="color: #009900;">        <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;${server.home}/lib/catalina-ant.jar&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/taskdef<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #808080; font-style: italic;">&lt;!-- compile project --&gt;</span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;build&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;init&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;build&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;buildnumber</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tstamp</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${classes.dir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${lib.dir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;copy</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${scala-library.jar}&quot;</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${lib.dir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;scalac</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">srcdir</span>=<span style="color: #ff0000;">&quot;${source.dir}&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">destdir</span>=<span style="color: #ff0000;">&quot;${classes.dir}&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">classpathref</span>=<span style="color: #ff0000;">&quot;build.classpath&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">force</span>=<span style="color: #ff0000;">&quot;never&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">deprecation</span>=<span style="color: #ff0000;">&quot;on&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;**/*.scala&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/scalac<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #808080; font-style: italic;">&lt;!-- create a deployable web archive --&gt;</span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;war&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;build&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;war&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;war</span> <span style="color: #000066;">destfile</span>=<span style="color: #ff0000;">&quot;${project.dir}/${ant.project.name}.war&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">webxml</span>=<span style="color: #ff0000;">&quot;${web.dir}/WEB-INF/web.xml&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">basedir</span>=<span style="color: #ff0000;">&quot;${web.dir}&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #808080; font-style: italic;">&lt;!-- creates a deployable web archive with </span>
<span style="color: #808080; font-style: italic;">    all classes packed into a single jar file --&gt;</span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;packedwar&quot;</span> </span>
<span style="color: #009900;">    <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;build&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;packedwar&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;jar</span> <span style="color: #000066;">destfile</span>=<span style="color: #ff0000;">&quot;${lib.dir}/${ant.project.name}.jar&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">basedir</span>=<span style="color: #ff0000;">&quot;${classes.dir}&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">duplicate</span>=<span style="color: #ff0000;">&quot;preserve&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;manifest<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;section</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Program&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;attribute</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Title&quot;</span> </span>
<span style="color: #009900;">            <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${ant.project.name}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;attribute</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Build&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${build.number}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;attribute</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Date&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${TODAY}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/section<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/manifest<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/jar<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${classes.dir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;war</span> <span style="color: #000066;">destfile</span>=<span style="color: #ff0000;">&quot;${project.dir}/${ant.project.name}.war&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">webxml</span>=<span style="color: #ff0000;">&quot;${web.dir}/WEB-INF/web.xml&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">basedir</span>=<span style="color: #ff0000;">&quot;${web.dir}&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${lib.dir}/${ant.project.name}.jar&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #808080; font-style: italic;">&lt;!-- deploy project on Tomcat server --&gt;</span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;deploy&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;war&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;deploy&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${webapp.dir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;copy</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${webapp.dir}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${web.dir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/copy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;deploy</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;${server.manager.url}&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">username</span>=<span style="color: #ff0000;">&quot;${server.manager.username}&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">password</span>=<span style="color: #ff0000;">&quot;${server.manager.password}&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;/${ant.project.name}&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">localWar</span>=<span style="color: #ff0000;">&quot;${project.dir}/${ant.project.name}.war&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #808080; font-style: italic;">&lt;!-- update and reload project on Tomcat server --&gt;</span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;reload&quot;</span> </span>
<span style="color: #009900;">    <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;build&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;reload&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;copy</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${scala-library.jar}&quot;</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${lib.dir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;copy</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${webapp.dir}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${web.dir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/copy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;reload</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;${server.manager.url}&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">username</span>=<span style="color: #ff0000;">&quot;${server.manager.username}&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">password</span>=<span style="color: #ff0000;">&quot;${server.manager.password}&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;/${ant.project.name}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #808080; font-style: italic;">&lt;!-- remove project from Tomcat server --&gt;</span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;undeploy&quot;</span> </span>
<span style="color: #009900;">    <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;init&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;undeploy&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;undeploy</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;${server.manager.url}&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">username</span>=<span style="color: #ff0000;">&quot;${server.manager.username}&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">password</span>=<span style="color: #ff0000;">&quot;${server.manager.password}&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;/${ant.project.name}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #808080; font-style: italic;">&lt;!-- build unit tests --&gt;</span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;buildtest&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;build&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${test.dir}/build&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;scalac</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">srcdir</span>=<span style="color: #ff0000;">&quot;${test.dir}&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">destdir</span>=<span style="color: #ff0000;">&quot;${test.dir}/build&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">classpathref</span>=<span style="color: #ff0000;">&quot;test.classpath&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">force</span>=<span style="color: #ff0000;">&quot;never&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">deprecation</span>=<span style="color: #ff0000;">&quot;on&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;**/*.scala&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/scalac<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #808080; font-style: italic;">&lt;!-- run unit tests --&gt;</span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;test&quot;</span> </span>
<span style="color: #009900;">    <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;buildtest&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;test&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;scalatest</span> <span style="color: #000066;">runpath</span>=<span style="color: #ff0000;">&quot;${test.dir}/build&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;reporter</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;stdout&quot;</span> <span style="color: #000066;">config</span>=<span style="color: #ff0000;">&quot;YFABRT&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;membersonly</span> <span style="color: #000066;">package</span>=<span style="color: #ff0000;">&quot;suite&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #808080; font-style: italic;">&lt;!-- &lt;reporter type=&quot;graphic&quot; config=&quot;YFABRT&quot;/&gt; --&gt;</span>
      <span style="color: #808080; font-style: italic;">&lt;!-- &lt;suite classname=&quot;suite.TestSuite&quot;/&gt; --&gt;</span> 
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/scalatest<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #808080; font-style: italic;">&lt;!-- delete all build files --&gt;</span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;clean&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;init&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;clean&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${classes.dir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${project.dir}/doc&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${test.dir}/build&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${lib.dir}/scala-library.jar&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${project.dir}/${ant.project.name}.war&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #808080; font-style: italic;">&lt;!-- create API documentation in doc folder --&gt;</span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;scaladoc&quot;</span> </span>
<span style="color: #009900;">    <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;build&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;scaladoc&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${project.dir}/doc&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;scaladoc</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">srcdir</span>=<span style="color: #ff0000;">&quot;${source.dir}&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">destdir</span>=<span style="color: #ff0000;">&quot;${project.dir}/doc&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">classpathref</span>=<span style="color: #ff0000;">&quot;build.classpath&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">doctitle</span>=<span style="color: #ff0000;">&quot;${ant.project.name}&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">windowtitle</span>=<span style="color: #ff0000;">&quot;${ant.project.name}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.thomasknierim.com/131/web-development/ant-script-for-scala-with-lift/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
