For project Euler, I need quite often to test things like is x*y*z < 1e18. Since BigInteger is usually too slow, long overflows, and double may return incorrect result due to rounding, I wanted to use long with appropriate checks. As Guava's LongMath.checkedMultiply throws, it can't be used as ex...
It's funny how when you walk into a university library these days, basically everyone's on a Macbook, but schools and libraries you have so many windows clones
You code looks great, and I only have just a few tips on style. Although, to be completely honest, I'm really not familiar with some of the libraries/modules/frameworks being used here, but, I'm going to try for the best answer possible. Disclaimer: A few of these tips are borrowed from @Quill's ...
> After 7 days, the top 30 nominees, ordered by reputation, advance to the primary phase. However, if there are 10 or fewer candidates, we skip directly to the election phase.
Thanks @TonyD, I am usually on top of my undefined behaviours, but I didn't realise this was one. Now I'm paranoid about production code I may have written in the past containing that style, and I will add it to my mental list of red-flags for code reviews. I will remove that bit from my answer. — paddy57 secs ago
I remember reading a section of A Brief History of Time where Stephen Hawking says that he went to a meeting where the church and the pope asked a bunch of physicists whether a certain scientific belief (big bang theory) went against the Bible's beliefs, and based on that meeting the church could either accept or deject the theory.
I've implemented the beginnings of a Python preprocesser I plan to implement sometime in the future, and the below code is my simple prototype. At the moment, it only converts until and unless statements.
py_preproc.py
"""
A simple Python utility that converts
non-valid Python code, like `until...
I've implemented the beginnings of a Python preprocesser I plan to implement sometime in the future, and the below code is my simple prototype. At the moment, it only converts until and unless statements.
py_preproc.py
"""
A simple Python utility that converts
non-valid Python code, like `until...
I was trying to find out if a string contained a capitalized letter and if it did I wanted to know the position of the character and its ASCII code. I might have refactored a little to much.
Given an input such as:
(is-capitalized "Meow mEow kItus kaTus")
My function returns:
((18 . 84) (...