My blog - by most recent
Full index or by tag
-
Feb 17, 2016
Adding an RSS feed to your Github pages website
With their usual small fanfare, github have added the ability to automatically generate an RSS feed of your recent posts to the gem plugins they have available. To use it, add the lines:
-
Feb 16, 2016
Adding a logo to a ParaView window
The vtkLogoWidget class exists to allow logo insertion in standard VTK render instances, but what about in ParaView? It turns out you can still use it fine. Run the following script in the ParaView python shell, or even make it a macro!
-
Feb 15, 2016
Using straight VTK to render text
Lets write a simple script to display some text in a standard vtk window:
-
Feb 14, 2016
Colourful copying in Mac OS X
The pygmentize tool can automagically syntax mark up an awful lot of languages, but sometimes you need to paste the text into a windowed application. Fortunately on Mac OS X there’s a convenient way of doing this making its way round the interweb. It makes use of rich text format (rtf) and the command line tool
pbcopy
which copies stdout to the mac pasteboard. The full command is -
Feb 13, 2016
Test if a variable exists in python
Sometimes we want to write a snippet which acts only if a variable doesn’t existThis one is fairly straightforward to do using the globals function:
-
Feb 4, 2016
Regexps - another thing I can't do. Yet.
Regular expressions are a powerful tool for text processing. Apparently. For some reason I just can’t ever get my head round them, and thus, given my preferred method for learning things, I can can never remember any of the syntax for them. So I’m going to try and do something about it by making notes on useful things which can be done with them.
-
Jan 8, 2016
Python in parallel with mpi4py
The module
mpi4py
makes it fairly trivial to make MPI calls within python scripts, by allowing first class python objects to be passed. As an example of a near do nothing script, consider the following: -
Jan 7, 2016
Python functionalities everyone should use more
Some notes on a few slightly quirky features of python that I (and everyone) ought to take note of.
-
Jan 6, 2016
Git recipes - Part III
Yesterday we dealt with some git commands which allow it to be used as originally intended. Today we’ll move on to some powerful, but dangerous commands which (almost) literally allow developers to rewrite history.
-
Jan 5, 2016
Git recipes - Part II
Yesterday we dealt with methods for SVN users to try to pretend they aren’t being forced to use git. Today we’ll move on to some recipes to take advantage of the strengths of git.