Live Edit of MariaDB generated table using Jquery and Bootstrap

My latest research involved the generation of a web table from a MySql/MariaDB database, with live CRUD capability (Create, Read, Update, Delete).
Key Learnings: JQuery is your friend. Bootstrap is also your friend. W3Schools is your friend. StackOverflow is your friend. Github is your friend.

With the help of all the above mentioned resources I was able to take a database of information, list it in a web page and then have options to delete records, update records, and add records. The biggest headache came with the question of how to signal a change to existing information in the listed table. An example I found on Github used the .on(blur…) functionality of JQuery but it had a bug(?) associated with it when the blur event fired multiple (an infinite number?) times. I solved the problem unsatisfactorily by changing .on(‘blur’,…) to .on(‘dblclick’…). I wanted to try avoiding mouse operations, but for now this has fixed the issue.

Update: April 1, 2023 (and this is not an April Fool)

The latest version of JQuery appears to have fixed this issue. The ‘dblclick’ references were changed to ‘blur’ references and the page appears to be working as intended.

This example on Github was particularly helpful:

https://github.com/rahmat058/Live-Table-Add-Edit-Delete-using-Ajax-Jquery-in-PHP-Mysql

[P]ersonal[A]udio[R]ecorder – Part Two

I’ve only done an elementary amount of BASH scripting, so as a learning tool I decided to automate even further, the process I described in Part One. Many streaming URLs are very long and complicated, so it makes sense to collect them and then make them accessible for automated “copy” and “paste”.

We live in a country of different time zones and therefore it is very convenient to be able to “listen” to the radio (especially the Canadian Broadcasting Corporation or CBC) in a different region at a different time. This can be used to hear something that was missed the first time, or to listen “ahead” to something when it is first aired.

So my desire to automate the “stream recording” process led me to find a list of CBC streaming URLs. Having done this I then compiled a list of places and stream URLs and put them in a text file in the form:
line1: place (in quotes)
line2: url (unquoted)

This can then be read into a Bash Array and converted to a Bash Associative Array so that a URL can be associated with a place or radio station name.

I learned a lot putting this script together, and it took a maddening amount of debugging as I learned some of the idiosyncrasies of Bash syntax. In particular I learned that quotes and/or the lack of them can lead to great frustration and disbelief.

In the process I also learned that processing command options and arguments is a non-trivial exercise. Fortunately I discovered argbash and despite some initial confusion about the “argbash process” I plugged on and learned how to use it.

The script I ended up writing is certainly not bomb-proof, but it suits my purpose pretty well and it can easily be used to schedule audio recordings of one minute to many minutes (up to the limit of available disk space!) of recording from any one of forty-two different radio streams. This list can certainly be expanded. There are literally hundreds, if not thousands, of radio streams available. For now I am interested in the CBC streams, along with a local internet radio station called “Cabin Radio”.

I also learned how to use “zenity” to prompt an interactive user of the “stream_record” script with pretty Gtk dialogue boxes.