Robert Cemper · Dec 16, 2021 go to post

As your properties are NOT Calculated then there is a Storage Entry (check Storage section) 
they are persisted and not just there on run-time

  • copy the class including Storage Definition !!!
  • set class  Parameter MANAGEDEXTENT  = 0;  to allow access to original Globals
  • remove SqlCompute*  from the Properties LastModified*   ; to make it normal Properties
  • now write to these properties whatever you need to do by object access or SQL  
Robert Cemper · Dec 15, 2021 go to post

The SQL statement you pass is an ordinary string.
So with LongString enable it is about 3,4MB  and of course I have never tried to write so
much in a single string. That's boring and hard to type.
If you mean running long it's probably just useful on the command line or background.
an ordinary connection to over ODBC/JDBC or HTTP in browser will most likely time out. 
What type of LONG are you referring to ?

Robert Cemper · Dec 11, 2021 go to post

Watching the daily results of our private leaderboard I did some observations:

  • the number of registered participants has grown since start from 68 to 93, 82 no surprise with the published code
  • actually, only 33 participants have collected  points and stars
  • I downloaded the actual ranking as JSON file into a local table 
  • I could identify only 17  22 names from DC that I flagged DC for our ranking
  • if I missed you pls. let me know your identity in AoC by DC mail  to add your DC flag

Date:  2021-12-27 08:53:47 UTC

Rank    DC      stars   score   name
1       1       50      4087    Kevin An
2       1       50      4026    Yuval Golan
3       1       50      4056    rcemper     disqualified by using Embedded Python
4       1       50      3798    ISC Jacques HUSER
------------------------------------------------ all completed
5       1       41      2901    Bert Sarens
6       1       36      2825    Oliver Wilms
7       1       36      2689    dspools
8       1       36      2683    Ivo ver eecke
9       1       28      2060    Tim Leavitt
10      1       22      1775    Fabian
11      1       17      1273    rhodery
12      1       18      1265    Shamus Clifford
13      1       18      1230    CrashAvery
14      1       16      1149    TylerFeldhege
15      1       15      1147    Sergei Shutov (Banksia Global)
16      1       11      764     José Roberto Pereira Junior
17      1       9       599     jackpto
18      1       6       386     NjekTt
19      1       5       307     Stuart Byrne
20      1       4       267     goran7t
21      1       2       148     David Hockenbroch
22      1       2       116     Evgeny Shvarov
------------------------------------------------ DC members
23              50      4145    Steven Reiz
24              32      2584    Navæéd Ålæm
25              28      2271    Carter Bourette
26              11      804     jonasvandervennet
27              11      768     @leeto
28              8       548     Paul Langelaan
29              6       416     alex2008alex
30              1       57      maxisimo

Instead of a daily reply, I plan just to update this reply once a day

Robert Cemper · Dec 11, 2021 go to post

No problem:

  • download from wrc>previews some    .tar.gz
  • docker load -i <downloaded> ...
  • off it goes with  Docker run or Dockerfile + docker-compose
Robert Cemper · Dec 10, 2021 go to post

No brilliant idea yet:

  • disassemble the char.stream to lines in steps of 10 to PPG
  • insert new lines in between
  • reassemble the stream by $o() from PPG

not so impressive.

Robert Cemper · Dec 10, 2021 go to post

Sure!  very condensed

  • set cls=##class(%Dictionary.ClassDefinition).%OpenId("<pkg>.<classname>")
  • set met=cls.Methods.GetAt(1)  ; may need some search
  • set imp=met.Implementation   ; a GlobalChar.Stream
  • write imp,OutputToDevice()

or you jump to the Method directly

  • set met=##class(%Dictionary.MethodDefinition).%OpenId("<pkg>.<classname>||<methodname>")

And these classes have tons of params to set or clear by specific methods

Robert Cemper · Dec 4, 2021 go to post

I'm not so convinced that such a converter never existed.
Probably in past  ~20yrs+ back when the improved readable syntax
came in place at the beginning of the millennium.
And taking this time gap the engineers of such tools are
most likely not available anymore in whatever sense. 

Otherwise it is still working and used in system routines like
%R.int, %RI.int, %RIMF.int, %RO.int, %ROMFOLD.int, %ROU.int, %RSET.int, ....

Robert Cemper · Dec 3, 2021 go to post

You expect something rather impossible.
every temporary SQL query result, every Temp.Stream all PPG (^||glob  ) reside in CACHETEMP for all Namespaces and every process.
What you ask for would require ALL simultaneously running processes to remove their related contents.
I fact this means not just stopping all processes but forcing them to terminate.
in other words to shut down Caché   BTW. it's the same for IRIS.
 

Robert Cemper · Dec 1, 2021 go to post

this is just a placeholder to demonstrate the structure
GitHuB  doesn't allow empty directories

Robert Cemper · Dec 1, 2021 go to post

Judging: (from AoC)

Below is the Advent of Code 2021 overall leaderboard; these are the 100 users with the highest total score. Getting a star first is worth 100 points, second is 99, and so on down to 1 point at 100th place.

so you collect stars 

Robert Cemper · Nov 30, 2021 go to post

it is in row #12,
I write the name of the package and the title of my review(as a link)
and not every review goes immediately  to the monthly list if I'm still in doubts as it may change

Robert Cemper · Nov 30, 2021 go to post

what I understand from your description:

  • you have an input file with records (rows) with delimited fields (columns)
  • you expect to see this file as a table (like in Excel)
  • you expect to sort your rows by various columns
  • you expect to include/exclude rows by various criteria

This is all standard  SQL and fully included IRIS  (MUMPS was almost stone-age) 
The only question left is your input format as Excel has a proprietary format,
but reads many others as well (CSV, HTML, XML, ..??)
 

Robert Cemper · Nov 30, 2021 go to post

If you have a complex object, then add %JSON.Adaptor to the class,
and do an %JSONExportToStream as you did with %XML.Adapter

Robert Cemper · Nov 30, 2021 go to post

or simply

ClassMethod Login(ByRef streamReturn As %GlobalBinaryStream, user As %String, pass As %String) As %Status [ ProcedureBlock = 1 ]
{
 set streamReturn=##class(%GlobalBinaryStream).%New() set cswReturn="{""success"":1}"
 set sc=streamReturn.Write(cswReturn) quit sc
}
Robert Cemper · Nov 30, 2021 go to post

suggestion

ClassMethod Login(ByRef streamReturn As %GlobalBinaryStream, user As %String, pass As %String) As %Status [ ProcedureBlock = 1 ]
{
 set streamReturn=##class(%GlobalBinaryStream).%New()
 set cswReturn={}
 set cswReturn.success=1
 ;
 set format=##class(%JSON.Formatter).%New()
 set format.Indent=0
 set format.LineTerminator=""
 set sc=format.FormatToStreamFromObject(cswReturn,.streamReturn)  
 quit sc
}
Robert Cemper · Nov 30, 2021 go to post

I have to add a few personal remarks.
This issue of the monthly reviews is exceptional as there is no package rated below 5*
In that sense, you may feel it be a Christmas edition.  And that's true for me.
It points out that the quality of contributions has significantly improved.
And as I try every package myself  I find problems and sometimes solutions too,
that I post as Pull Request on GitHub.
Pls understand, if I place Pull Request it is meant as help, suggestion but never as critics.
Some of you have already consumed this support as a kind of field testing.
And I offer it again to you to improve the quality of your package also before publishing.
My resources at home are of course limited and connections to external systems are not available.
I don't have medical devices or a machine park at home.
In addition, I'd like to thank you for your trust and your examples.
And over time I learned a lot about Docker configurations and various tricks to run them.
And there are areas where I just have no expertise. I skip these subjects.
Finally.
You are an exceptional society and I enjoy again and again to work with you

Robert Cemper · Nov 29, 2021 go to post

case sensitivity of packages is an ongoing challenge.
top-level := developer is ok.
but who should use top-level dc ?
I ask because every template uses dc for the example packages. which is ok.
but users follow this example (often).   

Robert Cemper · Nov 28, 2021 go to post

this is the method description  it seems that you should your call parameters differently

method ExecuteProcedure(ByRef pResultSnapshots As %ListOfObjects,
        Output pOutputParms As %ListOfDataTypes,
        pQueryStatement As %String,
        pIO As %String,
        pInputParms...)
 as %Status [ Language = objectscript ]

The pOutputParms list returns the output values of all scalar output and input/output parameters.
This would result in this order

SET tSC = ..Adapter.ExecuteProcedure( , .outparmSQLQuery2 , "io*"pRequest.StringValue )

>> 1st par  - skipped
>> 2nd par = output byRef
>> 3rd par = SqlQuery
>> 4th par = io
>>par 5 ... query input parameters
 

This explains the log

Robert Cemper · Nov 28, 2021 go to post

pass outparm by reference    .outparm

  SET tSC = ..Adapter.ExecuteProcedure(,,SQLQuery2,"io*",pRequest.StringValue,.outparm )

Robert Cemper · Nov 28, 2021 go to post

intersystemsdc/irishealth-community:2021.1.0.215.3-zpm should do it
or simply the latest

docker run --name my-iris -d -p 9091:1972 -p 9092:52773 intersystemsdc/irishealth-community
Robert Cemper · Nov 26, 2021 go to post

BINGO! 
that''s the way to go.

I typically use from Terminal

>SET ^GO=0

and in code 

SET ^JOB($h)=$JOB FOR x=1:0 HANG 1 IF $GET(^GO) QUIT

and of course Studio to attach
or I use $system.CSP.Shell()  as described here
 

Robert Cemper · Nov 26, 2021 go to post

as official documentation tells you:
https://docs.intersystems.com/iris20211/csp/docbook/DocBook.UI.Page.cls?KEY=GSQL_langelements#GSQL_langelements_ops_precedence

 
USER>SET status=$SYSTEM.SQL.Util.SetOption("ANSIPrecedence",1,.oldval)
 
USER>do $system.SQL.Shell()
SQL Command Line Shell
---------------------------------------------------

[SQL]USER>>SELECT 1+2*3+4*5
1.      SELECT 1+2*3+4*5
Expression_1
27
^^^^-----------------------------------------------
[SQL]USER>>q
 
USER>SET status=$SYSTEM.SQL.Util.SetOption("ANSIPrecedence",0,.oldval)
 
USER>do $system.SQL.Shell()
SQL Command Line Shell
---------------------------------------------------
 
[SQL]USER>>SELECT 1+2*3+4*5
3.      SELECT 1+2*3+4*5
 
Expression_1
65 
^^^^----------------------------------------------
[SQL]USER>>

.

Robert Cemper · Nov 26, 2021 go to post

Even the possibility of changing this elementary rule after 60+years
has the power and the risk of breaking millions of lines of code worldwide.
It's for people like you that are not willing to accept these rules that
the introduction of Embedded Python is encouraged. 

With the same mindset,
you may demand to revert from Italian, French Spanish, Portuguese
to pure Latin as spoken by Cesar. Or for French to Occitan ?

Robert Cemper · Nov 26, 2021 go to post

Forget about the week  and put your long query into a subselect

SELECT Sum(Dicos),Sum(Gen),Sum(Philo),Sum(Religion), Sum(SHS), ....
FROM (
.... your long query
)