6 Dec 2009, 4:01pm
Projects:
by Cliffano Subagio

5 comments
  • Sitebricks And SiteMesh On Google App Engine

    For the past couple of weeks, I’ve been trying various web framework stacks to be used with Google App Engine. The ones that I gave a go, and gave a pass for various reasons, were Stapler (the enchilada that powers Hudson), Spring, and RestEasy + htmleasy.

    The search continued and I came across Sitebricks, still in its alpha phase but it looks really promising. Simple and straightforward, nothing too magicky, and I got it working with GAE/J in no time.

    To guide others who might want to give Sitebricks on Google App Engine a try, here’s what I did: (and please note that this is a miminalist guide, enough to get a simple page up and running)

    1. Using Google Plugin for Eclipse, create a new Google Web Application Project with Google App Engine enabled and Google Web Toolkit disabled.
    2. Since Sitebricks didn’t have any official release yet, I had to build the jar from the sitebricks-0.7 tag using
      mvn install -Dmaven.test.skip=true

      . Unfortunately some of the unit tests on the trunk failed so I just skipped them, hey it’s still in alpha.

    3. The above command downloaded all the dependency jars and generated a Sitebricks SNAPSHOT jar at <M2_REPO>/com/google/sitebricks . Copy the following jars to the Eclipse project’s /war/WEB-INF/lib directory and add them to the build path.
      • sitebricks-0.7.jar
      • guice-2.0.jar
      • guice-servlet-2.0.jar
      • google-collections-1.0-rc3.jar
      • aopalliance-1.0.jar
      • mvel2-2.0.14.jar
      • dom4j-1.6.1.jar
      • commons-io-1.4.jar
    4. Create the following files in src/your/package/name.
      GuiceInit.java

      public class GuiceInit extends GuiceServletContextListener {
      
          @Override
          public Injector getInjector() {
              return Guice.createInjector(new SitebricksModule() {
                  @Override
                  protected void configureSitebricks() {
                      scan(FooBar.class.getPackage());
                  }
              });
          }
      }

      FooBar.java

      @At("/barkleyzone")
      public class FooBar {
      
          public String getQuote() {
              return "I have nothing against old people; I want to be one myself one day";
          }
      
          public String getName() {
              return "Charles Barkley";
          }
      }
    5. Create FooBar.html in /war.

      <div>
          ${name} said "${quote}".
      </div>
      
    6. Add GuiceInit servlet context listener and GuiceFilter to /war/WEB-INF/web.xml.

      <filter>
          <filter-name>webFilter</filter-name>
          <filter-class>com.google.inject.servlet.GuiceFilter</filter-class>
      </filter>
      <filter-mapping>
          <filter-name>webFilter</filter-name>
          <url-pattern>/*</url-pattern>
      </filter-mapping>
      <listener>
          <listener-class>your.package.name.GuiceInit</listener-class>
      </listener>
      
    7. Enable sessions by adding this line in /war/WEB-INF/appengine-web.xml .
      <sessions-enabled>true</sessions-enabled>
      
    8. Use Eclipse Run -> Run As -> Web Application to start the application and visit http://localhost:8080/barkleyzone and you should see this message:
      Charles Barkley said "I have nothing against old people; I want to be one myself one day."
    As for a page layout / templating solution, SiteMesh has always been a personal favourite.
    1. Download sitemesh-2.4.2.jar, place it in /war/WEB-INF/lib directory and add it to the build path.
    2. Create /war/templates/main.jsp .
      <%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>
      <html>
      <head>
      <title>Test</title>
      </head>
      <body>
          <decorator:body/>
      </body>
      </html>
      
    3. Create /war/WEB-INF/decorators.xml .

      <decorators defaultdir="/templates/">
          <decorator name="main" page="main.jsp">
              <pattern>/*</pattern>
          </decorator>
      </decorators>
      
    4. Add SiteMeshFilter to /war/WEB-INF/web.xml .

      <filter>
          <filter-name>sitemesh</filter-name>
          <filter-class>com.opensymphony.sitemesh.webapp.SiteMeshFilter</filter-class>
      </filter>
      <filter-mapping>
          <filter-name>sitemesh</filter-name>
          <url-pattern>/*</url-pattern>
      </filter-mapping>
      
    5. Use Eclipse to stop and start the application, view the HTML source of http://localhost:8080/barkleyzone and you should see the HTML layout wrapping the original div element.

    15 Sep 2009, 3:16am
    Projects:
    by Cliffano Subagio

    leave a comment
  • Hudson Code Swarm Part 2

    Continuing from my last Hudson Code Swarm post, this code_swarm video covers the last 7-8 months of activities in Hudson SVN repository (r14862 on 29 Jan 2009 to r21601 on 11 Sep 2009).

    Hudson project has been very active during that period, and this video clearly reflects that fact with the number of commiters (names) and their activities (particle movements).

    Hudson Code Swarm Part 2 from Cliffano Subagio on Vimeo.

    And in case anyone is interested, I’ve uploaded the code_swarm config file I used to generate the videos to github.

    10 Sep 2009, 1:29am
    Projects:
    by Cliffano Subagio

    28 comments
  • RFC – ChuckNorris Plugin

    Update (06/10/2009): installation & usage instructions are available from ChuckNorris Plugin wiki page.

    Me and some colleagues were yammering some Chuck Norris Facts-like jokes a few days ago (ChuckNorrisException can never be caught, only thrown :p), and that reminded me of ChuckNorris Plugin, a simple plugin I wrote when I first started learning about Hudson plugin mechanism a while ago.

    This plugin displays a picture of Chuck Norris, instead of Hudson the butler, and a random Chuck Norris ‘The Programmer’ fact on each build page.

    On failure build, Chuck Norris is ready to give you a whoopin’ for breaking the build.
    You’ll also see a Chuck Norris fact on the build page.


    A thumb up on successful build.

    And an alert stance on other build results.

    Please leave a comment and let me know what you think of ChuckNorris Plugin. And also let me know if you want to install it on your Hudson instance, I’ll make the .hpi file available for download.

    My favourite facts: ‘Chuck Norris can unit test an entire application with a single assert,’ and ‘When a bug sees Chuck Norris, it flees screaming in terror, and then immediately self-destructs to avoid being roundhouse-kicked.’

    http://wiki.hudson-ci.org/display/HUDSON/ChuckNorris+Plugin

    22 Aug 2009, 5:41am
    Projects:
    by Cliffano Subagio

    8 comments
  • Emptiness Header Images

    First of all, my apology to Tony Lauria for making him wait for a long time and for not being able to upload these images earlier as promised. Life has been exceptionally busy, but I’ll save the details for another blog post.

    It was a pleasant surprise for me to find out that Tony and some other Emptiness Theme users like to the header images from previous versions of the theme and requested their availability for download. Thanks so much for using the theme.

    So here they are (in chronological order)…

    Light greenish-yellowish leaves on tree branches in front of my home in Carnegie. This picture was used as the default header image from v0.1 to v0.9 of the theme.

    A city-loop train with Crown complex in the background. This picture was taken from the Flinders St studio apartment where I lived back in 2005. I used the picture as a custom header image demonstration on a cleaner way to customise WordPress Theme styles using MyCSS Plugin.

    Stones and water, which I thought represent the theme of emptiness really really well. The picture was taken at Korakuen Garden during my trip to Japan this year, and was used in v1.0 .

    Weird grassy plants at Shinjuku Garden. In retrospective, I found the random pattern of the plants to be quite interesting. This picture was used in v1.1 .

    Buildings behind the Shibuya Crossing at night (original 1024×768 image). I used this picture to test the custom image header cropping feature introduced in v1.1 .

    6 Jul 2009, 7:57pm
    Projects:
    by Cliffano Subagio

    1 comment
  • Teman Macet Podcast

    About 2 months ago, Ronald Widha invited me to become a guest on Teman Macet, a weekly tech podcast in Indonesian language, focusing on programming, software development, and the IT industry. The discussion was done via Skype since Ronald was based in Dubai, UAE, and I resided in Melbourne, Australia.

    The episode, #11 kontribusi ke open source project dalam waktu luang, was uploaded earlier this week. We discussed about my experience contributing to several small open source projects and various other tech-related topics.

    After listening to the episode, I figured that I didn’t answer Ronald’s questions well enough. I admit that I actually got lost when there were several questions asked in one go, my mind was digesting part of the questions and lost half of them when it was my turn to talk. Note to self: prepare a pen and a notepad.

    There were a couple of things that I would like to clarify since I wasn’t very clear with my answers. First one is that I misunderstood the question about why Hudson Build Monitor was made as a Firefox Add-on have (as opposed to subscribing the build feeds directly on Firefox toolbar). My revised answer would be that it does have a benefit in domain knowledge which allows data visualisation (coloured orbs, etc) and action triggers (starting a build, clearing up stuck executors, etc) amongst other things.

    The second one is on the bit where I talked about commercial products bundling open source software and using open source tools during the development process. I could’ve formed my sentences better. I just want to clarify that I wasn’t implying that commercial is the opposite of open source since there are tons of open source commercial products out there. Instead, I was referring to my experience back in year 2000 when most commercial products thought of open source as a non-option.

    Thanks, Ronald, for the invitation, and all the best with Teman Macet podcast project. I believe that the show has plenty of opportunities in the Indonesian market.  To those unfamiliar with Indonesian language, ‘Teman Macet’ roughly means ‘companion during traffic jam’.

    5 Jul 2009, 1:05am
    Projects:
    by Cliffano Subagio

    4 comments
  • Creating An Eco-Friendly Office

    This post is contributed by Jamie Sward (author bio provided).  I’ve always wanted to have a home studio / home office of my own someday, and I’ve always been interested to learn about anything eco-friendly, so the topics covered in this article suit my blog really well. I hope you find the information useful as I do.

    In this day and age, every little bit that we can do to help the environment makes a big difference.  Since the average person spends most of his or her time at work, maintaining an eco-friendly office lifestyle is a great first step.

    Green Office Furniture

    When it comes to office furniture, comfort is obviously key.  Many office furniture manufacturers are producing lines that are both comfortable and eco-friendly.  Herman Miller, for instance, a company that’s been around for over 100 years, has had its eye on the environment for quite some time now.  Herman Miller’s ever popular Aeron Chair not only adapts naturally to fit every body type, but it is also 94% recyclable.  The brand new Embody chair is 95% recyclable, made from 42% recycled content and contains no PVCs.

    Other manufacturers like Knoll and Steelcase are focused on producing eco-friendly desks, cabinets, space dividers and modular office furniture.  Furniture made from sustainably harvested hardwoods and recycled and bio-based non-toxic materials is becoming more popular and more readily available.  Given that many government agencies, universities and corporations are turning their attention to the environment, manufacturers have seen an increased demand for eco-friendly office solutions.

    Energy Efficient Lighting

    With countries like the UK and Australia phasing out incandescent light bulbs, we’re starting to see a move toward using energy-efficient lighting in homes and offices all over the world.  British retailers are to phase out traditional incandescent bulbs by 2011, in the hopes that the UK will cut carbon dioxide emissions by five million tonnes.  By 2012, Australia, New Zealand, Japan, Taiwan, Canada, Argentina and the greater EU will ban the production and sale of incandescent bulbs.

    What alternatives are there to incandescent bulbs?  The two major alternatives are compact fluorescent bulbs (CFLs) and Light Emitting Diodes (LEDs).  According to Energy Star, a joint program of the U.S. Environmental Protection Agency and the U.S. Department of Energy, a CFL will save about $30 USD over its lifetime and pay for itself in about 6 months.  It uses about 75% less energy and lasts about 10 times longer than an incandescent bulb.

    LEDs are also gaining popularity.  Taiwan is a global leader in the production of LEDs.  While LED technology is for the most part limited to street lights and electronic signage, the technology is quickly evolving.  Cree, a company based in North Carolina recently converted to a 100% LED lighting system.  Cree, a leader in LED solid-state lighting components, converted the lighting in their parking lots, hallways, lobbies, conference rooms and more!  According to a press release, these new LED lights use 48% less energy than they incandescent, fluorescent and high pressure sodium lights that they used before.

    While the widespread adoption of LED lights in the office place is a ways off, this is a promising development nonetheless.  In addition to lighting, offices are instituting other environmentally-friendly measures including inter-office paper, plastic, aluminum and ink cartridge recycling programs.  If you feel like your company isn’t on the right path, why not make your thoughts known to those in charge?  Every little bit helps – from an eco-friendly desk lamp to purchasing recycled paper products.  Take a stance and help the environment even from the comfort of your 9 to 5 job.

    About The Author

    As part of the marketing department at All Modern.com, CSN Chairs and several other CSN Stores, Jamie Sward has grown to appreciate all facets of modern design.  All Modern is part of CSN Stores, an online retailer specializing in modern and contemporary furniture, home accessories and lighting from some of the biggest names in modern furniture.  Brands include Herman Miller, Knoll, Kartell, Alessi, iittala and more.

    16 Mar 2009, 11:39pm
    Projects:
    by Cliffano Subagio

    1 comment
  • Gift From wannabesociety.com

    About a month ago I received an email from Andja Maric who was a global ambassador for wannabesociety.com . Andja came across Wish while googling for wishes, she explained that wannabesociety shared a similar idea of sharing your wish with the world (t-shirts in their case, binaries in my case).

    Andja then mentioned that she liked the concept of Wish and kindly offered to send a gift as a token of appreciation. So the gift finally arrived in my mailbox yesterday…

    The packet. First time ever receiving a delivery from Slovenia.

    The content. They sent 3 sets of these (a notebook, stickers, a mini brochure, and some kind of a wrist band). I picked ‘creative’, SS picked ‘believer’, so the last one ‘better’ will be sent to JC. SS and JC have been helping with site testing and concent moderation, and they prefer to remain anonymous.

    Thanks very much, Andja, and wannabesociety.com. I appreciate the kind gesture, and I dig wannabesociety’s concept of no design.

    9 Mar 2009, 9:34pm
    Projects:
    by Cliffano Subagio

    2 comments
  • BuildMonitor v1.0

    It’s been a long time since the last one (v0.9.2 – November 2008), but I’ve finally managed to release Hudson Build Monitor v1.0 .  This add-on is still in the sandbox, I’ve been waiting for approval from the Mozilla editors for the last 9 months, so unfortunately you still have to login to download it.

    A new feature in this release is build executor monitoring. This feature will work only on Hudson instance feeds (non-job feeds), and you have to enable it via Prefereces window -> Feeds tab -> Enable executor monitoring check box.

    The executor status will be displayed next to the build status. It’s blue when one of the executors is running a build, red when one of the executors is stuck, and grey when all executors are idle or offline.

    Another new feature is the support for HTTP Basic Authentication, this has been requested by a number of users with password-protected Hudson feeds. You can set the username and password in Preferences windows -> Network tab -> Username and Password fields.

    Thanks to Jason Meridth who helped with testing this feature and wrote up his experience.

    Other minor changes in this release:

    • ‘Add Link To Hudson Build Monitor’ menu only appears when you’re right clicking Hudson feed links (for all, for failures, for just latest builds), and no longer for all links.
    • Preference window is now tab-ified as seen from the above screenshot.
    • Hudson icon tooltip on Firefox status bar now displays a message that recommends user to add Hudson feed link via right click menu instead of manually adding the URL to Preferences window Feeds section. This feature was already implemented in v0.9 (released in November 2008) and documented on the wiki page, however, there are quite a number of users who are still not aware of it and keep adding the feed URL manually following the old tooltip message.

    As usual, translations have been updated thanks to Eric Lefevre-Ardant and Seiji Sogabe. Unfortunately I had to temporarily disable the French translation in v1.0 due to something wrong with the file/text(s) which breaks the add-on. I’ll do a patch release when it’s all sorted out, in the mean time, users with French locale on Firefox will get the default English texts.

    1 Mar 2009, 10:50pm
    Projects:
    by Cliffano Subagio

    3 comments
  • Build Executor Monitoring

    Here’s a sneak peek of Hudson Build Monitor’s new feature, the ability to monitor build executors from Firefox statusbar panel. This feature was requested by Espens back in July last year. Espens was one of the earliest users who raised lots of ideas and feature requests. Thanks Espens!

    In retrospective, I should’ve implemented this feature much earlier as I found out recently how useful it is to be able to keep track of the currently running builds and the status of the executors. Having a stuck executor is like losing a leg, sometimes you end up with a lot of builds waiting in the queue just because a master/slave doesn’t have any idle executor.

    I’ve been monitoring Apache Hudson instance, and that jspf-trunk build has been stuck for the past 3 days. If the master instance is set up following the 1 executor per 1 CPU suggestion, that’s like wasting 1 CPU resource not doing anything (if the box is dedicated for Hudson).

    Build executor monitoring will be included in v1.0 release about 2 weeks from now.

    Another  good news is that Hudson Build Monitor Firefox Add-on was featured in the tools tips section of JavaTools Community Newsletter on December 29th, 2008. It’s a few months old, but someone just told me about it :p. Thank you!

    1 Mar 2009, 9:04pm
    Projects:
    by Cliffano Subagio

    1 comment
  • Home Studio v0.1

    Some pictures of the initial version of my ‘home studio’. :)

    I have always wanted a home studio where I can work on my own projects and create stuffs: codes, digital graphics, hand drawings, circuit boards. I guess I’ll start with the codes and digital graphics bits for now. This ’studio’ is basically a third of my apartment’s bedroom (still renting). An old study desk, an old $25 chair. I’ll get proper furnitures, think ergonomic chair, when I have my own house, god knows when that will happen with the current global economic downturn.

    My laptop is an Asus F3SV running Ubuntu 8.10 . I used it as my main workstation for coding, IMing, web browsing, video editing. And just like any other geek, I have a naming convention for all gadgets within my home network, the laptop is hinata.

    Cables, cables, and cables. Someday everything has got to be wireless.

    Three old boxes which I assembled between 1999 – 2005. The one on the left is sasori, a Windows XP box that I use primarily for Windows-specific testing (Internet Explorer, FF on Windows), a little bit of gaming, and Photoshop. The one on the right (furthest in the picture) is gennou, running Ubuntu 7.10, this is where I host a local Hudson instance for my project builds and also to run weekly backups. The one in the middle is nameless at the moment, its power supply unit overheated and exploded in 2002, I haven’t had the time to rebuild it. On the top is anko, a wireless printer which also serves as a scanner and photocopy machine.

     

    Recent Posts

    Recent Comments

    • Tharindu: i started blogging long long time back but couldnt continue. last november i stated blogging again with...
    • maria: maybe he didnt believe in god, i dont either and does it really matter?? his message is the same:he talks...
    • Cliffano Subagio: Sure thing. The license for the images is Creative Commons Attribution Share Alike...
    • daniel: nice articles. can I copy your images? :D
    • Cliffano Subagio: Only an idea, won’t be made into real site (unless someone else wants to do it). Something...

    Most Commented Posts

    Linkroll