Table of Contents
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See: | |
# http://stackoverflow.com/questions/14095011/using-awk-to-align-columns-in-text-file | |
# for more info. | |
head -1 file.dat; tail -n+2 file.dat | rev | column -t | rev > out.dat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See: | |
# http://unix.stackexchange.com/questions/164207/insert-missing-string-in-multiple-ordered-columns | |
# | |
# The string of numbers after 'FIELDWIDTHS' indicate the end position of each column in the file | |
# The column numbers should be counted *starting from 0*. | |
gawk -vFIELDWIDTHS="4 7 4 6 8 8 6 8 8 8 7 5 4" -vOFS= '{for (i=1;i<=NF;i++) sub(" $","--",$i);}1' file.dat > out.dat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
print 'Versions\n' | |
print 'python', sys.version | |
try: | |
import numpy | |
print 'numpy', numpy.__version__ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Script to generate a PDF with all differences marked | |
# via the latexdiff package, between two .tex files. | |
# See: http://www.ctan.org/pkg/latexdiff | |
# | |
# All output is stored in a diff/ sub-folder that is | |
# created if it doesn't exist. | |
# | |
# Run with: |
Taken from here:
sudo leafpad /usr/share/applications/google-chrome.desktop
You'll find 3 entries in this file, [Desktop Entry], [NewWindow Shortcut Group] and [NewIncognito Shortcut Group]. Make sure that under each group there's the following line, it doesn't matter where in the group it is.
StartupWMClass=Google-chrome-stable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import numpy as np | |
def plt_f_chart(fig, x_name, y_name, coord, x_zmin, x_zmax, y_zmin, | |
y_zmax, x_data, y_data, st_sizes_arr, labels, center_cl, | |
clust_rad, mps): | |
''' | |
Zoom on x,y finding chart. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import numpy.linalg as la | |
import matplotlib.pyplot as plt | |
from matplotlib.patches import Ellipse | |
# import time | |
# http://stackoverflow.com/questions/14016898/port-matlab-bounding-ellipsoid-code-to-python | |
# http://stackoverflow.com/questions/1768197/bounding-ellipse/1768440#1768440 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
def cluster_stars(N, min_v, max_v): | |
''' | |
''' | |
mu = np.random.uniform(min_v, max_v) | |
sigma = np.random.uniform(max_v / 10., min_v / 10.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy.ndimage.filters import maximum_filter | |
from scipy.ndimage.filters import gaussian_filter | |
from scipy.ndimage.morphology import generate_binary_structure, binary_erosion | |
from scipy import stats | |
import matplotlib.pyplot as plt | |
import matplotlib.gridspec as gridspec | |
import matplotlib.offsetbox as offsetbox | |
# from mpl_toolkits.axes_grid1 import make_axes_locatable |
OlderNewer