#LaTeX in IPython Notebook
With this extension you can use LaTeX-style references within IPython (Notebook) while still using markdown for formatting.
Required:
- ipython-dev
- biblio-py
- markdown
| from __future__ import division | |
| from numpy.fft import rfft | |
| from numpy import argmax, mean, diff, log, nonzero | |
| from scipy.signal import blackmanharris, correlate | |
| from time import time | |
| import sys | |
| try: | |
| import soundfile as sf | |
| except ImportError: | |
| from scikits.audiolab import flacread |
| #!/usr/bin/python2 | |
| # Copyright (C) 2016 Sixten Bergman | |
| # License WTFPL | |
| # | |
| # This program is free software. It comes without any warranty, to the extent | |
| # permitted by applicable law. | |
| # You can redistribute it and/or modify it under the terms of the Do What The | |
| # Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See |
| import numpy as np | |
| def peakdetect(y_axis, x_axis = None, lookahead = 500, delta = 0): | |
| """ | |
| Converted from/based on a MATLAB script at http://billauer.co.il/peakdet.html | |
| Algorithm for detecting local maximas and minmias in a signal. | |
| Discovers peaks by searching for values which are surrounded by lower | |
| or larger values for maximas and minimas respectively | |
| function substitute { | |
| if [ -z "$1" -o -z "$2" ]; then | |
| echo "Usage: substitue FROM_STRING TO_STRING [OPTION]..." | |
| echo | |
| echo "Replace all occurances of FROM_STRING (a sed-compatible regular" | |
| echo "expression) with TO_STRING in all files for which ack-grep matches" | |
| echo "FROM_STRING." | |
| echo | |
| echo "Any additional options are passed directly to ack-grep (e.g.," | |
| echo " --type=html would only run the substitution on html files)." |
| import numpy as np | |
| import scipy.linalg.blas | |
| cdef extern from "f2pyptr.h": | |
| void *f2py_pointer(object) except NULL | |
| ctypedef int dgemm_t( | |
| char *transa, char *transb, | |
| int *m, int *n, int *k, | |
| double *alpha, |
#LaTeX in IPython Notebook
With this extension you can use LaTeX-style references within IPython (Notebook) while still using markdown for formatting.
Required:
| language: ruby | |
| branches: | |
| only: | |
| - master | |
| script: | |
| - "bundle exec jekyll build" | |
| - ./build.sh |
| # DISCLAIMER: | |
| # - Code is provided "as is" and any expressed or implied warranties are disclaimed. | |
| # - Errors and omissions excepted. | |
| # NOTE: | |
| # - Read it carefully, some commands might have to be changed for your system. | |
| # - BLAS/LAPACK compilation commands will most likely have to be changed based on the | |
| # stackoverflow link below. | |
| # - Running this shell file as a script is NOT recommended. Copy/pasting one command at a time is | |
| # okay as long as you monitor the output for any possible errors/warnings. |
| """ | |
| ldr.py | |
| Display analog data from Arduino using Python (matplotlib) | |
| Author: Mahesh Venkitachalam | |
| Website: electronut.in | |
| """ | |
| import sys, serial, argparse |
Copy nbflatten.py to somewhere on $PATH. Then, in the root of a git repository, run these commands:
echo "*.ipynb diff=ipynb" >> .gitattributes
git config diff.ipynb.textconv nbflatten.pyWhen you change a notebook and run git diff, you'll see the diff of flattened, simplified notebooks, rather than the full JSON. This does lose some information (metadata, non-text output), but it makes it easier to see simple changes in the notebook.
This doesn't help with merging conflicting changes in notebooks. For that, see nbdiff.org.