Nearest linear to a point?

Hello,
Is there a way to find the nearest linear to a point?
I will be receiving data in various formats containing x,y locations and no relevant attribution to the LRS route network I have created (no route ids, etc.)
I will need to eventually create LRS points from these features which will contain logmile info. If I can associate a linear to the point, I know how to do the rest. I have not been successful in figuring out how to do this without knowing which particular linear to work with.
I need SQL that will just return the nearest linear to a point. Is it possible in 8.1.7?
Thanks
Dave

Hi David,
Did you index more than two dimensions of the geometry column in gps_lrs?
If you did, then that could be the cause of this error. You can only use SDO_FILTER if geometries are indexed in more than 2D. The reason for this is that except for the R-tree indexing mechanism (which can only return approximate answers), all exact match answers only work in 2 dimensions (so sdo_nn would only return the nearest neighbor in two dimensions, which may not be the accurate answer you would expect from sdo_nn).
If you've indexed the measure dimension, i.e. if your lrs geometry is a 2d geometry plus a measure and you've indexed all three dimensions (assuming you are using r-tree indexing) then this would be a bad thing.
Hope this helps,
dan

Similar Messages

  • Cloud of Points Tree /Nearest Neighbor

    Hi guys;
    I'm using a binary tree to construct a tree of two dimensional points .here is how i construct the tree :
    the tree is constructed by successive subdivision of the Plan by semi-Lines accross a given point.
    the first subdivision is done by say a horizantal line across a given point.the plan is then split into two regions : the upper and lower half plans. the points in the upper plan will be in the right subtree and those in the lower plan will go into the left subtree.
    in the next step the plan will be subdiveded by a VERTICAL semi-line at this time : the points at the left of this line will be placed in the left subtree and those on the right will be placed to right subtree.
    Now i managed to write an insert() method for this :
    static Tree insert(Point p, Tree a, boolean vertical)
         if (a == null)
         return new Tree(null, p, null);
         boolean estAGauche =
         (vertical) ? (p.x < a.p.x) : (p.y < a.p.y);
         if (estAGauche)
         Tree g = insert(p, a.filsG, !vertical);
         return new Tree(g, a.p, a.filsD);
         else
         Tree d = insert(p, a.filsD, !vertical);
         return new Tree(a.filsG, a.p, d);
         static Tree insert(Point p, Tree a)
         return insert(p, a, false);
         }Now i want to tackle another problem : given the tree is filled with a cloud of points.
    if i pick a given point in the cloud ,i want to find the nearest neighbor of this point using the tree construct i described above.
    is this possible ? How can I implement it ?
    Many thanks for helping !

    this is because i will be dealing with a verylarge
    number of points so efficiency here is definitelya
    crucial issue...what do you think josiah ?Well, I've used that little algorithm for a global
    map with, say, 1e6 known points
    and the response was always almost intantaneous. It
    depends on the distribution
    of your known points, i.e. you can easily draw
    pathetic situations on a piece of
    paper but on average the nearest point is found
    withing a few searches (after
    finding those two lines using an O(log(n)) binary
    search ...
    Two dimensional locality doesn't help you much when
    you're using quad-trees;
    as has been said before in this thread: two nearest
    points may be miles apart
    in the tree.
    What does help (altough not much) is, after sorting
    the points on increasing Y
    values, do a minor sort using Gray-codes on the X
    coordinate. But that's for a
    later discussion ;-)
    kind regards,
    Jos
    Well, I've used that little algorithm for a global
    map with, say, 1e6 known points
    and the response was always almost intantaneous. It
    depends on the distribution
    of your known points, i.e. you can easily draw
    pathetic situations on a piece of
    paper but on average the nearest point is found
    withing a few searches (after
    finding those two lines using an O(log(n)) binary
    search ...
    What you say is very encouraging so i will try your little algorithm for sure.
    any way At this first stage of my application i'm not demanding some extra ordinary work to be acheived , and this one would be surely very sufficient..
    Two dimensional locality doesn't help you much when
    you're using quad-trees;
    as has been said before in this thread: two nearest
    points may be miles apart
    in the tree.
    you right !
    What does help (altough not much) is, after sorting
    the points on increasing Y
    values, do a minor sort using Gray-codes on the X
    coordinate. But that's for a
    later discussion ;-)
    something interesting i'll be patiently waiting for ;)
    kind regards,
    JosMany thanks ,

  • Syntax for linear gradient

    I'm getting:
    WARNING: com.sun.javafx.css.parser.CSSParser linearGradient Using deprecated syntax for linear gradient at <filename & line #>. Refer to the CSS Reference Guide.
    But I'm copying the syntax from the only reference guide I can find (no reference is included in the JDK)
    http://download.oracle.com/javafx/2.0/api/javafx/scene/doc-files/cssref.html

    The docs in the SDK have the correct reference. You can find the ref by following the link from the class doc for Node. Here is the relevant section.
    Linear Gradients <linear-gradient>
    linear-gradient( [ [from <point> to <point>] | [ to <side-or-corner>], ]? [ [ repeat | reflect ], ]? <color-stop>[, <color-stop>]+)
    where <side-or-corner> = [left | right] || [top | bottom]
    Linear gradient creates a gradient going though all the stop colors along the line between the "from" <point> and the "to" <point>. If the points are percentages, then they are relative to the size of the area being filled. Percentage and length sizes can not be mixed in a single gradient function.
    If neither repeat nor reflect are given, then the CycleMethod defaults "NO_CYCLE".
    If neither [from <point> to <point>] nor [ to <side-or-corner> ] are given, then the gradient direction defaults to 'to bottom'.
    Stops are per W3C color-stop syntax and are normalized accordingly.
    This example will create a gradient from top left to bottom right of the filled area with red at the top left corner and black at the bottom right.
    linear-gradient(to bottom right, red, black)
    This is equivalent to:
    linear-gradient(from 0% 0% to 100% 100%, red 0%, black 100%)
    This more complex example will create a 50px high bar at the top with a 3 color gradient with white underneath for the rest of the filled area.
    linear-gradient(from 0px 0px to 0px 50px, gray, darkgray 50%, dimgray 99%, white)
    The following syntax for linear gradient does not conform to the CSS grammar and is deprecated in JavaFX 2.0. The JavaFX 2.0 CSS parser supports the syntax but this support may be removed in later releases.
    linear (<size>, <size>) to (<size>, <size>) stops [ (<number>,<color>) ]+ [ repeat | reflect ]?
    Radial Gradients <radial-gradient>
    radial-gradient([ focus-angle <angle>, ]? [ focus-distance <percentage>, ]? [ center <point>, ]? radius [ <length> | <percentage> ] [ [ repeat | reflect ], ]? <color-stop>[, <color-stop>]+)
    If neither repeat nor reflect are given, then the CycleMethod defaults "NO_CYCLE".
    Stops are per W3C color-stop syntax and are normalized accordingly.
    Following are examples of the use of radial-gradient:
    radial-gradient(radius 100%, red, darkgray, black)
    radial-gradient(focus-angle 45deg, focus-distance 20%, center 25% 25%, radius 50%, reflect, gray, darkgray 75%, dimgray)
    The following syntax for radial gradient does not conform to the CSS grammar and is deprecated in JavaFX 2.0. The JavaFX 2.0 CSS parser supports the syntax but this support may be removed in later releases.
    radial [focus-angle <number> | <number> ] ]? [ focus-distance <size> ]? [ center <size,size> ]? <size> stops [ ( <number>, <color> ) ]+ [ repeat | reflect ]?

  • Convert old cs4 script to illustrator cc

    This is a big ask, but I found this script to remove redundant points at github.com/mekkablue/Glyphs-Scripts
    Each time I run, it seems to work, it shows how many points it has removed, but then illustrator crashes, with no kind of error notice.
    If I run it via extendscript toolkit it jumps to the following bit of code
    var docRef=app.activeDocument;
    I would really love to get this to work, if anyone is willing to help me.
      RemovetRedundantPoints.jsx
      A Javascript for Adobe Illustrator
      Author:
      Jim Heck
      [email protected]
      Purpose:
      Remove anchorpoints on selected path that are coincident in location.
      Finds and optionally removes redundant points from each selected PathItem.
      Useful for cleaning up after Offset Path and Outline Stroke commands in CS3.
      To Use:
      Select the paths, including compound paths to be affected. If no path is
      selected, the script will run for all paths in the document that are not
      locked. Run the script.
      Rights:
      This work is licensed under the Creative Commons Attribution 3.0 United States
      License. To view a copy of this license, visit
      http://creativecommons.org/licenses/by/3.0/us/
      or send a letter to Creative Commons, 171 Second Street, Suite 300,
      San Francisco, California, 94105, USA.
      Version History:
      1.8 120108 More fixes to the logic for keeping only a single point.
      The direction handles for the remaining point are now correctly calculated
      based on relative angle and distance to the original anchor to which a
      handle related. Also if a SMOOTH point is remaining, the angle of the
      two direction handles has been tweaked to be exactly 180 degrees for
      consistency with the definition of a SMOOTH point.
      1.7 120106 Change the way direction handles and PointType are handled
      when keeping only one point. Retract handles less than 0.5 points to keep
      consistent angles for SMOOTH point types. If keepLeadingPoint or
      keepTrailingPoint is specified, try to keep the PointType of that point.
      In the absence of other indicators, base PointType on the point (leading
      or trailing) that has an extended handle.
      1.6.1 090914 Tweak defaults to make sense for my work style
      1.6 090411 Fix a bug in creating a temporary path. Fix a bug in
      findRedundantPoints(), when searching backwards, the tolerance was always
      applied against the first point on the path instead of the adjacent point
      along the path. Change selection options so that there is more control over
      which points are processed on a given path. The new options allow for ignoring
      selection of points, restricting processing to only selected points, or
      processing redundant points if at least one of them is selected. Correct count
      of redundant points removed when both leading and trailing points retained.
      1.5 090404 Change default action to remove. Fix a major performance issue
      in the docGetSelectedPaths() routine. Searching through all the paths in very
      complex files takes a LONG time. Instead, search the document groups array.
      BETA: Lots of hacking on the removeRedundantPoints() routine to improve the
      look of the resulting curve when applied to the oxbow problem.
      1.4.1 090331 Fix a bug in removeRedundantPoints(), needed to compare absolute
      error to a tolerance. Also, loosen up the error criteria so less smooth
      points are mischaracterized as corners. Tolerance is now 0.02 radians,
      which is about 1.15 degrees. For some reason, the redundant points on
      arbitrary (non-geometric) outlined paths have lots of slop in the
      direction handles.
      1.4 090331 Add options to control which points are left on removal, leading,
      trailing or both. If neither is retained, the redundant point positions
      are averaged. If both are retained, intermediate points are removed, and
      inward facing control handles are synthesized (see comments below).
      Switched to using the atan2 function instead of atan for calculating theta.
      Fixed bugs in docGetSelectedPaths(). CompoundPathItem objects don't seem
      to have properly formed pathItems arrays when they contain what appear to
      be groups of paths. Also, layer objects can contain layers.
      1.3.1 090327 Limit user entered tolerance value to something sane.
      1.3 090327 Add user controls to specify a tolerance in points for identifying
      redundant points.
      1.2.3 090327 Improve results dialog verbiage.
      1.2.2 090326 Bug fix. Observe proper unlocking and locking order for
      handling of locked objects.
      1.2.1 090326 Minor bug fixes including, restricting selection only option
      to not be allowed with selection function.
      1.2 090326 Add option to remove only redundant points sets with at least one
      selected point. Fix broken option to remove locked redundant points.
      Add results dialog OK button.
      1.1 090325 Improve select action to work across selection or entire document.
      Handle nested layers in docGetSelectedPaths(). Clean whitespace.
      1.0.1 090325 Minor bug fix.
      1.0 090311 Initial release.
    * Function: getPairTheta
    * Description:
    * Return the angle relative to the X axis from the line formed between
    * two points, which are passed in as arguments. The angle is measured
    * relative to point A (as if A were relocated to the origin, and the angle
    * is measured to the X axis itself). The arguments are expected to be
    * arrays of two numbers (X, Y) defining the point. The return value is in
    * radians (PI to -PI)
    function getPairTheta(pairA,pairB){
      var deltaX=pairB[0]-pairA[0];
      var deltaY=pairB[1]-pairA[1];
      /*alert("deltaX="+deltaX+" deltaY="+deltaY);*/
      return(Math.atan2(deltaY, deltaX));
    * Function: getPairDistance
    * Description:
    * Return the distance between two points. The arguments are expected to be
    * arrays of two numbers (X, Y) defining the point. The return value is the
    * distance in units relative to the inputs.
    function getPairDistance(pairA,pairB){
      var deltaX=pairB[0]-pairA[0];
      var deltaY=pairB[1]-pairA[1];
      return(Math.sqrt((deltaX*deltaX)+(deltaY*deltaY)));
    * Function: findRedundantPoints
    * Description:
    * Find all sets of redundant points for the input path. A redundant point
    * is defined as one that has the same anchor location as a neighboring point.
    * The arguments are a path to work on, the tolerance in points to apply to
    * determine a point is redundant, and a boolean to indicate that only
    * groups of redundant points where at least one point is selected should
    * be considered. The return value is an Array of Arrays containing the
    * indicies of the redundant pathPoint objects found in the path.
    function findRedundantPoints(path, tolerance, anySelected, allSelected){
      var anchorDistance = 0;
      var redundantPointSets = new Array();
      var redundantPoint = new Array();
      var selectedRedundantPointSets = new Array();
      var selectedRedundantPoint = new Array();
      var i = 0;
      var j = 0;
      var k = 0;
      var index;
      var selected = false;
      if(path.pathPoints.length > 1) {
      * The first path point may be coincident with some at the end of the path
      * so we check going backwards first. Redundant points pushed on the
      * front of the array so they stay in order leftmost to rightmost.
      redundantPoint.push(0);
      index = 0;
      for (i=path.pathPoints.length-1; i>0; i--) {
      * Get distance and round to nearest hundredth of a point.
      * If points are closer than the tolerance, consider them
      * coincident.
      anchorDistance = getPairDistance(path.pathPoints[index].anchor, path.pathPoints[i].anchor);
      anchorDistance = roundToPrecision(anchorDistance, 0.01);
      if (anchorDistance < tolerance) {
      redundantPoint.unshift(i);
      else {
      break;
      index = i;
      * If we haven't used up all the points, start searching forwards
      * up to the point we stopped searching backwards. Test the
      * current point against the next point. If the next point matches push
      * its index onto the redundantPoint array. When the first one doesn't match,
      * check if the redundantPoint array has more than one index. If so add it
      * to the redundantPointSets array. Then clean the redundantPoint array
      * and push on the next point index.
      if(i > 0) {
      for (j=0; j<i; j++) {
      anchorDistance = getPairDistance(path.pathPoints[j].anchor, path.pathPoints[j+1].anchor);
      anchorDistance = roundToPrecision(anchorDistance, 0.01);
      if (anchorDistance < tolerance) {
      redundantPoint.push(j+1);
      else {
      if (redundantPoint.length > 1) {
      redundantPointSets.push(redundantPoint);
      redundantPoint = [];
      redundantPoint.push(j+1);
      * Push the last redundantPoint array onto the redundantPointSets array if
      * its length is greater than one.
      if (redundantPoint.length > 1) {
      redundantPointSets.push(redundantPoint);
      if (anySelected) {
      for (i=0; i<redundantPointSets.length; i++) {
      var currentPointSet = redundantPointSets[i];
      selected = false;
      for (j=0; j<currentPointSet.length; j++) {
      if (path.pathPoints[currentPointSet[j]].selected ==
      PathPointSelection.ANCHORPOINT) {
      selected = true;
      if (selected) {
      selectedRedundantPointSets.push(currentPointSet);
      else if (allSelected) {
      for (i=0; i<redundantPointSets.length; i++) {
      var currentPointSet = redundantPointSets[i];
      for (j=currentPointSet.length-1; j>=0; j--) {
      var currentPoint = path.pathPoints[currentPointSet[j]];
      if (currentPoint.selected == PathPointSelection.ANCHORPOINT) {
      selectedRedundantPoint.unshift(currentPointSet[j]);
      else {
      break;
      if (j > 0) {
      for (k=0; k<j; k++) {
      var currentPoint = path.pathPoints[currentPointSet[k]];
      if (currentPoint.selected == PathPointSelection.ANCHORPOINT) {
      selectedRedundantPoint.push(currentPointSet[k]);
      else {
      if (selectedRedundantPoint.length > 1) {
      selectedRedundantPointSets.push(selectedRedundantPoint);
      selectedRedundantPoint = [];
      if (selectedRedundantPoint.length > 1) {
      selectedRedundantPointSets.push(selectedRedundantPoint);
      selectedRedundantPoint = [];
      else {
      selectedRedundantPointSets = redundantPointSets;
      return(selectedRedundantPointSets);
    * Function: countRedundantPoints
    * Description:
    * Count the number of redundant points given a redundantPointSets array as
    * the first parameter.
    function countRedundantPoints(redundantPointSets, doKeepLeadingPoint, doKeepTrailingPoint) {
      var i = 0;
      var redundantPoints = 0;
      var pointsKept = 1;
      if (doKeepLeadingPoint && doKeepTrailingPoint) {
      pointsKept = 2;
      for (i=0; i<redundantPointSets.length; i++) {
      redundantPoints += redundantPointSets[i].length - pointsKept;
      return (redundantPoints);
    * Function: countSelectedPoints
    * Description:
    * Count the number of selected anchor points given a path as the first parameter.
    function countSelectedPoints(path) {
      var i = 0;
      var selectedPoints = 0;
      for (i=0; i<path.pathPoints.length; i++) {
      if (path.pathPoints[i].selected == PathPointSelection.ANCHORPOINT) {
      selectedPoints++;
      return (selectedPoints);
    * Function: removeRedundantPoints
    * Description:
    * Remove redundant points from a path input as the first parameter. The
    * second input parameter should be an array of arrays containing the
    * indicies of redundant points, as returned from function
    * findRedundantPoints(). From each set of indicies, the first point is
    * retained, and the subsequent points are removed from the path. Care is
    * taken to preserve the proper leftDirection and rightDirection handles,
    * as well as the proper PointType for the remaining point. Returns
    * the number of points removed.
    function removeRedundantPoints(path, redundantPointSets, keepLeadingPoint, keepTrailingPoint, keepAveragedPoint){
      var i = 0;
      var j = 0;
      var pointsToRemove = new Array();
      var tempLayer;
      var tempPath;
      * For each array of redundant point indicies in array redundantPointSets,
      * modify the leadingPoint to have all the properties needed to properly
      * describe the set of coincident points.
      for (i=0; i<redundantPointSets.length; i++) {
      var x = 0;
      var y = 0;
      var currentPointSet = redundantPointSets[i];
      var leadingPoint = path.pathPoints[currentPointSet[0]];
      var trailingPoint = path.pathPoints[currentPointSet[currentPointSet.length-1]];
      if (keepLeadingPoint && keepTrailingPoint) {
      * JAH 090401 REVISIT COMMENT WHEN DONE
      * If we are keeping two points, the leftDirection of the leading point
      * and rightDirection of the trailing point are already fixed. We have to
      * synthesize the inward facing handles, and choose pointType of the two points.
      * To allow easy manipultion of the inner handles without disturbing the fixed
      * handles, make the points PointType.CORNER. For the direction handles, make
      * them parallel to their respective paired handle, and extend them half the
      * distance between the two remaining points.
      var averagedPoint;
      var theta;
      var deltaX;
      var deltaY;
      var pairDistance;
      var leftDistance;
      var rightDistance;
      var firstRemovedIndex = 1;
      if (currentPointSet.length > 2) {
      averagedPoint = path.pathPoints[currentPointSet[1]];
      else {
      tempLayer = app.activeDocument.layers.add();
      tempLayer.name = "Temp";
      tempPath = tempLayer.pathItems.add();
      averagedPoint = tempPath.pathPoints.add();
      if( currentPointSet.length <= 2 || !keepAveragedPoint ) {
      * Use just the leading and trailing points. Create inward facing
      * direction handles for the two endpoints based on the relationship
      * of the angles between each endpoint and the average point.
      * For each endpoint, calcualte the angle of the endpoint to the
      * average point, and the endpoint to the other endpoint. Combine
      * the angles. The base angle for the inward facing direction handle
      * is the angle that points it towards the average point. Add to this
      * angle, a multiple of the difference between the angle just mentioned,
      * and the angle to the other endpoint. Adding this difference angle
      * will bias the curve towards the average point. Finally, set the
      * length of the direction handle as the distance from the endpoint
      * to the average point multiplied by a factor.
      var thetaAverage;
      var thetaPair;
      var tweakThetaToOppositeEndpoint = 1.0;
      var tweakPairDistance = 0.5;
      * Since the leading and trailing points will have direction handles pointing
      * in different directions, these points must be corner points by necessity.
      leadingPoint.pointType = PointType.CORNER;
      trailingPoint.pointType = PointType.CORNER;
      * Create new average point.
      for (j=0; j<currentPointSet.length; j++) {
      x += path.pathPoints[currentPointSet[j]].anchor[0];
      y += path.pathPoints[currentPointSet[j]].anchor[1];
      x /= currentPointSet.length;
      y /= currentPointSet.length;
      averagedPoint.anchor = Array(x, y);
      averagedPoint.leftDirection = Array( averagedPoint.anchor[0], averagedPoint.anchor[1]);
      averagedPoint.rightDirection = Array( averagedPoint.anchor[0], averagedPoint.anchor[1]);
      averagedPoint.pointType = PointType.CORNER;
      /* Calcualte new leading point rightDirection */
      pairDistance = getPairDistance(leadingPoint.anchor, averagedPoint.anchor);
      thetaAverage = getPairTheta(leadingPoint.anchor, averagedPoint.anchor);
      thetaPair = getPairTheta(leadingPoint.anchor, trailingPoint.anchor);
      theta = thetaAverage + tweakThetaToOppositeEndpoint * (thetaAverage - thetaPair);
      /*alert("thetaAverage="+thetaAverage+" thetaPair="+thetaPair" theta="+theta);*/
      deltaX = Math.cos(theta) * tweakPairDistance * pairDistance;
      deltaY = Math.sin(theta) * tweakPairDistance * pairDistance;
      leadingPoint.rightDirection = Array(leadingPoint.anchor[0]+deltaX, leadingPoint.anchor[1]+deltaY);
      /* Calcualte new trailing point leftDirection */
      pairDistance = getPairDistance(trailingPoint.anchor, averagedPoint.anchor);
      thetaAverage = getPairTheta(trailingPoint.anchor, averagedPoint.anchor);
      thetaPair = getPairTheta(trailingPoint.anchor, leadingPoint.anchor);
      theta = thetaAverage + tweakThetaToOppositeEndpoint * (thetaAverage - thetaPair);
      /*alert("thetaAverage="+thetaAverage+" thetaPair="+thetaPair" theta="+theta);*/
      deltaX = Math.cos(theta) * tweakPairDistance * pairDistance;
      deltaY = Math.sin(theta) * tweakPairDistance * pairDistance;
      trailingPoint.leftDirection = Array(trailingPoint.anchor[0]+deltaX, trailingPoint.anchor[1]+deltaY);
      else {
      * Use just the leading and trailing points, along with a third point added
      * at the average of all the removed points. This point will act to anchor
      * the curve at the average point. It will also allow the leading and
      * trailing points to be smooth points, allowing for a continuous
      * curve through them.
      * The inward facing direction handles for the two endpoints will be
      * shortened extensions of the outward facing direction handles for these
      * points. The length of the handles will be a multiple of the
      * distance from the direction handle to the average point.
      * For the average point, the direction handles will be parallel to the
      * angle formed by the angle between the two endpoints. The length
      * of the direction handles for this point will be a different multiple
      * of the length from each endpoint to the average point.
      var thetaAverage;
      var thetaPair;
      var tweakPairDistanceForAveraged = 0.5;
      var tweakPairDistanceForEndpoint = 0.25;
      * Since the leading and trailing points will have direction handles that
      * are parallel, make them smooth points.
      leadingPoint.pointType = PointType.SMOOTH;
      trailingPoint.pointType = PointType.SMOOTH;
      /* We will be keeping one more point, the averaged point. */
      firstRemovedIndex = 2;
      * Create new average point.
      for (j=0; j<currentPointSet.length; j++) {
      x += path.pathPoints[currentPointSet[j]].anchor[0];
      y += path.pathPoints[currentPointSet[j]].anchor[1];
      x /= currentPointSet.length;
      y /= currentPointSet.length;
      averagedPoint.anchor = Array(x, y);
      averagedPoint.leftDirection = Array( averagedPoint.anchor[0], averagedPoint.anchor[1]);
      averagedPoint.rightDirection = Array( averagedPoint.anchor[0], averagedPoint.anchor[1]);
      averagedPoint.pointType = PointType.SMOOTH;
      /* Calcualte new averaged point leftDirection */
      pairDistance = getPairDistance(leadingPoint.anchor, averagedPoint.anchor);
      theta = getPairTheta(leadingPoint.anchor, trailingPoint.anchor);
      /*alert("theta="+theta);*/
      if (theta > 0) {
      theta += Math.PI;
      else {
      theta += -Math.PI;
      deltaX = Math.cos(theta) * tweakPairDistanceForAveraged * pairDistance;
      deltaY = Math.sin(theta) * tweakPairDistanceForAveraged * pairDistance;
      averagedPoint.leftDirection = Array(averagedPoint.anchor[0]+deltaX, averagedPoint.anchor[1]+deltaY);
      /* Calcualte new averaged point rightDirection */
      pairDistance = getPairDistance(trailingPoint.anchor, averagedPoint.anchor);
      theta = getPairTheta(trailingPoint.anchor, averagedPoint.anchor);
      /*alert("theta="+theta);*/
      if (theta > 0) {
      theta += Math.PI;
      else {
      theta += -Math.PI;
      deltaX = Math.cos(theta) * tweakPairDistanceForAveraged * pairDistance;
      deltaY = Math.sin(theta) * tweakPairDistanceForAveraged * pairDistance;
      averagedPoint.rightDirection = Array(averagedPoint.anchor[0]+deltaX, averagedPoint.anchor[1]+deltaY);
      /* Calculate direction handles for leading and trailing points */
      pairDistance = getPairDistance(leadingPoint.anchor, trailingPoint.anchor);
      leftDistance = getPairDistance(leadingPoint.anchor, leadingPoint.leftDirection);
      if (leftDistance > 0) {
      theta = getPairTheta(leadingPoint.anchor, leadingPoint.leftDirection);
      /*alert("theta="+theta);*/
      if (theta > 0) {
      theta += Math.PI;
      else {
      theta += -Math.PI;
      pairDistance = getPairDistance(leadingPoint.anchor, averagedPoint.anchor);
      deltaX = Math.cos(theta) * tweakPairDistanceForEndpoint * pairDistance;
      deltaY = Math.sin(theta) * tweakPairDistanceForEndpoint * pairDistance;
      leadingPoint.rightDirection = Array(leadingPoint.anchor[0]+deltaX, leadingPoint.anchor[1]+deltaY);
      else {
      leadingPoint.rightDirection = leadingPoint.anchor;
      rightDistance = getPairDistance(trailingPoint.anchor, trailingPoint.rightDirection);
      if (rightDistance > 0) {
      theta = getPairTheta(trailingPoint.anchor, trailingPoint.rightDirection);
      if (theta > 0) {
      theta += Math.PI;
      else {
      theta += -Math.PI;
      pairDistance = getPairDistance(trailingPoint.anchor, averagedPoint.anchor);
      deltaX = Math.cos(theta) * tweakPairDistanceForEndpoint * pairDistance;
      deltaY = Math.sin(theta) * tweakPairDistanceForEndpoint * pairDistance;
      trailingPoint.leftDirection = Array(trailingPoint.anchor[0]+deltaX, trailingPoint.anchor[1]+deltaY);
      else {
      trailingPoint.leftDirection = trailingPoint.anchor;
      * Push all points other than the leading and trailing onto the pointsToRemove array
      * for later removal. We can't remove them while we are working with later sets.
      for (j=firstRemovedIndex; j<currentPointSet.length-1; j++) {
      pointsToRemove.push(currentPointSet[j]);
      else {
      * If we are only keeping one point, we will work with the leading point.
      * First, calculate the relative distances and angles of the direction handle for
      * the leadingPoint leftDirection handle and the trailingPoint rightDirection
      * handle. These values will be used to help properly construct the remaining
      * point.
      var leftDistance = getPairDistance(leadingPoint.anchor, leadingPoint.leftDirection);
      var rightDistance = getPairDistance(trailingPoint.anchor, trailingPoint.rightDirection);
      var leftTheta = getPairTheta(leadingPoint.anchor, leadingPoint.leftDirection);
      var rightTheta = getPairTheta(trailingPoint.anchor, trailingPoint.rightDirection);
      * If we are keeping the leadingPoint, calculate a relative rightDirection handle
      * based on the trailingPoint rightDistance and rightTheta. If we are keeping the
      * trailingPoint, copy its anchor and rightDirection handle to the leadingPoint,
      * and calculate a relative leftDirection handle based on the leadingPoint
      * leftDistance and leftTheta. If we are to keep neither leading or trailing point,
      * average the position of all the redundant points and calcuate direction handles
      * based on the appropriate values.
      if (keepLeadingPoint) {
      x = leadingPoint.anchor[0] + (Math.cos(rightTheta) * rightDistance);
      y = leadingPoint.anchor[1] + (Math.sin(rightTheta) * rightDistance);
      leadingPoint.rightDirection = Array(x, y);
      else if (keepTrailingPoint) {
      leadingPoint.anchor = trailingPoint.anchor;
      leadingPoint.rightDirection = trailingPoint.rightDirection;
      x = leadingPoint.anchor[0] + (Math.cos(leftTheta) * leftDistance);
      y = leadingPoint.anchor[1] + (Math.sin(leftTheta) * leftDistance);
      leadingPoint.leftDirection = Array(x, y);
      else {
      for (j=0; j<currentPointSet.length; j++) {
      x += path.pathPoints[currentPointSet[j]].anchor[0];
      y += path.pathPoints[currentPointSet[j]].anchor[1];
      x /= currentPointSet.length;
      y /= currentPointSet.length;
      leadingPoint.anchor = Array(x, y);
      x = leadingPoint.anchor[0] + (Math.cos(leftTheta) * leftDistance);
      y = leadingPoint.anchor[1] + (Math.sin(leftTheta) * leftDistance);
      leadingPoint.leftDirection = Array(x, y);
      x = leadingPoint.anchor[0] + (Math.cos(rightTheta) * rightDistance);
      y = leadingPoint.anchor[1] + (Math.sin(rightTheta) * rightDistance);
      leadingPoint.rightDirection = Array(x, y);
      * If the distance for a handle is less than half a point and rounds to zero,
      * retract that handle fully by setting that direction handle equal to the anchor
      * point. This will keep angles consistent for smooth points.
      if (Math.round(leftDistance) == 0) {
      leadingPoint.leftDirection = leadingPoint.anchor;
      if (Math.round(rightDistance) == 0) {
      leadingPoint.rightDirection = leadingPoint.anchor;
      * Handle the PointType in a minimal manner. If keeping the leadingPoint or keeping
      * the trailingPoint, keep the PointType of that point if possible. If both handles
      * are extended, measure the angles of the two direction handles. If both handles
      * have the same angle relative to the X axis within a tolerance, the PointType
      * can be SMOOTH, otherwise it must be CORNER. If the point type is SMOOTH, ensure
      * the direction handles are corrected to be exactly 180 degrees apart.
      * If not specifically keeping the leading or trailing point and only one handle is
      * extended, base the pointType on the the leadingPoint if only the left handle is
      * extended and the trailingPoint if only the right handle is extended. 
      if (Math.round(leftDistance) > 0 && Math.round(rightDistance) > 0) {
      var absdiff = Math.abs(leftTheta-rightTheta);
      var error = Math.PI - absdiff;
      /*alert("leftTheta="+leftTheta+" rightTheta="+rightTheta+" absdiff="+absdiff+" error="+error);*/
      if (Math.abs(error) < 0.02) {
      if (keepTrailingPoint) {
      leadingPoint.pointType = trailingPoint.pointType;
      else if (!keepLeadingPoint) {
      leadingPoint.pointType = PointType.SMOOTH;
      if (leadingPoint.pointType == PointType.SMOOTH) {
      if (keepTrailingPoint) {
      x = leadingPoint.anchor[0] + (Math.cos(Math.PI + rightTheta) * leftDistance);
      y = leadingPoint.anchor[1] + (Math.sin(Math.PI + rightTheta) * leftDistance);
      leadingPoint.leftDirection = Array(x, y);
      else {
      x = leadingPoint.anchor[0] + (Math.cos(Math.PI + leftTheta) * rightDistance);
      y = leadingPoint.anchor[1] + (Math.sin(Math.PI + leftTheta) * rightDistance);
      leadingPoint.rightDirection = Array(x, y);
      else {
      leadingPoint.pointType = PointType.CORNER;
      else if (keepTrailingPoint) {
      leadingPoint.pointType = trailingPoint.pointType;
      else if (!keepLeadingPoint && rightDistance > 0) {
      leadingPoint.pointType = trailingPoint.pointType;
      * Push all other points onto the pointsToRemove array for later removal. We can't
      * remove them while we are working with later sets.
      for (j=1; j<currentPointSet.length; j++) {
      pointsToRemove.push(currentPointSet[j]);
      * Sort the pointsToRemove array and then remove the points in reverse order, so the indicies
      * remain coherent during the removal.
      pointsToRemove.sort(function (a,b) { return a-b });
      for (i=pointsToRemove.length-1; i>=0; i--) {
      var pointToRemove = path.pathPoints[pointsToRemove[i]];
      pointToRemove.remove();
      if (tempPath) {
      tempPath.remove();
      if (tempLayer) {
      tempLayer.remove();
      return (pointsToRemove.length);
    * Function: selectRedundantPoints
    * Description:
    * Select redundant points on a path input as the first parameter. The
    * second input parameter should be an array of arrays containing the
    * indicies of redundant points, as returned from function
    * findRedundantPoints(). If there are redundant points, deselect all points
    * on the path and select the ANCHORPOINT of each redundant point. If there
    * are no redundant points on the path, do nothing.
    function selectRedundantPoints(path, redundantPointSets){
      var i = 0;
      var j = 0;
      if (redundantPointSets.length > 0) {
      for (i=0; i<path.pathPoints.length; i++) {
      path.pathPoints[i].selected = PathPointSelection.NOSELECTION;
      for (i=0; i<redundantPointSets.length; i++) {
      var currentPointSet = redundantPointSets[i];
      for (j=0; j<currentPointSet.length; j++) {
      path.pathPoints[currentPointSet[j]].selected = PathPointSelection.ANCHORPOINT;
    * Function: unlockPath
    * Description:
    * For a path input as the first parameter, unlock the path and any locked
    * parent object. Return an array of objects that have been unlocked.
    function unlockPath(path){
      var unlockedObjects = new Array();
      var parentObjects = new Array();
      var currentObject = path;
      var i = 0;
      while (currentObject.typename != "Document") {
      parentObjects.unshift(currentObject);
      currentObject = currentObject.parent;
      for (i=0; i<parentObjects.length; i++) {
      if (parentObjects[i].locked) {
      parentObjects[i].locked = false;
      unlockedObjects.unshift(parentObjects[i]);
      return unlockedObjects;
    * Function: lockObjects
    * Description:
    * For a set of objects as the first parameter, lock each object.
    function lockObjects(objects){
      var i = 0;
      for (i=0; i<objects.length; i++) {
      objects[i].locked = true;
    * Function: docGetSelectedPaths
    * Description:
    * Get all the selected paths for the docRef argument passed in as
    * a parameter. The second parameter is a boolean that controls if compound
    * path items are included (default true), and the third parameter is a
    * boolean that controls if locked objects are included (default false).
    * Returns an array of paths.
    function docGetSelectedPaths(docRef, includeCompound, includeLocked){
      var qualifiedPaths = new Array();
      var i = 0;
      var j = 0;
      var nextPath = null;
      var currentSelection = new Array();
      var nextSelection = docRef.selection;
      if (includeCompound == null) {
      includeCompound = true;
      if (includeLocked == null) {
      includeLocked = false;
      do {
      currentSelection = nextSelection;
      nextSelection = [];
      for(i=0; i<currentSelection.length; i++){
      var currentObject=currentSelection[i];
      if (currentObject.typename == "PathItem") {
      if (includeLocked || !(currentObject.locked ||
      currentObject.layer.locked)) {
      qualifiedPaths.push(currentObject);
      else if (currentObject.typename == "CompoundPathItem") {
      if (includeCompound &&
      (includeLocked || !(currentObject.locked ||
      currentObject.layer.locked))) {
      * For more complex compound paths (e.g. concentric circular bands),
      * in CS3 the CompoundPathItem object's pathItems array is empty.
      * Inspection of the paths in a document shows the paths contained
      * in the CompoundPathItem have groups as parents. To get around
      * this seeming bug, in addition to using the pathItems array,
      * which still contains individual paths, we also search through
      * all the groups in the document adding paths whose parent
      * is the CompoundPathItem object.
      * WARNING this takes non-negligible time in large documents.
      for (j=0; j<currentObject.pathItems.length; j++) {
      qualifiedPaths.push(currentObject.pathItems[j]);
      for (j=0; j<docRef.groupItems.length; j++) {
      if (docRef.groupItems[j].parent == currentObject) {
      nextSelection.push(docRef.groupItems[j]);
      else if (currentObject.typename == "GroupItem") {
      for (j=0; j<currentObject.pathItems.length; j++){
      nextSelection.push(currentObject.pathItems[j]);
      for (j=0; j<currentObject.compoundPathItems.length; j++){
      nextSelection.push(currentObject.compoundPathItems[j]);
      for (j=0; j<currentObject.groupItems.length; j++){
      nextSelection.push(currentObject.groupItems[j]);
      else if (currentObject.typename == "Layer") {
      for (j=0; j<currentObject.pathItems.length; j++){
      nextSelection.push(currentObject.pathItems[j]);
      for (j=0; j<currentObject.compoundPathItems.length; j++){
      nextSelection.push(currentObject.compoundPathItems[j]);
      for (j=0; j<currentObject.groupItems.length; j++){
      nextSelection.push(currentObject.groupItems[j]);
      for (j=0; j<currentObject.layers.length; j++){
      nextSelection.push(currentObject.layers[j]);
      } while (nextSelection.length > 0);
      return qualifiedPaths;
    * Function: docGetAllPaths
    * Description:
    * Get all the paths for the docRef argument passed in as a parameter.
    * The second parameter is a boolean that controls if compound path items are
    * included (default true), and the third parameter is a boolean that controls
    * if locked objects are included (default false). Returns an array of paths.
    function docGetAllPaths(docRef, includeCompound, includeLocked) {
      var qualifiedPaths = new Array();
      var i = 0;
      var nextPath = null;
      if (includeCompound == null) {
      includeCompound = true;
      if (includeLocked == null) {
      includeLocked = false;
      for (i=0; i<docRef.pathItems.length; i++) {
      nextPath = docRef.pathItems[i];
      if (!includeCompound && nextPath.parent.typename == "CompoundPathItem") {
      continue;
      if (!includeLocked && (nextPath.layer.locked == true || nextPath.locked == true)) {
      continue;
      qualifiedPaths.push(nextPath);
      return qualifiedPaths;
    * Function: roundToPrecision
    * Description:
    * Round a number input as the first parameter to a given precision. The
    * second input parameter is the precision to round to (typically a power of
    * 10, like 0.1). Returns the rounded value.
    function roundToPrecision(value, precision) {
      var result;
      result = value / precision;
      result = Math.round(result);
      result = result * precision;
      return (result);
    * Main code
    var dlgInit = new Window('dialog', 'Redundant Path Points');
    doInitDialog(dlgInit);
    var exitError;
    var tolerance = 1 * (dlgInit.tolerancePnl.editText.text);
    var doAnalyze = dlgInit.functionPnl.doAnalyze.value;
    var doRemove = dlgInit.functionPnl.doRemove.value;
    var doSelect = dlgInit.functionPnl.doSelect.value;
    var doKeepLeadingPoint = dlgInit.removalPnl.doKeepLeadingPoint.value;
    var doKeepTrailingPoint = dlgInit.removalPnl.doKeepTrailingPoint.value;
    var doKeepAveragedPoint = dlgInit.removalPnl.doKeepAveragedPoint.value;
    var includeCompound = dlgInit.optionPnl.includeCompound.value;
    var includeLocked = dlgInit.optionPnl.includeLocked.value;
    var ignoreSelected = dlgInit.selectionPnl.ignoreSelected.value;
    var anySelected = dlgInit.selectionPnl.anySelected.value;
    var allSelected = dlgInit.selectionPnl.allSelected.value;
    var docRef=app.activeDocument;
    var pathsToProcess = new Array();
    var i = 0;
    var j = 0;
    var totalPaths = 0;
    var totalPointsWithRedundancy = 0;
    var totalPointsToRemove = 0;
    var totalPointsRemoved = 0;
    var totalPointsStarting = 0;
    var totalPointsRemaining = 0;
    var totalPointsSelected = 0;
    var redundantPointSets = new Array();
    var unlockedObjects = new Array();
    try {
      if (exitError != 0) {
      throw("exit");
      exitError = 99;
      if (docRef.selection.length > 0) {
      pathsToProcess = docGetSelectedPaths(docRef, includeCompound, includeLocked);
      else {
      var doAll = confirm("Run script for all paths in document?");
      if (doAll) {
      pathsToProcess = docGetAllPaths(docRef, includeCompound, includeLocked);
      if (doSelect) {
      if (includeLocked) {
      exitError = 2;
      throw("exit");
      if (!ignoreSelected) {
      exitError = 3;
      throw("exit");
      docRef.selection = null;
      for (i=0; i<pathsToProcess.length; i++) {
      redundantPointSets = findRedundantPoints(pathsToProcess[i], tolerance, anySelected, allSelected);
      totalPaths++;
      totalPointsWithRedundancy += redundantPointSets.length;
      totalPointsToRemove += countRedundantPoints(redundantPointSets, doKeepLeadingPoint, doKeepTrailingPoint);
      totalPointsStarting += pathsToProcess[i].pathPoints.length;
      totalPointsSelected += countSelectedPoints(pathsToProcess[i]);
      if (doRemove) {
      if (includeLocked) {
      unlockedObjects = unlockPath(pathsToProcess[i]);
      else {
      unlockedObjects = [];
      totalPointsRemoved += removeRedundantPoints(pathsToProcess[i], redundantPointSets, doKeepLeadingPoint, doKeepTrailingPoint, doKeepAveragedPoint);
      if (unlockedObjects.length > 0) {
      lockObjects(unlockedObjects);
      if (doSelect) {
      selectRedundantPoints(pathsToProcess[i], redundantPointSets);
      totalPointsRemaining += pathsToProcess[i].pathPoints.length;
      var dlgResults = new Window('dialog', 'Redundant Path Points');
      doResultsDialog(dlgResults,
      totalPaths,
      totalPointsWithRedundancy,
      totalPointsToRemove,
      totalPointsRemoved,
      totalPointsStarting,
      totalPointsRemaining,
      totalPointsSelected,
      tolerance);
    catch(er)
      if (exitError == 2) {
      alert("Select function not supported in conjunction with 'Include Locked Items' option.");
      if (exitError == 3) {
      alert("Select function supported only with 'Ignore' selection restriction.");
      if (exitError == 99) {
      alert("ACK! Unexplained error\n");
    * Dialog Code
    * Function: doInitDialog
    function doInitDialog(dlgInit) {
      var defaultTolerance = 5.0;
      var maxSliderTolerance = 5;
      /* Add radio buttons to control functionality */
      dlgInit.functionPnl = dlgInit.add('panel', undefined, 'Function:');
      (dlgInit.functionPnl.doAnalyze = dlgInit.functionPnl.add('radiobutton', undefined, 'Analyze' )).helpTip = "Find and count redundant points.";
      (dlgInit.functionPnl.doRemove = dlgInit.functionPnl.add('radiobutton', undefined, 'Remove' )).helpTip = "Find and remove redundant points.";
      (dlgInit.functionPnl.doSelect = dlgInit.functionPnl.add('radiobutton', undefined, 'Select' )).helpTip = "Find and select redundant points.\nWARNING:Manual removal of selected redundant points can change the shape of your curves.\nTips:Hiding bounding box helps to see which points are selected. Modify selection as desired and rerun script to remove specific redundant points.";
      dlgInit.functionPnl.doRemove.value = true;
      dlgInit.functionPnl.orientation='row';
      /* Add radio buttons to control point selection */
      dlgInit.selectionPnl = dlgInit.add('panel', undefined, 'Point Selection State:');
      (dlgInit.selectionPnl.ignoreSelected = dlgInit.selectionPnl.add('radiobutton', undefined, 'Ignore')).helpTip="Process redundant points on a path regardless of their selection state.";
      (dlgInit.selectionPnl.allSelected = dlgInit.selectionPnl.add('radiobutton', undefined, 'All')).helpTip="Process redundant points on a path only if each of them is selected.";
      (dlgInit.selectionPnl.anySelected = dlgInit.selectionPnl.add('radiobutton', undefined, 'Any')).helpTip="Process redundant points on a path if any one of them is selected.";
      dlgInit.selectionPnl.allSelected.value = true;
      dlgInit.selectionPnl.orientation='row';
      /* Add a checkbox to control options */
      dlgInit.optionPnl = dlgInit.add('panel', undefined, 'Other Options:');
      (dlgInit.optionPnl.includeCompound = dlgInit.optionPnl.add('checkbox', undefined, 'Include Compound Path Items?')).helpTip="Work on compound path items.";
      (dlgInit.optionPnl.includeLocked = dlgInit.optionPnl.add('checkbox', undefined, 'Include Locked Items?')).helpTip="Work on locked items or items in locked layers.";
      dlgInit.optionPnl.includeCompound.value = true;
      dlgInit.optionPnl.includeLocked.value = false;
      dlgInit.optionPnl.alignChildren='left';
      dlgInit.optionPnl.orientation='column';
      /* Add a slider and edit box for user entered tolerance */
      dlgInit.tolerancePnl = dlgInit.add('panel', undefined, 'Tolerance (in PostScript points):');
      (dlgInit.tolerancePnl.slide = dlgInit.tolerancePnl.add('slider', undefined, defaultTolerance, 0.01, maxSliderTolerance)).helpTip="Use slider to set a tolerance value in hundredths of a point.";
      (dlgInit.tolerancePnl.editText = dlgInit.tolerancePnl.add('edittext', undefined, defaultTolerance)).helpTip="Enter a tolerance value. Values greater then 5.0 or more precise than 1/100 point can be manually entered here.";
      dlgInit.tolerancePnl.editText.characters = 5;
      dlgInit.tolerancePnl.orientation='row';
      dlgInit.tolerancePnl.slide.onChange = toleranceSliderChanged;
      dlgInit.tolerancePnl.editText.onChange = toleranceEditTextChanged;
      /* Add a panel control removal options */
      dlgInit.removalPnl = dlgInit.add('panel', undefined, 'Removal Options:');
      (dlgInit.removalPnl.doKeepLeadingPoint = dlgInit.removalPnl.add('checkbox', undefined, 'Keep Leading Point' )).helpTip = "Keep the leading point (lowest path index, lowest prior to origin cross for closed path).";
      (dlgInit.removalPnl.doKeepTrailingPoint = dlgInit.removalPnl.add('checkbox', undefined, 'Keep Trailing Point' )).helpTip = "Keep the trailing point (highest path index, highest following origin cross for closed path).";
      (dlgInit.removalPnl.doKeepAveragedPoint = dlgInit.removalPnl.add('checkbox', undefined, 'Keep Averaged Point' )).helpTip = "Keep an averaged point to help smooth transitions.";
      dlgInit.removalPnl.keepTips = dlgInit.removalPnl.add('statictext', undefined, 'Keeping neither will cause position of remaining point to be averaged. Keeping both will anchor two ends of a segment while removing intermediate redundant points. An averaged point helps smooth transitions.', {multiline:'true'} );
      dlgInit.removalPnl.doKeepLeadingPoint.value = false;
      dlgInit.removalPnl.doKeepTrailingPoint.value = false;
      dlgInit.removalPnl.doKeepAveragedPoint.value = false;
      dlgInit.removalPnl.alignChildren='left';
      dlgInit.removalPnl.orientation='column';
      /* Add execution buttons */
      dlgInit.executeGrp = dlgInit.add('group', undefined, 'Execute:');
      dlgInit.executeGrp.orientation='row';
      dlgInit.executeGrp.buildBtn1= dlgInit.executeGrp.add('button',undefined, 'Cancel', {name:'cancel'});
      dlgInit.executeGrp.buildBtn2 = dlgInit.executeGrp.add('button', undefined, 'OK', {name:'ok'});
      dlgInit.executeGrp.buildBtn1.onClick= initActionCanceled;
      dlgInit.executeGrp.buildBtn2.onClick= initActionOk;
      dlgInit.frameLocation = [100, 100];
      dlgInit.alignChildren='fill';
      dlgInit.show();
      return dlgInit;
    function initActionCanceled() {
      exitError = 1;
      dlgInit.hide();
    function initActionOk() {
      var proceed = true;
      exitError = 0;
      if (dlgInit.tolerancePnl.editText.text > 5.0) {
      proceed = confirm("Tolerance entered greater than 5.0 PostScript points. Proceed?");
      if (proceed) {
      dlgInit.hide();
    function toleranceSliderChanged() {
      dlgInit.tolerancePnl.editText.text = roundToPrecision(dlgInit.tolerancePnl.slide.value, 0.01);
    function toleranceEditTextChanged() {
      if (dlgInit.tolerancePnl.editText.text > 5000) {
      dlgInit.tolerancePnl.editText.text = 5000;
      dlgInit.tolerancePnl.slide.value = roundToPrecision(dlgInit.tolerancePnl.editText.text, 0.01);
    * Function: doResultsDialog
    function doResultsDialog(dlgResults,
      totalPaths,
      totalPointsWithRedundancy,
      totalPointsToRemove,
      totalPointsRemoved,
      totalPointsStarting,
      totalPointsRemaining,
      totalPointsSelected,
      tolerance) {
      /* Add static text to display results */
      dlgResults.resultsPnl = dlgResults.add('panel', undefined, 'Results:');
      dlgResults.resultsPnl.totalPaths = dlgResults.resultsPnl.add('group');
      dlgResults.resultsPnl.totalPaths.txt = dlgResults.resultsPnl.totalPaths.add('statictext', undefined, 'Paths processed: ');
      dlgResults.resultsPnl.totalPaths.txt.alignment = 'right';
      dlgResults.resultsPnl.totalPaths.val = dlgResults.resultsPnl.totalPaths.add('statictext', undefined, totalPaths);
      dlgResults.resultsPnl.totalPaths.val.characters = 10;
      dlgResults.resultsPnl.totalPaths.val.helpTip = "The number of paths processed.";
      dlgResults.resultsPnl.totalPointsSelected = dlgResults.resultsPnl.add('group');
      dlgResults.resultsPnl.totalPointsSelected.txt = dlgResults.resultsPnl.totalPointsSelected.add('statictext', undefined, 'Total points selected: ');
      dlgResults.resultsPnl.totalPointsSelected.txt.alignment = 'right';
      dlgResults.resultsPnl.totalPointsSelected.val = dlgResults.resultsPnl.totalPointsSelected.add('statictext', undefined, totalPointsSelected);
      dlgResults.resultsPnl.totalPointsSelected.val.characters = 10;
      dlgResults.resultsPnl.totalPointsSelected.val.helpTip = "The total number of points initially selected.";
      dlgResults.resultsPnl.separator0 = dlgResults.resultsPnl.add('panel');
      dlgResults.resultsPnl.totalPointsWithRedundancy = dlgResults.resultsPnl.add('group');
      dlgResults.resultsPnl.totalPointsWithRedundancy.txt = dlgResults.resultsPnl.totalPointsWithRedundancy.add('statictext', undefined, 'Points with redundancy: ');
      dlgResults.resultsPnl.totalPointsWithRedundancy.txt.alignment = 'right';
      dlgResults.resultsPnl.totalPointsWithRedundancy.val = dlgResults.resultsPnl.totalPointsWithRedundancy.add('statictext', undefined, totalPointsWithRedundancy);
      dlgResults.resultsPnl.totalPointsWithRedundancy.val.characters = 10;
      dlgResults.resultsPnl.totalPointsWithRedundancy.val.helpTip = "The number of points with redundancy.";
      dlgResults.resultsPnl.totalPointsToRemove = dlgResults.resultsPnl.add('group');
      dlgResults.resultsPnl.totalPointsToRemove.txt = dlgResults.resultsPnl.totalPointsToRemove.add('statictext', undefined, 'Redundant points to remove: ');
      dlgResults.resultsPnl.totalPointsToRemove.txt.alignment = 'right';
      dlgResults.resultsPnl.totalPointsToRemove.val = dlgResults.resultsPnl.totalPointsToRemove.add('statictext', undefined, totalPointsToRemove);
      dlgResults.resultsPnl.totalPointsToRemove.val.characters = 10;
      dlgResults.resultsPnl.totalPointsToRemove.val.helpTip = "The number of redundant points that would be removed.";
      dlgResults.resultsPnl.totalPointsRemoved = dlgResults.resultsPnl.add('group');
      dlgResults.resultsPnl.totalPointsRemoved.txt = dlgResults.resultsPnl.totalPointsRemoved.add('statictext', undefined, 'Redundant points removed: ');
      dlgResults.resultsPnl.totalPointsRemoved.txt.alignment = 'right';
      dlgResults.resultsPnl.totalPointsRemoved.val = dlgResults.resultsPnl.totalPointsRemoved.add('statictext', undefined, totalPointsRemoved);
      dlgResults.resultsPnl.totalPointsRemoved.val.characters = 10;
      dlgResults.resultsPnl.totalPointsRemoved.val.helpTip = "The number of redundant points that were removed.";
      dlgResults.resultsPnl.separator1 = dlgResults.resultsPnl.add('panel');
      dlgResults.resultsPnl.totalPointsStarting = dlgResults.resultsPnl.add('group');
      dlgResults.resultsPnl.totalPointsStarting.txt = dlgResults.resultsPnl.totalPointsStarting.add('statictext', undefined, 'Total points starting: ');
      dlgResults.resultsPnl.totalPointsStarting.txt.alignment = 'right';
      dlgResults.resultsPnl.totalPointsStarting.val = dlgResults.resultsPnl.totalPointsStarting.add('statictext', undefined, totalPointsStarting);
      dlgResults.resultsPnl.totalPointsStarting.val.characters = 10;
      dlgResults.resultsPnl.totalPointsStarting.helpTip = "The total number of points before processing.";
      dlgResults.resultsPnl.totalPointsRemaining = dlgResults.resultsPnl.add('group');
      dlgResults.resultsPnl.totalPointsRemaining.txt = dlgResults.resultsPnl.totalPointsRemaining.add('statictext', undefined, 'Total points remaining: ');
      dlgResults.resultsPnl.totalPointsRemaining.txt.alignment = 'right';
      dlgResults.resultsPnl.totalPointsRemaining.val = dlgResults.resultsPnl.totalPointsRemaining.add('statictext', undefined, totalPointsRemaining);
      dlgResults.resultsPnl.totalPointsRemaining.val.characters = 10;
      dlgResults.resultsPnl.totalPointsRemaining.val.helpTip = "The total number of points after processing.";
      dlgResults.resultsPnl.alignChildren='right';
      dlgResults.resultsPnl.orientation='column';
      dlgResults.note = dlgResults.add('group');
      dlgResults.note.txt = dlgResults.note.add('statictext', undefined, 'Combined results across paths qualified based on options');
      dlgResults.tolerance = dlgResults.add('group');
      dlgResults.tolerance.txt = dlgResults.tolerance.add('statictext', undefined, "Tolerance applied (in PostScript points): ");
      dlgResults.tolerance.val = dlgResults.tolerance.add('statictext', undefined, tolerance);
      /* Add execution buttons */
      dlgResults.executeGrp = dlgResults.add('group', undefined, 'Execute:');
      dlgResults.executeGrp.orientation='row';
      dlgResults.executeGrp.buildBtn1= dlgResults.executeGrp.add('button',undefined, 'OK', {name:'ok'});
      dlgResults.executeGrp.buildBtn1.onClick= resultsActionOk;
      dlgResults.frameLocation = [100, 100];
      dlgResults.show();
    function resultsActionOk() {
      exitError = 0;
      dlgResults.hide();

    you have said you are using cc.
    is it fully up to date?
    are you not using cc2014?
    when run from ESTK are you sure it is pointing to the correct illustrator?

  • [P6N SLI Platinum] black screen NO BOOT after D-bracket replug [RMA-SOLVED]

    Quick setup specs;
    P6N SLI Platinum
    E6600 (box/stock 2400mhz basic)
    2x 1Gb DDR2 6400 Gskill HZ
    Sapphire ATI X1600Pro (PCI-e basic)
    Aerocool Zero DBA 620W
    (2 HDs sata, 2 Hds pata, 2 optical pata at first -all OK at first, disconnected after, so irrelevant here ,( )
    (XP Pro clean new install from start)
    I tried to check the forum old posts before trying to write that new one, but could not find any really related totally adequate posts so far (or i missed them, sorry if so, then -?). I could already find very useful informations on first aid usual 'rebooting' procedures to follow with minimum new boot configurations, d-bracket new LED signals etc. But so far no luck, all same, nothing better, nothing cured here for the stuation here. ,(( Also excuse my english if not perfect, i am not english either. ,(
    VERY bad & sad problem here... ,(((( :
    All was working perfectly great during 5 days.. the P6N SLI platinum install went GREAT initially (as normal, not a first pc built, all normally happening, so far so good, etc).... all hardwares compatible together at first (dedicated ATX 'full' 8x8 pins connector too for the cpu only for ex -all working perfect at first try. quick tensions 5V/12V under msi dual core control tool perfect too etc), was great easy going/ great strong ultra-stability feeling on the hardware side.. i was just now concentrating on the software side (no special BIOS tweaks even attempted so far, all on basics-normal e6600/ddr2 auto-settings, apart at the end ddr2 quick test -when problem occured- on 450(900?)Mhz at 2.1V, far far easy under its possible specs max anyway.. and had been working perfect for 3 days with that little ddr2 boost try -no time for special bios further tweakings now, etc), reinstalling and transfering/reorganizing slowly my necessary files/hds/softwares from old to new setup, no oc, nothing special tempted (i was planning oc, new cpu more suited fan/silver6 etc only for the end..), LAN file sharing setup done, Realtek audio setup test done, etc ; installation had been so far one of the quickest and problem free ever... explaining maybe also my fatal lack of cautioun for just (too much) 3 sec in the end after 5/- days of perfect working new ring going on.. ,((( :
    At first, i also tried to immediately install the D-Bracket too to check possible hardware install problems -very useful feature i of course thought too..and wanted to try too, "in case of"..- (installing it from quick reading of the printed manual..with no colour pic coding inside..and quick error coming from there thereafter with an initial mismatch usb/jbd1 inverted plugs connections.. *both* having the exact same pins numbers and dispositions, beeing side by side on mainboard layout.. and so able to connect both headers indifferently.. so i did not see it immediately (( .. and no way to see it otherwise as such, anyway.. ,( ), just to be sure all was ok. I noticed that LED were of course, never lightning (not normal).. but as EVERYTHING else was working fine (GLAN, sound, etc etc).. i did not bother more than that -- error checking not necessary.
    Till that fatal clumsy day i wanted suddenly to.. check the D-bracket too. ((((
    All was working well, XP pro opened for hours as usual etc..
    i had not yet totally finished to install the motherboard in the pc-case (always on desk, free in sight..)... so i could always see the connections on it. ... and i noticed that ... the colour headers codes were NOT matching (usb=yellow..).. i had just stupidly initially badly connected the D-Bracket jdb1/usb adjacent plugs (inverting them), so... And still, all had ever worked perfect.. except the D-Bracket, of course, was sending back no lights then, obviously.. so i did the fatal error.. confident all was stable enough and strong if even that initial plug error had had no consequences at all.. i did the fatal bad move to try to UNPLUG the D-Bracket connectors and put them back in right orders WITHOUT switching OFF the power supply so... like an hot USB plug, sort of, in a way. fatal error.. :( :( :(
    As soon as i began to remove the usb/jdb1 connectors and put them back in normal order... the system suddenly SHUT DOWN ... no special bad noise, no special smell.. just sudden SHUT DOWN.
    From there.. impossible ever to boot back again the so far perfectly working machine (((((((((((( , always same till now :
    i switch on the power supply.. orange led appears on motherboard (ok)... i switch on the motherboard.. green led on motherboard appears (ok)... CPU fan begins (ok), video fan begins (ok) .... and... NOTHING.. total black video screen. no more even possibility to see the BIOS. :( total dead startup .. and the fans are going on eternally, blocked eternally in that inital startup with leds on too (no sudden shut down after a few seconds.. just.. nothing)... :(
    Suprem irony.. the D-bracket LED seems to 'work' now.. "of course". Just the PC no more booting at all ^. Only thing is that only green LEDs are appearing, no red ones... simply the sequence, from start and never changing :
    1. GREEN   2. GREEN
    3. GREEN   4. (---)    (not red, just nothing -?)
    If i look in manual, it means "Testing RTC (real time clock)". I don't know exactly what it means *here*, but sounds to me it is the most basic initial first BIOS checking.. and BIOS can't be reached for even that so ; BIOS fried???? :( :(
    I tried every 'standard' things recommanded usually here in older posts, for new boots recovery attempts thereafter in such 'boot errors' situations (clear cmos button pushed in every possible ways -quick, long, quick etc..-, removing little by little everything but the very minimal least energy taxing setup; keyboard, cpu, video, motherboard; 1 ddr2 nearest cpu slot.. point).. NOTHING. Worst, i tried to boot with one of those elements missing.. exact same D-Bracket lightning from start to.. eternally (123 GREEN 4-nothing). Even tried to remove the little (cmos?) KTS lithium battery for a few hours -that could work sometimes with the old already ultra-sensitive amd/nforce2 chipset bioses problems, so i tried there too-?-; same 3 green lights and fans running and nothing else happening from there.. ((
    Always the same; total dead boot as above. black screen. no possible access to even bios panel. ,(((
    So my desperate questions, now: of course, the origin is obvious here; all happened "by my fault" when i tried 'too quickly' to 'hot-plugging' replace correctly the D-BRACKET plugs *without* switching off the power supply... all shut down suddenly when i put back correctly the usb& jdb1 headers... :( ;
    - do you think there could be any possible last HOPES to recover the situation that i had missed (a well known situation in such d-bracket handling 'common' (?) connection error, a simple trick to try i had missed ??)
    - do you think i FRIED something in the process on the motherboard ?? :( :(
    - do you think it is 'only' the BIOS (fried????) ?? :( :(
    - do you think i could have fried a specifical external key component in the process (not necessarily motherboard) : ddr2 modules, cpu, video card????? :( :(
    - is my only solution is to send the motherboard to RMA (no other ways now) ???
    please, don't hesitate to give me any possible hints to try to avoid the RMA process.
    can i avoid it, right now?
    is that possible to fry an whole board just with such a D-Bracket 'hot plug switch' (on a so far perfectly working -light-  setup - no oc, little video card, etc) ???? :( :(
    That is the only C2D Intel/ddr2 motherboard i have here around. No possibility to test elements by elements for precise error checking (cpu, ddr2 modules, video card or powersupply).
    Only things i could check so far are;
    - the power supply (aerocool 620W zeroDBA) ;
    i tested it back on my old amd xp-m nforce2 setup.. always working apparently. NOT 'fried' so, apparently. but no way of course to test for exemple the special 8x8 (or 8x4) Intel ATX cpu connector on old xp-m motherboard. But power supply NOt fried at least, apparently -?
    - the video card.
    no way for me to really test the pci-e card on other motherboard around but.. i tried a very old PCI VGA card.. that one works on old setup.. and on P6N, no effect, doesn't improve the situation. So, not sure the new pci-e video card isn't fried.. but a new video card doesn't correct the dead boot problem.. (
    No way for me to test the ddr2 or CPU directly though.
    Do you think DDR2 or CPU could have been fried in the process too ???
    or just, as i fear anyway, 'simply', the motherboard BIOS fried -??? :-(
    Really, thx for any suggestions..
    if there could be an 'hidden' trick i did not try yet to try to recover the (initially working perfectly!!! (( ) setup, WITHOUT engaging the motherboard RMA process (at least 2 or 3 weeks lost here to wait the return..online store etc..)....
    please, suggest me.. ,((
    i am *really* very sad of that stupid clumsy idea to want to 'enable' the D-Bracket.. all was working great so far.. and i lost all with just that stupid idea to try an hot plug bracket reconnection without switching off the power supply it seems.. can it be possible,sigh?? all seemed so stable before that, that i.. just lost my usual cautious just 3 sec too long it seems... :-(
    Thanks in advance
    hoping post not too long too, but i tried to expose the situation as precisely as possible; first time i ever had such a problem with a motherboard/system install.. that is quiet ironical knowing it was also the best and quickest/easiest easy going new built i ever had so far too.. till then ,( .. and all came from the 'helper' d-bracket 'luxury second hand possible boot helper diagnostic tool' checking in the end too, here.. really hoping i can avoid an RMA process.. and no other hardware elements (apart the motherboard?) could have been damaged in the process ? ,(((

    hi, thx a lot for the quick answer. sorry for the length indeed (i did not know exactly how to describe the situation.. without omitting any later possibly important details).
    Alas, i already tried that many times in following interesting asnwers on similar problems in old posts here; did NOTHING. ,(
    But after your post, i tried it again, and removed for the remaining *hours* (6/8h?) the cmos battery as suggested again *too* so -pushed again the clear cmos button etc when battery out, then when in again, then replugging the powersupply etc; NOTHING better alas too. always same, no boot, black screen, no bios. ,(
    Problem always the same, to sum up, for clarity:
    power supply on => orange motherboard led is lightning up, motherboard on => green motherboard led is lightning up, cpu/video/case fans are working up as normal and.. that's all. nothing else forever. black screen. no signal. not a single chance to get again the bios setup screen.
    another detail i omitted, maybe; keyboard lights are all lightnng up too.. and stay blocked in that state too. tested with 2 different keyboards, same. to shut down the leds, fans etc, only one solution, shut down the power supply button directly, at that stage.
    right now, i test on barebone minimal system as recommanded too;
    cpu, 1 dimm (closest cpu slot), video, keyboard. all rest disconnected.
    i of course tried to reset the cmos with the 'magical red button' many times before, with power supply cable plugged out, pushed the button trying almost every possible way so far (quick, long, long sequences, short sequences etc etc)... changed NOTHING so far -is that thing working?? ,(. and right now, same after hours with cmos battery removed too. ,(
    the d-bracket leds are always (now it is correctly plugged..) :
    123 GREEN 4 (nothing)
    "Testing RTC (real time clock)"
    another 'interesting' detail is that; those leds are appearing IMMEDIATELY after the motherboard is switched on, from start (green led appearing on P6N). and it is staying as such till the end. nothing else. i tried to connect also the case speaker ; no bips, no sound signals at all too.
    I also remind the system was WORKING like a dream during 5 days *before* i had that sudden TOTAL boot problem.... AND i touched almost nothing in the bios too all along, for initial security reasons too.. (i was concentrating on the software installs anyway right now, NOT on the oc side..). The ddr2 quick little change i did was also the ONLY change i tempted to simply test quickly some setting i already saw working without problem with that P6N and that kind of ram.. and it was working without problem so far too, so.. all the time idem. And it had been perfectly working for 3 days as such untouched from there; no problems at all (those memory modules have been seen on that motherboard largely at those specs, why i did that quick test anyway.. far under their possible max -micron chips). it was even working so well i forgot to put the setting back as default after that quick ram test.. so much it was stable too (even if i had not time to do real memtest test on that one - i did for many hours with the initial automatical default settings too, to check the ram quality, was perfect for many hours, so ok too, no bad ram initially too-; was so stable for all my XP software installs operations etc.. that i forgot it thereafter, to be true..why it stayed like that till that moment (incidently).. but i preferred to mention it 'just in case' though, yes. i also did not push at all the dimm voltages in the process, it was always far inside the specs at 2.05V to be exact -usual for that ram too up to those numbers easy for it. i did not push the ram voltages either so..).
    The problem ONLY appears when i wanted to unplug the *initially* badly connected D-bracket headers so (inverted headers.. but that caused NO problems either so far too for the system stability.. only the LEDs were of course not working so far..) : i did the error to NOT switch off the power supply. :(
    *then* immediately the system shut down... and above situation appeared. ,(
    BUT all was working perfect before.. ram setting included so. ,((
    So my simple questions now too ;
    - do you know what means *exactly* the d-bracket message 'Testing RTC" (123 GREEN, 4 nothing).. initial bios problem, isn't it?? other ways to recover it now?? ,((
    - is it a WELL KNOWN PROBLEM when we try to disconnect and replug too hastily the d-bracket headers without switching off the power supply (*my* main erorr here, it seems :( :( ) ????
    ... and of course, do you think it could have *fried* another key component (cpu, ram -?? why i reminded the setting, just in case-?-, video card? .. ) with that d-bracket initial disconnection error ... ,(
    as i said, i have no secondary c2d/ddr2 motherboard here : no way to test the cpu and ddr2 modules on another motherboard to be sure too here. :( i absolutely can't know if they have been damaged or not, here.. :( :(
    any other idea for the motherboard itself though ??? ,(
    once again, thx a lot for any suggestions and precisions on that problem (is that a COMMON well known problem with the d-bracket, when we unplug and replug it without extrem care like i did -my main inattention error it seems.. mainly because all was so stable before too.. ((( - without shutting down the power supply/system FIRST ???? can it be possible 'only' that shut down all the system??? (( )
    thx in advance again +

  • A/B Color contrast in develop module

    It would be really nice to hace a slider (or three, I'll explain) for "color contrast".
    Threre is "contrast" slider that influences the luminosity basically. What I would want to have is a way to control color contrast while preserving luminosity as well as preserve color balance.
    A single slider implementation
    Basically the simplest way (but a bit crude) to do it would be with a single slider.
    The slider defaults to 0.
    Moving it to the right would be equivalent to the following photoshop procedure:
    Change mode to LAB
    Curve adjustment
    Steepen both the A and B curves linearly (pull extreme points in and leave the curve straight, plus keep the center where it is to preserve color balance)
    Leave the L curve alone
    Apply
    switch mode back to RGB
    Moving it left would be the same, except the AB curves would be made shallower rather than steeper (rotate the curve clockwise instead of counter clockwise about the center)
    A two slider implementation
    Same as the above, except that you would have separate A and B sliders (you might call the tint contrast and temp contrast to be consistent with the color balance sliders, which are just like moving the center point of the AB curves)
    A three slider implementation
    Basically this is like having bothe the one slider ("overall color contrast") and the two sliders ("temperature contrast" and "tint contrast"). It's a bit redundant but having the single control there makes it easier when you simply want to globally increase the color contrast without being too picky about the two separate controls (I guess easier for beginners)

    Not at all. The saturation control has quite a different effect that this, and much les subtle. Saturation just increases saturation without changing the hue. This actually changes the hue causing a separation in hues that is impossible to achive in any manuver you would to in RGB space. It drives colors apart rather than increasing their chroma.
    Try it yourself on a few images (especially on images that have nearly uniform color, such as deserts or faces. You will see that this is an entirelty different thing than saturation.

  • Monitor Capture for IPv6

    Trying to capture IPv6 BGP hello traffic with monitor capture feature without success.
    With the monitor capture for IPv6 traffic active and running; If I traceroute (IPv6) from this same router I do see the IPv6 traceroute traffic but NEVER IPv6 BGP hellos.
    NOTE:
    IPv6 traceroute traffic is not shown in the below output because I already cleared the V6BUFF buffer before running the show command.
    My setup:
    monitor capture buffer V6BUFF size 512 max-size 128 linear
    monitor capture point ipv6 cef V6PT mfr0.1 both
    monitor capture point associate V6PT V6BUFF
    monitor capture point start V6PT
    Troubleshooting
    After disassociating monitor capture point V4PT here are the results:
    1941-WAN3#sh mon cap buff all par
    Capture buffer V6BUFF (linear buffer)
    Buffer Size : 524288 bytes, Max Element Size : 128 bytes, Packets : 0
    Allow-nth-pak : 0, Duration : 0 (seconds), Max packets : 0, pps : 0
    Associated Capture Points:
    Name : V6PT, Status : Active
    Configuration:
    monitor capture buffer V6BUFF size 512 max-size 128 linear
    monitor capture point associate V6PT V6BUFF
    Capture buffer V4BUFF (linear buffer)
    Buffer Size : 524288 bytes, Max Element Size : 128 bytes, Packets : 125
    Allow-nth-pak : 0, Duration : 0 (seconds), Max packets : 0, pps : 0
    Associated Capture Points:
    Name : V4PT, Status : Inactive <--- I already disassociated this one
    Configuration:
    monitor capture buffer V4BUFF size 512 max-size 128 linear
    monitor capture point associate V4PT V4BUFF
    Regards
    Frank

    What was the issue and how did you solve it?
    -Deepak

  • Valuation of foreign exchange forward with NPV split for interest vs FX impact?

    Hello,
    I have the following business requirement regarding the accounting treatment of the valuation of a foreign exchange forward deal :
    1. during the lifetime of the deal
    step1. valuation
              the deal should valued at its NPV using the swap points curve (table AT15) => that gives the "VALUE"
         BUT
    step 2. the posting of the deal's value should be SPLIT into TWO components
                   a) component 1 = linearly amortized swap points since deal date +2   until valuation date     => to be classified to interest result
                   b) component 2 =  VALUE - component 1                                                                                => to be classified to unrealized fx result
    Comment.
    So, in fact it is some hybrid combination of the two SAP standard valuation methods
                   a) spot/spot + swap accrual + swap valuation (but NO NPV calculation) 
                   b) NPV calculation (without any split in components)
    2. at maturity
         realized fx result :     calculation based on deal spot rate versus spot rate at maturity
         interest result :          calculation based on deal spot rate vs deal forward rate
    Don't see how this "mixted behavior" can be achieved by customizing the valuation process.
    Please help.
    Best regards,
    Carl

    Hi Carl,
    In order to use the 2step valuation during the lifetime of forex contracts, you need to combine 2 valuation steps in your Position Management Procedure:
    1. step 6 Rate valuation for forward exchange transactions: spot-spot
    2. step 4 Security valuation
    Additonally, if the NPV should be calculated based on swap points from AT15, you need to apply BAdI JBA_SFGDT that is able to adjust TPM60 or/and reports in MRA if needed. See SAP note 0000940562 for details (and also 1941874 for extrapolation issues).
    As far as i know, at maturity you can only have 1flow of gain/loss by using standard SAP Solution.
    Best regards,
    Piotr

  • Show return value of a method-call within a column of ADF table component

    Hi,
    I'm currently developing a ADF "Master Form - Detail Table" component, which displays trips of a car in master form, and all related trip-point information in detail table. This detail table contains the following fields within a row :
    - idTripPoint
    - receivedAt
    - speed
    - coordinates
    Everything is displayed well when deploying my app. What I now want to implement is one more column into my detail table, which displays the result of a method-call which gets the coordinates of the corresponding tripPoint and executes a query to find the nearest neighbour to this point. This method afterwards returns a string which contains a textual description for the coordinates (e.g. 10 km south of Hilton Plaza). This method is defined within my SessionBean and also available within the Data Control Palette.
    What I first did, was just to drag the result (String) of my getTripPointDescription(JGeometry) method to a newly created column within my details table, released it there and set the corresponding NDValue for my method. I used the id of my details table table definition in PageDef for that (${bindings.TripstripPointsList.currentRow.dataProvider.coordinates}). I don't know if this is correct.
    When deploying my app, nothing happened, because my method has never been called. So I decided to implement an invokeAction within my PageDef which calls the generated methodAction within PageDef.
    It looks like that now:
    <executables>
    <invokeAction id="callDescription" Binds="getTripPointDescription"
    Refresh="prepareModel"/>
    </executables>
    <bindings>
    <methodAction id="getTripPointDescription"
    InstanceName="TripsEJBFacadeLocal.dataProvider"
    DataControl="TripsEJBFacadeLocal"
    MethodName="getTripPointDescription"
    RequiresUpdateModel="true" Action="999"
    IsViewObjectMethod="false"
    ReturnName="TripsEJBFacadeLocal.methodResults.TripsEJBFacadeLocal_dataProvider_getTripPointDescription_result">
    <NamedData NDName="tripPoint"
    NDValue="${bindings.TripstripPointsList.currentRow.dataProvider.coordinates}"
    NDType="oracle.spatial.geometry.JGeometry"/>
    </methodAction>
    </bindings>
    Now my method is called once for the coordinates of the first row of my detail table and the generated result is entered within each row.
    So how is it possible to get this standard-behaviour (within other application-frameworks) work in ADF? I just want to display a textual description of a coordinate instead of x/y coordinates within my table. And the corresponding method to get this textual description based on the x/y coordinate should be called for each row displayed in my table.
    I currently walked through all ADF-tutorials and blogs I found on the Internet, but every table example I found only displays data of the associated Entity-Bean. And method Action and accessorIterator are only used with command objects.
    Thank you,
    Thomas

    Sorry, I forgot to say which technologies I use:
    - Toplink Essentials JPA for Model layer (EJB 3.0)
    - ADF in View Layer
    I still hope someone can help me finding an answer.
    Bets Regards,
    Thomas

  • TOP questions about Software Updates - start here

    How do I update the software of my Nokia device?
    You can update the software of most Nokia devices by downloading the software directly to your phone, or by using Nokia Software Updater, Nokia's free PC software.
    Learn how and find out which methods are available for your device at
    http://www.nokia.com/global/support/software-update/update-your-phone/
    How do I know when there is new software available for my Nokia device?
    There are several ways to be notified about new sw versions for each Nokia device:
    1) Use Nokia Suite
    Whenever you connect your device to the latest version of Nokia Suite with a compatible USB cable, Nokia Suite will check if there is an update for your device. Note that this notification only works when you use a USB cable connection.
    2) Check online
    You can easily check the latest available version on the
    Nokia Software Update website.
    Currently Nokia does not publish the expected release dates for future software versions.
    What has been updated in each new software version?
    Main updates are published on the
    Nokia Software Update website.
    Here are some of the most common questions from the Nokia Software Update FAQ:
    Why has my device changed language after updating?
    After an update, your Nokia device may restart in its native language. Changing back to your preferred language can be done from the phone settings. Full instructions may vary depending on the phone model, if you need help you can download the full user guide for your phone from the support pages of your country's Nokia web site - visit www.nokia.com/support for more details.
    If your Nokia device was originally manufactured for use in another country or region, using Nokia Software Updater may revert the set of available device languages to the original language set.
    If your preferred language is no longer available after using Nokia Software Updater, you may need to return your Nokia device to a Nokia Care point to have this language reinstated.
    Other people can update their software but I cannot, although we have the same Nokia device model. What's wrong?
    Update availability is based on many things, including existing Nokia device firmware version, country, and operator. It may be due to one of these variables that your Nokia device isn't eligible for updates.
    Please note that your mobile service provider, operator, or carrier may not have approved the latest Nokia device firmware available.
    Nokia produces many different variants of each product (for different countries and languages) and not all variants have the latest Nokia device firmware. It is our priority to update all variants as quickly as possible, and we apologise for any delay. New software may become available at a later date, however, so please check again soon.
    Why doesn’t Nokia Suite detect my device?
    Sometimes the drivers for your Nokia device and associated connectivity cables can become corrupted.
    To resolve this, uninstall and re-install Nokia PC Suite and Nokia Software Updater:
    - In your PC’s Control Panel, go to Add/Remove programs
    - Uninstall Nokia Suite (if there are more than one entries uninstall all of them)
    - Go to www.nokia.com/support to download and install the latest version of Nokia Suite
    I am not able to use Nokia Suite on any PC and my device does not support updates directly over the air. Is there an alternative way to update my device's software?
    If you are not able to use Nokia Software Updater, you can visit your nearest authorized Nokia Care Point to have your software updated. Note that this may incur a charge. Locations for Nokia Care Points globally are available at the support page for your country, for details please visit http://www.nokia.com/global/support/locations/
    I wrote all my posts from 2005-2011 as an "Admin" for this community. I still work for Nokia as an external consultant, so my rank in all posts is now "Employee".

    Nokia considers changelogs to be confidential information and does not release them to the public.
    If you see any such information, it is leaked information and should therefore be treated with circumspection.
    Was this post helpful? If so, please click on the white "Kudos!" star below. Thank you!

  • SDO_NN with Oracle Spatial

    Hello,
    although the description of my problem is a bit long, I hope you could help me.
    I would like to compute the nearest neighbor of a point being located on the surface of the unit sphere.
    For that query, I would like to take advantage of the features provided by Oracle Spatial (10g).
    Table spatial_test contains the columns point_name, x, y, z, ra, dec where:
    point_name is the primary key
    x, y, z are the coordinates of the points on the unit sphere (so x^2+y^2+z^2=1)
    ra, dec are the the concerning spherical coordinates where the following conditions hold: x=cos(dec)*cos(ra) , y=cos(dec)*sin(ra), z=sin(dec).
    For computing the nearest neighbor of a point with point_name='point1' the query without using Oracle Spatial is:
    select * from(
    select
    acos(t1.x*t2.x+t1.y*t2.y+t1.z*t2.z) as distance, t1.*
    from spatial_test t1,
    spatial_test t2
    where t2.point_name='point1'
    and t1.name != t2.name
    order by dist
    where rownum<2;
    For taking advantage of Oracle Spatial, I have to prepare my data doing the following five steps:
    1. add a column to of type SDO_GEOMETRY to table spatial_test
    2. insert values to that table
    3. update table user_sdo_geom_metadata
    4. create the spatial index
    5. execute the following query on the amended table spatial_test:
    SELECT t1.point_name name1, t2.point_name name2 FROM spatial_test t1, spatial_test t2
    WHERE SDO_NN(t2.geom, t1.geom, 'sdo_num_res=2') = 'TRUE'
    and t1.point_name = 'point1'
    and t1.point_NAME != t2.point_name
    As mentioned in the User Guide for Oracle Spatial, only two dimensional objects are supported.
    So, if I insert tuples in the following form to my table:
    insert into spatial_test (point_name, x, y, z, geom) values (..., ..., ..., ...,
    SDO_GEOMETRY(3001,
    NULL, --SDO_SRID is null, so no coordinate system is associated with the geometry
    SDO_POINT_TYPE(x_value, y_value, z_value),
    NULL,
    NULL));
    I won't get the correct results. I assume that the z_value is just ignored. Am I right with that assumption?
    For using Oracle Spatial, I have to use the equivalent just using two dimensions. Since ra, dec is another representation for x, y, z, I tried to do the same, just using ra and dec. But here, my results also differ from the ones computed with my own computation of the nearest neighbor.
    Here an minimal example which shows my problem:
    CREATE TABLE spatial_test(
    point_name varchar(20) PRIMARY KEY,
    x float,
    y float,
    z float,
    ra float,
    dec float,
    geom SDO_GEOMETRY);
    -- INSERT POINTS --
    insert into spatial_test(point_name, x, y, z, ra, dec, geom) values ('point1', -0.00472924, 0.110927216, 0.99381728, 92.44125, 83.62542,
    SDO_GEOMETRY(2001, -- 2 dimensions, last dimension is the measure, geometry type 01 = point
    NULL, --SDO_SRID is null, so no coordinate system is associated with the geometry
    SDO_POINT_TYPE(92.44125, 83.62542, null),
    NULL,
    NULL));
    insert into spatial_test(point_name, x, y, z, ra, dec, geom) values ('point2', -0.00239923, 0.112814014, 0.993613226, 91.21833, 83.52097,
    SDO_GEOMETRY(2001, -- 2 dimensions, last dimension is the measure, geometry type 01 = point
    NULL, --SDO_SRID is null, so no coordinate system is associated with the geometry
    SDO_POINT_TYPE(91.21833, 83.52097, null),
    NULL,
    NULL));
    insert into spatial_test(point_name, x, y, z, ra, dec, geom) values ('point3', -0.00701052, 0.122780703, 0.992409065, 93.26792, 82.93584,
    SDO_GEOMETRY(2001, -- 2 dimensions, last dimension is the measure, geometry type 01 = point
    NULL, --SDO_SRID is null, so no coordinate system is associated with the geometry
    SDO_POINT_TYPE(93.26792, 82.93584, null),
    NULL,
    NULL));
    -- UPDATA user_sdo_geom_metadata --
    INSERT INTO user_sdo_geom_metadata
    (TABLE_NAME,
    COLUMN_NAME,
    DIMINFO,
    SRID)
    VALUES (
    'spatial_test',
    'geom',
    MDSYS.SDO_DIM_ARRAY(
    MDSYS.SDO_DIM_ELEMENT('ra', 0.0, 360.0, 0.0000000000001),
    MDSYS.SDO_DIM_ELEMENT('dec', -90.0, 90.0, 0.0000000000001)
    NULL -- no specific coordinate system should be associated with the geometries.
    -- CREATE THE SPATIAL INDEX --
    CREATE INDEX spatial_test_idx
    ON spatial_test(geom)
    INDEXTYPE IS MDSYS.SPATIAL_INDEX;
    Now I could execute the following queries which should both compute the nearest neighbor of 'point1'.
    This is the statement computing the nearest neighbor without Oracle Spatial:
    select * from(
    select
    acos(t1.x*t2.x+t1.y*t2.y+t1.z*t2.z) as distance, t2.point_name p1, t1.point_name p2
    from spatial_test t1,
    spatial_test t2
    where t2.point_name='point1'
    and t1.point_name != t2.point_name
    order by distance
    where rownum<2;
    RESULT:
    DISTANCE P1 P2
    ,003005107 point1 point2
    With the following statement, I compute the nearest neighbor of 'point1' using Oracle Spatial:
    SELECT t1.point_name name1, t2.point_name name2 FROM spatial_test t1, spatial_test t2
    WHERE SDO_NN(t2.geom, t1.geom, 'sdo_num_res=2') = 'TRUE'
    and t1.point_name = 'point1'
    and t1.point_NAME != t2.point_name;
    RESULT:
    NAME1 NAME2
    point1 point3
    As you see, unfortunately, the two results differ.
    Could you please tell me, what I understood wrong in using Oracle Spatial?
    In addition, what kind of coordinate system is assumed if it isn't specified in my SDO_GEOMETRY? Which kind of distance is computed using sdo_nn (euclidean distance, ...)?
    Would be glad, if you could tell how to reach the same results for my nearest neighbors using Oracle Spatial.
    Regards,
    Ina

    I would like to compute the nearest neighbor of a
    point being located on the surface of the unit
    sphere.That would be a spherical 3D computation. Currently, OS does not work well with 3D such as spheres, sorry. I know R2 was supposed to improve on this for cubes and pyramids, but to be honest; I haven’t had time to go back and test the simple cube operations. With 10gR1, for most of the operators and functions 2,2,3 and 2,2,5 are same point. I know this is something that is being worked on, possibly Dan can comment further.
    See for more info:
    Re: 3D Polygon
    For now, if you have your own routines, I’d use them as a package instead. If you need help there, let us know and we’ll try to point you in the right direction or help you to translate the code to PL/SQL.
    Bryan

  • Lumia 720 getting hot!!

    Hello all..
    its been two days I bought my Lumia 720..phone is gorgeous, but , to my shock it gets warm real quick..infact its warm almost all the time..the only background apps running are People and city lens..usually the phn gets warm during long talks, charging and playing music.
    And even if there are few background apps, isnt it abnormal that the phone is warm almost all the time. It has become an irritation. What should I do??

    Hi Bags003! Welcome to Nokia Support Discussions!
    In certain situations where multiple high performing applications are used, the phone may warm up and there is nothing unusual about this. Warming may also happen during charging or when listening to music for a longer time, for example. The environmental temperature may also result in warming up. However, all Nokia phones are tested for heat tolerance in accordance with industry and government standards. All models meet industry standards before they are offered for sale. Only Nokia models that meet heat tolerance standards are on the market and the heat level on all Nokia models are within the safe range.
    If you think that the hotness of the phone is beyond normal, it will be best to have it checked by our technicians.
    To know your nearest local Nokia Care Point, visit: http://www.nokia.com/global/support/locations/
    You can read more here: http://discussions.nokia.com/t5/Nokia-Lumia/Lumia-920-Cyan-ATT-Overheats-Battery-Draining/m-p/185643... 
    Battery life tips are provided on the above link. You can also check the below link and we hope this would be of help to you.
    http://discussions.nokia.com/t5/Pool-of-Knowledge/Battery-life-tips-for-Lumia-family-Windows-Phone-d...

  • My nokia moblie give the error cantact service

    hi...my mob give the error cntact service plz ...give me argnt solun what can i do..plz contact my no 9*********
    Moderator's Note: We have removed your contact number for security purposes. 

    Hi nitinkharade,
    What's the model of your phone? The message Contact Service indicates that there could be an internal problem with it. The following steps may help resolve or give some indication as to the source of the issue:
    Remove and re-insert the SIM card and the battery (if the battery is removable).
    If your phone has a memory card, remove and re-insert the card.
    If your phone still displays the same error message, you have to bring it to the nearest authorized Nokia Care Point for inspection and possible repair per @Abi99's advise. See: Local support to know the nearest Nokia Care Point within your area. 
    Note: Sending the phone in will delete all your personal data.
    We look forward to your reply.

  • Constant flow rate pt 2

    Problem: I'm trying to create a gui which allows the user to adjust instensity.  I have my valves characterized, and my event determined sliders,  but I still can't quite figure out how to make sure that no matter how many valves are open, the flow rate remains constant.  Example.  I have 2 valves open, I want a constant flow rate of 10L/min, so if i adjust the flow rate of one valve, the other valve automatically adjusts to maintain the constant flow rate.  The problem I am having is how to integrate the characterization of the valves with my event sliders.  I would then like to be able to adjust the constant flow rate for different elements.  Attached is what i have so far.
    Attachments:
    Test_Mix.vi ‏120 KB

    You'll have to figure out what flow rates correspond to what voltages.  Then create a subVI that will map the desired flowrate to a voltage.  It may be a simple scaling function, it may be a lookup table.
    One thing I like to use is a combination of threshold array and Interpolate 1-D array.  I'll have a couple of arrays with mulitple points where the element in one array that relates to voltage would correlate to the flow rate in the other array.  This would give a piecewise mapping of one to the other.  The functions will do a linear interpolation between points.  The more points you have in the array that correspond to the real profile of the pumps, the closer the actual flow rate will be to the desired flow rate.
    One question though, does the behavior change over time?  Does changing viscosity or temperature cause different voltage to flow rate behaviors?  If so, your problem will get more complicated.

  • I'm trying to interpolate 8 sensor readings in a foot shaped graph.

    hi,
    i am trying to use interpolation of 8 different sensor readings and graph the results in a foot shaped graph.  i am not sure how to do that in labview.  help!!!

    Ok,
    I assume you want something like a map (2D) with the color to be the information, is that it ?
    About interpolation, well you have many way to interpolate, the appropriate way will depend of the data type you have ; is that a 1D or 2D array ? what kind of interpolation you want ? Linear between 2 points, a spline interpolation ?...
    A couple of years ago I made a VI to do "2D spline interpolation", I had  a 2D map of temperature values and wanted to visualize a nice interpolated color map. If you are interested in this I'll try to dig it out.
    You can also find the attached example on the "example code" part of the forums
    Hope this helps.
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"
    Attachments:
    2D interpolation demo.llb ‏145 KB

Maybe you are looking for