https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
random
  • e

    Eugen Martynov

    09/03/2019, 8:48 AM
    order on the server time and for a message in the process calculate it on client applying the delta calculated on sync
    👍 1
    🙂 1
    u
    • 2
    • 5
  • s

    Seri

    09/03/2019, 6:27 PM
    are the code snippets on this article broken for anyone else? https://medium.com/@elizarov/kotlin-flows-and-coroutines-256260fb3bdb
    w
    a
    • 3
    • 2
  • d

    Davide Giuseppe Farella

    09/04/2019, 1:27 PM
    Hey guys, I've just published a lib on bintray which contains utils for Gradle, since one of the utils is regarding publishing, I have a script in the
    buildSrc
    which I want to include in the lib itself with
    api(project(":buildSrc"))
    , but when I include the lib in my project I got an error at sync time that says that
    :Library:buildSrc
    cannot be resolved. Any hint about that?
    g
    • 2
    • 2
  • d

    dewildte

    09/04/2019, 4:09 PM
    Cauliflower is just albino Broccoli. <- Kotlin related via the butterfly effect.
    💥 3
    👌🏻 3
    🥦 3
    p
    • 2
    • 1
  • i

    itnoles

    09/09/2019, 12:37 AM
    https://www.oracle.com/java/technologies/jdk8-downloads.html You needed the Oracle accounts to download Oracle JDK
    g
    n
    • 3
    • 5
  • p

    Paul Woitaschek

    09/09/2019, 3:44 PM
    Did someone see a larger drop in android conversions and more failed payment transactions the last days?
    n
    • 2
    • 5
  • g

    ghedeon

    09/10/2019, 11:23 AM
    Any user facing SDK that you can think about? Like, it shows its own UI, does some user interactions and gives you back the result? Looking for "API done right" inspirations.
    v
    m
    • 3
    • 4
  • k

    kartikpatodi

    09/11/2019, 5:36 AM
    Hey guys, just wanted to know if there is any java/kotlin dead code elimination library? I am generating java & kotlin source files and wanted to remove unused imports or functions from the source files.
    g
    • 2
    • 31
  • j

    janvladimirmostert

    09/16/2019, 7:55 AM
    Interesting concepts in the Unison language (referring to the hashing of functions and the file structure), adding this to Kotlin will probably break Java-interop, maybe something that can be added to IntelliJ if intelliJ is not already doing something similar

    https://www.youtube.com/watch?v=gCWtkvDQ2ZI▾

    👍 1
    r
    v
    • 3
    • 3
  • g

    Gunslingor

    09/27/2019, 2:22 PM
    Question about intelliJ Tomcat Run/Debug configuration, deployment tab: After the artifacts are built they get deployed and then tomcat is started... I can't figure out what is really happening when deployment happens... it looks to me like the artifact stays in the out folder where it was built to and there is no deployment to the webapps folder, instead Tomcat knows to look in the out folder to load the first class... how it knows to look there is what I don't understand at this point.
    k
    • 2
    • 6
  • m

    martin

    09/27/2019, 5:58 PM
    hi everyone! quick question.. how do I use Jackson to parse a JSON value from a nested key?
    {
    "count": 13
    "data": { ... }
    }
    for example I want to parse only the data field there to a class, using
    jacksonObjectMapper().readValue<MyClassForData>()
    :stackoverflow: 5
    m
    • 2
    • 1
  • p

    Paul Woitaschek

    09/28/2019, 11:20 AM
    Is someone by accident using a xps 9560 running Linux?
    ❔ 1
    🐧 1
    d
    c
    +2
    • 5
    • 16
  • r

    robstoll

    10/01/2019, 9:41 AM
    does kotlin optimise multiple
    val
    property accesses (properties which do not use
    get
    ) within a function? Not that I am concerned that it has any impact on performance, I am just curious. When I use the bytecode viewer it does not look like it.
    d
    • 2
    • 3
  • g

    Gunslingor

    10/01/2019, 7:15 PM
    Hey yalls... I'm wondering, looking for a service really... I'm looking for some assistance setting a complete IntelliJ workflow. I'm mainly talking about deployment/run workflow that includes minification and obfusation of python, php and js, autosyncing, ssh SDKs, auto remote running, possibly package management (css, js, python pips), maybe a things like fontawsome package reducer (so I can develop with the full package but deploy only what's needed), maybe compiling my python code to C (I hear that is possible with Cython but haven't tried).... These are the things I'm looking to do, I'm developing on a windows machine but the application is only runable on linux which complicates things. The last few years I've been developing on the server with a mounted drive and notepad++... I'm trying to take advantage of intelliJ... but it gets really complicated and finicky... I guess at a minimum I'm looking to be pointed in the right direct and discuss possibilities... at a maximum, a real expert can set up a project for me instantly 😃.
    n
    • 2
    • 14
  • g

    groostav

    10/08/2019, 8:09 AM
    I'm a sucker for these things:

    https://www.youtube.com/watch?v=Og847HVwRSI▾

    guess which language makes it on the board in 2019?
    :kotlin: 4
    👍 3
    ➕ 1
    d
    • 2
    • 1
  • g

    groostav

    10/08/2019, 8:10 AM
    also me and my company are still doing green-field fortran work 🤘
    t
    e
    • 3
    • 4
  • d

    Dominaezzz

    10/09/2019, 6:38 PM
    I'm making a prediction that Kotlin 1.4 will be released on 17th of March 2020. I'm leaving this here as proof. 🙂
    👀 1
    🤔 4
    r
    h
    +8
    • 11
    • 34
  • e

    elect

    10/11/2019, 11:33 AM
    @gildor remember all the discussion about bitwise operators and the suggested
    EnumSet
    which couldnt fit my needs? Well, nowadays after started playing with Swift, I can better define one of the disadvantage of
    EnumSet
    (at least for me): on jvm is a class, and it's passed by reference, deeper functions may modify the original content. While on Swift is instead a value type and then there is no problem passing it down to functions. Maybe it's possible to clone it, by this would introduce additional overhead in terms of verbosity and performances (I use flag intensively)
    g
    n
    • 3
    • 3
  • u

    ursus

    10/13/2019, 6:16 AM
    Hi, has someone switched api from json to some kind of binary serialization like protobuf and was mesureably happier? worth it?
    g
    m
    • 3
    • 4
  • b

    bjonnh

    10/14/2019, 8:45 PM
    https://twitter.com/TheHackersNews/status/1183812855612596225
    👀 2
    n
    • 2
    • 1
  • z

    zokipirlo

    10/18/2019, 1:26 PM
    Have some questions regarding buying new hardware for Android development. What is the most important hardware factor for fast build times and as fast as possible IDE (Intellij, Android Studio)? Is Gradle and Intellij "core sensitive"... I mean would 12 core Ryzen 9 be faster vs 8 core Ryzen 7? Is high class GPU of any help?
    f
    b
    • 3
    • 7
  • g

    groostav

    10/18/2019, 8:31 PM
    oh wow, for the first time in my life (that I can recall) Java's "Unreachable statement" actually caught a mistake. I had written
    public Returnables doStuff(){
      Returnables returnables;
      switch(x){
        case Instance1: returnables = makeReturnables()
        default: throw new IllegalStateException();
      }
      return returnables; //error: unreachable.
    Of course, I forgot to add a
    break
    statement, which is a nasty language feature onto itself. still! I've always been annoyed with java for compilation errors on "Unreachable code", and have on more than one occasion written
    if(1==1)
    just to get around it! I'm impressed it caught me here. Well done java. now to
    ctrl
    +
    alt
    +
    k
    ...
    f
    p
    • 3
    • 2
  • t

    Thiyagu

    10/18/2019, 10:58 PM
    I have blocking sqs listener , which fetch message from sqs , do some processing (may be message validation or enrichment) , store the procesed message in the DB, clean up the message from sqs. I am planning to write this whole sqs listener in non blocking way using Kotlin coroutines. My question is that how can I measure performance (throughput, cpu usage, thread usage) between my old approach and new coroutine based approach??
    t
    • 2
    • 1
  • m

    magisu

    10/21/2019, 10:20 PM
    Just get interviewed, used Kotlin, not so familiar with it and got damned.
    f
    s
    +3
    • 6
    • 42
  • m

    marstran

    10/23/2019, 7:03 PM
    I’m creating some exercises for a small Kotlin course for my company. I’m trying to create a fun exercise about sealed classes. I was thinking about modelling a state machine, but I just can’t come up with a fun example for it right now. Do anyone have an idea? 🙂 I’m thinking about making something like this:
    sealed class State
    class State1(val data: Int) : State()
    class State2(val otherData: Int) : State()
    object State3 : State()
    
    sealed class Action
    class Action1(val actionData: Int) : Action()
    object Action2 : Action()
    
    fun State.nextState(action: Action): State = TODO("Write this function")
    k
    • 2
    • 1
  • e

    elye

    10/24/2019, 2:27 AM
    Hi… Inability to instantiate an annotation class in Kotlin, is this a limitation in Kotlin vs Java? e.g. In Java
    @MapKey(unwrapValue = false)
    @interface MyKey {
        String name();
        Class<?> implementingClass();
        int[] thresholds();
    }
    I can instantiate it
    final class MyKeyImpl implements MyKey {
        private final String name;
        private final Class<?> implementingClass;
        private final int[] thresholds;
        MyKeyImpl(
                String name,
                Class<?> implementingClass,
                int[] thresholds) {
            this.name = name;
            this.implementingClass = implementingClass;
            this.thresholds = thresholds.clone();
        }
        @Override
        public Class<? extends MyKey> annotationType() { return MyKey.class; }
        @Override
        public String name() { return name; }
        @Override
        public Class<?> implementingClass() { return implementingClass; }
        @Override
        public int[] thresholds() { return thresholds.clone();}
    }
    If I convert it to Kotlin
    @MapKey(unwrapValue = false)
    internal annotation class MyKey(val name: String, val implementingClass: KClass<*>, val thresholds: IntArray)
    The below converted Kotlin code is not working.
    internal class MyKeyImpl(
        private val name: String,
        private val implementingClass: Class<*>,
        thresholds: IntArray) : MyKey {
        private val thresholds: IntArray
    
        init {  this.thresholds = thresholds.clone() }
        override fun annotationType(): Class<out MyKey> { return MyKey::class.java }
        override fun name(): String { return name }
        override fun implementingClass(): Class<*> {  return implementingClass }
        override fun thresholds(): IntArray { return thresholds.clone() }
    }
    b
    e
    +2
    • 5
    • 8
  • f

    Fudge

    10/24/2019, 9:33 AM
    Kotlin just hit 15K github releases 😮
    🎆 1
    g
    r
    s
    • 4
    • 5
  • d

    dewildte

    10/25/2019, 3:11 PM
    Has anyone got the Android Emulator to run inside Android Studio 4 yet?
    i
    • 2
    • 1
  • v

    Vague

    10/29/2019, 12:07 PM
    How does android know what state my view is (e.g. checked = true). An example is in NavigationView, when I assign a selector drawable to itemIconTint.
    e
    m
    • 3
    • 5
  • e

    Ellen Spertus

    10/29/2019, 3:21 PM
    An article I wrote for the Stack Overflow blog came out today. No Kotlin in it, though. https://stackoverflow.blog/2019/10/29/my-most-embarrassing-mistakes-as-a-programmer-so-far/
    🙂 2
    ➕ 1
    👍 7
    b
    • 2
    • 1
Powered by Linen
Title
e

Ellen Spertus

10/29/2019, 3:21 PM
An article I wrote for the Stack Overflow blog came out today. No Kotlin in it, though. https://stackoverflow.blog/2019/10/29/my-most-embarrassing-mistakes-as-a-programmer-so-far/
🙂 2
➕ 1
👍 7
b

bodiam

10/29/2019, 9:59 PM
Hi Ellen, that's a wonderful and inspirational blogpost you wrote, and thanks for sharing it here. I've shared it with my colleagues, but mistakes like this are worth sharing, and hopefully we'll learn something from this (my biggest mistake: timezones for opening hours are hard 😉 )
View count: 1