ChatGPT and calendars

I’m working on an algorithm to determine the dates of holidays, for example, Labor Day is the 1st Monday in September (thus September 2 for 2024… anywhere from the 1st through the 7th depending on the year). Just a little hack that I felt like doing. Well, it’s slightly complex, so just for fun I decided to ask ChatGPT how to do it.

ChatGPT did an excellent job… but the (my bolding) warning at the end was a surprise:

Me: How do I calculate which day of the month is, for example, the third Thursday?

ChatGPT:

To calculate which day of the month is, for example, the third Thursday, you can follow these steps:

1. Determine which day of the week the first day of the month falls on.

2. Find the day of the week that corresponds to the desired weekday (e.g., Thursday).

3. Add the appropriate number of days to the first occurrence of that weekday in the month to find the desired occurrence (e.g., third Thursday).

Here’s a more detailed breakdown:

1. Find the day of the week for the first day of the month using any method (e.g., a calendar, programming libraries like Python’s `datetime` module).

2. Determine the difference in days between the desired weekday and the day of the week of the first day of the month.

3. Calculate how many days you need to add to the first occurrence of the desired weekday to reach the desired occurrence (e.g., third Thursday).

For example, if the first day of the month is a Monday and you’re looking for the third Thursday, you’d add 4 days (Thursday minus Monday) to the date of the first Monday to find the date of the first Thursday. Then, you’d add (3 – 1) * 7 days to find the date of the third Thursday.

Keep in mind that this calculation might involve considerations for leap years and edge cases where the month doesn’t have the desired occurrence of the weekday (e.g., if there are only two Thursdays in the month).

And more good news from FutureCrunch (now Fix the News):

Humanity sees significant decline in tetanus-related fatalities

Tetanus, a bacterial infection that causes paralysis and can be fatal, claimed over 250,000 lives annually in the early 1990s. By 2019, the number of deaths had plummeted to fewer than 35,000 per year—largely thanks to widespread administration of the combined diphtheria, tetanus, and pertussis vaccines. OWD

The myths holding back police reform

From Neil Gross, professor of sociology at Colby College and a senior fellow at the Niskanen Center in Washington, DC:

Myth #1: The police can’t prevent crime

Although I can understand why some people might feel this way—if you live in a neighborhood with persistent crime and what seems like an oppressive police presence, say—research shows that the opposite is true. All else being equal, the larger the number of police officers in an area, the less crime there tends to be, at least for many kinds of crime…

Myth #2: Police reform compromises public safety

for the US as a whole, property crime has been sloping downward more or less uninterrupted since the early 1990s, as measured by official reports to police as well as anonymous victimization surveys.

And now, preliminary data from the largest US cities show a major drop in homicides for the first half of 2023. (Not for all cities. Violent crime in Washington, DC, for example, including homicide, is up this year.)…

Myth #3: Because of policing’s racist origins, there is nothing we can do to improve it

Policing, for its part, has transformed over the decades, as any historian of the subject can attest, and this is also true along the dimension of race. While stubborn racial disparities remain in use of force, arrest rates for petty offenses, routine traffic stops, internal hiring and promotion, and other aspects of police operations—disparities every department should work to minimize—and while horrific evidence of racial animus continues to surface with disturbing frequency, there can be no serious question that policing in 2023 looks very different than it did in, say, Birmingham, Alabama in 1963, when “Bull” Connor, the notoriously racist public safety commissioner, directed his officers and their dogs to viciously attack civil rights protesters because of his opposition to integration.

Very detailed and interesting, with history and real-life examples. 3,600 words: https://time.com/6316258/myths-police-reform/.

And more good news from FutureCrunch (now Fix the News) (bolding is mine):

Europe’s crackdown on air pollution cuts heart disease deaths
Europe recorded the largest annual decline in PM2.5—the air pollution most closely linked to harmful health effects—of any region of the world between 2010 and 2019. As a result, deaths in the region from heart disease attributed to pollution fell by 19.2% and from strokes by 25.3%. This amounts to 88,880 fewer heart disease deaths and 34,317 fewer stroke deathsFT

Star Wars suggested viewing order

Search your feelings, you know it to be true! Episode I doesn’t matter at all.

Rod Hilton recommends a viewing order for the first six movies. Both release order (IV, V, VI, I, II, III) and episode order (I, II, III, IV, V, VI) have issues. Thus, he recommends Machete Order (IV, V, II, III, VI), entirely skipping Episode I:

Look, I’m not going to sit here and bag on how crappy Episode I is. I’m not even going to try and act like Episode II is better or tell you Episode I ruined my childhood or anything like that. It didn’t, it’s just a movie that isn’t very good.

The reason to skip Episode I isn’t that it’s bad, it’s that it’s irrelevant. If you accept my suggestion that Star Wars, the saga, is really about Luke’s journey and his decision to accept his hero’s burden by saving not only the galaxy from the Empire, but his father from the dark side as well, then you’ll find that everything that happens in Episode I is a distraction from that story…

Every character established in Episode I is either killed or removed before it ends (Darth Maul, Qui-Gon, Chancellor Valorum), unimportant (Nute Gunray, Watto), or established better in a later episode (Mace Windu, Darth Sidious)….

Putting the prequels in the middle in general (which a commenter has pointed out is called Ernst Rister order) allows the series to end on the sensible ending point (<<deleted>>) while still beginning with Luke’s journey.

Approx 4,600 words: https://www.rodhilton.com/2011/11/11/the-star-wars-saga-suggested-viewing-order/. Warning, many spoilers.

And more good news from FutureCrunch (now Fix the News) (bolding is mine):

Domestic violence rates in Australia fall by two-thirds since the 90s
The rate of women killed by their partners has fallen by two-thirds over the past 34 years, part of a long-term trend of domestic and acquaintance homicide rates falling by more than half since 1989. Factors cited include better victim safety, stronger home security, improved policing, economic affluence, an ageing population, higher imprisonment rates, and higher immigration. AFR

Is the United States exceptional?

From Bret Devereaux’s blog (https://acoup.blog/2022/07/08/collections-is-the-united-states-exceptional/, approx 5,600 words):

I am not asking if the United States is the ‘best’ country; I rather like my country, but I understand it is not to everyone’s taste and that is fine… Instead I want to explore a number of ways in which the United States might clearly be considered ‘great’ or even ‘the greatest’ (either now or ever) to make the case both that the United States is obviously and indisputably exceptional and that several of these exceptional facets provide quite a lot of evidence to support the contention that the United States is, in those ways, a great country.

…the United States is both the biggest rich country (that is, it is the largest high income country) and the richest big country (that is, it has the highest income per capita of any country with a large population or land area) both now and at any other time in history…. Consequently, the United States dominates the global economy in a way that no other country does and no other country has ever done.

the United States is the most technologically advanced country to have ever existed. This is a tricky metric to average because it comes so many different fields and of course many countries excel in one field or another, but no country excels in anywhere near as many fields or on as many metrics as the United States does when it comes to technology or the production of knowledge.

We can start with universities. The United States makes up 4.25% of the world’s population but around half of its top research universities.

…the United States is also arguably the world’s oldest functioning democracy and likewise arguably has the world’s oldest still-used constitution… By at least some measurements, the United States is above and away the most individualist country in the world… American culture and cultural products are pervasive in a way that no other culture has ever really been. Of the top grossing films worldwide, American production companies are responsible for all of the top 29 before Skyfall (2012) finally gives us a non-American entry.

massive U.S. military spending continues to buy an incomparably massive amount of military power. The United States operates half of the world’s active aircraft carriers, 11 of the top 11 for raw combat power (which mostly comes down to the size of their air wing). The United States has both the world’s largest air force (the United States Air Force) and the world’s second largest air force (the U.S. Navy)... Normally due to balancing behavior, we’d expect a large coalition of allies to oppose U.S. interests, but instead the opposite is true: the United States leads the largest collection of peacetime allies in human history. The United States has essentially constructed a web of interlocking alliances with the USA at the center; NATO alone makes up a simple majority of global military spending before one even considers other treaty allies of the United States like Japan, South Korea, Australia, New Zealand and at least notionally most of South America.

…It has resulted in a country which is not merely exceptional, but exceptionally exceptional – that is, the United States is highly unusual in an unusually high number of ways.

Perhaps not surprisingly, the post has many comments…

And more good news from FutureCrunch (now Fix the News) (bolding is mine):

Deadliest form of heart attack falls by over half in United States
A recent study found that the rate of STEMI ((ST‐segment-elevation myocardial infarction)) heart attacks, caused by a near-total blockage of a coronary artery, has decreased by nearly 50% over the past 15 years. However, there are still disparities in care based on income, with low-income individuals experiencing higher rates of STEMI heart attacks and being more likely to die from them.

Firesign Theater

I ran into The Firesign Theater back in my college days (yes, many years ago). Their humor is… different. Here’s an ad for Mr. Leonardo’s Warehouse of Eternal Art (1 min 13 seconds), and their own High School Madness (8 min 5 seconds). A comment from YouTube: “Visionaries; masters of parody on reality and play on words. The Firesign Theatre wrote, recorded, and produced, brilliant comedy. The kept a whole generation sane during the Vietnam War.”

“Don’t eat with your hands, son! Use your entrenching tool!”

More Firesign Theater is available on YouTube.

And more good news from FutureCrunch (now Fix the News) (bolding is mine):

Ghana’s fight against malaria has seen a major breakthrough, with a 90% reduction in malaria mortality since 2012Mass shootings in the United States are down 29% from last year. The Kingdom of Saudi Arabia just pledged $500 million to end polio for good. Real solutions to homelessness in the United States exist; Houston and New Orleans show the way. Student debts will be lowered for more than three million Australians.

Math jokes

And several other kinds. (You will need some specialist knowledge to get some of these.) If eleven pages of this aren’t enough, check the comments from the tech people on Hacker News. Some examples:

—Why did the chicken cross the Mobius strip?
—To get to the other… er, um…

Not all math puns are terrible. Just sum.

The barman says, “We don’t serve time travelers in here.”
A time traveler walks into a bar.

Eleven pages: https://arxiv.org/pdf/2403.01010.

Hacker News: https://news.ycombinator.com/item?id=39659383.

And more good news from FutureCrunch (now Fix the News):

50 years of global immunisation

A new report estimates that since the 1970s, global immunisation efforts have saved an estimated 154 million lives—the equivalent of six lives every minute of every year. Vaccination against 14 diseases, including diphtheria, measles, polio, rubella, and tuberculosis, has helped reduced infant deaths by 40% globally and by more than 50% in Africa. VoxWHO.

Vaccines are among the most powerful inventions in history, making once-feared diseases preventable. Thanks to vaccines, smallpox has been eradicated, polio is on the brink, and with the more recent development of vaccines against diseases like malaria and cervical cancer, we are pushing back the frontiers of disease. WHO Director-General, Dr Tedros Adhanom Ghebreyesus

EVs help people who breathe

Hundreds of infants’ lives would be saved and millions of children would breathe easier across the US if the nation’s power grid depended on clean energy and more drivers made the switch to zero-emission vehicles, according to a new report from the American Lung Association….

Electric cars and trucks are better than gas-fueled vehicles because over the course of their lifetime they emit fewer carbon emissions. EVs create 3,932 pounds of carbon equivalent per year, compared to 11,435 for gas powered vehicles, according to calculations from the US Department of Energy. ((Some emissions occur during EV and battery construction and from recharging.))

This latest report estimates that by 2050, a switch to zero-emission vehicles and a decarbonized electric grid would mean 2.79 million fewer pediatric asthma attacks, 147,000 fewer pediatric acute bronchitis cases, 2.67 million fewer cases of pediatric upper respiratory symptoms and 1.87 million fewer cases of pediatric lower respiratory symptoms, and 508 infants’ lives would be saved.

The research comes from a larger American Lung Association report that said a big push for zero-emission vehicles would create more than $1.2 trillion in health benefits for the US by 2050… Globally, 8.8 million people die prematurely because of air pollution every year.

((Bolding is mine.)) https://www.cnn.com/2024/02/21/health/electric-vehicles-air-pollution-kids/index.html. 1,200 words.

ChatGPT 3.5 available for free

The famous Large Language Model is now available for free, no account needed. (Note that the premium and superior version is 4.0… possibly later by the time you read this.) https://chat.openai.com/

And more good news from FutureCrunch (bolding mine):

Three countries making uncelebrated progress on poverty
Uzbekistan has witnessed a sharp decline in child poverty, falling from 21.5% in 2021 to 13.7% in 2023; in the Philippines, a new report estimates the poverty rate could soon fall to single digits; and in Cambodia, average incomes have grown fourfold since 1990 and average schooling has increased from 2.4 to 5.1 years.

Swiss women win major climate court case

A group of 2,000+ senior women in Switzerland have won a court case that may force European governments to do more about climate change:

The European Court of Human Rights (ECHR) ruled Tuesday that Switzerland had not acted urgently to achieve climate targets, leading victims, who are mostly in their 70s, to suffer physically and emotionally while potentially placed at risk of dying.

The women, part of a group called KlimaSeniorinnen (Senior Women for Climate Protection), filed the lawsuit nine years ago.

The court’s judgment is binding, cannot be appealed, and could “influence the law in 46 countries in Europe including the UK,” the BBC reported.

I found this in Ars Technica: https://arstechnica.com/tech-policy/2024/04/2000-senior-women-win-biggest-victory-possible-in-landmark-climate-case/. More information on senior women fighting climate change at https://19thnews.org/2024/01/climate-grandmothers-environmental-activism/:

These are the climate grannies. They’ll do whatever it takes to protect their grandchildren.

And more good news from FutureCrunch (bolding mine):

FBI confirms huge decline in crime in the United States
New data from over 13,000 agencies, covering all of 2023, have shown that there was a 13% decline in murder last year (the largest one-year decline ever recorded); a 6% decline in violent crime, likely the lowest rate since the late 1960s; and a 4% decline in property crime. Fox News has been strangely silent.

From the internet (2018, part 2)

More stuff I saved because it was funny or useful or somehow worth saving:

❖❖❖❖❖❖❖❖

Changing life patterns: use habit substitution (replace smoking with chewing gum – can’t do both); habit attachment (append new habit to existing one, like floss after brushing).

❖❖❖❖❖❖❖❖

When dealing with clutter, I pick up an object and go “where should I put this?”, and of course this doesn’t work, because if I knew that, I would’ve put it there in the first place. It’s clutter because I didn’t have an answer.

So instead, I say “Where should this be a year from now?”

For some reason, this elicits entirely different answers. It cuts through the paralysis and imagines a future where the needful has been done.

Start with a very small habit that doesn’t take a whole lot of willpower to do and consistently do it…like do 1 sit up, and do it EVERY DAY.

❖❖❖❖❖❖❖❖

((I actually found this one to be helpful:))
Procrastinate later! What’s the rush? There’s always tomorrow!

((Also on procrastination:))
“Discipline is much more valuable than motivation.”

❖❖❖❖❖❖❖❖

In times of crisis, the wise build bridges, the fools build barriers.

❖❖❖❖❖❖❖❖

 “When another blames you or hates you, or people voice similar criticisms, go to their souls, penetrate inside and see what sort of people they are. You will realize that there is no need to be racked with anxiety that they should hold any particular opinion about you.”

― Marcus Aurelius, Meditations

❖❖❖❖❖❖❖❖

Look for the word “homeopathic” on the label: that’s Greek for useless.

❖❖❖❖❖❖❖❖

I had no idea so many women wanted to be my friend until I started dating …@Spaziotwat

❖❖❖❖❖❖❖❖

The duty of the general is to ride by the ranks on horseback, show himself to those in danger, praise the brave, threaten the cowardly, encourage the lazy, fill up gaps, transpose a company if necessary, bring aid to wearied, anticipate the crisis, the hour, and the outcome. – Onasander

❖❖❖❖❖❖❖❖

And in good news from FutureCrunch (2024!):

Everything in America is awful
Apart from the fact that marriage rates are up and divorce rates are down, the percentage of Americans without health insurance has fallen by almost half since 2010, employment for people in their prime working years is at its highest level in more than two decades, manufacturing construction spending has climbed to $225 billion per month, cholesterol levels are gradually improving across the country, and life expectancy has increased for the first time in two years thanks to a levelling off of overdose deaths.