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
''' | |
Overloads the builtin `print()` function to print the file and line number | |
where the print occurs, similarly to Javascript's `console.log()`. | |
Useful when in development. Just import this file at the top of your project. | |
''' | |
import builtins | |
import inspect | |
import os |
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
def array2htmltable(data): | |
q = "<table>\n" | |
for i in [(data[0:1], 'th'), (data[1:], 'td')]: | |
q += "\n".join( | |
[ | |
"<tr>%s</tr>" % str(_mm) | |
for _mm in [ | |
"".join( | |
[ | |
"<%s>%s</%s>" % (i[1], str(_q), i[1]) |
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 | |
# azimuths to plot (degrees) | |
data = [95, 87, 82, 96, 78, 89, 129, 264, 277, 58] | |
# convert to radians | |
azimuths_rad = (np.array(data) * np.pi) / 180.0 | |
# Polar plotting |
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
# * just prepares some data to plot, the legend trick is at line 54 | |
docs = {'ndocs': {'Actes': 1775, | |
'Article': 626, | |
'Autre': 497580, | |
'Compte rendu': 1831, | |
'Culturel': 76034, | |
'Document': 525, | |
'Livres': 313, |
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
sudo apt-get remove \ | |
emacs emacs24 emacs24-bin-common \ | |
emacs24-common emacs24-common-non-dfsg emacsen-common | |
wget -c http://gnu.mirror.vexxhost.com/emacs/emacs-24.5.tar.xz | |
tar vxf emacs-24.5.tar.xz | |
cd emacs-24.5/ | |
sudo apt-get install libxml2-dev libgtk-3-dev \ | |
libtiff5-dev libgif-dev libXpm-dev libncurses-dev | |
./configure | |
make |