PIVOTS with Unknown Values – Dynamic SQL

PIVOTS with Unknown Values – Dynamic SQL

As promised, although it took 3 years, I’ll show you how to use PIVOTS with unknown values. This is a continuation of the other PIVOT post. If you haven’t already, it’s not a bad idea to read it first. (Create Employee Work Shift Schedule using PIVOTS) We’ll use the same code to start off. The prep code is the same. Last time we predefined the time values like the code below But instead of listing the times, let’s concatenate the…

Read More Read More

Wildcard Let’s Encrypt with Certbot Apache Ubuntu

Wildcard Let’s Encrypt with Certbot Apache Ubuntu

Google started a campaign to make the web a safer place. So they decided to mark all websites using plain old http as “not secure”. Only websites that were using https we marked as “safe” to use. Nobody wants to see their website marked as “not secure” because they didn’t use https. In order to remove the warning message, the website needs a SSL certification. But that costs money. Fortunately, there is a free way to SSL your website. Let’s…

Read More Read More

Create Employee Work Shift Schedule using PIVOTS

Create Employee Work Shift Schedule using PIVOTS

Once in awhile, it is required of you to create visualizations of the data you have in the database.For example, you have a set of data of employees and when they start their shift and when it ends.But you would like to create a chart for the day to see which employees work together. Fortunately, creating this chart is easy in SQL Server using Common Table Expressions (CTE) and Pivot.The sample data we will use is the data seen below….

Read More Read More

How to add Google Maps Autocomplete to a search box

How to add Google Maps Autocomplete to a search box

Most of the time when creating a registration form, you will ask the user to type in the city they live in.And you want to make the user’s life easier by auto completing the city name as they type.Ever wondered how to add Google Maps autocomplete for a textbox? Using a free service from google, you can easily add the autocomplete to any textbox. The sample below demonstrates how it’s done and the highlighted rows are the important parts. Enjoy…

Read More Read More

Apache Custom Environment Variables in PHP

Apache Custom Environment Variables in PHP

If you ever wanted to create a new Environment Variable, you can do so by setting them in the VirtualHost section.For example, And to use it in PHP simply use $_SERVER[‘VARNAME’] or getenv(‘VARNAME’);If you were to check the output of phpinfo(), you can actually see the Environment Variable as the image illustrates below.

Copy / Clone WPF User Control

Copy / Clone WPF User Control

Sometimes you need to copy/clone your user controls. I found this link very useful and hope others find it useful.In short, you create an extension method that takes type T. Using XamlWriter you save the control into xaml and then read that xaml back out as an object.Here’s the code: https://gist.github.com/jon-kim/c209cb196d54ce9b8ad703ddc265c49e