Discussion Eduard Lebedyuk · Nov 17, 2021

We need to send some coordinates to a spaceship through a laser beam. To do that we have to encode it, and beam it out into space. Your mission is to implement the encoder with a compression standard. As usual shortest solution wins.

Task

You will receive a string of comma-separated integers and you will return a new string of comma-separated integers and sequence descriptors.

Input

"0,2,4,5,5,5,5,5,3,4,5"

Output

"0-4/2,5*5,3-5"

Note

8
2 634
Discussion Eduard Lebedyuk · Oct 8, 2021

Have you ever seen those vaccum compressed towels, that look like a pill and after you add water became a towel?

That's our challenge for today. As usual shortest solution wins.

Task

You will receive an integer number and you will return a new number where each digit is repeated a number of times equals to its value.

Input:

42

Output:

444422

Note:

11
0 493
Announcement Eduard Lebedyuk · Sep 10, 2021

Hello!

Want to get 5000 points on GlobalMasters?

I'm launching a bug bounty for a bug with which I've been struggling for the last 4 years. Have tried to resolve it many times, but no  dice - can't track it down.

Here's the issue.

To claim this bounty you need to:

  1. Create a pull request with the code to fix the issue outlined here.
  2. In the pull request OR in the issue OR in the commit message describe what's the reason for this bug and how your change fixes it.

First come first serve. Bounty would be paid only ONCE for a first working solution.

Challenge details are here.

11
0 473
Announcement Eduard Lebedyuk · Aug 31, 2021

We invite you to the webinar "InterSystems Reports",  on Tuesday, September 7th, at 10:00 (Moscow time). The language of the webinar is Russian.

InterSystems Reports, a part of InterSystems IRIS and InterSystems IRIS for Health, is a robust, modern report generation and publishing solution that includes:

  • Report Designer - a tool for report developers to create and preview reports.
  • Report Server, which gives users access to run, schedule, filter, and modify reports.

In this webinar, we'll cover all the steps of working with the InterSystems Reports, including:

0
0 277
Question Eduard Lebedyuk · Aug 20, 2021

In my Business Operation I need to execute a bookkeeping method every X seconds.

How can I do that?

There are two workarounds (I dislike both):

  1. Execute bookkeeping on process start - but there might be no requests at all
  2. Create a BS that sends messages to BO every X seconds - it makes production more complex and also queues might not guarantee that the method is executed on schedule.

Thoughts?

8
0 308
Question Eduard Lebedyuk · Aug 17, 2021

Alerts are automatic notifications triggered by specified events or thresholds being exceeded.

InterSystems Documentation

I have a Business Service connected to a machine with ~100 sensors. BS receives sensor values once a second.

Several conditions determine if a Business Service should raise an alert (it's a list of: sensor id > threshold).

I have three questions:

2
0 262
Discussion Eduard Lebedyuk · Aug 16, 2021

A quine is a computer program which takes no input and produces a copy of its own source code as its only output.

Wikipedia.

How about a fun challenge?

The task is to write a quine in InterSystems ObjectScript. It can be a class, or a method, or a routine, or just a line to be executed in a terminal. You decide!

Here's some resources you might consider useful:

Hard mode: do not use source code access functions.

Here's my (extremely uninspired, I know) attempt:

15
0 586
Question Eduard Lebedyuk · Jul 28, 2021

I have a BPL Business process which always processes messages - mainly it waits for responses since downstream systems are seriously async.

I need to update this process.

Wwould the existing instances of this Business Process complete correctly after the update?

My BPL changes would result in:

  1. New S method in the Thread class
  2. New OnResponse method in the context class

Both changes are in the middle of the process, so there are S/OnResponse methods before and after my change.

What if it's only a new S method? What if it's only a new OnResponse method?

4
0 155
Question Eduard Lebedyuk · Jun 4, 2021

Is there a way to add/substract from a pivot variable?

I have this MDX:

SELECT
  NON EMPTY [DateOfSale].[Actual].[YearSold].&[$variable.Year] ON 0,
  NON EMPTY [Product].[P1].[Product Name].Members ON 1
FROM [HOLEFOODS]

And with pivot variable Year equal to, say, 2016 it works:

 

Now I want to add previous year  first with one pivot variable and one explicit reference. It also works:

SELECT
  NON EMPTY
  {
    [DateOfSale].[Actual].[YearSold].&[$variable.Year],
    [DateOfSale].[Actual].[YearSold].&[2015]
  } ON 0,
  NON EMPTY [Product].[P1].[Product Name].Members ON 1
FROM [HOLEFOODS]

 

3
0 161
Article Eduard Lebedyuk · Jun 3, 2021 7m read

IMPORTANT NOTE InterSystems no longer provides a separate InterSystems Reports Server container. To run containerized InterSystems Reports Server, use Logi Reports Server container and your InterSystems Reports Server license. Documentation.

InterSystems Reports is powered by Logi Report (formerly named JReport), a product of Logi Analytics. InterSystems Reports is supported by InterSystems IRIS and InterSystems IRIS for Health. It provides a robust modern reporting solution that includes:

  • Embedded operational reporting which can be customized by both report developers and end users.
  • Pixel-perfect formatting that lets you develop highly specific form grids or other special layout elements for invoices, documents, and forms.
  • Banded layouts that provide structure for aggregated and detailed data.
  • Exact positioning of headers, footers, aggregations, detailed data, images, and sub-reports.
  • A variety of page report types.
  • Large-scale dynamic report scheduling and distribution including export to PDF, XLS, HTML, XML, and other file formats, printing, and archiving for regulatory compliance.

InterSystems Reports consists of:

  • A report designer, which provides Design and Preview Tabs that enable report developers to create and preview reports with live data.
  • A report server which provides end users browser-based access to run, schedule, filter, and modify reports.

From InterSystems documentation.

This article focuses on the Server part of InterSystems Reports and provides a guide on running Report Server in containers while persisting all the data.

2
3 854
Article Eduard Lebedyuk · Apr 21, 2021 1m read

It's possible to enable Ctrl+C / Ctrl+V in IRIS Terminal for Windows.

To do that, open Terminal and select Edit > User Settings and enable Windows edit accelerators. This settingspecifies whether the Terminal enables the common Windows edit shortcuts (Ctrl+C, Ctrl+V, Ctrl+Shift+V), in addition to the basic Terminal edit shortcuts (Ctrl+Insert and Shift+Insert).

After that Ctrl+C / Ctrl+V would work.

Also <SYNTAX> errors after incorrect copy/paste go away.

Docs.

7
1 421
Discussion Eduard Lebedyuk · Apr 2, 2021

Images for other languages are often build using multistage build process.

What about InterSystems IRIS?

Consider this Dockerfile:

FROM irishealth-community:2020.4.0.524.0 AS builder

# Load code into USER and compile
# Adjust settings, etc.

FROM irishealth-community:2020.4.0.524.0

# replace in standard kit with what we modified in first stage

COPY --from=builder /usr/irissys/iris.cpf /usr/irissys/.
COPY --from=builder /usr/irissys/mgr/IRIS.DAT /usr/irissys/mgr/.
COPY --from=builder /usr/irissys/mgr/user/IRIS.DAT /usr/irissys/mgr/user/.
9
0 308
Article Eduard Lebedyuk · Mar 4, 2021 1m read

Recently I wanted to get a list of all cached queries and their texts. Here's how to do that.

First create an SQL Procedure returning Cache Query text from a Cached Query routine name:

Class test.CQ
{

/// SELECT test.CQ_GetText()
ClassMethod GetText(routine As %String) As %String [ CodeMode = expression, SqlProc ]
{
##class(%SQLCatalog).GetCachedQueryInfo(routine)
}

}

And after that you can execute this query:

SELECT Routine, test.CQ_GetText(Routine)
FROM %SQL_Manager.CachedQueryTree()

And get a list of Cached Queries:

4
0 722
Article Eduard Lebedyuk · Jan 12, 2021 1m read

DataGrip is a multi-engine database environment targeting the specific needs of professional SQL developers, DataGrip makes working with databases an enjoyable and productive experience.

To work with InterSystems IRIS from DataGrip you'll need to add InterSystems JDBC driver first (once per DataGrip) and after that add all your InterSystems IRIS connections.

Part 1: Add InterSystems IRIS JDBC Driver

1. Go To File → DataSources

2. Go to + → Driver

3. Set Driver properties:

0
0 850
Discussion Eduard Lebedyuk · Jan 10, 2021
To start the year let's have a round of CodeGolf!
You know the drill. Shortest solution wins.Print a size ascending range of Diamonds using the numbers 1 to 9, ranging from size 1 to size N, each diamond separated by a blank line.
A size 1 diamond should look like this, a single centered 1:
1
With the size N=9 diamond looking like this:
1
121
12321
1234321
123454321
12345654321
1234567654321
123456787654321
12345678987654321
123456787654321
1234567654321
12345654321
123454321
1234321
12321
19
0 588
Question Eduard Lebedyuk · Jan 2, 2021

I have an SQL text index defined like this

Index TextIndex On (Text) As %iFind.Index.Basic(IGNOREPUNCTUATION = 1, INDEXOPTION = 0, LANGUAGE = "en", LOWER = 1);

If I run a query like this:

SELECT
Text
FROM Post
WHERE %ID %FIND search_index("TextIndex",'ABC')

I get 20 results with posts containing the term ABC.

But each post can contain the term ABC several times.

Is there a way to get a total count of ABC term?

Is there a way to get a count of ABC term in each Post?

13
0 518
Article Eduard Lebedyuk · Nov 19, 2020 3m read

In this article, we will run an InterSystems IRIS cluster using docker and Merge CPF files - a new feature allowing you to configure servers with ease.

On UNIX® and Linux, you can modify the default iris.cpf using a declarative CPF merge file. A merge file is a partial CPF that sets the desired values for any number of parameters upon instance startup. The CPF merge operation works only once for each instance.

3
1 762
Question Eduard Lebedyuk · Aug 26, 2020

I have a class:

Class test.Person Extends (%Persistent, %XML.Adaptor)
{
Property Name;
}

I want to serialize it into this XML:

<Person>
    <Id>1</Id>
    <Name>Ed</Name>
</Person>

Is it possible?

It's for the Visual Trace so I can't use %XML.Writer.

2
0 364
Article Eduard Lebedyuk · Aug 12, 2020 3m read

Productions often need to receive REST requests.

Here's how to do that.

1. Create proxy Service:

/// Empty BS we would use to send Produciton requests
Class production.ProxyService Extends Ens.BusinessService
{
}

2. Add it to production as RESTService (or any other name).

3. Write your rest broker (docs, more docs)

4. In your handler method create the message and call target BP/BO like this

8
1 1105
Article Eduard Lebedyuk · Aug 7, 2020 5m read

In this article, I will show how you can easily containerize  .Net/Java Gateways.

For our example, we will develop an Integration with Apache Kafka.

And to interoperate with Java/.Net code we will use PEX .

Architecture

Our solution will run completely in docker and look like this:

Java Gateway

First of all, let's develop Java Operation to send messages into Kafka. The code can be written in your IDE of choice and it can look like this.

In short:

7
1 1400
Article Eduard Lebedyuk · Aug 3, 2020 3m read

InterSystems IRIS currently limits classes to 999 properties.

But what to do if you need to store more data per object?

This article would answer this question (with the additional cameo of Community Python Gateway and how you can transfer wide datasets into Python).

The answer is very simple actually - InterSystems IRIS currently limits classes to 999 properties, but not to 999 primitives. The property in InterSystems IRIS can be an object with 999 properties and so on - the limit can be easily disregarded.

13
1 817
Question Eduard Lebedyuk · Jul 6, 2020

I'm building a .Net Core Gateway container. Here's the issue.

As a final step I'm building a .Net Core 2.1 library. It has a runnable dependency - .Net Gateway, which I need to start first.

However dotnet publish generates .runtimeconfig.json and .deps.json only for my library and not for my dependency (.Net Gateway).

Is there a way to force dotnet to generate .runtimeconfig.json and .deps.json for a dependency?

I have tried:

2
0 8751