Teaching season launched, new apps

Yesterday was the first day of teaching in this Fall semester. Times are a bit challenging; teaching resources for the courses I teach in have shrinked down to about 58-66% of last year’s teaching hours, depending on a course. Also the number of teachers for a course is down. While number of students is going up rather than down.

Face-to-face teaching is not possible with these resources and number of students (225-300+ in two of the courses ongoing currently). We’d be in the classroom every day from 8am to 8pm and still have overlapping teaching events. So online it is. Hello Zoom.

One feedback item from students last year was that the terminology is challenging in the Devices and data network course. Understandable: in five two hour lectures I should be able to give an overview of how computers work and the components they contain. The same for the networking, ten hours of lectures and they should get a grasp on how the Internet and packet networks do their thing. This means a constant shower of new terminology unfamiliar to 1st year students. Other courses have similar issues.

So I developed a dictionary app for students to use. Or actually two. One with Java for desktop computers:

Dictionary Java app for desktop computers

And another one using Swift and SwiftUI for macOS, iOS and iPadOS:

The iPhone version of the dictionary app.

Both apps get the dictionaries from the same source, a remote git repository with a JSON file, using HTTPS. Thus the dictionaries can be edited, appended to and updates are then downloaded to the users’ devices.

In the user device the terms are stored into a SQLite database, so they can be used offline. Users can search for the terms and follow the URLs to sources in the Internet to find out more.

The desktop versions also have a feature that generates a graph of the relationships between the terms by searching the terms from other terms’ description. For this, GraphViz must be installed on the device.

The Swift version has a Widget for all Apple platforms. The widget randomly shows a couple of terms a day from the dictionary. Here’s the iPhone widget (along with the GitHub app widget on top):

And here is the macOS Widget:

Clicking or tapping on the term on the widget opens the app and shows the description as well as English term for that specific ICT term.

The Java version is already public and available for installation. Swift version is still under development, I just need to decide how to distribute it to the various types of devices and prepare the App Store information with screenshots, descriptions and all. Then there is the inevitable App Store review waiting. Hopefully it’ll pass. This is yet another app for the category “downloads and renders JSON in a GUI”.

Hopefully the students find the apps useful for learning. Next I should focus on finishing the dictionary for the basic Internetworking part of my course and put also that available for the apps to download…

New version of SortSpectacle

My sorting algorithm learning tool / demo app SortSpectacle now includes a new method, Block sort.

Block sort is a variant of Merge sort. Merge sort uses additional arrays to recursively divide the original array into smaller arrays which are then sorted and combined to a final sorted array.

Block sort is an in-place variant of Merge sort. It uses a small cache to move elements around. Thus it is more memory efficient than Merge sort. And according to the demo app, also quite fast.

I still need to implement the step-by-step version of the algorithm — without it the execution is not animated. But if you take a look a the implementation (a Swift port I did based on the Java code WikiSort implemented by Mike McFadden), you can see that it will be quite a challenge to do…

Also it was quite nice to read in Twitter that someone is actually using my sorting algorithms in their own Swift/SwiftUI app to demonstrate the new SwiftUI Charts in action!

Anyhows, here’s a YouTube demo video showing the new version in action:

Busy busy busy

I’ve been really busy with evaluating student coursework in two courses. Some of this work was postponed in Feb/March since I participated in the international MSc program selection process then.

I have been considering posting shorter news like things or just small snippets of work I have been doing. Just to keep this blog alive.

So here is a screenshot of something I did in between the course evaluations — potentially a new exercise to be used in the Data structures and algorithms course next Fall. A small utility that converts plain Finnish text to braille symbols.

Finnish epic Kalevala in braille.

The job for the students is to generate the braille version faster than the naive lookup table looping implementation they get ready, using hash tables.

Another thing I did was for a course on GUI design & programming:

Demo about automated GUI testing

The purpose of this stupid card guessing game was to demonstrate how to implement a simple GUI test automation and execute the tests in simulator environment.

That’s it for today. Now back to evaluating those student programming assingments…

Java file management, hall of fame and a nice surprise

In the previous post I mocked the Java app that was hardcoded to use Windows C: disk as the default place to open files.

What then is the recommended way? One is to start looking from the user home directory:

JFileChooser fileChooser = new JFileChooser();

fileChooser.setCurrentDirectory(new File(System.getProperty("user.home")));

Or pick the documents directory. It is also a nice thing to save the selected directory and use that if the user would like to continue with the already selected directory next time.

What else is happening? It is now the last week of the course Data Structures and Algorithms I am responsible teacher. Students have been analyzing algorithm correctness and time complexity, implementing basic data structures, more advanced ones like hash tables and hash functions, binary search trees and binary search.

Lectures addressed graphs and graph algorithms too, but implementation of these was in an optional course project only, Mazes. When students finish that, they can play a game a bit like the PacMan.

They get to choose from two course projects: either that Mazes project or optionally implement the classic task: count the unique words from a book file, ignoring some words from another file. The largest test file is around 16 MB, having almost 100 000 unique words.

Processing the largest file, using naively two nested for loops takes on my Mac Mini M1 with 16MB of memory around two minutes to process. The fast versions (hash tables, binary search trees) take less than a second.

I have implemented several different solutions for comparison with three different programming languages, Java, Swift and C++. Each week in lectures I demonstrated some of these, and in the end we had this table for comparison (sorry, in Finnish only).

Hall of Fame of the different Books and Words implementations. Swift versions can be found from the link above to GitHub.

As you can see, the C++ with 8 threads was the fastest one. Next after C++ came a couple of Java versions. Swift implementations were not so fast as I expected. After some profiling, I suspect the reason is in the way Unicode chars are handled in Swift. All the book files are UTF-8 and students were expected to handle them correctly. I do not like that mostly in teaching programming languages the default is to stick with ascii and conveniently forget the existence of different languages and character sets.

Well, anyways, for some reason, processing these UTF-8 text files takes a lot of time with Swift. Maybe later I have time to find out if the issue is in my code and/or is there anything that can be done to speed things up.

Something very nice happened a week ago — the student guild of our study program, Blanko, awarded me this diploma for being a quality teacher. Apparently they had a vote and I somehow managed to come first this time. The diploma was accompanied by this Italian themed small gift box. A really nice surprise! I was so astonished to receive this, thank you so much if anyone of you is reading!

Nice award from the students for quality teaching.

Work work work

youtube.com/watch

Just checked the first commit date of the completely renovated Data structures and algorithms course repository. It was around December 2020.

Since then I have designed and implemented about ten exercises with unit tests in Java. And two course projects with unit tests. Plus about ten additional demos with Swift. All with commentary and instructions.

In a week the new course begins. I’ve recorded about 20 hours of new lecture materials. Additional videos about graph programming with C++ will be included from last year demos.

One of the reasons for not posting too much lately ?

The video is about one of the course project implementing a graph data structure with various algorithms including Dijkstra’s shortest path finding algorithm. I thought applying this in a game context would perhaps motivate the students to dwell into the world of data structures and algorithms. We’ll see….

Too busy and stuff

Apparently I am too busy to write anything here. Or … priorities… or workload… Work, life, etc.

During the Summer 2020 I decided that I want an app in the App Store. So I did it.

Slippery Cities (Liukkaat kadut in Finnish, Hala Gator in Swedish) warns pedestrians of slippery weather conditions in six Finnish cities. That photo above of my Apple Watch says that in Oulu there was a slippery alert two hours ago. So wear your spiked shoes. Or be careful out there.

I learned a lot about:

  • Swift programming
  • SwiftUI programming
  • WatchKit development with Xcode
  • Localisation for three languages
  • Accessibility programming in Apple platforms
  • AppStore: submitting apps for review (no issues by the way, app went through without any hassle)
  • Programming in watchOS, including watch faces, complications, background processing, networking,… with beta version of watchOS 7.

Buy it in the App Store, I want to get rich. Mind you, it may not work in the city you live, so consider that. Won’t refund you unless you twist my arm hard.

Then other things keeping me busy. Created a new course on Software Platforms and Ecosystems with two colleagues. That was hard. Luckily also behind us for a while, since the course ended in December.

I also took responsibility for a course on data structures and algorithms. Corona pandemic made that harder than usual, since the course material and arrangements were based on the assumption of face-to-face classroom teaching. Didn’t happen.

Now I am working on a course on server programming, which is a new course for me. I’ve been implementing a HTTPS chat server with Java and writing instructions for students to do the same. Topics include Java, HTTPS, certificates, authentication, JSON, sqlite database, password hashing and salting, UTF, encoding, decoding, HTTP headers,… Maven, Visual Studio Code, git — lots of work, since none of this existed in late December and course started in early January. ?

Then another course where I assist in exercises on advanced software testing and security issues started this week. Lots to learn for me there too.

So I’ve been very, very busy. Maybe in Spring 2021 I’ll be sharing more here.

Oh yes, and some nice things too — got myself a new Mac Mini M1, an Apple Silicon computer. So enjoying doing these things with the new device! My previous iMac 27″was already five years old, luckily in a good condition. I got a decent price for it when I sold it to fund the Mini.

Teaching season started

Fall teaching season has started with one old course already ongoing. Devices and networks. My part is the networks, so currently I can focus on two new courses starting in October. Data structures and algorithms is an old course but I’ll take responsibility for it this year.

Another course, Platforms and ecosystems is a new course. Meaning I have hands full in creating material for the new course together with two other teachers. And at the same time, familiarising myself with the data structures course.

For the data structures course, I’ve worked earlier with the demo sorting app implemented using Swift. No time to add additional sorting methods there, but should build it with new Xcode, Swift and iOS 14 to see if there are any (breaking) changes.

What I did recently is that I implemented simple (and stupid) array and linked list classes, both in C++ and Swift, to demonstrate the effectiveness of creating and accessing arrays in comparison to linked lists. Will be using that when discussing why different data structures have different (preferred) usage situations. And that there may be conflicting requirements for the data structure in an app. Then you just have to make compromises.

Another important thing to show to the students is that you need to build the release version before comparing or measuring performance.

Giving feedback in corona times

Remote teaching challenges the way I have given feedback to students. Sometimes the things to comment are largish software design models with associated documentation. When teaching face to face, it is easy to explain, point with fingers, talk together. But in isolation, that is not possible. Commenting their work in writing takes a long time and leaves room for misinterpretations.

As I mentioned in the previous post, I decided to experiment giving audio comments instead of written ones. I look at their documents and UML models, and record my comments into an audio file. The file is then shared from cloud to the student group. For me this is faster than writing. Students are able to follow my thoughts since I take care to pinpoint what I see when I record the audio. Video conferencing could be an option but requires everyone to be there at the same time. Comments on recorded video? – does not provide enough added value, in my opinion. Furthermore, I am able to comment thoroughly (face to face teaching is usually in classroom hours, which are limited) which may benefit the quality of the work. Negative side is that students must tolerate my an hour or so long ramblings about their work in the worst case… I have now given feedback to 16 student deliveries, perhaps around 12-13 hours of comments.

Anyways, as this seems to work, I may continue giving audio feedback after the corona virus isolation ends. Whenever that may happen…

Not a real student feedback recording. I already deleted those from my machine.

Changes at work

Our curriculum, Information processing Science, has been and is going through big changes. Many courses are put to rest and new ones created. Personally, this means many changes to my teaching portfolio.

Firstly, the course on Embedded Software Development Environments will cease to exist. ESDE, a master level course, was a successor to Mobile systems development course I taught in cooperation with Tampere University of Technology. Even before that, I was involved with mobile development related courses Symbian programming. So the years long track of teaching mobile programming, lately on Android, is now closing for me.

Another master level course disappearing is the Open Source Software Development, where I was responsible for course exercises for the past two years. There the students worked — under my watchful eye — on a distributed Java client-server project hosted in GitHub. The goal of that project was to learn how to communicate and coordinate fixing issues and providing new features to the project by using git: forking, branching, committing and providing pull requests to the main project, following the contribution guides and license terms of the project.

Third course I have a long history with is the Software engineering (BSc) course. My first paid job as a student at the Department of Information Processing Science somewhere around the end of 1980s was to type the handwritten lecture notes of professor Koskela to a Word document. Printouts were then sold as course material by the student guild Blanko. I also taught the course at the Open University, travelling to many cities and villages in Northern Finland for Friday night and Saturday lecturing sessions. Later, I was responsible for the course and the development of it for many years. The course is now changed from a 2nd study year course, integrating previous courses’ content before practical software project, to an introductory course in the first study year. Others will take charge.

Finally, I have decided to leave the Software architectures course. This 2nd year bachelor level course also has a long history of cooperation with Tampere University of Technology. The course is their making, based on their significant research on software architectures. At some point, I decided to take the exercises here in Oulu to more practical direction, studying source code of existing distributed systems and transforming the architecture based on new functional and non-functional requirements. In my opinion, this approach better illustrates the practical significance of various architectural solutions and the purpose of architectural diagrams, than just drawing pictures without any concrete connection to actual source code. The cooperation with TUT ceased some years ago but since their material was open sourced, I continued to use the lecture slides (updated by me yearly) with my own exercises and exercise projects.

Leaving now these courses behind, I will return back to teaching programming courses in bachelor level. I will take charge of Data structures and algorithms course, and will spend a considerable amount of teaching hours on a new course on server side app development. There is also one new course in the master level on platforms and ecosystems I am participating in, but the course is in the very early stages of development, so not much to say about that yet.