go to post Anna Golitsyna · Jul 17, 2024 I rebuild ^rINDEX using, as recommended, D ##class(%Library.RoutineIndex).RebuildIndex($NAMESPACE). That reduced the number of ^rINDEX entries with an empty Date Modified, the cause of the $RO error. However, this function is partially based on ^ROUTINE which in its turn had bogus entries, all of the type ^ROUTINE("ABC",0,"SIZE")=<some integer>. That’s all these routines contain. I killed these ^ROUTINE nodes and rebuilt ^rINDEX. No empty Date Modified.
go to post Anna Golitsyna · Apr 15, 2024 I wrote a simple function to find non-printable characters in a routine: findNonAsciis stream = ##class(%FileCharacterStream).%New()s stream.Filename="C:\TestAGbackup_2024-04-15_AG.txt"f { q:stream.AtEnd s line = stream.ReadLine() ; Strip all control characters, including non-processable by XML export, except for tabs and newlines s l2=$ZSTRIP(line,"*C","",$C(9)_$C(10)_$C(13)) w:l2'=line line,!,l2,!} q
go to post Anna Golitsyna · Jan 22, 2024 Everybody, thanks for reading and Robert and Sarah for replying. Yes, GetGlobalSizeBySubscript returns Allocated Size only Changing the third GetGlobalSizeBySubscript argument to an empty one does not make a difference in returned Size. GetGlobalSize and ^%GSIZE return Used Size which is still different but not dramatically. I also found an bug in my code. The lengthy InterSystems instructions to the GetGlobalSizeBySubscript code mention: ""Size - Maximum number of MB to count...Be careful to RESET this for multiple calls to the method". I'd say such a Size definition is counterintuitive but at least I got totalSize=1321.57, very close to the result from GetGlobalSize from GetGlobalSizeBySubscript(path,global,global,.Size). Final code with results is: partialGlobalsSize(dir,global)S sub="",path="C:\Cachesys\mgr\"_dir_"\",searchGlobal="^"_global,Alloc=0,Size=0S x=##Class(%GlobalEdit).GetGlobalSize(path, global,.Alloc,.Size)W global,",",Alloc,",",Size,! ; Alloc=1312,725 here, Size=725S Size=0S x=##Class(%GlobalEdit).GetGlobalSizeBySubscript(path,global,"",.Size)W global,",",Size,! ; 1311.9 hereS totalSize=0F { /// Size - Maximum number of MB to count. If the size of the global exceeds this value, /// calculation stops, and an error is returned. If undefined or set to 0, then the entire range is counted. /// Be careful to RESET this for multiple calls to the method S Size=0 ; Resetting! S sub=$O(@searchGlobal@(sub)) Q:sub="" ;$D(@("^MSCG("_t_")")) S x=##Class(%GlobalEdit).GetGlobalSizeBySubscript(path,global_"("""_sub_""")","",.Size) S totalSize=totalSize+Size}W global,",",totalSize,! ; 1321.57 hereQ
go to post Anna Golitsyna · May 10, 2023 That's the code I ended up with. Thanks for your help, everybody! ; str is parsed into two arrays, words and separators (spaces and punctuation) ; Trim leading and trailing spaces here if needed S L=$L(str),(currWord,currSep)="",cnt=0 F i=1:1:L { S currChar=$E(str,i,i) I $MATCH(currChar,"\w") { S currWord=currWord_currChar I currSep'="" { S sepAr(cnt)=currSep,currSep="" }} ELSE { S currSep=currSep_currChar I currWord'="" { S cnt=cnt+1,wordAr(cnt)=currWord,currWord="" } } }
go to post Anna Golitsyna · Oct 8, 2021 Marc, a slight variation on your idea, tested whether targetRtn exists or not. Thanks again! zn "A"s currRtn=(##class(%Routine).%OpenId(rtnName))s stream=currRtn.Read()zn "B"s targetRtn=(##class(%Routine).%OpenId(rtnName))s sc=targetRtn.Write(stream)d targetRtn.Save()
go to post Anna Golitsyna · Apr 1, 2021 One late addition: I just lost this debugging functionality again, looks like because my code was going into a different namespace via zn "nsp". If I put the first breakpoint AFTER this zn, the cursor does not go to it and the yellow box does not appear. However, if I put my first breakpoint AT zn, the yellow box appears at it and stays with me after the breakpoint as well. Can't say it's a feature but then what??
go to post Anna Golitsyna · Feb 9, 2021 Losing debugging capabilities, Scenario #2.A fellow programmer also lost her debugging capabilities some time ago though for different reasons and with different symptoms. I am not dead sure what happened in her case but it looks like some unfortunate combination of User Roles and Service Settings as defined in Management Portal. We discussed it today and she tried a few things. Changing the studio login user helped as well as changing localhost in Cache Server Manager to an actual IP address. Using Remote System Access from the cube was beneficial as well.
go to post Anna Golitsyna · Feb 9, 2021 Alright, this particular saga suddenly came to the end revealing the bug, my own one. But it is sort of educational so some details. I am implementing source control like features on and off while inheriting one of the features from a previous programmer. The latter feature which I preserved was about adding a timestamp with the compilation time to the changed routine in the overwritten source control method, OnAfterCompile. OnAfterCompile was adding this timestamp, resaving the routine directly in one of the internal routine globals, and it did NOT recompile the file again. That effectively still had the file internally marked as saved and compiled, no little cross in the Studio's routine tab, BUT that threw the .OBJ file mapping to the routine source code enough so the debug yellow box would refuse to appear and the cursor would not move from the first line. Many self eye-rolling emojis here...How did I discover it? I need to modify this custom source control class and it was annoying to do so while the source control was on so I turned it off, moved functionality to my test routine, and observed with incredulity the long lost yellow debug box again....P.S. On the plus side, I learned a lot about inner Cache workings due to this largely self-inflicted wound and I am happy it is over.
go to post Anna Golitsyna · Sep 2, 2020 Everybody, thanks for your help and advice but the old-timer's advice to go the d ^%GOF route in Cache Terminal proved to be it. It was actually amazing to see how much superior this route turned out to be comparing with the much more modern Export/Import Management Portal route. Specifically: Preparation to exclude certain globals, few dozens of them: Terminal - about 10 minutes because you can use ranges (see below and here, https://docs.intersystems.com/priordocexcerpts/prgglobalchui-41.pdf), portal - much longer because you have to uncheck each global individually Export speed: Terminal - 10 minutes, portal 3 hours (no kidding) Export/Import log per global: Terminal - log provided, complete with the number of blocks per global, portal - no log Import speed: Terminal - less than 10 minutes, portal - stuck in the middle with no error shown Sample %GOF usage in terminal, hit Enter if no special requests, exporting:d ^%GOFDevice: tmp.gof file format: ("UNW*") => Maximum media size (bytes): (No maximum)Enter a short description of the contents of this tape or fileDescription:All Globals? No => NoGlobal ^S-SZ [All globals in this range, case-sensitive - AG]Global ^'STPL* [Exclude all globals that start with STPL - AG]Real life output from my real life usage:...............^ZPG 182 data blocks written^ZTEMP 1 data block written491,337 blocks written in 10 minutes, 51 seconds--------------------Importing was done via d ^%GIF, via terminal as well. At some point the %GIF utility asked me: Globals with a preceding asterisk ('*') already exist in this directoryWhat would you like to do with these globals that exist? 1. Skip inputting globals that exist in this directory2. Merge input globals with the existing globals3. Specify skip/merge for individual globals Your choice: 1=>Thanks again,Anna
go to post Anna Golitsyna · Aug 19, 2020 It looks like code below would give me what I am looking for. Just need to figure out (or take an advice!) how to exclude, say, system classes outright. s rs=##class(%ResultSet).%New("%Dictionary.ClassDefinitionQuery:ClassIndex")s x=rs.Execute()f {s x=rs.Next() q:'xs TimeChanged=rs.GetDataByName("TimeChanged")s ClassName=rs.GetDataByName("ClassName")s Hash1=rs.GetDataByName("Hash1")s Hash2=rs.GetDataByName("Hash2") s System=rs.GetDataByName("System")s ClassType=rs.GetDataByName("ClassType")s Size=rs.GetDataByName("Size")}P.S. Found the answer to my last question: https://cedocs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=%25SYS&CLASSNAME=%25Library.RemoteResultSet