# SVN Account Request: kriscraig

- Thread: https://externals.io/message/49237
- Original archive: https://news-web.php.net/php.internals/49237
- Started by Kris Craig on 2010-08-10T01:19:05+00:00
- Messages: 12
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #49237 — Kris Craig — 2010-08-10T01:19:05+00:00

URL: https://externals.io/message/49237#49237

Currently, I'm working on several parallel feature additions to the date extension.  Specifically with regard to accurate calculation of seasonal equinox, an added paremeter character to display the current season in the `date()` function, limited hemisphere detection based on the timezone setting and/or latitude setting, etc.  I am also looking into tackling some related bugs, TODOs, PHPT tests, etc.  Far too much going on to toss around a bunch of patches left and right, though I can send a small sample patch of one of the things I'm working on to demonstrate my competence upon request.

For right now, I'd just need access to the php-src/.../ext/date portion of the repository, though later on I'll probably want access elsewhere in the repo to work on other things as well, though for now that isn't necessary.

And finally, I understand the licensing requirements and will not be committing any work linked to GPL/LGPL stuff (everything I've been doing thus far is self-authored anyway).

Please let me know if you have any additional questions/etc.  I look forward to contributing my talents to this wonderful community!

---

## #49240 — johannes@php.net — 2010-08-10T08:27:19+00:00

URL: https://externals.io/message/49237#49240 · In reply to: #49237

> Currently, I'm working on several parallel feature additions to the date extension.

Can you please send some patches first? We like to see some work before
handing out accounts.

johannes

---

## #49253 — Derick Rethans — 2010-08-10T10:53:12+00:00

URL: https://externals.io/message/49237#49253 · In reply to: #49237

> Currently, I'm working on several parallel feature additions to the 
> date extension.  Specifically with regard to accurate calculation of 
> seasonal equinox, an added paremeter character to display the current 
> season in the `date()` function, limited hemisphere detection based on 
> the timezone setting and/or latitude setting, etc.  I am also looking 
> into tackling some related bugs, TODOs, PHPT tests, etc.  Far too much 
> going on to toss around a bunch of patches left and right, though I 
> can send a small sample patch of one of the things I'm working on to 
> demonstrate my competence upon request.

Well, each of those features will have to come in as a separate patch 
anyway... but yes, discuss what you're doing! The date maintainer (me 
;-) ) is quite interested ;-)

regards,
Derick

-- 
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug

---

## #49273 — Kris Craig — 2010-08-10T19:28:07+00:00

URL: https://externals.io/message/49237#49273 · In reply to: #49240

Of course!  Here's a patch of php_date.c (currently based off 5.3.2; I'll
need to rebase off 5.3.3 of course) showing the seasonal equinox support
I've added thus far.  The formulas in there took quite a bit of research to
find, but ultimately I was able to find them in an old book titled,
"Astronomical Algorithms" by Jean Meeus.  It's apparently considered the
definitive text on the subject and is used by organizations such as NASA to
calculate the seasons.  The formulas are accurate to within a few seconds up
to the year AD 3000, but should be accurate to within a few minutes for
several thousand years after that.  I've already tested this and it works
perfectly thus far.

Currently, the only thing these new functions are being used for is to
display the season for a given date (northern hemisphere only; southern I'm
still working on).  To test it, simply use date( "v" ); to display the
current season or for a given timestamp.  I chose the letter "v" for
"vuodenaika", which is the Finnish word for "season".  I can also send a
test PHP script I wrote so you can visually compare the seasonal equinoxes
identified with your calendar or whatever to verify its accuracy.  That
reminds me, I still need to make that into a PHPT case....

The equinoxes are currently rounded to midnight of that given day, though
this can easily be changed to be accurate down to the second since the
functions are already in place.  I'm not sure which would be better though,
so I figured I'd ask around and see what y'all think about that one.

This is just one avenue I'm currently pursuing and I expect to be doing much
more as time permits.  Professionally, I work as a PHP test engineer for a
major software company and most recently was working closely with Pierre on
testing and debugging issues with the Win32 5.3.3 and 5.2.14 RC's.  He
hasn't seen any of my programming work as that's not what I do here, nor
have I discussed this SVN request with him since it's just for me
personally, but if you're looking for someone who can vouch for my character
and professionalism at least I'm sure he'd be willing to mention that if
asked.  Just to clarify again the source development work I'm doing on the
PHP core/etc is just me acting on my own personal behalf and not for any
company/etc.


Please don't hesitate to ask if there's anything else you need from me to
move this application forward.  Thanks!  =)

--Kris


2010/8/10 Johannes Schlüter <johannes@php.net>

> 
> > […]
> extension.
>
> Can you please send some patches first? We like to see some work before
> handing out accounts.
>
> johannes

---

## #49274 — Kris Craig — 2010-08-10T19:28:45+00:00

URL: https://externals.io/message/49237#49274 · In reply to: #49273

Sorry, I guess it would help if I actually attached the patch.....  Here it
is.


--Kris


2010/8/10 Kris Craig <kris.craig@gmail.com>

> Of course!  Here's a patch of php_date.c (currently based off 5.3.2; I'll
> need to rebase off 5.3.3 of course) showing the seasonal equinox support
> I've added thus far.  The formulas in there took quite a bit of research to
> find, but ultimately I was able to find them in an old book titled,
> "Astronomical Algorithms" by Jean Meeus.  It's apparently considered the
> definitive text on the subject and is used by organizations such as NASA to
> calculate the seasons.  The formulas are accurate to within a few seconds up
> to the year AD 3000, but should be accurate to within a few minutes for
> several thousand years after that.  I've already tested this and it works
> perfectly thus far.
>
> Currently, the only thing these new functions are being used for is to
> display the season for a given date (northern hemisphere only; southern I'm
> still working on).  To test it, simply use date( "v" ); to display the
> current season or for a given timestamp.  I chose the letter "v" for
> "vuodenaika", which is the Finnish word for "season".  I can also send a
> test PHP script I wrote so you can visually compare the seasonal equinoxes
> identified with your calendar or whatever to verify its accuracy.  That
> reminds me, I still need to make that into a PHPT case....
>
> The equinoxes are currently rounded to midnight of that given day, though
> this can easily be changed to be accurate down to the second since the
> functions are already in place.  I'm not sure which would be better though,
> so I figured I'd ask around and see what y'all think about that one.
>
> This is just one avenue I'm currently pursuing and I expect to be doing
> much more as time permits.  Professionally, I work as a PHP test engineer
> for a major software company and most recently was working closely with
> Pierre on testing and debugging issues with the Win32 5.3.3 and 5.2.14
> RC's.  He hasn't seen any of my programming work as that's not what I do
> here, nor have I discussed this SVN request with him since it's just for me
> personally, but if you're looking for someone who can vouch for my character
> and professionalism at least I'm sure he'd be willing to mention that if
> asked.  Just to clarify again the source development work I'm doing on the
> PHP core/etc is just me acting on my own personal behalf and not for any
> company/etc.
>
>
> Please don't hesitate to ask if there's anything else you need from me to
> move this application forward.  Thanks!  =)
>
> --Kris
>
>
> 2010/8/10 Johannes Schlüter <johannes@php.net>
>
> 
> > […]

---

## #49275 — Michael Maclean — 2010-08-10T19:50:15+00:00

URL: https://externals.io/message/49237#49275 · In reply to: #49274

> Sorry, I guess it would help if I actually attached the patch.....  Here
> it is.

The list strips attachments with filenames ending in something other 
than .txt - resend or perhaps put it online somewhere?

-- 
Cheers,
Michael

---

## #49281 — Kris Craig — 2010-08-10T20:36:24+00:00

URL: https://externals.io/message/49237#49281 · In reply to: #49275

Woops, sorry.  Here's the file renamed to .txt.  Thanks for the tip!


--Kris




> 
>
> > […]
>
> The list strips attachments with filenames ending in something other than
> .txt - resend or perhaps put it online somewhere?
>
> --
> Cheers,
> Michael

---

## #49787 — Kris Craig — 2010-09-25T02:17:43+00:00

URL: https://externals.io/message/49237#49787 · In reply to: #49281

It's been a couple months since I heard anything, so I wanted to check the
status of my request and update you on my efforts.  Things got pretty busy
so I didn't have much time to work on this in August, but the last couple
weeks I've been able to really dive into it.

The latest patch is attached (based off 5.3.3 r303757 now).  As you can see,
it's no longer just a hacky proof-of-concept like the previous patch sent
out.  This actually makes full use of the formulas and has been thoroughly
tested.

The only issue I'm running into is precision.  You'll notice I've got a ton
of type casting all over the place (including a lot of unnecessary long
doubles lol) which I'll have cleaned-up in the next patch.  These formulas
are accurate to within a few seconds (over the next several thousand years
at least), but the level of precision required is a bit much for standard
floating points to handle.  As a result, the equinox/solstice start dates
are off by about 6-14 minutes when compiled on stock Ubuntu 10.04 and 0-7
minutes when compiled on Windows (VC9).  Is the PHP source currently making
use of any arbitrary precision libraries (like MPFR, etc) anywhere?  That
would easily solve this rounding issue and enable me to put together some
PHPT tests with predictable results.


Also, I would like to ping for an update on my SVN account request.  If
there is anything further you need me to do for you in order to complete
this process, I will be more than happy to do it.


Thanks!

--Kris




> Woops, sorry.  Here's the file renamed to .txt.  Thanks for the tip!
>
>
> --Kris
>
>
>
> 
>
> > […]

---

## #49874 — Kris Craig — 2010-10-05T21:46:20+00:00

URL: https://externals.io/message/49237#49874 · In reply to: #49787

I'm starting to wonder if I'm sending this to the correct list.  It's been
another two weeks since my last email and I still have yet to receive a
response.  In fact, I haven't heard a thing from anyone since I sent the
first patch out (as requested) back on August 10th.

Could somebody (anybody) please email me a response when you get this?  If
you could tell me what I need to do and/or who I need to send this to in
order to illicit an answer, I would be extremely grateful for your advice!
I would be even more grateful (for whatever that's worth) if you have any
thoughts on the latest date patch I sent.


Thanks!

--Kris




> It's been a couple months since I heard anything, so I wanted to check the
> status of my request and update you on my efforts.  Things got pretty busy
> so I didn't have much time to work on this in August, but the last couple
> weeks I've been able to really dive into it.
>
> The latest patch is attached (based off 5.3.3 r303757 now).  As you can
> see, it's no longer just a hacky proof-of-concept like the previous patch
> sent out.  This actually makes full use of the formulas and has been
> thoroughly tested.
>
> The only issue I'm running into is precision.  You'll notice I've got a ton
> of type casting all over the place (including a lot of unnecessary long
> doubles lol) which I'll have cleaned-up in the next patch.  These formulas
> are accurate to within a few seconds (over the next several thousand years
> at least), but the level of precision required is a bit much for standard
> floating points to handle.  As a result, the equinox/solstice start dates
> are off by about 6-14 minutes when compiled on stock Ubuntu 10.04 and 0-7
> minutes when compiled on Windows (VC9).  Is the PHP source currently making
> use of any arbitrary precision libraries (like MPFR, etc) anywhere?  That
> would easily solve this rounding issue and enable me to put together some
> PHPT tests with predictable results.
>
>
> Also, I would like to ping for an update on my SVN account request.  If
> there is anything further you need me to do for you in order to complete
> this process, I will be more than happy to do it.
>
>
> Thanks!
>
> --Kris
>
>
>
> 
>
> > […]

---

## #49875 — Daniel P. Brown — 2010-10-05T22:17:31+00:00

URL: https://externals.io/message/49237#49875 · In reply to: #49874

>
> Could somebody (anybody) please email me a response when you get this?  If
> you could tell me what I need to do and/or who I need to send this to in
> order to illicit an answer, I would be extremely grateful for your advice!
> I would be even more grateful (for whatever that's worth) if you have any
> thoughts on the latest date patch I sent.

    You're coming through.  Sometimes some things just take longer
than others around here, and sometimes they just never happen at all.
It's certainly nothing personal against you.l

-- 
</Daniel P. Brown>
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

---

## #49876 — Kris Craig — 2010-10-05T23:50:52+00:00

URL: https://externals.io/message/49237#49876 · In reply to: #49875

Thanks, Daniel!  Yeah like a few minutes after I sent that email my SVN
request got approved lol.  I'd heard that sometimes you have to lean on the
list a little to get a response so I never thought it was anything
personal/etc.  =)

But yeah if you have some free time and would like to try applying my patch
please feel free to let me know the results.  I'm very interested to learn
how much precision variance there is on this across different compilers and
if there are any ideas out there to resolve that issue.  Because other than
the slight precision loss it works perfectly and should satisfy a lot of
people who have requested this over the years.


Bleh well my inane ramblings aside, thanks again!

--Kris


On Tue, Oct 5, 2010 at 3:17 PM, Daniel P. Brown
<daniel.brown@parasane.net>wrote:

> 
> > […]
>  If
> > […]
> advice!
> > […]
>
>     You're coming through.  Sometimes some things just take longer
> than others around here, and sometimes they just never happen at all.
> It's certainly nothing personal against you.l
>
> --
> </Daniel P. Brown>
> Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
> (866-) 725-4321
> http://www.parasane.net/

---

## #49877 — Daniel P. Brown — 2010-10-06T02:23:53+00:00

URL: https://externals.io/message/49237#49877 · In reply to: #49876

>
> But yeah if you have some free time and would like to try applying my patch
> please feel free to let me know the results.  I'm very interested to learn
> how much precision variance there is on this across different compilers and
> if there are any ideas out there to resolve that issue.  Because other than
> the slight precision loss it works perfectly and should satisfy a lot of
> people who have requested this over the years.

    That would definitely be Derick's realm.  Anyone could apply the
patch, but he's the one who will scrutinize it bit-by-bit (literally).

> Bleh well my inane ramblings aside, thanks again!

    Not a problem.  Welcome aboard.

-- 
</Daniel P. Brown>
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/
