relative-path

How to Load multiple angular2 components from different folders in one index.html file?

放肆的年华 提交于 2019-12-10 17:51:34
问题 I have developed few angular 2 components. the directory structure for my application is following. and I am loading each component from index.html as <script> System.config({ map: { 'rxjs': 'node_modules/rxjs' }, packages: { app: { format: 'register', defaultExtension: 'js' }, 'rxjs': {defaultExtension: 'js'} } }); System.import('component_1/app/main') .then(null, console.error.bind(console)); </script> what I have done is , there must be only one index.html and according to the path

Why simplexml_load_file does not work relative to host file?

穿精又带淫゛_ 提交于 2019-12-10 17:47:03
问题 I have simplexml_load_file instruction placed withing included PHP file. But this instruction works depending on where I include this file from. Why? Is it possible to make relative file path be interpreted relatively to the file instruction placed in? 回答1: You can always access the current file's full path with the magic __FILE__ constant, so you can write your simplexml_load_file() call like this: <?php simplexml_load_file(dirname(__FILE__).'/file.xml'); Update Since PHP 5.3, there have

Relative URLs in Sharepoint master page

眉间皱痕 提交于 2019-12-10 15:17:09
问题 I have a master page with tabs. The tabs are defined by the following sitemap file: <siteMap> <siteMapNode title="Home" url="~/" > <siteMapNode title="Schedule" url="~/Pages/Tab2.aspx"/> <siteMapNode title="Deliverables" url="~/Pages/Tab3.aspx"/> <siteMapNode title="My Items" url="~/Pages/Tab4.aspx"/> <siteMapNode title="Management" url="~/Pages/Tab5.aspx"/> <siteMapNode title="Working Docs" url="~/Pages/Tab6.aspx"/> </siteMapNode> </siteMap> The problem is that on my subsites, clicking on a

Relative path with fstream c++

最后都变了- 提交于 2019-12-10 15:16:24
问题 I try to load a file with fstream. The code looks like this file.open("../levels/level0.lvl"); if (file.is_open()) { while (!file.eof()) { std::getline(file, Str); list = ReadLine(Str, list); } } But it loads nothing. Yes only if the path is absolute. How can I make the path relative? The folder "levels" is hosted in the debug folder. same folder as the exe. 回答1: "The folder "levels" is hosted in the debug folder. same folder as the exe." It doesn't matter in which position the levels folder

Absolute to relative path (Eclipse, JSP) [duplicate]

↘锁芯ラ 提交于 2019-12-10 15:10:23
问题 This question already has answers here : Where to place and how to read configuration resource files in servlet based application? (6 answers) Closed 3 years ago . I am making a web application in Eclipse (JSP) and use Tomcat as a server (integrated into Eclipse). I have to create the object below and specify the path to configuration file. This absolute path is working great: Store store = StoreFactory.create("file:///C:/Users/Aliens/workspace/myProject/WebContent/config/sdb.ttl"); However I

Relative paths using requirejs in combination with Typescript and AMD

送分小仙女□ 提交于 2019-12-10 14:55:40
问题 There are several Javascript files, organized in folders Scripts/folder1, Scripts/folder2, ... With requirejs.config.baseUrl a folder is defined as the default, for example Scripts/folder1. Then in requirejs.config.paths some files are addressed with just the filename, and some are addressed with a relative path (like ../folder2/blabla). When coding the Typescipt file folder2/blabla.ts we need the module "math" from folder1. So we write import MOD1 = module("../folder1/math"); Regarding

Relative Path in master page for img tag

…衆ロ難τιáo~ 提交于 2019-12-10 14:40:16
问题 I have a tag in a master page. I use this master page in many folders. So the src path of the tag should be different for each folder. Here is my code : <img src="images/1.gif" /> and I have a folder named "images" and a folder named "Users". Master Page is in the root, but I use it in Users folder. How can I set a dynamic address for src? 回答1: The easiest way would be to use an asp:Image tag. You need to add runat="server" in order to use ~ syntax to resolve your URLs. <asp:Image ID="myImage

Get relative path to file at design time

不羁岁月 提交于 2019-12-10 13:52:21
问题 I am building a Windows phone 8 app. At design time I load a sample XML file to get sample data. It works well but I want to use path to file that is relative to solution root so it can work for all developpers with the same code. Here is my current code: var path = @"C:\Users\Tom\MyProject\SampleData\stub.xml"; xml = new StreamReader(path).ReadToEnd(); I tried a relative path like @"SampleData\stub.xml". It works on phone but at design time I get this error: DirectoryNotFoundException: Could

relative path not working for images in css

邮差的信 提交于 2019-12-10 11:13:58
问题 I have the following file structure: C:/wamp/myproject/admin/webroot/images I have an index.php file lying inside the admin folder which calls a header.inc.php file lying in the same folder. header.inc.php has the following code- <td align="left" valign="top" class="header-bg"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> index.php calls a css file (css.css) through the following code: <link href="<?php echo (WS_DIR_CSS); ?>/css.css" rel="stylesheet" type="text/css" /> The

Python relative import causes syntaxerror: invalid syntax

那年仲夏 提交于 2019-12-10 10:59:17
问题 I'm trying to install this great python module Python-Chrono to my python environment, but it fails at least with python 2.4.3 and 2.6.6 with the following error message: Traceback (most recent call last): File "setup.py", line 30, in ? import chrono File "/home/janne/python-chrono-0.3.0/chrono/__init__.py", line 22 from . import calendar ^ SyntaxError: invalid syntax The setup is using relative import mechanism and it should work just fine, but in my environment it causes this error. Is