Oh, hi there!

It’s been a while. Actually it has almost been two years. How have you been? Me? Not so great. A lot has happened, a lot has changed, I have changed. Good things, bad things, I’d say mostly bad things, but that would just be my negative mood speaking. Recently I’ve felt the extreme urge to write again. I realize it will be boring and nobody will actually care about it, but I like to write. It seems like a good way to reflect on past events and contemplate the future. So before I might, or might not, take up a regular posting again, I will first give you a “short recap” of the past twenty-two months or so.

The Internship

Directly after my last post, I spent fourteen weeks in America, working for google. Initially I was still a bit bummed out about the rejection discussed in my last post, but I managed to get over it pretty fast and by now I have gained a very good friend instead of a partner :). The first week I spent in Sunnyvale at their headquarters and then another thirteen weeks in Los Angeles, pretty much directly at the beach in Venice. I did take one week off though, to go to conference in Hawaii, also at the beach, albeit a little prettier and a lot warmer. For me it was the first time that I lived in a foreign country. I am a dutch person living in Germany, but let’s be fair, it’s all the fucking same thing. I loved the experience and I learned a lot about myself. The work at Google was exciting and I learned a lot of new exciting work related stuff. But boy, the imposter syndrome is real at Google ! Or I just actually suck at what I do?! Or is that the imposter syndrome speaking? I don’t know, but it was tough working with people who are all at least as good if not significantly better than you are. Apart from work, I didn’t really like LA. You just freaking Uber everywhere, while I love that I just walk everywhere at home! Apart from that somehow it just didn’t click with me. I wasn’t miserable over there, but I really was looking forward to going home. I think by now I’d me more into exploring, but back then I just was more shy and kept too myself most of the time. The best thing in my time in the US was the long weekend with my colleague and his wife, when we left LA x). We drove down to Yosemite, visiting some smaller towns along the way. Yosemite is amongst the prettiest pieces of earth that I have seen in my life! Apart from that, I lived in an Airbnb with a woman and her kid. I’m pretty sure she was an alcoholic considering the supersized vodka bottles I saw coming and going in that place! But yea, overall, I would do it again, it was a valuable experience, I just didn’t like LA. Maybe other American cities would be more to my liking? Who knows.

 

Coming back to Germany

AirBerlin, the company I bought my plane tickets from, went broke while I was in the US. Three days before flying home they told me my flight was canceled and I had to figure out (and pay!) an alternative myself. Great timing! Buying a short term single way ticket from LA was not cheap. After I came back, the plan was to write up my PhD thesis pretty much as soon as possible, but instead I started working on some paper ideas with my colleague that we developed earlier. This was great fun, too bad they didn’t work in the end. Around that time I met this girl who spiked my interest. In retrospect I don’t know why, and a double facepalm does not do it justice. At least you learn from experiences. The paper ideas failed and I worked hard on starting something with this girl. The next few months, we had some good times, we even went to Berlin for a week. There I found out that my favorite bar had been sold and turned to shit :(. At the same time I should have been writing my thesis and somewhere along the road I read about LSD microdosing several times. Supposedly it should have a positive effect on creativity and motivation to do boring tasks, such as writing a PhD thesis. I also found out that you can legally order LSD when it is slightly modified, and thus legally not LSD anymore, albeit with the exact same effect. I ordered some, and after a few weeks it was delivered to my home by the German post. Crazy feeling, but yea, everything was ready for microdosing, great! I’m not even sure what exactly happened, but at some point the relationship was somewhat boring to me, but me being the hopeless romantic that I am, I obviously did not accept this and just lived my “happy little life”. Shit hit the fan when she realized I was microdosing LSD, which for her was a good reason to break up. For me that was somehow totally okay and I didn’t shed a single tear after the break-up. It’s not like I dislaked her, but given a rather large age gap and the fact that we are rather different persons, it just didn’t work out.

So there I was, single again, nevertheless a bit unhappy about the break-up, bored out of my mind from (not) writing my PhD thesis, and sitting on a stash of LSD. You can guess what happened next :D.

 

The Trip

I was contemplating taking a full dose of LSD for a while now. I watched chefs table on Netflix and one of they guys talked about the “very strong acid” he once took, and that he understood the meaning of life during his trip. This really raised my interest. but at the same time, I knew you should not take LSD when are in a bad mood and especially not when you are alone. One week after the break-up, I was bored shitless though, and figured I could double my microdose scheduled for the day, just to see if I actually feel anything. Obviously nothing happened considering these tiny amounts. After reading all valuable tips and warning online, confirming my knowledge about not taking it alone or in a bad mood, obviously I decided it was a splendid idea to ignore all of this advise and take half a blotter of LSD in addition to my microdose. I waited for about four hours and nothing happened. I was somewhat annoyed and took the remaining half. Fun side note: I ordered five blotters of 100μg LSD, however, they sent fifteen blotters. Now there were two possible explanations, either these guys are giving it out for free to draw in new customers, OR, they somehow sent me fifteen 33μg blotters instead and I would need three of them for the full effect. While taking the second half, I figured that if nothing happens in an hour, I will take another two, because well, fuck that shit! Roughly an hour later I was sitting on the toilet when the colors of my tattoo started to glow and the normally rather rigid perceivable geometry of the room started to become more fluid-like. At that moment it instantly hit me that if I would have taken an additional two, it would have likely ended rather badly! The next three hours where rather stressful! Everything was too loud, too quite, too dark, too bright, too hot, or too cold. Everything was too something. I tried to google for some way to end an LSD trip, but my visual system failed me hard, nor could I really type on my smartphone anymore. I also realized that I did not pass the last three hours waiting for the trip to end, but in fact only about forty-five minutes. At this point I really wanted everything to just stop and started to have thoughts about what stuff I might do in order to make it stop. That became rather frightening, likely resulting in a classical panic attack. I realized I needed someone to stop me from doing something stupid in the next few hours. After not reaching two friends of mine, I contemplated to either call an ambulance, or call my parents. I knew the latter would be no help whatsoever, but I also really didn’t want this to go on an actual official record. At that point I called my brother, with whom I…, well let’s say we don’t have the best relationship. He did however rush over to my place and stayed with me for the next few hours. Kudos for that! But it was a bit annoying that while I was tripping balls and just started to understand how everything in the universe is totally connected, he was starting his typical racist discussions -.-;. In the middle of the night I had to do some convincing that I was fine and that he could now go home so that I could actually try to get some sleep. The next day I did have a nice headache, but otherwise felt pretty fine in general. LSD is fun, but take it with care and don’t be as stupid as me xD!

 

The Aftermath

The next few weeks everything went back to normal, but I did not have any significant motivation to continue writing my thesis. Instead I managed to procrastinate with smaller scientific projects, just not doing anything at all, or with wondering about what I wanted in life. I realized that nothing was really giving me any excitement and everything was just “mweeeeh”. Around that point in life I also wondered for the first time whether I actually have a depression. Maybe my blog was a self-fulfilling prophecy? I also realized that I really liked being in a relationship. Somehow this seemed like the only thing that gave me satisfaction and always served as a great way to plan my future. Just go along with the plans of the current girlfriend. Given my IT background I would find a job anywhere and so just planning around somebody else’s plan was always the path of least resistance and effort. I only realized this rather sub-optimal though-process a few months back, but roughly a year ago, I was sure that finding the next and better girlfriend would be a great idea. After roughly two months I started microdosing again, trying to get my shit together and finally finish writing my thesis, I was doing some exercises every evening, trying to eat healthy, which translated to me living of significant amounts of Huel, a nutritionally complete liquid food. Generally, I was feeling good. One day I was even standing in my living room, looking out the window and my brain just said “Wow what a beautiful day today!”. A thought that really scared my normally rather grumpy self! But it felt good. While I was actually registered on OkCupid and Tinder, passing some time in the evening, looking at random girls in my neighborhood, I was never actually successful on these platforms and had actually given up the hope to find someone there. But I didn’t really care to be honest. I just wanted to do some stuff and live a happy life for the next few months and finally finish writing.

And Then She Came Along…

A girl I had briefly seen before a few months back at some event, I met her again at one of the vegan meetups. She was trying to get everyone to join her for bouldering and I agreed to go, but only if she would join for the poetry slam that Friday. The slam was actually on my birthday and it was the yearly finales, so I convinced everyone to be super early. She actually complied and was there first, I was second, so we had a bit of time to chat and get to know each other a bit better. I’m not exactly sure when it happened, but that night I fell madly in love with her. Later that night, while walking home with my best friend who was also at the slam, I told him that I thought I really like this girl. He just told me that that was pretty obvious to him already. I guess he knows me after all those years ^^;. The only problem: she was just doing her internship here and was going to move away in a week. So for the next seven days, we saw each other every day, at first together with other people, then just the two of us and eventually she just stayed over at my place instead of me walking her home super late at night. It was a tough time since I barely slept, sometimes falling asleep at work, but it was such a crazy beautiful time! Nothing happened between us, it was just us spending time together, talking, getting to know us. By the end of the week it was clear that we had feelings for each other and we agreed that I would visit her in a few weeks. The next few months were wonderful. It was great to spend time with her and her little dog, she had so many interesting thoughts and we started planning a road trip, first buying and converting a van, and then driving through Europe for a year. It was her plan, which I pretty much just tagged along with, but I grew really fond of the idea of working on this joint project with her. I was generally happy, thinking that this is it, this is how life can and should be! But towards the end of the year, somehow it started to get clear that she wasn’t happy in the relationship. She had some difficult history and apparently she needed time by herself, planning her own life, doing exactly what she wanted and she also started to question whether I was the type of man she wanted to spend the rest of her life with. She could never really tell me what exactly was wrong, or what exactly she needed, so it was hard to really do something or change something. I went to visit her for Christmas, thinking we can relax a bit from the last stressful weeks. We hadn’t seen each other a lot recently and I was looking forward to spending some time together, maybe consolidating our differences a little and bond a bit more. But well, we didn’t. She broke up with me one day before Christmas and I left on the 24th. For me this was very tough. I found everything I was looking for in this girl and I was happy, happier than I had been in a long time and I never felt this way before. So when she broke up with me, I was shattered. There was no more motivation to do anything, and I think there it started to really go downhill with my general happiness.

 

The Last Five Months

I went to a university psychologist trying to work on my thesis procrastination just before the break-up. So the next appointment with her was less about my thesis and more about me being unhappy with life in general. The break-up threw me back to my old unhappy self, just that now I also missed my ex-girlfriend whom I loved like crazy. Initially I tried to cover up my feelings by meeting a lot of friends, trying to do a lot of stuff to distract me, but nothing really made me happy. Normally I was able to push back my doubts, fears and unhappiness about life, but now I started to actually accept these feelings and they became more present than usual. I still did the bare minimum needed in order to sustain myself and not let other people down, but there wasn’t much else.  A few weeks back I really hit rock bottom, well at least I hope it was rock bottom. I spent most of the day doing nothing, just lying in bed, waiting for time to pass and often avoiding social contacts. I just didn’t feel like doing anything at all.

But the past few months weren’t all bad. I realized I really need to change things in my life and find happiness for myself, really figure out what I need to be happy. Talking to a psychologist in general seemed helpful, but it was only once every five to seven weeks. Luckily I could also talk about my mindset with a lot of friends, some of which had really good insights. I realized that there are quite some bad patterns in my life and I really want to change those. Next week I finally have an appointment with a therapist, hopefully getting me a spot for a weekly therapy. I really want to work on my general motivation issues and I want to try to see the positive side of life more often. I started vegan and depressed as a joke, since some friends suggested it, but by now I do think there is a core of truth to it. Obviously I am vegan, but maybe I do actually have a mild form of depression.

So what’s next? Well, even after five months I still sometimes look back at my last relationship and miss my ex-girlfriend, a lot. But I also started to see that there were quite some issues where our ideas about life clashed pretty hard. Somehow this helps to accept the break-up, bit by bit. It doesn’t change the fact that I really liked the general mindset of my ex-girlfriend. She was super positive and just had this “somehow everything will work out, let’s just do stuff” attitude. And some of her ideas stuck around. I started to care more about the environment, trying to produce less garbage, buying more local stuff and I decided to buy as many fair trade product as possible. We also started bouldering together and I still really like it! But probably the craziest thing: I plan to now do a road trip through Europe, just well, without her. Sometimes I wonder if I just linger in the past and try to impress her, but the idea of traveling in a small space and getting rid of almost all my belongings, is pretty attractive. It would give me the chance to reduce life to the bare minimum and try to find out what I need in life! Do I really need the luxury that I now experience in daily life? Or does happiness rather come from the people I meet and interact with? Do I want to continue working as a computer scientist, or is there something else that actually makes me more happy? Right now I am trying to buy a suitable van, so that when I finally finishing writing my thesis, I can directly start converting the van. In early 2020 I can hopefully leave Aachen behind and explore Europe. Obviously I still want to finish my PhD, it would be stupid to throw away all the invested time, but I did realize that my mental health is more important. Likely one of the most important things in life. Currently that seems to clash a little with writing my thesis, but it’ll be okay, I hope! I should probably rather be writing my thesis instead of this post, but this is somehow more helpful right now.

Yesterday evening I was hanging out with some friends and they suggested to make “Vegan and Depressed – on Tour”. Those were actually the same friends that suggested the original blog title and somehow I must say that I liked the idea. So this morning I kept thinking about it and started writing again. Even though one of those friends is still vigorously doubting that I will ever buy a van, I hope that I can prove them wrong and actually create some “on Tour” posts on here!

In case somebody actually reads this, which I do somewhat doubt, and you are unhappy with life, I can only really urge you to talk to people! Friends, family, a therapist, talk to somebody! Talking helped me a lot, sometimes little conversations can start a thought process, which can really change your mindset and every small step helps! Initially I felt some sort of shame when actually telling people that I wasn’t doing great, thinking I might bore them, or they might react negatively. But so far almost everyone was actually pretty supportive. For me it takes away a lot of pressure if I don’t feel like I need to keep up some facade of a happy version of myself. So maybe give that a try and see what happens.

That’s it for today. Vegan and Depressed was always about random shit that happened and I want to keep it that way. So I’ll likely only write something if I found a topic that interests me or something interesting happened. I don’t want to make this my regular diary, that I keep to myself ;) So we’ll just have to see when I post next. Cheerio!

Oh, hi there!

… and you lose some

It’s been a while. I was busy with work, meeting new people, preparing for my internship, just lots of stuff to keep me busy. I might even say I was contempt with life. I’m not going to stretch it to happy. That would be overdoing it.

I met a very nice woman on a conference about a year ago. A fascinating person, unlike anyone I have met before. I instantly grew fond of her and even before the week was over, I knew I liked her more than just a friend. We stayed in touch for a few months, an occasional mail back and forth, but eventually life got the better of us and we didn’t hear from each other anymore. I got another quick mail for Christmas, but that was about it. Life continued, I met several other people, dated some of them, but nothing too fruitful. In the end I looked back on the conference as a nice memory, but my feelings didn’t affect me anymore in day-to-day life.

Then a few weeks back, I get a mail, telling me she is on a holiday in a close-by town and whether I want to come over for a day. I was thrilled, just seeing her name on my smartphone screen threw me back and boom, everything was there again. So far I had only spent time with her together with other people, but it was a great day, we got along very well and I was surprised to learn many new things about her. Normally I feel comfortable using the priors I have about people, simply because often they seem to be fairly accurate, but with her many of my priors were just completely off. A few weeks later I went to visit her for a weekend at her place. We had a great time again! We went for a bicycle tour and did some hiking the next day. I think I even learned to appreciate spending time outdoors a little while doing stuff with her. Even though I got a nice sunburn both the times I saw her. For those who don’t know me, people envy me for my colorful tattoos on my oh-so-pale skin. I’m really not into sun usually.

So I was hooked. Even though I had put her out of my mind, there wasn’t a lot but her to find in there for the past few weeks. I really wanted to see her again before my three month internship, but due to several issues, that wasn’t going to happen. However, our conversations were just casual smalltalk, after it was clear I wouldn’t see her anymore, I decided to simply write her how I feel. I know, not the most elegant solution, but she took it very well. After talking about it though, it was clear that she doesn’t share my feelings. One free ticket to the friendzone.

So I tried, and I lost some. The first day I was totally okay with the situation. I was surprised. I know myself and I didn’t expect me to be so cool with it. I even wondered whether my feelings could be true if I wasn’t at all sad. But now, another two days later, it is really hitting me. I’m leaving for the US in four days, I have lots of stuff to prepare before I can go and I don’t really feel like doing anything. I hope that the excitement of new people, new country, new office will overtake my mind and distract me from the whole situation. We agreed to maybe meet as friends when I get back. I really hope we can make that work since she simply is a very awesome person. But if I learned anything form the past events, my feelings can pop up out of nowhere given the right trigger. I guess it will be exciting times.

P.S. If you don’t like posts about my vegan and depressed life and expect scientific stuff instead, feel free to leave. The tutorials are the exception :D

… and you lose some

A different curse of dimensionality

High-dimensional space is  not only empty, it is also really painful to think about!

I went through three years of my CS studies without ever having an actual concept of the curse of dimensionality. I might have heard it here or there, but it never stayed in my mind for long. It wasn’t until I did the machine learning course, taught by my current boss and eventually even TA’d by me, that I had a grasp of what the curse of dimensionality might really mean. The good part is, the best solution to deal with it is to simply ignore that it exists and happily continue sciencing! A few semesters later I did a course on data mining, where people seemed to spend a lot more time worrying about high dimensional data and the problems that occur. At this point it became clear to me that this really must be an issue. Then finally, after finishing my masters and doing about two years of my PhD studies, I went to a PhD defense of a student from the data mining chair. Here it hit me! When these people talked about “high dimensional data” they considered 8D and above. I was highly amused since my machine, while I was sitting in the talk, was computing a k-means clustering in 128D. Something that seemed to work without any issues.

Over time, I guess I developed a slightly more subtle feeling for the curse of dimensionality and I guess it is more about how empty space becomes and how weird certain things seem to behave. However, I never gave too much thought to it, because to be fair, my clustering was still working.

Fast-forward to now, my colleague and me are working on an exciting new project and we had to discuss points on the surface of a hypersphere in n-dimensional space. He kept insisting that my intuitions about 3D spheres do not generalize to n-dimensional hyperspheres. Oh boy, he was right! Initially his comments didn’t really change my thinking, not because I didn’t believe him (he is usually right), but since I just couldn’t imagine what he was talking about. He suggested to read this post which to be honest didn’t do a lot for me, but I would rather recommend this video. I know it starts really simple, but if you stick through it you might really get a better feeling for hyperspheres! After all this reading, thinking and discussing, the curse of dimensionality became something far bigger than the theoretical problem. To me the fact that it is super hard to think in n-dimensional space is an additional, possibly even worse, curse of dimensionality!

Let’s consider a little example. Two days ago I had to reason about distances in n-dimensional space. Imagine a unit hypersphere with many points on the surface. My task is to pick a point on the surface and push all other points on the surface further away from this point than a given margin r. In other words, you place another hypersphere with radius r centered at the point and you push any other point until it is outside of this hypersphere. Here is an awesome illustration I made for this problem in 2D. (Why did I ever give my drawing tablet to my father?)

2d_spheres

The green points are fine, but the red points within the smaller circle have to be pushed out. “Why are you doing this” you ask? None of your business! I’m just telling you how messed up this whole thing is. Our initial intuition was, if you use a margin of 1, you have to push points super far over the surface of the sphere. If you consider the illustration above and set r to 1, you will indeed see you have to push it quite a bit over the surface of the unit circle. But how far? Does this change with n dimensions?

Before I tell you my solution to finding my answer, eventually I  had to agree with my colleague, my hypersphere intuition was garbage. However, as it turns out, his was as well. I thought of this for a long time and figured the surface of the unit hypersphere inside the other hypersphere becomes smaller and smaller with growing dimensions (thinking always is better on the toilet!). BUT, I had no way to be sure. I googled how to compute the hypersphere intersection, but at the time couldn’t find anything obvious. So what can one do? My idea: put many points uniformly on a surface, thus approximating the surface of the sphere and then check which percentage of points lie within the other hypersphere. Should be straight forward, but then you get to the point where you want to evenly sample points on an n-dimensional hypersphere. Not trivial, but also not impossible! Naively one could just sample points between -1 and 1 in each dimension and normalize the n-dimensional vector. Sadly this is wrong. Since in high-dimensional space, most pace tend to be in the corners of a hypercube, you would sample more points there and thus through normalization you would project “blobs of points” on your sphere. Shit… But there is an obvious solution. You just reject every sample that is outside of the unit hypersphere and then normalize. Easy!

import numpy as np

def sample_nd_sphere(n, size):
    samples = np.zeros((size, n))
    i = 0
    while i < size:
        sample = np.random.uniform(-1, 1, size=n)
        sample_norm = np.linalg.norm(sample);
        if  sample_norm <=1:
            samples[i] = sample/sample_norm
            i+=1
            
    return samples

While this is correct, the curse of dimensionality strikes again, and this time it strikes really hard. Getting 100 samples in 3 dimensions? Easy 8ms. In 12? Borderline, but okay within 2 seconds. But 13 dimensions this code already took more than 5 seconds and I was aiming for 128 dimensions and more than 100 samples. Urgh…!

So what does wolfram alpha say, someone must have done this right!? Apparently even in 3D it’s easy to mess up! But hey, in 1972 someone developed a “simple” way to pick points in 4D. Luckily wolfram alpha also discussed a way to easily sample in n dimensions . Actually it is embarrassingly simple, you just sample every dimension from a normal distribution and normalize the vector to the desired radius. This does feel obvious to me, but if you want to know why, well I don’t know, good luck figuring it out. So we get this:

import numpy as np

def sample_nd_sphere(n, size):
    samples = np.random.normal(size = (size,n))
    l = np.linalg.norm(samples, axis=1)
    samples = samples/l[...,None]

    return samples

Much faster! A million 128-dimension samples in just over 6 seconds.

So now the intersection part is easy:

import numpy as np

def percentage_inside_nd_sphere_range(radius, samples, dims):
    res = []
    for i in dims:
        test = sample_nd_sphere(i, samples)
        inside = 0
        total = 0
        for j in range(0, samples):
            current = test[j]
            dist = np.sqrt(np.sum(
                (test - np.repeat(current[None], samples, 0))**2
                , axis=1)) < radius
            inside += np.sum(dist)
            total += samples
        res.append(100.0*inside/total)
    return res

I take a point, place a hypersphere with radius r around it and count points within the hypersphere and finally average the statistics over every point. To generate my data I used 2000 points and only placed a hypersphere on every tenth point to speed up the computations a little. Nevertheless if you run this several times, for different radii and for different dimensionalities you get a pretty cool plot!

sphere intersection.png

On the vertical axis you see the percentage of points in the intersection, which in this case is a proxy for the percentage of the surface inside the hypersphere and on the horizontal axis the log of the dimensionality (0-128). Every line represent a specific radius of the hypersphere and thus in my case the margin I want to achieve. As can be seen a “1D-sphere” behaves a bit odd, but it is not really a sphere anyways. But if you look at r=1, you can indeed see that with an increasing dimensionality, the surface in the hypersphere intersection becomes very small. In fact many radii seem to show this behavior until there is a certain tipping point where exactly the opposite is true. For larger radii the hypersphere will soon almost enclose the complete unit hypersphere!

My colleagues initial intuition was the opposite with respect to small radii and increasing dimensionality. However, he does get credit for pointing out the tipping point. For some reason it was completely obvious to him that this is the case for r=sqrt(2). The plot confirms this, even though the line is not perfectly straight due to sampling, it does in fact stick very well to 50%. He didn’t want to discuss the details and to be honest at this point I don’t feel like proving it either. The plot clearly agrees with him on this matter! He also thinks that using bright colors on a black background makes me look like a script-kiddy x)

So what have I learned? The curse of dimensionality now has one more interpretation for me. I get serious headaches when thinking about this too long, my colleague has a bad taste in colors and writing a blog post about a trivial thing like this takes way longer than expected, albeit not as long as it took my colleague and me to discuss hyperspheres in high dimensional space in the past week. A rather spiky and smooth issue as it turns out!

A different curse of dimensionality

Happy Fucking New Year

Hello everyone,

I hope your new year started out just as great as mine! Just towards the end of last year, I took a shitload of holidays so that I can seriously relax  around the Christmas period. I was looking forward to it a lot, relax a little, maybe visit some places and people, finally play some FFXV! Everything was looking seriously dandy. But then my colleague came to me and asked me if I wanted to maybe do an internship at some big company in the US. I know my insecure and change-hating self, but it also sounded like a great opportunity! I accepted his offer to get me hooked up into the recruiting process and realized I would have to study a lot for the interview.

Fast-forward a few weeks and today is the last day of my holiday. Obviously I am now a way better coder and I feel very well prepared for the interview. I found a really nice balance between studying and enjoying my free time and I am coming out of the vacation relaxed and a better person. At least that is what I was hoping for. Just that well… it’s not true at all. I barely studied anything, I’m still a shit coder, I’m more nervous than ever and obviously I didn’t relax either because “I should have been studying all that time”. The only thing I did do was extensive reddit reading. It’s really depressing when you open reddit in the morning (aka around two in the afternoon) and all links are still purple because you scrolled through reddit until three last night. I also watched Orphan Black. Forty episodes are over way too fast! It was a decent show, but nothing too overwhelming.

I did learn some other things though. First of all, I seem to have a passion for Berliner Luft, a mint liquor most people seem to despise vigorously. Secondly, you can drink enough alcohol on one evening, so that you puke in the evening and it’ll again be the first thing you do the next morning. (This involved about 0.5l-0.6l Luft and 3 Gin tonics.) And finally, resulting from the previous life lesson, I learned that I want to stop drinking alcohol, at least for a while. This I have profoundly learned so many times now and I always forget about it approximately 3 days later. I even wrote myself a drunk mail after the office Christmas party where I got seriously hammered. But, just two days ago I drank a beer during dinner again. Since I really regretted that decision though, I did try to whole socializing without alcohol thing directly afterwards. Instead of drinking more beers in the bar, I switched to peppermint tea, a good Luft substitute! I did a period of like 6 weeks without alcohol somewhere last year and it was pretty darn sweet. So I’m really going to give this a shot again. (How ironic, … “give it a shot again” x).) Maybe this will be my resolution, instead of the other resolution of masturbating less. Apparently that is what drunk me said during the new year’s eve celebration. I partied with friends of a friend, who seem a bit more conservative and whom I barely know. Obviously, she was less than thrilled about this. Even though I now still have 5 bottles of Luft left, it feels like a great plan though. Especially since going back to this reddit classic, always hits me right in the feels man!

Well that is my current life status. I have to practice the piano, since I finally started lessons and I really suck at it, I have to study for the interview later this week, and I have to review a paper for Friday. Also I have to work again next week and somehow I am anticipating a lot of stuff to piled up on my todo list by now. Meanwhile, it feels that doing nothing on an average day is the right thing to do. On a positive note, …

There is no positive note :D Happy 2017, maybe it’ll be better than 2016.

Happy Fucking New Year

I feel cheated!

It’s been a while since I last posted anything on here. But today I really felt like blogging. I guess, to be fair, I didn’t post anything earlier simply because nothing all that vegan or depressing happened. Well… some people involved in my life might disagree with respect to certain events. But my side of the story was always pretty positive, or at the least interesting. I’m going to Berlin soon, two nice long weeks of doing nothing but eating, museums, meeting some nice people and drinking. Right! I did stop drinking for a while. It was pretty interesting. I felt somewhat non-depressed, while obviously still being vegan. I even got my life back together and went to work on decent times. Who would have ever guessed that was possible?

Yesterday I went to an art exhibit. I was super stoked since I saw some of the guys art a week earlier and I couldn’t stop thinking about it. I ended up buying my first real piece of art! Wooh super happy! At least my German part is, my Dutch part still thinks it was a waste of money. I strolled around the city for some hours afterwards, listening to some nice music. It was the best weather and I discovered that the city I’ve been living in, for more than three years now, has a seriously nice neighborhood. I wonder why I have been living in this place for so long when there are such awesome houses just across the city?!

So today, a new man, with art in his pocket, I felt super hipster and had to write something. At some point I was bored of work, so I went to the store to buy a six-pack of beer and two bottles of federweisser. I figured I could get wasted, listen to music and blog about something, but I think this is just really shitty tasting grape juice without alcohol x). So the getting wasted part might not work out so well. But as least I can seem sophisticated while playing the piano and drinking “wine”. That is what I am going to do now.

Bye.

I feel cheated!

Installing MayaVi for Python 3.5 in a virtual env

Hi everyone,

this might not be my typical post. But if you have a problem with that, well… fuck you. A few days back I installed MayaVi in a virtual environment that is running Python 3.5 and configured it to run from my Jupyter notebooks. This was a huge pain, but I managed to get it to work (major depression obtained during that process). Of course in the end I had no idea what made it work, but I was happy. Fast forward to today and I need to redo this since I decided to recreate my virtual env on my new machine. A GREAT (semi-maintained) guide of how to set up such a virtual env can be found here here. Since I am doing this again, I decided to document it this time to maybe save you the depression of figuring this whole damn thing out. All in all it shouldn’t take more than a few hours.

Prelimary stuff

Big warning: yes I studied computer science, but I am, as with most things in life, just very mediocre. I will find my way around, call things by the wrong name and eventually get stuff to work. So will the following be the cleanest possible solution? Probably not. There are some dirty hacks, but in the end MayaVi runs. The only reason I am writing this, is that I found tons of different blog posts all telling you how to do this, from somewhere between 2000 and 2004. Somewhat outdated :D If anybody just saves a little of time reading this, then it was worth it. Likely, it will be a future me doing this again at some point.

Here we will be aiming to installing MayaVi from PyPI, but with a properly working backend that we built ourselves. I’m installing this on Ubuntu 14.04 with quite some packages pre-installed and I’m using a horribly configured zsh. So some stuff might need to be slightly changed if you are using another shell or Linux version. I guess, if you are messing with this kind of stuff though, you ought to be able to fix your things. And obviously these guides only seem to have a rather limited lifespan. The moment stuff changes, everything could break. If you are reading this in 2020, just accept that you will to figure it out yourself. From here on out I will assume that you have setup stuff as described in the above mentioned guide. But it pretty much just boils down to a local gimmick of your global root with a usr, lib, include etc. folder located at ~/inst/. Furthermore, we are talking about how to do it for a virtual env. So let’s say I will assume your virtual env root is located under~/VIRT_ENV/. Change these two things throughout the following commands to your paths.

First shot at installing MayaVi!

So in theory installing MayaVi should be as easy as:

pip install mayavi

It will however present you with the following Error:

 ImportError: No module named 'vtk'

Now this can have two reasons, one might be that everything should work, but you just don’t use the site-packages in your virtual environment, or your (possibly) installed vtk doesn’t have Python 3 bindings. If it doesn’t present you with this error, be happy and go live your life. Or maybe you should check if you are actually using Python 3.

VTK

So let’s build VTK ourselves and install it locally so that Python can use it.

cd ~/inst/src
git clone https://github.com/Kitware/VTK.git
mkdir build-VTK
cd build-VTK
ccmake -D CMAKE_BUILD_TYPE=Release \
       -D CMAKE_INSTALL_PREFIX=~/inst \
       -D VTK_WRAP_PYTHON=ON \
       -D VTK_PYTHON_VERSION=3 \
       -D VTK_INSTALL_PYTHON_MODULE_DIR=~/VIRT_ENV/lib/python3.5/site-packages \
       -D PYTHON_EXECUTABLE=~/VIRT_ENV/bin/python3.5 \
       ../VTK

Hit c several times to configure and then g to generate then finish with a make and a make install. The make will download a lot of data from a somewhat slow server as it seems (~200MB) and the building also takes quite a while here. Go make yourself a vegan sandwich and come back afterwards. This will install everything into your local ~/inst folder. The problem is however, that Python expects the library file location to be in your path. If you like me don’t have your local installation folder in your path and library path, then this will cause problems. There are several solutions:

  1. You can add them to the correct paths in your shell config file (such as .bashrc or .zshrc). This will fix it, however it will affect everything you do, not only when you do something with your virtual env.
  2. You can change the above cmake command to install it purely to the virtual env. This will however not allow you to use it from anywhere else.
  3. You make some links between the library files of VTK in your local install folder and the place where they are searched for in when you import vtk.

I’m going for the last option. So let’s create the links with the following command:

for x in ~/inst/lib/libvtk*.so.1; do ln -s $x ${x/~\/inst/~\/VIRT_ENV}; done

Cool kids would now run vtk tests, however, I don’t want to do that. We should however make sure that we can at least import VTK! With your virtual env activated, run:

python -c 'import vtk; print(vtk.VTK_VERSION)'

This should print out something like 7.1.0. Check that the version you get is actually the one you just built yourself and not some old system version.

Second shot at installing MayaVi!

So with VTK fixed, let’s try again.

pip install mayavi

Success! At least for me this now works. Are we done. I don’t think so just yet. Open up a notebook or iPython console and run the following code:

import numpy as np
from mayavi import mlab

t = np.linspace(0, 4 * np.pi, 50)
x = np.sin(2 * t)
y = np.cos(t)
z = np.cos(2 * t)
s = 1 + np.sin(t)

mlab.points3d(x, y, z, s)

This will present you with another error, key of which is:

ImportError: Could not import backend for traits

Now after playing around with all of this stuff. I still couldn’t be bothered to read up on what traits exactly is or does, but I know we need it to run MayaVi. Traits can use two kinds of gui backends, wxPython or PyQt. Since wxPython seems pretty dead and doesn’t support newer Python versions, we have to go with PyQt. PyQt is just a wrapper around Qt and it has two (well kind of three) versions. There is PyQt4, PyQt5 and the kind of third version PySide. All of these could, in theory, be used as a backend, but traits doesn’t support PyQt5 (which would directly be available from PyPI) and PySide doesn’t work for Python 3.5 (but is also in PyPI). So we are left with PyQt4 as our only option.

PyQt4

So how do we get this? Yes, we have to build it ourselves. Ironically, even though there is a PyQt4 and PyQt5, PyQt4 will wrap either Qt4 or Qt5, I’m not sure who picked the naming schemes here. I was very confused when it started doing that. Now my system has a bunch of Qt5 libraries preinstalled and I can globally install certain libraries myself. If you don’t have sudo rights on your machine and you are missing relevant Qt4/5 libraries, you will have to install that yourself too. I didn’t do that, so you venture there yourself and fall of the edge of the world. Bye.

Now you can get a fairly good guide of how to install PyQt4 here. Apparently before installing PyQt4, you will fill have to install and build SIP. I don’t know what that is and frankly I don’t care. Let’s build it.

SIP

They only have mercurial repo, stuff I no can do, and a sourceforge link, durpadurp. So go here and get the latest version and extract it in your `~/inst/src’ folder. Now let’s build it, which is rather straight forward. From your activated virtual env do.

cd ~/inst/src/sip-4.18
python configure.py
make
make install

Accept the terms of the license by typing yes (no y won’t suffice). This will install sip into your virtual env. Since it is easy to reproduce for every new virtual env, I will not bother changing paths to try and install it in the ~/inst folder.

Actuall PyQt4 installation

So, almost there! You have to download another archive from sourceforge. Unzip it next to your SIP folder and then run the following:

cd ~/inst/src/PyQt-x11-gpl-4.11.4
python configure-ng.py

Note: the configure-ng.py instead of the configure.py. They say this is newer and better and fancier, let’s just believe them. Now you have to pay close attention to what happens. At some point the configuration says something like:

These PyQt4 modules will be built: QtCore, QtGui, QtNetwork, QtXml, QtOpenGL,
QtSql, QtTest, QtDBus.

This is the list of Qt libraries that will actually be wrapped by PyQt4. I never actually installed Qt5, however, apparently some of the software I use depends on Qt5, thus parts of the libraries have been installed globally. In order for traits and thus in turn MayaVi to work, your PyQt4 needs to wrap at least QtCore, QtGui and QtSvg. At least these are the hard dependencies I have found so far. As you can see my PyQt4 configuration isn’t planning to wrap QtSvg. It took me quite some time to figure this out and then some more time to figure out why. I simply didn’t have it installed. Here is the part where I pity you if you don’t have sudo rights, because have fun installing Qt5 from source. (Although it might not even be such a pain, who knows!) Instead I do:

sudo apt-get install libqt5svg5-dev

Now if we run the configuration script again, you should now notices that the QtSvg module will be built! Yay! So continue by running the following, as always while having your virtual env activated:

make
make install

This again installs it in your virtual env. And this concludes installing stuff!

Testing MayaVi!

We should now be able to test MayaVi again! OMG! Such Excite! For vanilla Python, MayaVi should now be working. There is one more thing that needs to be done if you want to use it with iPython or in a Jupyter notebook. Every time you start either of these you need to do the following before you call something: %gui qt. This will tell iPython to use qt as a gui backend. Maybe you can also set this in some config file, but that is up to you to find out. If you run the above testing block with this command prepended, you should see some window popping up with some 3D balls in a spiral. It’s important that you can drag stuff around with your mouse, without the window freezing. If this is not the case then something is still wrong. So to test it, activate your virtual env and run the following:

ipython
%gui qt
import numpy as np
from mayavi import mlab

t = np.linspace(0, 4 * np.pi, 50)
x = np.sin(2 * t)
y = np.cos(t)
z = np.cos(2 * t)
s = 1 + np.sin(t)

mlab.points3d(x, y, z, s)

If everything works well, that’s it. If not, too bad :( But it should be working, so now you can use MayaVi in whatever way you want to. Congratulations and it case this guide helped, you’re fucking welcome, next time you buy lunch think of this moment and eat something without animal cruelty.

Installing MayaVi for Python 3.5 in a virtual env

Deutsche Bahn, Magic, and Brothels

In before why such a posting break, fuck you!

To give you the global frame in which this story is set: I drove the same route from Düsseldorf to my place, very late at night, twice in the past two days. Due to some construction works on the rails a fifteen minute train drive segment (of the complete one hour fifteen) is boosted to an enjoyable full hour bus drive. That is, if there is a bus.

Day 1, Friday:
The days before were very interesting. I spent a great time in Stockholm on a conference and  met some super nice people. Really refreshing, although also very depressing for other reasons I will not disclose. The way back home was actually really okay apart from the additional time spent traveling. However, for no specific reason whatsoever, I carried four overly ripe bananas and the slowly rotting top part of a pineapple in my backpack, all the way from Stockholm. You might ask why, but… let’s say I had my reasons. Two of the bananas exploded in my backpack and together with the sweet and foul smell of the pineapple, my backpack now smells like an old smoothie. At least the slowly fermenting package of tofu in my bag didn’t explode. I’m actually really surprised nobody gave a shit about this stuff at the security gate, they only cared about the bottle of water that apparently was hidden deep under my fruit salad. Anyway, after planting the pineapple in a pot I fell asleep watching series, a very exciting night!

Day 2, Saturday:
On Saturday I went to the Japan-Day in Düsseldorf, you know, lots of cosplay, people with an astonishing absence of clothes and huge fireworks in the evening. An event I haven’t missed in the past 6 years. In fact I almost missed it this time, since my original flight from Stockholm was planned for Sunday. But hey, I just spent another 150 euros to get back in time! It was fun, although the fact that people thought my new tattoo is from Digimon was pretty depressing. Kids these days are so uneducated! Also I learned that next year I should wear a pedobear costume to disguise my age. After the fireworks there was the usual rush back to the train station. My friend and me even got a seat in the train, everything went better than expected and my scheduled arrival, including the stupid bus, was around two in the morning. There was a little problem though, Deutsche Bahn only booked the buses until the 21th of May. However, at one in the morning it was the 22nd already, you might see the issue? The train we arrived in apparently was staying in the station until the next morning, so some people started talking to the personnel in the train. To be exact they started slamming the windows so hard until someone finally responded. They refused to do anything and claimed they couldn’t give us Taxi coupons since they didn’t have any. About 30 minutes later of talking and waiting, the lady from the train apparently managed to pull someones head from their ass in some high up place at Deutsche Bahn and she got the OK to get us taxis. Then I saw an act of magic! She made taxi coupons appear. At least I guess this is what must have happened, considering first she had none and then I saw them, right there in front of my eyes! So a while later I was sitting in a taxi with another five people. The taxi driver was a funny guy, he told us about his experience with hookers in several cities and how awesome the brothel in Cologne is. Stuff you learn late at night in a taxi. He also suggested that we drive to the local brothel and party for the night, although he was a little concerned that they might want to pimp out the two girls we had in the taxi if we take them there too. One of which apparently lives directly across the street, what a small world!

Thank you Deutsche Bahn, for even more sleep deprivation than I already had due to getting wasted every night in Stockholm! Now it’s time for “breakfast” at a quarter past five. I really suck at this whole healthy living thing.

Deutsche Bahn, Magic, and Brothels

Today was an interesting day!

This morning I got up, full of motivation to start into the project integration week. I went to get some nice sweet vegan breakfast, payed by the university as it is a business trip. :D Everything went fine until I actually started testing the stuff I merged yesterday night. Soon I realized nothing was working anymore. I talk to the guy who wrote the code. He tried it on his laptop with my data. Everything works fine… These are the kind of “fuck my life” moments you don’t really want to encounter. The first day of the integration meeting and your laptop subtly starts hinting “Fuck you, dude!”. So an hour of debugging and ruling out what could be going wrong later and I didn’t get anywhere. Soon I was starting to think it might even be the general ubuntu updates I ran the night before. This was bugging me for a long time now based on some conflict fuck-up, but I fixed that the night before, Yay for me! I talked to some more people and found a guy who also updates regularly. We try it on his machine, doesn’t work either! Soon we realize that some update really broke something, changing all the prerecorded data to a useless state. Mind you we are talking about hours of work here, in areas with very limited access. We test some more and talk to our code-guru who pretty much wrote 90% of the code in the project. He soon has some ideas and tells my co-debugger, whom I accidentally pulled into the whole thing, to download some software from his bitbucket. So the guy pulls and already is starting to build. Then the guru says, “No wait, we need another github repo”. The guy gets that too and builds it. Several errors and the installation of some extra packages later, the next error pops up. The guru tells us something like “Now we really need to fuck this piece of shit up!” This guy is actually a professor, very funny guy! He tells the other guy to edit the make file. After learning that tabs and spaces are not the same in there, damn piece of shit make files, we just removed the -Werror flag. At this point I felt a little like I was watching a rape-scene. The girl goes  like, “No, I don’t want that!” and the rapist just goes like “Sssssshhhh, it’s okay.”. The code still didn’t build, but we didn’t need the last part apparently. Then we got to compile his code around the semi-build other code and with this we realized that these drivers have always been setting a flag the wrong way. So far nobody cared about this flag though. It turns out there was a bug report about this in early 2013 and somebody finally fixed it a couple of months back. So by updating this system, I activated the sleeper-bug. Luckily we could salvage our data, but we pretty much lost a day to the whole thing.

At least I got to visit my favorite restaurant in Bonn in the evening and eat some pizza. Now I’m tired. I hope you enjoyed my rape story. Good night.

Today was an interesting day!

A long morning and a late night snack

After postponing it for like five weeks, I finally got up early to go to the dermatologist. Being anywhere at eight in the morning is pure fucking torture! Now the shitty thing with dermatologists is that they also serve as beauty-specialists for ugly-ass old ladies that want to beatify their skin a little. Honestly, I think they should spend their time and money on polishing their personalities instead, but that is another matter. The result of this whole thing: the earliest possible scheduled appointment is at least three months out. To the rescue comes this little doctor’s office, that has open consultation-hours each morning. The only thing you need to do is wait a little. Well a lot, they admit it, but I had never thought it could have been four hours and twenty minutes! That’s more than half a day of work, while only reading a single paper. Obviously, I was less than thrilled!

The day was as unproductive as hell and I didn’t feel like working. I felt pretty shitty the past two days. As it turns out, you should cook chickpeas between one and three hours. Otherwise they will be hard to digest. Obviously I didn’t, which also means I will not be eating chickpeas for quite some time. After sitting through the day, reading some more papers and staring at stale training plots, my colleagues insisted on watching spectre. I told them I wouldn’t join until I had watched the three previous movies. I did want to join for food, but my chickpead stomach didn’t like the idea. Not spending Friday nights with my colleagues is a very weird thing :-/ They keep complaining that they are not on my “friend-list”, but I’ve grown seriously fond of these people.

So instead of watching spectre, I watched skyfall. I had some food, nothing fancy and eventually got bored and couldn’t sleep yet. Then, suddenly, I got super hungry again. I got up and fried me some potatoes, I think that is the first time that I have prepared potatoes for myself. Simple recipe, simple nice taste. Here it goes, this time it really wasn’t that bad!

  • Some, no a lot of, oil for frying
  • 8 little potatoes
  • 2 little onions
  • A clove of garlic
  • Italian herbs, pepper and salt for flavoring.

Wash the potatoes and onions and dice the potatoes in super fine slices. This took some time as I didn’t have a grater, and I actually had to cut them with a knife. Heat up the oil and fry your potatoes, you will stack several layers of potatoes in an average frying pan, but stir from time to time for an even frying result. Cut the onions in the same way and add them, keep stirring. Eventually turn down the heat pretty low and add the diced garlic clove and the herbs, fresh pepper and salt. Now just let it simmer for some time to make sure everything is well done. Me and my stomach are currently pretty tired of this undercooked shit! This actually turned out to be pretty decent food. I probably used a little too much fat, but apart from that it was simple tasty food. I even took a picture this time. As you can see, I was too lazy to get out my DSLR, so deal with the smartphone camera. :p

IMG_20151114_004822

A long morning and a late night snack

More cooking, more fuckups!

So after yesterdays blazing success with the cooking trail, I decided to do more of it. On Wednesday the organic supermarket has a 10% discount for students. This is great, because hey, I really need to save money dude! I went there and got lots of fresh fancy stuff, so now I’m prepared for a lot of cooking in the next few days! And today I made chickpea-shizzle! Here is what you will need:

  • 500gr of dried chickpeas
  • 400gr of plain tofu
  • 2 small onions
  • A quarter of a small cabbage
  • Soy sauce
  • A clove of garlic
  • A little piece of ginger
  • A little piece of chilli
  • Vegetable broth powder
  • 1/2-1 teaspoon of cumin
  • 1/2-1 teaspoon of ground up coriander seeds
  • Salt
  • Pepper
  • Some oil for frying

So it’s all pretty straight forward, I wonder how it ended up so mweeeh again! You start out by putting the chickpeas in a big pot with hot water and cook the shit out of it. You should have put them in cold water for soaking yesterday night. Then while this starts cooking, you do the dishes, like you should have also done yesterday night, you lazy little bastard!

Once you are done and you have a clean pan, start dicing the tofu and onions in equally sizes little blocks and fry them in a big-ass pan. You will add everything into this pan, so make sure it’ll fit. Once the tofu and onion have a little color, soak it in soy sauce, add some salt and the vegetable broth powder, which is actually just a better kind of salt. Don’t ask me how much of all of this stuff. Try it out and learn how to fry tofu for fuck sake! This even I can do!

Lower the heat and let it sit a little while you chop a quarter out of your cabbage. Slice it into super fine stripes and add them to the tofu and onions. Keep stirring from time to time to make sure nothing burns, but let it sit there for long enough so the cabbage is actually well-cooked.

Start chopping up the clove of garlic, maybe you could do two and add as much of ginger and chilli as you want. Chop this all up together, like as small as you can. I’d say make it garlic, ginger and chilli atoms, but that would be stupid! We all know those don’t exist. :-/ When done, add it to the rest and stir it well so the flavor can soak into the rest.

Now if you fucked up the planning of this stuff like I did, you will notice that your chickpeas are far from done by this time. Maybe I should have told you before? Sorry! You should only leave the stuff to fry on very low heat until they are done! The good part: you can already clean up all utensils you used so far and don’t need any more. By the time you are done, I really hope that your chickpeas are too. In fact, I think mine still weren’t done, but I also didn’t want to wait any longer. Pour the chickpeas into a strainer and shake them a little to remove excess water. You don’t want to make everything all watery and shit. Now add them to the rest and mix it up nicely. Finish it off with some agave nectar, or whatever sweetness you want to add. (No honey you dipshit!) Also add the lemon juice, the cumin and the coriander. Finally finish it with salt and pepper until it tastes okayish, because that is all that it will do!

Congratulations, now you have enough of this stuff for the next three to four meals! Sorry about that. But after my last recipe, I think you shouldn’t have trusted me on this one either. This stuff is pretty filling and it will be dominated by chickpeas. I guess next time like 250gr of chickpeas will do to. Maybe, cooking the chickpeas with salt might also totally help the taste. The worst part is the fact that there appear to be little stones in the chickpeas, this will fuck up my teeth nicely.

I forgot to take a picture again, but I can tell you how it looks. It looks vegan and because it is all yellow, it looks pretty depressed. A perfect fit I guess.

More cooking, more fuckups!