UUIDs have proven useful in many circumstances. We have basically two main variants: The UUID is calculated as a combination of the Ethernet-MAC-address, the timestamp and a counter. The UUID is calculated using a good random number generator While variant 1 provides for a good uniqueness, there are some issues with it. Today we use …
Autor-Archive: bk1
How to calculate Square Roots and Cubic Roots
The functions sqrt and sometimes even cbrt are commonly available, but it is nice to see how they can be calculated. There are several approaches, but the most popular ones are Newton’s method and an algorithmic formulation of how roots are taken manually, for those old enough to still have learned it in school. Earlier …
Guava-Collections in Java-APIs
When we write APIs, that have parameters or as return values, it is a good idea to consider relying on immutable objects only. This applies also when collections are involved directly or indirectly as content of the classes that occur as return values or parameters. Changing what is given through the API in either direction …
Scala Days 2019
Scala Days had a tenth anniversary in 2019. It is an annual conference about Scala, which I like to visit, when possible. There is some confusion as to what is meant: Where this the 9th, 10th or 11th Scala Days? Where the first Scala Days 9, 10 or 11 years ago? The truth is, that …
hashCode, equals and toString
In many programming languages we are urged to define methods hashCode, equals and toString. They are named like this in Java and in many JVM languages or they use similar names. Some languages like Perl and Scala provide decent mechanisms for the language to figure these out itself, which we do most of the time …
Can hashCodes impose a security risk?
This may come as a surprise, but attackers can assume that software is running in one of the common languages with their standard library. This calculates the hashcode of a string in a predictable way. For that reason it is possible, to create a large number of entries that result in strings having the same …
Unit Tests as Specifications
Quite often I hear the idea, that one team should specify a software system and get the development done by another team. Only good documentation is needed and good API contracts and beyond that, no further cooperation and communication is needed. Often a complete set of unit tests is recommended as a way or as …
Microservices
Microservices are a Hype, but they have their pros and cons. Sometimes people say, that this is the magic tool to solve all problems. They hear it on conference talks, read it in the internet or even in books. It is not the first time and it won’t be the last time that we hear …
ScalaUA 2019
In March 2019 I have visited ScalaUA in Kiev. It was interesting. I attended the following talks: Thinking Functionally by John A. De Goes Streaming data processing with Apache Spark by Roksolana Diachuk Theory of Constraints in Programming: Beyond Problem-Solving by Anatolii Kmetiuk Video Q&A session with Martin Odersky by Martin Odersky and Jon Pretty …
50 years of internet
According to some the RFC1, which was published on 1969-04-07, was the start of the internet. Many RFCs have since this time been published and they describe the standards of the internet. The early internet did contain functionality to communicate between computers, but it did of course not include http, html and the WWW, which …