Learning

Playing With AI

Playing with AI and Learning to Keep It Simple, Silly

Yesterday I was playing with AI in the evening and I asked it to help me write a function that would detect whether an array item was a photo or a video. I told the AI, this is a photo array item, and this is a video array item. I want the photo array item to display the img src code and for the video item to be displayed with video src code. At first it failed to detect anything and gave me an error message. I decided to highlight the photo array item snippet and the video array snippet. It didn’t come back with an error but it did not display any img or video code. In the end I decided to say “here’s the img src tag. I want you to detect whether the file is mp4 or jpg. If it’s mp4 add the video player, and if it’s a photo load the image. I went from asking it to read the array to determine what to do, to “check the filetype and load the appropriate src type. That worked, and required very little code. Don’t Over-Engineer With AI The moral I came away with, after the trial and error I went through last night is that whilst AI is great at reading and understanding code, and giving us answers it can sometimes fail. I was making something far more complicated than it had to be and chatGPT got confused, as would a human trying to complicate something simple. PHP has a lot of functionality built into it. It has tools that allow it to read exif information, file types and more, and if you know about these tools, then you can come up with elegant solutions, rather than complicated ones.

Experimenting With Hugo As A Blog

Converting This Blog To Hugo

On Saturday I converted my blog from WordPress to Hugo as an experiment and it went quite well. I downloaded the xml file and then I converted that xml with blog2md to go from xml to md pages. A page was created for every single blog post. This took a while. I now have my blog both as static pages, and as a wordpress blog.

My AI Teacher

Today I want to discuss something different. I want to discuss using AI as a teacher, rather than as a tool to replace us. For a few days I have been playing with the Instagram json file that I got when I requested my archive. With this json file I thought about things to do, and in so doing asked chatGPT for help, and it provided answers.

Adapting the Questions

A Desire to Dump WordPress

In theory WordPress is a fantastic tool to write a blog, without needing to learn to code. In practice I am tired of WordPress and I have been tired of WordPress ever since they started to use blocks, and ever since I noticed that it uses React. 

React and Meta

I know that PHP was developed by Facebook, and that we use it all the time, but I also know that React was developed by Facebook as it was morphing into Meta, the destroyer of the independent web. Instagram and Whatsapp were destroyed by Facebook, as the monopolist took over those accounts. 

Playing with the Hugo With An Old Site

For a few days I have been playing with Hugo with Markdown and HTML pages. It says that it is “the world’s fastest framework for building websites” and so far I do notice that it has a key strength that I like. 

Front Matter

That strength is that with small modifications you can take an existing static website and make it dynamic.  Hugo requires that each page has Front Matter.  

Front matter is:

Playing With Pelican - A Static Blog Website

When looking at Codeberg as a European alternative to github I came across mentions of Pelican, a static blog generator. Yesterday I spent several hours setting it up and playing. Whilst playing with it I saw some opportunities. 

By default Pelican is designed to have one category per blog post. For small websites this is fine. It encourages people to focus on three to five topics, and ensure that each topic is clearly visible in the nav bar at the top of the page. 

Updating Old HTML Webpages

Most websites are simple. They have five to ten pages at most but usually a single page is enough. Most pages are about one specific thing, whether it’s a CV inspired page to find new clients or a simple page with a few products. Most are usually about a single topic.

This makes website maintenance and design simple, because one theme fits every page. My website is different. It has articles about the Romans, Geography, Environmental Studies, old student newspaper articles, Media studies pages and more. In effect it is several websites rolled into one.

Working Towards a Goal

I am currently working towards a goal and I am struggling. I am struggling to stay focused when I follow online courses because I find that my mind strays. I am also struggling because the topic is so broad that there are hundreds of things you can learn but you need to be focused.

I am also struggling because although many people live in denial about the pandemic it is still thriving. The positivity check, for a disease, to be considered under control is less than five percent. COVID, after five years is still at ten or more percent. This gets in the way of going to conferences, meetups and other networking opportunities.

Learning By Writing despite GPT

I am old enough to remember a teacher writing on a board or piece of plastic for an overhead projector. “Why don’t you just give us photocopies of what you’re writing instead of asking us to copy down what you’re writing. “Because you will remember it better if you write it down.”

At the time this seemed stupid and a waste of time. Years later I think that we could have been taught to take summarised notes rather than literal notes but that isn’t the point. The point is that learning is as much about writing as it is about understanding the material Every day for weeks in a row I have taken the time to write a 300 word post and it’s difficult. Not only do you need to come up with an idea but you need to develop it into something that is at least three hundred words long.

Laravel and Context

There is value in studying Laravel and context. By this I mean that over a year ago I wanted to study Angular but after feeling lost in Javascript I decided to take a step back, to study JavaScript. I studied two or more courses over a period of months. I could have followed a single course and claimed that I knew and understood JavaScript but that would have been misleading.