<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 12pt; font-family: Verdana,Geneva,sans-serif'>
<p>Richard,<br /><br /><strong>Naive Bayes. </strong>I've used AI::NaiveBayes when I need to automate a decision, like your spam filter probably uses this algorithm. You train it by flagging spam and it recalculates the weights of the NB. I wrote a paper on using NB to classifying exam items into Bloom's taxonomy of cognitive complexity. This would be handy because most item authors are not experts in Bloom's taxonomy. <a href="https://jattjournal.net/index.php/atp/article/view/170341">https://jattjournal.net/index.php/atp/article/view/170341</a><br /><br />So, one thing you might be missing is a need to automatically classify written documents into classes.<br /><br />I think even with the amazingly superior AI we have today, there's still plenty of space to use "old school" ML (like NB). I asked ChatGPT to classify items into Bloom's taxonomy and the accuracy was like 20%. But then I fine-tuned a version of gpt-3.5 on the data we used for our NB paper and the rate was in the 70-80% range (which is comparable to the NB paper). In theory, this fine-tuned model "understands" the language better than my older NB model, which is driven by keywords. But a salient difference for me was that fine-tuning was like 12 lines of Perl code and an evening mostly spent learning to use the fine tuning API. We spent weeks on the analysis of that NB paper. Although lately I've been reflecting on the disadvantages of being tied to a vendor's fine-tuned model. I think that model is still available to me, but it won't be forever. <br /><br /><strong>What you're missing. </strong>But what you may be missing, and what I was referring to, was that LLMs can now write code. You describe the feature you want, and it writes the code. This is clearly going to be a disruptive innovation, but the people who are saying that we can replace coders are (currently) dead wrong. We have long had people who search for code snippets online and copy them into their code. I think AI just makes this process more efficient. In my experience, you absolutely need to be a coder to put the pieces in place and, often enough, debug what doesn't work.<br /><br />I use it especially in the situation you are in where I need something I don't use daily, like a Bash script.<br /><br /><strong>And (to be clear) you should be cautious. </strong>You should also be aware of all the pitfalls. Like (a) the AI being wrong; (b) the current copyright regime seems very against issuing copyrights for AI-generated output (probably for good reason); and (c) ChatGPT, for example, might end up using your input/output to train future versions of the model. There's also (d) the moral question of whether it's OK to "profit" (in any sense) from code scraped off the Internet (or God-knows where). [Although we scraped the exam questions I used in that NB paper... So, kettles and pots and all...]<br /><br />About AI being wrong, it's correct a lot, but I've seen it make up Perl modules and make up calls within existing models. But that's not really a big deal because the script won't execute and tells you exactly why not. The <strong>really problematic</strong> issue is that it definitely includes bugs. I was too lazy to write a complicated regex so I had ChatGPT write it and it fails about 2% of the time. Now I have the problem that I need to expend more effort (at some point) to figure out why the regex fails. In my application, it's not a big deal; it means an additional +2% error rate in part of one process in a pipeline that's only abut 90% accurate. But I shudder to imagine this being used more broadly and without proper oversight. I have caught more serious bugs. I'm not saying "AI code has bugs, so don't use it" because non-AI code also has bugs. I'm saying exercise caution and skepticism. Assume AI-written code has bugs.<br /><br />-Alan</p>
<div id="signature"></div>
<br />
<p id="reply-intro">On 2025-03-17 12:20, Richard Reina wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
<div id="replybody1">
<div class="v1userStyles" style="font-family: Arial; font-size: 12pt; color: #000000;">The only AI I have messed around with is: AI::NaiveBayes. I have yet to find any use for open AI because I guess I lack the imagination to find an interesting but sometimes inaccurate chat bot useful. Am I missing something? <br /><br /><span>On Mon, 25 Nov 2024 09:54:06 -0600, Alan Mead <amead2@alanmead.org> wrote:</span><br />
<p>I like Andy's PID file suggestion, but I would be inclined to make this a bash script rather than a perl one-liner and test something like:</p>
<p>`ps aux | grep perl | grep starman`</p>
<p><br /></p>
<p>And if that command causes it's own failure (by always creating a process with 'perl' and 'starman') then:</p>
<p>`ps aux | grep [p]erl | grep [s]tarman`</p>
<p><br /></p>
<p>If you find bash scripting not super easy (like me), ChatGPT is very helpful. It's helped me a lot in writing better admin scripts.</p>
<p><br /></p>
<p>-Alan</p>
<p><br /></p>
<div class="v1moz-cite-prefix">On 11/25/24 9:41 AM, Andy Bach wrote:</div>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
<style type="text/css">#replybody1 P { margin-top: 0; margin-bottom: 0; }</style>
<div class="v1elementToProof" style="font-family: 'Times New Roman', Times, serif; font-size: 11pt; color: #000000;">Need to expand your grep RE or add a grep -v to remove the ones you don't want, though, then you have to remove the one you just added. Another is to track the pids, find the ones you've created and look for one outside that set. You could have starman (if it doesn't) create a .pid file and use that to check that pid's status (with lsof -p <pid> maybe), rather than grepping.</div>
<hr style="display: inline-block; width: 98%;" />
<div id="v1divRplyFwdMsg" dir="ltr"><span style="font-size: 11pt; color: #000000; font-family: Calibri, sans-serif;"><strong>From:</strong> Chicago-talk <a class="v1moz-txt-link-rfc2396E" href="mailto:chicago-talk-bounces+andy_bach=wiwb.uscourts.gov@pm.org" rel="noreferrer"><chicago-talk-bounces+andy_bach=wiwb.uscourts.gov@pm.org></a> on behalf of Richard Reina <a class="v1moz-txt-link-rfc2396E" href="mailto:gatorreina@gmail.com" rel="noreferrer"><gatorreina@gmail.com></a><br /><strong>Sent:</strong> Sunday, November 24, 2024 5:19 PM<br /><strong>To:</strong> Chicago.pm chatter <a class="v1moz-txt-link-rfc2396E" href="mailto:chicago-talk@pm.org" rel="noreferrer"><chicago-talk@pm.org></a><br /><strong>Subject:</strong> [Chicago-talk] Determining if another perl process is running.</span>
<div> </div>
</div>
<div>
<style type="text/css">#replybody1 .x_tg
{ border-collapse: collapse; border-spacing: 0; }#replybody1 .x_tg td
{ border-color: black; border-style: none; border-width: 1px; font-family: Arial,sans-serif; font-size: 14px; overflow: hidden; padding: 5px 5px; word-break: normal; }#replybody1 .x_tg th
{ border-color: black; border-style: none; border-width: 1px; font-family: Arial,sans-serif; font-size: 14px; font-weight: normal; overflow: hidden; padding: 2px 2px; word-break: normal; }#replybody1 .x_tg .x_tg-94ls
{ background-color: #cb0000; border-color: inherit; text-align: left; vertical-align: top; }#replybody1 .x_tg .x_tg-pzl3
{ background-color: #FFFF00; border-color: inherit; text-align: left; vertical-align: top; }</style>
<table class="v1x_tg">
<thead>
<tr>
<th class="v1x_tg-pzl3"><strong>CAUTION - EXTERNAL: </strong></th>
</tr>
</thead>
</table>
<div>
<div dir="ltr">Hello everyone,
<div> </div>
<div>So excited about the Winter Perl Conference that I just registered for that I thought I would rebuild my aged Perl Dancer2 website. I 've done so and deployed it on a Digital Ocean droplet but I've hit a snag in setting up a cron job to make sure starman is running. It seems my query into whether the process is running gets treated as evidence that the process IS running. </div>
<div> </div>
<div>When I do:</div>
<div> </div>
<div>perl -e 'my $smstat = `ps -ef | grep starman`; unless ($smstat =~ /starman master/) { system("XDG_RUNTIME_DIR=/run/user/1001 exec /home/starman/<a href="http://starman.pl" target="_blank" rel="noopener noreferrer">starman.pl</a> start &>> /home/starman/starman.log"); print localtime . " starting starman\n"; } else { print "Starman is already running\n\n\n $smstat\n" }';<br /> </div>
<div>RESULTS IN:</div>
<div> </div>
<div>Starman is already running<br /><br /><br /> starman 203805 1 0 Nov08 ? 00:00:00 /lib/systemd/systemd --user<br />starman 203806 203805 0 Nov08 ? 00:00:00 (sd-pam)<br />root 472040 385 0 Nov20 ? 00:00:00 sshd: starman [priv]<br />starman 472049 472040 0 Nov20 ? 00:00:01 sshd: starman@pts/0<br />starman 472050 472049 0 Nov20 pts/0 00:00:00 -bash<br />starman 544383 472050 0 23:11 pts/0 00:00:00 perl -e my $smstat = `ps -ef | grep starman`; unless ($smstat =~ /starman master/) { system("XDG_RUNTIME_DIR=/run/user/1001 exec /home/starman/<a href="http://starman.pl" target="_blank" rel="noopener noreferrer">starman.pl</a> start &>> /home/starman/starman.log"); print localtime . " starting starman\n"; } else { print "Starman is already running\n\n\n $smstat\n" }<br />starman 544384 544383 0 23:11 pts/0 00:00:00 sh -c ps -ef | grep starman<br />starman 544385 544384 0 23:11 pts/0 00:00:00 ps -ef<br />starman 544386 544384 0 23:11 pts/0 00:00:00 grep starman</div>
<div> </div>
<div>It always says it's running even if it is not apparently because it's seeing 'starman master/ in the perl script that is inquiring. </div>
<div> </div>
<div>Anyone know a good solution to avoid this so that I can determine whether my starman startup script is indeed running?</div>
<div> </div>
</div>
</div>
<style type="text/css">#replybody1 .x_tg
{ border-collapse: collapse; border-spacing: 0; }#replybody1 .x_tg td
{ border-color: black; border-style: none; border-width: 1px; font-family: Arial,sans-serif; font-size: 14px; overflow: hidden; padding: 5px 5px; word-break: normal; }#replybody1 .x_tg th
{ border-color: black; border-style: none; border-width: 1px; font-family: Arial,sans-serif; font-size: 14px; font-weight: normal; overflow: hidden; padding: 2px 2px; word-break: normal; }#replybody1 .x_tg .x_tg-94ls
{ background-color: #cb0000; border-color: inherit; text-align: left; vertical-align: top; }#replybody1 .x_tg .x_tg-pzl3
{ background-color: #FFFF00; border-color: inherit; text-align: left; vertical-align: top; }</style>
<table class="v1x_tg">
<thead>
<tr>
<th class="v1x_tg-pzl3"><strong>CAUTION - EXTERNAL EMAIL:</strong> This email originated outside the Judiciary. Exercise caution when opening attachments or clicking on links.</th>
</tr>
</thead>
</table>
</div>
<fieldset class="v1moz-mime-attachment-header"> </fieldset>
<pre class="v1moz-quote-pre">_______________________________________________
Chicago-talk mailing list
<a class="v1moz-txt-link-abbreviated" href="mailto:Chicago-talk@pm.org" rel="noreferrer">Chicago-talk@pm.org</a>
<a class="v1moz-txt-link-freetext" href="https://mail.pm.org/mailman/listinfo/chicago-talk" target="_blank" rel="noopener noreferrer">https://mail.pm.org/mailman/listinfo/chicago-talk</a>
</pre>
</blockquote>
<pre class="v1moz-signature">--
Alan D. Mead, Ph.D.
President, Talent Algorithms Inc.
science + technology = better workers
<a class="v1moz-txt-link-freetext" href="https://talalg.com" target="_blank" rel="noopener noreferrer">https://talalg.com</a>
He who confuses political liberty with freedom and political equality
with similarity has never thought for five minutes about either.
-- Shaw, from "Maxims for Revolutionists"</pre>
_______________________________________________<br />Chicago-talk mailing list<br />Chicago-talk@pm.org<br />https://mail.pm.org/mailman/listinfo/chicago-talk</div>
</div>
<br />
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">_______________________________________________<br />Chicago-talk mailing list<br /><a href="mailto:Chicago-talk@pm.org">Chicago-talk@pm.org</a><br /><a href="https://mail.pm.org/mailman/listinfo/chicago-talk" target="_blank" rel="noopener noreferrer">https://mail.pm.org/mailman/listinfo/chicago-talk</a></div>
</blockquote>
</body></html>