In Software we often deal with ranges of dates and times. Let us look at it from the perspective of an end user. When we say something like „from 2020-03-07 to 2019-03-10“ we mean the set of all timestamps such that or more accurately: Important is, that we mean to include …
Kategorie-Archive: Data
UUIDs revisited
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 …
Flashsort in Scala
There is now also an implementation of Flashsort in Scala. In order to solve the requirement of sorting part of an array that is needed as part of flashsort, an heapsort implementation in Scala that can be constrained to a part of an array has been included as well. Heapsort was chosen, because it can …
Flashsort in Ruby
Deutsch There is a simple implementation of Flashsort in Ruby, after having already provided an implementation in C. The C-implementation is typically faster than the libc-function qsort, but this depends always on the data and on how well the metric-function has been written, that is needed on top of the comparison function for Flashsort. You …
Indexing of Arrays and Lists
We index arrays with integers. Lists also, at least the ones that allow random access. And sizes of collections are also integers. This allows for entries in Java and typical JVM languages, because integers are actually considered to be 32bit. Actually we could think of one more entry, using indices , but then we would …
Intervals
Intervals are subsets of a universe, that are defined by upper and lower boundaries. Typically we think about real numbers, but any totally ordered universe allows the definition of intervals. Intervals are defined by lower and upper boundaries, which can be a limiting number or unlimited, typically written as for the upper bound and for …
DB Persistence without UPDATE and DELETE
When exploring the usage of databases for persistence, the easiest case is a database that does only SELECT. We can cache as much as we like and it is more or less the functional immutable world brought to the database. For working on fixed data and analyzing data this can sometimes be useful. Usually our …
Lazy Collections, Strings or Numbers
The idea is, that we have data that is obtained or calculated to give us on demand as much of it as we request. But it is not necessarily initially present. This concept is quite common in the functional world, where we in a way hide the deprecated concept of state in such structures, by …
How to create ISO Date String
It is a more and more common task that we need to have a date or maybe date with time as String. There are two reasonable ways to do this: * We may want the date formatted in the users Locale, whatever that is. * We want to use a generic date format, that is …
Creating Unique Numbers
Many software systems rely on some kind of unique numbers. Uniqueness is always a question in what universe this uniqueness is required. We do see the different kinds of universes in the case of the IP-addresses. In theory they are world wide unique. In practice we have mechanisms in place like NAT, that use certain …