How do I reference a relative path in Jupyter-book - jupyter

In Jupyter-book, I am creating a _toc.yml file. I have something like -
- caption: Tutorials
chapters:
- file: ../../notebooks/some_notebook
I get the exception -
home/code/nwb_datajoint/docs/web-doc/intro.md:: WARNING: toctree contains reference to nonexisting document '../../notebooks/some_notebook' [etoc.ref]
looking for now-outdated files... none found
How do I reference a relative directory in in _toc.yml's parent directory?

Related

how to reference a parent folder from azure devops pipe?

I am getting the following error from my build:
'$/CCC/AAA/AAASchemas' cannot be cloaked because it does not have a mapped parent.
##[error]Exit code 100 returned from process: file name 'tf', arguments 'vc workfold /cloak /workspace:ws_26_26 $/CCC/AAA/AAASchemas /collection:https://usap-dev.visualstudio.com/ /loginType:OAuth /login:.,*** /noprompt'.
Here's how I've configured it:
How do I correctly add this folder?
The error message is very clear: You can't cloak that because you're not mapping anything in the hierarchy above it.
You're mapping $/CCC/AAA/FromHHHMethodist/DEV. The path $/CCC/AAA/AAASchemas isn't in that path. Thus, there's nothing to cloak, because it's not going to get downloaded in the first place. You'd only need to cloak it if you were mapping $/, $/CCC, or $/CCC/AAA.

How to use $ref to reference a path from another OpenAPI file?

Here it says I could refer to the definition in another file for an individual path, but the example seems to refer to a whole file, instead of a single path definition under the paths object. How to assign an individual path in another file's paths object?
For example, I have Anotherfile.yaml that contains the /a/b path:
paths:
/a/b:
post:
In another file, I use $ref to reference the /a/b path as follows:
paths:
/c/d:
$ref: 'Anotherfile.yaml#/paths/a/b'
but this gives an error:
Could not find paths/a/b in contents of ./Anotherfile.yaml
When referencing paths, you need to escape the path name by replacing / with ~1, so that /a/b becomes ~1a~1b. Note that you escape just the path name and not the #/paths/ prefix.
$ref: 'Anotherfile.yaml#/paths/~1a~1b'

Replace values in multiple appsettings files stored in different artifacts during VSTS Release pipeline

I am trying to replace appsettings.json and e2e-appsettings.json variables stored in two different artifacts in the release pipeline.
As per below code, ONLY appsettings.json is updating, but for the second line it gives an error,
error: NO JSON file matched with specific pattern: e2e/XXX.EndToEnd.Integration.Tests/e2e-appsettings.json
As per the information it should be the relative path to root. So in this case not sure what should be the root as there are two build artifacts.
Further in download artifact logs says,
2019-04-09T02:33:55.9132583Z Downloaded e2e/XXX.EndToEnd.Integration.Tests/e2e-appsettings.json to D:\a\r1\a\EstimationCore\e2e\XXX.EndToEnd.Integration.Tests\e2e-appsettings.json
The artifact with other appsettings.json file which is working fine is a zip file. logs, Downloading app/app.zip to D:\a\r1\a\EstimationCore\app\app.zip
These I have already tried which gave the same error
- NO JSON file matched with specific pattern: e2e/XXX.EndToEnd.Integration.Tests/e2e-appsettings.json.
- NO JSON file matched with specific pattern: **/*e2e-appsettings.json
- NO JSON file matched with specific pattern: d:\a\r1\a\EstimationCore\e2e\XXX.EndToEnd.Integration.Tests\e2e-appsettings.json.
- NO JSON file matched with specific pattern: d:\a\r1\a\EstimationCore\**\**\e2e-appsettings.json.

does the filePath argument for enterpriseLibrary.ConfigurationSource have to be a non-relative path?

The MSDN documentation for this element says "The path that points to the configuration file. This attribute is required if the configuration source is a file." Ok that's fairly obvious.
I tried just setting it to filePath="enterpriselibrary.config". The file exists in the root of my web app. But when I try to log an exception I get "The configuration file enterpriselibrary.config could not be found." Same thing if I use a relative path "~/enterpriselibrary.config".
So what's the story with this file path, does it have to be a hard path (C:
...\MyApp\enterpriselibrary.config)? Is there some documentation that I'm missing?
This is a known bug in EL 5.0: http://entlib.codeplex.com/workitem/26760
The bug is fixed in EL 5.0 Optional Update 1. There is also a workaround on that bug page (code below). I've used the workaround successfully.
workaround:
code:
[Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationElementType(typeof(FileConfigurationSourceElement))]
class FileConfigurationSource : Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource
{
public FileConfigurationSource(string configurationFilepath)
: base(configurationFilepath)
{
}
}
class FileConfigurationSourceElement : Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSourceElement
{
public override Microsoft.Practices.EnterpriseLibrary.Common.Configuration.IConfigurationSource CreateSource()
{
string configurationFilepath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, this.FilePath);
return new FileConfigurationSource(configurationFilepath);
}
}
config:
<add name="sourceName" type="YourNamespase.FileConfigurationSource, YourAssembly" filePath ="fileName"/>
The filePath can be relative or absolute. If you specify a relative path then the path is considered relative to the AppDomain.CurrentDomain.BaseDirectory directory. As you discovered you cannot use a root-relative path (~/enterpriselibrary.config).
I'm not sure why your config file is not found; the root of your web application should be the BaseDirectory.
To debug you can check that:
File.Exists(
Path.Combine(AppDomain.CurrentDomain.BaseDirectory,
"enterpriselibrary.config"))
returns true. If it does then Enterprise Library should be able to find the file specified.

How to change include directory of Zend Framework

I get the following error messages:
Warning: include_once(Zend\Db.php) [function.include-once]:
failed to open stream: No such file or directory in
C:\EasyPHP3\www\VPZ\Lib\Zend_1.7.7\Loader.php on line 83
Warning: include_once() [function.include]:
Failed opening 'Zend\Db.php' for inclusion (include_path='VPZ/') in
C:\EasyPHP3\www\VPZ\Lib\Zend_1.7.7\Loader.php on line 83
Warning: require_once(Zend/Exception.php)
[function.require-once]: failed to open stream:
No such file or directory in
C:\EasyPHP3\www\VPZ\Lib\Zend_1.7.7\Loader.php on line 87
Fatal error: require_once() [function.require]:
Failed opening required 'Zend/Exception.php' (include_path='VPZ/') in
C:\EasyPHP3\www\VPZ\Lib\Zend_1.7.7\Loader.php on line 87
i want to include ZendXXX\Db.php
how to change it
create a directory (say 'lib'), and put your Zend directory in it. so your directory structure looks like this:
- application
- lib
|- Zend
- wwwroot
|- index.php
now you should add lib to your include path. edit your index.php file:
$includePath = array();
$includePath[] = '.';
$includePath[] = './../application';
$includePath[] = './../lib';
$includePath[] = get_include_path();
$includePath = implode(PATH_SEPARATOR,$includePath);
set_include_path($includePath);
now you have your lib in your include path. you can include all Zend components like this:
include 'Zend/Loader.php';
require_once 'Zend/Db.php';
the best way is too include Zend_Loader first and then use it to load classes. do this:
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Db');
you can also register to autoload classes. just add this line to your code after all those before:
Zend_Loader::registerAutoLoad('Zend_Loader',true);
now you do not need to include files to call classes. just instanciate your classes:
$session = new Zend_Session_Namespace('user');
there is no need to include 'Zend/Session/Namespace.php'.
Use set_include_path(). See PHP.net documentation
Example:
set_include_path(get_include_path() . PATH_SEPARATOR . '/path/to/Zend');
I usually store the framework files under a "library" folder:
application
public_html
library
Zend
Common
etc....
and then in my bootstrap file, or front controller, I add that "library" folder to the include path:
set_include_path(get_include_path() . PATH_SEPARATOR . '../library');
See also:
Choosing Your Application's Directory Layout.
Create the Filesystem Layout.
The reason the other suggestions say anything about doing that, is because it's a bad move - in other words, you're doing it wrong.
You can create a subdirectory and name it Zendxxx, but then you have to add that to your include_path, and change it, whenever you put a newly named version up.
I'd hazard a guess, and say that you don't have a good way to test the website (so you want to lock it to a particular version of ZF), and further, that you aren't using revision control, so you want all the previous versions of code in the site-directory to be able to go back to, if you find a problem when you change the live-running code directly on the server.
project without library And including library from one location
project C:\xampp\htdocs\my\application
library C:\xampp\Zend\library
make changes in index.php
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR,
array(realpath(APPLICATION_PATH.'/../../../Zend/library'),get_include_path(),)));