Hacker News new | past | comments | ask | show | jobs | submit | divbzero's comments login

ITBS = Iowa Test of Basic Skills

It took me several seconds to recognize this acronym for a test I took decades ago but haven’t thought about since.


Well, Notepad is introducing AI support which already feels like scope creep to me…

https://support.microsoft.com/en-us/windows/enhance-your-wri...


They already introduced it. It's been there for some months.

... Yikes.

> Note that modern compilers like gcc or clang will produce something like is_leap_year2 from is_leap_year1, so there is not much point in doing this in C source, but it might be useful in other programming languages.

The optimizations that compilers can achieve kind of amaze me.

Indeed, the latest version of cal from util-linux keeps it simple in the C source:

  return ( !(year % 4) && (year % 100) ) || !(year % 400);
https://github.com/util-linux/util-linux/blob/v2.41/misc-uti...

But this is wrong and can only represent dates after the specific year when they switched from the Julian to Gregorian calendar!

For more on this, I recommend reading and implementing a function that calculates the day of the week [1]. Then you can join me in the special insanity hell of people that were trying to deal with human calendars.

And then you should implement a test case for the dates between Thursday 4 October 1582 and Friday 15 October 1582 :)

[1] https://en.m.wikipedia.org/wiki/Determination_of_the_day_of_...


> the specific year

The problem is, which "specific" year? The English were using "old-style" dates long after 1582. Better not to try to solve this intractable problem in software, but instead annotate every old date you receive with its correct calendar, which may even be a proleptic Gregorian calendar in some fields of study.

(How do you determine the correct calendar? Through careful inspection of context! Alas, people writing the dates rarely indicated this, and later readers tend to get the calendars hopelessly mangled up. Not to mention the changes in the start of the year. At least the day of week can act as an indicator, when available.)


The full code is

   static int leap_year(const struct cal_control *ctl, int32_t year)
   {
    if (year <= ctl->reform_year)
     return !(year % 4);

    return ( !(year % 4) && (year % 100) ) || !(year % 400);
   }
Where reform_year is the year the Gregorian calendar was adopted in the specific context specified (defaults to 1752 which is the year it was adopted by GB and therefore also the US).

So it does account for Julian dates.


cal doesn’t offer an option to use the 1582 reform date, but looks like it does handle the 1752 adoption in Great Britain correctly:

  $ cal 9 1752
     September 1752
  Su Mo Tu We Th Fr Sa
         1  2 14 15 16
  17 18 19 20 21 22 23
  24 25 26 27 28 29 30

But `ncal` does offer that option. Here's October 1582 in "Italy", which didn't exist back then:

  $ ncal -sIT 10 1582
      October 1582      
  Mo  1 18 25         
  Tu  2 19 26         
  We  3 20 27         
  Th  4 21 28         
  Fr 15 22 29         
  Sa 16 23 30         
  Su 17 24 31
France apparently took a couple months to get on board (or maybe just to find out):

  $ncal -sFR 12 1582
      December 1582     
  Mo     3 20 27      
  Tu     4 21 28      
  We     5 22 29      
  Th     6 23 30      
  Fr     7 24 31      
  Sa  1  8 25         
  Su  2  9 26         
 
`ncal -p` gives a list of the country codes it accepts. (These are current countries so it's a bit ahistorical for, say, Germany.)

Sadly they don't implement the weird thing Sweden did in the early 18th century: https://en.wikipedia.org/wiki/Swedish_calendar


I like how the linux one is also easier to understand because it doesn't perform three sequential checks which actually invert the last two conditions plus a default return. That's the kind of stuff that can make you crazy if you ever have to debug it.

I wondered 3 minutes "this is not right" til I realized that

  if ((y % 25) != 0) return true;
was actually checking for different from 0 (which in hindsight makes also sense because the century years by default are not leap unless they divide by 400)

> (by now you probably figured out that I am not very popular ar work)

I bet your colleagues appreciate it if you’re similarly strict about ending meetings on time.


It seems to make sense if you interpret it as:

10am c.t. = 10am with extra time

10am s.t. = 10am without extra time


This was unmistakably written by a human.

Walk Score can provide an estimate of walkability for any given address.

https://www.walkscore.com/


> I was thinking it’s hard to relate to Tom and Daisy in high school…

Yes, it seems easier to relate to them after encountering more “careless people” as an adult.


I remember not liking the characters and wondering why should I read this, but now I have come to appreciate the value of understanding the view points of other people in spite of how I might feel about their actions and words or be distanced from their existence by virtue in this case of the wealth and privilege available to them.

> So, there you have it: "all you have to do" is deploy a few hectares of radiators in space, combined with heat pumps that can dissipate gigawatts of thermal load…

Starcloud’s whitepaper suggests a 4 km × 4 km radiator. For comparison, the James Web Space Telescope has a sunshield measuring 21 m × 14 m and the International Space Station measures 109 m × 73 m.


James Webb is a trainwreck. It took 20 years of delays to launch it.

It _was_ a trainwreck. Now it’s in space making great discoveries.

Wait until you hear how long this project winds up taking.

Webb took a long time because this stuff is very, very challenging. One of its primary engineering challenges was… cooling!


To be fair, they wanted it very cold indeed

I was wondering if these server racks in space would need to be specifically designed for enough radiative cooling. Apparently the answer is “yes”: the radiators would be expansive and placed on the reverse side of the solar panels.

Starcloud is developing a lightweight deployable radiator design with a very large area - by far the largest radiators deployed in space - radiating primarily towards deep space, which has an average temperature of about 2.7 Kelvin or -270°C. The radiators can be positioned in-line with the solar arrays as shown in Figure 3, with one side exposed to sunlight.

Figure 3. A data center in Sun Synchronous Orbit, showing a 4km x 4km deployed solar array and radiators.

https://www.starcloud.com/wp


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: