difference with picocontainer
516887
public Object getComponentInstance(PicoContainer container) throws PicoInitializationException, PicoIntrospectionException,
			AssignabilityRegistrationException, NotConcreteRegistrationException {
		if (instantiationGuard == null) {
			instantiationGuard = new Guard() {
				public Object run() {
					final Constructor constructor;
					try {
						constructor = getGreediestSatisfiableConstructor(guardedContainer);
					} catch (AmbiguousComponentResolutionException e) {
						e.setComponent(getComponentImplementation());
						throw e;
					}
					ComponentMonitor componentMonitor = currentMonitor();
					try {
						Object[] parameters = getConstructorArguments(guardedContainer, constructor);
						componentMonitor.instantiating(constructor);
						long startTime = System.currentTimeMillis();
						Object inst = newInstance(constructor, parameters);
						componentMonitor.instantiated(constructor, System.currentTimeMillis() - startTime);
						return inst;
					} catch (InvocationTargetException e) {
						componentMonitor.instantiationFailed(constructor, e);
						if (e.getTargetException() instanceof RuntimeException) {
							throw (RuntimeException) e.getTargetException();
						} else if (e.getTargetException() instanceof Error) {
							throw (Error) e.getTargetException();
						}
						throw new PicoInvocationTargetInitializationException(e.getTargetException());
					} catch (InstantiationException e) {
						// can't get here because checkConcrete() will catch it
						// earlier, but see PICO-191
						// /CLOVER:OFF
						componentMonitor.instantiationFailed(constructor, e);
						throw new PicoInitializationException("Should never get here");
						// /CLOVER:ON
					} catch (IllegalAccessException e) {
						// can't get here because either filtered or access mode
						// set
						// /CLOVER:OFF
						componentMonitor.instantiationFailed(constructor, e);
						throw new PicoInitializationException(e);
						// /CLOVER:ON
					}
				}
			};
		}
		instantiationGuard.setArguments(container);
		Object result = instantiationGuard.observe(getComponentImplementation());
		instantiationGuard.clear();
		return result;

	}
80018
def _POUpdateBuilder(env, **kw):
  
  import SCons.Action
  from SCons.Tool.GettextCommon import _POFileBuilder
  action = SCons.Action.Action(_update_or_init_po_files, None)
  return _POFileBuilder(env, action=action, target_alias='$POUPDATE_ALIAS')
607245
def difference(self, *others):
        
        return self.copy(super(NGram, self).difference(*others))
967657
private void defineSliders(UIDefaults d) { 
    	// Rossi: slider inner color changed from gray to "white"
        d.put("sliderTrackBorderBase", new Color(0x709ad0));
//        d.put("sliderTrackInteriorBase", new Color(0x709ad0)); // blue better?
        d.put("sliderTrackInteriorBase", Color.WHITE); // Light blue better?
        String p = "Slider";
        d.put(p + ".States", "Enabled,MouseOver,Pressed,Disabled,Focused,Selected,ArrowShape");
        d.put(p + ".ArrowShape", new SliderArrowShapeState());
        d.put(p + ".thumbWidth", new Integer(17));
        d.put(p + ".thumbHeight", new Integer(20));
        d.put(p + ".trackBorder", new Integer(0));
        d.put(p + ".trackHeight", new Integer(5));
        // Rossi: Changed ticks to dark blue to make them "less massive"
        d.put(p + ".tickColor", new Color(0x5b7ea4));
        d.put(p + "[Disabled].tickColor", getDerivedColor("seaGlassDisabledText", 0, 0, 0, 0, true));
        d.put(p + ".font", new DerivedFont("defaultFont", 0.769f, null, null));
        d.put(p + ".paintValue", Boolean.FALSE);

        p = "Slider:SliderThumb";
        String c = PAINTER_PREFIX + "SliderThumbPainter";

        d.put(p + ".contentMargins", new InsetsUIResource(0, 0, 0, 0));
        d.put(p + ".States", "Enabled,MouseOver,Pressed,Disabled,Focused,Selected,ArrowShape");
        d.put(p + ".ArrowShape", new SliderArrowShapeState());
        d.put(p + "[Disabled].backgroundPainter", new LazyPainter(c, SliderThumbPainter.Which.BACKGROUND_DISABLED));
        d.put(p + "[Enabled].backgroundPainter", new LazyPainter(c, SliderThumbPainter.Which.BACKGROUND_ENABLED));
        d.put(p + "[Focused].backgroundPainter", new LazyPainter(c, SliderThumbPainter.Which.BACKGROUND_FOCUSED));
        d.put(p + "[Focused+MouseOver].backgroundPainter", new LazyPainter(c, SliderThumbPainter.Which.BACKGROUND_FOCUSED_MOUSEOVER));
        d.put(p + "[Focused+Pressed].backgroundPainter", new LazyPainter(c, SliderThumbPainter.Which.BACKGROUND_FOCUSED_PRESSED));
        d.put(p + "[MouseOver].backgroundPainter", new LazyPainter(c, SliderThumbPainter.Which.BACKGROUND_MOUSEOVER));
        d.put(p + "[Pressed].backgroundPainter", new LazyPainter(c, SliderThumbPainter.Which.BACKGROUND_PRESSED));
        d.put(p + "[ArrowShape+Enabled].backgroundPainter", new LazyPainter(c, SliderThumbPainter.Which.BACKGROUND_ENABLED_ARROWSHAPE));
        d.put(p + "[ArrowShape+Disabled].backgroundPainter", new LazyPainter(c, SliderThumbPainter.Which.BACKGROUND_DISABLED_ARROWSHAPE));
        d.put(p + "[ArrowShape+MouseOver].backgroundPainter", new LazyPainter(c, SliderThumbPainter.Which.BACKGROUND_MOUSEOVER_ARROWSHAPE));
        d.put(p + "[ArrowShape+Pressed].backgroundPainter", new LazyPainter(c, SliderThumbPainter.Which.BACKGROUND_PRESSED_ARROWSHAPE));
        d.put(p + "[ArrowShape+Focused].backgroundPainter", new LazyPainter(c, SliderThumbPainter.Which.BACKGROUND_FOCUSED_ARROWSHAPE));
        d.put(p + "[ArrowShape+Focused+MouseOver].backgroundPainter", new LazyPainter(c, SliderThumbPainter.Which.BACKGROUND_FOCUSED_MOUSEOVER_ARROWSHAPE));
        d.put(p + "[ArrowShape+Focused+Pressed].backgroundPainter", new LazyPainter(c, SliderThumbPainter.Which.BACKGROUND_FOCUSED_PRESSED_ARROWSHAPE));

        p = "Slider:SliderTrack";
        c = PAINTER_PREFIX + "SliderTrackPainter";
        d.put(p + ".contentMargins", new InsetsUIResource(0, 0, 0, 0));
        d.put(p + ".States", "Enabled,MouseOver,Pressed,Disabled,Focused,Selected,ArrowShape");
        d.put(p + ".ArrowShape", new SliderArrowShapeState());
        d.put(p + "[Disabled].backgroundPainter", new LazyPainter(c, SliderTrackPainter.Which.BACKGROUND_DISABLED));
        d.put(p + "[Enabled].backgroundPainter", new LazyPainter(c, SliderTrackPainter.Which.BACKGROUND_ENABLED));
    }
954185
private boolean updateTrgPic(int index) {
		SubPicture picSrc = subtitleStream.getSubPicture(index);
		SubPicture picTrg = subPictures[index];
		double scaleX = (double) picTrg.getWidth() / picSrc.getWidth();
		double scaleY = (double) picTrg.getHeight() / picSrc.getHeight();
		double fx;
		double fy;
		if (configuration.getApplyFreeScale()) {
			fx = configuration.getFreeScaleFactorX();
			fy = configuration.getFreeScaleFactorY();
		} else {
			fx = 1.0;
			fy = 1.0;
		}

		int wOld = picTrg.getImageWidth();
		int hOld = picTrg.getImageHeight();
		int wNew = (int) (picSrc.getImageWidth() * scaleX * fx + 0.5);
		if (wNew < MIN_IMAGE_DIMENSION) {
			wNew = picSrc.getImageWidth();
		} else if (wNew > picTrg.getWidth()) {
			wNew = picTrg.getWidth();
		}
		int hNew = (int) (picSrc.getImageHeight() * scaleY * fy + 0.5);
		if (hNew < MIN_IMAGE_DIMENSION) {
			hNew = picSrc.getImageHeight();
		} else if (hNew > picTrg.getHeight()) {
			hNew = picTrg.getHeight();
		}
		picTrg.setImageWidth(wNew);
		picTrg.setImageHeight(hNew);
		if (wNew != wOld) {
			int xOfs = (int) (picSrc.getXOffset() * scaleX + 0.5);
			int spaceSrc = (int) ((picSrc.getWidth() - picSrc.getImageWidth())
					* scaleX + 0.5);
			int spaceTrg = picTrg.getWidth() - wNew;
			xOfs += (spaceTrg - spaceSrc) / 2;
			if (xOfs < 0) {
				xOfs = 0;
			} else if (xOfs + wNew > picTrg.getWidth()) {
				xOfs = picTrg.getWidth() - wNew;
			}
			picTrg.setOfsX(xOfs);
		}
		if (hNew != hOld) {
			int yOfs = (int) (picSrc.getYOffset() * scaleY + 0.5);
			int spaceSrc = (int) ((picSrc.getHeight() - picSrc.getImageHeight())
					* scaleY + 0.5);
			int spaceTrg = picTrg.getHeight() - hNew;
			yOfs += (spaceTrg - spaceSrc) / 2;
			if (yOfs + hNew > picTrg.getHeight()) {
				yOfs = picTrg.getHeight() - hNew;
			}
			picTrg.setOfsY(yOfs);
		}
		// was image cropped?
		return (wNew != wOld) || (hNew != hOld);
	}
227669
private boolean somethingMayHaveChanged(PhaseInterceptorChain pic) {
        Iterator<Interceptor<? extends Message>> it = pic.iterator();
        Interceptor<? extends Message> last = null;
        while (it.hasNext()) {
            Interceptor<? extends Message> cur = it.next();
            if (cur == this) {
                if (last instanceof DemoInterceptor) {
                    return false;
                }
                return true;
            }
            last = cur;
        }
        return true;
    }
574788
private static MutablePicoContainer createContainer(ComponentContainer parent) {
    ComponentMonitor componentMonitor = new NullComponentMonitor();
    ReflectionLifecycleStrategy lifecycleStrategy = new StopSafeReflectionLifecycleStrategy(componentMonitor) {
      @Override
      public boolean isLazy(ComponentAdapter<?> adapter) {
        return true;
      }
    };
    return new DefaultPicoContainer(new OptInCaching(), lifecycleStrategy, parent.getPicoContainer(), componentMonitor);
  }
1341766
function tci() {
    var args = slice.call(arguments),
    ans = new Array(2),
    change;
    if (args.length === 4) {
      change = Math.abs(jStat.studentt.inv(args[1] / 2, args[3] - 1) *
                        args[2] / Math.sqrt(args[3]));
    } else {
      change = Math.abs(jStat.studentt.inv(args[1] / 2, args[2].length - 1) *
                        jStat.stdev(args[2], true) / Math.sqrt(args[2].length));
    }
    ans[0] = args[0] - change;
    ans[1] = args[0] + change;
    return ans;
  }
1286068
public Diff toProto() {
    ApiDiffProto.Diff.Builder builder = ApiDiffProto.Diff.newBuilder();
    for (String className : unsupportedClasses()) {
      builder.addClassDiff(
          ApiDiffProto.ClassDiff.newBuilder()
              .setEverythingDiff(ApiDiffProto.EverythingDiff.newBuilder().setClassName(className)));
    }
    for (String className : unsupportedMembersByClass().keySet()) {
      ApiDiffProto.MemberDiff.Builder memberDiff =
          ApiDiffProto.MemberDiff.newBuilder().setClassName(className);
      for (ClassMemberKey member : unsupportedMembersByClass().get(className)) {
        memberDiff.addMember(
            ApiDiffProto.ClassMember.newBuilder()
                .setIdentifier(member.identifier())
                .setMemberDescriptor(member.descriptor()));
      }
      builder.addClassDiff(ApiDiffProto.ClassDiff.newBuilder().setMemberDiff(memberDiff));
    }
    return builder.build();
  }
1181108
function controllerProviderDecorator($controllerProvider, $controllerIntrospectorProvider) {
  var register = $controllerProvider.register;
  $controllerProvider.register = function (name, ctrl) {
    $controllerIntrospectorProvider.register(name, ctrl);
    return register.apply(this, arguments);
  };
}
1319965
private void addBuiltIn( ) {
        input1.put("inv", Operation::inv);
        input1.put("pinv", Operation::pinv);
        input1.put("rref", Operation::rref);
        input1.put("eye", Operation::eye);
        input1.put("det", Operation::det);
        input1.put("normF", Operation::normF);
        input1.put("sum", Operation::sum_one);
        input1.put("trace", Operation::trace);
        input1.put("diag", Operation::diag);
        input1.put("min", Operation::min);
        input1.put("max", Operation::max);
        input1.put("abs", Operation::abs);
        input1.put("sin", Operation::sin);
        input1.put("cos", Operation::cos);
        input1.put("atan", Operation::atan);
        input1.put("exp", Operation::exp);
        input1.put("log", Operation::log);
        input1.put("sqrt", Operation::sqrt);
        input1.put("rng", Operation::rng);

        inputN.put("normP", (inputs, manager) -> {
            if( inputs.size() != 2 ) throw new RuntimeException("Two inputs expected");
            return Operation.normP(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("max", (inputs, manager) -> {
            if( inputs.size() != 2 ) throw new RuntimeException("One or two inputs expected");
            return Operation.max_two(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("min", (inputs, manager) -> {
            if( inputs.size() != 2 ) throw new RuntimeException("One or two inputs expected");
            return Operation.min_two(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("sum", (inputs, manager) -> {
            if( inputs.size() != 2 ) throw new RuntimeException("One or two inputs expected");
            return Operation.sum_two(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("zeros", (inputs, manager) -> {
            if( inputs.size() != 2 ) throw new RuntimeException("Two inputs expected");
            return Operation.zeros(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("ones", (inputs, manager) -> {
            if( inputs.size() != 2 ) throw new RuntimeException("Two inputs expected");
            return Operation.ones(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("rand", (inputs, manager) -> {
            if( inputs.size() != 2 ) throw new RuntimeException("Two inputs expected");
            return Operation.rand(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("randn", (inputs, manager) -> {
            if( inputs.size() != 2 ) throw new RuntimeException("Two inputs expected");
            return Operation.randn(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("kron", (inputs, manager) -> {
            if( inputs.size() != 2 ) throw new RuntimeException("Two inputs expected");
            return Operation.kron(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("dot", (inputs, manager) -> {
            if( inputs.size() != 2 ) throw new RuntimeException("Two inputs expected");
            return Operation.dot(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("pow", (inputs, manager) -> {
            if( inputs.size() != 2 ) throw new RuntimeException("Two inputs expected");
            return Operation.pow(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("atan2", (inputs, manager) -> {
            if (inputs.size() != 2) throw new RuntimeException("Two inputs expected");
            return Operation.atan2(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("solve", (inputs, manager) -> {
            if( inputs.size() != 2 ) throw new RuntimeException("Two inputs expected");
            return Operation.solve(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("extract", Operation::extract);
        inputN.put("extractScalar", (inputs, manager) -> {
            if( inputs.size() != 2 && inputs.size() != 3 ) throw new RuntimeException("Two or three inputs expected");
            return Operation.extractScalar(inputs, manager);
        });
    }
154464
@Override
    public IntIterator iterator() {

        return new IntIterator() {

            private final org.roaringbitmap.IntIterator iterator = bitmap.getIntIterator();

            @Override
            public int nextInt() {
                return iterator.next();
            }

            @Override
            public int skip(int k) {
                throw new UnsupportedOperationException("Views do not support skipping in the iterator");
            }

            @Override
            public boolean hasNext() {
                return iterator.hasNext();
            }
        };
    }
966885
protected void doSetInput(IEditorInput input) throws CoreException {

		ISourceViewer sourceViewer = getSourceViewer();
		if (!(sourceViewer instanceof ISourceViewerExtension2)) {
			setPreferenceStore(createCombinedPreferenceStore(input));
			internalDoSetInput(input);
			return;
		}

		// uninstall & unregister preference store listener
		getSourceViewerDecorationSupport(sourceViewer).uninstall();
		((ISourceViewerExtension2) sourceViewer).unconfigure();

		setPreferenceStore(createCombinedPreferenceStore(input));

		// install & register preference store listener
		sourceViewer.configure(getSourceViewerConfiguration());
		getSourceViewerDecorationSupport(sourceViewer).install(
				getPreferenceStore());

		internalDoSetInput(input);
		// ISourceViewer sourceViewer = super.getSourceViewer();
		// // if (!(sourceViewer instanceof ISourceViewerExtension2)) {
		// // //setPreferenceStore(createCombinedPreferenceStore(input));
		// // internalDoSetInput(input);
		// // return;
		// // }
		//
		// // uninstall & unregister preference store listener
		// // getSourceViewerDecorationSupport(sourceViewer).uninstall();
		// // ((ISourceViewerExtension2)sourceViewer).unconfigure();
		//
		// // setPreferenceStore(createCombinedPreferenceStore(input));
		//
		// // install & register preference store listener
		// if (sourceViewer != null)
		// {
		// sourceViewer.configure(getSourceViewerConfiguration());
		// getSourceViewerDecorationSupport(sourceViewer).install(getPreferenceStore());
		//
		// internalDoSetInput(input);
		// }else super.doSetInput(input);
		//
	}
1206374
@NotNull
    public ComparatorCompat<T> thenComparingInt(@NotNull ToIntFunction<? super T> keyExtractor) {
        return thenComparing(comparingInt(keyExtractor));
    }
984983
private void compareToInstallLocation(ExecutionContext context, CommandConsole console, Map<String, Set<String>> aparToIFixMap, File wlpInstallationDirectory) {
        String installToCompareToLocation = context.getOptionValue(INSTALL_LOCATION_TO_COMPARE_TO_OPTION);
        File installToCompareToFile = new File(installToCompareToLocation);
        if (!installToCompareToFile.exists()) {
            console.printlnErrorMessage(getMessage("compare.to.option.does.not.exist", installToCompareToLocation));
            return;
        }
        Set<String> aparsForNewInstall = null;
        try {
            aparsForNewInstall = findFixPackAparIds(installToCompareToFile, console, context);
        } catch (IllegalArgumentException e) {
            // These are thrown by the methods when the inputs were invalid and should have the message set to something readable to the user
            console.printlnErrorMessage(e.getMessage());
            return;
        } catch (ZipException e) {
            console.printlnErrorMessage(getMessage("compare.error.reading.install", installToCompareToLocation, e.getMessage()));
            return;
        } catch (IOException e) {
            console.printlnErrorMessage(getMessage("compare.error.reading.install", installToCompareToLocation, e.getMessage()));
            return;
        }

        // Go through all of the APARs that are currently installed and make sure they are in the new version
        Map<String, Set<String>> missingApars = new HashMap<String, Set<String>>();
        for (Map.Entry<String, Set<String>> aparIFixInfo : aparToIFixMap.entrySet()) {
            String apar = aparIFixInfo.getKey();
            if (!aparsForNewInstall.contains(apar)) {
                missingApars.put(apar, aparIFixInfo.getValue());
            }
        }
        // Output the result, this will consist of a message saying if there were any missing iFixes then details on what was missing and what was included
        if (missingApars.isEmpty()) {
            console.printlnInfoMessage(getMessage("compare.all.ifixes.present", wlpInstallationDirectory.getAbsolutePath(), installToCompareToLocation));
        } else {
            console.printlnInfoMessage(getMessage("compare.ifixes.missing", wlpInstallationDirectory.getAbsolutePath(), installToCompareToLocation));
            console.printlnInfoMessage("");
            console.printlnInfoMessage(getMessage("compare.list.missing.ifixes", wlpInstallationDirectory.getAbsolutePath(), installToCompareToLocation));
            printAparIFixInfo(console, missingApars);
        }
        // Now print the included APARs by removing all of the missing ones
        for (String missingApar : missingApars.keySet()) {
            aparToIFixMap.remove(missingApar);
        }
        if (!aparToIFixMap.isEmpty()) {
            console.printlnInfoMessage("");
            console.printlnInfoMessage(getMessage("compare.list.included.ifixes", wlpInstallationDirectory.getAbsolutePath(), installToCompareToLocation));
            printAparIFixInfo(console, aparToIFixMap);
        }
    }
999690
function perfFindInterlacedInserts(multiplier) {
  var start, end;
  var totalTimes = [];
  var totalMS = 0;

  var loopIterations = arraySize;
  if (typeof (multiplier) != "undefined") {
    loopIterations = loopIterations * multiplier;
  }

  for (var idx = 0; idx < loopIterations; idx++) {
    var customidx = Math.floor(Math.random() * arraySize) + 1;

    start = process.hrtime();
    var results = samplecoll.find({
      'customId': customidx
    });
    // insert junk record, now (outside timing routine) to force index rebuild
    var obj = samplecoll.insert({
        customId: 999,
        val: 999,
        val2: 999,
        val3: "more data 1234567890"
    });  
    
    end = process.hrtime(start);
    totalTimes.push(end);
    
  }

  for (var idx = 0; idx < totalTimes.length; idx++) {
    totalMS += totalTimes[idx][0] * 1e3 + totalTimes[idx][1] / 1e6;
  }

  totalMS = totalMS.toFixed(2);
  var rate = loopIterations * 1000 / totalMS;
  rate = rate.toFixed(2);
  console.log("interlaced inserts + coll.find() : " + totalMS + "ms (" + rate + " ops/s) " + loopIterations + " iterations");
  
}
499756
def picard_bam_to_fastq(picard, in_bam, fastq_one, fastq_two=None):
    
    if not file_exists(fastq_one):
        with tx_tmpdir(picard._config) as tmp_dir:
            with file_transaction(picard._config, fastq_one) as tx_out1:
                opts = [("INPUT", in_bam),
                        ("FASTQ", tx_out1),
                        ("TMP_DIR", tmp_dir)]
                if fastq_two is not None:
                    opts += [("SECOND_END_FASTQ", fastq_two)]
                picard.run("SamToFastq", opts)
    return (fastq_one, fastq_two)