Skip to content

Instantly share code, notes, and snippets.

Avatar

Sebastiano Ferraris SebastianoF

View GitHub Profile
@SebastianoF
SebastianoF / counter.py
Created Oct 14, 2018
Count words in latex
View counter.py
import os
import subprocess
'''
Counts the words in the manually selected latex files in the list list_file
Commands to obtain the number of words in a .tex file:
'detex my_file.tex | wc -w'
where my_file.tex is one of the string in the list list_files
View permutation_insights.md

For future reference after the discussion https://codereview.stackexchange.com/questions/201725/disjoint-cycles-of-a-permutation

How to go from Cauchy notation to cyclic notation of a permutation with python

After insights from @Accumulation (working but with extra loop and with no inverse) and @Martin R (not working but with cool insight and inverse), here is what I have got: (it seems to work, but is far from the pythonic-elegance suggested by Martin R).

def permutation_from_cauchy_to_disjoints_cycles(cauchy_perm):
@SebastianoF
SebastianoF / gist:5a43eec688674f1b885bf1dda77c17c1
Created Sep 4, 2017
Python, upload to pypi the latest code release
View gist:5a43eec688674f1b885bf1dda77c17c1
# setup.py must be there
# create the latest version
python setup.py bdist_wheel
# upload to pypi
twine upload dist/<your_code_name>_<your_version>.whl -r pypi