Skip to content

Commit

Permalink
ADD: pycon presentation slides
Browse files Browse the repository at this point in the history
  • Loading branch information
pavlov99 committed Nov 5, 2017
1 parent aa12e2f commit 77e81c7
Show file tree
Hide file tree
Showing 15 changed files with 1,946 additions and 19 deletions.
28 changes: 11 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
.env/
2017-10-22-codeconf/example1-higgs-big/*.[ct]sv
2017-10-22-codeconf/example1-higgs-big/HIGGS.csv.gz
2017-10-22-codeconf/presentation/cmd-awk-2017-kirill-pavlov.aux
2017-10-22-codeconf/presentation/cmd-awk-2017-kirill-pavlov.dvi
2017-10-22-codeconf/presentation/cmd-awk-2017-kirill-pavlov.log
2017-10-22-codeconf/presentation/cmd-awk-2017-kirill-pavlov.nav
2017-10-22-codeconf/presentation/cmd-awk-2017-kirill-pavlov.out
2017-10-22-codeconf/presentation/cmd-awk-2017-kirill-pavlov.snm
2017-10-22-codeconf/presentation/cmd-awk-2017-kirill-pavlov.synctex.gz
2017-10-22-codeconf/presentation/cmd-awk-2017-kirill-pavlov.toc
2017-10-22-codeconf/presentation/cmd-awk-2017-kirill-pavlov.vrb
2017-10-22-codeconf/presentation/_minted-cmd-awk-2017-kirill-pavlov/
*.sqlite
*.pyc
2017-11-04-pycon/presentation/jsonrpc-2017-kirill-pavlov.aux
2017-11-04-pycon/presentation/jsonrpc-2017-kirill-pavlov.log
2017-11-04-pycon/presentation/jsonrpc-2017-kirill-pavlov.nav
2017-11-04-pycon/presentation/jsonrpc-2017-kirill-pavlov.out
2017-11-04-pycon/presentation/jsonrpc-2017-kirill-pavlov.snm
2017-11-04-pycon/presentation/jsonrpc-2017-kirill-pavlov.synctex.gz
2017-11-04-pycon/presentation/jsonrpc-2017-kirill-pavlov.toc
2017-11-04-pycon/presentation/jsonrpc-2017-kirill-pavlov.vrb
2017-11-04-pycon/presentation/_minted-jsonrpc-2017-kirill-pavlov/

# LaTeX files
*.aux
*.log
*.nav
*.out
*.snm
*.synctex.gz
*.toc
*.vrb
2017-11-05-pycon/presentation/_minted-cmd-awk-2017-kirill-pavlov/
1 change: 1 addition & 0 deletions 2017-11-05-pycon/example1-higgs-big
33 changes: 33 additions & 0 deletions 2017-11-05-pycon/example2-awk-intro/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.PHONY: help
# target: help - Display callable targets
help:
@egrep "^# target:" [Mm]akefile

.PHONY: csv2tsv
# target: csv2tsv - Convert csv data to tab separated file
csv2tsv:
cat <(printf '# ') <(cat pycon-schedule.csv) | tr ',' '\t' > pycon-schedule.tsv

.PHONY: example1
example1:
cat pycon-schedule.tsv \
| tawk -o 'speaker' -f 'speaker' \
| tsrt -N \
| uniq \
| wc -l

.PHONY: example2
example2:
cut -d, -f5 pycon-schedule.csv \
| tail -n+2 \
| awk '{for(i=1; i<=NF; i++) w[$$i]++}END{for(i in w) print w[i], i}' \
| sort -r \
| head

.PHONY: example3
example3:
cat pycon-schedule.tsv \
| tawk -a -f 'speaker' -o 'key=timeslot if day == 1 else gensub("-", "+", "g", timeslot)' \
| tgrp -k key -g 'day=FIRST(day)' -g 'timeslot=FIRST(timeslot)' -g 'venue=FIRST(venue)' -g 'speaker=FIRST(speaker)' -g 'title=FIRST(title)' -g 'sessions=COUNT()' \
| tawk -o 'day;timeslot;venue;speaker;title' -f 'sessions==1' \
| tpretty
7 changes: 5 additions & 2 deletions 2017-11-05-pycon/example2-awk-intro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ There are 15 unique speakers.
cut -d, -f5 pycon-schedule.csv | tail -n+2 | awk '{for(i=1; i<=NF; i++) w[$i]++}END{for(i in w) print w[i], i}' | sort -r | head
```

Python! (Who could have guessed?)

3. Filter unique talks (one talk at a time).

Not all of the functions implemented, however, there are workarounds.
It is possible to combine two keys. For day 1 use timeslot, for day 2 use timeslot with substituted character
Not all of the functions implemented, however, there are workarounds. For example, there is no support for composite group key.

It is possible to combine two keys in a tricky way. For day 1 use timeslot, for day 2 use timeslot with substituted character

```bash
cat pycon-schedule.tsv \
Expand Down
1 change: 1 addition & 0 deletions 2017-11-05-pycon/example3-stock-market
Binary file not shown.
Loading

0 comments on commit 77e81c7

Please sign in to comment.