Archive for the 'Uncategorized' Category

Verifying the Tube station “mackerel” factoid

Wednesday 4th March 2015

I’ve heard the following little nugget of information before:

St John’s Wood is the only station on the London Underground network which does not contain any of the letters in the word “mackerel”.

I have never had any reason to doubt this, but neither had I checked it. It popped up again recently on a Facebook thread. Someone suggested that it was not true (or perhaps no longer true) because of Hoxton. However, strictly speaking Hoxton is on the London Overground network, not London Underground.

Anyway, I decided that I should go ahead and check the veracity of the statement. The geeky way.

  1. After a while searching for an existing plaintext list of Tube station names, I couldn’t find one, so instead I downloaded the Wikipedia page List of London Underground stations, had a quick look at the source HTML to see if it would be easy to pull the station names out of the page.

  2. It was; each line of the table starts with <th scope=”row”>, and follows a set pattern after that, as you might expect:

    <th scope="row"><a href="/wiki/Acton_Town_tube_station"
    title="Acton Town tube station">Acton Town</a></th>

    This is all one line in the original HTML, I’ve just broken it to two for display.

    So I can pull out just the lines containing station names using a simple grep.

  3. All I’m interested in is the bit between the opening <a …> and closing </a> tag. At this point I tend to resort to Perl to do anything remotely complex with regex replacement.

    $ grep '<th scope="row">' \
    list_of_london_underground_stations_from_wikipedia.html \
    | perl -pe 's/.*>([^<]+)<\/a>.*/$1/' \
    > list_of_london_underground_stations.txt

    Since I’ve broken out the Perl for this job, I could have thrown away the initial grep and incorporated it into the Perl instead, but this is just a quick hack and it already works, so why bother? I’m not aiming for elegance here.

  4. Verify the list:

    $ cat list_of_london_underground_stations.txt
    Acton Town
    Aldgate
    Aldgate East
    Alperton
    [...]
    Watford High Street
    Watford Junction
    Watford Vicarage Road
    $ wc -l  list_of_london_underground_stations.txt
         275 list_of_london_underground_stations.txt
    

    Looks good. We have just the station names, one per line, and there are 275 lines, which sounds about right. [The list includes a few planned stations at the end. I decided to keep these in.]

  5. Now I can grep for those station names for those not containing any of the letters in mackerel:
    $ egrep -vi '[mackerl]' list_of_london_underground_stations.txt
    St. John's Wood

And there you have it. Assuming of course that the Wikipedia list is correct and complete, the factoid is confirmed. And it took just a couple of minutes. Plus about 20 minutes writing it up afterwards…

Of course, now I can substitute other words for ‘mackerel’ too. For example, there are three stations that do not contain any of the letters in ‘herring’.

For your convenience and further exploration, you may download my plain text list of London Underground stations. Remember, it includes every station on the Wikipedia page as of 4th March 2015, including several stations that are at the planning stage so do not actually exist yet (or not on the current Tube network anyway); these are at the end of the list and are: Battersea, Cassiobridge, Nine Elms, Watford High Street, Watford Junction, Watford Vicarage Road.

How to revert Firefox 14 awesome bar auto-completion behaviour / switch off URL autofill

Monday 23rd July 2012

Firefox 14 introduced a change to how the “awesome bar” (aka location bar) works – it now auto-completes in place. A lot of other browsers do this, so I guess it’s consistent, but I don’t like it – I find it much faster to recall my most commonly visited sites by typing a few letters (usually 3 is enough) which often occur in the *middle* of the URL, while the auto-complete always works from the *beginning* of the URL, and I find it confusing to be offered a suggestion which isn’t what I’m looking for. I’d rather see only the letters I’ve typed in the field, and a list of suggestions below.

I eventually found out how to revert to the old behaviour, but it wasn’t easy and involved being sent round in circles a few times. So, for your benefit, here’s how:

1. Type about:config in the awesome bar / location bar.
2. Use the Search field to locate the preference browser.urlbar.autoFill
3. It is true by default in Firefox 14. Double-click to set to false.

How to make sure you don’t miss posts by your favourite Facebook Pages

Thursday 28th June 2012

Make an Interest List and add it to your sidebar Favourites

You may have seen the following message circulating on Facebook:

Due to Facebook’s new policy, only about 10% of people that ‘like’ a fan page will see the status updates.

In order to see my posts and notifications just click/hover over the ‘Liked’ button (beneath the cover photo, to the right) and activate the ‘show in news feed’ option.

This will allow you to see all of the posts.

Unfortunately that information is WRONG.

You will probably find that your Show in News Feed option is already active for the pages you like, unless you specifically switched it off. It does not guarantee that you will see the page’s updates in your feed. If you click this option you may be inadvertently switching it off!

Facebook decides which posts to show in your News Feed based on how often you “interact” with a Page’s posts – basically how often you hit Like, Comment, or Share on them. But regardless of how much you do that, it now shows Page posts far less often than it used to, because FB wants Page owners to pay for the privilege of having their posts seen (by people who have already asked to see them!)

If you’re a big fan of a particular Page, there is something you can do to help ensure that you don’t miss its posts – put it in your sidebar Favourites (or Favorites for US spellers). It’s a bit complicated, but here goes:

When you hover over the Liked button for a Page, you’ll see an option in that menu to create a New List. This creates what’s called an “Interest List”. As well as the currently selected Page, you can then also add to it any other Pages that you want to follow (such as Quextal 😉 ) – but I suggest not putting too many pages into one list, or Facebook might again intervene to decide which posts it shows in the list. Or you could just have one page per list, and create a new list for each page that you want in your sidebar, but there may be a limit to how many lists you can have in there.

So, choose which pages you want on this list (you can always add or remove pages from the list later if you change your mind), and click Next. You then have to choose a name for this list, and decide whether to make it public – that’s up to you, and it largely depends on whether you think it might be useful for other people. Making a list public shouldn’t infringe your personal privacy in any way.

When you finish creating the list, FB will show you the list page, hopefully full of posts by the Pages you selected.

Now go back to the main FB homepage. Your new list should be in the sidebar under INTERESTS (you might have to click MORE at the bottom of the sidebar to see this. If you hover over the name of the list you just created, a pencil icon appears to the left of it[1]. Click that and select Add To Favourites (or Favorites if you’re using US English). This will (a) put it in your Favourites / Favorites section near the top of your sidebar, and (b) put a number next to it whenever there are new posts to read. To read them, just click on the name of the list.

  • [1] Users of Matt Kruse’s excellent Social Fixer plugin may have to disable it temporarily to do this step.

Note that this probably has no effect on how likely a Page’s stories are to appear in your main News Feed, which will continue to be driven by Facebook’s desire to extort money from the Page owners. But at least you’ll be able to see in your sidebar when there are new posts to read.

You can subscribe to other people’s public Interest Lists. For example, here is my list of selected psybreaks artists and labels (it’s not meant to be exhaustive, so apologies to anyone I’ve left off).

I hope this is useful. Please share this article, especially where you see people sharing the wrong information quoted above, and add a comment if you notice any errors or have additional information.