<commit_before># Javran's ProjectEuler Workspace

[![Build Status](https://travis-ci.org/Javran/ProjectEuler.svg?branch=master)](https://travis-ci.org/Javran/ProjectEuler)

My Project Euler solutions and some more stuff that
makes working with problems and keeping track of correctness & efficiency
a bit easier (the "workspace" bit).

- `src/ProjectEuler` is the place for both solutions and stuff
  commonly shared. In particular, `ProblemX.hs` where `X` is a number,
  is the program for the corresponding problem.

## Executables

- `pet`: main program.
  `pet run <problem-number>` to run the program for the specific problem.

- `templater`: scripting for automating module list update.
  (TODO) It is also in plan to support creating new problem program.

- `XXX-example`: these are simple scripts just to save some typing time.
  To use them, edit its environment variables as appropriate and
  rename droping the `-example` suffix.

## petbox

Project home: https://github.com/Javran/petbox

Stands for "ProjectEuler Toolbox".

Some commonly used functions are extracted as a separated package.
Feel free to use them & contribution welcomed.

## Migration

Current state: most of the ancient solutions have been migrated.

Missing solution for Problem 66.

## Some more ideas about the "workspace" bit

- I want to have one giant binary that has everything, so we can:

    + share common code among different problems
    + note that every binary ships with RTS, having everything compiled
      together will save some space & linking time, with a slight cost
      (dynamic dispatching to one particular problem) at runtime.

- Also note that the data does not need to be there - we can have a caching
  mechanism that fetches data on the fly and put it locally for future uses.<commit_msg>Note about data part being stale.<commit_after># Javran's ProjectEuler Workspace

[![Build Status](https://travis-ci.org/Javran/ProjectEuler.svg?branch=master)](https://travis-ci.org/Javran/ProjectEuler)

My Project Euler solutions and some more stuff that
makes working with problems and keeping track of correctness & efficiency
a bit easier (the "workspace" bit).

- `src/ProjectEuler` is the place for both solutions and stuff
  commonly shared. In particular, `ProblemX.hs` where `X` is a number,
  is the program for the corresponding problem.

## Executables

- `pet`: main program.
  `pet run <problem-number>` to run the program for the specific problem.

- `templater`: scripting for automating module list update.
  (TODO) It is also in plan to support creating new problem program.

- `XXX-example`: these are simple scripts just to save some typing time.
  To use them, edit its environment variables as appropriate and
  rename droping the `-example` suffix.

## petbox

Project home: https://github.com/Javran/petbox

Stands for "ProjectEuler Toolbox".

Some commonly used functions are extracted as a separated package.
Feel free to use them & contribution welcomed.

## Migration

Current state: most of the ancient solutions have been migrated.

Missing solution for Problem 66.

## Some more ideas about the "workspace" bit

- I want to have one giant binary that has everything, so we can:

    + share common code among different problems
    + note that every binary ships with RTS, having everything compiled
      together will save some space & linking time, with a slight cost
      (dynamic dispatching to one particular problem) at runtime.

- Also note that the data does not need to be there - we can have a caching
  mechanism that fetches data on the fly and put it locally for future uses.

- `ProjectEuler.GetData` works fine except when a new data file is added,
  we need to somehow force this module to recompile when it is the case.
{'fraction_non_alphanumeric': 0.06548250265111347, 'fraction_numerical': 0.0010604453870625664, 'mean_word_length': 4.023968042609853, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2784172', 'n_tokens_mistral': 1022, 'n_tokens_neox': 994, 'n_words': 515}