Why tables for layout is stupid…

Why tables for layout is stupid: problems defined, solutions offered.

A very pretty (and-judging by the number of translations it's had-popular) presentation on the evils of using HTML tables for layout.

I remain sceptical: try this test: walk up to your friendly neighbourhood CSS zealot and whisper into his/her ear: "I want a flexible layout that adapts to the browser's current width/height. It should work on IE/Mozilla/Safari and Opera." Step back! Be prepared! You are about to recieve an outpouring of CSS styles, DIVs and (probably) Javascript, all (hopefully) replicating the built-in features of the plain-old HTML <table>.

Don't get me wrong: I am happy with the "tables are evil' Zeitgeist, I just can't accept the CSS 'solution.' Maybe HTML5?

Tags: Rant, Tools

A Visual Explanation of SQL Joins

Over on Jeff Atwood's Coding Horror site: A Visual Explanation of SQL Joins.

Simple, but useful. Some good tips in the comments as well.

Tags: Tools

No Clean Feed!

May as well put it "out there…"

I just sent this to the Prime Minister of Australia, the Hon. Kevin Rudd, via Email Your PM:

Opposition to Sen. Conroy's Internet Censorship scheme and to his cynical behaviour

Mr. Prime Minister,

Let me state my clear opposition to the proposed ISP-filtering legislation.

I am opposed to this scheme on technical grounds. I have 25+ years of
experience in the IT industry and can say with certainty that it CANNOT be
made to work effectively in the face of determined opposition to its
presence.

I am also opposed to the attack on freedom of information and freedom of
expression that it represents.

I find the sneaky way that Sen. Conroy has orchestrated the process to get
the result he wanted, and to avoid public oversight nothing less than
cynical, abhorrent and anti-democratic.

I expect more from the ministers in your government than the sort of trickery
he has displayed.

I voted Labour in the last federal election but I place my support according
to my evaluations of the issues, not the parties involved. On this issue your
government is looking to lose a vote.

I have also contacted both Sen. Conroy and Shadow Communications Minister
Tony Smith to register my feelings on this.

I look to you to bring sense and leadership to this matter.

Regards,

BOB

Via GetUp, I have also sent similar messages to Sen. Conroy and newly appointed Shadow Communications Minister, Tony Smith.

Why don't you do the same!

Tags: Rant

UML Stuff

First up, the Violet UML editor.

Pretty much as simple as you can possibly get. I like it!

Don't know UML (and let's face it, who really does!)? Try IBM's UML Basics content.

Tags: Tools

BarCamp Brisbane IV

A fun event, as usual.

I started ranting on about "Systems Thinking", about how it is slightly at odds with Agile ("Minimise waste [effort]"(L) vs "Do the simplest thing that could possibly work [at the moment]"(A)) and how people actively advocate and embrace a myriad of tiny point solutions when we have good system-wide stuff (think properties files, csv, YAML, etc. vs. XML).

The discussion got going and I'll summarize the eventual mood as: "So what! I'm having fun."

I tried making the point that perhaps you wouldn't be happy with your dentist coming to you saying: "I've just had this great idea that I'm going to try out…seems really fun…now open wide…"

I recall at one point (as I was trying to talk about waste/efficiency) one guy saying "I went to a place once where they used all the Oracle stuff: db, app server, Java, JSF, etc. They seemed happy and were really productive. I'd hate to work like that, though."

???

So much for systems thinking!

Was a fun discussion, though.

A particular Good Thing for this barcamp was that DJ Paine from Studio Promise was there offering to do high-quality head-shots of the participants. These are always good to have and so I thank DJ for his most generous offer. You can take a squiz at the contact-sheets. I was first in line, so I assumed the role of guinea-pig. It was quite fun moving the 'set' around to get the correct lighting and 'feel.' DJ gave it the good 'ol college try but no matter what he did, he couldn't make me look any more beautiful…such is life.

Tags: Rant

Oracle Cloud Computing Roundtable Luncheon

"Cloud Computing - Strategy, Best Practices, and Lessons Learned"

Date: Friday 9 October 2009
Presenter: Tim Rubin
Venue: Augustine's Mansions Private Dining Rooms

First (as always), I'd like to say "Thank You" to Oracle for inviting me along to this event. Even if they actually wanted "Dale Gately", whoever that is (the email just happened to come to me via my domain's default drop-box). I guess that I should say "Thank You, Dale" as well! Never look a gift-horse in the mouth :-)

I'm not sure that there was actually any 'Strategy', "Best Practices" OR "Lessons Learned" discussed in the presentation.

The guy sitting next to me summarized his response to Tim's spiel as: "Please don't buy into what our competitors are telling you…give us time to work something out…" I guess that's about right.

I loved the opening Larry Ellison quote on Cloud Computing:

The interesting thing about cloud computing is that we've redefined
cloud computing to include everything that we already do. I can't think of anything
that isn't cloud computing with all of these announcements. The computer industry
is the only industry that is more fashion-driven than women's fashion. Maybe I'm
an idiot, but I have no idea what anyone is talking about. What is it? It's complete
gibberish. It's insane. When is this idiocy going to stop?

We'll make cloud computing announcements. I'm not going to fight this thing. But I
don't understand what we would do differently in the light of cloud computing other
than change the wording of some of our ads. That's my view.

The participants (all CIOs and CTOs…whoever Dale Gately is, he's clearly more important than I am) were…a confused lot, it seems to me. This is what I picked up on:

  • We are going to 'do' "Cloud Computing."
  • We don't really know what it is.
  • We don't really know why we should be doing it.
  • We are sceptical that it will buy us anything. At all. In fact, all we can see are a myriad of problems.
  • Still, everyone tells us that we should 'do' "Cloud Computing", so we will.

The event's organiser/host made an interesting comment something along the lines of "In Brisbane, we always meet with a healthy 'show-me-the-money' attitude. Much more so than in the other states." Decoded, this means: "Damn! You luddites are giving me a hard time again. I didn't get this from Sydney or Melbourne."

One question was repeated a couple of times with various phrasing whch I'll summarize as: "If we do 'do' "Cloud Computing", will we still have to do all that yukky Systems Integration?" I'd have hoped that a roomful of CTOs and CIOs would have a bit more of a grasp on things than they apparently have, but that's life. To his credit, the presenter's answer was quite correct: "Of course! You'll still need to undertake a good round of Business Process Reengineering to get the benefits of this (or any new) technology."

A few interesting tidbits/notes:

In a typical data center, the Uptime Institute found that up to 30% of servers are 'dead' (ie with <10% utilization).

According to Tim, the major benefit of Cloud Computing is reduced time/cost to provision a system.

According the to Oracle Cloud Computing survey:

  • ~24% of respondents saw cloud computing as a way of saving (unspecified) costs
  • ~20% saw (unspecified) 'Architectural' benefits
  • ~18% considered Cloud Computing to be strategic, in some unspecified way
  • ~15% considered that Cloud Computing offered a revenue-raising opportunity

Tim gently made fun of these statistics by pointing out how they seem to show a herd mentality following a fad (my interpretation of his comments).

Tim pointed out that Cloud Computing may actually cost more than self-hosting if you provision it properly and account for it fully (without all the funny intra-organizational 'tweaks' that are often so beloved).

The fact that Cloud Computing introduces a whole new swag of failure modes, critical infrastructure points and training issues was pretty well glossed over (and would probably have taken all the allotted time anyway!).

SLAs and legal issues were almost completely ignored.

IMHO the SLA is probably the most critical aspect of Cloud Computing adoption, and here's why:

Let's say I buy into a cloud on the basis that my cloud will be provisioned for a 'normal' load, but can be scaled on-demand to enable me to handle the bursts that come along every now and then. Everyone in an organization does their timesheet on a Friday morning, so that's a good illustration. The timesheet system probably runs at 0.01% of maximum load during the rest of the week and so constitutes 'waste', according to the Cloud Computing credo. Consider that the cloud vendor is only going to make money by ensuring that his infrastructure is as maximally profitable as possible and so wants to handle the load with as little equipment/effort (= as highly shared between customers) as possible. How do you write an SLA that says: "I need my peak load traffic to be successfully dealt with, REGARDLESS of the traffic being offered at the same time by any of your other customers." All the other customers have their timesheets to fill in, remember; their peak is Friday morning as well. The only way a cloud vendor could make an appropriate guarantee would be to provision a data center in exactly the same way as we do now: for maximal utilization and accept that the normal usage is going to be very wasteful. This will fly in the face of the vendor's business case and make their life almost prohibitively expensive.

So: you want to be in the cloud? Expect to achieve worse service (in some unspecified/unspecifiable way). You may not get bitten, but you WILL need to decide how painful a bite you can potentially stand.

Tim makes the very good statement: "Any application that gives you a competitive advantage should NOT be in the cloud." Good advice.

Overall, I came away feeling 'unenlightened' and a little miffed at the shallowness of the coverage.

I didn't even get a desert at the end of the meal 'cos the caterers had run out :-(

Tags: Retrospectives

Tweaking The Grails Datasource To Cope With MySQL's Foibles

The application I am maintaining is falling prey to MySQL's infamous "kill connections after 8 hours of inactivity" feature.

The users arrive each morning to find that their application is unworkable, 'cos all the connections have "gone away."

This IS a feature and not a bug, and it does make sense (the server has to manage its resources appropriately [for it] and 8 hours is as good a timeout as 1 or 1000)…but it is darned inconvenient, nonetheless.

Following the lead set by Sudarshan Acharya in Grails, DBCP & Stale Connections, I came up with this little class:

import org.apache.log4j.Logger
import org.codehaus.groovy.grails.commons.ApplicationAttributes

class DataSourceUtils {
  static final Logger log = Logger.getLogger(DataSourceUtils)

//
// fix for the database killing idle connections
//
// http://sacharya.com/grails-dbcp-stale-connections/
//
  private static final ms = 1000 * 15 * 60

  public static tuneDataSource = {servletContext ->
    def ctx = servletContext.getAttribute(ApplicationAttributes.APPLICATION_CONTEXT)
    ctx.dataSource.with {d ->
      d.setMinEvictableIdleTimeMillis(ms)
      d.setTimeBetweenEvictionRunsMillis(ms)
      d.setNumTestsPerEvictionRun(3)
      d.setTestOnBorrow(true)
      d.setTestWhileIdle(true)
      d.setTestOnReturn(true)
      d.setValidationQuery('select 1')
      d.setMinIdle(1)
      d.setMaxActive(16)
      d.setInitialSize(8)
    }

    if (log.infoEnabled) {
      log.info "Configured Datasource properties:"
      ctx.dataSource.properties.findAll {k, v -> !k.contains('password') }.each {p ->
        log.info "  $p"
      }
    }
  }
}

It's easy to use, just plop it into BootStrap.groovy:

class BootStrap {

  def init = {servletContext ->
    DataSourceUtils.tuneDataSource (servletContext)
...

The configuration may be a bit more 'aggressive' than generally needed, but better safe than sorry!

Of course the 'correct' way to handle all this is to let the container control the datasource and then pick up the managed resource via JNDI. I'll go that way eventually, but there's plenty else in the application that needs fixing up first.

One can also establish a bigger value for MySQL's wait_timeout property, but this isn't really a good solution (one still has to be prepared for other causes of loss of connection). Many people suggest adding "autoReconnect=true" to the connection URL. This may be OK for a standalone application, but it is simply not recommended for use with connection pools. I think the doco uses language like "side effects related to session state and data consistency" when touching on this issue…scary!

[...edit...]
With Grails 1.3.1 there is a standard way of doing this.

Tags: Grails, Programming, Tools

A Small Tool For The Color-Theme-Challenged Designer

Adobe's Kuler color theme designer/search engine…thingy.

Krappy name, but something potentially useful…

Tags: Tools

Brisbane is "Groovy, Baby!"

I was at yesterday's Groovy/Grails Queensland meetup.

We started talking about the wealth of talent and Groovy/Grails 'names' that were clustered in and around Beautiful Brisbane, Australia. People with major, direct influence on the various Gr8 technologies. People like: Dr. Paul King, Lee Butts, Luke Daley, Bradley Beddoes (to name but a few). All movers and shakers in the Gr8 world. Many were in the room at the time.

Steve Dalton is maintaining a slightly bigger list.

We truly have a world-class, leading-edge group here.

To quote Lee: "We are the Australian HUB for Grails/Groovy :)"

(I'm so glad that I managed to avoid using the phrase 'paradigm shifting'…but it was hard ;-))

Tags: Grails, Groovy, Programming

Man's Inhumanity To Man

I had occasion to look this phrase up a while back. This is where it comes from:

Many and sharp the num'rous ills
Inwoven with our frame!
More pointed still we make ourselves
Regret, remorse, and shame!
And Man, whose heav'n-erected face
The smiles of love adorn, -
Man's inhumanity to man
Makes countless thousands mourn!

"Man was made to Mourn: A Dirge"
Robert Burns
1785

So true, and so sad!

The full poem is enough to cast one into a fit of depression!