Hi All,
Am attempting to run sample unit tests as per
and getting an ERROR #5007:
The Terminal detail is as follows:
SAMPLES>Set ^UnitTestRoot="C:\UnitTests" SAMPLES>write ^UnitTestRoot C:\UnitTests SAMPLES>do ##class(%UnitTest.Manager).
InterSystems ObjectScript is a scripting language to operate with data using any data model of InterSystems Data Platform (Objects, Relational, Key-Value, Document, Globals) and to develop business logic for serverside applications on InterSystems Data Platform.
Hi All,
Am attempting to run sample unit tests as per
and getting an ERROR #5007:
The Terminal detail is as follows:
SAMPLES>Set ^UnitTestRoot="C:\UnitTests" SAMPLES>write ^UnitTestRoot C:\UnitTests SAMPLES>do ##class(%UnitTest.Manager).
Hello, we have a few hundreds of triggers to port from Oracle to Cachè for a migration project, and many of them have to change (for example, normalize a value, null it, etc) the value which is being inserted.
The documentation says "You cannot set {fieldname*N} in trigger code." , so we're unlucky.
Is there a good workaround for this ?
SqlComputeOnChange doesn't seem the best way, but I'm not totally sure: for example normalization and validation could have a better place somewhere else than a trigger.
Hi!
Does anyone know if it is possible to programmatically (COS) read the productdescription from other namespaces?
What are the differences between a process private global and a percent variable? Basically I have some code running in an Ensemble operation that processes requests, and it needs access to pieces of data that are scattered throughout XData blocks in various classes.
Hello,
We are working on creating a metadata file to accompany PDF documents produced by one of our third party systems for ingestion into our DMS. One of the pieces of data that the metadata file must contain is the number of pages of the PDF document.
In Cache ObjectScript does anybody know if there is currently a way of counting the number of pages within a file (specifically a PDF) without invoking a non-Caché ObjectScript program/function from within Caché ObjectScript?
Does there exist a User Defined Language pack for Caché ObjectScript for use in Notepad++? I'm hoping some friendly developer somewhere may have created one . http://docs.notepad-plus-plus.org/index.php/User_Defined_Language_Files
Hi everyone,
I've created an Identicon Generator inspired on Fabio Gonçalves Captcha Validator.
This sample can be used to create Identicons for users of app for example, it can be useful to use in Zen Mojo applications, generating an identifier image based on name of the user by example, but it can be used in others kind of applications too(Zen, CSP etc)
Examples:
First one:

Will generate this:

And this:

Will generate this:

See my Github project: https://github.com/AndreiLN/Ikon
Best regards,
Andrei L. Nenevê
Inspired by the article "Declarative development in Caché" that's still trending on the dev com. The OP explored a functional style of iterating over a collection. A comment today suggested "Caché would need syntax support for anonymous functions".
With Macros you can kind of get anonymous like syntax using dot notation.
This is not production code, but it does work. First the macros...
#Define foreach(%c,%l) for i=1:1:%c.Size set %l=%c.GetAt(i) do #Define map(%oc,%nc,%l) set %nc=##class(%ListOfDataTypes).%New() for i=1:1:%oc.Size set %l=%oc.
Hi All,
We using cache 5.02.We have some problem regarding license usage.
I have a number of Business Process and due to the complexity these were created as "custom code" instead of BPL.
These processes currently invoke other components using SendRequestSync. For a couple of reasons I would like to be able to change these to use SendRequestAsync:
Let's say I have two classes: A and B. They share no common parent except %SystemBase. But these classes have some properties with the same name (type may be the same or not):
Class A {
Property data As C;
Property data2;
}Class B {
Property data As D;
Property data3;
}I need to automatically convert object of class A into object of class B. I'm planing to write a class generator that generates a separate class that converts A to B. It would work like this:
1.
Hi,
I was wondering if we have some documentation and sample code how to create APNS and GCM using Caché ObjectScript.
Thanks
Kumar
This was what I first wrote. Here is the test, first putting in an invalid value:
Deployment Type? (G)ateway or (I)HE: F
Invalid Choice
Deployment Type? (G)ateway or (I)HE: G
Hi,
I've organized my repository using TortoiseSVN. I was careful to use only svn commands while creating my file structure. Now all Subversion commands are working at the command line but not from within my IDE (Cache Studio). Basically I'm trying to write a plug-in for my IDE to use Subversion from within the Studio. Trying to integrate Subversion into my IDE, something like Subclipse, but for Cache Studio. The error occurred after reorganizing my code into directories. For example at the command-line, svn info and svn status and all other commands work perfectly. All Subversion commands work at the command prompt!
I am sending an HTTP request to cache class:
s rObj=##class(%Net.HttpRequest).%New() s rObj.Server="www.xyz.com" s rObj.Https=1 s rObj.SSLConfiguration="xyz" s rObj.ContentType="application/json" d rObj.EntityBody.Write("payload in json format") s sc=rObj.Post("/csp/ns/xyz.cls")
The request gets to the OnPreHTTP class method
Class xyz Extends %CSP.Page [ ProcedureBlock ]
{
ClassMethod OnPreHTTP() As %Boolean
{
q 1
}
}The question is how to retrieve the request payload in the OnPreHTTP method.
I am trying to write some code that takes in a string and does a serverside transformation of it to find embedded URLs and replace it with clickable links. I found the following regex for Javascript which is rated highly on StackOverflow;
replacePattern1 = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim;
replacedText = inputText.replace(replacePattern1, '<a href="$1" target="_blank">$1</a>');And I tried to do the following in Caché ObjectScript but it's not working:
Hi!
Consider I have a class Package.Data with Property UniqueStringValue as %String.
I introduced the Index for this property:
Index ValueIndex on UniqueStringValue [Unique];
It works well. But if I try to check if there is an object with the certain value in code like this:
if ##class(Package.Data).ValueIndexExists(value)
this expression fails, if value="value", even if there is an instance with instance.UniqueStingValue="Value"
How can I set the index to prevent saving case sensitive values in this class?
While I can see the benefits that $ZSTORAGE could have if used properly, I have not seen it used in the environments I have worked in. I was wondering if there are any developers that promote its usage.
If used properly, I would imagine it could be highly effective in maximizing free memory since some processes will never go over X amount, while others may very well need much more.
What is the difference between $case and $select?.Where places to use $case and $select?
If I were trying to access an index of a global variable, what time complexity would this operation have? My understanding of languages like Java/C++ is that arrays are stored as blocks of memory so that x[15] would have a lookup time complexity of O(1) because it just goes to (address of the array + 15) and retrieves the value stored there.
How does this work in Cache where the index of a variable isn't necessarily an integer value? If I were to have a variable like the following:
x("Adam") = "Red"
x("George") = "Blue"
x("Bryan") = "Green"
etc.
I am in the planning stages of making things more uniform in our routines and I would like to know what the easiest way would be to include an .inc at the beginning of each .mac routine. Has anyone written something that would open all routines and place something into the first row while leaving the rest of the routine unchanged? Thanks for any guidance you all may provide.
Points to remember before you start:
Hello guys,
I've got this piece of code which runs the method "WebMethod", that belongs to %SOAP.WebBase.cls.
It grabs the outcome from an internal webservice we have and after that, it writes into a file.
The thing is, when I browse the file contents, I realize that in the place where a special character should be, I see a question mark.
By querying the same webservice from a special soap tool called "SoapSonar" (I've been using this for years), the outcome shows up this special character (shows it properly).
So I wonder.
Have you ever thought what could be a reason why some development environment (database, language) would eventually become popular? What part of this popularity could be explain as language quality? What by new and idioms approaches introduced by early language adopters? What is due to healthy ecosystem collaboration? What is due to some marketing genius?
Take this online course to learn the foundations of the Caché ObjectScript language especially as it relates to use in creating variables and objects in Caché.
So I know it's been a while, and I hate to let my adoring fans down... just not enough to actually start writing again. But the wait is over and I'm back! Now bask in my beautiful ginger words!
For this series, I am going to look at some common problems we see in the WRC and discuss some common solutions. Of course, even if you find a solution here, you are always welcome to call in and expression you gratitude, or just hear my voice!
This week's common problem: "My query returns no data."
Is there a way to have a Data Lookup table be automatically updated via a script or cache code? We have a file that is being created by our EMR, and we need to import it into Ensemble to update it. Just trying to see if we can automate this process.
Thanks
Scott Roth
Ohio State University Wexner Medical Center
Cache rendering of an old classic:
s enc="dQZ4nK1VzU7DMAy+I/EEveTcCWicpt3UU2VABTRA/AhBeYW+As/U7vE4VNhxypJuoAlhS1vixJ//"_
"06TNsy5p4TppzRKTNqtMXuXQjSSrdEPSEmmtK1uZssp1l0Z3nHJ9fEQroJURlQLHNE35WPYWx7N3"_
"YpJYkeRe4mQzkEKuGDwjkHTBP+9JW4oUsB+Y2CVj2JuttlkFAbhbfdIuRU/jhvZkryejtNok7UpO"_
"Moww3JbdcPifW8APosVi4Q9Otwck5LMojmKOojNnDUIXe0XEvnVrdaEeiF95H8BYgXG38o6i0Vpg"_
"lhSO00TVkN6VelRPaq1q9ehucnizrGopJ5TY+8zHzOBSPih8jjnLQWbyKSYy25Cpe+JXMTdM2dZS"_
"cbAu3YP42EQw4GOq1a16VjfEtWoCGHJdS5dAjkPoYgRTCsw8DG4MaSAw2G++KfA6So0v9xTJVmHD"_
"0UjTAeD4TQ7oRr1EMMbXm2N6IyO1AxtDLS2NCBqHiCIYX+9hLxGGtCxk2Me0D8Q5eknNcafW0j47"_
"SiBNqVcYTSHEM3ASTfwvogDB4qFKc9G+YTzYg4yfqYyfqd2M6O6KqnOh3vgaK1SHIP8403/IitX/"_
"khVb/JYVkBdCh4/53gmCHyZoh3kApk/BrNdcOsBMDzb/hCPEI+zfA/fnvjTWnn8BUo3vtEE="
s enc=$SYSTEM.I was benchmarking the populate utils when I noticed something strange. Consider this simple benchmarking method:
ClassMethod runBench(count As %Integer = 300000)
{
s types=["name","ssn","company","title","phone","city","street","zip","mission","state","color","product","string","integer","float"]
//s types=["name","ssn"]
s iter=types.%GetIterator()
while iter.%GetNext(.key,.value){
s start=$P($ZTS,",",2)
s opt={}
s opt.type=value
for i=1:1:count{
s res=##class(DataGen.Generator).Hi, community!
Consider you need to exclude substring(s) from a string.
I did it with the following snippet:
/// excludes all the substrings from the string
ClassMethod ExcludeSubstring(substr,str as %String) As %String
{
while ($L(str,substr)>1) {
set str=$Piece(str,substr)_$Piece(str,substr,2,*)
}
quit str
}So, for example:
USER> set str=”ExcludemeGoodstringExcludemeExcludemeGoodstring” w ##class(User.Utils).ExcludeSubstring(“Excludeme”,str) GoodstringGoodstring
Is this the optimal approach or I reinvented the wheel?