go to post Robert Cemper · Sep 5, 2017 So for a first check if this is the only issue just throw the full string into a $TRANSLATE$tr(jsonstring,$c(26)) and whipe it out.
go to post Robert Cemper · Sep 5, 2017 Last comment from Ken holds his final solution.use Class %Regex.Matcher it finds the control chars and can replace it .e.g. ""http://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?A...
go to post Robert Cemper · Sep 5, 2017 http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...there isn't much doc around.it's also used for "Find in files"a little bit in debugginghttp://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...
go to post Robert Cemper · Sep 4, 2017 Hi Evgeny,IF you can afford a short OFFLINE state:#5) dismount DB / copy of cache.dat to a fast local device / remount it move the copy in a secure place: #2, #1ELSE IF you have to remain online all the time:#3) on fast local device + move backup in secure place by #2,#1 NEVER #4) a fair chance for massive inconsitencyRobert[semper fidelis]
go to post Robert Cemper · Sep 4, 2017 double dot ..property is the shortcut for $this.property in instance methods.http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...
go to post Robert Cemper · Sep 1, 2017 Great explanation of the issue. Thanks!So we have an nice example what Proleptic Gregorian Calendar used for $H calculation means: write $zd($zdh("1492-10-12",3,,,,,-600000)#7,11)Wed And that's definitely not correct as you demonstrated very precisely.But is common use in most programming and DB systems. But the date as such is questionable for 2 reasonsThere is a 5..6 hours time gap between Spain and the Caribean sea At the and of the middle age every kingdom and smaller typically dated their documentsby the years their actual king was in power. A common date as we know was not at all in place.So Oct.12 is most likely a date back calculated by historians hundred years later . So we should interpret this date as an common agreed convention that by luck was Friday.Thanks again for the contribution.
go to post Robert Cemper · Aug 31, 2017 You are right, the A -B -C case isn't covered by me:not a goal but an assist (half points )
go to post Robert Cemper · Aug 31, 2017 It's possible but counter productivesince: if you switch off journal this get's logged in Audit and generates at least 1 entry in journaland swicthing it back on for the rest of your application you get another entry.I just don't recommend things with negative impact on performance. Anyhow IF you insist it's your fate:http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...
go to post Robert Cemper · Aug 31, 2017 You may do it as well with SQLselect count(*) cnt , ID from ( select 'PERS' Typ, ID from %Dictionary.ClassDefinition where Super [ 'Persistent' union all select 'XML' Typ, ID from %Dictionary.ClassDefinition where Super [ 'XML.Adaptor')group by IDorder by cnt descResult : 2 both classes contained in classcntID2%BI.Blog2%BI.BlogPost2%BI.DashBoard2%BI.DetailList2%BI.DocMag2%BI.ImageList2%BI.KPI2%BI.ListField2%BI.Measure2%BI.PerfMet2%BI.PerfMetNode2%BI.PivotData2%BI.PivotTable
go to post Robert Cemper · Aug 31, 2017 For Regex you have $LOCATEhttp://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...$MATCHhttp://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...and %Regex.Matcherhttp://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?A...
go to post Robert Cemper · Aug 30, 2017 YES, map it to a namespace where Journal is disabledswitching on/of journalling at every write is overhead and fills the audit log that is journalled itself
go to post Robert Cemper · Aug 30, 2017 I'd suggest in this case to take the original JSON String from Request.HttpResponse.Dataand split it by "LineNumber":eg:set sep="""LineNumber"":"for line =2:1:$l(json,sep) set line(line)=+$p(json,sep,line)and you get line=3line(2)=0line(3)=1I admit it's not very object-ish but efficient
go to post Robert Cemper · Aug 30, 2017 your private google search service delivered some material.[this is not a standard service]
go to post Robert Cemper · Aug 30, 2017 Athanassios,I googled some time around Python console:It is single threaded. But your expectations seem to be that the behavour is like a terminal.To achieve this your have to run 2 Phyton consoles / shells as you required 2 Terminals.a) 1 passive to receive messages from WRITE see attaches example starting before b)b) 1 active to trigger action in CachéYour initial code from your questions using the Caché Phyton binding covers b) OK!for a) you may use a listener similar to this Phyton example with the correct port, buffer,... ToDo 1 #!/usr/bin/env python 2 3 import socket 4 5 6 TCP_IP = '127.0.0.1' 7 TCP_PORT = 5005 8 BUFFER_SIZE = 20 # Normally 1024, but we want fast response 9 10 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 11 s.bind((TCP_IP, TCP_PORT)) 12 s.listen(1) 13 14 conn, addr = s.accept() 15 print 'Connection address:', addr 16 while 1: 17 data = conn.recv(BUFFER_SIZE) 18 if not data: break 19 print "received data:", data 20 conn.send(data) # echo 21 conn.close()
go to post Robert Cemper · Aug 30, 2017 Dashboards are always fresh calculated.Compare the performance in .NET to IE. It should be rather close to each other being based on similar technology.If there is a significant difference then you dig at .NET end (buffers, ...)If Chrome is significant faster then IE it's most likely the faster JS engine in Chrome.Next you could look into global buffers of Caché and concurrent use of the Caché instance.And (rarely) the complexity of your dashboard
go to post Robert Cemper · Aug 30, 2017 Hi Athanassios,you can not run the sender code in the same terminal as the receiver codeyou have to use 2 terminals:Terminal #1) start receiver. This simulates your Phyton Consoleset tcp="|TCP|4200"open tcp:(:4200):1 write $s($t:"OK",1:"failed"),!for line=1:1 use tcp read text use 0 write line,?5,text,! now you wait for something to be sent:#Terminal #2): run sender set person = ##class(Samples.Person).%OpenId(1) w person.Name do person.PrintPersonTCP() for this test it's essential that the sender finds a receiver waiting for input. Probably the same issue with PhytonConsole?It's like real life: If nobody listens, your words are lost. And it has to happen at the same time.
go to post Robert Cemper · Aug 30, 2017 The ouput goes to port 4200. That works with Caché. (see test code)Attention: The ! at the end of the WRITE is important as it triggers the send.in SAMPLES it is at the beginning: So you just get an empty line. and rest remains in buffer.You may also add WRITE !! before the CLOSE to flush the buffer and send an empty line for termination .I have no knowledge on Python or PythonConsole but from your code I see no indicationwhere it starts listening at port 4200. pls. check.Test code from Caché Terminal:USER>set tcp="|TCP|4200"USER>open tcp:(:4200):1 write $s($t:"OK",1:"failed"),!OKUSER>for line=1:1 use tcp read text use 0 write line,?5,text,!1 Name: Uhles,Rob O.<READ> [ <READ> is the reaction to the connection CLOSE of the sender as I don't check termination ]
go to post Robert Cemper · Aug 29, 2017 Sorry, I saw just that one Print method fromSAMPLES.The redirect is especially required to convert a Write Command to a Write() Method and vice versa.For "classic" devices as files , TCP, UDP, all kind of pipes ,SPOOL,Console, Teerminal,...all you find in Caché I/O Device Guide I just see no added value except fiddling around $P which I never had the need to do over 40yrs
go to post Robert Cemper · Aug 29, 2017 Method PrintPerson() { set tcp="|TCP|4200" open tcp:("127.0.0.1":4200:"PSTE"):1 else quit use tcp Write "Name: ", ..Name,! close tcp Quit }