blog

Rotate iPhone video 90 degrees on Ubuntu

A very quick note about rotating .MOV videos shot on an iPhone 90 degrees clockwise on Ubuntu.  The first tool I tried was ffmpeg but it turns out that the Ubuntu version of ffmpeg isn't compiled with the -vf command-line option enabled. You could re-compile ffmpeg from source but it's easier to use mencoder:

sudo apt-get install mencoder
mencoder -vf rotate -o Input.MOV -oac lavc -ovc lavc Output.MOV

Free Stanford course on Probabilistic Graphical Models

One of the main research directions for my PhD is likely to be experimenting with bispoke probabilistic graphical models for representing multi-state appliances like washing machines.  As such, I need to learn about existing probabilistic graphical models.  For the past few days I've been reading a textbook called "Probabilistic Graphical Models" by Koller and Friedman.  So far I've really enjoyed the book.

Over lunch today, a friend of mine told me that Stanford are running a free on-line course on Probabilistic Graphical Models, presented by Koller. I've signed up - it looks like a great course; it starts in Feb. Stanford are also running a course on Information Theory, which I've also signed up for.

My copy of David MacKay's "Information Theory, Inference and Learning Algorithms" arrived

My copy of David MacKay's book "Information Theory, Inference and Learning Algorithms" arrived yesterday and I started reading it last night. It looks absolutely fascinating.

I first came across Professor MacKay when I read his other book, "Sustainable Energy Without the Hot Air" and  I was struck by how lucid, readable and entertaining it is. There is every reason to expect that his information theory book will be at least as readable.

Why get a book on "Information Theory, Inference and Learning Algorithms"? The main reason is because it should be very useful for my PhD in smart meter disaggregation. One of the god-fathers of disaggregation, George Hart, wrote the following in Hart 1992:

It is insightful to consider the [disaggregation problem] in the context of a communication model. Appliances can be thought of as “transmitters”, inadvertently broadcasting information as a by-product of their operation. The communication “channel” here is the house wiring. Any of the many signatures... may be the “codes” used in this communication scheme. Our task is to design a “receiver” for these codes which can decode them in terms of appliance state-change “messages”.

In other words, the disaggregation problem can be considered in an information-theoretic framework. This conceptual step allows us to take advantage of the tools developed in communication technology (i.e. coding theory).

Also, for a while now I've thought of information theory as one of those "sexy but mysterious" things which I'd love to learn more about. I read "Decoding Reality: The Universe as Quantum Information" a couple of years ago and found it fascinating (although I only understood about half the content of the book).

So, hopefully MacKay's information theory book will be a great self-study book.

My MSc project on disaggregation is on the Imperial website

During the academic year 2010-2011, I did a computer science MSc at Imperial (which I thoroughly enjoyed). During the last 3 months of the course, each student does an "individual project". Mine was on "Disaggregating Smart Meter Readings using Device Signatures" and the PDF is now available on the Imperial website (note that my birth name is "Daniel" although I've had the nickname "Jack" since I was 11!)

This MSc project formed the basis for my PhD (I'm doing my PhD with the same excellent supervisor with whome I did my MSc project). 4 months into my PhD, I now recognise that my MSc project was pretty naive but it was lots of fun!

E-readers for academic papers & converting LaTeX to EPUB

I currently read academic papers by downloading the PDF and printing; and the tiny collection of LaTeX documents I've authored are output as PDFs. It feels like I should embrace e-readers for academic reading and writing. I have a Kindle Keyboard which does handle PDFs but reading PDFs is not especially pleasant on the Kindle because of its small screen, relatively sluggish refresh rate and clunky note-taking feature.

Reference library available online

I've been using Zotero as my reference manager for my MSc project and my PhD.  It's free.  It's open source.  It's awesome. One of the really nice things about Zotero is that you can easily publish your library.  So that's what I've done. There are references on climate science, smart meter non-intrusive load monitoring (NILM), graphical models and a few other subjects.

 

Notes for producing clean plots in Matlab for LaTeX

set(gca, 'TickDir', 'out', 'XColor', [0.25 0.25 0.25], 'YColor', [0.25 0.25 0.25]);
set(gca, 'YLim', [0 200], 'YTick', [0 100 200], 'YTickLabel', []);
set(gcf,'units','centimeters');
pos = get(gcf, 'position');
set(gcf, 'position', [pos(1:2),5 ,5]); % make figure 5cm x 5cm
box off; % remove axes on right and top
matlabfrag('filename'); % export a .tex and a .eps file using matlabfrag

Export plots from MATLAB as EPS. \usepackage epstopdf in LaTeX.

MATLAB printing and exporting.

Using the same font in the figures and the LaTeX document

LaTeX documents, by default, use the Computer Modern font. It's often considered a good idea to use as few fonts as possible on a single page (otherwise it risks looking ugly). Hence it would be nice to use Computer Modern for figure text.  (This is achieved easily when using GNUplot to create figures using GNUplot's epslatex output terminal).

MATLAB simply cannot set the tick font to Computer Modern.  You can attempt to set the label font to computer modern using something like this:

set(0, 'defaultTextInterpreter', 'latex');
set(0, 'defaultTextFontName', 'cmr10');

But that also seems to result in the x-axis label being cropped off for small figures (say 5 x 5cm).  Tinkering with the label's y Position and the axes's y Position and height seems to be able to fix this problem but this seems like a lot of work, especially given that the output is always going to be unsatisfactory because the tick labels are a different font.

But the user-submitted script teximage.m may be a good bet (I haven't tried it) for rendering fonts using LaTeX and inserting the resulting bitmap into the EPS image.

Remarkably, MATLAB does not have in-built support for exporting figures as EPS files with placeholders plus a TEX file (hence allowing LaTeX to do the typesetting).  But there are some user-submitted scripts.  The most promising looks to be matlabfrag (I haven't tried it yet though).

Re-installing Windows Vista x64 Media Center

Just as we were settling down to watch TV on Sunday night, our HTPC (which runs Vista Media Center) decided to stop working. After installing some updates, Media Center gave a "component registration failure" error whenever we tried to watch either live or recorded TV.  After several attempts at fixing it, I decided to re-install Windows Vista (this was something I'd been planning to do for a while because Vista had swallowed up almost all of the system drive on which it was installed).  Here are some notes on installing Vista on my HTPC.  Our hardware includes:

Fixing a waterlogged iPhone 3GS

About a week ago, my wife's iPhone 3GS found its way into the washing machine and spent a good 15 minutes being washed before it was rescued.  We eventually got it to work this morning.  I'll quickly describe what we tried; what worked and what didn't work.

moving photos from Gallery2 to Flickr

From about 2003 until today, I kept my photos in a variety of places. Most of my photos were on my old website's photo gallery which ran the excellent Gallery2 software. For a number of reasons, I decided to move all my photos to my Flickr account. (I wanted to make use of the community features on flickr, I was failing to keep my Gallery2 install updated and my Android phone makes it really easy to upload photos direct to Flickr).

Pages

Subscribe to RSS - blogs