Using gnus for Gmail

My primary email account is with Gmail. Overall it works pretty well. In particular, it works well on the phone.

However, I have been finding email less and less effective as a communication medium of late, for a number of reasons.

  • There is too much clutter there.

    Not really spam, but over the years too many organisations have got my email address. Sometimes this is good: booking flights or hotels or whatever, the emails they send are useful, but then they send a bundle of spam and special offers.

  • Some key contacts don't really use email. Not naming names, but the younger you are the less likely it is that email will be your default way to communicate electronically.

  • The Gmail interface in chrome is a resource hog. Further it does not make good use of the real estate.

  • The editor for writing emails is ok, but rather limited

  • Some simple things are hard/impossible to do. For example, sometimes I am working on a draft and want to share the draft with someone else, leaving the draft in the drafts folder. No can do.

  • I started using the amazing vimium plugin in Chrome. For Gmail to work you have to switch off Vimium, but then you are left with tabs where the Vimium shortcuts don't work. So, I think it is best to read email elsewhere. I tried a browser window just for email, but I end up opening new tabs, so that quickly fails.

Many years back I used to use RMAIL in emacs. It was a powerful client and I am left with my favourite editor.

So, asking google for emacs email client the answer that comes back is gnus.

The quickstart on EmacsWiki was enough to get me as far as seeing my gmail in emacs. I even managed to read a few emails and may have replied to one or two.

I have dabbled in gnus before, but it seems to have taken on a whole new life since then. I suspect a large part of the rest of this week, or maybe this month is going to go on figuring out how it all works.

So far though, I am liking it, so it is a good start.

More on django-allauth

Armed with the missing django-allauth tutorial I have made some progress getting auth working with google doing as the authentication provider.

Sarah's guide pretty much covered everything I needed to know. It also encouraged me to work towards pushing out a bare-bones 80 days site.

This actually makes sense as I don't need the whole site up and running just for users to register for the competition.

The missing tutorial uses facebook as the example. Unfortunately, I could not figure out how to register my application and get the necessary keys on facebook.

Instead, I decided to have a go at using google. I quickly found this google guide which was enough to get my application registered and get the necessary keys.

Then it was back to the missing manual. I actually used the django admin interface to update the django database, rather than run the SQL as per the tutorial. This was just a matter of going to this url: http://127.0.0.1:8000/admin/socialaccount/socialapp/ and entering a new record.

I still had a couple of errors to get by. First, I copy/pasted the configuration information from the missint tutorial and had to remove the publish_stream scope as google does not support that (at least I assume that is what the problem is).

Next I had to go back to the Google Developer Console and register the callback url that my application was trying to use. Bingo, everything works.

So, with this setup, new users can just sign in with their google account and the application will set up a user registration for them if one does not already exist.

The down side with all this is that there are a plethora of authentication providers I should probably support: facebook, twitter, yahoom, linkedIn, github, etc, etc.

Really, this whole system is horribly broken. Every social media site has its own identity management implementation and it, naturally, wants everyone to use their identity management. In short, they all want to own your identity.

What we really need is for users to be able to manage their own identity, without need to for a central authority. The central authority is a critical security weakness as if that authority is compromised all users using that authority are compromised.

A secondary problem is that the current OAuth/OpenID solutions result in everybody wanting to be the central authority and hence users are faced with either balkanisation of identiy management or having to manage multiple identities.

Sadly, I do not see an end to this in the short term, not least because the current mess suits all the current incumbents.

Bootstrap css, allauth and initial site

Write your post here.

Django allauth

For the 80 days project I decided to use the django-allauth package to handle authentication.

When I say I decided, the decision was actually made by the django project cookiecutter I used to create the project.

This should provide lots of goodness in that it will allow users to register and log in to the site using social media OpenID authentication. At least, I think that what it does.

Time to read the missing-django-allauth-tutorial

The imitation game

The other day, Nick Hoskins posted a link to an intriguing puzzle, the Imitation Game Puzzle

I tried very hard not to click on the link. There was a picture of Alan Turing, a puzzle and a competition. Oh, and it was all run by the Chocolate Factory.

The Imitation Game film has just been released, hence the timing of the puzzle.

I clicked on the link. Pictures of the bombe's that were used to break Enigma in the Second World War. Another picture of Alan Turing and a little piece about the Turing Test.

In fact, one of the premises of the puzzle was to prove you are not a computer, in effect a reverse Turing Test.

I clicked on the link to download the pdf with the details of the puzzle. I was delighted to find what looked like a scan of a type-written document. This reminded me of working on puzzles with my mum.

My mum loved crosswords. Her favourite was to find a puzzle in The Guardian compiled by Araucaria. I can still recall her telling me how araucaria is the Latin name for tne monkey puzzle tree, with a twinkle in her eye.

At holiday times Araucaria would often create a special, puzzle. The puzzles could keep you amused for days. We would both take a look at them, get a few clues, then give up in despair. Mum would usually be more persistent than me. Maybe she would be cooking dinner and I would be sat talking to her in the kitchen. Happiness was solving a clue together.

One thing I learnt from this is that talking to others about problems helps you see them more clearly. My mind works that way for sure. It doesn't matter if the person you are talking fully understands, so long as they are engaged and interested it helps you find out what assumptions you are making, it raises questions and you get a second perspective on the problem.

Mum used to subscribe to special puzzles that Araucaria produced a few times a year. They would arrive in the post, printed on paper and looked like they were copies of an original from a type-writer -- just like the Imitation Game puzzle. I was hooked.

Earlier this year I visited Bletchley Park with my wife and family. The two boys are very interested in history and know way more than anyone of their age normally does about the world wars. Indeed, if a Turing Test was done on either of them you might well conclude that they are in fact computers since no human being could reasonably be expected to know as much as they do.

The visit to Bletchley was a bit disappointing, our timing was bad as they were just putting the finishing touches to some new exhibits so parts of the museum were closed. However, we did get to see the re-constructed bombe working. These bombe's were basically electro-mechanical special purpose parallel computers. They allowed vast numbers of enigma settings to be tried as the initial part of an attack on the Enigma ciphers.

The competition is still on-going, so I should not spoil the fun. Suffice to say, the puzzle came at just the right time for me.

I have been going through a very difficult time, so to be able to get away from everything for a few hours and immerse myself in the puzzle was very therapeutic.

My poor wife had to put up with an entire weekend of bizarre questions about a whole range of strange subjects. She was an immense help as I worked through the puzzle. I was reminded of sitting round the kitchen table with my mother, happy times indeed.

Araucaria would have been proud of this puzzle, many thanks to those at Google that created the puzzle and helped me through this very difficult time.

Star Trek universal translator

This theme from the global hackathon really interests me:

Challenges associated with real time communication and translation
(Star Trek universal translator anyone?)

I am finding computer interfaces becoming more and more annoying. I interact with computers through different interfaces: mobile phones, tablets, infra-red remotes, workstations etc etc.

Each application has its own idea of how it wants me to work with it. Some have discoverable interfaces. Some are close to unusable from a mobile phone.

What I am thinking is what we need is a layer that sits between input devices and applications. I guess we already have this, it is called an operating system. But currently, all these tend to do is implement the drivers needed to talk to the input device and simply pass on the events to applications running on the O/S.

Events tend to be pretty low level things like button click, keyboard keypress etc etc. If we had more sophisticated input devices, or rather a layer listening to existing inputs (for instance why not use the webcam too to observe what the user is doing, or the mic to listen. With this information it ought to be easier to guess what the user is really trying to do. Applications could then be build that accepted a much richer set of events.

For example:

  • go to next page
  • go back, I just clicked the screen by mistake
  • damn you autocorrect, stop guessing and just enter the word I have typed three times already
  • OK, usually when he does this he wants out of netflix and into xbmc, so why don't I just offer to take him there?
  • of course, the OS should learn from you as you interact with it
  • and we don't want to end up with clippy.

Then there is social media, I am signed up to way to many sevices: twitter, email, google+, github, facebook, koding.com, irc, blogs etc etc.

ttwick looks like it might have a solution to the problem of keeping track of everything.

There are a whole bunch of privacy issues to worry about here. Any interface listening to user inputs is seeing some very personal information. My guess is the way you type on a keyboard is a pretty unique identifier, perhaps as distinctive as your DNA.

So for apps to really behave well for you they might need to know this information that identifies who you are. But who do you really want to share that information with?

Now if the OS translated the inputs coming from devices into a standard, rich event stream then it might be that it could do it in such a way as the event stream was less of a personal marker and so we could get a double win of greater privacy and a more unified interface to interact with computers.

This whole area is really an accessibility thing. But for too long accessibility has been some extra thing you do to support people with disabilities. It isn't built into apps from the ground up. Further, it singles out those with disabilities: poor vision, paralysis, poor motor skills, etc etc. The reality is that everyone needs better interfaces.

If we out a layer between our input devices and our applications we can start working on those better interfaces. For everybody.

I am reminded of Tavis Rudd at PyCon 2014 talking about controlling emacs with his voice.

So again, all we need here is a layer listening to his voice and converting the voice into instructions for emacs. Now if that layer could learn as it was used, we might have something special.

World's first global hackathon

Over at koding.com they are running a global hackathon for the weekend of 6/7 December. It is an exciting project, with people participating all over the world.

The idea is for teams of up to 5 to work on projects along the following 5 themes:

  1. Problems facing our planet, explained using interactive data visualization. (e.g. climate change, earthquakes, food/water waste, etc.)
  2. Introducing software development to a beginner (games!)
  3. No one reads the fine print (ie TOS, EULA, legal documents) anymore yet every site has them. Devise a creative/interactive solution.
  4. HTML5 games that are educational and learning oriented. (multiplayer preferred)
  5. Challenges associated with real time communication and translation (Star Trek universal translator anyone?)

There are some great themes there, many of them relate directly to Bermuda. For example, maybe we could build a simple hurricane model, using data from the recent storms to allow people to explore the impact of global warming on Bermuda.

Meanwhile, I have been working on this 80 days project. Progress is proving difficult due to the amount of wonderful stuff there is out there that can be used in the project.

I am hoping to be able to use the hackathon to learn a couple more tools and to start making real progress on 80 days.

It would also be interesting to try and work with hackers on other small islands. One challenge here in Bermuda is, at least for now, our numbers are small. Other small islands have similary issues.

It would be good if we could perhaps work with people at the Lanzarote hackbase.

From a personal point of view, I also have some contacts in Ireland, so maybe we could stretch the definition of small a little to include Ireland too.

Then there are the Azores and the Caribbean.

Theme 5 is all about translation. It would be cool if we could make our site multi-lingual: English, Portuguese, Bermudian slang etc, etc.

One suggestion is to actually work towards having another hackathon event in the near future, a Small Island Hackathon. Is there any interest in using the global hackathon as an opportunity to build a site for a small island event. Perhaps we could have it coincide with Bermuda Race Weekend January 16-18th 2015.

Nikola, django packages, cookiecutter and other goodness

I have been spending some time looking at tools to help with the 80 days project.

nikola

First up on the list was nikola. This is a static site generator. I was mostly interested in it because:

I ran into one problem with nikola, see this nikola_issue

Happily, within three minutes of reporting the problem the maintainer posted a solution, even though the issue I reported was a dupe.

django packages and cookiecutter

Since I am working on a django project I took a look at django packages.

My attention was quickly drawn by cookiecutter in the featured grid. Cookie cutter creates projects from templates, so saving a lot of tedious work. It comes with a list of available cookiecutters.

I was a bit spoilt for choice, but I decided to give the cookiecutter djangopackage a go.

So far I am pleased with this choice. The docs led me through creating the django app, adding it to readthedocs and registering it with PyPi

All in all, a very painless way to get lots of goodies up and running for the project.

Now I just need to write some actual code.

Calculating 80 days from now

Checking when 80 days from the start of the project is

The first commit to github was done on 15th November 2014.

However, I had been working on the project for a couple of days by then, so I will take 13th November 2014 as the start date.

In [1]:
import datetime
In [2]:
start = datetime.date(2014, 11, 13)

start.isoformat()
Out[2]:
'2014-11-13'

Now calculate 80 days from the start date

In [3]:
end = start + datetime.timedelta(days=80)

Check that the 80 days of coding ends on 1st February 2015

In [4]:
end.isoformat()
Out[4]:
'2015-02-01'

What day of the week does the competition start on?

In [5]:
end.strftime("%A")
Out[5]:
'Sunday'

How many days are we into the project?

In [6]:
today = datetime.date.today()

day = (today-start).days

print("Today is day %(day)d.  %(togo)d days to go." % dict(day=day, togo=(80-day)))
Today is day 70.  10 days to go.

links