Search Results

Search found 3309 results on 133 pages for 'relative positioning'.

Page 21/133 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • Drawing a relative line in C#

    - by icemanind
    Guys, I know this is going to turn out to be a simple answer, but I can't seem to figure it out. I have a C# Winform application that I am trying to build. I am trying to draw a white line 60 pixels above the bottom of the form. I am using this code: private void MainForm_Paint(object sender, PaintEventArgs e) { e.Graphics.DrawLine(Pens.White, 10, this.Height-60, 505, this.Height-60); } Simple enough, however no line is drawn. After some debugging, I figured out that it IS drawing the line, but it is drawing it outside my form. If I change the -60 to -175, then I can see it at the bottom of my form. This would solve my problem, except as my form's height changes, the line draws closer and closer to the bottom of my form until eventually, its off the form again. What am I doing wrong? Am I using the wrong graphics unit? Or is there a more complex calculation I need to do to determine 60 pixels from the bottom of my form?

    Read the article

  • How does a portable Thread Specific Storage Mechanism's Naming Scheme Generate Thread Relative Uniqu

    - by Hassan Syed
    A portable thread specific storage reference/identity mechanism, of which boost/thread/tss.hpp is an instance, needs a way to generate a unique keys for itself. This key is unique in the scope of a thread, and is subsequently used to retrieve the object it references. This mechanism is used in code written in a thread neutral manner. Since boost is a portable example of this concept, how specifically does such a mechanism work ?

    Read the article

  • Java paint speed relative to color model

    - by Jon
    I have a BufferedImage with an IndexColorModel. I need to paint that image onto the screen, but I've noticed that this is slow when using an IndexColorModel. However, if I run the BufferedImage through an identity affine transform it creates an image with a DirectColorModel and the painting is significantly faster. Here's the code I'm using AffineTransformOp identityOp = new AffineTransformOp(new AffineTransform(), AffineTransformOp.TYPE_BILINEAR); displayImage = identityOp.filter(displayImage, null); I have three questions 1. Why is painting the slower on an IndexColorModel? 2. Is there any way to speed up the painting of an IndexColorModel? 3. If the answer to 2. is no, is this the most efficient way to convert from an IndexColorModel to a DirectColorModel? I've noticed that this conversion is dependent on the size of the image, and I'd like to remove that dependency. Thanks for the help

    Read the article

  • Perl Module from relative path not working in IIS6

    - by Laramie
    Disclaimer: I am not a PERL developer and am learning by the seat of my pants. I am using a Perl module called from a CGI scipt in IIS 6 that is bombing. The identical folder structure on an XP machine (IIS 5.1) works fantastic. If I remove the module loading command at line 9, it will print "about to load" and "ok", but When I try to run use Language::Guess; I receive The specified CGI application misbehaved by not returning a complete set of HTTP headers. in the browser. The folder structure is /cgi-bin/test.pl /PerlModules/Language/Guess.pm I have tried adjusting the file/folder permissions and have reviewed my IIS configuration time and again. It runs fine from the command line on the IIS machine or if I copy the module into \Perl\site\lib, but I don't have permission to load modules on the shared server this script is destined for. Am I missing something simple? Here is test.pl use strict; use CGI ':standard'; print header("text/html"); use lib "..\\PerlModules\\"; print "about to load<br/>"; #bombs here use Language::Guess; print "ok"

    Read the article

  • How to get relative source of item in ItemTemplate

    - by plotnick
    I have a ListBox with specified ItemTemplate. And the ItemTemplate contain itself ListView and I want to display in that ListView a collection, which is actually a property of the item of the ListBox. Could you show me how to do Binding. I'm thinking about RelativeSource thing, but I don't know what correct syntax would look like...

    Read the article

  • How to make movable type to use relative path

    - by haohaolee
    Commonly movable type will publish HTML files which contains absolute path, but if I want to host the site under different domain(e.g., both HTTP and HTTPS), it is very inconvenient. So is there a way to change all the paths to resource of my site to absolute ones? Thanks

    Read the article

  • Incorrect new Uri(base, relative) behaviour in .NET

    - by dr. evil
    When you create a new Uri like this: New Uri(New Uri("http://example.com/test.php"),"?x=y") it returns: http://example.com/?x=y It was supposed to return: http://example.com/test.php?x=y according to the every major browser out there (I'm not quite sure what RFC says though). Is this is a bug or is there any other function out there which behaves correctly, also what's the best way to fix it without reinventing the wheel?

    Read the article

  • Getting javascript mouse position relative to website prefferably without jQuery

    - by Constructor
    I've found this snippet on Ajaxian, but I can't seem to use the cursor.y (or cursor.x) as a variable and when the function is called as such it does not seem to work. Is there a syntax problem or something else? function getPosition(e) { e = e || window.event; var cursor = {x:0, y:0}; if (e.pageX || e.pageY) { cursor.x = e.pageX; cursor.y = e.pageY; } else { cursor.x = e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft; cursor.y = e.clientY + (document.documentElement.scrollTop || document.body.scrollTop) - document.documentElement.clientTop; } return cursor; } I'd preffer not to use jQuery UI if possible, since I've always thaught of jQuery and librarys as a bit of an overkill for most JS programing.

    Read the article

  • Relative XPath selection using XmlNode (c#)

    - by maxp
    Say i have the following xml file: <a> <b> <c></c> </b> <b> <c></c> </b> </a> var nodes = doc.SelectNodes("/a/b"); will select the two b nodes. I then loop these two nodes suchas: foreach (XmlNode node in nodes) { } However, when i call node.SelectNodes("/a/b/c"); It still returns both values and not just the descendants. Is it possible to select nodes only descening from the current node?

    Read the article

  • ASP.NET - Themes and Relative Referencing

    - by user70192
    Hello, I have an ASP.NET application that uses themes. Let's pretend I have a theme named "MySkin". I have a page that is in a sub-directory of my application. When I reference a page that uses "MySkin", I noticed that ASP.NET renders a link element that walks up to the root of the site and then down into the App_Themes directory. Here is an example link element I found in a rendered ASP.NET page: <link href="../../App_Themes/MySkin/theme.css" type="text/css" rel="stylesheet" /> Is there a reason that the rendered link element does not use the following instead: <link href="/App_Themes/MySkin/theme.css" type="text/css" rel="stylesheet" /> Is this a browser compatibility issue or is there another reason? The reason I am asking is because I am rendering my ASP.NET page using Server.Execute and storing the result in a different directory. Because of this, I would prefer to use the second way to reference my theme's css. Thank you!

    Read the article

  • log4j relative file path

    - by Bob
    Hi, I'd like my web app to log into files with this path: webapp/logs/ I can set the absolute path in the log4j.properties file, but the production environment's directory structure will be different. Is there any way I could do it? Here is how I do: log4j.appender.f=org.apache.log4j.RollingFileAppender log4j.appender.f.layout=org.apache.log4j.PatternLayout log4j.appender.f.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n log4j.appender.f.File=log.out log4j.appender.f.MaxFileSize=100KB This is printing logs into a file named log.log in my eclipse directory (c://eclipse). I'm using Tomcat 6.

    Read the article

  • Android relative layout problem with gravity

    - by DixieFlatline
    How can i put textview with id="naslov" to the center? I also tried with layout_gravity="center" but that doesn't work either. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:id="@+id/naslov" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="20dip" android:text="Povzetek" android:gravity="center"/> <TextView android:id="@+id/aha" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="10dip" android:text="Vseh oddaj:" android:layout_below="@id/naslov"/> </RelativeLayout>

    Read the article

  • Prolog - Finding the current directory, relative directory for 'tell' predicate

    - by Bharat
    I'm having trouble trying to figure out how to get prolog to spit out a text file where I want it to. I'm currently doing a bunch of operations and then using tell('output.txt') to record the output. Now the problem is that when I do this, it creates this file in the SWI \bin\ folder. I was wondering if there's a way to make it create this file in the directory containing the actual .pl file. So even if the file was moved (and it will be), the text file gets created right where the source file is. Long story short, is there a way to get the location of the source file once the source file has been consulted? Many Thanks!

    Read the article

  • cocoa/c++ relative path to load resources

    - by moka
    Hi, I am currently working directly with cocoa for the first time, to built a screen saver. Now I came across a problem when trying to load resources from within the .saver bundle. I basically have a small c++ wrapper class to load .exr files using freeImage. That works as long as I use absoulte paths, but thats not very useful, is it? So basically I tried everything, putting the .exr file on the level of the .saver bundle itself, inside the bundles Resources folder and so on. Then I simply tried to load the .exr like this without success particleTex = [self loadExrTexture: "ball.exr"]; I also tried making it go to the .saver bundles location like this: particleTex = [self loadExrTexture: "../../../ball.exr"]; to maybe load the .exr from that location but without success. I then came across this: NSString * path = [[NSBundle mainBundle] pathForResource:@"ball" ofType:@"exr"]; const char * pChar = [path UTF8String]; which seems to be a common way to find resources in cocoa, but for some reason its emty in my case. any ideas about that? I really tried out anything that came to my mind without success so I would be glad about some input!

    Read the article

  • Accessing relative path in Python

    - by Aaron Hoffman
    Hi, I'm running a Mac OS X environment and am used to using ~/ to provide the access to the current user's directory. For example, in my python script I'm just trying to use os.chdir("/Users/aaron/Desktop/testdir/") But would like to use os.chdir("~/Desktop/testdir/") I'm getting a no such file or directory error when trying to run this. Any ideas?

    Read the article

  • WCF REST Does Not Contain All of the Relative File Path

    - by Brandon
    I have a RESTful WCF 3.5 endpoint as such: System.Security.User.svc This is supposed to represent the namespace of the User class and is desired behavior by our client. I have another endpoint I created for testing called: Echo.svc I am writing an overridden IHttpModule and in my module, I follow what almost everyone does by doing: string path = HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath; If I make a call to: http://localhost/services/Echo/test My path variable has a value of '~/echo/test' However, when I make a call to: http://localhost/services/System.Security.User/test My path variable has a value of '~/system.security.user' In my 2nd situation, it is stripping off the '/test' on the end of any endpoint that contains multiple periods. This is undesired behavior and the only solution I have found to fixing this is some ugly string manipulation using the property which does contain the complete URL path: string rawPath = HttpContext.Current.Request.RawUrl; This returns '/services/system.security.user/test'. Does anyone know why my first situation does not return the rest of the URL path for endpoints that contain multiple periods in the name?

    Read the article

  • Displaying bitmaps in relative positions

    - by JonF
    I'd like to put a couple images on a surfaceview. I understand that the screen sizes of android devices can vary, so I don't think I can just use an x y position or I might end up placing it off different screens. Say I want to put two boxes in the center of the screen, a blue one and a red one. The blue one is to the left of the red one. How can I accomplish that while accounting for different screen sizes?

    Read the article

  • Using Relative Paths to Load Resources in Cocoa/C++

    - by moka
    I am currently working directly with Cocoa for the first time to built a screen saver. Now I came across a problem when trying to load resources from within the .saver bundle. I basically have a small C++ wrapper class to load .exr files using freeImage. This works as long as I use absoulte paths, but that's not very useful, is it? So, basically, I tried everything: putting the .exr file at the level of the .saver bundle itself, inside the bundles Resources folder, and so on. Then I simply tried to load the .exr like this, but without success: particleTex = [self loadExrTexture:@"ball.exr"]; I also tried making it go to the .saver bundles location like this: particleTex = [self loadExrTexture:@"../../../ball.exr"]; ...to maybe load the .exr from that location, but without success. I then came across this: NSString * path = [[NSBundle mainBundle] pathForResource:@"ball" ofType:@"exr"]; const char * pChar = [path UTF8String]; ...which seems to be a common way to find resources in Cocoa, but for some reason it's empty in my case. Any ideas about that? I really tried out anything that came to my mind without success so I would be glad about some input!

    Read the article

  • managing classes when everything is relative to a user in nhibernate (orm)

    - by Schotime
    Firstly I have three entities. Users, Roles, Items A user can have multiple Roles. An item gets assigned to one or more roles. Therefore a user will have access to a distinct set of items. Now there is a few ways I can see this working. There is a Collection on Users which has Roles via a many-to-many assoc. Then each Role in this collection will have its own collection of Items. So for each user I would have to get the User (using nhib and fetch the roles and items with it) then either do a selectMany on the Items in each Role to get all the Items for the user or do a couple of foreach's to port the data to a view or dto model. Create a db trigger to automatically insert into another table that just has the relationship between user and items so that on my User entity I only have a Items collections which has all the items assigned to me. Some other way that i can't think of yet, because I'm new to nHibernate. Now i know that the trigger doesn't feel right but I'm not sure how to do this. We also have some hierarchy later where a user may be in charge of a group of users. If anyone could shed some light on how they go about these scenarios in nhibernate or another orm that would be great, or point be in a direction. I know that in the past you would have to enter all combinations into a table so that the query worked, but when you know sql its not too bad. If you need any other info then let me know. Cheers

    Read the article

  • jQuery - search for previous selector relative to current

    - by Thomas Slater
    I have a form with 3 sections in it. Each section has a dedicated div for fairly long contextual help messages regarding the input that has focus. My question is, if I give each of these help divs a class of "form-tip" and each input that has a tip the class "has-tip", how can I get the tip to always show up in the previous "form-tip" div? Something like: $('.has-tip').each(focus(function() { var tip = $(this).attr('title'); // Find most recent $('.form-tip') in the DOM and populate it with tip })); I hope that makes sense... Thanks for any help.

    Read the article

  • jQuery > reset popup window 's x and y relative to icon that launched the window

    - by Scott B
    I have a jQuery jPicker colorpicker that is bound to an input text field and opens onclick of a small picker.gif icon. The problem I'm having is that (1) The colorpicker that opens does not appear to be positioned according to the x/y position of the picker.gif (it opens far away from the click point) and (2) The colorpicker does not seem to be aware of the viewport's scroll position (the top of the colorpicker is partially hidden at the top of the window). I'd like to use jQuery to reposition the colorpalette (1) Based on the x/y position of the input that its bound to and (2) reset it's top position based on the viewport's visible Y position. Here is the script where I am creating a new jPicker and binding it to my input text fields for header and sidebar... $('#myHeaderColor').jPicker ( {}, function(color) { $(this).val(color.get_Hex()); }, function(color) { $(this).val(color.get_Hex()); } ); $('#mySidebarColor').jPicker ( {}, function(color) { $(this).val(color.get_Hex()); }, function(color) { $(this).val(color.get_Hex()); } );

    Read the article

  • mod_rewrite and relative urls

    - by Davide Gualano
    I'm setting up some simple url rewriting rules using mod_rewrite and a .htacces file, but I've got some problems. If I set up the .htacces this way: Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteRule /index.html /index.php [L] when I call from the browser this url: http://localhost/~dave/mySite/index.html I got a 404 error. Using this .htacces instead Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteRule /index.html http://localhost/~dave/mySite/index.php [L] everything works fine and I get the index.php page I'm expecting. Am I forced to user absolute urls as the target of a rewrite? Is this a Apache configuration problem? I'm using Max OS X 10.6.2 with its standard Apache installation.

    Read the article

  • Finding relative libraries when using symlinks to ruby executables

    - by dgtized
    Imagine you have an executable foo.rb, with libraries bar.rb layed out in the following manner: <root>/bin/foo.rb <root>/lib/bar.rb In the header of foo.rb you place the following require to bring in functionality in bar.rb: require File.dirname(__FILE__)+"../lib/bar.rb" This works fine so long as all calls to foo.rb are direct. If you put as say $HOME/project, and symlink foo.rb into $HOME/usr/bin, then __FILE__ resolves to $HOME/usr/bin/foo.rb, and is thus unable to locate bar.rb in relation to the dirname for foo.rb. I realize that packaging systems such as rubygems fix this by creating a namespace to search for the library, and that it is also possible to adjust the load_path using $: to include $HOME/project/lib, but it seems as if a more simple solution should exist. Has anyone had experience with this problem and found a useful solution or recipe?

    Read the article

  • 2 column div layout: right column fixed width, left fluid, height relative to eachother

    - by Henrik
    I want a layout with two columns, two divs, where the left one has fluid width and the right one has fixed width. So far so good - see jsfiddle below - however, the height of the right column must be in relation to the height of the left column. So that if I have some content in the fluid column and would resize the browser window, thereby increasing or decreasing the height of the left column, the right one should follow and getting the same height. What I got so far: http://jsfiddle.net/henrikandersson/vnUdc/2/ Edit: Resolved, see comment below

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >