-
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 bylatexdiff
only working correctly on files with unix style line endings. So if you have a file that doesn’t work properly, try runningdos2unix
on the file to correct the endings and then try again. …
-
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: …
-
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. …
-
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: …
-
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 toFig_8
. Which can be done like this: …
-
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: …
-
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. …
-
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: …
-
Redirecting Nohup Output to File
If I want to run a command using
nohup
and redirect the output to a file other than the defaultnohup.out
I can use the following syntax to redirect stdout and stderr into the same file: …
-
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 functionisnan
: …