(no title)
shawndumas | 1 year ago
int main() { long long d; std::cout << "Enter a Julian Day Number: "; std::cin >> d;
if (d < 0) {
std::cerr << "Error: Invalid Julian Day Number (must be non-negative)." << std::endl;
return 1; // Indicate an error to the system
}
const int DAYS_PER_YEAR = 365;
const int DAYS_PER_LEAP_YEAR = 366;
const int DAYS_PER_LEAP_CYCLE = 1461; // 4 years
const int JULIAN_TO_GREGORIAN_THRESHOLD = 2299161; // Oct 15, 1582
// Adjust for Julian-to-Gregorian transition
if (d >= JULIAN_TO_GREGORIAN_THRESHOLD) {
d += 10; // Account for dropped days
}
int a = d + 32044;
int b = (4 * a + 3) / DAYS_PER_LEAP_CYCLE;
int c = (4 * a + 3) % DAYS_PER_LEAP_CYCLE;
int y = (b / 1460) + 1970;
d = (c / 4) - 365;
if (d < 0) {
y--;
d += DAYS_PER_YEAR + (y % 4 == 0);
}
std::cout << "Gregorian Year: " << y << std::endl;
std::cout << "Day of Year: " << d + 1 << std::endl; // Add 1 as days are typically 1-indexed
return 0;
}
worstspotgain|1 year ago
Really begs the question of what the long-term outlook is for the non-top-quartile people. Maybe re-prompting LLMs is the new ball of mud?
Terr_|1 year ago
Recently, my company acquired some engineers, and while I cannot evaluate their "percentile", I have been low-key flabbergasted at some of their suggestions for using LLMs in place of scripts. (For example, to modify or move nested data in a non-public JSON representation of a program.)
unknown|1 year ago
[deleted]
bjt|1 year ago
https://www.bbc.com/future/article/20240228-leap-year-the-im...
trealira|1 year ago
[0]: https://craftofcoding.wordpress.com/2020/02/12/the-world-of-...