Sergei Shutov · Dec 24, 2020 go to post

Another way to look at results -- by medal count. Border is part 1 (doesn't count), background is part 2.

Sergei Shutov · Jan 10, 2021 go to post

I shrunk your code a bit, it's 72 characters now:

f n=1:1:n f i=1:1:n,n-1:-1:1,"" s a=$e(112345678,2,i) w !?n-i,a,i,$re(a)
Sergei Shutov · Jan 11, 2021 go to post

Shrunk your code a bit, 71 chars:

f s=1:1:s f i=1:1:s,s-1:-1:1,"" s a=i f k=a-1:-1:1{s a=k_a_k} w !?s-i,a
Sergei Shutov · Jan 11, 2021 go to post

Yeah I thought N>9 is "bonus level" - it will definitely require more characters. Original answer (top one) was only working for N<=9 anyway

Sergei Shutov · Jan 11, 2021 go to post

Yeah I think we can shred a couple of characters using this technique from your code as well - it will become 71 characters, best so far:

f i=1:1:N f j="",1:1:i,i-1:-1:1 w !?N-j f l=1:1:j{w l} f r=l-1:-1:1 w r
Sergei Shutov · Apr 28, 2021 go to post

AES ECB encryption/decryption is done using AESEncode/AESDecode methods in the same package. They are deprecated so don't appear in documentation.

Sergei Shutov · May 10, 2021 go to post

Hi Ishan,

1) - There is Trak documentation but it's not publicly available, you need to get access via TRC https://trc.intersystems.com/

2) There are no settings for fonts/colours, you need to use custom CSS file to change those

Sergei Shutov · May 16, 2021 go to post

Hi Adrian,

Multi factor authentication can be enabled if you use single sign on or LDAP in TrakCare and your auth provider supports it. Please contact TRC for details.

Sergei Shutov · Jul 5, 2021 go to post

I believe this error happen because you are trying to execute this code in the class method, not instance method.

Can you please provide a full class definition and how you are executing the test?

Sergei Shutov · Jul 6, 2021 go to post

Try this way

K  $ZT="^%ET"   
  id="{id}"
  set httprequest = ##class(%Net.HttpRequest).%New()
 set httprequest.SSLConfiguration = "HTTPS"
  set httprequest.Server = "anypoint.mulesoft.com" /// CHANGED
 set httprequest.Https = 1
 set httprequest.ContentType="json"
set sc=httprequest.SetHeader("Connection","close")
set status = httprequest.Get("/mocking/api/v1/links/03a74865-d7fb-4318-a310-7ad2b95361f6/v1/receivables/"_id") /// CHANGED
if status {
response=httprequest.HttpResponse //IS JUST RETURNING PAGE
     do response.Data.Rewind()
     do {
     write response.Data.Read()
     while 'response.Data.AtEnd 
}
 quit

Sergei Shutov · Jul 6, 2021 go to post

Did you try to rebuild indices and purge cached queries?

Also, have a look at the execution plan in the Management portal -- it will tell you which indices it uses and how it builds a result.

Sergei Shutov · Sep 16, 2021 go to post

Hi Sai Sai,

One thing you might look into in regards to distribution and deployment is ZPM Package Manager https://github.com/intersystems-community/zpm . It's still under active development, but is already very usable at the moment, you can use it with a self-hosted open source private registry https://github.com/intersystems-community/zpm-registry/ and my consultancy is currently developing a commercial hosted version which will be announced at Virtual Summit next month.

There is an example of an Interoperability packaging at GitHub: https://github.com/intersystems-community/iris-interoperability-template

In terms of deployment, unless you have MASSIVE productions, I would recommend to deploy the whole thing at once even if not everything has changed -- it's just a lot less moving parts and options for errors this way, and you can test deployments on your test server as many times as you like.

Hope this helps!

Sergei Shutov
Managing Director, Banksia Global
https://banksiaglobal.com

Sergei Shutov · Oct 12, 2021 go to post

Hi Muhammad,

You should look at csvgen package by @Evgeny.Shvarovhttps://github.com/evshvarov/csvgen

There are a few examples of importing data from GitHub on the home page. You can have a look at the source code to see how it's done if you need more flexibility.

Sergei Shutov · Oct 14, 2021 go to post

This is what I do to generate JWTs.

ClassMethodGetJWT(usernameAs%String) As%String
{
// Calculate the issued at and expiration dates
setiat = ##class(%OAuth2.Utils).TimeInSeconds($ztimestamp,0)
setexp = ##class(%OAuth2.Utils).TimeInSeconds($ztimestamp,3600*24*7)

 

// Define token payload
setpayload = {
"iat": (iat),
"iss": "zpmhub",
"exp": (exp),
"user": (username)
}
setsecret=$get(^JWTSecret)
ifsecret="" {
setsecret=##class(%PopulateUtils).StringMin(64,64)
setsecret=$tr($p($SYSTEM.Encryption.Base64Encode(secret,1),"=",1),"+/","-_")
set^JWTSecret=secret
}
setJOSE("sigalg")="HS256"
do##class(%OAuth2.JWKS).AddOct("HS256",secret,.RemotePrivate)
do##class(%OAuth2.JWT).ObjectToJWT(.JOSE,payload,,.RemotePrivate,.jwt)
quitjwt
}
Sergei Shutov · Oct 14, 2021 go to post

All classes are ProcedureBlock by default, you need to manually set [Not ProcedureBlock] if you don't want to compile classes to Procedures. It's highly recommended to use ProcedureBlock though.

Sergei Shutov · Oct 15, 2021 go to post

In your case sigalg will be RS256 instead of HS256 and you'll need to call ##class(%OAuth2.JWKS).AddX509 instead of ##class(%OAuth2.JWKS).AddOct to use your private RSA keys.

It's definitely a bit of a challenge, but should be doable!

Sergei Shutov · Oct 15, 2021 go to post

Well in case of $classmethod you don't need to use an indirection at all to achieve the same result. I would avoid using indirection if at all possible.

Sergei Shutov · Oct 19, 2021 go to post

If you are talking about header (first part of 3-part JWT token) ObjectToJWT should generate correct values for you with alg, typ and x5t values set correctly.

If you are talking about payload (second part), I construct it after // Define token payload line in the example above and then pass it as 2nd argument to ObjectToJWT - you can add any data you need there.

Sergei Shutov · Oct 21, 2021 go to post

Can you please post your docker-compose.yml? Or at least part relevant to IRIS

Sergei Shutov · Oct 26, 2021 go to post

The one I posted above with hs256 did work, I didn't try RSA ones. Can you post your code that produces a wrong signature?