With a routine like this one, you can quickly calculate how many lines of code you are working with. And it is not only for routines, it works for classes because remember that classes generate routines !
Here you have the routine source code:
Pieces of experience in InterSystems Technology which solve some particular problem in elegant or unusual way.
With a routine like this one, you can quickly calculate how many lines of code you are working with. And it is not only for routines, it works for classes because remember that classes generate routines !
Here you have the routine source code:
How to parse a URL in Caché:
Let's pretend you are working on a project where you may be retrieving a URL for some purpose and you have the need to be easily able to parse apart that URL to get the various components that make up the URL.
Here's how to do that:
Note: This example assumes you have a variable named sURL that contains some url (i.e. http://www.intersys.com/main.csp?QUERY=abc#anchor) and you will be creating an array of the URL component pieces, where the array will be named aComponents.
In your class/routine, add the following code:
Do ##class(%Net.URLParser).Parse(sURL,.aComponents)
Caché 2016.1 introduced some very powerful JSON features. Unfortunately, the syntax used in the 2016.1 release is going to be changed in the 2016.2 release to bring it closer to Caché ObjectScript syntax. This will mean that code that works in 2016.1 may not be forwards compatible. See this announcement and this article for more details about the changes.
This sample class will add parameter DSINTERVAL to each class containing the parameter DSTIME
To execute it from a Terminal :
SAMPLES>d ##class(adm.param).add(,,1)
[SAMPLES] parameter DSINTERVAL=5 added to class DeepSee.Study.CityRainfall (via adm.param)
[SAMPLES] parameter DSINTERVAL=5 added to class HoleFoods.Transaction (via adm.param)
[SAMPLES] parameter DSINTERVAL=5 added to class News.DeepSee.NewsArticle (via adm.param)
DSINTERVAL parameter was added to 3 classes
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.
Checking if Directory or File Exists:
Outlined below is an example of how to check if a directory exists:
Set directoryName="c:\temp\nosuchdir"
/* Check for existence of a directory - Return Value: 0 - directory does not exist; 1 - directory does exist */
Set directoryExists=##class(%File).DirectoryExists(directoryName)
If ('directoryExists) // do the processing for when a directory does not exist
Outlined below is an example of how to check if a file exists:
The one question that some of you might have is:
How do I change my login information for Cache Studio if I clicked the checkbox to automatically save my login info so I do not have to enter my username/password every time I open Studio?
Well.....excellent question!!!!!!
Here's the answer:
Have you tried $Translate for date conversion?
USER>write $Translate("Dd.Mm.WwYy","WwYy-Mm-Dd","2015-08-02")
02.08.2015
Stolen from Russian forum and Alexander Koblov.
We're developing Ensemble PoC and one day our frontend developer (who doesn't have Ensemble production running) said that Populate just doesn't cut it and he needs to see the real data. He needed only one object, but the problem was - it's a big object. Still, I checked ids of everything related and wrote this command (parts omitted, but you get the idea):
as described in How to post an article from Word or Google Docs, you can use the Paste from Word button to paste content you have copied from a Word or Google Docs document into a Developer Community post.
this worked well for me pasting from Word 10 documents, and retained most (though not all) of my Word formatting. i did have one problem, however, and wanted to pass on my workaround.
This short article was motivated by a problem of one of my customers. They use Ensemble to integrate many systems, some of them use just plain files.
So they naturally selected File Outbound Adapter to write into target file. Things were running smoothly for years, until recently, when the volume of data being written to the file reached large size of tens of megabytes. The operation took around half an hour to complete, causing timing problems where subsequent operations within the process had to wait, and third party system was not happy to wait so long.
I was recently troubleshooting a problem on a Linux (RHEL) instance of 2016.1 at a site. For policy reasons their sysadmins wanted to update the Caché installation so it used network accounts for its cacheusr and iscagent users and groups instead of the locally-created ones that had been set up during original install of Caché.
To do this they ran various commands including chown
Afterwards non-root users couldn't obtain a terminal session using the csession command. Instead they receive this message:
cache: Permission denied
Process-private Globals can be used as a data global in storage definition. That way, each process can have its own objects for the class with ppg storage. For example lets define a pool, which can:
Here's the class:
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.
(Possibly?) little-known fact: It's possible to use $ListBuild on the left hand side of the equals sign in a set command to extract multiple list values at once:
For example:
See for reference: http://docs.intersystems.com/cache20152/csp/docbook/DocBook.UI.Page.cls…
Here are a few tips that might be useful to people who are running applications in an environment that's configured to use InterSystems mirroring.