Robin's Blog

Archive for the ‘How To’ Category

How to: speed up viewing Samba network shares in OS X

This is a very brief post to explain how I managed to speed up the viewing (that is, listing of files/directories) in Samba shares accessed via OS X. So, a bit of background: I have a file server at home which has some shared folders on it, shared using the SMB protocol. This is the […]

How to: rescue lost code from a Jupyter/IPython notebook

Jupyter (formerly known as IPython) notebooks are great – but have you ever accidentally deleted a cell that contained a really important function that you want to keep? Well, this post might help you get it back. So, imagine you have a notebook with the following code: and then you accidentally delete the top cell, with […]

How to: add simple new commands to LaTeX to help with writing papers

Like a lot of academics, I write many documents in LaTeX – including almost all of my academic papers, and my PhD thesis! So, anything that can make my life easier is of interest to me. I was recently discussing this with a colleague (a co-author on a paper actually), and realised that lots of […]

How to: get nice vector graphics in your exported PDF ipython notebooks

(This is really Part 2 of IPython tips, tricks & notes – Part 1, but I thought I’d give it a more self-explanatory title) IPython (sorry, Jupyter!) notebooks are really great for interactively exploring data, and then turning your analyses into something which can easily be sent to a non-technical colleague (by adding some Markdown and […]

How to: load the Google Maps Places library through Google API Loader

Google have recently introduced a new way of loading their javascript APIs: their Google API Loader. To use it, all you do is add a script tag in your HTML: <script src=”https://www.google.com/jsapi”></script> You can then load whatever Google APIs you want using code like this: google.load(‘visualization’, ‘1.0’); google.load(‘jquery’, ‘1’); google.load(‘maps’, ‘3’); google.setOnLoadCallback(function() { console.log(‘Callback’) }); […]

How to: Log electricity usage from a CurrentCost EnviR – Part 1

After borrowing a CurrentCost electricity usage meter from my local library (if you’re in the area, then Eastleigh library will loan you one for free!), I decided to buy one, as I’d found it very useful in trying to reduce my electricity usage. The benefit of buying one as opposed to borrowing one was that […]

How to: Fix weird ENVI startup file issues

This post is more a note to myself than anything else – but it might prove useful for someone sometime. In the dim and distant mists of time, I set up a startup file for ENVI which automatically loaded a specific image every time you opened ENVI. I have no idea why I did that […]

Simple parameter files for Python class-based algorithms

As part of my PhD I’ve developed a number of algorithms which are implemented as a class in Python code. An example would be something like this: class Algorithm: def __init__(self, input_filename, output_basename, thresh, n_iter=10): self.input_filename = input_filename self.output_basename = output_basename self.thresh = thresh self.n_iter = n_iter def run(self): self.preprocess() self.do_iterations() self.postprocess() def preprocess(self): # […]