idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
422,443
public static String buildAuraHome() {<NEW_LINE>String providedPath = System.getProperty("aura.home");<NEW_LINE>if (providedPath != null) {<NEW_LINE>try {<NEW_LINE>// try to clean up any provided path<NEW_LINE>File canonical = new File(providedPath).getCanonicalFile();<NEW_LINE>if (canonical.exists() && canonical.isDirectory()) {<NEW_LINE>return canonical.getPath();<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Class<?> clazz = AuraUtil.class;<NEW_LINE>try {<NEW_LINE>CodeSource source = clazz.getProtectionDomain().getCodeSource();<NEW_LINE>if (source != null) {<NEW_LINE><MASK><NEW_LINE>if (FILE_PROTOCOL.equalsIgnoreCase(url.getProtocol())) {<NEW_LINE>String path = stripTarget(url.getPath());<NEW_LINE>if (path != null) {<NEW_LINE>return path;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (SecurityException se) {<NEW_LINE>// ignore, we can't read it, try again with the class below.<NEW_LINE>}<NEW_LINE>String clazzPath = "/" + clazz.getName().replace('.', '/') + ".class";<NEW_LINE>URL clazzUrl = clazz.getResource(clazzPath);<NEW_LINE>System.out.println(clazzUrl);<NEW_LINE>if (FILE_PROTOCOL.equalsIgnoreCase(clazzUrl.getProtocol())) {<NEW_LINE>String path = clazzUrl.getPath();<NEW_LINE>if (path.endsWith(clazzPath)) {<NEW_LINE>path = path.substring(0, path.lastIndexOf(clazzPath));<NEW_LINE>path = stripTarget(path);<NEW_LINE>if (path != null) {<NEW_LINE>return path;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
URL url = source.getLocation();
1,288,398
public void rescaleCache(final Projection pProjection, final double pNewZoomLevel, final double pOldZoomLevel, final Rect pViewPort) {<NEW_LINE>if (TileSystem.getInputTileZoomLevel(pNewZoomLevel) == TileSystem.getInputTileZoomLevel(pOldZoomLevel)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final long startMs = System.currentTimeMillis();<NEW_LINE>if (Configuration.getInstance().isDebugTileProviders())<NEW_LINE>Log.i(IMapView.LOGTAG, "rescale tile cache from " + pOldZoomLevel + " to " + pNewZoomLevel);<NEW_LINE>final PointL topLeftMercator = pProjection.toMercatorPixels(pViewPort.left, pViewPort.top, null);<NEW_LINE>final PointL bottomRightMercator = pProjection.toMercatorPixels(pViewPort.right, pViewPort.bottom, null);<NEW_LINE>final RectL viewPortMercator = new RectL(topLeftMercator.x, topLeftMercator.y, bottomRightMercator.x, bottomRightMercator.y);<NEW_LINE>final ScaleTileLooper tileLooper = pNewZoomLevel > pOldZoomLevel ? new <MASK><NEW_LINE>tileLooper.loop(pNewZoomLevel, viewPortMercator, pOldZoomLevel, getTileSource().getTileSizePixels());<NEW_LINE>final long endMs = System.currentTimeMillis();<NEW_LINE>if (Configuration.getInstance().isDebugTileProviders())<NEW_LINE>Log.i(IMapView.LOGTAG, "Finished rescale in " + (endMs - startMs) + "ms");<NEW_LINE>}
ZoomInTileLooper() : new ZoomOutTileLooper();
152,364
private void updateParams(ApplicationMode appMode, boolean nighMode, boolean locationOutdated) {<NEW_LINE><MASK><NEW_LINE>int profileColor = locationOutdated ? ContextCompat.getColor(ctx, ProfileIconColors.getOutdatedLocationColor(nighMode)) : appMode.getProfileColor(nighMode);<NEW_LINE>int locationIconId = appMode.getLocationIcon().getIconId();<NEW_LINE>int navigationIconId = appMode.getNavigationIcon().getIconId();<NEW_LINE>int headingIconId = appMode.getLocationIcon().getHeadingIconId();<NEW_LINE>float textScale = getTextScale();<NEW_LINE>boolean carView = getApplication().getOsmandMap().getMapView().isCarView();<NEW_LINE>if (appMode != this.appMode || this.nm != nighMode || this.locationOutdated != locationOutdated || this.profileColor != profileColor || this.locationIconId != locationIconId || this.headingIconId != headingIconId || this.navigationIconId != navigationIconId || this.textScale != textScale || this.carView != carView) {<NEW_LINE>this.appMode = appMode;<NEW_LINE>this.profileColor = profileColor;<NEW_LINE>this.nm = nighMode;<NEW_LINE>this.locationOutdated = locationOutdated;<NEW_LINE>this.locationIconId = locationIconId;<NEW_LINE>this.headingIconId = headingIconId;<NEW_LINE>this.navigationIconId = navigationIconId;<NEW_LINE>this.textScale = textScale;<NEW_LINE>this.carView = carView;<NEW_LINE>navigationIcon = (LayerDrawable) AppCompatResources.getDrawable(ctx, navigationIconId);<NEW_LINE>if (navigationIcon != null) {<NEW_LINE>DrawableCompat.setTint(navigationIcon.getDrawable(1), profileColor);<NEW_LINE>}<NEW_LINE>headingIcon = getScaledBitmap(headingIconId);<NEW_LINE>locationIcon = (LayerDrawable) AppCompatResources.getDrawable(ctx, locationIconId);<NEW_LINE>if (locationIcon != null) {<NEW_LINE>DrawableCompat.setTint(DrawableCompat.wrap(locationIcon.getDrawable(1)), profileColor);<NEW_LINE>}<NEW_LINE>if (!view.hasMapRenderer()) {<NEW_LINE>headingPaint.setColorFilter(new PorterDuffColorFilter(profileColor, PorterDuff.Mode.SRC_IN));<NEW_LINE>area.setColor(ColorUtilities.getColorWithAlpha(profileColor, 0.16f));<NEW_LINE>aroundArea.setColor(profileColor);<NEW_LINE>}<NEW_LINE>markersNeedInvalidate = true;<NEW_LINE>}<NEW_LINE>}
Context ctx = view.getContext();
1,326,054
private void addDependency(List<IvyDependencyDescriptor> result, DependencyDescriptor dependencyDescriptor) {<NEW_LINE>ModuleRevisionId revisionId = dependencyDescriptor.getDependencyRevisionId();<NEW_LINE>ModuleComponentSelector requested = DefaultModuleComponentSelector.newSelector(DefaultModuleIdentifier.newId(revisionId.getOrganisation(), revisionId.getName()), new DefaultImmutableVersionConstraint(revisionId.getRevision()));<NEW_LINE>ListMultimap<String, String> configMappings = ArrayListMultimap.create();<NEW_LINE>for (Map.Entry<String, List<String>> entry : readConfigMappings(dependencyDescriptor).entrySet()) {<NEW_LINE>configMappings.putAll(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>List<Artifact> artifacts = Lists.newArrayList();<NEW_LINE>for (DependencyArtifactDescriptor ivyArtifact : dependencyDescriptor.getAllDependencyArtifacts()) {<NEW_LINE>IvyArtifactName ivyArtifactName = new DefaultIvyArtifactName(ivyArtifact.getName(), ivyArtifact.getType(), ivyArtifact.getExt(), (String) ivyArtifact.getExtraAttributes<MASK><NEW_LINE>artifacts.add(new Artifact(ivyArtifactName, Sets.newHashSet(ivyArtifact.getConfigurations())));<NEW_LINE>}<NEW_LINE>List<Exclude> excludes = Lists.newArrayList();<NEW_LINE>for (ExcludeRule excludeRule : dependencyDescriptor.getAllExcludeRules()) {<NEW_LINE>excludes.add(forIvyExclude(excludeRule));<NEW_LINE>}<NEW_LINE>result.add(new IvyDependencyDescriptor(requested, dependencyDescriptor.getDynamicConstraintDependencyRevisionId().getRevision(), dependencyDescriptor.isChanging(), dependencyDescriptor.isTransitive(), false, configMappings, artifacts, excludes));<NEW_LINE>}
().get(CLASSIFIER));
1,744,384
public static List<AssociatedTriple> imagesToTrifocal(GrayU8 gray01, GrayU8 gray02, GrayU8 gray03, TrifocalTensor model) {<NEW_LINE>// Using SURF features. Robust and fairly fast to compute<NEW_LINE>var configDetector = new ConfigFastHessian();<NEW_LINE>// limit the feature count<NEW_LINE>configDetector.maxFeaturesAll = 2500;<NEW_LINE>configDetector.extract.radius = 4;<NEW_LINE>DetectDescribePoint<GrayU8, TupleDesc_F64> detDesc = FactoryDetectDescribe.surfStable(configDetector, null, null, GrayU8.class);<NEW_LINE>// Associate features across all three views using previous example code<NEW_LINE>var associateThree = new ExampleAssociateThreeView();<NEW_LINE>associateThree.initialize(detDesc);<NEW_LINE><MASK><NEW_LINE>associateThree.detectFeatures(gray02, 1);<NEW_LINE>associateThree.detectFeatures(gray03, 2);<NEW_LINE>DogArray<AssociatedTripleIndex> associatedIdx = associateThree.threeViewPairwiseAssociate();<NEW_LINE>System.out.println("features01.size = " + associateThree.features01.size);<NEW_LINE>System.out.println("features02.size = " + associateThree.features02.size);<NEW_LINE>System.out.println("features03.size = " + associateThree.features03.size);<NEW_LINE>// Convert the matched indexes into AssociatedTriple which contain the actual pixel coordinates<NEW_LINE>var associated = new DogArray<>(AssociatedTriple::new);<NEW_LINE>associatedIdx.forEach(p -> associated.grow().setTo(associateThree.locations01.get(p.a), associateThree.locations02.get(p.b), associateThree.locations03.get(p.c)));<NEW_LINE>System.out.println("Total Matched Triples = " + associated.size);<NEW_LINE>// Storage for the found model. In this example we don't actually use the tensor.<NEW_LINE>List<AssociatedTriple> inliers = computeTrifocal(associated, model);<NEW_LINE>System.out.println("Remaining after RANSAC " + inliers.size());<NEW_LINE>return inliers;<NEW_LINE>}
associateThree.detectFeatures(gray01, 0);
237,322
public static void logMethodInvocations(ApplicationConnection c, Collection<MethodInvocation> methodInvocations) {<NEW_LINE>try {<NEW_LINE>getLogger().info("RPC invocations to be sent to the server:");<NEW_LINE>String curId = null;<NEW_LINE>List<MethodInvocation> invocations = new ArrayList<>();<NEW_LINE>for (MethodInvocation methodInvocation : methodInvocations) {<NEW_LINE>String id = methodInvocation.getConnectorId();<NEW_LINE>if (curId == null) {<NEW_LINE>curId = id;<NEW_LINE>} else if (!curId.equals(id)) {<NEW_LINE>printConnectorInvocations(invocations, curId, c);<NEW_LINE>invocations.clear();<NEW_LINE>curId = id;<NEW_LINE>}<NEW_LINE>invocations.add(methodInvocation);<NEW_LINE>}<NEW_LINE>if (!invocations.isEmpty()) {<NEW_LINE>printConnectorInvocations(invocations, curId, c);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>getLogger().log(<MASK><NEW_LINE>}<NEW_LINE>}
Level.SEVERE, "Error logging method invocations", e);
253,574
public void run(FlowTrigger trigger, Map data) {<NEW_LINE>GetInstallPathForDataVolumeDownloadMsg gmsg = originVolumeUuid != null ? new GetInstallPathForTemporaryDataVolumeDownloadMsg<MASK><NEW_LINE>gmsg.setPrimaryStorageUuid(targetPrimaryStorage.getUuid());<NEW_LINE>gmsg.setVolumeUuid(vol.getUuid());<NEW_LINE>gmsg.setBackupStorageRef(ImageBackupStorageRefInventory.valueOf(targetBackupStorageRef));<NEW_LINE>gmsg.setImage(ImageInventory.valueOf(template));<NEW_LINE>gmsg.setHostUuid(msg.getHostUuid());<NEW_LINE>bus.makeTargetServiceIdByResourceUuid(gmsg, PrimaryStorageConstant.SERVICE_ID, targetPrimaryStorage.getUuid());<NEW_LINE>bus.send(gmsg, new CloudBusCallBack(trigger) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(MessageReply reply) {<NEW_LINE>if (!reply.isSuccess()) {<NEW_LINE>trigger.fail(reply.getError());<NEW_LINE>} else {<NEW_LINE>GetInstallPathForDataVolumeDownloadReply r = reply.castReply();<NEW_LINE>prePSInstallPath = r.getInstallPath();<NEW_LINE>trigger.next();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
(originVolumeUuid) : new GetInstallPathForDataVolumeDownloadMsg();
1,835,511
public Concrete.Expression visitCase(Concrete.CaseExpression expr, Void params) {<NEW_LINE>Set<Referable> eliminatedRefs = new HashSet<>();<NEW_LINE>try (Utils.ContextSaver ignored = new Utils.ContextSaver(myContext)) {<NEW_LINE>for (Concrete.CaseArgument caseArg : expr.getArguments()) {<NEW_LINE>caseArg.expression = caseArg.expression.accept(this, null);<NEW_LINE>if (caseArg.isElim && caseArg.expression instanceof Concrete.ReferenceExpression) {<NEW_LINE>eliminatedRefs.add(((Concrete.ReferenceExpression) caseArg.expression).getReferent());<NEW_LINE>}<NEW_LINE>if (caseArg.type != null) {<NEW_LINE>caseArg.type = caseArg.type.accept(this, null);<NEW_LINE>}<NEW_LINE>addReferable(caseArg.referable, caseArg.type, null);<NEW_LINE>}<NEW_LINE>if (expr.getResultType() != null) {<NEW_LINE>expr.setResultType(expr.getResultType().accept(this, null));<NEW_LINE>}<NEW_LINE>if (expr.getResultTypeLevel() != null) {<NEW_LINE>expr.setResultTypeLevel(expr.getResultTypeLevel()<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Referable> origContext = eliminatedRefs.isEmpty() ? null : new ArrayList<>(myContext);<NEW_LINE>if (!eliminatedRefs.isEmpty()) {<NEW_LINE>myContext.removeAll(eliminatedRefs);<NEW_LINE>}<NEW_LINE>visitClauses(expr.getClauses(), null);<NEW_LINE>if (origContext != null) {<NEW_LINE>myContext.clear();<NEW_LINE>myContext.addAll(origContext);<NEW_LINE>}<NEW_LINE>return expr;<NEW_LINE>}
.accept(this, null));
1,457,226
public static int adaptToType(MethodVisitor method, Class<?> type) {<NEW_LINE>if (type.isPrimitive()) {<NEW_LINE>if (type.equals(long.class)) {<NEW_LINE>method.visitTypeInsn(CHECKCAST, getInternalName(Long.class));<NEW_LINE>method.visitMethodInsn(INVOKEVIRTUAL, getInternalName(Long.class), "longValue", "()J", false);<NEW_LINE>return 1;<NEW_LINE>} else if (type.equals(int.class)) {<NEW_LINE>method.visitTypeInsn(CHECKCAST, getInternalName(Integer.class));<NEW_LINE>method.visitMethodInsn(INVOKEVIRTUAL, getInternalName(Integer.class<MASK><NEW_LINE>return 0;<NEW_LINE>} else if (type.equals(double.class)) {<NEW_LINE>method.visitTypeInsn(CHECKCAST, getInternalName(Double.class));<NEW_LINE>method.visitMethodInsn(INVOKEVIRTUAL, getInternalName(Double.class), "doubleValue", "()D", false);<NEW_LINE>return 1;<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("type " + type + " not yet supported");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>method.visitTypeInsn(CHECKCAST, getInternalName(type));<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>}
), "intValue", "()I", false);
1,840,472
private // }<NEW_LINE>void addSnapshotButton() {<NEW_LINE>Button snapShotButton = new Button(XYGraphMediaFactory.getInstance().getImage("images/camera.gif"));<NEW_LINE>snapShotButton.setToolTip(new Label("Save Snapshot to PNG file"));<NEW_LINE>addButton(snapShotButton);<NEW_LINE>snapShotButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent event) {<NEW_LINE>// Have valid name, so get image<NEW_LINE>ImageLoader loader = new ImageLoader();<NEW_LINE>Image image = xyGraph.getImage();<NEW_LINE>loader.data = new ImageData[] { image.getImageData() };<NEW_LINE>image.dispose();<NEW_LINE>// Prompt for file name<NEW_LINE><MASK><NEW_LINE>if (path == null || path.length() <= 0)<NEW_LINE>return;<NEW_LINE>// Assert *.png at end of file name<NEW_LINE>if (!path.toLowerCase().endsWith(".png"))<NEW_LINE>path = path + ".png";<NEW_LINE>// Save<NEW_LINE>loader.save(path, SWT.IMAGE_PNG);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
String path = SingleSourceHelper.getImageSavePath();
1,407,879
protected void refresh() {<NEW_LINE>refreshJavaPlatforms();<NEW_LINE>refreshPlatforms();<NEW_LINE>platformValue.setEnabled(getProperties().isStandalone());<NEW_LINE>managePlafsButton.setEnabled(getProperties().isStandalone());<NEW_LINE>reqTokenList.setModel(getProperties().getRequiredTokenListModel());<NEW_LINE>final DefaultListModel model <MASK><NEW_LINE>wrappedJarsList.setModel(model);<NEW_LINE>emListComp = EditMediator.createListComponent(wrappedJarsList);<NEW_LINE>updateJarExportedMap();<NEW_LINE>runDependenciesListModelRefresh();<NEW_LINE>dependencyList.getModel().addListDataListener(new ListDataListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void contentsChanged(ListDataEvent e) {<NEW_LINE>updateEnabled();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void intervalAdded(ListDataEvent e) {<NEW_LINE>updateEnabled();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void intervalRemoved(ListDataEvent e) {<NEW_LINE>updateEnabled();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
= getProperties().getWrappedJarsListModel();
87,817
static // / @brief Print the solution.<NEW_LINE>void printSolution(DataModel data, RoutingModel routing, RoutingIndexManager manager, Assignment solution) {<NEW_LINE>// Solution cost.<NEW_LINE>logger.info(<MASK><NEW_LINE>// Inspect solution.<NEW_LINE>long totalDistance = 0;<NEW_LINE>for (int i = 0; i < data.vehicleNumber; ++i) {<NEW_LINE>logger.info("Route for Vehicle " + i + ":");<NEW_LINE>long routeDistance = 0;<NEW_LINE>String route = "";<NEW_LINE>long index = routing.start(i);<NEW_LINE>while (!routing.isEnd(index)) {<NEW_LINE>route += manager.indexToNode(index) + " -> ";<NEW_LINE>long previousIndex = index;<NEW_LINE>index = solution.value(routing.nextVar(index));<NEW_LINE>routeDistance += routing.getArcCostForVehicle(previousIndex, index, i);<NEW_LINE>}<NEW_LINE>route += manager.indexToNode(routing.end(i));<NEW_LINE>logger.info(route);<NEW_LINE>logger.info("Distance of the route: " + routeDistance + "m");<NEW_LINE>totalDistance += routeDistance;<NEW_LINE>}<NEW_LINE>logger.info("Total Distance of all routes: " + totalDistance + "m");<NEW_LINE>}
"Objective : " + solution.objectiveValue());
1,695,862
public void actionPerformed(ActionEvent e) {<NEW_LINE>JTextComponent textArea = (JTextComponent) e.getSource();<NEW_LINE>Caret caret = textArea.getCaret();<NEW_LINE>int dot = caret.getDot();<NEW_LINE>EditorPane currentCodePane = SikulixIDE.get().getCurrentCodePane();<NEW_LINE>int lineNumberAtCaret = currentCodePane.getLineNumberAtCaret(dot);<NEW_LINE>Element line = currentCodePane.getLineAtCaret(dot);<NEW_LINE>int count = line.getElementCount();<NEW_LINE>if (!select) {<NEW_LINE>switch(direction) {<NEW_LINE>case SwingConstants.EAST:<NEW_LINE>currentCodePane.jumpTo(lineNumberAtCaret + 1);<NEW_LINE>caret.setDot(<MASK><NEW_LINE>return;<NEW_LINE>case SwingConstants.WEST:<NEW_LINE>currentCodePane.jumpTo(lineNumberAtCaret);<NEW_LINE>return;<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>switch(direction) {<NEW_LINE>case SwingConstants.EAST:<NEW_LINE>try {<NEW_LINE>int startOffset = currentCodePane.getLineStartOffset(lineNumberAtCaret);<NEW_LINE>caret.moveDot(startOffset - 1);<NEW_LINE>} catch (BadLocationException e1) {<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>case SwingConstants.WEST:<NEW_LINE>try {<NEW_LINE>int startOffset = currentCodePane.getLineStartOffset(lineNumberAtCaret - 1);<NEW_LINE>caret.moveDot(startOffset);<NEW_LINE>} catch (BadLocationException e1) {<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
caret.getDot() - 1);
130,592
public static String trimIndent(String line, int indentUnitsToRemove, int tabWidth, int indentWidth) {<NEW_LINE>if (tabWidth < 0 || indentWidth < 0 || line == null) {<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>if (indentUnitsToRemove <= 0 || indentWidth == 0) {<NEW_LINE>return line;<NEW_LINE>}<NEW_LINE>final int spaceEquivalentsToRemove = indentUnitsToRemove * indentWidth;<NEW_LINE>int start = 0;<NEW_LINE>int spaceEquivalents = 0;<NEW_LINE>int size = line.length();<NEW_LINE>String prefix = null;<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>char <MASK><NEW_LINE>if (c == '\t') {<NEW_LINE>spaceEquivalents = calculateSpaceEquivalents(tabWidth, spaceEquivalents);<NEW_LINE>} else if (isIndentChar(c)) {<NEW_LINE>spaceEquivalents++;<NEW_LINE>} else {<NEW_LINE>// Assert.isTrue(false, "Line does not have requested number of indents");<NEW_LINE>start = i;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (spaceEquivalents == spaceEquivalentsToRemove) {<NEW_LINE>start = i + 1;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (spaceEquivalents > spaceEquivalentsToRemove) {<NEW_LINE>// can happen if tabSize > indentSize, e.g tabsize==8, indent==4, indentsToRemove==1, line prefixed with one tab<NEW_LINE>// this implements the third option<NEW_LINE>// remove the tab<NEW_LINE>start = i + 1;<NEW_LINE>// and add the missing spaces<NEW_LINE>char[] missing = new char[spaceEquivalents - spaceEquivalentsToRemove];<NEW_LINE>Arrays.fill(missing, ' ');<NEW_LINE>prefix = new String(missing);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String trimmed;<NEW_LINE>if (start == size)<NEW_LINE>trimmed = Util.EMPTY_STRING;<NEW_LINE>else<NEW_LINE>trimmed = line.substring(start);<NEW_LINE>if (prefix == null)<NEW_LINE>return trimmed;<NEW_LINE>return prefix + trimmed;<NEW_LINE>}
c = line.charAt(i);
920,686
public void execute(AdminCommandContext context) {<NEW_LINE>ActionReport report = context.getActionReport();<NEW_LINE>Logger logger = context.getLogger();<NEW_LINE>logger.info(Strings.get("stop.dg", deploymentGroup));<NEW_LINE>// Require that we be a DAS<NEW_LINE>if (!env.isDas()) {<NEW_LINE>String <MASK><NEW_LINE>logger.warning(msg);<NEW_LINE>report.setActionExitCode(ActionReport.ExitCode.FAILURE);<NEW_LINE>report.setMessage(msg);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ClusterCommandHelper clusterHelper = new ClusterCommandHelper(domain, runner);<NEW_LINE>ParameterMap map = null;<NEW_LINE>if (kill) {<NEW_LINE>map = new ParameterMap();<NEW_LINE>map.add("kill", "true");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// Run start-instance against each instance in the cluster<NEW_LINE>String commandName = "stop-instance";<NEW_LINE>clusterHelper.runCommand(commandName, map, deploymentGroup, context, verbose);<NEW_LINE>} catch (CommandException e) {<NEW_LINE>String msg = e.getLocalizedMessage();<NEW_LINE>logger.warning(msg);<NEW_LINE>report.setActionExitCode(ActionReport.ExitCode.FAILURE);<NEW_LINE>report.setMessage(msg);<NEW_LINE>}<NEW_LINE>}
msg = Strings.get("cluster.command.notDas");
834,396
public static void addPath(String path) throws MalformedURLException {<NEW_LINE><MASK><NEW_LINE>// Ensure that directory URLs end in "/"<NEW_LINE>if (file.isDirectory() && !path.endsWith("/")) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>// $NON-NLS-1$<NEW_LINE>file = new File(path + "/");<NEW_LINE>}<NEW_LINE>// See Java bug 4496398<NEW_LINE>loader.addURL(file.toURI().toURL());<NEW_LINE>StringBuilder sb = new StringBuilder(System.getProperty(JAVA_CLASS_PATH));<NEW_LINE>sb.append(CLASSPATH_SEPARATOR);<NEW_LINE>sb.append(path);<NEW_LINE>File[] jars = listJars(file);<NEW_LINE>for (File jar : jars) {<NEW_LINE>// See Java bug 4496398<NEW_LINE>loader.addURL(jar.toURI().toURL());<NEW_LINE>sb.append(CLASSPATH_SEPARATOR);<NEW_LINE>sb.append(jar.getPath());<NEW_LINE>}<NEW_LINE>// ClassFinder needs this<NEW_LINE>System.setProperty(JAVA_CLASS_PATH, sb.toString());<NEW_LINE>}
File file = new File(path);
1,575,399
private Object readArray() throws IOException {<NEW_LINE>JsonHandlerProvider provider = getHandlerProvider();<NEW_LINE>JsonArrayHandler handler = provider.getArrayHandler();<NEW_LINE>JsonConstant token;<NEW_LINE><MASK><NEW_LINE>int line = getLineNum();<NEW_LINE>int col = getColNum();<NEW_LINE>while ((token = next()) != ARRAY_END) {<NEW_LINE>if (token == WHITESPACE) {<NEW_LINE>// whoops. unterminated array.<NEW_LINE>throw new JsonStreamParseException(String.format("Unterminated array at %d:%d", getLineNum(), getColNum()), line, col);<NEW_LINE>}<NEW_LINE>// Any value<NEW_LINE>try {<NEW_LINE>handler.add(current);<NEW_LINE>} catch (JsonValidationException e) {<NEW_LINE>throw new JsonStreamParseException(e.getMessage(), String.valueOf(current), getLineNum(), getColNum(), e);<NEW_LINE>}<NEW_LINE>// comma<NEW_LINE>token = readComma(ARRAY_END);<NEW_LINE>if (token != ENTRY_SEPARATOR) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setHandlerProvider(provider);<NEW_LINE>assertTokenType(ARRAY_END, token);<NEW_LINE>return handler.getValue();<NEW_LINE>}
setHandlerProvider(provider.getArrayEntryHandlerProvider());
229,097
public List<IN> classifyGibbs(List<IN> document, Triple<int[][][], int[], double[][][]> documentDataAndLabels) throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException {<NEW_LINE>// log.info("Testing using Gibbs sampling.");<NEW_LINE>// reversed if necessary<NEW_LINE>List<IN> newDocument = document;<NEW_LINE>if (flags.useReverse) {<NEW_LINE>Collections.reverse(document);<NEW_LINE>newDocument <MASK><NEW_LINE>Collections.reverse(document);<NEW_LINE>}<NEW_LINE>CRFCliqueTree<? extends CharSequence> cliqueTree = getCliqueTree(documentDataAndLabels);<NEW_LINE>PriorModelFactory<IN> pmf = (PriorModelFactory<IN>) Class.forName(flags.priorModelFactory).newInstance();<NEW_LINE>ListeningSequenceModel prior = pmf.getInstance(flags.backgroundSymbol, classIndex, tagIndex, newDocument, entityMatrices, flags);<NEW_LINE>if (!flags.useUniformPrior) {<NEW_LINE>throw new RuntimeException("no prior specified");<NEW_LINE>}<NEW_LINE>SequenceModel model = new FactoredSequenceModel(cliqueTree, prior);<NEW_LINE>SequenceListener listener = new FactoredSequenceListener(cliqueTree, prior);<NEW_LINE>SequenceGibbsSampler sampler = new SequenceGibbsSampler(0, 0, listener);<NEW_LINE>int[] sequence = new int[cliqueTree.length()];<NEW_LINE>if (flags.initViterbi) {<NEW_LINE>TestSequenceModel testSequenceModel = new TestSequenceModel(cliqueTree);<NEW_LINE>ExactBestSequenceFinder tagInference = new ExactBestSequenceFinder();<NEW_LINE>int[] bestSequence = tagInference.bestSequence(testSequenceModel);<NEW_LINE>System.arraycopy(bestSequence, windowSize - 1, sequence, 0, sequence.length);<NEW_LINE>} else {<NEW_LINE>int[] initialSequence = SequenceGibbsSampler.getRandomSequence(model);<NEW_LINE>System.arraycopy(initialSequence, 0, sequence, 0, sequence.length);<NEW_LINE>}<NEW_LINE>sampler.verbose = 0;<NEW_LINE>if (flags.annealingType.equalsIgnoreCase("linear")) {<NEW_LINE>sequence = sampler.findBestUsingAnnealing(model, CoolingSchedule.getLinearSchedule(1.0, flags.numSamples), sequence);<NEW_LINE>} else if (flags.annealingType.equalsIgnoreCase("exp") || flags.annealingType.equalsIgnoreCase("exponential")) {<NEW_LINE>sequence = sampler.findBestUsingAnnealing(model, CoolingSchedule.getExponentialSchedule(1.0, flags.annealingRate, flags.numSamples), sequence);<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("No annealing type specified");<NEW_LINE>}<NEW_LINE>if (flags.useReverse) {<NEW_LINE>Collections.reverse(document);<NEW_LINE>}<NEW_LINE>for (int j = 0, dsize = newDocument.size(); j < dsize; j++) {<NEW_LINE>IN wi = document.get(j);<NEW_LINE>if (wi == null)<NEW_LINE>throw new RuntimeException("");<NEW_LINE>if (classIndex == null)<NEW_LINE>throw new RuntimeException("");<NEW_LINE>wi.set(CoreAnnotations.AnswerAnnotation.class, classIndex.get(sequence[j]));<NEW_LINE>}<NEW_LINE>if (flags.useReverse) {<NEW_LINE>Collections.reverse(document);<NEW_LINE>}<NEW_LINE>return document;<NEW_LINE>}
= new ArrayList<>(document);
519,516
final ListIngestionsResult executeListIngestions(ListIngestionsRequest listIngestionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listIngestionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListIngestionsRequest> request = null;<NEW_LINE>Response<ListIngestionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListIngestionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listIngestionsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "QuickSight");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListIngestions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListIngestionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListIngestionsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
877,056
protected void activateSpecialAction(Game game, ManaCost unpaidForManaAction) {<NEW_LINE>if (gameInCheckPlayableState(game)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!canRespond()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<UUID, SpecialAction> specialActions = game.getState().getSpecialActions().<MASK><NEW_LINE>if (!specialActions.isEmpty()) {<NEW_LINE>updateGameStatePriority("specialAction", game);<NEW_LINE>prepareForResponse(game);<NEW_LINE>if (!isExecutingMacro()) {<NEW_LINE>game.fireGetChoiceEvent(playerId, name, null, new ArrayList<>(specialActions.values()));<NEW_LINE>}<NEW_LINE>waitForResponse(game);<NEW_LINE>UUID responseId = getFixedResponseUUID(game);<NEW_LINE>if (responseId != null) {<NEW_LINE>if (specialActions.containsKey(responseId)) {<NEW_LINE>SpecialAction specialAction = specialActions.get(responseId);<NEW_LINE>if (unpaidForManaAction != null) {<NEW_LINE>specialAction.setUnpaidMana(unpaidForManaAction);<NEW_LINE>}<NEW_LINE>activateAbility(specialAction, game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getControlledBy(playerId, unpaidForManaAction != null);
957,040
private Boolean testConnection() throws ResourceException {<NEW_LINE>final boolean trace = TraceComponent.isAnyTracingEnabled();<NEW_LINE>if (trace && tc.isEntryEnabled())<NEW_LINE>Tr.<MASK><NEW_LINE>try {<NEW_LINE>Boolean result = AccessController.doPrivileged(new PrivilegedExceptionAction<Boolean>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Boolean run() throws Exception {<NEW_LINE>return (Boolean) mc.getClass().getMethod("testConnection").invoke(mc);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (trace && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "testConnection", result);<NEW_LINE>return result;<NEW_LINE>} catch (PrivilegedActionException x) {<NEW_LINE>Throwable cause = x.getCause();<NEW_LINE>if (cause instanceof IllegalAccessException || cause instanceof NoSuchMethodException || cause instanceof SecurityException) {<NEW_LINE>if (trace && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "testConnection", "method unavailable");<NEW_LINE>return null;<NEW_LINE>} else if (cause instanceof InvocationTargetException) {<NEW_LINE>cause = cause.getCause();<NEW_LINE>}<NEW_LINE>if (trace && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "testConnection", cause);<NEW_LINE>if (cause instanceof ResourceException)<NEW_LINE>throw (ResourceException) cause;<NEW_LINE>if (cause instanceof RuntimeException)<NEW_LINE>throw (RuntimeException) cause;<NEW_LINE>if (cause instanceof Error)<NEW_LINE>throw (Error) cause;<NEW_LINE>else<NEW_LINE>throw new ResourceAllocationException(cause);<NEW_LINE>}<NEW_LINE>}
entry(this, tc, "testConnection");
1,577,923
static void c_1() throws Exception {<NEW_LINE>BatchOperator<?> train_data = new AkSourceBatchOp().setFilePath(DATA_DIR <MASK><NEW_LINE>BatchOperator<?> test_data = new AkSourceBatchOp().setFilePath(DATA_DIR + TEST_FILE).select(CLAUSE_CREATE_FEATURES);<NEW_LINE>String[] new_features = ArrayUtils.removeElement(train_data.getColNames(), LABEL_COL_NAME);<NEW_LINE>train_data.lazyPrint(5, "< new features >");<NEW_LINE>LogisticRegressionTrainBatchOp trainer = new LogisticRegressionTrainBatchOp().setFeatureCols(new_features).setLabelCol(LABEL_COL_NAME);<NEW_LINE>LogisticRegressionPredictBatchOp predictor = new LogisticRegressionPredictBatchOp().setPredictionCol(PREDICTION_COL_NAME).setPredictionDetailCol(PRED_DETAIL_COL_NAME);<NEW_LINE>train_data.link(trainer);<NEW_LINE>predictor.linkFrom(trainer, test_data);<NEW_LINE>trainer.lazyPrintTrainInfo().lazyCollectTrainInfo(new Consumer<LinearModelTrainInfo>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void accept(LinearModelTrainInfo linearModelTrainInfo) {<NEW_LINE>printImportance(linearModelTrainInfo.getColNames(), linearModelTrainInfo.getImportance());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>predictor.link(new EvalBinaryClassBatchOp().setPositiveLabelValueString("2").setLabelCol(LABEL_COL_NAME).setPredictionDetailCol(PRED_DETAIL_COL_NAME).lazyPrintMetrics());<NEW_LINE>BatchOperator.execute();<NEW_LINE>}
+ TRAIN_FILE).select(CLAUSE_CREATE_FEATURES);
923,159
private List<Node> provision(NodeList nodeList) {<NEW_LINE>final List<Node> nodes = new ArrayList<>(provisionUntilNoDeficit(nodeList));<NEW_LINE>Map<String, Node> sharedHosts = new HashMap<>(findSharedHosts(nodeList));<NEW_LINE>int minCount = sharedHostFlag.value().getMinCount();<NEW_LINE>int deficit = minCount - sharedHosts.size();<NEW_LINE>if (deficit > 0) {<NEW_LINE>provisionHosts(deficit, NodeResources.unspecified()).forEach(host -> {<NEW_LINE>sharedHosts.put(host.hostname(), host);<NEW_LINE>nodes.add(host);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return candidatesForRemoval(nodes).stream().sorted(Comparator.comparing(node -> node.history().events().stream().map(History.Event::at).min(Comparator.naturalOrder()).orElse(Instant.MIN))).filter(node -> {<NEW_LINE>if (!sharedHosts.containsKey(node.hostname()) || sharedHosts.size() > minCount) {<NEW_LINE>sharedHosts.remove(node.hostname());<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}).<MASK><NEW_LINE>}
collect(Collectors.toList());
552,537
public JsonObject toJson() {<NEW_LINE>JsonObject json = new JsonObject();<NEW_LINE>json.addProperty("createdAt", this.eventSessionEnd.getStartTime());<NEW_LINE>json.addProperty("destroyedAt", this.eventSessionEnd.getTimestamp());<NEW_LINE>json.addProperty("sessionId", this.eventSessionEnd.getSessionId());<NEW_LINE>json.addProperty("uniqueSessionId", this.eventSessionEnd.getUniqueSessionId());<NEW_LINE>json.addProperty("customSessionId", this.eventSessionEnd.getSession().getSessionProperties().customSessionId());<NEW_LINE>json.addProperty("mediaMode", this.eventSessionEnd.getSession().getSessionProperties().mediaMode().name());<NEW_LINE>json.addProperty("recordingMode", this.eventSessionEnd.getSession().getSessionProperties().<MASK><NEW_LINE>long duration = (this.eventSessionEnd.getTimestamp() - this.eventSessionEnd.getStartTime()) / 1000;<NEW_LINE>json.addProperty("duration", duration);<NEW_LINE>json.addProperty("reason", this.eventSessionEnd.getReason() != null ? this.eventSessionEnd.getReason().name() : "");<NEW_LINE>// Final users<NEW_LINE>JsonObject usersJson = new JsonObject();<NEW_LINE>usersJson.addProperty("numberOfElements", users.size());<NEW_LINE>JsonArray jsonArray = new JsonArray();<NEW_LINE>users.values().forEach(finalUser -> {<NEW_LINE>jsonArray.add(finalUser.toJson());<NEW_LINE>});<NEW_LINE>usersJson.add("content", jsonArray);<NEW_LINE>json.add("users", usersJson);<NEW_LINE>// Accumulated recordings<NEW_LINE>JsonObject recordingsJson = new JsonObject();<NEW_LINE>recordingsJson.addProperty("numberOfElements", recordings.size());<NEW_LINE>JsonArray jsonRecordingsArray = new JsonArray();<NEW_LINE>recordings.forEach(rec -> {<NEW_LINE>jsonRecordingsArray.add(rec.toJson());<NEW_LINE>});<NEW_LINE>recordingsJson.add("content", jsonRecordingsArray);<NEW_LINE>json.add("recordings", recordingsJson);<NEW_LINE>return json;<NEW_LINE>}
recordingMode().name());
800,268
public final SelectClauseContext selectClause() throws RecognitionException {<NEW_LINE>SelectClauseContext _localctx = new SelectClauseContext(_ctx, getState());<NEW_LINE><MASK><NEW_LINE>paraphrases.push("select clause");<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(1602);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>switch(getInterpreter().adaptivePredict(_input, 183, _ctx)) {<NEW_LINE>case 1:<NEW_LINE>{<NEW_LINE>setState(1599);<NEW_LINE>((SelectClauseContext) _localctx).s = match(RSTREAM);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>{<NEW_LINE>setState(1600);<NEW_LINE>((SelectClauseContext) _localctx).s = match(ISTREAM);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>{<NEW_LINE>setState(1601);<NEW_LINE>((SelectClauseContext) _localctx).s = match(IRSTREAM);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>setState(1605);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (_la == DISTINCT) {<NEW_LINE>{<NEW_LINE>setState(1604);<NEW_LINE>((SelectClauseContext) _localctx).d = match(DISTINCT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(1607);<NEW_LINE>selectionList();<NEW_LINE>}<NEW_LINE>_ctx.stop = _input.LT(-1);<NEW_LINE>paraphrases.pop();<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
enterRule(_localctx, 204, RULE_selectClause);
567,253
public static void main(String[] args) {<NEW_LINE>Scanner sc = new Scanner(System.in);<NEW_LINE>System.out.println("Enter the number of points:");<NEW_LINE>int N = sc.nextInt();<NEW_LINE>ArrayList<Point> points = new ArrayList<Point>();<NEW_LINE>System.out.println("Enter the coordinates: X Y");<NEW_LINE>for (int i = 0; i < N; i++) {<NEW_LINE><MASK><NEW_LINE>int y = sc.nextInt();<NEW_LINE>Point e = new Point(x, y);<NEW_LINE>points.add(i, e);<NEW_LINE>}<NEW_LINE>QuickHull qh = new QuickHull();<NEW_LINE>ArrayList<Point> point = qh.quickHull(points);<NEW_LINE>System.out.println("The points in the Convex hull using Quick Hull are: ");<NEW_LINE>for (int i = 0; i < point.size(); i++) System.out.println("(" + point.get(i).x + ", " + point.get(i).y + ")");<NEW_LINE>sc.close();<NEW_LINE>}
int x = sc.nextInt();
1,538,654
public void connect(Callback callback, Activity activity) {<NEW_LINE>if (!connected) {<NEW_LINE>BluetoothDevice device = getDevice();<NEW_LINE>this.connectCallback = callback;<NEW_LINE>this.connecting = true;<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {<NEW_LINE>Log.d(BleManager.LOG_TAG, " Is Or Greater than M $mBluetoothDevice");<NEW_LINE>gatt = device.connectGatt(activity, <MASK><NEW_LINE>} else {<NEW_LINE>Log.d(BleManager.LOG_TAG, " Less than M");<NEW_LINE>try {<NEW_LINE>Log.d(BleManager.LOG_TAG, " Trying TRANPORT LE with reflection");<NEW_LINE>Method m = device.getClass().getDeclaredMethod("connectGatt", Context.class, Boolean.class, BluetoothGattCallback.class, Integer.class);<NEW_LINE>m.setAccessible(true);<NEW_LINE>Integer transport = device.getClass().getDeclaredField("TRANSPORT_LE").getInt(null);<NEW_LINE>gatt = (BluetoothGatt) m.invoke(device, activity, false, this, transport);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>Log.d(TAG, " Catch to call normal connection");<NEW_LINE>gatt = device.connectGatt(activity, false, this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (gatt != null) {<NEW_LINE>callback.invoke();<NEW_LINE>} else {<NEW_LINE>callback.invoke("BluetoothGatt is null");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
false, this, BluetoothDevice.TRANSPORT_LE);
256,805
public Object readFrom(Input input, Object owner) throws IOException {<NEW_LINE>if (ID_ARRAY_LEN != input.readFieldNumber(this))<NEW_LINE>throw new ProtostuffException("Corrupt input.");<NEW_LINE>final <MASK><NEW_LINE>Object[] array = (Object[]) Array.newInstance(delegate.typeClass(), len);<NEW_LINE>if (input instanceof GraphInput) {<NEW_LINE>// update the actual reference.<NEW_LINE>((GraphInput) input).updateLast(array, owner);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < len; ) {<NEW_LINE>switch(input.readFieldNumber(this)) {<NEW_LINE>case ID_ARRAY_DATA:<NEW_LINE>array[i++] = delegate.readFrom(input);<NEW_LINE>break;<NEW_LINE>case ID_ARRAY_NULLCOUNT:<NEW_LINE>i += input.readUInt32();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new ProtostuffException("Corrupt input.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (0 != input.readFieldNumber(this))<NEW_LINE>throw new ProtostuffException("Corrupt input.");<NEW_LINE>return array;<NEW_LINE>}
int len = input.readInt32();
1,684,454
static Pair.NonNull<TextRange, LinesCols> translateViaDiff(@Nonnull final DocumentEventImpl event, @Nonnull LinesCols linesCols) {<NEW_LINE>try {<NEW_LINE>int myStartLine = event.translateLineViaDiffStrict(linesCols.myStartLine);<NEW_LINE>Document document = event.getDocument();<NEW_LINE>if (myStartLine < 0 || myStartLine >= document.getLineCount()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int start = document.getLineStartOffset(myStartLine) + linesCols.myStartColumn;<NEW_LINE>if (start >= document.getTextLength())<NEW_LINE>return null;<NEW_LINE>int myEndLine = <MASK><NEW_LINE>if (myEndLine < 0 || myEndLine >= document.getLineCount()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int end = document.getLineStartOffset(myEndLine) + linesCols.myEndColumn;<NEW_LINE>if (end > document.getTextLength() || end < start)<NEW_LINE>return null;<NEW_LINE>if (end > event.getDocument().getTextLength() || myEndLine < myStartLine || myStartLine == myEndLine && linesCols.myEndColumn < linesCols.myStartColumn || event.getDocument().getLineCount() < myEndLine) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return Pair.createNonNull(new TextRange(start, end), new LinesCols(myStartLine, linesCols.myStartColumn, myEndLine, linesCols.myEndColumn));<NEW_LINE>} catch (FilesTooBigForDiffException e) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
event.translateLineViaDiffStrict(linesCols.myEndLine);
1,064,321
public BytesReference slice(int from, int length) {<NEW_LINE>FutureObjects.checkFromIndexSize(from, length, this.length);<NEW_LINE>if (length == 0) {<NEW_LINE>return BytesArray.EMPTY;<NEW_LINE>}<NEW_LINE>// for slices we only need to find the start and the end reference<NEW_LINE>// adjust them and pass on the references in between as they are fully contained<NEW_LINE>final int to = from + length;<NEW_LINE>final int limit = getOffsetIndex(to - 1);<NEW_LINE>final int start = getOffsetIndex(from);<NEW_LINE>final BytesReference[] inSlice = new BytesReference[1 + (limit - start)];<NEW_LINE>for (int i = 0, j = start; i < inSlice.length; i++) {<NEW_LINE>inSlice[i] = references[j++];<NEW_LINE>}<NEW_LINE>int inSliceOffset = from - offsets[start];<NEW_LINE>if (inSlice.length == 1) {<NEW_LINE>return inSlice[0<MASK><NEW_LINE>}<NEW_LINE>// now adjust slices in front and at the end<NEW_LINE>inSlice[0] = inSlice[0].slice(inSliceOffset, inSlice[0].length() - inSliceOffset);<NEW_LINE>inSlice[inSlice.length - 1] = inSlice[inSlice.length - 1].slice(0, to - offsets[limit]);<NEW_LINE>return new CompositeBytesReference(inSlice);<NEW_LINE>}
].slice(inSliceOffset, length);
957,583
public void before(Object target, Object[] args) {<NEW_LINE>if (isDebug) {<NEW_LINE>logger.beforeInterceptor(target, args);<NEW_LINE>}<NEW_LINE>final Trace trace = traceContext.currentTraceObject();<NEW_LINE>if (trace == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final InterceptorScopeInvocation invocation = interceptorScope.getCurrentInvocation();<NEW_LINE>final Object attachment = getAttachment(invocation);<NEW_LINE>if (attachment instanceof CommandContext) {<NEW_LINE>final CommandContext commandContext = (CommandContext) attachment;<NEW_LINE>if (methodDescriptor.getMethodName().equals("sendCommand")) {<NEW_LINE>commandContext.setWriteBeginTime(System.currentTimeMillis());<NEW_LINE>} else {<NEW_LINE>commandContext.setReadBeginTime(System.currentTimeMillis());<NEW_LINE>}<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("Set command context {}", commandContext);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>logger.warn("Failed to BEFORE process. {}", <MASK><NEW_LINE>}<NEW_LINE>}
t.getMessage(), t);
259,262
// todo this doesn't export data for onions that orbot hosts which have authentication (not supported yet...)<NEW_LINE>private String[] createFilesForZippingV3(String relativePath) {<NEW_LINE>final String v3BasePath = getV3BasePath() + "/" + relativePath + "/";<NEW_LINE>final String hostnamePath = v3BasePath + "hostname", configFilePath = v3BasePath + configFileName, privKeyPath = v3BasePath <MASK><NEW_LINE>Cursor portData = mResolver.query(OnionServiceContentProvider.CONTENT_URI, OnionServiceContentProvider.PROJECTION, OnionServiceContentProvider.OnionService.PATH + "=\"" + relativePath + "\"", null, null);<NEW_LINE>JSONObject config = new JSONObject();<NEW_LINE>try {<NEW_LINE>if (portData == null || portData.getCount() != 1)<NEW_LINE>return null;<NEW_LINE>portData.moveToNext();<NEW_LINE>config.put(OnionServiceContentProvider.OnionService.NAME, portData.getString(portData.getColumnIndex(OnionServiceContentProvider.OnionService.NAME)));<NEW_LINE>config.put(OnionServiceContentProvider.OnionService.PORT, portData.getString(portData.getColumnIndex(OnionServiceContentProvider.OnionService.PORT)));<NEW_LINE>config.put(OnionServiceContentProvider.OnionService.ONION_PORT, portData.getString(portData.getColumnIndex(OnionServiceContentProvider.OnionService.ONION_PORT)));<NEW_LINE>config.put(OnionServiceContentProvider.OnionService.DOMAIN, portData.getString(portData.getColumnIndex(OnionServiceContentProvider.OnionService.DOMAIN)));<NEW_LINE>config.put(OnionServiceContentProvider.OnionService.CREATED_BY_USER, portData.getString(portData.getColumnIndex(OnionServiceContentProvider.OnionService.CREATED_BY_USER)));<NEW_LINE>config.put(OnionServiceContentProvider.OnionService.ENABLED, portData.getString(portData.getColumnIndex(OnionServiceContentProvider.OnionService.ENABLED)));<NEW_LINE>portData.close();<NEW_LINE>FileWriter fileWriter = new FileWriter(configFilePath);<NEW_LINE>fileWriter.write(config.toString());<NEW_LINE>fileWriter.close();<NEW_LINE>} catch (JSONException | IOException ioe) {<NEW_LINE>ioe.printStackTrace();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return new String[] { hostnamePath, configFilePath, privKeyPath, pubKeyPath };<NEW_LINE>}
+ "hs_ed25519_secret_key", pubKeyPath = v3BasePath + "hs_ed25519_public_key";
1,717,747
public Mono<Void> writeWith(final ServerWebExchange exchange, final ShenyuPluginChain chain) {<NEW_LINE>return chain.execute(exchange).then(Mono.defer(() -> {<NEW_LINE>ServerHttpResponse response = exchange.getResponse();<NEW_LINE>ClientResponse clientResponse = exchange.getAttribute(Constants.CLIENT_RESPONSE_ATTR);<NEW_LINE>if (Objects.isNull(clientResponse)) {<NEW_LINE>Object error = ShenyuResultWrap.error(<MASK><NEW_LINE>return WebFluxResultUtils.result(exchange, error);<NEW_LINE>}<NEW_LINE>response.getCookies().putAll(clientResponse.cookies());<NEW_LINE>response.getHeaders().putAll(clientResponse.headers().asHttpHeaders());<NEW_LINE>// image, pdf or stream does not do format processing.<NEW_LINE>if (clientResponse.headers().contentType().isPresent()) {<NEW_LINE>final String media = clientResponse.headers().contentType().get().toString().toLowerCase();<NEW_LINE>if (media.matches(COMMON_BIN_MEDIA_TYPE_REGEX)) {<NEW_LINE>return response.writeWith(clientResponse.body(BodyExtractors.toDataBuffers())).doOnCancel(() -> clean(exchange));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>clientResponse = ResponseUtils.buildClientResponse(response, clientResponse.body(BodyExtractors.toDataBuffers()));<NEW_LINE>return clientResponse.bodyToMono(byte[].class).flatMap(originData -> WebFluxResultUtils.result(exchange, originData)).doOnCancel(() -> clean(exchange));<NEW_LINE>}));<NEW_LINE>}
exchange, ShenyuResultEnum.SERVICE_RESULT_ERROR, null);
120,731
private Mono<Response<Void>> deleteWithResponseAsync(String resourceGroupName, String accountName, String creatorName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (accountName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (creatorName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter creatorName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, creatorName, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
1,580,357
public void handleResolvedAddresses(ResolvedAddresses resolvedAddresses) {<NEW_LINE>logger.log(XdsLogLevel.DEBUG, "Received resolution result: {0}", resolvedAddresses);<NEW_LINE>ClusterManagerConfig config = (ClusterManagerConfig) resolvedAddresses.getLoadBalancingPolicyConfig();<NEW_LINE>Map<String, PolicySelection> newChildPolicies = config.childPolicies;<NEW_LINE>logger.log(XdsLogLevel.INFO, "Received cluster_manager lb config: child names={0}", newChildPolicies.keySet());<NEW_LINE>for (Map.Entry<String, PolicySelection> entry : newChildPolicies.entrySet()) {<NEW_LINE>final String name = entry.getKey();<NEW_LINE>LoadBalancerProvider childPolicyProvider = entry.getValue().getProvider();<NEW_LINE>Object childConfig = entry.getValue().getConfig();<NEW_LINE>if (!childLbStates.containsKey(name)) {<NEW_LINE>childLbStates.put(name, new ChildLbState(name, childPolicyProvider));<NEW_LINE>} else {<NEW_LINE>childLbStates.get(name).reactivate(childPolicyProvider);<NEW_LINE>}<NEW_LINE>LoadBalancer childLb = childLbStates.get(name).lb;<NEW_LINE>ResolvedAddresses childAddresses = resolvedAddresses.toBuilder().<MASK><NEW_LINE>childLb.handleResolvedAddresses(childAddresses);<NEW_LINE>}<NEW_LINE>for (String name : childLbStates.keySet()) {<NEW_LINE>if (!newChildPolicies.containsKey(name)) {<NEW_LINE>childLbStates.get(name).deactivate();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Must update channel picker before return so that new RPCs will not be routed to deleted<NEW_LINE>// clusters and resolver can remove them in service config.<NEW_LINE>updateOverallBalancingState();<NEW_LINE>}
setLoadBalancingPolicyConfig(childConfig).build();
358,904
public static void main(String[] args) {<NEW_LINE>FlowNetwork flowNetwork = new FlowNetwork(7);<NEW_LINE>// Path 1 from source to target<NEW_LINE>flowNetwork.addEdge(new FlowEdge(0, 1, 5));<NEW_LINE>flowNetwork.addEdge(new FlowEdge(1, 4, 4));<NEW_LINE>flowNetwork.addEdge(new FlowEdge(4, 6, 3));<NEW_LINE>// Path 2 from source to target<NEW_LINE>flowNetwork.addEdge(new FlowEdge<MASK><NEW_LINE>flowNetwork.addEdge(new FlowEdge(2, 5, 10));<NEW_LINE>flowNetwork.addEdge(new FlowEdge(5, 6, 7));<NEW_LINE>// Path 3 from source to target<NEW_LINE>flowNetwork.addEdge(new FlowEdge(0, 3, 2));<NEW_LINE>flowNetwork.addEdge(new FlowEdge(3, 6, 2));<NEW_LINE>int source = 0;<NEW_LINE>int target = 6;<NEW_LINE>double maxflow = new Exercise37().getMaxFlow(flowNetwork, source, target);<NEW_LINE>StdOut.println("Max flow: " + maxflow);<NEW_LINE>StdOut.println("Expected: 12.0");<NEW_LINE>}
(0, 2, 8));
508,592
public com.amazonaws.services.mgn.model.ResourceNotFoundException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.mgn.model.ResourceNotFoundException resourceNotFoundException = new com.amazonaws.services.mgn.model.ResourceNotFoundException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("code", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>resourceNotFoundException.setCode(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("resourceId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>resourceNotFoundException.setResourceId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("resourceType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>resourceNotFoundException.setResourceType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return resourceNotFoundException;<NEW_LINE>}
class).unmarshall(context));
156,756
public static boolean showAcceptDialog(@Nonnull final Callable<? extends DialogWrapper> dialogFactory) {<NEW_LINE>Application app = ApplicationManager.getApplication();<NEW_LINE>final CountDownLatch proceeded = new CountDownLatch(1);<NEW_LINE>final AtomicBoolean accepted = new AtomicBoolean();<NEW_LINE>final AtomicReference<DialogWrapper> dialogRef = new AtomicReference<DialogWrapper>();<NEW_LINE>Runnable showDialog = new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>// skip if certificate was already rejected due to timeout or interrupt<NEW_LINE>if (proceeded.getCount() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>DialogWrapper dialog = dialogFactory.call();<NEW_LINE>dialogRef.set(dialog);<NEW_LINE>accepted.set(dialog.showAndGet());<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error(e);<NEW_LINE>} finally {<NEW_LINE>proceeded.countDown();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>if (app.isDispatchThread()) {<NEW_LINE>showDialog.run();<NEW_LINE>} else {<NEW_LINE>app.invokeLater(<MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// IDEA-123467 and IDEA-123335 workaround<NEW_LINE>boolean inTime = proceeded.await(DIALOG_VISIBILITY_TIMEOUT, TimeUnit.MILLISECONDS);<NEW_LINE>if (!inTime) {<NEW_LINE>DialogWrapper dialog = dialogRef.get();<NEW_LINE>if (dialog == null || !dialog.isShowing()) {<NEW_LINE>LOG.debug("After " + DIALOG_VISIBILITY_TIMEOUT + " ms dialog was not shown. " + "Rejecting certificate. Current thread: " + Thread.currentThread().getName());<NEW_LINE>proceeded.countDown();<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>// if dialog is already shown continue waiting<NEW_LINE>proceeded.await();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>proceeded.countDown();<NEW_LINE>}<NEW_LINE>return accepted.get();<NEW_LINE>}
showDialog, ModalityState.any());
1,273,839
public InputStream asInputStream(DiscordApi api) throws IOException {<NEW_LINE>if (fileAsBufferedImage != null) {<NEW_LINE>PipedOutputStream pos = new PipedOutputStream();<NEW_LINE><MASK><NEW_LINE>api.getThreadPool().getExecutorService().submit(() -> {<NEW_LINE>try {<NEW_LINE>ImageIO.write(fileAsBufferedImage, getFileType(), pos);<NEW_LINE>pos.close();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>logger.error("Failed to process buffered image file!", t);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return pis;<NEW_LINE>}<NEW_LINE>if (fileAsFile != null) {<NEW_LINE>return new FileInputStream(fileAsFile);<NEW_LINE>}<NEW_LINE>if (fileAsIcon != null || fileAsUrl != null) {<NEW_LINE>URL url = fileAsUrl == null ? fileAsIcon.getUrl() : fileAsUrl;<NEW_LINE>HttpURLConnection conn = (HttpURLConnection) url.openConnection();<NEW_LINE>conn.setRequestMethod("GET");<NEW_LINE>conn.setRequestProperty("Content-Type", "application/json; charset=utf-8");<NEW_LINE>conn.setRequestProperty("User-Agent", Javacord.USER_AGENT);<NEW_LINE>return conn.getInputStream();<NEW_LINE>}<NEW_LINE>if (fileAsByteArray != null) {<NEW_LINE>return new ByteArrayInputStream(fileAsByteArray);<NEW_LINE>}<NEW_LINE>if (fileAsInputStream != null) {<NEW_LINE>return fileAsInputStream;<NEW_LINE>}<NEW_LINE>throw new IllegalStateException("No file variant is set");<NEW_LINE>}
PipedInputStream pis = new PipedInputStream(pos);
1,558,128
// Check the referred column of the expression<NEW_LINE>private Void visitColumnComparisonExpression(final UnqualifiedColumnReferenceExp column, final ComparisonExpression node) {<NEW_LINE>final ColumnName columnName = column.getColumnName();<NEW_LINE>if (columnName.equals(SystemColumns.WINDOWSTART_NAME) || columnName.equals(SystemColumns.WINDOWEND_NAME)) {<NEW_LINE>final Type type = node.getType();<NEW_LINE>if (!VALID_WINDOW_BOUND_COMPARISONS.contains(type)) {<NEW_LINE>throw invalidWhereClauseException("Unsupported " + <MASK><NEW_LINE>}<NEW_LINE>if (!isWindowed) {<NEW_LINE>throw invalidWhereClauseException("Cannot use WINDOWSTART/WINDOWEND on non-windowed source", false);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>final Column col = schema.findColumn(columnName).orElseThrow(() -> invalidWhereClauseException("Bound on non-existent column " + columnName, isWindowed));<NEW_LINE>if (col.namespace() == Namespace.KEY) {<NEW_LINE>if (!isKeyQuery(node)) {<NEW_LINE>setTableScanOrElseThrow(() -> invalidWhereClauseException("Bound on key columns '" + getSource().getSchema().key() + "' must currently be '='", isWindowed));<NEW_LINE>}<NEW_LINE>if (seenKeys.get(col.index()) && !queryPlannerOptions.getTableScansEnabled()) {<NEW_LINE>throw invalidWhereClauseException("A comparison condition on the key column cannot be combined with other" + " comparisons such as an IN predicate", isWindowed);<NEW_LINE>}<NEW_LINE>seenKeys.set(col.index());<NEW_LINE>isKeyedQuery = true;<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
columnName + " bounds: " + type, true);
362,441
public static void addAutoLoginServer(String addr, String id, String encryptedPass, String socksAddr) {<NEW_LINE>String addrs = PManager.getInstance().getString(PreferenceConstants.P_SVR_AUTOLOGIN_LIST);<NEW_LINE>if (StringUtil.isEmpty(addrs)) {<NEW_LINE>PManager.getInstance().setValue(PreferenceConstants.P_SVR_AUTOLOGIN_LIST, addr);<NEW_LINE>} else {<NEW_LINE>if (addrs.contains(addr) == false) {<NEW_LINE>addrs += (PreferenceConstants.P_SVR_DIVIDER + addr);<NEW_LINE>PManager.getInstance().setValue(PreferenceConstants.P_SVR_AUTOLOGIN_LIST, addrs);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String socksAddrs = PManager.getInstance().getString(PreferenceConstants.P_SOCKS_SVR_AUTOLOGIN_LIST);<NEW_LINE>if (StringUtil.isEmpty(socksAddrs)) {<NEW_LINE>PManager.getInstance().setValue(PreferenceConstants.P_SOCKS_SVR_AUTOLOGIN_LIST, socksAddr);<NEW_LINE>} else {<NEW_LINE>if (socksAddrs.contains(socksAddr) == false) {<NEW_LINE>socksAddrs <MASK><NEW_LINE>PManager.getInstance().setValue(PreferenceConstants.P_SOCKS_SVR_AUTOLOGIN_LIST, socksAddrs);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>PManager.getInstance().setValue(PreferenceConstants.P_SVR_ACCOUNT_PREFIX + addr, id + PreferenceConstants.P_SVR_DIVIDER + encryptedPass);<NEW_LINE>PManager.getInstance().setValue(PreferenceConstants.P_SOCKS_SVR_ADDR_PREFIX + addr, socksAddr);<NEW_LINE>}
+= (PreferenceConstants.P_SVR_DIVIDER + socksAddr);
491,325
public boolean onLongClick(View v) {<NEW_LINE>if (!isMultiple) {<NEW_LINE>isMultiple = true;<NEW_LINE>chosen = new ArrayList<>();<NEW_LINE>chosen.add(origPos);<NEW_LINE>doNewToolbar();<NEW_LINE>holder.itemView.setBackgroundColor(Palette.getDarkerColor(Palette.getDefaultAccent()));<NEW_LINE>holder.<MASK><NEW_LINE>} else if (chosen.contains(origPos)) {<NEW_LINE>holder.itemView.setBackgroundColor(Color.TRANSPARENT);<NEW_LINE>// set the color of the text back to what it should be<NEW_LINE>holder.text.setTextColor(textColor);<NEW_LINE>chosen.remove(origPos);<NEW_LINE>if (chosen.isEmpty()) {<NEW_LINE>isMultiple = false;<NEW_LINE>doOldToolbar();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>chosen.add(origPos);<NEW_LINE>holder.itemView.setBackgroundColor(Palette.getDarkerColor(Palette.getDefaultAccent()));<NEW_LINE>holder.text.setTextColor(textColor);<NEW_LINE>updateToolbar();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
text.setTextColor(Color.WHITE);
1,269,561
private <T extends Markable> void addPins(boolean removeViews, List<T> countries, T selectedCountry) {<NEW_LINE>if (removeViews) {<NEW_LINE>mapView.getMarkerLayout().removeAllViews();<NEW_LINE>removePaths();<NEW_LINE>}<NEW_LINE>List<T> countriesCopy = sortPins(countries);<NEW_LINE>for (Markable country : countriesCopy) {<NEW_LINE>ImageView marker = new ImageView(getContext());<NEW_LINE>marker.setTag(country);<NEW_LINE>TranslatedCoordinates coordinates = country.getCoordinates();<NEW_LINE>int selectedResource = country.equals(selectedCountry) ? R.drawable.ic_marker_secure_core_pressed : R.drawable.ic_marker_secure_core;<NEW_LINE>int selectedMarker = stateMonitor.isConnectedToAny(country.getConnectableServers()) ? R.drawable.ic_marker_colored : userData.hasAccessToAnyServer(country.getConnectableServers()) ? R.drawable.ic_marker_available : R.drawable.ic_marker;<NEW_LINE>if ((country.equals(selectedCountry)) && userData.isSecureCoreEnabled() && country.isSecureCoreMarker()) {<NEW_LINE>secureCoreMarker = marker;<NEW_LINE>}<NEW_LINE>if (secureCoreMarker != null) {<NEW_LINE>marker.setSelected(secureCoreMarker.getTag() == marker.getTag() || (marker.getTag().toString().contains(((VpnCountry) secureCoreMarker.getTag()).getCountryName())));<NEW_LINE>}<NEW_LINE>marker.setContentDescription(markerContentDescription(country, stateMonitor.isConnectedToAny(country.getConnectableServers()) <MASK><NEW_LINE>marker.setImageResource(userData.isSecureCoreEnabled() && country.isSecureCoreMarker() ? selectedResource : selectedMarker);<NEW_LINE>if (country.getCoordinates().hasValidCoordinates()) {<NEW_LINE>mapView.addMarker(marker, coordinates.getPositionX(), coordinates.getPositionY(), -0.5f, userData.isSecureCoreEnabled() && country.isSecureCoreMarker() ? -0.5f : -1.0f);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|| marker.isSelected()));
19,430
public void showDetail(final int how) {<NEW_LINE>prepareLine();<NEW_LINE>if (lineObj == null) {<NEW_LINE>Toolkit.getDefaultToolkit().beep();<NEW_LINE>EditCookie ed = dobj.getLookup(<MASK><NEW_LINE>if (ed != null) {<NEW_LINE>ed.edit();<NEW_LINE>// show correct line later<NEW_LINE>showAfterDataObjectUpdated = true;<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (how == DH_HIDE) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final EditorCookie edCookie = dobj.getLookup().lookup(EditorCookie.class);<NEW_LINE>if (edCookie != null) {<NEW_LINE>// #227989<NEW_LINE>Task prepareTask = edCookie.prepareDocument();<NEW_LINE>prepareTask.addTaskListener((Task task) -> {<NEW_LINE>EventQueue.invokeLater(() -> {<NEW_LINE>edCookie.open();<NEW_LINE>showLine(how);<NEW_LINE>highlightDetail(edCookie);<NEW_LINE>});<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>showLine(how);<NEW_LINE>}<NEW_LINE>SearchHistory.getDefault().add(SearchPattern.create(searchPattern.getSearchExpression(), searchPattern.isWholeWords(), searchPattern.isMatchCase(), searchPattern.isRegExp()));<NEW_LINE>}
).lookup(EditCookie.class);
864,549
public void recalculateSize(Point p) {<NEW_LINE>int xDelta = (<MASK><NEW_LINE>int yDelta = (p.y - gesturePoint.y);<NEW_LINE>switch(resizeMode) {<NEW_LINE>case OneSideScaleMode.N_RESIZE_MODE:<NEW_LINE>currentDragRect.setBounds(rectangle.x, rectangle.y + yDelta, rectangle.width, rectangle.height - yDelta);<NEW_LINE>break;<NEW_LINE>case OneSideScaleMode.E_RESIZE_MODE:<NEW_LINE>currentDragRect.setBounds(rectangle.x, rectangle.y, rectangle.width + xDelta, rectangle.height);<NEW_LINE>break;<NEW_LINE>case OneSideScaleMode.S_RESIZE_MODE:<NEW_LINE>currentDragRect.setBounds(rectangle.x, rectangle.y, rectangle.width, rectangle.height + yDelta);<NEW_LINE>break;<NEW_LINE>case OneSideScaleMode.W_RESIZE_MODE:<NEW_LINE>currentDragRect.setBounds(rectangle.x + xDelta, rectangle.y, rectangle.width - xDelta, rectangle.height);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
p.x - gesturePoint.x);
325,781
public void onClick(View v) {<NEW_LINE>PictureAttributes pictureAttributes = Attributes.createPictureAttributes();<NEW_LINE>pictureAttributes.setHeight(500);<NEW_LINE>pictureAttributes.setWidth(500);<NEW_LINE>pictureAttributes.setType(PictureAttributes.PictureType.SQUARE);<NEW_LINE>Profile.Properties properties = new Profile.Properties.Builder().add(Profile.Properties.PICTURE, pictureAttributes).add(Profile.Properties.FIRST_NAME).add(Profile.Properties.LAST_NAME).build();<NEW_LINE>// SimpleFacebook.getInstance().getProfile(new OnProfileListener() {<NEW_LINE>SimpleFacebook.getInstance().getProfile(properties, new OnProfileListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onThinking() {<NEW_LINE>showDialog();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onException(Throwable throwable) {<NEW_LINE>hideDialog();<NEW_LINE>mResult.setText(throwable.getMessage());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFail(String reason) {<NEW_LINE>hideDialog();<NEW_LINE>mResult.setText(reason);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onComplete(Profile response) {<NEW_LINE>hideDialog();<NEW_LINE>String <MASK><NEW_LINE>mResult.setText(Html.fromHtml(str));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
str = Utils.toHtml(response);
1,827,044
static NetworkInterface[] filterBySubnet(final NetworkInterfaceShim shim, final InetAddress address, final int subnetPrefix) throws SocketException {<NEW_LINE>final ArrayList<FilterResult> filterResults = new ArrayList<>();<NEW_LINE>final byte[] queryAddress = address.getAddress();<NEW_LINE>final Enumeration<NetworkInterface> interfaces = shim.getNetworkInterfaces();<NEW_LINE>while (interfaces.hasMoreElements()) {<NEW_LINE>final <MASK><NEW_LINE>final InterfaceAddress interfaceAddress = findAddressOnInterface(shim, networkInterface, queryAddress, subnetPrefix);<NEW_LINE>if (null != interfaceAddress) {<NEW_LINE>filterResults.add(new FilterResult(interfaceAddress, networkInterface, shim.isLoopback(networkInterface)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sort(filterResults);<NEW_LINE>final int size = filterResults.size();<NEW_LINE>final NetworkInterface[] results = new NetworkInterface[size];<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>results[i] = filterResults.get(i).networkInterface;<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>}
NetworkInterface networkInterface = interfaces.nextElement();
839,584
public static void horizontal3(Kernel1D_S32 kernel, GrayU8 input, GrayI16 output, int skip) {<NEW_LINE>final byte[] dataSrc = input.data;<NEW_LINE>final short[] dataDst = output.data;<NEW_LINE>final int k1 = kernel.data[0];<NEW_LINE>final int k2 = kernel.data[1];<NEW_LINE>final int k3 = kernel.data[2];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int widthEnd = UtilDownConvolve.computeMaxSide(input.width, skip, radius);<NEW_LINE>final int height = input.getHeight();<NEW_LINE>final int offsetX = UtilDownConvolve.computeOffset(skip, radius);<NEW_LINE>for (int i = 0; i < height; i++) {<NEW_LINE>int indexDst = output.startIndex + i * output.stride + offsetX / skip;<NEW_LINE>int j = input.startIndex + i * input.stride - radius;<NEW_LINE>final int jEnd = j + widthEnd;<NEW_LINE>for (j += offsetX; j <= jEnd; j += skip) {<NEW_LINE>int indexSrc = j;<NEW_LINE>int total = (dataSrc[<MASK><NEW_LINE>total += (dataSrc[indexSrc++] & 0xFF) * k2;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k3;<NEW_LINE>dataDst[indexDst++] = (short) total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
indexSrc++] & 0xFF) * k1;
617,719
void addAuthenticationSwitches(Map<String, Object> bundle) {<NEW_LINE>Map<String, SecurityScheme> securitySchemeMap = openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null;<NEW_LINE>List<CodegenSecurity> authMethods = config.fromSecurity(securitySchemeMap);<NEW_LINE>if (authMethods != null && !authMethods.isEmpty()) {<NEW_LINE>bundle.put("authMethods", authMethods);<NEW_LINE>bundle.put("hasAuthMethods", true);<NEW_LINE>if (ProcessUtils.hasOAuthMethods(authMethods)) {<NEW_LINE>bundle.put("hasOAuthMethods", true);<NEW_LINE>bundle.put("oauthMethods", ProcessUtils.getOAuthMethods(authMethods));<NEW_LINE>}<NEW_LINE>if (ProcessUtils.hasHttpBearerMethods(authMethods)) {<NEW_LINE>bundle.put("hasHttpBearerMethods", true);<NEW_LINE>bundle.put("httpBearerMethods", ProcessUtils.getHttpBearerMethods(authMethods));<NEW_LINE>}<NEW_LINE>if (ProcessUtils.hasHttpSignatureMethods(authMethods)) {<NEW_LINE>bundle.put("hasHttpSignatureMethods", true);<NEW_LINE>bundle.put("httpSignatureMethods", ProcessUtils.getHttpSignatureMethods(authMethods));<NEW_LINE>}<NEW_LINE>if (ProcessUtils.hasHttpBasicMethods(authMethods)) {<NEW_LINE>bundle.put("hasHttpBasicMethods", true);<NEW_LINE>bundle.put("httpBasicMethods"<MASK><NEW_LINE>}<NEW_LINE>if (ProcessUtils.hasApiKeyMethods(authMethods)) {<NEW_LINE>bundle.put("hasApiKeyMethods", true);<NEW_LINE>bundle.put("apiKeyMethods", ProcessUtils.getApiKeyMethods(authMethods));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, ProcessUtils.getHttpBasicMethods(authMethods));
513,487
private void write(Coordinate[] coords, Writer writer, int level) throws IOException {<NEW_LINE>startLine(level, writer);<NEW_LINE>startGeomTag(GMLConstants.GML_COORDINATES, null, writer);<NEW_LINE>int dim = 2;<NEW_LINE>if (coords.length > 0) {<NEW_LINE>if (!(Double.isNaN(coords[0].getZ())))<NEW_LINE>dim = 3;<NEW_LINE>}<NEW_LINE>boolean isNewLine = true;<NEW_LINE>for (int i = 0; i < coords.length; i++) {<NEW_LINE>if (isNewLine) {<NEW_LINE>startLine(level + 1, writer);<NEW_LINE>isNewLine = false;<NEW_LINE>}<NEW_LINE>if (dim == 2) {<NEW_LINE>writer.write("" + coords[i].x);<NEW_LINE>writer.write(coordinateSeparator);<NEW_LINE>writer.write("" + coords[i].y);<NEW_LINE>} else if (dim == 3) {<NEW_LINE>writer.write("" + coords[i].x);<NEW_LINE>writer.write(coordinateSeparator);<NEW_LINE>writer.write("" <MASK><NEW_LINE>writer.write(coordinateSeparator);<NEW_LINE>writer.write("" + coords[i].getZ());<NEW_LINE>}<NEW_LINE>writer.write(tupleSeparator);<NEW_LINE>// break output lines to prevent them from getting too long<NEW_LINE>if ((i + 1) % maxCoordinatesPerLine == 0 && i < coords.length - 1) {<NEW_LINE>writer.write("\n");<NEW_LINE>isNewLine = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!isNewLine)<NEW_LINE>writer.write("\n");<NEW_LINE>startLine(level, writer);<NEW_LINE>endGeomTag(GMLConstants.GML_COORDINATES, writer);<NEW_LINE>}
+ coords[i].y);
1,548,448
private void checkDuplicatedJars() {<NEW_LINE>threadService.runTaskLater(() -> {<NEW_LINE>try {<NEW_LINE>Path lib = getInstallationPath().resolve("lib");<NEW_LINE>// Path lib = IOHelper.getPath("C:\\Program Files\\AsciidocFX\\lib");<NEW_LINE>if (Files.notExists(lib)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, List<Path>> dependencies = getLibraryDependencies(lib);<NEW_LINE>List<String> duplicatePaths = dependencies.entrySet().stream().filter(e -> e.getValue().size() > 1).map(e -> e.getValue()).map(e -> {<NEW_LINE>return String.join("\n", e.stream().map(Path::toString).collect(Collectors.toList())) + "\n";<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>if (duplicatePaths.size() > 0) {<NEW_LINE>threadService.runActionLater(() -> {<NEW_LINE><MASK><NEW_LINE>});<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
AlertHelper.showDuplicateWarning(duplicatePaths, lib);
1,677,665
private void loadBase64Image() {<NEW_LINE>String[] parts = <MASK><NEW_LINE>String extension = parts[0].substring(11);<NEW_LINE>String encodedData = parts[1];<NEW_LINE>// byte[] decodedBytes = DatatypeConverter.parseBase64Binary(encodedData);<NEW_LINE>byte[] decodedBytes = parseHexBinary(encodedData);<NEW_LINE>if (decodedBytes == null) {<NEW_LINE>System.err.println("Decode Error on image: " + imagePath.substring(0, 20));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Image awtImage = new ImageIcon(decodedBytes).getImage();<NEW_LINE>BitmapFactory.Options options = new BitmapFactory.Options();<NEW_LINE>options.inMutable = true;<NEW_LINE>Bitmap bmp = BitmapFactory.decodeByteArray(decodedBytes, 0, decodedBytes.length, options);<NEW_LINE>// if (awtImage instanceof BufferedImage) {<NEW_LINE>// BufferedImage buffImage = (BufferedImage) awtImage;<NEW_LINE>// int space = buffImage.getColorModel().getColorSpace().getType();<NEW_LINE>// if (space == ColorSpace.TYPE_CMYK) {<NEW_LINE>// return;<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>PImage loadedImage = new PImage(bmp);<NEW_LINE>if (loadedImage.width == -1) {<NEW_LINE>// error...<NEW_LINE>}<NEW_LINE>// if it's a .gif image, test to see if it has transparency<NEW_LINE>if (extension.equals("gif") || extension.equals("png") || extension.equals("unknown")) {<NEW_LINE>loadedImage.checkAlpha();<NEW_LINE>}<NEW_LINE>setTexture(loadedImage);<NEW_LINE>}
this.imagePath.split(";base64,");
1,716,179
protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {<NEW_LINE>String sentence = (String) msg;<NEW_LINE>DeviceSession deviceSession;<NEW_LINE>int index = sentence.indexOf("UB05");<NEW_LINE>if (index != -1) {<NEW_LINE>String imei = sentence.substring(index + 4, index + 4 + 15);<NEW_LINE>deviceSession = getDeviceSession(channel, remoteAddress, imei);<NEW_LINE>} else {<NEW_LINE>deviceSession = getDeviceSession(channel, remoteAddress);<NEW_LINE>}<NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Parser parser = new Parser(PATTERN, sentence);<NEW_LINE>if (!parser.matches()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Position position <MASK><NEW_LINE>position.setDeviceId(deviceSession.getDeviceId());<NEW_LINE>DateBuilder dateBuilder = new DateBuilder().setTime(parser.nextInt(0), parser.nextInt(0), parser.nextInt(0));<NEW_LINE>position.setValid(parser.next().equals("A"));<NEW_LINE>position.setLatitude(parser.nextCoordinate());<NEW_LINE>position.setLongitude(parser.nextCoordinate());<NEW_LINE>position.setSpeed(parser.nextDouble(0));<NEW_LINE>dateBuilder.setDate(parser.nextInt(0), parser.nextInt(0), parser.nextInt(0));<NEW_LINE>position.setTime(dateBuilder.getDate());<NEW_LINE>position.setCourse(parser.nextDouble(0));<NEW_LINE>if (parser.hasNext(2)) {<NEW_LINE>position.set(Position.KEY_STATUS, parser.next());<NEW_LINE>position.set(Position.KEY_ODOMETER, parser.nextInt(0));<NEW_LINE>}<NEW_LINE>return position;<NEW_LINE>}
= new Position(getProtocolName());
739,141
public void onBindViewHolder(final RecyclerView.ViewHolder holder, final int position) {<NEW_LINE>int type = getItemViewType(position);<NEW_LINE>switch(type) {<NEW_LINE>case TYPE_ACTION_HEADER:<NEW_LINE>{<NEW_LINE>HeaderViewHolder headerViewHolder = (HeaderViewHolder) holder;<NEW_LINE>headerViewHolder.setAction(mMassOperationAction, BookmarkManager.INSTANCE.areAllCategoriesInvisible());<NEW_LINE>headerViewHolder.getText().setText(R.string.bookmark_lists);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case TYPE_CATEGORY_ITEM:<NEW_LINE>{<NEW_LINE>final BookmarkCategory category = getCategoryByPosition(toCategoryPosition(position));<NEW_LINE>CategoryViewHolder categoryHolder = (CategoryViewHolder) holder;<NEW_LINE>categoryHolder.setCategory(category);<NEW_LINE>categoryHolder.setName(category.getName());<NEW_LINE>bindSize(categoryHolder, category);<NEW_LINE>categoryHolder.setVisibilityState(category.isVisible());<NEW_LINE>ToggleVisibilityClickListener visibilityListener = new ToggleVisibilityClickListener(categoryHolder);<NEW_LINE>categoryHolder.setVisibilityListener(visibilityListener);<NEW_LINE>CategoryItemMoreClickListener moreClickListener = new CategoryItemMoreClickListener(categoryHolder);<NEW_LINE>categoryHolder.setMoreButtonClickListener(moreClickListener);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case TYPE_ACTION_ADD:<NEW_LINE>{<NEW_LINE>Holders.GeneralViewHolder generalViewHolder = (Holders.GeneralViewHolder) holder;<NEW_LINE>generalViewHolder.getImage().setImageResource(R.drawable.ic_checkbox_add);<NEW_LINE>generalViewHolder.getText().setText(R.string.bookmarks_create_new_group);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case TYPE_ACTION_IMPORT:<NEW_LINE>{<NEW_LINE>Holders.GeneralViewHolder generalViewHolder = (Holders.GeneralViewHolder) holder;<NEW_LINE>generalViewHolder.getImage().setImageResource(R.drawable.ic_checkbox_add);<NEW_LINE>generalViewHolder.getText().setText(R.string.bookmarks_import);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
throw new AssertionError("Invalid item type: " + type);
152,651
private void copyGapInsideGroup(LayoutInterval gap, int gapSize, LayoutInterval group, int alignment) {<NEW_LINE>assert gap.isEmptySpace() && (alignment == LEADING || alignment == TRAILING);<NEW_LINE>if (alignment == LEADING)<NEW_LINE>gapSize = -gapSize;<NEW_LINE>group.getCurrentSpace().positions[dimension][alignment] += gapSize;<NEW_LINE>List<LayoutInterval> originalGroup = new ArrayList<LayoutInterval>(group.getSubIntervalCount());<NEW_LINE>for (Iterator<LayoutInterval> it = group.getSubIntervals(); it.hasNext(); ) {<NEW_LINE>originalGroup.add(it.next());<NEW_LINE>}<NEW_LINE>for (LayoutInterval sub : originalGroup) {<NEW_LINE>LayoutInterval gapClone = LayoutInterval.cloneInterval(gap, null);<NEW_LINE>if (sub.isSequential()) {<NEW_LINE>sub.getCurrentSpace().positions[dimension][alignment] += gapSize;<NEW_LINE>int index = alignment == LEADING ? 0 : sub.getSubIntervalCount();<NEW_LINE>operations.insertGapIntoSequence(gapClone, sub, index, dimension);<NEW_LINE>} else {<NEW_LINE>LayoutInterval seq = new LayoutInterval(SEQUENTIAL);<NEW_LINE>seq.getCurrentSpace().set(dimension, sub.getCurrentSpace());<NEW_LINE>seq.getCurrentSpace().positions[dimension][alignment] += gapSize;<NEW_LINE>seq.setAlignment(sub.getRawAlignment());<NEW_LINE>layoutModel.addInterval(seq, group, layoutModel.removeInterval(sub));<NEW_LINE><MASK><NEW_LINE>layoutModel.addInterval(sub, seq, 0);<NEW_LINE>layoutModel.addInterval(gapClone, seq, alignment == LEADING ? 0 : 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
layoutModel.setIntervalAlignment(sub, DEFAULT);
755,936
protected ShardDeleteEvent createShardDeleteEvent(String clusterName, ClusterTbl clusterTbl, String shardName, ShardTbl shardTbl, Map<Long, SentinelGroupModel> sentinelTblMap) {<NEW_LINE>ClusterType clusterType = ClusterType.lookup(clusterTbl.getClusterType());<NEW_LINE>ShardDeleteEvent shardDeleteEvent = new ShardDeleteEvent(clusterName, shardName, executors);<NEW_LINE>shardDeleteEvent.setClusterType(clusterType);<NEW_LINE>if (null != clusterType && clusterType.supportMultiActiveDC()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>shardDeleteEvent.setShardMonitorName(metaCache.getSentinelMonitorName(clusterName, shardTbl.getShardName()));<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>long activeDcId = clusterService.find(clusterName).getActivedcId();<NEW_LINE>String activeDcName = dcService.getDcName(activeDcId);<NEW_LINE>shardDeleteEvent.setShardMonitorName(SentinelUtil.getSentinelMonitorName(clusterName, shardTbl.getSetinelMonitorName(), activeDcName));<NEW_LINE>}<NEW_LINE>// Splicing sentinel address as "127.0.0.1:6379,127.0.0.2:6380"<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>for (SentinelGroupModel sentinelGroupModel : sentinelTblMap.values()) {<NEW_LINE>sb.append(sentinelGroupModel.getSentinelsAddressString()).append(",");<NEW_LINE>}<NEW_LINE>sb.deleteCharAt(sb.length() - 1);<NEW_LINE>shardDeleteEvent.setShardSentinels(sb.toString());<NEW_LINE>shardEventListeners.forEach(shardEventListener -> shardDeleteEvent.addObserver(shardEventListener));<NEW_LINE>return shardDeleteEvent;<NEW_LINE>}
logger.warn("[createClusterEvent]", e);
966,997
private void clearIqCallbacks() {<NEW_LINE>final IqPacket failurePacket = new IqPacket(IqPacket.TYPE.TIMEOUT);<NEW_LINE>final ArrayList<OnIqPacketReceived> callbacks = new ArrayList<>();<NEW_LINE>synchronized (this.packetCallbacks) {<NEW_LINE>if (this.packetCallbacks.size() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": clearing " + this.packetCallbacks.size() + " iq callbacks");<NEW_LINE>final Iterator<Pair<IqPacket, OnIqPacketReceived>> iterator = this.packetCallbacks.values().iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Pair<IqPacket, OnIqPacketReceived<MASK><NEW_LINE>callbacks.add(entry.second);<NEW_LINE>iterator.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (OnIqPacketReceived callback : callbacks) {<NEW_LINE>try {<NEW_LINE>callback.onIqPacketReceived(account, failurePacket);<NEW_LINE>} catch (StateChangingError error) {<NEW_LINE>Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": caught StateChangingError(" + error.state.toString() + ") while clearing callbacks");<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": done clearing iq callbacks. " + this.packetCallbacks.size() + " left");<NEW_LINE>}
> entry = iterator.next();
1,160,451
final ListPublishedSchemaArnsResult executeListPublishedSchemaArns(ListPublishedSchemaArnsRequest listPublishedSchemaArnsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listPublishedSchemaArnsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListPublishedSchemaArnsRequest> request = null;<NEW_LINE>Response<ListPublishedSchemaArnsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListPublishedSchemaArnsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listPublishedSchemaArnsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudDirectory");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListPublishedSchemaArns");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListPublishedSchemaArnsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListPublishedSchemaArnsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,798,913
public Geometry union() {<NEW_LINE>if (inputPolys == null)<NEW_LINE>throw new IllegalStateException("union() method cannot be called twice");<NEW_LINE>if (inputPolys.isEmpty())<NEW_LINE>return null;<NEW_LINE>geomFactory = ((Geometry) inputPolys.iterator().<MASK><NEW_LINE>// STRtree index = new STRtree();<NEW_LINE>STRtree index = new STRtree(STRTREE_NODE_CAPACITY);<NEW_LINE>for (Iterator i = inputPolys.iterator(); i.hasNext(); ) {<NEW_LINE>Geometry item = (Geometry) i.next();<NEW_LINE>index.insert(item.getEnvelopeInternal(), item);<NEW_LINE>}<NEW_LINE>// To avoiding holding memory remove references to the input geometries,<NEW_LINE>inputPolys = null;<NEW_LINE>List itemTree = index.itemsTree();<NEW_LINE>// printItemEnvelopes(itemTree);<NEW_LINE>Geometry unionAll = unionTree(itemTree);<NEW_LINE>return unionAll;<NEW_LINE>}
next()).getFactory();
1,089,966
public void run(RegressionEnvironment env) {<NEW_LINE>AtomicInteger milestone = new AtomicInteger();<NEW_LINE>String epl = "@name('s0') select * from " + "SupportMarketDataBean#length(5) " + "output every 6 events " + "order by price";<NEW_LINE>createAndSend(env, epl, milestone);<NEW_LINE>SymbolPricesVolumes spv = new SymbolPricesVolumes();<NEW_LINE>orderValuesByPrice(spv);<NEW_LINE>assertValues(env, spv.symbols, "symbol");<NEW_LINE>assertValues(env, spv.prices, "price");<NEW_LINE>assertValues(env, spv.volumes, "volume");<NEW_LINE>assertOnlyProperties(env, Arrays.asList(new String[] { "symbol", "id", <MASK><NEW_LINE>clearValuesDropStmt(env, spv);<NEW_LINE>epl = "@name('s0') select * from " + "SupportMarketDataBean#length(5) " + "output every 6 events " + "order by symbol";<NEW_LINE>createAndSend(env, epl, milestone);<NEW_LINE>orderValuesBySymbol(spv);<NEW_LINE>assertValues(env, spv.symbols, "symbol");<NEW_LINE>assertValues(env, spv.prices, "price");<NEW_LINE>assertValues(env, spv.volumes, "volume");<NEW_LINE>assertOnlyProperties(env, Arrays.asList(new String[] { "symbol", "volume", "price", "feed", "id" }));<NEW_LINE>clearValuesDropStmt(env, spv);<NEW_LINE>}
"volume", "price", "feed" }));
1,098,896
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>RecyclerView recyclerView = findViewById(R.id.list);<NEW_LINE>recyclerView.setLayoutManager(new LinearLayoutManager(this));<NEW_LINE>List<Type> dataSet = new ArrayList<>();<NEW_LINE>dataSet.add(Type.Mask);<NEW_LINE>dataSet.add(Type.NinePatchMask);<NEW_LINE>dataSet.add(Type.CropCenterTop);<NEW_LINE>dataSet.add(Type.CropCenterCenter);<NEW_LINE>dataSet.add(Type.CropCenterBottom);<NEW_LINE>dataSet.add(Type.CropSquare);<NEW_LINE>dataSet.add(Type.CropCircle);<NEW_LINE>dataSet.add(Type.ColorFilter);<NEW_LINE>dataSet.add(Type.Grayscale);<NEW_LINE>dataSet.add(Type.RoundedCorners);<NEW_LINE>dataSet.add(Type.Blur);<NEW_LINE>dataSet.add(Type.Toon);<NEW_LINE>dataSet.add(Type.Sepia);<NEW_LINE>dataSet.add(Type.Contrast);<NEW_LINE>dataSet.add(Type.Invert);<NEW_LINE>dataSet.add(Type.Pixel);<NEW_LINE>dataSet.add(Type.Sketch);<NEW_LINE>dataSet.add(Type.Swirl);<NEW_LINE>dataSet.add(Type.Brightness);<NEW_LINE>dataSet.add(Type.Kuawahara);<NEW_LINE>dataSet.add(Type.Vignette);<NEW_LINE>dataSet.add(Type.CropLeftTop);<NEW_LINE>dataSet.add(Type.CropLeftCenter);<NEW_LINE>dataSet.add(Type.CropLeftBottom);<NEW_LINE>dataSet.add(Type.CropRightTop);<NEW_LINE>dataSet.add(Type.CropRightCenter);<NEW_LINE>dataSet.add(Type.CropRightBottom);<NEW_LINE>dataSet.add(Type.Crop169CenterCenter);<NEW_LINE>dataSet.add(Type.Crop43CenterCenter);<NEW_LINE>dataSet.add(Type.Crop31CenterCenter);<NEW_LINE>dataSet.add(Type.Crop31CenterTop);<NEW_LINE>dataSet.add(Type.CropSquareCenterCenter);<NEW_LINE>dataSet.add(Type.CropQuarterCenterCenter);<NEW_LINE><MASK><NEW_LINE>dataSet.add(Type.CropQuarterBottomRight);<NEW_LINE>dataSet.add(Type.CropHalfWidth43CenterCenter);<NEW_LINE>recyclerView.setAdapter(new MainAdapter(this, dataSet));<NEW_LINE>}
dataSet.add(Type.CropQuarterCenterTop);
1,507,937
private <T> Flux<JsonNode> findItems(@NonNull CosmosQuery query, @NonNull String containerName, @NonNull Class<T> domainType) {<NEW_LINE>final SqlQuerySpec sqlQuerySpec = new FindQuerySpecGenerator().generateCosmos(query);<NEW_LINE><MASK><NEW_LINE>cosmosQueryRequestOptions.setQueryMetricsEnabled(this.queryMetricsEnabled);<NEW_LINE>Optional<Object> partitionKeyValue = query.getPartitionKeyValue(domainType);<NEW_LINE>partitionKeyValue.ifPresent(o -> {<NEW_LINE>LOGGER.debug("Setting partition key {}", o);<NEW_LINE>cosmosQueryRequestOptions.setPartitionKey(new PartitionKey(o));<NEW_LINE>});<NEW_LINE>return cosmosAsyncClient.getDatabase(this.databaseName).getContainer(containerName).queryItems(sqlQuerySpec, cosmosQueryRequestOptions, JsonNode.class).byPage().publishOn(Schedulers.parallel()).flatMap(cosmosItemFeedResponse -> {<NEW_LINE>CosmosUtils.fillAndProcessResponseDiagnostics(this.responseDiagnosticsProcessor, cosmosItemFeedResponse.getCosmosDiagnostics(), cosmosItemFeedResponse);<NEW_LINE>return Flux.fromIterable(cosmosItemFeedResponse.getResults());<NEW_LINE>}).onErrorResume(throwable -> CosmosExceptionUtils.exceptionHandler("Failed to query items", throwable, this.responseDiagnosticsProcessor));<NEW_LINE>}
final CosmosQueryRequestOptions cosmosQueryRequestOptions = new CosmosQueryRequestOptions();
1,211,377
void initialize() {<NEW_LINE>// NON-NLS<NEW_LINE>assert resetFiltersButton != null : "fx:id=\"resetFiltersButton\" was not injected: check your FXML file 'NoEventsDialog.fxml'.";<NEW_LINE>// NON-NLS<NEW_LINE>assert dismissButton != null : "fx:id=\"dismissButton\" was not injected: check your FXML file 'NoEventsDialog.fxml'.";<NEW_LINE>// NON-NLS<NEW_LINE>assert zoomButton != null : "fx:id=\"zoomButton\" was not injected: check your FXML file 'NoEventsDialog.fxml'.";<NEW_LINE>titledPane.setText(Bundle.NoEventsDialog_titledPane_text());<NEW_LINE>noEventsDialogLabel.setText(Bundle.ViewFrame_noEventsDialogLabel_text());<NEW_LINE>dismissButton.setOnAction(<MASK><NEW_LINE>ActionUtils.configureButton(new ZoomToEvents(controller), zoomButton);<NEW_LINE>ActionUtils.configureButton(new Back(controller), backButton);<NEW_LINE>ActionUtils.configureButton(new ResetFilters(controller), resetFiltersButton);<NEW_LINE>}
actionEvent -> closeCallback.run());
856,111
public void writeExternalUtil(@Nonnull Element element, @Nonnull OptionsAndConfirmations optionsAndConfirmations) throws WriteExternalException {<NEW_LINE>final Map<String, VcsShowOptionsSettingImpl> options = optionsAndConfirmations.getOptions();<NEW_LINE>final Map<String, VcsShowConfirmationOptionImpl> confirmations = optionsAndConfirmations.getConfirmations();<NEW_LINE>for (VcsShowOptionsSettingImpl setting : options.values()) {<NEW_LINE>if (!setting.getValue()) {<NEW_LINE>Element settingElement = new Element(OPTIONS_SETTING);<NEW_LINE>element.addContent(settingElement);<NEW_LINE>settingElement.setAttribute(VALUE_ATTTIBUTE, Boolean.toString(setting.getValue()));<NEW_LINE>settingElement.setAttribute(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (VcsShowConfirmationOptionImpl setting : confirmations.values()) {<NEW_LINE>if (setting.getValue() != VcsShowConfirmationOption.Value.SHOW_CONFIRMATION) {<NEW_LINE>final Element settingElement = new Element(CONFIRMATIONS_SETTING);<NEW_LINE>element.addContent(settingElement);<NEW_LINE>settingElement.setAttribute(VALUE_ATTTIBUTE, setting.getValue().toString());<NEW_LINE>settingElement.setAttribute(ID_ATTRIBUTE, setting.getDisplayName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ID_ATTRIBUTE, setting.getDisplayName());
653,377
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {<NEW_LINE>getSerializedSize();<NEW_LINE>if (sceneId_ != 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (pos_ != null) {<NEW_LINE>output.writeMessage(2, getPos());<NEW_LINE>}<NEW_LINE>if (sceneBeginTime_ != 0L) {<NEW_LINE>output.writeUInt64(3, sceneBeginTime_);<NEW_LINE>}<NEW_LINE>if (type_ != emu.grasscutter.net.proto.EnterTypeOuterClass.EnterType.EnterNone.getNumber()) {<NEW_LINE>output.writeEnum(4, type_);<NEW_LINE>}<NEW_LINE>if (targetUid_ != 0) {<NEW_LINE>output.writeUInt32(6, targetUid_);<NEW_LINE>}<NEW_LINE>if (prevSceneId_ != 0) {<NEW_LINE>output.writeUInt32(9, prevSceneId_);<NEW_LINE>}<NEW_LINE>if (prevPos_ != null) {<NEW_LINE>output.writeMessage(10, getPrevPos());<NEW_LINE>}<NEW_LINE>if (dungeonId_ != 0) {<NEW_LINE>output.writeUInt32(11, dungeonId_);<NEW_LINE>}<NEW_LINE>if (worldLevel_ != 0) {<NEW_LINE>output.writeUInt32(12, worldLevel_);<NEW_LINE>}<NEW_LINE>if (enterSceneToken_ != 0) {<NEW_LINE>output.writeUInt32(13, enterSceneToken_);<NEW_LINE>}<NEW_LINE>if (isFirstLoginEnterScene_ != false) {<NEW_LINE>output.writeBool(14, isFirstLoginEnterScene_);<NEW_LINE>}<NEW_LINE>if (getSceneTagIdListList().size() > 0) {<NEW_LINE>output.writeUInt32NoTag(122);<NEW_LINE>output.writeUInt32NoTag(sceneTagIdListMemoizedSerializedSize);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < sceneTagIdList_.size(); i++) {<NEW_LINE>output.writeUInt32NoTag(sceneTagIdList_.getInt(i));<NEW_LINE>}<NEW_LINE>if (isSkipUi_ != false) {<NEW_LINE>output.writeBool(16, isSkipUi_);<NEW_LINE>}<NEW_LINE>if (enterReason_ != 0) {<NEW_LINE>output.writeUInt32(17, enterReason_);<NEW_LINE>}<NEW_LINE>if (unk1_ != 0) {<NEW_LINE>output.writeUInt32(18, unk1_);<NEW_LINE>}<NEW_LINE>if (!getUnk2Bytes().isEmpty()) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 19, unk2_);<NEW_LINE>}<NEW_LINE>unknownFields.writeTo(output);<NEW_LINE>}
output.writeUInt32(1, sceneId_);
1,421,975
public static void openInVisualVM(long id) throws IOException {<NEW_LINE>SpecVersion sv = getJavaVersion();<NEW_LINE>if (sv == null || (sv.major == 1 && sv.minor < 6)) {<NEW_LINE>final <MASK><NEW_LINE>d.asyncExec(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>Shell s = new Shell(d);<NEW_LINE>MessageDialog.openError(s, "VisualVM requires JDK1.6+ to run", "You are trying to launch VisualVM using an unsupported JDK.\n\nUse 'Window\\Preferences\\Run/Debug\\Launching\\VisualVM Configuration' to set the VisualVM JDK_HOME.");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Runtime.getRuntime().exec(new String[] { Activator.getDefault().getPreferenceStore().getString(PreferenceConstants.P_PATH), "--jdkhome", Activator.getDefault().getPreferenceStore().getString(PreferenceConstants.P_JAVAHOME), "--openid", String.valueOf(id) });<NEW_LINE>}
Display d = Display.getDefault();
1,676,846
private void populateAccessory(Project project) {<NEW_LINE>DefaultListModel model = (DefaultListModel) jListArtifacts.getModel();<NEW_LINE>model.clear();<NEW_LINE>// NOI18N<NEW_LINE>jTextFieldName.setText(project == null ? "" : ProjectUtils.getInformation(project).getDisplayName());<NEW_LINE>if (project != null) {<NEW_LINE>List<AntArtifact> artifacts <MASK><NEW_LINE>for (int i = 0; i < artifactTypes.length; i++) {<NEW_LINE>artifacts.addAll(Arrays.asList(AntArtifactQuery.findArtifactsByType(project, artifactTypes[i])));<NEW_LINE>}<NEW_LINE>for (AntArtifact artifact : artifacts) {<NEW_LINE>URI[] uris = artifact.getArtifactLocations();<NEW_LINE>for (int y = 0; y < uris.length; y++) {<NEW_LINE>model.addElement(new AntArtifactItem(artifact, uris[y]));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jListArtifacts.setSelectionInterval(0, model.size());<NEW_LINE>}<NEW_LINE>}
= new ArrayList<AntArtifact>();
168,382
private static WritableMap convertJsonToMap(JSONObject jsonObject) throws JSONException {<NEW_LINE>WritableMap map = new WritableNativeMap();<NEW_LINE>Iterator<String> iterator = jsonObject.keys();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>String key = iterator.next();<NEW_LINE>Object value = jsonObject.get(key);<NEW_LINE>if (value instanceof JSONObject) {<NEW_LINE>map.putMap(key, convertJsonToMap((JSONObject) value));<NEW_LINE>} else if (value instanceof JSONArray) {<NEW_LINE>map.putArray(key, <MASK><NEW_LINE>} else if (value instanceof Boolean) {<NEW_LINE>map.putBoolean(key, (Boolean) value);<NEW_LINE>} else if (value instanceof Integer) {<NEW_LINE>map.putInt(key, (Integer) value);<NEW_LINE>} else if (value instanceof Double) {<NEW_LINE>map.putDouble(key, (Double) value);<NEW_LINE>} else if (value instanceof Float) {<NEW_LINE>map.putDouble(key, ((Float) value).doubleValue());<NEW_LINE>} else if (value instanceof Long) {<NEW_LINE>map.putDouble(key, ((Long) value).doubleValue());<NEW_LINE>} else if (value instanceof String) {<NEW_LINE>map.putString(key, (String) value);<NEW_LINE>} else {<NEW_LINE>map.putString(key, value.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>}
convertJsonToArray((JSONArray) value));
1,544,757
public Object eval(Scope scope) {<NEW_LINE>Object target = expr.eval(scope);<NEW_LINE>if (target == null) {<NEW_LINE>if (scope.getCtrl().isNullSafe()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>Object[] argValues = exprList.evalExprList(scope);<NEW_LINE>try {<NEW_LINE>MethodInfo methodInfo = MethodKit.getMethod(target.getClass(), methodName, argValues);<NEW_LINE>if (methodInfo.notNull()) {<NEW_LINE>return methodInfo.invoke(target, argValues);<NEW_LINE>}<NEW_LINE>if (scope.getCtrl().isNullSafe()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>throw new TemplateException(buildMethodNotFoundSignature("public method not found: " + target.getClass().getName() + ".", methodName, argValues), location);<NEW_LINE>} catch (TemplateException | ParseException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>Throwable t = e.getTargetException();<NEW_LINE>if (t == null) {<NEW_LINE>t = e;<NEW_LINE>}<NEW_LINE>throw new TemplateException(t.getMessage(), location, t);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new TemplateException(e.getMessage(), location, e);<NEW_LINE>}<NEW_LINE>}
TemplateException("The target for method invoking can not be null, method name: " + methodName, location);
1,680,800
private ICompositeQueryFilter<I_M_HU> createQueryFilter_Barcode() {<NEW_LINE>if (Check.isEmpty(barcode, true)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final ICompositeQueryFilter<I_M_HU> filters = queryBL.createCompositeQueryFilter(I_M_HU.class);<NEW_LINE>final Collection<HUAttributeQueryFilterVO> barcodeQueryFilterVOs = createBarcodeHUAttributeQueryFilterVOs();<NEW_LINE>if (!barcodeQueryFilterVOs.isEmpty()) {<NEW_LINE>final ICompositeQueryFilter<I_M_HU> barcodeFilter = queryBL.createCompositeQueryFilter(I_M_HU.class);<NEW_LINE>// an HU will be barcode-identified either if it has barcode attributes or value with the value inserted as barcode<NEW_LINE>barcodeFilter.setJoinOr();<NEW_LINE>barcodeFilter.addEqualsFilter(I_M_HU.<MASK><NEW_LINE>for (final HUAttributeQueryFilterVO attributeFilterVO : barcodeQueryFilterVOs) {<NEW_LINE>attributeFilterVO.appendQueryFilterTo(barcodeFilter);<NEW_LINE>}<NEW_LINE>filters.addFilter(barcodeFilter);<NEW_LINE>} else // task #827 filter by hu value, as before<NEW_LINE>{<NEW_LINE>filters.addEqualsFilter(I_M_HU.COLUMN_Value, barcode.trim());<NEW_LINE>}<NEW_LINE>return filters;<NEW_LINE>}
COLUMN_Value, barcode.trim());
1,561,676
public ErrorCode action(ByteBuf ackPayload, String clientID, String fromUser, ProtoConstants.RequestSourceType requestSourceType, WFCMessage.Message message, Qos1PublishHandler.IMCallback callback) {<NEW_LINE>ErrorCode errorCode = ErrorCode.ERROR_CODE_SUCCESS;<NEW_LINE>boolean isAdmin = requestSourceType == ProtoConstants.RequestSourceType.Request_From_Admin;<NEW_LINE>if (message != null) {<NEW_LINE>if (!isAdmin) {<NEW_LINE>// only admin can broadcast message<NEW_LINE>return ErrorCode.ERROR_CODE_NOT_RIGHT;<NEW_LINE>}<NEW_LINE>long timestamp = System.currentTimeMillis();<NEW_LINE>long messageId = 0;<NEW_LINE>try {<NEW_LINE>messageId = MessageShardingUtil.generateId();<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return ErrorCode.ERROR_CODE_SERVER_ERROR;<NEW_LINE>}<NEW_LINE>message = message.toBuilder().setFromUser(fromUser).setMessageId(messageId).setServerTimestamp(timestamp).setConversation(WFCMessage.Conversation.newBuilder().setTarget(fromUser).setLine(message.getConversation().getLine()).setType(ProtoConstants.ConversationType.ConversationType_Private).<MASK><NEW_LINE>long count = saveAndBroadcast(fromUser, clientID, message);<NEW_LINE>ackPayload = ackPayload.capacity(20);<NEW_LINE>ackPayload.writeLong(messageId);<NEW_LINE>ackPayload.writeLong(count);<NEW_LINE>} else {<NEW_LINE>errorCode = ErrorCode.ERROR_CODE_INVALID_MESSAGE;<NEW_LINE>}<NEW_LINE>return errorCode;<NEW_LINE>}
build()).build();
1,755,012
protected Void doInBackground() throws Exception {<NEW_LINE>addPropertyChangeListener(evt -> {<NEW_LINE>if ("progress".equals(evt.getPropertyName())) {<NEW_LINE>progressBar.setValue((Integer) evt.getNewValue());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>long totalSize = 0;<NEW_LINE>for (File copyable : copyItems) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>long progress = 0;<NEW_LINE>setProgress(0);<NEW_LINE>for (File copyable : copyItems) {<NEW_LINE>if (copyable.isDirectory()) {<NEW_LINE>copyDir(copyable, new File(newFolder, copyable.getName()), progress, totalSize);<NEW_LINE>progress += Util.calcSize(copyable);<NEW_LINE>} else {<NEW_LINE>copyFile(copyable, new File(newFolder, copyable.getName()), progress, totalSize);<NEW_LINE>if (Util.calcSize(copyable) < 512 * 1024) {<NEW_LINE>// If the file length > 0.5MB, the copyFile() function has<NEW_LINE>// been redesigned to change progress every 0.5MB so that<NEW_LINE>// the progress bar doesn't stagnate during that time<NEW_LINE>progress += Util.calcSize(copyable);<NEW_LINE>setProgress((int) (progress * 100L / totalSize));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>saving.set(false);<NEW_LINE>return null;<NEW_LINE>}
totalSize += Util.calcSize(copyable);
1,566,690
public Projector visitWriterProjection(WriterProjection projection, Context context) {<NEW_LINE>InputFactory.Context<CollectExpression<Row, ?>> ctx = inputFactory.ctxForInputColumns(context.txnCtx);<NEW_LINE>List<<MASK><NEW_LINE>if (!projection.inputs().isEmpty()) {<NEW_LINE>ctx.add(projection.inputs());<NEW_LINE>inputs = ctx.topLevelInputs();<NEW_LINE>}<NEW_LINE>projection = projection.normalize(normalizer, context.txnCtx);<NEW_LINE>String uri = DataTypes.STRING.sanitizeValue(SymbolEvaluator.evaluate(context.txnCtx, nodeCtx, projection.uri(), Row.EMPTY, SubQueryResults.EMPTY));<NEW_LINE>assert uri != null : "URI must not be null";<NEW_LINE>StringBuilder sb = new StringBuilder(uri);<NEW_LINE>Symbol resolvedFileName = normalizer.normalize(WriterProjection.DIRECTORY_TO_FILENAME, context.txnCtx);<NEW_LINE>assert resolvedFileName instanceof Literal : "resolvedFileName must be a Literal, but is: " + resolvedFileName;<NEW_LINE>assert resolvedFileName.valueType().id() == StringType.ID : "resolvedFileName.valueType() must be " + StringType.INSTANCE;<NEW_LINE>String fileName = (String) ((Literal) resolvedFileName).value();<NEW_LINE>if (!uri.endsWith("/")) {<NEW_LINE>sb.append("/");<NEW_LINE>}<NEW_LINE>sb.append(fileName);<NEW_LINE>if (projection.compressionType() == WriterProjection.CompressionType.GZIP) {<NEW_LINE>sb.append(".gz");<NEW_LINE>}<NEW_LINE>uri = sb.toString();<NEW_LINE>Map<ColumnIdent, Object> overwrites = symbolMapToObject(projection.overwrites(), ctx, context.txnCtx);<NEW_LINE>return new FileWriterProjector(threadPool.generic(), uri, projection.compressionType(), inputs, ctx.expressions(), overwrites, projection.outputNames(), projection.outputFormat(), fileOutputFactoryMap, projection.withClauseOptions());<NEW_LINE>}
Input<?>> inputs = null;
913,302
public static double min(int[] y1, int[] y2) {<NEW_LINE>ContingencyTable contingency = new ContingencyTable(y1, y2);<NEW_LINE>double n = contingency.n;<NEW_LINE>double[] p1 = Arrays.stream(contingency.a).mapToDouble(a -> <MASK><NEW_LINE>double[] p2 = Arrays.stream(contingency.b).mapToDouble(b -> b / n).toArray();<NEW_LINE>double h1 = MathEx.entropy(p1);<NEW_LINE>double h2 = MathEx.entropy(p2);<NEW_LINE>double I = MutualInformation.of(contingency.n, p1, p2, contingency.table);<NEW_LINE>double E = E(contingency.n, contingency.a, contingency.b);<NEW_LINE>return (I - E) / (Math.min(h1, h2) - E);<NEW_LINE>}
a / n).toArray();
640,344
private RefactoringStatus createRenameChanges(IProgressMonitor monitor) throws CoreException {<NEW_LINE>Assert.isNotNull(monitor);<NEW_LINE>RefactoringStatus status = new RefactoringStatus();<NEW_LINE>try {<NEW_LINE>monitor.beginTask(RefactoringCoreMessages.RenameTypeParameterRefactoring_searching, 2);<NEW_LINE>ICompilationUnit cu = fTypeParameter.getDeclaringMember().getCompilationUnit();<NEW_LINE>CompilationUnit root = RefactoringASTParser.parseWithASTProvider(cu, true, null);<NEW_LINE>CompilationUnitRewrite rewrite = new CompilationUnitRewrite(cu, root);<NEW_LINE>IMember member = fTypeParameter.getDeclaringMember();<NEW_LINE>ASTNode declaration = null;<NEW_LINE>if (member instanceof IMethod) {<NEW_LINE>declaration = ASTNodeSearchUtil.getMethodDeclarationNode((IMethod) member, root);<NEW_LINE>} else if (member instanceof IType) {<NEW_LINE>declaration = ASTNodeSearchUtil.getAbstractTypeDeclarationNode((IType) member, root);<NEW_LINE>} else {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>JavaLanguageServerPlugin.logError("Unexpected sub-type of IMember: " + member.<MASK><NEW_LINE>Assert.isTrue(false);<NEW_LINE>}<NEW_LINE>monitor.worked(1);<NEW_LINE>RenameTypeParameterVisitor visitor = new RenameTypeParameterVisitor(rewrite, fTypeParameter.getNameRange(), status);<NEW_LINE>if (declaration != null) {<NEW_LINE>declaration.accept(visitor);<NEW_LINE>}<NEW_LINE>fChange = visitor.getResult();<NEW_LINE>} finally {<NEW_LINE>monitor.done();<NEW_LINE>}<NEW_LINE>return status;<NEW_LINE>}
getClass().getName());
595,941
public void fmlInit(FMLInitializationEvent evt) {<NEW_LINE>NetworkRegistry.INSTANCE.registerGuiHandler(instance, new FactoryGuiHandler());<NEW_LINE>BCRegistry.INSTANCE.registerTileEntity(TileMiningWell.class, "buildcraft.factory.MiningWell", "MiningWell");<NEW_LINE>BCRegistry.INSTANCE.registerTileEntity(TileAutoWorkbench.class, "buildcraft.factory.AutoWorkbench", "AutoWorkbench");<NEW_LINE>BCRegistry.INSTANCE.registerTileEntity(TilePump.class, "buildcraft.factory.Pump", "net.minecraft.src.buildcraft.factory.TilePump");<NEW_LINE>BCRegistry.INSTANCE.registerTileEntity(TileFloodGate.class, "buildcraft.factory.FloodGate", "net.minecraft.src.buildcraft.factory.TileFloodGate");<NEW_LINE>BCRegistry.INSTANCE.registerTileEntity(TileTank.class, "buildcraft.factory.Tank", "net.minecraft.src.buildcraft.factory.TileTank");<NEW_LINE>BCRegistry.INSTANCE.registerTileEntity(TileRefinery.class, "buildcraft.factory.Refinery", "net.minecraft.src.buildcraft.factory.Refinery");<NEW_LINE>BCRegistry.INSTANCE.registerTileEntity(TileChute.class, "buildcraft.factory.Chute", "net.minecraft.src.buildcraft.factory.TileHopper");<NEW_LINE>BCRegistry.INSTANCE.registerTileEntity(TileEnergyHeater.class, "buildcraft.factory.TileEnergyHeater");<NEW_LINE>BCRegistry.INSTANCE.<MASK><NEW_LINE>BCRegistry.INSTANCE.registerTileEntity(TileDistiller_BC8.class, "buildcraft.factory.TileDistiller");<NEW_LINE>if (Loader.isModLoaded("BuildCraft|Energy")) {<NEW_LINE>ComplexRefiningManager.init();<NEW_LINE>}<NEW_LINE>FactoryProxy.proxy.fmlInit();<NEW_LINE>BuilderAPI.schematicRegistry.registerSchematicBlock(refineryBlock, SchematicRefinery.class);<NEW_LINE>BuilderAPI.schematicRegistry.registerSchematicBlock(tankBlock, SchematicTileIgnoreState.class);<NEW_LINE>BuilderAPI.schematicRegistry.registerSchematicBlock(pumpBlock, SchematicPump.class);<NEW_LINE>BuilderAPI.schematicRegistry.registerSchematicBlock(floodGateBlock, SchematicTileIgnoreState.class);<NEW_LINE>BuilderAPI.schematicRegistry.registerSchematicBlock(autoWorkbenchBlock, SchematicAutoWorkbench.class);<NEW_LINE>BuilderAPI.schematicRegistry.registerSchematicBlock(chuteBlock, SchematicTile.class);<NEW_LINE>BuilderAPI.schematicRegistry.registerSchematicBlock(plainPipeBlock, SchematicFree.class);<NEW_LINE>aLotOfCraftingAchievement = BuildCraftCore.achievementManager.registerAchievement(new Achievement("buildcraft|factory:achievement.aLotOfCrafting", "aLotOfCraftingAchievement", 1, 2, autoWorkbenchBlock, BuildCraftCore.woodenGearAchievement));<NEW_LINE>straightDownAchievement = BuildCraftCore.achievementManager.registerAchievement(new Achievement("buildcraft|factory:achievement.straightDown", "straightDownAchievement", 5, 2, miningWellBlock, BuildCraftCore.ironGearAchievement));<NEW_LINE>refineAndRedefineAchievement = BuildCraftCore.achievementManager.registerAchievement(new Achievement("buildcraft|factory:achievement.refineAndRedefine", "refineAndRedefineAchievement", 10, 0, refineryBlock, BuildCraftCore.diamondGearAchievement));<NEW_LINE>if (BuildCraftCore.loadDefaultRecipes) {<NEW_LINE>loadRecipes();<NEW_LINE>}<NEW_LINE>}
registerTileEntity(TileHeatExchange_BC8.class, "buildcraft.factory.TileHeatExchange");
643,576
public //<NEW_LINE>void //<NEW_LINE>postEvent(// , @RequestParam(name = "message", defaultValue = "test message") final String message//<NEW_LINE>@RequestParam(name = "topicName", defaultValue = "de.metas.event.GeneralNotifications") final String topicName, //<NEW_LINE>//<NEW_LINE>@RequestParam(name = "toUserId", defaultValue = "-1") final int toUserId, //<NEW_LINE>@RequestParam(name = "important", defaultValue = "false") final boolean important, //<NEW_LINE>//<NEW_LINE>@RequestParam(name = "targetType", required = false) final String targetTypeStr, //<NEW_LINE>@RequestParam(name = "targetDocumentType", required = false, defaultValue = "143") final String targetDocumentType, @RequestParam(name = "targetDocumentId", required = false) final String targetDocumentId) {<NEW_LINE>userSession.assertLoggedIn();<NEW_LINE>final Topic topic = Topic.builder().name(topicName).type(<MASK><NEW_LINE>final UserNotificationRequestBuilder request = UserNotificationRequest.builder().topic(topic).recipientUserId(UserId.ofRepoId(toUserId)).important(important);<NEW_LINE>final UserNotificationTargetType targetType = Check.isEmpty(targetTypeStr) ? null : UserNotificationTargetType.forJsonValue(targetTypeStr);<NEW_LINE>if (targetType == UserNotificationTargetType.Window) {<NEW_LINE>final String targetTableName = documentCollection.getDocumentDescriptorFactory().getDocumentDescriptor(WindowId.fromJson(targetDocumentType)).getEntityDescriptor().getTableName();<NEW_LINE>final TableRecordReference targetRecord = TableRecordReference.of(targetTableName, Integer.parseInt(targetDocumentId));<NEW_LINE>request.targetAction(TargetRecordAction.of(targetRecord));<NEW_LINE>}<NEW_LINE>Services.get(INotificationBL.class).send(request.build());<NEW_LINE>}
Type.LOCAL).build();
74,772
public ApiResponse<MediaItemContents> mediaGet_1WithHttpInfo(String id, Integer pageIndex, Integer pageSize, String sortExpression, Boolean includeParent) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'id' is set<NEW_LINE>if (id == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'id' when calling mediaGet_1");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'pageIndex' is set<NEW_LINE>if (pageIndex == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'pageIndex' when calling mediaGet_1");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'pageSize' is set<NEW_LINE>if (pageSize == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'pageSize' when calling mediaGet_1");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'sortExpression' is set<NEW_LINE>if (sortExpression == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'sortExpression' when calling mediaGet_1");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'includeParent' is set<NEW_LINE>if (includeParent == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'includeParent' when calling mediaGet_1");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/media/{id}/items".replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new <MASK><NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "pageIndex", pageIndex));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "pageSize", pageSize));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "sortExpression", sortExpression));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "includeParent", includeParent));<NEW_LINE>final String[] localVarAccepts = { "application/json", "text/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>GenericType<MediaItemContents> localVarReturnType = new GenericType<MediaItemContents>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
HashMap<String, Object>();
1,400,027
@Path("connectionTest")<NEW_LINE>public Status connectionTest(@FormParam("dbtype") String dbtype, @FormParam("dbaddress") String dbaddress, @FormParam("dbport") String dbport, @FormParam("dbuser") String dbuser, @FormParam("dbpassword") String dbpassword) throws Exception {<NEW_LINE>Status status = Status.OK();<NEW_LINE>Connection conn = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>conn = DataSourceUtil.getConnection(dbaddress, dbport, dbuser, dbpassword, DatabaseType.valueOf(dbtype).getValue());<NEW_LINE>rs = conn.getMetaData().getCatalogs();<NEW_LINE>Set<String> allCatalog = new HashSet<>();<NEW_LINE>while (rs.next()) {<NEW_LINE>allCatalog.add<MASK><NEW_LINE>}<NEW_LINE>status.setInfo(mapper.writeValueAsString(allCatalog));<NEW_LINE>} catch (Throwable e) {<NEW_LINE>LoggerManager.getInstance().error(e);<NEW_LINE>status = Status.ERROR();<NEW_LINE>status.setInfo(e.getMessage());<NEW_LINE>} finally {<NEW_LINE>ResourceUtils.close(rs);<NEW_LINE>ResourceUtils.close(conn);<NEW_LINE>}<NEW_LINE>return status;<NEW_LINE>}
(rs.getString("TABLE_CAT"));
1,855,163
private boolean deleteRoleBindingsUsingServiceUser(boolean retry, List<String> roleBindingNames) {<NEW_LINE>DeleteRoleBindings deleteRoleBindingRequest = DeleteRoleBindings.newBuilder().addAllRoleBindingNames(roleBindingNames).build();<NEW_LINE>try (var authServiceChannel = uac.getBlockingAuthServiceChannel()) {<NEW_LINE>LOGGER.trace(CommonMessages.CALL_TO_ROLE_SERVICE_MSG);<NEW_LINE>// TODO: try using futur stub than blocking stub<NEW_LINE>var deleteRoleBindingResponse = authServiceChannel.<MASK><NEW_LINE>LOGGER.trace(CommonMessages.ROLE_SERVICE_RES_RECEIVED_MSG);<NEW_LINE>LOGGER.trace(CommonMessages.ROLE_SERVICE_RES_RECEIVED_TRACE_MSG, deleteRoleBindingResponse);<NEW_LINE>return deleteRoleBindingResponse.getStatus();<NEW_LINE>} catch (StatusRuntimeException ex) {<NEW_LINE>return (Boolean) CommonUtils.retryOrThrowException(ex, retry, (CommonUtils.RetryCallInterface<Boolean>) retry1 -> deleteRoleBindingsUsingServiceUser(retry1, roleBindingNames), timeout);<NEW_LINE>}<NEW_LINE>}
getRoleServiceBlockingStubForServiceUser().deleteRoleBindings(deleteRoleBindingRequest);
1,476,633
public static void main(String[] args) throws Exception {<NEW_LINE>// Connect to the sever<NEW_LINE>ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", PORT).usePlaintext().build();<NEW_LINE>ReactorChatGrpc.ReactorChatStub stub = ReactorChatGrpc.newReactorStub(channel);<NEW_LINE>CountDownLatch done = new CountDownLatch(1);<NEW_LINE>ConsoleReader console = new ConsoleReader();<NEW_LINE>// Prompt the user for their name<NEW_LINE>console.println("Press ctrl+D to quit");<NEW_LINE>String author = console.readLine("Who are you? > ");<NEW_LINE>stub.postMessage(toMessage(author, author + " joined.")).subscribe();<NEW_LINE>// Subscribe to incoming messages<NEW_LINE>Disposable chatSubscription = stub.getMessages(Mono.just(Empty.getDefaultInstance())).subscribe(message -> {<NEW_LINE>// Don't re-print our own messages<NEW_LINE>if (!message.getAuthor().equals(author)) {<NEW_LINE>printLine(console, message.getAuthor(), message.getMessage());<NEW_LINE>}<NEW_LINE>}, throwable -> {<NEW_LINE>printLine(console, "ERROR", throwable.getMessage());<NEW_LINE>done.countDown();<NEW_LINE>}, done::countDown);<NEW_LINE>// Publish outgoing messages<NEW_LINE>Flux.fromIterable(new ConsoleIterator(console, author + " > ")).map(msg -> toMessage(author, msg)).flatMap(stub::postMessage).subscribe(empty -> {<NEW_LINE>}, throwable -> {<NEW_LINE>printLine(console, "ERROR", throwable.getMessage());<NEW_LINE>done.countDown();<NEW_LINE>}, done::countDown);<NEW_LINE>// Wait for a signal to exit, then clean up<NEW_LINE>done.await();<NEW_LINE>stub.postMessage(toMessage(author, author <MASK><NEW_LINE>chatSubscription.dispose();<NEW_LINE>channel.shutdown();<NEW_LINE>channel.awaitTermination(1, TimeUnit.SECONDS);<NEW_LINE>console.getTerminal().restore();<NEW_LINE>}
+ " left.")).subscribe();
1,614,481
public static String generate(ClientConfig clientConfig, int indent) {<NEW_LINE>Preconditions.isNotNull(clientConfig, "ClientConfig");<NEW_LINE>StringBuilder xml = new StringBuilder();<NEW_LINE>xml.append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");<NEW_LINE>XmlGenerator gen = new XmlGenerator(xml);<NEW_LINE>gen.open("hazelcast-client", "xmlns", "http://www.hazelcast.com/schema/client-config", "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance", "xsi:schemaLocation", "http://www.hazelcast.com/schema/client-config " + "http://www.hazelcast.com/schema/client-config/hazelcast-client-config-" + Versions.CURRENT_CLUSTER_VERSION.getMajor() + '.' + Versions.CURRENT_CLUSTER_VERSION.getMinor() + ".xsd");<NEW_LINE>// InstanceName<NEW_LINE>gen.node("instance-name", clientConfig.getInstanceName());<NEW_LINE>gen.node("cluster-name", clientConfig.getClusterName());<NEW_LINE>// attributes<NEW_LINE>gen.appendLabels(clientConfig.getLabels());<NEW_LINE>// Properties<NEW_LINE>gen.appendProperties(clientConfig.getProperties());<NEW_LINE>// Network<NEW_LINE>network(gen, clientConfig.getNetworkConfig());<NEW_LINE>// Backup Ack To Client<NEW_LINE>gen.node("backup-ack-to-client-enabled", clientConfig.isBackupAckToClientEnabled());<NEW_LINE>// Security<NEW_LINE>security(<MASK><NEW_LINE>// Listeners<NEW_LINE>listener(gen, clientConfig.getListenerConfigs());<NEW_LINE>// Serialization<NEW_LINE>serialization(gen, clientConfig.getSerializationConfig());<NEW_LINE>// Native<NEW_LINE>nativeMemory(gen, clientConfig.getNativeMemoryConfig());<NEW_LINE>// ProxyFactories<NEW_LINE>proxyFactory(gen, clientConfig.getProxyFactoryConfigs());<NEW_LINE>// LoadBalancer<NEW_LINE>loadBalancer(gen, clientConfig.getLoadBalancer());<NEW_LINE>// NearCache<NEW_LINE>nearCaches(gen, clientConfig.getNearCacheConfigMap());<NEW_LINE>// QueryCaches<NEW_LINE>queryCaches(gen, clientConfig.getQueryCacheConfigs());<NEW_LINE>// ConnectionStrategy<NEW_LINE>connectionStrategy(gen, clientConfig.getConnectionStrategyConfig());<NEW_LINE>// UserCodeDeployment<NEW_LINE>userCodeDeployment(gen, clientConfig.getUserCodeDeploymentConfig());<NEW_LINE>// FlakeIdGenerator<NEW_LINE>flakeIdGenerator(gen, clientConfig.getFlakeIdGeneratorConfigMap());<NEW_LINE>// Metrics<NEW_LINE>metrics(gen, clientConfig.getMetricsConfig());<NEW_LINE>instanceTrackingConfig(gen, clientConfig.getInstanceTrackingConfig());<NEW_LINE>// close HazelcastClient<NEW_LINE>gen.close();<NEW_LINE>return formatXml(xml.toString(), indent);<NEW_LINE>}
gen, clientConfig.getSecurityConfig());
1,723,829
public static String escapeImages(String string, boolean unescape) {<NEW_LINE>for (Pattern p : Arrays.asList(fImgRegExpQ, fImgRegExpU)) {<NEW_LINE>Matcher m = p.matcher(string);<NEW_LINE>// NOTE: python uses the named group 'fname'. Java doesn't have named groups, so we have to determine<NEW_LINE>// the index based on which pattern we are using<NEW_LINE>int fnameIdx = p.equals(fImgRegExpU) ? 2 : 3;<NEW_LINE>while (m.find()) {<NEW_LINE>String <MASK><NEW_LINE>String fname = m.group(fnameIdx);<NEW_LINE>if (fRemotePattern.matcher(fname).find()) {<NEW_LINE>// dont't do any escaping if remote image<NEW_LINE>} else {<NEW_LINE>if (unescape) {<NEW_LINE>string = string.replace(tag, tag.replace(fname, Uri.decode(fname)));<NEW_LINE>} else {<NEW_LINE>string = string.replace(tag, tag.replace(fname, Uri.encode(fname, "/")));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return string;<NEW_LINE>}
tag = m.group(0);
783,811
private static ActionResponse read(ActionResponse response, HttpURLConnection connection) throws IOException {<NEW_LINE>int code = connection.getResponseCode();<NEW_LINE>if (code >= 500) {<NEW_LINE>try (InputStream input = connection.getErrorStream()) {<NEW_LINE>byte[] buffer = IOUtils.toByteArray(input);<NEW_LINE>response.setMessage(extractErrorMessageIfExist(new String(buffer, DefaultCharset.name)));<NEW_LINE>response.setType(Type.error);<NEW_LINE>}<NEW_LINE>} else if (code >= 400) {<NEW_LINE>response.setMessage(String.format("url invalid error, address: %s, method: %s, code: %d.", Objects.toString(connection.getURL()), connection<MASK><NEW_LINE>response.setType(Type.error);<NEW_LINE>} else if (code == 200) {<NEW_LINE>try (InputStream input = connection.getInputStream()) {<NEW_LINE>byte[] buffer = IOUtils.toByteArray(input);<NEW_LINE>String value = new String(buffer, DefaultCharset.name);<NEW_LINE>response = gson.fromJson(value, ActionResponse.class);<NEW_LINE>} catch (Exception e) {<NEW_LINE>response.setType(Type.connectFatal);<NEW_LINE>response.setMessage(String.format("convert input to json error, address: %s, method: %s, code: %d, because: %s.", Objects.toString(connection.getURL()), connection.getRequestMethod(), code, e.getMessage()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>connection.disconnect();<NEW_LINE>return response;<NEW_LINE>}
.getRequestMethod(), code));
41,026
public static void main(String[] args) throws Exception {<NEW_LINE>DialogViewer.prepare();<NEW_LINE>KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA", "BC");<NEW_LINE>KeyPair caKeyPair = keyGen.genKeyPair();<NEW_LINE>X509CertificateGenerator certGen = new X509CertificateGenerator(X509CertificateVersion.VERSION3);<NEW_LINE>X509Certificate caCert = certGen.generateSelfSigned(new X500Name("cn=CA"), Date.from(Instant.now()), Date.from(Instant.now().plus(3650, ChronoUnit.DAYS)), caKeyPair.getPublic(), caKeyPair.getPrivate(), SignatureType.SHA224WITHRSAANDMGF1, new BigInteger(Hex.decode("1122334455667788990011223344556677889900")));<NEW_LINE>KeyPair eeKeyPair = keyGen.genKeyPair();<NEW_LINE>X509Certificate eeCert = certGen.generate(new X500Name("cn=EE"), X500NameUtils.x500PrincipalToX500Name(caCert.getSubjectX500Principal()), Date.from(Instant.now()), Date.from(Instant.now().plus(365, ChronoUnit.DAYS)), eeKeyPair.getPublic(), eeKeyPair.getPrivate(), SignatureType.SHA224WITHRSAANDMGF1, new BigInteger(Hex.decode("0011223344556677889900112233445566778899")));<NEW_LINE>X509Certificate[] certs = new X509Certificate[] { eeCert, caCert };<NEW_LINE>DViewCertificate dialog = new DViewCertificate(new javax.swing.JFrame(), "Title", certs<MASK><NEW_LINE>DialogViewer.run(dialog);<NEW_LINE>}
, new KseFrame(), IMPORT_EXPORT);
423,662
protected void initColumnAndType() {<NEW_LINE>columns.put(COLUMN_ID, new ColumnMeta(COLUMN_ID, "int(11)", false, true));<NEW_LINE>columnsType.put(COLUMN_ID, Fields.FIELD_TYPE_LONG);<NEW_LINE>columns.put(COLUMN_TYPE, new ColumnMeta(COLUMN_TYPE, "varchar(9)", false));<NEW_LINE>columnsType.<MASK><NEW_LINE>columns.put(COLUMN_USER_TYPE, new ColumnMeta(COLUMN_USER_TYPE, "varchar(12)", false));<NEW_LINE>columnsType.put(COLUMN_USER_TYPE, Fields.FIELD_TYPE_VAR_STRING);<NEW_LINE>columns.put(COLUMN_USERNAME, new ColumnMeta(COLUMN_USERNAME, "varchar(64)", false));<NEW_LINE>columnsType.put(COLUMN_USERNAME, Fields.FIELD_TYPE_VAR_STRING);<NEW_LINE>columns.put(COLUMN_PASSWORD_ENCRYPT, new ColumnMeta(COLUMN_PASSWORD_ENCRYPT, "varchar(200)", false));<NEW_LINE>columnsType.put(COLUMN_PASSWORD_ENCRYPT, Fields.FIELD_TYPE_VAR_STRING);<NEW_LINE>columns.put(COLUMN_ENCRYPT_CONFIGURED, new ColumnMeta(COLUMN_ENCRYPT_CONFIGURED, "varchar(5)", false));<NEW_LINE>columnsType.put(COLUMN_ENCRYPT_CONFIGURED, Fields.FIELD_TYPE_VAR_STRING);<NEW_LINE>columns.put(COLUMN_CONN_ATTR_KEY, new ColumnMeta(COLUMN_CONN_ATTR_KEY, "varchar(6)", true));<NEW_LINE>columnsType.put(COLUMN_CONN_ATTR_KEY, Fields.FIELD_TYPE_VAR_STRING);<NEW_LINE>columns.put(COLUMN_CONN_ATTR_VALUE, new ColumnMeta(COLUMN_CONN_ATTR_VALUE, "varchar(64)", true));<NEW_LINE>columnsType.put(COLUMN_CONN_ATTR_VALUE, Fields.FIELD_TYPE_VAR_STRING);<NEW_LINE>columns.put(COLUMN_WHITE_IPS, new ColumnMeta(COLUMN_WHITE_IPS, "varchar(200)", true));<NEW_LINE>columnsType.put(COLUMN_WHITE_IPS, Fields.FIELD_TYPE_VAR_STRING);<NEW_LINE>columns.put(COLUMN_READONLY, new ColumnMeta(COLUMN_READONLY, "varchar(5)", true));<NEW_LINE>columnsType.put(COLUMN_READONLY, Fields.FIELD_TYPE_VAR_STRING);<NEW_LINE>columns.put(COLUMN_MAX_CONN_COUNT, new ColumnMeta(COLUMN_MAX_CONN_COUNT, "varchar(64)", false));<NEW_LINE>columnsType.put(COLUMN_MAX_CONN_COUNT, Fields.FIELD_TYPE_VAR_STRING);<NEW_LINE>columns.put(COLUMN_BLACKLIST, new ColumnMeta(COLUMN_BLACKLIST, "varchar(64)", true));<NEW_LINE>columnsType.put(COLUMN_BLACKLIST, Fields.FIELD_TYPE_VAR_STRING);<NEW_LINE>}
put(COLUMN_TYPE, Fields.FIELD_TYPE_VAR_STRING);
727,697
public static Object makePlainCellValue(DBCSession session, DBSTypedObject attribute, Object value) throws DBCException {<NEW_LINE>if (value instanceof Map) {<NEW_LINE>Map<String, Object> map = (Map<String, Object>) value;<NEW_LINE>Object typeAttr = map.get(WebSQLConstants.VALUE_TYPE_ATTR);<NEW_LINE>if (typeAttr instanceof String) {<NEW_LINE>switch((String) typeAttr) {<NEW_LINE>case WebSQLConstants.VALUE_TYPE_CONTENT:<NEW_LINE>{<NEW_LINE>if (map.get(WebSQLConstants.ATTR_BINARY) != null) {<NEW_LINE>throw new DBCException("Binary content edit is not supported yet");<NEW_LINE>}<NEW_LINE>value = <MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>DBWValueSerializer<?> valueSerializer = WebServiceRegistry.getInstance().createValueSerializer((String) typeAttr);<NEW_LINE>if (valueSerializer == null) {<NEW_LINE>throw new DBCException("Value type '" + typeAttr + "' edit is not supported yet");<NEW_LINE>}<NEW_LINE>value = valueSerializer.deserializeValue(session, attribute, map);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>}
map.get(WebSQLConstants.ATTR_TEXT);
1,593,619
public byte[] toByteArray() {<NEW_LINE>byte[] guid = new byte[16];<NEW_LINE>byte[] bytes1 = new byte[4];<NEW_LINE>bytes1[0] = (byte) (Data1 >> 24);<NEW_LINE>bytes1[1] = (byte) (Data1 >> 16);<NEW_LINE>bytes1[2] = (byte) (Data1 >> 8);<NEW_LINE>bytes1[3] = (byte) (Data1 >> 0);<NEW_LINE>byte[<MASK><NEW_LINE>bytes2[0] = (byte) (Data2 >> 24);<NEW_LINE>bytes2[1] = (byte) (Data2 >> 16);<NEW_LINE>bytes2[2] = (byte) (Data2 >> 8);<NEW_LINE>bytes2[3] = (byte) (Data2 >> 0);<NEW_LINE>byte[] bytes3 = new byte[4];<NEW_LINE>bytes3[0] = (byte) (Data3 >> 24);<NEW_LINE>bytes3[1] = (byte) (Data3 >> 16);<NEW_LINE>bytes3[2] = (byte) (Data3 >> 8);<NEW_LINE>bytes3[3] = (byte) (Data3 >> 0);<NEW_LINE>System.arraycopy(bytes1, 0, guid, 0, 4);<NEW_LINE>System.arraycopy(bytes2, 2, guid, 4, 2);<NEW_LINE>System.arraycopy(bytes3, 2, guid, 6, 2);<NEW_LINE>System.arraycopy(Data4, 0, guid, 8, 8);<NEW_LINE>return guid;<NEW_LINE>}
] bytes2 = new byte[4];
1,172,567
/* the javascript constructor */<NEW_LINE>private static Object jsConstructor(Context cx, Object[] args) {<NEW_LINE>NativeDate obj = new NativeDate();<NEW_LINE>// if called as a constructor with no args,<NEW_LINE>// return a new Date with the current time.<NEW_LINE>if (args.length == 0) {<NEW_LINE>obj.date = now();<NEW_LINE>return obj;<NEW_LINE>}<NEW_LINE>// if called with just one arg -<NEW_LINE>if (args.length == 1) {<NEW_LINE>Object arg0 = args[0];<NEW_LINE>if (arg0 instanceof NativeDate) {<NEW_LINE>obj.date = ((NativeDate) arg0).date;<NEW_LINE>return obj;<NEW_LINE>}<NEW_LINE>if (arg0 instanceof Scriptable) {<NEW_LINE>arg0 = ((Scriptable) arg0).getDefaultValue(null);<NEW_LINE>}<NEW_LINE>double date;<NEW_LINE>if (arg0 instanceof CharSequence) {<NEW_LINE>// it's a string; parse it.<NEW_LINE>date = date_parseString(cx, arg0.toString());<NEW_LINE>} else {<NEW_LINE>// if it's not a string, use it as a millisecond date<NEW_LINE>date = ScriptRuntime.toNumber(arg0);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>return obj;<NEW_LINE>}<NEW_LINE>double time = date_msecFromArgs(args);<NEW_LINE>if (!Double.isNaN(time) && !Double.isInfinite(time))<NEW_LINE>time = TimeClip(internalUTC(cx, time));<NEW_LINE>obj.date = time;<NEW_LINE>return obj;<NEW_LINE>}
obj.date = TimeClip(date);
1,617,340
public DescribeElasticsearchDomainsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeElasticsearchDomainsResult describeElasticsearchDomainsResult = new DescribeElasticsearchDomainsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeElasticsearchDomainsResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("DomainStatusList", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeElasticsearchDomainsResult.setDomainStatusList(new ListUnmarshaller<ElasticsearchDomainStatus>(ElasticsearchDomainStatusJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return describeElasticsearchDomainsResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
426,722
public static String saveTimedImage(BufferedImage img, String path, String name) {<NEW_LINE>RunTime.pause(0.01f);<NEW_LINE>if (null == path) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>File fImage = new File(path, name);<NEW_LINE>String formatName = "png";<NEW_LINE>if (name == null) {<NEW_LINE>fImage = new File(path, String.format("noname-%d.png", name, new Date().getTime()));<NEW_LINE>} else if (name.startsWith("#")) {<NEW_LINE>fImage = new File(path, String.format("%s-%d.png", name.substring(1), new Date().getTime()));<NEW_LINE>} else if (!name.isEmpty()) {<NEW_LINE>if (!name.contains(".")) {<NEW_LINE>fImage = new File(path, name + ".png");<NEW_LINE>} else {<NEW_LINE>formatName = name.substring(name.lastIndexOf(".") + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ImageIO.write(img, formatName, fImage);<NEW_LINE><MASK><NEW_LINE>} catch (Exception ex) {<NEW_LINE>log(-1, "saveTimedImage: did not work: %s (%s)", fImage, ex.getMessage());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return fImage.getAbsolutePath();<NEW_LINE>}
log(3, "saveImage: %s", fImage);
208,803
public List executeQuery(QueryBuilder filter, AggregationBuilder aggregation, final EntityMetadata entityMetadata, KunderaQuery query, int firstResult, int maxResults) {<NEW_LINE>String[] fieldsToSelect = query.getResult();<NEW_LINE>Class clazz = entityMetadata.getEntityClazz();<NEW_LINE>MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().<MASK><NEW_LINE>FilteredQueryBuilder queryBuilder = QueryBuilders.filteredQuery(null, filter);<NEW_LINE>SearchRequestBuilder builder = txClient.prepareSearch(entityMetadata.getSchema().toLowerCase()).setTypes(entityMetadata.getTableName());<NEW_LINE>addFieldsToBuilder(fieldsToSelect, clazz, metaModel, builder);<NEW_LINE>if (aggregation == null) {<NEW_LINE>builder.setQuery(queryBuilder);<NEW_LINE>builder.setFrom(firstResult);<NEW_LINE>builder.setSize(maxResults);<NEW_LINE>addSortOrder(builder, query, entityMetadata);<NEW_LINE>} else {<NEW_LINE>logger.debug("Aggregated query identified");<NEW_LINE>builder.addAggregation(aggregation);<NEW_LINE>if (fieldsToSelect.length == 1 || (query.isSelectStatement() && query.getSelectStatement().hasGroupByClause())) {<NEW_LINE>builder.setSize(0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SearchResponse response = null;<NEW_LINE>logger.debug("Query generated: " + builder);<NEW_LINE>try {<NEW_LINE>response = builder.execute().actionGet();<NEW_LINE>logger.debug("Query execution response: " + response);<NEW_LINE>} catch (ElasticsearchException e) {<NEW_LINE>logger.error("Exception occured while executing query on Elasticsearch.", e);<NEW_LINE>throw new KunderaException("Exception occured while executing query on Elasticsearch.", e);<NEW_LINE>}<NEW_LINE>return esResponseReader.parseResponse(response, aggregation, fieldsToSelect, metaModel, clazz, entityMetadata, query);<NEW_LINE>}
getMetamodel(entityMetadata.getPersistenceUnit());
1,045,393
private void loadNode985() {<NEW_LINE>BaseDataVariableTypeNode node = new BaseDataVariableTypeNode(this.context, Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics_QueryFirstCount, new QualifiedName(0, "QueryFirstCount"), new LocalizedText("en", "QueryFirstCount"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.ServiceCounterDataType, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics_QueryFirstCount, Identifiers.HasTypeDefinition, Identifiers.BaseDataVariableType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics_QueryFirstCount, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics_QueryFirstCount, Identifiers.HasComponent, Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics.expanded(), false));<NEW_LINE><MASK><NEW_LINE>}
this.nodeManager.addNode(node);
1,015,091
private void findTokensToWrap(InfixExpression node, int depth) {<NEW_LINE>Expression left = node.getLeftOperand();<NEW_LINE>if (left instanceof InfixExpression && samePrecedence(node, (InfixExpression) left)) {<NEW_LINE>findTokensToWrap((InfixExpression) left, depth + 1);<NEW_LINE>} else if (// always add first operand, it will be taken as wrap parent<NEW_LINE>this.wrapIndexes.isEmpty() || !this.options.wrap_before_binary_operator) {<NEW_LINE>this.wrapIndexes.add(this.tm.firstIndexIn(left, -1));<NEW_LINE>}<NEW_LINE>Expression right = node.getRightOperand();<NEW_LINE>List<Expression> extended = node.extendedOperands();<NEW_LINE>for (int i = -1; i < extended.size(); i++) {<NEW_LINE>Expression operand = (i == -1) ? right : extended.get(i);<NEW_LINE>if (operand instanceof InfixExpression && samePrecedence(node, (InfixExpression) operand)) {<NEW_LINE>findTokensToWrap((InfixExpression) operand, depth + 1);<NEW_LINE>}<NEW_LINE>int indexBefore = this.tm.firstIndexBefore(operand, -1);<NEW_LINE>while (this.tm.get(indexBefore).isComment()) indexBefore--;<NEW_LINE>assert node.getOperator().toString().equals(this.tm.toString(indexBefore));<NEW_LINE>int indexAfter = this.tm.firstIndexIn(operand, -1);<NEW_LINE>this.wrapIndexes.add(this.<MASK><NEW_LINE>this.secondaryWrapIndexes.add(this.options.wrap_before_binary_operator ? indexAfter : indexBefore);<NEW_LINE>if (!this.options.join_wrapped_lines) {<NEW_LINE>// TODO there should be an option for never joining wraps on opposite side of the operator<NEW_LINE>if (this.options.wrap_before_binary_operator) {<NEW_LINE>if (this.tm.countLineBreaksBetween(this.tm.get(indexAfter - 1), this.tm.get(indexAfter)) > 0)<NEW_LINE>this.wrapIndexes.add(indexAfter);<NEW_LINE>} else {<NEW_LINE>if (this.tm.countLineBreaksBetween(this.tm.get(indexBefore), this.tm.get(indexBefore - 1)) > 0)<NEW_LINE>this.wrapIndexes.add(indexBefore);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
options.wrap_before_binary_operator ? indexBefore : indexAfter);
176,583
public void write(org.apache.thrift.protocol.TProtocol prot, TSummarizerConfiguration struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet optionals = new java.util.BitSet();<NEW_LINE>if (struct.isSetClassname()) {<NEW_LINE>optionals.set(0);<NEW_LINE>}<NEW_LINE>if (struct.isSetOptions()) {<NEW_LINE>optionals.set(1);<NEW_LINE>}<NEW_LINE>if (struct.isSetConfigId()) {<NEW_LINE>optionals.set(2);<NEW_LINE>}<NEW_LINE>oprot.writeBitSet(optionals, 3);<NEW_LINE>if (struct.isSetClassname()) {<NEW_LINE>oprot.writeString(struct.classname);<NEW_LINE>}<NEW_LINE>if (struct.isSetOptions()) {<NEW_LINE>{<NEW_LINE>oprot.writeI32(struct.options.size());<NEW_LINE>for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter99 : struct.options.entrySet()) {<NEW_LINE>oprot.<MASK><NEW_LINE>oprot.writeString(_iter99.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (struct.isSetConfigId()) {<NEW_LINE>oprot.writeString(struct.configId);<NEW_LINE>}<NEW_LINE>}
writeString(_iter99.getKey());
805,573
public final OptionListContext optionList() throws RecognitionException {<NEW_LINE>OptionListContext _localctx = new OptionListContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 18, RULE_optionList);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(131);<NEW_LINE>match(LBRACK);<NEW_LINE>setState(132);<NEW_LINE>option();<NEW_LINE>setState(137);<NEW_LINE>_errHandler.sync(this);<NEW_LINE><MASK><NEW_LINE>while (_la == COMMA) {<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(133);<NEW_LINE>match(COMMA);<NEW_LINE>setState(134);<NEW_LINE>option();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(139);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>}<NEW_LINE>setState(140);<NEW_LINE>match(RBRACK);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
_la = _input.LA(1);
1,728,012
private boolean createAlignedTimeseries(List<String> seriesList, InsertPlan insertPlan) throws IllegalPathException {<NEW_LINE>List<String> measurements = new ArrayList<>();<NEW_LINE>for (String series : seriesList) {<NEW_LINE>measurements.add((new PartialPath(series)).getMeasurement());<NEW_LINE>}<NEW_LINE>List<TSDataType> dataTypes = new ArrayList<>(measurements.size());<NEW_LINE>List<TSEncoding> encodings = new ArrayList<>(measurements.size());<NEW_LINE>List<CompressionType> compressors = new ArrayList<>(measurements.size());<NEW_LINE>for (int index = 0; index < measurements.size(); index++) {<NEW_LINE>TSDataType dataType;<NEW_LINE>if (insertPlan.getDataTypes() != null && insertPlan.getDataTypes()[index] != null) {<NEW_LINE>dataType = <MASK><NEW_LINE>} else {<NEW_LINE>dataType = TypeInferenceUtils.getPredictedDataType(insertPlan instanceof InsertTabletPlan ? Array.get(((InsertTabletPlan) insertPlan).getColumns()[index], 0) : ((InsertRowPlan) insertPlan).getValues()[index], true);<NEW_LINE>}<NEW_LINE>dataTypes.add(dataType);<NEW_LINE>encodings.add(getDefaultEncoding(dataType));<NEW_LINE>compressors.add(TSFileDescriptor.getInstance().getConfig().getCompressor());<NEW_LINE>}<NEW_LINE>CreateAlignedTimeSeriesPlan plan = new CreateAlignedTimeSeriesPlan(insertPlan.getDevicePath(), measurements, dataTypes, encodings, compressors, null, null, null);<NEW_LINE>TSStatus result;<NEW_LINE>try {<NEW_LINE>result = coordinator.processPartitionedPlan(plan);<NEW_LINE>} catch (UnsupportedPlanException e) {<NEW_LINE>logger.error("Failed to create timeseries {} automatically. Unsupported plan exception {} ", plan, e.getMessage());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (result.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode() && result.getCode() != TSStatusCode.PATH_ALREADY_EXIST_ERROR.getStatusCode() && result.getCode() != TSStatusCode.NEED_REDIRECTION.getStatusCode()) {<NEW_LINE>logger.error("{} failed to execute create timeseries {}: {}", metaGroupMember.getThisNode(), plan, result);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
insertPlan.getDataTypes()[index];
618,537
private void invalidateLines(int startLine, int oldEndLine, int newEndLine, boolean textChanged, boolean bidiRequiredForNewText) {<NEW_LINE>checkDisposed();<NEW_LINE>if (textChanged) {<NEW_LINE>LineLayout firstOldLine = startLine >= 0 && startLine < myLines.size() ? myLines.get(startLine) : null;<NEW_LINE>LineLayout lastOldLine = oldEndLine >= 0 && oldEndLine < myLines.size() ? myLines.get(oldEndLine) : null;<NEW_LINE>if (firstOldLine == null || lastOldLine == null || !firstOldLine.isLtr() || !lastOldLine.isLtr())<NEW_LINE>bidiRequiredForNewText = true;<NEW_LINE>}<NEW_LINE>int endLine = Math.min(oldEndLine, newEndLine);<NEW_LINE>for (int line = startLine; line <= endLine; line++) {<NEW_LINE>LineLayout lineLayout = myLines.get(line);<NEW_LINE>if (lineLayout != null) {<NEW_LINE>removeChunksFromCache(lineLayout);<NEW_LINE>myLines.set(line, (textChanged && bidiRequiredForNewText) || !lineLayout.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (oldEndLine < newEndLine) {<NEW_LINE>myLines.addAll(oldEndLine + 1, Collections.nCopies(newEndLine - oldEndLine, null));<NEW_LINE>} else if (oldEndLine > newEndLine) {<NEW_LINE>List<LineLayout> layouts = myLines.subList(newEndLine + 1, oldEndLine + 1);<NEW_LINE>for (LineLayout layout : layouts) {<NEW_LINE>if (layout != null) {<NEW_LINE>removeChunksFromCache(layout);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>layouts.clear();<NEW_LINE>}<NEW_LINE>}
isLtr() ? null : myBidiNotRequiredMarker);
1,421,468
// -------------------------------------------------------------------------<NEW_LINE>@Override<NEW_LINE>public Function<Double, Double> differentiate(Function<Double, Double> function) {<NEW_LINE>ArgChecker.notNull(function, "function");<NEW_LINE>switch(differenceType) {<NEW_LINE>case FORWARD:<NEW_LINE>return new Function<Double, Double>() {<NEW_LINE><NEW_LINE>@SuppressWarnings("synthetic-access")<NEW_LINE>@Override<NEW_LINE>public Double apply(Double x) {<NEW_LINE>ArgChecker.notNull(x, "x");<NEW_LINE>return (function.apply(x + eps) - function.apply(x)) / eps;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>case CENTRAL:<NEW_LINE>return new Function<Double, Double>() {<NEW_LINE><NEW_LINE>@SuppressWarnings("synthetic-access")<NEW_LINE>@Override<NEW_LINE>public Double apply(Double x) {<NEW_LINE><MASK><NEW_LINE>return (function.apply(x + eps) - function.apply(x - eps)) / twoEps;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>case BACKWARD:<NEW_LINE>return new Function<Double, Double>() {<NEW_LINE><NEW_LINE>@SuppressWarnings("synthetic-access")<NEW_LINE>@Override<NEW_LINE>public Double apply(Double x) {<NEW_LINE>ArgChecker.notNull(x, "x");<NEW_LINE>return (function.apply(x) - function.apply(x - eps)) / eps;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Can only handle forward, backward and central differencing");<NEW_LINE>}<NEW_LINE>}
ArgChecker.notNull(x, "x");
25,977
public Collection<ErrorDescription> check(JPAProblemContext ctx, HintContext hc, AttributeWrapper attrib) {<NEW_LINE>Set<Modifier> fieldModifiers = attrib.getInstanceVariable() == null ? null : attrib.getInstanceVariable().getModifiers();<NEW_LINE>Set<Modifier> accesorModifiers = attrib.getAccesor() == null ? null : attrib.getAccesor().getModifiers();<NEW_LINE>Set<Modifier> mutatorModifiers = attrib.getMutator() == null ? null : attrib.getMutator().getModifiers();<NEW_LINE>List<ErrorDescription> errors = new ArrayList<ErrorDescription>();<NEW_LINE>if (fieldModifiers != null) {<NEW_LINE>if (fieldModifiers.contains(Modifier.PUBLIC)) {<NEW_LINE>// TODO: error by default<NEW_LINE>errors.addAll(getErr(ctx, hc, attrib, "MSG_PublicVariable"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (accesorModifiers != null) {<NEW_LINE>if (ctx.getAccessType() == AccessType.PROPERTY && !accesorModifiers.contains(Modifier.PUBLIC) && !accesorModifiers.contains(Modifier.PROTECTED)) {<NEW_LINE>// TODO: error by default<NEW_LINE>errors.addAll(getErr(ctx, hc, attrib, "MSG_NonPublicAccesor"));<NEW_LINE>}<NEW_LINE>if (accesorModifiers.contains(Modifier.FINAL)) {<NEW_LINE>// TODO: error by default<NEW_LINE>errors.addAll(getErr(ctx, hc, attrib, "MSG_FinalAccesor"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mutatorModifiers != null) {<NEW_LINE>// See issue 151387<NEW_LINE>// if (!mutatorModifiers.contains(Modifier.PUBLIC)<NEW_LINE>// && !mutatorModifiers.contains(Modifier.PROTECTED)){<NEW_LINE>if (mutatorModifiers.contains(Modifier.PRIVATE)) {<NEW_LINE>// TODO: warning by default<NEW_LINE>errors.addAll(getErr(ctx, hc, attrib, "MSG_NonPublicMutator"));<NEW_LINE>}<NEW_LINE>// see issue #108876<NEW_LINE>// else if (attrib.getModelElement() instanceof Id<NEW_LINE>// && mutatorModifiers.contains(Modifier.PUBLIC)){<NEW_LINE>// errors.add(Rule.createProblem(attrib.getMutator(), ctx,<NEW_LINE>// NbBundle.getMessage(ValidModifiers.class, "MSG_PublicIdMutatorDiscouraged"),<NEW_LINE>// Severity.WARNING));<NEW_LINE>// }<NEW_LINE>if (mutatorModifiers.contains(Modifier.FINAL)) {<NEW_LINE>// TODO: error by default<NEW_LINE>errors.addAll(getErr(ctx<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return errors;<NEW_LINE>}
, hc, attrib, "MSG_FinalMutator"));