Sergei Shutov · Sep 5, 2016 go to post

All subscripts will be calculated before merge command will start global merge, so looks like you hit this command several (at least 2) times within a second. Since you don't have $JOB as a subscript or data node it also could be that it's done from different processes.

On the other hand, it's considered a good code practice to assign $h to a variable somewhere at the top of the method, and use that variable instead of $h throughout the code.

Consider this code for example:

if (DAYNUM-$H>0) && (WKS>2) do ....
if (DAYNUM-$H<=0) && (WKS>2) do ....

You want to check if date is in future and do something different if it is. You would expect that only one branch of code would ever run; however in extremely rare circumstances when this code runs around midnight $h could change between first and second if statements and run both code branches, screwing up your database unpredictably.

Another good practice is to pass "current date" as method argument instead of assigning $h inside a method. This way it's much easier to test methods.

Sergei Shutov · May 26, 2016 go to post

Hi Kenneth, 

There is $toJSON method which you can use to convert any persistent object into JSON. Actually any %Registered object has it too!

SAMPLES>set Person=##class(Sample.Person).%OpenId(1)

SAMPLES>set personJson=Person.$toJSON()

SAMPLES>write personJson
{"$CLASSNAME":"Sample.Person","$REFERENCE":"1","Age":65,"DOB":39985,"FavoriteColors":["Yellow"],"Home":{"City":"Fargo","State":"NC","Street":"7424 Main Avenue","Zip":82189},"Name":"Novello,Olga I.","Office":{"City":"Pueblo","State":"MT","Street":"430 Franklin Place","Zip":29528},"SSN":"315-46-7788"}
SAMPLES>w $zv
Cache for UNIX (Apple Mac OS X for x86-64) 2016.2 (Build 657U) Sun May 15 2016 20:35:24 EDT

Sergei Shutov · May 12, 2016 go to post

I didn't actually test it on a phone/tablet, just resized browser window. Maybe it's OK on mobile devices.

Sergei Shutov · May 11, 2016 go to post

Looks nice! A few things to consider:

- On MacOs Safari header text is white on white background

- On small (mobile) screens there is a huge 230px right padding in .book class, page looks much better without it

- On small screens, it's better to hide left menu by default and let user expand it with menu button, like https://material.angularjs.org does. Also it should overlap or shift main text, otherwise both are unreadable.

Sergei Shutov · May 1, 2016 go to post

Hi Mike,

So, do you have a license installed? What does Management Portal tell you about the license?

If you only have  a single user license, make sure that both Terminal and Studio use the same IP address to connect to Cache. By default Terminal will connect using interprocess communication instead of TCP/IP, and Studio could use your external IP address, so the best way to make sure you use the same IP address is to define a new "remote" server with IP address of 127.0.0.1 and use it for both Terminal and Studio.

Hope this helps

=Sergei