CLOVIS
10/26/2022, 7:48 PMcallsInPlace
reads "A function declaring the callsInPlace effect must be inline." Yet, withContext
(KotlinX.Coroutines) declares a callsInPlace
effect without being inline. Is it a mistake?Joseph S
10/26/2022, 8:35 PM[x] Cocoapods
ruby (ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.x86_64-darwin21])
* System ruby is currently used
Consider installing ruby 2.7 via Homebrew, rvm or other package manager in case of issues with CocoaPods installation
ruby gems (3.0.3.1)
* cocoapods not found
Get cocoapods from <https://guides.cocoapods.org/using/getting-started.html#installation>
I tried what was mentioned for a solution to this but it does not seem to work. Any help is appreciated.Joseph S
10/26/2022, 9:48 PMMatti Viljamaa
10/27/2022, 7:48 AMInk
10/27/2022, 9:11 AMid: 123, price: 29,99, isAvailable: true
I try to get value of those variables:
val object= string.trim().removeSurrounding("{", "}").split(",").map {
it.split(":")[1].trim()
}
val id = productString[0]
val price = productString[1]
val isAvailable= productString[2].toBooleanOrNull()
The problem is price
. It cointains ,
between 29 and 99 and it makes error. How I can avoid dividing price on two parts in that case? I don't want to use .
instead of ,
Yusuf.I
10/27/2022, 10:13 AMhow can i add a check which checks if a class from set package is a data class or not and if it is not it throws an error
Matti Viljamaa
10/27/2022, 7:27 PMRuckus
10/27/2022, 10:00 PMJoseph S
10/28/2022, 3:01 AMval forBreakfast = Random.nextInt(until = 3).let { menu[it] }
I get most parts of this code except for what does ‘it’ mean in the square brackets? Is it some placeholder variable to represent the generated number or something?Eric Williams
10/28/2022, 1:07 PMAvi Perl
10/28/2022, 2:53 PMAdam Cooper
10/28/2022, 4:12 PMval wordle = Wordle()
get() {
if (this.lastWordListRefresh + 1.hours < Clock.System.now()) {
return Wordle().also {
<http://this.log.info|this.log.info>("Refreshing Wordle state")
this.lastWordListRefresh = Clock.System.now()
}
}
return field
}
My understanding was that returning a different value from get
would set the backing field. But it seems that, if lastWordListRefresh
has "expired", it returns a new object once, and then continues using the old backing object for subsequent calls. Is there a way to make it so that the value returned from get
sets the backing field? I essentially want a property that expires, and then lazily refreshes itself.Joseph S
10/28/2022, 7:24 PMJoseph S
10/28/2022, 7:30 PMJonathan Olsson
10/28/2022, 8:33 PMelect
10/29/2022, 8:13 AMtasks {
withType<KotlinCompile<*>>().all {
kotlinOptions {
freeCompilerArgs += listOf("-Xcontext-receivers")
}
}
Tolga ÇAĞLAYAN
10/29/2022, 4:34 PMmodel.searchTextProperty().addListener((obs, old, val) -> {
var empty = val == null || val.isBlank();
pseudoClassStateChanged(FILTERED, !empty);
navMenu.setPredicate(empty ? PREDICATE_ANY : region -> region instanceof NavLink link && link.matches(val));
});
public void setPredicate(Predicate<Region> predicate) {
content.setPredicate(predicate);
}
I have such a code block, how can I translate it to kotlin language?maarten ha
10/29/2022, 6:28 PMLoney Chou
10/30/2022, 12:17 PM-Xlambdas=indy
, but it seems that kotlin compiler still produces Function class.
fun main() {
val a = 0
l { println(a) }
}
fun l(block: () -> Unit) {
block()
}
Will produce:
NEW test/TestMainKt$main$1
public final static l(Lkotlin/jvm/functions/Function0;)V
final class test/TestMainKt$main$1 extends kotlin/jvm/internal/Lambda implements kotlin/jvm/functions/Function0
Ellen Spertus
10/31/2022, 4:38 AMfold
, which causes IntelliJ to give me a very odd suggestion?Shumilin Alexandr
10/31/2022, 11:03 AMpublic PushSmsResponse sendPushOrSms(PushSmsRequest pushSmsRequest, PushSmsSendRequest pushSmsSendRequest)
and now i try to fix test (Kotlin!) :
whenever(
pushSmsClient.sendPushOrSms(
PushSmsRequest().apply {
… some parameters, setters etc.
},
any<PushSmsSendRequest>() - problem HERE!
how can I write Kotlin code for analog from java :
(ArgumentMatchers.any() as PushSmsSendRequest)
in java it work’s. Mock method with any object PushSmsSendRequest type, how can i do this in Kotlin?Sam Stone
10/31/2022, 2:25 PMdiffs[x][y]
.
I don't even have clear what the edge cases are in a k-diff (based on k-way merge); with a 2-way diff, a given element is either in left, right, or both (in which case a similarity value is given to represent how similar they are).
And how do I represent a k-diff graphically? Some of my thoughts now are along the lines of: find the "added" elements that are only in some lists, and make those green; removed elements that are missing from some lists, and make those red; changed elements, and make those orange. But how do I determine those things? All k elements could be different, and their similarity values could all be different relative to each other.Advitiay Anand
10/31/2022, 8:09 PMLoney Chou
11/01/2022, 1:46 AMStephan Schroeder
11/01/2022, 4:16 PM@Autowired
.
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
class ValidationTest(
private val restTemplate: TestRestTemplate,
) {
@LocalServerPort
private val port = 0
@Test
fun greetingShouldReturnDefaultMessage() {
Assertions.assertThat(restTemplate.getForObject("<http://localhost>:$port/", String::class.java)).contains("405")
}
...
}
Unfortunatle the constructor injection fails before the test is even entered. No ParameterResolver for TestRestTemplate can be found.
No ParameterResolver registered for parameter [org.springframework.boot.test.web.client.TestRestTemplate restTemplate] in constructor [public de.fhirvalidationserver.ValidationTest(org.springframework.boot.test.web.client.TestRestTemplate)].
org.junit.jupiter.api.extension.ParameterResolutionException: No ParameterResolver registered for parameter [org.springframework.boot.test.web.client.TestRestTemplate restTemplate] in constructor [public de.fhirvalidationserver.ValidationTest(org.springframework.boot.test.web.client.TestRestTemplate)].
I assumed SpringBootTest would instanciate an instance of TestRestTemplate for me. Was that the mistake or is something else missing?elect
11/01/2022, 5:22 PMAccessing super members from public-API inline function is deprecatedWhich workarounds are available? I'd need to call the following
class Texture1d : Texture {
inline fun <reified T> load(..): T = super.load<T>(..) // error
Yusuf.I
11/01/2022, 6:39 PModay
11/01/2022, 9:47 PMobject SomeObject
? like by default without appending any typeInk
11/02/2022, 9:27 AMCustomObject myObject = CustomObject.INSTANCE;
I get error cannot find symbol CustomObject
Jonathan Olsson
11/02/2022, 12:23 PManInstance.javaClass
and anInstance::class.java
?Jonathan Olsson
11/02/2022, 12:23 PManInstance.javaClass
and anInstance::class.java
?Sam
11/02/2022, 12:46 PMJonathan Olsson
11/02/2022, 12:52 PMSam
11/02/2022, 12:53 PM