Blog Archives

Big Bash League vs Boxing Day Test

 

I love Test match cricket…

 

When I was thirteen I remember lying in bed watching the Ashes live on Channel 9, it would have been just a bit after midnight local time when Shane Warne announced his arrival on the international scene.

 

 

He went on to change the face of Test cricket, with the sport coming out of a period dominated by fast bowling, Warne single-handledly revived the art of leg-spin and with deliveries like the eight in the video below, leading the Australian Test team through a period in which they dominated both the Test and 50-over game.

 

 

A couple of years later I was at the Boxing Day Test at the MCG in 1995 when this famous incident took place.

 

No baaaallllllll!

Darrell Hair calls Muttiah Muralitharan a chucker

 

I was sitting with a Sri-Lankan friend in an area just back from Bay 13 where it was mostly Sri-Lankan fans, the conversations that got louder and angrier as it became clear that Umpire Darrell Hair was calling Muralitharan for throwing only added to the drama of what was one of the most memorable cricket controversies in the recent history of the game. It’s the drama that can only come from an incident that happens in a split-second across a five-day game and is irrevocably written into the history of the sport.

So it was with some surprise that I read Greg Baum’s article in The Age today where he’s quoted as saying, in regards to today’s Boxing Day Test…

 

Australia, though fragile, has taken some hesitant steps – in every way baby – towards recovery. But it is playing this match and series for the first time in the shadow of its own IPL, the massively over-hyped Big Bash League. Its only indisputable effect yet is to isolate this Test series in the program, meaning a man is either playing five-day cricket or five-minute cricket. Still Cricket Australia has the cheek to call it a system.

 

It’s a fair call, the timing of the games themselves is questionable. Pretty much an hour after the end of tomorrows second day’s play at the MCG the first match of the third round of BBL games will kick off. Nevertheless, I don’t think having a T20 League in Australia detracts from the longer version of the game… the sort of Test match moments I’ve described above are all the more unique and exciting because of the history of Test match cricket and the length of each game, with a controversial no-ball call able to change the course of a five-day match.

In the twenty-over game, it’s pretty much a three-hour slogfest where, like in the 50-over version most of the excitement comes down to the last quarter of the match.

What does any of this have to do with me? Well because I’ve spent the last three months working on the three-hour slogfest form of the game.

 

More promotion for the “massively over-hyped Big Bash League”

 

Check out the KFC T20 Big Bash League and the eight team sites:

 

Also, it would be amiss of me not to mention:

 


KFC T20 Big Bash League mobile app

More hype

 

Also big thanks to Sam W for writing the API for the mobile apps.

Anyway, that’s enough hype (don’t forget to download the app!). If anything I think the critics should be happy the BBL is on again Tuesday night, given Australia’s recent form, there’s probably a good chance the Test match will be finished by then anyway. In the meantime, you should download and rate the app. :D

 

LinkedInDiggRedditTumblrGoogle GmailPrintFriendlyEmailShare

Shiny new blog things

Hope you all like the blog update: shiny new theme, widgets, share links and some analytics. If nothing else, this blog has been an excellent exercise in finding out just how much awesome you can build using WordPress and without writing a single line of code.

Perhaps next week I can run a competition to see who can guess exactly how many plugins I’m using.

Quite often I’m asked, “what exactly is it you do at work?”, I take this as an indication that what I do is so complex that few mortals can comprehend the answer. To try and make it easier, I found a picture that best describes my daily function as a Sitecore Paladin.

Smiting thy CMS bugs

In Sitecore, certification is only the first step. The picture above shows what I do at work on a daily basis, right down to the horse and the hordes of evil, it’s also allows me to end this blog post with; I’m on a horse.

LinkedInDiggRedditTumblrGoogle GmailPrintFriendlyEmailShare

Declaring war on hay fever

After referring a few people to this product and getting some great feedback, I thought I’d share with you all, my miracle cure for hay fever.

Hay fever, or allergic rhinitis as Wikipedia refers to it, is a general allergy to Australia in spring time. Usually in individuals suffering from it, the symptoms include itchy eyes, runny nose and waking up feeling like you’ve spent the night with Lindsay Lohan, Amy Winehouse and Mike Tyson. This week I managed to actually tear a contact lense whilst rubbing my eyes due to hayfever symptoms, whilst I’m not trying to compare myself to Chuck Norris, you have to admit that’s pretty extreme.

Even the Bee Gees sang about it

There are many suggested ways for dealing with hay fever, the majority of which I’ve found ineffective.

  • Antihistamines; commonly purchased over-the-shelf pharmacy products such as Telfast, Zyrtec, Clarityne and so on. All guaranteed to leave you feeling every more tired in the morning. While they might be effective for relief of symptoms during the day, and some may be non-drowsy, after a while I couldn’t deal with the tiredness anymore.
  • Decongestants; nice in theory but I don’t think anyone wants to be tweaking for three months straight. Comes with a mild side effect of stroke due to bleeding in the brain, this may impair your ability to live.
  • Avoiding pollen; this is a great solution for people who don’t breathe. Or perhaps we need to think outside the square a little, how about we modify all the fucking grass in the world so we’re no longer allergic to it? Think I’m kidding?

    GRASS KILLAH

  • Desensitising injections; I have to admit I don’t know too much about this but you have to get a lot of injections, every year… and it stops working after a few years. The first two comments on this page are gold.
  • Steroids; it works, just do it. It’s called Budesonide, sold in pharmacies as Rhinocort Hayfever. Unfortunately it can get quite expensive but for most people it should only be for a few months, a few pumps up your nose each night and most of your symptoms should be taken care of for the next day. If the thought of taking steroids everyday doesn’t appeal to you, well rest assured it’s only a very, very small amount and all the information pamphlets from AstraZeneca say you’ll be fine. Really. In case you don’t believe me though, these are the worst side effects from budesonide from Wikipedia.

Budesonide may cause:

  • nose irritation or burning
  • bleeding or sores in the nose
  • lightheadedness
  • upset stomach
  • cough
  • hoarseness
  • dry mouth
  • rash
  • sore throat
  • bad taste in mouth
  • change in mucus color

In addition the following symptoms should be reported immediately:

  • difficulty breathing or swelling of the face
  • white patches in the throat, mouth, or nose
  • irregular menstrual periods
  • severe acne

rarely, behavioral changes—when these do occur, they seem to mostly affect children.

I think I can live with some breathing difficulties, horseness and irregular menstrual swelling that will mostly affect children, ANYTHING that actually takes care of the symptoms and allows me wake up in the mornings with some energy.

Disclaimers:

  • I was not paid a commission, fee or reimbursement of any kind to write this blog post on behalf of AstraZeneca Australia Pty Ltd or its affiliates.
  • Whilst I may have acted in the role of fire warden during my career which included training in dealing with a chemical, radiological and biological weapons attack upon the Victorian Public Service, I am not and do not profess to be a trained or qualified medical practitioner. You should seek qualified medical advice before spraying steroids up your nose every day.
  • I have never spent the night with Lindsay Lohan or Amy Winehouse.
LinkedInDiggRedditTumblrGoogle GmailPrintFriendlyEmailShare

October 2010, an update!

So a year on from starting at IE, what’s news? Besides spring and the joy of hayfever again, I thought I’d give a run down on what’s been keeping me busy.

Hoyts.com.au and hoyts.co.nz; the website for the cinema chain that operates here and in NZ is both a business and technical challenge on many levels. Dealing with external vendors, multiple stakeholders and a codebase that was far from Sitecore best practice has been a learning experience. In the year since we’ve managed to put live a home page redesign, regular maintenance updates and bug fixes, and most importantly; the new rewards program which is going strong.

Hoyts Corporate Australia and New Zealand; architecturally what should have been a fairly straight-forward exercise to create a ‘microsite’ running off a main site presented it’s own challenges when working around some publishing booby traps left by the previous developers. Also learnt some lessons about working with a multi-site Sitecore installation.

Hoyts Mobile Australia and New Zealand; a couple of brand new Hoyts websites, no Sitecore integration. Designed to replace an older WAP mobile site, the new mobile website incorporates some of the latest HTML5 and CSS3 techniques to streamline front-end development. Server side, it was awesome to work with MVC2, not having done any MVC development for a while, it took a while to get used to again.

Other stuff about mobile development and this site:

Maxxia NZ; just to make sure Sitecore isn’t the only CMS I work on, I did Level 1 and 2 Umbraco certification. Just in time to build the Maxxia NZ website. Nothing notable about the site itself, from the point of view of CMS’s though, it’s refreshing to work with a different CMS and one that really is bare-bones compared to Sitecore. Highly recommended for small/mid-level organisations looking for a .Net CMS, or for anyone not looking to pay for Sitecore’s full feature set.

IE Website; much to the amusement of the other .Net developers, I also put my hand up to play with WordPress. I’m not sure I’d call myself a WordPress guru, but I did get to play with a couple of cool new features of WordPress; custom post types and taxonomies.

Along the way, I’ve also learnt a hell of a lot more about front-end development than I expected. I’d even say I know my way around Photoshop and creating non-table layouts in CSS… it’s only taken me a few years to catch up to everyone else on this.

Finally, I couldn’t finish this post without giving a shout out to all the peeps at IE. They’re pretty sweet ;)

Special kudos to the .Net team there, the dorks… and Mig’s mum. She’s super sweet. ;)

LinkedInDiggRedditTumblrGoogle GmailPrintFriendlyEmailShare

Using Sitecore.NVelocity library to create email templates

If you find yourself sending emails from a Sitecore application and you don’t want to generate the emails in code-behind, an easy way to create basic email templates is by using the NVelocity library built into Sitecore API.

What is NVelocity?

NVelocity is a .Net port of the popular template engine Velocity written in Java. The .Net port is mostly recently maintained by the guys at Castle Project.

Sitecore’s NVelocity library

This is probably a bit older but still works fine for basic email templates.

One problem I repeatedly ran into, with both the Sitecore NVelocity library and the Castle Project NVelocity implementation was loading template files from the file system. After wasting a couple of hours on this (repeatedly the template file could not be found, no matter what I tried) I gave up and loaded the templates into memory using a TextReader and then applied the template using VelocityHelper.Evaluate.

Unfortunately there is nowhere near enough documentation online about NVelocity issues with reading template files, or the Sitecore NVelocity library to get much help with this problem. Basically any call to load a template file (using GetTemplate) would result in a ResourceNotFoundException.

Example of a NVelocity email template

Thank you for your registration

Your username was: $username

The delivery details you gave were:

Address: $address
City: $city
State: $state

Thank you

The file above should be saved somewhere as a .vm file, for example template1.vm. This is a basic email template for NVelocity, you use the dollar sign followed by a variable name to define somewhere that content is replaced, so in the example ‘username’, ‘address’, ‘city’ and ‘state’ are template data values.

Replacing content

This is the implementation that worked for me.

private void SendEmail()
{
 System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
 System.Text.StringBuilder sb = new System.Text.StringBuilder();
 string filePath = HttpContext.Current.Server.MapPath("/common/templates/template1.vm");
 string template;

 if (!System.IO.File.Exists(filePath))
 throw new ApplicationException("Could not find email template file: " + filePath);

 System.IO.TextReader reader = new System.IO.StreamReader(filePath);
 template = reader.ReadToEnd();

 NVelocity.VelocityContext context = new NVelocity.VelocityContext();

 context.Put("username", "hansolo");
 context.Put("address", "1337 Isme Street");
 context.Put("city", "Built On Rock N' Roll");
 context.Put("state", "VIC");

 message.From = new MailAddress("web@testsender.com");
 message.To.Add("recipient@test.com");
 message.Subject = "Test of NVelocity as email templating engine";
 message.IsBodyHtml = false;

 NVelocity.App.Velocity.Init();
 message.Body = Sitecore.Text.NVelocity.VelocityHelper.Evaluate(context, template, "example-template-replace");

 MainUtil.SendMail(message);            
}

What this does is takes the contents of the template1.vm file and replace all the values found inside using the values defined in the context.Put statements. Note these values don’t need to include the dollar sign.

Calling VelocityHelper.Evaluate and passing in a NVelocity VelocityContext, in-memory template (read from file system using System.IO) and log name will return the contents of the template with specified values replaced from the context passed in.

Output Email body

From the example above this is the body of the email sent.

Thank you for your registration

Your username was: wonaldng

The delivery details you gave were:

Address: 1337 Isme Street
City: Built On Rock N' Roll
State: VIC

Thank you

Useful links

Castle Project: Using NVelocity – the most referenced tutorial for this library.

Velocity @ Apache.org – Java version reference documentation.

Velocity is, on it’s own, a very strong template engine. In an advanced situation it can do a lot more than just replacing variables in a template, including things like program-control and conditional statements.

Hope this saves you some time if you ever have to go down this path.

LinkedInDiggRedditTumblrGoogle GmailPrintFriendlyEmailShare

Scripting data in SQL 2008 Enterprise Manager

Did you know this incredibly useful feature now comes with SQL 2008′s Enterprise Manager? I haven’t tested it with multiple tables that have complex relationships, but if you want to script data with more complexity, you should consider Red Gate’s SQL Data Compare.

Script Data in MS SQL Server 2008 Database Tables using Generate SQL Server Script Wizard

If neither is feasible, one of the most popular, creative and often-overlooked options is to use Microsoft Excel and write a formula to generate INSERT statements. Drag the cell corner to copy this formula for multiple rows. There are also many other code generation possibilities from this technique if you think creatively.

SQL Queries from Excel

Scripting SQL data is easy to do, make it part of your build process! Stick it in SVN and you bring version control to your database development.

LinkedInDiggRedditTumblrGoogle GmailPrintFriendlyEmailShare

Bored of Lorem Ipsum?

Check out BlindTextGenerator, a site that will generate dummy text for you with a number of exciting options.

I’m sure designers will get excited about this… boring people that they are. :p

LinkedInDiggRedditTumblrGoogle GmailPrintFriendlyEmailShare

SQL 2008: Saving changes is not permitted

Ran across a small issue with SQL Server 2008 Management Studio when attempting to add an identity column to a table which didn’t have one. As this action requires the entire table to be rebuilt (which Management Studio does behind-the-scenes), I was presented with an error message saying that ‘Saving changes is not permitted’.

By default in Management Studio 2008, you’re prevented from saving changes in the designer that require table re-creation. You can turn off this setting easily and the blog post at this link shows you how. :-)

SQL Server 2008 Designer Behavior Change: Saving Changes Not Permitted

Hopefully this might save you fifteen minutes one day.

LinkedInDiggRedditTumblrGoogle GmailPrintFriendlyEmailShare

Why I deserve a Google Wave invite

Dear Google,

I believe I deserve a Google Wave invite far more than the other people who are desperately begging all over the ‘net, turning every tech forum into a gigantic, online slum for the Wave-deprived. Here are a list of reasons why I expect Lars Rasmussen to personally deliver my invite to me in Melbourne.

  • During the early days of Gmail beta I offered Gmail invites to friends who were using Hotmail for a small fee. This shows a history of taking advantage of Google’s ingenuity for my own personal profit and if given access I promise to do the same with Wave invites.
  • This included selling one to my own sister; “1 gig of storage for your emails doesn’t come cheap!”
  • Very few people know, or will admit, that I am actually the person responsible for the two o’s in the middle of ‘Google’. ;)
  • Sergey Brin lost the company to me in a game of rock-paper-scissors in 1999 but I was too busy becoming the world’s best Counterstrike player to take ownership of the domain.
  • Wave is useless if you don’t have friends, I have created more fake accounts to add to my friends list on Facebook than the average developer :p

Seriously, it does look very exciting, but personally I’m more interested in the mythical GDrive project and when Google think they might release this. With Microsoft now offering 25 gig free on Windows Live Skydrive, I don’t know how much longer I can wait for Google to make their offering in this space public.

PS. My google username is ronald80. Important I add that so you know where to send my invite!

LinkedInDiggRedditTumblrGoogle GmailPrintFriendlyEmailShare

ADO.Net performance: ExecuteReader vs ExecuteNonQuery vs ExecuteScalar

Just re-linking a two year old blog post with performance advice that every developer using ADO.Net should read.

ExecuteReader, ExecuteNonQuery, ExecuteScalar … When to use What ?

Further notes:

  • Here is a good example (post #3) of how to implement OUTPUT parameters in a stored procedure using ExecuteNonQuery(), ignore post #2, he doesn’t know what he’s talking about.
  • Another example with just the ADO.Net side from MSDN: Executing a Command and Accessing Output Parameters.
  • The ExecuteNonQuery method returns the number of rows affected by the query (typically for Insert, Update, or Delete operations). From the MSDN page above.
LinkedInDiggRedditTumblrGoogle GmailPrintFriendlyEmailShare

Switch to our mobile site