Is there a better way to iterate through all properties of an object than the following? Perhaps without needing to open a definition of the class but directly against the object?
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:
The ideal number of table permissions to assign for your users is zero. Permissions should be granted upon sign-in based on the application used for access. For web applications, we have a simple way of doing this by appointing application roles, matching roles, and required resources in the System Management Portal.
ODBC and JDBC connections present a different problem, however, especially when third-party applications are involved. As providers of an ERP system, our customers often wish to be able to employ various software packages to integrate with or report on their data. Many of these programs are capable of running any kind of query. Yet, letting them do that can be devastating to a customer’s data.
If you work with Productions, highlighting connections between Business Hosts is a very convenient feature, allowing developers to get a visual representation of a data flow.
This feature works by default with all system Business Hosts. If a user writes their own Business Services, Processes, or Operations, they must implement the OnGetConnections method for this functionality to work with their custom Business Hosts (or use Ens.DataType.ConfigName properties for connections). That said, the SMP shows only the first layer of connections of the selected Business Host. Sometimes, we need to get connections of connections recursively to build a complete data flow graph. Or we might need this connection information to check which downstream systems might be affected by a change upstream.
Leet (or "1337"), also known as eleet or leetspeak, is a system of modified spellings used primarily on the Internet. It often uses character replacements in ways that play on the similarity of their glyphs via reflection or other resemblance. Additionally, it modifies certain words based on a system of suffixes and alternate meanings. There are many dialects or linguistic varieties in different online communities. Wikipedia
to dismount/mount a database, use Dismount() and Mount() methods in SYS.Database class available in %SYS namespace. NB: the database ID is its Directory
You'll find some examples of how to dismount/mount and check if a database is mounted (Mounted=1) or not (Mounted=0), and quickly see all the attributes of a database (via zwrite)
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.
I've been having a blast with the Advent of Code puzzles this year - though I'll be heading into a busy span of time with family soon and will probably drop off toward the end. (At least, that's what always seems to happen - it's a good thing, though!)
One of the features I like in InterSystems ObjectScript is how you can process array transformations in a specific method or a function.
Usually when we say "process an array" we assume a very straightforward algorithm which loops through an array and does something with its entries upon a certain rule.
The trick is how you transfer an array to work with into a function.
One of the nice approaches on how to pass the information about an array is using $Name and Indirection operator.
Below you can find a very simple example which illustrates the thing.
I've created a datatype class whoch extends from %Library.String with a REGEX parameter and the validation of the value against the regular expression. The class does not support Populate using the regular expression as a template for data population.
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 = "docs.intersystems.com"
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()
}
}
I want to share four functions with you. I hope that you can use it at some time.
DNI: the initials of the type of national identity document, is composed of different series of numbers and letters. That proves the identity and personal data of the holder, as well as the Spanish nationality. Example: 94494452X
NIE: The NIE or foreigner identity number is a code for foreigners in Spain.
With the release of Cache 2016.1, JSON support was re-architected and made part of the core object model with the creation of %Object and %Array classes, which allow you to create dynamic JSON enabled objects and arrays.
On a recent demonstration I was working on, I had the need to create a REST web service that returned a JSON representation of a persistent object. After searching for methods that would allow me to accomplish this, ultimately I found none, until now.
The input in today's challenge consists of an encrypted name, a dash, a sectorID, a dash and a checksum between brackets. A name is real if the checksum is equal to the five most common letters in the encypted name.
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.
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.
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:
I've been trying to write a method to compare two local variables, which may be arrays, for "equality" - that is, to see if they have all the same subscripts (if they're arrays) and values. This is the best I've come up with so far - are there any better/simpler approaches out there?
Now, let’s say you can’t access the terminal or simply you just rather execute it from a web interface. In this article, I will show you how to execute terminal commands from a simple web page.
For example, in the image below you see how we execute $zv on a webpage:
You will receive a string. Each word in the string will contain a number.
This number is the position that word should have in the sentence.
If the input string is empty, return an empty string.
The output can only be in words, without the given numbers.
The "apptools-admin" project is not only a set of tools for the administrator, but a platform for the rapid creation of a prototype of any solution.
For example, Photo Album, Music Player, and Personal Library all come together in a user-friendly treasure chest design.