Yes, You Can Use Different Types With the Same Structure
urmaul.com
by Bogdan Kolbik
6h ago
This is a story of how we fixed multiple bugs by typing our array indexes. We process a batch of items and we have to store some kind of item reference in many places. Our item ID is a string, so cloning it is not fun. We keep an array of items and use a value of type ItemIndex everywhere. As you can expect, ItemIndex contains an index in that array. It all sounded good in at start, but later we had to create two different item arrays. One of them contained all the items, and another one contained items after some filtering. This caused more than one bug, where we tried to use the index of one ..read more
Visit website
Finally a good feed reader
urmaul.com
by Bogdan Kolbik
2w ago
After the closure of Google Reader, I have spent years searching for a good RSS feed reader. It seems like I’ve found it. You can divide feed readers into two big categories, each with own pros and cons. There are installed apps. My biggest beef with them is how uncool they feel. These are special applications for viewing the web content so they have little browser engines inside. But as soon as you click on any link in the feed, either you switch to another application (browser) or the feed reader turns into a bad browser and opens the website in a little window. Having to switch between two ..read more
Visit website
Don't Start With a Skateboard
urmaul.com
by Bogdan Kolbik
1M ago
I'm arguing with metaphors again. Do you remember the famous metaphor that when you need a car, instead of building one, you should build a skateboard, then a scooter, a bike, a motorcycle, and only then a car? This metaphor shows a good idea of getting feedback earlier. It says, don't make all the work with a big-bang release in the end. Instead, start with something simple, a minimum viable product like a skateboard, and release it immediately. Collect feedback and adjust your work accordingly. There is one flaw, though. Building skateboards is not easy. The first mass production of skateboa ..read more
Visit website
Good GRPC GUI Clients
urmaul.com
by Bogdan Kolbik
7M ago
Looking for good GUI clients for debugging GRPC endpoints turned out to be surprisingly hard. It took several attempts and many apps checked. But I found some. Use case First, I need to explain, what I mean by “good”. We have some internal services running in Kubernetes and we want to expose some debugging endpoints for occasional manual requests. So by “good“ I mean a replacement for Swagger Web UI we used for this before. This means: It can read .proto file with service definitions. Supporting server reflection is also great but we don’t want to require our service to provide it. Requests c ..read more
Visit website
ZIO log annotations are confusing
urmaul.com
by Bogdan Kolbik
1y ago
I was working on a logger that writes metrics every time a warning or an error is logged. I tried to provide additional metric tags depending on the log annotations. And it didn't work. I was adding an annotation and I could see its value somewhere deep in the stack trace but the annotations value was empty. Turned out that ZIO has two log annotation mechanisms that work in parallel. This might age quickly. Here are the versions I'm using: "dev.zio" %% "zio" % "2.0.5", "dev.zio" %% "zio-logging" % "2.1.7", Annotation mechanisms Both mechanisms often use the same names and this increa ..read more
Visit website
Tech stack of the urmaul.com blog
urmaul.com
by Bogdan Kolbik
1y ago
At the time of writing this, urmaul.com is a static blog with privacy-friendly dynamic elements. Everything runs self-hosted on a single virtual server with an automatically updated Linux. This is a description of every layer with some reasoning and configuration details. Blog No CMS is running on the server and generating pages when you request them. All the pages are pre-generated, now it's just static files served by nginx. Benefits of static sites: Fast: It's hard to serve requests faster than nginx serves static files. Simple: configuring the server is easy because nothing smart is runni ..read more
Visit website
4 ways to fail at measuring durations
urmaul.com
by Bogdan Kolbik
1y ago
This post is a confession about multiple overlapping mistakes we made when trying to measure API request times. These errors went unnoticed for months because wrong statistics still look realistic. Hopefully, this post will help you avoid such fails. What we are trying to do We are making multiple parallel API requests to the external service. These are similar requests to the same service but with different input. We want to measure the time of each API call and show the statistics on a dashboard. Tech stack: Our application is built with Scala and ZIO. It uses Kamon to send data to Prometheu ..read more
Visit website
5 systematic ways of coming up with property-based tests
urmaul.com
by Bogdan Kolbik
3y ago
This is a cheat sheet based on a great talk "How to specify it! A guide to writing properties of pure functions" by John Hughes. This talk has a lot of information easy to forget so a cheat sheet may help you refreshing memories without watching the whole talk again. If you didn't watch the talk yet – watch it. Otherwise, you won't understand much. There are 5 systematic ways of formulating properties. The current example is a binary search tree. 1. Is there an invariant? Every operation should return valid results. If there is an invariant that your function must satisfy – you can write a t ..read more
Visit website
Solution for Hackerrank problem: Basic Cryptanalysis
urmaul.com
by Bogdan Kolbik
3y ago
There's one programming puzzle I solved many years ago but I still remember it because of the unusual solution. Problem: You have a text encrypted with a simple monoalphabetic substitution cipher. You don't have the key but you have a dictionary. Every word in a text can be found in this dictionary. Find the original text. It can be solved by dynamically generating regular expressions. Full problem text can be found here: https://www.hackerrank.com/challenges/basic-cryptanalysis/problem What can we see by looking at this encrypted word? rjayojfr It may look like "nothing" but actually it provi ..read more
Visit website
Solution for Project Euler Problem #700: Eulercoin
urmaul.com
by Bogdan Kolbik
3y ago
Problem: Imagine a sequence 1504170715041707*n mod 4503599627370517 where n is an integer increasing from 1. Find the subsequence of this sequence where every next element is smaller than a previous one. All the solutions I've read about include brute force calculations. I found a better one and I can't stop myself from posting it. Formal problem description: Leonhard Euler was born on 15 April 1707. Consider the sequence 1504170715041707n mod 4503599627370517. An element of this sequence is defined to be an Eulercoin if it is strictly smaller than all previously found Eulercoins. For example ..read more
Visit website

Follow urmaul.com on FeedSpot

Continue with Google
Continue with Apple
OR