In functional programming, a domain specific language (DSL) is a set of functions that can be composed to solve a specific problem. They are often found in libraries, but you can also write your own DSL that is specific to your business domain. This can be beneficial for several reasons:
In this post we’ll build a DSL for filtering emails in Scala. …
When writing tests, it can be useful to take data files from external systems and use those in your tests. These files can be quite large, so it makes sense to trim them down to a single record before checking them into git. This is simple to do by hand for human readable file formats like csv and json, but not for binary file formats like Parquet. To my knowledge, there are no pre-built CLI’s that do this.
In this post, we’ll install a command line tool and register it to your shell. …
Getting machine learning off the ground requires many skills and capabilities. Some of these skills are related, some are not. For example, knowledge of math and knowing when to use which machine learning (ML) algorithm share many commonalities, but they are largely unrelated to building infrastructure. That’s why people with ML skills tend to also be competent in math, but not in building infra. Skills cluster, and it’s useful to give these clusters names.
While playing Factorio the other day, I was struck by the many similarities with Apache Kafka. If you aren’t familiar with them: Factorio is an open-world RTS where you build and optimize supply chains in order to launch a satellite and restore communications with your home planet, and Kafka is a distributed streaming platform, which handles asynchronous communication in a durable way.
I wonder how far we can take the analogy between Factorio and Kafka before it starts to break down. Let’s start from scratch, explore the core Kafka concepts through Factorio visualizations, and have some fun along the way. …
Cells in Google Sheets can have multiple lines of text, and sometimes you need to match an expression over these lines.
REGEXREPLACE don’t match new line characters with
.-expressions by default:
You can add the
s flag to match multiple lines in the same cell:
I recently came across 3Blue1Brown’s “Essence of linear algebra” YouTube playlist. As the title implies, it covers the basics of linear algebra. Instead of focusing on the math though, it lays down a foundation that gives you a visual intuition that helps you reason about it. I would highly recommend this if you’ve never really grasped linear algebra that you’ve been taught in university, or if you’ve never gotten around learning about linear algebra at all.
While watching the first video, I decided to code it all out in Scala to let it materialize. That’s when it really clicked for me. While typing out the float multiplications I noticed just how simple the underlying operations are. It now really makes sense to me that GPU’s are optimized for floating point operations as all vector and matrix manipulations are encoded by multiplying or dividing floats. …
The other day I had some issues activating my Windows 10 product key in VirtualBox, so I hopped on a support chat with a Microsoft agent. When she was unable to view my activation key in my system settings, she pasted this script on my machine and executed it. It shows the product name, product id and installation key of the machine it’s executed on. I thought I’d share it as it might be useful for more Windows users.
Save this as
get-windows-product-key.vbs, right click it and select
Open with Command Prompt. It will show your Windows product key and store it as
Windows Key.txt in the same directory as where you’ve saved the script.
There’s no Scala Days conference without a keynote of Martin Odersky himself. This year he spoke about his current work: Dotty. Dotty is the new Scala compiler that will be part of Scala 3. The first release candidate was released just hours before the keynote and comes with the compiler itself (dotc), a repl (doti), a doc tool (dotd) and an IDE. It implements the MS language server protocol, enabling it to serve several front ends: VS-Code and Emacs (IntelliJ support is in the works). With Dotty, IDE’s can use the regular compiler as the presentation compiler.
Dotty is developed as a separate branch. It should release a stable 0.x in early 2018. The current rework on ctdlib collections will be part of 2.13 and dotty 0.1. Scala 3 is expected to release in 2019 or beyond. Dotty adopts the release train model with iterations of 6 weeks. …