Categories
Database MySQL

Incomplete Dates in MySQL

Sometimes you can't store the year portion of a date in MySQL because it's not available, such as when people are willing to provide their birthday but not the year of birth.

You can resolve this by entering "0000" in MySQL, but that won't work will all databases.

Another solution is to provide the year 1200 as a placeholder for those dates.

Using the year 1200 works because it it a leap year, so date formatting and calculations that are sensitive to leap years will work, but you'll have to filter out the year for certain queries and calculations.

 

Categories
eMail

Converting vCard (.vcf) files to Comma Separated (.csv)

Sometimes a contact list exports as a .vcf file, which can be difficult or impossible to import into another mail system.

This link provides a way to easily convert it;

http://www.unc.edu/vtoc/

'nuff said.

Categories
DOS & DOS Scripting

Batch Parameter Extensions

These examples use modifiers to modify parameter %1

  • %~f1 Expand %1 to Fully qualified path name
  • %~d1 Expand %1 to Drive letter
  • %~p1 Expand %1 to Path only e.g. \utils\ (ncludes a trailing \) Some commands will interpret this as an escape character.
  • %~n1 Expand %1 to a file Name without file extension C:\utils\MyFile or if only a path is present (with no trailing backslash\) – the last folder in that path.
  • %~x1 Expand %1 to a file eXtension only – .txt
  • %~s1 Change the meaning of f, n, s and x to reference the Short 8.3 name (if it exists.)
  • %~1 Expand %1 removing any surrounding quotes (")
  • %~a1 Display the file attributes of %1
  • %~t1 Display the date/time of %1
  • %~z1 Display the file size of %1
  • %~$PATH:1 Search the PATH environment variable and expand %1 to the fully qualified name of the first match found.

You can also combine these as shown below:

  • %~dp1 Expand %1 to a drive letter and path
  • %~sp1 Expand %1 to a path shortened to 8.3 characters
  • %~nx1 Expand %2 to a file name and extension only
  • %~dp0 The folder from which the script is being run

Reference:

  • https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/percent.mspx?mfr=true
  • https://ss64.com/nt/syntax-args.html
  • http://davidthewizard.blogspot.ca/2010/03/better-batch-files-through-command.html
  • http://stackoverflow.com/questions/5034076/what-does-dp0-mean-and-how-does-it-work
Categories
Web Development Web Server WordPress

Certificates and Mixed Content Errors

When a secure (https enabled) website is displaying a caution on the certificate and warning about mixed content, you need to identify and correct the content on the page that is causing thje warning.

A good check is to  visit https://www.whynopadlock.com and enter the URL of the troublesome site.  It will quickly identify the elements – typically images – that need to be corrected.

If the images are on the same site you can usually just change http:// to https:// in the image URL, or alternatively remove the http://mysite.com from the url of the image. If the image or element is on another site you can try changing the protocol to https, but you may have to bring the element onto your own site or live with the warning.  Just just accepting the warning is a bad idea because it caused your audience to lose confidence in your site.

Another good discussion of this with additional options can be found at ManageWP, it's worth a read.

Categories
Hardware

Canon MF Printer Toolbox in Windows 10

Users of certain Canon Multi Function printers may have trouble with the Toolbox utility after upgrading to Windows 10.

This thread on the Canon community website has a number of tips.  When time permits I will the specific instructions for my MF4370dn model, but it appears that it may vary slightly for other models.