User bio
404 bio not found
Member since Jul 25, 2017
Posts:
Replies:

Why do you need an AI for those questions?

4) and 5) I'm pretty sure, both questions were already answered by the creators of MUMPS back in the 60es, without AI

ClassMethod MAX(a,b,c,d)
{
  quit $$max($$max(a,b),$$max(c,d))

max(x,y) quit $s(x>y:x,1:y)
}

/// Compare alphanumeric data
/// OUT: a<b --> -1
///      a=b -->  0
///      a>b -->  1
ClassMethod AlphaCompare(a,b)
{
  quit $s(a=b:0, a]b:1, 1:-1)
}

6) CPU for this process - What do you mean by that?
  a) on a multicore CPU, you ask for the core number for your process?
     If yes, I think, you won't get that number, because
     usually, a process runs on the same core, the emphasis is on "usually" but the OS may shift a process, according to load, to another  core.
     If you could have a code like:
     set currentCore=$$GetTheCurrentCore($j)
     write "Current core: ",currentCore,!
     in the next point of time that information could be wrong
     
  b) do $system.CPU.Dump()
     gives you an info about the CPU, your proces runs on
  
  c) write ##class(%SYS.ProcessQuery).GetCPUTime()
     gives you two CPU-times, system- and user-time in milliseconds
 

Tipp #10 gives us plenty of opportunity for discussions like 
a) may that %DynArray have an embedded %DynArrays [1, 2, ["a", "b"], 4, 5]
b) may an element contain a comma                                [1, 2, "a,b", 4]
etc.

instead of the original solution: Set str = $TRANSLATE(jsonArray.%ToJSON(), "[]") 
I would use a more accurate way : set str = $e(jsonArray.%ToJSON(),2,*-1)

That's neither a trick nor a feature but an intended behavoir (for what feels like 100 years).
Each unique index over one or more table columns can be used to open that object just by using the column(s) from that index.

class DC.Example2 Extends %Persistent { 
Property Column1 As %String; 
Property Column2 As %String; 
Property Column3 As %String; 
Property Column4 As %String; 
    
Index one On Column1 [Unique]; 
Index two On (Column2,Column3) [Unique]; 
} 

set obj=##class(DC.Example2).oneOpen(colValue1)   // default lock, or 
set obj=##class(DC.Example2).oneOpen(colValue1,0) // without lock 
if (obj) { write obj.%Id() } else { write "Record does not exist or the index one is corrupted" } 

set obj=##class(DC.Example2).twoOpen(colValue2,colValue3)   // default lock, or 
set obj=##class(DC.Example2).twoOpen(colValue2,colValue3,0) // without lock 
if (obj) { write obj.%Id() } else { write "Record does not exist or the index two is corrupted" } 
Certifications & Credly badges:
Julius has no Certifications & Credly badges yet.
Followers:
Following:
Julius has not followed anybody yet.