Scrum in 10 minutes:

December 11th, 2008

I just watched this Scrum explanation video; A great summary of the basic concepts of Scrum.

Thanks to Hamids at http://shipsoftwareontime.com/ for creating this video.

jQuery plugin: DynDateTime, the date-time picker

December 9th, 2008

As avid readers will know, I am a fan of jQuery.  There are lots of plugins to ease development, but one thing I haven’t been able to find is a date time picker.  Yes, the UI plugin contains a date picker, but no time component.

This won’t do, so I  made one!

It is a fork of Dynarch.com’s (LGPL) DHTML Calendar v1.0, which ceased LGPL development in 2005.  I have used this widget successfully in many projects, and a colleague wanted a jQuery datetime picker.  So I present to you:

 DynDateTime

The demonstration page explains its usage (super easy).  The initial codebase (0.1) is little more then a jQuery wrapper, but the underlying code is well structured, so modification is not too hard.  The original code is written in an older javscript style, and I hope to improve that as well as fix a few bugs.

Why not give it a try, and start submitting those issues; if its in use, I have a reason to continue developing it.

Javascript libraries hosted by Google

November 27th, 2008

Google has built a system that hosts the most popular Javascript libraries on their vast network.  This means developers can link to Googles’ hosted libraries, saving bandwidth (at Googles’ expense)

Here is the page explaining: http://code.google.com/apis/ajaxlibs/documentation/

<script src="http://www.google.com/jsapi"></script>
<script>google.load("jquery", "1.2.6");</script>

Here is the list of available libraries as of todays posting:

name: jquery
versions: 1.2.3, 1.2.6

name: jqueryui
versions: 1.5.2

name: prototype
versions: 1.6.0.2, 1.6.0.3

name: scriptaculous
versions: 1.8.1, 1.8.2

name: mootools
versions: 1.11, 1.2.1

name: dojo
versions: 1.1.1, 1.2.0

name: swfobject
versions: 2.1

name: yui
versions: 2.6.0

Thanks, Google.

Update 11/12/2008:

There is an inconvenience using the google.load(…) method. As this needs to evaluate, request and load, you can’t (reliably) use jQuery(document).ready(…).  Google provide their own callback; google.setOnLoadCallback(…).

 While the callback is good, it means that the google.load(…) technique is not a straightforward replacement, you also need to convert your jQuery(document).ready(…) methods.  As jQuery chains these, I sometimes have more then one declaration on a page.

For example, a JSP might server-side include a couple of widgets, each of which “bootstrap” from their own jQuery(document).ready(…) method.  While its not hard to change, it still takes time, and breaks the drop-in-replacement endorsement.

 Thankfully, Google also allow you to link straight to their hosted versions.  The documentation link above lists all the library URLs; here is the jQuery code:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>

Using this technique, you can still take advantage of the system. In particular:

  • Googles’ mega network and bandwidth capabilities save your server bandwidth
  • Clients browser may already have Googles version of a library in cache, as many sites will be using the same link. This will make your site load faster for many users. (Specifically, users who have been to other sites that uses the same library from Google)

Thanks to this article for pointing out this option.

JAOO 2008

October 8th, 2008

Last week I attended JAOO 2008 in Aarhus, Denmark (Java And Object Orientation). The conference was well organized, and covered a wide range of topics. It was great to be able to listen to many opinions on the future of software development, as well as what is being done today.

I attended 18 talks in all, and there were a few major themes that recurred.

  • Cloud computing; how to develop and manage distributed systems. (and how can make this easier…)
  • Functional programming; an alternate paradigm in coding style that (among other benefits) allows for easy runtime distribution of code (cloud computing).
  • Scaling / High performance; how to architect and manage systems that are high volume and/or high performance.
  • Development and project methodologies; scrum and agile pep-talks, common planning and project mistakes, code review and refactoring.
  • Rich internet applications (RIA); Both standards based and proprietary approaches to RIA development.

There are a few talks that really interested me, and I’ll cover them here.

Top Ten Software Architecture Mistakes

By Eoin Woods from Barclays Global Investors

I really enjoyed this talk, although I noticed that the project name was misleading. The mistakes were not to do with the architecture itself, but with the edges of a project that can get neglected or forgotten. Never-the-less, it made for a great laundry list of issues to make sure all your projects have an answer for. Indeed, Eoin himself noted in the summary for the talk

“In this talk I’ll share some of the pitfalls that I’ve encountered in my experience as a software architect and in doing do, hopefully make sure that you avoid making just the same mistakes on your projects.”

So, here is my summary of the 10:

  1. Scoping Woes: the dreaded scope creep needs to be tackled head on; rigorously check that features are really needed, and that the flow on effects of missing features are communicated.
  2. Not Casting Your Net Widely: Ensure you identify the spectrum of stakeholders, and work to ensure that difficult stakeholders are addressed, to ensure they are onboard.
  3. Focusing on Function: Functionality is only one component of a successful project. Its the qualities of the project that need to be considered early, as these can be the hardest to change later on. Rank the most important qualities to help guide guide the project: availability, compliance, evolvability, maintainability, performance, reliability, scalability, security, supportability.
  4. Boxes and Line Descriptions: Many designs are drawn in a way that can be ambiguous or inaccurate. This leads to others misunderstanding design diagrams and all sorts of confusion. Ensure you are accurate and use a well defined notation! Make all diagram elements ( vertices’s, box styles, colors) explicit in their meaning.
  5. Forgetting It Needs to be Built: This point touches on the Golden Hammer problem. Consider why new technologies should be used rather then just following trends. Make sure you have a team with experience with your chosen tooling, else expect a learning cost. Ensure that any extra time is worth the benefit.
  6. Lack of Platform Precision: Saying it runs on “Linux with Tomcat” leaves the door open for problems like; “why doesn’t it work on my Linux kernel 1.0 with Java 1.2 and Tomcat 3 ?”. Specify a specific and versioned stack, and ensure that developers, testers and users all use the same stack.
  7. Performance Assumptions: A difficult quality to guarantee. Assume nothing and consider it early in the project. Test it properly based on the importance of this metric.
  8. DIY Security: How hard can it be to implement security? Answer: Its hard to do correctly! Generally, reusing infrastructure is a smarter way, unless you have very unusual needs.
  9. Lack of Disaster Recovery: Any system has a large risk without DR. Even if DR is in place it is rarely tested. Plan, Design, Build, Practice!
  10. No Backout Plan: For those times that deployments don’t go well, ensure you have a rollback/backout plan! Not easy for large deployments, but very risky without backout option.

I know in the past that I have neglected some of these non-functional and tangential considerations; the implication from this speech is that Software Architects must manage many more areas then just the functional development and tool choice. For me it reinforces how architects must work very closely with Project Managers and clients to architect a complete and robust solution.

Kaazing Gateway: An Open Source HTML 5 Websocket Server

By Jonas Jacobi from Kaazing

So how do we get proper 2-way communication between a browser and a server using HTTP? Classically this functionality, known as Comet programming, has been achieved with some sneaky emulation techniques. These include server polling, holding long-term HTTP connections and using hidden iframes. The existing solutions have costs, however. Polling adds lots of unneeded requests to a server, and holding connections open causes many open connections for the server as user count rises. Kaazing has taken a commendable approach to solving this limitation of HTTP.

First off, they contributed the WebSockets section to the HTML5 standard. This specifies a JavaScript API and DOM tag (<eventsource>) to open a new connection, allowing bi-directional communication. This connection uses the standard HTTP protocol, and actually changes the wire protocol from HTTP to WS after the connection is open. This means that connection can be open through proxies and firewalls without needing admins to open the network for this communication.

This means that there is a standardized way to code proper bi directional communication without thinking about the (tricky) details.

This is great, but HTML5 isn’t yet finalized: so how do we get browsers to support this? Its a chicken and egg problem - you need browser support before you use a feature, and you need a feature to be used to encourage browsers to support it. Kaazing has taken an approach that really resonated with me; I like to call it fake it till you make it.

Kaazing has a script that checks for existing WebSocket support, and if not there, it adds Kaazings implementation of the API. This means that developers can code using the standardized API before the browser has native support! Kaazing actually has multiple implementations of WebSockets, and their insertion script picks the best implementation for the clients browser. If a client has Flash installed, this is used as a bridge. If there is no Flash, Sliverlight or other bridge with proper socket support, it will have to default back to an implementation using long connections or polling.

This means that the solution works for everyone, even the 1% who don’t have Flash or similar installed. Now instead of polling or long connections of every customer, you only need to use this old tecqnique for 1% of your clients - much easier to deal with. Jonas mentioned that one browser already has native support for this API in one of their nightly builds (Maybe the newest Firefox? Opera? Can remember sorry).

Of course, you need a server that knows how to handle the protocol upgrade - this is Kaazings’ commercial offering: Kaazing gateway. In fact, their product can be used to allow any TCP traffic to be routed over HTTP, allowing the same proxy/firewall benefits for RIA and client-server software. The gateway can simply expose a normal network socket and any TCP content can be transmitted over the open connection. Much better then making your software have to make lots of HTTP requests, and the server needing to convert, package and send back each request in a textual format.

update: Look at  http://orbited.org/ and/or http://js.io/ for other implementations of WebSockets.

The concept that really resonated with me is the fake it till you (they) make it approach. I have seen this a few times already in the browser space, such as in these projects:

A standardized approach to Comet programming is great; a solution to browsers’ chicken and egg adoption issue is even better!

The Lively Kernel

By Dan Ingalls from Sun Microsystems Laboratories

The Lively Kernel is a project from Sun laboratories. It is an environment coded completely in JavaScript and SVG. It is not a production ready tool, but an interesting research project. The environment is designed for visual element creation, cloning and enlivening via scripting. The environment allows the end user to add scripting to any visual element and modify any existing one.

I don’t have much else to say about it - it works in all good browsers, and the tutorial demonstrates its features and concepts well.

Of interest to me is the idea that SVG could be used to develop richer applications that still use standards (ECMA, SVG in this case). UI design can be freed up with SVG, and good libraries would make an SVG based UI easy to develop. Coupling SVG with WebSockets would allow you do develop pixel perfect RIAs that could rival solutions such as Flex; I think these are the 2 major areas that traditional websites suffer in comparison.

Performance Considerations in Concurrent Garbage-Collected Systems

By Peter Holditch from Azul Systems

Going in, I knew this was a sponsored talk. I was expecting lots of PR and marketing fluff, but I was pleasantly surprised. Yes, Azul make high end Java appliances (more on them later) but the talk was about real-life Java garbage collection. I’m not going to cover it here as you can find better information elsewhere, but we covered stuff like concurrent, parallel garbage collection and fragmentation of the heap.

In this discussion, we were lead to an important conclusion: Java sometimes needs to pause execution (phrased: stop the world) to garbage collect and defragment the heap. High volume and high performance systems simply cannot afford this pause, and its frustrating even for regular Java systems. You can increase the heap size but this only delays the problem AND makes the pause longer. Larger heap == larger defragment time.

Azuls’ hardware gives the JVM garbage collector hardware mechanisms to work in realtime in parallel, giving your processes 100% cpu time with no stop the world interruptions. Oh, and did I mention that you can have heap sizes of > 500Gb ?!!

Their hardware is the CPU/memory equivalent of NAS; you have a regular server running a tweaked version of Sun Java. This version is a wrapper JVM which delegates all its work to the JVM running on the Azul CPU. As far as the regular server knows, it is a completely standard JVM. (albeit a very fast one with an abnormally large heap!)

The Azul hardware ships with many cores, and the CPU/memory can be logically divided into multiple JVM backends. I didn’t inquire into pricing, but I imagine that a box with 54×16 CPUs and 768GB of memory is going to cost a bit. Still, a very nice piece of hardware, and a good discussion on the art of garbage collection. Azul systems, you are welcome to send me some sample hardware so I can play more and do a better writeup…

Conclusion

These summaries are for some of the sessions I enjoyed, but there were many more interesting talks: Google Chrome and its JavaScript engine, the OpenSocial API, Googles’ App Engine, JRuby and others. I really enjoyed the talks, but also being able to socialize with so many different (smart) people means that its hard not to have an interesting time.

On one hand, conferences like this are really humbling. Listening to knowledged talks on so many subjects makes me feel like a fool only scratching the surface, and makes me appreciate how much more there is to learn. On the other hand, the whole experience is so inspiring! I suppose I’m inspired to continue scratching…

Test Driven Progressive Enhancement

September 26th, 2008

I have talked about PE before, but this is a interesting approach to ensure that the browser supports your enhancements - test for support!

http://www.alistapart.com/articles/testdriven

It tests specific CSS support by injecting DOM elements then measuring the injected element to see if it renders correctly.  It then stores a cookie with the results of the support, so this test need only run on the first visit.  It will switch to “enhanced” stylesheets,  and your PE script should apply enhancements only where support is available.

It also supports extension for testing specific cases,  if you use a technique that is not covered in the core tests.

On an unrelated note,  congratulations to WebKit for achieving full Acid3 compliance!

Googles new browser: Chrome

September 3rd, 2008

Google let the cat out of the bag a few days early: They accidentally announced their secret project to build a new browser experience. It is open source (though the initial release is for Windows: Linux and Mac promised soon) so ideas (and code) can be shared between different browser implementations.

They have a few great ideas that, if implemented well, could be very good.

  • It renders with the Webkit library, used in Safari and the iPhone. It is a fork of the KHTML library from Konqueror.
  • A new UI layout: tabs are placed above the address bar; the tabs are actually in the window frames top bar. This is good because it means that each tab has a separate address bar. (I should note that Opera also has the address bar in the tab, though the tabs are not in the window bar) The metaphor is broken in current browsers (Firefox, iE7+), as all tabs share the address bar: it magically changes in synch with tab switching. On the negative side,No operating systems use the top bar of a window, so this is very non standard. The only exception I can think of is M$ Office 2007s’ awful application start buttons, which reach up to the top LHS. Both Linux and Mac use this bar for shading and moving windows, so I hope that this doesn’t break that.
  • Per-tab processes: This means that every tab is isolated. One maligned tab can completely crash without affecting the others. In my opinion, this is a great feature. The extra memory cost of this feature will be outweighed by the utility it provides. How many times has one tab caused your whole browser to die and loose all your tabs? I expect the other browsers will follow this lead. Even better, there is a process tab showing you how much memory/CPU each tab is using. At last we can find out who to blame when things slow to a crawl! IE8 beta has per-tab processes, but who want to use that browser?
  • New Javascript rendering engine - V8. Google think that their new engine is fast, and have benchmarks to prove it. This is a good thing! They offer 3 key ares of performance improvement: Fast Property Access, Dynamic Machine Code Generation and Efficient Garbage Collection.
  • Lots of UI nice-ness that I can’t test until the Linux port is released. The most interesting to me is that they are finally starting to use the address bar for any kind of search, URL, whatever. In fact, its termed the Omnibar. I have been using a little known feature of Firefox to achieve this for ages: keywords. I can start the text in the address bar with the letter(s) of where I want to search - “g search with google”, or “ut funny youtube videos” etc. Read this, all Firefox users.

I welcome another player into the browser market, and am very excited to try it out. I do, however, have a few concerns:

  • Where are the browser migrants coming from? As much as I’d like to say that it would be from the IE camp, unfortunately I suspect its more likely to be the users who are already smart enough to have jumped to Firefox or Safari. Wikipedia suggest that right now, IE has 78%, Firefox has 16%, Safari has 3%, and the rest is filled in by others. Is this going to dilute Firefox, or strip IEs lead? I’m all for innovation in the browser space, but I do enjoy they rich set of Firefox tools build from its growing community.
  • Plug ins: As far as I can tell, Chrome only supports Google Gears for extensions/plugins. Will its market share be enough to get a rich set of 3rd party plug ins (I think yes). Where did these 3rd party developers come from? See the point above…
  • Its starting to look like a complete operating system - I’m not sure how I feel about this, but it could pave the way for a complete Google solution on your desktop. There was lots of speculation about this a few years ago( eg RRW, OS news). At least each Google component can be separated; having the option of a complete Google stack is fine, as long as you dont’ get locked in. Single vendors might realize the power they wield, and use it for their own maligned purposes. (Yes, even Google isn’t immune.)

You can read the (leaked) comic explaining its features in a clear and smart way. I expect Google were planning to announce it with more then just this comic, but it got out early and forced their hand. Perhaps this is why there is no Linux/Mac port yet? Here is the link, anyway:

http://googleblog.blogspot.com/2008/09/fresh-take-on-browser.html

This is the project homepage, with the Windows beta available for download: http://www.google.com/chrome/?hl=en

SSH keys

August 6th, 2008

SSH keys allow you to login via SSH without needing to type your password in each time. Here is a quick summary of what you need to do:

  1. Get the SSH client locally. There have been security vulnerabilities in some SSH tools, so ensure you have an up-to-date version. Assuming you use apt for package management (Debian, Ubuntu etc), you can use this command.

    sudo apt-get install openssh-client

    Replace install with update for ensuring the newest version.
  2. Now you need to generate a private and public key on your local machine. Open a terminal and type:

    ssh-keygen -t dsa -f ~/.ssh/id_dsa

    You can leave the passphrase empty. Your key pair will be created and stored in ~/.ssh/ as id_dsa.pub (public) and id_dsa (private)
  3. Now you need to get your public key registered on (each) target system. Many Linux distributions ship with a tool, ssh-copy-id, to make this easy.  From the local machine:

    ssh-copy-id -i ~/.ssh/id_dsa.pub user@target.com

    If you don’t have this tool, you’ll have to do it manually. The contents of the public key must be appended ~/.ssh/authorized_keys on the target system.

    1. Copy the file from the local to the target system

      scp ~/.ssh/id_dsa.pub user@target.com:~/
    2. Login to the target via SSH to the target

      ssh user@target.com
    3. Check if the (remote) file ~/.ssh/authorized_keys exists. If not create a new (empty) file and set its permissions:

      touch ~/.ssh/authorized_keys
      chmod 600 ~/.ssh/authorized_keys
    4. Copy the contents of id_dsa.pub to the new file, then remove the original file:

      cat ~/id_dsa.pub >> ~/.ssh/authorized_keys
      rm ~/id_dsa.pub
    5. You can now login from the local machine without needing a password.

jQuery presentation

July 15th, 2008

This quick post is only to link to the presentation I recently did on jQuery.

Unfortunately you don’t get my explanation of the examples, but hopefully they are obvious. Any questions welcome.

Update: I recently stumbled on this great HOWTO for creating your own plugins - very easy!

Linux Evangelism

July 12th, 2008

During a recent conversation with a colleague at work, positive mention of my Linux Evangelism was made. I had never though about this, but I suppose its somewhat right. I do talk passionately about GNU/Linux, and Kubuntu is my current flavor. I think its a great way to learn more about your hardware, and gives you complete control of your system. For those of you who I have turned on to Linux, check this site for equivalent apps:

http://linuxappfinder.com/alternatives

For example; for Adobe Photoshop; it has these recomendtations:

Handy for those people who are just making the switch and don’t know the ecosystem of software very well. Otherwise, Wine can run many windows applications….

News *Flash*

July 3rd, 2008

As I blogged about previously, I have a few complaints about Adobe Flash. One of the big problems that affect me (and all Linux users), has been fixed in the new v10 beta. Here is the announcement from the official Flash-Linux blog:

http://blogs.adobe.com/penguin.swf/2008/07/turkish_localization_also_wmod.html

They have finally implemented Wmode, so HTML elements can display over the top of flash - it now respects z-index correctly. No more dropdown menus hidden by the flash banner below. Here is an example of the problem taken from http://pathe.nl/:

flashPopUnder (by t1mthet00lman)

My current workaround for sites like this is to use adblocker to remove offending Flash elements. Even though I’d prefer not to need Flash, its great to see Linux support gaining momentum. As mentioned in the announcement, it helps ” … bring Linux web browsing up to ~2002 standards.”

Unfortunately, its Firefox 3+ only, and I haven’t yet made the switch…

Update: They have also published the SWF file spec, so search engines etc. can read (and index) their content - another of my Flash grumbles…

http://www.businesswire.com/portal/site/google/?ndmViewId=news_view&newsId=20080630006649&newsLang=en

Update 2: The Firefox guys are working towards  support for the WHATWG video and audio elements (i.e. a <video> tag ), making one of the biggest use cases (video - you tube etc.) have some competition from within standard.  Also, note the domain of the FF dev guy; .nz !

http://www.bluishcoder.co.nz/2008/07/video-and-audio-element-patch-has.html