Category: Kotlin
-
Solving the Daily Jumble
Recently I decided to subscribe to my local newspaper (the Hartford Courant, pronounced current) again. That’s been valuable by itself, and brought some benefits I forgot about (like a comics page), but one of the unexpected side effects has been the Daily Jumble. The idea is to unscramble the clues to form words. All of…
-
Fibonacci in Kotlin
I didn’t realize it until I noticed the trending topic on Twitter, but Saturday, November 23 was Fibonacci Day. That gave me an opportunity to drag out one of my favorite old jokes: For those unaware or who don’t remember, the Fibonacci series starts with 0 and 1, and then each subsequent number is the…
-
Annotated TOC for Kotlin Cookbook
Last week I received an email asking about a table Of contents for my new Kotlin Cookbook, saying they couldn’t find one either on the O’Reilly Media site or on Amazon. It’s a lot easier to make a decision about buying a recipe book if you have a list of recipes. When I checked last…
-
Kotlin Palindrome Checker
This post, based on code from my new Kotlin Cookbook, shows how to write a palindrome checker in Kotlin. Along the way it discusses raw strings and regular expressions, writing functions as single statements, and creating an extension function on String. First, a quick definition. A palindrome is a string whose characters are the same…
-
A Deep Dive into the KotlinVersion Class
Getting the current Kotlin version is easy, but the actual KotlinVersion class is much more interesting. This post shows how to get the Kotlin version programmatically, but then looks at the details of the KotlinVersion class, including how it demonstrates a great way to write an equals method and more. Note that this demo is…