Replies:

🧐 Additionally we have read 💭💭 carefully:

https://docs.intersystems.com/healthconnectlatest/csp/docbook/DocBook.UI...

https://docs.intersystems.com/healthconnectlatest/csp/docbook/DocBook.UI...

https://docs.intersystems.com/healthconnectlatest/csp/docbook/DocBook.UI...

https://docs.intersystems.com/healthconnectlatest/csp/docbook/DocBook.UI...

https://docs.intersystems.com/irisforhealthlatest/csp/docbook/DocBook.UI...

https://community.intersystems.com/post/making-jwtoauth20

However, we do still have the same question:

What way is there to "call", "invoke", "communicate" from the other environments ( for example INTEGRATION ) with the PREPRODUCTION Resource Server in order to Validate the Token?

That is to say, the question in another way would be:

What mechanism exists to communicate from an Environment A (Integration) with an Environment B (Preproduction) with the mission to Validate the Token from Environment A using the centralized Resource Server available in Environment B?

👀 Thank you very much for your attention, and thank you for your answers.

Best regards

As a reference a the Java solution:

Could be:

import java.util.*;

public class DnaStrand {

  static final Map<String,String> letters = Map.ofEntries(Map.entry("A","T"),Map.entry("T","A"),Map.entry("G","C"),Map.entry("C","G"));

  public static String makeComplement /*🧬🔁🧬*/ (String dna) {
    StringBuilder result = new StringBuilder();
    
    for(String letter:dna.split("")){
      result.append(letters.get(letter));
    }
    return result.toString();
  }
}

Would you like to improve this in ObjectScript?

Are you able?

Example solutions:

dinglemouseChungGorrainrainEAnochlunacjulialebowAndrew P.Kuzmanov_MarioIvanKotsovskiZasho (+ 13)'s solutions

public class Kata {
  public static String declareWinner(Fighter fighter1, Fighter fighter2, String firstAttacker) {
    Fighter a=fighter1, b=fighter2;
    if (firstAttacker.equals(fighter2.name)) {
      a = fighter2; b = fighter1;
    }    
    while (true) {      
      if ((b.health -= a.damagePerAttack) <= 0) return a.name;  // a wins
      if ((a.health -= b.damagePerAttack) <= 0) return b.name;  // b wins
    }
  }
}

My own:

public class Kata {
  public static String declareWinner(Fighter fighter1, Fighter fighter2,
                String firstAttacker) {
    
    String nextAttacker = firstAttacker;
    do{
        if(nextAttacker.equals(fighter1.name)){  
          fighter2.health -= fighter1.damagePerAttack;
          if(fighter2.health > 0){
            nextAttacker = fighter2.name;
          }
        }else{
          fighter1.health -= fighter2.damagePerAttack;
          if(fighter1.health > 0){
            nextAttacker = fighter1.name;
          }
        }
    
    }while(fighter1.health > 0 && fighter2.health > 0);
    return nextAttacker;
  }
}

marko-bekhtaKutayBSVarakutarosedhivyaShreyasRanimeshp's solution
 

public class Kata {
  public static String declareWinner(Fighter fighter1, Fighter fighter2, String firstAttacker) {
        int moves1 = (int) Math.ceil( (double)fighter2.health / fighter1.damagePerAttack);
        int moves2 = (int) Math.ceil( (double)fighter1.health / fighter2.damagePerAttack);
        if (moves1 > moves2) {
            return fighter2.name;
        } else if (moves1 < moves2) {
            return fighter1.name;
        } else {
            return firstAttacker;
        }
  }
}

I hope you feel challenged with this exercise

Followers:
Following:
Yone has not followed anybody yet.
Global Masters badges: