<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: luk-f-a</title>
    <description>The latest articles on Forem by luk-f-a (@luk).</description>
    <link>https://forem.com/luk</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F788970%2Fce275575-2e03-41d7-94ff-f9f83212518c.jpeg</url>
      <title>Forem: luk-f-a</title>
      <link>https://forem.com/luk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/luk"/>
    <language>en</language>
    <item>
      <title>Good reasons and bad reasons for Risk Management (RM series #1)</title>
      <dc:creator>luk-f-a</dc:creator>
      <pubDate>Sun, 05 Nov 2023 17:25:19 +0000</pubDate>
      <link>https://forem.com/luk/good-reasons-and-bad-reasons-for-risk-management-rm-series-1-1cgm</link>
      <guid>https://forem.com/luk/good-reasons-and-bad-reasons-for-risk-management-rm-series-1-1cgm</guid>
      <description>&lt;p&gt;I recently left a job in Risk Management. Mostly because the name was misleading, but that's a story for another day.&lt;br&gt;
Having just left, I want to write —first of all for myself— what I learned. Just in case I need it one day in the future. Hopefully it will also be useful to others.&lt;/p&gt;

&lt;p&gt;Everyone does risk management every day. If we have had a great sandwich for over a week in the fridge, we wonder: should I eat it? Pros: it was delicious. Cons: it might make me sick. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aXPk68MK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/84pjwl7n8gux1fis9m6i.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aXPk68MK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/84pjwl7n8gux1fis9m6i.gif" alt="Image description" width="480" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We weigh what can go wrong and what can go right and then make a decision. Companies do that too. Some companies establish a special department called "Risk Management". Ironically, sometimes they do manage risk, and sometimes they do not.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;br&gt;
Before I continue I must clarify that the rest of the post is partly serious and partly tongue-in-cheek. Which part is which is left as an exercise for the reader. Risk Management is a very important activity, and it is REALLY hard to do well. I will write about the latter in another post.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;From my own experience and from talking to others, I have learned that companies have a whole bunch of reasons for setting up a Risk Management department. Some reasons are better than others.&lt;/p&gt;

&lt;p&gt;What are the good reasons?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A company is a complex web of relationships that, hopefully, delivers some valuable product. If one part of the company fails so spectacularly such that it brings down the whole company, that would be bad for shareholders and bad for society. Society would lose a provider of whatever it was the company was making. Shareholders would have to re-organize the company, which is expensive and quite distracting from the core purpose of making whatever-it-was-that-it-was-making -for-society. Spending some effort up-front in not blowing up is worth it, on a net present value basis.&lt;/li&gt;
&lt;li&gt;Most employees would also prefer that the company does not blow up tomorrow. However, many employees would not affected  by the company blowing up in 20 years. There are some jobs that are able to create problems decades in the future. Those employees have an incentive to maximize their income today, whatever the cost for the company might be in 20 years. If you can increase sales of &lt;a href="https://www.nytimes.com/2023/04/04/business/media/johnson-johnson-talc-settlement.html"&gt;cancer-inducing powder&lt;/a&gt; or &lt;a href="https://www.doj.nh.gov/news/2022/20220303-settlement-purdue-pharma-sacklers.htm"&gt;destructively additive medication&lt;/a&gt; and get a fat bonus for your efforts, maybe you will choose to do it, whether the company will be sued into oblivion or not. Spending some effort in stopping these guys before they harm the company is worth it.&lt;/li&gt;
&lt;li&gt;Some employees do not even care if the company &lt;a href="https://edition.cnn.com/2023/04/24/investing/credit-suisse-bank-withdrawals-total/index.html"&gt;blows up tomorrow&lt;/a&gt;. &lt;a href="https://www.efinancialcareers.ch/en/news/2022/11/credit-suisse-traders-new-jobs"&gt;They will get a job elsewhere&lt;/a&gt;. Ironically, they might get a better job afterwards, as Matt Levine argues sometimes. Spending some effort in stopping these guys before they harm the company is definitely worth it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are all great reasons for having a Risk Management team. There are more, but I don't intend to make this a book on risk management.&lt;/p&gt;

&lt;p&gt;After almost 20 years in the financial industry, I can also enumerate some bad reasons to have a Risk Management team.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bad reason #1: "Something might go slightly wrong somewhere". Most humans are risk-averse, which means they will rather have certainty over uncertainty. We also enjoy the feeling of improving something, large or small. When faced with the news that something somewhere has gone wrong, many people think "how could we make sure that this never goes wrong again?". That's a noble thought but sometimes misguided, especially in large companies. When we do risk management in our daily lives, we are impacted by the good and the bad. We might enjoy the sandwich, or get food poisoning. We have skin in the game. It is not the same in a company. If we hire a bunch of people and tell them it's their job to stop bad things from happening, it might play out in this way:

&lt;ul&gt;
&lt;li&gt;first they try to stop really bad things from happening, which mostly means illegal behavior and bets that would bankrupt the company.&lt;/li&gt;
&lt;li&gt; without any real means of proving the counterfactual "if we weren't here, this company would be broke by now", they slowly develop a mentality that risk management is "always and everywhere a desirable phenomenon". Over time, they get used to being valued by what they do, not what they achieve.&lt;/li&gt;
&lt;li&gt;lastly, either out of the genuine desire to stop bad things from happening or a genuine desire to get a promotion, the scope of "bad things that should be stopped" starts to grow. And with that the size of the team. And with that the procedures they impose on the rest of the company. And with that the cost for the company, both in direct compliance cost and in lost business opportunities.
Left unchecked, after a few years it's likely that your well-intentioned Risk Management team has written endless documents and cost millions of dollars in procedures to avoid pens from being misplaced (don't laugh, that's a real risk with real financial consequences!). &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;How could this happen? It's quite simple, the Risk Management team is only looking at the downside of things. And it's only being rewarded for doing something about it. Not for effectively tackling the worthwhile problems but for doing &lt;em&gt;something&lt;/em&gt; about anything that could be argued it might be a problem.&lt;br&gt;
The cost-benefit trade off does not work for a centralized Risk Management team to take care of minor loses and inconveniences. It is a bad reason for having an RM team. In statistics lingo, RM should take care of the tail, not the body of the loss distribution.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bad reason #2: to shield top management in case something bad happens somewhere. Top management is made of humans. No matter how clever they are, how much they love the company, or how hard they work, they cannot be everywhere. Some tasks have to be delegated to less clever, less company-loving or less hard-working people. Something will go wrong eventually. What it is really important in that in case, is that everyone can say that they &lt;em&gt;followed proper procedure&lt;/em&gt;. That is the only chance at saving their jobs after some embarrassing incident. &lt;em&gt;Governance was followed&lt;/em&gt; is the line that will allow the C-suite level to save face (it does not always work but it usually does). I rank this as another type of principal-agent problem. It's not worth for the shareholder to spend millions to prevent the C-suite from being embarrassed. The shareholder would be better off saving the cost of the burdensome internal compliance with endless and ill-conceived governance, and absorbing the occasional loss. If the C-suite is occasionally embarrassed by something outside of their control, then so be it. The shareholder is already paying them millions, they should learn to live with it.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>risk</category>
    </item>
    <item>
      <title>Bard vs ChatGPT: round 1</title>
      <dc:creator>luk-f-a</dc:creator>
      <pubDate>Thu, 11 May 2023 20:22:49 +0000</pubDate>
      <link>https://forem.com/luk/bard-vs-chatgpt-round-1-1a4c</link>
      <guid>https://forem.com/luk/bard-vs-chatgpt-round-1-1a4c</guid>
      <description>&lt;p&gt;Last night I ran a very quick, unrigorous, unscientific, and maybe even unfair comparison between Bard and ChatGPT.&lt;/p&gt;

&lt;p&gt;LLMs do particularly well in those cases when we need something quick and simple in a tool we know little about. And I happened to have such a case: a simple website using htmx and fastAPI.&lt;/p&gt;

&lt;p&gt;This is not going to be a long post, so I'm jumping directly to the two things that caught my attention:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bard missed the prompt, and ChatGPT did much better.&lt;/li&gt;
&lt;li&gt;ChatGPT asked me relevant questions to confirm understanding, Bard did not.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Bard missed the prompt
&lt;/h2&gt;

&lt;p&gt;I asked Bard to use htmx. It kind of complied, but not really: it linked to htmx but did not use it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Function analyzer&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"contract"&lt;/span&gt; &lt;span class="na"&gt;placeholder=&lt;/span&gt;&lt;span class="s"&gt;"Enter a contract"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"analyze"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Analyze&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"tree"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://cdnjs.cloudflare.com/ajax/libs/htmx/1.8.0/htmx.min.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where are my htmx attributes Bard? All the logic is done in JS, which I wanted to avoid. &lt;/p&gt;

&lt;p&gt;
  full body
  &lt;br&gt;

&lt;pre&gt;&lt;code&gt;&lt;span&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Function analyzer&lt;span&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span&gt;&amp;lt;input&lt;/span&gt; &lt;span&gt;type=&lt;/span&gt;&lt;span&gt;"text"&lt;/span&gt; &lt;span&gt;id=&lt;/span&gt;&lt;span&gt;"contract"&lt;/span&gt; &lt;span&gt;placeholder=&lt;/span&gt;&lt;span&gt;"Enter a contract"&lt;/span&gt;&lt;span&gt;&amp;gt;&lt;/span&gt;
    &lt;span&gt;&amp;lt;button&lt;/span&gt; &lt;span&gt;id=&lt;/span&gt;&lt;span&gt;"analyze"&lt;/span&gt;&lt;span&gt;&amp;gt;&lt;/span&gt;Analyze&lt;span&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
    &lt;span&gt;&amp;lt;div&lt;/span&gt; &lt;span&gt;id=&lt;/span&gt;&lt;span&gt;"tree"&lt;/span&gt;&lt;span&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

    &lt;span&gt;&amp;lt;script &lt;/span&gt;&lt;span&gt;src=&lt;/span&gt;&lt;span&gt;"https://cdnjs.cloudflare.com/ajax/libs/htmx/1.8.0/htmx.min.js"&lt;/span&gt;&lt;span&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
        &lt;span&gt;const&lt;/span&gt; &lt;span&gt;contractInput&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;document&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;getElementById&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;"&lt;/span&gt;&lt;span&gt;contract&lt;/span&gt;&lt;span&gt;"&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;
        &lt;span&gt;const&lt;/span&gt; &lt;span&gt;analyzeButton&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;document&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;getElementById&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;"&lt;/span&gt;&lt;span&gt;analyze&lt;/span&gt;&lt;span&gt;"&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;
        &lt;span&gt;const&lt;/span&gt; &lt;span&gt;treeDiv&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;document&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;getElementById&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;"&lt;/span&gt;&lt;span&gt;tree&lt;/span&gt;&lt;span&gt;"&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;

        &lt;span&gt;analyzeButton&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;addEventListener&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;"&lt;/span&gt;&lt;span&gt;click&lt;/span&gt;&lt;span&gt;"&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;()&lt;/span&gt; &lt;span&gt;=&amp;gt;&lt;/span&gt; &lt;span&gt;{&lt;/span&gt;
            &lt;span&gt;// Get the contract from the input box.&lt;/span&gt;
            &lt;span&gt;const&lt;/span&gt; &lt;span&gt;contract&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;contractInput&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;value&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;

            &lt;span&gt;// Make a request to the backend to get the tree view of the contract.&lt;/span&gt;
            &lt;span&gt;fetch&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;"&lt;/span&gt;&lt;span&gt;/function-tree&lt;/span&gt;&lt;span&gt;"&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;{&lt;/span&gt;
                &lt;span&gt;method&lt;/span&gt;&lt;span&gt;:&lt;/span&gt; &lt;span&gt;"&lt;/span&gt;&lt;span&gt;GET&lt;/span&gt;&lt;span&gt;"&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;
                &lt;span&gt;body&lt;/span&gt;&lt;span&gt;:&lt;/span&gt; &lt;span&gt;JSON&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;stringify&lt;/span&gt;&lt;span&gt;({&lt;/span&gt;
                    &lt;span&gt;contract&lt;/span&gt;&lt;span&gt;:&lt;/span&gt; &lt;span&gt;contract&lt;/span&gt;
                &lt;span&gt;})&lt;/span&gt;
            &lt;span&gt;})&lt;/span&gt;
            &lt;span&gt;.&lt;/span&gt;&lt;span&gt;then&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;response&lt;/span&gt; &lt;span&gt;=&amp;gt;&lt;/span&gt; &lt;span&gt;response&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;json&lt;/span&gt;&lt;span&gt;())&lt;/span&gt;
            &lt;span&gt;.&lt;/span&gt;&lt;span&gt;then&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;tree&lt;/span&gt; &lt;span&gt;=&amp;gt;&lt;/span&gt; &lt;span&gt;{&lt;/span&gt;
                &lt;span&gt;// Render the tree to HTML.&lt;/span&gt;
                &lt;span&gt;const&lt;/span&gt; &lt;span&gt;html&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;render_tree&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;tree&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;

                &lt;span&gt;// Insert the HTML into the tree div.&lt;/span&gt;
                &lt;span&gt;treeDiv&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;innerHTML&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;html&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;
            &lt;span&gt;});&lt;/span&gt;
        &lt;span&gt;});&lt;/span&gt;

        &lt;span&gt;function&lt;/span&gt; &lt;span&gt;render_tree&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;tree&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;{&lt;/span&gt;
            &lt;span&gt;// Create a new ul element.&lt;/span&gt;
            &lt;span&gt;const&lt;/span&gt; &lt;span&gt;ul&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;document&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;createElement&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;"&lt;/span&gt;&lt;span&gt;ul&lt;/span&gt;&lt;span&gt;"&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;

            &lt;span&gt;// Iterate over the tree.&lt;/span&gt;
            &lt;span&gt;for&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;&lt;span&gt;const&lt;/span&gt; &lt;span&gt;key&lt;/span&gt; &lt;span&gt;in&lt;/span&gt; &lt;span&gt;tree&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;{&lt;/span&gt;
                &lt;span&gt;// Create a new li element.&lt;/span&gt;
                &lt;span&gt;const&lt;/span&gt; &lt;span&gt;li&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;document&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;createElement&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;"&lt;/span&gt;&lt;span&gt;li&lt;/span&gt;&lt;span&gt;"&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;

                &lt;span&gt;// Set the text of the li element to the key.&lt;/span&gt;
                &lt;span&gt;li&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;textContent&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;key&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;

                &lt;span&gt;// If the key is a dictionary, recursively render its children.&lt;/span&gt;
                &lt;span&gt;if&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;&lt;span&gt;typeof&lt;/span&gt; &lt;span&gt;tree&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span&gt;key&lt;/span&gt;&lt;span&gt;]&lt;/span&gt; &lt;span&gt;===&lt;/span&gt; &lt;span&gt;"&lt;/span&gt;&lt;span&gt;object&lt;/span&gt;&lt;span&gt;"&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;{&lt;/span&gt;
                    &lt;span&gt;li&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;appendChild&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;render_tree&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;tree&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span&gt;key&lt;/span&gt;&lt;span&gt;]));&lt;/span&gt;
                &lt;span&gt;}&lt;/span&gt;

                &lt;span&gt;// Append the li element to the ul element.&lt;/span&gt;
                &lt;span&gt;ul&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;appendChild&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;li&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;
            &lt;span&gt;}&lt;/span&gt;

            &lt;span&gt;// Return the ul element.&lt;/span&gt;
            &lt;span&gt;return&lt;/span&gt; &lt;span&gt;ul&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;
        &lt;span&gt;}&lt;/span&gt;
    &lt;span&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;




&lt;/p&gt;

&lt;p&gt;How did ChatGPT do? It did a good job, even if I had to edit the code to fix some bugs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Function Analyzer&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;label&lt;/span&gt; &lt;span class="na"&gt;for=&lt;/span&gt;&lt;span class="s"&gt;"contract"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Contract:&lt;span class="nt"&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"contract"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;hx-post=&lt;/span&gt;&lt;span class="s"&gt;"/function-tree"&lt;/span&gt; &lt;span class="na"&gt;hx-trigger=&lt;/span&gt;&lt;span class="s"&gt;"click"&lt;/span&gt; &lt;span class="na"&gt;hx-target=&lt;/span&gt;&lt;span class="s"&gt;"#treeview"&lt;/span&gt; &lt;span class="na"&gt;hx-swap=&lt;/span&gt;&lt;span class="s"&gt;"outerHTML"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Analyze&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;label&lt;/span&gt; &lt;span class="na"&gt;for=&lt;/span&gt;&lt;span class="s"&gt;"search"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Search:&lt;span class="nt"&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"search"&lt;/span&gt; &lt;span class="na"&gt;hx-post=&lt;/span&gt;&lt;span class="s"&gt;"/function-tree"&lt;/span&gt; &lt;span class="na"&gt;hx-trigger=&lt;/span&gt;&lt;span class="s"&gt;"keyup changed delay:500ms"&lt;/span&gt; &lt;span class="na"&gt;hx-target=&lt;/span&gt;&lt;span class="s"&gt;"#treeview"&lt;/span&gt; &lt;span class="na"&gt;hx-swap=&lt;/span&gt;&lt;span class="s"&gt;"outerHTML"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"treeview"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note the &lt;code&gt;hx-post&lt;/code&gt; (which I changed to &lt;code&gt;hx-get&lt;/code&gt;), &lt;code&gt;hx-target&lt;/code&gt; and &lt;code&gt;hx-swap&lt;/code&gt; which are some of the basic elements of htmx.&lt;/p&gt;

&lt;h2&gt;
  
  
  ChatGPT asked good questions
&lt;/h2&gt;

&lt;p&gt;My prompt included the following request in the last paragraph:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Your first task is to confirm your understanding of the task, by asking any questions that might be necessary, and then providing a design document. Once the document is confirmed by me, you will write the code.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;ChatGPT asked good, relevant questions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;To confirm my understanding of the task and provide a design document, I have a few questions and a proposed design.

Questions:

1. Are there any specific design requirements for the website (e.g., colors, fonts, layout)?
2. Should the search functionality filter the tree view in real-time as the user types in the search text box, or should it only filter after pressing a "Search" button?
3. Is it required to use any specific front-end libraries or frameworks, other than htmx?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bard was kind of pedantic about it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I understand the task as follows:
[...]
Do you have any questions about my understanding of the task?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_EQuKhm_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ljqexxxs883z2a8ikf5e.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_EQuKhm_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ljqexxxs883z2a8ikf5e.gif" alt="Image description" width="480" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm giving round 1 to ChatGPT for following the prompt in terms of asking questions and using htmx as requested.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>chatgpt</category>
    </item>
  </channel>
</rss>
