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
function s = jdbcquery(conn, sqlstr) | |
% Connect to database, execute SQL string, and pass back structure array. | |
% | |
% Usage: | |
% s = jdbcquery(conn, sqlstr) | |
% | |
% Input | |
% conn: A java.sql.Connection object. See Also database | |
% sqlstr: SQL string, i.e. 'SELECT * FROM Observation WHERE ConceptName LIKE ''Pandalus%''' | |
% |
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
function c = database(url, user, password, driverName) | |
% DATABASE - connect to a SQL database | |
% | |
% Usage: | |
% c = database(url, user, password, driverName) | |
% | |
% Inputs: | |
% url = The database URL. e.g. jdbc:jtds:sqlserver://solstice.shore.mbari.org:1433/EXPD | |
% user = The user name to connect to the database | |
% password = THe password for user |
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
#!/usr/bin/env -S scala-cli shebang --scala-version 3.1.2 | |
/* | |
Proof of concept to convert iFDO YAML to FathomNet CSV | |
Requirements: | |
- Install scala-cli https://scala-cli.virtuslab.org | |
Usage: | |
ifdo-to-fathomnet.sc <ifdo-yaml-file> > <fathomnet-csv-file> |
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.lang.System.Logger | |
import java.lang.System.Logger.Level | |
import java.util.function.Supplier | |
/** | |
* * @author Brian Schlining | |
*/ | |
object Logging: | |
case class LoggerBuilder( |
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
#!/usr/bin/env bash | |
echo "--- Building vars-kb-server (reminder: run docker login first!!)" | |
VCS_REF=`git tag | sort -V | tail -1` | |
docker buildx build --platform linux/amd64,linux/arm64 \ | |
-t mbari/vars-kb-server:${VCS_REF} \ | |
-t mbari/vars-kb-server:latest \ | |
--push . \ |
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.lang.System.Logger | |
import java.lang.System.Logger.Level | |
object Logging: | |
private def logAndReturn[T](obj: T, logger: Logger, level: Level, fn: T => String): T = | |
if logger.isLoggable(level) then | |
logger.log(level, fn(obj)) | |
obj |
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
set -g __fish_prompt_grey A3A3A3 | |
set -g __fish_git_prompt_char_cleanstate "✔" | |
set -g __fish_git_prompt_char_conflictedstate "✖" | |
set -g __fish_git_prompt_char_dirtystate "✚" | |
set -g __fish_git_prompt_char_stagedstate "●" | |
set -g __fish_git_prompt_char_stateseparator \U0020 #\Ue725 | |
set -g __fish_git_prompt_char_untrackedfiles "…" | |
set -g __fish_git_prompt_char_upstream_ahead "↑" | |
set -g __fish_git_prompt_char_upstream_behind "↓" | |
set -g __fish_git_prompt_char_upstream_prefix "" |
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.net.URL | |
import scala.deriving.* | |
import scala.compiletime.{summonAll} | |
import java.nio.file.Path | |
/** | |
* Base function we use to convert case classes to CSV | |
* @param a The object to convert | |
*/ | |
def transform[A : Transformer](a: A) = summon[Transformer[A]].f(a) |
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
#!/usr/bin/env scala | |
/* | |
@author Brian Schlining | |
@since 2021-10-25 | |
Scala version of example code at | |
https://python.plainenglish.io/send-http-requests-as-fast-as-possible-in-python-304134d46604 | |
*/ |
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
Framework | latency_ms | latency_ms_std | requests_sec | mb_sec | pct_max | |
---|---|---|---|---|---|---|
Cask | 61.76 | 7.16 | 4022.49 | 33.89 | 58.1 | |
Helidon | 57.33 | 7.45 | 4333.65 | 36.39 | 62.4 | |
http4s | 65.57 | 75.05 | 3928.46 | 32.98 | 56.6 | |
Javalin | 82.35 | 21.99 | 2959.23 | 24.48 | 42.0 | |
Scalatra | 58.34 | 3.88 | 4253.52 | 35.67 | 61.2 | |
SparkJava | 59.90 | 27.87 | 3347.74 | 28.30 | 48.6 | |
Vert.xWeb | 35.61 | 1.25 | 6980.19 | 58.29 | 100 | |
ZIOHttp | 57.03 | 6.46 | 4346.36 | 35.47 | 60.9 |