Tuesday, 13 December 2011

Virtual keyboards and "feelable" touchscreens


Senseg made a splash recently when they revealed their touchscreen technology which allows you to actually "feel" objects on-screen. By manipulating small electric charges, users can actually feel texture as they interact with a touchscreen. It'd be too easy to dismiss this as a gimmick, however I think this type of technology has the potential to make a positive impact on mobile devices.

Touchscreens are becoming increasingly ubiquitous in mobile devices, leading to the demise of the hardware keyboard. A glance at the list of all HTC phones in their current line-up shows only two of seventeen phones with a hardware keyboard. Samsung again only offer two phones with a hardware keyboard. While touchscreens offer the ability to eliminate hardware keyboards and other unsightly buttons for the sake of sleek aesthetics, they've so far failed (in my opinion) to provide a suitable replacement for hardware keys.

Yes, touchscreen keyboards are flexible and can offer a variety of layouts, however they still don't give sufficient physical feedback to allow fast touch typing. One reason we're better at typing on physical keyboards is because we "know" where our fingers are. The edges of keys (and the raised bumps often found on some keys) provide reference to other locations on the keyboard. Without looking at the keyboard, an experienced typist can type upwards of 100 words per minute. On a touchscreen, without proper physical feedback, you can expect just a small fraction of those speeds.

One argument against that could be the screen size, however tablets suffer from the same problems. The 26 character keys on my keyboard are of comparable size to the virtual keyboard on my 10-inch tablet. A popular approach to providing feedback for a mobile devices is to vibrate upon key press, however this provides little information other than "you've pressed a key". An alternative approach to making touchscreen keyboards easier to use has been patented by IBM; a virtual keyboard that adjusts itself to how users type on-screen. Auto-correct is another feature which has risen to aid the use of virtual keyboards, yet addresses the symptoms rather than the cause.

Enter touchscreens you can "feel". Actually being able to feel (something which resembles) the edges of keys on a virtual keyboard is likely to make it much easier to type on touchscreen devices. If technology becomes available which allows effective representation of edges (which Senseg claims their technology can), touchscreen devices will be able to offer what is, in my opinion, an improvement to virtual keyboards. I think this could be of particularly great benefit on tabletop computers which, by nature, allow a more natural typing position than handheld devices. Or perhaps this is all just wishful thinking because I go from 110WPM at my desktop to around 5WPM on my phone.

Wednesday, 23 November 2011

Running Visualisations

A heatmap of every run in November so far

Tonight I've been playing around with a python script which generates heatmaps from GPX files. The image above is a composite image of my last 10 runs in November (taken from my phone). It's fairly easy to see where I run most often.

What would be really cool would be if there was some way to visualise speed at a given point. The above image uses colour intensity to encode frequency of location; the more intense the colour, the more often I've run there. I'd find it interesting if it was possible to use colour to encode movement speed at a given point. For example, you could calculate the average speed across each run being visualised, and use different colours to represent above and below average, with varying saturation being used to represent how much above or below the average you were at that point.

Although I've seen a few existing methods of visualising speed (typically line charts), I've yet to see one which shows the relationship between speed and location. Endomondo and similar websites approach the issue by showing a map and separate chart for speed, and moving your mouse over either shows the corresponding location on map or speed on the chart. This exploratory method doesn't really give a good overview of the information.

This has the makings of a potential side project...

Tuesday, 15 November 2011

Android workshop and Surface

It feels unusually warm for November, which has made the past week quite pleasant for running. I've gotten 4 runs in over the last week, and I'm hoping to keep up at least 3 runs a week until the end of the semester. Dr Cutts talk last Wednesday on computing science education has caused a bit of introspection on how I use my time, and has made me realise that I don't always spend it wisely. I'm a workaholic, I get lots of work done, and I consider myself to be quite well organised. But maybe I could achieve similar things in a lot less time. Lately I've been focusing more on coursework, really trying to get as much done as early as possible. I've never had to pull an all-nighter working towards a deadline before, and I certainly don't plan to start any time soon.

I'm excited for the start of Week 12 because, other than the obvious reasons of having no more deadlines, I'm likely going to be putting on an Android development workshop in the School of Computing Science, along with another classmate. It'll be cool to give something back like that, and hopefully attendance is pretty decent. I'd certainly hope so, given that the Mobile Software Engineering degree has over 5 times as many students this year as last. The more Android projects I work on, the more I notice patterns emerging and the ability to re-use code. Things have gotten to the point now where any project I do in Android has about 50% re-used code. I think myself and James have a decent amount of experience to offer and can help teach other developers how to address problems that we've already encountered.

Week 12 is also the start of a fortnight dedicated to project work. My project at the moment is in quite a good state, I reckon. As far as implementation is concerned, I'm well ahead of schedule and the main technical concerns have been addressed. I don't know if I've mentioned it before, but I'm working with Microsoft Surface this year, and one of the technical challenges I'm approaching is how to display information when the Surface has stuff on top of it. I find this an interesting problem because it's only natural that a tabletop computer has to remain usable at the same time as being used as a table.

So far I've been iteratively developing a prototype which displays a shape in the largest unoccluded space, and have just started to animate this shape as it moves around the tabletop due to objects being placed on or removed from the Surface. There's some really cool stuff going on to make this work, and we (my project supervisor an I) are probably going to submit a work-in-progress paper to CHI2012 about our research so far. It's a new and novel area of research and it'd be the highlight of my academic "career" if that paper gets accepted.

Here's a terrible quality video I took earlier showing a prototype in action.


Wednesday, 26 October 2011

Left-recursion in Parsec

Lately I've been using the Parsec library for Haskell to write a parser and interpreter for a university assignment. Right-recursive grammars are trivial to parse with combinatorial parsers; tail recursion and backtracking make this simple. However, implementing a left-recursive grammar will often result in an infinite loop, as is the case in Parsec when using basic parsers.

Parsec does support left-recursion however. Unsatisfied with the lack of good tutorials when I googled for advice, I decided to write this. Hopefully it helps someone. If I can make this better or easier to understand, please let me know!

Left recursive parsing can be achieved in Parsec using chainl1.

chainl1 :: Stream s m t => ParsecT s u m a -> ParsecT s u m (a -> a -> a) -> ParsecT s u m a

As an example of how to use chainl1, I'll demonstrate its use in parsing basic integer addition and subtraction expressions.

First we'll need an abstract syntax tree to represent an integer expression. This can represent a single integer constant, or an addition / subtraction operation which involves two integer expressions.

data IntExp = Const Int
            | Add IntExp IntExp
            | Sub IntExp IntExp 

If addition and subtraction were to be right-associative, we'd parse the left operand as a constant, and attempt to parse the right operand as another integer expression. Upon failing, we'd backtrack and instead attempt to parse an integer constant. Reversing this approach to make the expressions left-associative would cause infinite recursion; we'd attempt to parse the left operand as an integer expression, which attempts to parse the left operand as an integer expression, which tries to... you get the point.

Instead we use chainl1 with two parsers; one to parse an integer constant, and another which parses a symbol and determines if the expression is an addition or subtraction.

parseIntExp :: Parser IntExp
parseIntExp =
  chainl1 parseConstant parseOperation

parseOperation :: Parser (IntExp -> IntExp -> IntExp)
parseOperation =
  do spaces
     symbol <- char '+' <|> char '-'
     spaces
     case symbol of
       '+' -> return Add
       '-' -> return Sub

parseConstant :: Parser IntExp
parseConstant =
  do xs <- many1 digit
     return $ Const (read xs :: Int)

Here, parseOperation returns either the Add or Sub tag of IntExp. Using GHCi, you can confirm the type of Add as:

Add :: IntExp -> IntExp -> IntExp

So, we have a parser which will parse a constant and a parser which will parse a symbol and determine what type of operation an expression is. In parseIntExp, chainl1 is the glue which brings these together. This is what allows left-associative parsing without infinitely recursing.

A complete code sample is available here. The abstract syntax tree has been created as an instance of the Show typeclass to print in a more readable format, which shows that the grammar is indeed left-associative.

ghci>  run parseIntExp "2 + 3 - 4"
((2+3)-4)

Thursday, 13 October 2011

Another reason I like C#

A lot of people seem to be finding their way here because of my post about finding the maximal area submatrix in a binary matrix in C#. I found this post from a couple of weeks ago which shows the same idea in Haskell. It's interesting to see a similar idea presented in a different language; especially one as awesome as Haskell.

After a couple of hours of writing in C# earlier I've found a feature of the language that I really like: indexors. They allow array-style indexing of user-defined classes, which would be particularly useful for data structures. I really like that something which has typically just been syntactic sugar for array access is available to developers. Why? Because we're too lazy to write foo.get(x, y) when foo[x, y] is also available.

Wednesday, 21 September 2011

Learning to play harmonica

My new harmonica.
As it turns out, lectures don't start until Monday, so (excluding a short workshop tomorrow afternoon) I don't really start back at university this week. That's given me an extra few days to recover and get over this illness. My cough is almost gone, thankfully.

I bought a harmonica a week ago and I love the wee thing. I seem to have picked it up quite quickly and can knock out a few riffs and jam along to some backing tracks, but my embouchure could be a lot better. Practice makes perfect, though. Right now I'm doing my family a favour and practising while they're out of the house. Apparently my grandmother was a good harmonica player, although I don't imagine she jammed along to blues music. Maybe I'm wrong...

I suppose I'm the only musical person in two generations of my family. My grandmother came from a very musical background (I think her mother was a music teacher) and my grandfather was quite musical too, but it seems to have skipped a generation and no-one else plays anything. I've spent a lot of my life playing music, having played bass and guitar since very early in high school. Since university I've also started to play ukulele and harmonica.

Last week I was unable to do any exercise but as I'm feeling a bit better now, I've started to run again. I've ran three times since Monday and I'm slowly getting back into it. You'd be surprised at what effects even a week of illness can have on fitness. I know I'm not going to be breaking any personal records at the moment (actually that's a lie, I ran my fastest ever mile on Monday) but right now I'm just trying to limit damage.

Sunday, 11 September 2011

Finding maximum zero submatrix with C#

After spending most of this evening attempting to solve this problem, it only feels right that I share my solution.

Suppose you have a binary matrix and you wish to find the largest zero submatrix, i.e. the largest rectangle of zeroes in the matrix (see below, highlighted in orange).

1 1 0 0 0 1 0
1 0 0 0 0 1 1
1 1 0 1 0 1 1
1 1 1 0 1 1 0

The brute-force approach to this problem isn't particularly efficient, with complexity O(n2m2). It involves looking at every position in the matrix, taking that position as an arbitrary point of the submatrix (e.g. the top-left point) and then testing all possible rectangles which originate at that point (e.g. all possible bottom-right points).

This algorithm finds the largest zero submatrix by looking at each position in turn and attempting to "grow" the submatrix up, to the left, and to the right. A dynamic programming approach is used and it keeps track of where the value 1 occurs. Array d contains the previous row where a 1 was found for each column. Array d1 contains the position of the left borders, and d2 contains the position of the right borders.

A complete code snippet for this program is available here. This has code to output the results and shows how to make use of the values calculated in this function.

static void MaxSubmatrix(int[,] matrix)
{
 int n = matrix.GetLength(0); // Number of rows
 int m = matrix.GetLength(1); // Number of columns

 int maxArea = -1, tempArea = -1;

 // Top-left corner (x1, y1); bottom-right corner (x2, y2)
 int x1 = 0, y1 = 0, x2 = 0, y2 = 0;

 // Maximum row containing a 1 in this column
 int[] d = new int[m];
 
 // Initialize array to -1
 for (int i = 0; i < m; i++)
 {
  d[i] = -1;
 }

 // Furthest left column for rectangle
 int[] d1 = new int[m];

 // Furthest right column for rectangle
 int[] d2 = new int[m];

 Stack<int> stack = new Stack<int>();

 // Work down from top row, searching for largest rectangle
 for (int i = 0; i < n; i++)
 {
  // 1. Determine previous row to contain a '1'
  for (int j = 0; j < m; j++)
  {
   if (matrix[i,j] == 1)
   {
    d[j] = i;
   }
  }

  stack.Clear();

  // 2. Determine the left border positions
  for (int j = 0; j < m; j++)
  {
   while (stack.Count > 0 && d[stack.Peek()] <= d[j])
   {
    stack.Pop();
   }
   
   // If stack is empty, use -1; i.e. all the way to the left
   d1[j] = (stack.Count == 0) ? -1 : stack.Peek();
   
   stack.Push(j);
  }

  stack.Clear();

  // 3. Determine the right border positions
  for (int j = m - 1; j >= 0; j--)
  {
   while (stack.Count > 0 && d[stack.Peek()] <= d[j])
   {
    stack.Pop();
   }
   
   d2[j] = (stack.Count == 0) ?  m : stack.Peek();
   
   stack.Push(j);
  }

  // 4. See if we've found a new maximum submatrix
  for (int j = 0; j < m; j++)
  {
   // (i - d[j]) := current row - last row in this column to contain a 1
   // (d2[j] - d1[j] - 1) := right border - left border - 1
   tempArea = (i - d[j]) * (d2[j] - d1[j] - 1);

   if (tempArea > maxArea)
   {
    maxArea = tempArea;

    // Top left
    x1 = d1[j] + 1;
    y1 = d[j] + 1;
    
    // Bottom right
    x2 = d2[j] - 1;
    y2 = i;
   }
  }
 }
}

Tuesday, 6 September 2011

East vs West

The most noticeable difference, at least from an outdoors perspective, between where I've been staying on the east coast of Scotland and where I live on the west? It's so flat! I've smashed my personal bests for running (for distance, not speed) without my quadriceps even complaining. At home, however, it feels like I'm almost always going either up or downhill.

It's not that I dislike uphill running, no, it's the downhill stretches that get to me. I find uphill running to be relaxing; it strongly encourages good form and pace, else you'll burn out quickly. I like feeling "in the zone" as I (slowly) make my way up the hill. Downhill, though, just doesn't feel right. Maybe I'll get used to it as I run more.

In my 100 miles challenge, I've covered 70. That leaves me with 30 miles in 11 days; easy! A couple of bike rides in there and I'm set.

I'm going to have to organise my time better once university starts back. Last year I failed to make a compromise between work and fun and training and as such cut out the training completely. That has taken it's toll on my body and my fitness and I'm determined to not have that happen again. It won't be easy finding time to stay on top of studies as well as just chilling out and training, but I'll find a way.

It'll help my studies too. I love that feeling where your mind empties when you're out pushing yourself and you get a fresh perspective on things. One of my lecturers in first year said the best way to tackle programming problems was to sleep on it; just step away from the computer, go for a walk and think about it. You're dead right, Quintin.

Tuesday, 30 August 2011

Side projects and running

Yesterday I started work on a new Android project, to pass some time and to create something which I, and hopefully others, will find useful. It's going to be an editor for GPS files which allows you to create, edit and share routes, using gpx (GPS exchange format) files. With the help of a friend, it's already made good progress in to something really lacking in features and polish, but still usable.

The image above is a screenshot showing what's implemented so far. Routes can be drawn by tapping the touch-screen to add a new waypoint and altered by dragging-and-dropping existing waypoints. Something I may also implement, if I can find out an elegant way to do it, is selecting points by a long press and then giving the option to, say, delete it.

Right now we're working through a to-do list and turning this into something which may eventually end up on the Android Market. Just after starting it, though, I'll be putting it on hold for a few days while I go off to stay with family on the other side of the country. Hopefully the weather stays reasonable, because I'll be taking my hiking boots, running shoes and, maybe, bike. It'll be great to just chill out, explore new places, and unwind for a few days.

I'm almost halfway there in my 100 mile challenge; I've covered 47.5 miles so far in the past 13 days. I've been running so much lately that I'm not racking up the miles as fast as I would be if I were cycling. My running is certainly improving though; both in speed and endurance. My technique is beginning to get more consistent as well, which is helping me to pace myself.

Wednesday, 24 August 2011

C#, Surface and Running

Since my last post I've taken up running. I've bought new shoes, fought through some hiking blisters and learned that I need to smarten up and pace myself. Running never really appealed to me before, but that was largely because I sucked at it. I'd put on any pair of trainers and head out without any consideration for progression and form. It was really an oversight on my part, because I've had experience with weightlifting which taught me to put an emphasis on proper form and planned workouts aimed at making progress.

Hiking in North Cyprus
I wish I was there again...
I'm addressing all of these issues now though and for the past week have been starting to carefully build up a base of fitness. Walking and cycling over the past few weeks has improved my fitness but I still need to ease my body into this, especially as running is more of an "impact" sport than cycling. My running trainers are comfortable and provide just as much support as I need, being flat footed. I've not yet ran over 2 miles in a single session, instead focusing on starting small and building my distance up slowly. After this post is finished I'll be heading out for another, while there is a break in the rain.

I'm a week into my 100 mile challenge and I've already covered 29 miles. Feels good.

In my fourth year of university I'll be undertaking a solo project which accounts for a significant part of my degree. Although I'm still discussing and arranging the details, I'm most likely going to be working with Microsoft Surface, Microsoft's touch-screen tabletop computing system. It's a technology completely new to me and I'm excited about working with it.

Of course, that means learning to develop for it, which also requires me to learn C# (C sharp), a language I've got no experience with. So far I've had no difficulty with it; it's so alike to other languages that I've used before. It has some small details though which I really like.

One of these is "Properties". Properties provide easy encapsulation without the need to explicitly call accessor and mutator methods. Whereas encapsulation in Java requires that for a private variable foo you create and use methods getFoo and setFoo, C# allows you to do the following:

public class Nyan
{
    private int foo;

    public int Foo
    {
        get { return foo; }
        set { foo = value; }
    }
}

Although the definition is similar to that in Java, it means you can access foo through the Foo property, like so:

x = Nyan.Foo;
Nyan.Foo = 15;

It's a minor detail, but it's an idea I really like.

Tuesday, 16 August 2011

The weather has it in for me

Port Glasgow
Port Glasgow, looking across the Clyde

I just walked five miles, most of it in the rain, to reach my goal of 50 miles, a week early! As I sit in my room looking out of the window, an hour after arriving home, I cannot see a cloud in the sky. This has been a common occurrence lately, with the bad weather coinciding with my decisions to go for a walk.

The recent rain has taken it's toll in the areas I walk, with tracks submerged under muddy water or slippery. Even when it isn't raining, my hiking boots are still getting soaked. I've not been mountain biking lately as a result; not because I dislike riding in the rain, I really don't mind it, but I cannot really be bothered to clean my bike afterwards. Hopefully things dry up again soon and I can head back out into the hills by bicycle.

With a week still to go, I've reached the goal I set myself of walking 50 miles (exercise; not including walking to/from work, shops etc.) in a month. It was an enjoyable challenge and motivated me to head out into the hills more. The exercise certainly helped me, and it's encouraged me to get back into mountain biking as well.

Carrying on from the previous challenge, I'm going to set myself another. Starting tomorrow, I'm setting myself the goal of walking, running and mountain biking 100 miles in a month (finishing on September 17th). As before, this won't include commuting. I'm really going to have to rely on my bike to rack up mileage this time around.

Really, 100 miles in a month is nothing. Heck, two years ago I'd cycle that in a week! I'll get back there, sooner or later...

Sunday, 7 August 2011

33/50

Inverkip & The Clyde
Looking across the Clyde, from the Greenock Cut
Since I set my goal of walking 50 miles in a month, I've walked almost 33. I've got over 2 weeks to go, so I see myself reaching this goal easily. Were it not for foot ailments which set me back a bit last week, I'd be very close to finishing already. It's not all bad though; a short break from walking gave me the chance to get back into mountain biking. My strength in the saddle is slowly increasing; I'll be sprinting up hills again in a couple of months!

Yesterday I walked the Greenock Cut, an aqueduct which runs around the hills behind Greenock. It was a good 8 mile hike and it stayed dry for most of the walk. I've lost count of how many times I've been around the cut (either by foot or bike), but yesterday was possibly the first time I did the entire walk clockwise. It was pleasant; from a distance, Greenock looks quite agreeable. Part of the trail overlooks what was my high school. It's hard to believe it's been 5 years since I finished there - time has fair flown by.

The weather forecast looks quite reasonable tomorrow and I'm hoping to get a walk in on my lunch break. I've been walking around Kelvin Park quite a bit this summer and it's amazing how quiet it gets on wet or overcast days. I've seen it going from packed on a sunny day, with not an unoccupied bench in sight, to completely empty the next; just because of a light shower.

Tomorrow will be the start of my remaining three weeks at work. It's been an interesting summer, although I'm already getting a taste of adventure for my short break afterwards. I'm planning a couple of camping trips and breaks away. Arran will definitely be visited, just so I can finally hike Goat Fell and get it off my to-do list. Depending on what else is in the area, I may camp in the glen and do something the next day as well. Inspired by something I was reading earlier, wild camping with a couple of Munros in the Crianlarich area is also a possibility. I have three weeks to decide...

Sunday, 31 July 2011

Google is taking over my life

Having received an invite to the new Google Music service, I've only just realised how much I rely on Google and their services. My best friends are on Google Plus, my work is on Google Documents, I rely on Gmail for communication, I plan with Google Calendar, my open source projects are on Google Code, I use Google Scholar for research, I use Picasa for image storage, and now my music collection is on Google Music. I hear they have a search engine as well...

Edit: Also Google Maps, another product I use almost every day (mostly for GPS tracking bike rides and walks).

I've been impressed with Google Music in the few hours I've used it today. My music is almost uploaded to the service, which has taken a while with my awful upload speed. The idea is that you upload your music to the cloud, allowing you to stream it anywhere using a browser or the Android application.

Streaming has been flawless; no buffering or waiting for tracks to load. The interface is also nice to use. It's still in a restricted beta-testing phase so I'm unsure of what they have planned for the service, however at the moment I see it more as a way to listen to your music anywhere, rather than a music discovery service like Last.fm and Pandora.

I had a quick cycle in the rain earlier - good times! Hilly mountain bike rides are never easy, especially given my current levels of fitness. Nonetheless, exercise is exercise and I'll hopefully regain fitness quickly. I'm 7lbs lighter since I last weighed myself earlier in the month. Water weight aside, this is a very positive start! Progress like this is going to spur me on to better things over the coming months.

Saturday, 30 July 2011

Mountain biking at sunset

My heart is still racing, and I got home half an hour ago! A short ride up and over the hill was enough to remind me of how long it's been since I cycled regularly. Watching the sun set over the river was as stunning as always. The thrill of flying down rough ground with abandon was as exhilarating as always. Alas, the only thing to have changed is me; boy have I gotten unfit!

Last Sunday I mentioned that I set myself the goal of walking 50 miles in a month. So far, so good on that front! I've walked over 17 miles in my first week, despite an irritating blister on my left foot. I'm hoping that by tomorrow it leaves me along so that I can tackle another long walk over the hills. Some of that distance has come from walking on my lunch break at work. Not only am I getting some exercise, but it's helping to clear my mind and help me focus at work better.

I've been using the Endomondo Android app to track my walks and bike rides. As impressive as the app is, it's the accompanying website that makes Endomondo great.

In the last week I feel like I've made a lot of changes; I'm eating healthier (and counting my calories!) and exercising a lot more. Really, I should've made this lifestyle change months ago, but I know only too well the difficulties of getting started. I went through it 4 years ago, losing over 70 pounds. I'm embarrassed that I let myself slip a little, but I'm determined to undo the past year of stress and laziness.

I'm angry at myself for how I've let myself go this past year, but I'm determined to become fitter and healthier. I've passed that "breaking point" and I'm going to give this all that I've got. I'm not going to try to make a change, I will.

Sunday, 24 July 2011

Pitlochry, hiking and fitness



Pitlochry, Scotland

It's hard to believe that it's been three weeks since I last posted. Time sure has flown by, largely due to work becoming increasingly busy. In that time I've also enjoyed a short trip to Pitlochry with my girlfriend. It was a perfect short break; I sure needed that time to relax, and really enjoyed the scenery. I'd love to return there soon to do a bit more hiking.

We enjoyed a walk around the dam and a short hike through the woods and countryside, but Ben Vrackie in the distance was so tantalising. The town sits close to the edge of the Cairngorms, a mountain range I've only been able to enjoy from afar as the snow-topped peaks sat on the horizon. After my research projects end, I should have around three weeks of holiday before starting 4th year of university. I'm hoping to get away again in that time, even if it's just to camp, and the Cairngorms are a possibility.

Another place I'd like to get away to for a night or two of camping is Arran, although I'm sure that if I set out early enough, I'd cover all of the hills there which interest me in a day. Goat Fell has been on my to-do list for far too long!

I've known for a while that I need to get back in shape, but I've lacked that drive to do something about it. This time I'm determined to succeed and I'm relying on some technology to provide me with accountability. I've started to use Endomondo for tracking walks, runs etc. through their Android application. I don't expect this to help me succeed; obviously that rests on me alone. However, I think that being able to set myself goals and trying to beat my previous bests will help motivate me to keep going.

I've challenged myself to do 50 miles of walking in a month (not including walking as part of my commute) so I'll be reporting back here between now and the 24th of August. It's a lovely day today and, despite having already been out for a short walk, I fancy another. I may as well enjoy the sunshine while it lasts!

Saturday, 25 June 2011

Glasgow Bus Finder


Although it's been around 3 months since we stopped work on Glasgow Bus Finder (my team project in third year), I've gotten the urge to do a bit more Android development. Aidan and myself always had greater ambitions than just a university project and I think it's time that I visit some of the features that we never had time to initially implement.

First and foremost was the ability to move the application to the SD card, as, admittedly, it has quite a high storage footprint. 3MB is not significant by any means, but I understand how limited memory can be in some devices.

Also, at the request of a friend who owns a Galaxy Tab, I should create larger graphics to ensure that the application scales up well on tablet computers.

I came across a cool game yesterday called Proun. It's a simple racing game involving brightly coloured shapes, and jazz music. That's about all a game needs, really! The cool thing? It has no fixed price; you pay what you think it deserves.

Monday, 20 June 2011

Kindles, strawberries and academia

My Kindle. And fish.
I finally got around to buying a Kindle! Already I love it; reading just seems so much easier when you don't have to hold open two pages. I've started reading David Copperfield by Charles Dickens, one of the free books in the Kindle store.

The highlight of Scottish summers, in my opinion, is our delicious strawberries. As I write this I'm tucking into a punnet. I remember picking strawberries with my grandparents when I was a boy. Naturally, the tastiest ones were the ones you cheekily ate while picking them! Alas, there are not many strawberry fields in my part of the country. It was always a nice way to spend an afternoon, picking strawberries and raspberries in the summer sunshine. Instead I'll have to settle for visiting the fruit-stall on Byres Road at lunchtime.

Work has been equally challenging and rewarding, although I have had a couple of not-so-great days. Some days I just feel unsatisfied with the amount of work I've gotten through, although maybe that's just me failing to meet my usual high standards. I think that my research skills are definitely improving. Even after 3 years of university, I don't think that I've learned much about independent research. By the end of this summer I reckon I'll have improved my research skills enough to put me into a good position for my 4th year project.

Last week I found out that I won two awards for my work in third year; the Level 3 Honours class prize, and a prize for my team project work. I'm honoured to have won both - it's a fantastic way to wrap up an otherwise stressful year. At least that hard work wasn't in vain.

Monday, 13 June 2011

Work and exam results

Helensburgh
Looking across the River Clyde
I've been so busy with work lately that I've not had the chance to update this blog or take many photographs. The picture above is one I took around a year ago, not too far from my home. Despite the shortcomings of my town, I certainly can't complain about the view!

Last Monday I started work at university, where I'll be spending the next 11 weeks studying visual complexity. Rather than describe what that means (which, ultimately, is a goal of the research project), I'll leave it to your imagination: visual complexity concerns how "complex" an image is. Vague, I know, but what this project aims to achieve is to start trying to construct a model for assessing the visual complexity, or "expressiveness" of an image.

We'll be taking several approaches to this, trying to find a relationship between subjective ratings of complexity and some objective measurements which we hope to discover. A lot of previous work in similar areas of research has found that the filesize of a JPEG image typically indicates the complexity due to the nature of the compression algorithm. If there is more redundancy (i.e. the image maybe has a lower "expressivity"), the compressed filesize will be lower. While this seems to make sense in some regards, it'll be interesting to find out if other variables can be used to quantify visual complexity.

I find this exciting work because it's such an open area of research; I find myself reading papers from a wide variety of subjects and already I feel like I've learned a lot even after a week.

Almost all of our exam results have been published now and I'm quite pleased with my grades. My GPA is an A, which I'm pleased with; although in some subjects I feel I could've done better. In particular, I'm very proud of getting an A1 for our team project. As the highest grade possible, it feels like a fantastic reward after a tough year. Our application has had what we consider small-scale success in the Android Market, with over 1000 downloads and a 4.8/5 average user rating. All of that lost sleep and intense effort was worthwhile in the end.

Thursday, 2 June 2011

Beinn Ghlas and Ben Lawers

Loch Tay
I'm absolutely exhausted after today's hike, a windy jaunt up Beinn Ghlas and Ben Lawers. At over 1200m tall, Ben Lawers is the 10th tallest mountain in Britain. Alas, there was no spectacular view from the top of either mountain. Both summits were shrouded in cloud, making it difficult to see much in either direction. It's a shame really because on a clear day, the Cairngorms can be seen in the distance. I had planned to also continue to An Stuc, but poor visibility and tiredness (mostly tiredness) made me decide to forget that idea. In retrospect, that was a great choice - I'm exhausted now after just two!




Summit of Ben Lawers
Looking up at Beinn Ghlas

Both mountains are on the north side of Loch Tay, an area I've already seen plenty of having climbed nearby Meall nan Tarmachan a year ago. I was looking forward to similar stunning views from the peaks of both mountains today, but low cloud and mist combined to limit views to just an occasional glimpse of Loch Tay below.

Despite the mistiness and a chilling, strong wind, my face and hands are both sunburned. I suffer from being Scottish; a skin condition that causes you to burn from so much as a rare flicker of sunlight. Although the weather wasn't particularly great, it was a thoroughly enjoyable walk. It was steep in places and I felt challenged at times, but that's to be expected from such tall hills. At 1103m and 1214m tall, both hills are the highest I've had the pleasure to hike.

I can't really think of a better way to spend 7 hours (although right now 7 hours of sleep is a fantastic idea), and hopefully I won't have to wait long before another adventure in the hills. Now to eat, wash and chill out with some movies and Minecraft.

Sunday, 22 May 2011

Keeping busy

Looking across the River Clyde
Exams are finished, the world didn't end yesterday, and I've got 2 weeks of holiday to enjoy! It's a shame the weather is still insistent on trying to dull the mood. Between rain and study I've had little chance to do much lately, but this morning I put on my waterproofs and headed out for a walk.

I know I should be taking this time to relax, but I enjoy being occupied and challenged by something. I'd quite like to start something new, perhaps another programming language, a website, or a small project. Earlier this year I started experimenting with gesture-control in Android. My programming experience with Android has been largely positive, and the simplicity of implementing basic gesture control is another reason I think it's a great platform to develop for. I'm hoping to do a mobile interaction project for my 4th year university project, and Android will almost certainly be the platform I choose.

So, what could I start learning to help kill some time over the next fortnight? As far as programming languages go, I consider myself "good" at C, Java and Python, and I'm familiar with Haskell and PHP. I suppose two popular languages missing from there are C++ and Ruby. I suppose I could follow some more advanced Haskell tutorials and improve my understanding of functional programming, especially since I'll probably take the functional programming course next year at university.

Thursday, 19 May 2011

Almost there...

Arrochar Alps
The "Arrochar Alps" (Photo: Andy O'Donnell [Flickr])

As I write this it's only 24 hours until my last exam this year and the only thing keeping my excitement in check is anxiety and concern after yesterday's exam. I've also accepted an additional 2 weeks of work this summer which will give me a bit of extra money (enough to cover a semester of travel expenses) but still leave me with a couple of weeks to relax before starting the final year of my degree.

May has been one of the stormiest I can remember and I can't remember how long ago it's been since we had a day without rain. I'm hoping that the weather starts to improve for my two week break to give me a chance to get some good hiking and cycling in.

I'd love to do a couple of Munros in that time. Two which have been at the top of my to-do list for a while now are Beinn Narnain and Beinn Ime. Both are Munros (the name given to Scottish mountains at least 3000 feet high) which are part of the informally named "Arrochar Alps" (pictured above).

Although I'm not as fit as I was this time last year, I still reckon I could do both in a day. Whether or not I can convince someone to join me, however, remains to be seen!

Monday, 16 May 2011

Procrastination, photography and Portugal

Carvoeiro, Algarve, Portugal 67
Carvoeiro, Portugal (Photo: garyhayes [Flickr])

Do you ever feel like you mindlessly browse the internet, consuming vast amounts of content for no reason other than to kill time? I think I definitely fall into this category at times. Maybe that's why I've lately been trying to update this blog more often and found a desire to share more photos on Flickr. Perhaps switching from being a consumer of content to a producer is a way of feeling like I'm not wasting so much time online.

I don't imagine this blog ever being read by more than a few people close to me and I'm surprised whenever a photograph of mine on Flickr gets more than 20 views. However, I think that the time spent writing these posts and taking photographs to share on Flickr is a more valuable use of time than browsing Reddit or Facebook.

Writing blog posts has lately seemed almost therapeutic to me - it's relaxing to write my thoughts down, even if I'm just talking nonsense. Sharing photos on Flickr is just an end-product of doing something I enjoy. If anything it gives me something to look back on, reminding me of the interesting places I've been and the cool things I've experienced.

The photo at the top of this post is of the beautiful cove beach in Carvoeiro in the Algarve. In a way I suppose I have a sad memory of being there; it was the last place we visited on our last holiday to Portugal. I miss the freshly cooked seafood, the kick from piri-piri chicken and the amazing bread. Strange, I know, but the locally produced bread was delicious; I've yet to find bread in Scotland which even comes close.

Sunday, 15 May 2011

Books and comics and Kindles, oh my

Between Silk And Cyanide (by Leo Marks)
This is one of the most entertaining and interesting books I've read in the past year; one that I'd certainly recommend, especially to anyone else interested in mathematics or computing science. Leo Marks was a British cryptographer during the second World War, and this book tells the story of his amusing struggles within the Special Operations Executive (SOE).

Bottom of his class, Marks wasn't deemed suitable for Bletchley Park, Britian's main codebreaking site during the war. Instead, he ended up at the SOE, dealing with the messages sent to and from secret agents spread throughout Europe. Unsatisfied that the lives of these agents were at risk from the poor encryption being used, Marks introduced (with entertaining difficulty, largely thanks to bureaucracy) increasingly better forms of security for messages transmitted by radio.

Largely my interest in this book was that it was vaguely computing science related, albeit from a much earlier age. It was fascinating to gain some insight into the secrets of communication during the war, and Marks is such a fantastic storyteller. You almost get the impression that he was rebelling against the bureaucracy for the fun of it, as well as helping to gain support for his ideas.

xkcd volume 0
Not much to say about this; who doesn't love xkcd?! More books should have their pages numbered in the base 3 number system. It's the only webcomic I read but I've missed so much over the past few months of university. After exams I'm definitely going to set a morning aside for catching up on everything.

Kindle
To make my long commute to work less boring this summer, I think I'll get myself a Kindle. Travelling for almost 2 hours each day, I'd be bound to get a lot more reading done. It'll be refreshing to read something that isn't academic for a change.

I still have books on my desk which are half-finished or not even started. One I plan to start reading tomorrow is The Man Who Loved Only Numbers, a biography of the wonderfully aloof Hungarian mathematician Paul Erdős. I started reading it in January, only to have to set it aside due to studying. Erdős has published more academic papers than any other mathematician, yet spent his life travelling the world, living out of a suitcase and giving most money he made to charity. When my uncle gave me the book he said that even I'm not as eccentric as Erdős... challenge accepted!

Saturday, 14 May 2011

Walking and databases

In the rough
This morning I awoke early to go for a walk with my camera, to take advantage of the early morning sunlight. Everything just looks so beautiful bathed in that warm, orange light. Alas, I must've left my camera on overnight because the batteries were flat. That gave me a perfect excuse to take another walk later in the day, though! I'm going to have to start getting back on my bike more often so that I can experience the same terrain at a more thrilling speed. Rough ground you've walked on a hundred times still looks intimidating when you're moving at 15mph!

I feel like I got through a good amount of studying, with my focus being my databases course. That's the first of my three exams next week and I'm quite confident about it. The topic of normalisation is still being taught in third year, although in three years of university and two years of college, I've yet to hear it explained better than it was in high school. Who'd have thought that, 5 years later, I'm still using knowledge from Advanced Higher Info Systems?

I'm going to have to take advantage of a quiet weekend to get through as much work as possible. Despite my best intentions, I can never manage to study effectively after sitting an exam. With 2 early in the week next week, that's 2 days of potentially ineffective studying. At least it's almost over.

Cool stuff
Web version of Angry Birds
Visualisation of a Daft Punk mashup
Build stuff with blocks

Thursday, 12 May 2011

Spring rain

P1030149
The rain let up for just long enough to let me get one picture

I had my 6th exam of the semester this morning, leaving me with just 3 next week to go. To help wind down after today's exam, I put on my hiking boots and waterproofs and headed out for a walk. I suppose I'm fortunate to live right on the outskirts of town, only a five minute walk from the countryside and amazing views across the river.

Lately the weather has been typically Scottish; sunny one moment and pouring rain the next. I found myself taking shelter under some trees on the golf course as the showers started. I must've been the only person on the course at that time. The usual ping of a driver smacking a ball was nowhere to be heard, although perhaps I couldn't hear it for the wind. I grew up playing golf on that course, but alas, studying took over my life once I started university.

Tomorrow I plan to take another walk, even if it rains as expected. There's a saying that the best time to relax is when you don't have the time to. I definitely feel that the fresh air is just what I need to help beat the exam stress.

Wednesday, 11 May 2011

Finding motivation to update

River Clyde Panorama
River Clyde from above Port Glasgow

I took the above photograph just over a year ago today, just a 15 minute walk from my home. Despite my interest in trying to capture the things which I find interesting, I've only uploaded 1 photo to my Flickr in 2011. To motivate myself to both update this blog and play with my camera more often, I'm going to try and make at least 1 post a week with a photograph of something from the past week.

Tuesday, 10 May 2011

University, exams and summertime

It's been almost 6 months since I last updated. I guess I'm not surprised that I never got around to posting more; the past few months have been the busiest of my life. I've almost finished my third year of university, an overwhelming amount of coursework, and so far I've completed 4 out of 9 exams this year. Less than a fortnight to go; I cannot wait! I'd be lying if I said I wasn't stressed.

Halstatt Morning
Hallstatt, Austria (photo: zcortez [flickr])

Alas, I have no plans to travel this summer. Instead, I'll be spending another 10 weeks at university doing paid research work. I had a similar position last year which I really enjoyed so I'm quite looking forward to this summer.

The above photograph is of the beautiful village of Hallstatt in Austria. For a while now I've wanted to travel to Austria and Switzerland, to explore the idyllic villages hidden in the mountains. The historic city of Bern, Switzerland is another place I'd love to spend even just a weekend. Maybe I'll have the funds and time to do so next summer. What better way to celebrate the end of university and the beginning of a new stage in life than to experience such a beautiful and interesting part of the world?

I still plan to get away for a short time this summer, even if it's just a weekend away in Scotland with my girlfriend, or opportunistic camping trips alone in the mountains. I think I've succeeded in encouraging Allie, my girlfriend, to take up hiking and join me on my crazy adventures.

Whatever is in store for me this summer, I can't wait!