Declaration of VAR

and some other stuff

On 19.05.2021 the website was moved to https://decovar.dev/. This is just a mirror now.
  • Resizing images with ImageMagick vs sips

    2019-12-12 | 2 min read

    For quite a some time I was using sips from standard Mac OS bundle to resize (mostly scale down) images. But I always had some suspicions about its results quality, so I decided to compare it with ImageMagick.

    ImageMagick vs sips

    The figure above shows results of an image being scaled down to 100px width using both tools, and as you can see, ImageMagick conversion quality is better.

    Read more
  • New Qt blog retarded design

    2019-11-24 | 2 min read

    Geniuses from Qt marketing team have (again) changed the website design. The blog now looks especially retarded:

    New retarded Qt blog design

    I couldn’t tolerate this, so I wrote a custom CSS for Stylus.

    Read more
  • Amazon, MXNet and Qt - The Great Robot Arm challenge

    2019-11-10 | 16 min read

    This February on the Embedded World 2019 event in Nuremberg The Qt Company had a joint demo together with Amazon - “The Great Robot Arm Challenge”.

    If video doesn't play in your browser, you can download it here.

    Amazon guys wrote a good article covering the deep-learning part. In turn, I wanted to tell about the Qt part.

    Read more
  • NGINX, uWSGI and Python scripts

    2019-11-03 | 15 min read

    You have a static HTML page with a form on it. And you want this form to be processed by a Python script when submitted. And you serve your page with NGINX. To make all that work you will also need an application server such as uWSGI.

    NGINX and uWSGI

    Let’s see, how it’s done.

    Read more
  • The fuck is this CORS and how do I send my bloody request

    2019-10-10 | 6 min read

    So I was working on some web view and I needed to send an XMLHttpRequest using JS. Usually I was working with my own backend, but this time it was a different remote host (our YouTrack instance), and my request failed with the following error:

    Firefox, missing CORS header
    Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://some.host?params=ololo. (Reason: CORS header Access-Control-Allow-Origin missing).
    Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://some.host?params=ololo. (Reason: CORS request did not succeed).

    That’s how I learnt about the existence of CORS, as it turned out I never sent cross-origin requests before.

    Read more
  • Microsoft Azure AD authentication on your website

    2019-09-21 | 3 min read

    You might have wondered how to add the Microsoft sign-in to certain corporate websites inside your company (which are available from the internet) in order to restrict access to employees of your organization only.

    Microsoft sign in

    At least I have, and it turned out to be not so difficult actually.

    Read more
  • Players queue for Heroes of Might and Magic

    2019-09-21 | 3 min read

    It’s not like we at work don’t have things to do, but suddenly we decided to play Heroes of Might and Magic. So we created a virtual machine, installed the game and started a hot-seat game via RDP.

    HoMM queue

    For notifying about next players turn we created a Slack channel. But soon enough it became annoying to announce next turns manually, so I created a simple web-application for that.

    Read more
  • Barefaced phone scammers

    2019-08-22 | 5 min read

    I got a phone call the other day. The man on the other end told me (with a strong indian accent), that he is from “Computer Solutions” (or something). That already sounded fishy, but he also used my full name, which lowered my guard for a bit, so I did not hang up right away.

    Scam-call-center

    Right after “how are you” he said that according to their “systems” my computer is in danger, because, as they can “see”, there was some “hacking software” downloaded to my computer, and they will now help me to get rid of it.

    Read more
  • Chunked upload to Twitter with C# / .NET Core

    2019-08-22 | 9 min read

    While images can be uploaded to Twitter in one request, uploading a video is a different story.

    .NET Core, Twitter

    And although I’ve managed to implement it, I am not entirely happy with the result, and later you will see why is that.

    Read more
  • DNB, communication and Face ID

    2019-08-17 | 4 min read

    Some more experience with norwegian bank DNB. In 2019.

    DNB fails

    In particular, about their implementation of Face ID, the way they do communication and other things.

    Read more