Giter Club home page Giter Club logo

aochelper's Introduction

A day may come when we use this space for something useful.

But it is not this day! This day we fight show these meaningless stats.

Eduardo's GitHub status


Here's some of the code that can be found in this profile (you're welcome, my future self):

๐Ÿ“š General purpose libraries
  • FileParser [C#]: a file... parser
  • SheepTools [C#]: general-purpose toolbox library
  • dotnet-combine [C#]: CLI tool that merges source code files into a single one and/or zips them
โ™Ÿ Chess

๐Ÿ‘‰ Play Lynx on Lichess! ๐Ÿ‘ˆ

๐ŸŽ… Advent of Code
๐ŸฅŠ Competitive programming
Arduino
  • SerialPortReader [C++]: Windows serial port reader
  • TwoMotors [C++]: library that allows an Arduino to control 2 DC motors
  • NECIRrcv [C++]: fork of Joe Knapp's library that allows an Arduino to get IR codes
  • NewPing [C++]: mirror of Tim Eckel's library that allows an Arduino to efficiently deal with ultrasonic sensors
Miscellaneous

aochelper's People

Contributors

codemonkey85 avatar dependabot[bot] avatar eduherminio avatar github-actions[bot] avatar jetersen 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  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

aochelper's Issues

Problems being solved backwards order

I added a Day02.cs today, and tried SolveLast() but it ran Day01 again. Running Solver.SolveAll() results in this output:

image

As far as I can tell the SolveAll() relies on LoadAllProblems() which just scans the assembly for classes that extend BaseDay but doesn't sort them? Unsure how to resolve this on my side, hoping you have some ideas (or I'm doing something wrong).

Project layout:
image

Exceptions that contain brackets break the console

Hi :-)
When I run my project using SolveAll in Debug mide, all is well and I get a nice pribntout of the 7 days so far.
Using release more, however, trips at day 3:
image

I think this happens when my code throws an exception and then the exception message and stack trace contain brackets []
the console format thing assumes special meaning so I suppose you need to escape those brackets before sending them into the console.

SolverConfiguration.ClearConsole doesn't work properly

SolverConfiguration.ClearConsole doesn't work properly.

More specifically, it doesn't work at least when the output to clear is big (i.e. you've solved a bunch of days or are using SolverConfiguration.ShowConstructorElapsedTime or/and SolverConfiguration.ShowTotalElapsedTimePerDay), but sometimes in other scenarios as well.

It doesn't matter what combination of Console.Clear() and/or AnsiConsole.Console.Clear(true) is used, but I can't find a way to fully clear the output of previous runs.

Back buffer rendering technique mentioned in spectreconsole/spectre.console#156 to re-render the table doesn't fix this issue either.

Solver without static context?

Would be nice if I could dependency inject the solver.

What you've done in your pull.ps1 I have done in C# by injecting a http client.

[Enhancement] Timing for day construction

I think it might be useful to (optionally?) allow to capture the timings of the day constructors. Day 7 of 2020, had a lot of up front processing that both parts leveraged. instead of doing it twice, it makes sense to put in the constructor. However doing so, the Part 1 and Part 2 become a lot slimmer just leveraging the data structures built by the constructor, and I think this results in artificially low runtimes, since the bulk of the processing wasn't accounted for.

Solve problem by index

Add an option to solve a problem my index.

Example:
Solver.Solve(12) should solve problem(s) where CalculateIndex() returns 12.

This should facilitate the parsing of arguments from standard input (idea taken from here, thanks @ZeevoX!).


Once the functionality is implemented, it'd be nice to provide something out of the box in the template.

Ability to do multiple years

I've taken the idea of your framework and expanded on it by allowing for multiple years.

My updated project structure is as follows:

+---AdventOfCode
|   AdventOfCode.csproj
|   GlobalUsings.cs
|   Program.cs
|
+---2015
|   |   Day_01.cs
|   |   Day_02.cs
|   |   Day_03.cs
|   |
|   \---Inputs
|           01.txt
|           02.txt
|           03.txt
|
+---2021
    |   Day_01.cs
    |   Day_02.cs
    |   Day_03.cs
    |
    \---Inputs
            01.txt
            02.txt
            03.txt

Clear Console happens regardless of flag

Regardless if I pass true or false for ClearConsole, it clears anyways. Looking at the code here, it seems it will do a clear no matter what, just either a Console.Clear or an AnsiConsole Clear.

I'd like to be able to use Console.WriteLine (or AnsiConsole.WriteLine) for debugging and not have those lines wiped out by the results.

image

IOException thrown by Solver.SolveLast when debugging in VS Code

Just installed AocHelper and using the Template. When attempting to debug my code, the SolveLast method throws an IOException when attempting to set the cursor visibility.
image

This project has run successfully when not using the debugger.
This same code, when debugged using Visual Studio, will run just fine (debugger behaves without throwing the exception).

I suspect this is some configuration or installation problem on my end with VSCode. Have you seen anything like this before?

Solves in reverse order

Using Solver.SolveAll(); will result in a reverse order, and somehow a duplicate being printed, as seen below:

This is my folder structure:

It looks like this issue is related to #137, but I'm not sure why this happens in my case.

Part 1 Timer seemingly starting early

For some reason, the Part 1 for everything is taking much longer than part 2 of the same question. For example:

image

I am not sure why this is the case. For Day 1, part 1 is doing significantly less than part 2. For Day 2, both parts are the exact same. Could this be related to how I have written my parts or is this something related to when AoCHelper starts the timer? This may also be a case of me not entirely understanding how the Helper is supposed to work.

Please note, I am using the Template that is linked in the main Readme.

Here is an example of how my Day 2 is set up:

    public class Day_02 : BaseDay
    {
        private readonly string _input;

        public Day_02()
        {
            _input = File.ReadAllText(InputFilePath);
        }

        public override ValueTask<string> Solve_1() => Part1();

        public override ValueTask<string> Solve_2() => Part2();

        private ValueTask<string> Part1()
        {
            throw new System.NotImplementedException();
        }

        private ValueTask<string> Part2()
        {
            throw new System.NotImplementedException();
        }
    }

Possibility of testing small demo inputs

Hi,
Thanks for this great tool ! I am using it again this year.

I have a mix between a feature request / question :
I'd like to implement some tests, but not using my own input files, but the small examples that is provided for each question (let's call them demo inputs).
As of now, I have to switch the inputs, but it is very redundant between each part and all my typos ^^'.

I suppose writing a Tests folder that take "test" inputs would be the best, but that mean I need to override by hand each BaseDay just to override InputFileDirPath so that it is the demo input that is used for testing.

Do you think that could be an added feature, or do you see a better way to do it ?

Config option to allow for multiple runs

Would be nice if we could set a config property that would run each solution N number of times and take the average timing across those runs. Where N is the value set in config.

            SolverConfiguration cfg = new();
            cfg.RunCount = 20;
            Solver.SolveAll(cfg);

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.