SQL statement to get value from row containing max value

Submitted by Darren Oh on Tue, 04/05/2016 - 11:56

I was trying to get a list of highest numbered records from an SQL database table. My first attempt used a GROUP BY and an aggregate function:

SELECT * FROM field_data
GROUP BY revision_id
HAVING delta = MAX(delta)

This means to only return records which contain the highest delta values their revision IDs. I know SELECT statements are only supposed to have fields which appear in the GROUP BY clause, but I tried it just in case. The HAVING filter had no effect. My second attempt used a join:

El Capitan Airplay Mirroring Issue

Submitted by Darren Oh on Fri, 02/12/2016 - 10:46

When I tried to use Airplay to make my TV a second display, the TV went blank. None of the mirroring options were shown in the Airplay menu. I called Apple support, but Airplay mysteriously started working during the call. Yesterday, the problem was back. I found the solution in an Apple support community post. There seems to be a bug in El Capitan that prevents Airplay from being used as a second display if there is an invalid login item.

Tags

MEAN App on Mac OS X

Submitted by Darren Oh on Wed, 02/10/2016 - 17:18

I’m working with a MEAN app on Mac OS X El Capitan Version 10.11.3. Every time I restart the computer, the app crashes, saying, “Too many open files.” I have to run this command in the terminal to get the app to start:

ulimit -n 1024

Tags

Drush Cron on Dreamhost

Submitted by Darren Oh on Mon, 02/08/2016 - 10:19

I set up Dreamhost cron jobs to run drush cron for two different sites running Drupal 8.0.3. One of the cron jobs worked, but the other failed with a syntax error. Drupal 8 requires PHP 5.5.9 or later, and the default version of PHP for one of the sites was 5.4.42. Changing the default PHP version in .bash_profile and .bashrc did not fix the error.

Tags

Protecting private files in Drupal 8

Submitted by Darren Oh on Thu, 02/04/2016 - 14:32

If you add a private files directory after installing Drupal 8.0.3, you will get a warning on the status page saying it is not fully protected and to see https://www.drupal.org/SA-CORE-2013-003 for information about how to protect it with an .htaccess file. The message shows up even if the directory is not Web-accessible. Ignore it. The .htaccess file will be created automatically after caches are rebuilt.

Tags

What Happened to Usenet?

Submitted by Darren Oh on Tue, 01/12/2016 - 17:23

Usenet used to be the Internet. The World Wide Web was announced on Usenet. But most ISPs no longer offer Usenet. Usenet has been replaced by Web forums (I include Facebook and Twitter in the definition of Web forums). Why?

Usenet lacks two things that Web forums have:

  • Authentication
  • Permanent archiving

The need for these two features is the reason Web forums have replaced Usenet.