2 Apr 2008, 11:00pm
Projects:
by

leave a comment

  • Random Project Updates

    Haven’t made any project related post since July last year, so here’s a list of little things I spent some time on:

    • While playing around with Firefox Web Developer Extension, I found out that some Maven reports generated invalid HTML which could break the reports layout with non-default vm templates. Hence MFINDBUGS-29, MCHECKSTYLE-74, and MCHANGES-83.
    • After integrating Kaptcha in SCode Plugin 0.5, I spent some time working on the Kaptcha project itself where most of the effort was on refactoring the original SimpleCaptcha code. That, and some other patches have made it to Kaptcha 2.1 and 2.2 .
    • I replaced all usages of JMock with EasyMock on all of my Java projects (I know, a stupid thing to do because EasyMock-ing is also no fun). Looking forward to giving Mockito a try at work. No, there will be no effort to replace EasyMock with Mockito regardless of the outcome.
    • As mentioned on my Slicehosted post, I rewrote Wish using Rails. I also spent more time playing with Ruby/Rails and I could see why some people love them. Personally, I’m still leaning towards Java. I think static typing is better in the long run. My take on the whole Ruby vs Java fiasco… people have different perspectives and opinions, there’s not one true programming language nirvana, Ruby and Java communities will learn to co-exist peacefully.
    • Since this blog is now using WordPress (damn, I hate upgrading WordPress everytime there’s a security fix), and because there hadn’t been any activity in Blojsom development, I decided to stop following Blojsom mailing lists for now. Nabble shows that I’ve been posting since July 2005 to February 2008, it didn’t feel that long at all :). I will still maintain the Blojsom plugins I created and I still have some patches to contribute to Blojsom core.

    11 Jun 2007, 4:57am
    Projects:
    by

    leave a comment

  • SCode Image Reload

    Sometimes the numbers on SCodePlugin-generated CAPTCHA image are not easy to read. And rather than refreshing the whole page, it would be nice to reload only the image and generate a new / more readable code.

    In order to give this a go, I modified the comment form on Melbourne photoblog and added a short Javascript code to refresh the image source. You can try it yourself on this form, just click the text “Generate another code” and wait shortly for the image to be reloaded with a new code.

    I have updated the Usage sample code on SCode Plugin wiki page with this improvement.

    As a side note, I found a problem where modifying img.src value via anchor tag’s onclick attribute does not work on IE 6 and the image will just disappear, while it works just fine on Firefox 2 and Opera 8.5 .

    function reloadSCode() {
      var scodeImage = document.getElementById("scodeImage");
      scodeImage.src="$BLOJSOM_BLOG.getBlogBaseURL()/captcha?flavor=kink&t=" + (new Date()).getMilliseconds();
    }
    
    <a href="javascript: void(0);" onclick="reloadSCode();">Generate another code</a>.
    

    After some mucking around, I found out that the function call must be made from the href attribute. This works on the browsers mentioned above.

    <a href="javascript: reloadSCode();">Generate another code</a>.
    

    Them browsers better implement proper Javascript standard before doomsday comes.

    9 Jun 2007, 2:31am
    Projects:
    by

    leave a comment

  • GateKeeper Plugin v0.1 And IMNotification Plugin v0.1

    GateKeeper Plugin v0.1 and IMNotification Plugin v0.1 have been released.

    I implemented GateKeeper Plugin for Blojsom following the earlier discussion on a simple anti-bot solution to fight comment spams. This blog has been using GateKeeper Plugin (with very simple challenges for now) and it has worked like a charm with 100% success rate, though I think that the success is actually contributed from the fact that the spammers have been focusing their effort on breaking more mainstream anti-spam solutions like CAPTCHAs.

    I’ve also been using IMNotification Plugin with Jabber server and Pandion client. This plugin provides an alternative to email notifications, and it’s handy for those with IM windows.

    6 May 2007, 1:03am
    Projects:
    by

    5 comments

  • Blojsom IM Notification Messages

    Here’s a screenshot of Blojsom notification messages on Pandion.

    You’ll be notified for new entry, comment, trackback, and pingback. I’m currently working on XMPP Plugin for Blojsom, though nothing is stopping this from becoming IMNotification Plugin. I guess there are plenty of AIM and MSN users out there.

    2 May 2007, 8:16pm
    Projects:
    by

    leave a comment

  • SCodePlugin v0.5

    SCodePlugin v0.5 has been released, expect the jar and source downloads to be available from SourceForge mirrors in the next few days. As usual, if you want it earlier, just email me and I’ll send it to you.

    Changelog:

    • Introduced KaptchaImageEngine using Kaptcha (was Simple Captcha) library, with 3 new flavours from KinkImageEngine, FishEyeImageEngine, and ShadowImageEngine.
    • Replaced image engine class loading in image factory with constructor injection. SCodePlugin passes the image factory to SCodeServlet, instead of passing the image engines.
    • Set ImageIO caching off during SCodeServlet initialisation. This improves performance and prevents any temporary disk-based image creation.

    Upgrade instruction:

    • In WEB-INF/lib directory, replace scodeplugin-0.4.jar with scodeplugin-0.5.jar, and add kaptcha-1.1.jar .
    • On /WEB-INF/classes/blojsom-plugins.xml file, replace the scode bean declaration you have for SCodePlugin v0.4:
      <bean id="scode" class="com.mbledug.blojsom.plugin.scode.SCodePlugin" init-method="init" destroy-method="destroy">
          <constructor-arg>
              <map>
                  <entry key="simple" value="com.mbledug.blojsom.plugin.scode.engine.SimpleImageEngine"/>
                  <entry key="gradient" value="com.mbledug.blojsom.plugin.scode.engine.GradientImageEngine"/>
                  <entry key="funky" value="com.mbledug.blojsom.plugin.scode.engine.FunkyImageEngine"/>
              </map>
          </constructor-arg>
      </bean>
      

      with this for SCodePlugin v0.5:

      <bean id="scodeSimpleImageEngine" class="com.mbledug.blojsom.plugin.scode.engine.SimpleImageEngine"/>
      <bean id="scodeGradientImageEngine" class="com.mbledug.blojsom.plugin.scode.engine.GradientImageEngine"/>
      <bean id="scodeFunkyImageEngine" class="com.mbledug.blojsom.plugin.scode.engine.FunkyImageEngine"/>
      <bean id="scodeKinkImageEngine" class="com.mbledug.blojsom.plugin.scode.engine.KinkImageEngine"/>
      <bean id="scodeFishEyeImageEngine" class="com.mbledug.blojsom.plugin.scode.engine.FishEyeImageEngine"/>
      <bean id="scodeShadowImageEngine" class="com.mbledug.blojsom.plugin.scode.engine.ShadowImageEngine"/>
      <bean id="scodeImageFactory" class="com.mbledug.blojsom.plugin.scode.ImageFactory">
          <constructor-arg>
              <map>
                  <entry key="simple" value-ref="scodeSimpleImageEngine"/>
                  <entry key="gradient" value-ref="scodeGradientImageEngine"/>
                  <entry key="funky" value-ref="scodeFunkyImageEngine"/>
                  <entry key="kink" value-ref="scodeKinkImageEngine"/>
                  <entry key="fisheye" value-ref="scodeFishEyeImageEngine"/>
                  <entry key="shadow" value-ref="scodeShadowImageEngine"/>
              </map>
          </constructor-arg>
      </bean>
      <bean id="scode" class="com.mbledug.blojsom.plugin.scode.SCodePlugin" init-method="init" destroy-method="destroy">
          <constructor-arg>
              <ref bean="scodeImageFactory"/>
          </constructor-arg>
      </bean>
      

    Recent Posts

    Recent Comments

    • Cliffano Subagio: Good to hear about your opportunity to visit Japan, I’m sure you will have a great...
    • Kayla: I’m going to Japan for two week this summer. Our sister city is Tsubame, Japan and my school has an...
    • poseidonfu: thanks,Very effective
    • anonymous: I really enjoyed both the last lecture and the book. I don’t think that theres anyone that I look up...
    • dioni: The thing I hate about HK is how people shove and push in the queue. Can’t they be civilized?!! I kept...

    Most Commented Posts

    Linkroll