go to post Eduard Lebedyuk · Apr 20, 2018 That looks like GZIP. Can you save response stream as a file and reopen it as a %Stream.FileCharacterGzip?
go to post Eduard Lebedyuk · Apr 20, 2018 There's a function for it called $QLength: write $QLENGTH($name(^global("first","second","third"))) >3 $Name is used to get global name as a variable.
go to post Eduard Lebedyuk · Apr 20, 2018 All properties names are written in: Write $$$ZENJSONPROP(tPropName,pFormat)_": {" Write $$$ZENJSONPROP(tPropName,pFormat)_":[" To get current property XMLNAME parameter call this: Write $$$comMemberArrayGet(tClass,$$$cCLASSproperty,tPropName,$$$cPROPparameter,"XMLNAME")
go to post Eduard Lebedyuk · Apr 19, 2018 Do you want to access data stored in Caché from .Net via REST API?
go to post Eduard Lebedyuk · Apr 19, 2018 Check out RESTForms project - generic REST API backend for modern web applications (articles: part 1, part 2). It handles transformation of classes/queries to JSON and exposes them via REST.
go to post Eduard Lebedyuk · Apr 15, 2018 You can create computed property and index it. Class A { Property P1 As B; Property P1P1 As %String [ SqlComputeCode = {set {*} = ##class(B).P1GetStored({P1})}, SqlComputed, SqlComputeOnChange = (%%INSERT, %%UPDATE) ]; Index I1 On P1P1; }
go to post Eduard Lebedyuk · Apr 14, 2018 Other locales could have TimeFormat property not equal to 1, there are also custom locales.I completely agree that in a wide range of scenarios defaults work fine, or rather defaults are what we expect them to be. However, that is not always the case, so I prefer (and advice) to use macros for $zd* functions with all relevant parameters specified.
go to post Eduard Lebedyuk · Apr 14, 2018 $zdt($H,3) When working with $zd* functions It's better to specify what you need explicitly, because otherwise locale change can be an unwelcome surprise: $zdt($H,3,1,0)
go to post Eduard Lebedyuk · Apr 14, 2018 There are two operations:comparing repository/instancebringing one on compliance with otherThe first part (comparison) could be easily generalized, as the underlying Git repository allows us to do it regardless.The second part, however is very specific and should be implemented as a part of the source control hooks. I don't see how it could be generalized.In my GitLab code I specify an interface which end user should implement - it's a method that accepts a list of deleted items (filepaths). Implementations of this interface should first translate file paths into internal names (i.e. /src/Utils/Math.cls -> Utils.Math) and then delete them.That said, full build from scratch can solve the issue completely. That's a decent approach to take towards more "lively" environments.Finally, as we're talking about deleting classes, at least for me it's an extremely rare case. Do you encounter it often? How & Why?
go to post Eduard Lebedyuk · Apr 13, 2018 The only "automatic" solution I see here is to check out and import classes into clear or new Namespace.Build git diff.Import new/modified classes.Delete deleted classes.Cache Tortoise Git automatically deletes classes deleted from repository.Or never delete classes, only "deprecate" itDepends on how much dead code you have. If say a few classes then it's fine. But large amounts of dead code just make codebase even harder to read.
go to post Eduard Lebedyuk · Apr 13, 2018 Does my example compile for you?Anyway, you should use #def1arg instead of #define as I suggested in the original answer.
go to post Eduard Lebedyuk · Apr 13, 2018 How would you mark it as DEPRECATED?As a comment on a first line.Also, how would you handle MAC files?The same.3. Go through all of the files in Cache and check if it's in the physical OS folder, if not mark it DEPRECATED.Well, if you decided to deprecate several classes then yes.Check out this series of articles on Git and Continuous delivery:Git and how Git flowsGitLab WorkflowGitLab installationContinuous Delivery configurationFirst article covers git, branches and how it can all work together in development.With Continuous Delivery you can easily automate the tasks of syncing your branches and environments.
go to post Eduard Lebedyuk · Apr 13, 2018 You should delete it.Let's say you have ClassA and ClassB. And ClassA calls methods of ClassB. Then you delete ClassB from the repository, but it stays locally. And everything is fine for you and works, but down the line you start a new installation and suddenly it does not work, because ClassB does not exist.When you're working with Git, or any version control system for that matter, you can easily rollback to any state of the repository. So once you commited something you can always get it back.On some of our projects we first mark stuff we want to delete as DEPRECATED. But it stays in the codebase and in the repository. After a while, after we're reasonably sure that we in fact do not need this, the actual delete from the repository and from the server happens.
go to post Eduard Lebedyuk · Apr 13, 2018 Use def1arg macro definition: #def1arg myMacro(%args) $lb("%args") write $$$myMacro(a, b) Compiles into write $lb("a, b")
go to post Eduard Lebedyuk · Apr 11, 2018 but I was unable to write to context.A08Msg. How did you determine that? Generally it's not a good idea to pass whole objects received from somewhere else, especially if they could be changed down the road. If we're talking about persistent objects then they have ids and all references to persistent objects are stored as ids in the database. At runtime the id is read and the object is loaded into memory as required. Ensemble BPL process is a state machine that loads and unloads context to/from disk often, so if some other Ensemble host changes the object it would also change in the base BP after reload cycle and that can cause problems. As a workaround you can assign clones, that is safe: <assign property='context.A08Msg' value='request.%ConstructClone(1)'/>
go to post Eduard Lebedyuk · Apr 11, 2018 My solution and how I got there. I started with this: f r=1:1:s{f c=1:1:s{i r=1!(r=s)!(c=1)!(c=s)!(r=c)!(s=(c+r-1)){w "#"}else{w " "} i c=s{w !}}} First improvement was thanks to @Robert.Cemper who suggested moving i c=s{w !}}} into a first for: f r=1:1:s w ! f c=1:1:s i r=1!(r=s)!(c=1)!(c=s)!(r=c)!(s=(c+r-1)){w "#"}else{w " "} Finally got the idea of using $lb/$lf to get my best result of 76: f r=1:1:s w ! f c=1:1:s w $s($lf($lb(c,r,r=s,c=s,c=r,r+c-s),1):"#",1:" ") Some other ideas that didn't pan out. First of all I thought about replacing $lf($lb)) with $f() but -1 and 1x numbers became a problem: f r=1:1:s w ! f c=1:1:s w $s($f(c_r_(r=s)_(c=s)_(c=r)_$replace(r+c-s,-1,""),1):"#",1:" ") Other idea was using $translate: f r=1:1:s w ! f c=1:1:s w $tr(''$lf($lb(c,r,r=s,c=s,c=r,r+c-s),1),10,"# ") Interestingly if we allow the box to be made of any symbols, some other solutions became possible. For example binary box (63 symbols): f r=1:1:s w ! f c=1:1:s w '$lf($lb(c,r,r=s,c=s,c=r,r+c-s),1)