From 37e1cda3e41cb392d1a851fca0bc36d69aa481b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20R=C3=BCmpelein?= Date: Tue, 19 Apr 2016 17:13:44 +0200 Subject: [PATCH] Initial Commit * Notes for basic talk layout * gitignore --- .gitignore | 177 +++++++++++++++++++++++++++++++++++++++++++++++++++++ Notes.md | 58 ++++++++++++++++++ 2 files changed, 235 insertions(+) create mode 100644 .gitignore create mode 100644 Notes.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0a5165d --- /dev/null +++ b/.gitignore @@ -0,0 +1,177 @@ +## Core latex/pdflatex auxiliary files: +*.aux +*.lof +*.log +*.lot +*.fls +*.out +*.toc +*.fmt +*.fot +*.cb +*.cb2 + +## Intermediate documents: +*.dvi +*-converted-to.* +# these rules might exclude image files for figures etc. +# *.ps +# *.eps +# *.pdf + +## Bibliography auxiliary files (bibtex/biblatex/biber): +*.bbl +*.bcf +*.blg +*-blx.aux +*-blx.bib +*.brf +*.run.xml + +## Build tool auxiliary files: +*.fdb_latexmk +*.synctex +*.synctex.gz +*.synctex.gz(busy) +*.pdfsync + +## Auxiliary and intermediate files from other packages: +# algorithms +*.alg +*.loa + +# achemso +acs-*.bib + +# amsthm +*.thm + +# beamer +*.nav +*.snm +*.vrb + +# cprotect +*.cpt + +# fixme +*.lox + +#(r)(e)ledmac/(r)(e)ledpar +*.end +*.?end +*.[1-9] +*.[1-9][0-9] +*.[1-9][0-9][0-9] +*.[1-9]R +*.[1-9][0-9]R +*.[1-9][0-9][0-9]R +*.eledsec[1-9] +*.eledsec[1-9]R +*.eledsec[1-9][0-9] +*.eledsec[1-9][0-9]R +*.eledsec[1-9][0-9][0-9] +*.eledsec[1-9][0-9][0-9]R + +# glossaries +*.acn +*.acr +*.glg +*.glo +*.gls +*.glsdefs + +# gnuplottex +*-gnuplottex-* + +# hyperref +*.brf + +# knitr +*-concordance.tex +# TODO Comment the next line if you want to keep your tikz graphics files +*.tikz +*-tikzDictionary + +# listings +*.lol + +# makeidx +*.idx +*.ilg +*.ind +*.ist + +# minitoc +*.maf +*.mlf +*.mlt +*.mtc +*.mtc[0-9] +*.mtc[1-9][0-9] + +# minted +_minted* +*.pyg + +# morewrites +*.mw + +# mylatexformat +*.fmt + +# nomencl +*.nlo + +# sagetex +*.sagetex.sage +*.sagetex.py +*.sagetex.scmd + +# sympy +*.sout +*.sympy +sympy-plots-for-*.tex/ + +# pdfcomment +*.upa +*.upb + +# pythontex +*.pytxcode +pythontex-files-*/ + +# TikZ & PGF +*.dpth +*.md5 +*.auxlock + +# todonotes +*.tdo + +# xindy +*.xdy + +# xypic precompiled matrices +*.xyc + +# endfloat +*.ttt +*.fff + +# Latexian +TSWLatexianTemp* + +## Editors: +# WinEdt +*.bak +*.sav + +# Texpad +.texpadtmp + +# Kile +*.backup + +# KBibTeX +*~[0-9]* diff --git a/Notes.md b/Notes.md new file mode 100644 index 0000000..5131be2 --- /dev/null +++ b/Notes.md @@ -0,0 +1,58 @@ +# WTFunctional: Modifying your WTF-Count using functional programming # + +## Content ## + + * Dafunc? Understanding functional programming with Haskell. + + no side-effects, no mutability => maintainability + + recursion + + functions as first class “objects”: i.e. C++, 5; is a valid statement + + lambdas + + lists, maps, filters, folds + => readability, less code reproduction, threadsafety… + + currying => just convenience + + code example: Pythagoraian triangles. + * Phuncy: The pythonic way is functional! + + Not strictly functional + + recursion, fafco + + lambda syntax + + map, fold => example (sum of squares?) + - python lambda syntax: lambda a,b: a+b + - fold with reduce + - don't return lists, but iterators! + - Note: 2: map, filter, reduce + 3: map, filter, functools.reduce() + ```Removed reduce(). Use functools.reduce() if you really need it; + however, 99 percent of the time an explicit for loop is more + readable.``` + Why use it? => Multi-processing! + ``` + a = list(range(10)) + + b = 0 + for i in a: + b += i**2 + print(b) + ``` + vs. + ``` + from functools import reduce + print(reduce(lambda x,y: x+y,map(lambda x: x**2,range(10)))) + ``` + + currying: not really, but binding via lambdas or functools.partial() or + https://mtomassoli.wordpress.com/2012/03/18/currying-in-python/ + + decorators! + + still FP, has advantages and is heavily used, i.e. in genomics (works on + tons of lengthy lists) + * FunCtional++: On the fast lane + + "Classical" C++ has some functional stuff, bust i.e. no lambdas (hardly usable) + + Changed with the new C++11-standard + + Buzzwords: + - `map` defines a Datatype in C++! + - lambdas in C++ + ```[](int x, int y) { return a`