Interesting papers (2016)

  • [Bypassing HTTP Strict Transport Security][hsts]

    Jose Selvi, 2014

    Attacking NTP to force HSTS policies to expire.

Interesting papers (2015)

  • Holistic Configuration Management at Facebook

    How Facebook manages and distributes configuration - from small JSON files to huge machine-learning datasets - at a massive scale.

  • The impact of syntax colouring on program comprehension

    Advait Sarkar, 2015.

    Study measuring the effects of syntax highlighting - notably that it is useful, and programmers spend less time focusing on keywords when using it.

  • Google Votes: A Liquid Democracy Experiment on a Corporate Social Network

    Hardt, Steve and Lopes, Lia C. R., 2015.

    An experimental voting system built and used inside Google that uses software to mix direct and representative democracy by allowing users to vote directly or entrust their vote to another user.

  • Scaling Agile at Spotify

    Henrik Kniberg & Anders Ivarsson (2012).

    Describes how Spotify has previously organised their engineers into tribes, squads, chapters and guilds; aiming to avoid layers of bureaucracy and other problems often associated with large numbers of employees.

Error handling in Rust

A short cheatsheet for dealing with Return values in Rust.

When a Result is Ok<T>:

let result: Result<&str, &str> = Ok("Succeeded");

result.is_ok() == true;
result.is_err() == false;

result.ok() == Some("Succeeded");
result.err() == None;

let other_result: Result<&str, &str> = Ok("Other result");
result.and(other_result) == Ok("Other result");
result.or(other_result) == Ok("Succeeded");

fn example(string: &str) -> Result<&str, &str> { Ok("Example") }
result.and_then(example) == Ok("Example");
result.or_else(example) == Ok("Succeeded");

When a Result is Err<E>:

let result: Result<&str, &str> = Err("Failed");

result.is_ok() == false;
result.is_err() == true;

result.ok() == None;
result.err() == Some("Failed");

let other_result: Result<&str, &str> = Ok("Other result");
result.and(other_result) == Err("Failed");
result.or(other_result) == Ok("Other result");

fn example(string: &str) -> Result<&str, &str> { Ok("Example") }
result.and_then(example) == Err("Failed");
result.or_else(example) == Ok("Example");

When an Option is Some<T>:

let option: Option<&str> = Some("Example");

option.is_some() == true;
option.is_none() == false;

option.unwrap() == "Example";
option.unwrap_or("Other") == "Example";
option.expect("the world is ending") == "Example";

When an Option is None:

option.is_some() == false;
option.is_none() == true;

option.unwrap(); // panic!()
option.unwrap_or("Other") == "Other";
option.expect("the world is ending"); // panic!("the world is ending")

Backups are important

Your laptop will die. Your hard drive will fail. You will lose your USB key. You’ll have a power cut halfway through typing up your essay. Accidents happen, and making sure you don’t lose work - especially assignments and essays - is important.

Any important work you do should be saved in multiple places. At a minimum, you should have at least two copies on physically separate devices. Preferably, you should have a third copy - this means that if one copy is destroyed or inaccessible, you still have two copies, and are still protected from a second device failing.

Geographical separation is also useful, and makes it much harder to lose work - this doesn’t need to mean keeping copies of your work in another country, but you should avoid keeping multiple copies in the same place. For example, if you have one copy on a laptop and another on a USB key, you may want to consider not keeping them in the same backpack - if the backpack was stolen, you would lose both copies of the work.

Work in progress

As well as making sure you have multiple copies of your files, you should make sure that you save changes to your files while you are working on them. Most editors will have a feature that automatically saves a copy of your work every few minutes - make sure you enable it. You don’t need to make a full backup every time you write a sentence, but making sure your work is saved regularly will save you from losing all the work you did that day when your word processor crashes or your laptop runs out of battery.

Online file storage

Various online services allow you to synchronise files and folders between online storage and multiple computers. This is one of the easiest ways to ensure you have backup copies of your work, and is extremely useful when working on something from multiple computers. You can also access your files though a web browser or mobile application, so you’re almost always able to access them.

Online storage services generally have a free plan, with paid plans available for additional features or extra space. This post doesn’t cover their paid features, and unless noted each service has applications for Linux, OSX and Windows, as well as Android and iOS phones.

  • Dropbox provides 2GB of storage (with extra space for using certain features or recruiting people), keeps a 30 day history of changes to files, and has applications for almost any device or operating system.
  • Google Drive provides 15GB of storage, and integrates with a set of office software that you can use from your browser or phone (word processing, spreadsheets, presentations). It’s missing a Linux application.

If you have existing services or devices you want a service to work with, Amazon and Apple also provide their own storage offerings: Amazon Cloud Drive provides 5GB of space, though doesn’t have much to show off aside from being available on Amazon Fire devices. iCloud is part of iOS and OSX, and you need an Apple device to use it, and there’s no Android client.

Version Control

Git can be used to incrementally record changes to your work and push/pull them to other repositories. Mercurial is a simpler and more user friendly alternative to Git, but both will need you to spend some time learning how version control systems work and how to use the tools they provide. For Computer Science students, basic knowledge of how to use Git and version control is essential, and it’s worth knowing how to use at least one version management system well as it’s almost essential for any software project. Various hosting services for Git allow you to store and publish repositories online.

  • GitHub is the most popular, and is used for many open source projects. You can publish an unlimited number of public repositories, but private repositories either require the Student Developer Pack (which provides 2 private GitHub repositories along with many other goodies), or a paid plan.
  • BitBucket provides unlimited public and private repositories. It’s similar to Github, but provides some different features and is aimed at companies and teams rather than individuals.

You can use Git and Mercurial on your own server with nothing more than SSH access, though there are also applications that will provide an interface similar to Github or Bitbucket. I’d suggest looking at GitLab or Gitorious if you plan on doing this.

Summary

  • Remember to regularly save work in progress.
  • Your work doesn’t exist until there are at least two copies.
  • It doesn’t count if those copies are in the same physical location.

Installing Pandoc on Windows

Install pandoc using the Windows installer from here. Install pandoc globally using this command (using the path to the version of pandoc you downloaded):

msiexec /i pandoc-1.12.3.msi ALLUSERS=1

Install miktex from here.

Run these commands to check that pandoc and miktex are installed:

"C:\Program Files (x86)\Pandoc\pandoc.exe" --version
"C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\pdflatex.exe" --version