查找

问题
· 八月 31, 2023

How exactly does the OperationLimit Property on the Regex-Matcher work, and how do I get it to work?

Hi there,

I want to use regex in my code, and I saw that the %Regex.Matcher class contains a property "OperationLimit" that you can also set to a number of steps that the regex engine should take maximum in analysing a given string. So far so good.

I tried to set the property with the function OperationLimitSet() to a silly value like 3. In 3 steps only very few regex should be executed, right? But what I found is that my regex always comes up with a solution. Here is what I did:

 

First I initialised my %Regex.Matcher.

set m = ##class(%Regex.Matcher).%New("(.+)\@(.+)\.(.+)")
do m.OperationLimitSet(3)
do m.TextSet("thisismytest@email.com")

 

Then I ran the regex and found my 3 groups.

zw m.Locate()
1
zw m.Group(1)
"thisismytest"
zw m.Group(2)
"email"
zw m.Group(3)
"com"

 

Now maybe I have completely misunderstood the OperationLimit property, or my implementation of this simple regex matcher is faulty, but the documentation clearly states: "Setting OperationLimit to a positive integer will cause a match operation to signal a TimeOut error after the specified number of clusters of steps by the match engine".  As I am using the Locate() function and not the Match() function, I wondered if the documentation specifically talks about the Match() function. But both the Locate() and Match() function execute without any problem.

set m = ##class(%Regex.Matcher).%New("(.+)\@(.+)\.(.+)")
do m.OperationLimitSet(3)
do m.TextSet("thisismytest@email.com")

zw m.Match()
1

I would appreciate any input as to why my regex is still running perfectly and what I can do to prevent this, as I would obviously like to set a realistic OperationLimit of 4000 or something in that range in the future.

Thanks for your help!

1 Comment
讨论 (1)2
登录或注册以继续
问题
· 八月 28, 2023

Memory options for EnsLib.JavaGateway.Service

Is there a best practice to set the memory options (classic xms and xmx) on the JavaGw service in the production?

What can be recommended?

Like specifying 1024M for xmx is for a single process? that process can't grow beyond that value right? what happen if the process reach the memory limit?

 

Thanks

 

Pietro

3 Comments
讨论 (3)3
登录或注册以继续
问题
· 八月 17, 2023

Custom task that exports query result in a csv file

Hello!

I'm new to Caché systems and I have a question...

I need to develop a custom task that daily exports the result of a query to a csv file in the database directory (I use the UNIX version).

Does anyone have any code or help to solve this case?

Thanks!!!

2 Comments
讨论 (2)1
登录或注册以继续
文章
· 八月 17, 2023 阅读大约需 1 分钟

Download Globals as XML using CSP

Inspired by a Question from @Evgeny Shvarov and a Reply from @Ashok Kumar T
I have created a base for Global download as XML file

How to use:
 
just call the page like http://<your_server>/csp/samples2/dc.Gdown.cls?GBL=global_name

gbl-name  without the initial ^ (caret)

The output has a default name <global_name>.XML  Your choice is available.

Known Limits:

  • you have to install it at your sourcing server
  • it is not tested/working across namespaces
  • there is no partial download
  • error handling is just basic or missing

There is space for personal improvements.

and this is it:

Class dc.Gdown Extends %CSP.Page
{

ClassMethod OnPreHTTP() As %Boolean [ ServerOnly = 1 ]
{
  #dim %response as %CSP.Response
  set %rcc=$Get(%request.Data("GBL",1),"")
  if %rcc]"" {
    set %rcd=$D(@("^"_%rcc))
    if %rcd {
      set %response.ContentType="application/xml"
      set %response.Headers("Content-Disposition")="attachment; filename="""_%rcc_".xml"""
    }
  }
  else  { 
    set %rcd=0
    set %rcc="Parameter GBL"
  }  
  quit $$$OK
}

ClassMethod OnPage() As %Status
{
  if '%rcd {
  &html<<html><head></head><body>
   #(%rcc)# &gt;&gt; not found </body></html>>
  quit $$$OK
  }
  do $system.OBJ.Export(%rcc_".GBL")
  Quit $$$OK
}
}





 





 

2 Comments
讨论 (2)2
登录或注册以继续
问题
· 八月 16, 2023

Web client from SOAP Service

I created a web service and used the Studio SOAP Wizard to generate a client from the WSDL file of the service. But the client is throwing the error as shown below

 WebServiceClientClass '' could not be instantiated, or the WebServiceURL Location could not be determined

What have I missed?

Is there a better way to create a client?

2 Comments
讨论 (2)2
登录或注册以继续