Skip to main content

Posts

Showing posts from 2019

Programming challenge websites

To maintain my limited Elixir programming skills, I use coding challenge websites such as Hackerrank, Codewars, and, more recently, Exercism. The sites offer puzzles that can be solved in different coding languages. The websites have a decent online editor so you can get right into coding. While the exercises certainly aid me in keeping up rudimentary skills in Elixir, the tasks are mostly brain teasers, which require minimal coding. Unfortunately, it is difficult to find any exercises which are about the issues I face in my daily work — things as manipulating complex data structures, mapping them to new ones, and so on. Practicing programming like this has the same issues as using these kinds of puzzles as interview questions. Interviewee with a decade of experience is demeaned and humiliated by a seemingly simple task under the stressful circumstances. I have seen this over and over again when giving interviews, and nowadays, I am firmly against live coding. One of the better e

Arduino air quality sensor

After some facade renovations, some of the air vents in some residents in the condominium I live in have complained about bad air quality. I have not noticed any changes but thought that it would be good to check if the air quality in my apartment is acceptable. The commercial CO2 monitors are rather expensive, so I decided to build my own with the Arduino I already own and with an inexpensive analog gas sensor MQ-135. With a few lines of code, the monitoring was set-up by getting an average reading of the air quality sensor in one-minute intervals. The Arduino sends the measurements via serial port to my computer, which then creates a CSV file of the result with a python script. https://github.com/jjylik/arduino-airquality

Flutter summer project

As a summer project, I helped out a team at my local university in a project combining open data with students seeking an apartment to rent, especially when moving to a new city. They designed a mobile app for this task, and I was to implement it. I decided to try out Flutter this time instead of react-native. Again, there are several blog posts and even official documentation on how to transform from native or react-native development into using Flutter.  Here are my two cents though Dart. Google's solution for building UI:s. The syntax is familiar looking. I like the way how it is not limited to any particular form of programming, but the guideline for Flutter enforces a specific declarative style. One of the best parts of Flutter development is the named arguments. Development environment. One of the better setup experiences. A self-contained diagnostic tool which alerts if something is not set correctly. Updating is a simple git pull and some installation scripts. I had

Speaking to students

Given there is a chance, I'm eager to give a tech talk to any kind of audience which is willing to have a listen. Part of the fun of giving a speech is of course also learning something about the subject and also, improving myself as a speaker.  Two of the most recent talks I've held this year have been to the local university IT students. Having been one of them in the past, I knew that giving them something uninspiring to do would be something they are used to. The challenge would be to figure out something actually fun which can be accomplished in a matter of a couple of hours. There are countless blog posts and tutorials about how to talk to students, but I decided to ignore them and wing it. I gave two assignments to choose from. First one was to make a DVD screen saver with JS. There was a short-lived internet meme about it earlier this year, and I thought that hey this could be fun. It turned out to be quite amusing to watch at least especially when mixed with

RocksDB data recovery

I recently needed to do some maintenance on a RocksDB key-value store. The task was simple enough, just delete some keys as the db served as a cache and did not contain any permanent data. I used the RocksDB cli administration tool ldb to erase the keys. After running a key scan with it, I got this error Failed: Corruption: Snappy not supported or corrupted Snappy compressed block contents So a damaged database. Fortunately, there's a tool to fix it, and after running it, I had access to the db via the admin tool. All the data was lost though. Adding and removing keys worked fine but all the old keys were gone. It turned out that the corrupted data was all the data there was. The recovery tool made a backup folder, and I recovered the data by taking the files from the backup folder and manually changing the CURRENT file to point to the old MANIFEST file which is apparently how RocksDB knows which sst (table) files to use. I could not access the data with the admin tool,