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
public class App | |
{ | |
private static final String JDBC_DRIVER = "org.sqlite.JDBC"; | |
private static final String CONNECTION_STRING = "jdbc:sqlite:/tmp/testdb.db"; | |
public static void main( String[] args ) throws SQLException, ClassNotFoundException { | |
SQLiteDataSource ds = new SQLiteDataSource(); | |
ds.setUrl("jdbc:sqlite:/tmp/data.db"); | |
DBI dbi = new DBI(ds); | |
Handle h = dbi.open(); |
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
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # | |
# Yet-Another-Bench-Script # | |
# v2023-04-23 # | |
# https://github.com/masonr/yet-another-bench-script # | |
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # | |
Sun Aug 6 17:43:28 UTC 2023 | |
Basic System Information: | |
--------------------------------- |
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
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # | |
# Yet-Another-Bench-Script # | |
# v2023-04-23 # | |
# https://github.com/masonr/yet-another-bench-script # | |
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # | |
Sun Aug 6 04:01:44 UTC 2023 | |
Basic System Information: | |
--------------------------------- |
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
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # | |
# Yet-Another-Bench-Script # | |
# v2023-04-23 # | |
# https://github.com/masonr/yet-another-bench-script # | |
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # | |
Sun Aug 6 03:39:44 UTC 2023 | |
Basic System Information: | |
--------------------------------- |
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
# v2023-04-23 # | |
# https://github.com/masonr/yet-another-bench-script # | |
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # | |
Sat Aug 5 23:24:44 EDT 2023 | |
ARM compatibility is considered *experimental* | |
Basic System Information: | |
--------------------------------- |
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
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # | |
# Yet-Another-Bench-Script # | |
# v2023-04-23 # | |
# https://github.com/masonr/yet-another-bench-script # | |
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # | |
Sun Aug 6 03:07:53 UTC 2023 | |
Basic System Information: | |
--------------------------------- |
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
use async_std::task::sleep; | |
use crypto::digest::Digest; | |
use crypto::sha1::Sha1; | |
use futures_util::*; | |
use roux::comment::CommentData; | |
use roux_stream::stream_comments; | |
use serde_json::{json, Value}; | |
use std::{borrow::Borrow, collections::HashSet, time::Duration}; | |
use tokio_retry::strategy::ExponentialBackoff; | |
use chrono::{self, Timelike}; |
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
/* | |
* Copyright (c) 2013 Mindoo GmbH | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
infix fun <T,O>List<T>.cartesianProduct(others:List<O>):List<Pair<T,O>> = | |
flatMap{ t:T-> | |
others.map { o-> Pair(t,o) } | |
} | |
inline fun <T, O, R> List<T>.mapCartesianProduct(others: List<O>, transform: (Pair<T, O>) -> R): List<R> = | |
flatMap { t: T -> | |
others.map { o -> transform(Pair(t, o)) } | |
} |
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
fun main() { | |
val rooms = mutableMapOf<String, MutableSet<ServerWebSocket>>() | |
val vertx = Vertx.vertx() | |
vertx.createHttpServer() | |
.webSocketHandler { | |
rooms.computeIfPresent(it.path()) { _, listOfConnections -> | |
listOfConnections.add(it) | |
listOfConnections | |
} | |
rooms.computeIfAbsent(it.path()) { _ -> mutableSetOf(it) } |
NewerOlder