PromptBros: plea in mitigation and two judgments

Following my previous blogpost, I have made a chat agent on PromptBros to illustrate the input of advocates in crafting a plea in mitigation. As a student, I was sometimes quite puzzled about the value the advocate adds when conducting a plea in mitigation. In some cases, the value is clear: where there is sentencing guidelines from the legislation or the Court of Appeal, or when a case is an excepted offence for which suspended sentence is available....

August 20, 2024

Tic-tac-toe: first draft

After feeding my previous blogpost into my PromptPros account, my Llama Sonar Chat agent quickly generated a passable first draft HTML file to work on. The only slight issue I encountered was that the return value of a spliced array is another array: so to get the number out I have to do let move = emptySpacesArray.splice(index, 1)[0] The first draft is now at this commit. Directions for next steps:...

August 15, 2024

Tic-tac-toe: reflections on a classic programming challenge

Coding up a game such as Tic-tac-toe is a classic programming challenge, but one which I never took much more than passing interest. I mean: I can see it is a good quick-start tutorial to a language/tool (e.g. React quick start). I also really enjoyed it when I did it for the first time. But after the first time, why do it again and again and again? But recently I changed my mind....

August 15, 2024

Table Talk of Nick Ribal

Who wrote these articles. All the misinterpretations are my own. Styling web components HTML was originally designed for documents. For documents, the cascading styles of CSS makes sense: you want uniform styling across the global environment, with fall-backs as necessary. But for web apps, the document model doesn’t make sense. You want separate components for different things (buttons, menus etc). For a component, you want all the styles to be confined to the component itself: you don’t want a situation where the overall style sheet may affect the look of a button....

August 7, 2024

Marginalia Search

A short time before I started following blogs with RSS, I came across Dan Luu’s blog (someone was referring to it as an example of a good looking blog with no CSS at all). It was a treasure trove of well thought-out and very well-written essays. And one of the most interesting pieces is about search engines, where (among others) Luu claims that one of the best search engines around is an indie project called Marginalia Search....

August 1, 2024

Clojure conj: lists v vectors

At this juncture, I noticed an interesting pattern with the behaviour of conj in Clojure. As per ClojureDocs: ;; notice that conjoining to a vector is done at the end (conj [1 2 3] 4) ;;=> [1 2 3 4] ;; notice conjoining to a list is done at the beginning (conj '(1 2 3) 4) ;;=> (4 1 2 3) Why? According to a Perplexity AI answer and my PromptBros agent, it is because:...

July 31, 2024

More ClojureScript Koans

I could only programme for a very short time today, so decided to have another crack at Clojure Koans. This puzzle is a good brain teaser. Dill in the ___ below. (= 25 ( ___ (fn [n] (* n n)))) I was stuck and decided to make a Clojure tutor bot on PromptBros to chat with. Again, it didn’t give the right answers: the apply function (if correctly explained) requires an input after the function, not before....

July 30, 2024

Learn Next.js with the Leviathan

[demo] [repo] After finishing the official quick start, I wanted to try Next.js out with an actual project. Soon after I started web programming, I used plain HTML and CSS (and a lot of ChatGPT) to put together a web version of John Selden’s Table Talk. The process took a day or two around new year’s eve and new year’s day. 8 months on and with Next, the process has got a lot smoother....

July 29, 2024

My first LLM agent

I was recently invited to try PromptBro’s LLM agent function. While I occasionally use Perplexity.ai for debugging, my exposure to LLM agents was limited to the very amusing Bertie Wooster bot on Poe. The sign-up experience is smooth. One of the first things I tried is the DALL-E integration, and I was impressed by the quality of the image generated. I entered the following text prompt. Give me a tutor who teaches a web dev (who is familiar with the usual tools) how to use the framework Next....

July 29, 2024

Next, Supabase, Mailgun

My aim is simple: on my deployed website, when a user enters her email to sign up for something, my website needs to send her a confirmation email, and also log it into a database. So, how to go about it? It is not hard to get a Next.js and Supabase working together on a local machine or when deployed. There is an official tutorial which is good but for a minor flaw....

July 29, 2024