<?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-3811411079633403304</id><updated>2012-02-16T17:46:22.459-08:00</updated><title type='text'>Ideas And Code</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ideas-and-code.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://ideas-and-code.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Roberto F.</name><uri>http://www.blogger.com/profile/14876598345323663362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>16</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3811411079633403304.post-8248440535922231605</id><published>2011-05-19T11:31:00.001-07:00</published><updated>2011-05-19T11:33:06.738-07:00</updated><title type='text'>Best Android Apps</title><content type='html'>Get the app: &lt;a href="http://www.bestappsmarket.com/p/app?id=812&amp;title=best-apps-market"&gt;http://www.bestappsmarket.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;See my Node: &lt;a href="https://catch.com/m/Biju4/G3u3ox6FkyF"&gt;https://catch.com/m/Biju4/G3u3ox6FkyF&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811411079633403304-8248440535922231605?l=ideas-and-code.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideas-and-code.blogspot.com/feeds/8248440535922231605/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://ideas-and-code.blogspot.com/2011/05/best-android-apps.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/8248440535922231605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/8248440535922231605'/><link rel='alternate' type='text/html' href='http://ideas-and-code.blogspot.com/2011/05/best-android-apps.html' title='Best Android Apps'/><author><name>Roberto F.</name><uri>http://www.blogger.com/profile/14876598345323663362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811411079633403304.post-7271767377241732928</id><published>2011-03-24T15:15:00.000-07:00</published><updated>2011-05-19T11:34:03.280-07:00</updated><title type='text'>Best Android App</title><content type='html'>We opened up our catalog of Best Android Apps.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.bestappsmarket.com"&gt;http://www.bestappsmarket.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Also available in the Android market as "Best Apps Market". Install from &lt;a href="http://www.bestappsmarket.com/p/app?id=812&amp;title=best-apps-market"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811411079633403304-7271767377241732928?l=ideas-and-code.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideas-and-code.blogspot.com/feeds/7271767377241732928/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://ideas-and-code.blogspot.com/2011/03/best-android-app.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/7271767377241732928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/7271767377241732928'/><link rel='alternate' type='text/html' href='http://ideas-and-code.blogspot.com/2011/03/best-android-app.html' title='Best Android App'/><author><name>Roberto F.</name><uri>http://www.blogger.com/profile/14876598345323663362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811411079633403304.post-4363970790311537422</id><published>2011-03-02T11:58:00.000-08:00</published><updated>2011-03-02T12:06:52.736-08:00</updated><title type='text'>Android Developer?</title><content type='html'>BuzzBox is launching a free SDK to add a scheduler to your Android App.&lt;br /&gt;Check out the new website: &lt;a href="http://hub.buzzbox.com"&gt;BuzzBox Notification Platform&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This is what I like to most:&lt;br /&gt;&lt;br /&gt;- create a cron job in your App: &lt;a href="http://hub.buzzbox.com/sdk/scheduler"&gt;cron scheduler for Android&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;- super simple notification API: &lt;a href="http://hub.buzzbox.com/sdk/notifications"&gt;Notification API&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;- add real time analytics: &lt;a href="http://hub.buzzbox.com/sdk/analytics"&gt;Real time analytics for Android&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://hub.buzzbox.com"&gt;&lt;img src="http://hub.buzzbox.com/sr/images/buzzbox-sdk-promo-small.png"/&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811411079633403304-4363970790311537422?l=ideas-and-code.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideas-and-code.blogspot.com/feeds/4363970790311537422/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://ideas-and-code.blogspot.com/2011/03/android-developer.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/4363970790311537422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/4363970790311537422'/><link rel='alternate' type='text/html' href='http://ideas-and-code.blogspot.com/2011/03/android-developer.html' title='Android Developer?'/><author><name>Roberto F.</name><uri>http://www.blogger.com/profile/14876598345323663362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811411079633403304.post-1520508046252645601</id><published>2010-05-12T15:54:00.000-07:00</published><updated>2010-05-12T15:56:55.122-07:00</updated><title type='text'>buzzbox google gadget (test)</title><content type='html'>&lt;script src="http://www.gmodules.com/ig/ifr?url=http://hosting.gmodules.com/ig/gadgets/file/104018764379669507595/buzzbox.xml&amp;amp;up_username=rob&amp;amp;up_showImage=yes&amp;amp;synd=open&amp;amp;w=338&amp;amp;h=208&amp;amp;title=BuzzBox+-+The+Top+News+Stories+for+you&amp;amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;amp;output=js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811411079633403304-1520508046252645601?l=ideas-and-code.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideas-and-code.blogspot.com/feeds/1520508046252645601/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://ideas-and-code.blogspot.com/2010/05/buzzbox-google-gadget-test.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/1520508046252645601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/1520508046252645601'/><link rel='alternate' type='text/html' href='http://ideas-and-code.blogspot.com/2010/05/buzzbox-google-gadget-test.html' title='buzzbox google gadget (test)'/><author><name>Roberto F.</name><uri>http://www.blogger.com/profile/14876598345323663362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811411079633403304.post-1103294339954725304</id><published>2010-02-26T12:10:00.000-08:00</published><updated>2010-02-26T12:15:58.942-08:00</updated><title type='text'>Tweet about a Story with buzzbox</title><content type='html'>The tweet button on buzzbox is pretty nice because with 1 click you get:&lt;br /&gt;&lt;br /&gt;- the title of the story&lt;br /&gt;- the source name&lt;br /&gt;- the short url (using &lt;a href="http://bzbx.us"&gt;bzbx.us&lt;/a&gt; - buzzbox's shortening service)&lt;br /&gt;- the most important topics (this is kind of unique, as far as I know)&lt;br /&gt;&lt;br /&gt;Everything is formatted so it will fit in a tweet. For example:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;Google Enhances Local Search With "Nearby" Filter [techcrunch] http://bzbx.us/S32 #Filter #Google&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;We could also include the buzzrank or other sources writing about the same story... we are experimenting about that.&lt;br /&gt;What do you think? Do you find it useful?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811411079633403304-1103294339954725304?l=ideas-and-code.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideas-and-code.blogspot.com/feeds/1103294339954725304/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://ideas-and-code.blogspot.com/2010/02/tweet-about-story-with-buzzbox.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/1103294339954725304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/1103294339954725304'/><link rel='alternate' type='text/html' href='http://ideas-and-code.blogspot.com/2010/02/tweet-about-story-with-buzzbox.html' title='Tweet about a Story with buzzbox'/><author><name>Roberto F.</name><uri>http://www.blogger.com/profile/14876598345323663362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811411079633403304.post-4064401706201838099</id><published>2010-02-23T22:14:00.000-08:00</published><updated>2010-02-23T22:23:15.618-08:00</updated><title type='text'>Best Daily Video from Youtube</title><content type='html'>I like the way I was able to use BuzzBox to use the data provided by Fast Forward to show the feed of the best videos from youtube, constantly updated. A great channel to check out when you are bored and want to have some fun watching videos.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.buzzbox.com/ws?id=547"&gt;Popular YouTube Videos Feed&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811411079633403304-4064401706201838099?l=ideas-and-code.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideas-and-code.blogspot.com/feeds/4064401706201838099/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://ideas-and-code.blogspot.com/2010/02/best-daily-video-from-youtube.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/4064401706201838099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/4064401706201838099'/><link rel='alternate' type='text/html' href='http://ideas-and-code.blogspot.com/2010/02/best-daily-video-from-youtube.html' title='Best Daily Video from Youtube'/><author><name>Roberto F.</name><uri>http://www.blogger.com/profile/14876598345323663362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811411079633403304.post-43082527386109521</id><published>2010-01-13T08:21:00.000-08:00</published><updated>2010-01-13T08:32:25.615-08:00</updated><title type='text'>Spring Jdbc and no transaction</title><content type='html'>You don't need transaction? Are you using Spring Jdbc (SimpleJdbcTemplate)?&lt;br /&gt;If you enable profileSQL in the jdbc connection url you will notice that all your queries are sorrounded by other 2 queries:&lt;br /&gt;&lt;br /&gt;1. SET autocommit=1&lt;br /&gt;&lt;br /&gt;2. YOUR QUERY&lt;br /&gt;&lt;br /&gt;3. SET autocommit=1&lt;br /&gt;&lt;br /&gt;You don't need 1 and 3 with you are not working with transaction. They are very fast to execute but they require network communication with your DB (and you don't want that!)&lt;br /&gt;&lt;br /&gt;You can fix that adding to your connection URL:&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;br /&gt;elideSetAutoCommits=true&lt;br /&gt;useLocalSessionState=true&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;in my case:&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;br /&gt;jdbc:mysql://localhost:3306/myDb?connectTimeout=4000&amp;amp;autoReconnect=true&amp;amp;useUnicode=true&amp;amp;characterEncoding=UTF-8&amp;amp;profileSql=false&amp;amp;elideSetAutoCommits=true&amp;amp;useLocalSessionState=true&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In my case I'm working on Mysql ISAM tables. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Similarly, I had an annoying SHOW WARNINGS query after every query. It went away when I upgraded Spring from 2.5.4 to 2.5.6&lt;br /&gt;I'm using mysql connector for Java 5.1.10&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811411079633403304-43082527386109521?l=ideas-and-code.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideas-and-code.blogspot.com/feeds/43082527386109521/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://ideas-and-code.blogspot.com/2010/01/spring-jdbc-and-no-transaction.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/43082527386109521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/43082527386109521'/><link rel='alternate' type='text/html' href='http://ideas-and-code.blogspot.com/2010/01/spring-jdbc-and-no-transaction.html' title='Spring Jdbc and no transaction'/><author><name>Roberto F.</name><uri>http://www.blogger.com/profile/14876598345323663362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811411079633403304.post-871767837641750163</id><published>2009-10-05T19:17:00.000-07:00</published><updated>2009-10-05T19:31:49.805-07:00</updated><title type='text'>JTidy errors to Log4j</title><content type='html'>By default JTidy logs all the errors on the standard output, kind of an old fashion way of doing logging. So I spent some time to integrate it with log4j to clean up my standard output.&lt;br /&gt;&lt;br /&gt;First, you need a PrintWriter as a bridge from JTidy to Log4j:&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Log4jPrintWriter extends PrintWriter {&lt;br /&gt;    Priority level;&lt;br /&gt;    Category cat;&lt;br /&gt;    StringBuffer text = &lt;span class="kwrd"&gt;new&lt;/span&gt; StringBuffer(&lt;span class="str"&gt;""&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; Log4jPrintWriter(org.apache.log4j.Category cat, org.apache.log4j.Priority level) {&lt;br /&gt;        super(System.err);  &lt;span class="rem"&gt;// PrintWriter doesn't have default constructor.&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;this&lt;/span&gt;.level =level;&lt;br /&gt;        &lt;span class="kwrd"&gt;this&lt;/span&gt;.cat   = cat;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class="rem"&gt;// overrides all the print and println methods for 'print' it to the constructor's Category&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; close(){&lt;br /&gt;        flush();&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; flush(){&lt;br /&gt;        &lt;span class="kwrd"&gt;if&lt;/span&gt; (!text.toString().equals(&lt;span class="str"&gt;""&lt;/span&gt;)){&lt;br /&gt;            cat.log(level,text.toString());&lt;br /&gt;            text.setLength(0);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; print(boolean b){&lt;br /&gt;        text.append(b);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; print(&lt;span class="kwrd"&gt;char&lt;/span&gt; c){&lt;br /&gt;        text.append(c);&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; print(&lt;span class="kwrd"&gt;char&lt;/span&gt;[] s){&lt;br /&gt;        text.append(s);&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; print(&lt;span class="kwrd"&gt;double&lt;/span&gt; d){&lt;br /&gt;        text.append(d);&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; print(&lt;span class="kwrd"&gt;float&lt;/span&gt; f){&lt;br /&gt;        text.append(f);&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; print(&lt;span class="kwrd"&gt;int&lt;/span&gt; i){&lt;br /&gt;        text.append(i);&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; print(&lt;span class="kwrd"&gt;long&lt;/span&gt; l){&lt;br /&gt;        text.append(l);&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; print(Object obj){&lt;br /&gt;        text.append(obj);&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; print(String s){&lt;br /&gt;        text.append(s);&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; println(){&lt;br /&gt;        &lt;span class="kwrd"&gt;if&lt;/span&gt; (!text.toString().equals(&lt;span class="str"&gt;""&lt;/span&gt;)){&lt;br /&gt;            cat.log(level,text.toString());&lt;br /&gt;            text.setLength(0);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; println(boolean x){&lt;br /&gt;        text.append(x);&lt;br /&gt;        cat.log(level,text.toString());&lt;br /&gt;        text.setLength(0);&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; println(&lt;span class="kwrd"&gt;char&lt;/span&gt; x){&lt;br /&gt;        text.append(x);&lt;br /&gt;        cat.log(level,text.toString());&lt;br /&gt;        text.setLength(0);&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; println(&lt;span class="kwrd"&gt;char&lt;/span&gt;[] x){&lt;br /&gt;        text.append(x);&lt;br /&gt;        cat.log(level,text.toString());&lt;br /&gt;        text.setLength(0);&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; println(&lt;span class="kwrd"&gt;double&lt;/span&gt; x){&lt;br /&gt;        text.append(x);&lt;br /&gt;        cat.log(level,text.toString());&lt;br /&gt;        text.setLength(0);&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; println(&lt;span class="kwrd"&gt;float&lt;/span&gt; x){&lt;br /&gt;        text.append(x);&lt;br /&gt;        cat.log(level,text.toString());&lt;br /&gt;        text.setLength(0);&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; println(&lt;span class="kwrd"&gt;int&lt;/span&gt; x){&lt;br /&gt;        text.append(x);&lt;br /&gt;        cat.log(level,text.toString());&lt;br /&gt;        text.setLength(0);&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; println(&lt;span class="kwrd"&gt;long&lt;/span&gt; x){&lt;br /&gt;        text.append(x);&lt;br /&gt;        cat.log(level,text.toString());&lt;br /&gt;        text.setLength(0);&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; println(Object x){&lt;br /&gt;        text.append(x);&lt;br /&gt;        cat.log(level,text.toString());&lt;br /&gt;        text.setLength(0);&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; println(String x){&lt;br /&gt;        text.append(x);&lt;br /&gt;        cat.log(level,text.toString());&lt;br /&gt;        text.setLength(0);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Thanks to &lt;a href="http://marc.info/?l=log4j-user&amp;m=101250230918002&amp;w=2"&gt;JD Evora&lt;/a&gt; for this.&lt;br /&gt;&lt;br /&gt;Then, declare your Logger and your PrintWriter&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; Logger log = Logger.getLogger(HtmlProcessor.&lt;span class="kwrd"&gt;class&lt;/span&gt;);&lt;br /&gt;    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; Log4jPrintWriter log4j = &lt;span class="kwrd"&gt;new&lt;/span&gt; Log4jPrintWriter(log, Level.DEBUG);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And finally, make JTidy work with it:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;InputStream pageStream =  &lt;span class="kwrd"&gt;new&lt;/span&gt; ByteArrayInputStream(html.getBytes(&lt;span class="str"&gt;"UTF-8"&lt;/span&gt;));&lt;br /&gt;Tidy tidy = &lt;span class="kwrd"&gt;new&lt;/span&gt; Tidy();&lt;br /&gt;&lt;br /&gt;tidy.setOnlyErrors(&lt;span class="kwrd"&gt;true&lt;/span&gt;); //&lt;------------------&lt;br /&gt;&lt;br /&gt;tidy.setInputEncoding(&lt;span class="str"&gt;"UTF-8"&lt;/span&gt;);&lt;br /&gt;tidy.setOutputEncoding(&lt;span class="str"&gt;"UTF-8"&lt;/span&gt;);&lt;br /&gt;tidy.setQuiet(&lt;span class="kwrd"&gt;true&lt;/span&gt;);&lt;br /&gt;tidy.setShowWarnings(&lt;span class="kwrd"&gt;false&lt;/span&gt;);&lt;br /&gt;tidy.setErrout(log4j);&lt;br /&gt;dom = tidy.parseDOM(pageStream, &lt;span class="kwrd"&gt;null&lt;/span&gt;);&lt;br /&gt;dom.normalize();&lt;br /&gt;...&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Enjoy your clean catalina.out!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811411079633403304-871767837641750163?l=ideas-and-code.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideas-and-code.blogspot.com/feeds/871767837641750163/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://ideas-and-code.blogspot.com/2009/10/jtidy-errors-to-log4j.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/871767837641750163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/871767837641750163'/><link rel='alternate' type='text/html' href='http://ideas-and-code.blogspot.com/2009/10/jtidy-errors-to-log4j.html' title='JTidy errors to Log4j'/><author><name>Roberto F.</name><uri>http://www.blogger.com/profile/14876598345323663362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811411079633403304.post-4129769839320187876</id><published>2009-09-24T15:53:00.001-07:00</published><updated>2009-09-24T16:44:29.841-07:00</updated><title type='text'>My Personalized Tech News</title><content type='html'>I've been working on BuzzBox for a while, so I feel now confortable now to share the first links to it.&lt;br /&gt;I'm currently using BuzzBox to read the most popular tech news every day. &lt;br /&gt;News from BuzzBox are:&lt;br /&gt;- personalized: I picked my favourite web sites &lt;br /&gt;- filtered: I get only the most popular news every day&lt;br /&gt;- clustered: so I don't get the same news twice&lt;br /&gt;&lt;br /&gt;I like to describe this first stage as a "personalized techmeme" (techmeme is an tech news aggregator).&lt;br /&gt;&lt;br /&gt;You can see My BuzzBox at &lt;a href="http://www.buzzbox.com/rfonti/MyBuzzBox/"&gt;My BuzzBox&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.buzzbox.com/rfonti/MyBuzzBox/"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 238px;" src="http://1.bp.blogspot.com/_nIWzcyEmiAY/SrwEInm8itI/AAAAAAAABkg/1N9mXldMQ8k/s400/ScreenHunter_4.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5385183800546069202" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I've put the RSS in my Feed Reader, and I consume the news there. Others are pushing thier News from BuzzBox to Twitter. See for example http://twitter.com/anigamBuzzBox or &lt;a href="http://www.buzzbox.com/anigam/tech-blogs/"&gt;Anu's tech BuzzBox&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;We have a long roadmap ahead. We want to bring personalized news to social networks, we want to be a preferred place to share and comment about news with your friends and everybody else.&lt;br /&gt;&lt;br /&gt;Check out the site and let me know what you think.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811411079633403304-4129769839320187876?l=ideas-and-code.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideas-and-code.blogspot.com/feeds/4129769839320187876/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://ideas-and-code.blogspot.com/2009/09/my-personalized-tech-news.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/4129769839320187876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/4129769839320187876'/><link rel='alternate' type='text/html' href='http://ideas-and-code.blogspot.com/2009/09/my-personalized-tech-news.html' title='My Personalized Tech News'/><author><name>Roberto F.</name><uri>http://www.blogger.com/profile/14876598345323663362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_nIWzcyEmiAY/SrwEInm8itI/AAAAAAAABkg/1N9mXldMQ8k/s72-c/ScreenHunter_4.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811411079633403304.post-8034656380695995146</id><published>2009-09-20T21:09:00.000-07:00</published><updated>2009-09-20T21:27:01.733-07:00</updated><title type='text'>A video blog on App Engine</title><content type='html'>I'm working on this basic idea: an automatic video blog created from a search on youtube.&lt;br /&gt;&lt;br /&gt;I like following the interviews of the David Letterman Show on youtube but it's quite difficult to subscribe to a good RSS for that. A simple query returns old and new results and many duplicate videos. Some interviews are partials, other are of bad quality. So I start building a filtering engine, using the Google Data Api.&lt;br /&gt;&lt;br /&gt;I started the project on Google App Engine, on the Java environment.&lt;br /&gt;It's still pretty basic, but you can already see the results:&lt;br /&gt;&lt;br /&gt; &lt;a href="http://videovertigo.appspot.com/letterman/"&gt;http://videovertigo.appspot.com/letterman/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I start with the query:&lt;br /&gt;"+letterman 2009|09 -monologue -"top 10" -"top ten""&lt;br /&gt;&lt;br /&gt;Then I look in the title and in the description for a Date. The parsing is performed by Antlr (thanks to Piercarlo for implementing this part). &lt;br /&gt;Then I assign a rank to each keyword, based on their frequency in the result set.&lt;br /&gt;&lt;br /&gt;Finally I try to cluster the videos that look similar, based on keywords and date.&lt;br /&gt;&lt;br /&gt;I'm still playing with the clustering to make it as general as possible. I would like users to build thier own video blog from a complex query, using tools like information extraction and clustering.&lt;br /&gt;&lt;br /&gt;In the home page there is a simple search functionality you can use to play with the engine: &lt;a href="http://videovertigo.appspot.com/"&gt;http://videovertigo.appspot.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;What do you think? Any idea how to improve the product? Are you an engineer and you would you like to contribute? Please contact me!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811411079633403304-8034656380695995146?l=ideas-and-code.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideas-and-code.blogspot.com/feeds/8034656380695995146/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://ideas-and-code.blogspot.com/2009/09/video-blog-on-app-engine.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/8034656380695995146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/8034656380695995146'/><link rel='alternate' type='text/html' href='http://ideas-and-code.blogspot.com/2009/09/video-blog-on-app-engine.html' title='A video blog on App Engine'/><author><name>Roberto F.</name><uri>http://www.blogger.com/profile/14876598345323663362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811411079633403304.post-5491424156407042845</id><published>2009-08-31T13:11:00.000-07:00</published><updated>2009-08-31T13:19:34.400-07:00</updated><title type='text'>A Bot from Brussel?!</title><content type='html'>I can see in Google Analytics a bunch of new visits every day to our service, &lt;a href="http://www.buzzbox.com"&gt;buzzbox.com&lt;/a&gt;, from Brussel, Belgium.&lt;br /&gt;They don't look right. It seems to be a Bot that is somehow downloading all static files and executing the google analytics script too.&lt;br /&gt;&lt;br /&gt;All the visits come from 2 IP addresses&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;84.17.129.60&lt;br /&gt;84.17.129.61&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And the User Agent, as it appears in my access log, is&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;"Mozilla/5.0 (X11; U; Linux x86_64; c) AppleWebKit/528.5+ (KHTML, like Gecko, Safari/528.5+) WebShot"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;We get most of our traffic from Twitter, so I think it is something connected with Bit.ly&lt;br /&gt;&lt;br /&gt;I'm currently blocking requests from those IPs... but it would be nice to understand more. Anybody has any clue? Please leave a comment.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811411079633403304-5491424156407042845?l=ideas-and-code.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideas-and-code.blogspot.com/feeds/5491424156407042845/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://ideas-and-code.blogspot.com/2009/08/bot-from-brussel.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/5491424156407042845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/5491424156407042845'/><link rel='alternate' type='text/html' href='http://ideas-and-code.blogspot.com/2009/08/bot-from-brussel.html' title='A Bot from Brussel?!'/><author><name>Roberto F.</name><uri>http://www.blogger.com/profile/14876598345323663362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811411079633403304.post-8653640233474805865</id><published>2009-08-06T12:23:00.000-07:00</published><updated>2009-08-10T21:52:11.965-07:00</updated><title type='text'>Tomcat on EC2 hot deployment</title><content type='html'>I'm running a simple application on Amazon EC2 on a single Tomcat and I have been looking for a while for the best way to deploy updates.&lt;br /&gt;&lt;br /&gt;I'm builing the application with Maven 2 and so I first I considered using the Cargo plugin to connect with a running Tomcat Manager. It didn't work for me: the Tomcat Manager stops and undeploys the application before starting receiving the new war file. In my case I was waiting almost 2 minutes to see my new war up and running (2 minutes in which the application is not reachable). I considered that too long.&lt;br /&gt;&lt;br /&gt;I ended up uploading the application with scp and then moving it in place in the running Tomcat.&lt;br /&gt;&lt;br /&gt;1. Create this script on the server. &lt;span style="font-weight:bold;"&gt;hotdeploy.sh&lt;/span&gt; &lt;br /&gt;&lt;pre class="csharpcode"&gt;#!/bin/sh&lt;br /&gt;TOMCATWEBAPPS=/var/local/tomcat-buzzbox/webapps&lt;br /&gt;chown tomcat:tomcat ROOT.war&lt;br /&gt;&lt;br /&gt;if [ -f $TOMCATWEBAPPS/ROOT.war ]; then&lt;br /&gt;  cp -p $TOMCATWEBAPPS/ROOT.war ROOT.war.previous&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;cp -p ROOT.war $TOMCATWEBAPPS/ROOT.war&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;It just move the war file in tomcat/webapps, while tomcat is running&lt;br /&gt;&lt;br /&gt;2. Make sure your Tomcat is configured for auto deploy (in server.xml)&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Host&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="localhost"&lt;/span&gt;  &lt;span class="attr"&gt;appBase&lt;/span&gt;&lt;span class="kwrd"&gt;="webapps"&lt;/span&gt;&lt;br /&gt;       &lt;span class="attr"&gt;unpackWARs&lt;/span&gt;&lt;span class="kwrd"&gt;="true"&lt;/span&gt; &lt;span class="attr"&gt;autoDeploy&lt;/span&gt;&lt;span class="kwrd"&gt;="true"&lt;/span&gt;&lt;br /&gt;       &lt;span class="attr"&gt;xmlValidation&lt;/span&gt;&lt;span class="kwrd"&gt;="false"&lt;/span&gt; &lt;span class="attr"&gt;xmlNamespaceAware&lt;/span&gt;&lt;span class="kwrd"&gt;="false"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;3. Create this script on your local machine (or development environment). &lt;span style="font-weight:bold;"&gt;deploy.bat&lt;/span&gt; - I'm using windows and cygwin.&lt;br /&gt;&lt;pre class="csharpcode"&gt;echo off&lt;br /&gt;echo Overwrite App with new version. Are you sure?&lt;br /&gt;echo -- press any key to continue; CNTR+C to cancel&lt;br /&gt;&lt;br /&gt;pause&lt;br /&gt;&lt;br /&gt;scp -i keypair1.pem ROOT.war root@domain.com:/root/ROOT.war&lt;br /&gt;ssh -i keypair1.pem root@domain.com 'cd /root/bb-deploy; ./hotdeploy.sh'&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That is: scp to move your war file and ssh to run the hostdeploy.sh script on the server. Tomcat auto deploys does the rest.&lt;br /&gt;&lt;br /&gt;That's all. It works great for me. Only few seconds of downtime.&lt;br /&gt;What do you think? How would you deploy a war in such an environment?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811411079633403304-8653640233474805865?l=ideas-and-code.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideas-and-code.blogspot.com/feeds/8653640233474805865/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://ideas-and-code.blogspot.com/2009/08/tomcat-on-ec2-hot-deployment.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/8653640233474805865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/8653640233474805865'/><link rel='alternate' type='text/html' href='http://ideas-and-code.blogspot.com/2009/08/tomcat-on-ec2-hot-deployment.html' title='Tomcat on EC2 hot deployment'/><author><name>Roberto F.</name><uri>http://www.blogger.com/profile/14876598345323663362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811411079633403304.post-1337081375941122110</id><published>2009-08-02T20:50:00.000-07:00</published><updated>2009-08-14T11:15:25.566-07:00</updated><title type='text'>Virtual Hosts with Apache, Tomcat, AJP</title><content type='html'>Here I describe how to configure Apache to handle request for 2 virtual hosts, redirecting the requests to 2 Tomcat installed on the same machine.&lt;br /&gt;&lt;br /&gt;Suppose you want to handle 2 applications hello.com and welcome.com.&lt;br /&gt;The DNS points to the same IP address and Apache is listening to port 80.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Apache/2.2.3&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Add proxy_ajp.conf in /etc/httpd/conf.d&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;LoadModule proxy_ajp_module modules/mod_proxy_ajp.so&lt;br /&gt;&lt;br /&gt;NameVirtualHost *&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;VirtualHost&lt;/span&gt; *&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;       ServerName hello.com&lt;br /&gt;       DocumentRoot /var/local/tomcat/webapps/ROOT/&lt;br /&gt;       ProxyPass /static/ !&lt;br /&gt;       ProxyPass / ajp://localhost:8091/&lt;br /&gt;       ProxyPassReverse / ajp://localhost:8091/&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;VirtualHost&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;VirtualHost&lt;/span&gt; *&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;       ServerName welcome.com&lt;br /&gt;       DocumentRoot /var/local/tomcat2/webapps/ROOT/&lt;br /&gt;       ProxyPass /static/ !&lt;br /&gt;       ProxyPass / ajp://localhost:8090/&lt;br /&gt;       ProxyPassReverse / ajp://localhost:8090/&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;VirtualHost&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Note how the static files (tipically images, css, javascripts... everything inside /static/) will be served by Apache. You need to have both "ProxyPass /static/ !" and the correct DocumentRoot.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Tomcat 6.0.18&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The default configuration of Tomcat 6.0.18 works pretty fine. You just have to change the ports so they don't conflict. I'm using 8090 and 8091 for the 2 APJ Connectors of the 2 Tomcats.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811411079633403304-1337081375941122110?l=ideas-and-code.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideas-and-code.blogspot.com/feeds/1337081375941122110/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://ideas-and-code.blogspot.com/2009/08/virtual-hosts-with-apache-tomcat-ajp.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/1337081375941122110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/1337081375941122110'/><link rel='alternate' type='text/html' href='http://ideas-and-code.blogspot.com/2009/08/virtual-hosts-with-apache-tomcat-ajp.html' title='Virtual Hosts with Apache, Tomcat, AJP'/><author><name>Roberto F.</name><uri>http://www.blogger.com/profile/14876598345323663362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811411079633403304.post-4946934045526250823</id><published>2009-08-02T15:59:00.000-07:00</published><updated>2009-08-10T21:52:12.037-07:00</updated><title type='text'>Amazon EC2 - file transfert console</title><content type='html'>If you run Windows, and you want something more user friendly to move file from and to EC2 than "scp", you can use WinSCP, following this directions:&lt;br /&gt;&lt;br /&gt;1. Download WinSCP&lt;br /&gt;2. Download puttygen&lt;br /&gt;3. convert your private key (keypair1.pem) to putty format using puttygen. Save it as .ppk&lt;br /&gt;&lt;br /&gt;Just run:&lt;br /&gt;puttygen.exe keypair1.pem&lt;br /&gt;then meny File/Save as Private Key&lt;br /&gt;&lt;br /&gt;4. connect to your instance using WinSCP, specifing scp protocol and using the generated ppk key&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811411079633403304-4946934045526250823?l=ideas-and-code.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideas-and-code.blogspot.com/feeds/4946934045526250823/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://ideas-and-code.blogspot.com/2009/08/amazon-ec2-file-transfert-console.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/4946934045526250823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/4946934045526250823'/><link rel='alternate' type='text/html' href='http://ideas-and-code.blogspot.com/2009/08/amazon-ec2-file-transfert-console.html' title='Amazon EC2 - file transfert console'/><author><name>Roberto F.</name><uri>http://www.blogger.com/profile/14876598345323663362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811411079633403304.post-7903507054967302053</id><published>2009-08-01T12:59:00.000-07:00</published><updated>2009-08-10T21:52:11.981-07:00</updated><title type='text'>A Blog Style for posting code</title><content type='html'>It took me a while to configure the style of this blog as I wanted.&lt;br /&gt;I needed a template that was clean, easy to read, and wide enough to post code.&lt;br /&gt;I needed a simple way to format code, mostly Java or XML. I wanted to use free tools and I wanted to copy and paste the code from my IDE without touching it (no adding spaces or tabs, please).&lt;br /&gt;&lt;br /&gt;So, I came up with this solution:&lt;br /&gt;&lt;br /&gt;1. Select "Minima Lefty Stretch by Douglas Bowman". Then you have to modify the template... read on.&lt;br /&gt;&lt;br /&gt;2. Make it 960px width and with a dark bg color. &lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Variable&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="bgcolor"&lt;/span&gt; &lt;span class="attr"&gt;description&lt;/span&gt;&lt;span class="kwrd"&gt;="Page Background Color"&lt;/span&gt;&lt;br /&gt;             &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="color"&lt;/span&gt; &lt;span class="attr"&gt;default&lt;/span&gt;&lt;span class="kwrd"&gt;="#fff"&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;="#162541"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;#outer-wrapper {&lt;br /&gt;width:960px;&lt;br /&gt;margin:auto;&lt;br /&gt;background:#ffffff;&lt;br /&gt;padding:10px;&lt;br /&gt;text-align:left;&lt;br /&gt;font: normal normal 100% Verdana, sans-serif;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;3. fix the publication date line and the body line-height&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;.postmeta {&lt;br /&gt;  font-size:80%;&lt;br /&gt;  text-align:right;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.post-body{&lt;br /&gt; // line-height: 1.6em ---- make sure you remove this&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;4. Add code formatting support with &lt;a href="http://www.manoli.net/csharpformat/"&gt;csharpformat&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;.postmeta {&lt;br /&gt;  font-size:80%;&lt;br /&gt;  text-align:right;&lt;br /&gt;}&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;    font-size: small;&lt;br /&gt;    color: black;&lt;br /&gt;    font-family: Consolas, &lt;span class="attr"&gt;&amp;amp;quot;&lt;/span&gt;Courier New&lt;span class="attr"&gt;&amp;amp;quot;&lt;/span&gt;, Courier, Monospace;&lt;br /&gt;    background-color: rgb(240, 250, 230);&lt;br /&gt;    /*white-space: pre;*/&lt;br /&gt;        overflow: auto; overflow-y: visible;&lt;br /&gt;        padding: 10px;&lt;br /&gt;        border: solid 1px rgb(120, 125, 115);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.csharpcode pre { margin: 0em; overflow: auto; overflow-y: visible;}&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;    background-color: #f4f4f4;&lt;br /&gt;    width: 100%;&lt;br /&gt;    margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;5. To format my code, I copy and paste my code to &lt;a href="http://www.manoli.net/csharpformat/"&gt;csharpformat&lt;/a&gt; (it works decently for Java too) and then I paste the result in blogger's HTML view.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811411079633403304-7903507054967302053?l=ideas-and-code.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideas-and-code.blogspot.com/feeds/7903507054967302053/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://ideas-and-code.blogspot.com/2009/08/blog-style-for-posting-code.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/7903507054967302053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/7903507054967302053'/><link rel='alternate' type='text/html' href='http://ideas-and-code.blogspot.com/2009/08/blog-style-for-posting-code.html' title='A Blog Style for posting code'/><author><name>Roberto F.</name><uri>http://www.blogger.com/profile/14876598345323663362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811411079633403304.post-2218845364791286955</id><published>2009-07-31T15:02:00.000-07:00</published><updated>2009-08-10T21:52:12.053-07:00</updated><title type='text'>Media RSS Plugin for ROME - howto</title><content type='html'>Rome, the Rss Java library, is extensible using Modules.&lt;br /&gt;This is how to integrate the Media Module (http://search.yahoo.com/mrss/) by Yahoo!&lt;br /&gt;&lt;br /&gt;Getting the library:&lt;br /&gt;&lt;br /&gt;Download the jar from java.net &lt;a href="http://wiki.java.net/bin/view/Javawsxml/MediaRSS"&gt;here&lt;/a&gt; - code there is not very useful.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Maven&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;Add to your pom.xml this repository:&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;repositories&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;repository&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;dist.wso2.org&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;dist.wso2.org&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;url&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            http://dist.wso2.org/maven2/&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;url&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;repository&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;repositories&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;and this dependency:&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;dependency&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;groupId&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;rome&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;groupId&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;artifactId&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;rome-mediarss&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;artifactId&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;     &lt;span class="rem"&gt;&amp;lt;!-- rome Yahoo! Media RSS Plugin for ROME , hosted on http://dist.wso2.org/maven2--&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;0.2.2&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;dependency&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Java Code&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;You can iterate through your Media Content like this:&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;br /&gt;SyndFeed feed = input.build(&lt;span class="kwrd"&gt;new&lt;/span&gt; XmlReader( method.getResponseBodyAsStream() ));&lt;br /&gt;List entries = feed.getEntries();&lt;br /&gt;&lt;span class="kwrd"&gt;for&lt;/span&gt;( Object obj : entries ) {  &lt;br /&gt;    SyndEntry e = (SyndEntry) obj;&lt;br /&gt;    MediaModule mediaModule = (MediaModule)e.getModule( MEDIA_NS );&lt;br /&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (mediaModule!=&lt;span class="kwrd"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; mediaModule instanceof MediaEntryModule ){&lt;br /&gt;        MediaEntryModule mentry = (MediaEntryModule ) mediaModule;&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;for&lt;/span&gt; (MediaGroup mg : mentry.getMediaGroups()) {&lt;br /&gt;            &lt;span class="kwrd"&gt;for&lt;/span&gt; (MediaContent mc : mg.getContents()) {&lt;br /&gt;                &lt;span class="kwrd"&gt;if&lt;/span&gt; (mc.getType()!=&lt;span class="kwrd"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; mc.getType().startsWith(&lt;span class="str"&gt;"image"&lt;/span&gt;)) {&lt;br /&gt;                    String imgUrl = mc.getReference().toString();&lt;br /&gt;                    &lt;span class="rem"&gt;// etc...&lt;/span&gt;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;In this case I was interested in getting image urls.&lt;br /&gt;You can access the MediaRss JavaDoc &lt;a href="https://rome.dev.java.net/nonav/apidocs/subprojects/modules/mediarss/0.2/apidocs/"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811411079633403304-2218845364791286955?l=ideas-and-code.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideas-and-code.blogspot.com/feeds/2218845364791286955/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://ideas-and-code.blogspot.com/2009/07/media-rss-plugin-for-rome-howto.html#comment-form' title='1 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/2218845364791286955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811411079633403304/posts/default/2218845364791286955'/><link rel='alternate' type='text/html' href='http://ideas-and-code.blogspot.com/2009/07/media-rss-plugin-for-rome-howto.html' title='Media RSS Plugin for ROME - howto'/><author><name>Roberto F.</name><uri>http://www.blogger.com/profile/14876598345323663362</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
