Category Archives: Videos

Low-friction paperless workflow

I’ve been trying to shift much more of the paperwork in my life into the digital world, but I was very keen that filing a bit of paper electronically should be as easy as putting it in a folder in the filing cabinet. “Wouldn’t it be nice”, I thought, “if the only thing I had to do was type a name or a few keywords and everything else happened automatically?”

So I built a system which did just that. This video describes in some detail how the script is set up. You may want to use the full-screen and HD options to make things more readable. If you’re less interested in the details and would just like to see it in action, watch the first couple of minutes and then skip to about 13:30.

One thing I don’t talk about in the video is the fact that Hazel rules can also look at the contents of the file. So, once the document has been OCRed, the automatic filing can happen based on words that actually occur on the paper — it might detect your car’s registration number (licence plate), for example, in a document and know to file that under ‘car stuff’ — which I think is very cool.

Some further links:

Inventing on Principle

This is an interesting and unusual talk, given about a year ago at a Canadian software engineering conference. I’d seen it before, but a friend reminded me of it recently (thanks, Aideen!) so I’ve just watched it again.

Bret Victor starts by talking about new ways to design software, and finishes with some suggestions on how to live your life. This is dangerous, because you may only find him credible on one of these points, and one could perhaps argue that the one-hour talk would be better delivered as two half-hour talks. And the first couple of minutes, delivered in his slow, careful style in a badly-lit brown room, don’t jump out and grab you. However, I think he pulls it off, and it certainly has the merit of being very different from your typical software-engineering talk.

Recommended.

No Troubled Thoughts

One of the records that was regularly played in my childhood home was a collection of sketches by the wonderful Joyce Grenfell. This was a favourite, and though I only ever knew it as audio, the place to find such things nowadays is of course YouTube.

 

 

 

An Italian telling people not to talk so much?

It’s almost too easy to find inspiring TED talks, so I don’t often post them here now, but this one particularly attracted me.

Ernesto Sirolli manages to give some great advice on aid (which is also relevant in the developed world) and on high-tech entrepreneurship (which is also relevant in the developing world). To do both of these in such an amusing and impassioned way, in just 15 mins, is sheer brilliance.

(Very nicely filmed, too)

The New Pointillism?

How can you take a year and a half to make a 3-minute music video? Like this:

It’s even more amazing when you know how they made it. There are no green-screens here, and every frame is created by hand…

This has been out for a while, of course, but old people like me have just discovered it. (Old people like me might also be reminded of Peter Gabriel’s ‘Sledgehammer’ video, which was pretty amazing a quarter of a century ago…)

Jump!

Lots of people seemed to like the Perpetuum Jazzile video in my last post, so here’s another.

Man, these guys are good! Check back here for one more tomorrow…

Using Little Computers to control Big Computers

Here’s my latest Raspberry Pi-based experiment: the CloudSwitch.

I don’t discuss the software in the video, but the fun thing is that the Pi isn’t dependent on some intermediate server – it’s using the boto module for Python to manage the AWS resources directly.

I decided to build the app slightly differently from the way I would normally approach a little project like this. I knew that, even for this very simple system, I would have several inputs and outputs of various kinds, some of them with big delays, and I wanted to make sure that timing hiccups or race conditions didn’t ever leave the lights displaying something that didn’t represent reality.

So this is only a single python file, but it runs several threads – one that looks for button presses, one that monitors and controls the Amazon server, and one that handles the lights – including flashing them in various patterns. They interact with the main thread using ZeroMQ messages, which is a lovely way to do inter-thread communications without all that nasty messing about with semaphores and mutexes.

Update: Here’s the very simple circuit diagram. The illuminated buttons I used have LEDs which take a little more power than the Raspberry Pi can really drive, so I put a couple of NPN transistors in there. It really doesn’t matter too much what they are – I used the 2N3904.

Raspberry Pi Webcam Viewer

I finally got a chance to play with my RaspberryPi, so I threw together a quick experiment.

 

 

Update: A few people have asked me for a little more information. I’m happy to make the source code available, but it’s not very tidy and a bit specific to my situation… however, to answer some of the questions:

The enclosure for the Raspberry Pi comes from SK Pang Electronics, and it’s perfect for my needs. You can buy just the perspex cover, but they do a nice Starter Kit which includes the breadboard, some LEDs, resistors and the pushswitch. Definitely recommended.

For the graphics, I used the PyGame library, which has the advantage of being cross-platform: you can use it with a variety of different graphics systems on a variety of different devices. On most Linux boxes, you’d normally run it under X Windows, but I discovered that it has various drivers that can use the console framebuffer device directly. This makes for a quicker startup and lighter-weight system, though I imagine it probably has less access to hardware acceleration, so it’s probably not the way to go if your graphics need high performance. You can read about how to get a PyGame display ‘surface’ (something you can draw on) from the framebuffer, in a handy post here.

To load an image from a file in PyGame is easy: you do something like this:

            im_surf = pygame.image.load(f, "cam.jpg")

where ‘f’ is an open file, and the ‘cam.jpg’ is just an invented filename to give the library a hint about the type of file it’s loading.

Now, with a webcam, we need to get the image from a URL, not from a file. It’s easy to read the contents of a URL in Python. You just need something like:

            import urllib
            img = urllib.urlopen(img_url).read()

but that will give you the bytes of the image as a string. If we want to convert it into a PyGame surface, we need to make it look more like a file. Fortunately, Python has a module called StringIO which does just that: allows you to treat strings as if they were files. So to load a JPEG from img_url and turn it into a PyGame surface which you can blit onto the screen, you can do something like:

          f = StringIO.StringIO(urllib.urlopen(img_url).read())
          im_surf = pygame.image.load(f, "cam.jpg")

I’ll leave the remaining bits as an exercise for the reader!

If you like this, you might also like my CloudSwitch

Spinning Beachball

A TED speaker’s worst nightmare. Mac users will enjoy this…

Here it is on the TED site (also works for non-Flash users).

Lady WoofWoof – Bark This Way

I made a silly movie. Starring my dog. Yes, another one. My excuse is that it’s mostly for the benefit of distant friends and family.

Then, to compound my folly, I made a movie about how I’d made the movie, which is probably more interesting for most people!

Update: Thanks to Richard Morrison for pointing me at these instructions for making your own camera stabiliser – very nice!

Cashing in on Open Source

I’ve recently switched to using GnuCash to manage my accounts, and have been quite impressed with it. A friend recently asked about software for simple bookkeeping, and I wondered whether GnuCash might be appropriate, but I didn’t find an introduction that took someone unfamiliar with accounting software through the absolute basics. So here’s my attempt to do so. It’s 26 minutes long.

Direct link.

Not your average Scottish cycling holiday…

I’d love to see the out-takes…

© Copyright Quentin Stafford-Fraser