Sunday, February 26, 2012

Gradle Grails Plugin for Grails 2.0.x

I love the Grails Framework but sometimes I prefer to build my Grails projects using Gradle. I am just happier that way.

I have just started upgrading one of our projects to Grails 2.0.x and thought I would share what our build.gradle looks like.

Full build script can be found on Github. Enjoy!


Sunday, January 15, 2012

Retort to Paul Collier

Hi Paul,

Nigeria's current administration might have received a legitimate mandate but their actions since their ascent has been anything but.You only need look at the budget and its constituent executive and legislative expenditure which has incensed the masses, and is anything but responsible, to give you an idea of the reasons behind Nigerian's mistrust.

All we have heard from the government are the same tired platitudes of how our biggest problem as a nation is the subsidy. No problem however straight-forward has a single solution and at times the march to durable solutions begins with critical and radical reasoning. What we need are creative solutions but our leaders seem to be unwilling to solicit them or even consider suggestions all in the hope that the people will soon be distracted so they can get their way. Well, democracy is about listening and inclusion and Nigerians have begun to talk. Shouldn't our elected government listen?

The government claim to have offered palliatives but how does more buses after a hike in fuel prices help with the consequent price increase of everything from food, to power generation costs? Just so you can process and contextualise it, a fitting analogue to what the Nigerian government has done by artificially hiking the prices of petroleum products would be the UK government deciding without consultation and alternatives to scrap a service as vital as the NHS. Such an action would understandably be met by resistance, as its effects would be far-reaching. Fine-tuning the mechanics of the current subsidy regime with a view to increasing accountability and then working on solutions to fill the vacuum once it is eventually removed might have been the place to start.

As a Nigerian who has seen both sides of the coin I know the pangs of Nigerians and understand the mistrust. I have benefitted from appalling roads, the epileptic and largely DIY power supply and the abysmally funded education and health-care systems. Oh and did I mention the non-existent social security? To crown all this Nigerians have increasingly and of recent been served incessant helpings of violence by politically motivated mercenaries. In the years past there has been trillions spent on white elephant projects only for those funds to be trousered by the ruling elite and their cohorts so is it any surprise we don't trust them? If they couldn't deliver with all those trillions what good will a paltry $8bn a year do?

At a time like this what we would love to hear from intelligent media isn't that Nigerians are being manipulated. It is patronising but also lazy reasoning to think that Nigerians who have had to contend with 50 years of suffering and smiling are incapable of articulating how they feel. I think what good folk like yourself need to be doing is actually gaining a firm grasp of the issues at play and, if you are so inclined, proffering solutions.

Nigerians are among the most resilient and resourceful people I know. It is time our leaders stopped taking advantage of that great trait and started doing their jobs.

Saturday, December 03, 2011

Musings on improving customer experience at MTN and MTN Connect centres

Last week I made my usual trip to the connect center for MTN. As usual the staff were courteous and helpful but I came away unhappy.


It is my belief that some of the reasons that customers come in to the center can be better addressed via a careful blend of self service and better empowered customer service personnel.


On the days I have visited you get customers who have come in for a varying number of reasons from topping up their prepaid accounts to registering their SIM and signing up to one of the increasingly popular BlackBerry bundles.


It turns out that with careful construction of self service applications MTN could reduce the number of customers feeling the need to come in. Take a scenario where a customer needs to top up their account: they should be able to do so at the now ubiquitous ATMs in major city centers.


Having more staff empowered with smartphones running key applications that, for example, allow them to take card payments for a vareity of services - it is a mobile communications company afterall - would help manage the load at the connect centers. Second level customer service operatives can then better spend their time helping customers with more complex requirements. This would be consistent with the level of customer experience you would get at an Apple Store or Wagamama where tills are attached to roving and attentive customer service personnel.


My pet peeve at the moment is my current issue where I need a statement of expenditure on my prepaid mobile account for accounting purposes. Front line staff at these locations are not empowered to solve my problem and as a customer there are no self service options. So I am stuck with the lengthy and soul destroying process of writing a letter along with applying for a police report just to get a statement on my account.


I am hopeful that a customer-focused someone in the MTN hierarchy reads this and sets the train in place to make the necessary adjustments for improved customer experience.


Peace and Love.



Published with Blogger-droid v2.0.1

Monday, August 01, 2011

Enabling Xpather Firefox Plugin in Firefox 5 on Windows 7 after upgrading from Firefox 3.x

I have been messing around with the Selenium Testing. Again. I think if you have spent any amount of time trying to construct functional tests for your web applications you will have found that Firefox developer tools like the Xpather plugin indispensable. Well, I do. My problem recently was the fact that with an upgrade to Firefox 5 from 3.x this most useful of plugins was disabled.

Its original developer Viktor Zigo, much respect for his efforts, is taking time off so while wondering what to do to get it working in Firefox 5, I stumbled upon the plugin reviews
page and a particular comment stood out for me. It led me to a useful solution on how to get this plugin enabled on Firefox 5. Without further ado, here it is.

This part of the post assumes that you had the plugin installed and working previously in Firefox 3.x and are on Windows 7.


  • To get it working update the install.rdf file which can be found in your Windows 7 install at the following location:
    \Users\\AppData\Roaming\Mozilla\Firefox\Profiles\lszvse7r.default\extensions\{636fd8b0-ce2b-4e00-b812-2afbe77ee899}
    Do adjust your username and actual profile directory to take into account your install specifics.
  • Restart your Firefox and Xpather 1.4.5 should be now be re-enabled.


Thursday, June 30, 2011

WebDriver querying Text Nodes - Lessons learnt

Earlier on today I ran into an odd problem while using WebDriver as part of my ongoing foray into Cucumber as a DSL. I was to trying write automated tests that verified that a link (a tag) had a text node. I could locate the link by an xpath locator.

I can hear you ask why this should be a problem. It was because the link looked as follows:


It turns out the usual WebDriver incantations along the lines of findElement(By.xpath("arbitrary-xpath")).getText() was returning nothing for the link's text. I looked around for a while and found that the only solution I had was to look things up via Javascript seeing as there were no ids to fallback on.

In the end it worked out that document.evaluate became the saviour of the day, since it allowed me to make xpath queries on a document. The result is a java step definition and cucumber feature file that look as follows:






UPDATE: Changed the step definition file so that the xpath lookup is done in WebDriver instead of in the javascript seeing as xpath lookups cannot be relied upon in Internet Explorer.

I suppose you could argue that the html could be changed to be better. True, but atimes that might not be an option. The purists will argue as they do here that it isn't a feature that should be provided by WebDriver but I think it would help to have a way of traversing the DOM once you have looked up an element. I should like to read about other creative solutions to a problem of this nature.

Monday, April 18, 2011

Nigeria Decides Results so far

Just got hold of the data for this weekend's Nigeria Presidential elections from the electoral body's website and I thought I'd share the same data in graphical form.

Enjoy.


All Party Votes so far - Front Runners



All Party Total Votes so far


Katsina

Rivers

Delta

Zamfara

Niger

Abia

Kano

Bauchi

Benue

Bayelsa

Kwara

Ebonyi

Plateau

Kaduna

Edo

Nasarawa

Oyo

Ekiti

Imo

Akwa Ibom

Sokoto

Lagos

Anambra

Kogi

Osun

Ondo

Enugu

FCT

Ogun

Tuesday, March 29, 2011

Neighbourhood surgeries - how can mine be improved?

This just feels like it could be better.

So I call to make an appointment at the surgery this morning and am told all morning slots are gone. So what about afternoon slots then?
Well, new slots are released at 2.30pm and you you can't book till then. This is after spending about 15 minutes in an automated telephone queue. Did I tell you that I hate them? What is the guarantee that I will be allotted a spot if I call in at 2.30pm? What if everyone also wants to call in at the same time? Sounds like a lottery arrangement. On a health service. BAD.

In the end I think an automated service should be put in place. I also think surgeries firstly should operate like normal businesses. What do the folks at the big golden arches do when loads of customers consistently walk through the door at an outlet? They scale up the site by hiring new hands and when this doesn't help they open a new one nearby. What has my friendly neighbourhood surgery done? They have resorted to handing out a 0844 number along with instituting an appointment lottery scheme. BAD.

In the end of the day, the lady on the other end of the line offers to have a doctor phone in some advice sometime in the day. She has made a judgement call that the condition doesn't warrant my being bothered to see a doctor. I am grateful for the offer but there is something faintly worrying about some lady at the other end of the phone deciding over the state of a surgery client's health (or access they get) without the proper experience. Might I add without the training for it. BAD.

Three strikes!

Enough ranting for one morning. I just thought I'd let it all out.

Be well.


UPDATE: They have called me back with an appointment. Result! That usually helps but I can't help thinking that some other guy might have been unlucky this time.


Sunday, March 06, 2011

Cucumber DSL for Selenium Testing - Take 2

After poking around with Cucumber, Cuke4Duke and Selenium, I liked what I saw and started digging around for more interesting bits. I have moved from selenium 1 to Webdriver(Selenium 2).

One of the minor problems I have had so far is that the browser windows don't get closed after my tests completed.

I saw a number of attempts at solving this including having a tagged @After hook on the last scenario in the last Feature. None of them really jumped out at me until I read a question to the group and that led me to give a JVM shutdown hooks a go (equivalent to Kernel#at_exit in Ruby land). That seems to work quite well and lives well away from the features and steps making for cleaner code. It also means that we will have a clean suite of features that don't get polluted by technical detail.


Do take a look at the full thing on GitHub. Let me know what you think.


Tuesday, March 01, 2011

Cucumber DSL for Selenium Testing - Take 1

I have had a few hours to play with Cucumber tests using cuke4duke by Aslak Hellesøy, a very useful addon to Cucumber which makes it possible to write step definitions in several JVM languages. I have gotten it to the point where I can write Cucumber Features and Scenarios for very basic tests. I hope to write in more detail about my full findings and thoughts later on.

I have set it up so that it can be built in Maven. The pom.xml file can be located here. The project structure is pretty simple and can be structured as follows:



|-features
|-brandhub.feature (source can be found here
|-src
|-test
|-java
|-sample
|-BrandHubSteps.java (full source can be found here)
|-pom.xml (source can be found here)



All you then need to do once you have the above structure is run mvn clean integration-test and you should be on your way. Your test results can be found in target/surefire-reports. I have included html and junit reports. You will also find that there is a pretty console log of your features and your scenarios.

Please note that the first time you run you will need to append the following system property to your maven command line:

-Dcucumber.installGems=true

This will make sure that the cuke4duke Ruby gem and its dependencies are installed. If you don't do this, you will most definitely get an error along the lines of:

Error opening script file: /.jruby/bin/cuke4duke

Let me know what you think.

Peace and Love.

Tuesday, January 18, 2011

Thoughts on collaborative consumption

Last night I read the excerpts from an interesting book on parenting, the Chinese mother way and thought it was an interesting book and wanted to read the full thing.

My dilemma? Buy or borrow. Now don't get me wrong, it is an interesting book now but I know it won't be once I am done reading it.
THe Buy or Borrow question would have been easy one to answer if we had parity in the utility of digital and conventional assets.

With a 'real' book you could easily buy it and resell it online without any qualms. You could loan it to a friend of family member in a heartbeat.
Not so with a digital/e-book. There is a lending feature on Amazon that allows you to lend out books for up to 14 days but is not enabled on all books.
Well what if I wanted to resell an eBook after I had read it? How does one put a value on a transaction like that? Is anyone even considering that model?

These questions have now come to the forefront of my consciousness after I watched Rachel Botsman's TED talk on collaborative consumption. Is anyone thinking along the same lines?
I'll buy the digital version of the book because its lighter and is a greener choice but I'd like to get more utility AND value from doing so.

Thursday, January 06, 2011

Oracle JDBC Driver wahala - the conclusion.

Yesterday, I told you about my ordeal with the Oracle JDBC Driver and the cryptic Non supported SQL92 token at position: x message I was getting.

Turns out that the problem was that when running the script in Continuous Integration builds, embedded SQL92 syntax escape processing was enabled by default.

In the end, the solution was to turn off escape processing so that code behaviour is the same whether run via Continuous Integration or as a standalone SQL script in SQL Developer.

In conclusion, I still think the guys at Oracle should implement better error messages, as this would have saved me loads of time.

Be well.

Wednesday, January 05, 2011

Oracle JDBC Driver wahala.

Happy New Year, folks. My year has started rather eventfully, as I have spent the most productive part of my day trying to resolve a problem with a DDL statement being executed as part of a product CI build.

The problem? There is a stored procedure on a project that I am able to run successfully via Oracle SQL Developer but have been unable to get working as part of the build. Currently, the Oracle JDBC Driver spits out the following nondescript SQL exception message: Non supported SQL92 token at position: x. X in this case seems to be some arbitrary location in the script ( this currently resolves to end of the file, meaning it has been misdiagnosed), which I cannot decipher as being an invalid token.

What would have been useful in the exception message, and I hark back to the days of Oracle SQL*plus, is a line number and column number with some mention of the errant token.

I am still trying to manually debug this problem in the hope that I am able to resolve it, as no successful build means no check-in. My suspicion is that the driver is doing something nasty or is unable to properly deal with a token that should ordinarily pose no problem.

I am using a v10.x Driver.

If you are reading this, have you encountered a problem like this recently? Any light you can shed is appreciated.


Thanks

Friday, December 24, 2010

Holiday Thoughts

This is just wishing everyone Happy Holidays (Christmas and New Year). Its been a good year, a hard year. I am glad that we have come to this point in the year. I am looking forward with a lot of excitement to all the fun things that can be achieved in 2011.

See you on the other side!

Saturday, November 13, 2010

British Gas nightmare - resolved

Things happened very quickly after I posted this and tweeted about it. I got followed by the proactive folks at British Gas customer relations department. They took up the matter and ensured that an investigation was indeed carried out.

Turns out that, as I suspected, there was a systemic error that meant I was billed when I shouldn't have been. So where telephone calls and emails failed to get me a foot in the door, blogging (macro and micro) kicked the door in. In the end, I got the bill rescinded and also an apology for my troubles. All is well again in the world.

It is an encouraging trend that folks at British Gas are listening to and talking with the groundswell. I think more companies need to be doing so. They also need to ensure that conventional customer service channels are a lot less of a pain to use. A happy customer is a repeat customer.

  

Saturday, November 06, 2010

British Gas nightmare

For weeks now I have been doing  battle with British Gas Home Care regarding an engineer visit. Here's my story.

We moved into our current home just before autumn kicked in and it was still warm. As the days started getting colder we discovered that we didn't know how to work the heating. After a few botched attempts at looking into ourselves we decided it was best to get folks whose job it was. So we called British Gas and explained the problem. They told us we there was a home care agreement under the previous occupant's name and if we wanted to take out a similar one, we said yes and asked them to close the other account to which they responded that only the owner could do so. We were informed that an engineer would look into the issue and carry out tests on our boiler and heating system to ensure that they could still find parts for them.

Engineer shows up and much to our shame, as it turns out, the thermostat was off. He turned it back on, did his tests and went on his way.
Fast forward a few weeks and I get a pay-now-or-else letter saying I owe £210 for services rendered by British Gas. I call them up and  try to ascertain what the bill was in relation to. The operative informs me that it is with regard to the engineer's visit. I inform him that we have a care agreement in place. He says it has been cancelled. I say by whom? He says he needs to get back to me. But he demands that I pay. That irks me and I tell him to find out why my account has been cancelled and that I think £210 is a lot to pay for someone turning on a thermostat. We have a stalemate and he says I might have court proceedings brought against me to which I respond: bring it!

A few weeks after that I get the second letter demanding payment. This is after I had reinstated the care agreement on being told by another operative that it was closed due to an error by British Gas.
 
On getting this letter, I decide that this is bullying. Corporate Goliath trying to trample on average David. It cannot be anything else, as had they taken time to look into the issue maybe they'd have found that I don't owe them. In the event that they needed to charge for the engineer's visit, as some companies do, £210 for an hour's work, if that, is no where near fair.

I have also received further communication relating to this dispute in form of a solicitor's letter urging me to pay or face a county court judgement and all the evil that brings. In response to this I have mailed the complaints department at British Gas and will be hoping that British Gas does what it should have done weeks ago and looks into this issue. I will be posting updates in the coming days and weeks.

All I can say is that from my experience, so far, it is becoming increasingly difficult for consumers to hold service providers accountable and easier for their rights to get trampled upon. I am one customer but on this occasion I have decided that on principle I will follow this to a logical conclusion and take on the giant that is British Gas. Hopefully, the values entrenched in British society will mean that there is a victory for common sense and the little guy.      

Thursday, September 16, 2010

Customer care rant

I was just thinking today about how sweet it would be to have self-service on things like booking a home installation or engineer visit.
You might ask why this is important but today a gas engineer was scheduled to take a look at the boiler (winter is in the winds) and our plans changed.
No one was going to be home. I had only one choice: get on the dog and bone and ask the company (one of Britain's corporate titans) to reschedule the appointment.

For anyone who has ever called to speak to customer care assistants for anything, it is dead time and you are paying for it.
And depending on the time of day and the load it could cost you an awful lot of time AND money.

My ideal scenario? How about if I was given the option to re-schedule the appointment online and not need to talk to anyone? I know some will say that there are folks who the online thing doesn't come naturally to. But I think those who can should be given the option to do things that way. I also think it would have saved me and the service provider time AND money, as the customer care assistant I spoke to could have spent his time trying to sign a new customer.


End of moan.

PS: Given that folks working within the day is almost now the norm, would it be so bad for service providers to have products that appealed to the market? Another rant. Another day.

Tuesday, July 20, 2010

Thoughts on EyeQL

Today we had a small challenge at work which revolved around taking certain changes from one of our code branches and merging them into another branch. Now the keyword here is certain.

One of the conventions we use at work is to have Atlassian JIRA ticket numbers as part of the commit comments. They came in handy today because all the changes that needed to be merged had ticket numbers associated with them.

The problem? An easy way to retrieve all the SVN revision numbers associated with those tickets so that we find it easy merge said revisions to the target branch. Luckily we have Atlassian Fisheye at work and with it comes an interesting DSL (EyeQL) for querying your codebase. I had know about it for sometime but didn't know where it could be used. This was such a case.

The following EyeQL query when run will return the revision numbers I was looking for:


select revisions
from dir /svn/directory/path
where comment =~ "^.*(JIRA-1|JIRA-2|JIRA-3).*$"
group by changeset
return revision


The query goes through all revisions currently indexed by Fisheye and retrieves the revision(s) grouped by changeset that have either or all of JIRA-1, JIRA-2 and JIRA-3 in their commit comments.

Armed with this list of revisions it was easy to go through and merge them from the source branch to the target branch.

We would like to hear your thoughts on whether you have been in similar shoes and how you have gone about solving your problem.

Thursday, June 10, 2010

Loving Spock Framework

I have been following the progress of the Spock Framework for sometime and today decided to take the plunge.

As a JUnit user and having used mocking frameworks like EasyMock and Mockito, I set to work trying to convert a test I had written earlier.

One of the things I found hard to get past was the need to inherit from a given class, namely the Specification. Once I had looked around the code and found that it was built to work in that way, I got down to it. I like the way in which tests are expressed.

I found the interactions/mocking slightly different, especially the syntax. I like the way in which you can use wild card matchers for parameters and number of calls but returning values from a mocked object's interactions was less than intuitive.

Where in the EasyMock world you would say something like


expect(mockedObject.calledMethod()).andReturn(value);


In Spock it would look something like the following


mockedObject.calledMethod() >> {value}


I am hoping that at some point there might be a different way to express that expectation as it currently looks a bit cryptic.

All in all I like that beyond your feature/test name you can self document tests to the extent that it becomes readable for non developers, so a heavy plus there. I also like the fact that IntelliJ and Maven all understand and can run Spock Specifications without any trouble.

In the coming days I will be using the Spock Framework a bit more, especially as I would love to discover other features like Unroll. Will let you know how I get on.

Peace and Love.

Friday, November 27, 2009

Installing couchdb on CentOS 5

Installing on CentOS 5 i386

(Note: COUCHDB-315 has an attached patch for the CouchDB README which adds instructions for RHEL 5.)

1. Install prerequisites. You will need EPEL for js and erlang (or build those from source).

yum install ncurses-devel openssl-devel icu libicu-devel js js-devel curl-devel erlang libtool gcc

You also require curl (7.19.7 worked for me).I had to build it locally though because of some weird libcomm_err.so missing dependency.

2. Install CouchDB

The configure line below is for 64-bit, adjust for your arch (or leave out --with-erlang if configure can find out for itself). You can use a release tarball instead of a checkout, in that case skip right to the ./confgure line.

svn checkout http://svn.apache.org/repos/asf/couchdb/trunk couchdb
cd couchdb
./bootstrap
./configure --with-erlang=/usr/lib/erlang/usr/include && make && make install

3. Edit config file to suit

vi /usr/local/etc/couchdb/local.ini

4. Create user, modify ownership and permissions

Create the couchdb user:

adduser -r --home /usr/local/var/lib/couchdb -M --shell /bin/bash --comment "CouchDB Administrator" couchdb

See the README for additional chown and chmod commands to run.

5. Launch! In console:

sudo -u couchdb couchdb

or as daemon:

sudo /usr/local/etc/rc.d/couchdb start

6. Run as daemon on start-up:

sudo ln -s /usr/local/etc/rc.d/couchdb /etc/init.d/couchdb
sudo chkconfig --add couchdb

Sunday, March 01, 2009

JQuery AutoComplete - Lessons Learnt

I can actually go to bed tonight after resolving my bugbear of the past few days: jquery.autocomplete. I usually stay away from JavaScript development in my day job but the past few days has seen me trying to do some work that requires autocomplete functionality. Never knowingly backing away from a challenge, I rolled up my sleeves and got to work.

It wasn't very difficult finding resources to get me started on this very useful plugin to the jquery framework library. Where I met my challenge was the use case which I sought to implement. I was going to be populating the lookup elements dynamically and this data would be supplied by the server-side in JSON at that. JSON being a subset of JavaScript made sense and I figured this would work out of the box....untrue. Thanks to Firebug I found that the JSON data coming back from the server side wasn't understood.

After a few days of sulking, I found some succour in the form of a jquery autocomplete implementation which actually speaks JSON. I had to tweak it to do my bidding in the end of the day but this was a better match for my problem and I am grateful to the codeassembly guy(s).

A few points to note:
It would be nice if the JSON functionality is brought into the main jquery.autocomplete.
It would also be nice to have a user defined formatItem function like the main jquery.autocomplete that is called after the JSON data is returned(this is the part of the codeassembly implementation I had to tweak to do my own thing).

All in all an interesting experience. I have a few more things to do in JavaScript land and will let you know how I get on.