Announcement Evgeny Shvarov · Sep 1, 2016

 

Here is the digest of  the most interesting and valuable posts on Developer Community published in August 2016.

Here we go!

News, events, releases

JSON changes in Caché 2016.2

Announcement about the Caché 2016.2 and 2016.3 Field Test Programs

Alert: Database Compaction

2016.1.2 Maintenance Release

 

Most viewed

Announcement about the Caché 2016.2 and 2016.3 Field Test Programs - 406

JSON changes in Caché 2016.2 - 306

What is causing the journals to grow rapidly? - 197

Writing forward compatible JSON in 2016.1 - 190

how to connect to the Cache database from node.js ? - 188

Caché MapReduce - introduction to BigData and MapReduce concept - 155

NewBie's Corner Session 17 New command - 153

Global references done internally by Cache - 145

Tips & Tricks - Process-private Globals as a class storage - 118

ZUTILS - 114

 

Most voted

Improve SQL Performance for Date Queries, AGAIN! - 8

JSON changes in Caché 2016.2 - 8

Caché MapReduce - introduction to BigData and MapReduce concept - 7

Announcement about the Caché 2016.2 and 2016.3 Field Test Programs - 7

Writing forward compatible JSON in 2016.1 - 7

HealthShare's new SDA extensions - 6

The Art of Mapping Globals to Classes 1 of 3 - 6

Enterprise Monitor and HealthShare - 5

What is causing the journals to grow rapidly? - 4

TLS v1.2 support in Caché - 4

 

Most commented

Setting ContentType in Rest Service - 13

Use of $ZUTIL(49) is deprecated - 11

CSP CONFIGURATION - 10

Announcement about the Caché 2016.2 and 2016.3 Field Test Programs - 10

Calling javascript method from Zen method, with parameters - 9

Git Continuous Integration - What are the most important differences between CacheGitHubCI and CacheUpdater? - 8

how to connect to the Cache database from node.js ? - 7

What is causing the journals to grow rapidly? - 7

Problem in the Property parameters (DISPLAYLIST | VALUELIST) [ SOLVED ] - 7

NewBie's Corner Session 17 New command - 7

0
0 375
Article Evgeny Shvarov · Aug 31, 2016 1m read

Hi!

Sometimes you see that call to DeepSee cube building method:

w ##class(%DeepSee.Utils).%BuildCube("CubeName")

does nothing.

Here are my 2 cents on possible reasons.

1. Run DeepSee Reset method in certain Namespace:

NAMESPACE> w ##class(%DeepSee.Utils).%Reset()

and try again.

2. Make sure, that all the indices in your base class for the cube are rebuilt, rebuild them and run it again:

w ##class(%DeepSee.Utils).%BuildCube("CubeName")

Hope this will save some time for you, and will be helpful as was to me.

2
0 470
Article Evgeny Shvarov · Jul 27, 2016 1m read

Hi, Community!

You know, that when we build hierarchies in DeepSee dimension all the members of lower level should be the part of one member of the higher level.

If not you'll get some empty results in MDX queries with this hierarchy.

With Time dimensions the obvious valid hierarchy is Year->Month->Day, cause every Month consists of one Year and every day consists of one month. 

But be aware of using Year->Month->Week->Day hierarchy. In this case, there are some weeks in the year (most of them), which consist of two months.

3
0 470
Question Evgeny Shvarov · Jul 27, 2016

Hi, Community!

We want to introduce tag Tips & tricks.

It's  not a snippet sometimes, but some small piece of best practice and useful experience. 

Please vote if you think it makes sense and we need this tag and we'll introduce it as the first level tag in taxonomy.

1
0 202
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 1009
Article Evgeny Shvarov · Jul 14, 2016 1m read

Alex Koblov posted today a #CachéHaiku:

Full command names

Make your code more readable

Than compact versions

My haiku:

Caché Globals

Shows you keys to the value

If you $order it

Your variant? ;)

20
1 1163
Question Evgeny Shvarov · Jul 8, 2016

Hi!
There is interesting question in Stackoverflow.
This query works for MS SQL:

SELECT * 
FROM 
(
    SELECT *, ROW_NUMBER() OVER (PARTITION BY client_id ORDER BY date_updated DESC) AS rn
    FROM client_address
) a
WHERE a.rn = 1

There is one answer there,  which solves the task:

SELECT *
FROM 
   client_address a
   LEFT JOIN client_address b
   on a.client_id  = b.client_id 
     and a.date_updated < b.date_updated 
WHERE
   b.client_id is null

But it goes with comment, that there are no Window functions in Caché SQL.

I wonder, are there any other options to make this query in Caché?

5
0 2451
Announcement Evgeny Shvarov · Jul 1, 2016

Hi!

Here is the digest of  the most interesting and valuable posts on Developer Community published in June 2016.

Here we go!

News, Events, releases

Update to 2016.1.1 Maintenance Release

2016.1.1 Maintenance Release

2016.2 Field Test Kit 2016.2.0.677.0

 

Most viewed

What is the best way to serialize object/list/array/etc to string?

Caché Open Authorization Framework (OAuth 2.

0
0 470
Announcement Evgeny Shvarov · Jun 30, 2016

Hi, Community!

I'm pleased to announce the new Developer Community release today. Meet the changes!

New voting system

Now you can vote for the post or comment with like or dislike buttons to change the post/comment rating.

Previous ratings converted to the new rating with the following rule:

4,5 stars = +1

1,2,3 stars=0.

Improved email notifications

You should receive HTML notifications now on new posts and comments on DC.

Please share your feedback with the recent release.

And vote up this post ;)

4
0 267
Question Evgeny Shvarov · Jun 23, 2016

Hi!

Here is the question in Russian Forum regarding roots extracting.

In Caché ObjectScript we use exponentiation operator (**) to raise an exponent to power. F.e. let's raise 3 to power of 3: 

USER> write 3**3 

27

And we use the same operator to extract the root. 

USER> write 27**(1/3) 

2.999999999999999963

And 2.999999999999999963 is not 3, obviously.

How to extract roots properly in Caché ObjectScript?

5
0 473
Article Evgeny Shvarov · Jun 13, 2016 1m read

Hi, Community!

Want to share with you one debugging approach from the Russian forum.

Suppose I want to debug the application  and I want it to stop the execution on a particular line.

I add in code this line:

l +d,-d

When I want to start debugging in this line I block d in terminal

USER> l +d

And execute the app.

The app stops on this line and lets me connect to it with Studio debugger.

To release lock I do in terminal

USER> l -d

And what are your debugging practices?

8
1 779
Article Evgeny Shvarov · Jun 8, 2016 1m read

Hi, Community!

If you prepare your longread for DC in Microsoft Word or Google Docs there is one very easy way how to add your formatted text and images in DC post at once.

To make it do the following:

1.Click Create Post on Developer Community.

2. Copy all the text in Word o GDocs to the buffer.

3. Click the button Paste from word (see the shot):

4. Paste the text to the opened window an press OK.

 

5. See the formatted text with images in your post. Save it as a draft or post it.

7
0 615
Question Evgeny Shvarov · May 30, 2016

Hi, Community!

Last weekend we held the Final of InterSystems Contest on Caché, DeepSee and iKnow under the aegis of IT Planet Student Championship in Ekaterinburg. BTW, this year we had more than 1,400 participants in InterSystems Contest.

One of the tasks for the final was to solve T9 Spelling problem  with Caché ObjectScript and use the minimum code. 

Problem description:
The Latin alphabet contains 26 characters and telephones only have ten digits on the keypad. We would like to make it easier to write a message to your friend using a sequence of keypresses to indicate the desired characters.

20
0 1413
Article Evgeny Shvarov · May 11, 2016 1m read

Hi!

I believe the simplest is (to work with csv delimited by ";"):


set file = ##class(%File).%New( "data.csv" )
    set sc = file.Open( "R" ) 
    if $$$ISERR(sc) quit    ; or do smth

    while 'file.AtEnd {
        set str=file.ReadLine() 
        for i=1:1:$length( str, ";" ) {
            set id=$piece( str, ";" ,i ) 
            write !, id  // or do smth
        }
    }
    do file.Close()

Possible options:

different variants of error handling with sc code.

Embrace while loop into try/catch block.

And what's yours?

16
0 7284
Article Evgeny Shvarov · Apr 16, 2016 1m read

Hi!

Want to share with you code snippet of try catch block I usually use in methods which should return %Status. 


{ 
 try {
  	$$$TOE(sc,StatusMethod())
 }
 catch e {
 	set sc=e.AsStatus()
 	do e.Log()
 }

Quit sc 
}

Here $$$TOE is a short form of $$$TROWONERROR macro.

Inside macro StatusMethod is any method you call which will return %Status value. This value will be placed into sc variable.

In case of sc contains error execution will be routed to try catch block. You can wrap any Status methods calls in your code if you need to catch the errors coming from them.

21
2 3583
Article Evgeny Shvarov · Apr 15, 2016 2m read

Hi!

Please find all the source code Global Summit 2016 Sessions and Experiences in following GitHub repositories:

Codes are in UDL form which is native to Atelier IDE.

Here is small guide how you can check out this project into your Atelier:

Let's see how to load code directly from GitHub URI. 

Open Atelier. Go to File -> Import -> Git -> Clone URI

 

   2. Specify URL for repository and press Next

   3.

1
0 1022
Question Evgeny Shvarov · Apr 5, 2016

Hi! 

There is a question for Ensemble on Stackoverflow:

I have the below dtl. In the foreach loop, I am just copying the same code in another part under anif condition. How can I avoid this redundancy? Can I reuse using sub transformation?

Here is the dtl class file :https://docs.google.com/document/d/1snJXElyw13hAfb8Lmg5IaySc7md_DE8J40FB79hBaXU/edit?usp=sharing

Original question.

2
0 622
Announcement Evgeny Shvarov · Apr 1, 2016

Hi, Community!

Here is the digest of the most interesting and valuable articles published on Developer Community in March 2016.

If we missed something interesting, please feel free to add it in comments.

So, here we go!

News and Events

Caché and Ensemble 2016.1 Release

New Book, Caché and MUMPS – Part II

Global Summit Contest I

Global Summit Contest II

Most commented

Class Projections and Projection Classes – 15 comments

How to display or save stack information? – 12 comments

Using Class Queries - %SQL.Statement versus %Library.

0
0 434