Monday, 25 October 2010

virtuwell launches

Note: The opinions expressed in this post (and all others) are my own and are not necessarily representative of those of AKQA, HealthPartners or any party involved in virtuwell. Please read this press release for more information.

Today is a good day. This morning, at around 7am PST, HealthPartners launched an application called virtuwell. It was created in partnership with AKQA (the company I work for) over the last 15 months or so.

The premise of the application is simple. If you or your kids are feeling sick and you are short of time, or perhaps if you don't have insurance, then virtuwell may be for you. It offers online diagnosis and treatment (including prescriptions) at a very affordable cost - it may even be covered by your health plan.

As Technical Architect, virtuwell was definitely the most challenging project of my career. We were responsible for developing the entire application, and had to meet the strict security and quality requirements that come hand in hand with a healthcare app without sacrificing a clean, friendly user interface. On top of that, I've had to master an entirely new technology stack. We have all learned a lot.

As a recent arrival in the USA, I have barely began to understand the challenges facing the health system here, but I am proud to have been part of a passionate and dedicated team that has made strides towards making healthcare more accessible to all.

It is also my mother's birthday.

As I said earlier, today is a good day.

Friday, 18 June 2010

Alfresco 3.1.1 and paragraph tags

Right now I am getting to grips with the finer details of an Alfresco v3.1.1 installation. It has been fun*.

Today's quest was all about stopping the TinyMCE plugin that Alfresco uses from wrapping absolutely everything in a <p> tag. Usually I love <p> tags. Way more than I love <br>tags. But not all content entered through a CMS should be wrapped in them.

I found this bug report, which mentioned a rather drastic way of fixing it, but also gave some clues as to another, less invasive, way. The hunt was on. A few hours later (it would have been a few minutes if I had thought to clear my browser cache), I came up with the following:

(DISCLAIMER: The following changes will be lost if you upgrade/replace your Alfresco installation. But since this issue doesn't occur in any other version of Alfresco, that should be ok.)

Step 1: Open up <tomcat>/webapps/alfresco/scripts/ajax/xforms.js

Step 2: Find the definition of alfresco.constants.TINY_MCE_DEFAULT_SETTINGS (it is near the end) and change it to be:

alfresco.constants.TINY_MCE_DEFAULT_SETTINGS =
{
theme: "advanced",
mode: "exact",
plugins: alfresco.constants.TINY_MCE_DEFAULT_PLUGINS,
width: -1,
height: -1,
auto_resize: false,
force_p_newlines: false,
encoding: "UTF-8",
entity_encoding: "raw",
add_unload_trigger: false,
add_form_submit_trigger: false,
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_buttons1: "",
theme_advanced_buttons2: "",
theme_advanced_buttons3: "",
urlconverter_callback: "alfresco_TinyMCE_urlconverter_callback",
file_browser_callback: "alfresco_TinyMCE_file_browser_callback",
forced_root_block: false,
force_br_newlines: true
};


Note the two last lines.

When you are done, all you need to do is clear your browser's cache, and go edit some web content in Alfresco. Anything you create from now on will no longer be wrapped in the usually wonderful <p> tags.

*This depends on your definition of fun.

Wednesday, 16 June 2010

New version of FBConnectAuth released: 1.0

One year on, I've just released a minor enhancement to the tiny open source project I created called FBConnectAuth - Facebook Connect Authentication for ASP.NET.

This release contains two enhancements:
  • It supports Facebook's new Graph API Javscript SDK (but remains backwards compatible)
  • It works in partially trusted environments
It is specifically targeted at .NET 2.0 (as was the previous release) for the benefit of those who don't have control over their production environment.

Interestingly, I noticed that the new Graph API requires the use of the Facebook Application's "Application ID", rather than "API Key". This means that an example of using FBConnectAuth looks with the Graph API like this:


//Note this is the "app id", not "api Key"
FBConnectAuthentication auth = new FBConnectAuthentication(appId,appSecret);
if (auth.Validate() != ValidationState.Valid)
{
// The request does not contain the details
// of a valid Facebook connect session.
// You'll probably want to throw an error here.
}
else
{
FBConnectSession fbSession = auth.GetSession();

string userId = fbSession.UserID;
string sessionKey = fbSession.SessionKey;

//This is the Graph API access token
//(available only when using the Graph API)
string accessToken = fbSession.AccessToken;

// The above values can now be used to communicate
// with Facebook on behalf of your user,
// perhaps using the Facebook Developer Toolkit

// The expiry time and session secret is also available.
}


If you are interested, go take a look.

Tuesday, 11 May 2010

Random Grails tip: Using a DB reserved word as a domain class name in Grails

We recently came across a situation where we couldn't our Grails app was failing because it was trying to create a table with the name of 'Condition', which turns out to be a reserved word in MySQL... We worked around it by changing the name of the table to 'conditions' by using the Grails ORM DSL, but it turns out there is another way.

Backtick to the rescue...
Hibernate allows you to use backticks (`) to indicate that a name should be escaped - you can simply use this in your grails mapping. For example, we could have used:


class Condition {
String property1
String property2
...

static mapping = {
table '`condition`'
...
}
}


To be honest, I'm not sure why Grails and/or hibernate don't escape all table and column names by default (I'm sure there is a good reason) - there is an open JIRA issue in Grails around this very problem...

Friday, 30 April 2010

The location of the User Profile for Network Service on Windows Server 2008 & 7

This kind of thing should be easy to find, but I couldn't hunt it down on google. So to save someone else some pain, here it is - the location of the %USERPROFILE% / home directory for the NT AUTHORITY\NetworkService user:

(drum roll...)

%systemroot%\ServiceProfiles\NetworkService

which usually translates as:

c:\Windows\ServiceProfiles\NetworkService

The user profiles for other "well known" service accounts (such as LocalService) are siblings of this directory.

I hope that saves someone some time...

Wednesday, 23 December 2009

2009 - A good year...

2009 draws to a close, and it just struck me what a phenomenal year it has been.

This year I:

  • Traveled through Morocco
  • Visited Paris
  • Got engaged!
  • Drove across the USA, from New York to California, via Nashville, New Orleans, Austin and Roswell
  • Moved to San Francisco
  • Helped AKQA and Fiat win loads of awards for eco:Drive
  • Hung out with a supermodel, and got paid for it.
  • Got interviewed by Wired Magazine, along with a cool photo shoot.
  • Joined a great team at AKQA SF, and helped make it even greater
  • Released FBConnectAuth, a tiny open source component for ASP.NET that helps with Facebook Connect authentication.
  • Met someone who was actually using FBConnectAuth.
  • Got to live in a great house in SF, in an awesome neighborhood.
  • Learnt to speak American.
  • Got to learn Groovy and Grails
  • Worked (and still working) on a massive (and still super-secret) grails project
  • Earned a new nickname ("Piping Hot" - for my terrible Halo skills)
  • Made new friends with funny accents.

I have a lot to be thankful for.

I hope you all (that's you mum) have a wonderful 2010!

Happy Holidays (see, check out my American skills)

Thursday, 25 June 2009

On winning...

18 months ago a few of us started work on something rather special. 12 hours ago, we won the advertising industry's biggest award.

It is sometimes the ones who shout the loudest that get the praise, so I want to take a moment to thank those that worked incredibly hard on an amazing product. To the small core of us that sat in that cosy, sunny room, developing a language of our own: Mark, Harald, Stuart (who pretty much became my wife), James, Richard S, Tristan, Martin, Zahid, Kevin - you rock! We can now, officially, get a woop woop.

To the guys who worked so closely with us the whole time, crafting words, designing t-shirts and making everything look wonderful: Chris, Richard B, Andy - you guys were the best creative team a bunch of geeks could have ever asked for.

Alison, you made the complicated simple. James and Nick, the branding was amazing - the video was a masterpiece.

Thanks to Bonnie, Eli and Livia for kicking things off and keeping them going. Deep gratitude to Neville and Miriam for all your advice.

And not forgetting our client - Luis. Without such a visionary and passionate figure sitting on the other side of the table, none of this would have happened.

That is enough gushing for now - I'm off to bed. Ciao!