Code Camp

Author

Jon Reades

Published

September 7, 2023

Prior to (re)joining CASA from the Department of Geography at King’s College London, Dr. Mic Ferretti, Dr. Zara Shabrina, Dr. James Millington, and I developed Code Camp.

Code Camp provides a gentle introduction to the basics of programming in Python. Across ten sessions you will learn about syntax, variables, ‘simple’ data structures such as lists and dictionaries, and about the fundamentals of writing functions for reusable code. The sessions are entirely self-led: you should follow along at your own pace and remember that ‘it’s a marathon, not a sprint’. Don’t cram it all into the last week of summer holidays!

Students from previous years have repeatedly said that completing Code Camp helped them to feel more ready for the Foundations of Spatial Data Science module, enabling them to do better on assessments and on the programme as a whole.

So please, complete Code Camp by the start of term and, if possible, go through the materials more than once!

You should have received instructions via email for running Code Camp, but here they are again…

Options

Code Camp is publicly accessible through a code-sharing web site called GitHub and can be run using either:

  1. Google’s ‘Collaboratory’, or
  2. The Open Source Binder tool.

In both cases there is nothing to install on your computer. You could even use a tablet or phone, though we wouldn't really recommend it. There are two main differences: ‘Colab’ notebooks require an account but can be saved into Google Drive; Binder does not require any registration, but you won’t be able to save anything.

Using Google Colab

How to get started:

  1. Go to Google’s Colab site and sign in using your Google account details (or create an account if you don’t already have one).
  2. Choose File then Open and select the GitHub tab from the open options (it’s between Google Drive and Upload).
  3. Enter the following URL: https://github.com/kingsgeocomp/code-camp (Jon was with King’s when he helped to create this resource)
  4. You should now see a list of notebooks to choose from – the first few are fairly quick to complete, but they get harder as you go along – select the first on in the sequence and click Open in Colab.
  5. You will need to trust the notebook in order to run it.

Now you can run code in your web browser! When you are done for the day you can save the notebook to your Google Drive – to re-run that notebook you can just load it from Google Drive, rather than going back to GitHub, but remember that you need to re-run all the cells up to the point where you saved the notebook. Being able to save and re-run a notebook is the main difference from Binder.

Using Binder

All you need to do to get started is click the image below: Title: fig: - Description: Binder Logo

That’s it! But in case clicking that image doesn’t work, you can also go to: https://bit.ly/33Rc5QD. When Binder starts, you will be able to run the notebooks! The main difference from Colab is that you have to download a notebook from Binder to your local computer in order to save it. To re-run the same notebook, you’d need to upload the notebook to Binder again. So Binder has no ‘memory’ of your work between interactions.