Conservative. Idaho. Software engineer. Historian. Trying to prevent Idiocracy from becoming a documentary.
Email complaints/requests about copyright infringement to clayton @ claytoncramer.com. Reminder: the last copyright troll that bothered me went bankrupt.
Sunday, February 28, 2021
Geek Squad Done With My PC
Saturday, February 27, 2021
Friday, February 26, 2021
Thursday, February 25, 2021
PC broken
The Most Comedic Comment Thread This Week
Wednesday, February 24, 2021
I am Spending a Lot of Time on Youtube
About to Go Into Shock
Read Now
As much as I hate National Review for its Never-Trumpism, this article points out that V-C day uis coming and soon:
Rates of infection have retreated before, but this time will be different, because a colossal number of Americans (perhaps 120 million) have already been infected, because a very large number of Americans (65 million) have received a vaccine, and, crucially, because a major chunk of the people we would most like to get vaccinated (due to age or because they interact with lots of others) already have had their shot.
Everywhere the virus turns, it is looking at roadblocks. It has fewer and fewer avenues to destroy. The beast is being cornered. And the Johnson & Johnson vaccine should be approved within days, with 20 million doses soon to be ready. With all of these weapons, and rapidly burgeoning infrastructure to deliver them to the target, getting 2 million people a day vaccinated is not a far-fetched goal. Even those who only get one dose of either the Pfizer or Moderna vaccine will enjoy a terrific level of protection. As the distribution machinery starts to work more efficiently, we could get something like 180 million shots into arms this spring, on top of the 65 million jabs that have already been jabbed. It is not necessary for every last American to get a shot before the virus goes into its inevitable death spiral. These trends appear likely to cut it to shreds before the first really hot day arrives in the Northeast. Meanwhile, cases have fallen 75 percent from a peak seven-day average of a quarter of a million in January to 55,000 on February 22.
Democrats Pushing Censorship
Members of Congress asking cable TV companies to drop conservative news channels for doubleplusngood news:
Yet, to our knowledge, the cable, satellite, and over-the-top companies that disseminate these media outlets to American viewers have done nothing in response to the misinformation aired by these outlets. 14 AT&T currently carries Fox News, Newsmax, and OANN on U-verse, DirecTV, and AT&T TV. 15 As a company that serves 17 million Americans,16 AT&T plays a major role in 2 the spread of dangerous misinformation that enabled the insurrection of January 6th and hinders our public health response to the current pandemic.
It is for these reasons we ask that you provide us with responses to the following questions about AT&T’s policies toward content carried on U-verse, DirecTV, and AT&T TV by March 8, 2021:
1. What moral or ethical principles (including those related to journalistic integrity, violence, medical information, and public health) do you apply in deciding which channels to carry or when to take adverse actions against a channel?
2. Do you require, through contracts or otherwise, that the channels you carry abide by any content guidelines? If so, please provide a copy of the guidelines.
3. How many of your subscribers tuned in to Fox News, Newsmax, and OANN on U-verse, DirecTV, and AT&T TV for each of the four weeks preceding the November 3, 2020 elections and the January 6, 2021 attacks on the Capitol? Please specify the number of subscribers that tuned in to each channel.
4. What steps did you take prior to, on, and following the November 3, 2020 elections and the January 6, 2021 attacks to monitor, respond to, and reduce the spread of disinformation, including encouragement or incitement of violence by channels your company disseminates to millions of Americans? Please describe each step that you took and when it was taken.
This is not strictly a threat to censor, but anyone that does not recognize this as an attempt to suppress differing opinions is not strong on reading skills.
Astonishing Video
Cardboard as Sheet Metal Stand-in
Bow Crime
Some years ago, there was a murder for hire in Sonoma County with a crossbow. The bad guys kidnapped a business rival of their employer near Sacramento and eventually killed him in northern Sonoma County. I guess California gun control worked; they did not use a gun for murder. I thought this very odd, but I just found this video on YouTube:
Tuesday, February 23, 2021
Group Trap
This 2/21/21 Reuters article could have been headlined "Transgender OathKeeper Turns Out to be Mole."
Briefly, OathKeepers were a component of the Capitol mob. ("The Capitol Mob" sounds like a Sunday morning politics talk show, doesn't?) She/he/? is pleading for home confinement bail because she/he/? is worried about rough treatment in jail. She claims to have met with the Secret Service before the riot. The Secret Service gave one of those "We will not confirm it, but we will not quite deny it, in case she has proof we met" answers:
A Secret Service representative said it worked with government partners for security on Jan. 6, but added “any assertion that the Secret Service employed private citizens to perform those functions is false.”
Group trap: A friend who was an antiwar activist in the 1960s told me, "You could always tell who the FBI agent was; he was the one who thought burning down the ROTC building was a neat idea." Any time you get together with a group intending civil disobedience or unlawful activity, you are opening yourself to informers or agent-provocateurs. Read Joseph Conrad's The Secret Agent (1907). Lone wolves are the safest form of subversion.
Monday, February 22, 2021
Interesting Solution
I mentioned a while back that as disturbing as the various civil war scenarios are, the big problem with secession is that large numbers of Red State Americans are dependent on their Social Security checks. I am imaging an independent nation that can be pretty sure that the rump USA is going to stop issuing those payments. In addition, I expect that without the restraints imposed by the Red States, the rump USA would rapidly go bankrupt, paying reparations to blacks for slavery; Indians for land theft (even though much of it was purchased, often under less then honest circumstances on both sides of the table); reparations to LGBTQABCDEFG for 250 years of oppression; destruction of any remaining industry to meet nonsensical climate change lies and strengthen the Chinese economy towards the left's long-tem goal: the end of American leadership to Chinese hegemony..
Bu there would be a solution. Much of the Western U.S. is federally owned land. Some of it is national parks which will remain tourist attractions and thus income sources for the new nation. But most BLM land could be auctioned off. Ranchers use most of that land now and often at subsidized rental rates. The environmentalists who have for 30 years been most upset with those ranchers might put their billions to work buying much of that land. People who want a square mile to avoid neighbors with their stereos turned up too loud would also be buyers.
Many military bases would likely be of value for their current use to the new nation. Some would be surplus, and because of airstrips, hangars and other support infrastructure would be of value to companies relocating to the new less regulated nation.
National forests would also be of value, both to developers building 40 acre high end homes, and likely some forestry companies. The environmentalists are also free to bid with their billions.
More exploitation of mineral resources the left has been locking up over the last 40 years would also produce income. Building a dam across the Snake River would produce hydropower for sale to "green" California, and by controlling the flow into the Columbia River, provide leverage on Oregon and Washington State concerning finances, and provide irrigation water for Idaho and Nevada. (I am thinking of a really tall dam.) The Snake River Gorge south of Boise just screams for it. The Colorado River's water flow to California would do likewise.
I think enough money could be raised to replace much of the current Social Security income stream.
I hope it does not come to this, but I fear nothing short of civil war or secession will cause the left to stop its campaign for racial oppression and economic collapse.
Keep in mind that secession does not qualify as treason. Making war with the national government would. The first Civil War started because South Carolina attacked a U.S. fort. Simply blockading U.S. bases would likely either bring the U.S. government to abandon those bases, or force negotiate a settlement.
Changing Mass Murder Weapon Types
Suddenly, in 1916, I am seeing lots of iron bars being used as blunt objects. Perhaps they are doing a better job of reporting the details.
Sunday, February 21, 2021
As Frustrating As All This Has Been
At least our unemployment rate is doing well: 4.4% for December. I suspect much of this is construction. Housing is sprouting everywhere and construction is ultimate social distancing. I have become interested in metal detectors. Some are promoting it as a social distancing hobby. Maybe once the snow melts.
I am also planning to pour a 8' x 16' pad for a 7.5' x 7.5' shed for the telescopes. This, plus an inordinate amount of ammo to hold the shed down, will free up needed garage space. The backyard is also Milky Way dark. I have been looking for a solution that does not block views of my neighbors and this seems to be the best choice.
Saturday, February 20, 2021
Montana Constitutional Carry: State 18
2/18\/21 Bozeman Daily Chronicle:
Republican Gov. Greg Gianforte signed legislation on Thursday that will expand where gun owners may carry firearms.
House Bill 102 allows people to carry a concealed weapon without a permit in most public settings, including banks and bars. Those with a permit will be able to carry in state and local government offices, as well.
The bill also limits restrictions the state university system can place on firearms on college campuses, including at Montana State University....
The university system initially raised questions about the bill, but on Thursday, Kevin McRae, deputy commissioner of higher education, said amendments made to the bill as it worked its way through the state Legislature “improved it in our view.”
The amendments include allowing the university system to restrict firearms at events staffed by university police, to require proof of firearms training and to delay the effective day to June 1 rather than upon Gianforte’s signing of the bill.
I Keep Hearing the Claim That There is a Large Movement Among Christians That Calls Itself "Antiscience"
Vermont Supreme Court Upholds Large Capacity Magazine Ban
Vermont v. Misch (Vt. 2021) is a steaming disaster of a decision. Why? As is often the case with gun law decisions, it is likely the person arguing for his rights. Max Misch is by this account, a white supremacist who cannot avoid physical confrontation and racial slurs.
You may be asking why this matters? If the argument is valid, it should not matter who is making the argument. In some universe, sure, but especially in a small state like Vermont, I am sure Misch's name is well-known, and judges are humans, too.
Good News on COVID-19
At least for a large fraction of Idahoans. 2/19/21 KTVB:
BOISE, Idaho — The Central District Health Board voted unanimously to lift COVID-19-related health orders in both Ada and Valley counties Friday, even as health officials expressed concerns about a new and deadlier strain of the virus detected in the Boise area.
The Valley County order had mandated masks in public places and schools, while Ada County's was more comprehensive, dealing with masks, social distancing, and gathering sizes. The board's vote replaces those orders - which were punishable by law, though rarely enforced - with advisories that function as "strong recommendations" to continue adhering to guidelines aimed at preventing further spread of COVID-19. The vote does not supersede orders by individual cities, such as Boise's mask mandate, or overrule any orders put in place statewide by the governor.
Trump is out of office, so even positive if not overwhelmingly proved news is now allowed on CNN. 2/20/21 CNN:
(CNN)Health experts have said that data so far has shown that Covid-19 vaccines prevent symptoms of the virus -- but a new study suggests that the Moderna and Pfizer vaccines may also prevent infections.
A team at the Mayo Clinic health system looked at more than 31,000 people across four states who had received at least one dose of either vaccine -- and found their vaccines were upwards of 80% effective in preventing infection 36 days after the first dose.Vaccine efficacy was 75% 15 days after the first dose, and appeared 89% effective from 36 days after the second dose, according to the research, which has not yet been peer-reviewed.
Friday, February 19, 2021
Penetrating Oil
Thursday, February 18, 2021
Do We Really Need That Many New Homes?
CNN Did Not Completely Go Back to Sleep After Trump Left
Fact check: Biden makes at least four false statistical claims at CNN town hallWorth reading and sending to your Biden voting friends. They won't call him a liar, but even this is better than I expected.
Wednesday, February 17, 2021
You Left Them on the Grill Too Long
Checking Past Predictions
For some reason, Blogger is not letting me insert this subversive video, but it is worth watching. It checks predictions made by the Canadian government in 2001 to justify impoverishing their nation, using Canadian government sources. The results are not pretty.
Monday, February 15, 2021
The Thirty Tyrants
For my last column I spoke with The New York Times’ Thomas Friedman about an article he wrote more than a decade ago, during the first year of Barack Obama’s presidency. His important piece documents the exact moment when the American elite decided that democracy wasn’t working for them. Blaming the Republican Party for preventing them from running roughshod over the American public, they migrated to the Democratic Party in the hopes of strengthening the relationships that were making them rich.
A trade consultant told Friedman: “The need to compete in a globalized world has forced the meritocracy, the multinational corporate manager, the Eastern financier and the technology entrepreneur to reconsider what the Republican Party has to offer. In principle, they have left the party, leaving behind not a pragmatic coalition but a group of ideological naysayers.”
In the more than 10 years since Friedman’s column was published, the disenchanted elite that the Times columnist identified has further impoverished American workers while enriching themselves. The one-word motto they came to live by was globalism—that is, the freedom to structure commercial relationships and social enterprises without reference to the well-being of the particular society in which they happened to make their livings and raise their children.
Undergirding the globalist enterprise was China’s accession to the World Trade Organization in 2001. For decades, American policymakers and the corporate class said they saw China as a rival, but the elite that Friedman described saw enlightened Chinese autocracy as a friend and even as a model—which was not surprising, given that the Chinese Communist Party became their source of power, wealth, and prestige. Why did they trade with an authoritarian regime and send millions of American manufacturing jobs off to China thereby impoverish working Americans? Because it made them rich. They salved their consciences by telling themselves they had no choice but to deal with China: It was big, productive, and efficient and its rise was inevitable. And besides, the American workers hurt by the deal deserved to be punished—who could defend a class of reactionary and racist ideological naysayers standing in the way of what was best for progress?
Worth reading in full to understand what is happening.
To Your Congressmen
I see President Biden has announced his long-expected gun ban proposals. One in particular he labels "eliminating immunity for gun manufacturers who knowingly put weapons of war on our streets." By this he means repeal of PLCAA, the Protection of Lawful Commerce in Arms Act (2005), which protected gun makers, distributors, and retailers from liability for criminal misuse of guns. I am confident that you will vote down Biden's absurd proposals. I also know that many moderate Democrats and Republicans anxious to prove their preference for Biden over Trump will be inclined to vote for it. Just remind them that such a change in liability, were it applied to automobiles, would hold car makers and dealers responsible for all deaths caused by criminal misuse of cars including drunk drivers, getaway cars, and the tens of thousands of traffic accident deaths.
Remind them also that the false label "weapons of war" includes at least 20 million rifles sold to Americans over the last few years, and millions more purchased before that. The Supreme Court decision DC v. Heller (2008) for which I helped draft amicus briefs, held that arms in common use are protected by the Second Amendment. Do they want that many angry people voting against them in the primary or general elections? The Republican Party is very close to losing many of its voters because of the four years of Republican opposition to President Trump. The Party can become a permanent loser if Republican Congressmen vote for repeal of PLCAA.
If you are represented by one of those moderate Democrats or RINOs, you may want to omit the " I am confident that you will vote down Biden's absurd proposals" sentence and the two last sentences of the second paragraph. And obviously, you did not write amicus briefs for Heller.
Find your member of the House here; Senators here.
Write Your State Legislators
What I sent this morning:
Please co-sponsor Rep. Zito's Idaho Small Arms Protection Act
The Biden Administration is going whole hog on its attempts to disarm the peasants, much as medieval aristocrats and King George III tried in 1775. There are some limits to what Idaho can do, but Rep. Zito's bill will prohibit state or local law enforcement from helping to enforce these unconstitutional laws and directs the Idaho Attorney-General to defend Idahoans who are prosecuted under laws that are clearly contrary to D.C. v. Heller (2008) which recognized that arms in common use may not be prohibited.
It is bad enough that Biden's election looks like it might have been achieved through widespread voter fraud. That he would attempt to disarm law-abiding Americans is even worse.
If your representatives are Democrats or RINO, you might want to leave off that second paragraph. To find your legislators' email addresses: go here and fill in your address in the Who's My Legislator box.
Sunday, February 14, 2021
Baby is Pretty Much Done
I have been rebuilding a 3" f/4.5 Newtonian over the last few years, probably averaging about 10 minutes a week. I made the mirror in the late 1980s, and initially I feared that I had it aluminized when it was really not a very good paraboloid. In retrospect, the problem was that the mechanical parts (mirror cell and diagonal holder) were really bad. With the available tools and materials, I am still trying to remember how I managed to cut a reasonably round set of discs of oak for the mirror cell.
The diagonal holder was one of those utterly non-adjustable stalks that went through a hole in the Edmund's rack and pinion focuser's base. This focuser was obsolete when I bought it. Friction alone held the eyepiece in the tube and when I say friction, I mean friction. Any notion of removing an eyepiece and putting in another without moving the scope was delusional. The only part that I kept when it was time to do a better job on the mechanicals was the 4.5" OD PVC tube. Fiberglass and carbon fiber tubes this size are remarkably expensive and the weight difference is trivial for this size. (Square-cube law.)
Now I had a lathe and a CNC mill. I turned the new mirror cell from 6061 aluminum. I made it .01" smaller than the inside of the tube. That was maybe a little close of a tolerance; getting it in and out is a pain. Edge mounting holes and adjustment bolt holes are exactly 120 degrees apart. I used a rotating table on the mill to get within tenths of a degree.
The diagonal holder I made from 1" diameter aluminum, some springs, some socket head screws, and a 1/4"-20 bolt that went through a spider made specifically for this tube's dimensions. (I have forgotten the spider maker's name.) The actual holder I turned from aluminum, then cut to a 45 degree angle on a tilting table on the mill. Again, a very precise cut. Then I bored out the interior on the lathe through which to put the1/4"-20 bolt.
I was horrified at how expensive 1 1/4" focusers were. I am sure they are very good, but for a scope this small and cheap, it seemed unreasonable to spend >$200. Besides, I was fantasizing about making my own. A Crayford looked to be more work than I wanted to expend, so I decided to use a drawtube for coarse focus, with a helical focuser for fine adjustment. The results are attached. It was not very satisfying and it seemed nearly hopeless to get my range of eyepieces to all hit the focal point.
I would have preferred the basic Orion focuser because it was inexpensive, but it was backordered, so I bought the GSO focuser from Agena. It was $79, so still reasonably priced. It is a very nice piece of work. Everything is metal, as near as I can tell. The name concerned me; the People's Republic of China has pretty well burned all bridges with its handling of the COVID-19 disaster and it is also the country we are most likely to be at war with in the next 20 years. Putting any money into their pockets, even indirectly through a private company, ran against my grain. Fortunately it is labeled as made in Taiwan. Concerns alleviated.
There are two thumbscrews; one controls tension of the operating rod against the drawtube; one prevents motion of the tube. It is not really a lock; it just disables the focus knobs in some way that seems magical to me at the moment. When trying to punch and drill the mounting holes, I found myself wishing for a much longer drill bit and tap for making the 10-24 holes, especially on the focuser side. Solution: using a really tiny Allan wrench, I removed the knob from the shaft, and now I had enough clearance (barely). The height of the focuser fully racked in is about 3", so I had to move the mirror cell up the tube about 1/2" to use my shortest F.L. eyepiece, an Orion 35mm that they called their Super-Plossl back 20 years ago.
I wanted dust caps, and to my pleasure B&H Photo had some 114mm dustcaps that are exact press-on for a 4.5" OD tube.
There are now many holes in the tube that are unsightly but not dysfunctional. The next steps are using a black epoxy glue to fill those holes. The focuser is not quite as fine as I would like, so I think that I will machine some larger knobs out of 3" diameter acetal and use the existing set screws to hold them to the axis. Being more than twice the diameter of the 1.25" knobs, I am expecting slightly finer precision of motion. The primary needs recoating; it was done in the early 1990s.
Saturday, February 13, 2021
Amazing the Stuff You Find on YouTube
Trump Gets Rent-Free Space in Progressive Heads Another Four Years
I have read some serious criticisms not only of convicting an ex-President but also of the idea that they could prevent him from holding office in the future. Especially as Biden and his job-killing plans go forward, Trump's actions (if not his overheated and often unnecessary bluster) will look better and better.
Thursday, February 11, 2021
Continued Work on Baby
Wednesday, February 10, 2021
Instapundit Warns About the Internet of Things
Case to be Heard
Caniglia v. Strong, et al. The police responded to a concerned wife worried about her husband possibly committing suicide. The actual provoking incident sounds more like a nasty argument advanced to a hyperbolic exclamation:
He had been married to his wife Kim Caniglia for 22 years when, on August 20, 2015, they had a disagreement inside their Cranston, Rhode Island home. See id.; Pet.App.53a. When the argument escalated, Petitioner went into the bedroom and retrieved an unloaded gun. Pet.App.53a. He returned to the living room and, in a dramatic gesture, put the gun on the table and said, “why don’t you just shoot me and get me out of my misery.” Id. When Mrs. Caniglia threatened to call 911, Petitioner left the home. Id. Mrs. Caniglia did not call 911. Id.
But the argument continued when Petitioner returned home. Id. at 54a. So Mrs. Caniglia decided to spend the night at a motel. Id.The next day, Mrs. Caniglia tried to call her husband. Id. When he did not answer, she became worried and called the Cranston police. Id. She asked the police to make a “well call” to check on Petitioner and to escort her home. Id. When multiple officers arrived to meet her, Mrs. Caniglia told them what had happened and that she was concerned about her husband’s safety—including the possibility that he could be suicidal. Id.
After calling Petitioner, who “sounded fine,” the officers escorted Mrs. Caniglia back to the home, where they instructed her to stay in the car while they spoke with Petitioner on the back deck. Id. at 55a. Petitioner told the officers about what had happened, and that he had said “just shoot me” because he “couldn’t take it anymore.” Id. “He was calm for the most part,” “seemed normal,” and said “that he would never commit suicide.” Id. Mrs. Caniglia then entered the home. Id.
Police took Caniglia to a mental hospital who released him the same day. Police, contrary to an agreement in which Caniglia had gone to the hospital, had confiscated his guns. The core question here is whether the power of police to search a car after an accident (what is called a "caretaking function") extends to a home searched without a warrant. It appears most courts have held it does not.
Petitioner alleged, by way of § 1983 claims, that Defendants had violated his rights under the Second Amendment, the Fourth Amendment, and the Fourteenth Amendment’s Due Process and Equal Protection Clauses.
This will likely be determined as a 4th Amendment case, but we can hope for a 2nd Amendment statement as well.
Tuesday, February 9, 2021
Gun Buying in the Age of COVID and BLM
NPR linked to a study of gun purchasing.
All sorts of interesting sometimes startling discoveries about the dramatic increase in gun purchases:
We find that gun purchases were particularly likely among attendees of protests against racism or police violence. These protests reached massive proportions during the first week of June, the second-highest week ever for background checks at the time. However, it is doubtful that protesters themselves—about 5% of the adult population by our estimates—can fully account for this increase.
Others may have purchased guns in reaction to this widespread unrest, as well as the sweeping government-mandated closures that coincided with the first peak in March. First-time gun purchases were more likely among African Americans, while existing gun owners were significantly more likely to buy guns if they reported not wearing masks or if they had contracted COVID-19. The most common reasons for purchase, by far, were protection against crime (70%) and target shooting or hunting (47%), though over a quarter (32%) said they were reacting to lockdowns, fears of the government, COVID-19, or the 2020 election.
Target shooting? I think that was a euphemism by respondents for revolutionary practice.
People who attended protests or rallies in 2020 were substantially more likely to purchase a gun than those who did not (see Figure 2). Respondents who attended racism or police violence protests were 1.6 times more likely to purchase guns than those who did not. Respondents who attended Trump rallies and protests over lockdowns and the election were 3.9 times more likely to purchase guns than those who did not. Both types of protest/rally attendees remained substantially more likely to purchase guns after accounting for differences in ideology, party, location, and other relevant factors. Notably, attendees at racism or police violence protests were more likely than non-protesters to buy guns only if they owned a gun already; otherwise, rates were statistically indistinguishable after accounting for other differences.
The vast majority of gun buyers in 2020 were not first-time buyers: Our survey found that only 24% of gun buyers did not already own a firearm. Yet, when we split this set of gun buyers into those who already owned a gun and those who did not, important differences emerge. In a multivariate regression controlling for demographic, geographic, and political factors, prior gun owners who said they didn’t follow mask-wearing guidelines were 1.6 times as likely to buy a gun as those who said they followed mask-wearing guidelines very closely. Among those who did not already own a gun, respondents with a household income over $200,000 per year were 2.1 times as likely to buy a gun as those under $15,000. Respondents who reported extreme stress were 2.9 times as likely to become a gun-owner as those who reported no stress and respondents who identified as African American were 1.7 times as likely as those who identified as white (though the majority of gun-buyers overall—66%—identified as white). Younger Americans and Republicans were both more likely to purchase guns than older Americans and Democrats, regardless of prior gun ownership, as shown in Figure 3.
Richer people bought more guns than poor people. Duh.
Younger Americans is likely a good sign.
Monday, February 8, 2021
Sunday, February 7, 2021
Long Sentence Unintended Consequences
Sheet Metal Craftsmen?
Saturday, February 6, 2021
The Terror
Friday, February 5, 2021
How Many Suits Did the 2020 Election Produce?
Here is a summary of suits caused by the 2020 election. Many were not decided on the merits of the claims of fraud, but standing and other procedural issues. A number of the suits are still active. What happens if he wins enough of those suits to have turned the election? Nothing, except proof that the news media were newsing (lying) when they called his suits baseless.
As a number have pointed out the impeachment is going forward in hopes of disqualifying Trump from holding office in the future. Why would you do that unless thought he could beat President Harris in 2024?
Climate Variability
Whoever Recommended BGSAX, Thank You
Thursday, February 4, 2021
Today's "Stroke Damaged My Brain" SQL Question
The query:
SELECT int(year/10)*10 AS decade, count(*) AS incidents, sum(incidents.dead) AS dead
FROM incidents
WHERE ([cause]='MI' or [cause]='MI?')
GROUP BY (int (year/10)*10);
This produces three columns:
decade | incidents | dead |
---|---|---|
1660 | 1 | 2 |
1800 | 1 | 8 |
1860 | 7 | 27 |
1870 | 4 | 19 |
1880 | 12 | 55 |
1890 | 19 | 78 |
1900 | 43 | 183 |
1910 | 21 | 83 |
1920 | 7 | 31 |
1940 | 2 | 18 |
1960 | 2 | 21 |
1970 | 6 | 27 |
1980 | 8 | 45 |
1990 | 9 | 48 |
2000 | 4 | 55 |
2010 | 11 | 170 |
2020 | 1 | 5 |
You will notice that there are no rows for the decades 1810 through 1859. This is because there are no incidents where the cause was clearly or likely mental illness. (If this seems odd, schizophrenia rates in Britain roughly octupled from the17th to 19th centuries, and similar dramatic increases happen in America over this same period. One possible cause is cats going from mousekillers in barns into homes as pets with toxoplasmosis in cat feces, as one possible environmental trigger.) So how do I get rows with 0 incidents into that query?
I tried:
SELECT int(year/10)*10 AS decade, count(*) AS incidents, sum(Table2.dead) AS 'dead'but the complaint is that "Your query does not include the specified expression int(year/10)*10 as an aggregate function."
FROM Table2
WHERE ((cause_ID=15) or (cause_ID=16))
UNION
SELECT int(year/10)*10 AS decade, count(*) AS incidents, sum(Table2.dead) AS 'dead'
FROM Table2
WHERE ((cause_ID<>15) and (cause_ID<>16))
GROUP BY (int (year/10)*10) ;
SELECT int(year/10)*10 AS decade, count(*) AS incidents, sum(Table2.dead) AS 'dead'
FROM Table2
WHERE ((cause_ID=15) or (cause_ID=16))
GROUP BY (int (year/10)*10)
UNION SELECT int(year/10)*10 AS decade, 0, 0
FROM Table2
WHERE ((cause_ID<>15) and (cause_ID<>16))
GROUP BY (int (year/10)*10);
However, if the first SELECT has matches, the UNION gives me two rows before DECADE, and some decades are still missing:
decade | incidents | 'dead' |
---|---|---|
1650 | 0 | 0 |
1660 | 1 | 2 |
1680 | 0 | 0 |
1690 | 0 | 0 |
1720 | 0 | 0 |
1750 | 0 | 0 |
1780 | 0 | 0 |
1800 | 0 | 0 |
1800 | 1 | 8 |
1820 | 0 | 0 |
1830 | 0 | 0 |
1840 | 0 | 0 |
1850 | 0 | 0 |
1860 | 0 | 0 |
1860 | 7 | 27 |
1870 | 0 | 0 |
1870 | 4 | 19 |
1880 | 0 | 0 |
1880 | 12 | 55 |
1890 | 0 | 0 |
1890 | 19 | 78 |
1900 | 0 | 0 |
1900 | 43 | 183 |
1910 | 0 | 0 |
1910 | 21 | 83 |
1920 | 0 | 0 |
1920 | 7 | 31 |
1930 | 0 | 0 |
1940 | 2 | 18 |
1950 | 0 | 0 |
1960 | 0 | 0 |
1960 | 2 | 21 |
1970 | 0 | 0 |
1970 | 6 | 27 |
1980 | 0 | 0 |
1980 | 8 | 45 |
1990 | 0 | 0 |
1990 | 9 | 48 |
2000 | 0 | 0 |
2000 | 4 | 55 |
2010 | 0 | 0 |
2010 | 11 | 170 |
2020 | 0 | 0 |
2020 | 1 | 5 |
I think instead of a UNION I need to only do the second SELECT if there is no record from the first SELECT.