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 com.jakewharton.picnic.BorderStyle | |
import com.jakewharton.picnic.TextAlignment | |
import com.jakewharton.picnic.table | |
import java.net.URL | |
import kotlin.time.measureTime | |
fun main(args: Array<String>){ | |
fun String.toHtml() = URL(this).openStream().bufferedReader().use { it.readText() } | |
val baseUrlHtml ="https://leagueofcomicgeeks.com/comics".toHtml() | |
// issues based on publisher |
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.locks.ReentrantLock | |
import kotlin.math.max | |
fun main(args: Array<String>){ | |
val text ="A B C D E F G" | |
val trie = Trie(text) | |
println("${" ".repeat(10)}1.START${" ".repeat(10)}") | |
println(trie.addNodeToTrie(1)) |
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
Regex ::= StartOfStringAnchor? Expression | |
Expression ::= Subexpression ("|" Expression)? | |
/* Anything that can be on one side of the alternation. */ | |
Subexpression ::= SubexpressionItem+ | |
SubexpressionItem | |
::= Match | |
| Group | |
| Anchor |
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
/* a fully fledged parser than parses regex expressions into AST on the fly | |
* note the parser is an LL(1), and the grammar used is context-free | |
* right recursive. | |
* Also, the parser does not tokenize the inputs thus making it a little | |
* faster than those that tokenize their inputs. | |
* Currently, it parses all regexes apart from those having | |
* back-references & Zero-Width Positive Lookahead Assertions '?=' | |
* For reference see: https://en.wikipedia.org/wiki/Compilers:_Principles,_Techniques,_and_Tools | |
* */ |
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 kotlinplayground | |
import java.io.IOException | |
import java.net.URI | |
import kotlin.system.measureTimeMillis | |
fun main(vararg args:String) { | |
val url = "https://rest.coinapi.io/v1/assets?apikey=14CCAB31-C529-424C-9407-F9CC89F4C055" | |
val bufferSize = 4096 | |
/* |
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.* | |
import kotlin.random.Random | |
// for references see https://swtch.com/~rsc/regexp/regexp-bytecode.c.txt | |
// https://swtch.com/~rsc/regexp/regexp1.html | |
fun makeRange(start: Char, end: Char): List<Char> { | |
val out = mutableListOf('(') | |
for (s in start until end) { |
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.* | |
import kotlin.random.Random | |
// for references see https://swtch.com/~rsc/regexp/regexp-bytecode.c.txt | |
// https://swtch.com/~rsc/regexp/regexp1.html | |
fun makeRange(start: Char, end: Char): List<Char> { | |
val out = mutableListOf('(') | |
for (s in start until end) { |
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.* | |
import kotlin.random.Random | |
fun makeRange(start: Char, end: Char): List<Char> { | |
val out = mutableListOf('(') | |
for (s in start until end) { | |
out.add(s) | |
out.add('|') |
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 me.gibsoncodes.myapplication | |
import android.os.Build | |
import android.os.FileObserver | |
import android.os.Handler | |
import android.os.HandlerThread | |
import android.os.Looper | |
import android.os.Message | |
import android.util.Log | |
import androidx.lifecycle.DefaultLifecycleObserver |
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 me.gibsoncodes.myapplication | |
import android.os.Handler | |
import android.os.Looper | |
import android.os.Message | |
import android.util.Log | |
import java.util.concurrent.CountDownLatch | |
/* |