Search Results

Search found 2572 results on 103 pages for 'relative'.

Page 7/103 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Display relative time in hour, day, month and year

    - by JohnJohnGa
    I wrote a function toBeautyString(epoch) : String which given a epoch, return a string which will display the relative time from now in hour and minute For instance: // epoch: 1346140800 -> Tue, 28 Aug 2012 05:00:00 GMT // and now: 1346313600 -> Thu, 30 Aug 2012 08:00:00 GMT toBeautyString(1346140800) -> "2 days and 3 hours ago" I want now to extend this function to month and year, so it will be able to print: 2 years, 1 month, 3 days and 1 hour ago Only with epoch without any external libraries. The purpose of this function is to give to the user a better way to visualize the time in the past. I found this: Calculating relative time but the granularity is not enough.

    Read the article

  • Get Relative Path to Linked Resource in C#

    - by Jason
    I have a number of linked resources (text files in this case) in a C# project I am working on. I know the resources are linked via relative path in the Resources file. Is there any way to get that relative path from within the C# code? If there isn't, what I am trying to do is to pass that resources file to an external application as a commandline argument. If I can't do it the first way (which would obviously be the easiest) any other suggestions would be much appreciated. Thanks!

    Read the article

  • Using htaccess rewrite to make a subdirectory be its own root for root relative path requests

    - by Scott
    Can I use htaccess to capture requests from a certain subdirectory and make that directory use itself as the root directory for any root relative path requests? For example if I have... http://www.example.com/subFIXED/subANY/restofpath ...where subFIXED is always the same directory, subANY is any immediate subdirectory of subFIXED, and I want a redirection of all href/src requests from any file under subANY to use subANY as the 'root' (sort of like a subdomain), in effect having root level requests use this as the root directory level: http://www.example.com/subFIXED/subANY/ Instead of this: http://www.example.com/ I'm assuming I can put an htaccess file in subFIXED to handle all calls coming from anything under any subANY, but not being very familiar with htaccess rewriting, variables, etc., I can't figure out how to capture which subANY directory is making the root level request and then use that capture to make a rewrite to consider that directory the root level of any root relative path requests from it. Thanks for your help

    Read the article

  • Icon placement relative to list items

    - by Ronedog
    When I show a hidden div that is stored inside an <li> tag the icons are pushing down to the bottom of the <li>. How can I prevent this? Here's the HTML: <ul> <li>Utah <ul> <li>Park City <ul> <li>Park Cat 1 <div><img class="portf_edit" /></div> <div><img class="portf_archive" /></div> <div><img class="portf_delete" /></div> </li> <li>Skiing <div><img class="portf_edit" /></div> <div><img class="portf_archive" /></div> <div><img class="portf_delete" /></div> </li> </ul> </li> </ul> </li> </ul> Here's the li css: li { list-style-type:none; vertical-align: top; list-style-image: none; left:0px; text-align:left; clear: both; } .portf_edit{ float:right; position: relative; right:50px; display:block; } .portf_archive{ float:right; position: relative; right:-5px; display:block; } .portf_delete{ float:right; position: relative; right: -60px; display:block; } Here's a screen shot prior to expanding which shows the icons how I want them to line up: Here's the screen shot prior to expanding which shows where the icons are being pushed to:

    Read the article

  • Specifying Locations relative to the context XML in Spring

    - by Daisuke Shimamoto
    Is there a way to reference a properties file relative to the Spring's context file itself? What I want to do is the below: <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <!-- I want the below to be relative to this context XML file. --> <value>app.properties</value> </list> </property> </bean> I was imagining something like ${contextpath} that I could prepend to the above "app.properties" but couldn't find anything helpful. Thanks.

    Read the article

  • MSBuild: convert relative path in imported project to absolute path.

    - by Ergwun
    Short version: I have an MSBuild project that imports another project. There is a property holding a relative path in the imported project that is relative to the location of the imported project. How do I convert this relative path to be absolute? I've tried the ConvertToAbsolutePath task, but this makes it relative to the importing project's location). Long version: I'm trying out Robert Koritnik's MSBuild task for integrating nunit output into Visual Studio (see this other SO question for a link). Since I like to have all my tools under version control, I want the target file with the custom task in it to point to the nunit console application using a relative path. My problem is that this relative path ends up being made relative to the importing project. E.g. (in ... MyRepository\Third Party\NUnit\MSBuild.NUnit.Task.Source\bin\Release\MSBuild.NUnit.Task.Targets): ... <PropertyGroup Condition="'$(NUnitConsoleToolPath)' == ''"> <NUnitConsoleToolPath>..\..\..\NUnit 2.5.5\bin\net-2.0</> </PropertyGroup> ... <Target Name="IntegratedTest"> <NUnitIntegrated TreatFailedTestsAsErrors="$(NUnitTreatFailedTestsAsErrors)" AssemblyName="$(AssemblyName)" OutputPath="$(OutputPath)" ConsoleToolPath="$(NUnitConsoleToolPath)" ConsoleTool="$(NUnitConsoleTool)" /> </Target> ... The above target fails with the error that the file cannot be found (that is the nunit-console.exe file). Inside the NUnitIntegrated MSBuild task, when the the execute() method is called, the current directory is the directory of the importing project, so relative paths will point to the wrong location. I tried to convert the relative path to absolute by adding these tasks to the IntegratedTest target: <ConvertToAbsolutePath Paths="$(NUnitConsoleToolPath)"> <Output TaskParameter="AbsolutePaths" PropertyName="AbsoluteNUnitConsoleToolPath"/> </ConvertToAbsolutePath> but this just converted it to be relative to the directory of the project file that imports this target file. I know I can use the property $(MSBuildProjectDirectory) to get the directory of the importing project, but can't find any equivalent for directory of the imported target file. Can anyone tell me how a path in an imported file that is supposed to be relative to the directory that the imported file is in can be made absolute? Thanks!

    Read the article

  • Getting rid of scroll bar for position: absolute inside of position:relative inside of overflow:auto

    - by Marcos
    Hey guys, my first question here on stack overflow. Trying to get something pretty simple to work, I'm sure I'm missing something quite obvious. Still getting used to the "standard" css, too many years working with non-functional ones! Heh. So, sample of what I'm doing: <div style="overflow: auto; border: 1px solid"> hello <div style="position: relative; z-index: 99999; top: 0px; left: 0px;"> <div style="z-index: 99999; overflow-y: hidden; position: absolute; overflow: hidden; height: 200px; left: 0; auto: 0"> <ul> <li >New</li> <li >Old</li> </ul> </div> </div> </div> In essence: The first div is a container, that I would like to automatically overflow as content is added. Inside of that container, I have a popup menu, which I have simplified here. The popup menu appears (as it should) directly under "hello". My problem, however, is that instead of the popup menu "coming out" of the parent, as would be expected by the absolute position, it is actually causing a scrollbar to appear on the parent. I know that if I take otu the "position: relative" it works, but then it no longer appars where I want it (directly under the previous element). What am I missing here? EDIT: Sample here: http://marcos.metx.net/OverflowTest.htm

    Read the article

  • Linear Layout over relative layout

    - by Sai
    I have a relative layout for Camera preview with some overlay features. The layout file looks like the one in shown below: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <android.view.SurfaceView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/preview" android:layout_width="fill_parent" android:layout_height="fill_parent" > </android.view.SurfaceView> </RelativeLayout> I integrated some menu options from the android bluetooth chat example. The menu options work fine but if I click on one of the options, the app just froze. It opens a debug perspective but I am not able to understand them. The app does not seem to crash but it just froze. The layout that I am using for the menu options is: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" > <TextView android:id="@+id/title_paired_devices" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/title_paired_devices" android:visibility="gone" android:textColor="#fff" android:paddingLeft="5dp" /> <ListView android:id="@+id/paired_devices" android:layout_width="match_parent" android:layout_height="wrap_content" android:stackFromBottom="true" android:layout_weight="1" /> <TextView android:id="@+id/title_new_devices" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/title_other_devices" android:visibility="gone" android:textColor="#fff" android:paddingLeft="5dp" /> <ListView android:id="@+id/new_devices" android:layout_width="match_parent" android:layout_height="wrap_content" android:stackFromBottom="true" android:layout_weight="2" /> Can I attribute this to the fact that I am trying to overlay Linear layout over relative layout? Any suggestions to display the list of bluetooth devices over camera preview would be greatly appreciated

    Read the article

  • URLRewriter.net fails relative paths when using more than one substring in URL

    - by Andreas Strandfelt
    Hi. I have installed the URLRewriter on my server, and it works fine, but I have a rather big problem. Relative links in hyperlinks, CSS-links, images etc. doesn't work when I have URLs with more than one substring. E.g. (sorry, no http:// in front, as I do not have enough reputation): dkbyg.strandweb.dk/Leje-og-udlejning-arbejdskraft leads to the path dkbyg.strandweb.dk/Workers.aspx and works just fine. But dkbyg.strandweb.dk/Leje-og-udlejning-arbejdskraft/Midtjylland leads to dkbyg.strandweb.dk/Workers.aspx?Region=Midtjylland using this line in the Web.config: <rewrite url="~/Leje-og-udlejning-arbejdskraft/(.+)" to="~/Workers.aspx?Region=$1"/> It rewrites just fine, but my relative links doesn't work anymore. CSS, Images, links and so on thinks my root is now http://dkbyg.strandweb.dk/Leje-og-udlejning-arbejdskraft, which of course doesn't exist. Can't this be fixed? All my links are correctly set using the ~/, like this: <asp:HyperLink ID="HyperLink3" CssClass="black_text" NavigateUrl="~/Forgot-Password" runat="server">I have forgotten my password</asp:HyperLink>

    Read the article

  • jQuery - Finding the element index relative to its container

    - by Hary
    Here's my HTMl structure: <div id="main"> <div id="inner-1"> <img /> <img /> <img /> </div> <div id="inner-2"> <img /> <img class="selected" /> <img /> </div> <div id="inner-3"> <img /> <img /> <img /> </div> </div> What I'm trying to do is get the index of the img.selected element relative to the #main div. So in this example, the index should be 4 (assuming 0 based index) and not 1. My usual way to go about getting indexes is using $element.prevAll().length but, obviously, that will return the index relative to the #inner-2 div. I've tried using $('img.selected').prevAll('#main').length but that's returning 0 :/

    Read the article

  • convert list of relative widths to pixel widths

    - by mkoryak
    This is a code review question more then anything. I have the following problem: Given a list of relative widths (no unit whatsoever, just all relative to each other), generate a list of pixel widths so that these pixel widths have the same proportions as the original list. input: list of proportions, total pixel width. output: list of pixel widths, where each width is an int, and the sum of these equals the total width. Code: var sizes = "1,2,3,5,7,10".split(","); //initial proportions var totalWidth = 1024; // total pixel width var sizesTotal = 0; for (var i = 0; i < sizes.length; i++) { sizesTotal += parseInt(sizes[i], 10); } if(sizesTotal != 100){ var totalLeft = 100;; for (var i = 0; i < sizes.length; i++) { sizes[i] = Math.floor(parseInt(sizes[i], 10) / sizesTotal * 100); totalLeft -= sizes[i]; } sizes[sizes.lengh - 1] = totalLeft; } totalLeft = totalWidth; for (var i = 0; i < sizes.length; i++) { widths[i] = Math.floor(totalWidth / 100 * sizes[i]) totalLeft -= widths[i]; } widths[sizes.lenght - 1] = totalLeft; //return widths which contains a list of INT pixel sizes

    Read the article

  • Replace relative urls to absolute

    - by Rocky Singh
    I have the html source of a page in a form of string with me: <html> <head> <link rel="stylesheet" type="text/css" href="/css/all.css" /> </head> <body> <a href="/test.aspx">Test</a> <a href="http://mysite.com">Test</a> <img src="/images/test.jpg"/> <img src="http://mysite.com/images/test.jpg"/> </body> </html> I want to convert all the relative paths to absolute. I want the output be: <html> <head> <link rel="stylesheet" type="text/css" href="http://mysite.com/css/all.css" /> </head> <body> <a href="http://mysite.com/test.aspx">Test</a> <a href="http://mysite.com">Test</a> <img src="http://mysite.com/images/test.jpg"/> <img src="http://mysite.com/images/test.jpg"/> </body> </html> Note: I want only the relative paths to be converted to absolute ones in that string. The absolute ones which are already in that string should not be touched, they are fine to me as they are already absolute. Can this be done by regex or other means?

    Read the article

  • XPath Query - Select relative top level nodes

    - by John
    I'm trying to iterate over some elements in an XML document that may be nested, but as I iterate over them I may be removing some from the tree. I'm thinking the best way is to do this recursively, so I'm trying to come up with an XPath Query that will select all the top-level nodes relative to the current node. //foo[not(ancestor::foo)] works great at the document level, but I'm trying to figure out how to do this from a relative query. <foo id="1"> <foo id="2" /> <foo id="3"> <foo id="4"> <bar> <foo id="5"> <foo id="6" /> </foo> <foo id="7" /> </bar> </foo> </foo> </foo> If the current node is foo#3, I only want to select foo#4. When the current node is foo#4, I only want to select foo#5 and foo#7. I think I'm trying to select any descendant foo nodes of the current node, but without any ancestor foo nodes between the current node and the node I'm selecting. My conundrum is if we're already inside a foo node, not(ancestor::foo) doesn't help.

    Read the article

  • List symlinks in specific relative directories

    - by Clinton Blackmore
    I have a server that shares out user home folders over the network. Each user has a Cache folder. Sometimes a symlink is used to redirect this folder to the hard drive of whichever machine they are using (and sometimes that doesn't work and they have a broken symlink [which is a matter for another day].) I'm trying to find out which users have symlinks and which don't. Within the shared folder, to get to the Cache folder you would substitute folders like so: $GRADE/$USERNAME/Library/Caches Right now I'm searching to see which users have symlinks and which do not. I've come up with: cd /path/to/shared/home/folders sudo find . -name "Caches" -exec ls -ld {} \; and get results like this: lrwxr-xr-x@ 1 name0 ES_Students 27 Jan 18 11:05 ./CES_Grade_03/name0/Library/Caches -> /tmp/name0/Library/Caches drwx------ 11 name1 ES_Students 374 Dec 8 15:44 ./CES_Grade_03/name1/Library/Caches lrwxr-xr-x@ 1 name2 ES_Students 27 Feb 23 14:27 ./CES_Grade_03/name2/Library/Caches -> /tmp/name2/Library/Caches drwx------ 17 name3 ES_Students 578 Jan 25 11:13 ./CES_Grade_03/name3/Library/Caches drwx------ 12 name4 ES_Students 408 Mar 22 13:09 ./CES_Grade_03/name4/Library/Caches but it nags at me that there must be a better way. Yes, it is good enough, and a one-off task, but I want to know how to do it right! Surely, I should be able to do something like: cd /path/to/shared/home/folders sudo ls -ld **/**/Library/Caches I'm afraid that I don't know the proper syntax or if there is a recursive folder-replacing wildcard format in bash, and my google-fu failed me. So, how do I properly formulate the search?

    Read the article

  • Using relative path in PHP.INI doc_root -- getting No Input File Specified -- running as fastCGI

    - by J.R.
    I'm attempting to run php-cgi under LightTPD on Windows with my doc_root set to one directory up (doc_root = "../Docs") -- however, I get "No input file specified". I've set cgi.fix_pathinfo, and all the other tricks I could find with no success. If I set doc_root to an absolute path, it works fine. How can I make this work? If any additional information is required, I'll gladly provide it. Thanks in advance.

    Read the article

  • qt qmake mkspecs relative path

    - by Fabien Bernede
    Hello, when I compile Qt with Windows SDK 7.0, I use : configure.exe -shared -platform win32-msvc2008 -ltcg -no-dsp -no-vcproj nmake ...no error occured. But when I move or change name of my Qt folder, qmake.exe said me makespec is not defined, so I configure my QMAKESPEC to win32-msvc2008, I try again, but now it said me it cannot find mkspecs folder, it try to find this folder only where I compiled Qt (absolute path), I want qmake.exe use relative path : ../mkspecs/ not C:\qt-4.6.2\mkspecs. How can I solve this issue ?

    Read the article

  • Relative Path in Subversion external configuration

    - by sundar venugopal
    is there any way to use Relative path when configuring subversion externals. for example Trunk - directoryA - directoryB - projectA {external DirectoryB} for configuring ProjectA we have to configure full path in the external property. which is causing problems or forcing us to do change the properties when we do branches. any way to automate the branching process or fix with absolute path will be useful

    Read the article

  • Using regular expressions to remove relative path slashes

    - by Adam Carlile
    Hey Guys I am trying to remove all the relative image path slashes from a chunk of HTML that contains several other elements. For example <img src="../../../../images/upload/1/test.jpg /> would need to become <img src="http://s3.amazonaws.com/website/images/upload/1/test.jpg" /> I was thinking of writing this as a rails helper, and just passing the entire block into the method, and make using Nokogiri or Hpricot to parse the HTML instead, but I don't really know. Any help would be great Cheers Adam

    Read the article

  • IE 7 crashes with style position relative

    - by prakash
    Hi All, Below link code causing IE 7 to Crash when link is clicked , when googled it is saying there is bug in IE 7 DO there is any work around for this ? <a title="FAQ" style="position:relative;right:235px;top:-55px;" target="_blank" href="http://www.Google.com/ccp/index.jsp?pg_name=shared/help/page/Somahlep_FAQ_hwtp">READ OUR FAQS</a>

    Read the article

  • probability and relative frequency

    - by Alexandru
    If I use relative frequency to estimate the probability of an event, how good is my estimate based on the number of experiments? Is standard deviation a good measure? A paper/link/online book would be perfect. http://en.wikipedia.org/wiki/Frequentist

    Read the article

  • Wicket: Relative to absolute URL or get base URL

    - by Gilean
    If I have a relative path to a static asset (flash/blah.swf), what is the best way to convert this to an absolute URL (http://localhost/app/flash/blah.swf)? Or what is the best way to get the base URL of the Wicket application? I've tried using RequestUtils.toAbsolutePath but it doesn't seem to work reliably and is frequently throwing exceptions.

    Read the article

  • Negative relative positioning puts extra space

    - by Jeremy
    http://ahjer-ahjer.blogspot.com/ This is my first time here... Please refer to the source of the site above. I have a problem with removing the extra space on the bottom of the page. I believe it's caused by the negative relative positions I've made but I'm not sure how to solve this problem. Should I change my codes in any way?

    Read the article

  • ASM x86 relative JMP

    - by benlaug
    Hi, I'm doing some ASM code in a C code with the asm function. My environment is DVL with gcc version 3. Hi need to make a JMP to a relative address like %eip+0x1f. How can I do this ? Thanks

    Read the article

  • Add domain to relative urls

    - by Rick
    How can I add http://facebook.com to relative URL's contained within #facebook_urls? Eg: <a href="/test.html"> becomes <a href="http://facebook.com/test.html"> #facebook_urls also contains absolute urls, so I want to make sure I don't touch those. Thanks!

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >