From 4d0ed31972c6faee58e25676e5009373f67139dc Mon Sep 17 00:00:00 2001 From: dozens Date: Sat, 22 Nov 2025 21:48:02 -0800 Subject: [PATCH] 6:58 is an unremarkable time --- .gitignore | 1 + Makefile | 26 ++++++++++++++++++++ README.md | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++ query.sh | 31 ++++++++++++++++++++++++ sql/rowing.sql | 33 +++++++++++++++++++++++++ 5 files changed, 157 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 README.md create mode 100755 query.sh create mode 100644 sql/rowing.sql diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..65eef93 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +db diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a57429a --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +src:=sql/rowing.sql +db:=db/rowing.sqlite3 + +# the default recipe will work +# as long as PHONYs are followed +# by a comment + +.PHONY: default +# List all recipes +default: + @sed -n '/^\.PHONY:/{ s/^\.PHONY: \(.*\)$$/\1/; N; s/\n/ /; s/ # /::/; p; }' \ + < Makefile \ + | awk -F '::' 'BEGIN { print "Usage:" } { printf "%10s: %s\n",$$1,$$2 }' \ + +.PHONY: db +# Build the database +db: ${db} + +${db}: ${src} + @mkdir -p $(@D) \ + && sqlite3 $@ ".read $<" && echo "Created database." + +.PHONY: clean +# Destroy generated files +clean: + @rm -f ${db} diff --git a/README.md b/README.md new file mode 100644 index 0000000..2fbd3ea --- /dev/null +++ b/README.md @@ -0,0 +1,66 @@ +# ROWING + +## ABOUT + +A database based on the legendary 2017 comment by user 10kTuesdays on a +/r/Rowing post titled "What's a good 2000m time?" + +> Here is the scale I go by for men's rowing. Feel free to refer back to this +> post for future reference. +> +> 5:35 is an extraordinary score 5:36 is an extraordinary score 5:37 is an +> extraordinary score 5:38 is an extraordinary score 5:39 is an extraordinary +> score 5:40 is an exceptional score 5:41 is an exceptional score 5:42 is an +> exceptional score 5:43 is an exceptional score 5:44 is an exceptional score +> 5:45 is a fantastic score 5:46 is a fantastic score 5:47 is a fantastic score +> 5:48 is a fantastic score 5:49 is a fantastic score 5:50 is an awesome score +> 5:51 is an awesome score 5:52 is an awesome score 5:53 is an awesome score +> 5:54 is an awesome score 5:55 is a really great score 5:56 is a really great +> score 5:57 is a really great score 5:58 is a really great score 5:59 is a +> really great score 6:00 is a great score 6:01 is a great score 6:02 is a +> great score 6:03 is a great score 6:04 is a great score 6:05 is a really +> really good score 6:06 is a really really good score 6:07 is a really really +> good score 6:08 is a really really good score 6:09 is a really really good +> score 6:10 is a really good score 6:11 is a really good score 6:12 is a +> really good score 6:13 is a really good score 6:14 is a really good score +> 6:15 is a good score 6:16 is a good score 6:17 is a good score 6:18 is a good +> score 6:19 is a good score 6:20 is a pretty good score 6:21 is a pretty good +> score 6:22 is a pretty good score 6:23 is a pretty good score 6:24 is a +> pretty good score 6:25 is a decent score 6:26 is a decent score 6:27 is a +> decent score 6:28 is a decent score 6:29 is a decent score 6:30 is an alright +> score 6:31 is an alright score 6:32 is an alright score 6:33 is an alright +> score 6:34 is an alright score 6:35 is an average score 6:36 is an average +> score 6:37 is an average score 6:38 is an average score 6:39 is an average +> score 6:40 is an ok score 6:41 is an ok score 6:42 is an ok score 6:43 is an +> ok score 6:44 is an ok score 6:45 is a mediocre score 6:46 is a mediocre +> score 6:47 is a mediocre score 6:48 is a mediocre score 6:49 is a mediocre +> score 6:50 is a pedestrian score 6:51 is a pedestrian score 6:52 is a +> pedestrian score 6:53 is a pedestrian score 6:54 is a pedestrian score 6:55 +> is an unremarkable score 6:56 is an unremarkable score 6:57 is an +> unremarkable score 6:58 is an unremarkable score 6:59 is an unremarkable +> score 7:00 is a beginner score 7:01 is a beginner score 7:02 is a beginner +> score 7:03 is a beginner score 7:04 is a beginner score 7:05 is a poor score +> 7:06 is a poor score 7:07 is a poor score 7:08 is a poor score 7:09 is a poor +> score 7:10 is a bad score 7:11 is a bad score 7:12 is a bad score 7:13 is a +> bad score 7:14 is a bad score 7:15 is a crummy score 7:16 is a crummy score +> 7:17 is a crummy score 7:18 is a crummy score 7:19 is a crummy score 7:20 is +> an awful score 7:21 is an awful score 7:22 is an awful score 7:23 is an awful +> score 7:24 is an awful score 7:25 is an appalling score 7:26 is an appalling +> score 7:27 is an appalling score 7:28 is an appalling score 7:29 is an +> appalling score 7:30 is an atrocious score 7:31 is an atrocious score 7:32 is +> an atrocious score 7:33 is an atrocious score 7:34 is an atrocious score 7:35 +> is an abysmal score 7:36 is an abysmal score 7:37 is an abysmal score 7:38 is +> an abysmal score 7:39 is an abysmal score +> +> To answer you original question of what is a good 2000m time... +> +> That puts you in the 6:15 to 6:19 range. Hope this helps. +> +> https://www.reddit.com/r/Rowing/comments/6r0zft/comment/dl253an/?context=3 + +## GETTING STARTED + +You will need: bash and sqlite + +1. `make db` +2. `./query.sh ` diff --git a/query.sh b/query.sh new file mode 100755 index 0000000..0bae2e3 --- /dev/null +++ b/query.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +if [ "$#" -ne 1 ]; then + echo "Usage: query.sh " + exit 1 +fi + +TIME=$1 +shift + +DB="db/rowing.sqlite3" + +cat< (SELECT REPLACE(MAX(max_time), ':', '') FROM rowing)) + THEN 'You are off the charts too slow' + ELSE + '${TIME} is ' || + CASE + WHEN SUBSTR(LOWER(word), 1, 1) IN ('a', 'e', 'i', 'o', 'u') THEN 'an' + ELSE 'a' + END || ' ' || word || ' time' + END AS message + FROM ( + SELECT rating AS word FROM rowing WHERE '${TIME}' BETWEEN min_time AND max_time + UNION ALL SELECT 1 AS word LIMIT 1 -- dummy selection to make sure the out-of-bounds messages get shown + ); +EOF diff --git a/sql/rowing.sql b/sql/rowing.sql new file mode 100644 index 0000000..b360d97 --- /dev/null +++ b/sql/rowing.sql @@ -0,0 +1,33 @@ +-- create table +CREATE TABLE rowing ( + min_time TEXT NOT NULL, + max_time TEXT NOT NULL, + rating TEXT NOT NULL +); + +-- seed table +INSERT INTO rowing (min_time, max_time, rating) VALUES ('5:35', '5:39', 'extraordinary'); +INSERT INTO rowing (min_time, max_time, rating) VALUES ('5:40', '5:44', 'exceptional'); +INSERT INTO rowing (min_time, max_time, rating) VALUES ('5:45', '5:49', 'fantastic'); +INSERT INTO rowing (min_time, max_time, rating) VALUES ('5:50', '5:54', 'awesome'); +INSERT INTO rowing (min_time, max_time, rating) VALUES ('5:55', '5:59', 'really great'); +INSERT INTO rowing (min_time, max_time, rating) VALUES ('6:00', '6:04', 'great'); +INSERT INTO rowing (min_time, max_time, rating) VALUES ('6:05', '6:09', 'really really good'); +INSERT INTO rowing (min_time, max_time, rating) VALUES ('6:10', '6:14', 'really good'); +INSERT INTO rowing (min_time, max_time, rating) VALUES ('6:15', '6:19', 'good'); +INSERT INTO rowing (min_time, max_time, rating) VALUES ('6:20', '6:24', 'pretty good'); +INSERT INTO rowing (min_time, max_time, rating) VALUES ('6:25', '6:29', 'decent'); +INSERT INTO rowing (min_time, max_time, rating) VALUES ('6:30', '6:34', 'alright'); +INSERT INTO rowing (min_time, max_time, rating) VALUES ('6:35', '6:39', 'average'); +INSERT INTO rowing (min_time, max_time, rating) VALUES ('6:40', '6:44', 'ok'); +INSERT INTO rowing (min_time, max_time, rating) VALUES ('6:45', '6:49', 'mediocre'); +INSERT INTO rowing (min_time, max_time, rating) VALUES ('6:50', '6:54', 'pedestrian'); +INSERT INTO rowing (min_time, max_time, rating) VALUES ('6:55', '6:59', 'unremarkable'); +INSERT INTO rowing (min_time, max_time, rating) VALUES ('7:00', '7:04', 'beginner'); +INSERT INTO rowing (min_time, max_time, rating) VALUES ('7:05', '7:09', 'poor'); +INSERT INTO rowing (min_time, max_time, rating) VALUES ('7:10', '7:14', 'bad'); +INSERT INTO rowing (min_time, max_time, rating) VALUES ('7:15', '7:19', 'crummy'); +INSERT INTO rowing (min_time, max_time, rating) VALUES ('7:20', '7:24', 'awful'); +INSERT INTO rowing (min_time, max_time, rating) VALUES ('7:25', '7:29', 'appalling'); +INSERT INTO rowing (min_time, max_time, rating) VALUES ('7:30', '7:34', 'atrocious'); +INSERT INTO rowing (min_time, max_time, rating) VALUES ('7:35', '7:29', 'abysmal');