Python sorting objects of user defined class

The most common way of sorting collections of custom objects in Python is to provide key function that is used to extract a comparison key from each element:

sorted("Case insensitive Sorting is here".split(), key=str.lower)

But sorted function compares objects by its nature, and it is possible to define comparison operators for your class t make sorted work automatically.

Install Jupyter Notebook and Scientific Environment in Ubuntu 14.04 With Python 3

Several changes occured since my last note about installing python scientific environment:

Scan images from command line in Linux

Console utilities in Linuxes are cool: mcabber for jabber, mutt for mail, mocp for music, vim to rule them all! This note is about scaning from the console (I assume your scanner is already set-up). Aim is to scan document with good quality into pdf with reasonable size.

Animations from scientific data using Paraview 4.3 and python

Create frames

This note describes usage of Paraview 4.3 (contrary to previous note with Paraview before 4.1). Some changes were made:

  • command line arguments were added to make code more reusable
  • it works with Paraview extracted from the archive (4.3.1)
  • white background must be specified manually (SetViewProperties(view, Background = [1, 1, 1]) in the code)