Search Results

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

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

  • Scale 2D coordinates and keep their relative euclidean distances intact?

    - by eiaxlid
    I have a set of points like: pointA(3302.34,9392.32), pointB(34322.32,11102.03), etc. I need to scale these so each x- and y-coordinate is in the range (0.0 - 1.0). I tried doing this by first finding the largest x value in the data set (maximum_x_value), and the largest y value in the set (minimum_y_value). I then did the following: pointA.x = (pointA.x - minimum_x_value) / (maximum_x_value - minimum_x_value) pointA.y = (pointA.y - minimum_y_value) / (maximum_y_value - minimum_y_value) This changes the relative distances(?), and therefore makes the data useless for my purposes. Is there a way to scale these coordinates while keeping their relative distances the intact?

    Read the article

  • What naming pattern can I use for sequential file naming (photos) when only their relative sequence is known?

    - by Juhele
    I got some old scanned photos and I want to put them in correct order. Unfortunately, I have no possibility to find out the exact order, only relative one like: "hm, this photo was surely taken after this one" and organize them step-by-step by manually changing numbering again and again. Is there any program (best free or opensource), where could I interactively put the photo in correct order straightaway (maybe by changing the order by dragging with mouse) and finally apply some file renaming to keep the file order? thank you in advance PS: running Windows (XP and 7), but if you know something for linux, let me kno too, please

    Read the article

  • How do I use key combinations on an axis on a joystick in xorg?

    - by valadil
    I'm using xserver-xorg-input-joystick on Debian Stable so I can use a joystick in place of the mouse. I have mouse movement working correctly, but got stuck trying to add functions for some other keys. These work: #Left stick #Pointer Option "MapAxis1" "mode=relative axis=1.5x" Option "MapAxis2" "mode=relative axis=1.5y" #Right stick #Arrow keys Option "MapAxis4" "mode=relative keylow=Left keyhigh=Right" Option "MapAxis5" "mode=relative keylow=Up keyhigh=Down" But when I try to make key combos (so I can navigate windows and screens in xmonad) I have no luck. #dpad #xmonad focus #up/down toggle window. l/r choose screen. Option "MapAxis8" "mode=relative keylow=Super_L,k keyhigh=Super_L,j" Option "MapAxis7" "mode=relative keylow=Super_L,w keyhigh=Super_L,e" I've also tried Super_R, plain old Super, Meta, and mod4mask, and anything else I can think of. These buttons print the letter, but don't appear to hold down the modifying key. The exception to that is shift. If I specify Shift_L or Shift_R, I get a capital letter. xev indicates that modifier keys are being pressed. If I lower Axis8, I get press Super_L, press k, release k, release Super_L. That looks like it should be working. Maybe this is an xmonad problem and not a joystick driver one? I'm also having trouble with getting an axis to use other XF86 keys: # triggers # song selection Option "MapAxis3" "mode=relative keylow=none keyhigh=XF86AudioForward" Option "MapAxis6" "mode=relative keylow=none keyhigh=XF86AudioBack" That does nothing. Any idea why? If it turns out that this isn't something I can do on an axis, but would work with a button, is there a way to treat my joysticks as buttons? Also, if anyone has suggestions for the other 5 buttons I'll have left after mouse buttons are bound, I'm listening.

    Read the article

  • How is the gimbal locked problem solved using accumulative matrix transformations

    - by Luke San Antonio
    I am reading the online "Learning Modern 3D Graphics Programming" book by Jason L. McKesson As of now, I am up to the gimbal lock problem and how to solve it using quaternions. However right here, at the Quaternions page. Part of the problem is that we are trying to store an orientation as a series of 3 accumulated axial rotations. Orientations are orientations, not rotations. And orientations are certainly not a series of rotations. So we need to treat the orientation of the ship as an orientation, as a specific quantity. I guess this is the first spot I start to get confused, the reason is because I don't see the dramatic difference between orientations and rotations. I also don't understand why an orientation cannot be represented by a series of rotations... Also: The first thought towards this end would be to keep the orientation as a matrix. When the time comes to modify the orientation, we simply apply a transformation to this matrix, storing the result as the new current orientation. This means that every yaw, pitch, and roll applied to the current orientation will be relative to that current orientation. Which is precisely what we need. If the user applies a positive yaw, you want that yaw to rotate them relative to where they are current pointing, not relative to some fixed coordinate system. The concept, I understand, however I don't understand how if accumulating matrix transformations is a solution to this problem, how the code given in the previous page isn't just that. Here's the code: void display() { glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClearDepth(1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glutil::MatrixStack currMatrix; currMatrix.Translate(glm::vec3(0.0f, 0.0f, -200.0f)); currMatrix.RotateX(g_angles.fAngleX); DrawGimbal(currMatrix, GIMBAL_X_AXIS, glm::vec4(0.4f, 0.4f, 1.0f, 1.0f)); currMatrix.RotateY(g_angles.fAngleY); DrawGimbal(currMatrix, GIMBAL_Y_AXIS, glm::vec4(0.0f, 1.0f, 0.0f, 1.0f)); currMatrix.RotateZ(g_angles.fAngleZ); DrawGimbal(currMatrix, GIMBAL_Z_AXIS, glm::vec4(1.0f, 0.3f, 0.3f, 1.0f)); glUseProgram(theProgram); currMatrix.Scale(3.0, 3.0, 3.0); currMatrix.RotateX(-90); //Set the base color for this object. glUniform4f(baseColorUnif, 1.0, 1.0, 1.0, 1.0); glUniformMatrix4fv(modelToCameraMatrixUnif, 1, GL_FALSE, glm::value_ptr(currMatrix.Top())); g_pObject->Render("tint"); glUseProgram(0); glutSwapBuffers(); } To my understanding, isn't what he is doing (modifying a matrix on a stack) considered accumulating matrices, since the author combined all the individual rotation transformations into one matrix which is being stored on the top of the stack. My understanding of a matrix is that they are used to take a point which is relative to an origin (let's say... the model), and make it relative to another origin (the camera). I'm pretty sure this is a safe definition, however I feel like there is something missing which is blocking me from understanding this gimbal lock problem. One thing that doesn't make sense to me is: If a matrix determines the difference relative between two "spaces," how come a rotation around the Y axis for, let's say, roll, doesn't put the point in "roll space" which can then be transformed once again in relation to this roll... In other words shouldn't any further transformations to this point be in relation to this new "roll space" and therefore not have the rotation be relative to the previous "model space" which is causing the gimbal lock. That's why gimbal lock occurs right? It's because we are rotating the object around set X, Y, and Z axes rather than rotating the object around it's own, relative axes. Or am I wrong? Since apparently this code I linked in isn't an accumulation of matrix transformations can you please give an example of a solution using this method. So in summary: What is the difference between a rotation and an orientation? Why is the code linked in not an example of accumulation of matrix transformations? What is the real, specific purpose of a matrix, if I had it wrong? How could a solution to the gimbal lock problem be implemented using accumulation of matrix transformations? Also, as a bonus: Why are the transformations after the rotation still relative to "model space?" Another bonus: Am I wrong in the assumption that after a transformation, further transformations will occur relative to the current? Also, if it wasn't implied, I am using OpenGL, GLSL, C++, and GLM, so examples and explanations in terms of these are greatly appreciated, if not necessary. The more the detail the better! Thanks in advance...

    Read the article

  • xpath/xslt to determine index of context node relative to all nodes of same name?

    - by Geoff
    Given the schema below - with a "query" node as the context, is it possible with xpath/xslt to determine the index of that "query" node relative to all "query" nodes in the document (not position() relative to its immediate siblings). TIA, Geoff <section> <name>About</name> <link>about</link> <questions> <question> <query>Question 1</query> <answer>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In cursus, elit id lacinia semper, ligula nunc rhoncus ante, in euismod tortor nibh dictum tellus.</answer> </question> </questions> </section> <section> <name>Contact</name> <link>contact</link> <questions> <question> <query>Question 1</query> <answer>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In cursus, elit id lacinia semper, ligula nunc rhoncus ante, in euismod tortor nibh dictum tellus.</answer> </question> <question> <query>Question 2</query> <answer>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In cursus, elit id lacinia semper, ligula nunc rhoncus ante, in euismod tortor nibh dictum tellus.</answer> </question> </questions> </section>

    Read the article

  • IIS URL Rewriting: How can I reliably keep relative paths when serving multiple files?

    - by NVRAM
    My WebApp is part CMS, and when I serve up an HTML page to the user it typically contains relative paths in a.href and img.src attributes. I currently have them accessed by urls like: ~/get-data.aspx/instance/user/page.html -- where instance indicates the particular instance for the report and "user/page.html" is a path created by an external application that generates the content. This works pretty reliably with code in the application's BeginRequest method that translates the text after ".aspx" into a query string, then uses Context.RewritePath(). So far so good, but I've just tripped over something that took me by surprise: it appears that if any of the query string ("instance/user/page.html") happens to contain a plus sign ("+") the BeginRequest method is never called, and a 404 is immediately returned to the user. So my question is two-fold: Am I correct in my belief that a "+" would cause the 404, and if so are there other things that could cause similar problems? Is there a way around that problem (perhaps a different method than BeginRequest)? Is there a better way to preserve relative URL paths for generated content than what I'm using? I'd rather not require site admins to install a 3rd party rewrite tool if I can help it.

    Read the article

  • How do I use a jQuery not selector to select relative URLs?

    - by Matt
    I'm working on a little jQuery script to add Google Analytics pageTracker onclick data to all relative URLs on my forum, allowing me to track clicks to external sites. I don't want to add the onclick to internal links on forum.sitename or sitename, and I don't want to add them to any hrefs marked # or that start with /. My script below works nicely, but for one minor problem! All of the forum's URLs are relative and don't start with /. I appear to have no way to change that, so need to modify the jQuery below to prevent it adding the onclick to links like as it currently does. What I want to do, is to write a .not() function like .not("[href!^=http") to prevent jQuery from adding the onclick to any hrefs which do not start with http. However, .not() appears not to support this. I'm new to jQuery and can't figure this out. Any pointers would be massively appreciated. $(document).ready(function(){ // Get URL from a href var URL = $("a").attr('href'); // Add pageTracker data for GA tracking $("a") .not("[href^=#]") .not("[href^=http://forum.sitename]") .not("[href^=http://www.sitename]") .attr("onclick","pageTracker._trackEvent('Outgoing_Links', 'Forum', " + URL + ");") ; }); Thanks!

    Read the article

  • How can I programmatically position a view using relative points?

    - by Steve Madsen
    What is the best way to position a view relative to the size of its superview, when the bounds of the superview are not yet known? I am trying to avoid hard-coding coordinates if it is at all possible. Perhaps this is silly, and if so, that's a perfectly acceptable answer. I've run into this many times when working with custom UI. The most recent example is that I'm trying to replace the UINavigationItem plain-text title with a custom view. I want that view to fill the superview, but in addition, I want a UIActivityIndicatorView on the right side, inset about 2 pixels and centered vertically. Here's the code: - (void) viewDidLoad { [super viewDidLoad]; customTitleView = [[UIView alloc] initWithFrame:CGRectZero]; customTitleView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; titleLabel = [[UILabel alloc] initWithFrame:CGRectZero]; titleLabel.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; titleLabel.lineBreakMode = UILineBreakModeWordWrap; titleLabel.numberOfLines = 2; titleLabel.minimumFontSize = 11.0; titleLabel.font = [UIFont systemFontOfSize:17.0]; titleLabel.adjustsFontSizeToFitWidth = YES; [customTitleView addSubview:titleLabel]; spinnerView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; spinnerView.center = CGPointMake(customTitleView.bounds.size.width - (spinnerView.bounds.size.width / 2) - 2, customTitleView.bounds.size.height / 2); spinnerView.hidesWhenStopped = YES; [customTitleView addSubview:spinnerView]; self.navigationItem.titleView = customTitleView; [customTitleView release]; } Here's my problem: at the time that this code runs, customTitleView.bounds is still zeroes. The auto-resizing mask hasn't had a chance to do its thing yet, but I very much want those values so that I can compute the relative positions of other sub-views (here, the activity indicator). Is this possible without being ugly?

    Read the article

  • How come this relative positioned div is displayed differently in IE?

    - by Camran
    What is with these microsoft browsers? Does microsoft ever do a good job at anything... Anyways, I have a relative positioned div inside another div. The inside-div is positioned with percentage (left: 0%; top:13%). My problem is that in all IE versions the div is displayed some pixels further down than where it is displayed in Chrome, or FF... Anybody recognize this? <div class="nav_container" id="nav_container"> <div id="nav_container2" style="position: relative; left: 0%; top: 13%;"></div> </div> Also, I am just about to browser adjust my website so some article about most common problems with IE is appreciated. Thanks UPDATE: Here is the style for the primary div. .nav_container { background-image: url(../Graphics/menu_lvl1.gif); height: 101px; width: 720px; }

    Read the article

  • How to use relative URL in jqGrid url parameter in ASP MVC?

    - by Chris Herring
    I've setup a jqGrid like this $('#gridTable').jqGrid({ url: '/GridData/', ... Now if I navigate to a url such as "/Controller/id/" then the grid will send a GET to "/GridData/" instead of "/Controller/id/GridData/". Can I make the GET relative so that I can pick the id up on the server side or do I have to manually pass the id as a parmater using javascript on the client?

    Read the article

  • How can I specify a relative path in a Python logging config file?

    - by ClaudioA
    I've the following file to config logging: [loggers] keys=root [handlers] keys = root [formatters] keys = generic # Loggers [logger_root] level = DEBUG handlers = root # Handlers [handler_root] class = handlers.RotatingFileHandler args = ("test.log", "maxBytes=1*1024*1024", "backupCount=10") level = NOTSET formatter = generic # Formatters [formatter_generic] format = %(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s datefmt = %Y-%m-%d %H:%M:%S In Development this works great, but when I deploy the application test.log is trying to be written in a path in which I don't have the necessary permission. So my question is, How can I do to specify a relative path in this configuration file.

    Read the article

  • Adding relative path for an external graphic in a XSL document?

    - by Pran
    Hi, first of, I don't know much about XSL. I am using a app called DITA to generate pdfs. One of the things it requires is an overwrite of an xsl file; to add custom styling. I am trying to add an external graphic using a relative path. It doesn't work, unless I supply the full path. Does not work: <fo:block text-align="center" width="100%"> <fo:external-graphic src="../../images/logo.png"/> </fo:block> Does work: <fo:block text-align="center" width="100%"> <fo:external-graphic src="/absolute/path/to/images/logo.png"/> </fo:block> I looked on the web, it said to use "file:image.png" and other website said to use "url(image.png)", but neither worked. What am I doing wrong?

    Read the article

  • jQuery event.layerX/Y is not relative to the element that triggered the event, is that correct?

    - by michielvoo
    If I use for example a mousemove event handler on a div and check the layerX property of the event, it changes when my mouse enters a positioned element inside that div (like an image). According to the jQuery Event object documentation it should follow the W3C DOM Level 3 specifications. But there's no mention of the layerX/Y property for the MouseEvent interface, so I'm wondering what behavior is according to specification? To me it seems that you always want the layerX/Y to be relative to the layer that fires the event, if I wanted the layerX/Y of a nested element, I would check the event in a different phase (bubbling) or would attach my handler to that nested element. My question is (somewhat subjective): how should layerX/Y work?

    Read the article

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