relative-path

Should I use relative include paths for my project, or place the include-directory on the include path?

天涯浪子 提交于 2019-11-30 11:28:48
In my project, I currently use relative paths to include my files, which admittedly doesn't change often. However, it yields pretty weird include patterns, because I usually nest my files in alot of folders. For example, in my current project I have network/server/myfile.hpp . It needs to include common/log.hpp . Current I use #include "../../common/log.hpp" which is pretty verbose, but works. If i instead add my main include directory on the path, I could simply include "common/log.hpp" . I know this question might be more about preference than anything else, but is there any objective pros

Why relative path doesn't work in Ruby require

北战南征 提交于 2019-11-30 11:15:00
I'm starting learning Ruby, one thing that I don't understand, why relative path for require directive doesn't work in ruby. It's something that works almost in every scripting language that I now (JSP, PHP...). I explain with a real example. I have a folder named shapes which contains 3 classes shape , rectangle and square . I have also another file test_shapes.rb from where I call and test my classes. When I import my classes to the main file like this: require "./shape" require "./rectangle" require "./square" I got error for files not found. When I include the name of my subfolder like

Loading external HTML page with relative paths into a DIV using jQuery

落爺英雄遲暮 提交于 2019-11-30 10:51:07
I am relatively new to jQuery and pardon if this question is too simple, but I've searched numerous threads for hours and cannot find a definite solution. I have the following folder structure: /index.html /html/pages/page1.html /html/pages/images/ /html/pages/css/ /html/pages/js/ /html/pages/includes/ I am trying to load page1.html into a DIV in index.html in the following basic way: $('#content').load('html/pages/page1.html', function () { console.log('loaded'); }); page1.html loads fine, however, it consists of multiple includes and all the content in it (images, CSS, JS, etc.) is relative

Asp.Net single control render for AJAX calls

99封情书 提交于 2019-11-30 09:49:03
I'm trying to implement something similar to this or this . I've created a user control, a web service and a web method to return the rendered html of the control, executing the ajax calls via jQuery. All works fine, but if I put something in the user control that uses a relative path (in my case an HyperLink with NavigateUrl="~/mypage.aspx") the resolution of relative path fails in my developing server. I'm expecting: http://localhost:999/MyApp/mypage.aspx But I get: http://localhost:999/mypage.aspx Missing 'MyApp'... I think the problem is on the creation of the Page used to load the control

Problem using URL rewrite (Relative Paths not working)

一世执手 提交于 2019-11-30 09:17:36
问题 I am using a .htccess file in order to rewrite my URLs. I am using the following rules in my .htaccess files Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^product/([0-9]+)/([A-Za-z0-9+]+)$ /product.php?productid=$1&prodname=$2 The rewrite worked fine. But when i try to access any other page through relative path which is in all the cases, the URL is not getting redirected properly. Like in the below example <form action "something.php" method="post"> <input type="text"

iText – HTML to PDF - Image is not displayed in PDF

不打扰是莪最后的温柔 提交于 2019-11-30 08:15:18
I have a html page with text, image and I am parsing the HTML content to iText to generate the PDF. In the generated PDF,Included images are not getting displayed and , only the text is getting displayed. If I pass the absolute path like D:/Deiva/CRs/HTMLPage/article-101-horz.jpg then the image will get printed. But if I try to print the image from the server like http://localhost:8085/content/dam/article-101-h1.jpg or http://www.google.co.in/intl/en_ALL/images/logos/images_logo_lg.gif then it is not getting printed in the PDF. NOTE: I am using itextpdf-5.2.1.jar to generate the PDF. My HTML

Why is Magento 1.4 including javascript files by filesystem path?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 05:05:59
I am in the process of testing a Magento 1.3 site using Magento 1.4. I am seeing very weird and inconsistent behavior. Instead of including the URL of my javascript files, Magento is creating tags with the full filesystem path of the js files, as so: <script type="text/javascript" src="/home/my_username/public_html/js/prototype/prototype.js"></script> I believe this is related to the new "Themes JavaScript and CSS files combined to one file" function. In fact, when I log into the admin and click "Flush JavaScript/CSS Cache", then the first page load is successful, and I see a single JS include

relative path doesn't work with paths

和自甴很熟 提交于 2019-11-30 03:48:26
问题 I'm having a problem with relative paths in requirejs. First of all, I have the following structure. I'm running it with a virtual host (os.com) and the path is os.com/test index.html <script data-main="config" src="require.js"></script> config.js require.config({ baseUrl: "./apps", deps: ['ui'], paths: { ui: 'ui/ui', system: 'system/system', core: 'core/core' } }); ui.js define(['./class/menuBuilder',"./class/window"], function(menuBuilder, windowBuilder){ return { menuBuilder: menuBuilder,

Unix paths that work for any platform in Python?

流过昼夜 提交于 2019-11-30 02:40:30
问题 Can all paths in a Python program use ".." (for the parent directory) and / (for separating path components), and still work whatever the platform ? On one hand, I have never seen such a claim in the documentation (I may have missed it), and the os and os.path modules do provide facilities for handling paths in a platform agnostic way (os.pardir, os.path.join,…), which lets me think that they are here for a reason. On the other hand, you can read on StackOverflow that "../path/to/file" works

Removing %20 from URI Relative Path

半世苍凉 提交于 2019-11-30 00:25:41
问题 I am generating a relative path from 1 directory to another. If the OutputDirectoryName property is a directory containing spaces, the spaces are encoded using %20, rather than a space. I am creating a relative path to a windows folder, so I must have my relatiave path using spaces. Is there a clean way to specify how the URI is encoded? I know I could do a stirng replace on the relativePath.ToString(), but am wondering if there's a better implementation. Thanks. public string