idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
968,476
public static void convert(InterleavedF64 input, InterleavedI16 output) {<NEW_LINE>if (input.isSubimage() || output.isSubimage()) {<NEW_LINE>final int N = input.width * input.getNumBands();<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, input.height, y -> {<NEW_LINE>for (int y = 0; y < input.height; y++) {<NEW_LINE>int indexSrc = input.getIndex(0, y);<NEW_LINE>int indexDst = output.getIndex(0, y);<NEW_LINE>for (int x = 0; x < N; x++) {<NEW_LINE>output.data[indexDst++] = (short) (input.data[indexSrc++]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} else {<NEW_LINE>final int N = input.width * input<MASK><NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopBlocks(0,N,(i0,i1)->{<NEW_LINE>int i0 = 0, i1 = N;<NEW_LINE>for (int i = i0; i < i1; i++) {<NEW_LINE>output.data[i] = (short) (input.data[i]);<NEW_LINE>}<NEW_LINE>// CONCURRENT_INLINE });<NEW_LINE>}<NEW_LINE>}
.height * input.getNumBands();
1,119,951
public BuilderSingularNoAuto build() {<NEW_LINE>java.util.List<String> things;<NEW_LINE>switch(this.things == null ? 0 : this.things.size()) {<NEW_LINE>case 0:<NEW_LINE>things = java.util.Collections.emptyList();<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>things = java.util.Collections.singletonList(this.things.get(0));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>things = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.things));<NEW_LINE>}<NEW_LINE>java.util.List<String> widgets;<NEW_LINE>switch(this.widgets == null ? 0 : this.widgets.size()) {<NEW_LINE>case 0:<NEW_LINE>widgets = java.util.Collections.emptyList();<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>widgets = java.util.Collections.singletonList(this<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>widgets = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.widgets));<NEW_LINE>}<NEW_LINE>java.util.List<String> items;<NEW_LINE>switch(this.items == null ? 0 : this.items.size()) {<NEW_LINE>case 0:<NEW_LINE>items = java.util.Collections.emptyList();<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>items = java.util.Collections.singletonList(this.items.get(0));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>items = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.items));<NEW_LINE>}<NEW_LINE>return new BuilderSingularNoAuto(things, widgets, items);<NEW_LINE>}
.widgets.get(0));
97,308
public void configurationUsage() {<NEW_LINE>Map<String, String> properties = new HashMap<>();<NEW_LINE>properties.put("azure.sdk.<client-name>.http.proxy.port", "8080");<NEW_LINE>properties.put("azure.sdk.http.proxy.hostname", "<host");<NEW_LINE>properties.put("azure.sdk.http.proxy.username", "user");<NEW_LINE>properties.put("azure.sdk.http.proxy.password", "pwd");<NEW_LINE>Configuration configuration = new ConfigurationBuilder(new SampleSource(properties)).root("azure.sdk").buildSection("<client-name>");<NEW_LINE>// BEGIN: com.azure.core.util.Configuration.get#ConfigurationProperty<NEW_LINE>ConfigurationProperty<String> property = ConfigurationPropertyBuilder.ofString("http.proxy.hostname").shared(true).logValue(true).systemPropertyName("http.proxyHost").build();<NEW_LINE>// attempts to get local `azure.sdk.<client-name>.http.proxy.host` property and falls back to<NEW_LINE>// shared azure.sdk.http.proxy.port<NEW_LINE>System.out.println<MASK><NEW_LINE>// END: com.azure.core.util.Configuration.get#ConfigurationProperty<NEW_LINE>}
(configuration.get(property));
252,429
public void analyze(Analyzer analyzer) throws UserException {<NEW_LINE>super.analyze(analyzer);<NEW_LINE>if (tableName == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>tableName.analyze(analyzer);<NEW_LINE>Table table = analyzer.getTableOrAnalysisException(tableName);<NEW_LINE>if (!(table instanceof View)) {<NEW_LINE>throw new AnalysisException(String.format("ALTER VIEW not allowed on a table:%s.%s", getDbName(), getTable()));<NEW_LINE>}<NEW_LINE>if (!Catalog.getCurrentCatalog().getAuth().checkTblPriv(ConnectContext.get(), tableName.getDb(), tableName.getTbl(), PrivPredicate.ALTER)) {<NEW_LINE>ErrorReport.reportAnalysisException(ErrorCode.ERR_TABLEACCESS_DENIED_ERROR, "ALTER VIEW", ConnectContext.get().getQualifiedUser(), ConnectContext.get().getRemoteIP(), tableName.getDb() + ": " + tableName.getTbl());<NEW_LINE>}<NEW_LINE>if (cols != null) {<NEW_LINE>cloneStmt = viewDefStmt.clone();<NEW_LINE>}<NEW_LINE>viewDefStmt.setNeedToSql(true);<NEW_LINE>Analyzer viewAnalyzer = new Analyzer(analyzer);<NEW_LINE>viewDefStmt.analyze(viewAnalyzer);<NEW_LINE>createColumnAndViewDefs(analyzer);<NEW_LINE>}
ErrorReport.reportAnalysisException(ErrorCode.ERR_NO_TABLES_USED);
260,060
private void updateBalancingState() {<NEW_LINE>List<Subchannel> <MASK><NEW_LINE>if (activeList.isEmpty()) {<NEW_LINE>// No READY subchannels, determine aggregate state and error status<NEW_LINE>boolean isConnecting = false;<NEW_LINE>Status aggStatus = EMPTY_OK;<NEW_LINE>for (Subchannel subchannel : getSubchannels()) {<NEW_LINE>ConnectivityStateInfo stateInfo = getSubchannelStateInfoRef(subchannel).value;<NEW_LINE>// This subchannel IDLE is not because of channel IDLE_TIMEOUT,<NEW_LINE>// in which case LB is already shutdown.<NEW_LINE>// LRLB will request connection immediately on subchannel IDLE.<NEW_LINE>if (stateInfo.getState() == CONNECTING || stateInfo.getState() == IDLE) {<NEW_LINE>isConnecting = true;<NEW_LINE>}<NEW_LINE>if (aggStatus == EMPTY_OK || !aggStatus.isOk()) {<NEW_LINE>aggStatus = stateInfo.getStatus();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If all subchannels are TRANSIENT_FAILURE, return the Status associated with<NEW_LINE>updateBalancingState(// If all subchannels are TRANSIENT_FAILURE, return the Status associated with<NEW_LINE>isConnecting ? CONNECTING : TRANSIENT_FAILURE, // an arbitrary subchannel, otherwise return OK.<NEW_LINE>new EmptyPicker(aggStatus));<NEW_LINE>} else {<NEW_LINE>updateBalancingState(READY, new ReadyPicker(activeList, choiceCount, random));<NEW_LINE>}<NEW_LINE>}
activeList = filterNonFailingSubchannels(getSubchannels());
1,022,717
public static void proxyResponseHeaders(Map<String, String> respHeaders, SimpleHttpResp resp) {<NEW_LINE>for (Map.Entry<String, String> hdr : respHeaders.entrySet()) {<NEW_LINE>String name = hdr.getKey();<NEW_LINE>String value = hdr.getValue();<NEW_LINE>if (name.equalsIgnoreCase("Content-type")) {<NEW_LINE>resp.contentType = MediaType.of(value);<NEW_LINE>} else if (name.equalsIgnoreCase("Set-Cookie")) {<NEW_LINE>String[] parts = value.split("=", 2);<NEW_LINE>U.must(parts.length == 2, "Invalid value of the Set-Cookie header!");<NEW_LINE>if (resp.cookies == null) {<NEW_LINE>resp.cookies = U.map();<NEW_LINE>}<NEW_LINE>resp.cookies.put(parts[0], parts[1]);<NEW_LINE>} else if (!ignoreResponseHeaderInProxy(name)) {<NEW_LINE>if (resp.headers == null) {<NEW_LINE>resp<MASK><NEW_LINE>}<NEW_LINE>resp.headers.put(name, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.headers = U.map();
1,260,276
public void drawBackground(@Nonnull PoseStack matrix, int mouseX, int mouseY, float partialTicks) {<NEW_LINE>super.drawBackground(matrix, mouseX, mouseY, partialTicks);<NEW_LINE><MASK><NEW_LINE>if (textScale == 1F) {<NEW_LINE>renderTextField(matrix, mouseX, mouseY, partialTicks);<NEW_LINE>} else {<NEW_LINE>// hacky. we should write our own renderer at some point.<NEW_LINE>float reverse = (1 / textScale) - 1;<NEW_LINE>float yAdd = 4 - (textScale * 8) / 2F;<NEW_LINE>matrix.pushPose();<NEW_LINE>matrix.scale(textScale, textScale, textScale);<NEW_LINE>matrix.translate(textField.x * reverse, (textField.y) * reverse + yAdd * (1 / textScale), 0);<NEW_LINE>renderTextField(matrix, mouseX, mouseY, partialTicks);<NEW_LINE>matrix.popPose();<NEW_LINE>}<NEW_LINE>MekanismRenderer.resetColor();<NEW_LINE>if (iconType != null) {<NEW_LINE>RenderSystem.setShaderTexture(0, iconType.getIcon());<NEW_LINE>blit(matrix, x + 2, y + (height / 2) - (int) Math.ceil(iconType.getHeight() / 2F), 0, 0, iconType.getWidth(), iconType.getHeight(), iconType.getWidth(), iconType.getHeight());<NEW_LINE>}<NEW_LINE>}
backgroundType.render(this, matrix);
1,171,445
private void initPanel() {<NEW_LINE>setBorder(new EmptyBorder(1, 2, 3, 5));<NEW_LINE>// configure toolbar<NEW_LINE>JToolBar toolbar = new JToolBar(JToolBar.HORIZONTAL);<NEW_LINE>toolbar.setFloatable(false);<NEW_LINE>toolbar.setRollover(true);<NEW_LINE>toolbar.setBorderPainted(false);<NEW_LINE>// create toggle buttons<NEW_LINE>int filterCount = filtersDesc.getFilterCount();<NEW_LINE>toggles = new ArrayList(filterCount);<NEW_LINE>JToggleButton toggleButton = null;<NEW_LINE>Map fStates <MASK><NEW_LINE>for (int i = 0; i < filterCount; i++) {<NEW_LINE>toggleButton = createToggle(fStates, i);<NEW_LINE>toggles.add(toggleButton);<NEW_LINE>}<NEW_LINE>// add toggle buttons<NEW_LINE>JToggleButton curToggle;<NEW_LINE>Dimension space = new Dimension(3, 0);<NEW_LINE>for (int i = 0; i < toggles.size(); i++) {<NEW_LINE>curToggle = (JToggleButton) toggles.get(i);<NEW_LINE>curToggle.addActionListener(this);<NEW_LINE>toolbar.add(curToggle);<NEW_LINE>if (i != toggles.size() - 1) {<NEW_LINE>toolbar.addSeparator(space);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>add(toolbar);<NEW_LINE>// initialize member states map<NEW_LINE>synchronized (STATES_LOCK) {<NEW_LINE>filterStates = fStates;<NEW_LINE>}<NEW_LINE>}
= new HashMap(filterCount * 2);
1,834,140
private Future<Map<String, Config>> topicConfigs(Collection<String> topicNames) {<NEW_LINE>LOGGER.debugCr(reconciliation, "Getting topic configs for {} topics", topicNames.size());<NEW_LINE>List<ConfigResource> configs = topicNames.stream().map((String topicName) -> new ConfigResource(ConfigResource.Type.TOPIC, topicName)).collect(Collectors.toList());<NEW_LINE>Promise<Map<String, Config><MASK><NEW_LINE>ac.describeConfigs(configs).all().whenComplete((topicNameToConfig, error) -> {<NEW_LINE>if (error != null) {<NEW_LINE>promise.fail(error);<NEW_LINE>} else {<NEW_LINE>LOGGER.debugCr(reconciliation, "Got topic configs for {} topics", topicNames.size());<NEW_LINE>promise.complete(topicNameToConfig.entrySet().stream().collect(Collectors.toMap(entry -> entry.getKey().name(), entry -> entry.getValue())));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return promise.future();<NEW_LINE>}
> promise = Promise.promise();
1,094,209
private static void buildCollisionConvexHulls(TileSet tileSet, BufferedImage image, TextureSet.Builder textureSet) {<NEW_LINE>if (image != null) {<NEW_LINE>ConvexHulls convexHulls = TileSetUtil.calculateConvexHulls(image.getAlphaRaster(), 16, image.getWidth(), image.getHeight(), tileSet.getTileWidth(), tileSet.getTileHeight(), tileSet.getTileMargin(<MASK><NEW_LINE>for (int i = 0; i < convexHulls.hulls.length; ++i) {<NEW_LINE>ConvexHull convexHull = convexHulls.hulls[i];<NEW_LINE>Tile.ConvexHull.Builder hullBuilder = Tile.ConvexHull.newBuilder();<NEW_LINE>String collisionGroup = "";<NEW_LINE>if (i < tileSet.getConvexHullsCount()) {<NEW_LINE>collisionGroup = tileSet.getConvexHulls(i).getCollisionGroup();<NEW_LINE>}<NEW_LINE>hullBuilder.setCollisionGroup(collisionGroup).setCount(convexHull.getCount()).setIndex(convexHull.getIndex());<NEW_LINE>textureSet.addConvexHulls(hullBuilder);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < convexHulls.points.length; ++i) {<NEW_LINE>textureSet.addCollisionHullPoints(convexHulls.points[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>textureSet.addAllCollisionGroups(tileSet.getCollisionGroupsList());<NEW_LINE>}
), tileSet.getTileSpacing());
422,431
protected List<ProductCategory> fetchImpactedChildrenProductCategories(ProductCategory productCategory) throws AxelorException {<NEW_LINE>// security in case of code error to avoid infinite loop<NEW_LINE>int i = 0;<NEW_LINE>List<ProductCategory> descendantsProductCategoryList = new ArrayList<>();<NEW_LINE>if (productCategory.getId() == null) {<NEW_LINE>// if product category is not saved, then it cannot have children<NEW_LINE>return descendantsProductCategoryList;<NEW_LINE>}<NEW_LINE>// product categories with max discounts are not be impacted<NEW_LINE>List<ProductCategory> childrenProductCategoryList = fetchChildrenWitNoMaxDiscount(productCategory);<NEW_LINE>while (!childrenProductCategoryList.isEmpty() && i < MAX_ITERATION) {<NEW_LINE>List<ProductCategory> nextChildrenProductCategoryList = new ArrayList<>();<NEW_LINE>for (ProductCategory childProductCategory : childrenProductCategoryList) {<NEW_LINE>if (descendantsProductCategoryList.contains(childProductCategory) || childProductCategory.equals(productCategory)) {<NEW_LINE>throw new AxelorException(TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, I18n.get(IExceptionMessage.PRODUCT_CATEGORY_CHILDREN_CIRCULAR_DEPENDENCY), childProductCategory.getCode());<NEW_LINE>}<NEW_LINE>descendantsProductCategoryList.add(childProductCategory);<NEW_LINE>nextChildrenProductCategoryList<MASK><NEW_LINE>}<NEW_LINE>childrenProductCategoryList.clear();<NEW_LINE>childrenProductCategoryList.addAll(nextChildrenProductCategoryList);<NEW_LINE>nextChildrenProductCategoryList.clear();<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>return descendantsProductCategoryList;<NEW_LINE>}
.addAll(fetchChildrenWitNoMaxDiscount(childProductCategory));
1,173,043
public static void vertical(GrayU8 input, GrayI16 output, int radius, @Nullable GrowArray<DogArray_I32> workspaces) {<NEW_LINE>workspaces = BoofMiscOps.checkDeclare(workspaces, DogArray_I32::new);<NEW_LINE>// CONCURRENT_REMOVE_LINE<NEW_LINE>final DogArray_I32 work = workspaces.grow();<NEW_LINE>final int kernelWidth = radius * 2 + 1;<NEW_LINE>final int backStep = kernelWidth * input.stride;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopBlocks(radius, output.height-radius, kernelWidth, workspaces, (work, y0,y1)->{<NEW_LINE>final int y0 = radius, y1 = output.height - radius;<NEW_LINE>int[] totals = BoofMiscOps.checkDeclare(work, input.width, false);<NEW_LINE>for (int x = 0; x < input.width; x++) {<NEW_LINE>int indexIn = input.startIndex + (y0 - radius) * input.stride + x;<NEW_LINE>int indexOut = output.startIndex + output.stride * y0 + x;<NEW_LINE>int total = 0;<NEW_LINE>int indexEnd <MASK><NEW_LINE>for (; indexIn < indexEnd; indexIn += input.stride) {<NEW_LINE>total += input.data[indexIn] & 0xFF;<NEW_LINE>}<NEW_LINE>totals[x] = total;<NEW_LINE>output.data[indexOut] = (short) total;<NEW_LINE>}<NEW_LINE>// change the order it is processed in to reduce cache misses<NEW_LINE>for (int y = y0 + 1; y < y1; y++) {<NEW_LINE>int indexIn = input.startIndex + (y + radius) * input.stride;<NEW_LINE>int indexOut = output.startIndex + y * output.stride;<NEW_LINE>for (int x = 0; x < input.width; x++, indexIn++, indexOut++) {<NEW_LINE>int total = totals[x] - (input.data[indexIn - backStep] & 0xFF);<NEW_LINE>totals[x] = total += input.data[indexIn] & 0xFF;<NEW_LINE>output.data[indexOut] = (short) total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_INLINE });<NEW_LINE>}
= indexIn + input.stride * kernelWidth;
731,556
// Analyze the next item in the queue. Leave it in the queue until analysis is complete.<NEW_LINE>// Any switch to dumb mode during a read action or a write action will cancel this analysis,<NEW_LINE>// which will restart with the same item.<NEW_LINE>boolean processNextItem(@NotNull Project project, @NotNull WorkItem item) {<NEW_LINE>if (item.isCancelled) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>if (item.hasFilesToRewrite()) {<NEW_LINE>app.invokeLater(() -> rewriteNextFile(project, item));<NEW_LINE>return true;<NEW_LINE>} else if (item.hasClasses()) {<NEW_LINE>analyzeNextClass(project, item);<NEW_LINE>return true;<NEW_LINE>} else if (item.hasFilesToAnalyze()) {<NEW_LINE>analyzeNextFile(project, item);<NEW_LINE>return true;<NEW_LINE>} else if (item.hasPackages()) {<NEW_LINE>analyzeNextPackage(project, item);<NEW_LINE>return true;<NEW_LINE>} else if (item.hasFilesToCheck()) {<NEW_LINE>checkNextFile(project, item);<NEW_LINE>return true;<NEW_LINE>} else if (item.hasFilesToDelete()) {<NEW_LINE>app.invokeLater(() -> deleteNextFile(project, item));<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
Application app = ApplicationManager.getApplication();
1,763,853
public boolean open(CharSequence tableName) {<NEW_LINE>if (hideTelemetryTables && (Chars.equals(tableName, TelemetryJob.tableName) || Chars.equals(tableName, TelemetryJob.configTableName))) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int pathLen = path.length();<NEW_LINE>try {<NEW_LINE>path.chop$().concat(tableName).<MASK><NEW_LINE>metaReader.of(path.$(), ColumnType.VERSION);<NEW_LINE>// Pre-read as much as possible to skip record instead of failing on column fetch<NEW_LINE>tableId = metaReader.getId();<NEW_LINE>maxUncommittedRows = metaReader.getMaxUncommittedRows();<NEW_LINE>commitLag = metaReader.getCommitLag();<NEW_LINE>partitionBy = metaReader.getPartitionBy();<NEW_LINE>} catch (CairoException e) {<NEW_LINE>// perhaps this folder is not a table<NEW_LINE>// remove it from the result set<NEW_LINE>LOG.info().$("cannot query table metadata [table=").$(tableName).$(", error=").$(e.getFlyweightMessage()).$(", errno=").$(e.getErrno()).I$();<NEW_LINE>return false;<NEW_LINE>} finally {<NEW_LINE>path.trimTo(pathLen).$();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
concat(META_FILE_NAME).$();
1,287,888
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>jScrollPane1 = new javax.swing.JScrollPane();<NEW_LINE>cfgTree = new javax.swing.JTree();<NEW_LINE>// NOI18N<NEW_LINE>setName(org.openide.util.NbBundle.getMessage(FmtSpaces.class, "LBL_Spaces"));<NEW_LINE>setOpaque(false);<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>cfgTree.setRootVisible(false);<NEW_LINE>jScrollPane1.setViewportView(cfgTree);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridwidth <MASK><NEW_LINE>gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.weighty = 1.0;<NEW_LINE>add(jScrollPane1, gridBagConstraints);<NEW_LINE>}
= java.awt.GridBagConstraints.REMAINDER;
1,081,793
private void monitor(MeterRegistry registry, ForkJoinPool fj) {<NEW_LINE>FunctionCounter.builder(metricPrefix + "executor.steals", fj, ForkJoinPool::getStealCount).tags(tags).description("Estimate of the total number of tasks stolen from " + "one thread's work queue by another. The reported value " + "underestimates the actual total number of steals when the pool " + "is not quiescent").register(registry);<NEW_LINE>Gauge.builder(metricPrefix + "executor.queued", fj, ForkJoinPool::getQueuedTaskCount).tags(tags).description("An estimate of the total number of tasks currently held in queues by worker threads").register(registry);<NEW_LINE>Gauge.builder(metricPrefix + "executor.active", fj, ForkJoinPool::getActiveThreadCount).tags(tags).description("An estimate of the number of threads that are currently stealing or executing tasks").register(registry);<NEW_LINE>Gauge.builder(metricPrefix + "executor.running", fj, ForkJoinPool::getRunningThreadCount).tags(tags).description<MASK><NEW_LINE>}
("An estimate of the number of worker threads that are not blocked waiting to join tasks or for other managed synchronization threads").register(registry);
1,060,959
public Layer instantiate(NeuralNetConfiguration conf, Collection<TrainingListener> iterationListeners, int layerIndex, INDArray layerParamsView, boolean initializeParams) {<NEW_LINE>// The instantiate method is how we go from the configuration class (i.e., this class) to the implementation class<NEW_LINE>// (i.e., a CustomLayerImpl instance)<NEW_LINE>// For the most part, it's the same for each type of layer<NEW_LINE>CustomLayerImpl myCustomLayer = new CustomLayerImpl(conf);<NEW_LINE>// Set the iteration listeners, if any<NEW_LINE>myCustomLayer.setListeners(iterationListeners);<NEW_LINE>// Integer index of the layer<NEW_LINE>myCustomLayer.setIndex(layerIndex);<NEW_LINE>// Parameter view array: In Deeplearning4j, the network parameters for the entire network (all layers) are<NEW_LINE>// allocated in one big array. The relevant section of this parameter vector is extracted out for each layer,<NEW_LINE>// (i.e., it's a "view" array in that it's a subset of a larger array)<NEW_LINE>// This is a row vector, with length equal to the number of parameters in the layer<NEW_LINE>myCustomLayer.setParamsViewArray(layerParamsView);<NEW_LINE>// Initialize the layer parameters. For example,<NEW_LINE>// Note that the entries in paramTable (2 entries here: a weight array of shape [nIn,nOut] and biases of shape [1,nOut]<NEW_LINE>// are in turn a view of the 'layerParamsView' array.<NEW_LINE>Map<String, INDArray> paramTable = initializer().<MASK><NEW_LINE>myCustomLayer.setParamTable(paramTable);<NEW_LINE>myCustomLayer.setConf(conf);<NEW_LINE>return myCustomLayer;<NEW_LINE>}
init(conf, layerParamsView, initializeParams);
1,671,359
private static void addNonNullObject(IsolatedSpeculationReasonEncoding encoding, Object o) {<NEW_LINE>Class<?> c = o.getClass();<NEW_LINE>if (c == String.class) {<NEW_LINE>encoding<MASK><NEW_LINE>} else if (c == Byte.class) {<NEW_LINE>encoding.addByte((Byte) o);<NEW_LINE>} else if (c == Short.class) {<NEW_LINE>encoding.addShort((Short) o);<NEW_LINE>} else if (c == Character.class) {<NEW_LINE>encoding.addShort((Character) o);<NEW_LINE>} else if (c == Integer.class) {<NEW_LINE>encoding.addInt((Integer) o);<NEW_LINE>} else if (c == Long.class) {<NEW_LINE>encoding.addLong((Long) o);<NEW_LINE>} else if (c == Float.class) {<NEW_LINE>encoding.addInt(Float.floatToRawIntBits((Float) o));<NEW_LINE>} else if (c == Double.class) {<NEW_LINE>encoding.addLong(Double.doubleToRawLongBits((Double) o));<NEW_LINE>} else if (o instanceof Enum) {<NEW_LINE>encoding.addInt(((Enum<?>) o).ordinal());<NEW_LINE>} else if (o instanceof ResolvedJavaMethod) {<NEW_LINE>encoding.addMethod((ResolvedJavaMethod) o);<NEW_LINE>} else if (o instanceof ResolvedJavaType) {<NEW_LINE>encoding.addType((ResolvedJavaType) o);<NEW_LINE>} else if (o instanceof ResolvedJavaField) {<NEW_LINE>encoding.addField((ResolvedJavaField) o);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unsupported type for encoding: " + c.getName());<NEW_LINE>}<NEW_LINE>}
.addString((String) o);
287,059
public static Vector combineIndexRowSplits(int matrixId, int rowId, int resultSize, KeyPart[] keyParts, ValuePart[] valueParts) {<NEW_LINE>// Get matrix meta<NEW_LINE>MatrixMeta matrixMeta = PSAgentContext.get().getMatrixMetaManager().getMatrixMeta(matrixId);<NEW_LINE>RowType rowType = matrixMeta.getRowType();<NEW_LINE>switch(rowType) {<NEW_LINE>case T_DOUBLE_DENSE:<NEW_LINE>case T_DOUBLE_SPARSE:<NEW_LINE>return combineIntDoubleIndexRowSplits(matrixId, rowId, <MASK><NEW_LINE>case T_FLOAT_DENSE:<NEW_LINE>case T_FLOAT_SPARSE:<NEW_LINE>return combineIntFloatIndexRowSplits(matrixId, rowId, resultSize, keyParts, valueParts, matrixMeta);<NEW_LINE>case T_INT_DENSE:<NEW_LINE>case T_INT_SPARSE:<NEW_LINE>return combineIntIntIndexRowSplits(matrixId, rowId, resultSize, keyParts, valueParts, matrixMeta);<NEW_LINE>case T_LONG_DENSE:<NEW_LINE>case T_LONG_SPARSE:<NEW_LINE>return combineIntLongIndexRowSplits(matrixId, rowId, resultSize, keyParts, valueParts, matrixMeta);<NEW_LINE>case T_DOUBLE_SPARSE_LONGKEY:<NEW_LINE>return combineLongDoubleIndexRowSplits(matrixId, rowId, resultSize, keyParts, valueParts, matrixMeta);<NEW_LINE>case T_FLOAT_SPARSE_LONGKEY:<NEW_LINE>return combineLongFloatIndexRowSplits(matrixId, rowId, resultSize, keyParts, valueParts, matrixMeta);<NEW_LINE>case T_INT_SPARSE_LONGKEY:<NEW_LINE>return combineLongIntIndexRowSplits(matrixId, rowId, resultSize, keyParts, valueParts, matrixMeta);<NEW_LINE>case T_LONG_SPARSE_LONGKEY:<NEW_LINE>return combineLongLongIndexRowSplits(matrixId, rowId, resultSize, keyParts, valueParts, matrixMeta);<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException("unsupport row type " + rowType);<NEW_LINE>}<NEW_LINE>}
resultSize, keyParts, valueParts, matrixMeta);
1,635,652
public static void runDatabaseScript() throws ClassNotFoundException, SQLException {<NEW_LINE>if (!Thread.currentThread().getName().equals("main")) {<NEW_LINE>// During development this class is called twice (because of the Spring developer tools)<NEW_LINE>logger.debug("Skipping database script check for thread {}", Thread.currentThread().getName());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>File databaseFile = new File(<MASK><NEW_LINE>File databaseScriptFile = new File(NzbHydra.getDataFolder(), "databaseScript.sql");<NEW_LINE>File databaseScriptFileNew = new File(NzbHydra.getDataFolder(), "databaseScriptNew.sql");<NEW_LINE>if (!databaseFile.exists()) {<NEW_LINE>logger.debug("No database file found - no recreation needed");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Class.forName("org.h2.Driver");<NEW_LINE>String dbConnectionUrl = "jdbc:h2:file:" + databaseFile.getAbsolutePath().replace(".mv.db", "");<NEW_LINE>if (isDatabaseRecreationNotNeeded(dbConnectionUrl)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>createDatabaseScript(databaseScriptFile, dbConnectionUrl);<NEW_LINE>deleteExistingDatabase(databaseFile);<NEW_LINE>replaceSchemaVersionChanges(databaseScriptFile, databaseScriptFileNew);<NEW_LINE>runDatabaseScript(databaseScriptFile, dbConnectionUrl);<NEW_LINE>}
NzbHydra.getDataFolder(), "database/nzbhydra.mv.db");
98,147
public void run(RegressionEnvironment env) {<NEW_LINE>SupportContextListener listener = new SupportContextListener(env);<NEW_LINE>env.runtime().getContextPartitionService().addContextStateListener(listener);<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@name('ctx') @public create context MyContext group by intPrimitive > 0 as pos, group by intPrimitive < 0 as neg from SupportBean", path);<NEW_LINE>env.compileDeploy("@name('s0') context MyContext select count(*) from SupportBean", path);<NEW_LINE>List<ContextStateEventContextPartitionAllocated> allocated = listener.getAllocatedEvents();<NEW_LINE>assertEquals(2, allocated.size());<NEW_LINE>assertEquals("neg", ((ContextPartitionIdentifierCategory) allocated.get(1).getIdentifier<MASK><NEW_LINE>listener.getAndReset();<NEW_LINE>env.undeployModuleContaining("s0");<NEW_LINE>env.undeployModuleContaining("ctx");<NEW_LINE>env.runtime().getContextPartitionService().removeContextStateListeners();<NEW_LINE>}
()).getLabel());
660,333
final GetAWSOrganizationsAccessStatusResult executeGetAWSOrganizationsAccessStatus(GetAWSOrganizationsAccessStatusRequest getAWSOrganizationsAccessStatusRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getAWSOrganizationsAccessStatusRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<GetAWSOrganizationsAccessStatusRequest> request = null;<NEW_LINE>Response<GetAWSOrganizationsAccessStatusResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetAWSOrganizationsAccessStatusRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getAWSOrganizationsAccessStatusRequest));<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, "Service Catalog");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetAWSOrganizationsAccessStatus");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetAWSOrganizationsAccessStatusResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetAWSOrganizationsAccessStatusResultJsonUnmarshaller());<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.startEvent(Field.ClientExecuteTime);
35,940
private static void checkAttributeValue(String argName, String value) throws InvalidArgumentException {<NEW_LINE>checkNullArgument(argName, value);<NEW_LINE>checkCharacterData(argName, value);<NEW_LINE>int index = value.indexOf('<');<NEW_LINE>if (index != -1) {<NEW_LINE>throw new InvalidArgumentException(argName, Util.THIS<MASK><NEW_LINE>}<NEW_LINE>index = value.indexOf('&');<NEW_LINE>if (index != -1) {<NEW_LINE>throw new InvalidArgumentException(argName, Util.THIS.getString("EXC_invalid_attribute_value", value));<NEW_LINE>}<NEW_LINE>boolean apostrofFound = false;<NEW_LINE>boolean quoteFound = false;<NEW_LINE>for (int i = 0, len = value.length(); i < len; i++) {<NEW_LINE>char c = value.charAt(i);<NEW_LINE>if (c == '\'')<NEW_LINE>if (quoteFound)<NEW_LINE>throw new InvalidArgumentException(argName, Util.THIS.getString("EXC_invalid_attribute_value", value));<NEW_LINE>else<NEW_LINE>apostrofFound = true;<NEW_LINE>if (c == '"')<NEW_LINE>if (apostrofFound)<NEW_LINE>throw new InvalidArgumentException(argName, Util.THIS.getString("EXC_invalid_attribute_value", value));<NEW_LINE>else<NEW_LINE>quoteFound = true;<NEW_LINE>}<NEW_LINE>}
.getString("EXC_invalid_attribute_value", value));
1,775,141
private void createDetailLines() {<NEW_LINE>StringBuffer sql = new StringBuffer(s_insert);<NEW_LINE>// (AD_PInstance_ID, Fact_Acct_ID,<NEW_LINE>sql.append("SELECT ").append(getAD_PInstance_ID()).append(",Fact_Acct_ID,");<NEW_LINE>// AD_Client_ID, AD_Org_ID, Created,CreatedBy, Updated,UpdatedBy,<NEW_LINE>sql.append(getAD_Client_ID()).append(",AD_Org_ID,Created,CreatedBy, Updated,UpdatedBy,");<NEW_LINE>// C_AcctSchema_ID, Account_ID, DateTrx, AccountValue, DateAcct, C_Period_ID,<NEW_LINE>sql.append("C_AcctSchema_ID, Account_ID, null, DateTrx, DateAcct, C_Period_ID,");<NEW_LINE>// AD_Table_ID, Record_ID, Line_ID,<NEW_LINE>sql.append("AD_Table_ID, Record_ID, Line_ID,");<NEW_LINE>// GL_Category_ID, GL_Budget_ID, C_Tax_ID, M_Locator_ID, PostingType,<NEW_LINE>sql.append("GL_Category_ID, GL_Budget_ID, C_Tax_ID, M_Locator_ID, PostingType,");<NEW_LINE>// C_Currency_ID, AmtSourceDr, AmtSourceCr, AmtSourceBalance,<NEW_LINE>sql.append("C_Currency_ID, AmtSourceDr,AmtSourceCr, AmtSourceDr-AmtSourceCr,");<NEW_LINE>// AmtAcctDr, AmtAcctCr, AmtAcctBalance, C_UOM_ID, Qty,<NEW_LINE>sql.append(" AmtAcctDr,AmtAcctCr, AmtAcctDr-AmtAcctCr, C_UOM_ID,Qty,");<NEW_LINE>// M_Product_ID, C_BPartner_ID, AD_OrgTrx_ID, C_LocFrom_ID,C_LocTo_ID,<NEW_LINE>sql.append("M_Product_ID, C_BPartner_ID, AD_OrgTrx_ID, C_LocFrom_ID,C_LocTo_ID,");<NEW_LINE>// C_SalesRegion_ID, C_Project_ID, C_Campaign_ID, C_Activity_ID,<NEW_LINE>sql.append("C_SalesRegion_ID, C_Project_ID, C_Campaign_ID, C_Activity_ID,");<NEW_LINE>// User1_ID, User2_ID, User3_ID, User4_ID , A_Asset_ID, Description)<NEW_LINE>sql.append("User1_ID, User2_ID, User3_ID, User4_ID, A_Asset_ID, Description");<NEW_LINE>//<NEW_LINE>sql.append(" FROM Fact_Acct WHERE AD_Client_ID=").append(getAD_Client_ID()).append(" AND ").append(m_parameterWhere).append(" AND DateAcct >= ").append(DB.TO_DATE(p_DateAcct_From, true)).append(" AND TRUNC(DateAcct, 'DD') <= ").append(DB.TO_DATE(p_DateAcct_To, true));<NEW_LINE>//<NEW_LINE>sql.append(" AND Account_ID IN (");<NEW_LINE>if (plID != null && !plID.isEmpty())<NEW_LINE>sql.append(plID);<NEW_LINE>if (bsID != null && !bsID.isEmpty()) {<NEW_LINE>if (plID != null && !plID.isEmpty())<NEW_LINE>sql.append(",");<NEW_LINE>sql.append(bsID);<NEW_LINE>}<NEW_LINE>sql.append(")");<NEW_LINE>int no = DB.executeUpdate(sql.toString(), get_TrxName());<NEW_LINE>if (no == 0)<NEW_LINE>log.fine(sql.toString());<NEW_LINE>log.fine("#" + no + " (Account_ID=" + p_Account_ID + ")");<NEW_LINE>// Update AccountValue<NEW_LINE>String sql2 = "UPDATE T_TrialBalance tb SET AccountValue = " + "(SELECT Value FROM C_ElementValue ev WHERE ev.C_ElementValue_ID=tb.Account_ID) " + "WHERE tb.Account_ID IS NOT NULL AND tb.AD_PInstance_ID = " + getAD_PInstance_ID();<NEW_LINE>no = DB.<MASK><NEW_LINE>if (no > 0)<NEW_LINE>log.fine("Set AccountValue #" + no);<NEW_LINE>}
executeUpdate(sql2, get_TrxName());
1,253,898
public void processAction(RequiredActionContext context) {<NEW_LINE>EventBuilder event = context.getEvent();<NEW_LINE>event.event(EventType.UPDATE_TOTP);<NEW_LINE>MultivaluedMap<String, String> formData = context.getHttpRequest().getDecodedFormParameters();<NEW_LINE>String challengeResponse = formData.getFirst("totp");<NEW_LINE>String totpSecret = context.getAuthenticationSession().getAuthNote("totpSecret");<NEW_LINE>String userLabel = formData.getFirst("userLabel");<NEW_LINE>OTPPolicy policy = context.getRealm().getOTPPolicy();<NEW_LINE>OTPCredentialModel credentialModel = OTPCredentialModel.createFromPolicy(context.getRealm(), totpSecret, userLabel);<NEW_LINE>if (Validation.isBlank(challengeResponse)) {<NEW_LINE>context.challenge(challenge(context).message(Messages.MISSING_TOTP));<NEW_LINE>return;<NEW_LINE>} else if (!CredentialValidation.validOTP(challengeResponse, credentialModel, policy.getLookAheadWindow())) {<NEW_LINE>context.challenge(challenge(context).message(Messages.INVALID_TOTP));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!CredentialHelper.createOTPCredential(context.getSession(), context.getRealm(), context.getUser(), challengeResponse, credentialModel)) {<NEW_LINE>context.challenge(challenge(context)<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>context.getAuthenticationSession().removeAuthNote("totpSecret");<NEW_LINE>context.success();<NEW_LINE>}
.message(Messages.INVALID_TOTP));
948,755
public void undoScale(SceneStructureProjective structure, SceneObservations observations) {<NEW_LINE>if (!structure.homogenous) {<NEW_LINE>double scale = desiredDistancePoint / medianDistancePoint;<NEW_LINE>undoNormPoints3D(structure, scale);<NEW_LINE>DMatrixRMaj A = new DMatrixRMaj(3, 3);<NEW_LINE>DMatrixRMaj A_inv = new DMatrixRMaj(3, 3);<NEW_LINE>Point3D_F64 a = new Point3D_F64();<NEW_LINE>Point3D_F64 c = new Point3D_F64();<NEW_LINE>for (int i = 0; i < structure.views.size; i++) {<NEW_LINE>SceneStructureProjective.View view = structure.views.data[i];<NEW_LINE>// X_w = inv(A)*(X_c - T) let X_c = 0 then X_w = -inv(A)*T is center of camera in world<NEW_LINE>CommonOps_DDRM.extract(view.worldToView, 0, 0, A);<NEW_LINE>PerspectiveOps.extractColumn(view.worldToView, 3, a);<NEW_LINE>CommonOps_DDRM.invert(A, A_inv);<NEW_LINE>GeometryMath_F64.mult(A_inv, a, c);<NEW_LINE>// Apply transform<NEW_LINE>c.x = -c.x / scale + medianPoint.x;<NEW_LINE>c.y = -c<MASK><NEW_LINE>c.z = -c.z / scale + medianPoint.z;<NEW_LINE>// -A*T<NEW_LINE>GeometryMath_F64.mult(A, c, a);<NEW_LINE>a.scale(-1);<NEW_LINE>PerspectiveOps.insertColumn(view.worldToView, 3, a);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>undoScaleToPixelsAndCameraMatrix(structure, observations);<NEW_LINE>}
.y / scale + medianPoint.y;
1,123,418
public void handleEditingFinished(Set<E> editedObjects) {<NEW_LINE>if (editedObjects.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>OWLAxiom newAxiom = createAxiom(editedObjects.iterator().next());<NEW_LINE>// the editor should protect from this, but just in case<NEW_LINE>if (newAxiom == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>A oldAxiom = getAxiom();<NEW_LINE>Set<OWLAnnotation> axiomAnnotations = oldAxiom.getAnnotations();<NEW_LINE>if (!axiomAnnotations.isEmpty()) {<NEW_LINE>newAxiom = newAxiom.getAnnotatedAxiom(axiomAnnotations);<NEW_LINE>}<NEW_LINE>List<OWLOntologyChange> changes = new ArrayList<>();<NEW_LINE>OWLOntology ontology = getOntology();<NEW_LINE>if (ontology != null) {<NEW_LINE>changes.add(new RemoveAxiom(ontology, oldAxiom));<NEW_LINE>changes.add(new AddAxiom(ontology, newAxiom));<NEW_LINE>} else {<NEW_LINE>OWLOntology activeOntology = getOWLModelManager().getActiveOntology();<NEW_LINE>changes.add(<MASK><NEW_LINE>}<NEW_LINE>getOWLModelManager().applyChanges(changes);<NEW_LINE>}
new AddAxiom(activeOntology, newAxiom));
35,737
public void validate(PlainAccessResource plainAccessResource) {<NEW_LINE>// Check the global white remote addr<NEW_LINE>for (RemoteAddressStrategy remoteAddressStrategy : globalWhiteRemoteAddressStrategy) {<NEW_LINE>if (remoteAddressStrategy.match(plainAccessResource)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (plainAccessResource.getAccessKey() == null) {<NEW_LINE>throw new AclException<MASK><NEW_LINE>}<NEW_LINE>if (!accessKeyTable.containsKey(plainAccessResource.getAccessKey())) {<NEW_LINE>throw new AclException(String.format("No acl config for %s", plainAccessResource.getAccessKey()));<NEW_LINE>}<NEW_LINE>// Check the white addr for accesskey<NEW_LINE>String aclFileName = accessKeyTable.get(plainAccessResource.getAccessKey());<NEW_LINE>PlainAccessResource ownedAccess = aclPlainAccessResourceMap.get(aclFileName).get(plainAccessResource.getAccessKey());<NEW_LINE>if (null == ownedAccess) {<NEW_LINE>throw new AclException(String.format("No PlainAccessResource for accessKey=%s", plainAccessResource.getAccessKey()));<NEW_LINE>}<NEW_LINE>if (ownedAccess.getRemoteAddressStrategy().match(plainAccessResource)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Check the signature<NEW_LINE>String signature = AclUtils.calSignature(plainAccessResource.getContent(), ownedAccess.getSecretKey());<NEW_LINE>if (!signature.equals(plainAccessResource.getSignature())) {<NEW_LINE>throw new AclException(String.format("Check signature failed for accessKey=%s", plainAccessResource.getAccessKey()));<NEW_LINE>}<NEW_LINE>// Skip the topic RMQ_SYS_TRACE_TOPIC permission check,if the topic RMQ_SYS_TRACE_TOPIC is used for message trace<NEW_LINE>Map<String, Byte> resourcePermMap = plainAccessResource.getResourcePermMap();<NEW_LINE>if (resourcePermMap != null) {<NEW_LINE>Byte permission = resourcePermMap.get(TopicValidator.RMQ_SYS_TRACE_TOPIC);<NEW_LINE>if (permission != null && permission == Permission.PUB) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Check perm of each resource<NEW_LINE>checkPerm(plainAccessResource, ownedAccess);<NEW_LINE>}
(String.format("No accessKey is configured"));
192,966
public MarkupDocBuilder tableWithColumnSpecs(List<MarkupTableColumn> columnSpecs, List<List<String>> cells) {<NEW_LINE>Validate.notEmpty(cells, "cells must not be null");<NEW_LINE>Boolean hasHeader = false;<NEW_LINE>List<String> options = new ArrayList<>();<NEW_LINE>List<String> cols = new ArrayList<>();<NEW_LINE>if (columnSpecs != null && !columnSpecs.isEmpty()) {<NEW_LINE>for (MarkupTableColumn col : columnSpecs) {<NEW_LINE>if (!hasHeader && isNotBlank(col.header)) {<NEW_LINE>options.add("header");<NEW_LINE>hasHeader = true;<NEW_LINE>}<NEW_LINE>String languageStyle = col.markupSpecifiers.get(MarkupLanguage.ASCIIDOC);<NEW_LINE>if (languageStyle != null && isNoneBlank(languageStyle)) {<NEW_LINE>cols.add(languageStyle);<NEW_LINE>} else {<NEW_LINE>cols.add(String.valueOf(col.widthRatio) + (col.headerColumn ? "h" : ""));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>newLine();<NEW_LINE>documentBuilder.append("[options=\"").append(join(options, ",")).append("\", cols=\"").append(join(cols, ",")).append<MASK><NEW_LINE>documentBuilder.append(AsciiDoc.TABLE).append(newLine);<NEW_LINE>if (hasHeader) {<NEW_LINE>Collection<String> headerList = columnSpecs.stream().map(header -> formatTableCell(defaultString(header.header))).collect(Collectors.toList());<NEW_LINE>documentBuilder.append(AsciiDoc.TABLE_COLUMN_DELIMITER).append(join(headerList, AsciiDoc.TABLE_COLUMN_DELIMITER.toString())).append(newLine);<NEW_LINE>}<NEW_LINE>for (List<String> row : cells) {<NEW_LINE>Collection<String> cellList = row.stream().map(cell -> formatTableCell(defaultString(cell))).collect(Collectors.toList());<NEW_LINE>documentBuilder.append(AsciiDoc.TABLE_COLUMN_DELIMITER).append(join(cellList, AsciiDoc.TABLE_COLUMN_DELIMITER.toString())).append(newLine);<NEW_LINE>}<NEW_LINE>documentBuilder.append(AsciiDoc.TABLE).append(newLine);<NEW_LINE>newLine();<NEW_LINE>return this;<NEW_LINE>}
("\"]").append(newLine);
1,661,383
public void init(Map<String, String> properties) throws PluginException {<NEW_LINE>try {<NEW_LINE>if (properties.containsKey(PROP_MAX_BATCH_SIZE)) {<NEW_LINE>maxBatchSize = Long.valueOf(properties.get(PROP_MAX_BATCH_SIZE));<NEW_LINE>}<NEW_LINE>if (properties.containsKey(PROP_MAX_BATCH_INTERVAL_SEC)) {<NEW_LINE>maxBatchIntervalSec = Long.valueOf(properties.get(PROP_MAX_BATCH_INTERVAL_SEC));<NEW_LINE>}<NEW_LINE>if (properties.containsKey(PROP_MAX_QUEUE_SIZE)) {<NEW_LINE>maxQueueSize = Integer.valueOf(properties.get(PROP_MAX_QUEUE_SIZE));<NEW_LINE>}<NEW_LINE>if (properties.containsKey(PROP_FRONTEND_HOST_PORT)) {<NEW_LINE>frontendHostPort = properties.get(PROP_FRONTEND_HOST_PORT);<NEW_LINE>}<NEW_LINE>if (properties.containsKey(PROP_USER)) {<NEW_LINE>user = properties.get(PROP_USER);<NEW_LINE>}<NEW_LINE>if (properties.containsKey(PROP_PASSWORD)) {<NEW_LINE>password = properties.get(PROP_PASSWORD);<NEW_LINE>}<NEW_LINE>if (properties.containsKey(PROP_DATABASE)) {<NEW_LINE>database = properties.get(PROP_DATABASE);<NEW_LINE>}<NEW_LINE>if (properties.containsKey(PROP_TABLE)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (properties.containsKey(MAX_STMT_LENGTH)) {<NEW_LINE>max_stmt_length = Integer.parseInt(properties.get(MAX_STMT_LENGTH));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new PluginException(e.getMessage());<NEW_LINE>}<NEW_LINE>}
table = properties.get(PROP_TABLE);
1,681,706
public int orderOfLargestPlusSign(int n, int[][] mines) {<NEW_LINE>int[][] grid = <MASK><NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>for (int j = 0; j < n; j++) {<NEW_LINE>grid[i][j] = n;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < mines.length; i++) {<NEW_LINE>grid[mines[i][0]][mines[i][1]] = 0;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>for (int j = 0, k = n - 1, l = 0, r = 0, u = 0, d = 0; j < n; j++, k--) {<NEW_LINE>// left direction<NEW_LINE>grid[i][j] = Math.min(grid[i][j], l = (grid[i][j] == 0 ? 0 : l + 1));<NEW_LINE>// right direction<NEW_LINE>grid[i][k] = Math.min(grid[i][k], r = (grid[i][k] == 0 ? 0 : r + 1));<NEW_LINE>// upwards<NEW_LINE>grid[j][i] = Math.min(grid[j][i], u = (grid[j][i] == 0 ? 0 : u + 1));<NEW_LINE>// downwards<NEW_LINE>grid[k][i] = Math.min(grid[k][i], d = (grid[k][i] == 0 ? 0 : d + 1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int result = 0;<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>for (int j = 0; j < n; j++) {<NEW_LINE>result = Math.max(result, grid[i][j]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
new int[n][n];
254,592
public ApiResponse<List<Pet>> findPetsByStatusWithHttpInfo(List<String> status) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'status' is set<NEW_LINE>if (status == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/pet/findByStatus";<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, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "status", status));<NEW_LINE>final String[<MASK><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[] { "http_signature_test", "petstore_auth" };<NEW_LINE>GenericType<List<Pet>> localVarReturnType = new GenericType<List<Pet>>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI("PetApi.findPetsByStatus", localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false);<NEW_LINE>}
] localVarAccepts = { "application/xml", "application/json" };
313,568
private static Collection<String> refreshUpdateCenters(ProgressHandle progress) {<NEW_LINE>final long startTime = System.currentTimeMillis();<NEW_LINE>Collection<String> problems = new HashSet<String>();<NEW_LINE>assert !SwingUtilities.isEventDispatchThread() : "Cannot run refreshProviders in EQ!";<NEW_LINE>Collection<RequestProcessor.Task> refreshTasks = new HashSet<RequestProcessor.Task>();<NEW_LINE>List<UpdateUnitProvider> providers = UpdateUnitProviderFactory.getDefault().getUpdateUnitProviders(true);<NEW_LINE>RequestProcessor rp = new RequestProcessor("autoupdate-refresh-providers", providers.size(), false);<NEW_LINE>for (UpdateUnitProvider p : providers) {<NEW_LINE>RequestProcessor.Task t = rp.post(getRefresher(p, problems, progress));<NEW_LINE>refreshTasks.add(t);<NEW_LINE>}<NEW_LINE>err.log(Level.FINEST, "Waiting for all refreshTasks...");<NEW_LINE>for (RequestProcessor.Task t : refreshTasks) {<NEW_LINE>t.waitFinished();<NEW_LINE>}<NEW_LINE>err.<MASK><NEW_LINE>long time = (System.currentTimeMillis() - startTime) / 1000;<NEW_LINE>if (time > 0) {<NEW_LINE>Utilities.putTimeOfRefreshUpdateCenters(time);<NEW_LINE>}<NEW_LINE>return problems;<NEW_LINE>}
log(Level.FINEST, "Waiting for all refreshTasks is done.");
1,852,926
private void onAnimateUpdated(@NonNull ValueAnimator animation) {<NEW_LINE>int color = (<MASK><NEW_LINE>int colorReverse = (int) animation.getAnimatedValue(ANIMATION_COLOR_REVERSE);<NEW_LINE>int radius = (int) animation.getAnimatedValue(ANIMATION_RADIUS);<NEW_LINE>int radiusReverse = (int) animation.getAnimatedValue(ANIMATION_RADIUS_REVERSE);<NEW_LINE>int stroke = (int) animation.getAnimatedValue(ANIMATION_STROKE);<NEW_LINE>int strokeReverse = (int) animation.getAnimatedValue(ANIMATION_STROKE_REVERSE);<NEW_LINE>value.setColor(color);<NEW_LINE>value.setColorReverse(colorReverse);<NEW_LINE>value.setRadius(radius);<NEW_LINE>value.setRadiusReverse(radiusReverse);<NEW_LINE>value.setStroke(stroke);<NEW_LINE>value.setStrokeReverse(strokeReverse);<NEW_LINE>if (listener != null) {<NEW_LINE>listener.onValueUpdated(value);<NEW_LINE>}<NEW_LINE>}
int) animation.getAnimatedValue(ANIMATION_COLOR);
349,528
private Mono<Response<Void>> deleteWithResponseAsync(String resourceGroup, String linkedSubscriptionName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<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 (resourceGroup == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (linkedSubscriptionName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter linkedSubscriptionName 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.getSubscriptionId(), resourceGroup, linkedSubscriptionName, this.client.<MASK><NEW_LINE>}
getApiVersion(), accept, context);
687,881
void decode(Decoder decoder, Instruction instruction) {<NEW_LINE>if ((((decoder.state_zs_flags & StateFlags.B) | decoder.state_vvvv_invalidCheck) & decoder.invalidCheckMask) != 0)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>instruction.setCode(code);<NEW_LINE>instruction.setOp1Register(decoder.state_reg + decoder.state_zs_extraRegisterBase + decoder.state_extraRegisterBaseEVEX + baseReg2);<NEW_LINE>if (((decoder.state_zs_flags & StateFlags.Z) & disallowZeroingMasking & decoder.invalidCheckMask) != 0)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>if (decoder.state_mod == 3) {<NEW_LINE>instruction.setOp0Register(decoder.state_rm + decoder.state_extraBaseRegisterBaseEVEX + baseReg1);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>if (((decoder.state_zs_flags & StateFlags.Z) & decoder.invalidCheckMask) != 0)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>decoder.readOpMem(instruction, tupleType);<NEW_LINE>}<NEW_LINE>}
instruction.setOp0Kind(OpKind.MEMORY);
1,162,468
public void run(CompilationController controller) throws IOException {<NEW_LINE>// cursor position needed<NEW_LINE>controller.toPhase(Phase.RESOLVED);<NEW_LINE>if (cancelled) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TreePath treePath = controller.getTreeUtilities().pathFor(caretPosition);<NEW_LINE>if (treePath != null) {<NEW_LINE>if (cancelled) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>while (parent != null) {<NEW_LINE>Tree.Kind parentKind = parent.getLeaf().getKind();<NEW_LINE>if ((TreeUtilities.CLASS_TREE_KINDS.contains(parentKind)) || (parentKind == Tree.Kind.COMPILATION_UNIT)) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>treePath = parent;<NEW_LINE>parent = treePath.getParentPath();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (treePath != null) {<NEW_LINE>if (cancelled) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>element = controller.getTrees().getElement(treePath);<NEW_LINE>} catch (IllegalArgumentException ex) {<NEW_LINE>Logger.getLogger("global").log(Level.WARNING, null, ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
TreePath parent = treePath.getParentPath();
373,654
private Object unaryExpr(TokenStream ts) throws IOException, JavaScriptException {<NEW_LINE>int tt;<NEW_LINE>ts.flags |= ts.TSF_REGEXP;<NEW_LINE>tt = ts.getToken();<NEW_LINE>ts.flags &= ~ts.TSF_REGEXP;<NEW_LINE>switch(tt) {<NEW_LINE>case TokenStream.UNARYOP:<NEW_LINE>sourceAdd((char) ts.UNARYOP);<NEW_LINE>sourceAdd((char) ts.getOp());<NEW_LINE>return nf.createUnary(ts.UNARYOP, ts.getOp(), unaryExpr(ts));<NEW_LINE>case TokenStream.ADD:<NEW_LINE>case TokenStream.SUB:<NEW_LINE>sourceAdd((char) ts.UNARYOP);<NEW_LINE>sourceAdd((char) tt);<NEW_LINE>return nf.createUnary(ts.UNARYOP, tt, unaryExpr(ts));<NEW_LINE>case TokenStream.INC:<NEW_LINE>case TokenStream.DEC:<NEW_LINE>sourceAdd((char) tt);<NEW_LINE>return nf.createUnary(tt, ts.PRE, memberExpr(ts, true));<NEW_LINE>case TokenStream.DELPROP:<NEW_LINE>sourceAdd<MASK><NEW_LINE>return nf.createUnary(ts.DELPROP, unaryExpr(ts));<NEW_LINE>case TokenStream.ERROR:<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>ts.ungetToken(tt);<NEW_LINE>int lineno = ts.getLineno();<NEW_LINE>Object pn = memberExpr(ts, true);<NEW_LINE>int peeked;<NEW_LINE>if (((peeked = ts.peekToken()) == ts.INC || peeked == ts.DEC) && ts.getLineno() == lineno) {<NEW_LINE>int pf = ts.getToken();<NEW_LINE>sourceAdd((char) pf);<NEW_LINE>return nf.createUnary(pf, ts.POST, pn);<NEW_LINE>}<NEW_LINE>return pn;<NEW_LINE>}<NEW_LINE>// Only reached on error. Try to continue.<NEW_LINE>return nf.createName("err");<NEW_LINE>}
((char) ts.DELPROP);
191,993
public void write(IDPSSODescriptorType idpSSODescriptor) throws ProcessingException {<NEW_LINE>if (idpSSODescriptor == null)<NEW_LINE>throw new ProcessingException(logger.nullArgumentError("IDPSSODescriptorType"));<NEW_LINE>StaxUtil.writeStartElement(writer, METADATA_PREFIX, JBossSAMLConstants.IDP_SSO_DESCRIPTOR.get(), JBossSAMLURIConstants.METADATA_NSURI.get());<NEW_LINE>Boolean wantsAuthnRequestsSigned = idpSSODescriptor.isWantAuthnRequestsSigned();<NEW_LINE>if (wantsAuthnRequestsSigned != null) {<NEW_LINE>StaxUtil.writeAttribute(writer, new QName(JBossSAMLConstants.WANT_AUTHN_REQUESTS_SIGNED.get()), wantsAuthnRequestsSigned.toString());<NEW_LINE>}<NEW_LINE>writeProtocolSupportEnumeration(idpSSODescriptor.getProtocolSupportEnumeration());<NEW_LINE>// Get the key descriptors<NEW_LINE>List<KeyDescriptorType<MASK><NEW_LINE>for (KeyDescriptorType keyDescriptor : keyDescriptors) {<NEW_LINE>writeKeyDescriptor(keyDescriptor);<NEW_LINE>}<NEW_LINE>List<IndexedEndpointType> artifactResolutionServices = idpSSODescriptor.getArtifactResolutionService();<NEW_LINE>for (IndexedEndpointType indexedEndpoint : artifactResolutionServices) {<NEW_LINE>writeArtifactResolutionService(indexedEndpoint);<NEW_LINE>}<NEW_LINE>List<EndpointType> sloServices = idpSSODescriptor.getSingleLogoutService();<NEW_LINE>for (EndpointType endpoint : sloServices) {<NEW_LINE>writeSingleLogoutService(endpoint);<NEW_LINE>}<NEW_LINE>List<String> nameIDFormats = idpSSODescriptor.getNameIDFormat();<NEW_LINE>for (String nameIDFormat : nameIDFormats) {<NEW_LINE>writeNameIDFormat(nameIDFormat);<NEW_LINE>}<NEW_LINE>List<EndpointType> ssoServices = idpSSODescriptor.getSingleSignOnService();<NEW_LINE>for (EndpointType endpoint : ssoServices) {<NEW_LINE>writeSingleSignOnService(endpoint);<NEW_LINE>}<NEW_LINE>List<AttributeType> attributes = idpSSODescriptor.getAttribute();<NEW_LINE>for (AttributeType attribType : attributes) {<NEW_LINE>write(attribType);<NEW_LINE>}<NEW_LINE>StaxUtil.writeEndElement(writer);<NEW_LINE>StaxUtil.flush(writer);<NEW_LINE>}
> keyDescriptors = idpSSODescriptor.getKeyDescriptor();
969,936
private static InitializationDescriptor read(JSONObject object) throws Exception {<NEW_LINE>InitializationDescriptor rd = new InitializationDescriptor();<NEW_LINE>JSONArray array = object.getJSONArray("buildTimeInitialization");<NEW_LINE>for (int i = 0; i < array.length(); i++) {<NEW_LINE>JSONObject jsonObject = array.getJSONObject(i);<NEW_LINE>if (jsonObject.has("class")) {<NEW_LINE>rd.addBuildtimeClass(jsonObject.getString("class"));<NEW_LINE>} else if (jsonObject.has("package")) {<NEW_LINE>rd.addBuildtimePackage(jsonObject.getString("package"));<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Unrecognized entry in JSON: " + jsonObject.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>array = object.getJSONArray("runtimeInitialization");<NEW_LINE>for (int i = 0; i < array.length(); i++) {<NEW_LINE>JSONObject jsonObject = array.getJSONObject(i);<NEW_LINE>if (jsonObject.has("class")) {<NEW_LINE>rd.addRuntimeClass(jsonObject.getString("class"));<NEW_LINE>} else if (jsonObject.has("package")) {<NEW_LINE>rd.addRuntimePackage<MASK><NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Unrecognized entry in JSON: " + jsonObject.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return rd;<NEW_LINE>}
(jsonObject.getString("package"));
1,366,732
private void initAndSearchCities(final SearchPhrase phrase, final SearchResultMatcher resultMatcher) throws IOException {<NEW_LINE>QuadRect bbox = phrase.getRadiusBBoxToSearch(DEFAULT_ADDRESS_BBOX_RADIUS * 20);<NEW_LINE>Iterator<BinaryMapIndexReader> offlineIndexes = phrase.getOfflineIndexes(bbox, SearchPhraseDataType.ADDRESS);<NEW_LINE>while (offlineIndexes.hasNext()) {<NEW_LINE>BinaryMapIndexReader r = offlineIndexes.next();<NEW_LINE>if (!townCities.containsKey(r)) {<NEW_LINE>BinaryMapIndexReader.buildAddressRequest(null);<NEW_LINE>List<City> l = r.getCities(null, BinaryMapAddressReaderAdapter.CITY_TOWN_TYPE);<NEW_LINE>townCities.put(r, l);<NEW_LINE>for (City c : l) {<NEW_LINE>LatLon cl = c.getLocation();<NEW_LINE>c.setReferenceFile(r);<NEW_LINE>int y = MapUtils.get31TileNumberY(cl.getLatitude());<NEW_LINE>int x = MapUtils.get31TileNumberX(cl.getLongitude());<NEW_LINE>QuadRect qr = new QuadRect(x, y, x, y);<NEW_LINE>townCitiesQR.insert(c, qr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (phrase.isNoSelectedType() && bbox != null && (phrase.isUnknownSearchWordPresent() || phrase.isEmptyQueryAllowed()) && phrase.isSearchTypeAllowed(ObjectType.CITY)) {<NEW_LINE>NameStringMatcher nm = phrase.getMainUnknownNameStringMatcher();<NEW_LINE>resArray.clear();<NEW_LINE>resArray = townCitiesQR.queryInBox(bbox, resArray);<NEW_LINE>int limit = 0;<NEW_LINE>for (City c : resArray) {<NEW_LINE>if (phrase.getSettings().isExportObjects()) {<NEW_LINE>resultMatcher.exportCity(phrase, c);<NEW_LINE>}<NEW_LINE>SearchResult res = new SearchResult(phrase);<NEW_LINE>res.object = c;<NEW_LINE>res.file = (BinaryMapIndexReader) c.getReferenceFile();<NEW_LINE>res.localeName = c.getName(phrase.getSettings().getLang(), phrase.getSettings().isTransliterate());<NEW_LINE>res.otherNames = c.getOtherNames(true);<NEW_LINE>res.localeRelatedObjectName = res.file.getRegionName();<NEW_LINE>res.relatedObject = res.file;<NEW_LINE>res.location = c.getLocation();<NEW_LINE>res.priority = SEARCH_ADDRESS_BY_NAME_PRIORITY;<NEW_LINE>res.priorityDistance = 0.1;<NEW_LINE>res.objectType = ObjectType.CITY;<NEW_LINE>if (phrase.isEmptyQueryAllowed() && phrase.isEmpty()) {<NEW_LINE>resultMatcher.publish(res);<NEW_LINE>} else if (nm.matches(res.localeName) || nm.matches(res.otherNames)) {<NEW_LINE>subSearchApiOrPublish(<MASK><NEW_LINE>}<NEW_LINE>if (limit++ > LIMIT * phrase.getRadiusLevel()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
phrase, resultMatcher, res, cityApi);
610,197
private Map<String, Object> initMagicVariables() {<NEW_LINE>Map<String, Object> map = new HashMap();<NEW_LINE>if (!caller.isNone()) {<NEW_LINE>// karate principle: parent variables are always "visible"<NEW_LINE>// so we inject the parent variables<NEW_LINE>// but they will be over-written by what is local to this scenario<NEW_LINE>if (!caller.isSharedScope()) {<NEW_LINE>caller.parentRuntime.engine.vars.forEach((k, v) -> map.put(k, v == null ? null : v.getValue()));<NEW_LINE>}<NEW_LINE>map.putAll(caller.parentRuntime.magicVariables);<NEW_LINE>map.put("__arg", caller.arg == null ? null : caller.arg.getValue());<NEW_LINE>map.put("__loop", caller.getLoopIndex());<NEW_LINE>}<NEW_LINE>if (scenario.isOutlineExample() && !this.isDynamicBackground()) {<NEW_LINE>// init examples row magic variables<NEW_LINE>Map<String, Object> exampleData = scenario.getExampleData();<NEW_LINE>map.putAll(exampleData);<NEW_LINE>map.put("__row", exampleData);<NEW_LINE>map.put(<MASK><NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>}
"__num", scenario.getExampleIndex());
239,353
private synchronized boolean existSyncTask(DatasetTable datasetTable, DatasetTableTask datasetTableTask) {<NEW_LINE>datasetTable.setSyncStatus(JobStatus.Underway.name());<NEW_LINE>DatasetTableExample example = new DatasetTableExample();<NEW_LINE>example.createCriteria().andIdEqualTo(datasetTable.getId()).andSyncStatusNotEqualTo(<MASK><NEW_LINE>example.or(example.createCriteria().andIdEqualTo(datasetTable.getId()).andSyncStatusIsNull());<NEW_LINE>Boolean existSyncTask = datasetTableMapper.updateByExampleSelective(datasetTable, example) == 0;<NEW_LINE>if (!existSyncTask) {<NEW_LINE>Long startTime = System.currentTimeMillis();<NEW_LINE>datasetTableTask.setLastExecTime(startTime);<NEW_LINE>datasetTableTask.setLastExecStatus(JobStatus.Underway.name());<NEW_LINE>datasetTableTask.setStatus(TaskStatus.Exec.name());<NEW_LINE>update(datasetTableTask);<NEW_LINE>DatasetTableTaskLog datasetTableTaskLog = new DatasetTableTaskLog();<NEW_LINE>datasetTableTaskLog.setTableId(datasetTableTask.getTableId());<NEW_LINE>datasetTableTaskLog.setTaskId(datasetTableTask.getId());<NEW_LINE>datasetTableTaskLog.setStatus(JobStatus.Underway.name());<NEW_LINE>datasetTableTaskLog.setStartTime(startTime);<NEW_LINE>datasetTableTaskLog.setTriggerType(TriggerType.Custom.name());<NEW_LINE>dataSetTableTaskLogService.save(datasetTableTaskLog);<NEW_LINE>}<NEW_LINE>return existSyncTask;<NEW_LINE>}
JobStatus.Underway.name());
217,851
private void loadFoundDictionaries() {<NEW_LINE>// installed /conf dir<NEW_LINE>Path configPath = controller.getConfigPath();<NEW_LINE>// user.home root<NEW_LINE>Path rootLocation = getConfigRootLocation();<NEW_LINE>final Path localLanguages = configPath.resolve("spellcheck");<NEW_LINE>final Path addedLanguages = rootLocation.resolve("spellcheck");<NEW_LINE>IOHelper.createDirectories(addedLanguages);<NEW_LINE>final String extension = ".dict";<NEW_LINE>final Stream<Path> localDictStream = IOHelper.find(localLanguages, Integer.MAX_VALUE, (path, attrs) -> path.toString<MASK><NEW_LINE>final Stream<Path> addedDictStream = IOHelper.find(addedLanguages, Integer.MAX_VALUE, (path, attrs) -> path.toString().endsWith(extension));<NEW_LINE>final Stream<Path> dictStream = Stream.concat(localDictStream, addedDictStream);<NEW_LINE>languages.set(FXCollections.observableArrayList(dictStream.sorted(Collections.reverseOrder()).collect(Collectors.toList())));<NEW_LINE>}
().endsWith(extension));
946,923
private ResolvableType resolveVariable(TypeVariable<?> variable) {<NEW_LINE>if (this.type instanceof TypeVariable) {<NEW_LINE>return resolveType().resolveVariable(variable);<NEW_LINE>}<NEW_LINE>if (this.type instanceof ParameterizedType) {<NEW_LINE>ParameterizedType parameterizedType = (ParameterizedType) this.type;<NEW_LINE>TypeVariable<?>[] variables = resolve().getTypeParameters();<NEW_LINE>for (int i = 0; i < variables.length; i++) {<NEW_LINE>if (nullSafeEquals(variables[i].getName(), variable.getName())) {<NEW_LINE>Type actualType = parameterizedType.getActualTypeArguments()[i];<NEW_LINE>return forType(actualType, this.variableResolver);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (parameterizedType.getOwnerType() != null) {<NEW_LINE>return forType(parameterizedType.getOwnerType(), this<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (this.variableResolver != null) {<NEW_LINE>return this.variableResolver.resolveVariable(variable);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
.variableResolver).resolveVariable(variable);
892,729
public void onBlock(final DirectBuffer termBuffer, final int termOffset, final int length, final int sessionId, final int termId) {<NEW_LINE>try {<NEW_LINE>final boolean isPaddingFrame = termBuffer.getShort(typeOffset(termOffset)) == PADDING_FRAME_TYPE;<NEW_LINE>final int dataLength = isPaddingFrame ? HEADER_LENGTH : length;<NEW_LINE>final ByteBuffer byteBuffer;<NEW_LINE>if (null == checksum || isPaddingFrame) {<NEW_LINE>byteBuffer = termBuffer.byteBuffer();<NEW_LINE>byteBuffer.limit(termOffset + dataLength).position(termOffset);<NEW_LINE>} else {<NEW_LINE>checksumBuffer.putBytes(0, termBuffer, termOffset, dataLength);<NEW_LINE><MASK><NEW_LINE>byteBuffer = checksumBuffer.byteBuffer();<NEW_LINE>byteBuffer.limit(dataLength).position(0);<NEW_LINE>}<NEW_LINE>int fileOffset = segmentOffset;<NEW_LINE>do {<NEW_LINE>fileOffset += recordingFileChannel.write(byteBuffer, fileOffset);<NEW_LINE>} while (byteBuffer.remaining() > 0);<NEW_LINE>if (forceWrites) {<NEW_LINE>recordingFileChannel.force(forceMetadata);<NEW_LINE>}<NEW_LINE>segmentOffset += length;<NEW_LINE>if (segmentOffset >= segmentLength) {<NEW_LINE>onFileRollOver();<NEW_LINE>}<NEW_LINE>} catch (final ClosedByInterruptException ex) {<NEW_LINE>close();<NEW_LINE>throw new ArchiveException("file closed by interrupt, recording aborted", ex, ArchiveException.GENERIC);<NEW_LINE>} catch (final IOException ex) {<NEW_LINE>close();<NEW_LINE>checkErrorType(ex, length);<NEW_LINE>} catch (final Exception ex) {<NEW_LINE>close();<NEW_LINE>LangUtil.rethrowUnchecked(ex);<NEW_LINE>}<NEW_LINE>}
computeChecksum(checksum, checksumBuffer, dataLength);
723,351
public void loadContactImage(CircleImageView imageView, TextView textView, Contact contact) {<NEW_LINE>try {<NEW_LINE>textView.setVisibility(View.VISIBLE);<NEW_LINE>imageView.setVisibility(View.GONE);<NEW_LINE>String contactNumber = "";<NEW_LINE>char firstLetter = 0;<NEW_LINE>contactNumber = contact.getDisplayName().toUpperCase();<NEW_LINE>firstLetter = contact.getDisplayName().toUpperCase().charAt(0);<NEW_LINE>if (firstLetter != '+') {<NEW_LINE>textView.setText(String.valueOf(firstLetter));<NEW_LINE>} else if (contactNumber.length() >= 2) {<NEW_LINE>textView.setText(String.valueOf(contactNumber.charAt(1)));<NEW_LINE>}<NEW_LINE>Character colorKey = AlphaNumberColorUtil.alphabetBackgroundColorMap.containsKey(firstLetter) ? firstLetter : null;<NEW_LINE>GradientDrawable bgShape = (GradientDrawable) textView.getBackground();<NEW_LINE>bgShape.setColor(context.getResources().getColor(AlphaNumberColorUtil.alphabetBackgroundColorMap.get(colorKey)));<NEW_LINE>if (contact.isDrawableResources()) {<NEW_LINE>textView.setVisibility(View.GONE);<NEW_LINE>imageView.setVisibility(View.VISIBLE);<NEW_LINE>int drawableResourceId = context.getResources().getIdentifier(contact.getrDrawableName(), "drawable", context.getPackageName());<NEW_LINE>imageView.setImageResource(drawableResourceId);<NEW_LINE>} else if (contact.getImageURL() != null) {<NEW_LINE>loadImage(imageView, textView, <MASK><NEW_LINE>} else {<NEW_LINE>textView.setVisibility(View.VISIBLE);<NEW_LINE>imageView.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>}
contact.getImageURL(), 0);
593,875
private static void addAnnotation(StringBuilder buf, IAnnotationBinding annotation, boolean addLinks) throws URISyntaxException {<NEW_LINE>IJavaElement javaElement = annotation.getAnnotationType().getJavaElement();<NEW_LINE>buf.append('@');<NEW_LINE>if (javaElement == null || !addLinks) {<NEW_LINE>buf.append(annotation.getName());<NEW_LINE>} else {<NEW_LINE>String uri = JavaElementLinks.createURI(JavaElementLinks.JAVADOC_SCHEME, javaElement);<NEW_LINE>addLink(buf, uri, annotation.getName());<NEW_LINE>}<NEW_LINE>IMemberValuePairBinding[] mvPairs = annotation.getDeclaredMemberValuePairs();<NEW_LINE>if (mvPairs.length > 0) {<NEW_LINE>buf.append('(');<NEW_LINE>for (int j = 0; j < mvPairs.length; j++) {<NEW_LINE>if (j > 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>IMemberValuePairBinding mvPair = mvPairs[j];<NEW_LINE>if (addLinks) {<NEW_LINE>String memberURI = JavaElementLinks.createURI(JavaElementLinks.JAVADOC_SCHEME, mvPair.getMethodBinding().getJavaElement());<NEW_LINE>addLink(buf, memberURI, mvPair.getName());<NEW_LINE>} else {<NEW_LINE>buf.append(mvPair.getName());<NEW_LINE>}<NEW_LINE>buf.append('=');<NEW_LINE>addValue(buf, mvPair.getValue(), addLinks);<NEW_LINE>}<NEW_LINE>buf.append(')');<NEW_LINE>}<NEW_LINE>}
buf.append(JavaElementLabels.COMMA_STRING);
253,875
private synchronized void createProducerSession() throws SIResourceException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE><MASK><NEW_LINE>if (iProducerSession == null) {<NEW_LINE>try {<NEW_LINE>iProducerSession = (ProducerSessionImpl) iProxyHandler.getMessageProcessor().getSystemConnection().createSystemProducerSession(iRemoteQueue, null, null, null, null);<NEW_LINE>} catch (SIException e) {<NEW_LINE>// No exceptions should occur as the destination should always exists<NEW_LINE>// as it is created at start time.<NEW_LINE>FFDCFilter.processException(e, "com.ibm.ws.sib.processor.proxyhandler.Neighbour.createProducerSession", "1:434:1.107", this);<NEW_LINE>SibTr.exception(tc, e);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "createProducerSession", "SIResourceException");<NEW_LINE>// this is already NLS'd //175907<NEW_LINE>throw new SIResourceException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "createProducerSession");<NEW_LINE>}
SibTr.entry(tc, "createProducerSession");
1,399,167
private void addDataToTable(Packet packet, int networkType, RowSetLoader rowWriter) {<NEW_LINE>rowWriter.start();<NEW_LINE>typeWriter.setString(packet.getPacketType());<NEW_LINE>timestampWriter.setTimestamp(Instant.ofEpochMilli(packet.getTimestamp()));<NEW_LINE>timestampMicroWriter.setLong(packet.getTimestampMicro());<NEW_LINE>networkWriter.setInt(networkType);<NEW_LINE>srcMacAddressWriter.setString(packet.getEthernetSource());<NEW_LINE>dstMacAddressWriter.setString(packet.getEthernetDestination());<NEW_LINE>String destinationIp = packet.getDestinationIpAddressString();<NEW_LINE>if (destinationIp == null) {<NEW_LINE>dstIPWriter.setNull();<NEW_LINE>} else {<NEW_LINE>dstIPWriter.setString(destinationIp);<NEW_LINE>}<NEW_LINE>String sourceIp = packet.getSourceIpAddressString();<NEW_LINE>if (sourceIp == null) {<NEW_LINE>srcIPWriter.setNull();<NEW_LINE>} else {<NEW_LINE>srcIPWriter.setString(sourceIp);<NEW_LINE>}<NEW_LINE>srcPortWriter.setInt(packet.getSrc_port());<NEW_LINE>dstPortWriter.setInt(packet.getDst_port());<NEW_LINE>packetLengthWriter.setInt(packet.getPacketLength());<NEW_LINE>// TCP Only Packet Data<NEW_LINE>tcpSessionWriter.setLong(packet.getSessionHash());<NEW_LINE>tcpSequenceWriter.setInt(packet.getSequenceNumber());<NEW_LINE>tcpAckNumberWriter.<MASK><NEW_LINE>tcpFlagsWriter.setInt(packet.getFlags());<NEW_LINE>tcpParsedFlagsWriter.setString(packet.getParsedFlags());<NEW_LINE>// TCP Flags<NEW_LINE>tcpNsWriter.setBoolean((packet.getFlags() & 0x100) != 0);<NEW_LINE>tcpCwrWriter.setBoolean((packet.getFlags() & 0x80) != 0);<NEW_LINE>tcpEceWriter.setBoolean((packet.getFlags() & 0x40) != 0);<NEW_LINE>tcpFlagsEceEcnCapableWriter.setBoolean((packet.getFlags() & 0x42) == 0x42);<NEW_LINE>tcpFlagsCongestionWriter.setBoolean((packet.getFlags() & 0x42) == 0x40);<NEW_LINE>tcpUrgWriter.setBoolean((packet.getFlags() & 0x20) != 0);<NEW_LINE>tcpAckWriter.setBoolean((packet.getFlags() & 0x10) != 0);<NEW_LINE>tcpPshWriter.setBoolean((packet.getFlags() & 0x8) != 0);<NEW_LINE>tcpRstWriter.setBoolean((packet.getFlags() & 0x4) != 0);<NEW_LINE>tcpSynWriter.setBoolean((packet.getFlags() & 0x2) != 0);<NEW_LINE>tcpFinWriter.setBoolean((packet.getFlags() & 0x1) != 0);<NEW_LINE>// Note: getData() MUST be called before isCorrupt<NEW_LINE>dataWriter.setString(parseBytesToASCII(packet.getData()));<NEW_LINE>isCorruptWriter.setBoolean(packet.isCorrupt());<NEW_LINE>rowWriter.save();<NEW_LINE>// TODO Parse Data Packet Here:<NEW_LINE>// Description of work in<NEW_LINE>// DRILL-7400: Add Packet Decoders with Interface to Drill<NEW_LINE>}
setInt(packet.getAckNumber());
1,080,976
private static Path createDemoCertificate() throws Throwable {<NEW_LINE>CertificateChainBuilder chainBuilder = new CertificateChainBuilder(DEMO_CERT_NAME);<NEW_LINE>KeyPairWrapper keyPair = chainBuilder.createCaCert();<NEW_LINE>// Some locations a user might be happy with<NEW_LINE>Path homeDir = Paths.get(System.getProperty("user.home"));<NEW_LINE>Path[] paths = { homeDir.resolve("Desktop"), homeDir.resolve("Downloads"), homeDir };<NEW_LINE>for (Path path : paths) {<NEW_LINE>File file = path.toAbsolutePath().normalize().toFile();<NEW_LINE>if (file.isDirectory() && file.canWrite()) {<NEW_LINE>Path certData = file.toPath().resolve(DEMO_CERT_NAME);<NEW_LINE>if (certData.toFile().mkdir() || (certData.toFile().isDirectory() && certData.toFile().exists())) {<NEW_LINE>// Write our PKCS#8 PEM file<NEW_LINE>File privateKey = certData.resolve(Constants.SIGNING_PRIVATE_KEY).toFile();<NEW_LINE>PemObject pemObject = new PemObject("PRIVATE KEY", keyPair.getKey().getEncoded());<NEW_LINE>log.info("Writing PKCS#8 Private Key: {}", privateKey);<NEW_LINE><MASK><NEW_LINE>PemWriter pemWriter = new PemWriter(writer);<NEW_LINE>pemWriter.writeObject(pemObject);<NEW_LINE>pemWriter.flush();<NEW_LINE>// Write our x509 certificate file<NEW_LINE>log.info("Writing x509 Certificate: {}", privateKey);<NEW_LINE>File certificate = certData.resolve(Constants.SIGNING_CERTIFICATE).toFile();<NEW_LINE>CertificateManager.writeCert(keyPair.getCert(), certificate);<NEW_LINE>return certData;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new CertificateException("Can't create certificate");<NEW_LINE>}
FileWriter writer = new FileWriter(privateKey);
668,729
Collection<BQModule> toDIModules(Collection<BQModuleMetadata> modulesMetadata) {<NEW_LINE>ModuleGraph moduleGraph = new ModuleGraph(modulesMetadata.size());<NEW_LINE>Map<Class<? extends BQModule>, BQModuleMetadata> moduleByClass = new HashMap<>();<NEW_LINE>modulesMetadata.forEach(metadata -> {<NEW_LINE>Class<? extends BQModule> moduleClass = metadata.getModule().getClass();<NEW_LINE>moduleByClass.putIfAbsent(moduleClass, metadata);<NEW_LINE>moduleGraph.add(metadata);<NEW_LINE>if (metadata.getOverrides().isEmpty()) {<NEW_LINE>bootLogger.trace(() <MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>modulesMetadata.forEach(metadata -> metadata.getOverrides().forEach(override -> {<NEW_LINE>BQModuleMetadata overrideModule = moduleByClass.get(override);<NEW_LINE>moduleGraph.add(metadata, overrideModule);<NEW_LINE>bootLogger.trace(() -> traceMessage(metadata, overrideModule));<NEW_LINE>}));<NEW_LINE>List<BQModule> modules = new ArrayList<>(moduleByClass.size());<NEW_LINE>moduleGraph.topSort().forEach(moduleClass -> modules.add(moduleClass.getModule()));<NEW_LINE>return modules;<NEW_LINE>}
-> traceMessage(metadata, null));
40,859
public boolean matchItems(Item[][] input, Item[][] output) {<NEW_LINE>if (!matchInputMap(cloneItemArray(input))) {<NEW_LINE>// Item[][] result = input;<NEW_LINE>for (int i = 0; i < input.length; i++) {<NEW_LINE>Item[] old = input[i];<NEW_LINE>Item[] newArray = new Item[old.length];<NEW_LINE>System.arraycopy(old, 0, newArray, 0, newArray.length);<NEW_LINE>Utils.reverseArray(newArray);<NEW_LINE>input[i] = newArray;<NEW_LINE>}<NEW_LINE>if (!matchInputMap(input)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// and then, finally, check that the output items are good:<NEW_LINE>List<Item> haveItems = new ArrayList<>();<NEW_LINE>for (Item[] items : output) {<NEW_LINE>haveItems.addAll(Arrays.asList(items));<NEW_LINE>}<NEW_LINE>List<Item<MASK><NEW_LINE>for (Item haveItem : new ArrayList<>(haveItems)) {<NEW_LINE>if (haveItem.isNull()) {<NEW_LINE>haveItems.remove(haveItem);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (Item needItem : new ArrayList<>(needItems)) {<NEW_LINE>if (needItem.equals(haveItem, needItem.hasMeta(), needItem.hasCompoundTag()) && needItem.getCount() == haveItem.getCount()) {<NEW_LINE>haveItems.remove(haveItem);<NEW_LINE>needItems.remove(needItem);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return haveItems.isEmpty() && needItems.isEmpty();<NEW_LINE>}
> needItems = this.getExtraResults();
485,229
protected void handle(CreateVtepMsg msg) {<NEW_LINE>List<VtepVO> vteps = Q.New(VtepVO.class).eq(VtepVO_.poolUuid, msg.getPoolUuid()).eq(VtepVO_.vtepIp, msg.getVtepIp()).list();<NEW_LINE>for (VtepVO vtep : vteps) {<NEW_LINE>if (!vtep.getHostUuid().equals(msg.getHostUuid())) {<NEW_LINE>logger.warn(String.format("same vtepip[%s] in host[%s] and host[%s], which in same cluster[%s]", msg.getVtepIp(), vtep.getHostUuid(), msg.getHostUuid()<MASK><NEW_LINE>} else {<NEW_LINE>logger.debug(String.format("get duplicate vtep create msg for ip [%s] in host [%s]", msg.getVtepIp(), vtep.getHostUuid()));<NEW_LINE>}<NEW_LINE>CreateVtepReply reply = new CreateVtepReply();<NEW_LINE>reply.setInventory(VtepInventory.valueOf(vtep));<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>VtepVO vo = new VtepVO();<NEW_LINE>vo.setUuid(Platform.getUuid());<NEW_LINE>vo.setClusterUuid(msg.getClusterUuid());<NEW_LINE>vo.setHostUuid(msg.getHostUuid());<NEW_LINE>vo.setPort(msg.getPort());<NEW_LINE>vo.setType(msg.getType());<NEW_LINE>vo.setVtepIp(msg.getVtepIp());<NEW_LINE>vo.setPoolUuid(msg.getPoolUuid());<NEW_LINE>try {<NEW_LINE>vo = dbf.persistAndRefresh(vo);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>if (!ExceptionDSL.isCausedBy(t, ConstraintViolationException.class)) {<NEW_LINE>throw t;<NEW_LINE>}<NEW_LINE>// the vtep is already attached<NEW_LINE>}<NEW_LINE>VtepInventory inv = VtepInventory.valueOf(vo);<NEW_LINE>String info = String.format("successfully create Vtep, %s", JSONObjectUtil.toJsonString(inv));<NEW_LINE>logger.debug(info);<NEW_LINE>CreateVtepReply reply = new CreateVtepReply();<NEW_LINE>reply.setInventory(inv);<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>}
, msg.getClusterUuid()));
1,352,086
public EntityRecognizerEvaluationMetrics unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>EntityRecognizerEvaluationMetrics entityRecognizerEvaluationMetrics = new EntityRecognizerEvaluationMetrics();<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("Precision", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>entityRecognizerEvaluationMetrics.setPrecision(context.getUnmarshaller(Double.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("Recall", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>entityRecognizerEvaluationMetrics.setRecall(context.getUnmarshaller(Double.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("F1Score", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>entityRecognizerEvaluationMetrics.setF1Score(context.getUnmarshaller(Double.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 entityRecognizerEvaluationMetrics;<NEW_LINE>}
class).unmarshall(context));
1,232,994
private Mono<SocketAddress> lookupRedis(RedisURI sentinelUri) {<NEW_LINE>Duration timeout = sentinelUri.getTimeout();<NEW_LINE>return Mono.usingWhen(Mono.fromCompletionStage(() -> connectSentinelAsync(newStringStringCodec(), sentinelUri, timeout)), c -> {<NEW_LINE>String sentinelMasterId = sentinelUri.getSentinelMasterId();<NEW_LINE>return c.reactive().getMasterAddrByName(sentinelMasterId).map(it -> {<NEW_LINE>if (it instanceof InetSocketAddress) {<NEW_LINE>InetSocketAddress isa = (InetSocketAddress) it;<NEW_LINE>SocketAddress resolved = getResources().socketAddressResolver().resolve(RedisURI.create(isa.getHostString(), isa.getPort()));<NEW_LINE>logger.debug("Resolved Master {} SocketAddress {}:{} to {}", sentinelMasterId, isa.getHostString(), <MASK><NEW_LINE>return resolved;<NEW_LINE>}<NEW_LINE>return it;<NEW_LINE>}).//<NEW_LINE>timeout(timeout).onErrorMap(e -> {<NEW_LINE>RedisCommandTimeoutException ex = ExceptionFactory.createTimeoutException("Cannot obtain master using SENTINEL MASTER", timeout);<NEW_LINE>ex.addSuppressed(e);<NEW_LINE>return ex;<NEW_LINE>});<NEW_LINE>}, //<NEW_LINE>//<NEW_LINE>c -> Mono.fromCompletionStage(c::closeAsync), (c, ex) -> Mono.fromCompletionStage(c::closeAsync), c -> Mono.fromCompletionStage(c::closeAsync));<NEW_LINE>}
isa.getPort(), resolved);
651,032
private Deployment createBaseDeployment() {<NEW_LINE>var is = this.getClass().getResourceAsStream("/base-keycloak-deployment.yaml");<NEW_LINE>Deployment baseDeployment = Serialization.<MASK><NEW_LINE>baseDeployment.getMetadata().setName(getName());<NEW_LINE>baseDeployment.getMetadata().setNamespace(getNamespace());<NEW_LINE>baseDeployment.getSpec().getSelector().setMatchLabels(Constants.DEFAULT_LABELS);<NEW_LINE>baseDeployment.getSpec().setReplicas(keycloakCR.getSpec().getInstances());<NEW_LINE>baseDeployment.getSpec().getTemplate().getMetadata().setLabels(Constants.DEFAULT_LABELS);<NEW_LINE>Container container = baseDeployment.getSpec().getTemplate().getSpec().getContainers().get(0);<NEW_LINE>var customImage = Optional.ofNullable(keycloakCR.getSpec().getImage());<NEW_LINE>container.setImage(customImage.orElse(config.keycloak().image()));<NEW_LINE>if (customImage.isEmpty()) {<NEW_LINE>container.getArgs().add("--auto-build");<NEW_LINE>}<NEW_LINE>container.setImagePullPolicy(config.keycloak().imagePullPolicy());<NEW_LINE>container.setEnv(getEnvVars());<NEW_LINE>configureHostname(baseDeployment);<NEW_LINE>configureTLS(baseDeployment);<NEW_LINE>mergePodTemplate(baseDeployment.getSpec().getTemplate());<NEW_LINE>return baseDeployment;<NEW_LINE>}
unmarshal(is, Deployment.class);
744,144
private void executeRegRipper(List<String> regRipperPath, Path regRipperHomeDir, String hiveFilePath, String hiveFileType, String outputFile, String errFile) {<NEW_LINE>try {<NEW_LINE>List<String> commandLine = new ArrayList<>();<NEW_LINE>for (String cmd : regRipperPath) {<NEW_LINE>commandLine.add(cmd);<NEW_LINE>}<NEW_LINE>// NON-NLS<NEW_LINE>commandLine.add("-r");<NEW_LINE>commandLine.add(hiveFilePath);<NEW_LINE>// NON-NLS<NEW_LINE>commandLine.add("-f");<NEW_LINE>commandLine.add(hiveFileType);<NEW_LINE>ProcessBuilder processBuilder = new ProcessBuilder(commandLine);<NEW_LINE>// RegRipper 2.8 has to be run from its own directory<NEW_LINE>processBuilder.directory(regRipperHomeDir.toFile());<NEW_LINE>processBuilder.redirectOutput(new File(outputFile));<NEW_LINE>processBuilder.redirectError(new File(errFile));<NEW_LINE>ExecUtil.execute(processBuilder, <MASK><NEW_LINE>} catch (IOException ex) {<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(Level.SEVERE, String.format("Error running RegRipper on %s", hiveFilePath), ex);<NEW_LINE>this.addErrorMessage(NbBundle.getMessage(this.getClass(), "ExtractRegistry.execRegRip.errMsg.failedAnalyzeRegFile", this.getDisplayName(), hiveFilePath));<NEW_LINE>}<NEW_LINE>}
new DataSourceIngestModuleProcessTerminator(context, true));
85,791
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {<NEW_LINE>final String createTableSql = "CREATE TABLE IF NOT EXISTS visits ( visit_id INT NOT NULL " + "AUTO_INCREMENT, user_ip VARCHAR(46) NOT NULL, timestamp DATETIME NOT NULL, " + "PRIMARY KEY (visit_id) )";<NEW_LINE>final String createVisitSql = "INSERT INTO visits (user_ip, timestamp) VALUES (?, ?)";<NEW_LINE>final String selectSql = "SELECT user_ip, timestamp FROM visits ORDER BY timestamp DESC " + "LIMIT 10";<NEW_LINE>String path = req.getRequestURI();<NEW_LINE>if (path.startsWith("/favicon.ico")) {<NEW_LINE>// ignore the request for favicon.ico<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PrintWriter out = resp.getWriter();<NEW_LINE>resp.setContentType("text/plain");<NEW_LINE>// store only the first two octets of a users ip address<NEW_LINE>String userIp = req.getRemoteAddr();<NEW_LINE>InetAddress address = InetAddress.getByName(userIp);<NEW_LINE>if (address instanceof Inet6Address) {<NEW_LINE>// nest indexOf calls to find the second occurrence of a character in a string<NEW_LINE>// an alternative is to use Apache Commons Lang: StringUtils.ordinalIndexOf()<NEW_LINE>userIp = userIp.substring(0, userIp.indexOf(":", userIp.indexOf(":") + 1)) + ":*:*:*:*:*:*";<NEW_LINE>} else if (address instanceof Inet4Address) {<NEW_LINE>userIp = userIp.substring(0, userIp.indexOf(".", userIp.indexOf(".") + 1)) + ".*.*";<NEW_LINE>}<NEW_LINE>Stopwatch stopwatch = Stopwatch.createStarted();<NEW_LINE>try (PreparedStatement statementCreateVisit = conn.prepareStatement(createVisitSql)) {<NEW_LINE>conn.createStatement().executeUpdate(createTableSql);<NEW_LINE>statementCreateVisit.setString(1, userIp);<NEW_LINE>statementCreateVisit.setTimestamp(2, new Timestamp(new Date().getTime()));<NEW_LINE>statementCreateVisit.executeUpdate();<NEW_LINE>try (ResultSet rs = conn.prepareStatement(selectSql).executeQuery()) {<NEW_LINE>stopwatch.stop();<NEW_LINE>out.print("Last 10 visits:\n");<NEW_LINE>while (rs.next()) {<NEW_LINE>String savedIp = rs.getString("user_ip");<NEW_LINE>String <MASK><NEW_LINE>out.print("Time: " + timeStamp + " Addr: " + savedIp + "\n");<NEW_LINE>}<NEW_LINE>out.println("Elapsed: " + stopwatch.elapsed(TimeUnit.MILLISECONDS));<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new ServletException("SQL error", e);<NEW_LINE>}<NEW_LINE>}
timeStamp = rs.getString("timestamp");
698,832
public static BXML<?> concatenate(BXML<?> firstSeq, BXML<?> secondSeq) {<NEW_LINE>BValueArray concatSeq = new BValueArray();<NEW_LINE>int j = 0;<NEW_LINE>// Load the content fully before concat the two<NEW_LINE>firstSeq.build();<NEW_LINE>secondSeq.build();<NEW_LINE>// Add all the items in the first sequence<NEW_LINE>if (firstSeq.getNodeType() == XMLNodeType.SEQUENCE) {<NEW_LINE>BValueArray seq = ((BXMLSequence) firstSeq).value();<NEW_LINE>for (int i = 0; i < seq.size(); i++) {<NEW_LINE>concatSeq.add(j++, seq.getRefValue(i));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>concatSeq.add(j++, firstSeq);<NEW_LINE>}<NEW_LINE>// Add all the items in the second sequence<NEW_LINE>if (secondSeq.getNodeType() == XMLNodeType.SEQUENCE) {<NEW_LINE>BValueArray seq = ((BXMLSequence) secondSeq).value();<NEW_LINE>for (int i = 0; i < seq.size(); i++) {<NEW_LINE>concatSeq.add(j++, seq.getRefValue(i));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>concatSeq<MASK><NEW_LINE>}<NEW_LINE>return new BXMLSequence(concatSeq);<NEW_LINE>}
.add(j++, secondSeq);
584,813
protected void addMacroParams(javax.persistence.TypedQuery jpaQuery) {<NEW_LINE>if (macroHandlers != null) {<NEW_LINE>for (QueryMacroHandler handler : macroHandlers) {<NEW_LINE>Map<String, Object> namedParams = new HashMap<>();<NEW_LINE>for (Param param : params) {<NEW_LINE>if (param.name instanceof String)<NEW_LINE>namedParams.put((String) param.name, param.value);<NEW_LINE>}<NEW_LINE>Map<String, Class> paramsTypes = new HashMap<>();<NEW_LINE>for (Parameter<?> parameter : jpaQuery.getParameters()) {<NEW_LINE>if (parameter.getName() != null) {<NEW_LINE>paramsTypes.put(parameter.getName(), parameter.getParameterType());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>handler.setQueryParams(namedParams);<NEW_LINE>handler.setExpandedParamTypes(paramsTypes);<NEW_LINE>for (Map.Entry<String, Object> entry : handler.getParams().entrySet()) {<NEW_LINE>jpaQuery.setParameter(entry.getKey(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
), entry.getValue());
651,391
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see com.ibm.websphere.cache.CacheAdminMBean#invalidateCacheIDs(java.lang.String, java.lang.String, boolean)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public String[] invalidateCacheIDs(String cacheInstance, String pattern, boolean waitOnInvalidation) throws javax.management.AttributeNotFoundException {<NEW_LINE>// Get the cache for this cacheInstance<NEW_LINE>DCache cache1 = getCache(cacheInstance);<NEW_LINE>// Check to see if request is to clear the cache<NEW_LINE>if (pattern.equals("*")) {<NEW_LINE>cache1.clear();<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "invalidateCacheIDs: Exiting. Cleared memory and disk cache since input pattern is *");<NEW_LINE>return new String[] { "*" };<NEW_LINE>}<NEW_LINE>// Check that the input pattern is a valid regular expression<NEW_LINE>Pattern cpattern = checkPattern(pattern);<NEW_LINE>// Get union of matches in memory and on disk<NEW_LINE>Collection<String> invalidateSet = new ArrayList<String>();<NEW_LINE>// Call mbeans to get matches in memory and on disk.<NEW_LINE>String[] memoryMatches = getCacheIDsInMemory(cacheInstance, pattern);<NEW_LINE>if (null != memoryMatches) {<NEW_LINE>for (int i = 0; i < memoryMatches.length; i++) {<NEW_LINE>invalidateSet.add(memoryMatches[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (cache1.getSwapToDisk()) {<NEW_LINE>String[] diskMatches = getCacheIDsOnDisk(cacheInstance, pattern);<NEW_LINE>if (null != diskMatches) {<NEW_LINE>for (int i = 0; i < diskMatches.length; i++) {<NEW_LINE>invalidateSet.add(diskMatches[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Iterator invalidates = invalidateSet.iterator();<NEW_LINE>// Invalidate the set of cache ids matched to the pattern and all<NEW_LINE>// entries dependent on the matched entry<NEW_LINE>while (invalidates.hasNext()) {<NEW_LINE>Object cacheID = invalidates.next();<NEW_LINE>cache1.invalidateById(cacheID, waitOnInvalidation);<NEW_LINE>}<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, <MASK><NEW_LINE>// need to convert to string array before return.<NEW_LINE>// Allocate output array #entries matched<NEW_LINE>String[] cids = invalidateSet.toArray(new String[invalidateSet.size()]);<NEW_LINE>return cids;<NEW_LINE>}
"invalidateCacheIDs: Exiting. Number of matches found = " + invalidateSet.size());
1,569,582
public State unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>State state = new State();<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("stateName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>state.setStateName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("onInput", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>state.setOnInput(OnInputLifecycleJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("onEnter", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>state.setOnEnter(OnEnterLifecycleJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("onExit", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>state.setOnExit(OnExitLifecycleJsonUnmarshaller.getInstance<MASK><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 state;<NEW_LINE>}
().unmarshall(context));
1,614,458
public static BufferedImage resizeWithRatio(BufferedImage image, int destinationWidth, int destinationHeight) {<NEW_LINE>int type = image.getType() == 0 ? BufferedImage.TYPE_INT_ARGB : image.getType();<NEW_LINE>// *Special* if the width or height is 0 use image src dimensions<NEW_LINE>if (destinationWidth == 0) {<NEW_LINE>destinationWidth = image.getWidth();<NEW_LINE>}<NEW_LINE>if (destinationHeight == 0) {<NEW_LINE>destinationHeight = image.getHeight();<NEW_LINE>}<NEW_LINE>int fHeight = destinationHeight;<NEW_LINE>int fWidth = destinationWidth;<NEW_LINE>// Work out the resized width/height<NEW_LINE>if (image.getHeight() > destinationHeight || image.getWidth() > destinationWidth) {<NEW_LINE>if (image.getHeight() > image.getWidth()) {<NEW_LINE>fHeight = destinationHeight;<NEW_LINE>float sum = (float) image.getWidth() / (float) image.getHeight();<NEW_LINE>fWidth = Math.round(destinationWidth * sum);<NEW_LINE>} else if (image.getWidth() > image.getHeight()) {<NEW_LINE>fWidth = destinationWidth;<NEW_LINE>float sum = (float) image.getHeight() / (float) image.getWidth();<NEW_LINE>fHeight = Math.round(destinationHeight * sum);<NEW_LINE>}<NEW_LINE>// else sides are equal and is set to destination size at initialization of<NEW_LINE>}<NEW_LINE>BufferedImage resizedImage = new BufferedImage(fWidth, fHeight, type);<NEW_LINE>Graphics2D g = resizedImage.createGraphics();<NEW_LINE>g.setComposite(AlphaComposite.Src);<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);<NEW_LINE>g.setRenderingHint(<MASK><NEW_LINE>g.drawImage(image, 0, 0, fWidth, fHeight, null);<NEW_LINE>g.dispose();<NEW_LINE>return resizedImage;<NEW_LINE>}
RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
1,689,255
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>super.onCreateView(inflater, container, savedInstanceState);<NEW_LINE>if (megaApi.getRootNode() == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>View v = getListView(inflater, container);<NEW_LINE>if (adapter == null) {<NEW_LINE>adapter = new MegaNodeAdapter(context, this, nodes, managerActivity.getParentHandleLinks(), <MASK><NEW_LINE>}<NEW_LINE>adapter.setListFragment(recyclerView);<NEW_LINE>if (managerActivity.getParentHandleLinks() == INVALID_HANDLE) {<NEW_LINE>logWarning("ParentHandle -1");<NEW_LINE>findNodes();<NEW_LINE>adapter.setParentHandle(INVALID_HANDLE);<NEW_LINE>} else {<NEW_LINE>managerActivity.hideTabs(true, LINKS_TAB);<NEW_LINE>MegaNode parentNode = megaApi.getNodeByHandle(managerActivity.getParentHandleLinks());<NEW_LINE>logDebug("ParentHandle to find children: " + managerActivity.getParentHandleLinks());<NEW_LINE>nodes = megaApi.getChildren(parentNode, getLinksOrderCloud(sortOrderManagement.getOrderCloud(), managerActivity.isFirstNavigationLevel()));<NEW_LINE>adapter.setNodes(nodes);<NEW_LINE>}<NEW_LINE>adapter.setMultipleSelect(false);<NEW_LINE>recyclerView.setAdapter(adapter);<NEW_LINE>return v;<NEW_LINE>}
recyclerView, LINKS_ADAPTER, ITEM_VIEW_TYPE_LIST, sortByHeaderViewModel);
668,423
public static OutputStream openForWriting(Form form, ScopedFile file) throws IOException {<NEW_LINE>switch(file.getScope()) {<NEW_LINE>case Asset:<NEW_LINE>throw new IOException("Assets are read-only.");<NEW_LINE>case App:<NEW_LINE>if (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO) {<NEW_LINE>return new FileOutputStream(new File(Environment.getExternalStorageDirectory(), file.getFileName()));<NEW_LINE>}<NEW_LINE>return new FileOutputStream(new File(form.getExternalFilesDir(""), file.getFileName()));<NEW_LINE>case Cache:<NEW_LINE>return new FileOutputStream(new File(URI.create(form.getCachePath(file.getFileName()))));<NEW_LINE>case Legacy:<NEW_LINE>return new FileOutputStream(new File(Environment.getExternalStorageDirectory(), file.getFileName()));<NEW_LINE>case Private:<NEW_LINE>return new FileOutputStream(new File(URI.create(form.getPrivatePath(file.getFileName()))));<NEW_LINE>case Shared:<NEW_LINE>String[] parts = file.getFileName().split("/", 2);<NEW_LINE>final ContentValues values = new ContentValues();<NEW_LINE>values.put(MediaStore.MediaColumns<MASK><NEW_LINE>values.put(MediaStore.MediaColumns.MIME_TYPE, "");<NEW_LINE>values.put(MediaStore.MediaColumns.RELATIVE_PATH, parts[0]);<NEW_LINE>final ContentResolver resolver = form.getContentResolver();<NEW_LINE>Uri contentUri = getContentUriForPath(parts[0]);<NEW_LINE>if (contentUri == null) {<NEW_LINE>throw new IOException("Unrecognized shared folder: " + parts[0]);<NEW_LINE>}<NEW_LINE>Uri uri = resolver.insert(contentUri, values);<NEW_LINE>if (uri == null) {<NEW_LINE>throw new IOException("Unable to insert MediaStore entry for shared content");<NEW_LINE>}<NEW_LINE>OutputStream out = resolver.openOutputStream(uri);<NEW_LINE>if (out == null) {<NEW_LINE>throw new IOException("Unable to open stream for writing");<NEW_LINE>}<NEW_LINE>return out;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>throw new IOException("Unsupported file scope: " + file.getScope());<NEW_LINE>}
.DISPLAY_NAME, parts[1]);
1,509,037
public static void toJSON(OutputWriter outputWriter, EnvironmentConfig environmentConfig) {<NEW_LINE>outputWriter.add(<MASK><NEW_LINE>addOrigin(outputWriter, environmentConfig.getOrigin());<NEW_LINE>outputWriter.addChildList("pipelines", outputListWriter -> {<NEW_LINE>environmentConfig.getPipelines().forEach(pipeline -> outputListWriter.addChild(writer -> EnvironmentPipelineRepresenter.toJSON(writer, pipeline, environmentConfig)));<NEW_LINE>});<NEW_LINE>outputWriter.addChildList("agents", outputListWriter -> {<NEW_LINE>environmentConfig.getAgents().forEach(agent -> outputListWriter.addChild(writer -> EnvironmentAgentRepresenter.toJSON(writer, agent, environmentConfig)));<NEW_LINE>});<NEW_LINE>outputWriter.addChildList("environment_variables", outputListWriter -> {<NEW_LINE>environmentConfig.getVariables().forEach(envVar -> outputListWriter.addChild(writer -> EnvironmentEnvironmentVariableRepresenter.toJSON(writer, envVar, environmentConfig)));<NEW_LINE>});<NEW_LINE>}
"name", environmentConfig.name());
1,616,598
private JsonResult toJson(final CompilationUnit cu) {<NEW_LINE>final JsonResult jsonResult = new JsonResult();<NEW_LINE>final NodeList<TypeDeclaration<?>> types = cu.getTypes();<NEW_LINE>if (types.isEmpty()) {<NEW_LINE>return jsonResult;<NEW_LINE>}<NEW_LINE>final TypeDeclaration<?> type = types.get(0);<NEW_LINE>jsonResult.addName(type);<NEW_LINE>jsonResult.addModifiers(type);<NEW_LINE>final Optional<PackageDeclaration> pkg = cu.getPackageDeclaration();<NEW_LINE>if (pkg.isPresent()) {<NEW_LINE>jsonResult.addPackage(pkg.get());<NEW_LINE>}<NEW_LINE>final List<BodyDeclaration<?>> members = type.getMembers();<NEW_LINE>final List<JsonResult> membersList = new ArrayList<>();<NEW_LINE>members.forEach((t) -> {<NEW_LINE>final JsonResult member = new JsonResult();<NEW_LINE>if (t instanceof FieldDeclaration) {<NEW_LINE>final FieldDeclaration fd = t.asFieldDeclaration();<NEW_LINE>member.addName(fd.getVariable(0));<NEW_LINE>member.addType(fd.getVariable<MASK><NEW_LINE>member.addModifiers(fd);<NEW_LINE>} else if (t instanceof CallableDeclaration) {<NEW_LINE>final CallableDeclaration callable = t.asCallableDeclaration();<NEW_LINE>if (t instanceof ConstructorDeclaration) {<NEW_LINE>final ConstructorDeclaration cd = t.asConstructorDeclaration();<NEW_LINE>member.addName(cd);<NEW_LINE>member.isConstructor();<NEW_LINE>member.addModifiers(cd);<NEW_LINE>} else if (t instanceof MethodDeclaration) {<NEW_LINE>final MethodDeclaration md = t.asMethodDeclaration();<NEW_LINE>member.addName(md);<NEW_LINE>member.isMethod();<NEW_LINE>member.addReturnType(md.getType());<NEW_LINE>member.addModifiers(md);<NEW_LINE>member.addBody(md);<NEW_LINE>}<NEW_LINE>final NodeList<Parameter> parameters = callable.getParameters();<NEW_LINE>List<JsonResult> parameterList = new ArrayList<>();<NEW_LINE>parameters.forEach((p) -> {<NEW_LINE>JsonResult param = new JsonResult();<NEW_LINE>param.addName(p);<NEW_LINE>param.addType(p.getType());<NEW_LINE>param.addModifiers(p);<NEW_LINE>parameterList.add(param);<NEW_LINE>});<NEW_LINE>member.addParameters(parameterList);<NEW_LINE>}<NEW_LINE>membersList.add(member);<NEW_LINE>});<NEW_LINE>jsonResult.addMembers(membersList);<NEW_LINE>return jsonResult;<NEW_LINE>}
(0).getType());
1,466,988
protected void addMachineSlots(@Nonnull InventoryPlayer playerInv) {<NEW_LINE>addSlotToContainer(new InventorySlot(getInv(), inFull, 44, 21));<NEW_LINE>addSlotToContainer(new InventorySlot(getInv()<MASK><NEW_LINE>addSlotToContainer(new InventorySlot(getInv(), trashcan, 10000, 10000) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>@SideOnly(Side.CLIENT)<NEW_LINE>@Nonnull<NEW_LINE>public ResourceLocation getBackgroundLocation() {<NEW_LINE>return IconEIO.TRASHCAN.getMap().getTexture();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>@SideOnly(Side.CLIENT)<NEW_LINE>@Nonnull<NEW_LINE>public TextureAtlasSprite getBackgroundSprite() {<NEW_LINE>return IconEIO.TRASHCAN.getAsTextureAtlasSprite();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>addSlotToContainer(new InventorySlot(getInv(), outEmpty, 44, 52));<NEW_LINE>addSlotToContainer(new InventorySlot(getInv(), outFull, 116, 52));<NEW_LINE>}
, inEmpty, 116, 21));
718,025
public void paint(Graphics g2, JComponent c) {<NEW_LINE>final Graphics2D g = (Graphics2D) g2;<NEW_LINE>final GraphicsConfig config = new GraphicsConfig(g);<NEW_LINE>final Color bg = c.getBackground();<NEW_LINE>g.setPaint(bg);<NEW_LINE>TableColumnModel model = ((JTableHeader) c).getColumnModel();<NEW_LINE>final int h = c.getHeight();<NEW_LINE>final int w = model.getTotalColumnWidth();<NEW_LINE>g.fillRect(0, 0, w, h);<NEW_LINE>JBColor bottomSeparatorColor = JBColor.namedColor("TableHeader.bottomSeparatorColor", ColorUtil.shift(bg, 0.75));<NEW_LINE>g.setPaint(bottomSeparatorColor);<NEW_LINE>UIUtil.drawLine(g, 0, h - 1, w, h - 1);<NEW_LINE>final Enumeration<TableColumn<MASK><NEW_LINE>final Color lineColor = JBColor.namedColor("TableHeader.separatorColor", ColorUtil.shift(bg, 0.7));<NEW_LINE>int offset = 0;<NEW_LINE>while (columns.hasMoreElements()) {<NEW_LINE>final TableColumn column = columns.nextElement();<NEW_LINE>if (columns.hasMoreElements() && column.getWidth() > 0) {<NEW_LINE>offset += column.getWidth();<NEW_LINE>g.setColor(lineColor);<NEW_LINE>UIUtil.drawLine(g, offset - 1, 1, offset - 1, h - 3);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>config.restore();<NEW_LINE>super.paint(g, c);<NEW_LINE>}
> columns = model.getColumns();
767,263
public boolean register(final InferableJavaFileObject jfo) {<NEW_LINE>Parameters.notNull("jfo", jfo);<NEW_LINE>final String inferedName = jfo.inferBinaryName();<NEW_LINE>final String[] pkgName = FileObjects.getPackageAndName(inferedName);<NEW_LINE>List<Integer> ids = this.packages.get(pkgName[0]);<NEW_LINE>if (ids == null) {<NEW_LINE>ids = new LinkedList<Integer>();<NEW_LINE>this.packages.put<MASK><NEW_LINE>}<NEW_LINE>// Check for duplicate<NEW_LINE>for (Iterator<Integer> it = ids.iterator(); it.hasNext(); ) {<NEW_LINE>final Integer id = it.next();<NEW_LINE>final InferableJavaFileObject rfo = this.content.get(id);<NEW_LINE>assert rfo != null;<NEW_LINE>if (inferedName.equals(rfo.inferBinaryName())) {<NEW_LINE>this.content.put(id, jfo);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Todo: add<NEW_LINE>final Integer id = currentId.getAndIncrement();<NEW_LINE>this.content.put(id, jfo);<NEW_LINE>ids.add(id);<NEW_LINE>return false;<NEW_LINE>}
(pkgName[0], ids);
799,863
public void onClick(View v) {<NEW_LINE>if (v == mClose) {<NEW_LINE>DoKit.removeFloating(ViewCheckDrawDoKitView.class);<NEW_LINE>DoKit.removeFloating(ViewCheckInfoDoKitView.class);<NEW_LINE>DoKit.removeFloating(ViewCheckDoKitView.class);<NEW_LINE>}<NEW_LINE>if (v == mNext) {<NEW_LINE>ViewCheckDoKitView dokitView = DoKit.getDoKitView(<MASK><NEW_LINE>if (dokitView != null) {<NEW_LINE>dokitView.preformNextCheckView();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (v == mPre) {<NEW_LINE>ViewCheckDoKitView dokitView = DoKit.getDoKitView(getActivity(), ViewCheckDoKitView.class);<NEW_LINE>if (dokitView != null) {<NEW_LINE>dokitView.preformPreCheckView();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getActivity(), ViewCheckDoKitView.class);
1,208,203
public JobSummary unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>if (!reader.isContainer()) {<NEW_LINE>reader.skipValue();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>JobSummary jobSummary = new JobSummary();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>if (name.equals("jobArn")) {<NEW_LINE>jobSummary.setJobArn(StringJsonUnmarshaller.getInstance<MASK><NEW_LINE>} else if (name.equals("jobId")) {<NEW_LINE>jobSummary.setJobId(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("thingGroupId")) {<NEW_LINE>jobSummary.setThingGroupId(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("targetSelection")) {<NEW_LINE>jobSummary.setTargetSelection(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("status")) {<NEW_LINE>jobSummary.setStatus(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("createdAt")) {<NEW_LINE>jobSummary.setCreatedAt(DateJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("lastUpdatedAt")) {<NEW_LINE>jobSummary.setLastUpdatedAt(DateJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("completedAt")) {<NEW_LINE>jobSummary.setCompletedAt(DateJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return jobSummary;<NEW_LINE>}
().unmarshall(context));
182,730
public Data fromCommand(ParticleType<Data> particleTypeIn, StringReader reader) throws CommandSyntaxException {<NEW_LINE>double dX = reader.readDouble();<NEW_LINE>reader.expect(' ');<NEW_LINE>double dY = reader.readDouble();<NEW_LINE>reader.expect(' ');<NEW_LINE>double dZ = reader.readDouble();<NEW_LINE>reader.expect(' ');<NEW_LINE>double scale = reader.readDouble();<NEW_LINE>reader.expect(' ');<NEW_LINE>int maxAge = reader.readInt();<NEW_LINE>reader.expect(' ');<NEW_LINE>int points = reader.readInt();<NEW_LINE>reader.expect(' ');<NEW_LINE>float[] colourOut = new float[4];<NEW_LINE>float[] colourIn = new float[4];<NEW_LINE>for (int i = 0; i < 4; ++i) {<NEW_LINE>colourOut[<MASK><NEW_LINE>reader.expect(' ');<NEW_LINE>}<NEW_LINE>for (int i = 0; i < 4; ++i) {<NEW_LINE>colourIn[i] = reader.readFloat();<NEW_LINE>reader.expect(' ');<NEW_LINE>}<NEW_LINE>return new Data(new Vec3(dX, dY, dZ), scale, maxAge, points, colourOut, colourIn);<NEW_LINE>}
i] = reader.readFloat();
400,317
private void copyResources(File resourcesDirectory) throws IOException {<NEW_LINE>// Unzip res.zip into resources directory<NEW_LINE>InputStream inputStream = getClass().getResourceAsStream("res.zip");<NEW_LINE>ZipInputStream zipInputStream = new ZipInputStream(inputStream);<NEW_LINE>try {<NEW_LINE>ZipEntry zipEntry = zipInputStream.getNextEntry();<NEW_LINE>while (zipEntry != null) {<NEW_LINE>File file = new File(resourcesDirectory, zipEntry.getName());<NEW_LINE>if (zipEntry.isDirectory()) {<NEW_LINE>file.mkdir();<NEW_LINE>} else {<NEW_LINE>OutputStream outputStream = new BufferedOutputStream(<MASK><NEW_LINE>try {<NEW_LINE>int b = zipInputStream.read();<NEW_LINE>while (b != -1) {<NEW_LINE>outputStream.write(b);<NEW_LINE>b = zipInputStream.read();<NEW_LINE>}<NEW_LINE>outputStream.flush();<NEW_LINE>} finally {<NEW_LINE>outputStream.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>zipEntry = zipInputStream.getNextEntry();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>zipInputStream.close();<NEW_LINE>}<NEW_LINE>}
new FileOutputStream(file), BUFFER_SIZE);
463,315
public Serializable doTestWork(EntityManager em, UserTransaction tx, Object managedComponentObject) {<NEW_LINE>System.out.println("Begin Running TestWorkRequest.doTestWork(twr) on " + managedComponentObject + " ...");<NEW_LINE>try {<NEW_LINE>System.out.println("Finding SimpleVersionedEntity10(id=" + identity + ") ...");<NEW_LINE>SimpleVersionedEntity10 findEntity = em.find(SimpleVersionedEntity10.class, identity);<NEW_LINE>Assert.assertNotNull("Assert find did not return null.", findEntity);<NEW_LINE>Assert.assertTrue("Assert that the EntityManager is associated with a transaction.", em.isJoinedToTransaction());<NEW_LINE>Assert.<MASK><NEW_LINE>Assert.assertSame("Assert that the delegate EntityManager used in components 1 and 2 are the same", delegate, em.getDelegate());<NEW_LINE>} finally {<NEW_LINE>System.out.println("End Running TestWorkRequest.doTestWork() on " + managedComponentObject + " ...");<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
assertSame("Assert that find did return the same entity.", entityPCtx1, findEntity);
565,617
protected Tuple2<double[], String> predictSingleVar(Timestamp[] historyTimes, double[] historyVals, int predictNum) {<NEW_LINE>LOG.info("Entering predictSingleVar");<NEW_LINE>if (historyVals.length <= 2) {<NEW_LINE>LOG.info("historyVals.length <= 2");<NEW_LINE>return Tuple2.of(null, null);<NEW_LINE>}<NEW_LINE>Map<String, String> conf = new HashMap<String, String>();<NEW_LINE>conf.put("periods", String.valueOf(this.predictNum));<NEW_LINE>conf.put("freq", getFreq(historyTimes));<NEW_LINE>conf.put("uncertainty_samples", String.valueOf(this.params.get(ProphetParams.UNCERTAINTY_SAMPLES)));<NEW_LINE>conf.put("init_model", this.params<MASK><NEW_LINE>List<Row> inputs = new ArrayList<>();<NEW_LINE>SimpleDateFormat dataFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");<NEW_LINE>for (int i = 0; i < historyTimes.length; i++) {<NEW_LINE>inputs.add(Row.of(dataFormat.format(historyTimes[i].getTime()), historyVals[i]));<NEW_LINE>}<NEW_LINE>Tuple3<String, String, double[]> tuple3 = warmStartProphet(this.runner, conf, inputs, null);<NEW_LINE>LOG.info("Leaving predictSingleVar");<NEW_LINE>return Tuple2.of(tuple3.f2, tuple3.f1);<NEW_LINE>}
.get(ProphetParams.STAN_INIT));
417,405
public WorkflowDefPb.WorkflowDef toProto(WorkflowDef from) {<NEW_LINE>WorkflowDefPb.WorkflowDef.Builder to = WorkflowDefPb.WorkflowDef.newBuilder();<NEW_LINE>if (from.getName() != null) {<NEW_LINE>to.setName(from.getName());<NEW_LINE>}<NEW_LINE>if (from.getDescription() != null) {<NEW_LINE>to.setDescription(from.getDescription());<NEW_LINE>}<NEW_LINE>to.setVersion(from.getVersion());<NEW_LINE>for (WorkflowTask elem : from.getTasks()) {<NEW_LINE>to<MASK><NEW_LINE>}<NEW_LINE>to.addAllInputParameters(from.getInputParameters());<NEW_LINE>for (Map.Entry<String, Object> pair : from.getOutputParameters().entrySet()) {<NEW_LINE>to.putOutputParameters(pair.getKey(), toProto(pair.getValue()));<NEW_LINE>}<NEW_LINE>if (from.getFailureWorkflow() != null) {<NEW_LINE>to.setFailureWorkflow(from.getFailureWorkflow());<NEW_LINE>}<NEW_LINE>to.setSchemaVersion(from.getSchemaVersion());<NEW_LINE>to.setRestartable(from.isRestartable());<NEW_LINE>to.setWorkflowStatusListenerEnabled(from.isWorkflowStatusListenerEnabled());<NEW_LINE>if (from.getOwnerEmail() != null) {<NEW_LINE>to.setOwnerEmail(from.getOwnerEmail());<NEW_LINE>}<NEW_LINE>if (from.getTimeoutPolicy() != null) {<NEW_LINE>to.setTimeoutPolicy(toProto(from.getTimeoutPolicy()));<NEW_LINE>}<NEW_LINE>to.setTimeoutSeconds(from.getTimeoutSeconds());<NEW_LINE>for (Map.Entry<String, Object> pair : from.getVariables().entrySet()) {<NEW_LINE>to.putVariables(pair.getKey(), toProto(pair.getValue()));<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, Object> pair : from.getInputTemplate().entrySet()) {<NEW_LINE>to.putInputTemplate(pair.getKey(), toProto(pair.getValue()));<NEW_LINE>}<NEW_LINE>return to.build();<NEW_LINE>}
.addTasks(toProto(elem));
1,815,958
private OperatorNode<?> fetchPipe(OperatorNode<?> toScan) {<NEW_LINE>OperatorNode<?> ast = toScan;<NEW_LINE>while (ast.getOperator() == SequenceOperator.PIPE) {<NEW_LINE>OperatorNode<ExpressionOperator> groupingAst = ast.<List<OperatorNode<ExpressionOperator>>>getArgument(2).get(0);<NEW_LINE>GroupingOperation groupingOperation = GroupingOperation.fromString(groupingAst.<String>getArgument(0));<NEW_LINE><MASK><NEW_LINE>List<Object> continuations = getAnnotation(groupingAst, "continuations", List.class, Collections.emptyList(), "grouping continuations");<NEW_LINE>for (Object continuation : continuations) {<NEW_LINE>groupingStep.continuations().add(Continuation.fromString(dereference(continuation)));<NEW_LINE>}<NEW_LINE>groupingSteps.add(groupingStep);<NEW_LINE>ast = ast.getArgument(0);<NEW_LINE>}<NEW_LINE>Collections.reverse(groupingSteps);<NEW_LINE>return ast;<NEW_LINE>}
VespaGroupingStep groupingStep = new VespaGroupingStep(groupingOperation);
1,789,485
public void initialize(EsperIOKafkaOutputFlowControllerContext context) {<NEW_LINE>this.runtime = context.getRuntime();<NEW_LINE>// obtain producer<NEW_LINE>try {<NEW_LINE>producer = new KafkaProducer<>(context.getProperties());<NEW_LINE>} catch (Throwable t) {<NEW_LINE>log.error("Error obtaining Kafka producer for URI '{}': {}", context.getRuntime().getURI(), t.getMessage(), t);<NEW_LINE>}<NEW_LINE>// determine topics<NEW_LINE>String topicsCSV = EsperIOKafkaInputAdapter.getRequiredProperty(context.getProperties(), EsperIOKafkaConfig.TOPICS_CONFIG);<NEW_LINE>String[] topicNames = topicsCSV.split(",");<NEW_LINE>for (String topicName : topicNames) {<NEW_LINE>if (topicName.trim().length() > 0) {<NEW_LINE>topics.add(topicName.trim());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// attach to existing statements<NEW_LINE>String[] deploymentIds = context.getRuntime()<MASK><NEW_LINE>for (String depoymentId : deploymentIds) {<NEW_LINE>EPStatement[] statements = context.getRuntime().getDeploymentService().getDeployment(depoymentId).getStatements();<NEW_LINE>for (EPStatement statement : statements) {<NEW_LINE>processStatement(statement);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// attach listener to receive newly-created statements<NEW_LINE>runtime.getDeploymentService().addDeploymentStateListener(new DeploymentStateListener() {<NEW_LINE><NEW_LINE>public void onDeployment(DeploymentStateEventDeployed event) {<NEW_LINE>for (EPStatement statement : event.getStatements()) {<NEW_LINE>processStatement(statement);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>public void onUndeployment(DeploymentStateEventUndeployed event) {<NEW_LINE>for (EPStatement statement : event.getStatements()) {<NEW_LINE>detachStatement(statement);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
.getDeploymentService().getDeployments();
601,463
private void doReplaceWithNonPacked(Structure struct, DataType[] resolvedDts) throws IOException {<NEW_LINE>// assumes components is clear and that alignment characteristics have been set.<NEW_LINE>if (struct.isNotYetDefined()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>structLength = struct.isZeroLength() ? 0 : struct.getLength();<NEW_LINE>numComponents = structLength;<NEW_LINE>DataTypeComponent[] otherComponents = struct.getDefinedComponents();<NEW_LINE>for (int i = 0; i < otherComponents.length; i++) {<NEW_LINE>DataTypeComponent dtc = otherComponents[i];<NEW_LINE>// ancestry check already performed by caller<NEW_LINE>DataType dt = resolvedDts[i];<NEW_LINE>int length = DataTypeComponent.usesZeroLengthComponent(dt) ? 0 : dt.getLength();<NEW_LINE>if (length < 0 || dtc.isBitFieldComponent()) {<NEW_LINE>// TODO: bitfield truncation/expansion may be an issue if data organization changes<NEW_LINE>length = dtc.getLength();<NEW_LINE>} else {<NEW_LINE>// do not exceed available space<NEW_LINE>int maxOffset;<NEW_LINE>int nextIndex = i + 1;<NEW_LINE>if (nextIndex < otherComponents.length) {<NEW_LINE>maxOffset = otherComponents[nextIndex].getOffset();<NEW_LINE>} else {<NEW_LINE>maxOffset = structLength;<NEW_LINE>}<NEW_LINE>if (length > 0) {<NEW_LINE>length = Math.min(length, maxOffset - dtc.getOffset());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DBRecord rec = componentAdapter.createRecord(dataMgr.getResolvedID(dt), key, length, dtc.getOrdinal(), dtc.getOffset(), dtc.getFieldName(), dtc.getComment());<NEW_LINE>dt.addParent(this);<NEW_LINE>DataTypeComponentDB newDtc = new DataTypeComponentDB(<MASK><NEW_LINE>components.add(newDtc);<NEW_LINE>}<NEW_LINE>repack(false, false);<NEW_LINE>}
dataMgr, componentAdapter, this, rec);
220,572
private static List<DataSchema> parseDataSchema(String resolverPath, String inputPath) throws RuntimeException, IOException {<NEW_LINE>try (Stream<Path> paths = Files.walk(Paths.get(inputPath))) {<NEW_LINE>return paths.filter(path -> path.toString().endsWith(PDL) || path.toString().endsWith(PDSC)).map(path -> {<NEW_LINE>File inputFile = path.toFile();<NEW_LINE>DataSchemaResolver resolver = MultiFormatDataSchemaResolver.withBuiltinFormats(resolverPath);<NEW_LINE>String fileExtension = getFileExtension(inputFile.getName());<NEW_LINE>PegasusSchemaParser parser = AbstractSchemaParser.parserForFileExtension(fileExtension, resolver);<NEW_LINE>try {<NEW_LINE>parser.<MASK><NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>if (parser.hasError()) {<NEW_LINE>throw new RuntimeException("Error: " + parser.errorMessage() + ", while parsing schema: " + inputFile.getAbsolutePath());<NEW_LINE>}<NEW_LINE>List<DataSchema> topLevelDataSchemas = parser.topLevelDataSchemas();<NEW_LINE>if (topLevelDataSchemas.size() != 1) {<NEW_LINE>throw new RuntimeException("The number of top level schemas is not 1, while parsing schema: " + inputFile.getAbsolutePath());<NEW_LINE>}<NEW_LINE>DataSchema topLevelDataSchema = topLevelDataSchemas.get(0);<NEW_LINE>if (!(topLevelDataSchema instanceof NamedDataSchema)) {<NEW_LINE>throw new RuntimeException("Invalid schema : " + inputFile.getAbsolutePath() + ", the schema is not a named schema.");<NEW_LINE>}<NEW_LINE>return topLevelDataSchema;<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>}<NEW_LINE>}
parse(new FileInputStream(inputFile));
499,907
static boolean contentOverlap(LayoutInterval interval1, LayoutInterval interval2, int fromIndex, int toIndex, int dimension) {<NEW_LINE>if (!interval2.isGroup()) {<NEW_LINE>if (!interval1.isGroup()) {<NEW_LINE>return LayoutRegion.overlap(interval1.getCurrentSpace(), interval2.getCurrentSpace(), dimension, 0);<NEW_LINE>}<NEW_LINE>LayoutInterval temp = interval1;<NEW_LINE>interval1 = interval2;<NEW_LINE>interval2 = temp;<NEW_LINE>}<NEW_LINE>// [more efficient algorithm based on region merging and ordering could be found...]<NEW_LINE>List<LayoutInterval> int2list = null;<NEW_LINE>List<LayoutInterval> addList = null;<NEW_LINE>Iterator it1 = getComponentIterator(interval1);<NEW_LINE>while (it1.hasNext()) {<NEW_LINE>LayoutRegion space1 = ((LayoutInterval) it1.next()).getCurrentSpace();<NEW_LINE>Iterator it2 = int2list != null ? int2list.iterator() : getComponentIterator(interval2, fromIndex, toIndex);<NEW_LINE>if (int2list == null && it1.hasNext()) {<NEW_LINE>int2list <MASK><NEW_LINE>addList = int2list;<NEW_LINE>}<NEW_LINE>while (it2.hasNext()) {<NEW_LINE>LayoutInterval li2 = (LayoutInterval) it2.next();<NEW_LINE>if (LayoutRegion.overlap(space1, li2.getCurrentSpace(), dimension, 0))<NEW_LINE>return true;<NEW_LINE>if (addList != null)<NEW_LINE>addList.add(li2);<NEW_LINE>}<NEW_LINE>addList = null;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
= new LinkedList<LayoutInterval>();
878,470
public void mouseClicked(MouseEvent e) {<NEW_LINE>if (e.getClickCount() != 2 || e.isPopupTrigger() || e.isConsumed()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int index = <MASK><NEW_LINE>if (index < 0 || index >= getModel().getSize()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Object value = getModel().getElementAt(index);<NEW_LINE>if (value instanceof TreeListNode) {<NEW_LINE>TreeListNode node = (TreeListNode) value;<NEW_LINE>if (null != node && !node.isExpandable()) {<NEW_LINE>ActionListener al = node.getDefaultAction();<NEW_LINE>if (null != al) {<NEW_LINE>al.actionPerformed(new ActionEvent(e.getSource(), e.getID(), e.paramString()));<NEW_LINE>}<NEW_LINE>} else if (null != node && node.isExpandable()) {<NEW_LINE>if (!node.isLoaded()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>node.setExpanded(!node.isExpanded());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
locationToIndex(e.getPoint());
787,370
public JsonCreateInvoiceCandidatesResponse createInvoiceCandidates(@NonNull final JsonCreateInvoiceCandidatesRequest request) {<NEW_LINE>final ImmutableMap<InvoiceCandidateLookupKey, JsonCreateInvoiceCandidatesRequestItem> lookupKey2Item = Maps.uniqueIndex(request.getItems(), this::createInvoiceCandidateLookupKey);<NEW_LINE>// candidates<NEW_LINE>final ImmutableList<ExternallyReferencedCandidate> //<NEW_LINE>exitingCandidates = externallyReferencedCandidateRepository.getAllBy(lookupKey2Item.keySet());<NEW_LINE>failIfNotEmpty(exitingCandidates);<NEW_LINE>final ImmutableList.Builder<NewManualInvoiceCandidate> candidatesToSave = ImmutableList.builder();<NEW_LINE>for (final Entry<InvoiceCandidateLookupKey, JsonCreateInvoiceCandidatesRequestItem> keyWithItem : lookupKey2Item.entrySet()) {<NEW_LINE>final JsonCreateInvoiceCandidatesRequestItem item = keyWithItem.getValue();<NEW_LINE>final NewManualInvoiceCandidate candidate = createCandidate(item);<NEW_LINE>candidatesToSave.add(candidate);<NEW_LINE>}<NEW_LINE>final JsonCreateInvoiceCandidatesResponseBuilder result = JsonCreateInvoiceCandidatesResponse.builder();<NEW_LINE>for (final NewManualInvoiceCandidate candidateToSave : candidatesToSave.build()) {<NEW_LINE>final JsonExternalId headerId = JsonExternalIds.ofOrNull(candidateToSave.getExternalHeaderId());<NEW_LINE>final JsonExternalId lineId = JsonExternalIds.ofOrNull(candidateToSave.getExternalLineId());<NEW_LINE>final InvoiceCandidateId candidateId = externallyReferencedCandidateRepository.save<MASK><NEW_LINE>final JsonInvoiceCandidatesResponseItem responseItem = JsonInvoiceCandidatesResponseItem.builder().externalHeaderId(headerId).externalLineId(lineId).metasfreshId(MetasfreshId.of(candidateId)).build();<NEW_LINE>result.responseItem(responseItem);<NEW_LINE>}<NEW_LINE>return result.build();<NEW_LINE>}
(manualCandidateService.createInvoiceCandidate(candidateToSave));
406,181
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {<NEW_LINE>FontRenderer fr = minecraft.fontRenderer;<NEW_LINE>String txt = Lang.GUI_COMBGEN_OUTPUT.get("");<NEW_LINE>int sw = fr.getStringWidth(txt);<NEW_LINE>fr.drawStringWithShadow(txt, 89 - sw / 2 - xOff, 0 - yOff, ColorUtil.getRGB(Color.WHITE));<NEW_LINE>txt = "-";<NEW_LINE>sw = fr.getStringWidth(txt);<NEW_LINE>fr.drawStringWithShadow("-", 89 - sw / 2 - xOff, 10 - yOff, ColorUtil<MASK><NEW_LINE>int y = 21 - yOff - 2;<NEW_LINE>int x = 114 - xOff;<NEW_LINE>txt = mathMax.getTicksPerCoolant() + "-" + LangFluid.tMB(mathMin.getTicksPerCoolant());<NEW_LINE>sw = fr.getStringWidth(txt);<NEW_LINE>fr.drawStringWithShadow(txt, x - sw / 2 + 7, y + fr.FONT_HEIGHT / 2 + 47, ColorUtil.getRGB(Color.WHITE));<NEW_LINE>x = 48 - xOff;<NEW_LINE>txt = mathMax.getTicksPerFuel() + "-" + LangFluid.tMB(mathMin.getTicksPerFuel());<NEW_LINE>sw = fr.getStringWidth(txt);<NEW_LINE>fr.drawStringWithShadow(txt, x - sw / 2 + 7, y + fr.FONT_HEIGHT / 2 + 47, ColorUtil.getRGB(Color.WHITE));<NEW_LINE>GlStateManager.color(1, 1, 1, 1);<NEW_LINE>}
.getRGB(Color.WHITE));
1,216,464
private static void solveNQueensWithGeneticAlgorithmSearch() {<NEW_LINE>System.out.println("\n--- NQueensDemo GeneticAlgorithm ---");<NEW_LINE>FitnessFunction<Integer> fitnessFunction = NQueensGenAlgoUtil.getFitnessFunction();<NEW_LINE>Predicate<Individual<Integer>> goalTest = NQueensGenAlgoUtil.getGoalTest();<NEW_LINE>// Generate an initial population<NEW_LINE>Set<Individual<Integer>> population = new HashSet<>();<NEW_LINE>for (int i = 0; i < 50; i++) population.add(NQueensGenAlgoUtil.generateRandomIndividual(boardSize));<NEW_LINE>GeneticAlgorithm<Integer> ga = new GeneticAlgorithm<>(boardSize, NQueensGenAlgoUtil.getFiniteAlphabetForBoardOfSize(boardSize), 0.15);<NEW_LINE>// Run for a set amount of time<NEW_LINE>Individual<Integer> bestIndividual = ga.geneticAlgorithm(population, fitnessFunction, goalTest, 1000L);<NEW_LINE>System.out.println("Max time 1 second, Best Individual:\n" + NQueensGenAlgoUtil.getBoardForIndividual(bestIndividual));<NEW_LINE>System.out.println("Board Size = " + boardSize);<NEW_LINE>System.out.println("# Board Layouts = " + (new BigDecimal(boardSize)).pow(boardSize));<NEW_LINE>System.out.println("Fitness = " + fitnessFunction.apply(bestIndividual));<NEW_LINE>System.out.println("Is Goal = " + goalTest.test(bestIndividual));<NEW_LINE>System.out.println("Population Size = " + ga.getPopulationSize());<NEW_LINE>System.out.println("Iterations = " + ga.getIterations());<NEW_LINE>System.out.println("Took = " + ga.getTimeInMilliseconds() + "ms.");<NEW_LINE>// Run till goal is achieved<NEW_LINE>bestIndividual = ga.geneticAlgorithm(population, fitnessFunction, goalTest, 0L);<NEW_LINE>System.out.println("");<NEW_LINE>System.out.println("Max time unlimited, Best Individual:\n" + NQueensGenAlgoUtil.getBoardForIndividual(bestIndividual));<NEW_LINE>System.out.println("Board Size = " + boardSize);<NEW_LINE>System.out.println("# Board Layouts = " + (new BigDecimal(boardSize)).pow(boardSize));<NEW_LINE>System.out.println("Fitness = " + fitnessFunction.apply(bestIndividual));<NEW_LINE>System.out.println("Is Goal = " <MASK><NEW_LINE>System.out.println("Population Size = " + ga.getPopulationSize());<NEW_LINE>System.out.println("Itertions = " + ga.getIterations());<NEW_LINE>System.out.println("Took = " + ga.getTimeInMilliseconds() + "ms.");<NEW_LINE>}
+ goalTest.test(bestIndividual));
1,674,466
public boolean onOptionsItemSelected(MenuItem item) {<NEW_LINE>switch(item.getItemId()) {<NEW_LINE>case R.id.action_follow:<NEW_LINE>mPresenter.followUser<MASK><NEW_LINE>invalidateOptionsMenu();<NEW_LINE>showSuccessToast(mPresenter.isFollowing() ? getString(R.string.followed) : getString(R.string.unfollowed));<NEW_LINE>break;<NEW_LINE>case R.id.action_bookmark:<NEW_LINE>mPresenter.bookmark(!mPresenter.isBookmarked());<NEW_LINE>invalidateOptionsMenu();<NEW_LINE>showSuccessToast(mPresenter.isBookmarked() ? getString(R.string.bookmark_saved) : getString(R.string.bookmark_removed));<NEW_LINE>break;<NEW_LINE>case R.id.action_share:<NEW_LINE>AppOpener.shareText(getActivity(), mPresenter.getUser().getHtmlUrl());<NEW_LINE>break;<NEW_LINE>case R.id.action_open_in_browser:<NEW_LINE>AppOpener.openInCustomTabsOrBrowser(getActivity(), mPresenter.getUser().getHtmlUrl());<NEW_LINE>break;<NEW_LINE>case R.id.action_copy_url:<NEW_LINE>AppUtils.copyToClipboard(getActivity(), mPresenter.getUser().getHtmlUrl());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return super.onOptionsItemSelected(item);<NEW_LINE>}
(!mPresenter.isFollowing());
1,213,225
private Mono<Response<Void>> deleteWithResponseAsync(String resourceGroupName, String automationAccountName, String variableName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() 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 (automationAccountName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter automationAccountName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (variableName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter variableName is required and cannot be null."));<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>final String apiVersion = "2019-06-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = <MASK><NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, automationAccountName, variableName, this.client.getSubscriptionId(), apiVersion, accept, context);<NEW_LINE>}
this.client.mergeContext(context);
1,126,552
final GetSceneResult executeGetScene(GetSceneRequest getSceneRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getSceneRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetSceneRequest> request = null;<NEW_LINE>Response<GetSceneResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetSceneRequestProtocolMarshaller(protocolFactory).marshall<MASK><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, "IoTTwinMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetScene");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>String hostPrefix = "api.";<NEW_LINE>String resolvedHostPrefix = String.format("api.");<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetSceneResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetSceneResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(getSceneRequest));
1,820,105
private void saveCollectedMethod(MappingCollector mappingCollector) {<NEW_LINE>File methodMapFile = new File(configuration.methodMapFilePath);<NEW_LINE>if (!methodMapFile.getParentFile().exists()) {<NEW_LINE>methodMapFile.getParentFile().mkdirs();<NEW_LINE>}<NEW_LINE>List<TraceMethod> methodList = new ArrayList<>();<NEW_LINE>TraceMethod extra = TraceMethod.create(TraceBuildConstants.METHOD_ID_DISPATCH, Opcodes.ACC_PUBLIC, "android.os.Handler", "dispatchMessage", "(Landroid.os.Message;)V");<NEW_LINE>collectedMethodMap.put(extra.getMethodName(), extra);<NEW_LINE>methodList.addAll(collectedMethodMap.values());<NEW_LINE>Log.i(TAG, "[saveCollectedMethod] size:%s incrementCount:%s path:%s", collectedMethodMap.size(), incrementCount.get(), methodMapFile.getAbsolutePath());<NEW_LINE>Collections.sort(methodList, new Comparator<TraceMethod>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(TraceMethod o1, TraceMethod o2) {<NEW_LINE>return o1.id - o2.id;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>PrintWriter pw = null;<NEW_LINE>try {<NEW_LINE>FileOutputStream fileOutputStream = new FileOutputStream(methodMapFile, false);<NEW_LINE>Writer w = new OutputStreamWriter(fileOutputStream, "UTF-8");<NEW_LINE>pw = new PrintWriter(w);<NEW_LINE>for (TraceMethod traceMethod : methodList) {<NEW_LINE>traceMethod.revert(mappingCollector);<NEW_LINE>pw.println(traceMethod.toString());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.e(TAG, <MASK><NEW_LINE>e.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>if (pw != null) {<NEW_LINE>pw.flush();<NEW_LINE>pw.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"write method map Exception:%s", e.getMessage());
1,408,957
final public void makeTypeMask() {<NEW_LINE>RefType.v("java.lang.Class");<NEW_LINE>typeMask = new LargeNumberedMap<Type, BitVector>(Scene.v().getTypeNumberer());<NEW_LINE>if (fh == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// **<NEW_LINE>initClass2allocs();<NEW_LINE>makeClassTypeMask(Scene.v().getSootClass("java.lang.Object"));<NEW_LINE>BitVector visitedTypes = new BitVector();<NEW_LINE>{<NEW_LINE>Iterator<Type> it = typeMask.keyIterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Type t = it.next();<NEW_LINE>visitedTypes.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// **<NEW_LINE>ArrayNumberer<AllocNode> allocNodes = pag.getAllocNodeNumberer();<NEW_LINE>for (Type t : Scene.v().getTypeNumberer()) {<NEW_LINE>if (!(t instanceof RefLikeType)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (t instanceof AnySubType) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (isUnresolved(t)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// **<NEW_LINE>if (t instanceof RefType && t != rtObject && t != rtSerializable && t != rtCloneable) {<NEW_LINE>RefType rt = (RefType) t;<NEW_LINE>SootClass sc = rt.getSootClass();<NEW_LINE>if (sc.isInterface()) {<NEW_LINE>makeMaskOfInterface(sc);<NEW_LINE>}<NEW_LINE>if (!visitedTypes.get(t.getNumber()) && !rt.getSootClass().isPhantom()) {<NEW_LINE>makeClassTypeMask(rt.getSootClass());<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// **<NEW_LINE>BitVector mask = new BitVector(allocNodes.size());<NEW_LINE>for (Node n : allocNodes) {<NEW_LINE>if (castNeverFails(n.getType(), t)) {<NEW_LINE>mask.set(n.getNumber());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>typeMask.put(t, mask);<NEW_LINE>}<NEW_LINE>allocNodeListener = pag.allocNodeListener();<NEW_LINE>}
set(t.getNumber());
463,672
public static ListTrafficMirrorSessionsResponse unmarshall(ListTrafficMirrorSessionsResponse listTrafficMirrorSessionsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listTrafficMirrorSessionsResponse.setRequestId(_ctx.stringValue("ListTrafficMirrorSessionsResponse.RequestId"));<NEW_LINE>listTrafficMirrorSessionsResponse.setNextToken(_ctx.stringValue("ListTrafficMirrorSessionsResponse.NextToken"));<NEW_LINE>listTrafficMirrorSessionsResponse.setTotalCount(_ctx.stringValue("ListTrafficMirrorSessionsResponse.TotalCount"));<NEW_LINE>List<TrafficMirrorSession> trafficMirrorSessions = new ArrayList<TrafficMirrorSession>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListTrafficMirrorSessionsResponse.TrafficMirrorSessions.Length"); i++) {<NEW_LINE>TrafficMirrorSession trafficMirrorSession = new TrafficMirrorSession();<NEW_LINE>trafficMirrorSession.setTrafficMirrorTargetId(_ctx.stringValue("ListTrafficMirrorSessionsResponse.TrafficMirrorSessions[" + i + "].TrafficMirrorTargetId"));<NEW_LINE>trafficMirrorSession.setTrafficMirrorSessionId(_ctx.stringValue("ListTrafficMirrorSessionsResponse.TrafficMirrorSessions[" + i + "].TrafficMirrorSessionId"));<NEW_LINE>trafficMirrorSession.setPriority(_ctx.integerValue("ListTrafficMirrorSessionsResponse.TrafficMirrorSessions[" + i + "].Priority"));<NEW_LINE>trafficMirrorSession.setTrafficMirrorTargetType(_ctx.stringValue("ListTrafficMirrorSessionsResponse.TrafficMirrorSessions[" + i + "].TrafficMirrorTargetType"));<NEW_LINE>trafficMirrorSession.setPacketLength(_ctx.integerValue("ListTrafficMirrorSessionsResponse.TrafficMirrorSessions[" + i + "].PacketLength"));<NEW_LINE>trafficMirrorSession.setTrafficMirrorSessionDescription(_ctx.stringValue("ListTrafficMirrorSessionsResponse.TrafficMirrorSessions[" + i + "].TrafficMirrorSessionDescription"));<NEW_LINE>trafficMirrorSession.setTrafficMirrorSessionStatus(_ctx.stringValue("ListTrafficMirrorSessionsResponse.TrafficMirrorSessions[" + i + "].TrafficMirrorSessionStatus"));<NEW_LINE>trafficMirrorSession.setEnabled(_ctx.booleanValue("ListTrafficMirrorSessionsResponse.TrafficMirrorSessions[" + i + "].Enabled"));<NEW_LINE>trafficMirrorSession.setTrafficMirrorSessionBusinessStatus(_ctx.stringValue("ListTrafficMirrorSessionsResponse.TrafficMirrorSessions[" + i + "].TrafficMirrorSessionBusinessStatus"));<NEW_LINE>trafficMirrorSession.setVirtualNetworkId(_ctx.integerValue("ListTrafficMirrorSessionsResponse.TrafficMirrorSessions[" + i + "].VirtualNetworkId"));<NEW_LINE>trafficMirrorSession.setTrafficMirrorFilterId(_ctx.stringValue("ListTrafficMirrorSessionsResponse.TrafficMirrorSessions[" + i + "].TrafficMirrorFilterId"));<NEW_LINE>trafficMirrorSession.setTrafficMirrorSessionName(_ctx.stringValue("ListTrafficMirrorSessionsResponse.TrafficMirrorSessions[" + i + "].TrafficMirrorSessionName"));<NEW_LINE>List<String> trafficMirrorSourceIds = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListTrafficMirrorSessionsResponse.TrafficMirrorSessions[" + i + "].TrafficMirrorSourceIds.Length"); j++) {<NEW_LINE>trafficMirrorSourceIds.add(_ctx.stringValue("ListTrafficMirrorSessionsResponse.TrafficMirrorSessions[" + i <MASK><NEW_LINE>}<NEW_LINE>trafficMirrorSession.setTrafficMirrorSourceIds(trafficMirrorSourceIds);<NEW_LINE>trafficMirrorSessions.add(trafficMirrorSession);<NEW_LINE>}<NEW_LINE>listTrafficMirrorSessionsResponse.setTrafficMirrorSessions(trafficMirrorSessions);<NEW_LINE>return listTrafficMirrorSessionsResponse;<NEW_LINE>}
+ "].TrafficMirrorSourceIds[" + j + "]"));
575,069
public void marshall(Cluster cluster, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (cluster == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(cluster.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getPendingUpdates(), PENDINGUPDATES_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getNumberOfShards(), NUMBEROFSHARDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getShards(), SHARDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getAvailabilityMode(), AVAILABILITYMODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getClusterEndpoint(), CLUSTERENDPOINT_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getNodeType(), NODETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getEngineVersion(), ENGINEVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getEnginePatchVersion(), ENGINEPATCHVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(cluster.getParameterGroupStatus(), PARAMETERGROUPSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getSecurityGroups(), SECURITYGROUPS_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getSubnetGroupName(), SUBNETGROUPNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getTLSEnabled(), TLSENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getKmsKeyId(), KMSKEYID_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getARN(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getSnsTopicArn(), SNSTOPICARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getSnsTopicStatus(), SNSTOPICSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getSnapshotRetentionLimit(), SNAPSHOTRETENTIONLIMIT_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getMaintenanceWindow(), MAINTENANCEWINDOW_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getSnapshotWindow(), SNAPSHOTWINDOW_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getACLName(), ACLNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getAutoMinorVersionUpgrade(), AUTOMINORVERSIONUPGRADE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
cluster.getParameterGroupName(), PARAMETERGROUPNAME_BINDING);
1,173,485
public void dfs(int i, int j, String result, boolean[][] visited, Trie tree, List<String> results, char[][] board) {<NEW_LINE>// System.out.println(result);<NEW_LINE>if (!tree.isPrefix(result)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (tree.search(result) && !set.contains(result)) {<NEW_LINE>results.add(result);<NEW_LINE>set.add(result);<NEW_LINE>// return;<NEW_LINE>}<NEW_LINE>int[][] step = { { 1, 0 }, { -1, 0 }, { 0, 1 }, { 0, -1 } };<NEW_LINE>for (int k = 0; k < step.length; k++) {<NEW_LINE>int x = i + step[k][0];<NEW_LINE>int y = j <MASK><NEW_LINE>if (x >= 0 && x < board.length && y >= 0 && y < board[x].length && !visited[x][y]) {<NEW_LINE>visited[x][y] = true;<NEW_LINE>dfs(x, y, result + board[x][y], visited, tree, results, board);<NEW_LINE>visited[x][y] = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
+ step[k][1];
70,655
public void runMerge(HoodieTable<T, List<HoodieRecord<T>>, List<HoodieKey>, List<WriteStatus>> table, HoodieMergeHandle<T, List<HoodieRecord<T>>, List<HoodieKey>, List<WriteStatus>> mergeHandle) throws IOException {<NEW_LINE>final GenericDatumWriter<GenericRecord> gWriter;<NEW_LINE>final GenericDatumReader<GenericRecord> gReader;<NEW_LINE>Schema readSchema;<NEW_LINE>final boolean externalSchemaTransformation = table.getConfig().shouldUseExternalSchemaTransformation();<NEW_LINE>HoodieBaseFile baseFile = mergeHandle.baseFileForMerge();<NEW_LINE>if (externalSchemaTransformation || baseFile.getBootstrapBaseFile().isPresent()) {<NEW_LINE>readSchema = HoodieFileReaderFactory.getFileReader(table.getHadoopConf(), mergeHandle.<MASK><NEW_LINE>gWriter = new GenericDatumWriter<>(readSchema);<NEW_LINE>gReader = new GenericDatumReader<>(readSchema, mergeHandle.getWriterSchemaWithMetaFields());<NEW_LINE>} else {<NEW_LINE>gReader = null;<NEW_LINE>gWriter = null;<NEW_LINE>readSchema = mergeHandle.getWriterSchemaWithMetaFields();<NEW_LINE>}<NEW_LINE>BoundedInMemoryExecutor<GenericRecord, GenericRecord, Void> wrapper = null;<NEW_LINE>Configuration cfgForHoodieFile = new Configuration(table.getHadoopConf());<NEW_LINE>HoodieFileReader<GenericRecord> reader = HoodieFileReaderFactory.<GenericRecord>getFileReader(cfgForHoodieFile, mergeHandle.getOldFilePath());<NEW_LINE>try {<NEW_LINE>final Iterator<GenericRecord> readerIterator;<NEW_LINE>if (baseFile.getBootstrapBaseFile().isPresent()) {<NEW_LINE>readerIterator = getMergingIterator(table, mergeHandle, baseFile, reader, readSchema, externalSchemaTransformation);<NEW_LINE>} else {<NEW_LINE>readerIterator = reader.getRecordIterator(readSchema);<NEW_LINE>}<NEW_LINE>ThreadLocal<BinaryEncoder> encoderCache = new ThreadLocal<>();<NEW_LINE>ThreadLocal<BinaryDecoder> decoderCache = new ThreadLocal<>();<NEW_LINE>wrapper = new BoundedInMemoryExecutor<>(table.getConfig().getWriteBufferLimitBytes(), new IteratorBasedQueueProducer<>(readerIterator), Option.of(new UpdateHandler(mergeHandle)), record -> {<NEW_LINE>if (!externalSchemaTransformation) {<NEW_LINE>return record;<NEW_LINE>}<NEW_LINE>return transformRecordBasedOnNewSchema(gReader, gWriter, encoderCache, decoderCache, (GenericRecord) record);<NEW_LINE>});<NEW_LINE>wrapper.execute();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new HoodieException(e);<NEW_LINE>} finally {<NEW_LINE>// HUDI-2875: mergeHandle is not thread safe, we should totally terminate record inputting<NEW_LINE>// and executor firstly and then close mergeHandle.<NEW_LINE>if (reader != null) {<NEW_LINE>reader.close();<NEW_LINE>}<NEW_LINE>if (null != wrapper) {<NEW_LINE>wrapper.shutdownNow();<NEW_LINE>wrapper.awaitTermination();<NEW_LINE>}<NEW_LINE>mergeHandle.close();<NEW_LINE>}<NEW_LINE>}
getOldFilePath()).getSchema();
375,659
private void restoreSession(int tabIndex) {<NEW_LINE><MASK><NEW_LINE>if (session_str == null && loadScripts == null && macOpenFiles == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<File> filesToLoad = new ArrayList<File>();<NEW_LINE>if (macOpenFiles != null) {<NEW_LINE>for (File f : macOpenFiles) {<NEW_LINE>filesToLoad.add(f);<NEW_LINE>restoreScriptFromSession(f);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (session_str != null) {<NEW_LINE>String[] filenames = session_str.split(";");<NEW_LINE>for (int i = 0; i < filenames.length; i++) {<NEW_LINE>if (filenames[i].isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>File f = new File(filenames[i]);<NEW_LINE>if (f.exists() && !filesToLoad.contains(f)) {<NEW_LINE>Debug.log(3, "restore session: %s", f);<NEW_LINE>filesToLoad.add(f);<NEW_LINE>restoreScriptFromSession(f);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (loadScripts != null) {<NEW_LINE>for (int i = 0; i < loadScripts.length; i++) {<NEW_LINE>if (loadScripts[i].isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>File f = new File(loadScripts[i]);<NEW_LINE>if (f.exists() && !filesToLoad.contains(f)) {<NEW_LINE>Debug.log(3, "preload script: %s", f);<NEW_LINE>filesToLoad.add(f);<NEW_LINE>restoreScriptFromSession(f);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String session_str = prefs.getIdeSession();
1,669,200
public void testActionlessFutureWithDefaultManagedExecutor() throws Exception {<NEW_LINE>BlockableIncrementFunction increment = new BlockableIncrementFunction("testActionlessFutureWithDefaultManagedExecutor", null, null, false);<NEW_LINE>CompletableFuture<Integer<MASK><NEW_LINE>CompletableFuture<Integer> cf2 = cf1.thenApplyAsync(increment);<NEW_LINE>assertEquals(Integer.valueOf(177), cf1.getNow(177));<NEW_LINE>assertEquals(Integer.valueOf(178), cf2.getNow(178));<NEW_LINE>assertFalse(cf1.isDone());<NEW_LINE>assertFalse(cf2.isDone());<NEW_LINE>assertTrue(cf1.complete(171));<NEW_LINE>assertEquals(Integer.valueOf(172), cf2.get(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>assertTrue(cf1.isDone());<NEW_LINE>assertFalse(cf1.isCompletedExceptionally());<NEW_LINE>assertTrue(cf2.isDone());<NEW_LINE>assertFalse(cf2.isCompletedExceptionally());<NEW_LINE>// Async action runs on a managed thread, but not on the servlet thread<NEW_LINE>String executorThreadName = increment.executionThread.getName();<NEW_LINE>assertTrue(executorThreadName, executorThreadName.startsWith("Default Executor-thread-"));<NEW_LINE>assertNotSame(Thread.currentThread(), increment.executionThread);<NEW_LINE>}
> cf1 = defaultManagedExecutor.newIncompleteFuture();
1,340,203
public List<String> showAnalyzeJobs() throws MetaNotFoundException {<NEW_LINE>List<String> row = Lists.newArrayList("", "ALL", "ALL", "ALL", "", "", "", "", "", "");<NEW_LINE>row.set(0, String.valueOf(id));<NEW_LINE>if (DEFAULT_ALL_ID != dbId) {<NEW_LINE>Database db = Catalog.getCurrentCatalog().getDb(dbId);<NEW_LINE>if (db == null) {<NEW_LINE>throw new MetaNotFoundException("No found database: " + dbId);<NEW_LINE>}<NEW_LINE>row.set(1, db.getFullName());<NEW_LINE>if (DEFAULT_ALL_ID != tableId) {<NEW_LINE>Table table = db.getTable(tableId);<NEW_LINE>if (table == null) {<NEW_LINE>throw new MetaNotFoundException("No found table: " + tableId);<NEW_LINE>}<NEW_LINE>row.set(<MASK><NEW_LINE>if (null != columns && !columns.isEmpty() && (columns.size() != table.getBaseSchema().size())) {<NEW_LINE>String str = String.join(",", columns);<NEW_LINE>if (str.length() > 100) {<NEW_LINE>row.set(3, str.substring(0, 100) + "...");<NEW_LINE>} else {<NEW_LINE>row.set(3, str);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>row.set(4, type.name());<NEW_LINE>row.set(5, scheduleType.name());<NEW_LINE>row.set(6, properties == null ? "{}" : properties.toString());<NEW_LINE>row.set(7, status.name());<NEW_LINE>if (LocalDateTime.MIN.equals(workTime)) {<NEW_LINE>row.set(8, "None");<NEW_LINE>} else {<NEW_LINE>row.set(8, workTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));<NEW_LINE>}<NEW_LINE>if (null != reason) {<NEW_LINE>row.set(9, reason);<NEW_LINE>}<NEW_LINE>return row;<NEW_LINE>}
2, table.getName());
1,647,647
public void actionPerformed(ActionEvent e) {<NEW_LINE>Collection<? extends Report> selectedReportsCollection = Utilities.actionsGlobalContext().lookupAll(Report.class);<NEW_LINE>String message = selectedReportsCollection.size() > 1 ? NbBundle.getMessage(Reports.class, "DeleteReportAction.actionPerformed.showConfirmDialog.multiple.msg", selectedReportsCollection.size()) : NbBundle.getMessage(Reports.class, "DeleteReportAction.actionPerformed.showConfirmDialog.single.msg");<NEW_LINE>String explanation = selectedReportsCollection.size() > 1 ? Bundle.DeleteReportAction_showConfirmDialog_multiple_explanation() : Bundle.DeleteReportAction_showConfirmDialog_single_explanation();<NEW_LINE>Object[<MASK><NEW_LINE>if (JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog(null, jOptionPaneContent, NbBundle.getMessage(Reports.class, "DeleteReportAction.actionPerformed.showConfirmDialog.title"), JOptionPane.YES_NO_OPTION)) {<NEW_LINE>try {<NEW_LINE>Case.getCurrentCaseThrows().deleteReports(selectedReportsCollection);<NEW_LINE>} catch (TskCoreException | NoCurrentCaseException ex) {<NEW_LINE>// NON-NLS<NEW_LINE>Logger.getLogger(DeleteReportAction.class.getName()).log(Level.SEVERE, "Error deleting reports", ex);<NEW_LINE>MessageNotifyUtil.Message.error(Bundle.DeleteReportAction_showConfirmDialog_errorMsg());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
] jOptionPaneContent = { message, explanation };