Robert Cemper · Aug 11, 2021 go to post

Thanks a lot @Nigel Salm !
This matches my expectations I have from "Robotics".
Some solutions, that are used in real life.
Robots running around, serving tea, playing chess or tic-tac-toe  running on 2 or 4 feet or barking and singing are just toys to me. Nice for kids, nice for movies but totally useless in real life. Just a mimic copying humans or pets.

Robert Cemper · Aug 6, 2021 go to post

Class Documentation of %Library.RoutineIndex tells me:
property Type as %String [ Required ];

The type of routine, this will be one of:

  • MAC - Macro routine, content is stored in ^rMAC global
  • INT - ObjectScript routine, content is stored in ^ROUTINE global
  • INC - Include file, these may be included from a MAC routine, content is stored in ^rINC
  • BAS - Cache Basic routine, content is stored in the ^ROUTINE global
  • MVB - MultiValue Basic routine, content is stored in the ^ROUTINE global
  • OBJ - Object code, content is stored in ^rOBJ global

Class Documentation of %Library.Routine explains the storage and  tells me: 
• classMethode GetRoutineGlobals(ByRef Names As %String) as %Status

Return list of globals where routine and class information is stored.
Returns Names="ROUTINE,rBACKUP,rINC,rINCSAVE,rINDEX,rMAC,rMACSAVE,rMAP,rOBJ,oddDEF"
Here is some documentation on the format of the routine globals. ROUTINE - Native .INT COS code, generated from .MAC, or generated from classes. When compiled generates .OBJ code.
ROUTINE(Name,0)=timestamp when last saved
ROUTINE(Name,0,0)=# lines in routine
ROUTINE(Name,0,1...x) = Source Lines in routine
ROUTINE(Name,0,"GENERATED")= 0/1 whether routine is generated or native
ROUTINE(Name,0,"INC",IncludeFileName1)=Timestamp when last include file last saved
ROUTINE(Name,0,"INC",IncludeFileName2)=Timestamp when last include file last saved
ROUTINE(Name,0,"SIZE")=# bytes in routine
ROUTINE(Name,0,"LANG")=language mode ROUTINE(Name,"MAC")=Timestamp of .MAC code when last saved if generated
rBACKUP(Name,Type,version) - backup of ^ROUTINE, created by the command Merge ^rBACKUP(rtn,type,nextverersion)=^ROUTINE(rtn) where type="INT/MVI/BAS" rINC - Native .INT or macro code, compiled into .MAC when included with #include directive
rINC(Name,0)=timestamp when last saved
rINC(Name,0,0)=# lines in include file
rINC(Name,0,1...x) = Source Lines in include file
rINC(Name,0,"SIZE")=# bytes in include file
rINC("ZZ","P") - Meta data used for precompiling include files rINCSAVE - Backup of ^rINC, created by the command Merge ^rINCSAVE(rtn,nextver)=^rINC(rtn,0) rINDEX - Index of .OBJ, .INT, and .MAC routines
rINDEX(Name,"OBJ/MAC/INC")=$lb(Time compiled,Size)
rINDEX(Name,"INT")=$lb(Time compiled,Size,Generated 0/1) rMAC - Native .MAC Macro code which when compiled generates .INT code
rMAC(Name,0)=Timestamp when last saved
rMAC(Name,0,0)=#lines in routine
rMAC(Name,0,1...x) = Source Lines in routine
rMAC(Name,0,"SIZE")=# bytes in routine rMACSAVE(Name,Type,version) - backup of ^rMAC, created by the command Merge ^rMACSAVE(rtn,nextver)=^rMAC(rtn,0) rMAP - Debug map used by the debugger and for error trapping
rMAP(Name,"INT","MAC",offsets)=$lb(debuginfo)
rMAP(Name,"MAC","INT",offsets)=$lb(debuginfo) rOBJ - Compiled .INT code
rOBJ(Name,"INT")=timestamp of .INT code when compiled
rOBJ(Name,0...n)=Compiled object code oddDEF - Source code for classes
oddDEF($zcvt(Name,"U"),....)=source code from class. Note that all of the other odd* nodes are meta data describing the class, and can be recreated by compiling the class. The rINDEXCLASS and rINDEXSQL nodes also get recreated when compiling the class.

so you may either do a query or just look into the globals directly
the sequence MAC        -> INT           -> OBJ      is
equivalent to modified -> modified - > compiled

Robert Cemper · Aug 6, 2021 go to post

No doubt, that it is a great environment for what I classify as ARTISTS.
But consider the maintenance of such ARTWORK.
It is a painful to impossible exercise to find and educate someone to replace a lost ARTIST.
Think of the masterpieces of the Italian Renaissance whether in sculpture or in painting.
We just don't understand the incredible technique they used.
Most famous case: Leonardo Da Vinci's "Last Supper" in Milan.
It is broken and just a shadow is left. Up to now, nobody was able to fix it in an acceptable way

Robert Cemper · Aug 5, 2021 go to post

except if  ...   As %String(COLLATION = "EXACT");

But rebuild of indices is still a must or good practice

Robert Cemper · Aug 3, 2021 go to post

Thanks for the DOWN VOTE, anonymous voter.
It confirms my initial suspicion that someone may dislike my projection of future

Robert Cemper · Jul 31, 2021 go to post

That's in fact happening by separating Globals-DB from Routine-DB in the namespace definition.
Those globals are visible in any DB but they are used only for RoutineDB with a kind of implicit routine mapping.  (ages old and implemented shortly after "Big Bang") 
Once the Routine-DB is clean and isolated just copy the full DB 
or use $system.OBJ.Export(....)

As example of this implicit mapping a view of my ^ROUTINE in namespace DEMO

Robert Cemper · Jul 30, 2021 go to post

create a new DB and list all 32 system elements in DB view
ROUTINE => .int
odd* => obj stuff, and all r* for various others

Robert Cemper · Jul 29, 2021 go to post

I'd suggest GBLOCKCOPY as it operates @ DB level and doesn't care about namespace 

Robert Cemper · Jul 23, 2021 go to post

still another variant that I would prefer

set str=""
for ... {
  set str=str_myval_","
}
set
str=$e(str,1,*-1)

And BTW: $ZH is much easier to handle than $now()

Robert Cemper · Jul 23, 2021 go to post

I don't think ObjectScript might be lost.
It will just fade out of applications development into "specials".
Though the question. "Why to write applications INSIDE a DB environment at all?"
still remains open and unanswered.

Robert Cemper · Jul 23, 2021 go to post

Thank you @Alexey Maslov !
This sequence is the best illustration I could wish of "the priests know what to do"
It's nothing that the average developer of a business application needs.
 

Robert Cemper · Jul 22, 2021 go to post

%Library.Date and %Library.Time are both DataType classes typically used to define Properties.
The values are stored as integers according to $HOROLOG format
They have its MINVAL and MAXVAL as any other numeric data type

Robert Cemper · Jul 21, 2021 go to post

Thank you @Herman Slagman !
I like your suggestion and would fully support it if ISC would take that turn.
You mentioned ignorance and you are right. I'm full with you.
Though I still see another more dangerous hurdle to pass:
Understanding the concept. Applying the concept. Teaching the concept.
I just fear there might not be enough qualified developers available to execute it.
Seeing the actual situation on my side of the globe I wouldn't expect to find enough experts.  

Robert Cemper · Jul 21, 2021 go to post
  1. Whatever you do it affects the operational machine as you have to read through the whole Table/Global
  2. For Table it can be a simple SELECT * FROM TABLE  with the option to select columns of interest
  3. For Global  use $system.OBJ.Export(<globalname>.GBL,<filename>)  as XML.

 Of course, if you have a Shadow instance of your operational machine you can do it there and avoid the load on the primary machine.
Eventually, you can run there all analyses without export at all.

Robert Cemper · Jul 20, 2021 go to post

I don't have a real favorite.

- for similar changes in multiple records, I use SQL in SMP, rarely also $system.SQL.Shell() from terminal
- for single changes, I use Global Edit in SMP and direct access in terminal equally
- for special objects I often write my class related customized edit method

Robert Cemper · Jul 19, 2021 go to post

Thanks for the input. (I was waiting for it)
If someone goes for speed I'd suggest  C or Assembly Language That's where ultimate speed lives.
As long as speed is available in the cloud for a few $$$ more. It's only interesting by principles not in reality.
The key  - in my opinion - is to break the chains of a rarely known scripting language compared to others.

Robert Cemper · Jul 18, 2021 go to post

On what operating system do you run this repo ?
Your ERROR message looks like coming from Windows [backslash] (No directory \home\....)
BUT the whole code seems to be written just for Linux/ Docker images

It is nowhere mentioned as a prerequisite. Might be implicit to.
>>>     "you’ll need the InterSystems Sandbox" 
I never heard of, never used it.

Robert Cemper · Jul 16, 2021 go to post

to get a clearer picture of the requirements it is essential to understand
how the connection operates:

  1. connection is established and messages are exchanged leaving the connection open
  2. connection is established, the message is sent, the connection is closed

It's evident that the behaviors are different  on both ends 
for #1 you start with a Listener and keep it cyclic reading, eventually writing

for #2 you open the listener, receive something and close it
to send your message you need an open - write - close cycle.
both are possible but you have to know what your opponent expects and how it reacts.

The whole requirement is rather archaic. Sounds like a webserver without HTTP.
REST would be the better approach.

Finally, you may consider outplacing the whole connection management to Node.js
which is far better suited for such exercises. Eg: wrap incoming stream into REST 
 

Robert Cemper · Jul 13, 2021 go to post

put it into %ZLANGC00 as ZY

and just have 

ClassMethod ToNato(t)   {
  ZY
} 
Robert Cemper · Jul 12, 2021 go to post

leaving aside that there are  evident typing errors that break the code
your reply underlines that the criteria: "Shortest answer wins!"
misses the precise definition of what is measured.
There is not much chance to be shorter than "x x q o"  (= 7 char)

Robert Cemper · Jul 10, 2021 go to post

Out of curiosity, I checked the size of the underlying OBJ code:
> object size = 380  (+47% !)  + timestamp = 18

So the expected gain is not what you would assume at first sight.
For the  price of an almost unreadable code