Compare commits

..

No commits in common. "a8d873b4fdb579036090cace9fc40d7334f6161b" and "0928dfdd1335f9688fe6ceafeb60c81717f943a2" have entirely different histories.

115 changed files with 148 additions and 1346 deletions

View File

@ -18,10 +18,9 @@
# - the repo root, gates/, scripts/ and .github/ have no entry either, so a
# binary added there is blocked.
#
# An allowlisted file that .gitignore ALSO matches fails silently on
# `git add` rather than erroring. That is enforced, not remembered: the
# ignore-consistency pre-commit hook (scripts/check_ignore_consistency.sh)
# fails the commit if any tracked file is gitignored.
# Every pattern here must also survive `git ls-files | git check-ignore
# --stdin --no-index` printing nothing -- an allowlisted file that .gitignore
# also matches fails silently on `git add` rather than erroring.
# --- Reports and presentations (155 .pdf, 3 .docx, 1 .doc, 1 .pptx) ---------
Programming/*.pdf

View File

@ -1,40 +0,0 @@
name: runnability
# Probes every course directory and fails if any RUNNER is broken.
#
# Deliberately NOT a diff against a committed baseline. A runner's status is a
# property of the machine, not of the commit: MATLAB, Unity and the .NET SDK
# are absent here and present locally, so `runnable` on a laptop and `blocked`
# on ubuntu-latest is correct rather than drift. Diffing the two would make
# this workflow red by construction, which is the one outcome the whole
# exercise is meant to avoid.
#
# What IS a defect, and what this catches: a run.sh that crashes, hangs, or
# reports an unknown kind. Those are `error`, and any `error` fails the job.
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
runnability:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Probe every course directory
run: ./run.sh status
- name: Fail on any broken runner
run: |
set -euo pipefail
if grep -qP '\terror\t' gates/runnability-ci.tsv; then
echo "::error::a course run.sh failed to probe"
grep -P '\terror\t' gates/runnability-ci.tsv
exit 1
fi
echo "all runners probed cleanly"
cut -f2 gates/runnability-ci.tsv | sort | uniq -c

10
.gitignore vendored
View File

@ -479,13 +479,3 @@ target/
# Generated by nginx/ssl/generate-cert.sh -- never commit a private key.
Programming/ERSMS-project/nginx/ssl/nginx.key
Programming/ERSMS-project/nginx/ssl/nginx.crt
# Output of ./run.sh run <dir> for the C++ courses.
build/
# Generated fresh by the runner on each CI run. Committing a local copy
# would label this machine capabilities as the runner is, which is a lie.
gates/runnability-ci.tsv
# Per-course virtualenvs created by ./run.sh run.
.venv/

View File

@ -56,15 +56,6 @@ repos:
language: script
pass_filenames: true
# A tracked file that .gitignore also matches fails silently on
# `git add`. 130 of those were fixed by hand; this keeps them fixed.
- id: ignore-consistency
name: no tracked file is gitignored
entry: scripts/check_ignore_consistency.sh
language: script
pass_filenames: false
always_run: true
# Thin shim into ~/utils, which owns the four markdown namespaces.
- id: md-naming
name: markdown naming convention
@ -72,13 +63,9 @@ repos:
language: system
files: \.(md|markdown)$
# -x so shellcheck FOLLOWS sourced files. The 44 per-course run.sh stubs
# source scripts/course_lib.sh; without -x every one of them reports
# SC1091 "not following", and the only other way to silence that is a
# per-file disable, which is banned here.
- id: shellcheck
name: shellcheck
entry: bash -c 'printf "%s\0" "$@" | xargs -0 -n 40 shellcheck -x' --
entry: bash -c 'printf "%s\0" "$@" | xargs -0 -n 40 shellcheck' --
language: system
types: [shell]
exclude_types: [zsh]

View File

@ -2,57 +2,53 @@
Generated by `./run.sh status`. Do not edit by hand.
Status is recorded PER ENVIRONMENT, from `gates/runnability-local.tsv` and
`gates/runnability-ci.tsv`. A directory that is `runnable` locally and
Status is recorded PER ENVIRONMENT. A directory that is `runnable` locally and
`blocked` in CI is the normal case, not drift: the runner has no MATLAB, no
Unity and no .NET SDK. Each environment rewrites only its own file, so a CI
run cannot clobber the local column.
Unity and no .NET SDK. CI compares only its own column.
`-` means that environment has not probed yet.
| Course | local | ci | Detail (local) |
|---|---|---|---|
| `NotProgramming/DPZ` | runnable | - | builds the report with latexmk |
| `NotProgramming/ECOGR` | runnable | - | builds the report with latexmk |
| `NotProgramming/EDABA` | runnable | - | builds the report with latexmk |
| `NotProgramming/EDABA-LAB` | runnable | - | builds the report with latexmk |
| `NotProgramming/EDISE` | runnable | - | builds the report with latexmk |
| `NotProgramming/EDISP` | no-code | - | submitted lab reports as PDFs only; no source was produced |
| `NotProgramming/ELAC` | runnable | - | builds the report with latexmk |
| `NotProgramming/EMISY` | runnable | - | builds the report with latexmk |
| `NotProgramming/ENUME` | blocked | - | needs MATLAB or Octave (none of: matlab octave) |
| `NotProgramming/EPHY2` | no-code | - | submitted lab reports as PDFs only; no source was produced |
| `NotProgramming/EPOGAI` | no-code | - | a presentation only; no source was produced |
| `NotProgramming/ERPM` | runnable | - | builds the report with latexmk |
| `NotProgramming/ESDP1` | runnable | - | builds the report with latexmk |
| `NotProgramming/ESOEN` | runnable | - | builds the report with latexmk |
| `NotProgramming/MOM` | runnable | - | builds the report with latexmk |
| `NotProgramming/SDM` | runnable | - | builds the report with latexmk |
| `NotProgramming/SDM2` | runnable | - | builds the report with latexmk |
| `NotProgramming/SPD` | runnable | - | builds the report with latexmk |
| `NotProgramming/STUP` | runnable | - | npm install && npm start |
| `Programming/AIS` | runnable | - | builds the report with latexmk |
| `Programming/BD2` | runnable | - | npm install && npm start |
| `Programming/BSS` | runnable | - | builds the report with latexmk |
| `Programming/EADS` | runnable | - | compiles each standalone .cpp |
| `Programming/EARIN` | runnable | - | python3 the entry script |
| `Programming/ECOAR` | runnable | - | make |
| `Programming/ECOTE` | runnable | - | python3 /home/kuhy/WUT_Computer_Science/Programming/ECOTE/program/translator/main.py |
| `Programming/ECRYPT` | no-code | - | test1.py is a 0-byte stub; this course produced no submitted code |
| `Programming/ECRYPT_PROJECT` | runnable | - | python3 the entry script |
| `Programming/EGUI` | runnable | - | dotnet build |
| `Programming/EOOP` | runnable | - | compiles each standalone .cpp |
| `Programming/EOPSY` | runnable | - | make |
| `Programming/EPFU` | runnable | - | make |
| `Programming/E-PSYOPS` | runnable | - | opens in the Unity editor |
| `Programming/ERSMS-project` | runnable | - | docker compose up |
| `Programming/NLP` | runnable | - | python3 the entry script |
| `Programming/PBAD` | blocked | - | jupyter is on PATH but broken (bad interpreter) |
| `Programming/PORR` | runnable | - | python3 /home/kuhy/WUT_Computer_Science/Programming/PORR/code/main.py |
| `Programming/PSD` | runnable | - | starts the Kafka/Flink stack (installs packages with sudo) |
| `Programming/psd_project` | runnable | - | mvn package |
| `Programming/TRAK` | runnable | - | python3 the entry script |
| `Programming/twm_4` | blocked | - | jupyter is on PATH but broken (bad interpreter) |
| `Programming/USD` | no-code | - | README describes a MetaDrive RL assignment; no implementation was submitted |
| `Programming/WDWR` | runnable | - | python3 the entry script |
| `Programming/ZPOB` | runnable | - | builds the report with latexmk |
| Course | local | Detail |
|---|---|---|
| `NotProgramming/DPZ` | unprobed | no run.sh yet |
| `NotProgramming/ECOGR` | unprobed | no run.sh yet |
| `NotProgramming/EDABA` | unprobed | no run.sh yet |
| `NotProgramming/EDABA-LAB` | unprobed | no run.sh yet |
| `NotProgramming/EDISE` | unprobed | no run.sh yet |
| `NotProgramming/EDISP` | unprobed | no run.sh yet |
| `NotProgramming/ELAC` | unprobed | no run.sh yet |
| `NotProgramming/EMISY` | unprobed | no run.sh yet |
| `NotProgramming/ENUME` | unprobed | no run.sh yet |
| `NotProgramming/EPHY2` | unprobed | no run.sh yet |
| `NotProgramming/EPOGAI` | unprobed | no run.sh yet |
| `NotProgramming/ERPM` | unprobed | no run.sh yet |
| `NotProgramming/ESDP1` | unprobed | no run.sh yet |
| `NotProgramming/ESOEN` | unprobed | no run.sh yet |
| `NotProgramming/MOM` | unprobed | no run.sh yet |
| `NotProgramming/SDM` | unprobed | no run.sh yet |
| `NotProgramming/SDM2` | unprobed | no run.sh yet |
| `NotProgramming/SPD` | unprobed | no run.sh yet |
| `NotProgramming/STUP` | unprobed | no run.sh yet |
| `Programming/AIS` | unprobed | no run.sh yet |
| `Programming/BD2` | unprobed | no run.sh yet |
| `Programming/BSS` | unprobed | no run.sh yet |
| `Programming/EADS` | unprobed | no run.sh yet |
| `Programming/EARIN` | unprobed | no run.sh yet |
| `Programming/ECOAR` | unprobed | no run.sh yet |
| `Programming/ECOTE` | unprobed | no run.sh yet |
| `Programming/ECRYPT` | unprobed | no run.sh yet |
| `Programming/ECRYPT_PROJECT` | unprobed | no run.sh yet |
| `Programming/EGUI` | unprobed | no run.sh yet |
| `Programming/EOOP` | unprobed | no run.sh yet |
| `Programming/EOPSY` | unprobed | no run.sh yet |
| `Programming/EPFU` | unprobed | no run.sh yet |
| `Programming/E-PSYOPS` | unprobed | no run.sh yet |
| `Programming/ERSMS-project` | unprobed | no run.sh yet |
| `Programming/NLP` | unprobed | no run.sh yet |
| `Programming/PBAD` | unprobed | no run.sh yet |
| `Programming/PORR` | unprobed | no run.sh yet |
| `Programming/PSD` | unprobed | pre-existing run.sh, no --probe support |
| `Programming/psd_project` | unprobed | no run.sh yet |
| `Programming/TRAK` | unprobed | no run.sh yet |
| `Programming/twm_4` | unprobed | no run.sh yet |
| `Programming/USD` | unprobed | no run.sh yet |
| `Programming/WDWR` | unprobed | no run.sh yet |
| `Programming/ZPOB` | unprobed | no run.sh yet |

View File

@ -1,11 +0,0 @@
#!/bin/bash
#
# NotProgramming/DPZ -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind tex \
-- "$@"

View File

@ -1,11 +0,0 @@
#!/bin/bash
#
# NotProgramming/ECOGR -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind tex \
-- "$@"

View File

@ -1,11 +0,0 @@
#!/bin/bash
#
# NotProgramming/EDABA-LAB -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind tex \
-- "$@"

View File

@ -1,8 +1,4 @@
\documentclass{report}
\usepackage[utf8]{inputenc}
% T1 is required for Polish ogonek characters; without it pdflatex
% fails with "Command \k unavailable in encoding OT1".
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{pdfpages}

View File

@ -1,11 +0,0 @@
#!/bin/bash
#
# NotProgramming/EDABA -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind tex \
-- "$@"

View File

@ -1,11 +0,0 @@
#!/bin/bash
#
# NotProgramming/EDISE -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind tex \
-- "$@"

View File

@ -1,12 +0,0 @@
#!/bin/bash
#
# NotProgramming/EDISP -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind none \
--note "submitted lab reports as PDFs only; no source was produced" \
-- "$@"

View File

@ -1,11 +0,0 @@
#!/bin/bash
#
# NotProgramming/ELAC -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind tex \
-- "$@"

View File

@ -1,11 +0,0 @@
#!/bin/bash
#
# NotProgramming/EMISY -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind tex \
-- "$@"

View File

@ -1,11 +0,0 @@
#!/bin/bash
#
# NotProgramming/ENUME -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind matlab \
-- "$@"

View File

@ -1,12 +0,0 @@
#!/bin/bash
#
# NotProgramming/EPHY2 -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind none \
--note "submitted lab reports as PDFs only; no source was produced" \
-- "$@"

View File

@ -1,12 +0,0 @@
#!/bin/bash
#
# NotProgramming/EPOGAI -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind none \
--note "a presentation only; no source was produced" \
-- "$@"

View File

@ -1,11 +0,0 @@
#!/bin/bash
#
# NotProgramming/ERPM -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind tex \
-- "$@"

View File

@ -1,11 +0,0 @@
#!/bin/bash
#
# NotProgramming/ESDP1 -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind tex \
-- "$@"

View File

@ -1,11 +0,0 @@
#!/bin/bash
#
# NotProgramming/ESOEN -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind tex \
-- "$@"

View File

@ -1,11 +0,0 @@
#!/bin/bash
#
# NotProgramming/MOM -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind tex \
-- "$@"

View File

@ -300,7 +300,7 @@
\item Intuicyjność
\item Materiały
\item Zasoby (Assety)
\item Dostępne funkcje
\item Dostępne funkcje}
\item ChatGPT
\end{itemize}
\end{frame}

View File

@ -1,11 +0,0 @@
#!/bin/bash
#
# NotProgramming/SDM -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind tex \
-- "$@"

View File

@ -1,8 +1,4 @@
\documentclass{beamer}
\usepackage[utf8]{inputenc}
% T1 is required for Polish ogonek characters; without it pdflatex
% fails with "Command \k unavailable in encoding OT1".
\usepackage[T1]{fontenc}
\usepackage[fontsize=20pt]{fontsize}
\usepackage{graphicx}

View File

@ -1,11 +0,0 @@
#!/bin/bash
#
# NotProgramming/SDM2 -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind tex \
-- "$@"

View File

@ -1,9 +1,6 @@
\documentclass[12pt]{article}
\usepackage[polish]{babel}
\usepackage[utf8]{inputenc}
% T1 is required for Polish ogonek characters; without it pdflatex
% fails with "Command \k unavailable in encoding OT1".
\usepackage[T1]{fontenc}
\usepackage{array}
\usepackage{float}
\usepackage{graphicx} % Add this line to include graphics

View File

@ -1,11 +0,0 @@
#!/bin/bash
#
# NotProgramming/SPD -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind tex \
-- "$@"

View File

@ -1,8 +1,4 @@
\documentclass[12pt]{extreport}
\usepackage[utf8]{inputenc}
% T1 is required for Polish ogonek characters; without it pdflatex
% fails with "Command \k unavailable in encoding OT1".
\usepackage[T1]{fontenc}
\begin{document}

View File

@ -1,12 +0,0 @@
#!/bin/bash
#
# NotProgramming/STUP -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind node \
--entry "$(dirname "$(readlink -f "$0")")/makieta" \
-- "$@"

View File

@ -1,8 +1,4 @@
\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
% T1 is required for Polish ogonek characters; without it pdflatex
% fails with "Command \k unavailable in encoding OT1".
\usepackage[T1]{fontenc}
% Packages
\usepackage{amsmath, amssymb, amsthm} % For math symbols and theorems

View File

@ -2,9 +2,6 @@
\usepackage[left=0.75in,right=0.75in,bottom=0.75in]{geometry}
\usepackage[polish]{babel}
\usepackage[utf8]{inputenc}
% T1 is required for Polish ogonek characters; without it pdflatex
% fails with "Command \k unavailable in encoding OT1".
\usepackage[T1]{fontenc}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{enumitem}

View File

@ -1,11 +0,0 @@
#!/bin/bash
#
# Programming/AIS -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind tex \
-- "$@"

View File

@ -1,12 +0,0 @@
#!/bin/bash
#
# Programming/BD2 -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind node \
--entry "$(dirname "$(readlink -f "$0")")/monorepo" \
-- "$@"

View File

@ -1,10 +1,4 @@
% Options belong BEFORE the class name; this read
% \documentclass{article}[12pt], where [12pt] is not a class option at all.
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
% T1 is required for Polish ogonek characters; without it pdflatex
% fails with "Command \k unavailable in encoding OT1".
\usepackage[T1]{fontenc}
\documentclass{article}[12pt]
\usepackage{graphicx}
\title{[BSS]-Lab1-śr16-KrzysztofRudnicki}

View File

@ -1,11 +0,0 @@
#!/bin/bash
#
# Programming/BSS -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind tex \
-- "$@"

View File

@ -1,8 +1,5 @@
\documentclass{article}
\usepackage[utf8]{inputenc}
% T1 is required for Polish ogonek characters; without it pdflatex
% fails with "Command \k unavailable in encoding OT1".
\usepackage[T1]{fontenc}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{graphicx}

View File

@ -1,11 +0,0 @@
#!/bin/bash
#
# Programming/E-PSYOPS -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind unity \
-- "$@"

View File

@ -1,60 +1,55 @@
// Krzysztof Rudnicki, 307585
struct treeNode
{
int key;
treeNode *left;
treeNode *right;
};
class Tree{
private:
treeNode *root;
public:
bool checkKeys(int givenKey);
bool findNode(treeNode*& nodeToFound, int givenKey);
static bool findNodeFrom(treeNode* curr, treeNode*& nodeToFound, int givenKey);
int sumNodeSub(const treeNode* start);
};
int Tree::sumNodeSub(const treeNode* start)
{
// Without this the recursion has no base case and walks off the end of
// the tree; the declaration/definition const mismatch meant the body was
// never compiled, so it was never reached either.
if (start == nullptr) return 0;
return (sumNodeSub(start->right)
+ sumNodeSub(start->left)
+ start->key);
}
// As submitted this did not compile: it called findNode on a treeNode*, which
// is a Tree method, and its while loop never advanced curr so it could not
// have terminated either. Same intent -- search the tree for a key -- expressed
// as the recursion the original was reaching for.
bool Tree::findNodeFrom(treeNode* curr, treeNode*& nodeToFound, int givenKey)
{
if(curr == nullptr) return 0;
if(curr -> key == givenKey)
{
nodeToFound = curr;
return 1;
}
if(findNodeFrom(curr -> left, nodeToFound, givenKey)) return 1;
return findNodeFrom(curr -> right, nodeToFound, givenKey);
}
bool Tree::findNode(treeNode*& nodeToFound, int givenKey)
{
return findNodeFrom(root, nodeToFound, givenKey);
}
bool Tree::checkKeys(int key)
{
treeNode* start;
if (!findNode(start, key)) return 0;
// if we did not find the node we cannot compare the keys of it's left and right subtrees
return (sumNodeSub(start->left) > sumNodeSub(start->right));
// Krzysztof Rudnicki, 307585
struct treeNode
{
int key;
treeNode *left;
treeNode *right;
};
class Tree{
private:
treeNode *root;
public:
bool checkKeys(int givenKey);
bool findNode(treeNode*& nodeToFound, int givenKey);
int sumNodeSub(treeNode* start);
};
int Tree::sumNodeSub(const treeNode* start)
{
return (sumNodeSub(start->right)
+ sumNodeSub(start->left)
+ start->key);
}
bool Tree::findNode(treeNode*& nodeToFound, int givenKey);
{
treeNode* curr = root;
treeNode* Cleft = curr->left;
treeNode* Cright = curr->right;
while(curr != nullptr)
{
if(curr -> key == givenKey)
{
nodeToFound = curr;
return 1;
}else
{
if(Cleft.findNode(nodeToFound, givenKey)) return 1;
if(Cright.findNode(nodeToFound, givenKey)) return 1;
}
}
return 0;
}
bool Tree::checkKeys(int key)
{
treeNode* start;
if (!findNode(start, key)) return 0;
// if we did not find the node we cannot compare the keys of it's left and right subtrees
return (sumNodeSub(start->left) > sumNodeSub(start->right));
}

View File

@ -24,7 +24,7 @@ public:
Node<Key, Info>* getRoot() const;
void destroy(Node<Key, Info>* &someNode);
~Dictionary();
void copyDictionary(Node<Key, Info> *&copiedDictRoot, Node<Key, Info> *otherTreeRoot);
void copyDictionary(Dictionary *&copiedDictRoot, Dictionary *otherTreeRoot);
Dictionary(const Dictionary &other);
void insert(const Key &newKey, const Info &newInfo);
void remove(const Key &keyToRemove);
@ -67,15 +67,13 @@ template<typename Key, typename Info>
Dictionary<Key, Info>::~Dictionary() { destroy(root); }
template<typename Key, typename Info>
void Dictionary<Key, Info>::copyDictionary(Node<Key, Info>* &copiedDictRoot, Node<Key, Info>* otherDictRoot)
void Dictionary<Key, Info>::copyDictionary(Dictionary* &copiedDictRoot, Dictionary* otherDictRoot)
{
if(otherDictRoot == nullptr) copiedDictRoot = nullptr;
else
{
copiedDictRoot = new Node<Key, Info>;
copiedDictRoot->key = otherDictRoot -> key;
copiedDictRoot = new Dictionary;
copiedDictRoot->info = otherDictRoot -> info;
copiedDictRoot->balanceFactor = otherDictRoot -> balanceFactor;
copyDictionary(copiedDictRoot -> left, otherDictRoot -> left);
copyDictionary(copiedDictRoot -> right, otherDictRoot -> right);
}
@ -85,7 +83,7 @@ template<typename Key, typename Info>
Dictionary<Key, Info>::Dictionary(const Dictionary &other)
{
if(other.root == nullptr) root = nullptr;
else copyDictionary(root, other.root);
else copyTree(root, other.root);
}
template<typename Key, typename Info>

View File

@ -1,11 +0,0 @@
#!/bin/bash
#
# Programming/EADS -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind cxx \
-- "$@"

View File

@ -1,8 +1,4 @@
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
% T1 is required for Polish ogonek characters; without it pdflatex
% fails with "Command \k unavailable in encoding OT1".
\usepackage[T1]{fontenc}
\usepackage{graphicx} % Required for inserting images
\usepackage{hyperref}

View File

@ -1,11 +0,0 @@
#!/bin/bash
#
# Programming/EARIN -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind python \
-- "$@"

View File

@ -1,12 +0,0 @@
#!/bin/bash
#
# Programming/ECOAR -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind make \
--entry "$(dirname "$(readlink -f "$0")")/C" \
-- "$@"

View File

@ -1,21 +1,9 @@
# ECOTE translator
To run unit tests:
Enter project environment:
Translates LaTeX `tabular` environments into HTML tables.
source /ecote/bin/activate
| Path | What it is |
|---|---|
| `translator/` | The implementation. Entry point `translator/main.py`. |
| `translator/functional_tests/` | End-to-end fixtures. |
| `unit_tests/test_code/` | 17 pytest modules. |
Run tests:
## Run the tests
```bash
python -m pytest unit_tests
```
> The package used to be called `code/`, which shadows Python's standard
> library `code` module. That is not cosmetic: pytest's debugging plugin
> imports `pdb`, `pdb` imports `code`, and it got this directory instead, so
> the whole suite died with an INTERNALERROR before collecting a single test.
> Renaming it is what makes these tests runnable at all.

View File

@ -1,7 +1,7 @@
"""
Tests begin document function
"""
from translator.main import begin_document
from code.main import begin_document
# Write python tests for a function translating LaTeX documentclass to html
def given_empty_then_error():

View File

@ -1,7 +1,7 @@
"""
Tests begin document function
"""
from translator.main import begin_tabular
from code.main import begin_tabular
# Write python tests for a function translating LaTeX documentclass to html
def given_empty_then_error():

View File

@ -1,4 +1,4 @@
from translator.main import command_name_check
from code.main import command_name_check
def given_valid_then_empty():

View File

@ -1,7 +1,7 @@
"""
Tests document class function
"""
from translator.main import document_class
from code.main import document_class
# Write python tests for a function translating LaTeX documentclass to html

View File

@ -1,4 +1,4 @@
from translator.main import document_class_only_checks
from code.main import document_class_only_checks
def test_missing_curly_bracket():

View File

@ -1,4 +1,4 @@
from translator.main import generic_checks
from code.main import generic_checks
def test_empty_string():

View File

@ -1,4 +1,4 @@
from translator.main import generic_checks_command
from code.main import generic_checks_command
def test_empty_string():

View File

@ -1,7 +1,7 @@
"""
Tests begin document function
"""
from translator.main import length_conversions
from code.main import length_conversions
# Write python tests for a function translating LaTeX documentclass to html

View File

@ -1,4 +1,4 @@
from translator.main import only_pipes_and_space
from code.main import only_pipes_and_space
def given_empty_then_true():

View File

@ -1,4 +1,4 @@
from translator.main import split_columns
from code.main import split_columns
def given_empty_then_correct():

View File

@ -1,4 +1,4 @@
from translator.main import split_rows
from code.main import split_rows
def given_empty_then_correct():

View File

@ -1,4 +1,4 @@
from translator.main import tabular_columns_parameters
from code.main import tabular_columns_parameters
def given_empty_then_error():

View File

@ -2,7 +2,7 @@
Tests tabular_parameters function
"""
from translator.main import tabular_parameters
from code.main import tabular_parameters
def given_empty_then_empty():
"""

View File

@ -2,7 +2,7 @@
Tests tabular_parameters function
"""
from translator.main import tabular_required_parameters
from code.main import tabular_required_parameters
def given_empty_then_error():

View File

@ -1,4 +1,4 @@
from translator.main import translate_column
from code.main import translate_column
def given_empty_then_correct():

View File

@ -1,5 +1,5 @@
from translator.main import translate_inside_to_html
from translator.main import tabular_required_parameters
from code.main import translate_inside_to_html
from code.main import tabular_required_parameters
def given_correct_then_correct():

View File

@ -1,13 +0,0 @@
#!/bin/bash
#
# Programming/ECOTE -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind python \
--entry "$(dirname "$(readlink -f "$0")")/program/translator/main.py" \
--test-dir "$(dirname "$(readlink -f "$0")")/program" \
-- "$@"

View File

@ -1,12 +0,0 @@
#!/bin/bash
#
# Programming/ECRYPT -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind none \
--note "test1.py is a 0-byte stub; this course produced no submitted code" \
-- "$@"

View File

Can't render this file because it is too large.

View File

Can't render this file because it is too large.

View File

@ -1,8 +1,4 @@
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
% T1 is required for Polish ogonek characters; without it pdflatex
% fails with "Command \k unavailable in encoding OT1".
\usepackage[T1]{fontenc}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{float}

View File

@ -1,14 +0,0 @@
#!/bin/bash
#
# Programming/ECRYPT_PROJECT -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
# No --entry on purpose: code/project.py prompts on stdin, so it cannot be run
# headlessly. This course ships a real pytest suite, and that is the check.
course_main --kind python \
--test-dir "$(dirname "$(readlink -f "$0")")/sieve" \
-- "$@"

View File

@ -1,12 +0,0 @@
#!/bin/bash
#
# Programming/EGUI -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind dotnet \
--entry "$(dirname "$(readlink -f "$0")")/lab2/lab2" \
-- "$@"

View File

@ -15,7 +15,7 @@
g++ -Wall -Wextra -Werror -pedantic lab_2.cpp currency.hpp
*/
#include "currency.hpp"
#include "currency2.hpp"
#include <iostream>
int main() {

View File

@ -1,11 +0,0 @@
#!/bin/bash
#
# Programming/EOOP -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind cxx \
-- "$@"

View File

@ -1,12 +0,0 @@
#!/bin/bash
#
# Programming/EOPSY -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind make \
--entry "$(dirname "$(readlink -f "$0")")/lab3/task3/ftp" \
-- "$@"

View File

@ -1,12 +0,0 @@
#!/bin/bash
#
# Programming/EPFU -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind make \
--entry "$(dirname "$(readlink -f "$0")")/penguins/src" \
-- "$@"

View File

@ -1,8 +1,4 @@
\documentclass{article}
\usepackage[utf8]{inputenc}
% T1 is required for Polish ogonek characters; without it pdflatex
% fails with "Command \k unavailable in encoding OT1".
\usepackage[T1]{fontenc}[11pt]
\documentclass{article}[11pt]
\usepackage{graphicx}
\usepackage{float}

View File

@ -1,11 +0,0 @@
#!/bin/bash
#
# Programming/ERSMS-project -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind compose \
-- "$@"

View File

@ -1,11 +0,0 @@
#!/bin/bash
#
# Programming/NLP -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind python \
-- "$@"

View File

@ -1,11 +0,0 @@
#!/bin/bash
#
# Programming/PBAD -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind notebook \
-- "$@"

View File

@ -1,8 +1,4 @@
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
% T1 is required for Polish ogonek characters; without it pdflatex
% fails with "Command \k unavailable in encoding OT1".
\usepackage[T1]{fontenc}
\usepackage{pgfplots}
\usepgfplotslibrary{groupplots}
\pgfplotsset{compat=1.17}

View File

@ -1,12 +0,0 @@
#!/bin/bash
#
# Programming/PORR -- see ../../run.sh for the probe contract.
set -euo pipefail
# shellcheck source-path=SCRIPTDIR
# shellcheck source=../../scripts/course_lib.sh
. "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh"
course_main --kind python \
--entry "$(dirname "$(readlink -f "$0")")/code/main.py" \
-- "$@"

View File

@ -1,21 +1,5 @@
#!/bin/bash
# --probe: report whether this can run here WITHOUT running it, per the
# contract in ../../run.sh. This script is the original coursework runner and
# is deliberately left otherwise untouched, so the probe is a early exit
# rather than a rewrite -- it installs packages with sudo and starts Kafka,
# which is exactly what a probe must never trigger.
if [[ "${1:-}" == "--probe" ]]; then
for tool in python mvn java; do
if ! command -v "$tool" > /dev/null 2>&1; then
echo "needs $tool"
exit 78
fi
done
echo "starts the Kafka/Flink stack (installs packages with sudo)"
exit 0
fi
# Function to run a script in the background and save its PID
run_script() {
python "$1" &

View File

@ -1,9 +1,6 @@
\documentclass[a4paper, 12pt]{article}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
% T1 is required for Polish ogonek characters; without it pdflatex
% fails with "Command \k unavailable in encoding OT1".
\usepackage[T1]{fontenc}
\usepackage[polish]{babel} % Add Polish language support
% Default fixed font does not support bold face

Some files were not shown because too many files have changed in this diff Show More