ARCHIVE: August, 2007

NLB LogoYes, you get it right, it is a web service and it is with Singapore National Library Board (NLB), and it has been successfully integrated nicely with BookJetty for slightly over a week in stealth mode, and today after it is more or less stable, I can finally announce it.

This is probably one of first integration using web service with a public sector in Singapore. In anyway, it’s a new beginning, which I hope this will lead to more of amazing stuff that will benefit many when more organisations be it public or private starts to open up their non-sensitive data through an Application Programming Interface (API).

I am glad that today has finally come, before, BookJetty has been slogging through the hard way, using screen scrapping and session pooling, with worries that the service can easily break with a small change in the library online catalog, scalability issue due to sessions maintenance, and worse, blocked.

Today, those worries should not no longer be there, it definitely makes day, and the day for all the BookJetty users in Singapore.

Many thanks to Singapore NLB for taking this initiative, special thanks to Jamieson Teo who helped to advocate and facilitate this integration, and to Ling Xia, for her fast and excellent support during the integration phase, and finally to the management for giving the green light.

My warmest gratitude to all.

Book Review: The Dip

MON, 20 AUG 2007

The Dip: A Little Book That Teaches You When to Quit (and When to Stick)

I have to ashamely say that I read this book at Kinokuniya book store, after a failed attempt to look for a sketch book this afternoon.

If you look at the cover, the part where the stick man stands, is the dip, the period when beginner’s luck has run out, when things are going tough, when many call it a quit, and cause you to be scarce if you stay on – which is a good thing – and when you persevere and take the right steps to ride through the storm, that’s when you your efforts will pay off again and the dip turns upside down.

I’m not sure if I’m getting lazy, but nowadays I started to have a good impression with thin books. This book will help you to analyse your current situation, if you are in the dip or in a cul de sac, if you should stay on or if you should call it a quit.

Advocating that successful people are not the ones who don’t quit, but also those who know when to quit. It is alright to call it a quit, the idea is not to waste time and resources on things that will not work, but to focus on areas that will work.

Something that I can relate to as a young startup, and it also reminds me of my hurdle in relationship.

BookJetty gets another new feature, last night, I applied the Add to Favorites feature replacing the loveit tag. All books tagged with loveit are now marked as your favorite books, and that tag has been removed.

Add to favoritesThe Add to favorites icon is a nice looking small flower-pattern icon on your book list, when not selected, it is shown in light gray to reduce the amout of noise in the book list. Following its close cousin, the AJAX-based star rating feature, adding to favorites is a breeze; just click on the icon without a page refresh.

Book favoritesOn your book details page, we now have an indicator showing home many people have favorited this book, and you can also add/remove from favorites through a shortcut found under your shelf panel.

Favorites shelfOn your book list page, there is an additional favorites shelf to filter out your favorite books.

Favorites can be a great indicator for a good book supporting the book rating and review information. So start adding your favorite books now, and more to come for BookJetty.

I was playing with SOAP4R again lately, as I needed to connect to a web service, and the experience had been smooth, from the code generation using wsdl2ruby up to the part when I tried to connect to the service.

My SOAP request could not be translated by the server, because SOAP4R will automatically append n1, n2, n#…namespace to your elements or attributes, and the service that was expecting elements without n# namepace.

 <n1:ServiceContext xmlns:n1="http://domain.com/name">
      <n1:UserName>x</n1:UserName>
      <n1:UserAccessKey>x</n1:UserAccessKey>
      <n1:Password>x</n1:Password>
 </n1:ServiceContext>

I thought, to fix this should be easy, by changing some settings when generating the request document, but the problem was, where should I set.

Not being able to find any clue in the rdoc and SOAP4R how-tos, forced me to code-trace like a British spy, but thanks to ruby-debug for making it easier.

And here is the trick, to use default namespace or to remove the default n1, n2, n# namepace, when calling SOAP::RPC::Driver#add_[rpc|document]_operation method, set the elementformdefault or attributeformdefault option to true, for element and attribute namespace handling respectively.

If you are using wsdl2ruby to generate your SOAP::RPC::Driver, edit [ServiceName|default]Driver.rb and append the options to each of the methods generated:

Methods = [
  [ "http://domain/ws/ServiceName:Operation", "operationMethod",
    [ ["in", "operationMethodRequest", ["::SOAP::SOAPElement", "http://domain.com/ws/ServiceName", "OperationMethodRequest"]],
      ["out", "OperationMethodResult", ["::SOAP::SOAPElement", "http://domain.com/ws/ServiceName", "OperationMethodResponse"]] ],
         { :request_style =>  :document, :request_use =>  :literal,
           :response_style => :document, :response_use => :literal, :faults => {},  
           :elementformdefault => true, :attributeformdefault => true  }
    ],
    
    # Other methods
    ....
  ]

If you are like me, most likely you will have quite a number of methods to apply, what you can do is to put a short plug in init_methods to enable that options for all methods, and that, will be nice and DRY.

[ServiceName|'default']Driver.rb
-------------------------------

def init_methods
  Methods.each do |definitions| 
    # set options to use default namespace instead of using n[#]
    opt = definitions.last
    opt.merge!({
      :elementformdefault => true,
      :attributeformdefault => true
    })
    
    # rest of the codes generated by wsdl2ruby
    if opt[:request_style] == :document
      add_document_operation(*definitions)
    else
      add_rpc_operation(*definitions)

      ....              
    end
  end
end

Apple Worlwide Developers Conference 2007 has passed for almost two months by now, and all the huzz and buzz of iPhone has started to calm down.

But, time-travelling to about a month ago, the day when I met Joe Goh, one of the very few Mac developers we have in Singapore. It was over a-cup-of-coffee talk, a nasi-briyani and roti-prata meal at Ang Mo Kio (AMK) Hub, he shared his experience at the conference, and one thing that caught my attention was The Bay Area Rapid Transit (BART) Widget, the winner of 2007 Apple Design Award (Dashboard Widget Category).

BART_widgetBART widget is small swiss-army tool that allows commuters to plan trips on the BART subway system in the San Francisco Bay Area.

When he showed me the widget, I was fast to be impressed at the amount of information packed nicely into such a small widget, and its intuitive design that delves with immediate feedback and speech synthesis. The best of all, that widget was all done basically with HTML, CSS and Javascript!!

The BART Widget proved to us, that given enough thoughts and creativitity, much we can do to replace the simple and traditional web interfaces that we all have been familiar with.

Finding out more about Bret Victor, the guy behind BART Widget, I found a paper he has written on User Interface (UI) design, named ‘Magic Ink‘. If you are a software developer or a UI designer, nothing beats bumping into a resource as delicious as this.

Bret stresses that information software design can be seen as the design of context-senstive information graphics, which he shows clearly through his widget, and he steps through the process and throughts behind the creation of BART widget, which I think is an invaluable information.

In the paper, he also shows other great examples on how a typical information-rich page, can be redesigned into a context-sensitive information graphic. An example shown below:

Flight Original

Consider the re-design:

Flight Redesign