Wednesday, May 17, 2017

London transit & BRT

I haven't covered the transit debate in London as closely as others, so this won't be a comprehensive look at the issue.  I mainly wanted to make a few points.

I've seen, primarily on social media but also in the Free Press, that many people in London seem to believe that the city always delays on proposals and doesn't show any urgency on anything.  The latest issue was the 1960's debate about building a ring road or at least a highway extending from Highbury to the northern area of the city.  Two points about this.  One, a ring road would not have been a good idea for the city.  Second, and more important, the notion that London cannot agree to build something is ridiculous.  In the last ten or 15 years, the city has built the downtown arena, Covent Garden Market, and the cargo expansion at the airport, among many other projects.  Fanshawe College downtown (a project I don't think deserved municipal funding) is under construction.  Several condo towers are under construction or in the planning stages, downtown and in the suburbs.  And, really, transit construction in other cities is as slow and divisive as in London.  Phase 2 of the Second Avenue subway extension in New York City was recently completed at the astounding cost of $4.5 billion after decades of planning.  Toronto has debated an extension of its subway into Scarborough for years.  There isn't anything uniquely horrible about transit in London.  The central problem about transit in the city is that employment and education are spread widely throughout the city, leaving no obvious corridors connecting residences and employers.

The challenging thing about transit is that everyone generally argues for their second best (or worse) option, because their preferred solution is simply impossible.  Given the traffic flow in London, I might argue for a line connecting major employers and institutions, including Masonville, the university, University Hospital, St. Joseph's Hospital, Victoria Hospital and Fanshawe College, i.e. cutting out Wellington Road to White Oaks Mall and an Oxford West line.  And extend bus service to the new industrial employers in the southeast.  (Well, actually, my preferred solution would be congestion charges and road tolls, which haven't yet become palatable here.)  But of course suburbanites (of which I am one) wouldn't support this.

Thursday, May 26, 2016

Onwards, inwards and upwards!


[update May 17, 2017: I see that the link below to Jake's article no longer works.  He may have taken the post down.  Obviously the post below no longer makes a lot of sense, but I recall that Jake was arguing that the future of transit was personal autonomous vehicles -- PRT -- and that London shouldn't build fixed lines, either BRT or LRT.]

This from TVDSB trustee Jake Skinner is good stuff.  So much of the transit debate in London seems to have come down to aesthetic preferences and untested assumptions (e.g., trains will convince young people to move to London).

One thing I would argue with is the idea that vehicle ownership will disappear with PRT.  1) Some people who haul a lot of stuff in their vehicles for work will prefer to use the same vehicle every day.  2) Some people may have specialized requirements (e.g., adaptations for disabilities) that aren't easily met by PRT fleets, especially in rural areas, where the fleet would likely be small.  3) Some people may prefer to customize their vehicles for aesthetic reasons.  I expect a mixed system of personal ownership and member-based fleets.

Ultimately, I favour road tolls, congestion charges and a carbon tax as the best ways to deal with global warming and traffic congestion.  Not, however, as a source of government revenue, or a fund for ambitious governments to "borrow" from.  The revenue collection could be administered by an independent third party and returned to all taxpayers through the income tax system.  There would be difficult problems to be worked out, e.g., the rates to be charged and which roads to cover, but they are probably simple compared to the mess of subsidies, grants, taxes and regulations in the plan leaked out of Queen's Park.  Such a system could eventually be merged with a PRT system, as the cost of the charges above and the vehicle charge could be wrapped into one fee.

Wednesday, May 18, 2016

Books in Brief: Being Nixon

Being Nixon: A Man Divided
by Evan Thomas (Random House, 2015)
available at Amazon

Before reading this book, I knew very little about Richard Nixon, other than the outline of his political history (vice-president for Eisenhower, 1960 loss to Kennedy, 1968 and 1972 victories, Watergate, resignation).  Being Nixon is not a standard political biography.  The main events are covered, but it is not a detailed chronology about the political developments in his life.  It is primarily a psychological portrait, an attempt to figure out how his personality affected, and was affected by, the issues.  Previously having only a very a basic impression of the man, I was surprised to read about Nixon's personality, mainly his aversion to social contact and his fear of confrontation.  I was also surprised to learn how detached Nixon seemed to be from the events of Watergate.  In today's world, I expect politicians to resemble corporate leaders -- effective leadership comes not just from decisions, but from effective management of the team in the PMO or White House.  Nixon, however, seemed cut off from Congress, his own Cabinet, in fact anyone other than a few advisors such as Haldeman, Kissinger and Ehlichman.  He seemed not to know anything about the Watergate break-in or the other dirty tricks.

Overall, a good, entertaining and non-partisan introduction to Nixon.  There are more specialized books for those who want to look deeper at Watergate, Vietnam, domestic and economic policy, China, the USSR, the student protests, and the rest.

Monday, October 26, 2015

An actual web app!

I have completed the first version of a web application and deployed it to Heroku.

It is pretty simple for now -- a MEAN stack app that generates the standings of an eight-team league based on the scores entered by users.  Some decent CRUD functionality, allowing users also to access games, edit game data and delete games.  The back end storage is provided by MongoLab.

No user authentication so far.  The next step is to require users to log in to create games and to let them edit or delete only those games that they created.

shielded-oasis-7953.herokuapp.com


Wednesday, May 20, 2015

More JavaScript

Code learning continues.  Another great resource is www.interviewcake.com.  I haven't explored the entire site, but I like the weekly challenge the owner sends out by email.  One recent challenge involved taking a given string and evaluating whether it could be re-arranged into a palindrome (e.g., "house" would return "false", "civci" would return "true", etc.).  Here is one solution:

function checkPal (str) {
 
    var counts = {};
    var ch, count, i, oddCount, key;
    for (i = 0; i < str.length; i++) {
        ch = str.charAt(i);
        if (counts[ch] > 0) {
            counts[ch]++;
        } else {
            counts[ch] = 1;
        }
    }
 
    oddCount = 0;
    for (key in counts) {
        if (counts[key] % 2 == 1) {
            oddCount++;
        }
    }
 
    if (oddCount == 1 || oddCount === 0) {
        return true ;
        } else {
            return false;
        }
}

The solution first creates an associative array from the characters of the string.  The important bit comes next.  A palindrome has at most one character which appears an odd number of times.  The function counts the values of each key, and if there is more than one key with an add value, the string cannot be a palindrome, and the function returns "false".

Tuesday, February 17, 2015

JavaScript

I've been learning JavaScript.  A great way to do it is to complete challenges, such as Project Euler.  One good set I found recently is at www.coderbyte.com -- a good collection of easy, medium and hard challenges. 

There is a challenge in the "easy" category, ArrayAdditionI, which seems to give beginning coders difficulty, at least based on the comments I have seen online.

When I looked at it a few weeks ago, I couldn't figure it out.  I left it and went on to other challenges.  I finally figured out a solution a couple of days ago and completed the coding today.  This solution uses binary numbers to check all possible combinations.

function ArrayAdditionI (arr) {
    var b = Math.max.apply(null, arr);
    var c = arr.indexOf(b);
    d = arr.splice(c,1);
    d = d.join("");
    d = Number(d);
    for (var x = 1; x < Math.pow(2,arr.length); x++) {
        var y = x.toString(2).split("");
        var total = 0;
        for (var z = 1; z < y.length + 1; z++ ) {
            if (y[y.length - z] === "1") {
                total += arr[z-1];
            }
        }
        if (total === d) {return true;}
    }
    return false;
}

Wednesday, May 07, 2014

Books in brief -- Bill James on crime

Popular Crime
by Bill James (Simon & Schuster, 2011)
available at Amazon

I can still remember, 31 years later, where I was when I saw my first Bill James Baseball Abstract -- back shelf at the WH Smith at the Bayshore Shopping Centre in Nepean.  I read the series inside and out until he gave it up in 1988.  As it has been for a lot of people, the series was one of my favourite things growing up.  At that time, of course, there was no internet, and almost no way to know if anyone else was reading the same thing.  Since then, I've bought some of the books (the Hall of Fame book, the historical Abstracts), but as I don't play fantasy baseball, I haven't bought any of the annual stats books.

I vaguely remember that when Popular Crime was published, the reviews were not very favourable.  This is a strange book.  James is a tremendously entertaining writer, never boring, but this book never really proves the things that he wants to prove.  His overall point is that stories and books about popular crime are not harmful to the (American) public, and that much good can come from reading about crime, such as increased awareness of the problems with the criminal justice system.  That may be true, but most of the book, rather than engaging the central issue, is a recitation of the facts of various popular crimes in American history, and criticism of the many crime books that he's read.  I have to admit that I learned a lot about crimes that I was only vaguely aware of or crimes in my lifetimes that I just haven't followed (e.g, Lindbergh kidnapping, JonBenet Ramsey, Lizzie Borden, and Sam Sheppard).  But James hasn't tried to build up an argument; he stops along the way to make various points about crime, most of which are completely unrelated to the central argument.  For example, James develops a kind of classification system for crime, so that a CJ9, for example, is a celebrity story involving the justice system.  The system does almost nothing to improve anyone's understanding of crime.  And, early in the book, he begins to develop a scoring system for evaluating guilt -- so many points for an eyewitness account, so many points if the accused stood to gain from the crime, etc.  Again, there is nothing to be gained from this, and he rarely revisits the idea afterwards.  Because of this, the whole book resembles a collection of blog posts.

Another significant problem is that James does not use any references, either in the text or as a bibliography.  He often states which books he has read about a case, but even here you are not sure whether his retelling of a case is based on those books or others he doesn't mention.  The lack of references is especially significant because James at several points makes an argument without pointing to any external evidence.  In chapter 18, he argues that the Warren Court's decisions about the rights of the accused caused an increase in crime rates from the 1960's.  He explicitly rejects the idea that demographic shifts had anything to do with it.  Now it may be that police were hamstrung by stronger procedural rules in the 1960's, but I am not going to believe that this led to an expansion of crime unless I see how this was supposed to have happened.  Similarly, James argues that in 1914-15, the United States was on the verge of revolution.  Again, if you're going to make a big point about political change in the U.S., you can at least refer to what others have said on the issue.

Part of the problem with the book is that James has an explicit disregard for intellectual, academics, lawyers and other similar people.  From the first chapter, "If you try to talk to American intellectuals and opinion-makers about the phenomenon of famous crimes, they immediately throw up a shield: I will not talk about this.  I am a serious and intelligent person.  I am interested in politics and the environment.  I do not talk about Natalee Holloway.  It is as if they were afraid of being dirtied by the subject" (emphasis in the original).  In chapter 16, he attacks the "intellectuals, the commentators, the smart-money crowd" for ridiculing the issues that voters were talking about during the U.S. presidential election.  "The smart people who thought they knew what was 'really' important turned out, in retrospect, to be just entirely wrong."

In one of the Abstracts (maybe 1988), James wrote for several pages about how professional baseball would benefit from a "revolution."  The idea was that the minor leagues should be freed from major league control; the result would be something like English soccer, in which dozens or even hundreds of teams compete for players and fan support.  At the end of Popular Crime, he attempts something similar.  He argues that many of the problems affecting American prisons (violence, a lack of rehabilitation and training) could be eliminated by small prisons.  And he means small -- no more than about 24 prisoners per facility.  It's an intriguing idea, and I wish he would have examined it more closely.