Table of Contents
This API solve two logical problems:
Can be reviewed: https://smklogic.herokuapp.com/index/
This project uses the following libraries and technologies:
- Python3
- Pandas - To analize the txt file
- Django
- PostgresQL - Two tablas created in Ping Pong problem
- GIT
- AWS - The deployed postgres DB attached to heroku settings
Ana, Jose and Juan play ping pong, each of them play the quantity of games viewed below.
If a player lose the game, in the next game the waiting player plays against the winner.
| Player name | Score |
|---|---|
| Ana | 17 |
| José | 15 |
| Juan | 10 |
Question: Who is the loser of the second game? and which games this person lose?
Find the shortest password based in a .txt file, that contain sequences of the password.
A sequence contain some characters of the password keeping the order.
password: 34879 one possible sequence: 389
The input file must contain a sequence per line. An example file can be dowloaded from:
Right clic and Save Link As ...:
https://raw.githubusercontent.com/datacloudgui/logic_problems_API/main/keylog.txt
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
This is an example of how to list things you need to use the software and how to install them.
- npm
npm install npm@latest -g
-
Clone the repo
git clone https://github.com/datacloudgui/logic_problems_API.git
-
Don forget setup your virtual environment with your favorite tool
-
Activate the virtual environment and install the dependencies
-
Install requirements
pip install -r requirements.txt
-
Setup a Postgres DB, the recommended way is using a
docker run --rm --name core-postgres -p 5432:5432 -e POSTGRES_PASSWORD=secret -d postgres
To use locally just run the server
python manage.py runserverThe two main files that contain the solution to the problems can be tested:
- Test the Ping Pong problem
Those test was writen using the Django dedicated file tests.py and can be run with:
python manage.py test logic.tests- Test the Password finder
Those test was writen into the file that define the Class writen and can be run with:
python logic/password_finder.pyGuillermo Sanchez - @datacloudgui - guillermo@datacloudgui.com
Personal page: datacloudgui.com
- Othneil Drew by this amazing template.