VBA: How to display an error message just like the standard error message which has a “Debug” button?

First the good news. This code does what you want (please note the “line numbers”) Sub a() 10: On Error GoTo ErrorHandler 20: DivisionByZero = 1 / 0 30: Exit Sub ErrorHandler: 41: If Err.Number <> 0 Then 42: Msg = “Error # ” & Str(Err.Number) & ” was generated by ” _ & Err.Source … Read more

How to conditionally add flags to shell scripts?

#!/bin/bash /usr/local/bin/mongo-connector \ -m “$MONGO_HOST” \ -t “$NEO_URI” \ ${VERBOSE:+-v} \ -stdout If VERBOSE is set and non-empty, then ${VERBOSE:+-v} evaluates to -v. If VERBOSE is unset or empty, it evaluates to the empty string. Note that this is an instance where you must avoid using double quotes. If you write: cmd “${VERBOSE:+-v}” rather than … Read more

how to get MouseMove and MouseClick in bash?

The xterm terminal emulator defines some control sequences to do mouse tracking, you can learn more about them in the section Mouse Tracking in the document ctlseqs for the xterm distribution. If you have xterm installed, you’ll probably have a copy at /usr/share/doc/xterm/ctlseqs.txt.gz or a similar path. Most terminal emulators running on the X Window … Read more

In PowerShell, what’s the best way to join two tables into one?

After 1.5 years, the cmdlet I had pasted in the original answer has undergone so many updates that it has become completely outdated. Therefore I have replaced the code and the ReadMe with a link to the latest version. Join-Object Combines two object lists based on a related property between them. Description Combines properties from … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)