TODO Do this correction without running bundle adjustment again
503385
private static void checkBehindCamera(SceneStructureMetric structure, SceneObservations observations, BundleAdjustment<SceneStructureMetric> bundleAdjustment) {

		int totalBehind = 0;
		Point3D_F64 X = new Point3D_F64();
		for (int i = 0; i < structure.points.length; i++) {
			structure.points[i].get(X);
			if( X.z < 0 )
				totalBehind++;
		}
		structure.views[1].worldToView.T.print();
		if( totalBehind > structure.points.length/2 ) {
			System.out.println("Flipping because it's reversed. score = "+bundleAdjustment.getFitScore());
			for (int i = 1; i < structure.views.length; i++) {
				Se3_F64 w2v = structure.views[i].worldToView;
				w2v.set(w2v.invert(null));
			}
			triangulatePoints(structure,observations);

			bundleAdjustment.setParameters(structure,observations);
			bundleAdjustment.optimize(structure);
			System.out.println("  after = "+bundleAdjustment.getFitScore());
		} else {
			System.out.println("Points not behind camera. "+totalBehind+" / "+structure.points.length);
		}
	}
1275109
def __adjustStopOrder(self, tick):
        '''  '''
        if not self.__stopOrderId:
            return

        if self.__stopOrder.action == Action.SELL:
            orgStopPrice=self.__buyOrder.price * 0.95
            newStopPrice=max(((tick.close + orgStopPrice) / 2), tick.close * 0.85)
            newStopPrice=min(newStopPrice, tick.close * 0.95)

            if newStopPrice > self.__stopOrder.price:
                self.__strategy.tradingEngine.cancelOrder(self.__security, self.__stopOrderId)
                stopOrder=Order(accountId=self.__strategy.accountId,
                                  action=Action.SELL,
                                  is_stop=True,
                                  security=self.__security,
                                  price=newStopPrice,
                                  share=self.__stopOrder.share)
                self.__placeStopOrder(stopOrder)
        '''
        elif self.__stopOrder.action == Action.BUY_TO_COVER:
            orgStopPrice=self.__buyOrder.price * 1.05
            newStopPrice=min(((orgStopPrice + tick.close) / 2), tick.close * 1.15)
            newStopPrice=max(newStopPrice, tick.close * 1.05)

            if newStopPrice < self.__stopOrder.price:
                self.__strategy.tradingEngine.cancelOrder(self.__security, self.__stopOrderId)
                stopOrder=Order(accountId=self.__strategy.accountId,
                                  action=Action.BUY_TO_COVER,
                                  type=Type.STOP,
                                  security=self.__security,
                                  price=newStopPrice,
                                  share=self.__stopOrder.share)
                self.__placeStopOrder(stopOrder)
        '''
241974
def tune_pair(self, pair):
        """"""
        self._save_bm_state()
        self.pair = pair
        self.update_disparity_map()
1035728
private void updateMultipleAlignment() throws StructureException,
			RefinerFailedException {

		msa.clear();

		// Override the alignment with the new information
		Block b = msa.getBlock(0);
		b.setAlignRes(block);
		repeatCore = b.getCoreLength();
		if (repeatCore < 1)
			throw new RefinerFailedException(
					"Optimization converged to length 0");

		SymmetryTools.updateSymmetryTransformation(axes, msa);
	}
584661
function getCalValues(bundle) {
    dbgHWTest('getCalValues');
    var defered = q.defer();
    var numUint32sToRead = 41;  // See basecamp somewhere...
    bundle.device.readFlash(0x3C4000, numUint32sToRead)
    .then(function(data) {
        // Convert the read calibration data to floating point values
        var floatingPointData = [];
        data.results.forEach(function(result){
            var buf = new Buffer(4);
            buf.writeUInt32BE(result,0);
            var floatVal = buf.readFloatBE(0);
            floatingPointData.push(floatVal);
        });
        bundle.calibrationInfo = floatingPointData;
        bundle.calibrationInfoValid = true;
        defered.resolve(bundle);
    }, function(err) {
        bundle.calibrationInfo = [];
        var i = 0;
        for(i = 0; i < numUint32sToRead; i++) {
            bundle.calibrationInfo.push(0);
        }
        bundle.calibrationInfoValid = false;
        bundle.overallResult = false;
        bundle.overallMessage = 'Failed to read device cal info.';
        bundle.shortMessage = 'Failed';
        defered.resolve(bundle);
    });
    return defered.promise;
}
16002
void adjustScroll() {

        iTreeHeight = iRowHeight * (iRowCount + 1);

        // correct would be iMaxTextLength + iMaxIndent*iIndentWidth
        iTreeWidth = iMaxTextLength * 2;

        sbHoriz.setValues(iX, iWidth, 0, iTreeWidth);

        int v = iY / iRowHeight,
            h = iHeight / iRowHeight;

        sbVert.setValues(v, h, 0, iRowCount + 1);

        iX = sbHoriz.getValue();
        iY = iRowHeight * sbVert.getValue();
    }
1015952
private void adjustSchema(String schemaPath, String newElementString) {

        newElementString = newElementString.substring(0, 1).toUpperCase() + newElementString.substring(1);
        try {
            CmsFile file = m_cms.readFile(schemaPath);

            CmsMacroResolver macroResolver = new CmsMacroResolver();
            macroResolver.setKeepEmptyMacros(true);

            macroResolver.addMacro(SAMPLE_TYPE_SCHEMA_ELEMENT, newElementString);
            String bundleName = m_bundle.getValue();

            bundleName = bundleName.split("/")[bundleName.split("/").length - 1];
            if (bundleName.contains("_")) {
                bundleName = bundleName.split("_")[0];
            }
            macroResolver.addMacro("ResourceBundle", bundleName);
            macroResolver.addMacro("typeName", m_typeShortName.getValue());
            String encoding = m_cms.readPropertyObject(
                file,
                CmsPropertyDefinition.PROPERTY_CONTENT_ENCODING,
                true).getValue(OpenCms.getSystemInfo().getDefaultEncoding());
            String newContent = macroResolver.resolveMacros(new String(file.getContents(), encoding));
            // update the content
            try {
                file.setContents(newContent.getBytes(encoding));
            } catch (UnsupportedEncodingException e) {
                try {
                    file.setContents(newContent.getBytes(Charset.defaultCharset().toString()));
                } catch (UnsupportedEncodingException e1) {
                    file.setContents(newContent.getBytes());
                }
            }
            // write the target file
            CmsLockUtil.ensureLock(m_cms, file);
            m_cms.writeFile(file);
            CmsLockUtil.tryUnlock(m_cms, file);
        } catch (

        CmsException e) {
            LOG.error("Unable to read schema definition", e);
        } catch (UnsupportedEncodingException e) {
            LOG.error("Unable to fetch encoding", e);
        }
    }
61555
private void fixTrans() {
        matrix.getValues(m);
        float transX = m[Matrix.MTRANS_X];
        float transY = m[Matrix.MTRANS_Y];

        float fixTransX = getFixTrans(transX, viewWidth, getImageWidth());
        float fixTransY = getFixTrans(transY, viewHeight, getImageHeight());

        if (fixTransX != 0 || fixTransY != 0) {
            matrix.postTranslate(fixTransX, fixTransY);
        }
    }
558695
private void pruneOutliers(BundleAdjustment<SceneStructureMetric> bundleAdjustment) {
		// see if it's configured to not prune
		if( pruneFraction == 1.0 )
			return;
		PruneStructureFromSceneMetric pruner = new PruneStructureFromSceneMetric(structure,observations);
		pruner.pruneObservationsByErrorRank(pruneFraction);
		pruner.pruneViews(10);
		pruner.prunePoints(1);
		bundleAdjustment.setParameters(structure,observations);
		bundleAdjustment.optimize(structure);

		if( verbose != null ) {
			verbose.println("\nCamera");
			for (int i = 0; i < structure.cameras.length; i++) {
				verbose.println(structure.cameras[i].getModel().toString());
			}
			verbose.println("\n\nworldToView");
			for (int i = 0; i < structure.views.length; i++) {
				verbose.println(structure.views[i].worldToView.toString());
			}
			verbose.println("Fit Score: " + bundleAdjustment.getFitScore());
		}
	}
1323320
private int adjustAlpha(int color, float factor) {
        int alpha = Math.round(Color.alpha(color) * factor);
        int red = Color.red(color);
        int green = Color.green(color);
        int blue = Color.blue(color);
        return Color.argb(alpha, red, green, blue);
    }
1197487
private void adjustStamp() {
        int max = MINIMUM_USER_STAMP;
        int newStamp = MINIMUM_USER_STAMP;

        for (;;) {
            int min = Integer.MAX_VALUE;
            for (int i = 0; i < stamp.length; i++) {
                int v = stamp[i];
                if (v >= newStamp && min > v) {
                    min = v;
                }
                if (max < v) {
                    max = v;
                }
            }
            if (max != min && min == Integer.MAX_VALUE) {
                break;
            }
            for (int i = 0; i < stamp.length; i++) {
                if (stamp[i] == min) {
                    stamp[i] = newStamp;
                }
            }
            newStamp++;
            if (min == max) {
                break;
            }
        }
        nextStamp = newStamp;
    }
875049
def _fixPe(self):
        
        sizeOfImage = 0
        for sh in self.sectionHeaders:
            sizeOfImage += sh.misc
        self.ntHeaders.optionaHeader.sizeoOfImage.value = self._sectionAlignment(sizeOfImage + 0x1000)
464974
private static void numericAdjustment(MethodVisitor mVisitor, String javaType) {
        adjustmentsMapper.getOrDefault(javaType, XsdAsmAttributes::doubleAdjustment).accept(mVisitor);
    }
539375
function debouncebundle (time) {
  let timer = postcssify.timer
  if (timer) { clearTimeout(timer) }
  postcssify.timer = setTimeout(() => {
    postcssify.timer = null
    bundle()
  }, time)
}
136211
public static double[] adjust(DGrowArray gwork, int desired) {
        if (gwork == null) gwork = new DGrowArray();
        gwork.reshape(desired);
        return gwork.data;
    }
53375
function fixAngleOverlap(list) {
    var firstItem = list[0];
    var lastItem = list[list.length - 1];
    if (firstItem
        && lastItem
        && Math.abs(Math.abs(firstItem.coord - lastItem.coord) - 360) < 1e-4
    ) {
        list.pop();
    }
}
4745
function fixPrepatch(to, ___) {
  var _this3 = this;

  if (this._hashChanged) return;

  __WEBPACK_IMPORTED_MODULE_6_vue__["default"].nextTick(function () {
    var instances = Object(__WEBPACK_IMPORTED_MODULE_9__utils__["g" /* getMatchedComponentsInstances */])(to);

    _lastComponentsFiles = instances.map(function (instance, i) {
      if (!instance) return '';

      if (_lastPaths[i] === instance.constructor._path && typeof instance.constructor.options.data === 'function') {
        var newData = instance.constructor.options.data.call(instance);
        for (var key in newData) {
          __WEBPACK_IMPORTED_MODULE_6_vue__["default"].set(instance.$data, key, newData[key]);
        }
      }

      return instance.constructor.options.__file;
    });

    // Hide error component if no error
    if (_this3._hadError && _this3._dateLastError === _this3.$options._nuxt.dateErr) {
      _this3.error();
    }

    // Set layout
    var layout = _this3.$options._nuxt.err ? __WEBPACK_IMPORTED_MODULE_8__index__["a" /* NuxtError */].layout : to.matched[0].components.default.options.layout;
    if (typeof layout === 'function') {
      layout = layout(_this3._context);
    }
    _this3.setLayout(layout);

    // Hot reloading
    setTimeout(function () {
      return hotReloadAPI(_this3);
    }, 100);
  });
}