Search Results

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

Page 17/103 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • How do I vertically align an item within a list using relative layout?

    - by Jay Askren
    I am using a list view in Android 1.5 to show a list of images and text next to the image. I am trying to vertically center the text but the text is at the top of the row instead of centered. Below is my layout: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/row" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="10dip"> <ImageView android:id="@+id/item_image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingRight="10dip" android:src="@drawable/default_image" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_alignParentBottom="true" android:layout_centerVertical="true" android:gravity="center_vertical"/> <TextView android:id="@+id/item_title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/item_image" android:layout_alignParentTop="true" android:layout_alignParentBottom="true" android:layout_centerVertical="true" android:gravity="center_vertical" /> </RelativeLayout> It seems strange that I need to set alignParentTop="true" when I'm trying to vertically center the text, but if I don't the text does not even show up. What am I doing wrong?

    Read the article

  • How to judge the relative efficiency of algorithms given runtimes as functions of 'n'?

    - by Lopa
    Consider two algorithms A and B which solve the same problem, and have time complexities (in terms of the number of elementary operations they perform) given respectively by a(n) = 9n+6 b(n) = 2(n^2)+1 (i) Which algorithm is the best asymptotically? (ii) Which is the best for small input sizes n, and for what values of n is this the case? (You may assume where necessary that n0.) i think its 9n+6. guys could you please help me with whether its right or wrong?? and whats the answer for part b. what exactly do they want?

    Read the article

  • How to Open Multiple PopUp windows with JQuery on form submission (popUps should be relative to form

    - by Ole Jak
    I have A HTML form like this: <form> <fieldset class="ui-widget-content ui-corner-all"> <select id="Streams" class="multiselect ui-widget-content ui-corner-all" multiple="multiple" name="Streams[]"> <option value="35"> Example Name (35)</option> <option value="44"> Example Name (44)</option> <option value="5698"> Example Name (5698)</option> <option value="777"> Example Name (777)</option> <option value="12"> Example Name (12)</option> </select> <input type="submit" class="ui-state-default ui-corner-all" name="submitForm" id="submitForm" value="Play Stream from selected URL's!"/> </fieldset> </form> in my JS + HTML page I use JQuery. As you can see I allow user to select multiple Items. I want to open on Submit button click as many popup windows as many Items he selected in a list. Each popUp window should open some url like www.example.com/test.php?id=OPTION_SELECTED . And here I mean by PopUp Window a real browser window. So for each of the selected options I ll get a pop up window whith diferent url. Please Help.

    Read the article

  • How to Open Multiple PopUp windows with JQuery on form submition (popUps should be relative to form

    - by Ole Jak
    I have A form like this: <form> <fieldset class="ui-widget-content ui-corner-all"> <select id="Streams" class="multiselect ui-widget-content ui-corner-all" multiple="multiple" name="Streams[]"> <br /> <option value="35"> Example Name (35)</option> <option value="44"> Example Name (44)</option> <option value="5698"> Example Name (5698)</option> <option value="777"> Example Name (777)</option> <option value="12"> Example Name (12)</option> </select> <br/> <input type="submit" class="ui-state-default ui-corner-all" name="submitForm" id="submitForm" value="Play Stream from selected URL's!"/> </fieldset> </form> in my JS + HTML page I use JQuery. As you can see I allow user to select multiple Items. I want to open on Submit button click as many popup windows as many Items he selected in a list. Each popUp window should open some url like www.example.com/test.php?id=OPTION_SELECTED . So for each of the selected options I ll get a pop up window whith different url. Please Help.

    Read the article

  • How to determine position (x,y) relative to the page of every character inside spans through javascript?

    - by Fernando
    This is as simple as I can get. I will have several spans randomly positioned on the screen through something like: $(".hidden:first").css('-webkit-transform','rotate('+((0.5-Math.random())*40)+'deg)'); $(".hidden:first").animate({ left: '+=' + (((screen.width-800-224)/2) + Math.random()*800), top: '+=' + (50+Math.random()*600) } [...] and later on I would like to iterate through every char of every of those elements (that are randomly position and have random rotation), and I would need to discover the (x,y) position of every character on the screen so I can colorize it, forming certain draws according to certain functions. Is this easily achievable? I am really inexperienced at javascript. Thanks. Fernando.

    Read the article

  • Want to set 'src' of script to my IP-Won't load in Safari or Chrome. Relative link asp.netmvc

    - by Ozaki
    I have a script that links to the server I am hosting (IP can change) usually I would just use for links: var url ='http://' + window.location.hostname + 'end of url'; But in this case it isnt appearing to be so easy. I have tried: (1) $('#scriptid').attr('src', url); as well as: (2) var script = document.createElement( 'script' ); script.type = 'text/javascript'; script.src = url; $("#insert").append( script ); Now case (2) works loads the script runs the script. But when at the end of my script it hits the 'write data' it decides to replace the entire page with just the data. Any idea on how I can do this? Note: I am using plain html not ASP. With ASP backend that is just the way it has to be. Ok it now is <script src="myscript.js"></script> C# router.AddAsyncRoute("myscript.js"...... It workes in IE & FF. But I get blank pages in Chrome & Safari. I am using document.write to write a script onto my page. Any ideas why Chrome & Safari don't like this? I am so far assuming that in Crhome & Safari it takes longer to run the script therefore launching the document.write after the DOM has loaded therefore replacing the page with a blank one. edit the script im trying to run is a modification of: d = new dTree('d'); d.add(0,-1,'My example tree'); d.add(1,0,'Node 1','default.html'); d.add(2,0,'Node 2','default.html'); d.add(3,1,'Node 1.1','default.html'); d.add(4,0,'Node 3','default.html'); d.add(5,3,'Node 1.1.1','default.html') document.write(d); Any ideas how I can get around this? I am not to sure how to implement an appenChild in this case as the script is changing constantly with live data. So every refresh it will generally have changed some...

    Read the article

  • Why is my .htaccess file redirecting to full server path instead of relative path?

    - by death.au
    I've never had a problem with cakePHP before, but something's odd about this server and is causing the redirects in the .htaccess files to behave oddly. CakePHP uses mod_rewrite in .htaccess files to redirect requests to its own webroot folder. The problem is that the redirects are listing the wrong path and causing a 404 error. My CakePHP application, which is stored in the listings directory, has a .htaccess file as follows: <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ app/webroot/ [R=301,L] RewriteRule (.*) app/webroot/$1 [R=301,L] </IfModule> (*note that the R=301 causes an external redirect so we can see what is going on from our end. It should really omit this flag and do the redirect internally, transparent to end-users) This is supposed to redirect any request from http://hostname.com/~username/listings/ to http://hostname.com/~username/listings/app/webroot/ However, rather than simply adding “app/webroot/” to the end as it is supposed to, it is adding the full server path ( /home/username/public_html/listings/app/webroot/ ) resulting in the final URL http://hostname.com/home/username/public_html/listings/app/webroot/ which is obviously incorrect and triggers a 404 error. The hosting is on a shared hosting account, so that limits what I can do with the settings. I've never seen this happen before, and I'm thinking it's something wrong from the hosting side of things, but if anyone has some helpful suggestions then I can put them to the hosting company as well.

    Read the article

  • How can I get my setup.py to use a relative path to my files?

    - by Chris B.
    I'm trying to build a Python distribution with distutils. Unfortunately, my directory structure looks like this: /code /mypackage __init__.py file1.py file2.py /subpackage __init__.py /build setup.py Here's my setup.py file: from distutils.core import setup setup( name = 'MyPackage', description = 'This is my package', packages = ['mypackage', 'mypackage.subpackage'], package_dir = { 'mypackage' : '../mypackage' }, version = '1', url = 'http://www.mypackage.org/', author = 'Me', author_email = '[email protected]', ) When I run python setup.py sdist it correctly generates the manifest file, but doesn't include my source files in the distribution. Apparently, it creates a directory to contain the source files (i.e. mypackage1) then copies each of the source files to mypackage1/../mypackage which puts them outside of the distribution. How can I correct this, without forcing my directory structure to conform to what distutils expects?

    Read the article

  • CPU Usage relative to number of users? - ASP.Net Application

    - by soldieraman
    My Asp.net application uses 25-30% of the CPU on a test server which has 600 MB Ram on it. I can see the asp_wb process taking that much percentage of CPU. This is when I am testing using one user. How many users can the server afford then without falling over? Is there a relationship between the CPU Usage and number of user aka if there are 2 users my application will sky rocket to 60% of memory usage? Or does/Should/How does the server handle this?

    Read the article

  • zfdatagrid : how to set the relative order of columns?

    - by user522350
    To those of you who are familiar with zfdatagrid for the Zend framework: I got a recordset by a JOIN query, say from tables s and t, now I want to set the order in which the columns appear in the deployed table. For example, 5th column of table t to appear at the leftmost side, then 3rd column of table s, then 2nd column of table t, then 4th column of table s. How do I do this? Whatever I tried, it always shows first the columns of the left table of the JOIN, then the columns of the right table of the JOIN. I only know how to tell it which columns to show, but not their order. Thanks!

    Read the article

  • How to access the relative directory of a ASP.NET website?

    - by Michael Schilling
    I need to access a folder that will contain various text files for my web site. I'm using Visual Web Developer 2010 Express. I made a web site using visual basic. Here is the failing code: Dim fileName As String fileName = CurDir.ToString + fileName.Text + ".txt" FileOpen(1, fileName, OpenMode.Output) FileClose(1) CurDir.ToString is giving me strange directory path that isn't anywhere near where my website files are located. I need to be able to access the files in a folder inside of the WebSite1 folder without using C:\Users\..., but I'm at a loss on how to do that. Can anyone help me out?

    Read the article

  • Is there an easier way to do Classic ASP "relative path"?

    - by Alex.Piechowski
    Right now, I'm having trouble. First of all I have a page, let's call it "http://blah.com/login". That obviously goes strait to "index.asp" A line of Main.asp: <!--#include file="resource/menu.asp"--> Page top includes all of what I need for my menu... so: Part of resource/menu.htm: <div id="colortab" class="ddcolortabs"> <ul> <li><a href="main.asp" title="Main" rel="dropmain"><span>Main</span></a></li> ... </ul> </div> <!--Main drop down menu --> <div id="dropmain" class="dropmenudiv_a"> <a href="main/announcements.asp">Announcements</a> <a href="main/contacts.asp">Contact Information</a> <a href="main/MeetingPlans.asp">Meeting Plan</a> <a href="main/photos.asp">Photo Gallery</a> <a href="main/events.asp">Upcoming Events</a> </div> Let's say I click on the "announcements" (http://blah.com/login/main/announcements.asp) link... Now I'm at the announcements page! But wait, I include the same menu file. Guess what happens: I get sent to "http://blah.com/login/main/main/announcements.asp Which doesn't exist... My solution: Make a menu_sub.asp include for any subpages. But wait a second... this WORKS, but it gets REALLY REALLY messy... What can I do to use just one main "menu.asp" instead of "menu_sub.asp"? using "/main/announcements.asp" WON'T be an option because this is a web application that will be on different directories per server. Any ideas? PLEASE

    Read the article

  • How can I build a list of world geo locations and their relative geographical hierarchies?

    - by Nathan Ridley
    I want to build a database of geographical locations and would like to be able to identify locations that fall inside other locations. For example, The Empire State Building is going to have one geo-coordinate, but my database would be able to tell me that it falls inside Manhattan, which falls inside New York City, which is in the state of New York and so forth. I've been looking at OpenStreetMap which seems to have a pretty decent database but as best I can tell, I would need to create a set of polygon structures representing each region and then detect if a coordinate falls inside a given region's polygon. Is there a better way to do this, or is there a data source where all of this has already been calculated?

    Read the article

  • How to make margin be relative to the center of the UIElement and not its top-left corner in a Grid?

    - by Nockawa
    I'd like the Margin property to reference the center of the UIElement and not the top-left corner. That way when I change the width/height of the UIElement it stays in the same spot. Is there a way to configure this behavior or I'll have to rely on Binding to make the adjustment ? Thanks. For instance if I change the Width/Height of the following rectangle, its center will move. <Grid> <Rectangle Fill="#FF991C1C" Width="10" Height="40" HorizontalAlignment="Left" Margin="90,161,0,0" VerticalAlignment="Top"/> </Grid>

    Read the article

  • How do I specify a relative local file path in DOS?

    - by donde
    I am using c#.NET 2.0 to execute DOS commands to ftp a file. All works except for 1 thing, in the cmd file I call, it runs a PUT statement. Right now the put statement has a hardcoded local file path. I need to specify a dynamic path. I've tried put %~dp0\myfile.DTL myfile.dtl but it says it can't find the file.

    Read the article

  • 'Best' way to pull data relative to a div?

    - by acidzombie24
    This answer suggested i should put my data in JS instead of a textarea. Thinking about it i could have scripts and do something like myarray[i]="data" where i is the index of my for loop. However when i click a div how do i find out what i is? I have used var data = $(this).parent('.parent').find('.valuestr').eq(0).val(); which is extremely simple. Should i use a script or should i continue to do it with a textarea? if i should use a script 1) Whats the easiest way to find i and 2) Is it bad pratice to have dozens or hundreds of <script> in my html? or i can go through the loop twice but i still dont know the easiest way to find i. I would have to store it somewhere or go through multiple tags and count them.

    Read the article

  • Delaying execution of Javascript function relative to Google Maps / geoxml3 parser?

    - by Terra Fimeira
    I'm working on a implementing a Google map on a website with our own tiles overlays and KML elements. I've been previously requested to create code so that, for instance, when the page is loaded from a specific URL, it would initialize with one of the tile overlays already enabled. Recently, I've been requested to do the same for the buildings which are outlined by KML elements so that, arriving at the page with a specific URL, it would automatically zoom, center, and display information on the building. However, while starting with the tile overlays work, the building KML does not. After doing some testing, I've determined that when the code which checks the URL executes, the page is still loading the KML elements and thus do not exist for the code to compare to or use: Code for evaluating URL (placed at the end of onLoad="initialize()") function urlClick() { var currentURL = window.location.href; //Retrieve page URL var URLpiece = currentURL.slice(-6); //pull the last 6 digits (for testing) if (URLpiece === "access") { //If the resulting string is "access": access_click(); //Display accessibility overlay } else if (URLpiece === "middle") { //Else if the string is "middle": facetClick('Middle College'); //Click on building "Middle College" }; }; facetClick(); function facetClick(name) { //Convert building name to building ID. for (var i = 0; i < active.placemarks.length; i++) { if (active.placemarks[i].name === name) { sideClick(i) //Click building whose id matches "Middle College" }; }; }; Firebug Console Error active is null for (var i = 0; i < active.placemarks.length; i++) { active.placemarks is which KML elements are loaded on the page, and being null, means no KML has been loaded yet. In short, I have a mistiming and I can't seem to find a suitable place to place the URL code to execute after the KMl has loaded. As noted above, I placed it at the end of onLoad="initialize()", but it would appear that, instead of waiting for the KML to completely load earlier in the function, the remainder of the function is executed: onLoad="initialize()" information(); //Use the buttons variables inital state to set up description buttons(); //and button state button_hover(0); //and button description to neutral. //Create and arrange the Google Map. //Create basic tile overlays. //Set up parser to work with KML elements. myParser = new geoXML3.parser({ //Parser: Takes KML and converts to JS. map: map, //Applies parsed KML to the map singleInfoWindow: true, afterParse: useTheData //Allows us to use the parsed KML in a function }); myParser.parse(['/maps/kml/shapes.kml','/maps/kml/shapes_hidden.kml']); google.maps.event.addListener(map, 'maptypeid_changed', function() { autoOverlay(); }); //Create other tile overlays to appear over KML elements. urlClick(); I suspect one my issues lies in using the geoxml3 parser (http://code.google.com/p/geoxml3/) which converts our KML files to Javascript. While the page has completed loading all of the elements, the map on the page is still loading, including the KML elements. I have also tried placing urlClick() in the parser itself in various places which appear to execute after all the shapes have been parsed, but I've had no success there either. While I've been intending to strip out the parser, I would like to know if there is any way of executing the "urlClick" after the parser has returned the KML shapes. Ideally, I don't want to use an arbitrary means of defining a time to wait, such as "wait 3 seconds, and go", as my various browsers all load the page at different times; rather, I'm looking for some way to say "when the parser is done, execute" or "when the Google map is completely loaded, execute" or perhaps even "hold until the parser is complete before advancing to urlClick".

    Read the article

  • jQuery: How to position one element relative to another?

    - by paul
    I have a hidden DIV which contains a toolbar-like menu. I have a number of DIVs which are enabled to show the menu DIV when the mouse hovers over them. Is there a built-in function which will move the menu DIV to the top right of the active (mouse hover) DIV? I'm looking for something like $(menu).position("topright", targetEl);

    Read the article

  • how to not use relative links in html, but everytime starting from the domain.

    - by Andy
    Hi, I'm trying to make a page for use with wordpress and it's almost working, The page I want to use is an HTML page with designated space for it within certain DIVs. I'm encountering the problem of wordpress using the wrong links to kind of everything. I will probably have to change every link to http://www.mydomain.com/sub/folder/image.jpg while there are many links. the page is positioned in a subfolder, there where wordpress is installed on the server. But other pages are positioned in the root, and retrieve all other files directly starting from the domain so writing /sub/folder/image.jpg is enough. Is there a way I could get this to work with html/php files in sub folders as well (so when typing a link like /sub/folder/image.jpg they retrieve http://www.mydomain.com/sub/folder/image.jpg and not http://www.mydomain.com/sub/folder/sub/folder/image.jpg thanks!

    Read the article

  • How to place a symbol (path) relative to the far end of svg text?

    - by dugeen
    I'm working on a program which generates SVG maps. Some of the map items have captions which need a symbol after them (like a plane symbol for an airport caption). If I have a text element thus <text x="30" y="30">Pericles</text> I can place another bit of text at the next character position by saying <text x="30" y="30">Pericles <tspan>!</tspan></text> but I'd like to draw my own symbol at that position with a <path> element. What I'm doing at the moment is having the generating program guess the extent of the text from tables of font metrics etc, but this isn't accurate enough to place the symbol consistently. Is there any way round this - like specifying a <marker> to be used when drawing the text, and using a tspan with an invisible dash in it or something to get the marker placed?

    Read the article

  • How can I get the file extensions from relative links in HTML text using Perl?

    - by Structure
    For example, scanning the contents of an HTML page with a Perl regular expression, I want to match all file extensions but not TLD's in domain names. To do this I am making the assumption that all file extensions must be within double quotes. I came up with the following, and it is working, however, I am failing to figure out a way to exclude the TLDs in the domains. This will return "com", "net", etc. m/"[^<>]+\.([0-9A-Za-z]*)"/g Is it possible to negate the match if there is more than one period between the quotes that are separated by text? (ie: match foo.bar.com but not ./ or ../) Edit I am using $1 to return the value within parentheses.

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >