How to get the current working directory in Kotlin
Sometimes it’s nice to know where you are. import java.nio.file.Paths fun main() { val cwd = Paths.get(“”).toAbsolutePath() println(cwd.toString()) }
Sometimes it’s nice to know where you are. import java.nio.file.Paths fun main() { val cwd = Paths.get(“”).toAbsolutePath() println(cwd.toString()) }
Before Kotlin BufferedReader br = new BufferedReader(new FileReader(“data.txt”)); try { StringBuilder sb = new StringBuilder(); String line = br.readLine(); while (line != null) { sb.append(line); sb.append(System.lineSeparator()); line = br.readLine(); } String content = sb.toString(); } finally { br.close(); } This is a code sample reading a files content in plain old Java. What a mess…
Motivation Whether you need credentials to log into a system or some configuration parameters for your application, the .env concept might help you. Installation pip install python-dotenv Usage .env file Create an .env file in your project root folder You should not share this file or commit/push it to your version control. You should add…
Dependency First you need to add the following dependency to your build.gradle file dependencies { testImplementation ‘org.jetbrains.kotlin:kotlin-test’ As a second step you need to add the task test { useJUnitPlatform() } Implementation When you are familiar with JUnit you may recognized the @Test annotation. Assertions work pretty much the same. You can choose from a…
Motivation Learning a programming language can be challenging. Although there are tons of articles and tutorials for learning languages the most important thing is to transfer your knowledge to other real world problems. The challenges The coding challenges are language agnostic so you can use any modern language which supports writing command line applications. Write…
Aufbau einer entwicklungs-begleitenden Software-Qualitätssicherung In meiner Zeit als Software-Entwickler bei mgm technology partners und der e.solutions GmbH durfte ich zweimal eine entwicklungsbegleitende Qualitätssicherung aufbauen. Bei mgm technology partners konnten wir im ERiC (Elster Rich Client) die Neufehlerrate pro Release um 90% senken. Bei e.solutions begleiteten wir das Audi Virtual Cockpit in die drei ersten SOPs…
This is the overview page for my little Kotlin tutorial Learning Kotlin Part 1 – print Learning Kotlin Part 2 – arrays Learning Kotlin Part 3 – ranges Learning Kotlin Part 4 – conditionals Learning Kotlin Part 5 – loops Learning Kotlin Part 6 – functions Learning Kotlin Part 7 – multiple return values Reading…
Motivation In this article I will show you five reasons why you might need an Octopi for your Prusa 3d printer Monitoring Owning a 3d printer is not subtle: you need a good amount of space and the printer generates a lot of noise. So a separate room or a place in the basement are…
Motivation Fiddling around with octoprint I figured that I needed a case and holder for the Raspberry Cam Cam case Printables.com for the rescue: Sneaks has a lot of cool designs and I fell in love with the Articulating Raspberry Pi Camera Mount for Prusa MK3 and MK2 The parts Here you can see all…
When you are new to 3d printing your first prints will likely fail or not produce the desired results right away. Here are 5 common issues with 3d printing. Heatbed dirty When you do not clean the heatbed properly before a print you may encounter issues with the adhesion. So please clean the heatbed before…