Posts

Book Review: Algorithms to Live By: The Computer Science of Human Decisions by Brian Christian and Tom Griffiths

Image
I liked the idea of the book form the first time I've seen the title and fortunately, it lives up to my expectations. It's not perfect, but it rekindled my curiosity towards math and algorithms. Bringing them to everyday problems makes them much more interesting.

The only thing that I'm missing in the book is the application of algorithms in business settings. For example, when I mentioned this book Mateusz K he has sent me a blog post of  Pieter Hintjens: Amdahl to Zipf: Ten Laws of the Physics of People. For example, Amdahl's Law mathematically proves the argument from The Mythical Man-Month that you can't just add new people to the project to deliver it faster because of the cost of synchronization.

I want this post to be a reminder for myself of the most interesting ideas in the book so if you want to savor it yourself just remember that it's worth buying.

Rating: 9/10
Contents: 1. Optimal Stopping Probably the most interesting from this chapter was the ru…

Book Review: Masters of Doom by David Kushner

Image
The book that I wanted to read for a long time. How was it?

I have to say that it's really good. I learned a lot about Id and both John Carmack and John Romero - how their lives looked up before and during the creation of the most know Id Games like Doom or Quake. What was depressing but also making it so much more real is how much politics and infighting happened between all those people working in the industry at that time.

The only downside for me is that there's not much about the technology side of things. There is a paragraph here and there but most of the book is about two John's allowing you to take a look inside their heads. Maybe another downside as not native speaker would be the font - that made it harder than necessary to read.

All in all, I highly recommend it. 8/10

I've spent an hour debugging XSRF error because of ... fetch

Image
Yesterday we were working on a new subpage with a form. Let's use the new `fetch` API to make POST requests seemed like a good idea but we started getting errors from the server:

`HTTP 403: Forbidden (XSRF cookie does not match POST argument)`

Header `X-XSRFToken` was set, we tried passing value in the body, setting token in the template, setting it in the backend only in certain cases but nothing helped. Finally my coworker found out that we're not sending `_xsrf` cookie with the request at all so it generates a new one every time...

Turns out fetch doesn't send cookies by default. It's by design: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch

The fix is incredibly simple: tell fetch to include credentials in the options:

```
fetch("/someURL/", {
    method: "post",
    headers: {
       "X-CSRFToken": token
    },
    credentials: "include"
});

```


Book Review: The Art of Manliness: Classic Skills and Manners for the Modern Man by Brett McKay

Image
I'm a a listener of The Art of Manliness podcast for over a year now and just before my last vacation I decided to buy the book. Partly as a support for the podcast and partly to get my own opinion about it (reviews are really all over the place from 1 to 5 starts on Goodreads).

If you read most critical reviews you will find that Bret McKay draws a lot of inspiration from 19th century gentleman. You can think about your grandfather more than your father kind of man being the inspiration for this book. There is a bunch of practical advice on all kinds of topics from shaving, dressing to raising kids but also a lot of trivia and random facts you won't really need so you have to pick yourself.

There is one annoying quirk of this book though, it tries to explain things with words that should be explained with images. I have skipped most of tying knots and ties for that reason. I've noticed that there's a new book called The Illustrated Art of Manliness: The Essential How…

Book Review: Sapiens: A Brief History of Humankind by Yuval Noah Harari

Image
That's my first review in a pretty long time, but I decided to only review good books - the kind I'm recommending and giving to my friends.

I heard about "Sapiens" a couple of times but I bought the book after learning more about the author and seeing that Cal Newport recommends the book as well. You can read about the author at Yuval Harari Works Less Than You maybe you will get interested the same way I did.

Sapiens starts when humans were hunter-gatherers and brings us to modern times. Most important is his perspective and high level view on agriculture, religions, ideologies and nations. Most striking was how much modern culture we live in is just another kind of ideology and how important it is for people to believe in the same things.

Rating: 10/10. Must read.

I was reading it in english but I liked the books so much that I bought Polish paper edition as well. Polish readers can find shops at: lubimyczytac.pl




Pomodoro Yo-yo Effect

Image
Recently I started feeling stressed and less productive which forced me to be more conscious of my work, habits and everything around it. Thanks to that I noticed:


I got a lot of notifications from Slack, Messenger and Email.I felt anxious before starting new tasks.My focus wasn't predictable, especially on harder tasks.

Don't get me wrong, I felt great most of the time, especially when I sat for hour or two at a time coding. The troubling thing was that it wasn't every day and I felt it was getting worse.

Most of those problems should be fixed by Pomodoro techinique I was writing about before, did it stop working? The thing is, I stopped using it.

A couple of months ago I noticed that staring new tasks, and taking breaks is actually a hindrance. I could easily focus for an hour or more on a task and basically forget about Pomodoro, and feel guild about not following it or not keeping proper count. I've decided that it wasn't necessary anymore. It did it's job …

Book Review: Influence by Robert B. Cialdini

Image