Are you all ready for something you wish you knew ages ago (or, in my case, a DECADE ago)? Open up a portal in your favorite instance and go to:

System Administration->Configuration->Additional Settings->Startup

Scroll down to "Terminal Prompt" and click 'Edit'. This allows you to edit what you see on your terminal prompt. You can change that to my current setting: 8,3,2

What does this do? It adds your instance name for your prompt. So now your prompt can look like:

DEVELOPMENT:USER>

12 12
1 1.2K
Article
· Apr 1, 2019 3m read
Closures in ObjectScript

After many sleepless nights it's a pleasure to announce the newer, better, moderner ObjectScript compiler which implemented pretty much everything you ever wanted to have in modern ObjectScript:

  • Design objective of this new compiler is to parse reasonable subset of current ObjectScript syntax which will look readable for stranger, and not scare them with 1 letter syntax. The good start for compiler was the old-good COS Guidelines from here https://github.com/intersystems-ru/cos-guidelines
  • For reasons we mentioned above we do not parse 1 letter syntax. It's declared evil;
  • We do not handle dotted syntax for the same reason - modern syntax with {} is proper replacement for dotted syntax blocks;

But we not only parse the modern ObjectScript syntax, we have implemented finally the long-standing request which we always dreamed about. Closures!

9 9
3 721
Article
· Nov 11, 2019 11m read
Transactions in Global InterSystems IRIS

InterSystems IRIS supports a unique data structure, called globals, for information storage. Essentially, globals are persistent arrays with multi-level indices, having several extra capabilities—transactions, quick traversal of tree structures, and a programming language known as ObjectScript.

I'd note that for the remainder of the article, or at least the code samples, we'll assume you have familiarised yourself with the basics of globals:

6 7
1 805
Article
· Mar 19, 2019 9m read
A Tutorial On WebSockets

Intro

Most server-client communication on the web is based on a request and response structure. The client sends a request to the server and the server responds to this request. The WebSocket protocol provides a two-way channel of communication between a server and client, allowing servers to send messages to clients without first receiving a request. For more information on the WebSocket protocol and its implementation in InterSystems IRIS, see the links below.

9 7
3 5.3K

I wanted to write it as a comment to article of @Evgeny Shvarov . But it happens to be so long, so, decided to post it separately.

Image result for docker clean all images

I would like to add a bit of clarification about how docker uses disk space and how to clean it. I use macOS, so, everything below, is mostly for macOS, but docker commands suit any platform.

6 6
3 6.7K
Article
· Jul 31, 2019 2m read
Anti CSRF Methods

IRIS provides us with anti login CSRF attack mitigation, however this is not the same as a CSRF attack, as login attacks only occur on the login form. There are currently no built-in tools to mitigate CSRF attacks on api calls and other forms, so this is a step in mitigating these attacks.

See the following link from OWASP for the definition of a CSRF attack:

https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)

4 5
1 626
Article
· Mar 28, 2019 2m read
ObjectScript error handling snippets

ObjectScript has at least three ways of handling errors (status codes, exceptions, SQLCODE, etc.). Most of the system code uses statuses but exceptions are easier to handle for a number of reasons. Working with legacy code you spend some time translating between the different techniques. I use these snippets a lot for reference. Hopefully they're useful to others as well.

22 5
19 3.1K

Hello

I made for fun a bash script that creates csv files from a %GOGEN exported file.
%GOGEN, the utility for exporting globals for Cache 5.xx

First I thought it would be very simply with bash, but ...
- if I want a header in the csv file
- if you export with GOGEN more globals together not only one
- if I want a csv file for every global/indexes has the global ..

The simply bash script goes up 100 lines of code. If I will start again with this, I would use Python or Go, not bash.

Example:

For a EXPORTED.GLO file

0 5
0 652

Our team is reworking an application to use REST services that use the same database as our current ZEN application. One of the new REST endpoints uses a query that ran very slowly when first implemented. After some analysis, we found that an index on one of the fields in the table greatly improved performance (a query that took 35 seconds was now taking a fraction of a second).

3 4
0 413

$LIST string format and %DynamicArray and %DynamicObject classes

IRIS, and previously Cache, contain several different ways to create a sequence containing a mixture of data values. A data sequence that has been available for many years is the $LIST string. Another more recent data sequence is the %DynamicArray class, which along with the %DynamicObject class, is part of the IRIS support for JSON string representation. These two sequences involve very different tradeoffs.

$LIST String Format

11 4
8 2.6K

InterSystems Data Platforms products allow you to export and import security settings in two different ways.

This article talks about those options:
- On the command line, using ^SECURITY
- Programmatically, using the Export and Import methods of classes in the Security package

Exporting settings on the command line (^SECURITY)

You can export everything or individual sections of the security settings.

4 4
0 1.9K

Hi,

It turns out that on windows if you run a command with a windows command file you need to escape the % character as %%

In my case I could test freeze and thaw calls at the command line successfully as

..\bin\cache -s. -U%SYS ##Class(Backup.General).ExternalFreeze()

...but when my freeze script ran it would fail.

it turns out that a single '%' is striped when run in a windows command file, and it must be escaped as '%%' windows gets:

1 3
0 748

This is a quick note on what happens when, on your CSP page, you call a cache script which returns a %Boolean and store that value in a javascript variable.

When you call a script with language="cache" and returntype="%Boolean" from a javascript script, the return value is interpreted as a string, not as a boolean.

Here's an example:

A cache script that returns (in theory) a "false" value:

0 3
0 511

In this article, we will explore the development of an IRIS client for consuming RESTful API services that have been developed to the OData API standard.

We will be exploring a number of built-in IRIS libraries for making HTTP requests, reading and writing to JSON payloads, and seeing how we can use them in combination to build a generic client adaptor for OData. We will also explore the new JSON adapter for deserializing JSON into persistent objects.

4 3
2 958

The %Net.SSH.Session class lets you connect to servers using SSH. It's most commonly used with SFTP, especially in the FTP inbound and outbound adaptors.

In this article, I'm going to give a quick example of how to connect to an SSH server using the class, describe your options for authenticating, and how to debug when things go wrong.

Here's an example of making the connection:

10 3
0 5.5K

If a picture is worth a thousand words, what's a video worth? Certainly more than typing a post.

Please check out my "Coding talks" on InterSystems Developers YouTube:

1. Analysing InterSystems IRIS System Performance with Yape. Part 1: Installing Yape

https://www.youtube.com/embed/3KClL5zT6MY
[This is an embedded link, but you cannot view embedded content directly on the site because you have declined the cookies necessary to access it. To view embedded content, you would need to accept all cookies in your Cookies Settings]

Running Yape in a container.

2. Yape Container SQLite iostat InterSystems

https://www.youtube.com/embed/cuMLSO9NQCM
[This is an embedded link, but you cannot view embedded content directly on the site because you have declined the cookies necessary to access it. To view embedded content, you would need to accept all cookies in your Cookies Settings]

Extracting and plotting pButtons data including timeframes and iostat.

13 3
2 1.4K

Hi guys!

Portrait of Madame X, Gustave Caillebotte.

One of the features I like in InterSystems ObjectScript is how you can process array transformations in a specific method or a function.

Usually when we say "process an array" we assume a very straightforward algorithm which loops through an array and does something with its entries upon a certain rule.

The trick is how you transfer an array to work with into a function.

One of the nice approaches on how to pass the information about an array is using $Name and Indirection operator.

Below you can find a very simple example which illustrates the thing.

3 2
1 535