Ad
  • Custom User Avatar

    n and m were results of weekdays with different orders of arguments. I've changed the names to weekdays_date1_date2 and weekdays_date2_date1.

  • Custom User Avatar

    when creating this kata, I thought about this and specifically created an edge case test to check this point. I, frankly, always myself thought that using between operator without casting date type will exclude last day from the boundaries. But I checked that both

    select * 
    from courses
    where course_date between '2022-10-01' and '2023-06-30'
    order by course_date desc
    

    and

    select * 
    from courses
    where course_date between '2022-10-01'::date and '2023-06-30'::date
    order by course_date desc
    

    are including 2023-06-30. so for sure there is no issue in the kata, but I am still perplexed why this is happening :)

  • Custom User Avatar

    I believe this kata has an issue. For example, between '1999-03-20' and '1999-03-21' means you want only data for only one day. Starts-with-inclusive, ends-with-exclusive.
    Description says nothing about exclusion of the last day of a trimester, but one may only complete this kata when he/she does so.

  • Custom User Avatar

    я тоже с рекурсией сидел, но правильный результат не получался.

    есть проблемы с пониманием, одно дело когда на пустом месте нагенерировать строк, другое когда навешивать рекурсию на готовую таблицу.

    Потом как вспомнил что решение в одну строчку кумулятивной суммой, так и почувствовал себя дауном.

  • Custom User Avatar

    My solution works perfectly on my local machine with PostgreSQL, but this kata throws this at me:

    expected collection contained:  [{:date1=>#<Date: 2023-01-21 ((2459966j,0s,0n),+0s,2299161j)>, :date2=>#<Date: 2023-03-31 ((2460035j,...,0s,0n),+0s,2299161j)>, :date2=>#<Date: 2023-03-31 ((2460035j,0s,0n),+0s,2299161j)>, :m=>1, :n=>50}]
    actual collection contained:    [{:date1=>#<Date: 2023-01-21 ((2459966j,0s,0n),+0s,2299161j)>, :date2=>#<Date: 2023-03-31 ((2460035j,...0s,0n),+0s,2299161j)>, :date2=>#<Date: 2023-03-31 ((2460035j,0s,0n),+0s,2299161j)>, :m=>50, :n=>50}]
    

    Does anybody know what do these n and m mean?

  • Custom User Avatar