My University Blog

Tags: English, university
Created on Sun, 06 Jan 2019

During year 3 at University on one of the courses we had to write a blog post every week. I have written a blog before (this one) but 3rd year at University of Glasgow is crazy busy - almost everyone has developed a depression, panic attacks, disorders and has become a goat. I have discovered my old University blog on the interwebs and copied it over to this new/old blog of mine.

Few things of note:

So here are the links to the posts:

It was quite fun remembering what 3rd year was like - it was an absolute hell and has been since then. I still have people complaining about it - it is way too much for a year given that the previous two years are relatively easy going. Add to that the fact that most people are searching for summer internships and start to get the scared feeling of "What the fuck am I going to do in real life" after ~14 years (all of your meaningful life) of education and being told what to do. It's very stressful but maybe it's because reality is quite stressful.

Bullsh8t, Episode #1 - Astrology

Tags: English, opinions
Created on Sat, 29 Sep 2018

This episode of bulls8t is sponsored by my own desire to limit some of the bullsh8t in the world

Horoscopes are the worst thing since the invention of God(s). The stupid idea that planets and stars somehow influence your day to day life is idiotic and should have died pretty much whenever it was conceived. Like most of humanity. Or at least ever since we know that it doesn't influence your life. Which in all practical terms has been forever.

Hey babeee, Which sign are you?

Astrology, a.k.a. horoscopes, a.k.a. these things in the websites you read "just for fun but you actually don't really believe" (but deep down you actually do believe them because you think there is a grand scheme of things, but deeper, deeper down you know you don't know anything) revolves around an idea called a sign. Signs are twelve words that sound funny in English so that's why we stick with much hipster Latin.

achzually

ACKCHYUALLY. Signs are constellations in the sky. Constellations are what our pattern matching machines in our heads try to invent whenever they look at pretty much anything. Do an experiment if you don't believe me.

Spill some salt on the table. Now lock your head on the table and watch that for 30 days. In less than 5 minutes you will start seeing triangles and rectangles, also pentagons, hexagons and septagons.

Octagons? Possible.

Nonagons? Sure.

How about shapes with 10 sides. Maybe.

11 sides? I can see that happening.

12 sides? It is entirely possible.

The point is, you will see anything you want to see. And when you are the night shift at some old point in the past and have to be under a table of distant salt (also known as glowing balls of hydrogen and helium) you start seeing shapes. Wanna see how Aries looks like? Well, take a look at this magnificient ram:

it's alive!

Most of them constellations are like this. If you go out and look UP rather than at your glowing rectangle of light in your hand, you will see that. Well, no, actually you will see this if you also go somewhere nice and clean like a mountain, not in the dust- and light- poluted cities.

Man, we have screwed up these cities.

Also if there are no white water vapour in the air also known as tobacco smoke that smokers keep on saying "itz nize and calmz ya dawn man". Fuck you.

To help you in your quests, sometimes the civilization hires large laser pointers, shoot them up in the stratosphere and draw lines for you to imagine. Just ask you nearest flat-earther to tell you when and you will see this:

it's alive!

So yeah, somehow someone saw a ram there. Yeah.

Moving on. Now why Aries is special collection of dots? Because from our very special point of view (the Earth) the Sun appears to pass through these constellations as the year goes on. And wherever the Sun has been when you were born in relation to other stars that's what sign you are. That's it. Now I took a trip to space, hired a bunch of lasers and satelites to draw the lines just to show you this photo:

it's alive!

You are welcome.

The 4 Lies THEY have been feeding us! You won't believe number 2!!

No, I didn't go to space. Obviously. This "photo" is taken in the future, in May of 2019 (or the past depending on when you are reading this crap). And I sure won't use my time machine just for a shity blog post. But that's just the small lie.

The real lie is that the Earth is flat.

But another lie is that if you paid enough attention, May of 2019?! But Aries is in March/April. Then why is the Sun in the constellation in May?

And are there only 12 constellations through which the Sun passes?

And who cares - I mean, if you are reading this, you probably know the answers. People who believe in zodiac crap generally don't read. Well, they do read but only their horoscopes. And facebook posts. But facebook I hear is not cool anymore because it indeed requires reading. Now the hype is in Instafeces where you don't need to read - just look at photos of the Magellanic clouds.

Haha, but no, really, you just look at pictures of the concerning climate change graphs.

Haha, but no seriously you look at pictures of your mom. Haha but she is so fat that, eh... whatever.

Ok, but seriously - there are 13 constellations, and they are not given equal rights. Like not at all, it's worse than Attack helicopter gender and the rest.

fixd that for ya

Also, 13 is unlucky and people are superstitious so they cut down the Snake bearer Ophiuchus which is between Scorpio and Sagitarius because ain't nobody wants to be a Snake bearer. And also dates defer because the Earth wobbles like a coin on a table (get it, cause it's flat).

Do you want to see what Aries looks like from Betelgeuse, a star far away but still in our galaxy? Here it is:

still magnificient tho

You see it now? Great!

So... what I was trying to say is...

Astrology is full of Tauri excrements. Like seriously full of bullsh8t. If I hear anybody talking that they have read that today it's gonna be a lucky day because they are Pisces, I go away. More than I go away if someone is smoking and when someone is smoking it is actually burning my lungs.

If somebody asks me which sign I am, I tell her she is an idiot (see, gender equality, I use "she" when it's relevant) and I don't waste my time with her. I prefer to waste my time by watching and recording meteors which is another useless thing but oh so much better than listening about horoscopes.

Facebook (and the rest) - wait a minute - this way is wrong!

Tags: English, technology, opinions
Created on Thu, 19 Jul 2018

This is not the way we wanted computers to work. We don't want people addicted to their phones all the time, looking like zombies, internally feeling depressed and anxious and always trying to outcompete everybody in the world; trying to show off to get a few more likes, to get a few more comments. We don't want this poisonous competition of individuals for meaningless virtual points. And all the while these same people are being exploited by Facebook to click on things so that advertisers can show them ads to things they probably don't even want. We don't want people reading shallow automatically generated articles of confirmation bias, which are being promoted by Facebook to get even more clicks for more ads for more things you don't want.

We wanted to connect with the people we care about. It's our intrinsic desire in this more and more isolated society. We wanted to know what is going on in the lives of the people we cared about but not to compete with them in this ugly jelaous way. When I see a real friend of mine going on vacation - I like it, I feel good he feels good. But when I see it in a person I barely know - I see it as a showoff.

What we got is connection with companies. We got hundreds of messaging apps, photo apps and paradoxically - it's making it harder to connect with people. People use something different for different reasons and it's impossible to message inbetween apps like it is possible to send SMS to people on different mobile networks.

Facebook seems like a behemot, seems like this huge company that is here to stay. It has done wrong many times, it has changed its algorithms to promote biased content to keep you with interacting with the site, it has created walled gardens, it is ruled by an asshole who has said privacy is not expected but he keeps a tape on his camera. It had broken promises and apologized and broke promises again. It has Instagram and Whatsapp and many people don't even know it - so if you want to escape, it is there to capture you again.

It is not how we wanted our society to work. I don't think Steve Jobs wanted this when he and the rest of Apple envisioned the smart phone. I don't think he would be happy to see Apple has worked a few years with it's best engineers on hand to create animated emojis. It is not how we wanted our computing to work.

We want to be able to learn new skills, to create things and express ourselves, to connect with people and keep the important ones close to us. That's what fundamentally technology should be about.

Build a memory graph in linux terminal

Tags: English, technology, hacks
Created on Wed, 11 Jul 2018

I was searching for a terminal based graph of usage of memory but I couldn't find one, so I built it using simple bash and python.

First create a directory called mem and enter it with cd mem

Then run the daemon part of the monitor:

while true; do free -m | head -2 | tail -1 | awk '{print $3}' > `date +'%Y-%m-%dT%H:%M:%S%z'`; sleep 1; done

To actually build the graph, use this:

watch -n1 'for f in `ls -r | head -30`; do num=`cat $f`; python -c "print(\"{} {}\".format(\"$f: $num\", \".\" * ($num/10)))"; done'

And the result is something like this:

2018-07-11T11:26:36+0000: 330 .................................
2018-07-11T11:26:35+0000: 316 ...............................
2018-07-11T11:26:34+0000: 285 ............................
2018-07-11T11:26:33+0000: 236 .......................
2018-07-11T11:26:32+0000: 235 .......................
2018-07-11T11:26:31+0000: 236 .......................
2018-07-11T11:26:30+0000: 236 .......................
2018-07-11T11:26:29+0000: 238 .......................
2018-07-11T11:26:28+0000: 236 .......................
2018-07-11T11:26:27+0000: 236 .......................
2018-07-11T11:26:26+0000: 240 ........................
2018-07-11T11:26:25+0000: 236 .......................
2018-07-11T11:26:24+0000: 236 .......................
2018-07-11T11:26:23+0000: 236 .......................
2018-07-11T11:26:22+0000: 239 .......................
2018-07-11T11:26:21+0000: 236 .......................
2018-07-11T11:26:20+0000: 343 ..................................
2018-07-11T11:26:19+0000: 330 .................................
2018-07-11T11:26:18+0000: 327 ................................
2018-07-11T11:26:17+0000: 313 ...............................
2018-07-11T11:26:16+0000: 287 ............................
2018-07-11T11:26:15+0000: 238 .......................
2018-07-11T11:26:14+0000: 236 .......................
2018-07-11T11:26:13+0000: 236 .......................
2018-07-11T11:26:12+0000: 237 .......................
2018-07-11T11:26:11+0000: 236 .......................
2018-07-11T11:26:10+0000: 236 .......................
2018-07-11T11:26:09+0000: 236 .......................
2018-07-11T11:26:08+0000: 240 ........................
2018-07-11T11:26:07+0000: 237 .......................

On the difficulty of trying again

Tags: English, essays, life
Created on Mon, 02 Jul 2018

Chess

I don't even know how I ended up here. Something - was it an article, or a video - but something prompted me to watch some comentary on the chess matches between AlphaZero vs Stockfish. AlphaZero is Google's/Alphabet's AI machine - both the software of deep learning and through their proprietary TPUs hardware. Stockfish is (was) the best chess computer program in the world. Now, ever since 1997 match between the then world champion Garry Kasparov and Deep Blue, playing chess against computers has been useless in terms of actually beating them.

It's of course because computers are not like people - once you create great software, you can copy it, distribute it and improve it - even if it's illegal or whatever, you can do it if you want to. Humans not so much - once a human dies the best way he can (so far) transfer the knowledge of his lifetime experience is through the slow, inneficient and incomplete multi-level interface of brain-words-mouth-air-ear-words-brain. Or similar path in writing. And errors occur on each interface - your thoughts and emotions are transcribed imperfectly with words, the brains on the two sides understand words in a different way and then transcribing them back into similar feelings is difficult. We call this empathy. Something like json.dumps(yaml.loads('{}')) - it may work perfectly sometimes but most of the time it's impossible to get the same message.

Through thousands of generations of painful trial and error we were able to invent science, engineering and machines that are now beating us in some areas. And as argued above, once computers are able to beat us, they will always be able to beat us - because they can copy their collective knowledge. If I have a child, there is no way to transfer all the human knowledge that has been acquired. A tiny fraction takes a lifetime. A tiny, tiny, tiny fraction. How tiny? Play a game - go and click on wikipedia's random article page. Do this a hundred times. Give yourself a point if you have even heard anything about the title. Give yourself two points if you know what the title means. Three if you can say anything other than the description. Five if you consider yourself knowing quite a bit about it. You may score 10-15 points if you are lucky. Generally, you would score around 5. And the amount of articles on wikipedia are still imaginable - in the English wikipedia it's around 5.5 million.

Okay, back on point - chess and AI. Even though it's now meaningless to play chess against computers, people still enjoy analyzing the games between people and machines and between machines themselves. It's an unsolved game - as in it's unknown whether there is a perfect strategy to always win as in much smaller games like Tic-Tac-Toe. And most probably we will never actually solve it in the mathematical way. The only thing which we can do is optimize solutions by trial and error. So far, the trial and error has been inspired by the human grandmasters and the experience that they have gathered through hundreds of years of playing chess, recording and analyzing the games. Through fine tuning parameters of the pieces values, converting chess positions into numbers of advantage for one side versus another, analyzing the possible moves on each move and iterating deeply through a almost brute force (but pruned brute force) search trees of min-max algorithm and doing that quickly on a fast hardware - we were able to beat humans. Computers don't feel emotions, don't get caught in the moment yada-yada.

AlphaZero is a new category.

Why? Well, for one, according to the paper AlphaZero had not had the advantages of these hundreds of years and collective - hundreds of thousands of years - of playing chess vs the grandmasters and fine tuned parameters and optimized search trees. But it had the advantage of playing versus different versions of itself for the equivalent of hundreds of thousands of human years.

Yup. It had only tabula rasa of the chess rules as you would teach a beginner. No "develop a strong center in the beginning", "castle early" not even "keep material advantage up". It was up to itself to figure that out. Basically the idea as I undrestand it now is this (I am still to enter the "Machine learning" thing, so I'm simplifying because I don't know more yet) - develop a basic understanding of the rules and a neural network that assigns weights - initially random - to decisions based on outcome of win/draw/lose in old fashioned code. Then copy yourself with a few slightly tweaked weights. And then play the two versions against each other a hundred times. The one that wins survives and saves these weights. A new copy is developed with slightly tweaked parameters and played against the winner. And so on for millions and millions of games until there is this one version which you actually want to present as a competition. Brute forced trial and error.

As I watched some of the interviews commenting on AlphaZero with the grandmasters of old - Gary Kasparov, Anatoly Karpov, Viswanathan Anand - they were quite amazed at the games the machine played, citing "alien" play. Of course it's alien, we haven't seen intelligence greater than human (so far). By definition, it's alien. And again remember - it played against not a mere mortal human, but the best computer program as of before. Sometimes it would completely sacrifice "common rules" like material advantage for positional, or play lines that the Stockfish would see as errors but later, Stockfish would reconciliate in it's analysis and see it as winning indeed. As a child, I remember being fascinated by chess and the chessmasters, I considered them with unhuman brains, able to think so much better than average Joe, that they see things which we can't see. Now I feel they are pretty much average Joe or me, looking at the machines in the same way.

The bigger picture

I feel curiosity and complete awe but more interestingly - resistance - when learning about these advancements. What I gather from this is that the best way for something to be the best in whatever it's doing is by continuous trial and error. Humans are not the best subjects at that. We feel pain when we lose. Sometimes the pain is too big to move on. Do computers feel that when you give them -1 point when they lose a game? "Don't be silly, computers don't feel!". And probably that's why they can learn so quickly and not "fall into depression". Or maybe, computer depressions are when a neural network goes so bad that instead of improving itself, it enters somehow a negative feedback cycle - is that even possible? I don't know, but I am curious to learn.

I went on a run after these videos and started thinking about the implications of this. Here it is - a machine trained for about 4 hours from scratch learned to beat the best of the best in a small domain like chess. It learned by continuous trial, tweak, play, lose, adapt, try again. It beat the "learn from history". It was able to "live" thousands of generations of human lives completely dedicated to chess. In four hours. Or ten - doesn't matter, in a very small amount of time compared to human lives. This is what exponential means. When you look at the great history of the Universe, life and human development (recently read Sapiens) - it's all an exponent. It took a very long time to develop single-celled life, then a very long-time to devleop multicellular life but then compared to that everything else is an explosion. Watch this video which is the development of the Universe squashed into 10 minutes. It takes until 1 minute until the end for multicellular life to appear, and then everything happens in the last minute - marine life, plants, trees, lizards, dinosaurs. Primates are in the last 2 seconds, humans - in a blip of the last second. Scale the whole human history into that 10 minute video, computers will be on the last bleep in the same way.

And then chess is the same way. Hundreds or thousands of years of play. Versus 4 hours of training of a machine.

The philosophy

It's difficult for humans to fail. It feels painful and if it happens too many times, you avoid failure.

But failure is the best way to learn. Think of it this way...

What if it wasn't millions of neural networks failures to discover chess. What if the neural networks could live your life a million times. Each time trying something a little different, not caring if it loses or dies sometimes. What would be your checkmate? What would be the best version of yourself if failing wasn't painful?

What if you anticipated pain but didn't care?

Humans avoid pain and seek pleasure. But what if you anticipated the pain, accept it as an iteration and knew that this is the best way to learn proven by millions of generations of a computer program.

Food for thought...