go to post Jon Willeke · Sep 30, 2019 If you've specified the language as "basic", then I would expect the Right() function to be available. Otherwise, for "objectscript", you'll want to use something like $extract(string,*-10,*). Edit: if there's some reason to prefer using the methods supplied by the wizard, you could also do something like this: ..SubString(string,..Length(string)-10)
go to post Jon Willeke · Sep 26, 2019 It looks like the issue tracker on the Github repository is active, so you could report it there: https://github.com/intersystems-community/openexchange/issues Alternatively, if we name check @Evgeny Shvarov (although I'm not entirely sure how to do that), he'll check it out when he gets back from Global Summit.
go to post Jon Willeke · Sep 26, 2019 It looks like the accented "é" is causing problems with the directory software. The UTF-8 encoding of \u00e9 is \xc3\xa9, which is URL encoded as %c3%a9, which has been URL encoded again as %25c3%25a9. Try this: https://openexchange.intersystems.com/package/Cach%C3%A9Quality My browser displays this as: https://openexchange.intersystems.com/package/CachéQuality
go to post Jon Willeke · Sep 6, 2019 Interesting. I added a loop for if $increment(num) {} (i.e., a new-style if statement that doesn't set $test): no measurable improvement over legacy if. I also added a loop for do $increment(num) (i.e., a do statement that neither sets $test nor returns a value): ever so slightly slower. USER>d ^Times(1,8) count num+1 1+num =$i() $i() $i(){} d $i() times in microseconds -------------------------------------------------------- 1 1.000 0.000 1.000 0.000 0.000 1.000 10 0.000 0.000 0.100 0.100 0.000 0.000 100 0.010 0.010 0.490 0.030 0.030 0.040 1000 0.042 0.011 0.029 0.034 0.029 0.033 10000 0.011 0.010 0.030 0.032 0.032 0.031 100000 0.009 0.010 0.030 0.028 0.027 0.031 1000000 0.009 0.010 0.028 0.028 0.027 0.031 10000000 0.010 0.010 0.028 0.028 0.028 0.031 Incidentally, here are some results with num renamed to ^num: USER>d ^Times(1,8) count num+1 1+num =$i() $i() $i(){} d $i() times in microseconds -------------------------------------------------------- 1 2.000 0.000 2.000 1.000 0.000 0.000 10 0.100 0.200 0.100 0.100 0.100 0.100 100 1.070 0.280 0.130 0.110 0.100 0.110 1000 0.142 0.144 0.142 0.102 0.102 0.106 10000 0.142 0.141 0.110 0.116 0.104 0.108 100000 0.142 0.141 0.102 0.101 0.100 0.104 1000000 0.139 0.140 0.100 0.098 0.100 0.102 10000000 0.138 0.138 0.098 0.098 0.099 0.102 For "=$i()", I assigned a local, rather than redundantly assigning the global.
go to post Jon Willeke · Sep 5, 2019 set count=count+1 and set count=1+count generate identical object code, so I think we found your margin of error. if $increment(count) has to set $test, so I would expect it to be slower for a local variable. (I'm not sure about a global.) In IRIS 2018.2 and later, do $increment(count) may close the gap a bit.
go to post Jon Willeke · Aug 29, 2019 There is a way to do something similar in Caché and IRIS. In a Russian locale, you have access to the "KOI8R" I/O translation table. KOI8-R has the funny property that if you mask out the high-order bit, you get a sort of readable transliteration. Here's an example using a Unicode instance in the "rusw" locale: USER>s koi8=$zcvt("Пример для Кода","O","KOI8R") USER>s ascii="" f i=1:1:$l(koi8) s ascii=ascii_$c($zb($a(koi8,i),127,1)) USER>zw ascii ascii="pRIMER DLQ kODA"
go to post Jon Willeke · Aug 23, 2019 When you're using subscript indirection with a recursive $order traversal, you may find the $name function useful; e.g., do ..RecursiveGlobalCount($na(@pGlobalName@(tKey)),"",.tCount) As the other answers suggest, you probably want $query instead of $order, but $order can be useful for summarizing on multiple subscript levels (e.g., count, min, and max per country, state, and city).
go to post Jon Willeke · Aug 21, 2019 It's documented here: https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?K... "The hashes are calculated using the PBKDF2 algorithm with the HMAC-SHA-1 pseudorandom function, as defined in Public Key Cryptography Standard #5 v2.1: 'Password-Based Cryptography Standard.' The current implementation uses 1024 iterations, 64 bits of salt, and generates 20 byte hash values."
go to post Jon Willeke · Jul 25, 2019 You can also change it after installation by running cinstall setserviceusername in the bin directory.
go to post Jon Willeke · Jul 10, 2019 It occurs to me that the Visual Basic solution works with minimal modification as Caché Basic: weaken the DIM statements, change Debug.Print to Print, and replace the call to Format$(). Option Explicit Const VECSIZE = 3350 Const BUFSIZE = 201 Dim buffer Dim vect Dim more, karray, num, k, l, n For n = 1 To VECSIZE vect(n) = 2 Next n For n = 1 To BUFSIZE karray = 0 For l = VECSIZE To 1 Step -1 num = 100000 * vect(l) + karray * l karray = num \ (2 * l - 1) vect(l) = num - karray * (2 * l - 1) Next l k = karray \ 100000 buffer(n) = more + k more = karray - k * 100000 Next n Print buffer(1) Print "." l = 0 For n = 2 To BUFSIZE Print Right("00000" & buffer(n), 5) l = l + 1 If l = 10 Then l = 0 Print 'line feed End If Next n
go to post Jon Willeke · Jul 9, 2019 I would look at the implementations that do not depend on a "big number" package. Java and C# use BigInteger; Python uses long; Ada, C, and others use GMP; etc. You might try porting the Pascal implementation to ObjectScript. Where you see div, use the "\" operator, and be aware of operator precedence.
go to post Jon Willeke · Jun 17, 2019 Unfortunately, deployment of the Hibernate dialect for InterSystems IRIS is still a bit of a work in progress: https://irisdocs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page... There's an old dialect for Caché in the Hibernate distribution itself, but the IRIS dialect lives in a handful of files that you can get from the WRC.
go to post Jon Willeke · Jun 14, 2019 Interesting question. I think the idea is that the output is not just a number, but the second field of a $horolog/$ztimestamp string, where the convention is to include the leading zero if necessary. If you repeat the experiment with $zdth, or you catch the value of $zts just after midnight UTC, you should see a zero after the comma.
go to post Jon Willeke · May 9, 2019 The %SYSTEM.SQL::Execute() method returns an %SQL.StatementResult object. I'm not that familiar with the iris.node module, but it appears that invoke_classmethod() does not return an object that you can pass to invoke_method() or get_property(). However, it seems that you can fake it by copying the "result" field into a new object as "oref": > result = data.invoke_classmethod({class: '%SYSTEM.SQL', method: 'Execute', arguments: ['select 1']}) { ok: 1, class: '%SYSTEM.SQL', method: 'Execute', arguments: [ 'select 1' ], result: '12' } > data.get_property(result, '%SQLCODE') Error: No object reference provided > o = {oref: result.result} { oref: '12' } > data.get_property(o, '%SQLCODE') { ok: 1, oref: 12, property: '%SQLCODE', value: '0' } > data.invoke_method(o, '%GetData', 1) { ok: 1, oref: 12, method: '%GetData', result: '1' }
go to post Jon Willeke · May 8, 2019 The main thing I can suggest is to verify that the client and server agree on the encoding. It's been years since I've used Reflection; hopefully it supports UTF-8. Check your settings and/or documentation. When you're in a Caché session, look at the value of the $zmode special variable: USER>w $zm RY\Latin1\K\UTF8\ I'm not sure offhand what determines the default I/O translation table for a terminal, but if you see "RAW" instead of "UTF8", you can set it manually: USER>u 0:(/IOT="UTF8") USER>w $zm RY\Latin1\K\UTF8\
go to post Jon Willeke · Apr 19, 2019 $toJSON() escaped forward slash unnecessarily in 2016.1. It's valid JSON, but unconventional. %ToJSON() doesn't do this in 2016.2 and later. Depending on your data, you may be able to get away with $replace(json,"\/","/"). To handle all cases would be a bit more work.
go to post Jon Willeke · Apr 12, 2019 I thought there was a method to do just this in the TestInstance class, but it's actually in %UnitTest.Portal package: USER>w ##class(%UnitTest.Portal.standardPage).GetTestStatus(^UnitTest.Result) 0 Up to you if you want to depend on an implementation detail of the portal. It is a public method that's been there since 2012.
go to post Jon Willeke · Apr 9, 2019 So the input is Windows-1252, and the output is Windows-1252 in which certain characters are mapped to their numerical escape sequence? You could do this with XSLT 2.0 using character maps. Given this input (presented here as UTF-8 for visibility on the forum): <?xml version="1.0"?> <Recordset> • coffee €5,• tea €4 </Recordset> This stylesheet will escape the bullets and euro signs: <?xml version="1.0"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:character-map name="a"> <xsl:output-character character="€" string="&#128;"/> <xsl:output-character character="•" string="&#149;"/> </xsl:character-map> <xsl:output encoding="Windows-1252" indent="yes" use-character-maps="a"/> <xsl:template match="/"> <Recordset> <xsl:value-of select="/Recordset"/> </Recordset> </xsl:template> </xsl:stylesheet> Output: <?xml version="1.0" encoding="Windows-1252"?> <Recordset> • coffee €5,• tea €4 </Recordset>
go to post Jon Willeke · Apr 9, 2019 My hunch is that XSLT is not the right tool for the job, but it's not clear to me what you're trying to do. What is the input encoding, what is the desired output encoding, and what do you mean by non-standard characters? Are these characters that don't exist in the output encoding?
go to post Jon Willeke · Apr 2, 2019 This post about the %SyntaxColor class might be useful as a starting point: https://community.intersystems.com/post/syntax-highlighting-objectscript It wouldn't integrate seamlessly with the LaTeX toolchain, but you could probably transform its output into something usable.