go to post Jon Willeke · Aug 9, 2017 For the most part, dynamic objects use local memory that is accounted for by $zstorage and $storage. However, some of it comes from other heap-allocated memory, similar to long strings. You can round trip a large JSON object through a dynamic object with %FromJSON()/%ToJSON(), even if an individual field exceeds the string limit. However, it is not currently possible to get the value of such a field within Caché. Note that you should call %ToJSON() such that it outputs to a device or writes to a stream: USER>d o.%ToJSON(stream) USER>d o.%ToJSON() Otherwise, you may get a STRINGSTACK error: USER>w o.%ToJSON() W o.%ToJSON() ^ <STRINGSTACK>
go to post Jon Willeke · Aug 4, 2017 Can you post some examples of input and expected output? Edit: here's an example from StackOverflow that gets the same output: USER>s (key,iv)="0123456789ABCDEF" USER>zzdump $system.Encryption.AESCBCEncrypt("1234567890",key,iv) 0000: 60 2C AE 14 35 8D 0A C5 C9 6E 2D 46 D1 7E 58 E3 https://stackoverflow.com/questions/28592989/aes-pkcs7-padding
go to post Jon Willeke · Jul 17, 2017 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?
go to post Jon Willeke · Jun 28, 2017 My research shows that "!" was added in 1992, inspired by MSM. "$" was added in 1993 as a VMS-friendly synonym.
go to post Jon Willeke · Jun 8, 2017 This method probably first shipped with Caché 4.0 in December 2000, but the oldest instance I have handy is Caché 4.0.4: USER>w $system.Version.GetMajor() 4
go to post Jon Willeke · Apr 20, 2017 "NWK" is not a good search term for three separate one-character parameters. You want the OPEN Mode Parameters section of the Sequential File I/O chapter of the Caché I/O Device Guide: http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...
go to post Jon Willeke · Mar 9, 2017 I don't really understand the question. It sounds like you're trying to convert from one eight-bit character set to another, but French generally uses the same character set as English, as far as I know. If you're using a Unicode instance of Caché, your first resort should be I/O translation: translate the input to Unicode, then translate on output to the desired character set. Doing it in COS is slower and less convenient. That said, here are some things in your code that don't really make sense: a."i"; should probably be a.%Get(i). a-128; maybe a.%Get(c-128)? I don't understand the purpose of the first loop or the return statements. value(j); ...? If I were to hazard a guess at rewriting this, my first try might be something like this: for i=1:1:$l(str) { s c=$e(str,i) if $a(c)<128) { w c } else { w $c(a.%Get($a(c)-128)) } }
go to post Jon Willeke · Feb 13, 2017 The instance is assigned a GUID that you can retrieve using the InstanceGUID() method of the %SYS.System class: USER>w ##class(%SYS.System).InstanceGUID() C74E6F76-F21F-11E6-9BB8-A860B607521C Databases are not assigned such an identifier.
go to post Jon Willeke · Jan 31, 2017 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?
go to post Jon Willeke · Jan 31, 2017 I can't reproduce this in a 2016.2 instance I have handy: USER>s filename="DKA0:[QD.CACHEJCWG2.MGR.USER]CACHE.DAT" USER>w $zf("GETFILE",filename,"UIC") [1,1] Can you get the output of $zu(56,2) after the error? Anything unusual about your filename?
go to post Jon Willeke · Jan 17, 2017 The CHUI routine editor is part of the FDBMS, which hasn't been a standard part of the product for a very long time. You could try the line editor with xecute ^%, but it's kind of painful, and I think it only supports .INT routines. I suggest using the editor of your choice with XML export files.
go to post Jon Willeke · Jan 9, 2017 Careful, you should pad each byte with a leading zero if necessary. Otherwise your output is missing five nibbles.
go to post Jon Willeke · Jan 9, 2017 I'm not sure I understand the objection to %VID. I've seen a few different recommendations on how best to use it, but I think it does what you want in the following example: select * from ( select top all * from Sample.Person order by DOB ) where %vid between 10 and 19 Regardless of the where or order by clause that you put in the sub-query, %VID refers to the position in the result set.
go to post Jon Willeke · Dec 5, 2016 To handle this in the general case, you would decompose the string, then strip out non-spacing marks. Unicode normalization has been requested previously, and will hopefully make it into the product at some point.
go to post Jon Willeke · Nov 2, 2016 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.
go to post Jon Willeke · Oct 14, 2016 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.
go to post Jon Willeke · Aug 26, 2016 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.
go to post Jon Willeke · Aug 23, 2016 $fromJSON(stream) works for me in 2016.1.0. What problem are you having?
go to post Jon Willeke · Jul 29, 2016 Greetings. Did you consult at InterSystems fifteen years ago? Long time no see. My favorite technique to keep myself and others honest is to test with random inputs. This gives rise to two challenges: generating the input, and verifying the output. The input obviously depends on the problem: string, number, list, etc. When it comes to output, I look for invariants: x*y=(y*x), sort(x)=sort(shuffle(x)), etc. I sometimes even write another version of the code under test to act as an oracle that's perhaps slower, or not as general. Caché has at least three ways to generate random numbers: $random(), $system.Encryption.GenCryptRand(), and the Basic Rnd() function. $random(n) returns a number from 0 to n-1, where n'>1E17. GenCryptRand(n) returns n bytes of cryptographically random data. You can convert it to a number using one of the $ascii() functions: $a($system.Encryption.GenCryptRand(1)) $zwa($system.Encryption.GenCryptRand(2)) $zla($system.Encryption.GenCryptRand(4)) $zqa($system.Encryption.GenCryptRand(8)) - may be negative Rnd() is interesting for a tester, because you can seed it with Randomize. If you don't use a seeded PRNG, you'll want to log your inputs somehow. It's frustrating to find a one in a billion bug, but not be able to reproduce it.