Miller Shuffle Algorithm
Everyone loves 'shuffle' on their music player. I never really thought about how it worked to ensure that it randomly shuffled through a playlist without repeats, but this guy has, and he has improved on it.
From the linked instructables page:
With the case of an MP3 player, or any play-list shuffle, one might and apparently some do (even on big name electronics and streaming services), simply use an operation like songIndex=random(NumOfSongs). This use of a PRNG will give you a good mathematical randomness to what is played. But you will get many premature repetitions of song selection. With a population of 1000 to choose from you will get ~37% repeats out of 1000 plays. From the start of a listening session on average a song will repeat within ~26 songs. The % of repeats is the same regardless of the selection population size.
The accepted goal of a “Shuffle” algorithm is herein defined as providing means to reorder a range of items in a random like manner, where each item is referenced once, and only once, when going through the range (# of items). So for 1-52 (think card deck) you get 52 #s in a pseudo random order, or similarly for a song list of 1000s. Re-shuffling gives a very different mix.
The Fisher-Yates (aka Knuth) algorithm has been a solution that fixes this unwanted repetition. The 1000 songs play in a 'random' order without repeating. The issue this algorithm does come with is the added burden of an array in RAM memory of 2 times the maximum number of songs (for up to 65,000 songs 128KB of RAM is needed) being dedicated to shuffled indexes for the duration that access to additional items from the shuffle are desired (so as to not give repeats).
After reading it and trying to read the code (written in C, I believe), there is also a link to a github repo with more iterations on the algorithm. A few excerpts:
The way the algorithm works its magic is by utilizing multiple curated computations which are ‘symmetrical’, in that the range of values which go in are the same values which come out albeit in a different order. Conceptually each computation {e.g. si=(i+K) mod N } stirs or scatters about the values within its pot (aka: range 0 to N-1) in a different way such that the combined result is a well randomized shuffle of the values within the range. This is achieved without the processing of intermediate “candidates” which are redundant or out of range values (unlike with the use of a PRNG or LFSR) which would cause a geometrically increasing inefficiency, due to the overhead of retries.
So basically you can query the algorithm, providing the "deck" of things, and what your location in the query is, the seed info (for randomness), and then it can tell you what is next in the shuffle without actually having to move things around.
For example, let's say we had a deck with five cards in it: [a, b, c, d, e] - We just tell the algorithm three things:
- What our current index is in the deck
- A "shuffle ID" which is the seed for the randomizing
- How many entries are in the deck
So if we're just starting it, we'd say we're at position -1, which doesn't exist. We give it the random shuffle ID of "123" and lastly we tell it there are 5 entries. It then calculates that the next position to start playing is 4th in the queue. Then when it is time to play the next song the algorithm is fed "4", "123" and "5" to then return 2, etc.
Under the most common other way of handling randomizing playlists what happens is it takes the indexes for each item in the deck, then shuffles them. So it might create a separate list of the deck positions, [2,5,1,3,4] which requires you to maintain this memory. For desktop computers, obviously that is not a problem. But what if you're making a tiny computer using a simple board like an Arduino or something and you have memory limitations, etc. This is a big step forward for it.
Will it change the world? Doubtful. But still interesting to learn about.

Two Years without Invasive Hornets in Washington State
For the second year in a row, no northern giant hornets were detected in Washington, the state Department of Agriculture reported Dec. 4.
The department recently completed its annual invasive pest survey and will begin removing more than 800 northern giant hornet traps that have been monitored since July. An additional 200 traps were placed throughout the state by federal state and local agencies, community groups and private citizen scientists.
I guess you could say these hornets have... buzzed off.

COP28 Leader Slammed after claim against fossil fuel phaseout
"There is no science out there, or no scenario out there, that says that the phaseout of fossil fuel is what's going to achieve 1.5C."
In his remarks revealed earlier this week by The Guardian, Al Jaber not only attempted to discredit the idea that preserving a livable climate requires phasing out fossil fuels—he attempted to paint the idea as extremist.
He said he expected a "sober and mature conversation," not an "alarmist" one, when former Ireland president Mary Robinson asked him during a panel discussion whether he would support a global effort to phase out fossil fuels. He appeared offended she even asked.
Al Jaber has attempted to walk back these comments amid uproar this week, claiming he believes "the phase down and the phaseout of fossil fuel is inevitable." Even U.S. Climate Envoy John Kerry has shrugged off the comments, saying they probably "came out the wrong way."
🙄

Japan to make university free for families with three or more children starting in 2025
I saw this mentioned on Mastodon and so I went to find a related article for more information:
In a significant policy shift to tackle Japan's severe decline in birth rates, the Japanese government is planning to offer free college tuition to families with three or more children starting the 2025 academic year. This move is a part of the broader "Children's Future Strategy," which Prime Minister Fumio Kishida discussed in a recent press conference. This policy and the broader strategy is set for a Cabinet decision later this month.

I hate when this sort of thing happens. That sort of behavior is truly universal in that sort of work, so much goofing around and personality when the cameras are off. And one miscue on camera timing and this poor woman has to jump through PR hoops.

December 6th, 2023
Automated Archives for December, 6th 2023
This post was automatically generated
Wallabag Additions
These are articles that which I saved today so that I may read them later. Substance and quality will vary drastically.
- Understanding Iraqi Democracy: A Conversation with Marsin Alshamary - Brown Political Review
- After 50 Years, a Danish Commune Is Shaken From Its Utopian Dream
- Was Henry Kissinger Really a Realist?
- Why We Need Community Now More than Ever | The Walrus
- Ammon Bundy Has Disappeared
Chess For the Day
Record: 3-0-2
Net Elo Change: +8
Games Played
Blog Posts On This Day
- 1 year ago (6 posts)

Facebook rolling out end-to-end encryption on messenger chats and calls

How a Fossil Fuel Treaty Could Support the Paris Agreement
Inside Climate News is among the websites I subscribe to in my RSS feed. And largely I love their coverage. This headline got my attention, worrying that the fossil fuel lobbyists had gotten to them. But I ended up enjoying this article and getting a better insight into what could be useful and helpful. Will it ultimately be used for good? I honestly doubt it, but it raised an excellent point regarding that we're sort of going into this backwards by trying to lessen demand which puts no cap on production.
From the intro:
What we’re seeing here at COP28 is that fossil fuels have finally been dragged center stage, in part because of the fossil fuel treaty campaign around the world for the last three years raising awareness about the fact that we are not aligning the production of fossil fuels with Paris goals. Right now we are on track to produce 110 percent more oil, gas, and coal between now and 2030 than we can ever burn if we want to meet the goal of 1.5 degrees Celsius.
We need new agreements between countries on who gets to produce what fossil fuels and how much, and for how long. We need a plan that’s based on equity and fairness to align production with a global carbon budget. And we’re going to need new financial mechanisms and cooperation to support countries in, first of all, stopping the expansion of fossil fuels, and then secondly, winding down the production of fossil fuels.
There are so many countries today that are expanding the production of fossil fuels just to feed their debt. So some of the areas that are being looked at under a fossil fuel treaty include debt relief or tax agreements and trade agreements in order to make stopping the expansion and production and winding down production viable for many countries around the world.
From the first actual Question and Answer of the article after the intro:
There’s something intuitive about the notion that we should be producing less fossil fuel. But I’ve also heard well reasoned arguments that targeting supply specifically will either be ineffective, because other countries will simply increase production to meet demand, or that if it is effective and begins to crimp supply, that it would lead to energy price spikes and volatility that would undermine political support and potentially hurt developing nations the most. What’s your response to these critiques?
Trying to phase out fossil fuels by designing policy that is only to reduce demand is like trying to cut with one half of the scissors. We need to cut both supply and demand because what we build today will be what we use tomorrow. So we’ve had 30 years of climate policy and negotiations, designed just to reduce demand. And it’s not working. It’s not working fast enough to keep us safe.

How a Fossil Fuel Treaty Could Support the Paris Agreement
Inside Climate News is among the websites I subscribe to in my RSS feed. And largely I love their coverage. This headline got my attention, worrying that the fossil fuel lobbyists had gotten to them. But I ended up enjoying this article and getting a better insight into what could be useful and helpful. Will it ultimately be used for good? I honestly doubt it, but it raised an excellent point regarding that we're sort of going into this backwards by trying to lessen demand which puts no cap on production.
From the intro:
What we’re seeing here at COP28 is that fossil fuels have finally been dragged center stage, in part because of the fossil fuel treaty campaign around the world for the last three years raising awareness about the fact that we are not aligning the production of fossil fuels with Paris goals. Right now we are on track to produce 110 percent more oil, gas, and coal between now and 2030 than we can ever burn if we want to meet the goal of 1.5 degrees Celsius.
We need new agreements between countries on who gets to produce what fossil fuels and how much, and for how long. We need a plan that’s based on equity and fairness to align production with a global carbon budget. And we’re going to need new financial mechanisms and cooperation to support countries in, first of all, stopping the expansion of fossil fuels, and then secondly, winding down the production of fossil fuels.
There are so many countries today that are expanding the production of fossil fuels just to feed their debt. So some of the areas that are being looked at under a fossil fuel treaty include debt relief or tax agreements and trade agreements in order to make stopping the expansion and production and winding down production viable for many countries around the world.
From the first actual Question and Answer of the article after the intro:
There’s something intuitive about the notion that we should be producing less fossil fuel. But I’ve also heard well reasoned arguments that targeting supply specifically will either be ineffective, because other countries will simply increase production to meet demand, or that if it is effective and begins to crimp supply, that it would lead to energy price spikes and volatility that would undermine political support and potentially hurt developing nations the most. What’s your response to these critiques?
Trying to phase out fossil fuels by designing policy that is only to reduce demand is like trying to cut with one half of the scissors. We need to cut both supply and demand because what we build today will be what we use tomorrow. So we’ve had 30 years of climate policy and negotiations, designed just to reduce demand. And it’s not working. It’s not working fast enough to keep us safe.

December 5th, 2023
Automated Archives for December, 5th 2023
This post was automatically generated
Wallabag Additions
These are articles that which I saved today so that I may read them later. Substance and quality will vary drastically.
- After 50 Years, a Danish Commune Is Shaken From Its Utopian Dream
- Was Henry Kissinger Really a Realist?
- Why We Need Community Now More than Ever | The Walrus
- Ammon Bundy Has Disappeared
Chess For the Day
Record: 3-0-2
Net Elo Change: +3
Games Played
Blog Posts On This Day
- 1 year ago (7 posts)

"You’re Telling Me That Thing Is Forged?"
I forget the name of the book I read, but it was discussing the absurdity that was the Trump regime and how inept they were at actually running the country. It was in that book that I was first introduced to John McEntee. The linked article recounts a bit more about John. This first excerpt captures what had been highlighted in the book, which was the absolute absurd levels of loyalty which were required by that regime. The second one was new to me and absolutely wild to read about.
Edit: Ah yes, the book I was trying to think of was Michael Lewis' The Fifth Risk.
Johnny McEntee was just twenty‑five years old when he volunteered to work on the Trump campaign in 2015. He didn't have much experience—he was a production assistant on the news desk at Fox News at the time—but he was eager, confident, and willing to work hard. Most importantly, he loved Donald Trump. A former quarterback at the University of Connecticut, he achieved short-lived internet fame in 2011 when a video of him throwing trick passes went viral. Trump liked having him around and soon made him his personal assistant, taking him along whenever he traveled. As the campaign ramped up, he became Trump's "body guy," carrying the candidate's bags and relaying messages.
McEntee reprised the role in the White House after the 2016 election, but was fired in early 2018 by then-chief of staff John Kelly when a background check turned up a serious gambling habit that was considered to pose a national security risk. He didn't leave for long, though. After Kelly himself was fired, McEntee returned to the White House in February 2020.
His second stint in the administration proved to be more consequential. McEntee resumed his role as Trump's body guy with a seat just outside the Oval Office, but he was also named director of the Presidential Personnel Office, which is responsible for the vetting, hiring, and firing of the four thousand political appointees who serve in the executive branch. McEntee may have never hired or fired anybody before in his life, but he was fiercely loyal—and for Trump, that made him the perfect choice for the job.
McEntee's efforts to root out Trump infidels in the administration were often comically petty, but they came with the force of a presidential mandate. Just weeks before the 2020 presidential election, for example, somebody on McEntee's staff discovered that a young woman in the office of Housing and Urban Development Secretary Ben Carson had liked an Instagram post by pop star Taylor Swift that included a photo of Swift holding a tray of cookies decorated with the Biden-Harris campaign logo. The transgression was brought all the way to White House chief of staff Mark Meadows, who placed a call to Carson's top aide. The message: We can't have our people liking the social media posts of a high‑profile Biden supporter like Taylor Swift.
Now, this comes out from January 6th investigations, and is mind boggling.
The January 6 Committee's investigation unearthed the extraordinary story of what happened next—but the information didn't make it into any of the committee's hearings or its final report. What follows is based on the sworn testimony of the key players, including McEntee and Macgregor, as well as National Security Advisor Robert O'Brien and General Mark Milley, the chairman of the Joint Chiefs of Staff.
Three days after Macgregor arrived at the Pentagon, he called McEntee and told him he couldn't accomplish any of the items on their handwritten to-do list without a signed order from the president.
"Hey, they're not going to do anything we want, or the president wants, without a directive," Macgregor told him, emphasizing the need for an official White House order signed by Trump. The Pentagon's stonewalling made sense, of course: You don't make major changes to America's global defense posture based on a glorified Post-it note from the president's body guy.
The order, Macgregor added, should focus on the top priority from McEntee's list—Afghanistan—and it had to include a specific date for the complete withdrawal of all uniformed military personnel from the country. He suggested January 31, 2021.
McEntee and an assistant quickly typed up the directive, but they moved the Afghanistan withdrawal timeline up to January 15—just five days before Trump was set to leave office—and added a second mandate: a complete withdrawal of US troops from Somalia by December 31, 2020.
McEntee, of course, didn't know the first thing about drafting a presidential directive—let alone one instructing the movement of thousands of servicemen and -women. He had two jobs in the White House—only one of which he was qualified for—and neither one had anything to do with national security or the military. An order even 10 percent as consequential as the one McEntee was drafting would typically go through the National Security Council with input from the civilian leadership at the Pentagon, the Joint Chiefs of Staff, and the military commanders in the region. Instead, the guy who usually carried Trump's bags was hammering it out on his computer, consulting with nobody but the retired colonel the president had just hired because he had seen him on cable TV.
The absurdity of the situation was captured in McEntee's interview with the January 6 Committee:
Q: Is it typical for the Presidential Personnel Office to draft orders concerning troop withdrawal?
McEntee: Probably not typical, no.
Because they were so out of their depth, McEntee and his assistant ended up reaching out to Macgregor again—they didn't know how to arrange the document they were working on. "I was called on the phone by one of McEntee's staffers who was having trouble formatting the order and getting the language straight," Macgregor recalled. The retired colonel told the thirty-year-old staffer to open a cabinet, find an old presidential decision memorandum, and copy it.
Easy enough. The duo wrote up the order, had the president sign it, and sent it over to Kash Patel, the new acting defense secretary's chief of staff.
Chaos ensued.

December 4th, 2023
Automated Archives for December, 4th 2023
This post was automatically generated
Chess For the Day
Record: 4-0-1
Net Elo Change: +17
Games Played
Blog Posts On This Day
- 1 year ago (10 posts)

Time's best inventions of 2023
All sorts of things on this list. I had heard of many of them, some are insane, and some are amazing.

"Requiem for the American Dream" book review
I haven't read the book yet, it's on my virtual stack to get to eventually. I did enjoy this review of it though.
Ours Was the Shining Future, Leonhardt’s first book, is an attempt to explain what happened. His take, which I believe is correct, is that democratic capitalism (defined as “a system in which the government recognises its crucial role in guiding the economy”) has since the 1970s given way to a laissez-faire free-for-all in which corporations and short-termism rule. In this world, he writes, “there is no longer a mass movement focused on improving economic outcomes for most Americans. The country’s largest activist groups, on both the left and the right, are focused on other subjects.”
How did we get here? In Leonhardt’s analysis, changes to three things — political power, culture and investment — mean that average, working Americans have been left behind. Since the late 1960s, the “old labor” of the New Deal has been hijacked by a new and more entitled “Brahmin left”, increasingly made up of college-educated elites that talk down to workers rather than with them. In a country that fundamentally skews more socially conservative, the Democratic party has also become too radically progressive on social issues such as abortion, immigration and LGBTQ rights.
Because of this, they have lost the electoral votes needed to push through badly needed economic policies such as long-term public investment, as well as more progressive taxation, plus healthcare and educational reform, that would temper rising inequality. Add in a “greed is good” culture of self-interest and global market forces pushing only what’s good for the quarter, and you get a country in decline.

"The end of Elon Musk" by Drew Magary
Years ago I read Drew Magary's The Postmortal and really enjoyed it for what it asked about the nature of life and death. Here's Drew discussing the pop-death of Elon Musk regarding his recent awful appearance at the NY Times book event:
Musk, who appeared both high and made of plywood, responded with a reality of his own:
"Actually, what this advertising boycott is going to do is, it's going to kill the company. And the whole world will know that those advertisers killed the company, and we will document it in great detail."
Here Musk looked out to the audience, expecting vehement agreement, perhaps even applause. He was greeted with dead silence instead. Sorkin, still residing in the correct reality, told Musk, "But those advertisers, I imagine they're going to say, 'WE didn't kill the company.'"
And here is where Musk revealed his delusion to all. "Oh yeah?" he shot back. "Tell it to Earth."

December 3rd, 2023
Automated Archives for December, 3rd 2023
This post was automatically generated
Wallabag Additions
These are articles that which I saved today so that I may read them later. Substance and quality will vary drastically.
Chess For the Day
Record: 0-0-3
Net Elo Change: -19
Games Played
Blog Posts On This Day
- 1 year ago (5 posts)

December 2nd, 2023
Automated Archives for December, 2nd 2023
This post was automatically generated
Wallabag Additions
These are articles that which I saved today so that I may read them later. Substance and quality will vary drastically.
Chess For the Day
Record: 2-0-2
Net Elo Change: +1
Games Played
Blog Posts On This Day
- 1 year ago (4 posts)

December 1st, 2023
Automated Archives for December, 1st 2023
This post was automatically generated
Wallabag Additions
These are articles that which I saved today so that I may read them later. Substance and quality will vary drastically.
Chess For the Day
Record: 4-0-3
Net Elo Change: +5
Games Played
- renatomartin - LOSS
- EzzELDen_Youssef - WIN
- Hamburgerjung78 - WIN
- garleu - WIN
- hajiyev_i - WIN
- amirshahidi - LOSS
- RaVaN124421 - LOSS
Blog Posts On This Day
- 1 year ago (7 posts)

November 30th, 2023
Automated Archives for November, 30th 2023
This post was automatically generated
Wallabag Additions
These are articles that which I saved today so that I may read them later. Substance and quality will vary drastically.
- A People’s Obituary of Henry Kissinger
- Henry Kissinger, War Criminal Beloved by America's Ruling Class, Finally Dies
Chess For the Day
Record: 0-0-2
Net Elo Change: -11
Games Played
Blog Posts On This Day
- 1 year ago (5 posts)
