Giter Site home page Giter Site logo

hurricanemark / dailycodingchallenge Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 2.0 8.15 MB

Test-driven software solutions to the daily coding challenge received in my mail box. Apparently, these are interview questions. New addition is usually pushed as file denoted 'codechallenge-###.py' , where ### is the sequential digits. Each file should contain a date, the original problem description in the comment section, and my attempted solution below it.

License: GNU General Public License v3.0

Python 98.80% Shell 0.98% Dockerfile 0.22%
python pytest dailycodechallenge pythonic test-driven-development-with-python interview-questions codechallenge docker-development

dailycodingchallenge's Introduction

Solutions for Daily Coding Challenge

Sign up for an account at "https://dailycodingproblem.com" to automatically receive a daily coding problem in your mail box.

This repository contains continuous update of my solutions (code snippets). I try to keep it a consistent activity as a way to keep my mind entertained.

Coding Practice

Problem descriptions are here to require understanding before moving ahead!

Comments are here to explain code to other programmers, better yet, as notes to my future self. The comment section contains date, problem's description follows by my thought on computation flow and pseudo code.

Codes are here to explain algorithms to the computer. The code section usually contains function(s) for addressing the main problem and test_func() written for pytest module. In order to optimize, we first take measurement. Some solutions here also output elapsed runtime if there are multiple ways to implement a solution.

Often, I would recommit updates on individual file with further thoughts, improvement or total rewrite of the solution.

Code Layout

One problem/solution per python file. Each python file contains the given problem in the commented section and my attempted code below it. The files are not linked or referenced to one another. However, you could import each one as module (see module_unittests.py) or run pytest on the entire directory (see tests.py). Be sure to open it up and read it.

Feel free to suggest better performance for any of my solutions here.

Published URL: https://hurricanemark.github.io/DailyCodingChallenge/

How to Run

Several unit test modules are used here. pytest, module_unittesst.py, and unittest.runner that can generate xml summary.

** 1. Install pytest (pip install pytest)

** 2. git clone https://github.com/hurricanemark/DailyCodingChallenge.git

** 3. Run pytest (pytest ./*.py)

Any function written in the form of test_xyz() will be automatically executed with pytest.

** or, execute individual python solution (python codechalleng-##.py)

** or, execute python tests.py for comprehensive testing of the whole directory

** or, python3 module_unittests.py

** PIPENV: using provided Pipfile.lock ==recommended==

pipenv install
pipenv shell
pipenv run python ./tests.py
exit()

Verbose unittest output is in @@includetests_output.txt ๐Ÿ˜‚

Develop && Run Tests Using Docker Image

Install docker-ce on your local machine. Follow this link docker-ce for installation instruction.
Make sure you have .dockerignore file in your folder.

$ docker build . -t pydockerrunner

$ docker rm runmycodechallenges; docker run -it --name runmycodechallenges pydockerrunner:latest "/bin/bash"

dailycodingchallenge's People

Contributors

aesclever avatar hurricanemark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

edson-github

dailycodingchallenge's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.