# google-foobar-2023-q4
## Production
<!-- todo
add some assets
# pip install google-foobar-2023-q4
hychan48-cake-is-not-a-lie --help
-->
### Installation
```bash
# https://replit.com/@jasonchan51/hychan48-google-foobar-2023-q4
pipx install hychan48-google-foobar-2023-q4
hychan48-cake-is-not-a-lie --help
hychan48-cake-is-not-a-lie abab
hychan48-dont-get-volunteered 0 1
```
<!--
# pipx install git+https://github.com/hychan48/google-foobar-2023-q4.git
#pipx run --spec git+
# Returns 2
```
-->
## Level 1
* [readme_q1_the-cake-isnot-a-lie.md](levels/q1/readme_q1_the-cake-isnot-a-lie.md)
```bash
hychan48-cake-is-not-a-lie abab
# GitHub action runs the PyTests:
pytest levels/q1/tests/solutions_test.py
# JavaScript solution
pnpm run test:q1
```
## level 2
### Question 1
* [readme_q2_dont-get-volunteered.md](levels/q2/readme_q2_dont-get-volunteered.md)
* Simplified Knight's Tour problem
* Textbook BFS, but I wanted to animate it
* [BFS Wiki](https://en.wikipedia.org/wiki/Breadth-first_search)
* [Knight's Tour Game](https://www.maths-resources.com/knights/)
* Experimented with ILP. Good example to teach with
```bash
hychan48-dont-get-volunteered 0 1 # Returns 3
pytest ./levels/q2/tests/solutions_bfs_test.py
```
## Background
* https://github.com/hychan48/google-foobar-2023-q4
* I searched proxy vs load balancer. and at first I found it mad sketch
* had to verify it's SSL/TLS cert and Google was foobar was.
## Assumptions
* So far it looks like it's either Python 2.7 or Java 8
* I'm going to use Python 3.11.6, using basic syntax it should be backwards compatible with 2.7
* Also, I have PyCharm installed already
* TDD with PyTest
# Quick Checklist
- [ ] Documentation
- Save Original Question
- [ ] /api/v1/files/ (.json)
- [ ] convert to .yaml and .html
- Reword Question and Keywords
- [ ] readme_q.template.md
- Principles
- TDD
- Quick and dirty
- Unless the question piques my research interest
- 7 days per question seems like a lot of time
- Priorities
- [ ] JSDoc @typedef but for Python
- [ ] Metadata
- [ ] Author
- [ ] GitHub Repo
- [ ] Environment
- Time / Space Complexity (if applicable)
- [ ] Validation / Error handling
- [ ] Test cases / Unit Tests
- [ ] Workflow with GitHub actions
- Lint - Flake8
- Unit Tests - PyTest
# dev setup
```bash
# there's also some helpers
conda activate ./venv
# newer method
# pull
# bats installs differently? weird
# mostly for bats
git pull --recurse-submodule
## bats clones to test/ by default
#
# first time
# pipx / conda(mamba) / poetry
git submodule add https://github.com/bats-core/bats-core.git test/bats
git submodule add https://github.com/bats-core/bats-assert.git test/test_helper/bats-assert
git submodule add https://github.com/bats-core/bats-support.git test/test_helper/bats-support
git commit -m 'Add bats-support library'
tree test/bats/bin
mkdir -p ~/.local/bin
rm ~/.local/bin/bats
ln -s $PWD/test/bats/bin/bats ~/.local/bin/bats
ln -s $PWD/test/bats/bin/bats /usr/local/bin/bats
ln -s ./test/bats/bin/bats /usr/local/bin/bats
ls -l /usr/local/bin/bats
bats
export PATH=$PATH:~/.local/bin
# git submodule add https://github.com/ztombol/bats-support test/test_helper/bats-support
```
```powershell
# cygwin / windows 11
pnpm i
# haha didnt work:
conda create -n foobar-py27 python=2.7
conda create -n google-foorbar-2023-q4 python=3.11
conda activate google-foorbar-2023-q4
# update pipx
pipx --version
python -m pip install --user pipx
python -m pipx ensurepath
# poetry... too basic to need it... todo: move to other section
# might not be needed after all...
pipx install poetry
poetry --version
poetry init
# poetry might not be needed after all...
poetry add pytest --group dev
#poetry shell
# 3.11.4 vs 3.11.6... interesting
```
### Install pytest
```bash
conda activate google-foorbar-2023-q4
python -m pip install pytest
python -m pip install -r requirements.txt
```
## Appendix
* [/api/v1/files/](https://foobar.withgoogle.com/api/v1/files/)
Raw data
{
"_id": null,
"home_page": "https://github.com/hychan48/google-foobar-2023-q4",
"name": "hychan48-google-foobar-2023-q4",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9,<3.12",
"maintainer_email": "",
"keywords": "google,foobar,python",
"author": "JC",
"author_email": "jchan48@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/59/48/dba878fa30b9e94689df5f3842fc3b99afdf0e817ee17454ca82e19914a2/hychan48_google_foobar_2023_q4-0.2.2.tar.gz",
"platform": null,
"description": "# google-foobar-2023-q4\n## Production\n<!-- todo\nadd some assets\n# pip install google-foobar-2023-q4\nhychan48-cake-is-not-a-lie --help\n-->\n\n### Installation\n```bash\n# https://replit.com/@jasonchan51/hychan48-google-foobar-2023-q4\npipx install hychan48-google-foobar-2023-q4\n\nhychan48-cake-is-not-a-lie --help\nhychan48-cake-is-not-a-lie abab\nhychan48-dont-get-volunteered 0 1\n```\n<!-- \n# pipx install git+https://github.com/hychan48/google-foobar-2023-q4.git\n#pipx run --spec git+\n\n# Returns 2\n\n```\n -->\n\n## Level 1\n* [readme_q1_the-cake-isnot-a-lie.md](levels/q1/readme_q1_the-cake-isnot-a-lie.md)\n```bash\nhychan48-cake-is-not-a-lie abab\n\n# GitHub action runs the PyTests:\npytest levels/q1/tests/solutions_test.py\n# JavaScript solution\npnpm run test:q1\n```\n\n## level 2 \n### Question 1\n* [readme_q2_dont-get-volunteered.md](levels/q2/readme_q2_dont-get-volunteered.md)\n* Simplified Knight's Tour problem\n * Textbook BFS, but I wanted to animate it\n * [BFS Wiki](https://en.wikipedia.org/wiki/Breadth-first_search)\n * [Knight's Tour Game](https://www.maths-resources.com/knights/)\n* Experimented with ILP. Good example to teach with\n```bash\nhychan48-dont-get-volunteered 0 1 # Returns 3\npytest ./levels/q2/tests/solutions_bfs_test.py\n```\n\n## Background\n* https://github.com/hychan48/google-foobar-2023-q4\n* I searched proxy vs load balancer. and at first I found it mad sketch\n* had to verify it's SSL/TLS cert and Google was foobar was.\n\n## Assumptions\n* So far it looks like it's either Python 2.7 or Java 8\n* I'm going to use Python 3.11.6, using basic syntax it should be backwards compatible with 2.7\n * Also, I have PyCharm installed already\n* TDD with PyTest\n\n\n\n\n# Quick Checklist\n- [ ] Documentation\n - Save Original Question\n - [ ] /api/v1/files/ (.json)\n - [ ] convert to .yaml and .html\n - Reword Question and Keywords\n - [ ] readme_q.template.md\n - Principles\n - TDD\n - Quick and dirty\n - Unless the question piques my research interest\n - 7 days per question seems like a lot of time\n - Priorities\n - [ ] JSDoc @typedef but for Python \n - [ ] Metadata\n - [ ] Author\n - [ ] GitHub Repo\n - [ ] Environment\n - Time / Space Complexity (if applicable)\n- [ ] Validation / Error handling\n- [ ] Test cases / Unit Tests\n - [ ] Workflow with GitHub actions\n - Lint - Flake8\n - Unit Tests - PyTest\n\n# dev setup\n```bash\n# there's also some helpers\nconda activate ./venv\n\n# newer method\n\n# pull\n# bats installs differently? weird\n# mostly for bats\ngit pull --recurse-submodule\n\n## bats clones to test/ by default\n# \n\n# first time\n# pipx / conda(mamba) / poetry\n\ngit submodule add https://github.com/bats-core/bats-core.git test/bats\ngit submodule add https://github.com/bats-core/bats-assert.git test/test_helper/bats-assert\ngit submodule add https://github.com/bats-core/bats-support.git test/test_helper/bats-support\ngit commit -m 'Add bats-support library'\n\ntree test/bats/bin\nmkdir -p ~/.local/bin\nrm ~/.local/bin/bats\nln -s $PWD/test/bats/bin/bats ~/.local/bin/bats \nln -s $PWD/test/bats/bin/bats /usr/local/bin/bats\nln -s ./test/bats/bin/bats /usr/local/bin/bats\nls -l /usr/local/bin/bats\nbats\nexport PATH=$PATH:~/.local/bin\n\n# git submodule add https://github.com/ztombol/bats-support test/test_helper/bats-support\n\n```\n\n\n```powershell\n# cygwin / windows 11\npnpm i\n# haha didnt work:\nconda create -n foobar-py27 python=2.7\nconda create -n google-foorbar-2023-q4 python=3.11\n\nconda activate google-foorbar-2023-q4\n\n# update pipx\npipx --version\npython -m pip install --user pipx\npython -m pipx ensurepath\n\n# poetry... too basic to need it... todo: move to other section\n# might not be needed after all...\npipx install poetry\npoetry --version\npoetry init\n\n# poetry might not be needed after all...\npoetry add pytest --group dev\n#poetry shell\n# 3.11.4 vs 3.11.6... interesting\n```\n\n### Install pytest\n```bash\nconda activate google-foorbar-2023-q4\npython -m pip install pytest\n\npython -m pip install -r requirements.txt\n```\n## Appendix\n* [/api/v1/files/](https://foobar.withgoogle.com/api/v1/files/)\n\n\n",
"bugtrack_url": null,
"license": "AGPL-3.0",
"summary": "JC's Google Foobar Journey - 2023 Q4",
"version": "0.2.2",
"project_urls": {
"Homepage": "https://github.com/hychan48/google-foobar-2023-q4",
"Repository": "https://github.com/hychan48/google-foobar-2023-q4"
},
"split_keywords": [
"google",
"foobar",
"python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d26939629a1a5c736036b626c08a6b7b1b78c7e690006a2c9c9cddcd3a38c25c",
"md5": "f29951e8b0ed96c6ae9d5b5b728e0608",
"sha256": "2f6d5cda6811abdc8bfb3c613a2ed43e734e3f82d03268ff7017c100331d852b"
},
"downloads": -1,
"filename": "hychan48_google_foobar_2023_q4-0.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f29951e8b0ed96c6ae9d5b5b728e0608",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9,<3.12",
"size": 62598,
"upload_time": "2023-11-13T07:38:04",
"upload_time_iso_8601": "2023-11-13T07:38:04.633137Z",
"url": "https://files.pythonhosted.org/packages/d2/69/39629a1a5c736036b626c08a6b7b1b78c7e690006a2c9c9cddcd3a38c25c/hychan48_google_foobar_2023_q4-0.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5948dba878fa30b9e94689df5f3842fc3b99afdf0e817ee17454ca82e19914a2",
"md5": "bbac576c83cca13cf161b534cee65c66",
"sha256": "fb1f37f479f1cc2cfd5c943285b1949751f18d18a09d1ab703863127452b0801"
},
"downloads": -1,
"filename": "hychan48_google_foobar_2023_q4-0.2.2.tar.gz",
"has_sig": false,
"md5_digest": "bbac576c83cca13cf161b534cee65c66",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9,<3.12",
"size": 54020,
"upload_time": "2023-11-13T07:38:06",
"upload_time_iso_8601": "2023-11-13T07:38:06.453120Z",
"url": "https://files.pythonhosted.org/packages/59/48/dba878fa30b9e94689df5f3842fc3b99afdf0e817ee17454ca82e19914a2/hychan48_google_foobar_2023_q4-0.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-13 07:38:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hychan48",
"github_project": "google-foobar-2023-q4",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "argcomplete",
"specs": [
[
"==",
"3.1.1"
]
]
},
{
"name": "click",
"specs": [
[
"==",
"8.1.6"
]
]
},
{
"name": "colorama",
"specs": [
[
"==",
"0.4.6"
]
]
},
{
"name": "iniconfig",
"specs": [
[
"==",
"2.0.0"
]
]
},
{
"name": "packaging",
"specs": [
[
"==",
"23.2"
]
]
},
{
"name": "pipx",
"specs": [
[
"==",
"1.2.0"
]
]
},
{
"name": "pluggy",
"specs": [
[
"==",
"1.3.0"
]
]
},
{
"name": "pytest",
"specs": [
[
"==",
"7.4.3"
]
]
},
{
"name": "userpath",
"specs": [
[
"==",
"1.9.0"
]
]
}
],
"lcname": "hychan48-google-foobar-2023-q4"
}