Posts

Showing posts from October, 2022

Windows 10 default environnent variables

From   Complete list of environment variables on Windows 10 - Pureinfotech On Windows 10, environment variables are predefined names representing the path to certain locations within the operating system, such as a drive or a particular file or folder. Environment variables can be helpful in a number of scenarios, but they’re particularly useful if you’re an IT person or you’re fixing someone else’s computer, as you can quickly navigate to certain locations without even knowing the username or full path to a system folder. For example, instead of browsing a path like  C:\Users\<UserName>\AppData\Roaming , you can open the  Run  command (Windows key + R), type this variable  %APPDATA% , and press  Enter  to access the same path. Or you can use the  %HOMEPATH%  variable to access the current user default folders location — where the operating system stores the folders for Desktop, Documents, Downloads, OneDrive, etc. In this  guide , you’ll learn the list of the most common environ

MySQL - How to find gaps in sequential numbering in mysql

 From a reply found here:  sql - How to find gaps in sequential numbering in mysql? - Stack Overflow SELECT CONCAT(z.expected, IF(z.got -1 > z.expected, CONCAT( ' thru ' ,z.got -1 ), '' )) AS missing FROM ( SELECT @rownum : = @rownum + 1 AS expected, IF( @rownum = YourCol, 0 , @rownum : = YourCol) AS got FROM ( SELECT @rownum : = 0 ) AS a JOIN YourTable ORDER BY YourCol ) AS z WHERE z.got != 0 ; Note that the order of columns  expected   and  got   is critical. If you know that  YourCol   doesn't start at 1 and that doesn't matter, you can replace ( SELECT @rownum : = 0 ) AS a with ( SELECT @rownum : = ( SELECT MIN (YourCol) -1 FROM YourTable)) AS a If you need to perform some kind of shell script task on the missing IDs, you can also use this variant in order to directly produce an expression you can iterate over in bash. SELECT GROUP_CONCAT(IF(z.got -1 > z.expected, CONCAT( '$(' ,z.expected, ' ' ,z.got