will

Where there is a Will

Will McGugan's Blog

I am a freelance software developer living in Edinburgh Glasgow.

I post mostly about tech (particularly Python) and photography.

Background: A code monkey

This year, Ellen and I took a trip, roughly following the North Coast 500 route.

The West coast of Scotland is stunning. As a Glasgow cabbie observed, if it wasn't for the weather and the midges of the Scottish West Coast, Brits wouldn't bother leaving the UK for their holiday. I can't comment on the weather (which was beautiful), but he may have a point about the midges.

Here are some photos from that trip.

Thistles at sunrise. Taken at around 5.30am. Worth getting up for?

This image is part of a much larger panorama that I would like to print for my wall in three parts.

The iconic Highland Cow, or Highland Coo as we call them in Scotland.

If you aren't familiar with midges, they are tiny biting flies. Their vileness is brilliantly illustrated with the following video...

I've always been intrigued by HDR, but some of my earlier attempts have been pretty horrific (like someone ate a pack of crayons and vomited on the screen).

Sunsets are one of the few subjects where HDR really works. Without merging a range of exposures you can never expose for both the sun and the foreground. So I was quite pleased to get the following shot (in Flores, Indonesia).

The trick in processing an HDR photo is to make it look like it is not HDR. At least not obviously HDR...

In addition to Orangutans, my Indonesia trip was to photograph Komodo dragons. These are absolutely remarkable animals, and as close to a living dinosaur you can see today.

As excited as I was to see these animals, the experience was a little disappointing. The rangers lead us around a short trek through the forrest before returning to the beach where there a dragon was basking. It was all clearly staged.

Komodo Dragons are actually venomous, contrary to the popular belief that their bites kill with toxic bacteria in their mouths.

This was a juvenile dragon. We saw it meandering through the forrest, occasionally chewing on dry bones, trying to find sustenance. The temptation to hug him, and squeeze him, and call him George was string.

continue reading…

The Isle of May is a remarkable island just off the East coast of Scotland. Although tiny (less than 1km2), it is home to a remarkable amount of wildlife, birds in particular. I was lucky enough to visit with the Glasgow Photography Meetup group.

Here's a few shots from that day.

I think this is a juvenile gull. Post a comment if I'm wrong!

Photographing a bird in flight is a challenge, so I'm please I got this at all, but the plain background this doesn't make for a memorable photo.

There were some fantastic vantage points on the island where I could get eye-level shots like this one.

These photos were all taken with a Canon 500mm, which is an absolutely fantastic lens for bird photography and a good upper body workout.

This SO post prompted me to think about how you would go about customizing a entire Django site (not just an app). Particularly if it is a third party project, still in development.

Forking the site repository is a solution, but the more customizations you make, the more awkward it becomes to merge upstream fixes and features. The problem is compounded if you have multiple deploys, with custom templates, assets, and settings.

I wanted to do a quick write-up of how this would be done in Moya, where customization is more of a first-class concept.

I'll briefly go over how you would serve a Moya site with a custom template, without modifying any of the original files. The project I'll be customizing is Moya Techblog which power this blog. continue reading…

My first wildlife trip this year was to Indonesia to shoot orangutans and Komodo dragons. This post is about the former, I'll save the dragons for another post.

These photos were taken in Bukit Lawang, North Sumatra, which has a sanctuary for Sumatran Orangutans (there is another species in Borneo). They offer guided treks to see the animals, which are mostly rescue animals that have been re-introduced to the wild.

I think this is my favourite shot of the trip. It seems almost posed. continue reading…

Inthing can take a screenshot of your desktop then post it online.

Here's a quick example:

Alternatively you can do the same thing from the command line with the inthing app. The following is equivalent to the Python code (assuming you have set up the stream and password environment variables):

See the docs for more details.

Screenshot capabilities courtesy of the excellent pyscreenshot library.

Screenshot taken with Stream.screenshot

Just landed in inthing is a new and quite interesting feature.

Version 0.1.4 adds a capture method which will record all standard output, i.e. anything you print to the terminal. It works as a context manager. Here's an example:

Any print statement inside the with block will be captured and posted online with the block exits.

You can also do something similar from the command line, with the inthing capture subcommand, which posts anything you pipe in to it as an event.

lets say you wanted to post the version of all you installed Python packages online. You could do something like the following:

For more information see the Inthing docs.

Inthing is still technically in beta, but these features are quite solid. Please give them a try, and let me know how it goes!

My entry for /r/WildlifePhotography competition

Male Atlas Beetle

The Django code in this post comes from the official Django tutorial.

I've tried not to be disingenuous with the comparison, and I'm only going to compare like with like, so I can show code from both frameworks and let you draw your own conclusions. I'll cover the areas where they differ in another post.

Both Moya and Django use models to map databases on to familiar data structures. In the case of Moya, the mapping is done with SQLAlchemy. Django uses its own ORM.

Here's the models.py from the Django tutorial and a Moya version: continue reading…