Discussion Eduard Lebedyuk · Jun 23

Welcome everyone!

Hope to meet you here.

Let's have a dedicated discussion thread about Ready 2025. Please post your impressions! Ideas! Inspiration! Photos!

Keynotes are streamed live so even if you're not in Orlando, you can still join!

0
0 0
Article Eduard Lebedyuk · Apr 18 8m read

For my hundredth article on the Developer Community, I wanted to present something practical, so here's a comprehensive implementation of the GPG Interoperability Adapter for InterSystems IRIS.

Every so often, I would encounter a request for some GPG support, so I had several code samples written for a while, and I thought to combine all of them and add missing GPG functionality for a fairly complete coverage. That said, this Business Operation primarily covers data actions, skipping management actions such as key generation, export, and retrieval as they are usually one-off and performed manually anyways. However, this implementation does support key imports for obvious reasons. Well, let's get into it.

0
0 0
Discussion Eduard Lebedyuk · Mar 18

How do you collect stack info when debugging non-interactive jobs?

I cobbled this together today from the docs, but maybe there's something pre-built? LOG^%ETN()?

set stack = ""for loop=0:1:$STACK(-1) { 
      set stack = stack _ "Context level:" _ loop _ " Context type: " _ $STACK(loop) _ $c(10,13) _
                          "  Current place: " _ $STACK(loop,"PLACE") _ $c(10,13) _
                          "  Current source: " _$STACK(loop,"MCODE") _ $c(10,13)
}

Log meth

0
0 0
Question Eduard Lebedyuk · Mar 4

I have an Embedded Python method, which is essentially a call to one third-party module.

Most of the time, the method takes <0.1 seconds to execute, but sometimes it takes 30 or 60 seconds.

The server is relatively idle (20-30% CPU load).

How can I debug this issue further? Ideally, I want to know where this library spends the time. The library is mainly Python code (it's boto3, so it's not a Python C API proxy library).

0
0 0
Discussion Eduard Lebedyuk · Feb 13

It's been a while (and everyone is well-rested after Advent Of Code!) so let's run another round of Code Golf.

Your task is navigating in a grid-like labyrinth in a clockwise spiral pattern. As it traverses the matrix, it collects characters, revealing a secret message. Your challenge: find the shortest, most elegant code to decode this spiral cipher. Input:

  1. A multidimensional string array with comma separated characters (n x n)
  2. Starting coordinates X and Y

Output: The decoded message as a single string

Constraints:

0
0 0
Article Eduard Lebedyuk · Jan 7 1m read

When you deploy code from a repo, class (file) deletion might not be reflected by your CICD system.
Here's a simple one-liner to automatically delete all classes in a specified package that have not been imported. It can be easily adjusted for a variety of adjunct tasks:

set packages = "USER.*,MyCustomPackage.*"set dir = "C:\InterSystems\src\"set sc = $SYSTEM.OBJ.LoadDir(dir,"ck", .err, 1, .loaded)
set sc = $SYSTEM.OBJ.Delete(packages _ ",'" _ $LTS($LI($LFS(loaded_",",".cls,"), 1, *-1), ",'"),, .err2)
0
0 0
Discussion Eduard Lebedyuk · Aug 5, 2024

Today we have an unusual code golf: build a program (using only printable ASCII characters, tabs and newlines) that prints out exactly the characters in the printable ASCII space (characters 32 to 126) that don't appear in your program's source code (in any order, however many times you want).

As usual, the goal is to produce the shortest code to do this.

My (admittedly not very good, but does the job!) entry:

Classascii.ascii {

ClassMethodascii()
{
    setx="!#$%&'()*+,-./0123456789:;<>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdfghijklmnopqruvwyz{|}~"
}

}
0
0 0
Article Eduard Lebedyuk · May 24, 2024 15m read

If you're running IRIS in a mirrored configuration for HA in GCP, the question of providing a Mirror VIP (Virtual IP) becomes relevant. Virtual IP offers a way for downstream systems to interact with IRIS using one IP address. Even when a failover happens, downstream systems can reconnect to the same IP address and continue working.

The main issue, when deploying to GCP, is that an IRIS VIP has a requirement of IRIS being essentially a network admin, per the docs.

To get HA, IRIS mirror members must be deployed to different availability zones in one subnet (which is possible in GCP as subnets always span the entire region). One of the solutions might be load balancers, but they, of course, cost extra, and you need to administrate them.

In this article, I would like to provide a way to configure a Mirror VIP without using Load Balancers suggested in most other GCP reference architectures.

0
0 513
Discussion Eduard Lebedyuk · May 24, 2024

It's Friday and a long weekend is upon us, so let's have a round of code golf!

Nowadays, it's rare to find a text message without at least one emoji. 😃😄😎🙂😊😀😁😆😂 But back in the day, people had to be creative to express their emotions in text. They would use emoticons, which are symbols made up of keyboard characters :^)=])B). Our challenge for today is to create a function that receives a string as argument and returns the total number of smiling faces or happy faces. Each smiley face must have one smiling mouth, which should be marked with ), ], }, D or >. A smiley face can have a pair of eyes but it does not have to. Valid characters for eyes are :, ;, 8, B or =. A nose is optional, and can be represented these characters: -, ^, c, o and ~.

Valid smiley face examples:

    :) :D ;-D :~) :‑) :-] =)    
    :] :-> :> 8-) :D 8‑D )
    8) :-} :} :o) :c) :^) =]
    :‑D 8D =D B^D

Input

"count how many smiley faces are here :)"

Output

1
4
0 250
Announcement Eduard Lebedyuk · Mar 28, 2024

Hello Community,

I'd like to share with you our article with @Regilo.Souzaon AWS Amazon blog Automating application-consistent Amazon EBS Snapshots for InterSystems IRIS databasesOur team has created this step-by-step instruction to create application-consistent snapshots for InterSystems IRIS databases. In this article, we outline how to automate pre-scripts to pause I/O and flush buffer to disk and post-scripts to thaw I/O, as shown in the following figure:

0
0 204
Discussion Eduard Lebedyuk · Mar 11, 2024

Let's have another round of code golf, with a different signature today!

Write a classmethod that will receive a variable number of parameters  containing comma-separated strings and/or positive numbers, and returns one of four possible string values.

  • Easy mode: each argument is guaranteed to be one sting or number without commas or white spaces.

Depending on the ordering of the lengths of the elements in the input, your method should return:

0
0 315
Discussion Eduard Lebedyuk · Mar 5, 2024

Work Queue Manager (WQM) is a feature of InterSystems IRIS that enables you to improve performance by distributing work to multiple concurrent processes programmatically. The idea is that you split the work into chunks, and WQM distributes the chunks across worker processes and can provide the info that the work is done.

However, recently, I got an interesting question: there's a large logical transaction composed of ~1,000,000 individual objects and SQL inserts and updates. Some updates are CPU-intensive, so the original idea was to use WQM to split an update into chunks to speed things up. 

0
0 288
Article Eduard Lebedyuk · Feb 9, 2024 6m read

Welcome to the next chapter of my CI/CD series, where we discuss possible approaches toward software development with InterSystems technologies and GitLab. Today, we continue talking about Interoperability, specifically monitoring your Interoperability deployments. If you haven't yet, set up Alerting for all your Interoperability productions to get alerts about errors and production state in general.

Inactivity Timeout is a setting common to all Interoperability Business Hosts. A business host has an Inactive status after it has not received any messages within the number of seconds specified by the Inactivity Timeout field. The production Monitor Service periodically reviews the status of business services and business operations within the production and marks the item as Inactive if it has not done anything within the Inactivity Timeout period. The default value is 0 (zero). If this setting is 0, the business host will never be marked Inactive, no matter how long it stands idle.

0
0 1253
Article Eduard Lebedyuk · Feb 7, 2024 2m read

Recently, I needed to run WebGateway on an additional port but with a twist - this port should publish only one web application.
At first, I thought about configuring Web Gateway to allow only specific web applications (~urls), but Web Gateway configuration is per Apache configuration:

LoadModule csp_module_sa "/opt/webgateway/bin/CSPa24.so"
CSPModulePath "/opt/webgateway/bin/"
CSPConfigPath "/opt/webgateway/bin/"

And while LoadModule has two allowed contexts, server config and virtual host, the csp module must be loaded once in the server context.

But we can use two VirtualHosts and here's how:

1
0 283
Discussion Eduard Lebedyuk · Jan 26, 2024

Multi-tap or multi-press is the name given to the historic technique of writing SMS on the first mobile phones with a keyboard of 10-12 numeric keys. For example, to type LOL you need to press 5 three times, 6 three times and 5 three times again. Your task is to write a function that takes a string as input and returns the repeated digits associated with each character according to the multi-tap system. Should consider letters from A to Z, doesn't distinguish between upper/lowercase characters. Numbers are allowed, and any punctuation should be ignored.

Input

"Example"

Output

"339926755533"

Note

18
1 499
Article Eduard Lebedyuk · Dec 19, 2023 8m read

If you're running IRIS in a mirrored configuration for HA in Azure, the question of providing a Mirror VIP (Virtual IP) becomes relevant. Virtual IP offers a way for downstream systems to interact with IRIS using one IP address. Even when a failover happens, downstream systems can reconnect to the same IP address and continue working.

The main issue, when deploying to Azure, is that an IRIS VIP has a requirement of IRIS being essentially a network admin, per the docs.

To get HA, IRIS mirror members must be deployed to different availability zones in one subnet (which is possible in Azure as subnets can span several zones). One of the solutions might be load balancers, but they, of course, cost extra, and you need to administrate them.

In this article, I would like to provide a way to configure a Mirror VIP without the using Load Balancers suggested in most other Azure reference architectures.

0
1 881
Discussion Eduard Lebedyuk · Oct 20, 2023

Let's do a round of code golf! Last one was very popular!

The Chinese zodiac is a repeating cycle of 12 years, with each year being represented by an animal and an element that changes every 2 years.
The animals are: Rat, Ox, Tiger, Rabbit, Dragon, Snake, Horse, Goat, Monkey, Rooster, Dog and Pig.
The elements are: Wood, Fire, Earth, Metal and Water.
Your task is to write a function that receives a year, and returns the element and the animal that year represent.
Let's use the year 1924 as start point, in the Chinese zodiac the element was Wood and the animal was Rat.

Input

2023

Output

"Water Rabbit"
7
0 593
Article Eduard Lebedyuk · Oct 13, 2023 1m read

For containers in ECS files are not editable if the file size is larger than ephemeral storage free space. For example if I have 4Gb free I can't edit 8Gb file. But if I start container with 50 Gb of ephemeral storage (24Gb free) I can edit my 8Gb file just fine. Even file attributes cannot be changed: chattr -i <file> fails if the amount of free ephemeral storage is not enough (and so db can't be mounted for writing).

0
0 330
Discussion Eduard Lebedyuk · Aug 21, 2023

Has anyone tried AWS Batch with InterSystems IRIS docker images?

I have a noninteractive workload (but it requires internet access from the job to deliver results), so I'm considering using it as a simpler alternative to ECS since Fargate backs both, and that's enough for my use case.

I wonder if anyone tried and cares to share the results, issues, cfn templates.

1
0 186
Discussion Eduard Lebedyuk · Jul 28, 2023

Our previous code golf ended with an overwhelming win, so now it's time for another one. Parenthesis Hell is a Lisp-like esoteric programming language(esolang). As a Lisp-like language, the code consists only of nested matched pairs of opened and closed parenthesis. Your task is to write a method that receives a string of parenthesis and returns 1 if the order of the parenthesis is valid. For example, the string of parenthesis (())() is valid because it contains a matched pair of opened and closed parenthesis at each position. The string ()((()))) is not valid because it contains one unmatched parenthesis.

37
0 718
Question Eduard Lebedyuk · Jul 20, 2023

I have the following setup: REST broker calls inProc BO via BS. As BO initialization is time-consuming, I want to reuse the same BO during the CSP process lifetime.

I have tried the following approaches:

  1. Set %session.Preserve to 1 (I would prefer not to use it as the BO object is not linked to a specific client)
  2. Set $$$EnsInProcPersist to 1 (looked relevant)
  3. Cached BS between calls

However, every time I call my REST endpoint, I get a new BO. Is there a way to cache inProc BOs in the CSP context?

0
0 123
Question Eduard Lebedyuk · Jun 15, 2023

How to import Custom Schemas from VSCode? They look like this:

<?xml version="1.0"?><Categoryname="ITK"description="xmlns:hl7='urn:hl7-org:v2xml' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"std="1"><MessageTypename='ACK'structure='ACK'returntype='ACK'description='xsi:schemaLocation="urn:hl7-org:v2xml ACK.xsd"'/></Category>

Instead of wrapped XML export produced by $system.OBJ:

2
0 306
Article Eduard Lebedyuk · Jun 7, 2023 7m read

Recently I needed to restore a version of a production class, which was overwritten by compilation and running UpdateProduction. As the correct version was unavailable in the source control, I used journals to restore the data. Journals store a plethora of information about what's happening in the system and are quite a powerful tool. This article explains how to work with journals to extract the data you require.

0
0 287
Article Eduard Lebedyuk · May 23, 2023 1m read

When developing interoperability productions, it might be useful to have settings outside of a Business Host. The primary reason is when you need a setting to affect several different Business Hosts and want to guarantee that the value is the same. While System Default Settings can be used to propagate settings for Business Hosts, they can be changed by overriding the value on a BH level (although the advantage of Business Host settings set via SDS is that they don't need custom code which our current approach requires).Another reason is when you need to affect non-setting parts of the

1
0 352