Leverage AI for building a prototype of a VUI / GUI for logging home gardening activities: planting, mulching, watering, weeding, harvesting, etc

- Spring Boot with Spring AI, leveraging OpenAI's chat completions API
The book provides this first implementation, which as written traverses each element past i
two times per recursion:
def qsort(arr):
if len(arr) < 2:
return arr
pivot = arr[0]
less = [i for i in arr[1:] if i <= pivot]
# NOTE: this traverses all N elements twice in the list.
greater = [i for i in arr[1:] if i > pivot]
This sample code is meant to gently introduce the concept of event sourcing at the level of concrete implementation, using Kotlin. For conceptual background, I recommend starting with:
Inspired by:
https://developer.atlassian.com/server/confluence/pagination-in-the-rest-api/ https://stackoverflow.com/questions/13872273/api-pagination-best-practices
The following command returns everything available, 47 results in this case:
Note: there's a default page size of 1000, which is why the next and prev have the same values in this case, though we might just strip the parameters out when everything is visible
Demonstrates how to use a single command to assign multiple Members to a Scope along with Scope-specific roles each Member will have for the target Scope.
For the context of this example, the following request will setup the instance with the needed starting conditions:
The following input payload specifies an array with 9 commands. These nine commands expand to 13 concrete actions for the backend API processor to execute. However, 12 of these actions are erroneous! Only one of them will succeed against the database running on the instance.
[
{
"from": "Animal"
},
{
"from": "Scope",
"where": {
$(document).arrive('.story-card', function() { | |
const story = $(this); | |
const applyStatusAging = () => { | |
const number = story.find('.number').text().trim(); | |
const title = story.find('.title'); | |
const query = ` | |
from: PrimaryWorkitem | |
where: | |
Number: ${number} |
$('.advisory').each((index, elm) => { | |
const el = $(elm); | |
const text = el.text().trim().replace(/\s+|\r|\n+/gmi, ''); | |
const matches = text.match(/\d+/gi); | |
if (matches) { | |
matches[0]+='d'; | |
if (matches.length>1) matches[1]+='c'; | |
const aging = `<span title='${text}'>${matches.join(', ')}</span>`; | |
const story = el.parents('.story-card'); | |
el.parents('.aging').html(aging); |