This is a series of programming challenges for beginners and experienced Caché programmers.

For an introduction : go to article

The challenge today is about some basic cryptography : you will have to generate data for a one-time pad (OTP) (see for more info).

0 0
0 280

This code snippet sends an XML request to a server and saves the response to a file. The class method "test" runs the code:

Class objectscript.postXML
    classmethod test() {
        Set HTTPRequest = ##class(%Net.HttpRequest).%New()
        Set HTTPRequest.ContentType = "text/xml"
        Set HTTPRequest.NoDefaultContentCharset = 1
        Set HTTPRequest.Location = "ITOMCZ"
        Set HTTPRequest.Server = ""
        Do HTTPRequest.RemoveHeader("User-Agent")  
        Do HTTPRequest.RemoveHeader("Accept-Encoding") 
        Do HTTPRequest.RemoveHeader("Connection")
        Do HTTPRequest.SetHeader("Expect","100-continue")
        Set RequestXML = ##class(%Library.File).%New("c:\test.xml")
        Do RequestXML.Open("RS")
        Do HTTPRequest.EntityBody.CopyFrom(RequestXML)
        Do RequestXML.%Close()
        Do HTTPRequest.Post(HTTPRequest.Location)
        Do $System.OBJ.Dump(HTTPRequest)
        Do $System.OBJ.Dump(HTTPRequest.HttpResponse)
        Write HTTPRequest.HttpResponse.Data.Size
        Write HTTPRequest.ContentLength
        Set ResponseStream = ##class(%Stream.FileBinary).%New()
        // Second part is typically the file extension, i.e.: application/pdf -> pdf
        Set FileType = $Piece(HTTPRequest.HttpResponse.GetHeader("CONTENT-TYPE"),"/",2)
        Set ResponseStream.Filename = "C:\test."_FileType
        Write ResponseStream.CopyFrom(HTTPRequest.HttpResponse.Data)
        Write ResponseStream.%Save()
        Do ResponseStream.%Close()

Here's a link to the code on GitHub

0 0
0 603

 Pre-requisite - Basic knowledge of ENSEMBLE and ObjectScript

My both previous sessions were related to OBJECTSCRIPT.
This time, we are going to add a flavour Ensemble/Healthshare,
to be informative and fast.

In this session we are going to discuss about - 
"Informative and Fast WEB API VIA ObjectScript and Ensemble/HealthShare"

Web API can be REST or SOAP. We will taking example of SOAP in this session.
However, whatever I demonstrate today, will also be applicable for REST.

0 0
0 251

Our company is in the process of converting our software for use in Intersystems IRIS and one of the major sections of the software makes use of a custom statically-linked C library using the $ZF("function-name") functionality. During this, I found out that the process for setting up the C library to be used within the database platform has changed significantly between Cache and IRIS.

5 0
0 174
Laurel James (GJS) · Apr 20, 2021 3m read
Why gj :: locate?

You may think it isn’t too difficult to get from label+offset^routine to the actual source line responsible for the error.  For an expert it isn't that hard... most of the time.  But there are enough oddities and special rules that even an expert can get it wrong, whilst spending a lot of time trying to get there.

gj :: locate is the latest tool from George James Software – it debugs any error, class or routine by converting the location of an error in compiled .int code to the corresponding location in your source, and then taking you right there.

Image this scenario…

4 0
1 149
Gevorg Arutiunian · Sep 6, 2018 1m read
Save a file using %Net.HttpRequest

This code snippet allows for a file on the web to be saved into the file system. Specify the server and GET request, as well as the directory the file should be saved to. The class method "test" runs the code:

Class objectscript.saveFileHTTP Extends %RegisteredObject
    classmethod test() {
        Set httprequest = ##class(%Net.HttpRequest).%New()
        Set httprequest.Server = ""
        Do httprequest.Get("documentation/cache/20172/pdfs/GJSON.pdf")
        Do $System.OBJ.Dump(httprequest.HttpResponse)
        Set stream=##class(%FileBinaryStream).%New()
        Set stream.Filename="c:\test.pdf"

        Write stream.CopyFrom(httprequest.HttpResponse.Data)
        Write stream.%Save()

Here's a link to the code on GitHub

2 0
0 670

Hi ObjectScript developers!

How to Protect Your Belongings from Pests While Moving - Delicate ...

InterSystems ObjectScript is perhaps the best language on the planet to deal with globals - and it is an interpretable language.

Yes, it has a compiler. But even the compiler can compile some lines in ObjectScript which will then fire as bugs during the runtime.

There are some technics on how to avoid that such as unit testing, coding guidelines and your coding experience, of course ;)

Here I want to present to you the yet another approach to how you can reduce the number of errors in your ObjectScript runtime and enforce coding guidelines - it's an ObjectScript Quality tool developed by Lite Solutions, InterSystems solution partner.

See the details below.

4 0
0 338

Wir suchen für ein Unternehmen unserer Firmengruppe

eine/n ERP System Developer / Programmierer/ Software Entwickler

Unser Partnerunternehmen ist ein international agierendes Handelsunternehmen mit Sitz in der Nähe von Wien.

Der zukunftsorientierte IT Bereich entwickelt intelligente innovative Lösungen für die Vielfalt der Herausforderungen, die sich täglich stellen. Die Fülle der abwechslungsreichen Aufgaben und Projekte, sowie die Art und Weise wie zusammengearbeitet wird, bietet hervorragende Wachstums- und Entwicklungschancen.

3 0
0 536

Points to remember before you start: 

  1. It is not possible in a COS (Caché Object Script) job/process context to have multiple Named Pipes. It is a one Named Pipe per job/process limited line of communication. 
  1. Named Pipes, in Caché, like most pipes on most operating systems are Unidirectional. That means you open them for either Read or Write, but not both. 
2 0
0 575
Vitaliy Serdtsev · Jul 7, 2017 19m read
Indexing of non-atomic attributes

Quotes (1NF/2NF/3NF)ru:

Every row-and-column intersection contains exactly one value from the applicable domain (and nothing else).
The same value can be atomic or non-atomic depending on the purpose of this value. For example, “4286” can be
  • atomic, if its denotes “a credit card’s PIN code” (if it’s broken down or reshuffled, it is of no use any longer)
  • non-atomic, if it’s just a “sequence of numbers” (the value still makes sense if broken down into several parts or reshuffled)

This article explores the standard methods of increasing the performance of SQL queries involving the following types of fields: string, date, simple list (in the $LB format), "list of <...>" and "array of <...>".

7 0
0 663

Hello again and welcome to the Part 3 - Using the SQL API!

If you have been wondering about how to use SQL along with Frontier, you came to the right place. That's because since Frontier wraps the common Caché SQL API within it's own, you need to use the API provided from it. But you don't need  to worry about its learning curve, because the Frontier SQL API is really simple.

2 0
0 505
Gevorg Arutiunian · Oct 26, 2018 1m read
Send an HTML Email

This code snippet contains the class method "test" which sends an HTML email. Change the literal strings in the method to customize the email's from address, to address, subject, and body:

Class objectscript.sendEmail Extends %RegisteredObject
    classmethod test() {
        set m=##class(%Net.MailMessage).%New()
        set m.From=""
        set m.IsHTML=1
        do m.To.Insert("")
        set m.Subject="Sent by IRIS mail"
        set m.Charset="iso-8859-1"
        do m.TextData.Write("<HTML><HEAD><TITLE></TITLE>"_$char(13,10))
        do m.TextData.Write("<META http-equiv=Content-Type content=""text/html; charset=iso-8859-2""></HEAD>"_$char(13,10))
        do m.TextData.Write("<BODY><FONT face=Arial size=2>Test <B>Test</B></FONT></BODY></HTML>")
        set s=##class(%Net.SMTP).%New()
        set s.smtpserver=""
        set status=s.Send(m)

Here's a link to the code on GitHub

0 0
1 803

Good afternoon everyone,

I hope you are well,

I am currently working on the below opportunity and if anyone here would like to hear more details please feel free to contact me on 01908 886 030 or

Met with the client yesterday, beautiful office in Waterloo London, latest tech available with many benefits including working from home 2 days/w as well!

Intersystems Caché Senior Software Engineer


4 0
1 408

Hi Developers!

For those who want to participate in the Advent of Code 2019 and code with ObjectScript in IRIS, I created a very simple but handy Github Template.

Use the green button

to copy template in your own repo, clone the repo and run in the repo folder:

docker-compose up -d

you will get InterSystems IRIS 2019.4 Community Edition running with the template classes to load input data from files and Day1 solution.

This is also set up to start crafting solutions of Advent of Code 2019 and edit, compile and debug ObjectScript with VSCode addon.

Happy coding with Advent of Code 2019!

0 0
0 179
InterSystems Official
Raj Singh · Oct 20, 2020
ObjectScript extension for VS Code reaches 1.0

Hello Developer Community!

Once again I'm here to talk about the ObjectScript extension for Visual Studio Code, and this time we are excited to announce the release of version 1.0!

The community has come together in an unprecedented way to deliver this product with InterSystems, and its only fitting that a tool so critical to  developer productivity would be built with community testing, feedback and source code from the very beginning.

16 0
0 749



In this presentation, developer oriented, we will cover this tool, how it works, how you can use it/administer it, etc. Duration 30 minutes.

The topics will include:

  • a short presentation of Caché Quality and SonarQube (which this plugin uses),
  • a demonstration of the rules and how to tailor them to your need.

Questions will be more than welcome! Hope to see you there!

And a big thanks to Evgeny Shvarov who made this possible!

2 0
0 513

This is a series of programming challenges for beginners and experienced Caché programmers.

For an introduction : go to article

The challenge of day 16 is about generating random data using a modified version of a dragon curve (you can find more info on fractal curves like Dragon here :

0 0
0 269
First-class functionwiki

In computer science, a programming language is said to have first-class functions if it treats functions as first-class citizens. This means the language supports passing functions as arguments to other functions, returning them as the values from other functions, and assigning them to variables or storing them in data structures. Some programming language theorists require support for anonymous functions (function literals) as well. In languages with first-class functions, the names of functions do not have any special status; they are treated like ordinary variables with a function type.

This post continues the article “Declarative development in Caché”.

[2357111317].forEach(function(i) {

How to do something like this in Caché using COS?

Below are some exercises on this topic.

2 0
0 357

Have you ever needed a math function but could not find what you needed and ended up writing your own? Look no further! ObjectScript-Math is here to solve all your math related function needs.

ObjectScript-Math is an Open Source library for ObjectScript Math functions. It is now available on Open Exchange. This library contains a mix of new functions that are not currently available and functions that are available. The existing functions will be wrapped for use from ObjectScript-Math so that all Math functions can have a central location.

This library will continue to grow, so give it a try and give your feedback!

Don't see what you are looking for? Please feel free to submit requests for additional functions or contribute code yourself!

3 0
1 319