Article Evgeny Shvarov · Jul 25, 2016 2m read

Hi, Community!

Today there are two main settings for your email notification subscriptions.

1. Subscribe to all new posts, all comments, all answers

You can do it in your subscription settings in the Content Types. Click on My Account, go to Subscriptions and click on Content types tab:

 

In this case, you'll get only one notification for every new article or question posted on DC and every answer and comment if you checked this option.

Here are some recipes with this option.

1. Receive all the new posts notifications (without answers and comments in it):

Turn on Post checkbox.

2.

15
1 1006
Question Alexey Maslov · Nov 28, 2017

In short, I wanted to react on CPUusage warnings and alerts with my own actions. It seemed that it was possible in my Caché version (2015.1): 
http://docs.intersystems.com/cache201513/csp/docbook/DocBook.UI.Page.cl…

But all my attempts silently failed. Callback code was as simple as possible: 

Class %z.Monitor.Health Extends SYS.Monitor.Health.AbstractCallback{/// This method is called for every Health Monitor sensor reading.<br>///...
Method Callback(type As %Integer, sensor As %String, value As %String, mean As %String, sigma As %Stri
6
0 482
Question Seth Rothenberg · Nov 29, 2017

Greetings.

We have one vendor who requires us to send data using TCP

through an SSH port forwarding tunnel that is set up in advance.

UNIX scripts maintain this, and the Ensemble interface uses a TCP Adapter.

I was thinking that Ensemble could maintain the SSH tunnel, 

which would improve our detecting of issues.

Has anyone done something like this?

I see that the  class %Net.SSH.Session has a method ForwardPort,

but it doesn't stand up the tunnel by itself.   Instead, it appears 

to return a handle into the tunnel.     It will work a bit differently.

Thanks

Seth

• method ForwardPort(pRemoteHost As %S

1
0 546
Question CJ H · Nov 27, 2017

aa=$zwc(411,1,1,3)/*$bit(1,3,5)*/
bb=$zwc(403,1,0,2)/*$bit(1,3)*/

Is there a handy function to test wether one bit string is covered by another one bitstring? For example, "bb" is covered by "aa".

I currently implement this by one AND operation and then do a bitcount, I just want to know any default function is already out there.

Thanks.

3
0 438
Question Alex Kogan · Nov 28, 2017

Hello,

I was wondering if there is a way to maybe temporarily alter the [Private] tag dynamically or any other way to run a Unit test against class method, which has been labeled as [Private]?

I mean, I understand there is a workaround to create a non private class method inside this class, which will in turn call this private method  and run a Unit test on the non private method, but I am looking for a way to do this without altering the original class.

Thank you,

Alex

2
0 442
Article Katherine Reid · Nov 27, 2017 1m read

Caché will not change the cryptographic settings in an existing TLS configuration when you upgrade.  This means that unless you've updated them yourself, you're still using the values from the very first version you started using SSL in.  

If you've upgraded since creating your TLS configurations, take a moment to look at the enabled protocols and ciphersuites to make sure you've enabled all the versions you want, and disabled the old versions you don't want.

2
0 1040
Question Tom Philippi · Nov 28, 2017

When executing a business process I'd like to share the Login Token from an external system retrieved via one of my business operations across multiple process instances. This means I need to persist the token somewhere. What would be the best approach/pattern to implement this?

The primary idea I had was to store the token and a timestamp in a persistable object and then write a single method in the Business Operation that retrieves the token.

1
0 373
Question Tom Philippi · Nov 27, 2017

How do I set an URL when I post a httpRequest via SendFormArray of my Ensemble Business Operation. Here is my code: 

Class CareHome.RestApiClient Extends EnsLib.REST.Operation
{
Parameter INVOCATION = "Queue";
Method Login(pRequest As CareHome.Request.LoginRequest, Output pResponse As Ens.StringResponse)
{

set tURL = ..Adapter.URL_"login/login"


set httpRequest = ##class(%Net.HttpRequest).%New()
 set httpRequest.ContentType="application/json"
 do ..ObjectToJSONStream(pRequest,.jsonStream,"aeliw")
 set httpRequest.EntityBody = jsonStream
  
 set tSC = ..Adapter.SendFormData(.tHttpResponse,"POST",httpReques

1
0 948
Question Nikita Savchenko · Nov 26, 2017

Hello!

Suppose I have a package with classes which I want to rename. All these classes are persistent and they already have a lot of data stored.

The best I can think of to do is the following:

  1. Duplicate class definitions of old classes, rename each of them and save
  2. Write a routine to copy (duplicate) all the data from old classes to new ones. (which is not trivial at some point)
  3. Refactor all the application's code to use new classes. (which may not be trivial at some point too)
  4. Test the things above
  5. Load new code to live environment and launch the script
  6. Hope that 5. finishes successfully.
10
0 1552
Question Rubens Silva · Nov 9, 2017

Hello.
We're about to implement an application that could use WebSockets intensely so before we head to that direction we need to figure out about how some few things work. That being said, anyone care to give me some enlightenment?

  • What's the criteria for a new session to be created when using WebSockets?
  • What's the factor for calculating how many licenses to would be used when SharedConnection  is enabled for WebSockets?
  • Is there a way to use session in a way that it would optimize the license usage for a single user?
1
0 368
Article Danny Wijnschenk · Nov 25, 2017 4m read

This is (the end) of a series of programming challenges for beginners and experienced Caché programmers.

For an introduction : go to article https://community.intersystems.com/post/advent-code-2016-day1-no-time-t…

This is the 25th and last challenge of the 2016 series of Advent of Code.

In this challenge,  you have to send a signal out,  using the assembunny code interpreter that  we had to make in earlier challenges.

There is one extra instruction added to the assembunny language, which outputs a value (out x).

Using the instructions as input (see http://adventofcode.com/2016/day/25 for the

1
0 580
Question Güvenal · Nov 21, 2017

Greetings!

Hopefully someone has an answer on this, I cannot find any example or understand from the documentation how to acheive this.

I have a SOAP header subclass

Class AddressType Extends %SOAP.Header
{

Parameter ELEMENTQUALIFIED = 1;

Parameter MAXLEN;

Parameter NAMESPACE = "urn:registry:1";

Parameter XMLNAME = "urn:LogicalAddress";

}

In my  %SOAP.WebClient I use it like this:
set customHeader = ##class(AddressType).%New()
do ..HeadersOut.SetAt(customHeader,"AddressType")

Which results in
...
<SOAP-ENV:Header>
<urn:LogicalAddress xmlns="urn:registry:1" xmlns:hdr="urn:registry:1"></urn:LogicalAddress>
</SOA

5
0 786
Article Danny Wijnschenk · Nov 24, 2017 11m read

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

For an introduction : go to article https://community.intersystems.com/post/advent-code-2016-day1-no-time-t…


Today, you need to find your way through a maze (again). There are 8 points of interest in the maze, and you have to visit them all, starting with point 0.
You may visit some points more than once, in random order. The challenge is to find the shortest path through the maze while visiting all points.

The maze looks a bit like this : 

###############################################################
0
0 311
Question Alexandr Ladoshkin · Nov 23, 2017

Dear community!

I have problem with index NULL value.  Unique index doesn't work for this case.  If I use insert and one of parameter is "NULL". Message of constraint doesn't appear and row is inserted into table successfully.  How Can I use index with NULL?

Class TestClassIndx Extends %Persistent
{
Property name As %String [ Private ];
Property age As %String [ Private ];
Property country As %String [ Private ];
Index IndextestUniq On (name, age, country) [ Unique ];
}

INSERT INTO TestClassIndx (name,age,country) VALUES ('1','2',NULL)

Best Regards 

3
0 793
Question Julian Matthews · Nov 23, 2017

I have been working on a project in our Dev environment which resulted in processing a few (million) HL7 messages, and I thought it would be a good idea to purge the namespace in a controlled way. My concern was when it hit the day where the scheduled task would purge 'the day of a million messages', it would fill the Journal Drive quite dramatically and would happen overnight resulting in triggering a response from the poor person on out of hours support.

My idea of a controlled way was to:

  • Run a backup
  • Disable Journalling
  • Run Purge
  • Compact and Truncate DB
  • Re-enable Journalling

Now, I got as far as

6
0 1178
Question Vivek Ranjan · Nov 22, 2017

I ran the below query in three different modes.  Coordinated Universal Time is 5 hours ahead of Eastern Time so there is difference in value from column 1 and column 2 in ODBC, Display mode, but not in Logical Mode. By default the query executes in ODBC mode when we query the data from outside world(via ODBC connection). 

I don't know  why query 2 and query 3 outputs different from query 1.

Query 1. Ran in Logical mode, DATEPART() took in memory stored timestamp data(stored in UTC)

'Hour ' returned are same for both the columns

Query 2. Ran in ODBC mode, DATEPART() took in memory stored timestamp

3
0 515
Article Danny Wijnschenk · Nov 23, 2017 4m read

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

For an introduction : go to article https://community.intersystems.com/post/advent-code-2016-day1-no-time-t…
 

Remember the assembunny language we had to code on day 12 (https://community.intersystems.com/post/advent-code-2016-day12-leonardo…)?

There is a new instruction we have to implement which toggles an instruction x lines away (further or back).

  • For one-argument instructions, inc becomes dec, and all other one-argument instructions become inc.
  • For two-argument instructions, jnz becomes cpy
0
0 399
Question Tom Philippi · Nov 23, 2017

I have an Ensemble installation and just build my first RestService (using %CSP.Rest that forwards them to my Business Service). This works nice and fine when I use postman to make REST calls over http (port 57772). However when I attempt to make a request using https over port 443 I receive the following error:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
    <head>
        <title>404 Not Found</title>
    </head>
    <body>
        <h1>Not Found</h1>
        <p>The requested URL /csp/healthshare/fcoffice/rest/ping was not found on this server.</p>
        <hr>
7
0 1002