Why does that happen?

— Keeping track of things I should remember



  1. Fixing latexdiff issues

    I was getting some really odd problems with running latexdiff for some paper revisions. The first few pages would build fine, and then all of the remaining pages would be marked up as new insertions. It turns out that the problem was caused by latexdiff only working correctly on files with unix style line endings. So if you have a file that doesn’t work properly, try running dos2unix on the file to correct the endings and then try again. …


  2. Using GDAL to fix NoData issues

    If you grab some raster data and it has a weird NoData value set, it may not work properly in LSDTopoTools. To fix this run this command: …


  3. Installing fonts in Ubuntu 14.04

    To install fonts on Ubuntu, first download the fonts that you want. For example I wanted the Font Awsome symbols for my CV. …


  4. Checking out a specific revision using git

    If I need to grab a specific version of a git repository, for example, to run latexdiff on an old version of a paper I can do the following. Firstly get the SHA for the particular commit, either through the command line: …


  5. Creating numbered directories

    For a paper I was submitting I wanted to create a directory to store each figure I created, so wanted to create a series of directories named Fig_1 through to Fig_8. Which can be done like this: …


  6. Copying files via ssh

    To move files between machines which you can connect to via ssh, you can use the command scp. To copy a file from a remote machine to your local machine use: …


  7. Thinning a Dataset

    If you have a large plain text data file, that needs to be quickly plotted, it can be useful to thin the data by selecting every nth line, particularly if the dataset is too large to be loaded into memory using numpy. This post is based around this SuperUser question. …


  8. Removing errorbars from matplotlib legends

    Matplotlib by default includes errorbars in the legend on top of whatever symbol is being used. I think this makes the legend look really messy, so wanted to remove it and simply plot the symbols. Here is a legend with errorbars included: …


  9. Redirecting Nohup Output to File

    If I want to run a command using nohup and redirect the output to a file other than the default nohup.out I can use the following syntax to redirect stdout and stderr into the same file: …


  10. Checking For nans in a Numpy Array

    I was trying to debug some code today and found that I had a nan value propagating through some calculations, causing very weird behavior. I figured there must be a quick way to check numpy arrays for nan values. We can use the numpy function isnan: …