Congratulations to the participants and winners. Special BIG THANKS to the organizers and administrators of this contest. 💐🏵🌷🌻🌹 I'm really proud to see how this community has grown and raised in quality.
do ^ADMIN indicates that you run a classic straight ObjectScript program. while WRITE just has 1 direction to act READ is bi-directional. READ can send some text as prompt and waits for reply. The only bi-directinal device I know of are network connections as TCP, UDP, TRM,FTP,.. The common feature is : they communicate out of your IRIS instance.
Inside IRIS you may do a redirection e.g to some TCP port like |TCP|7000 but then this port is blocked. No other process can touch |TCP|7000. So you need an external port wrapper to some other port. e.g. |TCP|7100
Then you can handle this bi-directional communication either by sequence or you have a list of prompts and the expected replies or similar.
The sequence of operation could then be:
have a STARTER that runs in background
initiate the external wrapper
run do ^ADMIN
start the FOREGROUND
connect to external wrapper
send prompts to terminal
get replies from external file
send it back to port
which forwards it to ^ADMIN hanging in background
The most tricky point is to handle situations where the communication if it is not just 1 Prompt :=> 1 Answer but multiple Prompts or WRITEs :=>1 Answer or 1 Prompt :=> multiple Answers.
So I'd suggest instead of an IRIS internal solution rather look for an external Terminal program to consume and apply your answer script.
I see a general problem in interpretation of the "spiral" so I took some drawing for aquadratíc and a rectangular matrix.
depending on the starting point you have to take a pre-designed direction
if you hit the diagonal you have to turn right
you have to invalidate the row/column you just were on
proceeding to invalid points is not allowed.
start a the central point is an immediate termination as it has no direction to proceed
The diagonal came to my mind thinking how to NOT increase the imaginative radius of the spiral. The related subscripts for the diagonale points of an n*m are found as (-n/2+x,-m/2+y) The pink subscripts are obviously (n/2,m/2) and might be just virtual.
As subscripts start with 1 and first piece position is also 1 some more adjustment of coordinates is required
Just at a 2nd view also N=3 has that problem. StarMiddleTop (1,2) has the same Problem as MiddleRight (2,3) Not all characters of the matrix show up in the result. it shows DEFGHABIbut DEFGHABC looks similar correct according to published rules Is this expected behavior?
The clockwise logic is simple for a 3*3 matrix though starting with 4*4 there is some rule missing on how the handle a dead end Starting at a corner (1,1) or similar is trivial. BUT: starting at any other point may create a rathole or miss some boxes
Start (1,1) is in the example but Start (1,2) runs ODEGOLFISMU what is the next to (2,1) ? (1,1) or (2,2) or ?? worse with Start(2,2) already the first according to description could be up (1,2) or right (2,3) or left (2,1) leaving dead ends clockwise. And this is only with N=4 larger grids may create multiple lost cells. Clockwise spiral is just not detailed enough for a UNIQUE result to collect ALL cells A rule how to handle / skip already consumed cells might improve. Just as I type a non straight spiral solution to (2,2) consuming the full matrix might be CUISMUCODEGOLFFH I fail to imagine grids >5*5
Microsoft Windows does not come with a default version of Python, and as of InterSystems IRIS 2024.2, the InterSystems IRIS installer for Windows no longer installs Python for you.
go to post
Congratulations to the participants and winners.
Special BIG THANKS to the organizers and administrators of this contest. 💐🏵🌷🌻🌹
I'm really proud to see how this community has grown and raised in quality.
go to post
do ^ADMIN indicates that you run a classic straight ObjectScript program.
while WRITE just has 1 direction to act READ is bi-directional.
READ can send some text as prompt and waits for reply.
The only bi-directinal device I know of are network connections as TCP, UDP, TRM,FTP,..
The common feature is : they communicate out of your IRIS instance.
Inside IRIS you may do a redirection e.g to some TCP port like |TCP|7000
but then this port is blocked. No other process can touch |TCP|7000.
So you need an external port wrapper to some other port. e.g. |TCP|7100
Then you can handle this bi-directional communication either by sequence
or you have a list of prompts and the expected replies or similar.
The sequence of operation could then be:
The most tricky point is to handle situations where the communication
if it is not just 1 Prompt :=> 1 Answer but
multiple Prompts or WRITEs :=>1 Answer or 1 Prompt :=> multiple Answers.
So I'd suggest instead of an IRIS internal solution rather look for an
external Terminal program to consume and apply your answer script.
go to post
check if your lines start with the labels or if you have some leading <blank> or <tab>
if so it is interpreted as function call instead of a label
go to post
slightly shorter using Julian Date
USER>set hours=-3 write $zdt($zdth(hours*3600+$zdt($h,-2),-2))
Sorry, I just couldn't resist
go to post
From Ensemble.inc:
#define TRACE(%arg) $$$catTRACE("user",%arg) #define sysTRACE(%arg) $$$catTRACE("system",%arg) #define catTRACE(%cat,%arg) Do:$$$DoTrace ##class(Ens.Util.Trace).WriteTrace(%cat,$$$CurrentClass,$$$CurrentMethod,%arg) #; #define DoTrace $S($D($$$EnsJobLocal("DoTrace")):$$$EnsJobLocal("DoTrace"),1:##class(Ens.Util.Trace).DoTrace()) #; #define EnsJobLocal %Ensemble #; . . . . Class Ens.Util.Trace [ Abstract, ClassType = "", ProcedureBlock, System = 4 ] { ClassMethod DoTrace() { Set tJobConfigName=$$$JobConfigName Quit $G($$$ConfigTrace(tJobConfigName),0)||(""'=$G($$$JobTraceDevice))||$$$IsTerminalDevice($IO) }
go to post
Never tried it for long time , but $system.CSP.Shell() might be a starting point
$system.CSP.* seems to have some more useful methods.
go to post
I followed this rules with (1,1) as base
Starting any other point than (1,1) simply shortens the spiral.
now I reached 259
I really dislike the result as it is composed so unfriendly
just to save same bytes that nobody asked for.
go to post
I see a general problem in interpretation of the "spiral".png)
so I took some drawing for aquadratíc and a rectangular matrix.
The diagonal came to my mind thinking how to NOT increase the imaginative radius of the spiral.
The related subscripts for the diagonale points of an n*m are found as (-n/2+x,-m/2+y)
The pink subscripts are obviously (n/2,m/2) and might be just virtual.
As subscripts start with 1 and first piece position is also 1
some more adjustment of coordinates is required
I haven't written any useful line yet.
go to post
DC search; Improve selectivity of Articles and Questions by using TAGS
https://ideas.intersystems.com/ideas/DPI-I-630
go to post
Very elegant !👍
go to post
Just at a 2nd view also N=3 has that problem.
StarMiddleTop (1,2) has the same Problem as MiddleRight (2,3)
Not all characters of the matrix show up in the result.
it shows DEFGHABI but DEFGHABC looks similar correct according to published rules
Is this expected behavior?
2cents more
go to post
The clockwise logic is simple for a 3*3 matrix
though starting with 4*4 there is some rule missing on how the handle a dead end
Starting at a corner (1,1) or similar is trivial.
BUT: starting at any other point may create a rathole or miss some boxes
Set matrix($Increment(matrix)) = "C,O,D,E" Set matrix($Increment(matrix)) = "U,C,H,G" Set matrix($Increment(matrix)) = "M,U,F,O" Set matrix($Increment(matrix)) = "S,I,F,L"
Start (1,1) is in the example but
Start (1,2) runs ODEGOLFISMU what is the next to (2,1) ? (1,1) or (2,2) or ??
worse with Start(2,2) already the first according to description could be
up (1,2) or right (2,3) or left (2,1) leaving dead ends clockwise.
And this is only with N=4 larger grids may create multiple lost cells.
Clockwise spiral is just not detailed enough for a UNIQUE result to collect ALL cells
A rule how to handle / skip already consumed cells might improve.
Just as I type a non straight spiral solution to (2,2) consuming the full matrix
might be CUISMUCODEGOLFFH
I fail to imagine grids >5*5
go to post
The ERROR you see happens when you try to store your object
Check the possible index collission before any attempt to Save the object.
set exists=obj.MyIndexExists(Prop1,Prop2)
Now you may handle the critical situation according to your needs
go to post
2 options:
set mylist = "" for i = 1:1:5 { set item = "item"_i set mylist = mylist_$ListBuild(item) } zw mylist
kill mylist for i = 1:1:5 set $li(mylist,i)="item"_i zw mylist
go to post
see:
https://docs.intersystems.com/irislatest/csp/documatic/%25CSP.Documatic.cls?LIBRARY=%25SYS&CLASSNAME=SYS.Database#FreeSpace
go to post
Just as you did with Studio
go to post
see docs: https://docs.intersystems.com/ens201813/csp/documatic/%25CSP.Documatic.cls?LIBRARY=%25SYS&CLASSNAME=%25CSP.Response#ContentLength
• property ContentLength as %String;
go to post
As a first step I would search Journals to find the Globals affected
if they are not in IRISTEMP/CACHETEMP or PPG of if Journal is switched off.
In order to separate routine calls (abc^myroutine) from real ^globals
Though journal just shows Process Ids, no routine names.
go to post
Great idea.
Though it requires to run the whole application repeatedly.
Eventually need to fix transactions broken by <PROTECT>
go to post
I just identified a possible source of the hidden Python installation:
https://docs.intersystems.com/iris20243/csp/docbook/DocBook.UI.Page.cls?KEY=GEPYTHON_prereqs#GEPYTHON_prereqs_version
I did an upgrade from my previous IRIS 2024.1