MarkLogic: where should I place the XSLT code when testing xdmp:xslt-invoke in the qconsole - xslt

I have tried adding it to the database associated with the query that's being run, in the folder of the qconsole itself and in the Modules db, but I still get the error message: "File open error: open '/to-html.xsl': No such file or directory"
This is the code I'm trying to run:
xdmp:xslt-invoke("to-html.xsl", fn:doc('/docs/before-1.xml'))

Generally, the path given to xdmp:xslt-invoke will resolve relative to your modules root. But there is a more complex set of rules about the order MarkLogic will use when evaluating paths explained in the documentation:
https://docs.marklogic.com/guide/app-dev/import_modules#id_29407

Related

What is a Jenkins Workspace directory?

I'm using R scripts with C++ code under the hood. An error message references a Jenkins Workspace with the file I'd like to debug. The workspace directory appears to be temporary and I'm unable to find this file:
c:\jenkins\workspace\mxnet\mxnet\src\operator\tensor../elemwise_op_common.h:123: Check failed: assign(&dattr, (*vec)[i])
How should the directory c:\jenkins\workspace\... be understood?
Where would I look for the header file elemwise_op_common.h?
The file should be in
c:\jenkins\workspace\mxnet\mxnet\src\operator\elemwise_op_common.h
The \../ being for getting one folder up.
The workspace is where Jenkins checks out the sources, and execute its job.
It differs from a build.
See more at "Building a software project".

Error: network 'Scenario' not found

I have installed veins-4.5 and I can run the Erlangen example.
However, when I try to run the example in the subprojects/veins_inet folder it gives "Error: Network 'Scenario' not found, check .ini and .ned files"
However the Scenario.ned is in the same folder as omnetp.ini.
How do I solve this problem?
Many thanks.
If you are using the interface graphic, do it: click in subprojects/veins_inet and next in omnet ++ project -> build all.
Another cause for that error is that the .ini isn't correct.
In particular, if you wish to simulate using Gui (Tkenv), your .ini file should include something like:
[Config MyNetwork]
However, for a command-line simulation (Cmdenv), the .ini file should read instead:
cmdenv-config-name = MyNetwork
in the latter case, you should also add "-u Cmdenv" to your run command.
Confusing between the 2 options above raises the error ""Error: Network '...' not found, check .ini and .ned files".

Creating a file via python on OpenShift application

with io.open("filepath/filename",mode="w",encoding="utf8") as file:
file.write(jsondata)
But it seems something wrong.
my flaskapp return 500 and no error logs
But when i remove it everything can run as normal.
what should i do?
If you are using OpenShift 2, it is likely your web application is running under Apache/mod_wsgi. You shouldn't in that case be using relative path names as the current working directory of the application is effectively undefined and likely not writable. Instead construct an absolute path name. Depending on what file is for, you may be best to write files into the data directory provided to you and specified by the OPENSHIFT_DATA_DIR environment variable, if it potentially needs to persist. Or OPENSHIFT_TMP_DIR if a temporary file. Details of important variables for directories can be found in:
https://developers.openshift.com/managing-your-applications/environment-variables.html#directory-variables
As to why you aren't seeing any error, this is likely because Flask is swallowing the error up when generating the 500 response. You would need to configure Flask to log details of the error.

Not able to save file deployed on jetty server

I have deployed my webapplication on a jetty server, and I am trying to edit those deployed files using WebStorm 8.0.4. But I am unable to save the edited files and getting the following error:
Try turning the 'safe write' feature (Settings/General, 'Use safe writes') off - does it help? It creates a temporary copy of a file: creates a separate temp file, deletes the original and then renames. With this option the original file permissions may be lost, this causes problems, especially when working on remote drives.
Follow these steps.
Open C:\Users\YourUserName\.m2\repository (If you use maven)
Find org folder and Navigate org\eclipse\jetty\jetty-webapp\yourJettyVersion
There will be a .jar file.
Open it with winrar or some program like winrar.
Navigate org\eclipse\jetty\webapp
Find webdefault.xml and Open it with any text editor.
Search useFileMappedBuffer parameter in file
You will see a param value.
Change it to false.
Save and Exit.
I'm sorry for any English mistakes.

PyAIML not loading startup

I am beginning a project on Python that implements PyAIML and I wrote the following code to create a brain for my project:
import aiml
k=aiml.Kernel()
k.learn("std-startup.xml")
k.respond("LOAD AIML B")
k.saveBrain("jarvis.brn")
When I run the program I get this error: WARNING: No match found for input: LOAD AIML B
I understand that I needed to download an AIML set to begin development. So I did, but I'm stuck there.
Please help. I'm a noob programmer so don't be rough on me for this dumb mistake.
Thanks in advance!
The .learn() method will not throw an error if the file you pass it does not exist, and I'm guessing that you are trying to learn patterns from "std-startup.xml" without having this file in your directory.
Make sure the file std-startup.xml is in the directory you are running your script from. You should also have a directory called standard in your working directory that contains the standard set of aiml files. Basically your directory should look like this:
mydir/my_script.py
mydir/std-startup.xml
mydir/standard/a-bunch-of-std-aiml-files.aiml
These files can be found in the "Other Files/Standard AIML Set/" folder on the pyaiml source forge site. Go to that folder and download the one of the tarballs or the zip.
A few things:
If your AIML is loading properly, pyAIML will respond with a line that will read something like:
Loading std-startup.aiml... done (1.00 seconds)
It will not necessarily throw an error if it does not find a file to load, so if you don't see this line, pyAIML has not loaded the AIML file.
I don't see 'std-startup.xml' in the sourceforge directory either, but this shouldn't matter. All that you're loading is any AIML file that will allow you to test the kernel. Try loading the 'self-test.aiml' file in the /aiml directory instead. (Double-check to make sure the file suffix in your code is .aiml and not .xml)
k.respond() is for giving the bot some input and 'LOAD AIML B' is just a test phrase. Once you've loaded 'self-test.aiml' try k.respond('test date') and you should get
The date is Wed Mar 13 01:37:07 2013 in response.