Study library not found - pine-script-v5

Compilation error. Line 17: Could not find function or function reference 'study'
// Include libraries study(title="Trade Trigger", overlay=true)
This library was proposed to me by ChatGPT.
(This is a follow up from my post "fibUp = fibonacci(high,"up")" with the code source)

Related

Cannot find the module 'babel-plugin-r'

I am having the following error while running the react native code,please help me
error: index.js: Cannot find module 'babel-plugin-r'
Require stack:
/home/Documents/Assignment3/node_modules/#babel/core/lib/config/files/plugins.js
/home/Documents/Assignment3/node_modules/#babel/core/lib/config/files/index.js
/home/Documents/Assignment3/node_modules/#babel/core/lib/index.js
/home/Documents/Assignment3/node_modules/metro-transform-worker/src/index.js
/home/Documents/Assignment3/node_modules/metro/src/DeltaBundler/Worker.js
/home/Documents/Assignment3/node_modules/jest-worker/build/workers/processChild.js
I faced the same problem when i used react navigation which requires react-native-reanimated.
To resume, after following instructions mentionned in the documentation,
i omitted the three points ... , as following:
module.exports = function (api) {
api.cache(true);
return {
presets: ["babel-preset-expo"],
//... <=== this three dots caused the problem
plugins: ["react-native-reanimated/plugin"],
};
};
which resolved the problem for me.
Original answer link is here

How to correctly setup RUTA config parameters in the script?

Help is needed with a code example for proper understanding of setting parameters in own RUTA script.
In my case I need to setup the configuration parameter "emptyIsInvisible" to false. The root cause is described in Are some extra settings in RUTA script needed to detect annotations with the same begin and end attributes?
I made two attempts
1) use the name of standard Ruta Engine:
ENGINE BasicEngine;
Document{->CONFIGURE(BasicEngine, "emptyIsInvisible" = false)};`
That part of the script does not change the default settings.
2) use the name of own engine:
ENGINE xxx.yyy.zzz.TagEngine;
Document{->CONFIGURE(TagEngine, "emptyIsInvisible" = false)};
In that case the script raises the following exception:
Exception in thread "main" java.lang.StackOverflowError
at java.io.UnixFileSystem.getBooleanAttributes0(Native Method)
at java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:242)
at java.io.File.exists(File.java:819)
at sun.misc.URLClassPath$FileLoader.getResource(URLClassPath.java:1081)
at sun.misc.URLClassPath$FileLoader.findResource(URLClassPath.java:1048)
at sun.misc.URLClassPath$1.next(URLClassPath.java:226)
at sun.misc.URLClassPath$1.hasMoreElements(URLClassPath.java:236)
at java.net.URLClassLoader$3$1.run(URLClassLoader.java:589)
at java.net.URLClassLoader$3$1.run(URLClassLoader.java:587)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader$3.next(URLClassLoader.java:586)
at java.net.URLClassLoader$3.hasMoreElements(URLClassLoader.java:611)
at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java:45)
at sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java:54)
at java.util.ServiceLoader$LazyIterator.hasNextService(ServiceLoader.java:354)
at java.util.ServiceLoader$LazyIterator.hasNext(ServiceLoader.java:393)
at java.util.ServiceLoader$1.hasNext(ServiceLoader.java:474)
at javax.xml.parsers.FactoryFinder$1.run(FactoryFinder.java:293)
at java.security.AccessController.doPrivileged(Native Method)
at javax.xml.parsers.FactoryFinder.findServiceProvider(FactoryFinder.java:289)
at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:267)
at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:127)
at org.apache.uima.internal.util.XMLUtils.createSAXParserFactory(XMLUtils.java:543)
at org.apache.uima.util.impl.XMLParser_impl.parse(XMLParser_impl.java:159)
at org.apache.uima.util.impl.XMLParser_impl.parseResourceSpecifier(XMLParser_impl.java:399)
at org.apache.uima.util.impl.XMLParser_impl.parseResourceSpecifier(XMLParser_impl.java:381)
at org.apache.uima.ruta.engine.Ruta.wrapAnalysisEngine(Ruta.java:278)
at org.apache.uima.ruta.engine.Ruta.wrapAnalysisEngine(Ruta.java:270)
at org.apache.uima.ruta.engine.RutaEngine.initializeEngines(RutaEngine.java:896)
at org.apache.uima.ruta.engine.RutaEngine.initializeScript(RutaEngine.java:820)
at org.apache.uima.ruta.engine.RutaEngine.initialize(RutaEngine.java:527)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:267)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initialize(PrimitiveAnalysisEngine_impl.java:172)
at org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEngineFactory_impl.java:94)
at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62)
at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:279)
at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:331)
at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:448)
at org.apache.uima.ruta.engine.Ruta.wrapAnalysisEngine(Ruta.java:279)
at org.apache.uima.ruta.engine.Ruta.wrapAnalysisEngine(Ruta.java:270)
at org.apache.uima.ruta.engine.RutaEngine.initializeEngines(RutaEngine.java:896)
at org.apache.uima.ruta.engine.RutaEngine.initializeScript(RutaEngine.java:820)
at org.apache.uima.ruta.engine.RutaEngine.initialize(RutaEngine.java:527)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:267)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initialize(PrimitiveAnalysisEngine_impl.java:172)
at org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEngineFactory_impl.java:94)
at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62)
at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:279)
at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:331)
at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:448)
at org.apache.uima.ruta.engine.Ruta.wrapAnalysisEngine(Ruta.java:279)
at org.apache.uima.ruta.engine.Ruta.wrapAnalysisEngine(Ruta.java:270)
at org.apache.uima.ruta.engine.RutaEngine.initializeEngines(RutaEngine.java:896)
at org.apache.uima.ruta.engine.RutaEngine.initializeScript(RutaEngine.java:820)
at org.apache.uima.ruta.engine.RutaEngine.initialize(RutaEngine.java:527)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:267)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initialize(PrimitiveAnalysisEngine_impl.java:172)
at org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEngineFactory_impl.java:94)
at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62)
at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:279)
at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:331)
at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:448)
at org.apache.uima.ruta.engine.Ruta.wrapAnalysisEngine(Ruta.java:279)
at org.apache.uima.ruta.engine.Ruta.wrapAnalysisEngine(Ruta.java:270)
at org.apache.uima.ruta.engine.RutaEngine.initializeEngines(RutaEngine.java:896)
at org.apache.uima.ruta.engine.RutaEngine.initializeScript(RutaEngine.java:820)
at org.apache.uima.ruta.engine.RutaEngine.initialize(RutaEngine.java:527)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:267)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initialize(PrimitiveAnalysisEngine_impl.java:172)
at org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEngineFactory_impl.java:94)
at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62)
at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:279)
at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:331)
....
This parameter will not solve the problems in the linked question. The parameter controls the basic matching if there are no annotations at all at some positions. This means that is will only affect the matching if a different seeding is applied, e.g., there is no seeding.
Concerning this question:
You cannot configure the RutaEngine analysis engine within the script the analysis engine tries to execute. You need to set the configuration parameter on framework level. This depends on how you create and run the UIMA analysis engines in your code.
In a simple Ruta project, you need to modify the template analysis engine description (BasicEngine.xml) so that the generated descriptions will contain the parameter value.
Using uimaFIT or other factory methods, you need to pass the parameter and its value when creating the description or analysis engine.
DISCLAIMER: I am a developer of UIMA Ruta

call MATLAB in Java via MatlabControl.java

Recently I am trying to write a java application that can execute matlab code but faced some problems.
First of all, I refer to the link: http://www.cs.virginia.edu/~whitehouse/matlab/JavaMatlab.html
It has some tips to execute matlab code under java application. I included the MatlabControl.java as well as jmi.jar, following the steps it gives.
but when I try to test just a piece of simple code as follows
package jmat;
public class MainProgram {
public static void main(String[] args) {
MatlabControl mc = new MatlabControl();
mc.eval(new String("x=5;"));
}
}
the console outputed the error as follows
Exception in thread "main" java.lang.UnsatisfiedLinkError: com.mathworks.jmi.NativeMatlab.PostMatlabRunnable(JZ)V
at com.mathworks.jmi.NativeMatlab.PostMatlabRunnable(Native Method)
at com.mathworks.jmi.NativeMatlab.postMatlabRunnable(NativeMatlab.java:399)
at com.mathworks.jmi.MatlabLooper.postMatlabRunnable(MatlabLooper.java:178)
at com.mathworks.jmi.Matlab.whenMatlabReady(Matlab.java:1404)
at jmat.MatlabControl.eval(MatlabControl.java:88)
at jmat.MainProgram.main(MainProgram.java:8)
I have no idea why it failed in my program, does any one can help me?
MATLAB version: R2009b
OS: Win7 32bits
Actually, you will need more than just MatlabControl.java in order to use Matlabcontrol. I'm assuming you picked up the source file from Option #3 in the link; that's just how options #1 and #2 work inside.
Go to that link that you posted and look at Option #1. Go to the link posted there, http://matlabcontrol.googlecode.com and click on Downloads. The first jar, matlabcontrol-4.1.0.jar is the one you want.
Download that and include it in the build path of your project. Then follow the walkthrough guides that are posted online. Let me know if you have any additional questions.

Prefix is null when using client stubs

I had to use axis to generate stubs because the SOAP I am working with uses RPC. After setting up the code to post I am receiving the below stack trace. If anyone has had this issue please help. From using the debug tool in Eclipse I can see that Axis is using default prefixes, but the issue is that one of the prefixes it uses has already been used so it returns null. Does anyone know why this may be happening?
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.io.IOException: java.io.IOException: Non nillable element 'prefix' is null.
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:java.io.IOException: java.io.IOException: Non nillable element 'prefix' is null.
at org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:275)
at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1504)
at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:980)
at org.apache.axis.encoding.SerializationContext.outputMultiRefs(SerializationContext.java:1055)
at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:145)
at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:478)
at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
at org.apache.axis.client.Call.invoke(Call.java:2757)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
Though that this question is not answered after one year I thought that it might help you since you are working with RPC and probably a legacy system.
In your generated client stub with Apache Axis under packaging that ends with "_xsd" where the Objects of the web service provider are created open classes one by one.
Somewhere in the middle of the class you will find a static block code like this:
static {
typeDesc.setXmlType(...);
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("prefix");
elemField.setXmlName(new javax.xml.namespace.QName("", "prefix"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
just change the value of nillable to true like this:
elemField.setNillable(true);
You should repeat this action for all classes and all fields of those classes if they do not match with their corresponding values in your WSDL (i.e. based on the definition of your WSDL they are nullable).
I've noticed that Apache Axis 1.2 - 1.4 automatically makes attributes not 'nillable' by default. I don't know why is this the case but I think this is the solution.

GWT History issue

Is it possible to add/create new history token from every class? I have the problem, that i get NullPointerException if i try to create new token (History.newItem("infoTab")) outside the main class (the main class contains the onModuleLoad() method). Here the error message:
09:45:11.890 [ERROR] [com.mycompany.client.AdminInterface] Unable to load module entry
point class com.mycompany.client.entries.MainEntry (see associated exception for details)
edit: the iframe part was not added in the index.html. After adding it, i get following:
11:16:48.885 [ERROR] [com.mycompany.client.AdminInterface] Error while executing the JavaScript provider for property 'user.agent'
com.google.gwt.core.client.JavaScriptException: (null): null
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:195)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)
at com.google.gwt.dev.shell.ModuleSpacePropertyOracle.computePropertyValue(ModuleSpacePropertyOracle.java:189)
at com.google.gwt.dev.shell.ModuleSpacePropertyOracle.getSelectionProperty(ModuleSpacePropertyOracle.java:127)
at com.google.gwt.dev.cfg.ConditionWhenPropertyIs.doEval(ConditionWhenPropertyIs.java:58)
at com.google.gwt.dev.cfg.Condition.isTrue(Condition.java:49)
at com.google.gwt.dev.cfg.ConditionAny.doEval(ConditionAny.java:37)
at com.google.gwt.dev.cfg.Condition.isTrue(Condition.java:49)
at com.google.gwt.dev.cfg.ConditionAll.doEval(ConditionAll.java:38)
at com.google.gwt.dev.cfg.Condition.isTrue(Condition.java:49)
at com.google.gwt.dev.cfg.Rule.isApplicable(Rule.java:36)
at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.tryRebind(StandardRebindOracle.java:98)
at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:54)
at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:154)
at com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:119)
at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:531)
at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:414)
at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:39)
at com.google.gwt.core.client.GWT.create(GWT.java:98)
at com.google.gwt.user.client.ui.Hyperlink.<clinit>(Hyperlink.java:65)
at com.mycompany.client.entries.MainEntry.onModuleLoad(MainEntry.java:110)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:369)
at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:185)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:380)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
at java.lang.Thread.run(Thread.java:662)
Line 110 from MainEntry is:
searchButton = new Hyperlink("Search", SEARCH_ID);
so i can't really understand, what is wrong...whithout the iframe i get five history tokens added successfully as follow http://localhost:8080/client/index.html#token1.
It works with and without the iframe tag in my index.html. My mistake was, that i use the url query parameters wrong...after the # :)