Lemiffe Music, Software, Stories & AI

The Edinburgh Trams Nightmare

Over four years ago I started making plans to come to Edinburgh, UK, to study a master degree. Naturally, I did some research into the city beforehand and found out that one of the major local issues was the construction of a tram network that would run from the airport all the way to the city centre.

Edinburgh trams from the 1900s

I remember reading that a large percentage of the locals opposed the tram system, partly because the bus system is already an excellent travel option, but primarily because of the chaos the construction would cause. By the time I read that, I believe it had already been under construction for quite a while.

I moved to Edinburgh over two years ago, only to find Princes Street (one of the main streets in Edinburgh) still closed due to the construction. Buses were taking an alternative route, but the people still weren’t happy. This seems quite logical, as it had already been under construction for years with no end in sight.

About a year ago I remember quite clearly that the works on Princes street were finished. The end seemed near. Then shortly before the Pope’s visit not so long ago they even placed a tram on the rails on Princes St. But, was it functional? Well, the thing itself seemed pretty functional… but the rails lead nowhere! Yes, Princes St. had rails installed, but at each end they just terminated abruptly. Construction was still not finished, and there was no evidence to why the works were halted.

Shortly after the scandal grew as the council got into endless debates with the construction committees and the mediators. There was a lot of frustration over the cost of the whole project, and the fact that it was coming out of the public’s pockets. Then they started a debate over whether to scrap the whole project and remove the tram lines, or finish the project off. The issue was costs of course: Is it cheaper to go on or to back off? This was followed by more discussions…

At the end of August, 2011, there were several interesting events reported in the news. I believe the first one is that the council decided to back out and scrap the project. Alarmingly quite a lot of people complained, including citizens who initially opposed the project. Afterwards, the tram chiefs decided it might be best to terminate the line at Haymarket. Finally, according to the Metro newspaper, a consortium (Train manufacturer Bombardier and French company RATP) declared that they would like to take over the construction of the trams and offered a good price. They tried the same previously but were rejected.

Now for my personal view: This is an absolutely ridiculous matter. Come on, years to build a tram system? How hard can it be? So much debate about the costs, so much time wasted, so much money spent on ridiculous meetings in posh hotels that reached no conclusion, so much chaos in Princes St. for years. I wonder how stupid a group of people must be not to be able to develop a proper system, a clear view of the costs based on materials and labour, a precise estimate of time, and a funding effort to obtain the money from various sources instead of relying primarily on the council.

Half of the tram line is already there! It’s just a matter of being intelligent, adding some numbers, deciding on the best strategy, and going ahead with it. You can’t back out now. That would be like NASA saying “oh, sorry astronauts, we’ll have to leave you up there on the ISS because we’ve disbanded all our shuttles and it would cost us too much money to get someone else to bring you down.” (I seriously hope that doesn’t happen, that will be the moment I lose faith in humanity).

Anyway, that is just my 2p on this issue. Think first, then act, but don’t spend too long thinking, and don’t back out when you’ve already started to act.

How Police could effectively pre-empt riots

Over the past few days we have seen violence escalate dramatically in different cities across England, with London being the primary location. Acts of violence, rioting, looting, and arson have taken place at night for several days.

I have been attached to the BBC News coverage through their website and I saw an interesting tweet posted there:

Tweeted by Hannah Robertson in GloucesterAt first I thought. Pre-empt where the next bout would take place? How on earth would they manage that?

But it actually isn’t that hard. They have a mountain of CCTV data, they have a good amount of servers, all they lack is a bit of artificial intelligence.

The best way I can think of to determine where possible bouts of violence could sprout in what seems like an apparent random non-deterministic method of choice is as follows:

The IT team of the police should annotate the direction of each CCTV camera, including which streets are in view and the coordinates.

Afterwards, the CCTV cameras should be plotted on a 2D map, as vectors (pointing in the direction they are facing, with the length of the vector being the distance the camera covers).

Map Plot of LondonAdditionally, all points of interest should be mapped, such as shopping centres, residential areas, commercial areas, shops with high-value items, and shops with low-value items. Most of this data can be readily obtained from Google Maps, amongst other online maps. This data can be extracted and annotated with the values we require (such as the value of the goods sold per area, etc.)

If you think this is a very hard task, it is not. A very simple way of doing this would be to go to the website (or ask by phone) of each major retailer and chain for a list of addresses of their shops. Google Maps can plot them on a map using a spreadsheet as input. There you go, simple as that!

A Machine Learning program could be developed using WEKA (for instance), in which an SVN is programmed to take data from the map-plot, where priority spots include places where high-value items are sold. Additionally, it would take data from each CCTV camera.

Now, how do we represent the data from CCTV cameras? One way would be to take a selection of pixels from each camera, measure the amount of change for a second, and wherever there is a large enough change in different areas of the same camera, we might have a lot of movement going on. So we automatically annotate the data per CCTV camera as having “movement” or “no movement”. Additionally, a range from 0-1 would produce better results (hopefully).

So now we run an SVN machine on the data and hopefully come up with some interesting results.

What could essentially be obtained from this is a vector describing the movement of as mass of people from camera to camera, this vector would be projected on the 2d map. Multiple vectors could be plotted at the same time if there were multiple riots taking place at the same time in the city. A confidence level can be given to each vector (assuming we have built in a few mechanisms to differentiate people from cars, etc). The places of interest could be mapped as hotspots, and furthermore we can predict paths to possible places of interest, derived from the speed and direction of each vector.

So there you go. If you belong to the MET, please share this blog post with your boss (or the IT team) and get working on a system to perform such actions, it would certainly help prevent further stupidity in the future. 6,000 police officers should be able to deal with outbreaks of crime provided they knew where the rioters would be gathering and where they are heading.

Credit is NOT bad

Credit is not bad - But the way we use it IS!

Edilberto Salazar (name changed), 35, married, with one daughter, is a man that I met over two years ago while working for an IT firm in Mexico. This man owed over $200,000 (£10,000+) pesos to the bank, more than $100,000 (£5,000+) pesos in taxes, plus his mortgage and personal credits at department stores. He is one of those guys that saturates one credit card, then applies for another to which he transfers all his overdue credit from his other card, and so on.

He is just one of many people I have met in several years that has the same problem. Endless calls and letters, harassment, and bad looks from friends and family. The truth is that he is just one in millions caught in the same situation.

Credit was created as a way of obtaining something we want now and paying for it later, at an interest, of course. Interest rates and other surcharges are the building blocks of banks, lending companies and other financial institutions. In fewer words: Banks charge for the “benefit” of lending you the money you need right now.

But it’s not just money nowadays, is it? Back in the old days it was mostly about a means to purchasing the home you’ve always wanted, or paying for a costly operation, or buying something you really need urgently. Nowadays the amount of things you can do by credit is enormous: Clothes, home appliances, cars, luxury items, handbags, mobile phones, phone contract payments, payments for other debt you may have in other financial institutions, education, even a haircut for goodness sake. Just about anything can be “purchased” on credit, and if the store doesn’t have its own credit line, you can probably still pay with your Amex, Visa, Mastercard, Maestro, etc.

But the concept of “free money” is what has started the massive wave of debt. We saw it recently with the credit crunch, but we’ve seen it previously countless times. And it’s not about individual people any more, it’s about entire countries indebted to others.

Why did this last credit crunch occur? Because of the sub-prime mortgages, the ratings of CDO. MRS, ABS and other deals, the lending, selling and packaging of these deals amongst banks and world-wide financial institutions, etc. They thought the gold mine would never end, and when it looked like it was depleting they found another way of marketing and selling the same deals as new products to investors, creating new indexes in the stock market, and eventually tying everything up in a way that a credit crunch became unavoidable.

But it’s not the banks fault, nor the investors, they are just looking for ways to make more money. The fault lies within the general public, as described by Tetsuya Ishikawa in his book “How I caused the credit crunch”. Credit allows you to have a house before you can pay for it, clothes without any money on you, and more importantly, operations and medical care when you do not own enough money to pay for them.

We all need money for certain things in life, but we also ought to have some decency (or put more straightly: intelligence) and analyse all options into consideration. Credit is a tool, an aid through difficult times, it is not free money, and it often results in a much higher cost than what you could have paid originally for it. Interest is a killer.

So if this opened a wound in you, try to sort out your problems, and lay off credit for life unless REALLY needed.

My Social Network Map

Three days shy of a year ago I published a blog post about my social networks in which I explained a bit about the interconnectivity provided by sites such as Ping.fm which help you keep your status updates synchronised across social networks.

Last year I was on about 10 social networks, this year the number has gone up to 17 (which is  really19 as I excluded Google Reader and Wordpress.com for visual purposes). But it seems to me that interconnectivity has still not matured enough, there is no “home” for your social networks, and I doubt this will change in the short term.

Click on the image to see a full-sized version.

image

Open your eyes, ears, heart, mind

George Orwell mentioned all throughout his masterpiece book ‘Nineteen eighty four’ the thoughts and actions of the proletarians, which are described as ignorant people who can’t care less of anything that happens outside their direct daily lives in his book. Ignorance is bliss. Or as “Goldstein” would say, “Ignorance is Strength”.

But I choose not live my life like that. Not now, not ever. Can you? I honestly prefer to lead a life in search for information, further knowledge, and culture, while having the possibility of changing my mood, thoughts, and actions based on this data, instead of living a “normal” life in the safety and comfort of ignorance.

A friend of mine once spoke to me about three kinds of events that open your mind to new ideas, possibilities and information:

  • Meeting someone from another country.
  • Travelling to another country.
  • Learning another language.

In my own opinion, having passed through those three events, I concur with him. They really change your perspective and view of the world, society, and culture.

I would like to add another three mind-opening stages that help you form a sense of identity:

  • Adolescence & friendship
  • Literature & philosophical talks
  • Having a partner

Why do I consider these stages/events as meaningful components of identity, maturity and knowledge?

Adolescence, at least in many cultures, is considered a stage of rebellion, change, transition, problems, questions, and overall madness. But it is in this stage where many of the strong lifelong ideas are formed. It is also in this stage when true friends are found, **friendships **that may last a lifetime. These are vital components of identity. And even if many of the ideas you have while going through this stage may be wrong, it is a necessary step to have these wrong ideas in order to clearly define them and change them further on.

**Literature **opens your mind to understand how others think, and allows you to develop critical thinking. This paves the way to formulating opinions based on facts instead of biased assumptions. The more you learn, the more you know, the more you can speak about, the more you can teach about, and so on.

This also brings me to the point of philosophy, and philosophical talks. These types of talks seem like endless debates about this and that. However, the actual discussion may open your mind to search for more information about specific topics and formulate a better opinion. These talks can then lead to better structured debates, and finally to an idea which may spark a change. That is why I consider the basis of all this, these philosophical talks, such an important issue.

Finally, a partner, may keep you centred on reality. While adolescence many times includes biased opinions and self centeredness, literature and philosophy allow you to form an opinion, and having a partner many times concretes that opinion, removing the egoism from self-centred thoughts formed during adolescence. That is why people who are successful in relationships are often people who stop thinking solely about themselves but think in greater proportion of other people, specifically their partners.

One must be somewhat selfish to succeed in today’s world, but you must never put aside your partner or loved ones, the same way you must never put aside striving for a common good instead of personal satisfaction. There must be a sense of equilibrium, as this allows an easier flow of knowledge, clarity and understanding. Are you ready to open you eyes, ears, heart and mind?