Posts

Showing posts from May, 2017

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?

sqlite + multiprocessing?

Just implemented simple test (mostly using examples from the internet). Yes, sqlalchemy+sqlite crashes when more than one thread is trying to access the database file. Need to move to MySQL to have a few processes (like Tornado) access the DB...

Rabin-Karp Algorithm

Random thought: i t turns out that Rabin-Karp is based on quite simple things - first, knowing the hash function and, second, understanding that the previous hash of the substring could be used to calculate the next one (when including next symbol) in O(1) instead of calculating the next hash anew in O(n).

Getting POSIX TZ strings from Olson tzdata

Problem at hand: we are having IOT device which does not have the IANA/Olson tzdata package but we would like users to be able to select their time zones from the list, but not enter the TZ string in form of PST8PDT... After a lot of searching, I could not discover the way of obtaining any sort of the TZ string database which would work for most of the cases. The closest I got was the momentjs  JSON data generated from the old good Olson tzdata but, alas, it was still missing the simple TZ strings. Now it was pretty much evident that solution should still somehow include the Olson database but I did not know how. Final step had come up when I actually have taken a look at the tzinfo file format and discovered that in the current version (v2), the TZ string lies right in the end of each file, conveniently separated by the new line symbols at start and in the end! So the final solution for now is: download latest tzdata build it with zone info compiler (or just zic) ...