Clayton Cramer.
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.
"And we know that all things work together for good to them that love God, to them who are the called according to his purpose." -- Rom. 8:28Thursday, April 10, 2025
HD 12K Channel on YouTube
There Was Probably a More Efficient Way to Do This
But convergent sequence of a hexagon shrinking by mill radius until hexagon height less than mill radius seems to do the job.
#!/bin/bash
if [[ $# -lt 8 ]];
then echo "$0 xstart ystart zstart zstep zend xyfeed zfeed height millradius"
exit 2;
fi
cat prolog.nc >hexagon.nc
xstart=$1
ystart=$2
zstart=$3
zstep=$4
zend=$5
xyfeed=$6
zfeed=$7
height=$8
millradius=$9
xend=`echo "$xstart+$height" | bc -l`
while [ "$(bc <<< "$height > $millradius")" == 1 ];
do
xstart=`echo "$xstart+$millradius/2.0" | bc -l`
height=`echo "$height-$millradius/2.0" | bc -l`
if [ "$(bc <<< "$height > $millradius")" == 1 ];
then
mkhexagon $xstart $ystart $zstart $zstep $zend $xyfeed $zfeed $height $millradius
fi
done
cat epilog.nc >>hexagon.nc
And there is an increasingly excited sound it makes as the cuts get shorter and shorter. Writing scripts instead of C always sounds faster than it is. Bash scripts are never as simple as they should be and are far harder to debug than a C program where you have tools like gdb.
DOGE Surveys Unemployment Insurance Claims
Some Carry-On Mistakes Almost Make Sense
A federal grand jury indicted a man who officials said was found with a flashbang grenade in his luggage as he passed through the security checkpoint at Pittsburgh International Airport last year."
Watch Inflation Become A Good Thing
"By the numbers
"The CPI was forecast to rise 2.6% last month, according to economists polled by financial data firm FactSet. The CPI, a basket of goods and services typically bought by consumers, tracks the change in those prices over time.
"March's report comes after inflation rose 2.8% on an annual basis in February.
"On a monthly basis, prices actually fell 0.1% in March, the first monthly drop in nearly five years."
Later in the article is a discussion of the prospect of inflation as higher tariffs raise prices.
"Because tariffs are paid by U.S. importers like Walmart when they accept shipments of foreign goods, they typically pass off all or some of the tariff cost onto consumers through higher prices."
Why "all or some"? If other suppliers, such as in the U.S. or other nations subject to lower tariffs, manage to come up with competitive prices, retailers may not be able to pass the suddenly dramatically higher prices of Chinese goods.
Rgular readers will recall my pleasure when I replaced a broken PRC drill press vise with a far better made Taiwanese one for roughly twice the price.
If doubling the price of poorly made PRC drill press vises makes them price competitive with far better made Taiwanese products (and who knows, maybe American products) there may be little or no price pressure on consumers. There might just be a pile of PRC drill press vises remaindered at a price that makes W-M and Harbor Freight rethink China as a source.
Wednesday, April 9, 2025
Today's Bash Question
This should not be this hard. I want to do a while loop on the condition "$xstart < $xend"
while [ "$xstart < $xend" ]
do
...
done
I know that to do a float compare, I need something like
echo "$xstart > $xend" | bc -l
returning a boolean.
Found it:
while [ "$(bc <<< "$xstart < $xend")" == 1 ];