<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-7864604315847802409</id><updated>2008-05-17T15:33:40.967+02:00</updated><title type='text'>Inside JavaBlackBelt</title><link rel='alternate' type='text/html' href='http://www.javablackbelt.com/blog/'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7864604315847802409/posts/default'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.javablackbelt.com/blog/atom.xml'/><author><name>Nicolas Brasseur</name><uri>http://www.blogger.com/profile/01117035593921786099</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7864604315847802409.post-4052383334546643306</id><published>2008-05-16T13:00:00.003+02:00</published><updated>2008-05-17T13:54:40.510+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='community'/><title type='text'>You must obey the rules !</title><content type='html'>With the upcoming revamp of the moderation process, here at the JavaBlackBelt &lt;a href="http://www.javablackbelt.com/blog/atomium.jpg"&gt;secret HQ&lt;/a&gt; we are fiercely arguing about &lt;span style="font-weight: bold;"&gt;What Makes A Question Good&lt;/span&gt;. I've summed up our discussions in the form of rules and have decided to share them with the community in this blog entry.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;A question must be in the &lt;span style="font-weight: bold;"&gt;right place&lt;/span&gt;. A major problem in the basic exams is that many questions are too hard for the category they're in.&lt;/li&gt;&lt;li&gt;The question's statement must be clear, easy-to-understand, well-formatted, typo-free and focussed on testing real knowledge.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Avoid ambiguity&lt;/span&gt;: nothing is worse than knowing the answer but hesitating to state it because it's unclear what the question author wants. Example: "How old is J2SE?"&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Avoid trick questions&lt;/span&gt;: does a question test the user's attention rather than her technical knowledge?&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Avoid never-ending questions&lt;/span&gt;: questions containing too much text/code/choice are usually of poor quality.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Avoid &lt;/span&gt;&lt;span&gt;&lt;span style="font-weight: bold;"&gt;cut &amp;amp; paste code&lt;/span&gt; questions&lt;/span&gt; : ask yourself "Is it easy to find the right answer without even understanding why the answer is right, simply by pasting into an IDE or googling for 10 seconds?"&lt;/li&gt;&lt;li&gt;A question must include a &lt;span style="font-weight: bold;"&gt;clear and pedagogical explanation&lt;/span&gt; that will teach the user something. We aim to teach people new things.&lt;/li&gt;&lt;li&gt;Don't copy other people's questions. &lt;span style="font-weight: bold;"&gt;Plagiarism is evil&lt;/span&gt;.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;You must obey the rules !&lt;br /&gt;&lt;br /&gt;We've built JavaBlackBelt as a learning tool where people play with exams to discover new things. Help them in their journey. The main mantra when you write a question should be &lt;span style="font-weight: bold;"&gt;"Do not try to trap people, help them learn and understand the technology."&lt;/span&gt;</content><link rel='alternate' type='text/html' href='http://www.javablackbelt.com/blog/2008/05/you-must-obey-rules.html' title='You must obey the rules !'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7864604315847802409&amp;postID=4052383334546643306&amp;isPopup=true' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.javablackbelt.com/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7864604315847802409/posts/default/4052383334546643306'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7864604315847802409/posts/default/4052383334546643306'/><author><name>Nicolas Brasseur</name><uri>http://www.blogger.com/profile/01117035593921786099</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-7864604315847802409.post-3929680297771901216</id><published>2008-05-09T08:30:00.001+02:00</published><updated>2008-05-11T18:56:39.994+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='music'/><title type='text'>Singing about architecture is like...</title><content type='html'>&lt;a href="http://globalnerdy.com/2007/11/28/dilbert-on-extreme-and-agile-programming/"&gt;Extreme Programming&lt;/a&gt; and &lt;a href="http://dilbert.com/strips/comic/2008-04-15/"&gt;stand-up meetings&lt;/a&gt; have appeared in Dilbert over the years, but there's a new reference point to prove that software development methodology is a hot topic in mainstream pop culture: &lt;a href="http://www.youtube.com/watch?v=k2CFDsG_oxg"&gt;"The Architect"&lt;/a&gt; by &lt;a href="http://www.myspace.com/deusbe"&gt;dEUS&lt;/a&gt; (one of Belgium's best-known rock bands - which sounds like an insult, but isn't... I hope):&lt;br /&gt;&lt;br /&gt;&lt;object height="355" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/k2CFDsG_oxg&amp;amp;hl=en"&gt;&lt;param name="wmode" value="transparent"&gt;&lt;embed src="http://www.youtube.com/v/k2CFDsG_oxg&amp;amp;hl=en" type="application/x-shockwave-flash" wmode="transparent" height="355" width="425"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;There's more to the song than a catchy guitar riff that's both dissonant and jerkily propulsive, it's clearly lambasting &lt;a href="http://www.waterfallmanifesto.org/"&gt;Waterfall&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Big_Design_Up_Front"&gt;Big Design Up Front&lt;/a&gt; and &lt;a href="http://www.joelonsoftware.com/articles/fog0000000018.html"&gt;Architecture Astronauts&lt;/a&gt;. Check out some of the &lt;a href="http://www.hotellounge.com/songs/thearchitect.html"&gt;lyrics&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;What is the architect doing?&lt;br /&gt;(...)&lt;br /&gt;I'm gonna go home and shut up for a year&lt;br /&gt;And when that year is over I will reappear&lt;br /&gt;And have a solution.&lt;br /&gt;I've reason to believe that what I find&lt;br /&gt;Is gonna change the face of human kind&lt;br /&gt;(...)&lt;br /&gt;Cause I'm the architect.&lt;br /&gt;(...)&lt;br /&gt;About all the problems on this earth we should&lt;br /&gt;Worry now to solve them later&lt;br /&gt;And so he’s brooding and alluding on a perfect design.&lt;br /&gt;(...)&lt;br /&gt;Now if these aspirations bother you&lt;br /&gt;Well you are just you, you don’t have a clue&lt;br /&gt;I'm sticking to the plan, I will see it through&lt;br /&gt;Let there be no confusion.&lt;br /&gt;Cause I'm the architect.&lt;/blockquote&gt;&lt;br /&gt;It may only be software development, but at least now it's rock 'n' roll, too.</content><link rel='alternate' type='text/html' href='http://www.javablackbelt.com/blog/2008/05/singing-about-architecture-is-like.html' title='Singing about architecture is like...'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7864604315847802409&amp;postID=3929680297771901216&amp;isPopup=true' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.javablackbelt.com/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7864604315847802409/posts/default/3929680297771901216'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7864604315847802409/posts/default/3929680297771901216'/><author><name>Moandji Ezana</name><uri>http://www.blogger.com/profile/15146694874856243257</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-7864604315847802409.post-6539513726381476226</id><published>2008-05-07T12:01:00.000+02:00</published><updated>2008-05-07T12:01:00.689+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dev'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><title type='text'>JUnit and auto-boxing</title><content type='html'>After that gigantic &lt;a href="http://www.javablackbelt.com/blog/2008/04/tomcat-memory-leak.html"&gt;previous post&lt;/a&gt;, I thought it'd be good to post something simpler and more widely applicable.&lt;br /&gt;&lt;br /&gt;I came across a little JUnit assertion gotcha that had me puzzled for a second. I was testing this (note, calculateDurationInSeconds() returns a long)&lt;br /&gt;&lt;blockquote&gt;assertEquals(120, subjectUnderTest.calculateDurationInSeconds());&lt;/blockquote&gt;and getting the following, less-than-helpful test failure message&lt;br /&gt;&lt;blockquote&gt;expected: &lt;120&gt; but was: &lt;120&gt;&lt;/blockquote&gt;I figured this one out pretty quickly because my Eclipse underlines cases of auto-boxing/unboxing. Since the assertEquals(Object, Object) method is being used, my int is becoming an Integer and the long returned by the method is becoming a Long. Obviously, any equals() comparaison is going to fail. I corrected this by using the long literal notation:&lt;br /&gt;&lt;blockquote&gt;assertEquals(120L, subjectUnderTest.calculateDurationInSeconds());&lt;/blockquote&gt;What with all the conversion already going on between the presentation and data layers, I'm trying to generalise the practice of making primitive/wrapper conversions explicit, just in case.</content><link rel='alternate' type='text/html' href='http://www.javablackbelt.com/blog/2008/05/junit-and-auto-boxing.html' title='JUnit and auto-boxing'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7864604315847802409&amp;postID=6539513726381476226&amp;isPopup=true' title='2 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.javablackbelt.com/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7864604315847802409/posts/default/6539513726381476226'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7864604315847802409/posts/default/6539513726381476226'/><author><name>Moandji Ezana</name><uri>http://www.blogger.com/profile/15146694874856243257</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-7864604315847802409.post-6331309041174752733</id><published>2008-05-05T18:16:00.001+02:00</published><updated>2008-05-06T10:31:10.218+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dev'/><category scheme='http://www.blogger.com/atom/ns#' term='app servers'/><title type='text'>How Tomcat ruined my night</title><content type='html'>Tomcat is probably &lt;a href="http://blog.springsource.com/main/2007/12/24/is-it-a-tomcat-or-the-elephant-in-the-room/"&gt;one of the more widely used pieces of open source infrastructure&lt;/a&gt; and it's a great boon to our productivity. Sometimes, though, a deep-rooted problem can sneak up on you and drag you into a sleep-deprived night of frantic web searching.&lt;br /&gt;&lt;br /&gt;One day, I happened to see our production JVM restart, for no apparent reason. Intrigued, I looked into it a little bit more and realised that since &lt;a href="http://www.javablackbelt.com/NewsletterPreview.wwa?newsletterId=5819858"&gt;the release of JBB v3&lt;/a&gt; last December, it had been restarting roughly 6 times per month. After an OutOfMemory, &lt;a href="http://blogs.sun.com/alanb/entry/heap_dumps_are_back_with"&gt;the JVM dumps its heap into an hprof file&lt;/a&gt;, so there were a number of these files on the server, often over 1GB each!&lt;br /&gt;&lt;br /&gt;I downloaded an hprof file and tried to open it with &lt;a href="https://hat.dev.java.net/"&gt;jhat&lt;/a&gt;, provided with the default Java 6 distro. jhat creates a website for you to visualise the heap [1]. Unfortunately, I couldn't get jhat to work, probably because &lt;a href="http://blogs.sun.com/alanb/entry/heap_dumps_are_back_with#comment-1174977909000"&gt;JavaScript support is not yet implemented in MacOSX's JDK 1.6&lt;/a&gt;. I got around this problem by reading the hprof with &lt;a href="http://yourkit.com/"&gt;YourKit Java Profiler 7.0&lt;/a&gt; and quickly saw that vast amounts of memory were being taken up by several huge char arrays (click on the image for a larger version).&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.javablackbelt.com/blog/uploaded_images/yourkit_sc-743134.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://www.javablackbelt.com/blog/uploaded_images/yourkit_sc-743123.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;As you can see from the screenshot, 115 instances of &lt;a href="http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/jasper/runtime/BodyContentImpl.html"&gt;org.apache.jasper.runtime.BodyContentImpl&lt;/a&gt; were holding on to over 560 million bytes worth of objects, keeping them from being garbage-collected and eating up inordinate amounts of RAM. So, what's BodyContentImpl actually doing?&lt;br /&gt;&lt;br /&gt;Tomcat maintains a pool of PageContext instances, which in turn have an array of BodyContentImpls. Each BodyContentImpl has an array with the text from the tag's body. This array has a default size of 512 that is hard-coded as org.apache.jasper.Constants.DEFAULT_TAG_BUFFER_SIZE. Once the body of a custom tag gets bigger than that, the array grows and is never reset to its original size. With concurrent users, several such arrays might be created, so if a few popular pages use big custom tags, you can end up with a number of gigantic, un-garbage-collectable char arrays. In our case, this happened because in v3 we started decorating large blocks of JSP code with SiteMesh custom tags.&lt;br /&gt;&lt;br /&gt;One solution would be to set the environment variable org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER to true, so that arrays over 512 bytes are released. Another would be to recompile Tomcat with a tag buffer size more suited to our needs. So both choices are extreme: either you maintain huge arrays for ever, or you're constantly creating and garbage collecting arrays, as 512 bytes is a fairly low limit for custom tags. We settled on giving the JVM more RAM to handle the extra garbage collection.&lt;br /&gt;&lt;br /&gt;Of course, &lt;a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=37793"&gt;others&lt;/a&gt; have &lt;a href="http://jira.atlassian.com/browse/JRA-10145"&gt;experienced&lt;/a&gt; the same problem&lt;a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=37793"&gt;&lt;/a&gt;. What's the word from the Tomcat camp? Well, Remy Maucherat, Tomcat committer, &lt;a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=37793#c8"&gt;considers that&lt;/a&gt;: &lt;blockquote&gt;Using sensibly written software helps. It should be obvious reading the API that using large body tags is going to be a huge problem.&lt;br /&gt;&lt;/blockquote&gt;Please draw your own conclusions.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;By the way, jhat loads the whole hprof file into memory, so you may need to use the -J-mx512m flag if you're having OutOfMemory thrown.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;</content><link rel='alternate' type='text/html' href='http://www.javablackbelt.com/blog/2008/05/how-tomcat-ruined-my-night.html' title='How Tomcat ruined my night'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7864604315847802409&amp;postID=6331309041174752733&amp;isPopup=true' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.javablackbelt.com/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7864604315847802409/posts/default/6331309041174752733'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7864604315847802409/posts/default/6331309041174752733'/><author><name>Aymeric Levaux</name><uri>http://www.blogger.com/profile/15554948182907260874</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-7864604315847802409.post-1868907648201276264</id><published>2008-04-30T10:52:00.000+02:00</published><updated>2008-04-30T11:04:22.324+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Welcome!</title><content type='html'>Welcome to &lt;a href="http://www.javablackbelt.com/"&gt;JavaBlackBelt&lt;/a&gt;'s new blog!&lt;br /&gt;&lt;br /&gt;The aim and content are likely to evolve, but at the moment, we plan to write about some of the interesting technical issues Aymeric and I face developing the website, along with tips and tricks/how-to posts to help you get the most out of JBB.&lt;br /&gt;&lt;br /&gt;Please leave comments, bookmark us, subscribe to the &lt;a href="http://www.javablackbelt.com/blog/atom.xml"&gt;RSS feed&lt;/a&gt;, share us on your favourite social networks and whatever else people are doing to blogs nowadays. We hope you enjoy delving Inside JavaBlackBelt!</content><link rel='alternate' type='text/html' href='http://www.javablackbelt.com/blog/2008/04/welcome_30.html' title='Welcome!'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7864604315847802409&amp;postID=1868907648201276264&amp;isPopup=true' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.javablackbelt.com/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7864604315847802409/posts/default/1868907648201276264'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7864604315847802409/posts/default/1868907648201276264'/><author><name>Moandji Ezana</name><uri>http://www.blogger.com/profile/15146694874856243257</uri><email>noreply@blogger.com</email></author></entry></feed>