<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-24336167</id><updated>2011-04-22T03:31:39.374+02:00</updated><category term='text-processing'/><category term='regex'/><category term='snippets'/><category term='ant'/><category term='heuristics'/><category term='ergonomics'/><category term='java'/><category term='python'/><category term='groovy'/><category term='spring'/><category term='latex'/><category term='errors'/><category term='aop'/><category term='caveats'/><category term='parsing'/><category term='intellij'/><category term='automation'/><category term='equinox'/><category term='oc4j'/><title type='text'>Mert on Software</title><subtitle type='html'>I am interested in software engineering topics like use case analysis, test automation, configuration management. Besides design issues are in my interest area like domain driven design, object oriented design. I use java and groovy (recently) in my programs.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mert-on-software.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://mert-on-software.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Mert Nuhoglu</name><uri>http://www.blogger.com/profile/13791089273448603451</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh6.google.com/image/mert.nuhoglu/RfRIyVEsryI/AAAAAAAAACg/w8VMpOhPMAg/s288/Kendim03.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>23</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-24336167.post-4696978215161956700</id><published>2009-01-06T19:37:00.001+02:00</published><updated>2009-01-06T19:37:53.360+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='intellij'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Navigation features of IntelliJ Python Plugin</title><content type='html'>I think one of best uses of IntelliJ for the developer is its easy navigation features. Here are some of screenshots about the navigation features of the Python plugin of IntelliJ:&lt;br /&gt;&lt;br /&gt;Find usages (Alt-F7) of any python object, class etc.&lt;br /&gt;&lt;img src="http://i44.tinypic.com/2whdpp1.jpg" style="margin: 10px 10px 0pt 0pt; float: left; width: 531px; height: 261px;" title="Find usages of any python object, class etc." alt="" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Structure of a python file and classes inside it:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i39.tinypic.com/20pd305.jpg" style="margin: 0pt auto 10px; display: block; text-align: center; width: 747px; height: 373px;" title="Structure of a python file and classes inside it" alt="" /&gt;&lt;br /&gt;Go to definition (Ctrl-B) of a python class, function etc.&lt;br /&gt;&lt;img src="http://i44.tinypic.com/2h4g7x5.jpg" style="margin: 10px 10px 0pt 0pt; float: left;" title="Go to definition of a python class, function etc." alt="" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Find a class (Ctrl-N):&lt;br /&gt;&lt;img src="http://i39.tinypic.com/awcis6.jpg" style="" title="Find a class" alt="" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/24336167-4696978215161956700?l=mert-on-software.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mert-on-software.blogspot.com/feeds/4696978215161956700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=24336167&amp;postID=4696978215161956700' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/4696978215161956700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/4696978215161956700'/><link rel='alternate' type='text/html' href='http://mert-on-software.blogspot.com/2009/01/navigation-features-of-intellij-python.html' title='Navigation features of IntelliJ Python Plugin'/><author><name>Mert Nuhoglu</name><uri>http://www.blogger.com/profile/13791089273448603451</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh6.google.com/image/mert.nuhoglu/RfRIyVEsryI/AAAAAAAAACg/w8VMpOhPMAg/s288/Kendim03.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://i44.tinypic.com/2whdpp1_th.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24336167.post-1827928226932908249</id><published>2007-11-03T21:25:00.000+02:00</published><updated>2007-11-03T21:44:41.509+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='heuristics'/><category scheme='http://www.blogger.com/atom/ns#' term='snippets'/><title type='text'>Heuristics for Travelling Salesman Problem</title><content type='html'>I added &lt;a href="http://snipplr.com/view/4064/shortest-path-heuristics-nearest-neighborhood-2-opt-farthest-and-arbitrary-insertion-for-travelling-salesman-problem/"&gt;matlab code&lt;/a&gt; for some heuristics of travelling salesman problem (TSP) to &lt;a href="http://snipplr.com/"&gt;snipplr&lt;/a&gt;.&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;The code contains three different heuristics:&lt;br /&gt;1. Nearest neighborhood&lt;br /&gt;2. 2 opt (improvement algorithm)&lt;br /&gt;3. Farthest and arbitrary insertion&lt;br /&gt;&lt;br /&gt;I prepared these snippets for a graduate course called as Heuristic Methods in OR that I take in Bogazici University &lt;a href="http://www.ie.boun.edu.tr/"&gt;Industrial Engineering department&lt;/a&gt;.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/24336167-1827928226932908249?l=mert-on-software.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mert-on-software.blogspot.com/feeds/1827928226932908249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=24336167&amp;postID=1827928226932908249' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/1827928226932908249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/1827928226932908249'/><link rel='alternate' type='text/html' href='http://mert-on-software.blogspot.com/2007/11/heuristics-for-travelling-salesman.html' title='Heuristics for Travelling Salesman Problem'/><author><name>Mert Nuhoglu</name><uri>http://www.blogger.com/profile/13791089273448603451</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh6.google.com/image/mert.nuhoglu/RfRIyVEsryI/AAAAAAAAACg/w8VMpOhPMAg/s288/Kendim03.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24336167.post-2188908817878045940</id><published>2007-07-07T15:56:00.000+03:00</published><updated>2007-07-07T16:20:17.976+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='snippets'/><category scheme='http://www.blogger.com/atom/ns#' term='groovy'/><title type='text'>Automatic Backup of All Projects</title><content type='html'>I wrote a script in groovy that backups all my source code projects automatically. I know this is actually the job of a version control system. But for the time, this script works for me well. The nice thing in this script is that it excludes all the fat files like zip, jar etc. So the generated backup is very small.&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;Here is the source code of the script:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import java.util.zip.*&lt;br /&gt;import java.nio.charset.Charset;&lt;br /&gt;import java.nio.charset.CharsetDecoder;&lt;br /&gt;import java.nio.charset.CharsetEncoder;&lt;br /&gt;import java.nio.charset.CharacterCodingException;&lt;br /&gt;import java.nio.ByteBuffer;&lt;br /&gt;import java.nio.CharBuffer;&lt;br /&gt;// Aşağıda belirtilen klasördeki tüm klasörleri zipler.&lt;br /&gt;// Ancak arşiv dosyalarını (jar, ear gibi) hariç bırakır.&lt;br /&gt;// klasorundenItıbaren klasörleri zipler&lt;br /&gt;&lt;br /&gt;def zipIt = new File("D:/projects/groovy-deney-01")&lt;br /&gt;def klasorundenItibaren = 'aaa'&lt;br /&gt;def String arsivlenmeyecekDosyaUzantilari = /\S*\.(class|jar|ear|war|pdf|rar|7z|log|gz|swf|tld|index|psd|iws|ipr|pdb|dll|cab|obj|ocx|zip|ttf|log|mdb|bak|mat|aux)/&lt;br /&gt;zipIt.listFiles().grep( {it.name &gt; klasorundenItibaren}).each{ folder -&gt;&lt;br /&gt;    if(folder.file) return&lt;br /&gt;    println(folder.name)&lt;br /&gt;&lt;br /&gt;    def buf = new byte[1024]&lt;br /&gt;    def out = new ZipOutputStream(new FileOutputStream(folder.name + ".zip"))&lt;br /&gt;    if(eklenecekDosyaYok(folder, arsivlenmeyecekDosyaUzantilari)) return&lt;br /&gt;    folder.eachFileRecurse {&lt;br /&gt;        if( it.file &amp;&amp; !(it.name ==~ arsivlenmeyecekDosyaUzantilari)) {&lt;br /&gt;            println it.name&lt;br /&gt;            println it.canonicalPath&lt;br /&gt;            input = new FileInputStream(it.absolutePath)&lt;br /&gt;&lt;br /&gt;            String s = it.canonicalPath.substring(folder.canonicalPath.size()+1) &lt;br /&gt;&lt;br /&gt;            out.putNextEntry(new ZipEntry(s))&lt;br /&gt;            while((len = input.read(buf)) &gt; 0) {&lt;br /&gt;                out.write(buf,0,len)&lt;br /&gt;            }&lt;br /&gt;            out.closeEntry();&lt;br /&gt;            input.close()&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    out.close()&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;def boolean eklenecekDosyaYok(File folder, String arsivlenmeyecekDosyaUzantilari){&lt;br /&gt;    println folder.name&lt;br /&gt;    println folder.listFiles().findAll{ !(it.name ==~ arsivlenmeyecekDosyaUzantilari)}.empty&lt;br /&gt;    println folder.listFiles().findAll{ !(it.name ==~ arsivlenmeyecekDosyaUzantilari)}&lt;br /&gt;    return folder.listFiles().findAll{ it.file &amp;&amp; !(it.name ==~ arsivlenmeyecekDosyaUzantilari)}.empty&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/24336167-2188908817878045940?l=mert-on-software.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mert-on-software.blogspot.com/feeds/2188908817878045940/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=24336167&amp;postID=2188908817878045940' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/2188908817878045940'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/2188908817878045940'/><link rel='alternate' type='text/html' href='http://mert-on-software.blogspot.com/2007/07/automatic-backup-of-all-projects.html' title='Automatic Backup of All Projects'/><author><name>Mert Nuhoglu</name><uri>http://www.blogger.com/profile/13791089273448603451</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh6.google.com/image/mert.nuhoglu/RfRIyVEsryI/AAAAAAAAACg/w8VMpOhPMAg/s288/Kendim03.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24336167.post-2260516753784680827</id><published>2007-07-02T15:52:00.000+03:00</published><updated>2007-07-02T15:57:01.252+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='groovy'/><title type='text'>Anket Verilerini Siniflandirma</title><content type='html'>Groovy ile anket sonuçlarını sınıflandıran bir program yazdım. &lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package com.shibi.util.text.ölçek&lt;br /&gt;&lt;br /&gt;int ANAHTAR_SATIR_NO = 1&lt;br /&gt;String KLASOR = 'resources/ölçek/Hareket ve Kuvvet 2/'&lt;br /&gt;String[] cevapAnahtarı = new File(KLASOR + '00.txt')&lt;br /&gt;                                .readLines()[ANAHTAR_SATIR_NO]&lt;br /&gt;                                .split(/,/)&lt;br /&gt;println cevapAnahtarı.size()&lt;br /&gt;StringBuffer out = new StringBuffer()&lt;br /&gt;new File(KLASOR + '01.txt').eachLine { line -&gt;&lt;br /&gt;    def cevaplar = line.split(/,/)&lt;br /&gt;    def soru = 1&lt;br /&gt;    for( cevap in cevaplar ) {&lt;br /&gt;        out &lt;&lt; olumlulukDeğeri(cevap, soru, cevapAnahtarı) &lt;&lt; virgul(soru)&lt;br /&gt;        soru++&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;def output = new File(KLASOR + '02.txt')&lt;br /&gt;output.write(out.toString())&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;String olumlulukDeğeri(String cevap, int soru_no, String[] cevapAnahtarı) {&lt;br /&gt;    switch(cevap) {&lt;br /&gt;        case 'A' :  return (cevapAnahtarı[soru_no-1] == '1') ? '1'  : '-1'&lt;br /&gt;        case 'B' :  return (cevapAnahtarı[soru_no-1] == '1') ? '-1' : '1'&lt;br /&gt;        case 'C' :  return '0'&lt;br /&gt;        case 'D' :  return 'D'&lt;br /&gt;        default  :  return 'D'&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;String virgul(int soru_no) {&lt;br /&gt;    (soru_no % 30) ? ',' : '\n'&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;3 tane dosya var: 00.txt, 01.txt ve 02.txt&lt;br /&gt;&lt;br /&gt;00.txt dosyası cevap anahtarı. Bu anket tutum ölçmeye yönelik olduğundan, her bir sorunun olumlu mu, olumsuz mu tutum içerdiğini belirtir.&lt;br /&gt;&lt;br /&gt;01.txt elimizdeki ham veriler. Bunlar anketlere verilen yanıtlardır.&lt;br /&gt;02.txt verilerin sınıflandırılmış hali. Bu örnekte 3'lü Likert tipi ölçek kullanıldığından, veriler -1, 0 veya +1 olarak sınıflandırılmaktadır.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/24336167-2260516753784680827?l=mert-on-software.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mert-on-software.blogspot.com/feeds/2260516753784680827/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=24336167&amp;postID=2260516753784680827' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/2260516753784680827'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/2260516753784680827'/><link rel='alternate' type='text/html' href='http://mert-on-software.blogspot.com/2007/07/anket-verilerini-siniflandirma.html' title='Anket Verilerini Siniflandirma'/><author><name>Mert Nuhoglu</name><uri>http://www.blogger.com/profile/13791089273448603451</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh6.google.com/image/mert.nuhoglu/RfRIyVEsryI/AAAAAAAAACg/w8VMpOhPMAg/s288/Kendim03.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24336167.post-2228315793597338496</id><published>2007-05-24T20:48:00.000+03:00</published><updated>2007-05-24T20:55:35.982+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='errors'/><title type='text'>Problem: cannot find symbol constructor TestCase()</title><content type='html'>I was struggling with a strange problem for a few days. Now I found partially the reason of the problem. A very simple test class didn't compile in my project:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import junit.framework.TestCase;&lt;br /&gt;&lt;br /&gt;public class MyTest extends TestCase {&lt;br /&gt;    public void testMe() {&lt;br /&gt;        assertTrue(true);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;The IDE (intellij) didn't compile it by saying:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cannot find symbol constructor TestCase()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This was very strange at first. After lots of trials and errors I found out that the reason for this compile error was that there was a conflict between the dependencies. Specifically the conflict was between junit.jar and repast.jar.&lt;br /&gt;&lt;br /&gt;When repast.jar has a higher order than junit.jar then the test class doesn't compile. I didn't understand exactly why it occurred but it seems that it has a relation to the classpath declaration in the manifest.mf file of repast.jar, which states:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Class-Path: lib/junit.jar lib/log4j-1.2.8.jar lib/openmap.jar lib/plot.jar&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Moreover repast's own junit has a smaller version than 3.8.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/24336167-2228315793597338496?l=mert-on-software.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mert-on-software.blogspot.com/feeds/2228315793597338496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=24336167&amp;postID=2228315793597338496' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/2228315793597338496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/2228315793597338496'/><link rel='alternate' type='text/html' href='http://mert-on-software.blogspot.com/2007/05/problem-cannot-find-symbol-constructor.html' title='Problem: cannot find symbol constructor TestCase()'/><author><name>Mert Nuhoglu</name><uri>http://www.blogger.com/profile/13791089273448603451</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh6.google.com/image/mert.nuhoglu/RfRIyVEsryI/AAAAAAAAACg/w8VMpOhPMAg/s288/Kendim03.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24336167.post-772809653700887461</id><published>2007-05-19T17:28:00.000+03:00</published><updated>2007-05-19T17:39:51.795+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='spring'/><category scheme='http://www.blogger.com/atom/ns#' term='aop'/><title type='text'>Introduction to AspectJ 5 with Spring and JavaConfig</title><content type='html'>Using the articles about JavaConfig in &lt;a href="http://jroller.com/page/habuma?entry=guice_vs_spring_javaconfig_a"&gt;Guice vs. Spring JavaConfig: A comparison of DI styles&lt;/a&gt; and &lt;a href="http://www.infoq.com/articles/Simplifying-Enterprise-Apps"&gt;Simplifying Enterprise Applications with Spring 2.0 and AspectJ&lt;/a&gt; I managed to use aspectj configured with spring in java code only, that is without using xml files.&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;Here is the annotated aspectj class:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import org.aspectj.lang.annotation.AfterReturning;&lt;br /&gt;import org.aspectj.lang.annotation.Aspect;&lt;br /&gt;import org.aspectj.lang.annotation.Pointcut;&lt;br /&gt;&lt;br /&gt;@Aspect&lt;br /&gt;public class HelloFromAspectJ {&lt;br /&gt;    @Pointcut("execution(* main(..))")&lt;br /&gt;    public void mainMethod() {}&lt;br /&gt;&lt;br /&gt;    @AfterReturning("mainMethod()")&lt;br /&gt;    public void sayHello() {&lt;br /&gt;        System.out.println("Hello from AspectJ!");&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Here is the ordinary java class which is adviced by the above aspect:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class HelloService {&lt;br /&gt;    public void main() {&lt;br /&gt;        System.out.println("Hello World!");&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And here is the configuration class, which replaced the spring's configuration xml file:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import org.springframework.config.java.annotation.Configuration;&lt;br /&gt;import org.springframework.config.java.annotation.Bean;&lt;br /&gt;import org.springframework.config.java.context.AnnotationApplicationContext;&lt;br /&gt;import org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator;&lt;br /&gt;import org.springframework.context.ApplicationContext;&lt;br /&gt;&lt;br /&gt;@Configuration&lt;br /&gt;public class SpringConfig {&lt;br /&gt;    @Bean&lt;br /&gt;    public HelloService helloService() {&lt;br /&gt;        return new HelloService();&lt;br /&gt;    }&lt;br /&gt;    @Bean&lt;br /&gt;    public HelloFromAspectJ helloFromAspectJ() {&lt;br /&gt;        return new HelloFromAspectJ();&lt;br /&gt;    }&lt;br /&gt;    @Bean&lt;br /&gt;    public AnnotationAwareAspectJAutoProxyCreator annotationAwareAspectJAutoProxyCreator() {&lt;br /&gt;        return new AnnotationAwareAspectJAutoProxyCreator();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;        ApplicationContext ctx = new AnnotationApplicationContext(SpringConfig.class);&lt;br /&gt;        HelloService helloService = (HelloService) ctx.getBean("helloService");&lt;br /&gt;        helloService.main();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Note that the bean AnnotationAwareAspectJAutoProxyCreator is the &lt;a href="http://static.springframework.org/spring/docs/2.0.x/reference/aop.html#aop-ataspectj"&gt;enabler of annotated aspects &lt;/a&gt;in spring. It has the same function as the &lt;pre&gt;&amp;lt;aop:aspectj-autoproxy/&amp;gt;&lt;/pre&gt; element in the spring's xml configuration.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/24336167-772809653700887461?l=mert-on-software.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mert-on-software.blogspot.com/feeds/772809653700887461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=24336167&amp;postID=772809653700887461' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/772809653700887461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/772809653700887461'/><link rel='alternate' type='text/html' href='http://mert-on-software.blogspot.com/2007/05/introduction-to-aspectj-5-with-spring.html' title='Introduction to AspectJ 5 with Spring and JavaConfig'/><author><name>Mert Nuhoglu</name><uri>http://www.blogger.com/profile/13791089273448603451</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh6.google.com/image/mert.nuhoglu/RfRIyVEsryI/AAAAAAAAACg/w8VMpOhPMAg/s288/Kendim03.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24336167.post-6306043183226605817</id><published>2007-04-21T20:18:00.000+02:00</published><updated>2007-04-21T21:07:58.350+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='latex'/><category scheme='http://www.blogger.com/atom/ns#' term='automation'/><title type='text'>Keyboard for LaTeX</title><content type='html'>I prepared a new keyboard layout that is partially optimized for LaTeX editing. I made some statistical analysis on sample LaTeX documents. And then put the most frequent keys such that they are easy to type.&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;The rules laying out the keys are these:&lt;br /&gt;1. The load on both hands should be balanced.&lt;br /&gt;2. Mostly used characters should be arranged according to these rules in the order of priority:&lt;br /&gt;a) Index finger &gt; Middle finger &gt; Ring finger&lt;br /&gt;b) Middle row of the keyboard &gt; Upper row &gt; Lower row&lt;br /&gt;c) Little finger&lt;br /&gt;&lt;br /&gt;So I determined the following layout for the symbols that are widely used in LaTeX documents:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;` @ &amp;lt; [ =      '    _ ] &amp;gt; !     . . .&lt;br /&gt;% $ ( {       * +    \ } ) ?    . &lt;br /&gt;. . / ^ &amp;      #    " - | ~     .&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The above layout is in the order of the keys in a standard keyboard like:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;q w e r t      y    u i o p     . . .&lt;br /&gt;a s d f       g h    j k l ;    .&lt;br /&gt;. z x c v      b    n m , .    /&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To make the LaTeX keyboard effective, the user presses any key in combination with Space key. Space key is under the thumb finger. So it is the easiest key to press very frequently. To do this I wrote a script in &lt;a href="http://www.autohotkey.com/"&gt;AutoHotkey&lt;/a&gt;.&lt;br /&gt;Note that to make the layout easy to remember, I made a convention for parantheses characters "&amp;lt; [ ( {". The opening parantheses are all put in the left side and their counter pairs are put in the same key location in the right side.&lt;br /&gt;You can get the script file from the following links:&lt;br /&gt;&lt;a href="http://docs.google.com/Doc?id=a7w6zmv5z8j_0jgf998"&gt;English Q-Keyboard&lt;/a&gt;&lt;br /&gt;&lt;a href="http://docs.google.com/Doc?id=a7w6zmv5z8j_1c9j446"&gt;Turkish F-Keyboard&lt;/a&gt;&lt;br /&gt;To exit the script, press Ctrl-Esc.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/24336167-6306043183226605817?l=mert-on-software.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mert-on-software.blogspot.com/feeds/6306043183226605817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=24336167&amp;postID=6306043183226605817' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/6306043183226605817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/6306043183226605817'/><link rel='alternate' type='text/html' href='http://mert-on-software.blogspot.com/2007/04/keyboard-for-latex.html' title='Keyboard for LaTeX'/><author><name>Mert Nuhoglu</name><uri>http://www.blogger.com/profile/13791089273448603451</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh6.google.com/image/mert.nuhoglu/RfRIyVEsryI/AAAAAAAAACg/w8VMpOhPMAg/s288/Kendim03.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24336167.post-1711084332667349474</id><published>2007-03-28T21:03:00.000+02:00</published><updated>2007-03-28T21:08:57.709+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='text-processing'/><title type='text'>Generate RTF in Java</title><content type='html'>I was googling for an open source library to generate RTF text in java. After navigating through lots of forums, I couldn't find a satisfactory result. Then I searched in Google Blogs and voila :) &lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;Here is the link to the rtf generator in java.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://it.newinstance.it/2007/03/23/msword-generation-made-easyer/"&gt;http://it.newinstance.it/2007/03/23/msword-generation-made-easyer/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It is a very small jar file of 5 KB size, but it depends on Freemarker.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/24336167-1711084332667349474?l=mert-on-software.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mert-on-software.blogspot.com/feeds/1711084332667349474/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=24336167&amp;postID=1711084332667349474' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/1711084332667349474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/1711084332667349474'/><link rel='alternate' type='text/html' href='http://mert-on-software.blogspot.com/2007/03/generate-rtf-in-java.html' title='Generate RTF in Java'/><author><name>Mert Nuhoglu</name><uri>http://www.blogger.com/profile/13791089273448603451</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh6.google.com/image/mert.nuhoglu/RfRIyVEsryI/AAAAAAAAACg/w8VMpOhPMAg/s288/Kendim03.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24336167.post-3429330115533627105</id><published>2007-03-28T19:26:00.000+02:00</published><updated>2007-03-29T11:16:11.207+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='parsing'/><category scheme='http://www.blogger.com/atom/ns#' term='groovy'/><title type='text'>Parsing JMemorize Documents with Groovy</title><content type='html'>Groovy makes a lot of things absolutely very easy. One of them is xml parsing. &lt;br /&gt;&lt;br /&gt;I use &lt;a href="http://jmemorize.org"&gt;JMemorize&lt;/a&gt; for learning new programming libraries like Wicket and Groovy. But I want to import my flash cards into Keynote. So I needed to parse xml documents that JMemorize uses for storing the cards. &lt;br /&gt;&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;It is not a big deal parsing xml documents. But Groovy makes it much easier. I put my code here to show Groovy's easiness and maybe some JMemorize users may benefit.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;def lesson = new XmlParser().parse(new File('resources/Java.jml'))&lt;br /&gt;def cards = lesson.Category.Category.grep{it.'@name' == 'Groovy'}.Deck.Card&lt;br /&gt;output = new File('resources/jmemorize.txt')&lt;br /&gt;output.write('')&lt;br /&gt;def counter = 0&lt;br /&gt;for(card in cards) {&lt;br /&gt;    output &lt;&lt; "Soru $counter:\n\n" &lt;&lt; card.'@Backside' &lt;&lt; '\n----\nYanıtı:\n' &lt;&lt; card.'@Frontside' &lt;&lt; '\n====\n'&lt;br /&gt;    counter++&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/24336167-3429330115533627105?l=mert-on-software.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mert-on-software.blogspot.com/feeds/3429330115533627105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=24336167&amp;postID=3429330115533627105' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/3429330115533627105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/3429330115533627105'/><link rel='alternate' type='text/html' href='http://mert-on-software.blogspot.com/2007/03/parsing-jmemorize-documents-with-groovy.html' title='Parsing JMemorize Documents with Groovy'/><author><name>Mert Nuhoglu</name><uri>http://www.blogger.com/profile/13791089273448603451</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh6.google.com/image/mert.nuhoglu/RfRIyVEsryI/AAAAAAAAACg/w8VMpOhPMAg/s288/Kendim03.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24336167.post-9192109820129574980</id><published>2007-03-26T19:11:00.000+02:00</published><updated>2007-03-26T19:24:02.815+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='latex'/><category scheme='http://www.blogger.com/atom/ns#' term='ergonomics'/><category scheme='http://www.blogger.com/atom/ns#' term='groovy'/><title type='text'>Ergonomic Keyboard Layout for LaTeX Authoring</title><content type='html'>Inspired by &lt;a href="http://plastictree.net/keyboard/index.html"&gt;Lasse Kliemann&lt;/a&gt;, I am trying to build a new keyboard layout for LaTeX authoring. Lasse Kliemann has produced a very easy to use keyboard layout for LaTeX symbols. &lt;br /&gt;&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;If you have written some LaTeX code, you certainly know that LaTeX requires lots of symbols like {\}([]$. These characters are hard to type because firstly they reside in far places on the keyboard, secondly they usually require modifier keys in combination. Lasse's solution is to set space-bar as a modifier. The symbols are bound to usual alphabetic characters on the keyboard. So using a key combination like space-s produces {. Both keys "space" and "s" are very easy to type in combination. &lt;br /&gt;&lt;br /&gt;I wondered whether Lasse's keyboard layout is the optimum layout for LaTeX authoring. He actually designed the layout for other programming tasks as well like HTML and C authoring. So I wrote a program in Groovy that measures the character statistics in a given tex file. Here is the code:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;map = [:]&lt;br /&gt;new File('poisson01.tex').getText('utf-8').each {&lt;br /&gt;    if(map[it] == null)&lt;br /&gt;        map[it] = 0&lt;br /&gt;    else&lt;br /&gt;        map[it] = map[it] + 1&lt;br /&gt;}&lt;br /&gt;def keys = map.keySet().findAll{ !(('a'..'z').contains(it) || ('A'..'Z').contains(it)) }&lt;br /&gt;def frequencies = map.subMap(keys)&lt;br /&gt;def characterList = frequencies.keySet().toList()&lt;br /&gt;characterList.sort { frequencies[it] }&lt;br /&gt;&lt;br /&gt;characterList.reverse().each {&lt;br /&gt;    println it + ' ' + frequencies[it]&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here is the output of a run:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;\ 893&lt;br /&gt;&lt;br /&gt; 489&lt;br /&gt;  446&lt;br /&gt;{ 388&lt;br /&gt;} 387&lt;br /&gt;( 222&lt;br /&gt;) 220&lt;br /&gt;= 207&lt;br /&gt;$ 155&lt;br /&gt;_ 112&lt;br /&gt;[ 110&lt;br /&gt;] 110&lt;br /&gt;. 99&lt;br /&gt;1 90&lt;br /&gt;ı 81&lt;br /&gt;^ 80&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So the various parentheses are the mostly used characters. But this is just one latex file. For better design optimization, one should use a randomly selected set of LaTeX files.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/24336167-9192109820129574980?l=mert-on-software.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mert-on-software.blogspot.com/feeds/9192109820129574980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=24336167&amp;postID=9192109820129574980' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/9192109820129574980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/9192109820129574980'/><link rel='alternate' type='text/html' href='http://mert-on-software.blogspot.com/2007/03/ergonomic-keyboard-layout-for-latex.html' title='Ergonomic Keyboard Layout for LaTeX Authoring'/><author><name>Mert Nuhoglu</name><uri>http://www.blogger.com/profile/13791089273448603451</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh6.google.com/image/mert.nuhoglu/RfRIyVEsryI/AAAAAAAAACg/w8VMpOhPMAg/s288/Kendim03.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24336167.post-6269937164651310634</id><published>2007-03-16T15:54:00.000+02:00</published><updated>2007-03-16T16:02:27.071+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='snippets'/><category scheme='http://www.blogger.com/atom/ns#' term='regex'/><category scheme='http://www.blogger.com/atom/ns#' term='groovy'/><title type='text'>Groovy: Automatic Text Replacement Script</title><content type='html'>I have been doing graduate studies in Industrial Engineering at Bogazici University for a few months. Normally I use a notebook to take my notes. But in the last few weeks I try to take my notes in the laptop. But this has some difficulties. I use abbreviations for the frequently used terms. Then I change them with find/replace in word. This is a manual repetitive task. So it is a very good case for automation. Since I have been learning Groovy these weeks, it was a good opportunity to try my knowledge.&lt;br /&gt;&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;&lt;br /&gt;This is the code. It reads two files. One file "sd.txt" contains my lecture notes. The other file "kelimeler.txt" contains the abbreviations together with their replacements.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;map = [:]&lt;br /&gt;new File('kelimeler.txt').eachLine {&lt;br /&gt;   map[it.tokenize()[0]] = it.tokenize()[1]&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;output = new File('out.txt')&lt;br /&gt;output.write('')&lt;br /&gt;new File('SD.txt').newReader('ISO-8859-9').eachLine { line -&gt;&lt;br /&gt;   output.append(convert(line) + '\n','ISO-8859-9')&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;def String convert(line) {&lt;br /&gt;   matcher = line =~ /\w+/&lt;br /&gt;   list = matcher.collect { it }&lt;br /&gt;&lt;br /&gt;   map.keySet().grep(list).each {&lt;br /&gt;       line = line.replaceAll(/\b$it\b/,map[it])&lt;br /&gt;   }&lt;br /&gt;   return line&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Note that, I am using ISO-8859-9 encoding, which is the standard, non-unicode encoding for turkish characters.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/24336167-6269937164651310634?l=mert-on-software.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mert-on-software.blogspot.com/feeds/6269937164651310634/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=24336167&amp;postID=6269937164651310634' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/6269937164651310634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/6269937164651310634'/><link rel='alternate' type='text/html' href='http://mert-on-software.blogspot.com/2007/03/groovy-automatic-text-replacement.html' title='Groovy: Automatic Text Replacement Script'/><author><name>Mert Nuhoglu</name><uri>http://www.blogger.com/profile/13791089273448603451</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh6.google.com/image/mert.nuhoglu/RfRIyVEsryI/AAAAAAAAACg/w8VMpOhPMAg/s288/Kendim03.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24336167.post-5412949074347942345</id><published>2007-03-16T10:15:00.000+02:00</published><updated>2007-03-16T11:49:50.361+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='caveats'/><category scheme='http://www.blogger.com/atom/ns#' term='groovy'/><title type='text'>Return Statement Inside The Closures In The Functions</title><content type='html'>Regarding Groovy Categories:&lt;br /&gt;Return statements inside the functions don't return anything if used in the "use" closures:&lt;br /&gt;&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;pre&gt;&lt;br /&gt;class TokenCategory3 {&lt;br /&gt;    static String g(String self) {&lt;br /&gt;        return 'hello'&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;String f() {&lt;br /&gt;    use(TokenCategory3) {&lt;br /&gt;        assert 'a'.g() == 'hello'&lt;br /&gt;        return 'a'.g()&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;use(TokenCategory3) {&lt;br /&gt;    assert 'a'.g() == 'hello'&lt;br /&gt;}&lt;br /&gt;assert f() == null&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Note that the last line returns null, although there is a return statement in f().&lt;br /&gt;To make f() return some value, the return statement should be outside the "use" closure:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;pre&gt;&lt;br /&gt;String h() {&lt;br /&gt;    String result&lt;br /&gt;    use(TokenCategory3) {&lt;br /&gt;        result = 'a'.g()&lt;br /&gt;    }&lt;br /&gt;    return result&lt;br /&gt;}&lt;br /&gt;assert h() == 'hello'&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/24336167-5412949074347942345?l=mert-on-software.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mert-on-software.blogspot.com/feeds/5412949074347942345/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=24336167&amp;postID=5412949074347942345' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/5412949074347942345'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/5412949074347942345'/><link rel='alternate' type='text/html' href='http://mert-on-software.blogspot.com/2007/03/return-statement-inside-closures-in.html' title='Return Statement Inside The Closures In The Functions'/><author><name>Mert Nuhoglu</name><uri>http://www.blogger.com/profile/13791089273448603451</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh6.google.com/image/mert.nuhoglu/RfRIyVEsryI/AAAAAAAAACg/w8VMpOhPMAg/s288/Kendim03.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24336167.post-114469473232765569</id><published>2006-04-10T20:42:00.000+02:00</published><updated>2007-03-16T11:50:39.601+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='equinox'/><category scheme='http://www.blogger.com/atom/ns#' term='oc4j'/><title type='text'>Equinox Deployment on oc4j/orion</title><content type='html'>When deploying equinox on oc4j 9 there happens a problem. oc4j doesn't provide any debug information. Thus it is very difficult to solve the problem. I deployed the same application on oc4j 10, then it became clear. oc4j 9 was actually complaining of this problem:&lt;br /&gt;&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;          Missing class: org.apache.commons.el.Logger&lt;br /&gt;&lt;br /&gt;        Dependent class: net.sourceforge.myfaces.util.ClassUtils&lt;br /&gt;                 Loader: sibi.web.sibi:0.0.0&lt;br /&gt;            Code-Source: /C:/oc4j/j2ee/home/applications/sibi/sibi/WEB-INF/lib/m&lt;br /&gt;yfaces-components.jar&lt;br /&gt;          Configuration: WEB-INF/lib/ directory in C:\oc4j\j2ee\home\application&lt;br /&gt;s\sibi\sibi\WEB-INF\lib&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That is oc4j needs commons-el.jar in its classpath. This jar file is included in the common folder of Tomcat. Therefore the application runs on tomcat but not on oc4j. &lt;br /&gt;&lt;br /&gt;Giving back detailed debug information is crucial for any application. Fortunately oc4j 10g gives better information than oc4j 9.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/24336167-114469473232765569?l=mert-on-software.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mert-on-software.blogspot.com/feeds/114469473232765569/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=24336167&amp;postID=114469473232765569' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/114469473232765569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/114469473232765569'/><link rel='alternate' type='text/html' href='http://mert-on-software.blogspot.com/2006/04/equinox-deployment-on-oc4jorion.html' title='Equinox Deployment on oc4j/orion'/><author><name>Mert Nuhoglu</name><uri>http://www.blogger.com/profile/13791089273448603451</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh6.google.com/image/mert.nuhoglu/RfRIyVEsryI/AAAAAAAAACg/w8VMpOhPMAg/s288/Kendim03.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24336167.post-114348236258648960</id><published>2006-03-27T19:38:00.000+02:00</published><updated>2006-03-27T19:59:22.596+02:00</updated><title type='text'>Please vote for this java bug</title><content type='html'>Please vote for this java bug: &lt;a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4910812"&gt;http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4910812&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This is related to the hotswap feature of java vm. This is very essential because hotswap allows the programmer to make changes in the code and see the results immediately without restarting the application servers or anything else. Rapid feedback enables rapid development.&lt;br /&gt;&lt;br /&gt;To add your comments on this feature please use this sun forum: &lt;a href="http://forum.java.sun.com/thread.jspa?messageID=3949087"&gt;http://forum.java.sun.com/thread.jspa?messageID=3949087&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/24336167-114348236258648960?l=mert-on-software.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mert-on-software.blogspot.com/feeds/114348236258648960/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=24336167&amp;postID=114348236258648960' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/114348236258648960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/114348236258648960'/><link rel='alternate' type='text/html' href='http://mert-on-software.blogspot.com/2006/03/please-vote-for-this-java-bug.html' title='Please vote for this java bug'/><author><name>Mert Nuhoglu</name><uri>http://www.blogger.com/profile/13791089273448603451</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh6.google.com/image/mert.nuhoglu/RfRIyVEsryI/AAAAAAAAACg/w8VMpOhPMAg/s288/Kendim03.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24336167.post-114337841030542306</id><published>2006-03-26T15:06:00.000+02:00</published><updated>2006-03-26T15:06:50.313+02:00</updated><title type='text'>Spring 2.0: New Features</title><content type='html'>New Spring 2.0 features are great. That will surely make a new leap towards simplification of quality software development. Download the presentation given by Rod Johnson -founder of Spring- to learn about new features of Spring 2.0: &lt;a href="http://skillsmatter.com/downloads/02-03-06_Spring_Update_Spring_2_Rod_Johnson_at_Skills_Matter.pdf"&gt;Spring Update: Introducing Spring 2.0&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/24336167-114337841030542306?l=mert-on-software.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mert-on-software.blogspot.com/feeds/114337841030542306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=24336167&amp;postID=114337841030542306' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/114337841030542306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/114337841030542306'/><link rel='alternate' type='text/html' href='http://mert-on-software.blogspot.com/2006/03/spring-20-new-features.html' title='Spring 2.0: New Features'/><author><name>Mert Nuhoglu</name><uri>http://www.blogger.com/profile/13791089273448603451</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh6.google.com/image/mert.nuhoglu/RfRIyVEsryI/AAAAAAAAACg/w8VMpOhPMAg/s288/Kendim03.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24336167.post-114337504877081976</id><published>2006-03-26T14:06:00.000+02:00</published><updated>2006-03-26T14:10:48.776+02:00</updated><title type='text'>Calling Ruby Scripts From Java Through Spring</title><content type='html'>The new Spring 2.0 carries a very interesting feature: binding scripts through dependency injection. It enables to load scripted objects into the Spring application context and call them as if they were java objects. I wonder whether the reverse is possible too? Look at the &lt;a href="http://jroller.com/page/habuma?entry=spring_meet_ruby"&gt;Spring-Loaded blog&lt;/a&gt; for more information.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/24336167-114337504877081976?l=mert-on-software.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mert-on-software.blogspot.com/feeds/114337504877081976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=24336167&amp;postID=114337504877081976' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/114337504877081976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/114337504877081976'/><link rel='alternate' type='text/html' href='http://mert-on-software.blogspot.com/2006/03/calling-ruby-scripts-from-java-through.html' title='Calling Ruby Scripts From Java Through Spring'/><author><name>Mert Nuhoglu</name><uri>http://www.blogger.com/profile/13791089273448603451</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh6.google.com/image/mert.nuhoglu/RfRIyVEsryI/AAAAAAAAACg/w8VMpOhPMAg/s288/Kendim03.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24336167.post-114329134198871006</id><published>2006-03-25T14:46:00.000+02:00</published><updated>2006-03-25T14:56:05.710+02:00</updated><title type='text'>maven2-jetty6 plugin problem</title><content type='html'>I was trying to develop a new web application based on equinox-1.6. New versions of equinox are built with maven2. This is good because maven makes build management very easy. I ran equinox with jetty6 plugin. Brett Porter explains &lt;a href="http://blogs.codehaus.org/people/brett/archives/001306_developing_with_jetty_where_have_you_been_all_my_life.html"&gt;in his blog entry&lt;/a&gt; why jetty6-plugin is such a life saver for web application developers. But somehow I received the following error:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;:INFO:  NO JSP Support for /login, did not find org.apache.jasper.servlet.JspServlet&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I am not sure what caused this error. Probably there is a classpath error. I tried to run some other applications with jetty6-plugin. They were ok. Even another equinox-1.6 based application was running properly. Then I changed the version of jetty6-plugin to the previous version (6.0.0beta12) and fortunately the problem was solved. I am not sure but probably there is a classpath related error with dependencies of jetty6, jasper-compiler etc..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/24336167-114329134198871006?l=mert-on-software.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mert-on-software.blogspot.com/feeds/114329134198871006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=24336167&amp;postID=114329134198871006' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/114329134198871006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/114329134198871006'/><link rel='alternate' type='text/html' href='http://mert-on-software.blogspot.com/2006/03/maven2-jetty6-plugin-problem.html' title='maven2-jetty6 plugin problem'/><author><name>Mert Nuhoglu</name><uri>http://www.blogger.com/profile/13791089273448603451</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh6.google.com/image/mert.nuhoglu/RfRIyVEsryI/AAAAAAAAACg/w8VMpOhPMAg/s288/Kendim03.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24336167.post-114320184955193287</id><published>2006-03-24T13:54:00.000+02:00</published><updated>2007-03-16T11:51:30.331+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='ant'/><title type='text'>Using Standalone Ant Tasks in Java Code</title><content type='html'>Ant is a very good build management and automation tool. Moreover Ant tasks are very easy to use in java code as well. I mean, you don't have to write build.xml files in order to benefit from Ant tasks. You can as well use Ant tasks from java code directly.&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;Here is an example of code:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    Project project = new Project();&lt;br /&gt;    project.setBasedir(".");&lt;br /&gt;    project.setName("DbUnit Test");&lt;br /&gt;    SQLExec sqlExec = new SQLExec();&lt;br /&gt;    sqlExec.setProject(project);&lt;br /&gt;    sqlExec.setDriver(driverName);&lt;br /&gt;    sqlExec.setUrl(url);&lt;br /&gt;    sqlExec.setUserid(username);&lt;br /&gt;    sqlExec.setPassword(password);&lt;br /&gt;    File createTable = new File("db/create-table.sql");&lt;br /&gt;    sqlExec.setSrc(createTable);&lt;br /&gt;    sqlExec.execute();&lt;br /&gt;    sqlExec.setSrc(null);&lt;br /&gt;    sqlExec.addText("" +&lt;br /&gt;            "                INSERT INTO app_user (id, first_name, last_name) \n" +&lt;br /&gt;            "                    values (5, 'Julie', 'Raible');\n" +&lt;br /&gt;            "                INSERT INTO app_user (id, first_name, last_name) \n" +&lt;br /&gt;            "                    values (6, 'Abbie', 'Raible');\n");&lt;br /&gt;    sqlExec.execute();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This is the same as the following build.xml excerpt:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    &amp;lt;sql driver=\&amp;quot;${jdbc.driverClassName}\&amp;quot; url=\&amp;quot;${jdbc.url}\&amp;quot;&lt;br /&gt;         userid=\&amp;quot;${jdbc.username}\&amp;quot; password=\&amp;quot;${jdbc.password}\&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;classpath refid=\&amp;quot;compile.classpath\&amp;quot;/&amp;gt;&lt;br /&gt;        &amp;lt;![CDATA[ &lt;br /&gt;            INSERT INTO app_user (id, first_name, last_name) &lt;br /&gt;                values (5, \'Julie\', \'Raible\');&lt;br /&gt;            INSERT INTO app_user (id, first_name, last_name) &lt;br /&gt;                values (6, \'Abbie\', \'Raible\');&lt;br /&gt;        ]]&amp;gt;&lt;br /&gt;    &amp;lt;/sql&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Although xml code is shorter, java code has some adequate use cases. For example, you want to reuse SQLExec's functions in your own application. You can reuse any of the Ant tasks which is a large library full with utilities. &lt;br /&gt;&lt;br /&gt;But beware that all Ant tasks depend on a wrapping Project object. Therefore the first line in the above java code instantiates a dummy Project object.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/24336167-114320184955193287?l=mert-on-software.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mert-on-software.blogspot.com/feeds/114320184955193287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=24336167&amp;postID=114320184955193287' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/114320184955193287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/114320184955193287'/><link rel='alternate' type='text/html' href='http://mert-on-software.blogspot.com/2006/03/using-standalone-ant-tasks-in-java.html' title='Using Standalone Ant Tasks in Java Code'/><author><name>Mert Nuhoglu</name><uri>http://www.blogger.com/profile/13791089273448603451</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh6.google.com/image/mert.nuhoglu/RfRIyVEsryI/AAAAAAAAACg/w8VMpOhPMAg/s288/Kendim03.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24336167.post-114286190840968060</id><published>2006-03-20T15:38:00.000+02:00</published><updated>2006-03-20T15:38:28.426+02:00</updated><title type='text'>IntelliJ IDEA Blog  Opened</title><content type='html'>&lt;a href="http://blogs.jetbrains.com/idea/"&gt;IntelliJ IDEA Blog  &lt;/a&gt; The official group blog of IntelliJ Idea. My favorite IDE and software...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/24336167-114286190840968060?l=mert-on-software.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mert-on-software.blogspot.com/feeds/114286190840968060/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=24336167&amp;postID=114286190840968060' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/114286190840968060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/114286190840968060'/><link rel='alternate' type='text/html' href='http://mert-on-software.blogspot.com/2006/03/intellij-idea-blog-opened.html' title='IntelliJ IDEA Blog  Opened'/><author><name>Mert Nuhoglu</name><uri>http://www.blogger.com/profile/13791089273448603451</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh6.google.com/image/mert.nuhoglu/RfRIyVEsryI/AAAAAAAAACg/w8VMpOhPMAg/s288/Kendim03.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24336167.post-114280532681400503</id><published>2006-03-19T23:49:00.000+02:00</published><updated>2006-03-19T23:55:26.823+02:00</updated><title type='text'>Maven2 - Simplification of Build Management</title><content type='html'>&lt;a href="http://maven.apache.org/guides/getting-started/index.html"&gt;Maven2&lt;/a&gt; has made a great improvement in simplification of build management. It is only one step to generate a skeleton application with Maven2.  This is as easy as Ruby-on-Rails code generators. Maven2 does not only provide lots of code generators. It helps also greatly in testing, deploying, dependency management and all other project management issues.&lt;br /&gt;&lt;br /&gt;An example. You have a project generated by maven2. Then you want to create a project file for IntelliJ Idea. Normally you would open Idea and adjust the settings on classpath, source path etc. With maven2, you only give a command: mvn idea:idea. Maven2 handles all the settings for you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/24336167-114280532681400503?l=mert-on-software.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mert-on-software.blogspot.com/feeds/114280532681400503/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=24336167&amp;postID=114280532681400503' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/114280532681400503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/114280532681400503'/><link rel='alternate' type='text/html' href='http://mert-on-software.blogspot.com/2006/03/maven2-simplification-of-build.html' title='Maven2 - Simplification of Build Management'/><author><name>Mert Nuhoglu</name><uri>http://www.blogger.com/profile/13791089273448603451</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh6.google.com/image/mert.nuhoglu/RfRIyVEsryI/AAAAAAAAACg/w8VMpOhPMAg/s288/Kendim03.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24336167.post-114276324864839490</id><published>2006-03-19T12:09:00.000+02:00</published><updated>2006-03-19T12:14:08.656+02:00</updated><title type='text'>Jetty and Appfuse</title><content type='html'>Appfuse-1.9 works on Jetty-6.0-beta without any configuration. Just dropping appfuse.war into webapps folder of jetty works without any warning/errors. Well normally this shouldn't surprise any java developer, but after struggling with so many small but not-easy-to-understand migration problems this was surprising to me.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/24336167-114276324864839490?l=mert-on-software.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mert-on-software.blogspot.com/feeds/114276324864839490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=24336167&amp;postID=114276324864839490' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/114276324864839490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/114276324864839490'/><link rel='alternate' type='text/html' href='http://mert-on-software.blogspot.com/2006/03/jetty-and-appfuse.html' title='Jetty and Appfuse'/><author><name>Mert Nuhoglu</name><uri>http://www.blogger.com/profile/13791089273448603451</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh6.google.com/image/mert.nuhoglu/RfRIyVEsryI/AAAAAAAAACg/w8VMpOhPMAg/s288/Kendim03.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24336167.post-114275677051028589</id><published>2006-03-19T10:05:00.000+02:00</published><updated>2007-03-16T11:52:01.509+02:00</updated><title type='text'>Very Simple Jetty Configuration</title><content type='html'>I like &lt;a href="http://jetty.mortbay.org"&gt;Jetty&lt;/a&gt; as a web server. It is pretty small, fast and easy to configure. Here is my very simple web application configuration on jetty 4.2.2 (you can try it on any java ide):&lt;br /&gt;&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;1. Put the following files into the classpath: jasper-compiler.jar, jasper-runtime.jar, javax.servlet.jar, org.apache.jasper.jar, org.mortbay.jetty.jar (these files are included in jetty 4.2.x distributions)&lt;br /&gt;&lt;br /&gt;2. Create a web page welcome.html and put it into {project.dir}/resources folder.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;?xml version=\&amp;quot;1.0\&amp;quot; encoding=\&amp;quot;UTF-8\&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC \&amp;quot;-//W3C//DTD XHTML 1.1//EN\&amp;quot;&lt;br /&gt;        \&amp;quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;html xmlns=\&amp;quot;http://www.w3.org/1999/xhtml\&amp;quot; xml:lang=\&amp;quot;tr\&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;head&amp;gt;&lt;br /&gt;        &amp;lt;title&amp;gt;Welcome&amp;lt;/title&amp;gt;&lt;br /&gt;        &amp;lt;meta http-equiv=\&amp;quot;Content-Type\&amp;quot; content=\&amp;quot;text/html; charset=UTF-8\&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;script type=\&amp;quot;text/javascript\&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;/script&amp;gt;&lt;br /&gt;    &amp;lt;/head&amp;gt;&lt;br /&gt;    &amp;lt;body&amp;gt;&lt;br /&gt;        Merhaba&lt;br /&gt;    &amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;3. Compile and run the following java class (the working folder should be {project.dir}):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class Start {&lt;br /&gt;    private static Logger log = Logger.getLogger("start");&lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;        Server jettyServer = null;&lt;br /&gt;        try&lt;br /&gt;        {&lt;br /&gt;            jettyServer = new Server();&lt;br /&gt;            SocketListener socketListener = new SocketListener();&lt;br /&gt;            socketListener.setPort(8080);&lt;br /&gt;            jettyServer.addListener(socketListener);&lt;br /&gt;            jettyServer.addWebApplication("/test", "resources");&lt;br /&gt;            jettyServer.start();&lt;br /&gt;        }&lt;br /&gt;        catch (Exception e) {&lt;br /&gt;            log.info("Could not start the Jetty server: " + e);&lt;br /&gt;            if (jettyServer != null) {&lt;br /&gt;                try { jettyServer.stop();&lt;br /&gt;            } catch (InterruptedException e1) { log.info("Unable to stop the jetty server: " + e1); }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;4. Go to http://localhost:8080/test/welcome.html&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.box.net/public/5e4gagnhde"&gt;Here you can download the code as an IntelliJ Idea project&lt;/a&gt;, excluding the jetty-4.2.x distribution.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/24336167-114275677051028589?l=mert-on-software.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mert-on-software.blogspot.com/feeds/114275677051028589/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=24336167&amp;postID=114275677051028589' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/114275677051028589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/114275677051028589'/><link rel='alternate' type='text/html' href='http://mert-on-software.blogspot.com/2006/03/very-simple-jetty-configuration.html' title='Very Simple Jetty Configuration'/><author><name>Mert Nuhoglu</name><uri>http://www.blogger.com/profile/13791089273448603451</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh6.google.com/image/mert.nuhoglu/RfRIyVEsryI/AAAAAAAAACg/w8VMpOhPMAg/s288/Kendim03.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24336167.post-114275529845862138</id><published>2006-03-19T09:55:00.000+02:00</published><updated>2006-03-19T10:01:38.473+02:00</updated><title type='text'>Welcome - Selam</title><content type='html'>Hi everybody, this is my 7th weblog. I know that this makes everything a little more confused. But this is better than big up front design.  You can't make everything as organized from the start. This weblog is specifically dedicated to the small things in software development. I don't want to clutter my other weblogs with these small issues. I will write in this blog more freqeuntly, I hope. And this weblog will be mixed in Turkish and English.&lt;br /&gt;&lt;br /&gt;Here comes the Turkish introduction:&lt;br /&gt;&lt;br /&gt;Merhaba, bu benim 7. weblogum. İngilizce kısmını okuyanlar için bu Türkçe giriş tekrar mahiyetinde olacak. Diğer webloglarımı kalabalıklaştırmamak için, özellikle yazılım geliştirmede karşılaştığım küçük meselelere burada değineceğim.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/24336167-114275529845862138?l=mert-on-software.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mert-on-software.blogspot.com/feeds/114275529845862138/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=24336167&amp;postID=114275529845862138' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/114275529845862138'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24336167/posts/default/114275529845862138'/><link rel='alternate' type='text/html' href='http://mert-on-software.blogspot.com/2006/03/welcome-selam.html' title='Welcome - Selam'/><author><name>Mert Nuhoglu</name><uri>http://www.blogger.com/profile/13791089273448603451</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://lh6.google.com/image/mert.nuhoglu/RfRIyVEsryI/AAAAAAAAACg/w8VMpOhPMAg/s288/Kendim03.jpg'/></author><thr:total>0</thr:total></entry></feed>
