Last updated: Sep 17, 2026

Assignments · DHG 502 syllabus

Assignment 0 (not graded)

Due: 23 Sep, 9:00 am

This exercise is not graded. Its purpose is to check that the whole workflow — repository, Codespace, AI coding assistant, and published page — functions before the graded work begins. For this assignment, please complete the following steps:

  1. Create a new GitHub repository and open it in Codespaces.
  2. Using the method taught in class, call the GLM-5.3-Flash model through OpenCode (with your own API key from keyreg.qhchina.org, class code dhg502). Never commit your key to the repository.
  3. Find a historical source in plain text — for example the Mingshi 明史 (History of the Ming), or another source of your choosing — and ask the model to suggest several ways of analyzing it. For instance:
    • the most frequent words in the source
    • a more targeted question, such as extracting the names of all the treacherous officials 奸臣 recorded in the source
    • how often particular people, places, or official titles are mentioned, and how that distribution changes across the text

    The analysis can be very simple or somewhat more complex — that is up to you. What matters is that you can explain what the code did and judge whether the result is plausible.

  4. Once the analysis is finished, you will have a .py script, a .txt file with the results, and an .html file presenting them as a simple page.
  5. Commit and push all the files to your GitHub repository to save your work.

Publishing to GitHub Pages (three simple steps)

So that your .html results can be viewed directly on the web, publish them as a GitHub Pages site:

  1. Make sure your final .html file is in the root of the repository and named index.html. (If it has a different name, remember to specify the correct file in the following steps.)
  2. On your repository page, go to Settings → Pages.
  3. Under Build and deployment → Source, choose:
    • Branch: main
    • Folder: / (root)

    Then click Save. Wait 1–2 minutes and the site will be generated automatically.

Once it is published, a URL will appear on the same page, in this format:

https://your-account.github.io/your-repo-name/

Submission

Please submit the following two links on Moodle:

Include a README.md with your name, the course code, a one-sentence description of what you did, and a citation for the source you used. Do not put your student ID in a public repository. The source should be public domain or openly licensed; otherwise, use a short instructor-provided source.

If you have any questions, please feel free to ask!