Category Archives: Programming

Stuff about stringing ones and zeroes together to form something useful. Contains some elaborations of the answers I post on Stack Overflow

Obfuscating mailto and tel links

When I designed my programmer’s portfolio site one of the things I noted it needs was my contact information. One alternative to doing that is a contact form, which has the advantage of avoiding spam from being sent to your e-mail address. However, I also found it very unnatural compared to having it open the user’s e-mail client or phone client. The mailto: and tel: links are the standard practice for contact information links, but it has the flaw of spam bots extracting the information and storing it for robocalls in the future.

So I get around it by obfuscating the links and text so that these bots would have a slightly harder time of getting the data.
Continue reading Obfuscating mailto and tel links

Office Development in Visual Studio Community Edition

There’s no need to buy the full version of Visual Studio in order to develop Office add-ons. All you need is the free Visual Studio 2015 Community Edition and the Office Dev Tools for VS 2015. The Office Dev Tools provides the templates to allow you quickly start creating add-ins for Office/SharePoint.
Continue reading Office Development in Visual Studio Community Edition

Recursive SQL for tree like structures

The WITH clause in SQL assuming it is supported by your database allows the database to perform lookups against hierarchical structure using what is known as a Common Table Expression (CTE). A common use case for this would be the LOCATION table in Curam where you’d want to determine if a given location is inside another location or to provide a list of locations that are underneath a higher level location.
Continue reading Recursive SQL for tree like structures

Converting a VBA collection to a JavaScript array

Windows Scripting Host allows you to access VBA Collections which are used by many objects in the Excel object model such as ThisWorkbook.Worksheets. Unfortunately VBA collections are not JavaScript arrays so you don’t have access to some of the more useful polyfills. To get around this I loaded up the Array.from polyfill into my project and created the following function:

This will then give me the capability of doing the following with the Array.forEach polyfill.