go to post Timothy Leavitt · Nov 9, 2021 Ended up being a simpler solution than expected... the query had been update table set newfield = 1 where newfield is null and really should have just been update %NOINDEX table set newfield = 1 (because it was null everywhere).
go to post Timothy Leavitt · Nov 9, 2021 There's great IDE integration for VSCode for local git repos; really it's the package manager awareness that's key. Use case: I find a bug in one of my project's dependencies Assuming it's been loaded from my local filesystem rather than by zpm install, I can just fix it directly via an isfs editing mode and it'll be reflected on the filesystem.
go to post Timothy Leavitt · Nov 8, 2021 Thanks @Ben.Spead! And just to be clear, this isn't just for those working in shared, remote development environments - I anticipate this simplifying a lot of my work on Open Exchange projects even with local instances and VSCode.
go to post Timothy Leavitt · Nov 3, 2021 I wonder if the business host is running an old version of the class. (That would explain why the <UNDEFINED> reports a weird line of code, and why the error hasn't gone away after you fixed it.) Maybe try disabling + reenabling the business operation / restarting the production?
go to post Timothy Leavitt · Oct 28, 2021 The internal hackathon is over but I'd love to still hear more thoughts here. :)
go to post Timothy Leavitt · Oct 28, 2021 Agreed - this feels like the biggest gamechanger among Virtual Summit announcements since we've called it Virtual (or Global) Summit.
go to post Timothy Leavitt · Oct 13, 2021 One note here, $$Quote^%qcr will represent control characters with $c(decimalAsciiCode) syntax - like the newlines in this case. I think there's some more official classmethod that's equivalent, but I don't recall where it is off the top of my head.
go to post Timothy Leavitt · Oct 13, 2021 Hi Erica, $$$Text generates content into the message globals at compile time. Here's one way to solve the problem: Class Erica.DemoLocalizedXData { Parameter DOMAIN = "Demo"; XData LocalizedEmail [ MimeType = text/html ] { <body> <p> Text to be translated into another language </p> </body> } ClassMethod GetLocalizedContent(xDataName As %String) As %String [ CodeMode = objectgenerator ] { do %code.WriteLine(" Quit $Case(xDataName,") set key = "" for { set xdata = %class.XDatas.GetNext(.key) quit:key="" set data = xdata.Data.Read() // Assumptions about length here... do %code.WriteLine(" "_$$$QUOTE(xdata.Name)_":$$$Text("_$$Quote^%qcr(data)_"),") } do %code.WriteLine(" :"""")") } } After compilation you'll have: ^IRIS.Msg("Demo")="en" ^IRIS.Msg("Demo","en",3630108798)="<body>"_$c(13,10)_"<p>"_$c(13,10)_"Text to be translated into another language"_$c(13,10)_"</p>"_$c(13,10)_"</body>"_$c(13,10) If you want to localize individual strings in the XData block independent of the HTML markup that gets a little more complicated. I'd think it's simpler/possibly better to localize the entire block at once though.
go to post Timothy Leavitt · Oct 11, 2021 Neat trick for the expression for r! (Which I hope to never see again outside of the context of contests like this. :))
go to post Timothy Leavitt · Oct 8, 2021 Gaming the system and using the code provided to check the result length, 3: ClassMethod AddWater(p As %String, t = {$e(p)}, r = {$case(p,"":"",:..AddWater($e(p,2,*)))}, f = {$Select(t:$tr($j(t,t)," ",t)_r,1:r)}) As %String [ CodeMode = expression ] { f }
go to post Timothy Leavitt · Oct 8, 2021 Edit: down from 73 to 67 to 58 (but still looking for better...) Missing an important test case:Do $$$AssertEquals(##class(CodeGolf.MagicTowel).AddWater("00020"), "22")
go to post Timothy Leavitt · Sep 10, 2021 Theory: bad export is caused by slashes in InternalName when working from the workspace context menu in Studio. (https://github.com/MakarovS96/cache-tort-git/issues/4#issuecomment-91717...)
go to post Timothy Leavitt · Aug 23, 2021 @Ben Spead yes - haven't had a chance to verify if that actually works yet, but I do intend to...
go to post Timothy Leavitt · Aug 23, 2021 PBKDF2 is not a method of encryption, it's a method of hashing - e.g., it's one-way. Depending on what you're looking to accomplish (e.g., validating users against some external system), delegated authentication (https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...) with a ZAUTHETNICATE routine (see https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...) might help.
go to post Timothy Leavitt · Aug 23, 2021 @Craig.Regester I'd be really interested to see what you're doing with the server hooks. (Maybe @Raj Singh would be interested too?) It sounds like you're rolling your own; what are you integrating with? Git, Perforce, SVN, etc.? A few tidbits that may or may not be relevant for your use cases: %Studio.Extension.Base:UserAction (see https://docs.intersystems.com/irislatest/csp/documatic/%25CSP.Documatic....) with Action=3 will also launch an external browser given a full URL provided in Target (not necessarily CSP, but could be). This isn't truly a "modal" window but would give you a little bit more control perhaps. For the sake of VSCode specifically there's a different API (not really documented) for closing a page opened with Action = 2 - specifically, sending a message to the parent frame (a VSCode web view) with data {"result":"done"}. This looks something like (in %CSP.Page:OnPage): If (%request.Get("EndTemplate") = 1) { If (%request.UserAgent [ " Code/") { // For VSCode only: Set %response.ContentType="text/html",%response.CharSet="UTF-8" Write "<html>",! Write "<script type=""text/javascript"">",! &js<if (window.parent) { window.parent.postMessage({"result":"done"},'*') }> Write "</script>",! Write "</html>",! } Else { Set %response.ContentType="text/xml",%response.CharSet="UTF-8" Set delim = ##class(%CSP.StudioTemplateError).#DELIM Write "<?xml version=""1.0""?>",! Write "<template><![CDATA[BODY",delim Write delim,"]]]]><![CDATA[></template>",! } Quit $$$OK }
go to post Timothy Leavitt · Aug 17, 2021 @Evgeny Shvarov, the power of generators and projections is more in the creation of frameworks/tools that speed up building solutions. This includes many parts of IRIS itself, but moves into the user space for larger/more complicated applications (e.g., what we've done with AppS.REST both for REST-enabling older ObjectScript-based applications and for quickly building out new applications using IRIS and modern web technologies).
go to post Timothy Leavitt · Aug 16, 2021 If only da Vinci had provided explicit documentation (preferably written above the painting, in Latin) about how to maintain it going forward...
go to post Timothy Leavitt · Aug 16, 2021 @Evgeny Shvarov anything with CodeMode=objectgenerator, typical uses of projections, anything that works with %Dictionary.(.*Definition|Compiled.*), anything that works directly with %Library.Routine / %Library.RoutineMgr... there are examples all over the place, including throughout both of my Open Exchange projects. https://openexchange.intersystems.com/package/Test-Coverage-Toolhttps://openexchange.intersystems.com/package/apps-rest These don't go to the level of dynamically modifying/instrumenting code, but another of my projects (a mock framework for ObjectScript, still internal to InterSystems) does.
go to post Timothy Leavitt · Aug 6, 2021 I've found writing applications INSIDE the DB environment to be the single coolest thing about InterSystems' technology. The code itself being stored in the database and accessible through both object and relational modes (just like the actual data) makes metaprogramming a really natural part of the language.