Category Archives: Programming

Checking for open ports on other systems

Testing connectivity and port availability using SSH instead of Telnet – Unix & Linux Stack Exchange Windows: Port open: C:\>ssh -p 121 p4-mfgkex_exchange_identification: read: Connection reset Port closed: C:\>ssh -p 120 p4-mfgssh: connect to host p4-mfg port 120: Connection timed … Continue reading

Posted in Cmd scripting, Operational Technology, Security, System/DB Administration | Leave a comment

ForFiles is not For

Today I was surprised to find a new batch command. FORFILES. This is essentially a re-worked FOR command, with a slightly different skew. Whereas FOR is targeted at files or text, FORFILES is exclusively targeted at files. What makes it … Continue reading

Posted in Cmd scripting, FunTimes, Programming | 1 Comment

PowerBI Power Query / M lookups

I’m building a dynamic bucketing system with filtering based on process and program. I’m facing several interesting challenges. First- bucket sizes are based on the program, so I need dynamic buckets, and bucket labels. Second- max number of buckets is … Continue reading

Posted in Business, Business Intelligence, Design and UX, PowerBI | Leave a comment

Feature Debugging flags

I chuckled today when I received an add from launchdarkly.com. They’re a “feature flag” SaaS provider. I explained the concept of feature flags to a non-software-developer just a few weeks ago, so maybe my phone was eavesdropping. I was amused … Continue reading

Posted in C#, Musings, Programming | Leave a comment

Open the application folder, Hal.

Some applications *cough ClickOnce cough cough* hide in difficult-to-find folders, with auto-generated paths that include GUIDs. Here’s an easy way to open the application folder, and also the config file. And the local application data folder, because of course you’re … Continue reading

Posted in C#, Programming | Leave a comment

Simplified switch

I commonly included this code at the end of a C# switch statement, in a misguided effort to proactively satisfy the syntax of the switch statement: switch (contentType) { case FraMES.ContentTypes.Something: do stuff for Something; break; default: throw new Exception(“FraMES.ThisMethod … Continue reading

Posted in C#, Programming | Leave a comment

Automating PowerShell FTP from a command line

I’m supporting an environment which excluded PowerShell and most other software. When the system required FTP file transfers, we used the Windows command line FTP client with automation scripting. It was functional although clumsy. PowerShell has potential for more graceful … Continue reading

Posted in Programming | Leave a comment

Simple SQL to count related records

Here is a basic example of how to use a subquery to return a total count of records. This is particularly useful to show an aspect related to some info that you are working with. This example would count the … Continue reading

Posted in Programming, SQL Server | Leave a comment

C# Pragma to disable unused constants

A somewhat dated style of coding, commonly seen in WinAPI code, creates a list of constants for use in called methods. Occasionally I find this concept handy and illustrative, such as when using 32-bit resources because the 64-bit equivalent is … Continue reading

Posted in C#, Programming | 1 Comment

PowerBI YearMonthDay in formatted new column

This formula will create a zero-padded Year/Month/Day Weekday in PowerBI. For example: 2021/06/15 T Create a new column, and update the formula to use your table name and column name. (‘history'[date] in the formula below.) DateYMD = Year(‘db_datareader uvw_aca_wipinfo'[end_time]) & … Continue reading

Posted in PowerBI | Leave a comment