Copied over updated slide layout from presentation-slides
[cipher-training.git] / slides / caesar-break.html
index 5ea77b9ffb208baa62eb1c4437cad26a6ef19b55..4d2ebfa0d01d556dbdd37599f3e4320f92fc4031 100644 (file)
         color: #ff6666;
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
+      }
+      .indexlink {
+        position: absolute;
+        bottom: 1em;
+        left: 1em;
       }
        .float-right {
         float: right;
 
 ---
 
+layout: true
+
+.indexlink[[Index](index.html)]
+
+---
+
 # Human vs Machine
 
 Slow but clever vs Dumb but fast
@@ -93,6 +104,8 @@ What does English look like?
 
 How do we define "closeness"?
 
+## Here begineth the yak shaving
+
 ---
 
 # What does English look like?
@@ -154,6 +167,7 @@ open()
 * Count them
 ```python
 import collections
+collections.Counter()
 ```
 
 Create the `language_models.py` file for this.
@@ -279,7 +293,7 @@ Use `logger.debug()`, `logger.info()`, etc. to log a message.
 
 ---
 
-# How much ciphertext do we need?
+# Homework: how much ciphertext do we need?
 
 ## Let's do an experiment to find out
 
@@ -289,6 +303,18 @@ Use `logger.debug()`, `logger.info()`, etc. to log a message.
 4. Score 1 point if `caesar_cipher_break()` recovers the correct key
 5. Repeat many times and with many plaintext lengths
 
+```python
+import csv
+
+def show_results():
+    with open('caesar_break_parameter_trials.csv', 'w') as f:
+        writer = csv.DictWriter(f, ['name'] + message_lengths, 
+            quoting=csv.QUOTE_NONNUMERIC)
+        writer.writeheader()
+        for scoring in sorted(scores.keys()):
+            scores[scoring]['name'] = scoring
+            writer.writerow(scores[scoring])
+```
 
     </textarea>
     <script src="http://gnab.github.io/remark/downloads/remark-0.6.0.min.js" type="text/javascript">