Public release of Stockholm Transit (SL)

Hello again!

This time I have very exciting news! Me and my friend Mattias Svanström ( have been working on an Android app called Stockholm Transit (SL) for the last 6 months. And now the time has come to finally release it publicly!

Stockholm Transit is an app that helps you plan your journeys while traveling in Stockholm with SL (Storstockholms Lokaltrafik). What makes Stockholm Transit different from other apps is the interactive and clickable subway and rail map that makes it much easier to quickly select departure and arrival station. Normally you’d have to write the names of the stations, but this step is skipped in our app. The app also have all the normal features that you would expect from an app like this. You can configure the exact time you want to arrive, save favorite trips, view your trip on a Google map and much more.

Inspiration to this app came after my trip to Seoul in South Korea, where they have a really good app for planning trips with the subway. And then after coming back to Stockholm I realized that we don’t have an app like that here, so I decided to create on myself.  And now I finally feel that the app is ready for release!

This is the map you’ll see when you start the app:

Stockholm Transit (SL)

In the map you can simply press where you want to start, where you want to go and then press search to quickly see the different possible trips that you can take. Simple and very fast.

See below for more screenshots of the other parts of the app:

Download it here:

Get it on Google Play

And please send any comments or feedback to or post it in the comments down below. Sharing the app and giving it a good rating in Google play is also a nice thing to do… 🙂

Finished #21 in CodeCombat’s Greed tournament


I’ve been very busy during the last months. I’ve had lots of stuff to do in school, done lots of programming on my new travel app (will make a post about this soon) and I’ve also started working as a summer intern at a company called Besedo. And I’ve been to Malta. But this post is about Greed, an online multiplayer programming competition game.

Basically you had to write JavaScript code to control your workers in the game. The objective was to collect gold as fast as possible, build soldiers and destroy the enemy base.


As I mentioned in the title of this blog post, I finished #21 in the tournament. I only spent maybe 10 hours coding this, and this was in the beginning of the tournament. So I’m pretty happy with the results. During the last week I didn’t even code any new strategy, I only ported my code from the Ogre side to the Human side.

And what did I get for my participation in this tournament?

I actually won 3 things:

  • Webstorm private license.
  • O’Reilly ebook of my choice.
  • Amazon Web Services credits – $50.

Which is pretty nice! Webstorm is a good IDE for web development, which I actually wanted to buy anyways. A free ebook from O’Reilly is also nice, considering they have many interesting books about programming. And $50 credit for Amazon Web Services is perfect too, since I host the backend for my soon-to-be-announced travel app there.

My strategy

My strategy in the game was pretty simple. My strategy for collecting coins was simply to calculate the value of each coin divided by the distance from each worker. Each worker would then simply run towards the coin with the highest value per meter, unless that coin was targeted by an enemy worker which was closer to the coin than my worker. One optimization I also did was to split the map into 4 zones, and have my 4 workers take one zone each. This greatly increased the number of coins I managed to collect faster than the enemy.

My fighting strategy was not very advanced, and I could’ve improved it a lot. Here I simply waited until the enemy started hitting my base, and then I built as many soldiers as possible to fight back his attack. This usually then managed to overrun the enemy and win the game. If the enemy was too slow, or never attacked me, I waited until I had collected 300 gold, after which I simply did an all-out attack with as many soldiers as I could build. This also usually won the game.

The code

You can find the code I wrote for the tournament in my public repository here: human.js. The code is not very optimized or well commented, because it was just a quick implementation. But it did its job.

Actual game

Here is an actual game from the tournament: Foosvald vs Orson Peters. (Press the link to see a replay!)

In the game you see how my team, bottom left, reaches 300 gold and then stages an all-out attack and wins. Very nice.

Foosvald vs Orson Peters

You can still participate in the tournament, and submit code. You can’t win any prizes anymore though. But try it out, it’s fun.

See you in the next post!

Blocking websites for maximum productivity


Exactly one week ago I tried something that I’ve tried many times before. But this time I did it a little bit more than usually. I blocked all distracting websites for a whole week, 24 hours per day. During this last week I haven’t been to Reddit even once. Haven’t opened Facebook. Haven’t even checked the Swedish news. My time in front of my computer has only been spent doing productive stuff like developing my Android app, doing homework and other programming exercises.

This little experiment worked so well that I might just have to try it for another week. Who knows, might even extend it to a full month!

There are many ways of blocking websites locally on your computer. I just Googled and picked the first program that seemed ok. The choice fell on Cold Turkey, but any program will do.

That’s it. Try it!

Free Machine Learning course on Coursera

Hello again,

I’ve been interested in machine learning for a while, but never really had the chance take a real Machine Learning course. A small part on Machine Learning was included in the Artificial Intelligence course I took at KAIST in South Korea, but it was very small. At KTH where I study now they have many courses in Machine Learning, but unfortunately none of which fit my schedule this semester.

One course that actually fits my schedule is however the free online Machine Learning course given at Coursera. Coursera is a website which provides many different MOOCs (Massive open online courses) of which many are free. The course I’m taking, in Machine Learning, is totally free.

Machine Learning course on Coursera

This course gives a good introduction to various Machine Learning topics including:

  1. Supervised learning (parametric/non-parametric algorithms, support vector machines, kernels, neural networks).
  2. Unsupervised learning (clustering, dimensionality reduction, recommender systems, deep learning).
  3. Best practices in machine learning (bias/variance theory; innovation process in machine learning and AI)

It’s not focused on the very deep mathematical topics, but instead serves as a good  introduction on how to actually apply the concepts in practical applications.


The format of the class is very simple. Each week there are multiple videos introducing various parts of that week’s topic. In every video there are also usually one or a couple of optional review questions, which makes you listen and think more actively. There are also graded review questions for the whole week, which serve as a good way of repeating and reviewing the material. Finally there is also one graded programming exercise per week, with a few different subtasks. The exercises are completed in the free and open source GNU Octave or the proprietary MATLAB, and then submitted to the judging system for automatic verification and grading. If you have 80% score  or higher when the course ends you’ll pass it and get a statement of accomplishment from the teacher.

Time needed to take this course

On the course website it says that you probably need around 5 to 7 hours per week to watch the videos, answer the review questions and finish the programming exercises. This is a pretty good estimate. The first week I spent some more time on this because I had some problems with getting Octave to run on my Windows computer, but the week after that took only around 4 hours or so. Of course I  know both programming and have taken some of math courses at KTH, but even without this background it shouldn’t be too hard to do the exercises.

Review after the first few weeks

This course will run for 10 weeks in total, and we’ve now just finished week 3. So far I like the course and have learnt a lot. It’s been on a pretty good level too. I’ve learnt new things, without having to spend too much time on it. I’ve also learnt the basic math behind many of the algorithms used in the class, and can easily look them up to deepen my understanding of the more advanced math. After finishing the course I’ll try to write a longer review on what I learnt and what I thought of the course.

And by the way, the course started on 3rd of March, but you can still register and do the first few weeks of work to catch up with the schedule.

Spaced repetition with Memrise


Have you heard about spaced repetition? Spaced repetition is a learning technique for learning and memorizing facts, words or anything else you might want study. When studying using spaced repetition you increase the time between review sessions in a smart manner instead of simply trying to cram facts into your memory. This is then supposed to help you remember the facts (or whatever you choose to learn) for a longer time, instead of just forgetting it directly again.

Memrise explains it like this:

Memrise makes use of Spaced Repetition, helping you review items at expertly spaced intervals to help you maintain them in memory in the most efficient manner possible. Reminders space out in time as your knowledge for an item gets deeper, meaning you don’t forget, but don’t waste time reviewing what you already know.

There are many helpful websites that make use of spaced repetition, and I can really recommend using one of them or mobile app while studying. Usually they work like normal paper flash cards (useful while remembering new things) but with the additional bonus of automatically only appearing when you need to review that specific card. If you while reviewing a card are unable to remember the answer, you simply mark the card for an earlier review. And on the other hand if you know the correct answer, you mark it as correct. The program will then calculate the optimal time for reviewing the individual cards. This is easier than having to manually sort physical flash cards, trying to guess when to review them.

Another good thing when using any of these websites or apps is that they will automatically sync your cards and progress between devices. So I can at one moment review the cards on my computer, and then simply continue on my phone if I want too. This makes it much easier to just spontaneously review some cards when you have a few minutes over.


One website that I like is Memrise is a free website which makes use of spaced repetition and also something they call the “Testing Effect”. This simply means that by actively trying to recall the correct answer you reinforce the memory, making it more likely that you’re going to remember that item later.

On Memrise you also find lots of pre-made courses for languages, chemistry, engineering, history and many other subjects. This is perfect for me, since I have studied Korean in South Korea for one year, but now live in Sweden and don’t study Korean at school any more. On Memrise there is a Korean course with the 1000 most common words that I’m studying right now. In this course there are many words I already know, mixed with some new words. This is good combination for me, since I can both review what I already know and also learn new words at the same time. If there is no suitable course for what you want to study you can also create your own and input the things you want to remember. Then you have the opportunity to either keep it private, or share it with other people.

If you choose to study a pre-made course, there are usually lots of “mems” that other users have created and shared with everyone. Each “mem” can consist of funny pictures, pronunciations or helpful mnemonics or a combination of any of these. By reading these mnemonics, listening to the pronunciation and looking at the pictures you use many different senses, which is supposed to help you remember the word even better.

To further help you studying with Memrise they also incorporate game-like aspects into the learning process. You get points while reviewing words, which are then visible in the high score list for that specific course.  Also, instead of only reviewing facts on two-sided flash cards all the time (like many other apps), there are a few varied exercises for both choosing the correct word from a list or spelling out the word (both from the target language to English or the other way around). This both makes it more fun to learn, and helps you retain the fact for a longer time.

When you’re then done with the initial learning phase of the new words the level that you just completed will be locked for a few hours, making use of spaced repetition, before you can study it again. After the second time you have reviewed it, it might be locked for maybe a full day, or whatever amount of time Memrise finds suitable.

Memrise is totally free, and instead of only me talking about it, have a look at the pictures below. You should also go and try it out by yourself.

Go to and create an account, or simply use the links below to download the app for Android or iOS.

Get it on Google Play Download on the App Store



Have fun learning and see you later!