Oisín Hurley's Weblog

old dog, new tricks

Installing the DataMapper gem with Postgres.app

with 2 comments

Another install-related entry. This time, I’m attempting to install the Ruby Gem, DataMapper, for a small project – a mini app for pulling S3/Cloudfront download stats for my Verbose (iTunes link) podcast. The app pulls a date range worth of logs from S3, then digests the logs, putting the relevant data into a Postgres database, so they can be mangled at will later. 

I’ve installed Postgres.app on my MacBook Air, because I like the icon. I could have homebrew‘ed the database in, but since I don’t use it that often, it’s trivial to remove when bundled into the app. DataMapper has worked well for me in the past, so I’m sticking with it.

The whole reasoning behind using Postgres in the first place is that both AppFog and Heroku support it as their default SQL database. There’s no performance constraints, or scaling requirements here, since this is just a tiny, personal app. The main technology consideration is get-out-of-my-way-and-let-me-get-this-done-for-cheap.

But there’s always something. In this case it’s installing a Ruby gem with native extensions, when the collateral for building those extensions resides in a non-default location. 

Image

 

Making the install work involves using bundle config, an aspect of Bundler I didn’t know about. It allows you to override the arguments to the configure execution for native gem components. You can directly override when installing a gem, or you can register an override that will be stored in your ~/.bundle directory and remembered for future use. 

Here’s the incantation that worked for me, for a once-off install:

gem install do_postgres -- \
--with-pgsql-server-dir=/Applications/Postgres.app/Contents/MacOS \
--with-pgsql-server-include=/Applications/Postgres.app/Contents/MacOS/include/server

Written by oisinhurley

September 14, 2013 at 2:03 pm

Installing Erlang and Elixir on OS X Mavericks

with 5 comments

Homebrew is my go-to tool for non-App Store or prebuilt app installs on Mac, and has been for ages, just because I’ve found it easier to use than fink or macports. There’s been precious little trouble moving to mavericks, but Erlang is one item that didn’t install smoothly for me. The solution was to add a configure switch to specify a later version of OpenSSL that isn’t installed by default on Mavericks (on beta 3 at least). Right now, brew only supports extra configure switches through altering the brew formula, and I didn’t want to muck about with that.

With thanks to Steve Vinoski for some tips on the configuration of the Erlang source code build:

$ brew install openssl

will get a recent version of OpenSSL that Erlang likes. At the end of the install you’ll get a message

Caveats
This formula is keg-only: so it was not symlinked into /usr/local. Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble. The OpenSSL provided by OS X is too old for some software. Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables: LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include

The Erlang source build needs to know about that /usr/local/opt/openssl directory. Go download the Erlang source – if you are intending to install Elixir get the 16B01 version at least. Unpack the source, change into the source directory and issue the build configure like this (line breaks for legibility – paste-able version at this gist).

$ ./configure --disable-hipe 
              --enable-smp-support
--enable-threads
--enable-kernel-poll
--enable-darwin-64bit
--with-ssl=/usr/local/opt/openssl

Once you’ve configured the build, you might want to skip a couple of things – for example wxWindows and ODBC

$ touch lib/wx/SKIP lib/odbc/SKIP
$ make
$ sudo make install

Check that erl has found the crypto module ok

$ erl
Erlang R16B01 (erts-5.10.2) [64-bit] [smp:4:4] [async-threads:10] [kernel-poll:false]
Eshell V5.10.2 (abort with ^G)

1> crypto:start().
ok
2>
User switch command
--> q

Now for Elixir, it’s just a matter of going back to using homebrew and all should behave as expected.

$ brew install elixir
$ iex
Erlang R16B01 (erts-5.10.2) [64-bit] [smp:4:4] [async-threads:10] [kernel-poll:false]
Interactive Elixir (0.10.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> IO.puts("Woot")
Woot
\:ok
iex(2)>

Written by oisinhurley

August 25, 2013 at 8:45 pm

Posted in programming

Tagged with , , ,

Trying my hand at podcasting

leave a comment »

The closing stages of úll earlier this year featured two podcast recordings, live with the Unprofessional and The Talk Show guys. We were all in the audience, in the events room at Odessa, which happened to have a bar, and, well, we were all delighted, tired and emotional after a while, and in that fertile ground for promises and good ideas, the thought was thought – we should do this!

And, surprisingly, it happened, and you can subscribe to the first Verbose podcast. There’s a twitter account @VerbosePodcast and an app.net account @VerbosePodcast for further firehosery.

The podcast itself is a rambling country garden of stuff, mostly themed around iOS and iOS development, but we pick up on other things too, like Google I/O and some of the nuisances of making software.

Yes, we will do better on the sound next time around! Sorry!

Written by oisinhurley

May 22, 2013 at 7:05 pm

Posted in self-serving blog twaddle

Tagged with

Hobbit IMAX

leave a comment »

The Hobbit, in IMAX, was fantastic. Drain all bladders before taking your seat: there is something like 166 minutes of film, preceded by 30 minutes or more of trailer, ads, and the usually turgid mush about the mind-splittingly good technology that is going to make your experience unparalleled. 

Before we get into a brief description of the thing, I’d like to note that the Hobbit probably represents the only new estate in big budget blockbusters – all the trailers here were for reboots: Superman (again), Wizard of Oz (a sequel), Star Trek (OMFG again). 

This Hobbit screening was not only IMAX, it was 3D, which is generally of gimmicky quality. This, however, was very good – I couldn’t suppress a flinch at an incoming spear during the Star Trek trailer, and there were times when it appeared you were looking through a hole in the wall of the cinema rather than at a screen. No doubt, the 48fps had something to do with this. Pan shots were very smooth and there definitely was a parallax-scrolling effect going on during the wide travel shots.

Top tips: Do not sit near the front. You will be too close to the screen and you won’t be able to see the edges. Do not move your head around, the 3D effect appears to be delicate and even a moderate tilt will blur out parts of the picture. Do not bring excessively small humans, they have tiny internal waste storage spaces and may cause you to miss chunks of the movie when they need emptying. Do not bring a picky perfect recall of the book, loads of original material has been packed in to make a solid movie from what is really a short book constructed for the appreciation of young readers.

About twenty minutes from the end, the sound and picture streams de-synched at our showing, but by giving us free IMAX tickets for another show, the management of the cinema forestalled the impending torches and pitchforks mob. 

Take the top tips above and go see it.

Written by oisinhurley

December 15, 2012 at 11:49 am

Posted in opinion, self-serving blog twaddle

Tagged with

Dear @monkchips

leave a comment »

Dear @monkchips

Thank you for a exemplary conference experience at Monki Gras during a chilly and bright London January. You went deep on the craft theme and I think that resonated strongly with everyone there, because those people who were there loved and cared so much about what they do. That was the first thing that set it apart from ‘regular’ conferences.

Also there was beer, but not a surreptitious beer, not a beer that was pale and fizzy and gullished without pleasure by braying middle managers with grotesquely tumescent bellies and swollen man-boobs. This was a first-class beer that was knitted into the fabric of the conference and reflected the craft theme, that an attendee could openly savour in company in the noonday without fear of a judgement of functional alcoholism (to borrow a phrase from @jasonh). This was another welcome distancing from the mainstream, albeit I thought I had been mugged after checking my wallet post the Craft Beer Co. experience – though is the welcome price we pay for quality.

At this moment, in an echo of the event itself, I am writing this letter, drinking a craft pale ale in a craft beer pub that has newly opened across the road from my office, a whole 45 metres away from my desk. I feel that these echoes will continue to reverberate, perhaps to the detriment of my deadlines.

Let us return to the conference.

The food, made fresh in front of our eyes, the specially roasted coffee, the baskets of fucking fruit, all spoke to a care of consumption that really is usually ignored in favour of cost in our modern lives. Care and attention, @monkchips, care and attention to the smallest detail makes the picture whole and perfect.

In your carefully crafted environment, who could not be in a positive frame of mind, content and happy to be open and honest with their neighbor, even though they may be a temporary stranger? This brought the best out in the already well-qualified and excellent speakers, brought out the humour, brought out the honest expression normally present among a group of friends rather than between a conference speaker and conference attendees. I cannot speak for others – but forty minutes into the first day I was in the front row wishing I was up there giving a talk. What a crowd!

And your conference was filled with wonders – the .gov.uk affair was heart-stopping in its implications and amazing in the fact that it actually happened; – the data pretties entranced us and were in a second breath laid bare as shams if presented without context; – kittehs masqueraded, unchecked, as chikins; – the bombshell that companies get the UX they deserve was dropped; – machines with software that killed people were wheeled out; – the dysfunctions of technology executives were outed without ceremony; – the list could go on, if it weren’t for the line drawn under it by that 9.5 ABV beer, the name of which escapes me entirely.

This letter has just about reached its limit. Let me finish by mentioning that most important aspect of conference-going – personal relevance. I’m a technical co-founder, and my work life is trisected equally into states of euphoria, all-consuming flow and cold panic. At your conference, listening to the experiences and the judgements of those who have treaded this route before, I experienced an enormous feeling of validation – that I haven’t chosen the wrong technology stack; – that I’m not totally crazy for attempting to do what I am doing; – that these people have tried and succeeded and are not that different to me after all: and for that, especially that, I thank you and your team.

all the best
Oisin

p.s also – phone is teh awesome :)

Written by oisinhurley

February 3, 2012 at 7:50 pm

CoderDojo Dublin

with 5 comments

There’s been some buzz about CoderDojo in the news recently. The CoderDojo was founded by James Whelton in 2011 to introduce kids to coding at an age when they are still in school, in an environment that supports learning. With support from Bill Liao, CoderDojos have sprung up in nine locations around Ireland.

This is relevant to my interests, and I wanted to see what the whole thing was about. To get in, you need a kid, so I brought the ten year old rugby fanatic that hangs around my house and eats the food. He chose the Programming Games with Python session – no doubt wanting to fulfill his dream of getting a decent rugby game on his iPod touch at some point.

Let me digress briefly on the subject of teaching kids how to manipulate computers with software code. We use physical tools to supplement our physical selves – pushing a nail into a piece of timber with your thumb is rarely successful. We need to use computational tools to supplement our own mental computing capabilities and allow us to enhance our reasoning processes. We are already equipped to pick up a hammer, see a nail and get a fair idea what to do next, but pick up an iPod Touch and put a rugby game on it? It’s not obvious how to get there, so instruction is required. And instruction needs to be imparted early, not because we want to make more developers, not because we want kids choosing a career in coding, but because we want to give them the tools they need in the 21st century to allow them to take advantage of every opportunity that comes their way.

Back to the dojo. Our host Eugene had his work cut out for him: 25 or more young humans, with vastly different capabilities in the area, short attention spans and different laptops all around. I decided take Mr. Rugby ahead with a copy of a simple Python text game involving choosing a cave and hoping the dragon therein doesn’t eat you, taken from the syllabus book.

The programming journey went like this – at each stage we thought of a goal and massaged the existing code and added new code to get to it. The kid did all the typing, saving, running, copying, pasting. I just pointed out now and then similar chunks of code that he could reuse and got him through any blocks.

  • I say – let’s extend the game from a choice between two caves, to a choice between three.
  • Kid says – let’s print out which cave was which at the end of the game, so you can see which was the right one.
  • We discover that strings and integers were different :)
  • We discover that when one chooses three random numbers in the range 1..3, there’s a good chance two will be the same, and it doesn’t make sense to have a bad dragon and a good dragon in the one cave – they are territorial.
  • Kid surprises me by coming up with a simple but effective way to make sure that the numbers wouldn’t clash, and we implement it – without using the modulo operator

Then we were done with where we wanted to go. Eugene was taking the kids along, helping each individually if he need to do so, and going down the same path initially, making an extra cave in the game.

But our local journey hadn’t finished after all. The kid had decided that now it was time to do some visuals and had sketched out a picture with three caves with numbers over them. Here’s where having a software savvy dad and the internet is a win: we grabbed a free pixel art program, muddled out how to use it, and while he drew the screen, I frantically researched free Python game libraries.

Aside – before we got onto the visuals, I spotted a few areas in the code to put in a couple of for loops, and suggested we ‘tidy up’ the code a bit so that I could show these and explain them. Why? was the response, the thing worked didn’t it? The important thing at this point is to shrug and agree – the lad is not a professional coder, he doesn’t need to refactor, he just needs results. In fact the whole thing needs to be results-driven. This is why you use a tool – not because it’s lovely or elegant or makes you feel special, but because you have a job to sort out. Then you put the tool down. It’s only when you get trained in how tools work can you start making your own tools. cf. lightsabre etc

Eventually I stumbled over pygame, which turned out to be just the tool we needed. We made a plan to write a small programme to try it out, and there was palpable excitement when our extremely amateurish drawing of caves popped up, surmounted by a hand-scrawled Danger!! sign.

Screenshot of game

On the way home on the train, we designed an rugby-themed 8-bit scroller for the iPod Touch and set up the kid’s github account. When we arrived home the kid insisted, with uncharacteristic determination, that we finish the Dragon game – adding keyboard control, putting in dragon graphics, conveying the result visually. Next challenge: the rugby game. Yikes!

Very little of this article has been on the details of the CoderDojo, but you may have already realized how the CoderDojo was instrumental in making this tiny but important success work. It provided us (and I write ‘us’ deliberately) a place in which learning was the norm; it provided a place where myself and himself were on the same team working towards an external goal; it provided a place that wasn’t dominated by adults. And that last one is the key one I think.

Many thanks to Eugene and the team behind CoderDojo Dublin for their commitment and patience in putting the series together, they are providing an really valuable service, on their own time.

Written by oisinhurley

January 22, 2012 at 3:29 pm

ESB Spark O’ Genius

with one comment

I don’t write much about the Company, what with me being a self-effacing developer type with a disinclination to hyperbole. But we have an interesting week ahead of us. There are a couple of things happening — the first is about learning: the first module of the iGAP3 Program, subject matter being Strategy. There’s even homework! Due today! And it’s not done yet! I’m writing a blog entry instead — classic displacement activity. Provided I don’t have to wear the cone of shame, I’m looking forward to the session. The second thing is about exposure: we’ve entered Vigill in a number of these startup competitions, one of which was the ESB Ireland Spark of Genius, which is inextricably connected to the upcoming and massively hyped Dublin Web Summit.

As an aside, if you bump into me, don’t ask me how and when and what we did — if it’s not a story on Trello or a ticket at Assembla or a strange MongoDB query or trying to do capacity analysis for cloud service pricing, it’s difficult to get my attention these days. I’m merely the development angle here. Barry spins the visions and Helen hunts down and corrals the customers. Myself, more than ably assisted by Steve, has to make sure that the services don’t break and that we can make good on our promises and that there’s some kind of costing and schedule that makes sense.

The Brownies of Reward

The Brownies of Reward

Back to the competition. Last Friday we went out to a big lawyery place on St. Stephen’s Green with nine other companies to pitch to the judges in the semi-final stage of the Spark of Genius. Sitting in the Green Room there was a noticeable lack of G+Ts, but plenty of coffee, which was no doubt fuelling the nervous tittering of the individuals that were there to show off in front of the panel in the boardroom.

The panel turned out to be a dozen people — I still don’t know who half of them were — but we did our pitch, our multiply-practised 5 minute pitch, and then we toddled off, intercepted briefly by a posh lawyerly standup lunch and a bit of a hobnob with the great and the good.

Long story short, we just recently found out we had progressed to the final and there’s a short article in the Irish Times with an overview of all finalists. I remember being told that one of the important goals when running a company is to keep the organization off the front page, but the technology section is good, apparently. Myself and Barry have lined the meeting room with whiteboards and are bursting our brains to try to come up with a good presentation for the final which is on Thursday 27th at 1515 on the main stage of the Dublin Web Summit. Follow the @_vigill tweetstream for more information as it comes in.

Written by oisinhurley

October 21, 2011 at 2:58 pm

Follow

Get every new post delivered to your Inbox.

Join 3,976 other followers