[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

How can my boss take rails seriously with bugs like this?

EvilGeenius

10/24/2006 4:17:00 PM


The Time::next_week method is supposed to give the time of the start of
the next week. But look at this, it cocks up :

>> t=Time.parse "Monday October 16th 2006"
=> Mon Oct 16 00:00:00 BST 2006
>> t.next_week
=> Mon Oct 23 00:00:00 BST 2006
>> t.next_week.next_week
=> Tue Oct 24 00:00:00 BST 2006
>> t.next_week.next_week.next_week
=> Mon Oct 30 00:00:00 GMT 2006


Arrhhhgg!! Its just f*cked up my application data!

Has anyone run across this problem?


--
Posted via http://www.ruby-....

12 Answers

Eero Saynatkari

10/24/2006 4:42:00 PM

0

On 2006.10.25 01:17, Chris Richards wrote:
>
> The Time::next_week method is supposed to give the time of the start of
> the next week. But look at this, it cocks up :
>
> >> t=Time.parse "Monday October 16th 2006"
> => Mon Oct 16 00:00:00 BST 2006
> >> t.next_week
> => Mon Oct 23 00:00:00 BST 2006
> >> t.next_week.next_week
> => Tue Oct 24 00:00:00 BST 2006
> >> t.next_week.next_week.next_week
> => Mon Oct 30 00:00:00 GMT 2006
>
>
> Arrhhhgg!! Its just f*cked up my application data!
>
> Has anyone run across this problem?

I am sure someone on the Rails list has.

> Posted via http://www.ruby-....
^^^^^^^^^^^^^^^^^^^^^^^^^

Paul Irofti

10/24/2006 5:29:00 PM

0

On Tuesday 24 October 2006 19:17, Chris Richards wrote:
> The Time::next_week method is supposed to give the time of the start
> of
>
> the next week. But look at this, it cocks up :
> >> t=Time.parse "Monday October 16th 2006"
>
> => Mon Oct 16 00:00:00 BST 2006
>
> >> t.next_week
>
> => Mon Oct 23 00:00:00 BST 2006
>
> >> t.next_week.next_week
>
> => Tue Oct 24 00:00:00 BST 2006
>
> >> t.next_week.next_week.next_week
>
> => Mon Oct 30 00:00:00 GMT 2006
>
>
> Arrhhhgg!! Its just f*cked up my application data!
>
> Has anyone run across this problem?


Your boss can read code?

If something is broken fix it! It's an OpenSource project built upon an
OpenSource programming language...

At least submit a bug (after you search the bug tracker for duplicates
and possible fixes).

The last thing you should do is bitch like this... it's embarrassing..
and who cares about your boss or your problems anyways?

This is a bug and nothing more. Did you give up on a C/C++/php/[put your
Lang here] library when you found a bug in their functions? I bet you
haven't...

So have some respect for the devels and take into consideration that
this is a technical mailing list not a kindergarden.

Carl Lerche

10/24/2006 5:46:00 PM

0

Not to mention that this is one of the easiest libraries (that I've
worked with) to fix / patch on the fly.


On 10/24/06, Paul Irofti <bulibuta@gmail.com> wrote:
> On Tuesday 24 October 2006 19:17, Chris Richards wrote:
> > The Time::next_week method is supposed to give the time of the start
> > of
> >
> > the next week. But look at this, it cocks up :
> > >> t=Time.parse "Monday October 16th 2006"
> >
> > => Mon Oct 16 00:00:00 BST 2006
> >
> > >> t.next_week
> >
> > => Mon Oct 23 00:00:00 BST 2006
> >
> > >> t.next_week.next_week
> >
> > => Tue Oct 24 00:00:00 BST 2006
> >
> > >> t.next_week.next_week.next_week
> >
> > => Mon Oct 30 00:00:00 GMT 2006
> >
> >
> > Arrhhhgg!! Its just f*cked up my application data!
> >
> > Has anyone run across this problem?
>
>
> Your boss can read code?
>
> If something is broken fix it! It's an OpenSource project built upon an
> OpenSource programming language...
>
> At least submit a bug (after you search the bug tracker for duplicates
> and possible fixes).
>
> The last thing you should do is bitch like this... it's embarrassing..
> and who cares about your boss or your problems anyways?
>
> This is a bug and nothing more. Did you give up on a C/C++/php/[put your
> Lang here] library when you found a bug in their functions? I bet you
> haven't...
>
> So have some respect for the devels and take into consideration that
> this is a technical mailing list not a kindergarden.
>
>

Jacob Fugal

10/24/2006 6:59:00 PM

0

On 10/24/06, Chris Richards <evilgeenius@gmail.com> wrote:
>
> The Time::next_week method is supposed to give the time of the start of
> the next week. But look at this, it cocks up :
>
> >> t=Time.parse "Monday October 16th 2006"
> => Mon Oct 16 00:00:00 BST 2006
> >> t.next_week
> => Mon Oct 23 00:00:00 BST 2006
> >> t.next_week.next_week
> => Tue Oct 24 00:00:00 BST 2006
> >> t.next_week.next_week.next_week
> => Mon Oct 30 00:00:00 GMT 2006

I agree with everyone else that your manners while pleading for help
could use some work. I empathize, however, with screwed up data and
how that can put you in a bad mood. That said...

This is really not as widespread a bug as it looked to me when you
first mentioned it, but is an edge case tied to the messed up system
we have called "Daylight Savings Time". What's happening is that the
next week function hops forward by 7 days, then pulls back to the
Monday immediately preceding (or coinciding with) the resulting date.
This usually works all fine and handy. But if:

* the seven day jump crosses the DST boundary
* the seven day jump ends on a Monday, and
* the time portion is within an hour of midnight

Then the timezone change is going to change early Monday morning to
late Sunday night, and next_week will slurp it back 6 days to what it
thinks is the previous Monday. But since we cross the boundary again,
we actually make it back to Tuesday. The second time you call
next_week (from Tuesday), we don't end on Monday, so there's no
problem (aside from the wrong starting point).

Similar conditions will apply in April where if you start late Sunday
night the Sunday before DST, the Monday 8 days in the future (instead
of 1 day) will be returned. Stupid Daylight Savings Time. As if it
doesn't confuse us humans enough, it has to go and mess with our code.

FWIW, this issue has actually been brought up on the Rails list and a
patch submitted[1], all the way back in June. Now just to see if that
patch can gain some momentum in actually being committed...

Jacob Fugal

[1] http://dev.rubyonrails.org/t...

M. Edward (Ed) Borasky

10/24/2006 9:14:00 PM

0

Jacob Fugal wrote:
> This is really not as widespread a bug as it looked to me when you
> first mentioned it, but is an edge case tied to the messed up system
> we have called "Daylight Savings Time".

And I thought it was just *cows* that got messed up by Daylight Savings
Time!



Hal E. Fulton

10/25/2006 12:08:00 AM

0

M. Edward (Ed) Borasky wrote:
> Jacob Fugal wrote:
>
>>This is really not as widespread a bug as it looked to me when you
>>first mentioned it, but is an edge case tied to the messed up system
>>we have called "Daylight Savings Time".
>
>
> And I thought it was just *cows* that got messed up by Daylight Savings
> Time!
>


Actually, it's Daylight Saving Time. :)

Sorry, just feeding a pet peeve...


Hal

Kevin

10/25/2006 1:16:00 AM

0


Hal Fulton wrote:
> M. Edward (Ed) Borasky wrote:
> > Jacob Fugal wrote:
> >
> >>This is really not as widespread a bug as it looked to me when you
> >>first mentioned it, but is an edge case tied to the messed up system
> >>we have called "Daylight Savings Time".
> >
> >
> > And I thought it was just *cows* that got messed up by Daylight Savings
> > Time!
> >
>
>
> Actually, it's Daylight Saving Time. :)
>
> Sorry, just feeding a pet peeve...
>
>
> Hal

Just wait til next year when the US changes the day that DST starts and
ends on. Won't that be fun.

It's not a hard thing to fix, but you just *know* that some ISP is
going to forget.

BTW... Daylight saving time doesn't actually save any daylight....
another pet peeve.

_Kevin

Hal E. Fulton

10/25/2006 1:27:00 AM

0

_Kevin wrote:
>
> Just wait til next year when the US changes the day that DST starts and
> ends on. Won't that be fun.

Hmm, isn't that this year??

> It's not a hard thing to fix, but you just *know* that some ISP is
> going to forget.
>
> BTW... Daylight saving time doesn't actually save any daylight....
> another pet peeve.

Quite right. Will Rogers said it was like cutting off one end of a
blanket and sewing it on the other end to make it longer.

My father occasionally nags Congress to do away with it. (I always
admire those who tilt at windmills.) He is actually old enough to
remember when there was no such thing.


Hal

Kev Jackson

10/25/2006 1:47:00 AM

0

Not sure about the US, but in the UK, the original reason for a BST
(British Summer Time) change was so that farm workers had more
daylight hours - don't know why the US calls it Daylight Savings Time
though.

These days as we have so few farmers/farm workers left in the UK, that
reason is no longer applicable, so now we have the following reasons
trotted out every time someone mentions abolishing it:

1 - tradition - the 'we've always done it' argument
2 - children walking home from school should be in daylight - hard to
argue with that - except 90% of schoolkids are driven to/from school
in air-conditioned SUV's and couldn't care less about whether it's
light or dark
3 - saves electricity - this one is actually true - I've seen the data
of the electricity consumption just before BST and after the change
and the difference changing the clocks makes is remarkable (basically
as you have more daylight, you use the lights less - although it
doesn't make sense really as you will use them later, the usage of
electricity is actually lower - suprised me)

Anyway, the electricity savings are real (at least the numbers I've
seen), and given the political ramifications of reducing energy
consumption (right now), don't expect any politician to advocate
something that could potentially use more power...

Kev

M. Edward (Ed) Borasky

10/25/2006 1:51:00 AM

0

Kevin Jackson wrote:
> Not sure about the US, but in the UK, the original reason for a BST
> (British Summer Time) change was so that farm workers had more
> daylight hours - don't know why the US calls it Daylight Savings Time
> though.
>
> These days as we have so few farmers/farm workers left in the UK, that
> reason is no longer applicable, so now we have the following reasons
> trotted out every time someone mentions abolishing it:
>
> 1 - tradition - the 'we've always done it' argument
> 2 - children walking home from school should be in daylight - hard to
> argue with that - except 90% of schoolkids are driven to/from school
> in air-conditioned SUV's and couldn't care less about whether it's
> light or dark
> 3 - saves electricity - this one is actually true - I've seen the data
> of the electricity consumption just before BST and after the change
> and the difference changing the clocks makes is remarkable (basically
> as you have more daylight, you use the lights less - although it
> doesn't make sense really as you will use them later, the usage of
> electricity is actually lower - suprised me)
>
> Anyway, the electricity savings are real (at least the numbers I've
> seen), and given the political ramifications of reducing energy
> consumption (right now), don't expect any politician to advocate
> something that could potentially use more power...
>
> Kev
>
>

Actually, IIRC it originated (here in the US, at any rate) during WWII
as an energy saving measure. I think it was all year round, or maybe one
hour in the winter and two hours in the summer.