Code

I asked ChatGPT to write me a program

This post contains a lot of code, presented as close as possible to the code ChatGPT gave me. I’m including it here so people can see how good or bad they think it is. Where necessary I modified the code to make it work, but it’s as close as possible. All this code makes the post look longer than it is. If you’re not interested in the code then you can just skip over it and just read my words :-)

Emulating a Philips Hue light

Over the past couple of years I’ve been building out an Alexa skill for my media center. So now I can say things like “Alexa, tell media to play music”. That will turn my receiver on, switch it to the Mac input, and start iTunes playing. Similarly “Alexa, tell media to switch to TiVo”, “Alexa tell media to pause”. The backend code running on the Mac asks the receiver what input is selected (TiVo, Mac, BluRay…) and if on the Mac it works out what application has focus (iTunes, DVD Player, Kodi, …) so when a command such as “pause” is received then it knows how to send the appropriate action.

Historical Java

Discussions elsewhere (in more than one place; coincidence?) reminded me that in the long long distant past I was “hot” java programmer (“hotjava”, geddit? Ah shaddup!). I actually wrote what I believe was the first website Java applet sold commercially in the UK, back in 1995. It was a teaser site for the SciFi Channel (which was due to launch around then) called “zorg”. We got involved ‘cos we were Sun partners and the client had gone to Sun asking for some Java development.

Teaching myself javascript

My web design skills are a little on the old side. Probably frozen around 1997; Netscape Navigator 2 would probably render most of my stuff properly. As part of the “make work” project I did last month I wanted to try something new. With the existing version if you clicked on a link to get cover-art then it would just be a simple link. You see the image then press “BACK”.