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.

Betas

I wanted to install Apple developer betas on some of my devices to try out something. But then I saw that the bank ID software didn’t work on the beta. Bummer.

Today, week later, I realized that I also have an iPad. And since the bank ID app works also on iPad, I installed public beta of iOS 14 on my phone, as well as developer beta 2 on my Apple Watch. 🙂

New Swift tools

I’ve been working on my sorting methods demonstration app recently when I’ve had time for it. Most of my time currently is spend with evaluating student exercise projects submitted at the end of June for the Software Architectures course.

So, not much new functionality in the sorting app now. I am now mostly trying to make sure code so far is good and documented. Since my plan is to use it as an example and demonstration in the new course I am teaching in Fall, Data structures and Algorithms, I want the demo well documented and of good quality.

To make this happen, I’ve installed several Swift related tools and tried them out.

I am using Swift lint to make sure code is clean and following the Swift coding conventions. Though I had to disable some rules that are too tight for this demo app, using the .swiftlint.yml configuration file.

disabled_rules:
 - multiple_closures_with_trailing_closure
 - line_length
 - todo

For generating html documentation from the comments in the code, I’ve experimented with Jazzy and Swift-doc. Currently Jazzy seems to be in a better shape for my needs, since Swift-doc currently documents only public properties of the project.

Apparently Swift-doc has been used mainly for documenting APIs and libraries and their public APIs. There is a pull request in the GitHub repository, not yet accepted, enabling specifying the level of protection (open, public, fileprivate, private) to document. I tried out the fork which enables protection level configuration, results of which can be seen here. In addition to the protection level issues, there are issues with links. If you try to navigate using the class graphs on the page, the links are not correctly generated by the tool.

The Jazzy generated documentation does not have these issues, and I like the visual apprearance of the Apple themed documentation page (screenshot below).

Well, back to evaluating the SWA exercise work projects, after finishing the study program Zoom meeting I am currently listening to ?

Jazzy generated html documentation of the sorting demo app.

Fun with Swift operator overloading

There is this guy in one forum, writing all his sentences ending with at least two periods, mostly three… Always… This might help him, integrated into some text editor… Saving his keyboard strokes…

extension String {
   static postfix func ... (str: inout String) -> String {
      str = String(str.map {
         $0 == "." ? "…" : $0
      })
      return str
   }
}

var sentence = "Operator dotdotdot. For those. Who want to write. All sentences. With several periods."
let hisStyle = sentence...
print(hisStyle)
// Prints: "Operator dotdotdot… For those… Who want to write… All sentences… With several periods…"

What about adding a copyright at the end of text the user enters, using this brand new copyright operator, <©>

postfix operator <©>
extension String {
   static postfix func <©> (str: inout String) -> String {
      str += " © Antti J."
      return str
   }
}

var originalText = "Life is a b***h and then you die."
var copyrighted = originalText<©>
print(copyrighted)
// Prints: "Life is a b***h and then you die. © Antti J."

Well, back to some more serious work.

Pandemic isolation ramblings

Due to the corona virus pandemic, I’ve been working remotely since the end of February. I felt like having a cold and isolated myself before the University officially recommended that to the personnell. Not having the virus though, but a common cold only. Obviously I cannot be 100% sure since there are no tests available here unless you are critical workforce or seriously ill. So keeping myself isolated just in case, at home.

Luckily the grocery nearby delivers food and their app and website to create the orders works quite well. Today the second delivery is arriving, which should be enough for a week at least. They have a very high load of orders flooding the service. What I usually do is to create an order with a couple of products, select the delivery date about one week later, and then keep filling the order until the day before the delivery. By this day, I already have the next delivery date reserved, with a new growing list of items to order. In this way, we am able to secure the deliveries so that there will not be too long gaps in between.

Since the isolation started, I have continued to offer video sessions via MS Teams and Moodle discussion and chat support to the students in the Software architectures course. Fortunately, the course lectures and exercises were mostly over by the isolation started. Students continue working on their exercise work projects until the end of May. Luckily I have a fast network at home, and even better hardware than at the campus. That large iMac screen has proven to be quite a good a thing to have. Currently I am recoding audio feedback for the first phase of the exercise work projects to the students. The amount of feedback to give could be quite extensive, and text feedback is inferior to audio, in my opinion. Video in this case is not needed since I can easily pinpoint the things I comment by addressing the chapter titles and paragraph and page numbers. Let’s see how this works.

The study program and the research unit are using Zoom video sessions to keep in touch and organize during the pandemic. Probably this will last until summer, but I suspect there will be limitations and exceptional situation even in the Fall semester. Time will tell. University support staff has increased the online training of teachers, providing courses in Zoom on using Moodle, Teams and Zoom itself in teaching.

I’ve started to implement a small app with Swift to learn something new. The app is also something to use as a demonstration in Fall in the Data structures and algorithms course. I will take charge of that course after the summer break, so wanted to do something related to the topic.

Below is a demo video of the app in the early phases. I am planning to implement maybe a couple of more sorting algorithms and improve the graphics and usability of the app. YouTube is full of these kind of videos, so I will not put too much effort on this, like implementing tens of different algos.