go to post Vitaliy Serdtsev · Dec 18 ClassMethod Stream2BytesArray(stream As %Stream.Object) As %SYS.Python { set builtin = $SYSTEM.Python.Builtins() set b = builtin.bytearray() do stream.Rewind() while 'stream.AtEnd { set r = $system.Python.Bytes(stream.Read($$$MaxLocalLength)) do b.extend(r) } quit b }
go to post Vitaliy Serdtsev · Dec 3 Here you can find version 3.10.2: https://repo.maven.apache.org/maven2/com/intersystems/intersystems-jdbc/
go to post Vitaliy Serdtsev · Nov 15 Parallel Query Processing Ignored Parallel Query Processing for a Specific Query And don't forget about AutoParallelThreshold
go to post Vitaliy Serdtsev · Oct 11 I checked on the version "IRIS 2024.2CE for Windows" - the file is deleted from the SOURCFILE. Maybe it's about the access rights to delete? Check it out: Step 6: Determine Owners and Groups UNIX® Users, Groups and Permissions
go to post Vitaliy Serdtsev · Oct 11 It seems to me that in this case it would be advisable to use a comparison of stream hashes, using, for example, the SHA3HashStream method.
go to post Vitaliy Serdtsev · Aug 15 XData block (MimeType) The default is text/xml Encoding Translation Try this: XData Script { <script type="text/javascript"> var v1=1; var v2=2; function Colors() { if (v1=1&&v2=2) { alert('&<>"'); } } </script> }
go to post Vitaliy Serdtsev · Aug 14 size = 59 (does not depend on the "k" flag) ClassMethod ascii() { f i=32:1:126 w:^oddDEF($this,"m","ascii",30,1)'[$c(i) *i } size = 76 (+without the "for" loop) ClassMethod ascii() { w $tr(##class(%Net.SMTP).#PrintableAscii,^oddDEF($this,"m","ascii",30,1)) }
go to post Vitaliy Serdtsev · Aug 9 Judging by this code, I probably did not fully understand the conditions of the task. So: the source code of the method = " f i=0,27,0:1:94 d %code.Write($c(i+32)) ", size = 42 the following characters are not found in the source code of the method: !"#&'*-/568;<>?@ABCDEFGHIJKLMNOPQRSTUVXYZ[\]^_`abghjklmnpqsuvwxyz{|}~ the method should print the characters from point 2 I did not find it in the task conditions [CodeMode = objectgenerator] Where did I go wrong?
go to post Vitaliy Serdtsev · Aug 9 I would like to draw your attention to a number of points: this code will work correctly only when the compilation flag "k" is enabled, otherwise $TEXT will not return anything. k - Keep source. When this flag is set, source code of generated routines will be kept. this code will not work correctly in Caché, because there the label name will be "zascii", non "ascii" if you look at the generated INT code, you can see the "}" character at the end, which will return $t(ascii+1), which will lead to an incorrect result ascii() methodimpl { f i=32:1:126 w:$t(ascii+1)'[$c(i) *i }
go to post Vitaliy Serdtsev · Jul 1 In addition to the above: Dynamic SQL Using Older Result Set Classes
go to post Vitaliy Serdtsev · Jun 27 Also take a look at the event logging capability at the CSP-Gateway level: Event Logging Parameters
go to post Vitaliy Serdtsev · Jun 26 The terminal output in a log file is in Unicode UTF8 format and for further log processing Ansible is not able to read the format. What error does Ansible give you? I'm not familiar with Ansible, but it seems to me that it shouldn't have any problems reading UTF-8: https://github.com/NixOS/nixpkgs/issues/223151#issuecomment-1484053350
go to post Vitaliy Serdtsev · Jun 26 Hi! You need first convert the formatted date and time string to a standard timestamp. Unfortunately, the built-in TO_TIMESTAMP function is not suitable for your case. Next, you need determine whether the time zone will be taken into account or not. For tests, you can use https://www.timestamp-converter.com / (ISO 8601 section). Here is a small example: Class dc.test Extends %RegisteredObject { ClassMethod ISO2TS( strISO As %String, withTZ As %Boolean = 0) As %TimeStamp [ SqlProc ] { s tsUTC=##class(%TimeStamp).XSDToLogical(strISO) q $s(withTZ:##class(%UTC).ConvertUTCtoLocal(tsUTC),1:tsUTC) } ClassMethod Test() { f s="2024-06-23T06:03:00Z","2024-06-23T06:03:00-02:45" { s iso=s, utc=##class(%TimeStamp).XSDToLogical(iso), tz=##class(%UTC).ConvertUTCtoLocal(utc) w $$$FormatText("ISO 8601 = %2%1Date Time (UTC) = %3%1Date Time (your time zone) = %4%1",$$$NL,iso,utc,tz),! } } }Result (for me): USER>d ##class(dc.test).Test() ISO 8601 = 2024-06-23T06:03:00Z Date Time (UTC) = 2024-06-23 06:03:00 Date Time (your time zone) = 2024-06-23 09:03:00.000 ISO 8601 = 2024-06-23T06:03:00-02:45 Date Time (UTC) = 2024-06-23 08:48:00 Date Time (your time zone) = 2024-06-23 11:48:00.000 Using via SQL: SELECT YEAR(ts) "YEAR", MONTH(ts) "MONTH", DAY(ts) "DAY", {fn HOUR(ts)} "HOUR", {fn MINUTE(ts)} "MINUTE", {fn SECOND(ts)} "SECOND" FROM (SELECT dc.test_ISO2TS('2024-06-23T06:03:00Z',0) ts)
go to post Vitaliy Serdtsev · Jun 24 See "Customizing the Terminal Application": Network Encoding Physical Character Setting
go to post Vitaliy Serdtsev · Jun 24 Try this example Class User.myclass Extends %Persistent { Property myVECTOR As %Vector(CAPTION = "Vector", DATATYPE = "INTEGER"); Property myProperty As %String(MAXLEN = 40) [ Required ]; ClassMethod GetEmbedding1(sentences As %String) As %String { q "2,4,6,8" } ClassMethod GetEmbedding2(sentences As %String) As %DynamicObject { q [1,3,5,7,9] } ClassMethod Test() { d ..%KillExtent() set data=##class(User.myclass).%New() set data.myProperty ="anything 1" set data.myVECTOR=##class(User.myclass).myVECTORDisplayToLogical(##class(User.myclass).GetEmbedding1("this is my text")) d $system.OBJ.DisplayError(data.%Save()) ; OR set data=..%New() set data.myProperty ="anything 2" set data.myVECTOR=data.myVECTORDisplayToLogical(..GetEmbedding2("this is my text")) d $system.OBJ.DisplayError(data.%Save()) zw ^User.myclassD } } USER>d ##class(User.myclass).Test() ^User.myclassD=2 ^User.myclassD(1)=$lb("",{"type":"integer", "count":4, "length":4, "vector":[2,4,6,8]} ; <VECTOR>,"anything 1") ^User.myclassD(2)=$lb("",{"type":"integer", "count":5, "length":5, "vector":[1,3,5,7,9]} ; <VECTOR>,"anything 2")
go to post Vitaliy Serdtsev · Jun 6 SELECT LIST(Diagnose) FROM (SELECT TOP ALL MRDIA_ICDCode_DR->MRCID_Desc Diagnose FROM SQLUser.MR_Diagnos WHERE MRDIA_MRADM_ParRef=123456789 ORDER BY MRDIA_DiagnosisType_DR ASC)
go to post Vitaliy Serdtsev · May 28 Regional preferences have nothing to do with it. From the conditions of the task it is unclear how many mouths, noses and eyes are allowed in one emoticon (based on physiology one at a time (we do not count pathologies)): ")", "))", ")D", ")))", "xD", "xDD"
go to post Vitaliy Serdtsev · May 27 Additional explanations are required. It is not entirely clear from the description whether one smiling mouth is acceptable, for example ")", "D", etc., and also why "))" is a valid smiley face.
go to post Vitaliy Serdtsev · May 15 How would you like to solve it, using ObjectScript? For example, like this: ClassMethod Test() { s C = 2500, r = 0.5, S = 3000000, T = 35, W = 5 w $$maxWeddingCost(C, r, S, T, W),! ; => 93278.3281405256664 s S = 2000000 w $$maxWeddingCost(C, r, S, T, W),! ; => 174425.0762746580325 maxWeddingCost(C,r,S,T,W) s r=r/100,a=1+r**12,b=a**(T-W) q a**W-1/r*C+$$LEAST^%qarfunc(0,b-1/r*C-S/b) }