relative

PHP convert external relative path to absolute path

Hello, I am trying to figure out how to convert an "external relative path" to an absolute one: I'd really like a function that will do the following: $path = "/search?q=query"; $host = "http://google.com"; $abspath = reltoabs($host, $path); And have $abspath equal to "http://google.com/search?q=query" Another example: $path = "top.h...

relative path not working for images in css

Hi, 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" cellp...

php mkdir windows relative path

Hi, Want to create a directory on windows from a PHP script. My script is in www/Test directory of Apache and want to create a folder(fold1) inside www/downloads directory. Inside the script, using, $dirName = "../downloads/fold1"; mkdir("{$dirName}"); If we use the full path of dirName like C:\Apache\www\downloads\fold1, it works f...

Program fails to load image from relative path on drag-drop file open

I have a program I have written in C#, which loads an image with Image.FromFile, and it loads the image successfully every time. However, when you drag and drop another file on the executable, like you are giving the program the command line argument of the file, and the file is not in the same folder as the executable, the program crash...

jQuery Relative Offset problems

Hi, User select an image in top. This image moving to "Current element". User select another image. Previous selected image moving to "Old elements": $('#selected_element_1').css({'position': 'relative', 'top': '-129px', 'left': '40px'}) Result: <div style="background-color: rgb(204, 204, 204);"> <ul id="CurrentElement" class="ch...

Css positioning problem

Hi guys. I did a "shadow" effect but the "div" elements must have a relationship (father and son) <style> body { padding-left: 47px; padding-top: 114px; } div { font-size: 60px; position: relative; } div div { left: 3px; position: absolute; top: 3px; } </...

Updating the relative time in android

Hi All, I am developing a Twitter client application. As with other twitter clients, I would like to display the relative time of tweet with respect to the current time. I am using a list view and a Simple adapter that binds to an arraylist which stores the tweet information. If I calculate the relative time and store a string, I will b...

In a WPF user control, how do I specify coordinates relative to the control's total size, so that the control will scale correctly?

I have created this simple expand button user control with WPF:          I designed the thing with Width and Height both set to 100 so that I could see what I'm actually doing. The stripped-down XAML of this user control is: <UserControl x:Class="Foobar.ExpandButton" ... Width="100" Height="100"> ... ...

Android - Nested layout question

Consider a VideoView added to a Linear Layout with parameteres FILL_PARENT, FILL_PARENT. The Linear Layout gets added to the root layout which is a Relative Layout, with parameters WRAP_CONTENT, WRAP_CONTENT. Which parameters take precedence here? ...

Regular Expression to match relative URLs

Looking for a regular expression that match the following relative URLs: All urls starts with /abc/ but we don't know where it ends and it doesn't have any file extension at the end. /abc/xyz /abc/part1/part2 /abc/red/blue/white/green/black and so on. Any help? ...

IE position:relative displaying as if position: static

Hi Guys, i have the following html (excerpt from larger code-base) <div class="diary-event ui-corner-all" title="[title]"> <span id="delete"></span> <div class="diary-event-title ui-corner-all">[title]</div> <div class="diary-event-body ui-corner-all"> <p class="hyphenate">[body]</p> </div> </div> (where [titl...

What is the trick to make Visual Studio 2008 use project relative paths for include dirs etc?

Hi I have a VS 2008 solution with around 10 projects. When I add include directories by launching browse popup and select a dir, I see VS storing the absolute path in the project file. What I want it to do is use project relative paths even for paths in sibling folders. Is there any setting in VS to force it? Thanks ...

Can't get IgnoreGravity within RelativeLayout to work

I have two buttons. I want one to be aligned at the top center of the application. I want to get the other button to ignore the gravity settings and go where I tell it. How do I do this? <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/relative_la...

How do I open a C file with a relative path?

I am trying to parse a txt file and I want to reference it relative to my current directory location. If I put the file path in completely it will work but it I try to use ..\src\test.txt it wont find it. Is this not the proper way to reference a file relative up one directory? Any help would be appreciated ...

How to Bind to a Child's Background in Xaml?

I'm able to bind to a child's Background if the child is explicitly named in ElementName: <TreeViewItem Header="Test" Background="{Binding ElementName=TestChild, Path=Background}"> <TextBox Name="TestChild" Text="Hello?" Background="{Binding SomeBinding}" /> </TreeViewItem> I'd prefer to use relative position rather than specific n...

relative path traversing, is this valid?

I have a an XML file where I need to get up 2 dirs to get a file (from water to fire) <album basepath="albums/water/images"> <img src="001.jpg" /> <img src="002.jpg" /> <img src="../../fire/images/005.jpg" /> </album> So my question is if albums/water/images/../../fire/images/005.jpg is a valid path? ...

Can I share source code among projects in Eclipse (CDT) without using absolute paths?

Greetings, I know there are similar questions with answers, and some of them are being offered to my as I type this. However, none of them seem to offer a solution without absolute paths. I have two projects in an SVN project, and they need use some cpp and h files in a shared way. I simply could not find a way of avoiding absolute pa...

What relative path do I need to use in my Java Project.

Hi, I have a structure like: src -|com -|company -|Core --> JAVA class -|rules --> text files Inside Core is a Java Class that uses: BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(fileName))); But I cannot figure out what relative path to use. Now I use: "..\\..\\...

how can I provide a relative path for H2 database file, using hibernate under Tomcat?

Greetings, I have a setup which must be fairly common: I have an H2 db, with a db file. I'm using the db in standalone mode. Hibernate provides access to db, and I've deployed my code into Tomcat. The problem is: I could not find a nice way of simply putting the db file into the war, and providing a relative path in hibernate config fil...

Python relative import causes syntaxerror: invalid syntax

Hi all, 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 ...