Saturday, May 19, 2012

Automatically extracting bomb drops from the Blitz Bomb Census maps

I just finished Blackout by Connie Willis and I was wondering where she did get all the exact times when the air raids of The Blitz were happening.
I am curious because I was thinking that a timeline map would give a visual effect of the huge destruction and hard times the Londoners had to go through...so I googled for it and found the following:
Both examples show nice data visualization opportunities, but they both show how difficult it is to obtain data. Digital access to historical data could triggers a blossoming of applications!

Anyway I experimented with the little map from the first blog and wrote a little program using SimpleCV.

This is were I started from:
and this is what I got (without too much work, I must admit):


The code is quite simple and the parameters could be changed to get higher accuracy.

blz = Image("./sampleimages/the_blitz.png")
img = blz.copy()
dist = img.colorDistance(SimpleCV.Color.WHITE)
dist.dilate(2)

segmented = dist.stretch(240, 255)
blobs = segmented.findBlobs()
if blobs:
 circles = blobs.filter([b.isCircle(0.6) for b in blobs])
 for c in circles:
  img.drawCircle((c.x, c.y),
                 c.radius(),
                 SimpleCV.Color.YELLOW,
                 2)
 img.show()

Thursday, April 19, 2012

wiki of the future?

Last weekend I have been watching, reading and playing around with Ward Cunningham's Smallest Federated Wiki. As usual he is a great designer and aims to simple, effective, understandable and useful tools! I particularly like the plugins idea (not new of course) and how easy it seems to be to add new ones, like support for MathJax:
Get inspired you too!

Wednesday, April 18, 2012

syntax highlight

The following example shows how to syntax highligh some snippet of code in a very minimalistic way.
I used it by symlinking to a file in the version control repo and name it in as the argument of
$('#code-area').load() and here it is:


  code higlighted with minimal javascript
  
  
  
  


Metacircular code highlighting

The following code is an highlighted version of this very page using SyntaxHighlighter.
You need a decent modern browser to enjoy it.
  

metacircularity

I found and liked a very good summary of the 'Maxwell Equations of software' motto from Alan Kay in this post from Michael Nielsen.

It is nice also because it has running code inspired by all the gurus and books I like: Alan Kay, Peter Norvig, John McCarthy, SICP, Paul Graham.

Monday, February 6, 2012

Git and RSA identities

Here is the solution I found to be able to use git with a different RSA identity than the rsa_id default one.

My repo on github is logback-android and my user account is espinielli.
I did generate an SSH key as per github help and named it github_rsa:
$ ssh-keygen -t rsa -C "your_email@youremail.com" -f github_rsa

I then added the following section in ~/.ssh/config
# github for espinielli
Host github
HostName github.com
User espinielli
IdentityFile /Users/espin/.ssh/github_rsa


From within the repo directory (I cloned it before via http):
$ git remote add gh ssh://git@github.com/espinielli/logback-android.git

And finally I am able to use it like this:
$ git push gh master

Friday, January 20, 2012

LaTeX on Blogger again

My previous post about LaTeX  on Blogger reported that the solution described there did not work anymore...
Now I found a new solution based on mathjax.

So let's try it straight away with inline math, like the great equation \(e^{-2\pi}\), and with displayed math like the following:
\[ \left [ - \frac{\hbar^2}{2 m} \frac{\partial^2}{\partial x^2} + V \right ] \Psi
= i \hbar \frac{\partial}{\partial t} \Psi \]