update copyright and clean up comments

This commit is contained in:
itwrx
2025-05-17 09:02:52 -05:00
parent eba14223f1
commit 04b3317f42
16 changed files with 64 additions and 148 deletions

View File

@@ -1,10 +1,11 @@
#[Copyright 2024 ITwrx.
This file is part of Simple Site Manager.
Simple Site Manager is released under the GNU Affero General Public License 3.0.
#[Copyright 2025 ITwrx.
This file is part of Forget-Me-Not.
Forget-Me-Not is released under the GNU Affero General Public License 3.0.
See COPYING or <https://www.gnu.org/licenses/> for details.]#
#TODO: Use a human checker in login form or remove from project.
import std/random
#import sqliteral, "../helpers/db"
type
HumanChecker* = object
@@ -35,32 +36,3 @@ proc getHCById*(id: int): HumanChecker =
for hc in humanCheckers:
if hc.id == id:
return hc
#for some reason we are creating the humanCheckers here and then checking them from the DB, instead of one data location or the other, like we probably should have.
#the below was probably supposed to be a test, but then it just stayed like that.
#[proc getHumanChecker*(): HumanChecker =
{.gcsafe.}:
randomize()
var humanCheckers{.threadvar.}: seq[HumanChecker]
humanCheckers.add(HumanChecker(id: 1, question: "26 + four, minus 10", answer: 20))
humanCheckers.add(HumanChecker(id: 2, question: "10 minus 2, + 14", answer: 22))
humanCheckers.add(HumanChecker(id: 3, question: "15 + five, minus 3", answer: 17))
humanCheckers.add(HumanChecker(id: 4, question: "9 + nine, minus 6", answer: 12))
humanCheckers.add(HumanChecker(id: 5, question: "13 - three, plus 5", answer: 15))
humanCheckers.add(HumanChecker(id: 6, question: "7 + six, plus one", answer: 14))
humanCheckers.add(HumanChecker(id: 7, question: "22 + 8, - 2", answer: 28))
humanCheckers.add(HumanChecker(id: 8, question: "4 - four, + ten", answer: 10))
humanCheckers.add(HumanChecker(id: 9, question: "16 + four, minus three", answer: 17))
humanCheckers.add(HumanChecker(id: 10, question: "twelve minus four, plus 8", answer: 16))
return sample(humancheckers)
proc getHCById*(id: int): HumanChecker =
{.gcsafe.}:
var hc {.threadvar.}: HumanChecker
#prepareDb2SQL()
for row in db2.rows(SelectHumanCheckerById, id):
hc.id = row.getInt(0)
hc.question = row.getString(1)
hc.answer = row.getInt(2)
return hc]#

View File

@@ -1,9 +1,8 @@
#[Copyright 2024 ITwrx.
This file is part of Simple Site Manager.
Simple Site Manager is released under the GNU Affero General Public License 3.0.
#[Copyright 2025 ITwrx.
This file is part of Forget-Me-Not.
Forget-Me-Not is released under the GNU Affero General Public License 3.0.
See COPYING or <https://www.gnu.org/licenses/> for details.]#
#import sqliteral, "../helpers/db", "../helpers/global.nim", sequtils, algorithm, times
import sqliteral, "../helpers/db", algorithm, times
type
@@ -13,9 +12,6 @@ type
var allReminders: seq[Reminder]
#proc myCmp(x, y: Reminder): int =
# cmp(x.sendDate, y.sendDate)
proc getReminderSendDatetime*(reminder: Reminder): DateTime =
let sendDateDTString = $reminder.sendDate & " " & $reminder.sendTimeHr & ":" & $reminder.sendTimeMin & ":" & $reminder.sendTimeAmPm
#single digits for minutes, as db send_time_min is integer and won't use "00", which results in runtime parse error.

View File

@@ -1,6 +1,6 @@
#[Copyright 2024 ITwrx.
This file is part of Simple Site Manager.
Simple Site Manager is released under the GNU Affero General Public License 3.0.
#[Copyright 2025 ITwrx.
This file is part of Forget-Me-Not.
Forget-Me-Not is released under the GNU Affero General Public License 3.0.
See COPYING or <https://www.gnu.org/licenses/> for details.]#
import sqliteral, "../helpers/db"

View File

@@ -1,6 +1,6 @@
#[Copyright 2025 ITwrx.
This file is part of Simple Site Manager.
Simple Site Manager is released under the GNU Affero General Public License 3.0.
This file is part of Forget-Me-Not.
Forget-Me-Not is released under the GNU Affero General Public License 3.0.
See COPYING or <https://www.gnu.org/licenses/> for details.]#
import sqliteral, "../helpers/db"