This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class Holder<T>(private val value:T){ | |
companion object{ | |
fun <T, R> lift(block:(T)->R):(Holder<T>)->Holder<R> = {it.map(block)} | |
} | |
fun <R> map(block:(T)->R):Holder<R> = Holder(block(value)) | |
fun combine(other:Holder<T>, block:(T, T)->T):Holder<T> = map{ block(it, other.value) } | |
} | |
/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.example | |
//fun Int.collatz():List<Int> = collatz1(listOf()) | |
//private tailrec fun Int.collatz1(acc:List<Int>):List<Int> | |
//= when { | |
// this == 1->acc + this | |
// this % 2 == 0->(this / 2).collatz1(acc + this) | |
// else->(this * 3 + 1).collatz1(acc + this) | |
//} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Objects; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
class Main { | |
public static void main(String[] args){ | |
// var cont = new Continuation(5, "unlucky"); | |
// for (int i = 0; i < 10; i++) { | |
// cont = luck(cont); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Objects; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
class Main { | |
public static void main(String[] args){ | |
// var cont = new Continuation(5, "unlucky"); | |
// for (int i = 0; i < 10; i++) { | |
// cont = luck(cont); | |
// System.out.println("my luck :" + cont.ret); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@file:Suppress("UNCHECKED_CAST", "NOTHING_TO_INLINE", "OVERRIDE_BY_INLINE") | |
package kore.savable | |
class ArrayMap(@PublishedApi internal val keyList:List<String>, @PublishedApi internal val valueList:List<Any?>):Map<String, Any?>{ | |
class KeySet(val keyList:List<String>):Set<String>{ | |
override inline val size:Int get() = keyList.size | |
override inline fun isEmpty():Boolean = keyList.isEmpty() | |
override inline fun contains(element:String):Boolean = keyList.indexOf(element) != -1 | |
override inline fun iterator():Iterator<String> = keyList.iterator() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package server | |
import com.sun.management.OperatingSystemMXBean | |
import m42.controller.M42Ctrl | |
import m42.servicemanager.Context | |
import org.springframework.http.server.reactive.ServerHttpRequest | |
import org.springframework.http.server.reactive.ServerHttpResponse | |
import org.springframework.scheduling.annotation.Scheduled | |
import org.springframework.web.bind.annotation.GetMapping | |
import org.springframework.web.bind.annotation.RestController |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package kore.sqlite | |
import android.content.Context | |
import android.database.Cursor | |
import android.database.sqlite.SQLiteDatabase | |
import android.database.sqlite.SQLiteStatement | |
import java.io.File | |
class SQLite( | |
private val context: Context, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package kore.ds2411.dialog | |
import androidx.compose.foundation.background | |
import androidx.compose.foundation.border | |
import androidx.compose.foundation.layout.Arrangement | |
import androidx.compose.foundation.layout.Column | |
import androidx.compose.foundation.layout.Row | |
import androidx.compose.foundation.layout.Spacer | |
import androidx.compose.foundation.layout.fillMaxWidth | |
import androidx.compose.foundation.layout.padding |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const EsbuildLoader = require("esbuild-loader"); | |
config.module.rules.push({ | |
test: /\.js$/, // 모든 JS 파일을 처리 | |
loader: "esbuild-loader", | |
options: { | |
target: "es2015", // ES2015 이상의 모듈만 처리 | |
loader: "js", // JavaScript 처리 | |
}, | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.jetbrains.kotlin.gradle.dsl.JvmTarget | |
import org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile | |
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | |
version = "1.0.0" | |
plugins { | |
alias(libs.plugins.kotlinMultiplatform) | |
// alias(libs.plugins.androidLibrary) | |
} |
NewerOlder