{"id":18687755,"url":"https://github.com/jorgechato/warmup","last_synced_at":"2026-05-01T00:31:51.722Z","repository":{"id":84530405,"uuid":"169863286","full_name":"jorgechato/warmup","owner":"jorgechato","description":"A simple repository with a bunch of exercises, from algorithms, to designs.","archived":false,"fork":false,"pushed_at":"2019-02-10T23:02:08.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-18T20:06:09.001Z","etag":null,"topics":["algorithm","design","docker","travis-ci"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jorgechato.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-09T12:09:59.000Z","updated_at":"2019-02-11T07:44:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"66c6b4e7-d7b5-4e99-b0f7-0ede1bb3d253","html_url":"https://github.com/jorgechato/warmup","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jorgechato/warmup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgechato%2Fwarmup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgechato%2Fwarmup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgechato%2Fwarmup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgechato%2Fwarmup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jorgechato","download_url":"https://codeload.github.com/jorgechato/warmup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgechato%2Fwarmup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32481553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","design","docker","travis-ci"],"created_at":"2024-11-07T10:34:01.198Z","updated_at":"2026-05-01T00:31:51.630Z","avatar_url":"https://github.com/jorgechato.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Warmup\n[![Build Status](https://travis-ci.org/jorgechato/warmup.svg?branch=master)](https://travis-ci.org/jorgechato/warmup)\n\nIn this repository there are 2 Algorithms exercises, 1 Design pattern and 1 Architecture design.\n\nAll the modules are in a CI/CD pipeline to run the tests. The architecture module is integrated into the deployment process with docker and heroku.\n\n## Algorithms\n\n### Palindrome\n\n#### Run\n\n```zsh\n# Run palindrome\n$ python -m algorithms.palindrome\n\n# Run tests\n$ python -m algorithms.palindrome_tests -v\n```\n\n### Unique triplets sum == 0\n\n#### Run\n\n```zsh\n# Run unique triplets sum == 0\n$ python -m algorithms.triplets\n\n# Run tests\n$ python -m algorithms.triplets_tests -v\n```\n\n## Design Patterns\n\n### Object pool library\n\n- `opool_sample` is the first iteration of the Pool.\n- `opool` object pool library (Use case: database connection)\n    - `opool_demo` demo of how to use the library.\n    - `opool_tests` unit tests.\n\n**Advantages**\n\n- It offer a significant performance boost.\n- It manages the connections and provides a way to reuse and share them.\n- Object pool pattern is used when the rate of initializing a instance of the class is high.\n\n#### Use\n\n```python\nfrom design.opool import Pool\n\npool = Pool([1, 2, 3])\n# Lease an object from the pool\n# Context manager is the way to use it.\nwith pool.lease() as val:\n    # ...\n    # use val as the object\n    # ...\n```\n\n#### Run\n\n```zsh\n# Run library\n$ python -m design.opool_demo\n\n# Run tests\n$ python -m design.opool_tests -v\n```\n\n## Architecture Designs\n\n### Short URL\n\n#### Install \u0026 Run\n\n```zsh\n# Run library\n$ python FLASK_APP=architecture/app flask run\n```\n\n```zsh\n# Short the URL\n$ curl -X PUT \"https://warmup-short-url.herokuapp.com/shorten\" -H \"accept: application/json\" -H \"Content-Type: application/json\" -d \"{ \\\"url\\\": \\\"http://jorgechato.com\\\"}\"\n\n{\"__this\": \"http://warmup-short-url.herokuapp.com/shorten\", \"original\": \"http://jorgechato.com\", \"short\": \"http://warmup-short-url.herokuapp.com/rfWfV\"}\n\n# Get the original URL\n$ curl -X PUT \"https://warmup-short-url.herokuapp.com/original\" -H \"accept: application/json\" -H \"Content-Type: application/json\" -d \"{ \\\"shorted\\\": \\\"http://warmup-short-url.herokuapp.com/rfWfV\\\"}\"\n\n{\"__this\": \"http://warmup-short-url.herokuapp.com/original\", \"original\": \"http://jorgechato.com\", \"short\": \"http://warmup-short-url.herokuapp.com/rfWfV\"}\n```\n\n#### Deploy\n\nThis module is automated by the CI/CD\n\n```zsh\n# Build docker\n$ docker build -t short-url:latest .\n$ docker run -p 8000:8000 --name short-url short-url:latest\n```\n\nYou can check [the heroku deployment](https://warmup-short-url.herokuapp.com) tho.\n\n**What is a distributed system?**\n\nA distributed system is a network that consists of autonomous computers that are connected using a distribution middleware. They help in sharing different resources and capabilities to provide users with a single and integrated coherent network.\n\n**What kind of difficulties commonly found when building a distributed system?**\n\n- Security is a big challenge in a distributed environment, especially when using public networks.\n- Fault tolerance could be tough when the distributed model is built based on unreliable components.\n- Coordination and resource sharing can be difficult if proper protocols or policies are not in place.\n\n**How do you solve these difficulties?**\n\n- Enabling security layers like MFA.\n- Automated Middleware Specialization approach could solve this issue.\n- The ressource sharing could be solved with a reactive platform or a data streaming like Kafka.\n\n---\n\n## Requirements\n\n### Must have\n\n- [python 3.x](https://www.python.org/downloads/)\n- pip3\n\n### We recommend you\n\n- [anaconda](https://anaconda.org/anaconda/python)\n\n#### Install dependencies\n\n```bash\n# with anaconda\n$ conda env create -f environment.yml # create virtual environment\n$ conda activate warmup # enter VE\n# or\n$ source activate warmup\n(warmup) $ conda deactivate # exit VE\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjorgechato%2Fwarmup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjorgechato%2Fwarmup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjorgechato%2Fwarmup/lists"}