2023-11-04_10-17-07Z_Saturday database changed
This commit is contained in:
1 parent
61cfb0cd6b
commit
ffc386c515
1 file changed
+3
-2
+3
-2
@@ -20475,7 +20475,8 @@ INSERT INTO `eps` (`id`, `date`, `title`, `duration`, `summary`, `notes`, `hosti
|
||||
(3984,'2023-11-09','Whoppers. How Archer72 and I made moonshine. Volume one.',1730,'Sgoti assists Archer72 with his crazy plan to make moonshine.','<p>What is a whopper?<br />\n<a href=\"https://www.merriam-webster.com/dictionary/whopper\">an\nextravagant or monstrous lie</a><br />\n<a href=\"https://dictionary.cambridge.org/dictionary/english/whopper\">a\nbig lie</a><br />\n</p>\n<p>A work of <a href=\"https://en.wikipedia.org/wiki/Fiction\">Fiction</a>\nis any creative work, chiefly any narrative work, portraying\nindividuals, events, or places that are imaginary or in ways that are\nimaginary.<br />\n</p>\n<ul>\n<li><strong>Source:</strong> <a\nhref=\"https://en.wikipedia.org/wiki/Moonshine\">Moonshine</a> is\nhigh-proof liquor, generally whiskey, traditionally made, or at least\ndistributed, illegally.<br />\n</li>\n<li><strong>Supporting Source:</strong> <a\nhref=\"https://katexic.com/word/busthead-bust-head/\">busthead\n(bust-head).</a> noun. Cheap, strong liquor, usually of the illegal\nvariety. Moonshine. Hooch. Poteen. Pop-skull. Bumblings. The origin is\nobvious to anyone who’s hit the busthead a little hard themselves.<br />\n</li>\n</ul>\n<p>The Bureau of Alcohol, Tobacco, Firearms and Explosives (<a\nhref=\"https://en.wikipedia.org/wiki/Bureau_of_Alcohol,_Tobacco,_Firearms_and_Explosives\">BATFE</a>),\ncommonly referred to as the ATF, is a domestic law enforcement agency\nwithin the United States Department of Justice.<br />\n</p>\n<ul>\n<li><strong>Source:</strong> <a\nhref=\"https://hackerpublicradio.org/correspondents/0318.html\">Archer72</a><br />\n</li>\n<li><strong>Source:</strong> <a\nhref=\"https://hackerpublicradio.org/correspondents/0401.html\">Mechatroniac</a><br />\n</li>\n<li><strong>Source:</strong> <a\nhref=\"https://hackerpublicradio.org/correspondents/0078.html\">Klaatu</a><br />\n</li>\n<li><strong>Source:</strong> <a\nhref=\"https://hackerpublicradio.org/correspondents/0377.html\">Zen_Floater2</a><br />\n</li>\n</ul>\n',391,0,1,'CC-BY-SA','Whoppers, Moonshine, Archer72',0,0,1),
|
||||
(3985,'2023-11-10','Bash snippet - be careful when feeding data to loops',1644,'A loop in a pipeline runs in a subshell','<article>\n<h2 id=\"overview\">Overview</h2>\n<p>Recently Ken Fallon did a show on HPR, <a\nhref=\"https://hackerpublicradio.org/eps/hpr3962/index.html\">number\n3962</a>, in which he used a <a\nhref=\"https://www.gnu.org/software/bash/manual/html_node/Pipelines.html\">Bash\npipeline</a> of multiple commands feeding their output into a\n<code>while</code> loop. In the loop he processed the lines produced by\nthe pipeline and used what he found to download audio files belonging to\na series with <code>wget</code>.</p>\n<p>This was a great show and contained some excellent advice, but the\nuse of the format:</p>\n<pre><code>pipeline | while read variable; do ...</code></pre>\n<p>reminded me of the \"gotcha\" I mentioned in my own <a\nhref=\"https://hackerpublicradio.org/eps/hpr2699/index.html\">show\n2699</a>.</p>\n<p>I thought it might be a good time to revisit this subject.</p>\n<h2 id=\"so-whats-the-problem\">So, what\'s the problem?</h2>\n<p>The problem can be summarised as a side effect of pipelines.</p>\n<h3 id=\"what-are-pipelines\">What are pipelines?</h3>\n<p>Pipelines are an amazingly useful feature of Bash (and other shells).\nThe general format is:</p>\n<pre><code>command1 | command2 ...</code></pre>\n<p>Here <code>command1</code> runs in a subshell and produces output (on\nits <em>standard output</em>) which is connected via the pipe symbol\n(<code>|</code>) to <code>command2</code> where it becomes its\n<em>standard input</em>. Many commands can be linked together in this\nway to achieve some powerful combined effects.</p>\n<p>A very simple example of a pipeline might be:</p>\n<pre><code>$ printf 'World\nHello\n' | sort\nHello\nWorld</code></pre>\n<p>The <code>printf</code> command (≡<code>\'command1\'</code>) writes two\nlines (separated by newlines) on <em>standard output</em> and this is\npassed to the <code>sort</code> command\'s <em>standard input</em>\n(≡<code>\'command2\'</code>) which then sorts these lines\nalphabetically.</p>\n<p>Commands in the pipeline can be more complex than this, and in the\ncase we are discussing we can include a loop command such as\n<code>while</code>.</p>\n<p>For example:</p>\n<pre><code>$ printf 'World\nHello\n' | sort | while read line; do echo "($line)"; done\n(Hello)\n(World)</code></pre>\n<p>Here, each line output by the <code>sort</code> command is read into\nthe variable <code>line</code> in the <code>while</code> loop and is\nwritten out enclosed in parentheses.</p>\n<p>Note that the loop is written on one line. The semi-colons are used\ninstead of the equivalent newlines.</p>\n<h3 id=\"variables-and-subshells\">Variables and subshells</h3>\n<p>What if the lines output by the loop need to be numbered?</p>\n<pre><code>$ i=0; printf 'World\nHello\n' | sort | while read line; do ((i++)); echo "$i) $line"; done\n1) Hello\n2) World</code></pre>\n<p>Here the variable <code>\'i\'</code> is set to zero before the\npipeline. It could have been done on the line before of course. In the\n<code>while</code> loop the variable is incremented on each iteration\nand included in the output.</p>\n<p>You might expect <code>\'i\'</code> to be 2 once the loop exits but it\nis not. It will be zero in fact.</p>\n<p>The reason is that there are two <code>\'i\'</code> variables. One is\ncreated when it\'s set to zero at the start before the pipeline. The\nother one is created in the loop as a \"clone\". The expression:</p>\n<pre><code>((i++))</code></pre>\n<p>both creates the variable (where it is a copy of the one in the\nparent shell) and increments it.</p>\n<p>When the subshell in which the loop runs completes, it will delete\nthis version of <code>\'i\'</code> and the original one will simply\ncontain the zero that it was originally set to.</p>\n<p>You can see what happens in this slightly different example:</p>\n<pre><code>$ i=1; printf 'World\nHello\n' | sort | while read line; do ((i++)); echo "$i) $line"; done\n2) Hello\n3) World\n$ echo $i\n1</code></pre>\n<p>These examples are fine, assuming the contents of variable\n<code>\'i\'</code> incremented in the loop are not needed outside it.</p>\n<p>The thing to remember is that the same variable name used in a\nsubshell is a different variable; it is initialised with the value of\nthe \"parent\" variable but any changes are not passed back.</p>\n<h2 id=\"how-to-avoid-the-loss-of-changes-in-the-loop\">How to avoid the\nloss of changes in the loop</h2>\n<p>To solve this the loop needs to be run in the original shell, not a\nsubshell. The pipeline which is being read needs to be attached to the\nloop in a different way:</p>\n<pre><code>$ i=0; while read line; do ((i++)); echo "$i) $line"; done < <(printf 'World\nHello\n' | sort)\n1) Hello\n2) World\n$ echo $i\n2</codLine truncated
|
||||
(3992,'2023-11-21','Test recording on a wireless mic',223,'Archer72 tests out a wireless mic with a USB C receiver','<h2 id=\"lekato-2-pack-wireless-microphone-with-charging-case\">LEKATO 2\nPack Wireless Microphone with Charging Case</h2>\n<p><a href=\"https://www.amazon.com/gp/product/B0C4SNT6QK\"\nclass=\"uri\">https://www.amazon.com/gp/product/B0C4SNT6QK</a></p>\n<ul>\n<li>USB C</li>\n<li>Two microphones in a charging case</li>\n<li>Charge phone and use the receiver simultaneously</li>\n</ul>\n<h3 id=\"claims\">Claims</h3>\n<ul>\n<li>75 ft. transmission range</li>\n<li>Wireless Mic can work continuously for 5 hours, and the charging box\ncan quickly charge the device 4 times. The total usage time reaches 25\nhours</li>\n</ul>\n<h2 id=\"axet-audio-recorder-on-f-droid\">Axet Audio recorder on\nF-Droid</h2>\n<p><a href=\"https://f-droid.org/packages/com.github.axet.audiorecorder\"\nclass=\"uri\">https://f-droid.org/packages/com.github.axet.audiorecorder</a></p>\n<ul>\n<li>Works to record stereo with this mic set</li>\n</ul>\n',318,0,0,'CC-BY-SA','Recording, Microphone, Wireless, USB \'C\', F-droid, Android App',0,0,1),
|
||||
(4221,'2024-10-07','HPR Community News for September 2024',0,'HPR Volunteers talk about shows released and comments posted in September 2024','',159,47,1,'CC-BY-SA','Community News',0,0,1);
|
||||
(4221,'2024-10-07','HPR Community News for September 2024',0,'HPR Volunteers talk about shows released and comments posted in September 2024','',159,47,1,'CC-BY-SA','Community News',0,0,1),
|
||||
(4241,'2024-11-04','HPR Community News for October 2024',0,'HPR Volunteers talk about shows released and comments posted in October 2024','',159,47,1,'CC-BY-SA','Community News',0,0,1);
|
||||
/*!40000 ALTER TABLE `eps` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
@@ -21399,4 +21400,4 @@ UNLOCK TABLES;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2023-11-03 8:39:21
|
||||
-- Dump completed on 2023-11-04 10:15:51
|
||||
Reference in new issue
Block a user