Appearing Offline on MSN/Windows Live Messenger: Game Theory Analysis

May 10th, 2008

Peek-a-boo!
Creative Commons License photo: jenn_jenn

A few years ago, Microsoft introduced the ability to “hide” on Appear Offline on MSN Messenger and to keep talking to people. This is quite a useful feature for the anti-social types who really don’t want anybody to talk to them!

I’ve noticed some interesting trends since this feature has been introduced. The people who used to have their status stuck on “away” now use appear offline. This is perhaps frustrating when you then end up calling or texting at extortionate rates your friend instead whilst you’re actually both sitting at your computer!

The reason why people use “appear offline” is so they can be selective about who they talk to. Fair enough. But when other people also use “appear offline”, it doesn’t work. This could be illustrated using a bit of game theory.

Appear Offline

Initially, lets say that both persons A and B gain 2 units of utility from being online in MSN Messenger. This utility could be in many forms: pleasure gained from sharing gossip, money saved in not having to text or time saved. The exact form of the utility isn’t important.

Let’s go into hiding… 

grandmaster FLAX ~ II
Creative Commons License photo: striatic

Now lets say Person A decides to “Appear Offline” but Person B is still “Online”. Person A will only talk to Person B when it is beneficial to him. Person A will still gossip with Person B but only in times convenient to himself and when he’s stuck on his particle physics essay, he can still see when Person B is online and get help from him. For this reason, Person A’s utility increases from 2 to 3.

But Person B won’t derive any utility. When he needs somebody to talk to, or has run into a brick wall upgrading to Service Pack 3, he won’t be able to get through to Person A on MSN Messenger. Instead, he might end up calling or find a more sociable person to talk to! Hence Person B derives no utility from this arrangement.

Notice that the payoffs are symmetrical. If Person B decides to “Appear Offline” but Person A doesn’t, Person B will gain 3 units of utility whilst Person A will gain nil.

The fourth possible situation is when both Persons A and B decide to “Appear Offline”. Neither persons derives any utility from this arrangement as they’ll never talk to each another. They might as well actually be offline.

The best arrangement 

Holy Rollers
Creative Commons License photo: J. Random

As we can see, in this analysis the best possible outcome is that both persons A and B are online. They both derive 2 units of utility from this arrangement and 4 units of utility are gained in total.

Person A or person B could seek to increase the utility they gain by appearing offline. This increases their own utility to 3 units. Would they do this in reality? Rationally, probably yes.

If person A decided to stay “online”, person B would gain 2 units of utility from staying online and 3 units from appearing offline. So in this situation, person B should appear offline to maximise their own payoff.

If person A decided to “appear offline”, person B gains no utility either way. So it really doesn’t matter whether person B stays online or appears offline. But they don’t lose any utility by appearing offline.

By considering all the possible outcomes, person B will rationally choose to appear offline to maximise their payoff. As the situation is symmetrical, person A should also rationally choose to appear offline. The outcome? Both persons A and B “appear offline” and nobody gains any utility.

Back to the real world…

In this discussion and game theory model, I’ve abstracted from reality. Of course, it isn’t true that everybody on MSN Messenger appears offline these days. But I will say that amongst my contact list, I know quite a few people do and it has lead to some annoying situations. I’m even guilty of “appearing offline” on many occasions without realising the person I want to talk to is also appearing offline and waiting for me to come online.

Spicing up your blog posts with photos

May 9th, 2008

SpiceWorld
Creative Commons License photo: pietroizzo

One problem with many of my blog posts in the past has been that they aren’t particularly interesting to look at! In the many designs which have been used in the site, I’ve played around with different fonts, text and line spacing and different text sizes to try to make text as palatable as possible. However you style your text though, I still believe your pages will look bland when you have a lot of it!

I’ve recently been experimenting with using some images to spice up the look of the blog.

This posed a problem. Where do the photos come from?

My Own Photos
I do love photography but I’m by no means a good photographer! My photograph collection is also fairly small (by a small collection I mean 8,000 photos totally 9GB) and un-indexed! And I’m fairly sure some obscure and badly lit shots from many months ago wouldn’t add that much to the post…

Google Images
Every student in the world types terms into Google Images and plagiarises images to spice up their homework or class Powerpoint presentations! However, it’s slightly illegal and constitutes copyright infringement unless the image is public domain. And it’s not exactly easy to find public domain imagery on Google Images…

bookshelf
Creative Commons License photo: chotda

Flickr
This is the third and the best option. I’ve used Flickr for quite a while but my photography is pretty lame. The best thing about Flickr though is being able to see photos taken by others. On Flickr you can search for Creative Commons licensed photos. Essentially, the Creative Commons license allows you to use the image on your webpage providing you credit the author and link back to the original.

I’m hoping that this will add a bit of colour to the blog and more pleasant reading. I’m discovering some fantastic new photos whilst searching for and adding photos to my blog posts and I hope you’ll see some photos you’ll love too!

As a bit of advice to anybody who wants to do the same thing on their blog… it’s often better to sort photos by “Most interesting” rather than “Most relevant”. That’ll mean the photos are sometimes less relevant but they’re often of a much higher quality!

Choosing a strong and memorable password

May 9th, 2008

Security
Creative Commons License photo: Thomas Hawk

I don’t think I’m alone in having difficulties inventing strong and secure but unique and memorable passwords for every website. The problem has really exploded recently as I’ve started to do more online shopping making it even more important to keep all my accounts secure.

I found out about the following technique to choose strong and memorable passwords today and I think it’s really good.

A good technique for choosing a password is to:
Choose a phrase between 8 and 16 words long that will be easy to remember. You can include names and numbers too.

Take the first letter of each word in order, including any numbers, capital letters or punctuation. This then becomes your new password.

For example:

Choosing the phrase: ‘My pet dog’s first name is Rex!’ would result in the password: MpdfniR!

or the phrase: ‘My sister Peg is 24 years old’ would give the password: MsPi24yo

Choosing a password in this way produces a password which should be easy to remember, but cannot easily be guessed. With practice, you should be able to choose phrases which provide the required number of different character types.

You can choose words and associations which are relevant to the site you may be visiting. Say Amazon.com - you might associate that with the environment and therefore one of Gandhi’s sayings: “Earth provides enough to satisfy every man’s need, but not every man’s greed.” By taking the first part of his quote and applying the quoted method, you might have a password like “Epe2semn,“.

I think by more or less any measure, this password is pretty secure. It contains a mixture of uppercase and lowercase characters, numerical characters as well as punctuation.

Some scientific research on this method is detailed in a Cambridge University paper “The memorability and security of passwords - some empirical results” (2000).

CSS Reflections in WebKit

May 8th, 2008

In the latest builds of Safari, you can reflect images using just CSS. Apple have come up with the proprietary -webkit-box-reflect CSS property for this.

reflection is a replica of the original object with its own specific transform and mask. The box-reflect property can be used to specify the specialized transform and mask that should be used for the replica.

-webkit-box-reflect: <direction> <offset> <mask-box-image>

<direction> can be one of above, below, left or right.
<offset> is a length or percentage that specifies the distance of the reflection from the edge of the original border box (using the direction specified). It can be omitted, in which case it defaults to 0.
<mask-box-image> is a mask-box-image that can be used to overlay the reflection. If omitted, the reflection has no mask.

Why use this over Reflection.js? Well, you can reflect any element - not just images. This includes for example the <video> element. But unfortunately it’ll only work in Safari and as far as I know, no other browser vendors are in the process of implementing anything similar.

In the future perhaps Reflection.js will simply provide a wrapper using <canvas> in Firefox and Opera, Webkit CSS in Safari and VML in Internet Explorer (at the moment canvas is also used in Safari).

It’s rewarding being a blogger

May 8th, 2008

Almost two years ago, I experienced an persistent error in my Javascript development in one of my scripts. It was the case of the “Expected identifier, string or number” error from having an extra comma at the end of a function. I made a blog entry about it to share my experiences solving the problem.

Somehow my blog entry got indexed by Google and started turning up on a lot of search results. The post has received over 1,500 hits in just the last quarter (the higher number of visitors on weekdays indicates its genuine traffic) and I’ve been receiving quite a few comments and thank you messages! It’s really rewarding knowing that a blog post you made has saved others a bit of time!

I know that whenever I’ve had problems getting something to work - might that be Linux, Javascript or Windows I’ve always turned to Google and the rest of the internet for help. And I’m really glad that the archive of posts and “solutions to problems” that I’ve accumulated over the years on this blog has been useful and given something back to the community.

In other news, haven’t we just have the most wonderful weather in Britain lately?

Wii Fit: Part 2

May 6th, 2008

Day 179 - Wii Fit!
Creative Commons License photo: nataliej

A few days ago I wrote about Wii Fit but I wanted to follow up to the previous post as I’ve now had the game for several days. It was questioned why I’d even called Wii Fit a game. I call it a game because it’s fun! I’ve managed to clock up a decent 15 to 20 minutes worth of exercise every day since getting Wii Fit. The only barrier to getting any more done is the fact that everybody else in the household wants the Wii for Wii Fit!

Wii Fit contains a selection of “games” or activities in 4 categories:

  • Yoga
  • Muscle workouts: Including press-ups
  • Aerobic Exercise: Boxing, hula hooping, jogging, etc.
  • Balance Games: Ski jumping, Skiing and snowboarding slaloms, tightrope walking, etc.

Somehow Nintendo managed to do a really good job at encouraging you to keep working at your fitness. After every activity, a “piggy bank” tells you how long you’ve been exercising for on the current day. Once you accumulate a certain amount of time, new activities and levels are opened up. Gaining good scores on certain activities also releases more difficult or challenging levels of the activity. For example, with jogging there is short distance, long distance and a lap around the island!

The tests on Wii Fit are strangely enjoyable. Every day, Wii Fit can calculate your general fitness from your balance and BMI and gives you a Wii Fit “age”. Your BMI can also be plotted against time to show your progression towards the targets to lose/gain weight you set yourself (I’ve consistently gained weight since starting to play Wii Fit!)

In conclusion, I feel Wii Fit is a fantastic purchase and really something which could help you towards getting your 30 minutes of daily exercise! Whether it really will encourage people to keep fit in the long run or whether it’s just the novelty factor remains to be seen. But it’s flying off the shelves. Woolworths reported that they were selling 90 copies per minute. From my own experience, my local Woolworths sold out on the day Wii Fit was released. They received extra stock last Friday lunchtime and by the time I bought mine (at about 4PM), they only had two left. A friend of mine even queued up outside a new branch of GAME at 7 in the morning to get Wii Fit!

Patterns of Growth in Cities

May 5th, 2008

Go
Creative Commons License photo: dlemieux

New Scientist (subscription required) had a really interesting article this week about how crime in cities can be modelled and predicted through some parameters such as how “connected” a road is and it’s proximity to bars and fast food restaurants.

There was also an aside about some economies of scale and increasing returns to scale found in cities.

Quantities related to physical infrastructure, such as the total length of pipes carrying water, seem to grow in proportion to the city population N raised to the power , with equal to 0.8. This implies that these quantities grow less quickly than the population, as cities benefit from certain economies of scale. Meanwhile, quantities related to social or economic development, such as the number of investors, total economic output or overall crime, all grow slightly faster than population, with equal to 1.15, suggesting that cities also realise certain increasing returns associated with social interaction.

You can read the full paper at the PNAS website. It’s interesting to look at the full table of exponents. Things such as R&D and patents increasing faster than population are economies of scale and reasons why it’s great to live in a city. They also save on some resources as we see that the number of roads and gas stations increase slower than population. But it’s worth highlighting that crime and AIDS cases increase faster than population - obviously negative side-effects of living in cities. I don’t know why I find this stuff interesting. Perhaps it really is interesting, or it’s just the economist in me.

Exponents of Cities

Encoding Javascript in a PNG through canvas

May 5th, 2008

I think this is a hilarious way to compress and perhaps obfuscate your Javascript code. How does it work? Well, in ASCII text, which is how Javascript is encoded, 8 bits are used to encode a single character (this gives 2^8 combinations or 256 possible characters).

In an 8-bit binary image file, the 8 bits are used to represent a colour. With 8 bits, you can encode 256 different colours all the way from white to black. In colour images, 3 bytes are used for each pixel. It stores the amount of red, green and blue as values from 0 to 255 and then combines them together to give colour.

This script works by encoding the 256 possible characters in an ASCII Javascript file as 256 possible colours in a binary PNG file. <canvas> is used to read the “values” or colours of each pixel, turning it back into the ASCII equivalent. The result is then eval()-ed.

The benefit of this technique is you can then benefit from PNG compression. Of course, most servers will gzip your Javascript files anyway meaning you don’t actually benefit from a reduction in file size.

I got this idea to stuff Javascript in a PNG image and then read it out using the getImageData() method on the canvas element. Unfortunately, for now, that means only Firefox, Opera Beta and the recent WebKit nightlies work. And before anyone else points out how gzip is superior, this is in no way meant as a realistic alternative.

Anyway, since the support for the getImageData method on the canvas element isn’t widely supported yet, I guess this remains a curiosity for now and just another way to use/misuse the canvas. So, this is meant only as thing of interest and is not something you should use in most any real life applications, where something like gzip will outperform this.

This reminds me of steganography and techniques of hiding files inside JPEG images. You could perhaps use this technique to add a digital watermark to an image. Or you could store metadata inside the pixels itself and then use <canvas> to read it out. The advantage of that is your metadata can never get separated from your actual image.

Boris Johnson is London Mayor

May 3rd, 2008

I stayed up last night to follow the results of the mayoral elections in London. I had quite an interest in the election being somebody who will be living in London over the next few years but also as someone who had previously met Boris.

Both Boris and outgoing mayor Ken Livingstone gave really good speeches when the results were announced. I was quite impressed at how Boris planned to work across party differences, and it almost seemed like he offered Ken and Liberal Democrat candidate Brian Paddick a job in his administration.

It’s an important job and I believe this appointment makes Boris one of the most senior Conservative politicians in the country. The BBC has a short biography of Boris which I felt was really interesting. I really recommend “Boris: The Rise of Boris Johnson” by Andrew Gimson as a more complete biography of our new mayor.

I met Boris at a networking event last year. In typical Boris style, he turned up about half an hour late but nobody seemed to mind. He was the main attraction of the evening. Boris spoke about his political career and about some of the controversies he has been involved politically. He was the friendly personality that you see on television and I think he’s a genuinely nice guy. People have publicly wondered whether he is competent for the job because of the number of gaffes he has made. I gained the impression that he was just very upfront and much more willing to have a laugh than most politicians were. It is true that the way he acted on the London campaign trial could be described as “new Boris” so it’d be interesting to see what happens when he starts on Monday!

I think the Boris Versus Ken contest has given the Barack Versus Hillary contest some competition for most interesting political battle of the year.

Javascript Image Effects

May 2nd, 2008

The Javascript Image Effects script is stunning. It works by using VML filters in Internet Explorer and the <canvas> tag in Firefox and Opera - the same methods used by Reflection.js.

This library tries to enable different client side image effects. IE has long had its filters, which have provided a few basic effects for IE. With canvas, some of these effects can also be achieved in Firefox and Opera.

Safari lacks the getImageData/putImageData methods on the canvas 2d-context, so only the very basic flipping effects will work on this browser. The functions are present in the latest WebKit nightlies, however. Likewise, Opera only supports the get/putImageData methods in the beta version (9.50b), so you need the beta to see most of the effects. Check the compatibility column in the table above.

Among the effects available are blur, sharpen, flip, invert colours, find edges, emboss and brightness/contrast adjustment.

I think it’s fantastic that all of these effects can be achieved using <canvas>. However, it appears that the effects are achieved through the manipulation of individual pixels and unless there are dramatic improvements in performance I don’t think this would be practical as an unobtrusive Javascript. However, it could make a fantastic web-based AJAX image editor which would allow you to tweak an image before submitting it using toDataUrl().

If you use the javascript image effect, be aware of the terms of use which prohibit commercial use without permission.

Next »