Article Eduard Lebedyuk · May 18, 2023 2m read

Let's have a round of Code Golf!

String rotation is when you take a word and move some of its letters to the end of the word, so the first letter becomes the second letter, the second letter becomes the third, and so on. Last letter becomes first. Rotation can happen only in one direction →. Your task is to write a method that will receive two strings. It then must return an integer value of how many times needed to rotate the strings to be equal. As usual shortest solution wins.

Input

"hello", "llohe"

Output

3

  ​

Note

Rules

14
0 418
Article Eduard Lebedyuk · Apr 26, 2023 2m read

Git stores complete history - meaning you would never lose your files, even if they are deleted, they are still available. That, however, presents an issue if large or sensitive files have been committed. Deleting them DOES NOT remove them from history. Recently one of the repos I work on became unexpectedly large, so here's how you can resolve that:

0
0 230
Discussion Eduard Lebedyuk · Mar 2, 2023

It's time for a Code Golf round!

Isogram 

A word or phrase that has no repeating letters, consecutive or non-consecutive.


Implement a method that checks if the received string is an isogram or not.
Assume the empty string is an isogram. 
Ignore the letter case.

Allowed inputs: A-Z, a-z.

As usual, the shortest solution wins!

11
0 372
Article Eduard Lebedyuk · Feb 10, 2023 6m read

In this article, we will establish an encrypted JDBC connection between Tableau Desktop and InterSystems IRIS database using a JDBC driver. While documentation on configuring TLS with Java clients covers all possible topics on establishing an encrypted JDBC connection, configuring it with Tableau might be a little bit tricky, so I decided to write it down.

Securing SuperServer

3
1 702
Question Eduard Lebedyuk · Jan 19, 2023

I have a production with one Business Host - a Business Service which I need to scale automatically to consume ~80% of CPU time.
Business Service pulls data from a (non-FIFO) queue so that I can adjust pool size without any issues.

So far, I'm planning a different BS running every X seconds and sampling CPU with $system.Process.GetCPUTime() and scaling the pool size of the main BS up/down based on that metric.

Has anyone tried something similar? Any advice/code samples would be appreciated.

6
0 293
Question Eduard Lebedyuk · Jan 11, 2023

In Interoperability productions Inbound Adapters extract and separate retrieval logic from actual payload processing, which is left to a BS.

At a high level, an adapter looks like this:

Class MyAdapter Extends Ens.InboundAdapter {

Method OnTask() As%Status
{
  Set request = ..RetrieveRequest()
  Set sc = ..BusinessHost.ProcessInput(request)
  Set..BusinessHost.%WaitForNextCallInterval=1
  Quit sc

}
}

However, in many cases, RetrieveRequest retrieves a batch payload, so our adapter looks like this instead:

4
0 375
Question Eduard Lebedyuk · Nov 30, 2022

I initialize a HS.SDA3.Container from a XML stream and I need to iterate over it twice. What is a correct way of doing it? Is it enough to adjust StreamPos/StreamOref?

The optimal solution would be to use one loop, but it's not possible to combine the processing logic.

set oSDA = ##class(HS.SDA3.Container).%New()
do oSDA.InitializeXMLParse(.tQuickStream)

while oSDA.GetNextSDA(.tType, .tPatient) {
        // processing logic A
}

set oSDA.StreamPos = 1do oSDA.StreamOref.Rewind()

while oSDA.GetNextSDA(.tType, .tPatient) {
        // processing logic B
}
4
1 491
Discussion Eduard Lebedyuk · Nov 9, 2022

We're back with a code golf!

You will receive a string. Each word in the string will contain a number. This number is the position that word should have in the sentence. If the input string is empty, return an empty string. The output can only be in words, without the given numbers.

##Input "i2s T1his Te4st a3"

##Output This is a Test

13
0 627
Article Eduard Lebedyuk · Nov 4, 2022 9m read

If you're running IRIS in a mirrored configuration for HA in AWS, 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 AWS, is that an IRIS VIP has a requirement of both mirror members being in the same subnet, from the docs:

5
2 3049
Article Eduard Lebedyuk · Sep 26, 2022 11m 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, let's talk about interoperability.

Issue

When you have an active interoperability production, you have two separate process flows: a working production that processes messages and a CI/CD process flow that updates code, production configuration and system default settings.

Clearly, CI/CD process affects interoperability. But questions are:

  • What exactly happens during an update?
  • What do we need to do to minimize or eliminate production downtime during an update?
0
1 560
Discussion Eduard Lebedyuk · Sep 16, 2022
 
Several models, such as DALL-E, Midjourney, and StableDiffusion, became available recently. All these models generate digital images from natural language descriptions. The most interesting one, in my opinion, is StableDiffusion which is open source - released barely a few weeks ago. There's now an entire community trying to leverage it for various use cases.
0
0 930
Article Eduard Lebedyuk · Jul 13, 2022 7m read

After almost four years on hiatus, my CI/CD series is back! Over the years, I have worked with several InterSystems clients, developing CI/CD pipelines for different use cases. I hope the information presented in this article will be helpful to someone.

This series of articles discusses several possible approaches toward software development with InterSystems technologies and GitLab.

We have an exciting range of topics to cover: today, let's talk about things beyond the code - namely configurations and data.

Issue

4
3 813
Article Eduard Lebedyuk · Jul 4, 2022 3m read

InterSystems Native SDK for Python is a lightweight interface to InterSystems IRIS APIs that were once available only through ObjectScript.

I'm especially interested in the ability to call ObjectScript methods, class methods, to be precise. It works, and it works great, but by default, calls only support scalar arguments: strings, booleans, integers, and floats.

But if you want to:

  • Pass or return structures, such as dicts or lists
  • Pass or return streams

You'll need to write some glue code or take this project (installs with pip install edpy). edpy package gives you one simple signature:

call(iris, class_name, method_name, args)

which allows you to call any ObjectScript method and get results back.

3
3 566
Discussion Eduard Lebedyuk · Jul 1, 2022

Leet (or "1337"), also known as eleet or leetspeak, is a system of modified spellings used primarily on the Internet. It often uses character replacements in ways that play on the similarity of their glyphs via reflection or other resemblance. Additionally, it modifies certain words based on a system of suffixes and alternate meanings. There are many dialects or linguistic varieties in different online communities. Wikipedia

You'll have to translate a string into a LeetSpeak. As usual shortest solution wins.

##Input "Listen"

##Output 1|573n

##Note

8
0 590
Discussion Eduard Lebedyuk · May 3, 2022

An anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. For example, the word anagram itself can be rearranged into nag a ram, also the word binary into brainy and the word adobe into abode. Wikipedia

You will receive two strings returning true if the two arguments given are anagrams of each other. As usual shortest solution wins.

##Input "Listen", "Silent"

##Output 1

##Note

33
0 662
Article Eduard Lebedyuk · Mar 5, 2022 6m read

Function as a service (FaaS) is a category of cloud computing services that provides a platform allowing customers to develop, run, and manage application functionalities without the complexity of building and maintaining the infrastructure typically associated with developing and launching an app. Building an application following this model is one way of achieving a "serverless" architecture, and is typically used when building microservices applications.  

Wikipedia

FaaS is an extremely popular approach to running workloads in the cloud, allowing developers to focus on writing code.

4
2 405
Discussion Eduard Lebedyuk · Mar 4, 2022

New month, new code golf!

You will receive a string with a label code with numbers and letters. Our challenge is to check if this code begins with 1, 2, or 3 and ends with A, B, C, S, or R. It should return true(1) if so or return false(0) otherwise. As usual shortest solution wins.

##Input "198739A79D9R"

##Output 1

##Note

Rules

  1. The signature of the contest entry MUST be:
4
1 364
Discussion Eduard Lebedyuk · Feb 2, 2022

You will receive a string of comma-separated integers whose elements have both a negative and a positive value, except for one integer that is either only negative or only positive, our challenge will be to find that integer. As usual shortest solution wins.

##Input "1,-1,2,-2,3"

##Output 3

3 has no matching negative appearance

##Note

Rules

  1. The signature of the contest entry MUST be:
34
0 780
Article Eduard Lebedyuk · Jan 26, 2022 4m read

If you're deploying to more than one environment/region/cloud/customer, you will inevitably encounter the issue of configuration management.

While all (or just several) of your deployments can share the same source code, some parts, such as configuration (settings, passwords) differ from deployment to deployment and must be managed somehow.

In this article, I will try to offer several tips on that topic. This article talks mainly about container deployments.

4
0 456