Paul Barry's Website - Web Development and Databases

3rd Year Module on the B.Sc. Hons. Degree in Computer Games Development

Games: Web Development and Databases

Academic Year 2016/17 - Class Log.


Mon 12 Sep 2016: Due to ongoing building works with L216, classes won't start until 9:00am on Tues 20th September 2016.

Tues 20 Sep 2016: General introduction to the course: using Python to build server-side web services which interact with MySQL and MongoDB. Installed Python, then had a quick overview of IDLE. We start "for real" at 3:00pm tomorrow (Web 21st). This is a 50/50 course - 50% CA, 50% Final Exam.

Wed 21 Sep 2016: Started programming in Python by experimenting at the IDLE shell, then writing our code in the IDLE editor when we are happy that it does what we need it to do. Created the "odds" program, explored indentation, and learned about some of the built-in functions (BIFs) such as print, range, dir, type, and so on. See today's transcript for all the details as well as the code.

Wed 28 Sep 2016: Today was all about beer.... well, beer songs. Also introduced the four built-in data structures: list, tuple, dictionary, and set.

Thurs 29 Sep 2016: We played around with list methods (while trying not to panic).

Wed 5 Oct 2016: Did lots of dictionary work, including building a frequency counter.

Thurs 6 Oct 2016: We watched David Beazley's talk on the builtins (after looking at Counters, tuples, sets, and list comprehensions).

Wed 12 Oct 2016: Learned about Python functions, then installed Flask and built a small (but working) webapp.

Thurs 13 Oct 2016: Took a little side-detour into the world of HTML. Adjusted our webapp so that it could return and display a HTML file called 'test.html', which we then used to learn about HTML and its various markup tags. At the moment, we have a HTML form on our page which seems to be sending data to the server, but we have yet to work out how to process the received data on the server. Learning how to do this is our task for next week (as we build up to Assignment 1).

Wed 19 Oct 2016: Used Jinga2 to create templates for our HTML files.

Thurs 20 Oct 2016: Sent data to the server using POST, appended the data to a file, then took a look at the WordGame specification. Assignment 1 is now active and is due Thursday, November 10, 2016.

Wed 26 Oct 2016: Work on the first assignment continues.

Thurs 27 Oct 2016: Work continues on the first assignment (at least, I think it does).

Wed 9 Nov 2016: Lots of discussion about using sessions instead of global variables today, as well as Shane's insistence that his interpretation of how the game should behave is the correct one (Ha!). The deadline for this assignment has been extended until 3:00pm on Wednesday 16th November 2016.

Thurs 10 Nov 2016: Lots of grunts and groans while a certain student revisits his code (to make it conform to specification). Remember: deadline is next Wednesday.

Wed 16 Nov 2016: Looked at the source code to Paul's webapp for the word game system.

Wed 23 Nov 2016: We solved the multiple-submit problem for our webapp, but still have a race condition when saving the leaderboard. The solution? Use a database (which supports transactions). So, we installed MariaDB, created a new database and user (scoresDB and g3user) and started to work with some SQL: creating a table, inserting some data, and then selecting data from the table. We discussed CRUD: create, read, update, and delete, as well as talked about schemas, rows, columns, fields, tables, and databases. Could this be any more exciting?

Thurs 24 Nov 2016: More SQL - CRUD: Create, Read, Update, Delete aka INSERT, SELECT, UPDATE, DELETE (in SQL). Started to explore what's meant by conforming to the First Normal Form (1-N-F), then looked at some badly designed database tables before looking at some that conform well to the 1-N-F model.

Wed 30 Nov 2016: More 1-N-F database design with students, lecturers, and who they are taught by. Successfully installed the mysql-connector-python driver (together with Paul's DBcm module) into Python. We are ready to write Python code which interacts with MySQL.

Thurs 01 Dec 2016: Used the DBcm module from within our Python code to connect to our database, then read all of the leaderboard data using a SELECT query. We also created code which added data to our table using an INSERT statement. Having done this, we adjusted data_utils.py to use similar code to replace our earlier pickle implementation, which - at a first glance - appeared to work, but when integrated with our webapp code broke. The solution to this problem is the subject of the current class competition to find the reason why as well as produce the new code needed to fix the issue. Next Wednesday, December 7th, is the class exam on SQL, starting at 3:00pm.

Wed 07 Dec 2016: Class exam on MySQL.

Thurs 08 Dec 2016: Ran through the correct solutions for the database exam, as well as discussed the changes to be applied to data_utils.py to fix the SQL issues. Then, we uploaded the working webapp onto PythonAnywhere (in the cloud).

Wed 14 Dec 2016: We built a Twitter-killer webapp in 46 lines of code (plus templates).

Thurs 15 Dec 2016: Methinks it's Christmas.

Wed 11 Jan 2017: We reviewed 2016, then played the word association game. This lead onto a discussion of database design for non-tabular (unstructured) data.

Thurs 12 Jan 2017: Having installed MongoDB, we started looking at getting data into and out of MongoDB (with the help of some friendly Unicorns). Before next Wednesday, everyone needs to read through pages 1-14 of The Little MongoDB Book.

Wed 18 Jan 2017: As well as playing more with MongoDB, we used pymongo to get most of the data from the norms JSON file into MongoDB. About 800 documents were invalid, however. We fixed this vith the deprecated check_key-flase trick. See today's transcripts for more.

Thurs 19 Jan 2017: Tweets, Python, MongoDB, and four-letter words. We had it all today - see the transcript.

Wed 25 Jan 2017: Quickly ran through the past papers for 2016 and 2015.

Thurs 26 Jan 2017: We're all spinning our wheels waiting for Project 2 to begin...

Wed 01 Feb 2017: Details of the final assignment (integrated into Games Devices Project 2) was distributed. By class tomorrow, each time has to have decided which of the two options they are planning to implement (and the team needs to be able to justify the choice).

Thurs 02 Feb 2017: Games identified, teams identified, database component identified. All we need to do now is work out the message protocol our multiplayer games need.

Wed 08 Feb 2017: For tomorrow's class, each time has to start working on their message protocol for their app/game.

Thurs 09 Feb 2017: A small number of teams have started to work on their message protocols. Everyone else needs to get going by next week (i.e., Wednesday).

Wed 15 Feb 2017: Work on the message protocols continues.

Thurs 16 Feb 2017: Looked at final bunch of message protocols. All are ready now. Schedule for next week is to conduct a review of progress on Wednesday, with submission by 3 on Thursday (ahead of demo).

Web 22 February 2017: Tomorrow at 3:00pm is demo-time for the final CA.

Thurs 23 Feb 2017: Demo day. This class concludes this module.


Return to the Courses page.