This file contains 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
/* | |
* Available context bindings: | |
* COLUMNS List<DataColumn> | |
* ROWS Iterable<DataRow> | |
* OUT { append() } | |
* FORMATTER { format(row, col); formatValue(Object, col); getTypeName(Object, col); isStringLiteral(Object, col); } | |
* TRANSPOSED Boolean | |
* plus ALL_COLUMNS, TABLE, DIALECT | |
* | |
* where: |
This file contains 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 com.intellij.database.model.DasTable | |
import com.intellij.database.psi.DbColumnImpl | |
import com.intellij.database.util.Case | |
import com.intellij.database.util.DasUtil | |
/* | |
* Available context bindings: | |
* SELECTION Iterable<DasObject> | |
* FILES files helper | |
*/ |
This file contains 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
sut.getProjectManager().createProject { | |
projectId = "kotlin-sql" | |
projectName = "kotlinでSQL実行できる的ななにか" | |
projectType = ProjectType.Gradle | |
codeReviewIdPattern = "kot-{}" | |
vcsSettings { | |
+vcs(id = "kotlin-sql", vcs = Vcs.git, url = "https://github.com/siosio/kotlin-sql") | |
} | |
} |
This file contains 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 siosio | |
import org.jboss.logging.Logger | |
import java.util.concurrent.ExecutorService | |
import java.util.concurrent.Executors | |
import java.util.concurrent.TimeUnit | |
import javax.batch.operations.JobOperator | |
import javax.batch.runtime.BatchRuntime | |
import javax.batch.runtime.BatchStatus | |
import javax.batch.runtime.Metric |
This file contains 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 TestContext | |
import org.junit.Test | |
import setup | |
import sum | |
import kotlin.test.assertEquals | |
fun sum(a: IntArray) = a.sum() | |
class TestContext<P, OUT> { |
This file contains 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 collatz | |
import kotlin.util.measureTimeMillis | |
import java.util.HashMap | |
import java.util.Arrays | |
val MAX = 100000 | |
fun main(args: Array<String>) { | |
println(measureTimeMillis { |
This file contains 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 Ret(val count:Int, val prev:Int?) { | |
fun next(number:Int) = if (prev == number) | |
Ret(count, number) | |
else | |
Ret(count + 1, number) | |
} | |
fun runs(a: IntArray): Int { | |
return a.fold(Ret(0, null), {(ret, num) -> | |
ret.next(num) |
This file contains 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
fun runs(a : IntArray) : Int { | |
return a.withIndices().count { | |
when (it.first) { | |
0 -> true | |
else -> a.get(it.first - 1) != it.second | |
} | |
} | |
} |
NewerOlder