Kotlin: How to use .filter( ), ‘it’ key word, and arrow ‘->’ operator

Kotlin’s built-in .filter() function is meant to iterate through any iterable collection type, (lists, sets, or maps) and check each element of the collection against some criteria (aka “predicate”). If the element matches the predicate, meaning the boolean result is true, then the element is added to a result collection of the same type that … Continue reading Kotlin: How to use .filter( ), ‘it’ key word, and arrow ‘->’ operator

Kotlin: How to understand the not-null assertion operator (!!)

The Kotlin “not-null assertion operator” is expressed as two exclamation points. !! that appear at the end of a variable name. For example: myVariable!! Here is what the Kotlin documentation says about this operator: Here is what I learned about the not-null assertion operator after a little bit of experimentation: The difference between b and … Continue reading Kotlin: How to understand the not-null assertion operator (!!)

How to use the Linux od command (Octal Dump)

I was in a command terminal “bash” window on my Mac and I tried to run this curl command to get a security token from a web service api:curl -d “Username=mywebsite&Password=password” -X POST https://dev-warehouseapi.somewebsiteservice.com/api/Token However, my curl command failed with the message “curl: no URL specified!”. For example: My curl command appeared to be perfect, … Continue reading How to use the Linux od command (Octal Dump)

Python and Kotlin: A comparison of the language basics

In this table I will compare some basic programming syntax and conventions between the Python and Kotlin programming languages. Programming element Python Kotlin Commenting code: # This is a comment // This is a comment Multi-line comments: “”” This is a comment. This is a comment, too. This is a comment, too. “”” /* This … Continue reading Python and Kotlin: A comparison of the language basics

MongoDB: How to install mongodb-community on Mac and run on localhost

The goal of this article is to show how to get mongodb-community to run on a Mac at localhost:27017. This assumes that Homebrew has already been installed on your Mac machine. Using a terminal or bash window, start with the following brew command:brew tap mongodb/brew In this screenshot, I used this command after I already … Continue reading MongoDB: How to install mongodb-community on Mac and run on localhost