Giter Club home page Giter Club logo

eulerpy's Introduction

I'm a software engineer from Vancouver, and am currently working in Toronto. Right now, I'm a senior backend engineer at ๐Ÿ’ย MLSE Digital Labs, where I architect and manage products that serve the Toronto Maple Leafs, Toronto Raptors, and more.

Previously, I led a product rewrite initiative at ๐Ÿฅฌย Freshline, worked on improving the deliverability of ๐Ÿ“ซย Gmail, and strengthened identity and attestation guarantees around ๐Ÿ”’ย Confidential Computing.

I graduated with a CS degree from the ๐ŸŽ“ย University of British Columbia, and interned at ๐Ÿ‘Šย Riot Games, ๐ŸŒŽย Google, and ๐Ÿปย Axiom Zen. I also created โš”๏ธย zeal.gg, a site for tracking the League of Legends ranked climb.

Feel free to reach out to me about software development, computer science education, or video games via Twitter!

eulerpy's People

Contributors

alefnula avatar alexeymk avatar bsoyka avatar c0mkid avatar gdfelt avatar ikeviny avatar mitchellmcmillan avatar orsenthil avatar qu4tro 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eulerpy's Issues

Translations

For educational purpose it would be cool to have translations of questions, so that non-english speaker could solve them.

The locale module in python returns a list of OS supported languages, so we can automatically select the system language if the translation is available (fallback to english otherwise). This behavior should also be over-writable with a command line parameter -l, --lang.

Here are some french translations for instance: http://blog.lucaswillems.com/532/traduction-problemes-1-50-project-euler

Change timing functionality to include CPU timing.

Alright, so I initially made the decision to use wall timings rather than CPU timings in #8. This was mainly because I didn't want the output to become too cluttered with information, but I also wanted to maintain a one-liner output, and having various different timings all on one line (other than total time) might make things confusing.

However, after sleeping on it, I remembered that I specifically coded in functionality to allow for multi-line outputs (lines 111-118 in euler.py). In commit ec3b50b, I changed the behaviour of multi-line outputs to print from this:

$ euler -v 1
Checking "001.py" against solution: 123
12345

To this:

$ euler -v 1
Checking "001.py" against solution:
123
12345

Since the a multi-line output is not going to print the correct solution anyways (the Project Euler solutions are, for the most part, single values), this is just an easier-to-read way of printing the output.

Having realized that I'm not really restricted to single-line outputs anyways, I think that I would now be more satisfied with the following behaviour of the timing output:

POSIX:

$ euler -v 1
Checking "010.py" against solution: 123
Time elapsed: user 3.17 s, sys: 33.9 ms, total: 3.21 s

POSIX (multi-line output):

$ euler -v 1
Checking "010.py" against solution:
123
12345
Time elapsed: user 3.17 s, sys: 33.9 ms, total: 3.21 s

Windows:

$ euler -v 1
Checking "010.py" against solution: 123
Time elapsed: 3.21 s

I apologize for my indecisiveness about this, @alefnula; I'm not really too experienced with making these sorts of executive project decisions yet.

Cache data files

I suggest that we should cache all the data files used throughout the problems, I quickly extracted them all here:

http://projecteuler.net/project/names.txt
http://projecteuler.net/project/words.txt
http://projecteuler.net/project/poker.txt
http://projecteuler.net/project/cipher1.txt
http://projecteuler.net/project/triangle.txt
http://projecteuler.net/project/keylog.txt
http://projecteuler.net/project/matrix.txt
http://projecteuler.net/project/matrix.txt
http://projecteuler.net/project/matrix.txt
http://projecteuler.net/project/roman.txt
http://projecteuler.net/project/sudoku.txt
http://projecteuler.net/project/words.txt
http://projecteuler.net/project/base_exp.txt
http://projecteuler.net/project/triangles.txt
http://projecteuler.net/project/sets.txt
http://projecteuler.net/project/network.txt

Image: http://projecteuler.net/project/images/p_201_laserbeam.gif
Image: http://projecteuler.net/project/images/p_208_robotwalk.gif
Image: http://projecteuler.net/project/images/p_215_crackfree.gif
Image: http://projecteuler.net/project/images/p_220.gif
Image: http://projecteuler.net/project/images/p_226_formula.gif
Image: http://projecteuler.net/project/images/p_226_scoop2.gif
Image: http://projecteuler.net/project/images/p_228.png
Image: http://projecteuler.net/project/images/p_237.gif
Image: http://projecteuler.net/project/images/p_244_start.gif
Image: http://projecteuler.net/project/images/p_244_example.gif
Image: http://projecteuler.net/project/images/p_244_start.gif
Image: http://projecteuler.net/project/images/p_244_target.gif
Image: http://projecteuler.net/project/images/p_246_anim.gif
Image: http://projecteuler.net/project/images/p_246_ellipse.gif
Image: http://projecteuler.net/project/images/p_247_hypersquares.gif
Image: http://projecteuler.net/project/images/p_251_cardano.gif
Image: http://projecteuler.net/project/images/p_252_convexhole.gif
Image: http://projecteuler.net/project/images/p_255_Heron.gif
Image: http://projecteuler.net/project/images/p_255_Example.gif
Image: http://projecteuler.net/project/images/p_256_tatami3.gif

Problem 8

Hi all,

it seems the solution for Problem 8 is incorrect. When multiply 13 consecutive digits you get 23514624000, however the problem statement asks for 5 consecutive digits...

Line endings interfering with solution checking on Windows?

From this thread over on Reddit, it seems as though there's an issue with solution checking on Windows. However, as I am running OS X (and don't have a Windows partition/VM set up at the moment), I can't verify anything about this issue.

From what I can gather, it seems as though the problem could be mitigated by changing line 129 in euler.py from is_correct = output == solution to is_correct = output.strip() == solution to strip the \r character printed by the output on Windows.

Could someone running Windows verify if this is indeed the case?

I tried and met with this traceback

$ euler -g 1
Traceback (most recent call last):
  File "/Users/skumaran/AllPython/CPython-2.6.8/bin/euler", line 9, in <module>
    load_entry_point('EulerPy==1.0.1', 'console_scripts', 'euler')()
  File "/Users/skumaran/AllPython/CPython-2.6.8/lib/python2.6/site-packages/click/core.py", line 488, in __call__
    return self.main(*args, **kwargs)
  File "/Users/skumaran/AllPython/CPython-2.6.8/lib/python2.6/site-packages/click/core.py", line 474, in main
    self.invoke(ctx)
  File "/Users/skumaran/AllPython/CPython-2.6.8/lib/python2.6/site-packages/click/core.py", line 653, in invoke
    ctx.invoke(self.callback, **ctx.params)
  File "/Users/skumaran/AllPython/CPython-2.6.8/lib/python2.6/site-packages/click/core.py", line 325, in invoke
    return callback(*args, **kwargs)
  File "/Users/skumaran/AllPython/CPython-2.6.8/lib/python2.6/contextlib.py", line 34, in __exit__
    self.gen.throw(type, value, traceback)
  File "/Users/skumaran/AllPython/CPython-2.6.8/lib/python2.6/site-packages/click/core.py", line 57, in augment_usage_errors
    yield
  File "/Users/skumaran/AllPython/CPython-2.6.8/lib/python2.6/site-packages/click/core.py", line 325, in invoke
    return callback(*args, **kwargs)
  File "/Users/skumaran/AllPython/CPython-2.6.8/lib/python2.6/site-packages/EulerPy/euler.py", line 194, in main
    generate_file(problem)
  File "/Users/skumaran/AllPython/CPython-2.6.8/lib/python2.6/site-packages/EulerPy/euler.py", line 88, in generate_file
    click.confirm("Generate file for problem #{}?".format(problem), default=default, abort=True)
ValueError: zero length field name in format
[localhost euler]$

s/solution/answer/g

For some reason i was expecting to see a solution in code when i want to cheat, not just the answer...

I guess solution is the proj. Euler terminology see what makes more sense...

Decrapation of time.clock() method in python 3.8

As you can see in this issue from the CPython repository the method time.clock() has been removed as of version 3.8 (Official python bug).

In your clock() function inside the utils module you are using this method making this whole package unusable (in case the resource module is not importable)

# Use the resource module instead of time.clock() if possible (on Unix)
try:
    import resource

except ImportError:
    import time

    def clock():
        """
        Under Windows, system CPU time can't be measured. Return time.clock()
        as user time and None as system time.
        """
        return time.clock(), None

else:
    def clock():
        """
        Returns a tuple (t_user, t_system) since the start of the process.
        This is done via a call to resource.getrusage, so it avoids the
        wraparound problems in time.clock().
        """
        return resource.getrusage(resource.RUSAGE_CHILDREN)[:2]

I don't know how willingly are you about still maintaining this repository. But I had to change this locally in my windows machine.

Should --cheat be removed?

I'm not sure which way to go on this topic. I understand that there may be some concern surrounding people simply going into the solutions file to grab answers, but the repository that I grabbed the solutions from is only one search away anyways. To be completely honest, I think that if someone feels as though they've "solved" a problem simply because they are in possession of the correct answer, it's their loss for not understanding the process behind deriving the answer. However, if the general consensus is that it's detrimental to the Project Euler community to include functionality that allows for the answer to be printed, I'll remove it (and also encrypt the answer file).

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.