Jon Willeke · Feb 25, 2016 go to post

Different people are going to have different workflows for unit testing, but I would encourage you to settle on a way to get those tests out of the database. I'd be nervous about running tests in a namespace that contains my only copy, since %UnitTest is designed to load and delete by default.

If you're using Studio with the source control hooks, it works pretty well to write the tests in a development namespace, then run them in a test namespace.

Jon Willeke · Mar 4, 2016 go to post

Visual Studio Code got a lot of praise in a recent Hacker News discussion of an extension for the Go language. One user mentioned that the PHP extension is quite good, and works well with XDebug. It's also supposed to be good for JavaScript and TypeScript.

I've been using Xamarin Studio to write NUnit tests (C#) on the Mac. I loaded the project into VSC, and it's not bad. It doesn't seem particularly fast or lightweight, as some have claimed, but it's adequate. OmniSharp is included, so you can hover over method calls to see the signature, and each method definition is preceded by a count of how many times it's called.

Java support is not nearly as good out of the box, but there may be some extensions to improve that.

For COS, you could probably configure a task runner to use Atelier's REST APIs to save and compile files to a server. Syntax highlighting and debugging would take some doing, but the hope is that Atelier will scratch that itch better than VSC ever could.

I'd say that Visual Studio Code doesn't have enough to lure me away from Emacs for any extended period of time, but it's a capable, extensible editor.

Jon Willeke · Mar 16, 2016 go to post

The /exportversion qualifier probably would not have helped in this case. It just strips new keywords from the class definition.

Jon Willeke · Jun 2, 2016 go to post

Even after looking at Timur and Eduard's answers, I don't understand the question. $lb(1,2,3,",",5) returns a string. Why are you trying to round trip it through a delimited string using $lts and $lfs?

Jon Willeke · Jun 2, 2016 go to post

$lts and $lfs are the abbreviated forms of $listtostring and $listfromstring, respectively. $lb(1,2,3,",",5) returns a string, which seems to be what you want. I don't understand why you are then converting it to a delimited string with $listtostring.

Jon Willeke · Jun 7, 2016 go to post

If you want to wait for either a signal or for termination of a process, you can use a lock:

  1. Process A takes out an exclusive lock.
  2. Process B attempts to lock the same name.
  3. Process A either releases its lock or terminates.
  4. Process B will then get its lock.

You may need an extra synchronization step between steps 1 and 2 to ensure that A gets the lock before B does.

In steps 2 and 4, multiples processes can wait for a shared lock on the same name, and they will all be triggered at the same time.

Jon Willeke · Jun 16, 2016 go to post

In general, no, you can't apply string functions directly to streams. I found one such enhancement request from eight years ago that has since been closed. (There may have been others.)

For the specific case of $replace, it should be straightforward to implement Eduard's suggestion using the FindAt() method.

Jon Willeke · Jun 23, 2016 go to post

Unless I've misunderstood the context, it's simpler to use the ERROR macro:

$$$ERROR($$$GeneralError,"DXL Testing Run Error")

You don't need %occErrors.inc to get GeneralError, because of how ERROR (like ERRORCODE) is defined.

Jon Willeke · Jul 26, 2016 go to post

Does this call do what you want?

USER>w $zstrip(pHL7,">","|^")
PID|1|12345||DOE^JOHN
Jon Willeke · Aug 23, 2016 go to post

$fromJSON(stream) works for me in 2016.1.0. What problem are you having?

Jon Willeke · Aug 26, 2016 go to post

I don't understand what you mean when you say that your clinicians aren't database users, but it sounds like you need to give them access to the %Service_SQL service.

Jon Willeke · Oct 14, 2016 go to post

Worth mentioning that O/S authentication is simpler and potentially more secure than fiddling with passwords in a script. If you do prompt for a password, consider using the -s option of the read command to hide the input.

Jon Willeke · Nov 2, 2016 go to post

In the following screenshot, I've just typed "prop", a unique prefix of the property template, then pressed Cmd-/ (the Content Assist shortcut for Emacs key bindings on a Mac):

 

Since its auto insert attribute is on, I expected the template to expand immediately, rather than presenting the popup.

Jon Willeke · Jan 9, 2017 go to post

Careful, you should pad each byte with a leading zero if necessary. Otherwise your output is missing five nibbles.

Jon Willeke · Jan 31, 2017 go to post

WRC should take good care of you then. It occurs to me that when a call-out function returns an error, you should see a FUNCTION error. An ILLEGAL VALUE error suggests that $zf could not find the "GETFILE" entry. Is there any chance that you're using a kernel with a modified czf.c?

Jon Willeke · Jun 28, 2017 go to post

My research shows that "!" was added in 1992, inspired by MSM. "$" was added in 1993 as a VMS-friendly synonym.

Jon Willeke · Jul 17, 2017 go to post

Are you sure that this problem is due to endian? A byte stream does not in itself have a byte order; multi-byte data structures do, such as Unicode characters encoded as UTF-16. As for the signature itself, I would expect its encoding to be specified in a portable manner.

Is it possible that line endings are getting changed?

Jon Willeke · Aug 14, 2017 go to post

I notice two things:

  1. The C# ciphertext is 64 bytes, which is twice as long as I'd expect for a 31-byte input.
  2. In the first sixteen bytes of the C# ciphertext, alternating bytes are NUL.

I thought maybe C# is using UTF-16, but I I haven't managed to replicate its output using $zconvert with "UnicodeLittle" or "UnicodeBig".

Edit: the first sixteen bytes of the output appear to be the first eight bytes of the initialization vector converted to Base-64, then UTF-16.

Jon Willeke · Aug 14, 2017 go to post

"Escaped hex sequence too large" means that a hexadecimal escape sequence couldn't be decoded. I suspect that you've encountered a Unicode character that can't be handled on your eight-bit instance.

Jon Willeke · Aug 23, 2017 go to post

Tim's comment demonstrates that $get leaks an OREF when $this is used as a subscript of an array that doesn't exist. That's a bug.

An OREF as a number is unique within a process, so +$this is more compact, and potentially faster than ""_$this. You should never see, e.g., 1@foo and 1@bar at the same time.

Jon Willeke · Sep 11, 2017 go to post

If you're connecting to the local system, you don't need to use Telnet. Use the cn_ap option described in the link that Peter posted.

Jon Willeke · Dec 20, 2017 go to post

The main change for 10.11 (El Capitan) and 10.12 (Sierra) is that /usr/lib is not writable, due to System Integrity Protection (SIP). You'll have to put the ODBC modules into /usr/local, and tell php.ini where you put them; e.g.,

extension=/usr/local/lib/php/extensions/no-debug-non-zts-20131226/odbc.so
extension=/usr/local/lib/php/extensions/no-debug-non-zts-20131226/pdo_odbc.so