
Show HN: Every Day Is Pi Day - theden
http://euler.party/
======
Jaruzel
For most of us in the world, No Day is Pi Day.

[http://imgur.com/1r5QpQu](http://imgur.com/1r5QpQu)

~~~
GlennS
Also works with YYYY-MM-DD...

Although admittedly I too find the US date system's wrong-endianness pretty
annoying.

~~~
TallGuyShort
I've always been surprised that Pi Day is primarily evangelized by so many
math / science / CS folks, when I would think it would be precisely these
folks who hate the MM/DD/YYYY format. ISO format soothes my soul like a warm
slice of apple pie with ice cream.

~~~
SAI_Peregrinus
Pi Day is the same in Drunk Endian (US) and Big Endian (ISO Standard) formats
(March 14th). It's different in Little Endian (Traditional European) format.

~~~
TallGuyShort
Yeah this thought mainly occurred to me when a big hubbub was made about
3.1415 day (3/14/15, or MM/DD/YYYY).

------
seszett
The text is very blurry on my browser, I'm not sure if it's intended but it
makes it hard to focus on what's written.

~~~
teekert
That is the "text-shadow: 0px 0px 1px;", indeed it has a blurring effect
rather than an fancy shadow effect in this case, I agree.

~~~
odonnellryan
From what I remember, that is actually supposed to "smooth" text in some
browsers. Text used to look too sharp in Chrome (haven't had this problem in a
while) sometimes. I believe that was one of the "fixes!"

~~~
nxc18
Until about 2014, Chrome didn't support ClearType on Windows, which is why
text looked so awful compared to other browsers.

Mac's renderer happens to err on the side of drawing more pixels in case of
ambiguity (e.g. calculation yields fractions of a pixel); this is why
everything on a mac looks like its in bold with the default settings. Windows
tends to err on the side of not rendering those pixels but this is
configurable with ClearType.

If you choose non-ClearType (what Google did in the early days), you have
chosen to have ugly text that will not look good on anything other than a CRT
in the 90s.

Now, somewhat ironically, Google's text actually looks somewhat better than
Edge's; Microsoft stopped using subpixel rendering (i.e. the best part of
ClearType) in Metro/Windows Store Style/Modern/UWP apps years ago, while
Chrome is still taking advantage of the feature.

~~~
odonnellryan
What's the reason for this? Why wouldn't you just use ClearType all the time?

~~~
nxc18
As for why Chrome didn't implement it early on, they likely just hadn't
bothered to use the newer APIs/use the APIs properly.

The reason why subpixel rendering is disabled in modern/WinRT/UWP apps, as I
understand it, is likely to do with rotation. Modern apps are designed for
tablet use, where the display may be oriented in any particular direction.
Subpixel rendering depends on knowing the layout of the pixel elements
themselves (the position of the R, G, & B elements relative to the greater
pixel). When rotated, the layout changes and subpixel rendering makes things
look worse.

In an ideal world, subpixel rendering would be turned off only in situations
where the display is rotated. It appears that at least the rendering surface
for Edge does use subpixel rendering, just not UI elements, which is an
improvement over no use at all.

------
martin-adams
For the curious, the source code takes a somewhat obvious approach:

[http://euler.party/pi.js](http://euler.party/pi.js)

Yep, I think that is literally pi to 6 million decimal places then doing an
indexof of the 6 digit year and 6 digit time of day.

~~~
anfractuosity
I wonder if the 6 million digits cover all possible 6 digit year and time
combinations, I guess it wouldn't be hard to bruteforce check.

Edit:

I just noticed for the time digits, it seemed to be reporting something like
-2 a few minutes ago.

'133343' doesn't seem to be part of the digits, which would represent
13:33:43. Unless I'm misunderstanding.

~~~
zulln
I wrote a quick script to test it. It does not take leap seconds into
consideration and assumes all months to have 31 days (would be easy to modify,
but it is sufficient for the task).

[https://gist.github.com/zulln/110a1d454d07339c496cc8ec6349fe...](https://gist.github.com/zulln/110a1d454d07339c496cc8ec6349fe8b)

This means this does not work about 200 times a day in addition to about
hundred whole days (for every hundred years).

~~~
mbb70
A quick script from me determined you need 10,524,628 decimals of pi for this
to work for all dates and times, with the limiting time being 16:25:42.

~~~
lutusp
> A quick script from me determined you need 10,524,628 decimals of pi for
> this to work for _all dates and times_ ... (emphasis added)

For a finite, normally distributed digit sequence (as Pi is thought to be),
the probability is always less than 1.0 for finding a particular sequence
within it. But if you mean a specially engineered sequence designed to include
all possible 6-digit sequences, then we've left the question of whether a
given finite Pi sequence includes it.

~~~
zulln
I am not sure what you are trying to say here. He did not care about
probability, he tested it.

------
onion2k
"Euler" is pronounced "Oiler", which makes the domain quite amusing if you
share my childish sense of humour.

~~~
gpvos
No idea what the joke is; do you have to be a native speaker of English to
understand it?

~~~
ClassyJacket
I'm a native English speaker and I don't get it either.

------
someloll
I loved this: [http://euler.party/pi.js](http://euler.party/pi.js)

but it could have been done better by preallocating an array of size [86400]
(all seconds in a day)

~~~
martin-adams
But it's also used for the date as well

------
partycoder
An approximation of Pi I put together just now

    
    
        var i, a = 1, s = false;
        var steps = 10000000000;
    
        for (i = 3; i < steps; i += 2) {
    	a += s ? 1/i : -1/i;
    	s = !s;
        }
    
        console.log(a * 4);
    

That loop approximates arctan(1) with a Taylor series, only using basic
arithmetic operations.

    
    
        pi = arctan(1) * 4
    

Outputs:

    
    
        3.141592653388201
                  ^-- last correct digit

------
lutusp
I just performed an experiment with this 100 * 10^6 sequence of Pi and found
out that a reasonable approximation of pi (31415926) is located at an
arbitrary location within the sequence (apart from the obvious location):

    
    
        Test sequence found at location         0.
        Test sequence found at location  50366472.
        2 instances of "31415926" within the first 100 million digits of pi.

------
dwe3000
I [think I] understand the annoyance with indicating Pi Day based on the US
order for month/day (though, I normally use ISO 8601 as my first choice,
also), but I think some people may be missing the point. In the United States,
with poor STEM performance, anything that increases awareness of math in the
United States is beneficial, even if it is in an extremely arbitrary way.

------
tgb
Seems rather funny that it doesn't do the MMDD interpretation, too, given the
current date.

~~~
mrspeaker
If we don't encourage that date format then maybe it will go away!

~~~
majewsky
MMDD is fine as long as it's preceded (rather than succeeded) by YY.

~~~
Karellen
s/YY/YYYY/

~~~
catshirt
well that's just the most obscure date format i think i've ever seen ? ;)

------
spcelzrd
My birthday is Pi Day. Now I don't feel so special anymore.

