Posts

Mindset

Carol Dweck's book has simple thought: growth vs fixed mindset is the core of learning process, how we face the challenges. Because of simplicity, this thought really feels true. The corollaries of the mindset are huge. Literally - the general path in life we choose when using one mindset or the other. As a father, chapter about praising effort and not the talent in the children is especially helpful (done something very fast and without effort? Then it was too easy for you, let's do something challenging!)

Born A Crime

My first audio book turned out to be amazing childhood stories of south african-born comic Trevor Noah. Totally different experience of a man growing up in different country, sometimes funny, sometimes sad but amazingly true.

Be careful when you cast

There was a bug which indicated itself when something was saved to sqlite and then queried back. It turned out that we were saving int which got bind to int64 but when binding value in query we (tada!) used unsigned int!

The catch could be demonstrated with the following small example:

#include <iostream>
#include <stdint.h>

using namespace std;

int main() {
  int src = 0xFFFFFFFF;
  int64_t x = src;
  uint32_t req = 0xFFFFFFFF;
  int64_t y = req;
  cout << "x = " << hex << x << endl;
  cout << "y = " << hex << y << endl;
  cout << (x == y) << endl;
}

x = ffffffffffffffff <- what we are saving
y = ffffffff <- what we are searching for
0

In here, x and y get literally the same value but after converting to int64, totally different values get saved to the database!
Fix? Bind to int - it's 4 bytes and in this case! And maybe use uints/int more consistent;)

On Writing Well

The new book on my bookshelf, On Writing Well by William Zinsser. Helps clear up the head a lot in terms of writing.

Main thoughts:
No clutter - just minimal amount of words for what you want to sayRewriting/editorial is not only normal but essential (example with the real manuscript edits is golden)You are writing for yourself in the first placeWrite for people, with people In detail:
Verbs - active, precise, colorfulNo redundant adverbs or adjectivesContractions are totally fine (I thought not!)He/she is the real problem: use plurals ('they', 'we') or change wording to address What struck me: just "friends" vs "work friends" + "close friends" (no distinction sounds a lot better!)
See a lot in common with writing good code - say only what you want to say, no more, no less.

QTCreator for x86

Historically, we were using 32-bit Ubuntu (16.04) for development and all was good... until we discovered that maximum QTCreator version you can officially get (without building from sources  of course) is 3.5.1! Which, while not too bad, had some nasty crashes fixed only in the later versions.

And only after some time and luck, we discovered that ubuntu-sdk-ide is QTCreator with plugins.
What's important, it gets updated for x86, too! (latest version is 4.1.0 for 16.04) see here.

As a result, sudo add-apt-repository ppa:ubuntu-sdk-team/ppa && sudo apt update && sudo apt install ubuntu-sdk-ide.

Solved!

Failure Is Common

Just read the James Altucher's Choose Yourself. Very inspiring piece of work. Inspiring in a sense that many other books are talking about: failure is not only normal but failure is very-very common.
Almost-evident wisdom but still it takes to read many-many books talking about this in one or the other fashion (and heck a lot of practice of failing) to really feel that with your own bones.
Great book!

Travelling Idea

When I was driving from Los Angeles to San Francisco, I had to find the place or places where to stay for the night. I was wondering if, given the data from all the people travelling this route, it is possible to find the best places to stay considering few parameters you can choose like "Days travelling - Awesome places to see - Cheapest stay on the route".
If you want cheapest trip, algorithm will find the optimal route prioritizing this criteria, or if you want just the route people usually take - see it and decide for yourself whether it is what you want.
For example, if booking.com has, for example, lots of data of anonimized user IDs, it should be possible to implement something like that, isn't it?
Or there is already such a service and I had just totally missed it?