Postgresql Tip: Sometimes the translate function is easier than replace or regexp_replace

Steven NgDaily Debug BlogLeave a Comment

Overview If you’re trying to replace the contents of a string in Postgresql (or Microsoft SQL Server, which uses a similar syntax) , your first instincts are probably to use the replace or regexp_replace function. They’re both useful and handy, but there is also a translate function, which you might not know about. After all, who has time these days … Read More

Generating a Non-Expiring API Token for Facebook Insights

Steven NgDaily Debug Blog1 Comment

If you’re trying to write your own script to download your Facebook Page’s Insights information, or if you’re using Extrata, you need a Facebook API key. The problem with the keys is that they are short-lived by default, and it’s not obvious how to get one that doesn’t expire. Facebook makes you jump through hoops to get such a key. … Read More

Quick Hit: Programming Font Preview Tool

Steven NgBusiness Intelligence, CodingLeave a Comment

Over at, you can try out various programming fonts to see how they look with some sample code you can paste in yourself. You might be asking, “But Steven, a monospace font is a monospace font is a monospace font. Why should I care?” In programming in particular, you want to be able to visually spot the difference between … Read More

Generating Rolling Start and End Dates Landing on Preset Weekdays From Any Date

Steven NgAnalytics, Business Intelligence, Coding, Cognos, Daily Debug Blog, ReportingLeave a Comment

I answered a Cognos question on Reddit last week, and figured the formulas I provided in the answer would be useful to other people. I’m writing this in generic pseudo code, so that it’s not Cognos specific, so you should be able to use this in anything by changing up the function names to your tool of choice. The Problem … Read More