Skip to content

Instantly share code, notes, and snippets.

@edouardklein
edouardklein / UnderwaterCorrection.py
Created June 22, 2014 06:11
Underwater picture correction with the GIMP
# This script can be used to correct red absorption
# when taking pictures underwater
# to use in the GIMP, open the python-fu console,
# set the my_dir variable and exec the file :
# exec(open('path/to/file.py).read())
# Realeased under the WTF public license
for file in listdir(my_dir):
if (file[-4:] != '.JPG'):
continue
print my_dir+'\\'+file
@edouardklein
edouardklein / keybase.md
Created October 21, 2014 15:14
Keybase Verification

Keybase proof

I hereby claim:

  • I am edouardklein on github.
  • I am edouardklein (https://keybase.io/edouardklein) on keybase.
  • I have a public key whose fingerprint is 2164 F600 B1D7 4177 8612 48F0 6BF2 F6A1 07FC 758C

To claim this, I am signing this object:

@edouardklein
edouardklein / ComparativeAdvantage.py
Created January 2, 2015 13:38
Code to plot Figure 1 in the paper "Easy steps towards a sane IT policy in hospitals"
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <markdowncell>
# We visualize the maximum cost at which an IT worker can be hired given his efficiency and the hourly cost of the people he is replacing.
# <codecell>
def hourly_cost(monthly_cost=0, hours_per_week=0, hours_per_month=0, monthly_salary=0):
@edouardklein
edouardklein / APHPscraping.py
Created January 2, 2015 15:26
This script automatically fetch information from Paris hospitals patient information system by simulating GUI actions.
"""This script automatically fetch information from Paris hospitals patient information system by simulating GUI actions.
See it in action there : https://www.youtube.com/watch?v=nGMSP_wBr-8 .
Although this is ad-hoc to the task at hand, we share this because some features are nice and worth replicating :
- Logging allow for after-the-fact debugging. This is necessary because the script is to be launched by people who don't
have IT skills, and it automates a buggy software which randomly crashes.
- There are some workarounds for pyautogui's limitations, see nonasciichars_workaround() and change_date().
- Using csv files as input and output and rewriting them at every iteration allow for no data loss, no matter how critical the failure.
- Trapping errors in try:...except: blocks allow to log failure states and correct them on the go, while continuing the tasks
@edouardklein
edouardklein / Ed
Last active August 29, 2015 14:14
iPython notebook - Cancer classifier
{
"metadata": {
"name": "",
"signature": "sha256:85272ac1663064bca34b844ba7fc160187b15dcadf58efacf0ca4b4f043e5d58"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@edouardklein
edouardklein / m_array.ipynb
Last active August 29, 2015 14:14
iPython notebook - M-array
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@edouardklein
edouardklein / HMM
Last active August 29, 2015 14:15
HMM
{
"metadata": {
"name": "",
"signature": "sha256:4d4b09fc52007a513388c088a50125d674ffd05d5be7e9d643dcf582d8e4d3dd"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@edouardklein
edouardklein / HMM
Last active August 29, 2015 14:15
HMM2
{
"metadata": {
"name": "",
"signature": "sha256:e03d52a26f4dccc6cc9bde5805be986ec05a75df60c1c7dd98c7d4478ecb1993"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@edouardklein
edouardklein / BigData.ipynb
Created March 3, 2015 23:32
iPython notebook - TP BigData @epita
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"metadata": {
"name": "",
"signature": "sha256:9d075aa2b84192041a12154406b6cec23f7731d96854c8bed1b4010b96ea94cb"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [