<?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-8400556187645363102</id><updated>2011-12-31T01:08:26.636-08:00</updated><category term='java6'/><category term='captcha'/><category term='jcaptcha'/><category term='java'/><category term='leopard'/><category term='brms'/><category term='apple'/><category term='drools'/><category term='mac'/><category term='eclipse'/><category term='jboss rules'/><category term='how-to'/><category term='intellij'/><category term='osx'/><title type='text'>macjavadev</title><subtitle type='html'>Coding like Frank Lloyd Wright built: elegant, efficient, professional, and occasionally leaky.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://macjavadev.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8400556187645363102/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://macjavadev.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>James</name><uri>http://www.blogger.com/profile/15984236341367538242</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>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8400556187645363102.post-7478080962754659344</id><published>2007-12-06T13:32:00.000-08:00</published><updated>2007-12-07T11:17:53.568-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='java6'/><category scheme='http://www.blogger.com/atom/ns#' term='osx'/><category scheme='http://www.blogger.com/atom/ns#' term='mac'/><title type='text'>Using OpenJDK 1.6 (Java 6) with IntelliJ</title><content type='html'>I have been able to use the &lt;a href="http://landonf.bikemonkey.org/static/soylatte/"&gt;SoyLatte&lt;/a&gt; (a.k.a. version 1.0 of the Java 6 Port for Mac OS X 10.4 and 10.5) to compile my projects in IntelliJ. It was fairly painless. To do so:&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Install OpenJDK 1.0. Brandon recommends putting it in /usr/local/soylatte16-amd64, but I went ahead and put it in /System/Frameworks/JavaVM.Framework/Versions. Makes more sense to me that way, but it doesn't really matter.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;In IntelliJ open up your project preferences (Cmd-,)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Click on "JDKs"&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Add a new one.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Add the following jars to the classpath:&lt;br /&gt;${install_dir}/soylatte16-i386-1.0/lib/dt.jar&lt;br /&gt;${install_dir}/soylatte16-i386-1.0/lib/jconsole.jar&lt;br /&gt;${install_dir}/soylatte16-i386-1.0/lib/tools.jar&lt;br /&gt;${install_dir}/soylatte16-i386-1.0/jre/lib/charsets.jar&lt;br /&gt;${install_dir}/soylatte16-i386-1.0/jre/lib/jce.jar&lt;br /&gt;${install_dir}/soylatte16-i386-1.0/jre/lib/jsse.jar&lt;br /&gt;${install_dir}/soylatte16-i386-1.0/jre/lib/management-agent.jar&lt;br /&gt;${install_dir}/soylatte16-i386-1.0/jre/lib/resources.jar&lt;br /&gt;${install_dir}/soylatte16-i386-1.0/jre/lib/rt.jar&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;And you're done. Note that this is only to compile existing projects with Java 6 using IntelliJ. If you want to launch IntelliJ with Java6 you're on your own.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8400556187645363102-7478080962754659344?l=macjavadev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://macjavadev.blogspot.com/feeds/7478080962754659344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8400556187645363102&amp;postID=7478080962754659344' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8400556187645363102/posts/default/7478080962754659344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8400556187645363102/posts/default/7478080962754659344'/><link rel='alternate' type='text/html' href='http://macjavadev.blogspot.com/2007/12/using-openjdk-16-java-6-with-intellij.html' title='Using OpenJDK 1.6 (Java 6) with IntelliJ'/><author><name>James</name><uri>http://www.blogger.com/profile/15984236341367538242</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-8400556187645363102.post-2819919579455584954</id><published>2007-11-20T07:13:00.000-08:00</published><updated>2007-11-20T08:11:56.177-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='intellij'/><category scheme='http://www.blogger.com/atom/ns#' term='eclipse'/><title type='text'>IntelliJ: t3h awesome (mostly)</title><content type='html'>I installed IntelliJ a couple of weeks ago, and have thus far been impressed. After using Eclipse for the past three years I've been getting more and more annoyed at its sluggishness. I tried NetBeans for about three days, but quickly got frustrated with it. IntelliJ, however, is a lean, mean, fighting machine, intuitive in all the right places and a breeze to use, with a couple of exceptions.&lt;br /&gt;&lt;br /&gt;My primary positive praise is all about the speed: IntelliJ is fast. After using the bloated beast that is Eclipse, using IntelliJ makes my neural receptors hum with delight. Loading up and switching between projects is faster. Setting preferences is faster. Tweaking the classpath, refactoring, searching for references, and generating code coverage reports: all faster.&lt;br /&gt;&lt;br /&gt;And Groovy? Don't even get me started. The Groovy plug-in for Eclipse is like using a climbing Mt. Everest while drunk: technically possible, but something that will quite likely lead to an early death. The Groovy support in IntelliJ is robust and... fast.&lt;br /&gt;&lt;br /&gt;Editing non-Java files is also a breeze. Now, normally I am a &lt;a href="http://www.vim.org/"&gt;vim&lt;/a&gt; nut. For years I have been using vim for editing JSPs, XML, config files, etc. Basically, if it's not a Java class, I use vim. I have plenty of macros and various vim-crap to help me along, but IntelliJ is the first thing I have used that has caused me to use vim less -- much to my own surprise. The XML editor is tight: it reads your DTD/schema and lets you do the cmd-space trick for auto-completion of tag names and attributes. Spring configuration files are validated against known classes, so if you reference a bean that IntelliJ doesn't know about, it flags your config file with an error.&lt;br /&gt;&lt;br /&gt;Nice.&lt;br /&gt;&lt;br /&gt;But all is not roses. We have an extensive Struts application where I work, and the Tiles integration seems to simply be broken.  For example, in the following example the input is flagged as an error even though that tile is defined elsewhere:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;action path="/searchPromos" input=".Mpr.Main"&amp;gt;&lt;/pre&gt;&lt;br /&gt;Also, there were problems with the GWT integration that I was unable to overcome. This may simply be due to my inexperience with that framework, so I will not go into detail about that until I am more confident where the blame lays.&lt;br /&gt;&lt;br /&gt;There are also two views that Eclipse has that IntelliJ does not: JavaDoc and declaration. I kept these open all the time in Eclipse, and I miss them. The IntelliJ way of viewing JavaDocs is to hit ^j. While this is fine, I still miss my dedicated view.&lt;br /&gt;&lt;br /&gt;On the plus side, IntelliJ validates your JavaDocs more thoroughly than Eclipse does. For example, IntelliJ raises a flag in the following due to the discrepancy between what is documented (&lt;code&gt;param&lt;/code&gt;) and what is coded (&lt;code&gt;param1&lt;/code&gt;):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;/**&lt;br /&gt;  * A method which does something&lt;br /&gt;  *&lt;br /&gt;  * @param param&lt;br /&gt;  */&lt;br /&gt;  public void doSomething(int param1) { ... }&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;In any event, IntelliJ is an excellent IDE. It is different from Eclipse, to be sure, but they are kissing cousins. The initial effort I put into it has paid off nicely thus far, and switching has not cause me any undue pain.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8400556187645363102-2819919579455584954?l=macjavadev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://macjavadev.blogspot.com/feeds/2819919579455584954/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8400556187645363102&amp;postID=2819919579455584954' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8400556187645363102/posts/default/2819919579455584954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8400556187645363102/posts/default/2819919579455584954'/><link rel='alternate' type='text/html' href='http://macjavadev.blogspot.com/2007/11/intellij-t3h-awesome-mostly.html' title='IntelliJ: t3h awesome (mostly)'/><author><name>James</name><uri>http://www.blogger.com/profile/15984236341367538242</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><entry><id>tag:blogger.com,1999:blog-8400556187645363102.post-775279409215278311</id><published>2007-11-01T14:52:00.000-07:00</published><updated>2007-11-02T08:18:11.849-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jboss rules'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='drools'/><category scheme='http://www.blogger.com/atom/ns#' term='brms'/><category scheme='http://www.blogger.com/atom/ns#' term='how-to'/><title type='text'>Quickstart: Drools 4.0.3 Web Admin (BRMS)</title><content type='html'>The documentation on &lt;a href="http://labs.jboss.com/drools/"&gt;Drools&lt;/a&gt; is a little bit light on the "where the hell do I start" part, so here's a quickstart guide. I'll walk you through getting the equivalent of a "Hello, World" app up in Drools, i.e. the simplest setup possible. This will use the Drools web management interface, and will not require any actual code whatsoever. This assumes that you, much like myself, in fact know next to nothing about Drools, and just want to play with it before getting into Rete algorithms and truth maintenance and all that crap.&lt;br /&gt;&lt;br /&gt;Isn't that nice.&lt;br /&gt;&lt;br /&gt;There are only three requirements.&lt;br /&gt;&lt;ol&gt;&lt;li&gt; You have your own servlet container: Tomcat, Glassfish, whatever.&lt;/li&gt;&lt;br /&gt;&lt;li&gt; You have in your possession a JavaBean in some .jar flie somewhere. Any bean will do.&lt;/li&gt;&lt;br /&gt;&lt;li&gt; You don't require screenshots. Sorry, I'm lazy. Maybe in the future.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;That's it.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt; Download the &lt;a href="http://labs.jboss.com/drools/downloads.html"&gt;Drools BRMS&lt;/a&gt; from JBoss.&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Deploy it to your app server. I like Glassfish.&lt;br /&gt;&lt;pre&gt;[0932][jchilders@Ivan:~/webapps]$ unzip drools-4.0.3-brms.zip&lt;br /&gt;[0932][jchilders@Ivan:~/webapps]$ sudo asadmin &lt;br /&gt;Use "exit" to exit and "help" for online help.&lt;br /&gt;asadmin&gt; start-domain domain1&lt;br /&gt;asadmin&gt; deploydir ./drools-brms/&lt;/pre&gt;&lt;br /&gt;Log in to it. (Mine deployed to http://localhost:8080/drools-jbrms/). User ID is "", password is "", without the quotes.&lt;/li&gt;&lt;br /&gt;&lt;li&gt; You should see five options on the left: Info, Rules, Packages, Deployment, and Admin. Click on Admin.&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Click on "Create New Category".&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Name your category something clever. We'll call ours "BannerAds". Save it.&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Click on "Packages". There is a button on this page that will allow you to create a new package. It is small and has no label, but does have a tooltip. Click on it.&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Give your package a name and optional description. We'll call ours "MyPackage". Save it.&lt;/li&gt;&lt;br /&gt;&lt;li&gt; There is another tiny, hard-to-find button on this page that allows you to create a new model. Click on it.&lt;/li&gt;&lt;br /&gt;&lt;li&gt; This model will reference the jar file that has your bean it in I mentioned earlier. Name it something witty like "MyBean" and save it.&lt;/li&gt;&lt;br /&gt;&lt;li&gt; You should be at a screen that will let you upload your jar. Do it. &lt;/li&gt;&lt;br /&gt;&lt;li&gt; Click on the "Save Changes" button.&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Holy crap we're almost there! Now click on the "MyPackage" package in the tree, then "Edit Package Configuration" in the main window.&lt;/li&gt;&lt;br /&gt;&lt;li&gt; In the "Header" section in the main window you need to actually tell Drools about your bean. To do so:&lt;br /&gt;&lt;pre&gt;import com.mycompany.MyBean&lt;/pre&gt;&lt;br /&gt;No semicolon at the end. If you want to get crazy and are lucky enough to own more than one JavaBean, do more than one import.&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Wow we should actually be able to make a rule now! AWESOME!&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Click on the massive 16px button that will let you "Create New Rule" &lt;/li&gt;&lt;br /&gt;&lt;li&gt; Give it a name and category and type it as "Business rule". Save.&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Ok, now comes the real test. Click on the big green plus sign to the right of "WHEN". You should see a window that says "Add a condition to the rule..." If everything was set up correctly -- and that's a big if -- then you should see two selects: "Fact", and "Condition Type". If all it says is "Add a condition to the rule..." and nothing else, then you screwed up. Also these instructions may be wrong. It is much more likely that you screwed up because I have a blog. If it doesn't work please go to step &lt;a href="http://downloads.jboss.com/drools/docs/4.0.3.15993.GA/html/ch02s05.html"&gt;RTFM&lt;/a&gt;, else continue.&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Fact. Click on it. Select your bean.&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Figure out the rest on your own. You're now to the point where you can create rules based upon your bean. Doing so using the visual editor is pretty self-explanatory.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;May the force be with you, always.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8400556187645363102-775279409215278311?l=macjavadev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://macjavadev.blogspot.com/feeds/775279409215278311/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8400556187645363102&amp;postID=775279409215278311' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8400556187645363102/posts/default/775279409215278311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8400556187645363102/posts/default/775279409215278311'/><link rel='alternate' type='text/html' href='http://macjavadev.blogspot.com/2007/11/quickstart-drools-403-web-admin-brms.html' title='Quickstart: Drools 4.0.3 Web Admin (BRMS)'/><author><name>James</name><uri>http://www.blogger.com/profile/15984236341367538242</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8400556187645363102.post-801518792715586693</id><published>2007-10-31T10:26:00.001-07:00</published><updated>2007-10-31T13:11:26.331-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='leopard'/><category scheme='http://www.blogger.com/atom/ns#' term='java6'/><category scheme='http://www.blogger.com/atom/ns#' term='apple'/><title type='text'>Leopard, Java6, and immaturity</title><content type='html'>I have never before been ashamed to be a Java developer.&lt;br /&gt;&lt;br /&gt;Apple did not include Java6 in last week's release of OS X Leopard. This came only a few short weeks after Apple pulled a Java6 beta that was available on ADC, with no word as to why. These two  factors together seem to have triggered a firestorm in parts of the Java community, the most infamous being &lt;a href="http://www.javalobby.org/java/forums/t102936.html"&gt;Michael Urban's disjointed rant&lt;/a&gt; over at JavaLobby where he fumes about the above issues at length, and eventually concludes that he's going to take his toys and go home, e.g. abandon OS X as his dev platform. The tone and content amount to nothing more than "I don't have what I want, when I want it, so SCREW YOU!" Judging from the comments he was hardly alone.&lt;br /&gt;&lt;br /&gt;This is just embarrassing.&lt;br /&gt;&lt;br /&gt;Leopard has been out for a grand total of five days. Five. Having such an extreme reaction to the lack of Java6 in the .0 version of Leopard is just...  wow. I really don't have words for it. Arrogant? Short-sighted? Immature? Completely ignorant of what it takes to get an operating system shipped? It certainly isn't supported by history.&lt;br /&gt;&lt;br /&gt;Once Java 1.4 was added to OS X 10.0, Apple has always included Java in its operating system. Always. It is apparent that Java isn't a top priority for the company, but that does not mean that it has *zero* priority, or that those priorities are even skewed. Apple's primary target is and always has been the consumer market. Java simply isn't a player in that space. Further, Java powers much of apple.com -- including the iTunes Music Store -- so it is hardly in Apple's interest to neglect it.&lt;br /&gt;&lt;br /&gt;None of the complaints change the fact Macs are still an extremely enjoyable environment to develop Java applications on, far better than Windows or Ubuntu. For me this is the important part: what tool do I feel most comfortable using? Java6 availability changes that not at all.&lt;br /&gt;&lt;br /&gt;Even if Java6 were available its lack of penetration even within the Java-sphere would really make it more of a novelty than a must-have. Sad, possibly, but true.&lt;br /&gt;&lt;br /&gt;----&lt;br /&gt;&lt;br /&gt;Addendum: There are a few words that when I run across in an article cause me to immediately take what is being said less seriously. "Fanboy", "zealot", and their ilk are large red flags. The newest one is "Steve Jobs". From the previously linked to article: "But once again, the part I have really had it with, is the unprecedented arrogance of Steve Jobs and company..." Steve Jobs has had more unsupported adjectives thrown at him than I think anyone since Bill Clinton. For many Jobs has become a rhetorical foil, something used more for emotive effect than anything else.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8400556187645363102-801518792715586693?l=macjavadev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://macjavadev.blogspot.com/feeds/801518792715586693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8400556187645363102&amp;postID=801518792715586693' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8400556187645363102/posts/default/801518792715586693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8400556187645363102/posts/default/801518792715586693'/><link rel='alternate' type='text/html' href='http://macjavadev.blogspot.com/2007/10/leopard-java6-and-immaturity.html' title='Leopard, Java6, and immaturity'/><author><name>James</name><uri>http://www.blogger.com/profile/15984236341367538242</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-8400556187645363102.post-8116649174456856562</id><published>2007-10-11T11:09:00.001-07:00</published><updated>2007-10-11T13:00:42.221-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='captcha'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='jcaptcha'/><title type='text'>JCAPTCHA: Never mind. We hates it.</title><content type='html'>So after spending numerous hours last night trying to figure out how to create a custom CAPTCHA image using JCAPTCHA, I realized a few things&lt;div&gt;&lt;ol&gt;&lt;li&gt;The documentation is, to be kind, sparse. Also it's written by people whose first language is decidedly not English. That's fine if the code is so elegant as to be self-documenting, buuut....&lt;/li&gt;&lt;li&gt;The API is difficult to grasp. It relies too heavily on inheritance; a few strategies and a Builder would help to clean things up immensely.&lt;/li&gt;&lt;li&gt;If you decide against using one of the built-in image generators, then you must familiarize yourself with an undocumented collection of ImageFilters for which the source code is unavailable.&lt;br /&gt;&lt;code&gt;TwirlFilter&lt;/code&gt; is a perfect example. Figuring out how to implement a &lt;code&gt;TwirlFilter&lt;/code&gt; required becoming a monkey banging away on a keyboard: eventually and almost totally by random I got something that worked. Further, some of the methods inherited by TwirlFilter actually cause NPEs when called, and since there's no documentation there is no way to tell what does what or, in some cases, even what units are expected.&lt;br /&gt;For example, &lt;code&gt;TwirlFilter.setAngle(int)&lt;/code&gt; takes radians as its argument, but there is no way to know this in advance.&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;This is just a workplace shooting waiting to happen.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For posterity's sake, here's how you would implement a TwirlFilter in JCAPTCHA:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;style type="text/css"&gt; td.java, td.java-ln {vertical-align:top;} tt.java, tt.java-ln, pre.java, pre.java-ln {line-height:1em; margin-bottom:0em;} td.java-ln { text-align:right; } tt.java-ln, pre.java-ln { color:#888888 } /* Background       */ span.java0  { font-size: 10pt; color:#ffffff; } /* Line numbers       */ span.java1  { font-size: 10pt; color:#808080; } /* Multi-line comments       */ span.java2  { font-size: 10pt; color:#3f7f5f; } /* Single-line comments       */ span.java3  { font-size: 10pt; color:#3f7f5f; } /* Keywords       */ span.java4  { font-size: 10pt; color:#7f0055; font-weight:bold; } /* Strings       */ span.java5  { font-size: 10pt; color:#2a00ff; } /* Character constants       */ span.java6  { font-size: 10pt; color:#990000; } /* Numeric constants       */ span.java7  { font-size: 10pt; color:#990000; } /* Parenthesis       */ span.java8  { font-size: 10pt; color:#000000; } /* Primitive Types       */ span.java9  { font-size: 10pt; color:#7f0055; font-weight:bold; } /* Others       */ span.java10  { font-size: 10pt; color:#000000; } /* Javadoc keywords       */ span.java11  { font-size: 10pt; color:#7f9fbf; } /* Javadoc HTML tags       */ span.java12  { font-size: 10pt; color:#7f7f9f; } /* Javadoc links       */ span.java13  { font-size: 10pt; color:#3f3fbf; } /* Javadoc others       */ span.java14  { font-size: 10pt; color:#3f5fbf; } /* Undefined       */ span.java15  { font-size: 10pt; color:#ff6100; } /* Annotation       */ span.java16  { font-size: 10pt; color:#646464; } &lt;/style&gt; &lt;div class="java"&gt;&lt;code class="java"&gt;&lt;span class="java0"&gt;&amp;#xA0; &lt;/span&gt;&lt;span class="java4"&gt;protected &lt;/span&gt;&lt;span class="java9"&gt;void &lt;/span&gt;&lt;span class="java10"&gt;buildInitialFactories&lt;/span&gt;&lt;span class="java8"&gt;() {&lt;br /&gt; &amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span class="java10"&gt;WordGenerator wg = &lt;/span&gt;&lt;span class="java4"&gt;new &lt;/span&gt;&lt;span class="java10"&gt;RandomWordGenerator&lt;/span&gt;&lt;span class="java8"&gt;(&lt;/span&gt;&lt;span class="java10"&gt;CHAR_LIST&lt;/span&gt;&lt;span class="java8"&gt;)&lt;/span&gt;&lt;span class="java10"&gt;;&lt;br /&gt; &lt;br /&gt; &amp;#xA0;&amp;#xA0;&amp;#xA0; FontGenerator fontGen = &lt;/span&gt;&lt;span class="java4"&gt;new &lt;/span&gt;&lt;span class="java10"&gt;TwistedAndShearedRandomFontGenerator&lt;/span&gt;&lt;span class="java8"&gt;(&lt;/span&gt;&lt;span class="java4"&gt;new &lt;/span&gt;&lt;span class="java10"&gt;Integer&lt;/span&gt;&lt;span class="java8"&gt;(&lt;/span&gt;&lt;span class="java7"&gt;24&lt;/span&gt;&lt;span class="java8"&gt;)&lt;/span&gt;&lt;span class="java10"&gt;, &lt;/span&gt;&lt;span class="java4"&gt;new &lt;/span&gt;&lt;span class="java10"&gt;Integer&lt;/span&gt;&lt;span class="java8"&gt;(&lt;/span&gt;&lt;span class="java7"&gt;30&lt;/span&gt;&lt;span class="java8"&gt;))&lt;/span&gt;&lt;span class="java10"&gt;;&lt;br /&gt; &amp;#xA0;&amp;#xA0;&amp;#xA0; BackgroundGenerator bgGen = &lt;/span&gt;&lt;span class="java4"&gt;new &lt;/span&gt;&lt;span class="java10"&gt;UniColorBackgroundGenerator&lt;/span&gt;&lt;span class="java8"&gt;(&lt;/span&gt;&lt;span class="java4"&gt;new &lt;/span&gt;&lt;span class="java10"&gt;Integer&lt;/span&gt;&lt;span class="java8"&gt;(&lt;/span&gt;&lt;span class="java7"&gt;200&lt;/span&gt;&lt;span class="java8"&gt;)&lt;/span&gt;&lt;span class="java10"&gt;, &lt;/span&gt;&lt;span class="java4"&gt;new &lt;/span&gt;&lt;span class="java10"&gt;Integer&lt;/span&gt;&lt;span class="java8"&gt;(&lt;/span&gt;&lt;span class="java7"&gt;100&lt;/span&gt;&lt;span class="java8"&gt;)&lt;/span&gt;&lt;span class="java10"&gt;, Color.WHITE&lt;/span&gt;&lt;span class="java8"&gt;)&lt;/span&gt;&lt;span class="java10"&gt;;&lt;br /&gt; &amp;#xA0;&amp;#xA0;&amp;#xA0; TextPaster textPaster = &lt;/span&gt;&lt;span class="java4"&gt;new &lt;/span&gt;&lt;span class="java10"&gt;RandomTextPaster&lt;/span&gt;&lt;span class="java8"&gt;(&lt;/span&gt;&lt;span class="java4"&gt;new &lt;/span&gt;&lt;span class="java10"&gt;Integer&lt;/span&gt;&lt;span class="java8"&gt;(&lt;/span&gt;&lt;span class="java7"&gt;5&lt;/span&gt;&lt;span class="java8"&gt;)&lt;/span&gt;&lt;span class="java10"&gt;, &lt;/span&gt;&lt;span class="java4"&gt;new &lt;/span&gt;&lt;span class="java10"&gt;Integer&lt;/span&gt;&lt;span class="java8"&gt;(&lt;/span&gt;&lt;span class="java7"&gt;8&lt;/span&gt;&lt;span class="java8"&gt;)&lt;/span&gt;&lt;span class="java10"&gt;, &lt;/span&gt;&lt;span class="java4"&gt;new &lt;/span&gt;&lt;span class="java10"&gt;RandomListColorGenerator&lt;/span&gt;&lt;span class="java8"&gt;(&lt;/span&gt;&lt;span class="java10"&gt;TEXT_COLORS&lt;/span&gt;&lt;span class="java8"&gt;))&lt;/span&gt;&lt;span class="java10"&gt;;&lt;br /&gt; &lt;br /&gt; &amp;#xA0;&amp;#xA0;&amp;#xA0; ImageFilter&lt;/span&gt;&lt;span class="java8"&gt;[] &lt;/span&gt;&lt;span class="java10"&gt;noFilters = &lt;/span&gt;&lt;span class="java8"&gt;{ }&lt;/span&gt;&lt;span class="java10"&gt;;&lt;br /&gt; &amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;br /&gt; &amp;#xA0;&amp;#xA0;&amp;#xA0; TwirlFilter twirlFilter = &lt;/span&gt;&lt;span class="java4"&gt;new &lt;/span&gt;&lt;span class="java10"&gt;TwirlFilter&lt;/span&gt;&lt;span class="java8"&gt;()&lt;/span&gt;&lt;span class="java10"&gt;;&lt;br /&gt; &amp;#xA0;&amp;#xA0;&amp;#xA0; twirlFilter.setAngle&lt;/span&gt;&lt;span class="java8"&gt;(&lt;/span&gt;&lt;span class="java7"&gt;1&lt;/span&gt;&lt;span class="java8"&gt;)&lt;/span&gt;&lt;span class="java10"&gt;;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span class="java3"&gt;// In radians&lt;br /&gt; &amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;br /&gt; &amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span class="java10"&gt;ImageFilter&lt;/span&gt;&lt;span class="java8"&gt;[] &lt;/span&gt;&lt;span class="java10"&gt;textFilters = &lt;/span&gt;&lt;span class="java8"&gt;{ &lt;/span&gt;&lt;span class="java10"&gt;twirlFilter &lt;/span&gt;&lt;span class="java8"&gt;}&lt;/span&gt;&lt;span class="java10"&gt;;&lt;br /&gt; &amp;#xA0;&amp;#xA0;&amp;#xA0; ImageDeformation bgDeformations = &lt;/span&gt;&lt;span class="java4"&gt;new &lt;/span&gt;&lt;span class="java10"&gt;ImageDeformationByFilters&lt;/span&gt;&lt;span class="java8"&gt;(&lt;/span&gt;&lt;span class="java10"&gt;noFilters&lt;/span&gt;&lt;span class="java8"&gt;)&lt;/span&gt;&lt;span class="java10"&gt;;&lt;br /&gt; &amp;#xA0;&amp;#xA0;&amp;#xA0; ImageDeformation textDeformations = &lt;/span&gt;&lt;span class="java4"&gt;new &lt;/span&gt;&lt;span class="java10"&gt;ImageDeformationByFilters&lt;/span&gt;&lt;span class="java8"&gt;(&lt;/span&gt;&lt;span class="java10"&gt;textFilters&lt;/span&gt;&lt;span class="java8"&gt;)&lt;/span&gt;&lt;span class="java10"&gt;;&lt;br /&gt; &amp;#xA0;&amp;#xA0;&amp;#xA0; ImageDeformation finalDeformations = &lt;/span&gt;&lt;span class="java4"&gt;new &lt;/span&gt;&lt;span class="java10"&gt;ImageDeformationByFilters&lt;/span&gt;&lt;span class="java8"&gt;(&lt;/span&gt;&lt;span class="java10"&gt;noFilters&lt;/span&gt;&lt;span class="java8"&gt;)&lt;/span&gt;&lt;span class="java10"&gt;;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;br /&gt; &lt;br /&gt; &amp;#xA0;&amp;#xA0;&amp;#xA0; WordToImage wordToImage = &lt;/span&gt;&lt;span class="java4"&gt;new &lt;/span&gt;&lt;span class="java10"&gt;DeformedComposedWordToImage&lt;/span&gt;&lt;span class="java8"&gt;(&lt;/span&gt;&lt;span class="java10"&gt;fontGen, &lt;br /&gt; &amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; bgGen,&lt;br /&gt; &amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; textPaster,&lt;br /&gt; &amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; bgDeformations,&lt;br /&gt; &amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; textDeformations,&lt;br /&gt; &amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; finalDeformations&lt;/span&gt;&lt;span class="java8"&gt;)&lt;/span&gt;&lt;span class="java10"&gt;;&lt;br /&gt; &lt;br /&gt; &amp;#xA0;&amp;#xA0;&amp;#xA0; addFactory&lt;/span&gt;&lt;span class="java8"&gt;(&lt;/span&gt;&lt;span class="java4"&gt;new &lt;/span&gt;&lt;span class="java10"&gt;ShearedWhiteBackgroundGimpyFactory&lt;/span&gt;&lt;span class="java8"&gt;(&lt;/span&gt;&lt;span class="java10"&gt;wg, wordToImage&lt;/span&gt;&lt;span class="java8"&gt;))&lt;/span&gt;&lt;span class="java10"&gt;;&lt;br /&gt; &amp;#xA0; &lt;/span&gt;&lt;span class="java8"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8400556187645363102-8116649174456856562?l=macjavadev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://macjavadev.blogspot.com/feeds/8116649174456856562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8400556187645363102&amp;postID=8116649174456856562' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8400556187645363102/posts/default/8116649174456856562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8400556187645363102/posts/default/8116649174456856562'/><link rel='alternate' type='text/html' href='http://macjavadev.blogspot.com/2007/10/jcaptcha-never-mind-we-hates-it.html' title='JCAPTCHA: Never mind. We hates it.'/><author><name>James</name><uri>http://www.blogger.com/profile/15984236341367538242</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>
