28 Feb 2010, 4:24pm
Life:
by Cliffano Subagio

2 comments
  • App My State Idea Entry

    From App My State web site, “App My State is a competition to inspire Victorians to create web and mobile applications for Victorians. Entrants will be competing for $100,000 in prizes.” The gist of the competition is that the government has released some data, you go create something with it.

    So here’s a quick mock-up of my idea (guaranteed not going to win any prize):

    http://www.isvictoriamoreviolentthanlastyear.com.au ? YES

    As a resident of Melbourne, Victoria, Australia, I am greatly concerned with the increase of violence in the recent years. Gone are the days when people could feel safe traveling on public transport at night. Gone are the days when I could safely walk by myself on the city streets at 4am on a weekend.

    Is it the government’s fault? No, even though I think that the law could be tougher, I still believe that the problem is with the people. Once I was on the train, I saw a group of youngsters arguing with an old guy. The youngsters got off the train at Caulfield station, but they kept shouting profanities at the old guy still inside the train. And when the train started moving, one of the youngsters suddenly kicked the train window right next to where the old guy sat. Is it the lack of respect? Is it the decline in morality standard?

    Not many people know this, but I myself was once held at knifepoint. I fell asleep on the tram after a long tiring day, and I woke up with a knife pressed on my neck. There were two of them, and they got away with my wallet. An old guy, whom I later knew as Laurie, tried to help me that night (thank you Laurie from East Burwood). But the second robber held the knife against Laurie. To cut the story short, the police contacted me the next day, they caught both guys. Apparently I was the first victim that night, the fourth one wasn’t so lucky and was stabbed on the neck.

    Rantings aside, the site itself could easily be built by comparing last year and this year’s crime statistic. Though unfortunately the result can be cached for at least the next 5 years. Melbourne is getting more violent each year, and there’s no sign that the situation will improve for the better.

    26 Jan 2010, 10:58pm
    Work:
    by Cliffano Subagio

    1 comment
  • A Guide To Stand-Up Meeting – Part 1

    people around you are not blind...

    I’ve been doing daily stand-up meetings for all but 1.5 years of my time in the software development industry, and I had plenty of chance to observe the good and bad habits during the stand-up.

    For this part, I’ll just highlight the need to keep what you say relevant to the project, to not pause too long and too often, and to not unconsciously perform politically incorrect hand movement where no one wants to pair-program with you afterward.

    The above panel was drawn this morning while waiting at Caulfield Station. I’ll do part 2 on the next down time, whenever that is.

    19 Jan 2010, 12:25am
    Work:
    by Cliffano Subagio

    2 comments
  • Known Hosts Issue With Net::SSH

    This issue bit me twice within a month, and each time I had to spend a couple of hours to figure out the cause of the problem, mostly due to the obscurity of the error messages.

    So I was using net-ssh-2.0.15 and jruby-openssl-0.5.1 for a piece of code that’s supposed to perform some remote operations. The Net::SSH usage itself was straightforward…

    Net::SSH.start(@host, @username, :keys => @keys) do |ssh|
        ...
    end
    

    When I ran the above snippet on Windows XP, it gave this error message without any further information…

    The system cannot find the path specified

    Not exactly helpful, eh? And after some sleuthing around, it came down to add(host, key) method in lib/net/ssh/known_hosts.rb :

    def add(host, key)
      File.open(source, "a") do |file|
        blob = [Net::SSH::Buffer.from(:key, key).to_s].pack("m*").gsub(/\s/, "")
        file.puts "#{host} #{key.ssh_type} #{blob}"
      end
    end
    

    This method is trying to add an entry to the known_hosts file, which location is stored in source variable. In my case, the variable resolved to C:/.ssh/known_hosts . But the problem was that the .ssh directory didn’t exist. So I simply created it.

    Lo and behold, when I ran this piece of code on a Solaris box weeks later, I hit another error message…

    No such file or directory (IOError)

    which turned out to be caused by the exact same thing, but this time the location is <script_home>/.ssh/known_hosts . The workaround was the same, I simply created the .ssh directory.

    So there you go, hopefully it helps whoever else was confused by the unclear error messages.
    And in terms of a long term solution, it would be nice if add(host, key) checks or even creates the .ssh directory before attempting to write known_hosts file.

    10 Jan 2010, 5:05am
    Life:
    by Cliffano Subagio

    2 comments
  • On Rude Customer Service

    ... yep, robots, preferably configurable via Hudson.

    I never understood the point of having humans doing customer service if they can’t be polite and friendly to fellow human.

    p.s. Introducing LatteGirl. Here’s her attempt at drawing CoderBoy and herself.

    5 Jan 2010, 11:20pm
    Life:
    by Cliffano Subagio

    leave a comment
  • Adelaide Getaway 2009

    Some photos from my Adelaide getaway sometime late last year. Enjoyed a nice breakfast at Briccone, Rundle Mall, somewhere in the eastern side of the CBD. But the highlight of Adelaide was Glenelg, a beautiful and relaxing suburb by the beach.

    Originals are available from the photoset page on Flickr.

    11 Dec 2009, 10:35pm
    Etc:
    by Cliffano Subagio

    leave a comment
  • My Take On People’s Takes On Google’s QR Code Push

    So Google made a big push for QR Code usage in the US by sending window decals containing QR Code links to their top 100,000 business listings (via Favorite Places). This effort was covered by TechCrunch (TC) and Mobile Marketing Watch (MMW) among many other tech blogs / news sites out there. For the most part of the articles, they were only a rehash of Google’s original blog post, while the rest contained some original opinions from the authors, and this, along with some short sighted comments, was the part that bugged me.

    Let’s start with a paragraph from TC article

    Local businesses can also set up coupon offers through their Google directory page, which would turn the QR code into a mobile coupon, and help entice someone standing outside a store to come in: “If you found us on Google, you get 20% off.”

    MMW not only copied exactly the same paragraph, but also added

    This is where the true benefit lies.

    And my take is… Coupon only benefits if you want to attract potential customers not standing outside a store, e.g. if you do a Google search and you find the Google directory page along with a coupon from the said business. On the other hand, if you do want to attract someone nearby your store, surely a large 20% discount or a SALE sign will do a better job than a garble of black and white dots inside a square.

    I think the true benefits of having those QR Codes placed on the door of your restaurant/store are

    1. To convince the potential customers to use your business by exposing them to positive reviews and ratings.
      This is why Google only sent the window decals to their top listings, businesses having negative reviews might not be so keen.
    2. To increase the possibility of those (potential) customers revisiting your business by providing them with the address, map, and contact details.
      This replaces the traditional role of business cards.

    Both points are nothing new, they already exist all along with print media (brochures, business cards) and human interaction (conversation, words of mouth). Brochures and business cards will eventually run out and there’s a limit to the number of people you can reach by talking directly to the person. So you move those content online, in this case as a Google business listing. And what is the easiest way to link you and those online content? QR Code! QR Code is the simplest mechanism to retrieve those content (point and click) and to keep the content with you (as a url bookmark on your mobile phone).

    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.

    4 Nov 2009, 1:05am
    Life:
    by Cliffano Subagio

    leave a comment
  • Hobart Getaway 2009

    I went to Hobart in late August for a weekend getaway. Hobart was nice and quiet, I really enjoyed the walks through Battery Point and Salamanca Place. Had possibly the greatest breakfast ever at Retro Cafe.

    Originals are available from the photoset page on Flickr.

    23 Sep 2009, 1:08am
    Etc:
    by Cliffano Subagio

    leave a comment
  • Garry Kasparov's How Life Imitates Chess

    I finished reading How Life Imitates Chess a few months ago, and finally had the chance to go through my notes this afternoon during lunch break.

    Having followed the world of chess ever since I was a teenager, I’ve always been interested to know how great chess players think, to know their opinions about life, to know the things they went through to achieve their extraordinary skills… and this book offers exactly that.

    Garry Kasparov wrote about his experience, his thinking process, and how he applied all those things into various aspects of life. These are my favourite quotes from the book:

    Ch1 – The lesson
    p14
    It’s not enough to be talented. It’s not enough to work hard and to study late into the night. You must also become intimately aware of the methods you use to reach your decisions.

    Ch2 – Strategy
    p19
    “Why?” is the question that separates visionaries from functionaries, great strategists from mere tacticians. You must ask this question constantly if you are to understand and develop and follow your strategy.

    Ch3 – Strategy and tactics at work
    p36-37
    … our goal is to improve our position. You must avoid creating weaknesses, find small ways to improve your pieces, and think small – but never stop thinking.

    Ch4 – Calculation
    p50
    A computer may look at millions of moves per second, but lacks a deep sense of why one move is better than another; this capacity for evaluation is where computers falter and humans excel. It doesn’t matter how far ahead you see if you don’t understand what you are looking at.

    Ch5 – Talent
    p65
    Break your routines, even to the point of changing ones you are happy with to see if you can find new and better methods.

    Ch6 – Preparation
    p73
    If you said you ddn’t have enough time, that meant you were not well organized.

    Botvinnik summed up his philosophy by stating, “The difference between man and animal is that man is capable of establishing priorities!”

    Ch7 – MTQ: Material, time, quality
    p96
    But I believe that by using your time wisely you can put all your material to your best advantage and achieve the ultimate goal of quality. That’s the promise of the material-time-quality concept–in chess and in life.

    Ch8 – Exchanges and imbalances
    p102
    If we can detect or cultivate a weak spot in our opponent’s position, we can then attempt to transform our position to take advantage of that weakness.

    Ch 9 – Phases of the game
    p112
    So dedicate yourself to making the time, finding a space in which you can think and learn, and finding new ideas with which to shock your adversaries.

    Ch11 – Question success
    p135
    Question the status quo at all times, especially when things are going well. When something goes wrong, you naturally want to do it better next time, but you must train yourself to want to do it better even when things go right.

    Ch12 – The inner game
    p145
    That’s why I always think of Simon Bolivar and remember that experienced soldier who studies the battlefields in the aftermath of the war returns with both wisdom and renewed courage.

    Ch13 – Man vs. machine
    p166
    Weak human + machine + superior process was greater than a strong computer and, remarkably, greater than a strong human + machine with an inferior process.

    Ch14 – Intuition
    p178
    As they develop, our instincts–our intuitive senses–become labor-saving and time-saving devices; they literally cut down the time it takes to make a proper evaluation and act. You can collect and analyze new information forever without ever making a decision. Something has to tell you when the law of diminishing returns is kicking in. And that something is intuition.

    Ch15 – Crisis point
    p184
    But in fact, crisis really means a turning point, a critical moment when the stakes are high and the outcome uncertain. It also implies a point of no return. This signifies both danger and opportunity…

    Another thing I like about this book is that it also validates my belief on the importance of wanting to improve the way you do things, and also on the importance of understanding what you are doing.

    And regarding Garry’s current involvement in politics… as much as I wish him all the best, I’m afraid this is one battle he’s unlikely to win despite his brilliance (and I’d love to be proven wrong!). Politics defy any form of logic and reasoning, chess is a much more peaceful world in any way.

    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.

     

    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