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
enum class CVVideoCaptureProperty(val id: Int) { | |
POS_MSEC(0), | |
POS_FRAMES(1), | |
POS_AVI_RATIO(2), | |
FRAME_WIDTH(3), | |
FRAME_HEIGHT(4), | |
FPS(5), | |
FOURCC(6), | |
FRAME_COUNT(7), | |
FORMAT(8), |
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 com.vmichalak.benchmark | |
import org.openjdk.jmh.annotations.Benchmark | |
import org.openjdk.jmh.annotations.Scope | |
import org.openjdk.jmh.annotations.State | |
val text = """ | |
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | |
Nulla pretium ante at commodo gravida. |
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 java.util.* | |
fun main(args: Array<String>) { | |
(1..10).forEach { println(spin("my {little|big} pony")) } | |
} | |
fun spin(value: String): String { | |
var result: String = value | |
val random: Random = Random() | |
val regex: Regex = Regex("\\{[^{}]*}") |
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 kotlin.math.floor | |
/** | |
* This class implement a Linear Congruential Generator. | |
* | |
* @author Valentin Michalak | |
*/ | |
class Random(private var seed: Long = 0) { | |
companion object { |