Remember the path of last login
create ~/.bash_logout
with the following contents:
1 2 | t=`readlink -f \`pwd\`` ln -sfn $t ~/lastdir |
Continue reading ‘Remember the path of last login’ »
Molecular modeling in Materials Sciences Web development Programming IT
Archive for the ‘My work’ Category.
create ~/.bash_logout
with the following contents:
1 2 | t=`readlink -f \`pwd\`` ln -sfn $t ~/lastdir |
Continue reading ‘Remember the path of last login’ »
The key steps
1. Create a folder named “~/python-packages”, then create a path “~/python-packages/lib/python2.6/site-packages/” with
1 | mkdir -p python-packages/lib/python2.6/site-packages/ |
The above path containing the version number of Python should be adjust accordingly base on the actual Python version you are using.
This step sets up a directory structure that is needed by python modules.
Continue reading ‘Install Python modules as non-root user on HPC cluster’ »
To create more than one window in a gnuplot script could be necessary if you have many data series to plot. The following code snippet shows how:
1 2 3 4 5 6 7 8 |
The essential point here is to use twice(or more times) “set term” commands with different window ID.
Continue reading ‘Multiple windows with gnuplot’ »
To select a toolkit for GUI programming is something like to select a bottle of wine. Only you know your favorites. Here are mine.
OK, even after reading the handbook a few times, it is not very clear which python file is the initial script for Qtiplot. It is important to know if you want to extend Qtiplot with python. After checking all the default python files in the Qtiplot installation path, I found qtiplotrc.py should be the one, although a smarter guy would have realized this from its name. You could import your own Python module in this startup file and enjoy them right after entering Qtiplot.
History Expansion
History expansions introduce words from the history list into the input stream, making it easy to repeat commands, insert the arguments to a previous command into the current input line, or fix errors in previous commands quickly.
A demo program showing the way to make animation with matplotlib.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # A demo for animation with matplotlib # Written by Ting Li (Dr.Ting.Li at gmail.com) # 2010-09-10 # Ref: http://www.scipy.org/Cookbook/Matplotlib/Animations import numpy as np import time import matplotlib matplotlib.use('WXAgg') #before import pylab, choose the GUI backend #It can also be done while calling this script from command line: #>>> python animation.py -dWXAgg #Other backends are: valid strings are ['ps', 'Qt4Agg', 'GTK', 'GTKAgg', 'svg', # 'agg', 'cairo', 'MacOSX', 'GTKCairo', 'WXAgg', 'TkAgg', 'QtAgg', 'FltkAgg', # 'pdf', 'CocoaAgg', 'emf', 'gdk', 'template', 'WX'] from pylab import * <a href="http://9rivers.linkka.com/2010/09/11/animation-with-matplotlib/#more-561" class="more-link"><small>Continue reading ‘Animation with matplotlib’ »</small></a> |
Zotero, the must-have reference manager for scientists, supports various bibliography styles. This is benefited from the CSL (citation style language), which is an open XML standard for citations and bibliographies. Since Zotero is implemented as a Firefox addon, it naturally supports search and grab references from the internet, which is very convenient and better than some other stand-alone reference managers.
Continue reading ‘A Zotero style for ACS references with titles’ »
I didn’t know this before I saw this post. The shortcut is ‘Alt+=’. That’s simple!
There is a ‘-C’ option allow you to do this. However, it can fail in some situation. There are also some posts online that report this option does not work. If you have that problem, maybe you could try the solution here.
Continue reading ‘Uncompress tar to specific directory + Other tar/untar tricks’ »