Feb 012015
 

I don’t write about my daughter Méabh all that much on any social media including Twitter, Facebook and even this website. Primarily because I respect any need she may have in the future for privacy. I don’t know if I would want to read tweets or Facebook updates written by my parents when I was young. Sure, they might be interesting for me from time to time but would I want others to read them? What about current or perspective employers. Imagine if you searched for Darragh Ó Héiligh and you found a post written by my mother on Facebook thirty years ago. That is a frightening thought.

Anyway, that’s beside the point of today’s post.

I don’t write about Méabh very often but tonight while at the end of a great weekend, I really wanted to write something because it marks the continuation of a journey that I hope to have only started with her. That is the journey of music and performances.

This weekend was the seventh annual Temple bar music festival. I don’t think it was a very good festival this year overall but one part I really enjoyed were the free performances from under 18 groups that were hosted in Dublin’s city hall. These were advertised as family friendly events so I of course bought Méabh. I listen to a lot of music at home therefore Méabh does as well but music is very different when played live so when I have the opportunity to attend a live performance I jump at it. Now that I have Méabh as well, I love bringing her with me. I love being there for her reactions. She is fifteen months young at the moment so possibly too early for some of the strict performances where you can’t make any noise while the musician is playing however, if this weekend was anything to go by she wouldn’t be any bother at all. She absolutely loved the performances. She clapped at the end of most tunes, songs, slow airs and poems and she danced happily along to faster tunes. During a slow air today she even turned toward me and gave me a huge hug for the duration of the tune. There was a collective Aw from the audience around me at that point. I thought that during the poem at the very least she’d get bored but not at all. She stood in the isle looking around.

I love having the opportunity to introduce something that means so much to me to Méabh but the reason that I’m writing tonight is I’m incredibly proud of her for not just sitting quietly during hours of performances but actually enjoying the entire performances from beginning to end. Today we were in the one seat for an hour and a half and not once did she complain that she couldn’t run around on her own or make noise.

By far, for me, the most rewarding part of being a parent is introducing Méabh to something and being there as she gets just as much joy from it as I do.

Jan 082015
 

I wrote a short blog post last night when I felt that I couldn’t get any further independently with searching within a Mongo database for data between a date and time range.

I was highlighting a question that I had posed on Stack overflow.

Fortunately today when I got home from work very late I found there were two very short and very useful responses.
Turns out that I was over complicating my approach. The date is actually represented in the Mongo shell as an ISo date but it’s actually a BSON date type.

So by converting it to a string I was causing the problem in the first place.

Here’s what I was trying:

date1 = datetime.datetime.utcnow()-datetime.timedelta(minutes=15)
date1 = date1.strftime(“%Y-%m-%dT%H:%M:%S.000Z”)
for cursor in sensors.find({‘Date':{“$gte”:’ISODate(“‘date1′)”‘}}):

First line is defining the date and time minus 15 minutes.
Second line is converting it into the right format.
Third line is creating the cursor and adding the ISODate(“”) component.

However, here’s what I should have been doing.

date1 = datetime.datetime.utcnow()-datetime.timedelta(minutes=15)
for cursor in sensors.find({‘Date':{“$gte”: date1}}):

That simple!

However, on my travels I found that you can profile a Mongo database.
Learn about profiling MOngo here
This turns on profiling:

db.setProfilingLevel(2) This turns off profiling:

db.setProfilingLevel(0)

This shows you the entries written to the profile table:

db.system.profile.find()

This is the kind of output you can expect from profiling:

“query”, “ns” : “DatabaseName.CollectionName”, “query” : { “Date” : { “$gte” : “ISODate(\”2014-12-31T12:30:09.000Z\”)” } }, “ntoreturn” : 0, “ntoskip” : 0, “nscanned” : 0, “keyUpdates” : 0, “nreturned” : 0, “responseLength” : 20, “millis” : 1, “client” : “127.0.0.1”, “user” : “” }

My huge thanks to the people on Stack overflow who helped out.

Jan 082015
 

Here we go again. I blogged about this before but now I’m trying to do it using Python. I don’t know why this is so difficult!

I had to ask the question on Stack overflow because I’m no closer to solving it.

When I eventually find the answer or if someone helps, I’ll of course post the solution here. It’s funny, when researching this, I kept finding the blog post I wrote before. Funny but ever so slightly irritating as well because I really don’t need to read wheat I’ve written!

Updated on 8th January 2015 at 11PM: I have written a second blog post with the answer to this question here.

Jan 022015
 

I post to Audioboom an dsound cloud when ideas come into my head so I’ve decided that to revive this site a little, I’d link the other services I post to so that when I record a podcast in Audioboom for example you see it as a new blog post here.

Any thought’s? The first podcast is here: By the way, you can also subscribe through the iTunes podcast service if you like.

 

| Open Player in New Window

Listen or Download

Dec 242014
 

2014 is almost finished and I don’t think I’ve ever been so happy to see the end of a year.

Usually, I’ll try to see the good in things but this year the bad took over the good.

On the 23rd of May my granny died. Coming to terms with this hasn’t been easy. I’m probably not through grieving yet either. There’s rarely a day when I don’t think of her.

I’ve also been handed way more than I can handle in work. I’m managing the support team, implementing new solutions like the SMS gateway and the new backup solution, managing a few contractors, implementing and monitoring security and maintaining the entire production, test and office environments. As well as this, I’m also the escalation point for support so just as I’m about to really focus on a problem, someone will stand at my desk expecting an immediate answer. Managing people is very difficult. Managing people and also doing another full time job is next to impossible. The balls that I’m juggling regularly fall so when I’m focused on managerial, something in the environment goes pear shaped. When I’m focused on the environment or a new system, work doesn’t get done and I have to go back to management again.

This year has been great in other ways. We rented an apartment in Spain for a month in June. That was a fantastic experience. Living in a completely different climate was refreshing and relaxing. I worked over there for a few weeks and then took a few weeks off at the end.

I also travelled to Canada with Comhaltas for the Echoes of Erin tour. I blogged about it at the time so take a look if you’re interested. That was an absolutely incredible two weeks. I loved Canada and the Canadian people. The people I travelled with were lovely and great musicians as well so all round I couldn’t have been happier with the experience.

This is also our second year of marriage. Without Emma I wouldn’t have handled my granny’s passing and all the stresses of work. She has both picked me up and given me a kick in the ass when I’ve needed it. One of the best things I ever did was propose to Emma. I continue to admire and appreciate her determination, kindness, patients, humour and thoughtfulness. She is also the reason why Méabh our daughter continues to thrive. I just hope Méabh doesn’t talk as much…

Speaking of Méabh she is just brilliant. A month ago she progressed from trying to walk to actually getting up and going where ever she wanted. It was in the most unlikely place as well. We were visiting Mick O’Brian and his daughter Aoife when they finished a performance in Drogheda. We let Méabh down for a second and she just got onto her feet and walked away. It was really that quick. She saw something she wanted and she walked to it. Actually, I think it was another person but she decided it was more convenient to walk over. Apart from walking Méabh is getting on really well. She’s forming a lot of different sounds and occasionally she correctly replicates something that we’ve said. For example, on Sunday Emma said Ouch. Méabh thought this was hilarious so said outzz. It wasn’t completely accurate but it was a great first try. I also get called Daddy first thing in the morning or when she gets excited. Any other time I get called Dada. She’s trying to say Nama’s name too but that usually comes out as Nana or Nananananana. I don’t expect any real words from her for a good six months or so and even then they will be very simple but it’s really interesting to hear her start to explore the different sounds.

Again, moving on, I mentioned Nama my guide dog in the last paragraph. I have him two years now. He’s been better than I could have anticipated. I’m convinced he’s bullet proof. No situation seems to put him off. When I need him he’s an absolute rock and when it’s time to unwind he’s a big pup.

So there you have it. 2014 has been very good but unfortunately because of two bad things the good has been over shadowed. Bring on 2015.

I would like to finish by wishing you all a very happy Christmas and a rewarding, fulfilling and prosperous new year. My sincerest thanks for continuing to visit this website. My special thanks to those who have left comments and who have contacted me through the site. It has been a pleasure to contine the DigitalDArragh.com website for an eleventh year.

Dec 142014
 

Thanks to a suggestion from my wife last week, I bought a Energenie socket controller for the Raspberry Pi. This little gadget allows wireless communication to a special socket that plugs into an electrical outlet. When working, this allows you to easily write code that will turn on or off that socket. The pack comes with one transmitter and two receiving sockets but actually, I bought two kits as each socket may be controlled by up to two transmitters and one transmitter may control up to four sockets.

The reason that I bought this is quite simple. I have a new Raspberry Pi B+ in our living room with RaspBMC to allow us to use the XBMC media center software. we also put up our Christmas tree last weekend so we have the yearly problem of having to reach around quite a large christmas tree to reach the socket to turn off power to the lights every night. As they would say on twitter, it’s a perfect example of a first world problem! I hate that term but I’m getting off the point. Thanks to the RP and the Energenie I can turn on and off our Christmas tree lights remotely without going anywhere near that hard to reach socket.

The problem of course was, on Wednesday after I spent a short amount of time getting this set up the night before, my wife posted a status to facebook saying, “It’s bad when I’m not technical enough to turn on the christmas tree lights”. Point taken. I set about creating a web interface to allow us to do this from our phones.

I have never used the Flask Python web micro framework so this was a very new venture for me. the code you see before is my second version. The first one didn’t use views, a config file, templates or flash messages. It worked but it wasn’t as clean. I like to learn to do things properly so I scrapped it and read about how to do this properly. If you are interested in Flask, I really suggest you read this incredibly helplful tutorial by guel Grinberg.
Here are all the steps. Hopefully I haven’t left anything out. To make this a little more conveenient for you, I’ve also included a package of all the code and graphics you will need to get this running on your own system.

What you’ll need

  • A Raspberry Pi
  • An Energenie socket

Getting your environment ready.

I’m installing this on RaspBMC. This is the Raspberry Pi distribution for XBMC use primarily.
Update the aptitude repository
sudo apt-get update
Install build dependencies.
apt-get install gcc python-dev
install the Python GPIO package to gain control of the pins on the Pi.
cd /tmp
wget https://pypi.python.org/packages/source/R/RPi.GPIO/RPi.GPIO-0.5.8.tar.gz

Extract the contents of the archive.
tar xzvf RPi.GPIO-0.5.8.tar.gz
cd RPi.GPIO-0.5.8
sudo python setup.py install

Change to your home directory and get the Energenie install software from the following address.
cd
wget https://energenie4u.co.uk/res/software/ENER002-2PI.py

Now install this.
sudo python ENER002-2PI.py
Make a directory that will hold your project
cd
mkdir

ProjectName}
cd {ProjectName}

Get the really fantastic library created by Amy Mather’s. More information can be found here.
wget https://github.com/MiniGirlGeek/energenie-demo/raw/master/energenie.py
Get the Python setup tools package.
sudo apt-get install python-setuptools
get the Flask micro web framework.
sudo easy_install flask
Get the Jinja2 Python template engine.
sudo easy_install Jinja2
You now have all the components required to get coding.

create your app file and directory structure

The structure is as follows:
{ProjectName}/
{ProjectName}/run.py
{ProjectName}/config.py
{ProjectName}/energenie.py
{ProjectName}/apple-touch-icon-120x120-precomposed.png
{ProjectName}/apple-touch-icon-120x120.png
{ProjectName}/favicon.png
{ProjectName}/app/
{ProjectName}/app/views.py
{ProjectName}/app/__init__.py
{ProjectName}/app/static/
{ProjectName}/app/static/apple-touch-icon-120x120.png
{ProjectName}/app/static/christmastree.png
{ProjectName}/app/static/style.css
{ProjectName}/app/templates/
{ProjectName}/app/templates/index.html

The code

The following section has the code for each file along with a description of what that file is used for.

run.py

You will use this file to launch your application.

from app import app
app.run(host='0.0.0.0', debug=True) # Set to be accessible over the network with debugging enabled.

config.py

The config.py file does as you would expect. It is used to store config variables for the application.
SECRET_KEY = 'YourSecretKey'
The secret key is what ever you define. This is used by the flash messaging component.

app/views.py

This is the main part of your application. all of the processing happens here.

# Import statements.
from flask import render_template, flash
from app import app
from energenie import switch_on, switch_off

# Main page. accessible from http://yourIPAddress:5000/
@app.route('/')
def index():
return render_template('index.html', title='Christmas')

# Code that is called with http://yourIPAddress:5000/on. This turns on the lights and adds a message to say the lights are on.
@app.route('/on')
def on():
switch_on(1)
flash('Christmas tree lights on.')
return render_template('index.html', title='Christmas - Lights On')

# Code that is called with http://yourIPAddress:5000/off. This turns off the lights and adds a message to say the lights are off.
@app.route('/blue')
def off():
switch_off(1)
flash('Christmas tree lights off.')
return render_template('index.html', title='Christmas - Lights Off')

app/__init__.py

App initialization. Also includes the definition of the config file and tells flask that we are using views.py.

from flask import Flask
app = Flask(__name__)
app.config.from_object('config')
from app import views

app/static/style.css

You need to put static files into the static directory. The following style sheet definition defines some basic page layout options.

body {
margin-top:100px;
font-size: 30px;
}

.red-button-link {
text-decoration: none;
padding: 15px 20px;
background: red;
color: #FFF;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
border: solid 2px #20538D;
text-shadow: 0 -2px 0 rgba(0, 0, 0, 0.4);
-webkit-box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), 0 2px 2px rgba(0, 0, 0, 0.2);
-moz-box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), 0 2px 2px rgba(0, 0, 0, 0.2);
box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), 0 2px 2px rgba(0, 0, 0, 0.2);
-webkit-transition-duration: 0.2s;
-moz-transition-duration: 0.2s;
transition-duration: 0.2s;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
}
.red-button-link:hover {
background: red;
border: solid 2px #2A4E77;
text-decoration: none;
}
.red-button-link:active {
text-decoration: none;
-webkit-box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
-moz-box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
background: red;
border: solid 2px #23E5F;
}

.green-button-link {
text-decoration: none;
padding: 15px 20px;
background: green;
color: #FFF;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
border: solid 2px #20538D;
text-shadow: 0 -2px 0 rgba(0, 0, 0, 0.4);
-webkit-box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), 0 2px 2px rgba(0, 0, 0, 0.2);
-moz-box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), 0 2px 2px rgba(0, 0, 0, 0.2);
box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), 0 2px 2px rgba(0, 0, 0, 0.2);
-webkit-transition-duration: 0.2s;
-moz-transition-duration: 0.2s;
transition-duration: 0.2s;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
}
.green-button-link:hover {
background: green;
border: solid 2px #2A4E77;
text-decoration: none;
}
.green-button-link:active {
text-decoration: none;
-webkit-box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
-moz-box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
background: green;
border: solid 2px #203E5F;
}

PNG files

Add the graphics from the attached zip file if you like but if you would rather use your own, add them to the static folder.

templates/index.html

This is the template file. The UI that you will see is defined in this file.







Picture of the Christmas Tree.

Turn the lights on      Turn the lights off

{% with messages = get_flashed_messages() %}
{% if messages %}
{% for message in messages %}
{{ message }} {% endfor %}
{% endif %}
{% endwith %}




Download the files required in an archive

You may download the archive here

if you would rather not copy and paste the code.

Oct 182014
 

While writing on Thursday we were on a bus to Killaloe. It’s a small town in the region of Ontario. It was a part of the tour that I was looking forward to. In Ireland we have a town called Killaloe as well. A thousand years ago, this town was the capital of Ireland as it is where King Brian Ború ruled from. In 1014, Brian Ború was killed at the battle of Clontarf while defending Ireland from the Danes. Therefore, it was quite nice to meet people from a town with the same name here in Canada.

We travelled seven hours from Shannon in Quebec to Killaloe and the first sight that greeted us was streets lined with Irish flags, painted stones and scenery that rivalled our own. In fact, one of the people on the bus remarked: “It’s raining, the sky is grey, there are Irish flags and most of the names in the grave yard are Irish. It feels like home”. The people of Killaloe certainly made us feel like we had come home. We got off the bus to a lovely meal and a room full of people whose excitement was tangible. After eating enough for a small army, we were treated to some brilliant music from local musicians and dancers. Children as young as seven sang expertly and local musicians who had spent time in Ireland entertained us with stories and songs. Of course, we couldn’t just sit there all night so we gladly joined in. It was great to play with local musicians again. The quality of music over here is brilliant. I even got the chance to meet with a piper named Paul. He played the Scottish small pipes. Although they aren’t as nice as the Uilleann pipes, I was still delighted to give them a go. I’m quite happy with the tunes I got from them as well. They are played differently to the Uilleann pipes. Instead of the drones resting over your leg, they are suspended by the force of the air going through the bag over your right forearm just below your shoulder. They only have one octave and the wholes on the chanter are tiny. The set I played were in A and they sounded really nice.

We had a great typical traditional Irish session there. It was like being home.

Afterword, we were introduced to our host family and after a quick beer and a chat we got some much needed sleep. Killaloe is mainly built on top of one really large rock. Not that it’s relevant but it’s interesting. They also get tremors from time to time. The town is home to about 700 people and most have Irish names.

On Friday morning, we played in a primary school. There were two schools within about a minute walk away from each other. One is a public school and the other is a catholic school. I really liked that the children from the catholic school were invited to the public school for our performance. Our instruments were described in detail and we had a minute to play a short example. Of course, as I was playing in a school, I decided to have a bit of fun so I didn’t play an Irish tune, instead I played a children’s song called I’m a little tea pot. It was really funny. That tune was hummed by members of the group for an hour after the performance. It got stuck in people’s heads. The performance in the school only lasted an hour but I was energised by it for the day. I loved that the kids had no inhibitions about clapping along. It was so relaxed.

After the school performance we had a brief tour of Killaloe. The town is tiny so the tour only took about 20 minutes but it was interesting none the less. We heard about how the rail line was only used up until the 1950’s before it was removed. The tour guide mentioned that they could travel from there to Toronto and back in less than a day. Now it takes two days as public transport from or too Killaloe is very poor. The railway track was ripped out in 1986 after the stations was removed in 1960 and in 2004, a student completing her masters in gardening landscaped the area where the track ran through the centre of Killaloe to commemorate the railway. A path now runs over the same route that the track took and a design using red bricks on the edge of the path shows where the rack lay. We also heard about a large fire that destroyed 7 businesses and four houses in 1950. Fortunately, men in that had been drinking in a hotel on the same road fought the fire and successfully bought it under control before any further damage could be done. In 1927 a flood covered the same area with three feet of water.

As you can tell, I’m trying to soak up as much knowledge during my trip through Canada as possible. I am absolutely fascinated by the people, the geography and the history.

After the tour we passed a local radio station and as a few of us expressed an interest in it, we went in to pay the managers and presenters a visit. It’s a small local station with a catchment area of about 100 miles so in many respects, it’s similar to our local station LMFM. It’s a tiny place in the middle of the town. The walls are lined with records, tapes and a few CD’s. They have no computerized repository but a local man has written their station management software which is really interesting. They seem to have similar license requirements compared to our local stations. They are also streaming online so I’ve suggested that they stream to iTunes or at the very least podcast their live shows.

After the radio station, we paid a visit to their local grave yard. This was an unusual thing to do but if you think about it, it was fitting. I have had a real emotive connection to the stories and songs that I’ve heard in Canada. I have often thought of emigrating with my family and I’m still thinking about it. That’s a post for another day of course. It’s one thing thinking about emigrating but it’s another thing entirely leaving your family, your country, your friends and your culture to move somewhere else. I think it’s one of the reasons why I have been so enthralled by the songs and stories I’ve heard over here. People left here when there was no skype, no mobile phones, no Internet and no easy travel. They missed home. They were heart broken. To ease their suffering, and retain their unique identity, they spread the Irish culture. However, most of them dreamt of returning home someday. When they couldn’t, they asked that their origin be marked on their grave stone so that family and friends who came looking would find them. We found McCarthy, McPhail, Riley, Dwyer, Holly, Lynch, Geeran, Murray, Daly, murphy, Flynn, and many many more. The graves were often simple but some grave stones even had transcriptions and prayers in Irish. I get the impression that a hundred years ago, this was a thriving Irish settlement. They lost some of their connections with Ireland but they didn’t lose their identity or culture. Recently, with the Irish gathering, and now the Comhaltas tour, that connection has been firmly re-established and the elation of the 700 residents of Killaloe can be felt clearly.

The songs and stories really meant a lot to me but visiting the grave yard really had an impact on me. Yes, people made a life for themselves here and many of them were successful and have been the foundations of what are now thriving and solid communities but they still missed home. They still wanted to get back to Ireland and when they died, they wanted people know where they came from. Therefore, when everyone had gone, myself and Ken returned to the graveyard with two local ladies so that I could play two slow airs. It was my way of quietly paying tribute to those who left Ireland when there was little hope of returning. We had bought Irish culture to Killaloe and to their descendants but I wanted to bring some culture to their forbears.

I played amazing grace there as the first tune. It was the first time I played it since the 25th of May at my granny’s burial. It was quite difficult to play it again because it bought back a day I didn’t handle particularly well but it was fitting.

Last night, we played for a packed hall of 600 people. We were in great spirits starting the performance and our energy carried right through to the audience. They seemed to love it. My favourite solos continue to be Rebecca’s first tune on Fiddle, Anna on harp and Clara on Concertina. All the other musicians in the group are spectacular. Their solos reflect this but these are three of my favourites. In relation to the musicians, I have rarely seen such talent. I’m in awe of some of them. They play such an array of instruments and they have such a lovely style. I have no problem saying this either. I consider myself to be a reasonable piper and an adequate bodhran player but the day I stop learning is the day I’ll stop playing. I’m sure the others in the group feel the same but their standard is higher than I would ever anticipate reaching. Not that I’ll not try but you should hear some of the music that I’ve had the fortune to listen to while on this tour.

We went to a local family home after the performance to socialize with the volunteers and play some music. It was nice to get an opportunity to show our gratitude. We felt very welcome there so I hope they enjoyed our visit.

We’re back on the bus now for a short trip of two and a half hours to the next performance and the next host family. We’re nearing the end of our trip now. I’ll write more in a day or two.

Thanks for reading. Don’t forget to leave a comment on this or other posts to let me know if you’re enjoying them or if you have questions.