OJ's rants

It's not about you, it's about the software

Issue With Google Reader

| Comments

For some reason Google Reader has failed to update and include my latest Web Development in Erlang post. This is rather odd as every other RSS reader I have tested (including the one built-in to MS Outlook) has managed to parse and handle the post just fine. I have attempted to get in touch with the GReader team but I haven’t had any luck so far in getting them to respond.

Those of you who are using Google Reader and are interested in this post, please point your browser in this direction.

Apologies for the issue.

Webmachine, ErlyDTL and Riak - Part 3

| Comments

Riak LogoFor those of you who are new to the series, you may want to check out Part 1 and Part 2 before reading this post. It will help give you some context as well as introduce you to some of the jargon and technology that I’m using. If you’ve already read then, or don’t want to, then please read on!

This post builds on the previous two, but not without a few little modifications. If you’re interested in following along step by step with your own version of the code running, then get yourself a copy of this changeset before doing so.

In this post we’re going to cover:

  1. A slight refactor of code structure to support the “standard” approach to building applications in Erlang using OTP.
  2. Building a small set of modules to talk to Riak.
  3. Creation of some JSON helper functions for reading and writing data.
  4. Calling all the way from the Webmachine front-end to Riak to extract data and display it in a browser using ErlyDTL templates.

There are quite a few code snippets in this post as well as output from script executions and bash sessions. To avoid confusion, all file listings reference the path to the file that is being modified relative to the root of the project folder.

Be warned, this is a long post :) Get yourself a shmoke und a pancake, a glass of your favourite beverage and put some relaxing music on (instrumental is best).

Are you ready? OK, here we go …

ASP.NET MVC 2, Random Sign-offs and TempData Loss

| Comments

MVCIn the last few days I’ve been working on resolving issues in a production system which runs on ASP.NET MVC 2. Most of the issues were actually really easy to resolve and the team of developers were able to fix them and deploy to production without too many problems.

Unfortunately, as always, there was one problem in particular that had us scratching our heads and was causing some of us to lose sleep. All over the Internet there were posts of people describing similar symptoms yet none of them revealed a solid answer.

The purpose of this post is to document the issue and the resolution in it’s entirety. It’s in story form rather than reference form because that’s how I felt like writing it :)

Webmachine, ErlyDTL and Riak - Part 2

| Comments

Riak LogoIn Part 1 of the series we covered the basics of getting the development environment up and running. We also looked at how to get a really simple ErlyDTL template rendering. If you haven’t yet gone through Part 1, I suggest you do that now. If you have, read on!

There are a few reasons this series is targeting this technology stack. One of them is uptime. We’re aiming to build a site that stays up as much as possible. Given that, one of the things that I missed in the previous post was setting up a load balancer. Hence this post will attempt to fill that gap.

Webmachine, ErlyDTL and Riak - Part 1

| Comments

Riak LogoIt has been a long time coming, but the first post is finally here! This is the first in a series of post, as promised a while ago, covering off web development using Erlang. This post is the ubiquitous “get up and running” post, which aims to get your environment set up so that you can dive in to development. The next post will detail how to handle a basic end-to-end web request.

First up, a few things we need to be aware of before we begin:

  1. The information in this post has only been verified on Linux (Mint to be exact). It should work just fine on Mac OSX. I’m almost certain that it won’t work on a Windows machine. So if you’re a Windows developer, you’ll have to wait for another post down the track which covers off how to get your environment ready to rock.
  2. We’ll be downloading, building and installing Erlang, ErlyDTL, Riak and Webmachine.
  3. Rebar is the tool we’ll be using to handle builds, but I won’t be covering it in any depth.
  4. You will need the latest versions of both Mercurial and Git so make sure they’re downloaded and installed before you follow this article.
  5. We’ll be doing some interaction with Riak via curl, so make sure you have it downloaded and installed as well.
  6. This is intended to be a step-by-step guide targeted at those who are very new to web development in Erlang. This may not be the most ideal set up, nor the best way of doing certain things. I am hoping that those people who are more experienced than I will be able to provide feedback and guidance in areas where I am lacking.
  7. Over the course of this series I’ll be attempting to build an Erlang version of the Code Smackdown site that I’ve been working on here and there with a mate of mine. You’ll see that the sample application we’re working on is called “csd” for obvious reasons.

OK, let’s get into it. First up, Erlang.

BFPG June Meetup

| Comments

Erlang LogoThe time has come for another meeting of the Functional Programming minds! This months BFPG Meetup, starting 6pm Monday 28th, is the first one at our new venue: Microsoft HQ, Waterfront Place, Brisbane. For details on the location, take a look at the BFPG about page.

Erlang LogoThis month we have three speakers, and I am one of them! In my talk, “Erlang - Why should you care?”, I will be giving a fairly non-technical introduction to Erlang. I’ll be covering off the features of the language, some of its design goals and its history. I aiming to show that this language is not one that was spawned out of academia and that it has been applied in the real-world ever since its conception. If I have time, I’ll also be giving a small demonstration of one of the neatest features of the technology.

Erlang Logo I’ll be posting the slides and demonstration code here on this blog as well as BFPG’s home after the meetup has taken place.

Myself and my comrades, Tom and Tony, will aim to provide a fun and interesting evening at our new venue. Based on the RSVPs so far, it looks like we are going to have one of the biggest turn-outs to date. This is probably due to the exposure we got during last month’s talk by Dave Thomas. There are still plenty of spots left, so if you’re keen to come along, go and sign up. Bring your friends, your friend’s friends and your mum.

I hope to see you there!


Update (6th July 2010): We had a fantastic turn-out of just short of 50 people (a record breaker for the group so far!). My talk seemed to be fairly well-received. No rotten tomatoes were thrown and the crowd seemed engaged through most of the talk. It felt good! I think many people wanted to see more code, but since that wasn’t the focus of the talk they were a little disappointed. If people are keen for more Erlang goodness at future meetups, then I’ll be happy to dive a little deeper.

Here’s a video of my talk:

OJ Reeves - Erlang - Why Should You Care.

As promised, here are the slides:

  1. PPTX
  2. PDF (Google Docs)
  3. PPT (Google Docs)

If you have issues reading the slide deck, or would like it in another format, then please drop me a line.

Dave Thomas at YOW! Nights Brisbane

| Comments

Haskell LogoTwo nights ago I was fortunate enough to attend a YOW! Nights conference held at the local Microsoft Office here in Brisbane. The speaker for the session was none other than Dave Thomas, the man behind the likes of ObjectMentor. Not only is this guy incredibly switched on, he is thought-provoking and very entertaining to boot. I’ve been to a few of these sessions in the past but I’ve never seen one as packed out as this one. It was great to see such a turn-out, which no doubt was boosted by the presence of both the Queensland MSDN Users Group and the Brisbane Functional Programming Group.

The Issue of Perception

| Comments

What is Perception?

As cheesy as it sounds, I’m going to start off with a definition ripped straight off Dictionary.com:

perception

noun

  1. the act or faculty of apprehending by means of the senses or of the mind; cognition; understanding.
  2. immediate or intuitive recognition or appreciation, as of moral, psychological, or aesthetic qualities; insight; intuition; discernment: an artist of rare perception.
  3. the result or product of perceiving, as distinguished from the act of perceiving; percept.
  4. Psychology. a single unified awareness derived from sensory processes while a stimulus is present.
  5. Law. the taking into possession of rents, crops, profits, etc.

A classic EscherTake a moment to digest the meaning of the word. Can you see how subjective it is? One’s perception varies greatly depending on the observer. The motivation of the observation is also going to skew how one is perceived. The relationship one has with the observer is also going to impact how that observer perceives you.

Finally, it’s important to note that what was perceived and any point in time is not necessarily the same as what actually occurred.

I’m So Impressed I Want to Pay You Less

| Comments

Slave driverThe title of this post is a statement that I’ve heard a few times in the past while at work. The people who said it might not have used those exact words, but the intent is the same. Usually I hear it in the following form:

“We’re very happy with the work you’ve done for us as a contractor. We want to keep you on, but would like you to take a job as a permanent employee and continue to work on the project.”

Once they’ve made this point, they then feel the need to harp on about the good points of becoming a permanent employee. Things such as job security, sick/annual leave and better hours tend to get mentioned. All of them are complete bullshit of course.

There is no such thing as job security. Sick and/or annual leave isn’t enough to make up for the difference in pay. Hours tend to always be worse when you’re working for the man, because you’re expected to do whatever needs to be done regardless of the hours. This is worse if you’re working on mission-critical stuff.

Truncated Pages

| Comments

Not too long ago I mentioned that I’d setup and installed Nginx on this server. All seemed well to start off with, then on certain occasions I started to notice that some pages were being served truncated while I was at work. I thought that the issue was work-related, as they have a fairly draconian security policy in place and I thought that it had something to do with severing the connection.

This assumption was proved false a few days ago when I received an email about my Trac/Mercurial/SSH post not rendering properly in someone else’s browser. Dammit!

So this time I actually did a bit of research by delving into the log files (yes, I know.. genius isn’t it!) and determined that there was indeed a problem. Thankfully it was fairly simple to resolve. For some reason the fastcgi instances were failing to function periodically when attempting to access a folder on disk. In short, some of the temp folders were owned by the right user, and some of them weren’t. After modifying the ownership of the appropriate folders, everything seems to be running nicely.

Yet more proof that the admin is an idiot.

If after I post this you notice any truncation at all across the site, please let me know! Cheers!