I’m only in NY for a day, but I’ve had a chance to catch a few trains, so this is my first impression:
Platform:
Clean, but not as clean as Scottish train platforms. Trains seem to leave on time from GCT, but delays seem usual from many other stations. I’d say delays are on par with Scotrail.
I’ve not seen CCTV on the platforms here, and just a few in the stations. Scotrail platforms are plastered with CCTV… Including the trains themselves.
GCT beats any Scottish stn. Including Glasgow Central in looks.
Trains:
Quite clean, same as Scotrail trains. Some of them squeak a lot on the rails, and they seem much slower than trains in the UK (Virgin, cross-country, Scotrail). People seem friendlier, they actually ask if it would be alright to take the seat next to you… over there, most people just sit down.
In Scottish trains they check and sign your ticket, which you keep till you reach your destination, as they ask for it on your way out. In NY trains, sometimes they take your ticket away, and other times just clip it and give it back. It seems you never have to show it to leave the station.
All in all, I prefer Scottish trains… But I prefer Belgian “B” trains even more… They are the most silent ones I’ve ben on.
I won’t go into detail in the NY underground. I’ve heard it is filthy and full of rats. I even heard people play a game here… How many rats can you count. Doesn’t sound tempting so I’ll probably be avoiding the subway.
A couple of weeks ago I was asked to develop a mobile application with data access in ASP.NET.
Naturally, I did a bit of research, tried out a few things, and finally came to the conclusion that .NET framework 4.0 was the best choice.
So I got down straight to development, using Jquery Mobile Framework, ASP.NET with .NET 4.0, MVC3, ADO.NET Entity Framework 4.1, and ASPX (web forms).
It was easy enough to set up, but when it came down to implementing user controls, I found it a nightmare. Passing parameters to the user control whilst using a MultiView was giving me a headache.
The issue here is that web forms are not naturally set up to work via AJAX calls, and Jquery Mobile Framework relies entirely on AJAX calls. So I decided to try out the Razor layout engine instead of web forms.
I had no experience using the Razor layout engine, but after a couple of hours, I found it delicious to use. I could code up pages much faster than in web forms. And the integration with controllers and models in the MVC3 framework was just, natural, it all fit into place beautifully.
Naturally, I found a few issues learning the basics of the MVC3 framework, forms authentication, the Razor layout engine, and accessing data from a database. Tutorials seemed to be all over the place, but I came across a few good ones which I will share with you.
If you are getting started with MVC3 + Razor + Data access (using DBContext in MVC3), follow these tutorials, and you’ll be a ‘pro’ in a couple of days (providing you have enough experience).
Learn the basics of the Razor layout syntax:
http://msdn.microsoft.com/en-us/gg618477
Learn how “sections” work in Razor:
http://weblogs.asp.net/scottgu/archive/2010/12/30/asp-net-mvc-3-layouts-and-sections-with-razor.aspx
Learn how to implement partial views in Razor (which can be used as ‘user controls’):
http://rachelappel.com/razor/partial-views-in-asp-net-mvc-3-w-the-razor-view-engine/
Learn how a basic MVC3 application works in .NET:
http://www.asp.net/mvc/tutorials/creating-a-mvc-3-application-with-razor-and-unobtrusive-javascript
Learn how to integrate data access (database first) using MVC3 and EF 4.1:
http://msdn.microsoft.com/en-us/data/gg685489
(If you want to create models, but use a MSSQL database that is not on your machine, and you don’t want to have it in the App_Data folder, just follow the steps, then delete the database from the app_data folder, and change the data source in the web.config to point to the correct location).
Writing your own queries to access the database instead of relying solely on those from the model:
So that’s it for now, I thought it would be good to have a central location for these tutorials as they served me well whilst I learned the basics of MVC3 + EF4.1 + Razor, so I hope they are useful to you as well.
If you have any queries, please let me know in the comment section below.
The right fucking decisions. That’s what people should learn to make.
If people made the right fucking decisions, the world would not only seem better, it would be better. Less car crashes, less time wasted, less unemployment, less abortions, less suicides, less disasters, less stupidity.
It’s not hard to make the right decisions, just think before you act, measure your options, make the best choice.
When it doesn’t work out, you know you tried your best, and it will probably turn out better next time.
If you lose your money, break your mobile, crash your parents car, befriend the wrong person… think, measure, then act… Next time. Tomorrow never comes when tomorrow is all you wait for. Today is the only time, this moment.
Lets stop acting like mindless fools and get our act together, lets make the right fucking decisions, for the sake of humanity.
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.
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:
At 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).
Additionally, 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.