Mario Fernandez
04/23/2020, 5:10 PMKotlin
and arrow
this past months internally at ThoughtWorks, and an article of mine featuring Either
just got published 😛 https://www.thoughtworks.com/insights/blog/either-data-type-alternative-throwing-exceptionsRobert Jaros
04/25/2020, 12:56 PMelizarov
04/25/2020, 8:37 PMDan Newton
04/27/2020, 8:25 AMelye
05/04/2020, 10:43 AMSlackbot
05/05/2020, 12:21 PMKris Wong
05/06/2020, 4:11 PMpablisco
05/06/2020, 5:10 PMRobert Jaros
05/10/2020, 1:38 AMclassName
parameter to all DSL builder functions for better React-like HTML markup
- simplified state binding functions
- added root panel container types from Bootstrap 4.4
- upgraded dependencies: Coroutines 1.3.6, Spring Boot 2.2.7, Jooby 2.8.2, Bootstrap Select 1.13.17
For more details about this release see the changelog.
As always any feedback is welcomed :-)elizarov
05/10/2020, 7:54 AMDan Newton
05/12/2020, 8:07 AMStanislav Kozlovski
05/14/2020, 3:00 PMpackage-private
published:
https://levelup.gitconnected.com/kotlin-unit-testing-classes-without-leaking-public-api-871468695447
I’m sure you’re all aware of it, but I thought I’d share 🙂Abhishek Bansal
05/17/2020, 7:22 AMpjagielski
05/17/2020, 9:45 PMShabih Syed
05/22/2020, 5:53 PMiguissouma
05/25/2020, 1:05 PMkotlin
, spring-boot
, graphql-kotlin
, r2dbc
, postgres
. If any one want take a look. A compatible frontend in React is available here. this is inspired by WhatsApp-Clone-Server implmented in TypeScript and Apollo Graphql Server.zsmb
05/25/2020, 5:39 PMgammax
05/27/2020, 1:36 PMamanda.hinchman-dominguez
05/27/2020, 5:18 PMsdeleuze
05/28/2020, 1:02 PMjaguililla
05/29/2020, 3:13 PMHari Kulhari
06/05/2020, 9:47 AMMarcin Wisniowski
06/05/2020, 3:59 PMOscar Sequeiros
06/08/2020, 12:19 PMraulraja
06/09/2020, 10:56 PMStephan Schroeder
06/10/2020, 1:32 PMcsv2List
-function is used to map an InputStream containing csv-text into a list of a user-defined data class. Strong type guarantees, including nullability and user-defined property types are provided (as well as common csv-features like ,
being allowed in csv-values if those are surrounded by quotation marks).
@CsvRow data class DataRow(
@CsvValue(name = "RQIA") val id: String,
@CsvValue(name = "Number of beds") val bedCount: Int?, // types can be nullable
val addressLine1: String, // without annotation it's assumed the the column name is the the property name
val city: String = "London", // without value in the csv file the Kotlin default value is used
@CsvTimestamp(name = "latest check", format = "yyyy/MM/dd|dd/MM/yyyy")
val latestCheckDate: LocalDate?, // multiple formats can be provided separated by '|'
@CsvGeneric(name = "offers Cola, Sprite or Fanta", converterName = "beverageBoolean")
val refreshments: Boolean? // a user-defined converter can be used
)
// register a user-defined converter
registerGenericConverter("beverageBoolean") {
it.toLowerCase()=="indeed"
}
// some text in csv-format to be mapped
val csvStream: InputStream = """
city, addressLine1, Number of beds, latest check, RQIA, "offers Cola, Sprite or Fanta"
if a line doesn't fit the pattern, it will be discarded <- like this line, the next line is fine because city and Number of beds are nullable
, "2 Marylebone Rd", ,2020/03/11, WERS234, nope
Berlin, "Berkaer Str 41", 1 ,28/08/2012, "NONE123", indeed
Paris,"Rue Gauge, Maison 1", 4 , , "FR92834",
Atlantis,,25000,,,
""".trimIndent().byteInputStream()
val dataRows: List<DataRow> = csv2List( // <- this is how you trigger the mapping, you basically tell the lib when the InputStream comes from and which type the data is
CsvSourceConfig(
stream = csvStream
)
)
Madalin Valceleanu
06/12/2020, 6:38 AMNick
06/14/2020, 3:39 AMval velocity = 5 * meters / seconds
val acceleration = 9 * meters / (seconds * seconds)
val time = 1 * minutes
// d = vt + ½at²
val distance = velocity * time + 1.0/2 * acceleration * time * time
println(distance ) // 16500 m
println(distance `as` kilometers) // 16.5 km
println(distance `as` miles ) // 10.25262467191601 mi
println(5 * miles / hours `as` meters / seconds) // 2.2352 m/s
Try it out and provide feedback. (edited)