Tag Archives: Coding

Live Transit Visualization

After a push from @logic, I started working on a project to show live location of suburban trains based on transit.js. The idea is to make a map similar to this for many cities, with a choice of schedules (weekday/sunday). But I found the jQuery plugin, transit.js, too hardcoded and disorganised to perform what I wanted to and also to my taste.

I found other projects like:

  • LiveBus which does a live status map using SVG maps based on d3.js library and GTFS feeds of the bus data.
  • TransitLive which uses LeafletJS as the map library with their own OSM tiles. The schdule data seems to come from the backend service.
  • NextBus which has a textual realtime status and route maps based completely on Google Maps.
  • King County Metro which again uses Google Maps for the map and a custom way of loading data from its servers. The best map I have seen so far and loads a ton of JS.

Each has its own technology stack solving the same problem.This blog post details the use of GTFS data or the lack of it for realtime visualization. So the generalized picture seems to be that everyone is rolling out a custom version of their own.

So, I am going to create a simple library that can do this.

Here is the mockup usage of the library:

// Create a new livetransit object with the map type
var lt = new LiveTransit();

// Assign a div for the map
var divId = "map";
var mapType = "google";

lt.setupMap(divId, mapType);

// Overloaded to perform both addRoute and initiateMovement
lt.initiateMovement("chennai_velachery.kml", "chennai_velachery_weekday.json");

// ------------------------------------
// other probable cases to deal with
// -----------------------------------
// Specify a different schedule like Sunday/Holiday Schedule
lt.changeSchedule( "chennai_velachery_sunday.json" );
// change the location - city
lt.changeLocation( "new.kml", "new.json" );


I have been observing a pattern in my life over the past few months. I am obsessed about something in the evenings and the free time. It was books for a month, Far Cry 3 for another, and has recently turned into Chess.

I am trying to understand the underlying factor which is responsible for this behaviour. After reading through some pages about impact of games on human brain, watching the TED talks like Jane McGonigal: Gaming can make a better world and assuring myself that I am not really going crazy, I think I have a plausible answer.

Like all young people I need to have that sense of achievement.

Being a introvert, the above explanation makes a lot of sense. I am not uploading pics in Facebook, I am not tweeting even an average of 1 tweet/day – other things that could keep me filled with the achievement and appreciation factor I am looking for.

Obsession Hacking

The word hacking is being used in a lot of places where it means “modification” or “change” or “tweak”. I am trying to use it for channeling my obsession into something that could be productive – as in work – as well as supply me the required achievement factor. One activity which I know could do that is – Coding.

Taking a look at what I have done in 2014:


I think I would do what John Resig recommends – Write Code Everyday, starting from today December 1, 2014. Let me see how far the obsession hacking goes.

Update: December 20,2014
Well. This doesn’t seem to be as simple as it seems. Gaming, reading books, chess – all have been entertaining and relaxing. Because that is consumption of content. But coding is production of content, hence has proved to be a much difficult and straining task. I haven’t been able to get to coding at all. The experiment so far has been a big failure.