ursus
07/22/2018, 3:24 PMWHEN_ENUM_CAN_BE_NULL_IN_JAVA
is so annoying, then my enum is in kotlinbenleggiero
07/22/2018, 9:02 PMGiulio
07/23/2018, 6:21 PMpyrkamarcin
07/24/2018, 9:06 PM{
ChallengeParameters: {},
AuthenticationResult: {
AccessToken: eyJraWQiOiI3Qnw,
ExpiresIn: 3600,
TokenType: Bearer,
RefreshToken: yJjdHkiOCcr
}
}
There is simple solution?pyrkamarcin
07/24/2018, 9:21 PM.
and -
(internal token char) in regex and run.locke
07/25/2018, 4:31 PMList<Pair<T,S>>
to Map<T,S>
?ivano
07/25/2018, 4:53 PMstegod10
07/26/2018, 8:28 AMArvind Katte
07/26/2018, 9:12 AMalbertm
07/26/2018, 3:34 PMwith(dataList as RecyclerView) {
layoutManager = createNewLayoutManager()
....
}
So I have the RecyclerView and set all the params, but it's not working. It works only if I make the direct cast like this:
(dataList as RecyclerView).layoutManager = createNewLayoutManager()
What I am doing wrong?Hadi Tok
07/26/2018, 9:51 PMval key:String? = getKey() ; key?.mapSingle{ getValue(it) }?.{println(it)}
what should keyword should replace mapSingle
martmists
07/29/2018, 2:31 PMmartmists
07/29/2018, 2:36 PMmartmists
07/29/2018, 2:49 PMNiko
07/30/2018, 9:37 AMAlhima
07/30/2018, 3:30 PMlateinit var myVariable1
that will be injected later and another one is a val that is initialised by a extension function that returns a lazy
with the function that initialises my variable2
(this extension needs my previous lateinit var myVariable1
by parameter) . When Im creating my class, Im receiving an error because the ´lateinit var myVariable1´ is null at the moment that the class is created(and lateinit cannot be null). Shouldnt this be protected? As Im using only that` lateinit var myVariable1` parameter in my lazy function, that will be triggered always after my ´lateinit var´ is injected?ursus
07/30/2018, 7:50 PMvar i = 0
while (i < Math.min(all.size, maxSize)) {
}
other than while, so I can keep the i var indite the loop scopeursus
07/30/2018, 8:24 PMval maxSize = BookDao.RECENTS_SIZE
val all = mutableListOf<RealmObject>()
all.addAll(it.findAllRecentSearchedBooks().run { if (this.size > maxSize) subList(0, maxSize) else this })
all.addAll(it.findAllRecentSearchedAuthors().run { if (this.size > maxSize) subList(0, maxSize) else this })
all.sortByDescending {
when (it) {
is RecentlySearchedBook -> it.timestamp
is RecentlySearchedAuthor -> it.timestamp
else -> error("Unknown type")
}
}
val allUnmamaged = mutableListOf<SearchItem>()
for (i in 0 until Math.min(all.size, maxSize)) {
allUnmamaged.add(it.unmanaged(all[i]) as SearchItem)
}
allUnmamaged
tipsy
07/31/2018, 2:24 PMkarelpeeters
07/31/2018, 9:09 PMnullFirst
for nulls.ursus
08/01/2018, 1:19 AMursus
08/01/2018, 2:10 AMAregev2
08/01/2018, 10:29 AMprint()
in this case)ursus
08/01/2018, 3:56 PMBernhard
08/01/2018, 7:25 PMbdawg.io
08/01/2018, 9:34 PMreduce
operation but I want my accumulator value to be a different type than the types and I want to provide my initial value. Here’s an example using Int and String listOf("1", "10", "100", "1000").reduce(withInitial = 0) { acc: Int, current: String ->
acc + current.toInt()
} // should result in Int(1111)
Bernhard
08/02/2018, 11:50 AMkarelpeeters
08/02/2018, 12:44 PMAregev2
08/02/2018, 1:18 PMzpearce
08/02/2018, 7:42 PMmylist.map { doTheThing(it); it }
zpearce
08/02/2018, 7:42 PMmylist.map { doTheThing(it); it }
diesieben07
08/02/2018, 7:42 PMonEach
zpearce
08/02/2018, 7:46 PM