I’m a software developer from Mjøndalen in Norway. My first experience with programming was scripting VBA in Excel while studying economics. I remember working day and night scripting excel to automate a bunch of stuff for an assignment and really having a great time with it. Later I figured out that scripting excel was pretty much the only thing I enjoyed about the economics studies, so I went on to study computer science as well. I enjoyed computer science a lot, and this made me extra happy and relieved because of how boring I found economics studies.

FastAI

I’m currently following the fast ai course, and will hopefully post a lot about stuff related to that. Jeremy seems like a great teacher.

How to FastAI

I liked these points on “how to do a fast.ai lesson” from here:

  1. Watch lecture
  2. Run notebook and experiment
  3. Reproduce results
  4. Repeat with different dataset

It is fine to not do all of the steps the first time you go through the course, but take it as far as you can and try to push yourself more and more on each iteration.

I also liked this quote from a former student: “One of my favorite pieces of advice was from FastAI’s Jeremy Howard. He told me to focus on making one really great project that showed off my skills. He says that so many people have many interesting but half-finished projects on github, and that it’s so much better to have a single one that is really polished.”

I will to try to make something that assists players of the boardgame Twilight Imperium 4 by collecting data of the state of the game and then visualizing the data. The reason for doing this specifically is that I enjoy playing TI4 a lot so it will hopefully give some extra motivation to finish the project. Also, TI4 is such a complex game with lots of different components, and it would be nice to have a tool that helped to keep track of it all. The first thing I want to try out is to keep track of the public objectives.

Notes from live coding sessions and more

Timestamps and links from the fast.ai live coding sessions (and sometimes other places) that might be useful. Jeremy shows a lot of useful stuff in these sessions.

Session 1:

Session 2:

Session 3:

Session 4:

  • Virtues of a great programmer: laziness, impatience and hubris. One way of being lazy is to learn stuff that is re-usable, such as using python for scripts rather than shell because python can be used for more purposes.

Terminal tricks:

  • !! last command
  • !$ last token in last command
  • ctrl + u: delete everything left of the cursor
  • ctrl + k: delete everything right of the cursor

For some more terminal tricks check out this file.

Jupyter notebook tricks (given a function f):

  • something. + click tab will show available methods for something
  • f?: displays function signature, docstring, file and type on running
  • f??: displays function source code on running
  • f: displays where the function is from and its parameters on running
  • f( and shift+tab: displays the same as f? in the active jupyter block (do not need to run it)
  • shift+m: merge blocks?
  • 0 0: restarts the kernal - nice to use when you want to re run everything
  • a hotkey for running everything is not set by default, but can be assigned through help > edit keyboard shortcuts > run all cells

Python technicalities and related stuff:

  • Inside of a class, the class does not know about itself. For type hinting to work one has to wrap the class name in quotes. From this clip
  • fastcore.utils has functionality for defining funtions for a class outside of the class (like extension functions in kotlin?). This is done with the fastcore.utils.patch decorator. At this point python will know about the class, so no need to wrap type hint of the class in quotes
  • showcase of using nbdev for testing

Other:

  • “When you’re trying to understand enough of a new codebase to make a specific PR, it’s best to use an editor which lets you jump to definitions to understand how the code works. Reading and experimenting in the notebooks is the best way to understand the bigger picture more thoroughly.” (from here)