I finally moved from Sequel Pro to Sequel Ace. Sequel Pro hasn't been updated in years. It mostly worked but did have some annoying problems. During a recent OS and app reinstall, I found that Sequel Pro was no longer available on Homebrew, so I went for Sequel Ace, a fork that is still maintained. It is very similar but improved. I like it.
Continue reading post "Sequel Ace"my posts
Readable query output in MySQL CLI
I tend to prefer a GUI like Sequel Pro for looking at database data, but since Sequel Pro doesn't support MySQL 8+ and I haven't settled on an alternative, I found myself needing to use the CLI. It also can just be faster to use for new or rarely accessed servers or whatever, and is nice and lightweight. However, it wraps query output by default, and with many or wide columns, it can become very hard to read and figure out which data is in which column. Recently, I went looking for something better, and found a StackOverflow question with a couple ways: outputting vertically, and using a pager with a nowrap option set.
Continue reading post "Readable query output in MySQL CLI"MySQL: DELETE with sub-query on same table
I had an issue with a MySQL query containing a sub-query recently where it worked fine when done as a SELECT query, but gave an error when switching it to a DELETE query. The error given was something like 'You can't specify target table "items" for update in FROM clause'. The sub-query was referencing the same table as the main query, which apparently can't be done directly in MySQL because the table will be modified during deletion. But there is a sort of a hack I found in this StackOverflow answer, among others, to force it to create a temp table and allow it to work.
Simple MySQL backup script
I made a simple bash backup script for the newer MySQL database servers at Cogneato.
Continue reading post "Simple MySQL backup script"
I've just learned that, with the MySQL command line client, one can run \s or status; and get a nice readout of status information.
Continue reading post "#3009"
Automatically reconnect PDO when connection times out
In PHP scripts that run queries to a MySQL database over a long period of time, the connection may time out and give a "MySQL server has gone away" error. Continue reading post "Automatically reconnect PDO when connection times out"
Import SQL file in Doctrine / PDO
I recently needed to programmatically import SQL files containing database dumps into a database managed by Doctrine ORM. Continue reading post "Import SQL file in Doctrine / PDO"
Restaurants and bars in Ohio are forcibly closed now, except for carry out, in response to this COVID-19 virus. Continue reading post "#2712"
Eclipse 2017
Took a long lunch to watch the eclipse today. My mom got me some of those eclipse glasses, and it was very visible through them. This in contrast to everything else, which was not at all visible through them.
Since we didn't get the full eclipse, it looked similarly interesting for a good hour before and after the peak, just a normal sun with a dark circle covering part of it. Things didn't even seem any different than normal without viewing helpers.
I attempted to photograph the eclipse, with no special equipment (eg solar filters) beyond my mirrorless DSLR. Continue reading post "Eclipse 2017"
My new resumé site
Well, I finally did it. After several years of effort, I finally released a new version of my CV / resumé site. How did I accomplish such a difficult task? Let me tell you, it was not easy. There was the desire to accomplish perfection that I did not have enough time for in my day job, to make everything organized and set up in the best possible way, that I might be able to draw from for other sites. There was the want to learn new things that I don't use at work that might be useful or at least give me ideas and be important to know for my career in general. And, of course, there was the fatigue from doing very similar work for long periods of time at my actual job, and working on some of the more general use projects I work on on github.
I spent countless hours reading about different best practices and methods. I researched and tried several different frameworks / CMSs. I built and rebuilt my site numerous times in different ways. I played with different design, development, and content ideas, and was not entirely satisfied that any was the best.
Continue reading post "My new resumé site"Stearns: Wordpress Custom Queries
For the Stearns site, we need to list upcoming events on the home page. Using Flutter, I created a custom write panel for the events (and other items). The events are simply posts that have a custom date field attached to them.
I was attempting to use the "query_posts()" function to get the posts I need. I discovered that it is possible to use this function multiple times on a single page. I previously thought you were unable to because of "the loop", but you only have to make a few accommodations for the page name and other such Wordpress variables getting changed. I was able to use this to output the page data on our home page plus two categories of posts.
Unfortunately, "query_posts()" allows limiting by category and sorting by a custom key, but no less than, greater than, or other such comparisons with the meta key [wrong, see end of post]. So I decided to make my own SQL query, to be run with the "$wp_db->get_results()" function. The function allows a straight SQL query to be run. Then some other functions are used to put the result set into "the loop". So, the code to run my custom query looks like the following: