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.Random; | |
| import java.util.concurrent.*; | |
| public class FastestResultPlayground { | |
| static void sleep(long millis) { | |
| try { | |
| // Simulating a heavy job | |
| Thread.sleep(millis); | |
| } catch (Exception e) { | |
| throw new RuntimeException(e); |
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
| /** | |
| The SimpleQueryStatement enfoces the statement type to "SELECT". It's useful | |
| when using some special sql querys, such as sqlite3 query 'PRAGMA database_list;'. | |
| Usage: | |
| Like `Transaction.exec()` | |
| ``` | |
| val someValue = transaction { |
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.math.BigDecimal | |
| class FibonacciIterator : Iterator<BigDecimal> { | |
| var generations = 0L | |
| private set | |
| private var ancient = BigDecimal(0) | |
| private var parents = BigDecimal(1) | |
| override fun hasNext(): Boolean { |
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.io.ByteArrayOutputStream | |
| object Hexagram64 { | |
| private const val zero = '䷀' | |
| private const val nil = '⚋' | |
| fun parse(string: String): ByteArray = ByteArrayOutputStream(128).use { stream -> | |
| var count = 0 | |
| var length = 0 | |
| var data = 0 |
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 net.catten.demo | |
| import java.util.* | |
| import kotlin.math.abs | |
| private const val dummy = '_' | |
| private val codec = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".toSet().toCharArray() | |
| private val base = codec.size | |
| private val max = Long.MAX_VALUE.toCustomBase() |
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
| #!/bin/bash | |
| set -e | |
| app_name="" | |
| app_username="" | |
| app_password="123456" | |
| app_user_host="localhost" | |
| db_name="" | |
| mysql_username="root" | |
| mysql_password="" |
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 net.catten.json.huge.extractor.complex | |
| import com.fasterxml.jackson.databind.JsonNode | |
| import com.fasterxml.jackson.databind.node.JsonNodeType | |
| import java.util.* | |
| import kotlin.collections.ArrayList | |
| class JsonCat { | |
| fun extractJson(jsonNode: JsonNode): List<JsonKnot> { |
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
| /* | |
| Author : https://www.cnblogs.com/kidney/p/5351133.html | |
| */ | |
| * { | |
| -webkit-box-sizing: border-box; | |
| -moz-box-sizing: border-box; | |
| box-sizing: border-box; | |
| } |
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.hibernate.dialect.MySQL5Dialect; | |
| public class MySQLNDB7Dialect extends MySQL5Dialect { | |
| @Override | |
| public boolean supportsCascadeDelete() { | |
| return true; | |
| } | |
| @Override |
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 com.shinonometn.iot.commons.database; | |
| import com.fasterxml.jackson.core.JsonProcessingException; | |
| import com.fasterxml.jackson.databind.JavaType; | |
| import com.fasterxml.jackson.databind.ObjectMapper; | |
| import com.fasterxml.jackson.databind.ObjectReader; | |
| import com.fasterxml.jackson.databind.ObjectWriter; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; |
NewerOlder