Kubo and the two strings

Beautifully made movie, with stop-motion animation technique, origami, and links to Buddhism and Shinto tradition of Japan. Fascinating. Quite a complicated story, about storytelling, with hero’s journey troops woven into the film. Not made for small children, but rather for an older audience. Story about loss and forgiveness, and before anything else, about stories, and storytelling. About personal journeys, life, pain, being hurt, and losing the love ones.

Kubo taking care of his mother, which suffered some sort of brain damage from the opening scenes, is very moving. The opening scene is very dramatic, and moving too.

Two strings

Yesterday Emilia got her smartphone sorted, and for the first time she can use email and messaging apps. It is quite revealing, or perhaps eye-opening, of how she approaches it, and how she uses it to communicate with her friends, and with the extended family. For example, naturally, she uses quite a number of emojis in her messages. She has definitely never learned it from me. It is interesting to see her interacting with parents and the rest of the family through this new medium. It is rather hard to see your own kids becoming independent, as it happens very gradually, but, this is a clearly visible process.

Today was a bit warmer morning than yesterday, about -2C. Another rather busy day at work. Split into short chunks of meetings, and short activities. Meeting with Jaimie, Hakon, Magnus. Discussing workload issues with Tom and Simon. Then Game Programming final session with students, discussing the submission expectations. I guess this should be done up better early in the course.

Brainstorming a bit about the way immersive virtual environments can be controlled without the Vive controllers. Possibly using the Tango device. Will have to explore the ideas more.

Evening. Watching “Kubo and the two strings”. This film is thought-provoking and immensely beautiful. Makes a big impression on girls. I guess it is a bit hard for them to get all the meaning from the movie, but we will surely watch it again. Must discuss it tomorrow of how much they have got from the movie. When asked why the title is “two string”, Emilia says that it is about his mom and dad.



Busy day. Morning and early afternoon dedicated to SmartCities workshop at NTNU. Simon and I setup HTP Vive and demoed some of VR capabilities in the context of remote collaboration. Simon later showcased the collaboration space developed by MSc student, Niclas. Then meeting with Basel and Tom, discussing the future of VR projects. Back to workshop. Work, emails, catching up with students taking the graphics exam. Then home. Installing the spiky tires onto the bicycle, and cycling to the climbing gym. First climbing with Terje, then with Basel. A day like many others, but, there was this girl. At the climbing gym. She was wearing a pair of glasses and a pretty bright red jersey. She was loud, talkative, and extremely excited. She was about 6 years old. I think, it might have been her very first day at the climbing gym. She talked to everyone climbing there, asking how often they climb, and how great climbing is. She was so full of positive energy that it just poured to everyone she interrupted in her enquiries. She talked to me for few minutes, although I couldn’t answer her much as my Norwegian is almost non-existent. I smiled, nodded, and tried to answer some of her questions. She has brightened my day. And, she made everyone else in the gym smiling. She might have said, that she wants to be like “us”, people that can climb things that she cannot yet. I want to be like her, capable of bringing enthusiasm and positive energy to the world around.


Thursday, February 11

I couldn’t sleep last night. I woke up several times throughout the night. I guess I was a bit stressed, but not realised it at the time. Today I had an important meeting, with a presentation in front of several reps from the Norwegian law enforcement agencies and Europol. The presentation and the meeting went well. I hope there will be follow up collaboration. The meeting alone was very interesting. Balancing the technological developments with policy making and security issues is a truly tricky undertaking.

The trip to and from Oslo went well – I drove my colleague car, and chatted with her throughout the trip. Pretty nice weather, side trip to pick up her friend from the Gardermoen airport. Back to Gjovik, work, then trip to Lillehammer with Rune and Terje for climbing. Met Agata and Piotr, who were practicing there as well. Arild joined shortly after we have started.

Now I’ll do some coding on the educational project I’ve been recently working on, and then go to sleep.

Dublin Blockchain hackathon.


Last weekend I went to Dublin for the Blockchain Hackathon organized by Chainsmiths.  IMG_2128The main sponsor of the event was Fidelity Investments. The event was actually by most part organized by a single person, Kevin Loaec (@KLoaec) who put enormous effort to pull it off.
The Twitter hashtag for the event was #blockhack15.


The original idea was around Autonomous Decentralized organization, temporary wallets, and selling procedurally generated art. This has been iterated over multiple times, and we have settled for proof-of concept for using Bitcoin blockchain with temporary wallets and pure client-side implementation for digital assets tracking and rewards redistribution. We started with nodejs server-side but realised that it might be possible to completely skip server side and implement everything as a single-page client-side only app, that uses blockchain for all the state and data tracking. It was quite hard to make all the necessary components to talk to each other but eventually it almost worked. We have got stuck on small technicalities with OP_RETURN data passing. Nevertheless, the concept worked.

We won the best innovative idea in FinTech award by Fidelity Investments.IMG_2123


[Those are some of the notes that I’ve taken during the event]

History: distributed ledger-like systems were known for long time. However, Bitcoin blockchain brings in distributed consensus into the picture. This is quite a unique proposition (being matched now to some extent by Ethereum).

Why Bitcoin

  • No central authority controlling it.
  • There is no credit risk. The credit risk always exists when talking about national currencies or bank issuing the currency tokens.
  • There is no 3rd party risk.

Scalability in Bitcoin: major issue, no real solutions, but some technical progress, eg. with Colored Coins and Open Chain to address some of the most pressing scalability issues. Will there be a single Bitcoin blockchain or will other alt-coins persevere? None knows. Bitcoin has a huge head start, most of the computing power and by far most of the investment.

Issues: mining pools becoming inherently centralized. Chinese miners dominating that part of the ecosystem already. Note however, that the miners could, but are unlikely to jeopardize the system as they have their own financial incentives at stake.

FinTech: blockchains are huge in fintech industry. They are used to reduce operational costs, for transparency and tracking, for technology itself. Not Bitcoins directly. Rather the underlying blockchain technology. Bitcoin often equated to cash – same rules apply on multiple levels.

Ethereum: promising technology. Can they build and sustain the blockchain network?


Ideas pitchedIMG_2112

  1. Automating charity donations by linking small micropayments for procrastination activities that one would like to reduce in her/his own life. Inspired by SelfControlApp from MacOSX: “SelfControl is a free and open-source application for Mac OS X that lets you block your own access to distracting websites, your mail servers, or anything else on the Internet.”
  2. Charity donations made transparent for everyone involved. The donors see their funds being used for the cause advertised.
  3. Blockchain for a better world: donations made before crisis situations (flooding, earthquake, etc) and funds released to the areas affected by the disasters upon triggers from real world (the use of smart contracts).
  4. Keeping track of personal data and identity and only allowing 3rd parties to access parts of your identity (e.g. age). Think of it like a trusted 3rd party service managing access to your identity without the 3rd party.
  5. Automating transaction tracking for the backoffice: tracking, transparency and verification of all backoffice processes.
  6. Rental housing market managed by smart contracts on Ethereum.
  7. Smart-contract or blockchain control over doctor/pharmacist prescription market.
  8. Vehicle licence plate tracking via open distributed blockchain. Register for digital assets tracking.
  9. Workplace reward scheme; giving out reward tokens, that can be redeemed by participants for something, via company own, verifiable blockchain.
  10. Kidney swap: finding a donor willing to donate a kidney that matches your requirements and swapping the kidney with a donor that you have found, that doesn’t match your requirements, but matches the other party.
  11. Collector cards for digital content; artists broadcast a hash of original work that can be purchased and “owned” by collectors.
  12. Using Ethereum for control/management of mining in the Bitcoin blockchain. The idea is to form smart contract around mining pool. An allocated collateral is locked by the owner of the pool, and whistleblower can signal violation of rules that would release the collateral to all stakeholders. This mechanism would prevent mining pool owners of conducting anything outside of the set of agreed rules. Without any 3rd party controlling it.
  13. Identity tracking, identity creating, web-of-trust-like mapping between a person and digital identity, without central authority.
  14. Kondo-apartment management using blockchain. Shared between landlord and tenants for tracking assets, rental agreements, leases, etc.
  15. Autonomous insurance company: interested parties all sign up and make capital investment. The claims are managed by the 51% consensus, and the funds are released upon reaching the majority for a given claim.
  16. Associate value of software to its use. Proof-of-work evaluation system for autonomous calculation of software worth by the usage that it experiences.
  17. How to manage Bitcoin micropayments without the use of Bitcoins directly.
  18. Car-chain: tracking car ownership by public ledger.
  19. Lending money and using smart-contracts to track the loans and repayments.
  20. Distributed computing platform with BTC micropayments for proof-of-work (after certain tasks are accomplished).
  21. Analytics on blockchain: how to extract valuable informations from transactions on Bitcoin and alternative blockchains.
  22. Replacing computational proof-of-work with something meaningful in the real world.



IMG_2113 IMG_2124 IMG_2125

IMG_2131 IMG_2132 IMG_2111

Birdman, 2014

Birdman, 2014, by Alejandro Gonzalez Inarritu

Story of love, ego, desire to be loved and admired. Story of achieving something in the past, and moving on. Story of being a father to a daughter, and husband. Story of accomplishing something  important.

Lots of symbols and metaphors. References to other movies. Ending open for interpretations. Examples: He dies in the theatre, the ending is just death-dream hallucinations. He survives the suicide attempt on the premiere, but jumps out and commits suicide in the hospital. He survives. In all of the cases he achieves the admiration of the public, of the critics, and of his daughter.

Interesting tension and interactions between Riggan and his daughter. Social media playing central role in her world-view, and the struggle to make something meaningful that is validated by the social peers. Opening a Twitter account and having 80k followers within few hours validates to her the worth of her own father.

Complex and multilayered presentation of modern artist/creator and the world around.

Original ending with Jonny Depp rewritten to the current ending. I sort of liked the self-referential, “Being John Malcovitch” style of the original concept for the ending and the exposition of the layers of play and drama.

Modern Game Engine Architectures

Game Engine Architectures

This week, in one of the game programming classes, students enquired about the best way of designing their Graphics Engines and Game Engines. We run courses in which students have to implement simple graphical applications with the use of OpenGL; and courses in which they have to implement games in C++.  I have recommended them to use component-based entity systems and delegation, as it is by far one of the most widely used solution. I have pointed out that typical object-oriented hierarchy modelling, even though it is simple to start with, may quickly lead to problems and the need for multiple inheritance. I’ve also suggested model-view-controller pattern, or MVC, to cleanly isolate their model, logic, and presentation layers. You can check the introduction article here. It is important to note that there have been multiple discussions on game engines, and this one is a good example this one: “Why are MVC and TDD not employed more in game architecture?” and this one “Component based game engine design“.

Obviously, the typical solutions that we use need regular update and therefore this weekend I’ve looked into the various options for design game engines. And it turns out to be quite a complicated topic on its own. I have learned 2 things: a new, pretty complex way of implementing component system, and functional reactive programming patterns. Let us start with CBES.

Component-based entity systems

CBES, or Component-based Entity Systems are one of the most popular and pervasive models used in modern designs of many games and game engines. One of the best introductions is provided in the Game Programming Patterns. However, they have their drawbacks. They tend to get quite complex, due to inter-component communication, state-tracking, and dependencies. They do not take any advantage of cache lines, and they can be limited in the way of abstracting behaviours.

One of the interesting models for implementing the components is Data-oriented Design. In CppCon 2015, Vittorio Romeo provided a skeleton for the Implementation of the component-based entity system in modern C++. His talk is definitely worth a watch.


There are other alternatives. In this simple article “Why I switched from CBES to FRP” the author is pointing out some of the limitation of component-based system, and suggesting the switch to Functional Reactive Programming.


Functional Reactive Programming

It turns out, that FRP, or Functional Reactive Programming is not only limited to Haskel or Elm. It can be used in your C++ projects to. There is Reactive programming in C++ (RFP in C++: video lecture). The code of David Sankel’s sbase system is available on Bitbucket.

ps. David has also C++ oriented podcast, that is quite interesting.

Poznan marathon: October 11

Poznan marathon story

Before the start

I was supported by my dad. We got near the stadium around 40min before the start. It was hard to find a parking spot. Cold morning. It was around +4C when we started driving. My dad had to scrape frost from the windshields. While walking through the Poznan trade centre towards the hall I’ve done a quick warmup. The hall was packed with runners, and the inside of the hall was nice and warm. We walked through the Hall #3 and exited on the other side. There were long queue to the toilets. Lots of people everywhere. I’ve run back and forth a bit, trying to keep warm. The time passed quickly. The last 10min of waiting I spent already in the crowd, near the start line. Jumping. Screaming. Getting the adrenaline pumping. And then – the run just started.

Before the 18th km

I started relatively fast, trying to get in front of the slower runners to have space to keep my own pace. I have not started far from the start line. 10 seconds to be precise. I kept the fast pace. Unusually fast. My heart-rate was in the excess of 180, hitting 190bpm. All due to adrenaline rush. I wasn’t actually running on my limit – quite to the contrary, I felt relaxed. 5min into the race and the heart settled on around 165bpm. I have never run that fast before. Usually, I start quite conservative for the first 10km or so. I try to pick up the pace later. Early fast start means early build-up of lactic acid in the muscles, which means trouble later in the race. Because the last two marathons I’ve finished with the power reserves, I wanted to know how it feels to run faster. The pace was set, and even though the pace was fast for me (4:15min/km), I was able to keep it up reasonably well. I’ve joined the group of runners with the 3:00 pacemaker, and running with that group felt great. I could see some of the runners in the group doing well. Others showing early signs of struggle. I was in the latter category. I knew I will not be able to keep up that pace till the end of the race. The first crisis came at about 18th kilometre.

After the 18th km

The running with a group means you have to keep the pace of the group. It is both: good and bad. The good thing is that you have less air resistance and that the group keeps you motivated. This particular group was quite densely packed, to a point that even small variation in speed was hard to execute. We all were so close to each other, that slowing down means everyone behind you have to slow down with you, and speeding up is not easy because there is no space. I decided I need to vary my speed a bit more than the running in tight group allows me to do. I slowly dropped to the tail of the group. I wasn’t much slower than the group, but I’ve noticed that moving forward towards the centre of the group became impossible. I just couldn’t move forward anymore. I continue running with slightly slower pace then. In the group I managed 4:13min/km, and then by dropping to the tail, I’ve dropped also to 4:15min/km. But, that was the speed I should have to achieve 3hrs mark anyway, so I was actually quite happy. Running at 4:15min/km felt somewhat easier, and I could vary my tempo more freely. The relatively happy running was then interrupted at around the 26th km, when I started feeling quite bad. The run suddenly became super HARD.

The pain

The right quadriceps started aching shortly after 10th or 11th kilometre, and I had to favour my left leg for a while. This soon elevated the pain of the left calf to a point that it was aching more than the quadriceps before. With both left calf and right quad aching quite badly, I tried to vary the gait so that other muscles put in more effort offloading the two that starting showing signs of damage early. I have also started pushing more with my arms, hoping that the tired leg muscles will have just a bit easier. Once the pain sets in, it never really goes away, but when a new pain in new muscle appears with ferocious intensity, you somewhat forget about the previous pain.  It is like climbing the staircase, where each new step is just a bit taller and harder than the previous one. While you overcoming step 3, it feels intense and hard, but once you at step 8, looking back to your efforts and troubles at step 3 you get a completely different perspective. The leg pain actually faded into minor once my back and shoulders started aching from intense arm workout that I was putting in. I tense too much, and the hard fast running was taking its toll.

After the wall

I hit the wall around 26th km. Suddenly, I just felt extremely weak. I pushed harder, trying to wait it off, but the pain, tiredness and lack of power never went away. In fact, my leg muscles felt weaker and weaker. I had to push harder still, yet, watching my tempo slowly dropping down. 4:16min/km. Push push push push like never before, just to realise, it is now 4:18min/km. I tried real hard to find the power and energy and pushing even more. 4:20min/km. Yes, the intensity of the wall was somewhat crushed, and running for a while at 4:20min/km felt good again. Stable. Perhaps I could keep that pace? Nope. The thing is that the time between the walls actually shrinks the longer you run, and the new down period set in. Pushing you more into the hell. I felt quite good overall. Sure, I was aching everywhere, but the leg muscles stopped complaining, and went numb instead. I couldn’t feel much pain, just a total inability to generate energy. The leg muscles felt really slow and weak. The arms could pump something but that was rather painful. My back was hurting from the workout my hands were doing. I monitored my heart-rate and it was steady at around 165bpm. I asked myself: can I do 170bpm? And the answer was: NO. No matter how hard and fast I tried to run I simply couldn’t push my body beyond the 168bpm. Strange feeling. I new my heart can do more than that, I new my mind can withstand more pain that I was in, yet, for some reason, I just couldn’t push harder. Was I on my physical limit? I’d like to think that, but I probably wasn’t 😉  I did not feel that I was. Have I reached my physical limit?

The finish

When there were 6 or so kilometres left, it became even harder to run and to keep the pace. And then, on the last 4 km stretch we all had a head-wind pushing us back. Making the forward progression became even harder. I remember slipping slowly back in the pack, being completely depleted, and having no power for a strong finish. I was empty. Crossing the finish line have not delivered a strong emotional kick. It just felt the job was hard, and now, the job was done. I was pleased to reach the same time as before, which is 3:10. This time, without any power reserves left. And with the whole body in pain.

My dad was waiting for me at the finish line. My wife and kids where cheering my back home, watching the entire race through internet broadcast. They knew I went well for the first 15km or so, but I was slipping in position from then on. I eventually finished on place 334th.

About 20min after the finish, the endorphins kicked in, and I became overwhelmed with a good feelings 😉 That good feelings stay with me for about 2 weeks solid after every long run. (Writing this entry I have a grin on my face.)

Because I have already achieved 3:10, it turns overall into a bit of anticlimax. With all the prep and no improvement in the actual “result”. But then again, i’m not sure if the result in terms of time is the key, or if the experience is the main reason why I do it. The experience is worth the effort. The 13th marathon story ended.


Some stats

There were 7052 runners taking part in the run. 6242 finished. That means more than 10% tried to do something and gave up at some point.

The oldest man finishing was 74 years old (Piotr Silkin). He finished with the time of 4:14. The oldest woman was 73 (Wiera Stasiewicz). She finished with 5:28.

Poznan marathon results

Marathon: what it is.

Marathon: what it is?

It is not really about fitness. Or your legs. It is all about your head. And your heart.

The run starts with lots of euphoria and enthusiasm. It is extremely elevating to be able to participant in one of the old running events. Events that inspired so many people in the past, and continue to inspire more. The event that goes back to the ancient Greece and the story of the Marathon. And it feels awesome to be surrounded by thousands of like-minded people, that undertake the challenge with you. Awesome. Truly elevating. You start. The rhythmic noise of people’s feet hitting the road puts your mind quickly into ease and meditation-like state. The first 10k passes rather quickly. You keep the pace that you set yourself for. You feel great. You have been overtaken by faster runners. You have overtaken the slower. And you felt great doing it. You settle to the group of runners that are LIKE YOU. Some might be slightly slower. Some slightly faster. But the same t-shirts, the same shoes, the same faces start building a family around you. You might talk with some. You might be running in silence. But you are part of that family. And you feel it. The rhythmic sound of shoes hitting the road accompany you.
With relatively happy thoughts you hit the half mark. You start thinking, that you might be able to DO IT. The half wasn’t that bad, right? It continues to feel good. You keep the pace. Things seem to be going according to your plan. And then, suddenly, it happens. Perhaps 25th kilometre or so. You slow down! Just a bit. But enough to notice. And you have to make a huge mental effort, to push your body to run. To return to the pace that you should have. And it happens again. You slow down. Just a bit. And again you have to force yourself to run faster. You repeat that for a while. You get used to it. You know it is a cycle. You pick-up, you give-up, you pick-up again. Easier. Harder. Easier. Harder. You get into the cycle. Your legs start to ache. Your entire body starts to ache. And you start feeling tired of the effort. In your head. You JUST want to slow down. But people around you help. You tag along a group. Or perhaps just one runner. They keep you moving.

You hit 30km or so. You start seeing some people that slowed down. Some start to walk. Some are giving up. You may shout to them. Or pat them on the back. Or encourage them to FIGHT. This is not the end. There is WORK to be done. And you suddenly feel good again. You feel that you might have what it takes! You keep pushing. You feel the run is great. You got a second wind perhaps.

You try to fool yourself thinking that MOST of the work is behind you. That things will be fine! But you KNOW this is a lie. You know, the race has not started yet. The race will really start after you hit the wall. The wall may hit you seriously hard. Or gradually. But it always happens. It sneaks up on you. Suddenly. The realisation, first in your body, then in your mind, that the pace is TOO MUCH for you to keep. You cannot run THAT FAST anymore. No way! Your body screams for you to slow down. Your mind keeps inventing reasons of why you should slow down. Slowing down is the only thing on your mind from now on.

But you are not slowing down. Your body aches. Screams. You feel it is unbearable. You have to “leave your body behind” and think about something else. You better HAVE something else to think about. Because the effort is more than you can take. More than you can deal with. The usual unity of your mind and your body is shuttered. The effort is way TOO MUCH to take in.

Yet you continue to run. And you continue to push. This is real HELL. Every passing minute feels like eternity. You start resisting checking the watch, because you know that you will be very disappointed. You cannot comprehend that the hours of suffering that you just went through, are actually minutes. Or worse: seconds. You KNOW you cannot continue this. But you do. You keep running. The only thing in your head is to give up. Your thoughts race, and you start seriously contemplating giving up. But you continue, and instead of slowing down, you give up hope. You start thinking that this suffering, this unbearable effort will never end. That this HELL will just continue for eternity. You start thinking of death. You may actually start begging for death. Anything, that would put you out of this misery. You would give anything for this to end. Your body and your mind scream at you to STOP.
You continue running.

And then you see it. You do not believe it, but it is real. You see the finish line. And ONLY THEN you start believing that you can actually finish it. That it will be OK. That you have conquered the impossible. How? You have no idea. But you know: YOU, somehow, managed to go through this inhumane effort. This hell. And you came out on the other end. There is still a doubt, a hint that you just attempted the impossible, and that IT WILL NOT WORK. But it does – you cross the finishing line. It is real. You are totally exhausted. Completely depleted. Both, physically. And mentally.

A surge of emotions hit you. You may cry. The emotions are super strong. It is HUGE. You have done something that was impossible. You have gone beyond your own limitations. You WERE THERE. You have witnessed it. And you came out.

It is one of the most elevating feelings that you can experience. It shakes you to the very core. It goes real deep in you. And stays with you. Forever.

One day left. The day after tomorrow I will stand with 8 thousands other runners. And run. If you never done it yourself, you have no idea. You do not know, or understand of how it feels. No idea of what it is. You may think you do, cognitively. But it is not possible for you to fully appreciate the effort and challenge. And what you missing out. Wanna try it?


Fear. Faith.

I will run 130km tomorrow, during the mountain run festival in Poland. Is running ultra something exciting? Something great? Not really. As in life, there are moments that you cherish, moments that highlight the journey, but overall, it boils down to just a mundane inhumane effort.  It is hard to explain why I will run. I cannot rationally explain it to myself neither.

There is something magically appealing in the inhumane effort that one has to go through to come out on the other side. It is a true “valley of darkness”, and the only emotion that I entertain now is fear. There is no joy, no enthusiasm, no elevating feeling. I had those earlier, when doing longer runs for the first time. But now, with a bit of experience, I am just plainly scared. I know that I will go through hell. My body. And my mind.

How do you prepare for running ultra? What do you need? There is only one thing you need to have, and one thing only. FAITH. You need to believe, that you can do it. It is that simple.