Giter Site home page Giter Site logo

badouralix / adventofcode-2018 Goto Github PK

View Code? Open in Web Editor NEW
29.0 9.0 6.0 5.08 MB

Advent of Code 2018

Home Page: https://adventofcode.com/2018

License: MIT License

Shell 0.01% Python 97.48% C 0.28% C++ 1.40% Go 0.18% JavaScript 0.06% Ruby 0.02% Rust 0.21% Java 0.11% Cython 0.24%
advent-of-code advent-of-code-2018

adventofcode-2018's People

Contributors

alsyia avatar anatolebeuzon avatar atauveron avatar ayc0 avatar aymericbebert avatar badouralix avatar david-ds avatar degemer avatar dependabot[bot] avatar enizor avatar evqna avatar gandem avatar jonremy avatar julesdt avatar ludoge avatar lypnol avatar oxlay avatar puigfp avatar puigfp-dd avatar quentinverlhac avatar remicalixte avatar rpelliard avatar sfluor avatar silvestreperret avatar solenleroux avatar thomren avatar tpxp avatar youyoun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adventofcode-2018's Issues

Better support for dev

Description

Add a new command to run a wip-solution in debug mode.

Design

The new command would look like:

$ ./aoc debug -d9 -p2 -abadouralix -r
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Running submissions for day 09:

* part 2:
---------------------------------------------------
On input from badouralix
---------------------------------------------------
<stdout of badouralix solution on badouralix input>
...

The idea is to prevent python main process to read a subprocess stdout, and let the shell print the subprocess stdout. The runner would not use the flag stdout=PIPE as it currently does:

https://github.com/badouralix/advent-of-code-2018/blob/badcaacc13cb732726dc8a9309e7487f63572a15/tool/runners/go.py#L35

Create go symlink if not exist

Description

./aoc create only creates a symlink to the go solution in workspace/ after it successfully created the go solution file. In particular, if the solution file already exists, it will skip creating the symlink even though it does not exist.

Design

Catch the exception and keep moving?

Removing the following line would also help creating all missing files, instead of exiting at the first exception:

https://github.com/badouralix/advent-of-code-2018/blob/badcaacc13cb732726dc8a9309e7487f63572a15/tool/create.py#L130

Run as fast as possible

Description

Stop running super-mega-long solutions.

Design

Add a boolean flag --fast or --no-slow to the run command

Timeout

Discard solutions that take more than 5s to run.

We could also add a integer flag --timeout to override the default 5s timeout.

Slow flag

Add a file to list all slow solutions (blacklist) or all fast solutions (whitelist) and use this file to deduce solutions to be run.

All together

A naive approach for the timeout feature would be running the solution and force stop the execution after 5s. If a solution timeouts on the first input, it will likely timeout on all other inputs. Which means for each input, we run spend 5s for nothing.

This is improvable by flagging the solution as slow on the first input and avoid running it on other inputs. In a sense, this is a dynamic version of slow flag with a discrimination based on timeout.

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.