go to post Julius Kavay · Nov 12, 2022 You say "No punctuation". OK, but then we have a contradiction: Example 4 of the test cases contains several commas, a dot and a question mark...
go to post Julius Kavay · Nov 11, 2022 A small complaint:- possible word delimiters weren't specified (space, tab, etc.)- no specification about punctuation marks (allowed or disallowed)- no specification about empty words (allowed or disallowed) and how to handle them, if allowed So my question is, are the following examples legal or not: "O2K. I'1m" --> "I'm OK.""spac4es are2 1There ma3ny" --> "There are many spaces."
go to post Julius Kavay · Nov 10, 2022 Putting all in one line saves one byte ClassMethod Order(s As %String) As %String { s d=" ",z="" f i=1:1:$l(s,d){s b=$p(s,d,i),c=$zstrip(b,"*n"),$p(z,d,$tr(b,c))=c} q z } Changing $zstrip() to a $tr() saves one more byte ClassMethod Order(s As %String) As %String { s d=" ",z="" f i=1:1:$l(s,d){s b=$p(s,d,i),c=$tr(b,1E20/17),$p(z,d,$tr(b,c))=c} q z } So I end up with 86 bytes
go to post Julius Kavay · Nov 9, 2022 and this is an updated version ClassMethod Order(s as %String) As %String { s d=" ",z="" f i=1:1:$l(s,d) s b=$p(s,d,i),c=$zstrip(b,"*n"),$p(z,d,$tr(b,c))=c q z }
go to post Julius Kavay · Nov 9, 2022 I do not work with Ensemble nor do I have Ensemble installed... But you could take a close look on that Ens_Enterprise_MsgBank.MessageHeader class, and check, if there is a mapping into an other, possibly readonly, database. Maybe somebody with ENS experience has a solution for you
go to post Julius Kavay · Nov 9, 2022 As I learned the hard way, abstract classes do not have storage implementation, hence no indices either
go to post Julius Kavay · Nov 9, 2022 One of the possible solutions /// You can change the s:b]"" to an comma if there is always exact one space between the words /// and remove the ,1) from $lts() if all word are numbered from 1..N with no number missing ClassMethod WordOrder(s) { s z="" f i=1:1:$l(s," ") s b=$p(s," ",i) s:b]"" $li(z,$zstrip(b,"*ap"))=$zstrip(b,"*n") q $lts(z," ",1) } This is a working solution and maybe not the shortest
go to post Julius Kavay · Nov 8, 2022 I never had this kind of problem, but a quick and dirty method would be: 1) remove the 'Mount Read-only' flag, 2) run the tune table utility, 3) reenable the 'Mount Read-only flag'. I hope, you do not have some mean application, waiting for the chance of his life, to get a writable database...
go to post Julius Kavay · Nov 7, 2022 License counting depends on how you access Cache/IRIS (i.e. Web interface or some kind of client).
go to post Julius Kavay · Nov 7, 2022 You can it enter via terminal, no question about, but it's a little bit cumbersome // create the class s cls=##class(%Dictionary.ClassDefinition).%New() s cls.ProcedureBlock=1 s cls.Super="%RegisteredObject" s cls.Name="ObjectScript.RightTriangle" // add one method s mth=##class(%Dictionary.MethodDefinition).%New() s mth.Name="Main" s mth.Description="Compute area and hypotenuse of a right triangle" d mth.Implementation.WriteLine($c(9)_"write !,""Compute the area and hypotenuse of a right triangle"",") d mth.Implementation.Write($c(9,9)_"!,""given the lengths of its two sides.""") d cls.Methods.Insert(mth) // add one more method s mth=##class(%Dictionary.MethodDefinition).%New() s mth.Name="Area",mth.Description="Area, computed from sides 'a' and 'b'" s mth.FormalSpec="a,b" d mth.Implementation.WriteLine($c(9)_"quit a*b/2") d cls.Methods.Insert(mth) // save the class (it's NOT compiled!) w cls.%Save() As you may see, creating a class via an IDE is simpler... but yes, in an emergency case you can do it also via a console access