Sunday, November 10, 2013

My first rugby league game

I went to the Rugby League World Cup game in Thomond Park, Limerick last night, Ireland lost to Australia 50-0.
It's a professional game in Australia, so their players were bigger, faster, better trained than the Irish, but you'd still expect at least one score from the boys in white*
They did get close the Australia try line a few times, but poor decision making meant it never led to a score. I've only seen bits of games on Sky Sports, never a full match, so I'm unfamiliar with the rules but the way it seemed to go to me is this:
player in possession runs at opposition, up to three players are allowed to tackle him (at least I didn't see more than three players in a tackle) and this involves wrestling him to the ground until...something happens and the ref blows. The player who took the ball into the tackle is allowed to stand up, the tackling players stand off him, and he puts the ball on the ground, stops it with his foot, and rolls it back to a teammate, and play resumes as before.
There's no lineouts, if the ball goes out of play on the sidelines, an opposition player collects the ball, and passes it from the sideline to a teammate, who touches it to his boot (think tap-and-go in rugby union) and then play resumes.
Not sure why scrums are awarded (is it for knock ons?) but a scrum only has six players on each side and appears to be uncontested, although this may have been because of Ireland's amateur status.
A try is 4 points, and a conversion is another point on top of that.
Play is 40 minutes a side, and the team with the most points at the end wins.
Honestly, if it wasn't for the unique attraction of the "World Cup" element to the occasion, I more than likely would not have attended and it's unlikely I'll be at any games in future.

*Australia played in green because they are higher ranked than Ireland, Ireland played in white.

Wednesday, September 25, 2013

SteamOS

Valve's Steam has been the de facto standard for downloadable PC gaming for some time now, and it has long been reported that they intended to move into the console gaming arena, with the "SteamBox" rumoured to be announced at a trade show/convention (E3, PAX, GDC, etc) for the past few years.

The first tentative steps have been made over the last 12 months, with Valve first releasing "big screen mode" to make the transition from PC gaming with a keyboard and mouse to console gaming with a control pad simpler. Following this came the Linux Steam client, and its steadily increasing library of games, although still lagging behind the numbers available on the Windows and Mac clients. The next big announcement came just this past week with the announcement of SteamOS, an Ubuntu-based Steam operating system that will be made available for free to hardware manufacturers, similar to Google providing the Android OS to mobile device manufacturers. However, I don't think this is going to be as big a success as Android (now the dominant mobile OS) in the gaming market.

Firstly, PC gamers are unlikely to spend money on hardware to play the games they already play on their desktop/laptop. Modern laptops can easily be connected to modern TVs with HDMI cables, and I've used a PC to play DVDs on a TV using a graphics card with a TV out port for almost a decade. A similar setup could easily be used for gaming, if you really wanted to use steam on a TV.

Secondly, console gamers are unlikely to be interested in buying another console in the near future. Sony's PlayStation 4 and MicroSoft's XBOX One are launching in November, costing 400 and 500 respectively (according to gamestop.ie). After that initial outlay plus new games, gamers are unlikely to be willing to pay for another box to sit under their TV, no matter what it offers, unless of course it is ridiculously cheap.

 Finally, and what is most important on any console, games. Steam's main rival in the downloadable gaming market is EA's controversial Origin platform. EA are unlikely to make any of their big franchises available on any Steam platform - FIFA, Madden, Modern Warfare, etc - which are among the top selling games on consoles every year. If they are not available, then gamers will simply not buy the platform. There are two more announcements to be made by Valve, the first coming this evening at 6pm GMT, which may change my opinion, but as it is, there's little to be excited about.

Friday, September 13, 2013

How to get the historical FIFA rankings for a country

FIFA, the world's football association have issued a set of international rankings once a month since August 1993 but have not made them available to developers, either through an API or downloadable files (e.g. csv, excel spreadsheet, etc).
However, it is possible to access the rankings for a country in an xml file using Firefox and the Firebug plug in.
First, open fifa.com and click on the relevant association's page, e.g. Scotland: http://www.fifa.com/associations/association=sco/index.html
When the page opens, click the "Rankings" link: http://www.fifa.com/associations/association=sco/ranking/gender=m/index.html
Right click on "Rankings Evolution" and select "Inspect element with Firebug"
The parent element of the div containing the "Rankings Evolution" text box is a div with a class type of "box". Right click on this and select "Copy HTML".
Paste the HTML into a text editor (notepad, gEdit, Kate, etc).
Search for the text "new SWFObject(" (without the quotes) and copy the first parameter, e.g. /flash/maranking/marankbrowser.swf?t1=sco&g=m&a=1&v=2&lang=e&environment=PROD
Add this to http://www.fifa.com to create the URL for the flash object: http://www.fifa.com/flash/maranking/marankbrowser.swf?t1=sco&g=m&a=1&v=2&lang=e&environment=PROD
Open a new tab and activate firebug. Click the Net tab and ensure it is enabled. Note that two requests are sent to the server, flashranking.xml and association=sco.xml. Right click on association=sco.xml and select "Copy Repsonse Body".
Open a text editor and paste in the response body. Each entry is in the format

Wednesday, September 11, 2013

Door closed for Trap

If you had said after the 1-1 draw at home to Cyprus that we would be at a World Cup play off in two years, and qualify for a tournament two years later, you'd have been laughed off the internet. Yet, that's where Trapattoni brought us.
I'm genuinely sorry to see him go, and I fear for the future of the game here with GAA in the ascendancy again, and rugby still drawing massive viewing numbers, but I have to admit it was one qualification tournament too many.

I think in time, his majority of his tenure will be remembered well.

Thanks for the memories Trapattoni, Paris, Poznan, etc,

Thursday, September 05, 2013

A farewell to boots

Since camping at all but the first Witnness events, and attending the Sunday night of the first Oxegen in 2004, it's been the better part of a decade since my last music festival (Slane isn't a festival) and, much like buses, this year I've been to two! The Longitude festival was held in Marley Park, not far from where I live and work, and the Electric Picnic celebrated it's tenth anniversary in Stradbally, Co Laois.
I wore the same work boots I had with me at Punchestown many moons ago, they were given to me as a health and safety requirement in a temporary warehouse job I took a lifetime ago, during a three week break between semesters during my Grad Dip in UL and the only positive from that job. Regrettably I had to retire my musical companions as the sole of the right boot finally conceded defeat on Sunday afternoon when it cracked, and the metal plate between it and the in sole of the boot snapped back, rendering the boot useless. They've served me well these past years, and I hope to replace them with a similar pair as soon as possible.
Among other firsts at the EP was my first yoga class. Waking early on Sunday morning (well, earlier than I had planned) and unable to regain a state of slumber, I walked first around the campsite and then on to the main concert site. Wandering around in the ealry morning, with little of the guests for company and precious few stalls open, I did feel an odd sense of serenity. While passing a tent for some local businesses in Cloughjordan, Co Tipperary, I noticed an sign for a free yoga class starting at 11, seeing as it was 10:40 or so, I resolved to try it out. The instructor began by asking was it anyone's first time, and happily I wasn't alone in making my debut. Of the class of about 30, I'd estimate there were eight others attempting this for the first time. The instructor took us through some basic breathing exercises, and then into some simple movements, before some intermediate poses, including one developed at the EP by her and a partner. While I didn't really get the breathing correct during the class, I found the movements and poses relatively easy to complete. I've been attending the local gym regularly after work and my warmup includes some similar stretches.
While the art, comedy and spoken word attractions were the big differences from the Oxegen and Witnness festivals of old, it's the little changes that struck me the most. Whereas in festivals past, facilities were kept to a minimum, there's been a mass growth in the cottage industry of offerings to festival attendees, offering everything from massages to phone recharging to ATMs (incidentally the only queue longer than the ladies toilets was for the ATMs!). Londis had a pop-up shop at the campsite in Stradbally, and the Irish Time's Ticket supplement was given away for free on each day with reviews of the previous day's events.
Ep has a reputation for being more family-friendly and I did find this the case with many young children in attendance, which did give a more relaxed atmosphere to proceedings. There were many infants as well, with one girl passing us pushing a buggy carrying a child that had not yet seen his first Christmas! One downside of this was that many remained in attendance in the main arean after the sun had passed below the horizon and night had set in. While there's nothing wrong with this in theory, in practise this meant a child could disappear without notice and be left alone in the dark, in a field with more than 30,000 people, (many of whom in were in later stages of intoxication) and with mobile phone coverage at a premium. I can only imagine what this would do to a parent.
What I had noticed at Longitude and moreso at EP was the reappearance of symbols of 60's flower child idealism, girls wearing flowers in their hair, beaded hairbands and CND-branded clothing. What troubled me was the flowers and beads were plastic and mass-manufactured, instead of real and hand woven, and clothes bearing the symbols of peace and tolerance were made and sold by fashion houses with more eyes on the bottom line than anything the icons they stood for. I wondered did these children of children of the cultural decade ,and the pivot of change that followed it, believe in what they wore, or did they just want others to think they did?
I doubt this will be my last festival, or that another nine harvests will be reaped before I attend another, but I cannot imagine myself camping again. While not unable to function without the creature comforts of home, the simple fact is that, in my fourth decade, the recovery time is longer, the stiffness less bearable and the cold night air more penetrating. C'est la vie.

Tuesday, August 27, 2013

Spring Insight on Tomcat failing to start

Spring Insight is a powerful tool to record timing data for web applications deployed on a Spring server, but can also be used on Tomcat.
However, it does require a large amount of configuration before it will run correctly on a Tomcat deployment.
One exception that caused me a large amount of grief was the descriptive java.lang.NullPointerException at java.io.File.(File.java:222) at com.springsource.insight.collection.tcserver.ltw.TomcatWeavingInsightClassLoader.readInsightConfig(TomcatWeavingInsightClassLoader.java:67) at com.springsource.insight.collection.tcserver.ltw.TomcatWeavingInsightClassLoader.start(TomcatWeavingInsightClassLoader.java:50)
  Fortunately the source code for all Spring products is available to download at http://maven.springframework.org/release/com/springsource/ I am using Insight 1.5.1.SR2, and the source for the TomcatWeavingInsightClassLoader class is in the insight-collection project at http://maven.springframework.org/release/com/springsource/insight/insight-collection-tcserver/1.5.1.SR2/insight-collection-tcserver-1.5.1.SR2-sources.jar Examining the class, on line 67 we can see the following File insightDir = new File(System.getProperty("insight.base")); So Insight is looking for the insight root directory in your deployment, which can be set at run time. To resolve the problem, add the system parameter "insight.base" to your tomcat startup with the value of the insight directory in the deployment, e.g. "-Dinsight.base=C:\tomcat\insight"

Monday, August 12, 2013

Persist timing data from Spring Insight

Spring Insight is a powerful tool for tracing time spent in various methods during the progress of a web application call. While you can export traces from the Insight UI, the resultant file is in binary format, and can only be opened with the Insight UI itself. Fortunately, there is a workaround if you want to persist the data recorded during a call.
Insight adds extra headers to the repsonse object from a call - X-TraceId and X-TraceUrl. The traceId is (unsurprisingly) the id of the compelted trace and the trace url is a link to the trace on the Insight server that is in the form "/insight/services/traces/?type=[json|xml] with json as the default.
If you enter this url into your browser, the Insight server will return the data from the call in the selected format.
If you can access the response headers programattically (e.g. in a headerless browser, or using a proxy) you will be able to access the X-TraceId and X-TraceUrl values and from there can request and persist the Insight data.

Wednesday, July 24, 2013

SalesForce.com Authorised Application using Apache HttpComponents

This article describes how to create a basic authorised application that will query the SalesForce.com API without the need for logging in to your account
  1. Register a SalesForce.com remote application
    • Create a SalesForce.com Developer account - http://developer.force.com/
    • On connection to the salesforce.com api, you must provide your password and the security token combined as a string
    • Log into your account and click App Setup(in the menu on the left) -> Create -> Apps
    • Under "Connected Apps", click New
    • Enter the Connected App Name, Connected API Name and Contact Email (note - it's recommended to not use spaces in the App and API names)
    • Under OAuth Settings. select "Enable OAuth Settings"
    • Enter the Callback URL - in an OAuth application this is the URL the application will return to after authentication, which will not be needed here, but the value cannot be blank
    • Select "Access and manage your data (api)" in the "Available OAuth Scopes" and add it to the "Selected OAuth Scopes"
    • Click Save
    • In the application description page that opens, note the Consumer Key, and Consumer Key values (you will need to click "Click to reveal" to see it)
    • In the user dashboard, click Personal Setup -> My Personal Information in the menu on the left, then Reset My Security Token.
    • Your security token will be not be displayed on screen, and will be sent to the email address associated with the salesforce.com account
      • e.g. for password "myPassword" and security token "mySecurityToken" the connection is authorised with the string "myPasswordmySecurityToken"

  2. Develop application in Eclipse
    • Create a new Java project
    • Add the following jar files:
      • From the apache http components project  - http://hc.apache.org/ - you will need the following jar files
        • httpclient
        • httpcore
    • The following code snippet will open a connection to the SalesForce API and return a JSON document
      • Replace the values in angle brackets with the appropriate values from your setup
      • String accessToken = null;
        String instanceUrl = null;
        DefaultHttpClient httpClient = new DefaultHttpClient();
        HttpPost httpPost = new HttpPost("https://login.salesforce.com/services/oauth2/token");
        // prepare the parameters
        ArrayList postParameters = new ArrayList();
        postParameters.add(new BasicNameValuePair("grant_type", "password"));
        postParameters.add(new BasicNameValuePair("client_id", {your application client id}));
        postParameters.add(new BasicNameValuePair("client_secret", {your application client secret}));
        postParameters.add(new BasicNameValuePair("username", {your salesforce.com username}));
        postParameters.add(new BasicNameValuePair("password", {your salesforce.com password + your salesforce.com security token}));
        // prepare the form, and set the encoding
        UrlEncodedFormEntity urlEncodedFormEntity = new UrlEncodedFormEntity(postParameters);
        urlEncodedFormEntity.setContentEncoding("UTF-8");
        httpPost.setEntity(urlEncodedFormEntity);
        // place the right content type for the form
        httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded");
        // execute the request to get the tokens
        HttpResponse httpResponse = httpClient.execute(httpPost);
        int statusCode = httpResponse.getStatusLine().getStatusCode();
        if (statusCode == HttpStatus.SC_OK) {
            ObjectMapper objMapper = new ObjectMapper();
            InputStreamReader inputStreamReader = new InputStreamReader(httpResponse.getEntity().getContent(), "UTF-8");
            JsonNode rootNode = objMapper.readTree(inputStreamReader);
            accessToken = rootNode.get("access_token").asText();
            instanceUrl = rootNode.get("instance_url").asText();
        }
        System.out.println("AccessToken: " + accessToken);
        System.out.println("instanceUrl: " + instanceUrl);
  3. Query the SalesForce API
    • The instanceUrl is the salesforce.com server that all subsequent queries must be sent to, and the access token must be set as the "Authorization" header in all subsequent requests
    • One of the simplest requests is to retrieve the details for the customer accounts associated with your salesforce.com account, this list can be seen in the Account header on your dashboard
    • Use the following code snippet to request the list of accounts and store the JSON string in the accounts String object
      • URIBuilder uriBuilder = new URIBuilder(instanceUrl + "/services/data/v28.0/query");
        uriBuilder.addParameter("q", "SELECT Name, Id, BillingStreet, BillingCity, Phone, Website from Account LIMIT 100");
        String accounts = null;
        HttpGet httpGet = new HttpGet(uriBuilder.build());
        httpGet.addHeader("Authorization", "OAuth " + accessToken);
        try {
            httpResponse = httpClient.execute(httpGet);
            if (httpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
             InputStreamReader inputStreamReader = new InputStreamReader(httpResponse.getEntity().getContent(), "UTF-8");
             accounts = objMapper.readTree(inputStreamReader).toString();
            }
        } finally {
             httpGet.releaseConnection();
         }
        System.out.println(accounts);
While these snippets will work perfectly well in a command line application, in a web application, it is prudent to persist the instance url and access token in the user's HttpSession object.

Thursday, June 20, 2013

Sending a Node.JS request module request through a proxy

all very simple really, just add the "proxy" attribute to the request call
    request({
        proxy: ':',
        url: endpointUrl ,
        method: requestMethod,
        body: requestBody
    }).pipe(res);

Tuesday, June 04, 2013

How to delete multiple jobs in Jenkins

over time, a Jenkins server can amass a large of jobs (or projects as the "Delete" link calls them) and having to delete them one by one can be laborious to perform through the UI.

Fortunately, Jenkins includes a scripting engine that can be run through the UI that handles the task very well.

Open the following URL: http:///script
and enter the following code in the textbox:

for(job in jenkins.model.Jenkins.theInstance.getProjects()) {
    job.delete();
}

and moments later, all the jobs are removed!

Tuesday, April 16, 2013

Thoughts on thoughts and prayers, and prayer

Following the explosions in Boston yesterday, my timelines in facebook and twitter are filled with outpourings of grief and sadness for the victims, but the phrase "my thoughts and prayers" is frequently included in all online missives. This made me think - what does "my thoughts and prayers" actually mean?

Going on my browser history today, my thoughts have been on Nintendo's plumbing brothers Mario and Luigi, the maven build tool, footballer Sean McGinty, the casting of Splinter in Ninja Turtles, and some of the online reactions to the explosions in Boston. But I can honestly say I haven't really thought about the victims, or their familes.

What about prayers? While raised Catholic, I only attend mass infrequently throughout the year, the last time a little under a month ago, and I rarely pray for anything, except when explicitly asked to do so.

Has the phrase itself lost some of its meaning? Has it become one of these catch all, non offensive colloquialisms that people use? Another one in frequent use is "have a good one!" for an online friend's birthday. Particularly if you don't really know this "friend" or haven't spoken to them recently so you can't include any references to recent events in their life, and you don't want to wish them to have a bad one, do you? Having seen countless going away cards in my decade of full time employment, the phrase "best of luck mate" is another one in frequent use, often multiple times on the same card.

In both cases my internal translator reads them as "I can't think of anything else to say".

Maybe that's the reason why we use the "thoughts and prayers" phrase in cases of atrocity, we simply cannot think of anything else to say. Our own words fail us, so we use someone else's.

Maybe we need to think more about people and pray for them before telling people we are thinking of and praying for them.

Friday, March 08, 2013

Irish in the Premier League

A recent post on foot.ie stated the the author could not remember when Ireland had so few players starting in the Premier League. Taking this on board, I resolved to examine the Irish Abroad database and get the list of players who have started at least one Premier League game in each of the last seven seasons. With 25 players starting at least one game in the 2012/2013 season, it is below the average for the previous six season, which is 28, but Irish players are still the third most represented nation in the PL, after England and France

2006-2007: 24
Stephen Carr, Lee Carsley, Kevin Doyle, Damien Duff, Richard Dunne, Steve Finnan, Caleb Folan, Derek Geary, Shay Given, Matt Holland, Stephen Hunt, Stephen Ireland, Robbie Keane, Paddy Kenny, Kevin Kilbane, Shane Long, Alan O'Brien, Andy O'Brien, John O'Shea, Stephen Quinn, Alan Quinn, Darren Randolph, Andy Reid, Steven Reid

2007-2008: 27
Stephen Carr, Lee Carsley, David Connolly, Colin Doyle, Kevin Doyle, Damien Duff, Richard Dunne, Steve Finnan, Caleb Folan, Shay Given, Ian Harte, Stephen Hunt, Stephen Ireland, Robbie Keane, Stephen Kelly, Kevin Kilbane, Shane Long, Paul McShane, Liam Miller, Daryl Murphy, Andy O'Brien, Joey O'Brien, Roy O'Donovan, John O'Shea, Steven Reid, Andy Reid, Anthony Stokes

2008-2009: 24
Keith Andrews, Rory Delap, Damien Duff, Richard Dunne, Caleb Folan, Darron Gibson, Shay Given, Stephen Ireland, Robbie Keane, Stephen Kelly, Dean Kiely, Kevin Kilbane, Liam Lawrence, Paul McShane, Liam Miller, Daryl Murphy, Andy O'Brien, Joey O'Brien, John O'Shea, Steven Reid, Andy Reid, Keith Treacy, Glenn Whelan, Marc Wilson

2009-2010: 32
Keith Andrews, Stephen Carr, Lee Carsley, Rory Delap, Kevin Doyle, Damien Duff, Richard Dunne, Keith Fahey, Steve Finnan, Caleb Folan, Kevin Foley, Darron Gibson, Shay Given, Stephen Hunt, Stephen Ireland, Robbie Keane, Stephen Kelly, Andy Keogh, Kevin Kilbane, Liam Lawrence, Chris McCann, James McCarthy, Paul McShane, David Meyler, Daryl Murphy, Andy O'Brien, John O'Shea, Andy Reid, Steven Reid, Stephen Ward, Glenn Whelan, Marc Wilson

2010-2011: 27
Keith Andrews, Leon Best, Stephen Carr, Ciaran Clark, Seamus Coleman, Rory Delap, Kevin Doyle, Damien Duff, Richard Dunne, Keith Fahey, Kevin Foley, Darron Gibson, Stephen Hunt, Stephen Ireland, Robbie Keane, Stephen Kelly, James McCarthy, David Meyler, Andy O'Brien, John O'Shea, Steven Reid, Andy Reid, Conor Sammon, Jonathan Walters, Stephen Ward, Glenn Whelan, Marc Wilson

2011-2012: 34
Keith Andrews, Leon Best, Ciaran Clark, Seamus Coleman, Simon Cox, Rory Delap, Kevin Doyle, Damien Duff, Shane Duffy, Richard Dunne, Kevin Foley, Anthony Forde, Darron Gibson, Shay Given, Wes Hoolahan, Stephen Hunt, Stephen Ireland, Robbie Keane, Stephen Kelly, Paddy Kenny, Shane Long, James McCarthy, James McClean, David Meyler, John O'Shea, Anthony Pilkington, Steven Reid, Conor Sammon, Marc Tierney, Jonathan Walters, Stephen Ward, Keiren Westwood, Glenn Whelan, Marc Wilson

2012-2013: 25
Ciaran Clark, Seamus Coleman, Damien Duff, Robert Elliot, Darron Gibson, Shay Given, Ian Harte, Wes Hoolahan, Noel Hunt, Stephen Ireland, Stephen Kelly, Shane Long, James McCarthy, James McClean, Joey O'Brien, John O'Shea, Alex Pearce, Anthony Pilkington, Steven Reid, Enda Stevens, Jay Tabb, Marc Tierney, Jonathan Walters, Glenn Whelan, Marc Wilson

Monday, December 31, 2012

Things that were true about me on 1st January 2012 that are not true on 31st December 2012

I've never been to Belgium, Poland, Skibereen or Argentina
I speak no Polish
I've never seen grouplove, Two Door Cinema Club, Stone Roses or Snow Patrol live
I've never had a tooth removed
I haven't published an article since I left IBM
I've never been to two weddings on two consecutive days
I've never been photographed with a mayor
I've never had a photo go viral
I've never been to a Boca Juniors game
I've never organised a film screening
I've never been interviewed on 98FM, Q102 or Phantom 105.2
I've never been to an Irish rugby international at Thomond Park
I am not followed on twitter by anyone with Irish international caps
I've never been to a wedding in the Southern Hemisphere
I've never gotten into the second round of the Facebook Hacker Cup
I don't own a raspberry pi, tablet computer, or giant bean bag
I've never given a presentation in my new job

Tuesday, December 25, 2012

Ireland Monthly Records

After figuring out the highest ranked team beaten, and lowest ranked side lost to, by recent managers a few weeks ago, I was reminded of Staunton's quote that we play better in March anyway (at least I think that's what it was, the only record I can find of it is here: http://www.munster-express.ie/sports/studsup/staunton-survives-and-its-all-to-play-for-in-september/ ) so I decided to see if I could use the same results set as before to find out what month we play best in. The results history I'm working off of is here if you want to check any of them: https://sites.google.com/site/tetsujin1979/matches
Month         P  W  Win %  D Draw %  L  Loss %  GF GF/G   C  C/G
January       0  0  0.00%  0  0.00%  0   0.00%   0    0   0    0
February     26 13 50.00%  6 23.08%  7  26.92%  36 1.38  24 0.92
March        41 24 58.54%  7 17.07% 10  24.39%  61 1.49  37 0.90
April        38 15 39.47%  8 21.05% 15  39.47%  45 1.18  45 1.18
May         106 35 33.02% 22 20.75% 49  46.23% 123 1.16 165 1.56
June         64 25 39.06% 21 32.81% 18  28.12%  77 1.20  71 1.11
July          1  0  0.00%  0  0.00%  1 100.00%   0 0.00   2 2.00
August       16  4 25.00%  7 43.75%  5  31.25%  19 1.19  21 1.31
September    56 26 46.43% 18 32.14% 12  21.43%  85 1.52  55 0.98
October      75 30 40.00% 24 32.00% 21  28.00% 128 1.71 106 1.41
November     54 20 37.04% 17 31.48% 17  31.48%  93 1.72  66 1.22
December      9  0  0.00%  1 11.11%  8  88.89%   8 0.89  26 2.89

GF = Goals For
GF/G = Goals for Per Game
C = Conceded
C/G = Conceded Per Game

So, the first thing to note, is that Staunton was right, with a 58% win ratio, March is our strongest month!
Technically, July is our weakest month, losing the only game we ever played in July, the 2-0 loss to Holland in World Cup '94. However, December is probably worse, losing 8 of 9 games played in the final month of the year, also the most goals conceded per game in any month, with over 2 goals per game
We've scored more goals in October than any other month, just ahead of May, but by .01 of a goal per game, November has the highest goals per game
May is comfortably our worst defensive month, conceding 165 goals (probably due to end of season syndrome) almost 60 more than the next worst, 106 in October

Thursday, June 21, 2012

A Tale Of A Thumb

On Saturday evening, my friends and I returned from a day in Torun, a small town roughly halfway between Poznan and Gdansk, after attending a charity game between the Ireland fans group You Boys In Green (YBIG) and a local selection. Poland were playing the Czech Republic for a place in the knockout stages of the tournament, and, with the fanzone full to capacity, we headed to the main square to watch the game on one of the screens erected by its bars and restaurants. On the way there, one of the many volunteers for the city handed me a flier for a goodbye appreciation from the volunteers in the square on the following Monday afternoon. I took a quick snap of the flier in my left hand with only the edge of my thumb visible and tweeted the pic, using the free city wifi - https://twitter.com/tetsujin1979/status/214109757739503616/photo/1. Initially I didn't think anything more of it, it was one of many images I'd posted from Poland and another of the thousands of tweets I'd posted since joining the microblogging site After the game ended, and a downpour had convinced many of the fans to head home rather than risk being soaked, I checked twitter again and was surprised to see the image had been picked up by the sports and humour blog balls.ie - http://www.balls.ie/2012/06/16/crazy-poznan-is-throwing-a-goodbye-party-for-the-irish-fans/ - and had been retweeted several times The next morning I was surprised to see that Paddy Power had mentioned it on their twitter feed - https://twitter.com/paddypower/status/214281980760702976 - and credited me as the author of the pic. What followed on Monday caught me completely off guard, while browsing the Irish Independent's website, I noticed a headline for a goodbye party for the Irish fans in Poznan. Thinking this would be about the party itself, I opened the page only to have my photo staring back at me - http://www.independent.ie/sport/soccer/euro-2012/irish-news/so-lonely-round-the-streets-of-poznan-polish-city-throws-a-goodbye-party-for-irish-fans-3140886.html Finally, after the Ireland - Italy game I received a tweet from a former co-worker that my photo had appeared on Craig Doyle Live! The episode is still available on the RTE player - http://www.rte.ie/player/#!v=3321453 - at 7:30, I took a quick snapshot and you can see it here: Finally, using a site I built myself some time ago, I built a graph to show how my tweet progressed though the twittersphere - http://retweetgraph.appspot.com/Gallery?id=237001 - it received little traction until the RTESoccer account retweeted it and then it really took off, finishing up with 55 retweets, a personal best!

Thursday, January 13, 2011

Facebook Hacker Cup - Studious Student Solution

Here's my solution to the Studious Student problem in the Facebook Hacker Cup in Java


package com.facebook;

import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class StudiousStudent {

public StudiousStudent(String wordLine) {

ArrayList strings = new ArrayList();
StringTokenizer st = new StringTokenizer(wordLine);
int wordCount = Integer.parseInt(st.nextToken());
while (st.hasMoreTokens())
strings.add(st.nextToken());

String[] stringArray = (String[]) strings.toArray(new String[strings.size()]);
for (int index1 = 0; index1 < wordCount; index1++) {

for (int index2 = 0; index2 < wordCount; index2++) {

if ((stringArray[index1] + stringArray[index2]).compareTo(stringArray[index2] + stringArray[index1]) > 0 && (index1 < index2)) {

String tmp = stringArray[index1];
stringArray[index1] = stringArray[index2];
stringArray[index2] = tmp;

}

}

}
for (int counter = 0; counter < stringArray.length; counter++)
System.out.print(stringArray[counter]);

System.out.println();

}

public static void main(String[] args) {

BufferedReader input = null;
try {

input = new BufferedReader(new FileReader("studiousStudent.txt"));
String inputLine = input.readLine();
Integer wordLineCount = Integer.parseInt(inputLine);
for (int counter = 0; counter < wordLineCount; counter++) {

new StudiousStudent(input.readLine());

}
input.close();

} catch (Exception e) {

System.out.println("e.getMessage():" + e.getMessage());
e.printStackTrace();

}

}

}

Facebook Hacker Cup - Double Squares Solution

Here's my java solution for the Double Squares problem in the Facebook Hacker Cup

import java.io.BufferedReader;
import java.io.FileReader;
import java.util.Date;

public class Squares {

public Squares(int square) {

double squareRoot = Math.sqrt(square);
int squareCount = 0;
for (int counter1 = 0; counter1 <= squareRoot; counter1++) {

for (int counter2 = counter1; counter2 <= squareRoot; counter2++) {

if((counter1 * counter1) + (counter2 * counter2) == square)
squareCount++;

}

}
System.out.println(squareCount);
}

public static void main(String[] args) {

BufferedReader input = null;
try {

input = new BufferedReader(new FileReader("squares.txt"));
String inputLine = input.readLine();
Integer squares = Integer.parseInt(inputLine);
for(int counter = 0; counter < squares; counter++) {

new Squares(Integer.parseInt(input.readLine()));

}
input.close();

}
catch(Exception e) {

System.out.println("e.getMessage():" + e.getMessage());
e.printStackTrace();

}

}
}

Results in less than a minute

Sunday, January 09, 2011

2010 - A Year In Fitness

Finished the year more or less as I started. Went to the gym more in February than I did in November and December combined.
2010GymSwimmingFootballTag RugbyWeight (kg)
January782094.5
February1274093.8
March1183094
April965095
May754596
June564794.3
July564494.5
August243494.6
September685494.6
October563494.8
November764295
December130095
Total77734130

Tuesday, November 02, 2010

ReTweetGraph

I launched a new site yesterday, it's more of a proof of concept (i.e. does this actually work) than anything else at the moment


If you're on twitter, and I know some of you are, there's an option called "retweeting" where you send a message you received from someone to all of your followers, similar enough to a chain message in email, only in this case you can track the progress of the message (or "tweet" as they are called).

Bearing this in mind, I set out to see if I could plot the progress of a tweet as it passed between users on a graph.

Turns out, I can, and did and now so can you - http://retweetgraph.appspot.com/

You can only create a graph if you have an account with twitter, but anyone can view the gallery of created graphs

Sunday, October 17, 2010

An open letter to the Irish Independent

Dear Sir/Madam,

I really do not know where to begin with the aticle "Vendetta is an Italian word" published Sunday, 17th October 2010 - http://www.independent.ie/sport/soccer/vendetta-is-an-italian-word-2382953.html

Quote - "Giovanni Trapattoni is making a mess of the Irish manager's job. And if he doesn't get his act together pronto, the FAI should give him the boot "
A fair comment, and the opinion of the author, but who would you replace the manager with? Also, given that the Independent have dedicated several articles to the state of the FAI's finances, should you really be advocating sacking a manager, which will result in paying off the rest of his contract, as well as the backroom staff, and then start paying a new man at the helm?

Quote - "We've become so used to Reid's omission from the Irish international squad that there's a tendency to treat it as a fait accompli"
Andy Reid has played a grand total of 39 minutes this season, only 6 of which were in Premier League games, the others were against Colchester United in the League Cup, and he failed to make it off the bench in a further two league games. What evidence is there that he would have made a difference against Russia?
Also, the phrase is "au fait accompli"

Quote - "Stephen Ward of Wolves, injured at the moment, was left out of the squad when he would have been a better bet than the increasingly ludicrous Kevin Kilbane at left-back."
Stephen Ward is not injured, he played in Wolverhampton's game against West Ham on the 16th October. He has only been omitted from the starting XI in two games for Wolves this season, both League Cup games. He's started every Premiership game, and only failed to complete two so far this season, so he was also not injured in the build up to the Russia/Slovakia double header either. Seriously, who is doing the research (or lack thereof) at the Independent in recent weeks?

Quote - "Marc Wilson moved up from Portsmouth to Stoke in the same deal that took Ireland first-teamer Liam Lawrence in the other direction. No place for him either."
Not only was Wilson in the squad, he was on the bench against Slovakia. Daniel McDonnell made the same error in his article "McCarthy certain to figure in future plans but Trap unlikely to change 'the system'" published Thursday, 14th October 2010 - http://www.independent.ie/sport/soccer/mccarthy-certain-to-figure-in-future-plans-but-trap-unlikely-to-change-the-system-2378540.html
Quote "His club colleague Marc Wilson, who failed to make the bench in Tuesday night's 1-1 draw with Slovakia, is in line for an international debut as well." A rudimentary search using google, not to mention reading any review of the game on any relevant site (rte.ie, uefa.com, wikipedia, fifa.com, fai.ie, soccernet, football365.com, skysports.com, etc) would have told you the correct lineup.

The title of the article is "Vendetta is an Italian word", which is ironic considering the tone and direction of articles in the Independent about the Ireland team and management in recent months.

The entire article boils down to "Giovanni Trappatoni should be sacked because he plays Paul Green instead of Andy Reid".

Yours, etc