idx
int32 46
1.86M
| input
stringlengths 321
6.6k
| target
stringlengths 9
1.24k
|
|---|---|---|
1,438,762
|
private static void readOnlyTransaction(PrintWriter pw) {<NEW_LINE>// ReadOnlyTransaction must be closed by calling close() on it to release resources held by it.<NEW_LINE>// We use a try-with-resource block to automatically do so.<NEW_LINE>try (ReadOnlyTransaction transaction = SpannerClient.getDatabaseClient().readOnlyTransaction()) {<NEW_LINE>ResultSet queryResultSet = transaction.executeQuery(Statement.of("SELECT SingerId, AlbumId, AlbumTitle FROM Albums"));<NEW_LINE>while (queryResultSet.next()) {<NEW_LINE>pw.printf("%d %d %s\n", queryResultSet.getLong(0), queryResultSet.getLong(1)<MASK><NEW_LINE>}<NEW_LINE>ResultSet readResultSet = transaction.read("Albums", KeySet.all(), Arrays.asList("SingerId", "AlbumId", "AlbumTitle"));<NEW_LINE>while (readResultSet.next()) {<NEW_LINE>pw.printf("%d %d %s\n", readResultSet.getLong(0), readResultSet.getLong(1), readResultSet.getString(2));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
, queryResultSet.getString(2));
|
306,295
|
static <T> int binarySearch(FST<T> fst, FST.Arc<T> arc, int targetLabel) throws IOException {<NEW_LINE>assert arc.nodeFlags() == FST.ARCS_FOR_BINARY_SEARCH : "Arc is not encoded as packed array for binary search (nodeFlags=" <MASK><NEW_LINE>BytesReader in = fst.getBytesReader();<NEW_LINE>int low = arc.arcIdx();<NEW_LINE>int mid;<NEW_LINE>int high = arc.numArcs() - 1;<NEW_LINE>while (low <= high) {<NEW_LINE>mid = (low + high) >>> 1;<NEW_LINE>in.setPosition(arc.posArcsStart());<NEW_LINE>in.skipBytes((long) arc.bytesPerArc() * mid + 1);<NEW_LINE>final int midLabel = fst.readLabel(in);<NEW_LINE>final int cmp = midLabel - targetLabel;<NEW_LINE>if (cmp < 0) {<NEW_LINE>low = mid + 1;<NEW_LINE>} else if (cmp > 0) {<NEW_LINE>high = mid - 1;<NEW_LINE>} else {<NEW_LINE>return mid;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return -1 - low;<NEW_LINE>}
|
+ arc.nodeFlags() + ")";
|
457,662
|
static <T> Keyframe<T> newInstance(JSONObject json, LottieComposition composition, float scale, AnimatableValue.Factory<T> valueFactory) {<NEW_LINE>PointF cp1 = null;<NEW_LINE>PointF cp2 = null;<NEW_LINE>float startFrame = 0;<NEW_LINE>T startValue = null;<NEW_LINE>T endValue = null;<NEW_LINE>Interpolator interpolator = null;<NEW_LINE>if (json.has("t")) {<NEW_LINE>startFrame = (float) json.optDouble("t", 0);<NEW_LINE>Object startValueJson = json.opt("s");<NEW_LINE>if (startValueJson != null) {<NEW_LINE>startValue = valueFactory.valueFromObject(startValueJson, scale);<NEW_LINE>}<NEW_LINE>Object endValueJson = json.opt("e");<NEW_LINE>if (endValueJson != null) {<NEW_LINE>endValue = valueFactory.valueFromObject(endValueJson, scale);<NEW_LINE>}<NEW_LINE>JSONObject cp1Json = json.optJSONObject("o");<NEW_LINE>JSONObject cp2Json = json.optJSONObject("i");<NEW_LINE>if (cp1Json != null && cp2Json != null) {<NEW_LINE>cp1 = JsonUtils.pointFromJsonObject(cp1Json, scale);<NEW_LINE>cp2 = <MASK><NEW_LINE>}<NEW_LINE>boolean hold = json.optInt("h", 0) == 1;<NEW_LINE>if (hold) {<NEW_LINE>endValue = startValue;<NEW_LINE>// TODO: create a HoldInterpolator so progress changes don't invalidate.<NEW_LINE>interpolator = LINEAR_INTERPOLATOR;<NEW_LINE>} else if (cp1 != null) {<NEW_LINE>interpolator = PathInterpolatorCompat.create(cp1.x / scale, cp1.y / scale, cp2.x / scale, cp2.y / scale);<NEW_LINE>} else {<NEW_LINE>interpolator = LINEAR_INTERPOLATOR;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>startValue = valueFactory.valueFromObject(json, scale);<NEW_LINE>endValue = startValue;<NEW_LINE>}<NEW_LINE>return new Keyframe<>(composition, startValue, endValue, interpolator, startFrame, null);<NEW_LINE>}
|
JsonUtils.pointFromJsonObject(cp2Json, scale);
|
652,210
|
private void loadFromDB() throws Exception {<NEW_LINE>Query query = new Query(HugeType.VERTEX);<NEW_LINE>query.capacity(this.verticesCapacityHalf * 2L);<NEW_LINE>query.limit(Query.NO_LIMIT);<NEW_LINE>Iterator<Vertex> vertices = this.graph.vertices(query);<NEW_LINE>// switch concurrent loading here<NEW_LINE>boolean concurrent = true;<NEW_LINE>if (concurrent) {<NEW_LINE>try (LoadTraverser traverser = new LoadTraverser()) {<NEW_LINE>traverser.load(vertices);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Iterator<Edge> adjEdges;<NEW_LINE>Id lastId = IdGenerator.ZERO;<NEW_LINE>while (vertices.hasNext()) {<NEW_LINE>Id vertex = (Id) vertices.next().id();<NEW_LINE>if (vertex.compareTo(lastId) < 0) {<NEW_LINE>throw new HugeException("The ramtable feature is not " + "supported by %s backend", this.graph.backend());<NEW_LINE>}<NEW_LINE>ensureNumberId(vertex);<NEW_LINE>lastId = vertex;<NEW_LINE>adjEdges = this.graph.adjacentEdges(vertex);<NEW_LINE>if (adjEdges.hasNext()) {<NEW_LINE>HugeEdge edge = (HugeEdge) adjEdges.next();<NEW_LINE>this.addEdge(true, edge);<NEW_LINE>}<NEW_LINE>while (adjEdges.hasNext()) {<NEW_LINE>HugeEdge edge = (HugeEdge) adjEdges.next();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
this.addEdge(false, edge);
|
1,818,754
|
protected void internalTransform(Body b, String phaseName, Map<String, String> options) {<NEW_LINE>if (!b.getMethod().isSynchronized() || b.getMethod().isStatic()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Iterator<Unit> it = b.getUnits().snapshotIterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Unit u = it.next();<NEW_LINE>if (u instanceof IdentityStmt) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// This the first real statement. If it is not a MonitorEnter<NEW_LINE>// instruction, we generate one<NEW_LINE>if (!(u instanceof EnterMonitorStmt)) {<NEW_LINE>b.getUnits().insertBeforeNoRedirect(Jimple.v().newEnterMonitorStmt(b.getThisLocal()), u);<NEW_LINE>// We also need to leave the monitor when the method terminates<NEW_LINE>UnitGraph graph = ExceptionalUnitGraphFactory.createExceptionalUnitGraph(b);<NEW_LINE>for (Unit tail : graph.getTails()) {<NEW_LINE>b.getUnits().insertBefore(Jimple.v().newExitMonitorStmt(b<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
|
.getThisLocal()), tail);
|
1,441,224
|
public void aggregate(int length, AggregationResultHolder aggregationResultHolder, Map<ExpressionContext, BlockValSet> blockValSetMap) {<NEW_LINE>double min = Double.POSITIVE_INFINITY;<NEW_LINE>double max = Double.NEGATIVE_INFINITY;<NEW_LINE>BlockValSet blockValSet = blockValSetMap.get(_expression);<NEW_LINE>if (blockValSet.getValueType() != DataType.BYTES) {<NEW_LINE>double[] doubleValues = blockValSet.getDoubleValuesSV();<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>double value = doubleValues[i];<NEW_LINE>if (value < min) {<NEW_LINE>min = value;<NEW_LINE>}<NEW_LINE>if (value > max) {<NEW_LINE>max = value;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Serialized MinMaxRangePair<NEW_LINE>byte[][] bytesValues = blockValSet.getBytesValuesSV();<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>MinMaxRangePair minMaxRangePair = ObjectSerDeUtils.MIN_MAX_RANGE_PAIR_SER_DE.deserialize(bytesValues[i]);<NEW_LINE>double minValue = minMaxRangePair.getMin();<NEW_LINE>double maxValue = minMaxRangePair.getMax();<NEW_LINE>if (minValue < min) {<NEW_LINE>min = minValue;<NEW_LINE>}<NEW_LINE>if (maxValue > max) {<NEW_LINE>max = maxValue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
|
setAggregationResult(aggregationResultHolder, min, max);
|
1,838,543
|
private void appendStringify(Writer writer, HollowDataAccess dataAccess, String type, int ordinal, int indentation) throws IOException {<NEW_LINE>if (excludeObjectTypes.contains(type)) {<NEW_LINE>writer.append("null");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>HollowTypeDataAccess typeDataAccess = dataAccess.getTypeDataAccess(type);<NEW_LINE>if (typeDataAccess == null) {<NEW_LINE>writer.append("{ }");<NEW_LINE>} else if (ordinal == ORDINAL_NONE) {<NEW_LINE>writer.append("null");<NEW_LINE>} else {<NEW_LINE>if (typeDataAccess instanceof HollowObjectTypeDataAccess) {<NEW_LINE>appendObjectStringify(writer, dataAccess, (HollowObjectTypeDataAccess) typeDataAccess, ordinal, indentation);<NEW_LINE>} else if (typeDataAccess instanceof HollowListTypeDataAccess) {<NEW_LINE>appendListStringify(writer, dataAccess, (HollowListTypeDataAccess) typeDataAccess, ordinal, indentation);<NEW_LINE>} else if (typeDataAccess instanceof HollowSetTypeDataAccess) {<NEW_LINE>appendSetStringify(writer, dataAccess, (HollowSetTypeDataAccess) typeDataAccess, ordinal, indentation);<NEW_LINE>} else if (typeDataAccess instanceof HollowMapTypeDataAccess) {<NEW_LINE>appendMapStringify(writer, dataAccess, (<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
HollowMapTypeDataAccess) typeDataAccess, ordinal, indentation);
|
1,842,334
|
void init(Consumer<BytecodeTransformer> bytecodeTransformerConsumer, List<Predicate<BeanInfo>> additionalUnusedBeanExclusions) {<NEW_LINE>long start = System.nanoTime();<NEW_LINE>// Collect dependency resolution errors<NEW_LINE>List<Throwable> errors = new ArrayList<>();<NEW_LINE>for (BeanInfo bean : beans) {<NEW_LINE>bean.init(errors, bytecodeTransformerConsumer, transformUnproxyableClasses);<NEW_LINE>}<NEW_LINE>for (ObserverInfo observer : observers) {<NEW_LINE>observer.init(errors);<NEW_LINE>}<NEW_LINE>for (InterceptorInfo interceptor : interceptors) {<NEW_LINE>interceptor.init(errors, bytecodeTransformerConsumer, transformUnproxyableClasses);<NEW_LINE>}<NEW_LINE>for (DecoratorInfo decorator : decorators) {<NEW_LINE>decorator.init(errors, bytecodeTransformerConsumer, transformUnproxyableClasses);<NEW_LINE>}<NEW_LINE>processErrors(errors);<NEW_LINE>List<Predicate<BeanInfo>> allUnusedExclusions = new ArrayList<>(additionalUnusedBeanExclusions);<NEW_LINE>if (unusedExclusions != null) {<NEW_LINE>allUnusedExclusions.addAll(unusedExclusions);<NEW_LINE>}<NEW_LINE>if (removeUnusedBeans) {<NEW_LINE>long removalStart = System.nanoTime();<NEW_LINE>Set<BeanInfo> declaresObserver = observers.stream().map(ObserverInfo::getDeclaringBean).<MASK><NEW_LINE>Set<DecoratorInfo> removedDecorators = new HashSet<>();<NEW_LINE>Set<InterceptorInfo> removedInterceptors = new HashSet<>();<NEW_LINE>removeUnusedComponents(declaresObserver, allUnusedExclusions, removedDecorators, removedInterceptors);<NEW_LINE>LOGGER.debugf("Removed %s beans, %s interceptors and %s decorators in %s ms", removedBeans.size(), removedInterceptors.size(), removedDecorators.size(), TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - removalStart));<NEW_LINE>// we need to re-initialize it, so it does not contain removed beans<NEW_LINE>initBeanByTypeMap();<NEW_LINE>buildContext.putInternal(BuildExtension.Key.REMOVED_INTERCEPTORS.asString(), Collections.unmodifiableSet(removedInterceptors));<NEW_LINE>buildContext.putInternal(BuildExtension.Key.REMOVED_DECORATORS.asString(), Collections.unmodifiableSet(removedDecorators));<NEW_LINE>}<NEW_LINE>buildContext.putInternal(BuildExtension.Key.REMOVED_BEANS.asString(), Collections.unmodifiableSet(removedBeans));<NEW_LINE>LOGGER.debugf("Bean deployment initialized in %s ms", TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start));<NEW_LINE>}
|
collect(Collectors.toSet());
|
1,369,986
|
protected void scoreDisparity(final int disparityRange, final boolean leftToRight) {<NEW_LINE>final int[] scores = leftToRight ? scoreLtoR : scoreRtoL;<NEW_LINE>final byte[] dataLeft = patchTemplate.data;<NEW_LINE>final byte[] dataRight = patchCompare.data;<NEW_LINE>for (int d = 0; d < disparityRange; d++) {<NEW_LINE>int total = 0;<NEW_LINE>int idxLeft = 0;<NEW_LINE>for (int y = 0; y < blockHeight; y++) {<NEW_LINE>int idxRight = y * patchCompare.stride + d;<NEW_LINE>for (int x = 0; x < blockWidth; x++) {<NEW_LINE>total += Math.abs((dataLeft[idxLeft++] & 0xFF) - (dataRight[idxRight++] & 0xFF));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int index = leftToRight <MASK><NEW_LINE>scores[index] = total;<NEW_LINE>}<NEW_LINE>}
|
? disparityRange - d - 1 : d;
|
229,097
|
public List<IN> classifyGibbs(List<IN> document, Triple<int[][][], int[], double[][][]> documentDataAndLabels) throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException {<NEW_LINE>// log.info("Testing using Gibbs sampling.");<NEW_LINE>// reversed if necessary<NEW_LINE>List<IN> newDocument = document;<NEW_LINE>if (flags.useReverse) {<NEW_LINE>Collections.reverse(document);<NEW_LINE>newDocument = new ArrayList<>(document);<NEW_LINE>Collections.reverse(document);<NEW_LINE>}<NEW_LINE>CRFCliqueTree<? extends CharSequence> cliqueTree = getCliqueTree(documentDataAndLabels);<NEW_LINE>PriorModelFactory<IN> pmf = (PriorModelFactory<IN>) Class.forName(flags.priorModelFactory).newInstance();<NEW_LINE>ListeningSequenceModel prior = pmf.getInstance(flags.backgroundSymbol, classIndex, tagIndex, newDocument, entityMatrices, flags);<NEW_LINE>if (!flags.useUniformPrior) {<NEW_LINE>throw new RuntimeException("no prior specified");<NEW_LINE>}<NEW_LINE>SequenceModel model = new FactoredSequenceModel(cliqueTree, prior);<NEW_LINE>SequenceListener listener <MASK><NEW_LINE>SequenceGibbsSampler sampler = new SequenceGibbsSampler(0, 0, listener);<NEW_LINE>int[] sequence = new int[cliqueTree.length()];<NEW_LINE>if (flags.initViterbi) {<NEW_LINE>TestSequenceModel testSequenceModel = new TestSequenceModel(cliqueTree);<NEW_LINE>ExactBestSequenceFinder tagInference = new ExactBestSequenceFinder();<NEW_LINE>int[] bestSequence = tagInference.bestSequence(testSequenceModel);<NEW_LINE>System.arraycopy(bestSequence, windowSize - 1, sequence, 0, sequence.length);<NEW_LINE>} else {<NEW_LINE>int[] initialSequence = SequenceGibbsSampler.getRandomSequence(model);<NEW_LINE>System.arraycopy(initialSequence, 0, sequence, 0, sequence.length);<NEW_LINE>}<NEW_LINE>sampler.verbose = 0;<NEW_LINE>if (flags.annealingType.equalsIgnoreCase("linear")) {<NEW_LINE>sequence = sampler.findBestUsingAnnealing(model, CoolingSchedule.getLinearSchedule(1.0, flags.numSamples), sequence);<NEW_LINE>} else if (flags.annealingType.equalsIgnoreCase("exp") || flags.annealingType.equalsIgnoreCase("exponential")) {<NEW_LINE>sequence = sampler.findBestUsingAnnealing(model, CoolingSchedule.getExponentialSchedule(1.0, flags.annealingRate, flags.numSamples), sequence);<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("No annealing type specified");<NEW_LINE>}<NEW_LINE>if (flags.useReverse) {<NEW_LINE>Collections.reverse(document);<NEW_LINE>}<NEW_LINE>for (int j = 0, dsize = newDocument.size(); j < dsize; j++) {<NEW_LINE>IN wi = document.get(j);<NEW_LINE>if (wi == null)<NEW_LINE>throw new RuntimeException("");<NEW_LINE>if (classIndex == null)<NEW_LINE>throw new RuntimeException("");<NEW_LINE>wi.set(CoreAnnotations.AnswerAnnotation.class, classIndex.get(sequence[j]));<NEW_LINE>}<NEW_LINE>if (flags.useReverse) {<NEW_LINE>Collections.reverse(document);<NEW_LINE>}<NEW_LINE>return document;<NEW_LINE>}
|
= new FactoredSequenceListener(cliqueTree, prior);
|
1,332,839
|
protected void activate(Map<String, Object> config) {<NEW_LINE>List<Map<String, Object>> loginConfigs = NestingUtils.nest(WebserviceSecurity.LOGIN_CONFIG_ELEMENT_NAME, config);<NEW_LINE>if (loginConfigs != null && !loginConfigs.isEmpty())<NEW_LINE>this.loginConfig = new LoginConfigImpl(loginConfigs.get(0));<NEW_LINE>List<Map<String, Object>> securityConstraintConfigs = NestingUtils.nest(WebserviceSecurity.SECURITY_CONSTRAINT_ELEMENT_NAME, config);<NEW_LINE>if (securityConstraintConfigs != null) {<NEW_LINE>for (Map<String, Object> securityConstraintConfig : securityConstraintConfigs) {<NEW_LINE>securityConstraints.add(new SecurityConstraintImpl(securityConstraintConfig));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Map<String, Object>> securityRoleConfigs = NestingUtils.nest(WebserviceSecurity.SECURITY_ROLE_ELEMENT_NAME, config);<NEW_LINE>if (securityRoleConfigs != null) {<NEW_LINE>for (Map<String, Object> securityRoleConfig : securityRoleConfigs) {<NEW_LINE>securityRoles.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
add(new SecurityRoleImpl(securityRoleConfig));
|
805,570
|
public void encrypt(ByteBuf outBuf, List<ByteBuf> plainBufs) throws GeneralSecurityException {<NEW_LINE>checkArgument(outBuf.nioBufferCount() == 1);<NEW_LINE>// Copy plaintext buffers into outBuf for in-place encryption on single direct buffer.<NEW_LINE>ByteBuf plainBuf = outBuf.slice(outBuf.writerIndex(), outBuf.writableBytes());<NEW_LINE>plainBuf.writerIndex(0);<NEW_LINE>for (ByteBuf inBuf : plainBufs) {<NEW_LINE>plainBuf.writeBytes(inBuf);<NEW_LINE>}<NEW_LINE>verify(outBuf.writableBytes() == plainBuf.readableBytes() + TAG_LENGTH);<NEW_LINE>ByteBuffer out = outBuf.internalNioBuffer(outBuf.writerIndex(), outBuf.writableBytes());<NEW_LINE>ByteBuffer plain = out.duplicate();<NEW_LINE>plain.limit(out.limit() - TAG_LENGTH);<NEW_LINE>byte[] counter = incrementOutCounter();<NEW_LINE>int outPosition = out.position();<NEW_LINE>aeadCrypter.<MASK><NEW_LINE>int bytesWritten = out.position() - outPosition;<NEW_LINE>outBuf.writerIndex(outBuf.writerIndex() + bytesWritten);<NEW_LINE>verify(!outBuf.isWritable());<NEW_LINE>}
|
encrypt(out, plain, counter);
|
110,080
|
private void moveExportToOwnCloud() throws Exporter.ExporterException {<NEW_LINE>Log.i(TAG, "Copying exported file to ownCloud");<NEW_LINE>SharedPreferences mPrefs = mContext.getSharedPreferences(mContext.getString(R.string.owncloud_pref), Context.MODE_PRIVATE);<NEW_LINE>Boolean mOC_sync = mPrefs.getBoolean(mContext.getString(R.string.owncloud_sync), false);<NEW_LINE>if (!mOC_sync) {<NEW_LINE>throw new Exporter.ExporterException(mExportParams, "ownCloud not enabled.");<NEW_LINE>}<NEW_LINE>String mOC_server = mPrefs.getString(mContext.getString(R.string.key_owncloud_server), null);<NEW_LINE>String mOC_username = mPrefs.getString(mContext.getString(R.string.key_owncloud_username), null);<NEW_LINE>String mOC_password = mPrefs.getString(mContext.getString(R.string.key_owncloud_password), null);<NEW_LINE>String mOC_dir = mPrefs.getString(mContext.getString(R.string.key_owncloud_dir), null);<NEW_LINE>Uri serverUri = Uri.parse(mOC_server);<NEW_LINE>OwnCloudClient mClient = OwnCloudClientFactory.createOwnCloudClient(serverUri, this.mContext, true);<NEW_LINE>mClient.setCredentials(OwnCloudCredentialsFactory.newBasicCredentials(mOC_username, mOC_password));<NEW_LINE>if (mOC_dir.length() != 0) {<NEW_LINE>RemoteOperationResult dirResult = new CreateRemoteFolderOperation(mOC_dir, true).execute(mClient);<NEW_LINE>if (!dirResult.isSuccess()) {<NEW_LINE>Log.w(TAG, "Error creating folder (it may happen if it already exists): " + dirResult.getLogMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String exportedFilePath : mExportedFiles) {<NEW_LINE>String remotePath = mOC_dir + FileUtils.PATH_SEPARATOR + stripPathPart(exportedFilePath);<NEW_LINE>String mimeType = mExporter.getExportMimeType();<NEW_LINE>RemoteOperationResult result = new UploadRemoteFileOperation(exportedFilePath, remotePath, mimeType, getFileLastModifiedTimestamp(<MASK><NEW_LINE>if (!result.isSuccess())<NEW_LINE>throw new Exporter.ExporterException(mExportParams, result.getLogMessage());<NEW_LINE>new File(exportedFilePath).delete();<NEW_LINE>}<NEW_LINE>}
|
exportedFilePath)).execute(mClient);
|
1,683,130
|
private String slicesQuantSql() {<NEW_LINE>QuantizedColumn[] extras = getExtraQuantizedColumns();<NEW_LINE>StringBuilder level2 = new StringBuilder().append("select " + "quantum_ts, min(ts) over win1 start_ts, max(ts + dur) over win1 end_ts, depth, " + "substr(group_concat(name) over win1, 0, 101) label, id");<NEW_LINE>for (QuantizedColumn qc : extras) {<NEW_LINE>level2.append(", ").append(qc.windowed("win1")).append(" ").append(qc.name);<NEW_LINE>}<NEW_LINE>level2.append(" from ").append(tableName("span")).append(" window win1 as (partition by quantum_ts, depth order by dur desc " + "range between unbounded preceding and unbounded following)");<NEW_LINE>StringBuilder level1 = new StringBuilder().append("select " + "quantum_ts, start_ts, end_ts, depth, label, count(1) cnt, " + "quantum_ts - row_number() over win2 i, group_concat(id) id");<NEW_LINE>for (QuantizedColumn qc : extras) {<NEW_LINE>level1.append(", ").append(qc.name);<NEW_LINE>}<NEW_LINE>level1.append(" from (").append(level2).append(")").append(" group by quantum_ts, depth ").append(" window win2 as (partition by depth, label order by quantum_ts)");<NEW_LINE>StringBuilder outer = new StringBuilder().append("select " + "min(start_ts), max(end_ts), depth, label, max(cnt), group_concat(id) id");<NEW_LINE>for (QuantizedColumn qc : extras) {<NEW_LINE>outer.append(", ").append(qc.windowed("win3"));<NEW_LINE>}<NEW_LINE>outer.append(" from (").append(level1).append(")").append<MASK><NEW_LINE>return outer.toString();<NEW_LINE>}
|
(" group by depth, label, i").append(" window win3 as (partition by depth, label, i)");
|
1,735,394
|
private void waitingLoop() {<NEW_LINE>try {<NEW_LINE>while (true) {<NEW_LINE>// underlying work-queue is shutting down, quit the loop.<NEW_LINE>if (super.isShuttingDown()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// peek the first item from the delay queue<NEW_LINE>WaitForEntry<T> entry = delayQueue.peek();<NEW_LINE>// default next ready-at time to "never"<NEW_LINE>Duration nextReadyAt = heartBeatInterval;<NEW_LINE>if (entry != null) {<NEW_LINE>// the delay-queue isn't empty, so we deal with the item in the following logic:<NEW_LINE>// 1. check if the item is ready to fire<NEW_LINE>// a. if ready, remove it from the delay-queue and push it into underlying<NEW_LINE>// work-queue<NEW_LINE>// b. if not, refresh the next ready-at time.<NEW_LINE>Instant now = this.timeSource.get();<NEW_LINE>if (!Duration.between(entry.readyAtMillis, now).isNegative()) {<NEW_LINE>delayQueue.remove(entry);<NEW_LINE>super.add(entry.data);<NEW_LINE>this.waitingEntryByData.remove(entry.data);<NEW_LINE>continue;<NEW_LINE>} else {<NEW_LINE>nextReadyAt = Duration.between(now, entry.readyAtMillis);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>WaitForEntry<T> waitForEntry = waitingForAddQueue.poll(nextReadyAt.toMillis(), TimeUnit.MILLISECONDS);<NEW_LINE>if (waitForEntry != null) {<NEW_LINE>if (Duration.between(waitForEntry.readyAtMillis, this.timeSource.get()).isNegative()) {<NEW_LINE>// the item is not yet ready, insert it to the delay-queue<NEW_LINE>insert(this.<MASK><NEW_LINE>} else {<NEW_LINE>// the item is ready as soon as received, fire it to the work-queue directly<NEW_LINE>super.add(waitForEntry.data);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// empty block<NEW_LINE>}<NEW_LINE>}
|
delayQueue, this.waitingEntryByData, waitForEntry);
|
1,801,569
|
protected String toExcelName(String name) {<NEW_LINE>if (name.isEmpty()) {<NEW_LINE>// this is actually invalid, but let's leave it to POI to throw an exception<NEW_LINE>return name;<NEW_LINE>}<NEW_LINE>char[] chars = name.toCharArray();<NEW_LINE>StringBuilder escaped = null;<NEW_LINE>// TODO? always prepend "_" to avoid invalid names like R/C/A1<NEW_LINE>// valid character taken from the HSSFName.validateName method<NEW_LINE>if (!Character.isLetter(chars[0]) && chars[0] != '_' && chars[0] != '\\') {<NEW_LINE>escaped = new StringBuilder(chars.length * 4 / 3);<NEW_LINE>escaped.append('_');<NEW_LINE>escaped.append(Integer.toHexString(chars[0]));<NEW_LINE>}<NEW_LINE>for (int i = 1; i < chars.length; ++i) {<NEW_LINE>if (Character.isLetterOrDigit(chars[i]) || chars[i] == '_' || chars[i] == '\\' || chars[i] == '.') {<NEW_LINE>if (escaped != null) {<NEW_LINE>escaped.append(chars[i]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (escaped == null) {<NEW_LINE>escaped = new StringBuilder(chars.length * 4 / 3);<NEW_LINE>escaped.append(chars, 0, i);<NEW_LINE>}<NEW_LINE>escaped.append(Integer.toHexString(chars[i]));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String excelName = escaped == null <MASK><NEW_LINE>if (excelName.length() > 255) {<NEW_LINE>excelName = excelName.substring(0, 255);<NEW_LINE>}<NEW_LINE>// TODO? check for uniqueness<NEW_LINE>return excelName;<NEW_LINE>}
|
? name : escaped.toString();
|
1,052,480
|
final DescribeProtectionGroupResult executeDescribeProtectionGroup(DescribeProtectionGroupRequest describeProtectionGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeProtectionGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeProtectionGroupRequest> request = null;<NEW_LINE>Response<DescribeProtectionGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeProtectionGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeProtectionGroupRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Shield");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeProtectionGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeProtectionGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeProtectionGroupResultJsonUnmarshaller());<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>}
|
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
|
1,718,822
|
private void addVirtualMyMusicFolder() {<NEW_LINE>DbidTypeAndIdent myAlbums = new <MASK><NEW_LINE>VirtualFolderDbId myMusicFolder = new VirtualFolderDbId(Messages.getString("Audio.Like.MyAlbum"), myAlbums, "");<NEW_LINE>if (PMS.getConfiguration().displayAudioLikesInRootFolder()) {<NEW_LINE>if (!getChildren().contains(myMusicFolder)) {<NEW_LINE>myMusicFolder.setFakeParentId("0");<NEW_LINE>addChild(myMusicFolder, true, false);<NEW_LINE>LOGGER.debug("adding My Music folder to root");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!PMS.get().getLibrary().getAudioFolder().getChildren().contains(myMusicFolder)) {<NEW_LINE>myMusicFolder.setFakeParentId(PMS.get().getLibrary().getAudioFolder().getId());<NEW_LINE>PMS.get().getLibrary().getAudioFolder().addChild(myMusicFolder, true, false);<NEW_LINE>LOGGER.debug("adding My Music folder to 'Audio' folder");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
DbidTypeAndIdent(DbidMediaType.TYPE_MYMUSIC_ALBUM, null);
|
1,465,903
|
protected void createActions() {<NEW_LINE>super.createActions();<NEW_LINE>// content assist proposal action<NEW_LINE>IAction a = new // $NON-NLS-1$<NEW_LINE>TextOperationAction(// $NON-NLS-1$<NEW_LINE>TLAEditorMessages.getResourceBundle(), // $NON-NLS-1$<NEW_LINE>"ContentAssistProposal.", // $NON-NLS-1$<NEW_LINE>this, ISourceViewer.CONTENTASSIST_PROPOSALS);<NEW_LINE>a.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>setAction("ContentAssistProposal", a);<NEW_LINE>// content assist tip action<NEW_LINE>a = new // $NON-NLS-1$<NEW_LINE>TextOperationAction(// $NON-NLS-1$<NEW_LINE>TLAEditorMessages.getResourceBundle(), // $NON-NLS-1$<NEW_LINE>"ContentAssistTip.", // $NON-NLS-1$<NEW_LINE>this, ISourceViewer.CONTENTASSIST_CONTEXT_INFORMATION);<NEW_LINE>a.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>setAction("ContentAssistTip", a);<NEW_LINE>// define folding region action<NEW_LINE>// toggle comment<NEW_LINE>// $NON-NLS-1$<NEW_LINE>a = new ToggleCommentAction(TLAEditorMessages.getResourceBundle(), "ToggleComment.", this);<NEW_LINE>a.setActionDefinitionId(TLAEditorActivator.PLUGIN_ID + ".ToggleCommentAction");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>setAction("ToggleComment", a);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>markAsStateDependentAction("ToggleComment", true);<NEW_LINE>markAsSelectionDependentAction("ToggleComment", true);<NEW_LINE>((ToggleCommentAction) a).configure(<MASK><NEW_LINE>// format action (only if formater available)<NEW_LINE>if (getSourceViewerConfiguration().getContentFormatter(getSourceViewer()) != null) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>a = new TextOperationAction(TLAEditorMessages.getResourceBundle(), "Format.", this, ISourceViewer.FORMAT);<NEW_LINE>a.setActionDefinitionId(TLAEditorActivator.PLUGIN_ID + ".FormatAction");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>setAction("Format", a);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>markAsStateDependentAction("Format", true);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>markAsSelectionDependentAction("Format", true);<NEW_LINE>}<NEW_LINE>// createProofFoldAction(IProofFoldCommandIds.FOCUS_ON_STEP, "FoldUnusable.", "FoldUnusable");<NEW_LINE>// createProofFoldAction(IProofFoldCommandIds.FOLD_ALL_PROOFS, "FoldAllProofs.", "FoldAllProofs");<NEW_LINE>// createProofFoldAction(IProofFoldCommandIds.EXPAND_ALL_PROOFS, "ExpandAllProofs.", "ExpandAllProofs");<NEW_LINE>// createProofFoldAction(IProofFoldCommandIds.EXPAND_SUBTREE, "ExpandSubtree.", "ExpandSubtree");<NEW_LINE>// createProofFoldAction(IProofFoldCommandIds.COLLAPSE_SUBTREE, "CollapseSubtree.", "CollapseSubtree");<NEW_LINE>// createProofFoldAction(IProofFoldCommandIds.SHOW_IMMEDIATE, "ShowImmediate.", "ShowImmediate");<NEW_LINE>// a = new ExampleEditorAction(TLAEditorMessages.getResourceBundle(), "Example.", this, getStatusLineManager()); //$NON-NLS-1$<NEW_LINE>// a.setActionDefinitionId("org.lamport.tla.toolbox.editor.basic.TestEditorCommand");<NEW_LINE>// setAction("ToggleComment", a);<NEW_LINE>}
|
getSourceViewer(), getSourceViewerConfiguration());
|
1,319,681
|
public void onLoaded(com.ansca.corona.CoronaRuntime runtime) {<NEW_LINE>com.naef.jnlua.NamedJavaFunction[] luaFunctions;<NEW_LINE>// Fetch the Lua state from the runtime.<NEW_LINE>com.naef.jnlua.LuaState luaState = runtime.getLuaState();<NEW_LINE>// Add a module named "myTests" to Lua having the following functions.<NEW_LINE>luaFunctions = new com.naef.jnlua.NamedJavaFunction[] { new GetRandomBooleanLuaFunction(), new GetRandomNumberLuaFunction(), new GetRandomStringLuaFunction(), new GetRandomArrayLuaFunction(), new GetRandomTableLuaFunction(), new PrintBooleanLuaFunction(), new PrintNumberLuaFunction(), new PrintStringLuaFunction(), new PrintArrayLuaFunction(), new PrintTableLuaFunction(), new PrintTableValuesXYLuaFunction(), new CallLuaFunction<MASK><NEW_LINE>luaState.register("myTests", luaFunctions);<NEW_LINE>luaState.pop(1);<NEW_LINE>}
|
(), new AsyncCallLuaFunction() };
|
1,200,513
|
private void mountHomeDir(AppEntry entry) {<NEW_LINE>String home = entry.getBasePath();<NEW_LINE>if (home.length() > 5) {<NEW_LINE>// TODO: may be located deeper inside jar, not root ?<NEW_LINE>logger.error("Unhandled home directory: " + home);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>int homeJarID = Integer.parseInt(home);<NEW_LINE>long time = System.currentTimeMillis();<NEW_LINE>homeMountPoint = MountManager.mount(homeJarID, false);<NEW_LINE>if (homeMountPoint == null) {<NEW_LINE>logger.error("Failed mounting " + home + ".jar");<NEW_LINE>} else {<NEW_LINE>homeMountPoint = homeMountPoint + java.io.File.separator;<NEW_LINE>}<NEW_LINE>time = System.currentTimeMillis() - time;<NEW_LINE>logger.info("Mounted Xlet home directory from " + home + ".jar " + "to " + homeMountPoint + "(" + time + "ms)");<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.error(<MASK><NEW_LINE>}<NEW_LINE>}
|
"Failed mounting " + home + ".jar:" + ex);
|
1,270,941
|
private void injectManFileManager() {<NEW_LINE>// Override javac's JavaFileManager<NEW_LINE>_fileManager = getContext().get(JavaFileManager.class);<NEW_LINE>_manFileManager = new ManifoldJavaFileManager(getHost(), _fileManager, getContext(), true);<NEW_LINE>getContext().put(JavaFileManager.class, (JavaFileManager) null);<NEW_LINE>getContext().put(JavaFileManager.class, _manFileManager);<NEW_LINE>// Assign our file manager to javac's various components<NEW_LINE>try {<NEW_LINE>if (JreUtil.isJava8()) {<NEW_LINE>ReflectUtil.field(ClassReader.instance(getContext()), "fileManager").set(_manFileManager);<NEW_LINE>} else {<NEW_LINE>Object classFinder = ReflectUtil.method(CLASSFINDER_CLASS, "instance", Context.class).invokeStatic(getContext());<NEW_LINE>ReflectUtil.field(classFinder, "fileManager").set(_manFileManager);<NEW_LINE>ReflectUtil.field(classFinder<MASK><NEW_LINE>Object modules = ReflectUtil.method(MODULES_CLASS, "instance", Context.class).invokeStatic(getContext());<NEW_LINE>ReflectUtil.field(modules, "fileManager").set(_manFileManager);<NEW_LINE>Object moduleFinder = ReflectUtil.method(MODULEFINDER_CLASS, "instance", Context.class).invokeStatic(getContext());<NEW_LINE>ReflectUtil.field(moduleFinder, "fileManager").set(_manFileManager);<NEW_LINE>}<NEW_LINE>// Hack for using "-source 8" with Java 9<NEW_LINE>try {<NEW_LINE>Object classFinder = ReflectUtil.method(CLASSFINDER_CLASS, "instance", Context.class).invokeStatic(getContext());<NEW_LINE>ReflectUtil.field(classFinder, "fileManager").set(_manFileManager);<NEW_LINE>Object modules = ReflectUtil.method(MODULES_CLASS, "instance", Context.class).invokeStatic(getContext());<NEW_LINE>ReflectUtil.field(modules, "fileManager").set(_manFileManager);<NEW_LINE>Object moduleFinder = ReflectUtil.method(MODULEFINDER_CLASS, "instance", Context.class).invokeStatic(getContext());<NEW_LINE>ReflectUtil.field(moduleFinder, "fileManager").set(_manFileManager);<NEW_LINE>} catch (Throwable ignore) {<NEW_LINE>}<NEW_LINE>ReflectUtil.field(ClassWriter.instance(getContext()), "fileManager").set(_manFileManager);<NEW_LINE>ReflectUtil.field(Enter.instance(getContext()), "fileManager").set(_manFileManager);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}
|
, "preferSource").set(true);
|
854,023
|
public void initSubDevices() {<NEW_LINE>ModelFactory factory = ModelFactory.eINSTANCE;<NEW_LINE>AccelerometerDirection x = factory.createAccelerometerDirection();<NEW_LINE>x.setDirection(AccelerometerCoordinate.X);<NEW_LINE>x.setUid(getUid());<NEW_LINE>String subIdX = "x";<NEW_LINE>logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdX);<NEW_LINE>x.setSubId(subIdX);<NEW_LINE>x.init();<NEW_LINE>x.setMbrick(this);<NEW_LINE>AccelerometerDirection y = factory.createAccelerometerDirection();<NEW_LINE>y.setDirection(AccelerometerCoordinate.Y);<NEW_LINE>y.setUid(getUid());<NEW_LINE>String subIdY = "y";<NEW_LINE>logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdY);<NEW_LINE>y.setSubId(subIdY);<NEW_LINE>y.init();<NEW_LINE>y.setMbrick(this);<NEW_LINE>AccelerometerDirection z = factory.createAccelerometerDirection();<NEW_LINE>z.setDirection(AccelerometerCoordinate.Z);<NEW_LINE>z.setUid(getUid());<NEW_LINE>String subIdZ = "z";<NEW_LINE>logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdZ);<NEW_LINE>z.setSubId(subIdZ);<NEW_LINE>z.init();<NEW_LINE>z.setMbrick(this);<NEW_LINE>AccelerometerTemperature temperature = factory.createAccelerometerTemperature();<NEW_LINE>temperature.setUid(getUid());<NEW_LINE>String subIdTemperature = "temperature";<NEW_LINE>logger.debug(<MASK><NEW_LINE>temperature.setSubId(subIdTemperature);<NEW_LINE>temperature.init();<NEW_LINE>temperature.setMbrick(this);<NEW_LINE>AccelerometerLed led = factory.createAccelerometerLed();<NEW_LINE>led.setUid(getUid());<NEW_LINE>String subIdLed = "led";<NEW_LINE>logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdLed);<NEW_LINE>led.setSubId(subIdLed);<NEW_LINE>led.init();<NEW_LINE>led.setMbrick(this);<NEW_LINE>}
|
"{} addSubDevice {}", LoggerConstants.TFINIT, subIdTemperature);
|
637,653
|
void startEdit() {<NEW_LINE>// If we do not reset this, it could false the endEdit behavior in case no key was pressed.<NEW_LINE>lastKeyPressed = null;<NEW_LINE>editing = true;<NEW_LINE>handle.getGridView().addEventFilter(KeyEvent.KEY_PRESSED, enterKeyPressed);<NEW_LINE>handle.getCellsViewSkin().getVBar().valueProperty().addListener(endEditionListener);<NEW_LINE>handle.getCellsViewSkin().getHBar().valueProperty().addListener(endEditionListener);<NEW_LINE>Control editor = spreadsheetCellEditor.getEditor();<NEW_LINE>// Then we call the user editor in order for it to be ready<NEW_LINE>Object value = modelCell.getItem();<NEW_LINE>// We don't want the editor to go beyond the cell boundaries<NEW_LINE>Double maxHeight = Math.min(viewCell.getHeight(<MASK><NEW_LINE>if (editor != null) {<NEW_LINE>viewCell.setGraphic(editor);<NEW_LINE>editor.setMaxHeight(maxHeight);<NEW_LINE>editor.setPrefWidth(viewCell.getWidth());<NEW_LINE>}<NEW_LINE>spreadsheetCellEditor.startEdit(value, modelCell.getFormat(), modelCell.getOptionsForEditor());<NEW_LINE>if (editor != null) {<NEW_LINE>focusProperty = getFocusProperty(editor);<NEW_LINE>focusProperty.addListener(focusListener);<NEW_LINE>}<NEW_LINE>}
|
), spreadsheetCellEditor.getMaxHeight());
|
1,134,720
|
public int compareTo(SyncError other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetErrorCode(), other.isSetErrorCode());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetErrorCode()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetMessage(), other.isSetMessage());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetMessage()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
|
this.errorCode, other.errorCode);
|
1,820,929
|
private Pair<Integer, List<String>> processList(LinkedList<MultiDataSet> tempList, int partitionIdx, int countBefore, boolean finalExport) throws Exception {<NEW_LINE>// Go through the list. If we have enough examples: remove the DataSet objects, merge and export them. Otherwise: do nothing<NEW_LINE>int numExamples = 0;<NEW_LINE>for (MultiDataSet ds : tempList) {<NEW_LINE>numExamples += ds.getFeatures(0).size(0);<NEW_LINE>}<NEW_LINE>if (tempList.isEmpty() || (numExamples < minibatchSize && !finalExport)) {<NEW_LINE>// No op<NEW_LINE>return new Pair<>(countBefore, Collections.<String>emptyList());<NEW_LINE>}<NEW_LINE>List<String> exportPaths = new ArrayList<>();<NEW_LINE>int countAfter = countBefore;<NEW_LINE>// Batch the required number together<NEW_LINE>int countSoFar = 0;<NEW_LINE>List<MultiDataSet> tempToMerge = new ArrayList<>();<NEW_LINE>while (!tempList.isEmpty() && countSoFar != minibatchSize) {<NEW_LINE>MultiDataSet next = tempList.removeFirst();<NEW_LINE>if (countSoFar + next.getFeatures(0).size(0) <= minibatchSize) {<NEW_LINE>// Add the entire DataSet object<NEW_LINE>tempToMerge.add(next);<NEW_LINE>countSoFar += next.getFeatures(0).size(0);<NEW_LINE>} else {<NEW_LINE>// Split the DataSet<NEW_LINE>List<MultiDataSet> examples = next.asList();<NEW_LINE>for (MultiDataSet ds : examples) {<NEW_LINE>tempList.addFirst(ds);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// At this point: we should have the required number of examples in tempToMerge (unless it's a final export)<NEW_LINE>MultiDataSet toExport = org.nd4j.linalg.dataset.MultiDataSet.merge(tempToMerge);<NEW_LINE>exportPaths.add(export(toExport, partitionIdx, countAfter++));<NEW_LINE>return new <MASK><NEW_LINE>}
|
Pair<>(countAfter, exportPaths);
|
398,716
|
public HtmlResponse delete(final EditForm form) {<NEW_LINE>verifyCrudMode(form.crudMode, CrudMode.DETAILS);<NEW_LINE>validate(form, messages -> {<NEW_LINE>}, this::asDetailsHtml);<NEW_LINE>verifyToken(this::asDetailsHtml);<NEW_LINE>final String id = form.id;<NEW_LINE>boostDocumentRuleService.getBoostDocumentRule(id).ifPresent(entity -> {<NEW_LINE>try {<NEW_LINE>boostDocumentRuleService.delete(entity);<NEW_LINE>saveInfo(messages <MASK><NEW_LINE>} catch (final Exception e) {<NEW_LINE>throwValidationError(messages -> messages.addErrorsCrudFailedToDeleteCrudTable(GLOBAL, buildThrowableMessage(e)), this::asEditHtml);<NEW_LINE>}<NEW_LINE>}).orElse(() -> {<NEW_LINE>throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), this::asDetailsHtml);<NEW_LINE>});<NEW_LINE>return redirect(getClass());<NEW_LINE>}
|
-> messages.addSuccessCrudDeleteCrudTable(GLOBAL));
|
1,213,530
|
public BatchDetectSyntaxResult batchDetectSyntax(BatchDetectSyntaxRequest batchDetectSyntaxRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(batchDetectSyntaxRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BatchDetectSyntaxRequest> request = null;<NEW_LINE>Response<BatchDetectSyntaxResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new <MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<BatchDetectSyntaxResult, JsonUnmarshallerContext> unmarshaller = new BatchDetectSyntaxResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<BatchDetectSyntaxResult> responseHandler = new JsonResponseHandler<BatchDetectSyntaxResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
|
BatchDetectSyntaxRequestMarshaller().marshall(batchDetectSyntaxRequest);
|
1,259,242
|
public void run(RegressionEnvironment env) {<NEW_LINE>ConditionHandlerFactoryContext conditionHandlerFactoryContext = SupportConditionHandlerFactory.getFactoryContexts().get(0);<NEW_LINE>assertEquals(conditionHandlerFactoryContext.getRuntimeURI(), env.runtimeURI());<NEW_LINE>handler = SupportConditionHandlerFactory.getLastHandler();<NEW_LINE>String[] fields = "c0".split(",");<NEW_LINE>String epl = "@name('s0') select * from SupportBean " + "match_recognize (" + " partition by theString " + " measures P1.theString as c0" + " pattern (P1 P2) " + " define " + " P1 as P1.intPrimitive = 1," + " P2 as P2.intPrimitive = 2" + ")";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>env.sendEventBean(new SupportBean("A", 1));<NEW_LINE>env.sendEventBean(new SupportBean("B", 1));<NEW_LINE>env.sendEventBean(new SupportBean("C", 1));<NEW_LINE>assertTrue(handler.getContexts().isEmpty());<NEW_LINE>// overflow<NEW_LINE>env.sendEventBean(new SupportBean("D", 1));<NEW_LINE>RowRecogMaxStatesEngineWide3Instance.assertContextEnginePool(env, "s0", handler.getAndResetContexts(), 3, RowRecogMaxStatesEngineWide3Instance.getExpectedCountMap(env, "s0", 3));<NEW_LINE>env.sendEventBean(new SupportBean("E", 1));<NEW_LINE>RowRecogMaxStatesEngineWide3Instance.assertContextEnginePool(env, "s0", handler.getAndResetContexts(), 3, RowRecogMaxStatesEngineWide3Instance.getExpectedCountMap(env, "s0", 4));<NEW_LINE>// D gone<NEW_LINE>env.sendEventBean(new SupportBean("D", 2));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "D" });<NEW_LINE>// A gone<NEW_LINE>env.sendEventBean(new SupportBean("A", 2));<NEW_LINE>env.assertPropsNew("s0", fields, <MASK><NEW_LINE>// C gone<NEW_LINE>env.sendEventBean(new SupportBean("C", 2));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "C" });<NEW_LINE>env.sendEventBean(new SupportBean("F", 1));<NEW_LINE>assertTrue(handler.getContexts().isEmpty());<NEW_LINE>env.sendEventBean(new SupportBean("G", 1));<NEW_LINE>RowRecogMaxStatesEngineWide3Instance.assertContextEnginePool(env, "s0", handler.getAndResetContexts(), 3, RowRecogMaxStatesEngineWide3Instance.getExpectedCountMap(env, "s0", 3));<NEW_LINE>env.undeployAll();<NEW_LINE>}
|
new Object[] { "A" });
|
1,166,066
|
public void visit(BLangAnnotationAttachment annAttachmentNode) {<NEW_LINE>if (annAttachmentNode.expr == null && annAttachmentNode.annotationSymbol.attachedType != null) {<NEW_LINE>BType attachedType = Types.getReferredType(annAttachmentNode.annotationSymbol.attachedType);<NEW_LINE>if (attachedType.tag != TypeTags.FINITE) {<NEW_LINE>annAttachmentNode.expr = ASTBuilderUtil.createEmptyRecordLiteral(annAttachmentNode.pos, attachedType.tag == TypeTags.ARRAY ? ((BArrayType<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (annAttachmentNode.expr != null) {<NEW_LINE>annAttachmentNode.expr = rewrite(annAttachmentNode.expr, env);<NEW_LINE>for (AttachPoint point : annAttachmentNode.annotationSymbol.points) {<NEW_LINE>if (!point.source) {<NEW_LINE>annAttachmentNode.expr = visitCloneReadonly(annAttachmentNode.expr, annAttachmentNode.expr.getBType());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result = annAttachmentNode;<NEW_LINE>}
|
) attachedType).eType : attachedType);
|
1,259,930
|
final DeleteBotLocaleResult executeDeleteBotLocale(DeleteBotLocaleRequest deleteBotLocaleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteBotLocaleRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteBotLocaleRequest> request = null;<NEW_LINE>Response<DeleteBotLocaleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteBotLocaleRequestProtocolMarshaller(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, "Lex Models V2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteBotLocale");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteBotLocaleResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteBotLocaleResultJsonUnmarshaller());<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>}
|
(super.beforeMarshalling(deleteBotLocaleRequest));
|
1,092,686
|
private StringBuilder replace(String wmlTemplateString, int offset, StringBuilder strB, java.util.Map<String, ?> mappings) {<NEW_LINE>int startKey = wmlTemplateString.indexOf("${", offset);<NEW_LINE>if (startKey == -1)<NEW_LINE>return strB.append(wmlTemplateString.substring(offset));<NEW_LINE>else {<NEW_LINE>strB.append(wmlTemplateString<MASK><NEW_LINE>int keyEnd = wmlTemplateString.indexOf('}', startKey);<NEW_LINE>if (keyEnd > 0) {<NEW_LINE>String key = wmlTemplateString.substring(startKey + 2, keyEnd);<NEW_LINE>Object val = mappings.get(key);<NEW_LINE>if (val == null) {<NEW_LINE>System.out.println("Invalid key '" + key + "' or key not mapped to a value");<NEW_LINE>strB.append(key);<NEW_LINE>} else {<NEW_LINE>strB.append(val.toString());<NEW_LINE>}<NEW_LINE>return replace(wmlTemplateString, keyEnd + 1, strB, mappings);<NEW_LINE>} else {<NEW_LINE>System.out.println("Invalid key: could not find '}' ");<NEW_LINE>strB.append("$");<NEW_LINE>return replace(wmlTemplateString, offset + 1, strB, mappings);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
.substring(offset, startKey));
|
1,117,893
|
public static void printGemmFailureDetails(INDArray a, INDArray b, INDArray c, boolean transposeA, boolean transposeB, double alpha, double beta, RealMatrix expected, INDArray actual, INDArray onCopies) {<NEW_LINE>System.out.println("\nFactory: " + Nd4j.factory().getClass() + "\n");<NEW_LINE>System.out.println("Op: gemm(a,b,c,transposeA=" + transposeA + ",transposeB=" + transposeB + ",alpha=" + alpha + ",beta=" + beta + ")");<NEW_LINE>System.out.println("a:");<NEW_LINE>printMatrixFullPrecision(a);<NEW_LINE><MASK><NEW_LINE>printMatrixFullPrecision(b);<NEW_LINE>System.out.println("\nc:");<NEW_LINE>printMatrixFullPrecision(c);<NEW_LINE>System.out.println("\nExpected (Apache Commons)");<NEW_LINE>printApacheMatrix(expected);<NEW_LINE>System.out.println("\nSame Nd4j op on zero offset copies: gemm(aCopy,bCopy,cCopy," + transposeA + "," + transposeB + "," + alpha + "," + beta + ")");<NEW_LINE>printMatrixFullPrecision(onCopies);<NEW_LINE>System.out.println("\nActual:");<NEW_LINE>printMatrixFullPrecision(actual);<NEW_LINE>}
|
System.out.println("\nb:");
|
276,211
|
public void handleError(String location, Request req, Response resp) throws ServletException, IOException {<NEW_LINE>try {<NEW_LINE>log("handleError: " + location);<NEW_LINE>String filter_path = req.getFilterPath();<NEW_LINE>String servlet_path = req.getServletPath();<NEW_LINE>String path_info = req.getPathInfo();<NEW_LINE>String req_uri = req.getRequestURI();<NEW_LINE>DispatcherType dtype = req.getDispatcherType();<NEW_LINE>URI uri;<NEW_LINE>if (location.startsWith("/")) {<NEW_LINE>uri = new URI(context_path_ + location);<NEW_LINE>} else {<NEW_LINE>uri = new URI(req_uri).resolve(location);<NEW_LINE>}<NEW_LINE>req.<MASK><NEW_LINE>req.setDispatcherType(DispatcherType.ERROR);<NEW_LINE>String path = uri.getPath().substring(context_path_.length());<NEW_LINE>ServletReg servlet = findServlet(path, req);<NEW_LINE>req.setMultipartConfig(servlet.multipart_config_);<NEW_LINE>FilterChain fc = new CtxFilterChain(servlet, req.getFilterPath(), DispatcherType.ERROR);<NEW_LINE>fc.doFilter(req, resp);<NEW_LINE>req.setServletPath(filter_path, servlet_path, path_info);<NEW_LINE>req.setRequestURI(req_uri);<NEW_LINE>req.setDispatcherType(dtype);<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>throw new ServletException(e);<NEW_LINE>}<NEW_LINE>}
|
setRequestURI(uri.getRawPath());
|
505,853
|
private void populateTraceTnSlowCountAndPointPartialPart2() throws Exception {<NEW_LINE>if (!columnExists("trace_tn_slow_point", "partial")) {<NEW_LINE>// previously failed mid-upgrade prior to updating schema version<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PreparedStatement deleteCountPS = session.prepare("delete from trace_tn_slow_count where" + " agent_rollup = ? and transaction_type = ? and transaction_name = ? and" + " capture_time = ? and agent_id = ? and trace_id = ?");<NEW_LINE>PreparedStatement deletePointPS = session.prepare("delete from trace_tn_slow_point where" + " agent_rollup = ? and transaction_type = ? and transaction_name = ? and" + " capture_time = ? and agent_id = ? and trace_id = ?");<NEW_LINE>ResultSet results = session.read("select agent_rollup, transaction_type," + " transaction_name, capture_time, agent_id, trace_id from" + " trace_tn_slow_count_partial");<NEW_LINE>Queue<ListenableFuture<?>> futures = new ArrayDeque<>();<NEW_LINE>for (Row row : results) {<NEW_LINE>BoundStatement boundStatement = deleteCountPS.bind();<NEW_LINE>int i = 0;<NEW_LINE>// agent_rollup<NEW_LINE>copyString(row, boundStatement, i++);<NEW_LINE>// transaction_type<NEW_LINE>copyString(row, boundStatement, i++);<NEW_LINE>// transaction_name<NEW_LINE>copyString<MASK><NEW_LINE>// capture_time<NEW_LINE>copyTimestamp(row, boundStatement, i++);<NEW_LINE>// agent_id<NEW_LINE>copyString(row, boundStatement, i++);<NEW_LINE>// trace_id<NEW_LINE>copyString(row, boundStatement, i++);<NEW_LINE>futures.add(session.writeAsync(boundStatement));<NEW_LINE>boundStatement = deletePointPS.bind();<NEW_LINE>i = 0;<NEW_LINE>// agent_rollup<NEW_LINE>copyString(row, boundStatement, i++);<NEW_LINE>// transaction_type<NEW_LINE>copyString(row, boundStatement, i++);<NEW_LINE>// transaction_name<NEW_LINE>copyString(row, boundStatement, i++);<NEW_LINE>// capture_time<NEW_LINE>copyTimestamp(row, boundStatement, i++);<NEW_LINE>// agent_id<NEW_LINE>copyString(row, boundStatement, i++);<NEW_LINE>// trace_id<NEW_LINE>copyString(row, boundStatement, i++);<NEW_LINE>futures.add(session.writeAsync(boundStatement));<NEW_LINE>waitForSome(futures);<NEW_LINE>}<NEW_LINE>MoreFutures.waitForAll(futures);<NEW_LINE>dropColumnIfExists("trace_tn_slow_point", "partial");<NEW_LINE>}
|
(row, boundStatement, i++);
|
737,290
|
private Mono<Response<Void>> deleteWithResponseAsync(String resourceGroupName, String name, 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.<MASK><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 (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name 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(), resourceGroupName, name, this.client.getApiVersion(), accept, context);<NEW_LINE>}
|
error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));
|
1,760,056
|
public static QueryMqSofamqMessageByTopicResponse unmarshall(QueryMqSofamqMessageByTopicResponse queryMqSofamqMessageByTopicResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryMqSofamqMessageByTopicResponse.setRequestId(_ctx.stringValue("QueryMqSofamqMessageByTopicResponse.RequestId"));<NEW_LINE>queryMqSofamqMessageByTopicResponse.setResultCode(_ctx.stringValue("QueryMqSofamqMessageByTopicResponse.ResultCode"));<NEW_LINE>queryMqSofamqMessageByTopicResponse.setResultMessage(_ctx.stringValue("QueryMqSofamqMessageByTopicResponse.ResultMessage"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNum(_ctx.longValue("QueryMqSofamqMessageByTopicResponse.Data.PageNum"));<NEW_LINE>data.setPageSize(_ctx.longValue("QueryMqSofamqMessageByTopicResponse.Data.PageSize"));<NEW_LINE>data.setTaskId(_ctx.stringValue("QueryMqSofamqMessageByTopicResponse.Data.TaskId"));<NEW_LINE>data.setTotal(_ctx.longValue("QueryMqSofamqMessageByTopicResponse.Data.Total"));<NEW_LINE>List<ContentItem> content = new ArrayList<ContentItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryMqSofamqMessageByTopicResponse.Data.Content.Length"); i++) {<NEW_LINE>ContentItem contentItem = new ContentItem();<NEW_LINE>contentItem.setBody(_ctx.stringValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].Body"));<NEW_LINE>contentItem.setBodyCrc(_ctx.longValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].BodyCrc"));<NEW_LINE>contentItem.setBornHost(_ctx.stringValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].BornHost"));<NEW_LINE>contentItem.setBornTimestamp(_ctx.longValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].BornTimestamp"));<NEW_LINE>contentItem.setInstanceId(_ctx.stringValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].InstanceId"));<NEW_LINE>contentItem.setMsgId(_ctx.stringValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].MsgId"));<NEW_LINE>contentItem.setReconsumeTimes(_ctx.longValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].ReconsumeTimes"));<NEW_LINE>contentItem.setStoreHost(_ctx.stringValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].StoreHost"));<NEW_LINE>contentItem.setStoreSize(_ctx.longValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].StoreSize"));<NEW_LINE>contentItem.setStoreTimestamp(_ctx.longValue<MASK><NEW_LINE>contentItem.setTopic(_ctx.stringValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].Topic"));<NEW_LINE>List<PropertyListItem> propertyList = new ArrayList<PropertyListItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].PropertyList.Length"); j++) {<NEW_LINE>PropertyListItem propertyListItem = new PropertyListItem();<NEW_LINE>propertyListItem.setName(_ctx.stringValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].PropertyList[" + j + "].Name"));<NEW_LINE>propertyListItem.setValue(_ctx.stringValue("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].PropertyList[" + j + "].Value"));<NEW_LINE>propertyList.add(propertyListItem);<NEW_LINE>}<NEW_LINE>contentItem.setPropertyList(propertyList);<NEW_LINE>content.add(contentItem);<NEW_LINE>}<NEW_LINE>data.setContent(content);<NEW_LINE>queryMqSofamqMessageByTopicResponse.setData(data);<NEW_LINE>return queryMqSofamqMessageByTopicResponse;<NEW_LINE>}
|
("QueryMqSofamqMessageByTopicResponse.Data.Content[" + i + "].StoreTimestamp"));
|
1,270,667
|
public boolean isActive(FeatureState featureState, FeatureUser user) {<NEW_LINE>HttpServletRequest request = HttpServletRequestHolder.get();<NEW_LINE>if (request == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String triggerParamsString = featureState.getParameter(PARAM_URL_PARAMS);<NEW_LINE>if (Strings.isBlank(triggerParamsString)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String[] triggerParams = SPLIT_ON_COMMA.split(triggerParamsString.trim());<NEW_LINE>Map<String, String[]> <MASK><NEW_LINE>actualParams.putAll(request.getParameterMap());<NEW_LINE>String referer = request.getHeader("referer");<NEW_LINE>if (referer != null) {<NEW_LINE>for (Map.Entry<String, List<String>> entry : getRefererParameters(actualParams, referer).entrySet()) {<NEW_LINE>actualParams.put(entry.getKey(), entry.getValue().toArray(new String[entry.getValue().size()]));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return isTriggerParamPresent(actualParams, triggerParams);<NEW_LINE>}
|
actualParams = new HashMap<>();
|
50,780
|
private void render(ListItem item, Object data) {<NEW_LINE>Listcell listcell = null;<NEW_LINE>int colIndex = 0;<NEW_LINE>int rowIndex = item.getIndex();<NEW_LINE>WListbox table = null;<NEW_LINE>if (item.getListbox() instanceof WListbox) {<NEW_LINE>table = (WListbox) item.getListbox();<NEW_LINE>}<NEW_LINE>int colorCode = 0;<NEW_LINE>if (table != null) {<NEW_LINE><MASK><NEW_LINE>if (colorCode < 0) {<NEW_LINE>// Color the row.<NEW_LINE>// TODO: do this with a class and CSS<NEW_LINE>item.setStyle("color: #FF0000; " + item.getStyle());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!(data instanceof List)) {<NEW_LINE>throw new IllegalArgumentException("A model element was not a list");<NEW_LINE>}<NEW_LINE>if (listBox == null || listBox != item.getListbox()) {<NEW_LINE>listBox = item.getListbox();<NEW_LINE>}<NEW_LINE>if (cellListener == null) {<NEW_LINE>cellListener = new CellListener();<NEW_LINE>}<NEW_LINE>for (Object field : (List<?>) data) {<NEW_LINE>listcell = getCellComponent(table, field, rowIndex, colIndex);<NEW_LINE>listcell.setParent(item);<NEW_LINE>listcell.addEventListener(Events.ON_DOUBLE_CLICK, cellListener);<NEW_LINE>listcell.setAttribute("zk_component_ID", "ListItem_R" + rowIndex + "_C" + colIndex);<NEW_LINE>colIndex++;<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}
|
colorCode = table.getColorCode(rowIndex);
|
1,686,475
|
final DeleteVolumeResult executeDeleteVolume(DeleteVolumeRequest deleteVolumeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteVolumeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteVolumeRequest> request = null;<NEW_LINE>Response<DeleteVolumeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteVolumeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteVolumeRequest));<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, "FSx");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteVolume");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteVolumeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><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>}
|
false), new DeleteVolumeResultJsonUnmarshaller());
|
1,321,216
|
public ModelAndView renderAdminPage() {<NEW_LINE>log.debug("renderAdminPage()");<NEW_LINE>final List<ModuleType<MASK><NEW_LINE>final Set<Resource> resources = new HashSet<>();<NEW_LINE>final Set<AdminSidebarItem> adminSidebarItems = new HashSet<>();<NEW_LINE>moduleTypes.forEach(moduleType -> {<NEW_LINE>resources.addAll(moduleType.getResources());<NEW_LINE>adminSidebarItems.addAll(moduleType.getAdminSidebarItems());<NEW_LINE>});<NEW_LINE>List<Resource> uniqueResources = resources.stream().filter(distinctByKey(resource -> resource.getRelativeUrl())).collect(Collectors.toList());<NEW_LINE>uniqueResources.forEach(resource -> log.debug("resource: " + resource));<NEW_LINE>List<String> angularJsModules = moduleTypes.stream().filter(moduleType -> moduleType.getAngularJsNameAdmin() != null).filter(distinctByKey(moduleType -> moduleType.getAngularJsNameAdmin())).map(moduleType -> moduleType.getAngularJsNameAdmin()).collect(Collectors.toList());<NEW_LINE>angularJsModules.forEach(angularJsModule -> log.debug(angularJsModule));<NEW_LINE>List<AdminSidebarItem> uniqueAdminSidebarItems = adminSidebarItems.stream().filter(distinctByKey(adminSidebarItem -> adminSidebarItem.getTitle())).collect(Collectors.toList());<NEW_LINE>uniqueAdminSidebarItems.forEach(adminSidebarItem -> log.debug("adminSidebarItem: {}", adminSidebarItem));<NEW_LINE>ModelAndView modelAndView = new ModelAndView("control-panel/index");<NEW_LINE>modelAndView.addObject("resources", uniqueResources);<NEW_LINE>modelAndView.addObject("angularJsModules", angularJsModules);<NEW_LINE>modelAndView.addObject("adminSidebarItems", uniqueAdminSidebarItems);<NEW_LINE>return modelAndView;<NEW_LINE>}
|
> moduleTypes = moduleTypeHystrixClient.getAllModuleTypes();
|
1,404,877
|
static // / @brief Print the solution.<NEW_LINE>void printSolution(DataModel data, RoutingModel routing, RoutingIndexManager manager, Assignment solution) {<NEW_LINE>// Solution cost.<NEW_LINE>logger.info("Objective : " + solution.objectiveValue());<NEW_LINE>// Inspect solution.<NEW_LINE>long maxRouteDistance = 0;<NEW_LINE>for (int i = 0; i < data.vehicleNumber; ++i) {<NEW_LINE>long index = routing.start(i);<NEW_LINE>logger.info("Route for Vehicle " + i + ":");<NEW_LINE>long routeDistance = 0;<NEW_LINE>String route = "";<NEW_LINE>while (!routing.isEnd(index)) {<NEW_LINE>route += manager.indexToNode(index) + " -> ";<NEW_LINE>long previousIndex = index;<NEW_LINE>index = solution.value<MASK><NEW_LINE>routeDistance += routing.getArcCostForVehicle(previousIndex, index, i);<NEW_LINE>}<NEW_LINE>logger.info(route + manager.indexToNode(index));<NEW_LINE>logger.info("Distance of the route: " + routeDistance + "m");<NEW_LINE>maxRouteDistance = Math.max(routeDistance, maxRouteDistance);<NEW_LINE>}<NEW_LINE>logger.info("Maximum of the route distances: " + maxRouteDistance + "m");<NEW_LINE>}
|
(routing.nextVar(index));
|
724,496
|
private void commandLea(Instruction instruction, int flags) {<NEW_LINE>if ((flags & Flags.NO_REGISTER_USAGE) == 0) {<NEW_LINE>assert info.usedRegisters.size() >= 1 : info.usedRegisters.size();<NEW_LINE>assert instruction.getOp0Kind() == OpKind.REGISTER : instruction.getOp0Kind();<NEW_LINE>int reg = instruction.getOp0Register();<NEW_LINE>for (int i = 1; i < info.usedRegisters.size(); i++) {<NEW_LINE>UsedRegister regInfo = <MASK><NEW_LINE>if (reg >= Register.EAX && reg <= Register.R15D) {<NEW_LINE>if (regInfo.getRegister() >= Register.RAX && regInfo.getRegister() <= Register.R15) {<NEW_LINE>int memReg = regInfo.getRegister() - Register.RAX + Register.EAX;<NEW_LINE>info.usedRegisters.set(i, new UsedRegister(memReg, regInfo.getAccess()));<NEW_LINE>}<NEW_LINE>} else if (reg >= Register.AX && reg <= Register.R15W) {<NEW_LINE>if (regInfo.getRegister() >= Register.EAX && regInfo.getRegister() <= Register.R15) {<NEW_LINE>int memReg = ((regInfo.getRegister() - Register.EAX) & 0xF) + Register.AX;<NEW_LINE>info.usedRegisters.set(i, new UsedRegister(memReg, regInfo.getAccess()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>assert reg >= Register.RAX && reg <= Register.R15 : reg;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
info.usedRegisters.get(i);
|
1,451,135
|
public BatchDeleteDocumentResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>BatchDeleteDocumentResult batchDeleteDocumentResult = new BatchDeleteDocumentResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return batchDeleteDocumentResult;<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("FailedDocuments", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>batchDeleteDocumentResult.setFailedDocuments(new ListUnmarshaller<BatchDeleteDocumentResponseFailedDocument>(BatchDeleteDocumentResponseFailedDocumentJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return batchDeleteDocumentResult;<NEW_LINE>}
|
String currentParentElement = context.getCurrentParentElement();
|
265,765
|
public static List<String> tokenizeIntoList(CharSequence chars, final boolean includeSeparators, final boolean skipLastEmptyLine) {<NEW_LINE>if (chars == null || chars.length() == 0) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>LineTokenizer tokenizer = new LineTokenizer(chars);<NEW_LINE>List<String> lines = new ArrayList<String>();<NEW_LINE>while (!tokenizer.atEnd()) {<NEW_LINE>int offset = tokenizer.getOffset();<NEW_LINE>String line;<NEW_LINE>if (includeSeparators) {<NEW_LINE>line = chars.subSequence(offset, offset + tokenizer.getLength() + tokenizer.<MASK><NEW_LINE>} else {<NEW_LINE>line = chars.subSequence(offset, offset + tokenizer.getLength()).toString();<NEW_LINE>}<NEW_LINE>lines.add(line);<NEW_LINE>tokenizer.advance();<NEW_LINE>}<NEW_LINE>if (!skipLastEmptyLine && stringEndsWithSeparator(tokenizer))<NEW_LINE>lines.add("");<NEW_LINE>return lines;<NEW_LINE>}
|
getLineSeparatorLength()).toString();
|
301,196
|
private TypeSpec newDefaultClientClassSpec(final State state, final ClassName defaultClientClass, final ClassName defaultBlockingClientClass) {<NEW_LINE>final TypeSpec.Builder typeSpecBuilder = classBuilder(defaultClientClass).addModifiers(PRIVATE, STATIC, FINAL).addSuperinterface(state.clientClass).addField(GrpcClientCallFactory, factory, PRIVATE, FINAL).addField(GrpcSupportedCodings, supportedMessageCodings, PRIVATE, FINAL).addField(BufferDecoderGroup, bufferDecoderGroup, PRIVATE, FINAL).addMethod(// TODO: Cache client<NEW_LINE>methodBuilder("asBlockingClient").addModifiers(PUBLIC).addAnnotation(Override.class).returns(state.blockingClientClass).addStatement("return new $T($L, $L, $L)", defaultBlockingClientClass, factory, supportedMessageCodings, bufferDecoderGroup).build()).addMethod(newDelegatingMethodSpec(executionContext, factory, GrpcExecutionContext, null)).addMethod(newDelegatingCompletableMethodSpec(onClose, factory)).addMethod(newDelegatingCompletableMethodSpec(closeAsync, factory)).addMethod(newDelegatingCompletableMethodSpec(closeAsyncGracefully, factory)).addMethod(newDelegatingCompletableToBlockingMethodSpec(close, closeAsync, factory)).addMethod(newDelegatingCompletableToBlockingMethodSpec<MASK><NEW_LINE>final MethodSpec.Builder constructorBuilder = constructorBuilder().addModifiers(PRIVATE).addParameter(GrpcClientCallFactory, factory, FINAL).addParameter(GrpcSupportedCodings, supportedMessageCodings, FINAL).addParameter(BufferDecoderGroup, bufferDecoderGroup, FINAL).addStatement("this.$N = $N", factory, factory).addStatement("this.$N = $N", supportedMessageCodings, supportedMessageCodings).addStatement("this.$N = $N", bufferDecoderGroup, bufferDecoderGroup);<NEW_LINE>addClientFieldsAndMethods(state, typeSpecBuilder, constructorBuilder, false);<NEW_LINE>typeSpecBuilder.addMethod(constructorBuilder.build());<NEW_LINE>return typeSpecBuilder.build();<NEW_LINE>}
|
(closeGracefully, closeAsyncGracefully, factory));
|
189,540
|
private void parseAndSetLoginOptions(String options) {<NEW_LINE>Matcher m = OPTION_PATTERN.matcher(options);<NEW_LINE>if (!m.find()) {<NEW_LINE>loginOptionsMulti = Collections.emptyMap();<NEW_LINE>}<NEW_LINE>Map<String, List<String>> optsMap = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);<NEW_LINE>do {<NEW_LINE>String p = m.group();<NEW_LINE>p = GenericUtils.trimToEmpty(p);<NEW_LINE>if (StringUtils.isEmpty(p)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int <MASK><NEW_LINE>String name = (pos < 0) ? p : GenericUtils.trimToEmpty(p.substring(0, pos));<NEW_LINE>CharSequence value = (pos < 0) ? null : GenericUtils.trimToEmpty(p.substring(pos + 1));<NEW_LINE>value = GenericUtils.stripQuotes(value);<NEW_LINE>// For options without value the value is set to TRUE.<NEW_LINE>if (value == null) {<NEW_LINE>value = Boolean.TRUE.toString();<NEW_LINE>}<NEW_LINE>List<String> opts = optsMap.get(name);<NEW_LINE>if (opts == null) {<NEW_LINE>opts = new ArrayList<String>();<NEW_LINE>optsMap.put(name, opts);<NEW_LINE>}<NEW_LINE>opts.add(value.toString());<NEW_LINE>} while (m.find());<NEW_LINE>loginOptionsMulti = optsMap;<NEW_LINE>}
|
pos = p.indexOf('=');
|
740,854
|
public Object parse(XMLEventReader xmlEventReader) throws ParsingException {<NEW_LINE>// Get the startelement<NEW_LINE>StartElement startElement = StaxParserUtil.getNextStartElement(xmlEventReader);<NEW_LINE>StaxParserUtil.validate(startElement, SAML11Constants.REQUEST);<NEW_LINE>SAML11RequestType request = parseRequiredAttributes(startElement);<NEW_LINE>while (xmlEventReader.hasNext()) {<NEW_LINE>// Let us peek at the next start element<NEW_LINE>startElement = StaxParserUtil.peekNextStartElement(xmlEventReader);<NEW_LINE>if (startElement == null)<NEW_LINE>break;<NEW_LINE>String elementName = StaxParserUtil.getElementName(startElement);<NEW_LINE>if (SAML11Constants.ATTRIBUTE_QUERY.equals(elementName)) {<NEW_LINE>startElement = StaxParserUtil.getNextStartElement(xmlEventReader);<NEW_LINE>SAML11AttributeQueryType query = SAML11ParserUtil.parseSAML11AttributeQuery(xmlEventReader);<NEW_LINE>request.setQuery(query);<NEW_LINE>} else if (SAML11Constants.AUTHENTICATION_QUERY.equals(elementName)) {<NEW_LINE>startElement = StaxParserUtil.getNextStartElement(xmlEventReader);<NEW_LINE>SAML11AuthenticationQueryType query = SAML11ParserUtil.parseSAML11AuthenticationQuery(xmlEventReader);<NEW_LINE>request.setQuery(query);<NEW_LINE>} else if (SAML11Constants.ASSERTION_ARTIFACT.equals(elementName)) {<NEW_LINE>startElement = StaxParserUtil.getNextStartElement(xmlEventReader);<NEW_LINE>request.addAssertionArtifact(StaxParserUtil.getElementText(xmlEventReader));<NEW_LINE>} else if (SAML11Constants.AUTHORIZATION_DECISION_QUERY.equals(elementName)) {<NEW_LINE>startElement = StaxParserUtil.getNextStartElement(xmlEventReader);<NEW_LINE>SAML11AuthorizationDecisionQueryType query = SAML11ParserUtil.parseSAML11AuthorizationDecisionQueryType(xmlEventReader);<NEW_LINE>request.setQuery(query);<NEW_LINE>} else if (elementName.equals(JBossSAMLConstants.SIGNATURE.get())) {<NEW_LINE>request.setSignature(StaxParserUtil.getDOMElement(xmlEventReader));<NEW_LINE>} else if (SAML11Constants.ASSERTION_ID_REF.equals(elementName)) {<NEW_LINE>startElement = StaxParserUtil.getNextStartElement(xmlEventReader);<NEW_LINE>request.addAssertionIDRef<MASK><NEW_LINE>} else<NEW_LINE>throw logger.parserUnknownStartElement(elementName, startElement.getLocation());<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
|
(StaxParserUtil.getElementText(xmlEventReader));
|
213,967
|
public void autoPopupParameterInfo(@Nonnull final Editor editor, @Nullable final Object highlightedMethod) {<NEW_LINE>if (DumbService.isDumb(myProject))<NEW_LINE>return;<NEW_LINE>if (PowerSaveMode.isEnabled())<NEW_LINE>return;<NEW_LINE>ApplicationManager.getApplication().assertIsDispatchThread();<NEW_LINE>final CodeInsightSettings settings = CodeInsightSettings.getInstance();<NEW_LINE>if (settings.AUTO_POPUP_PARAMETER_INFO) {<NEW_LINE>final PsiDocumentManager documentManager = PsiDocumentManager.getInstance(myProject);<NEW_LINE>PsiFile file = documentManager.getPsiFile(editor.getDocument());<NEW_LINE>if (file == null)<NEW_LINE>return;<NEW_LINE>if (!documentManager.isUncommited(editor.getDocument())) {<NEW_LINE>file = documentManager.getPsiFile(InjectedLanguageUtil.getEditorForInjectedLanguageNoCommit(editor, file).getDocument());<NEW_LINE>if (file == null)<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Runnable request = () -> {<NEW_LINE>if (!myProject.isDisposed() && !DumbService.isDumb(myProject) && !editor.isDisposed() && (EditorActivityManager.getInstance().isVisible(editor))) {<NEW_LINE>int lbraceOffset = editor.getCaretModel().getOffset() - 1;<NEW_LINE>try {<NEW_LINE>PsiFile file1 = PsiDocumentManager.getInstance(myProject).getPsiFile(editor.getDocument());<NEW_LINE>if (file1 != null) {<NEW_LINE>ShowParameterInfoHandler.invoke(myProject, editor, file1, lbraceOffset, highlightedMethod, false, true, null, e -> {<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} catch (IndexNotReadyException ignored) {<NEW_LINE>// anything can happen on alarm<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>addRequest(() -> documentManager.performLaterWhenAllCommitted<MASK><NEW_LINE>}<NEW_LINE>}
|
(request), settings.PARAMETER_INFO_DELAY);
|
1,762,827
|
final ListTypeRegistrationsResult executeListTypeRegistrations(ListTypeRegistrationsRequest listTypeRegistrationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTypeRegistrationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTypeRegistrationsRequest> request = null;<NEW_LINE>Response<ListTypeRegistrationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTypeRegistrationsRequestMarshaller().marshall(super.beforeMarshalling(listTypeRegistrationsRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTypeRegistrations");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ListTypeRegistrationsResult> responseHandler = new StaxResponseHandler<ListTypeRegistrationsResult>(new ListTypeRegistrationsResultStaxUnmarshaller());<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>}
|
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
|
395,726
|
public final void writeMember(String key, Object value, @Shared("keyInfo") @Cached KeyInfoNode keyInfo, @Cached ImportValueNode castValueNode, @Cached(value = "createCachedInterop()", uncached = "getUncachedWrite()") WriteElementNode writeNode) throws UnknownIdentifierException, UnsupportedMessageException {<NEW_LINE>JSDynamicObject target = this;<NEW_LINE>if (testIntegrityLevel(true)) {<NEW_LINE>throw UnsupportedMessageException.create();<NEW_LINE>}<NEW_LINE>if (!keyInfo.execute(target, key, KeyInfoNode.WRITABLE)) {<NEW_LINE>throw UnknownIdentifierException.create(key);<NEW_LINE>}<NEW_LINE>TruffleString tStringKey = Strings.fromJavaString(key);<NEW_LINE>Object <MASK><NEW_LINE>if (writeNode == null) {<NEW_LINE>JSObject.set(target, tStringKey, importedValue, true, null);<NEW_LINE>} else {<NEW_LINE>writeNode.executeWithTargetAndIndexAndValue(target, tStringKey, importedValue);<NEW_LINE>}<NEW_LINE>}
|
importedValue = castValueNode.executeWithTarget(value);
|
487,794
|
public void onStart() {<NEW_LINE>super.onStart();<NEW_LINE>binding.setSubmitToken(resetPasswordViewModel.getSubmitToken());<NEW_LINE>resetPasswordViewModel.getProgress().observe(this, this::showProgress);<NEW_LINE>resetPasswordViewModel.getError().observe(this, this::showError);<NEW_LINE>resetPasswordViewModel.getSuccess().<MASK><NEW_LINE>resetPasswordViewModel.getMessage().observe(this, this::showMessage);<NEW_LINE>resetPasswordViewModel.getBaseUrl().observe(this, this::setBaseUrl);<NEW_LINE>resetPasswordViewModel.setBaseUrl();<NEW_LINE>if (token != null)<NEW_LINE>resetPasswordViewModel.setToken(token);<NEW_LINE>binding.btnResetPassword.setOnClickListener(view -> {<NEW_LINE>if (!validator.validate())<NEW_LINE>return;<NEW_LINE>if (!binding.newPassword.getText().toString().equals(binding.confirmPassword.getText().toString())) {<NEW_LINE>showError("Passwords Do not Match");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ViewUtils.hideKeyboard(view);<NEW_LINE>resetPasswordViewModel.submitRequest(resetPasswordViewModel.getSubmitToken());<NEW_LINE>});<NEW_LINE>binding.loginLink.setOnClickListener(view -> getFragmentManager().popBackStack());<NEW_LINE>binding.resendTokenLink.setOnClickListener(view -> resendToken());<NEW_LINE>}
|
observe(this, this::onSuccess);
|
747,666
|
private void assembleAudit(AuditEvent event) {<NEW_LINE>auditBuffer.append(event.queryId).append("\t");<NEW_LINE>auditBuffer.append(longToTimeString(event.timestamp)).append("\t");<NEW_LINE>auditBuffer.append(event.clientIp).append("\t");<NEW_LINE>auditBuffer.append(event.user).append("\t");<NEW_LINE>auditBuffer.append(event.db).append("\t");<NEW_LINE>auditBuffer.append(event.state).append("\t");<NEW_LINE>auditBuffer.append(event.queryTime).append("\t");<NEW_LINE>auditBuffer.append(event.scanBytes).append("\t");<NEW_LINE>auditBuffer.append(event.scanRows).append("\t");<NEW_LINE>auditBuffer.append(event.returnRows).append("\t");<NEW_LINE>auditBuffer.append(event.stmtId).append("\t");<NEW_LINE>auditBuffer.append(event.isQuery ? 1 : 0).append("\t");<NEW_LINE>auditBuffer.append(event.feIp).append("\t");<NEW_LINE>auditBuffer.append(event<MASK><NEW_LINE>auditBuffer.append(event.sqlHash).append("\t");<NEW_LINE>auditBuffer.append(event.peakMemoryBytes).append("\t");<NEW_LINE>// trim the query to avoid too long<NEW_LINE>// use `getBytes().length` to get real byte length<NEW_LINE>String stmt = truncateByBytes(event.stmt).replace("\t", " ");<NEW_LINE>LOG.debug("receive audit event with stmt: {}", stmt);<NEW_LINE>auditBuffer.append(stmt).append("\n");<NEW_LINE>}
|
.cpuTimeMs).append("\t");
|
1,565,580
|
private static void tryAssertion56(RegressionEnvironment env, String stmtText, String outputLimit, AtomicInteger milestone) {<NEW_LINE>sendTimer(env, 0);<NEW_LINE>env.compileDeploy(stmtText).addListener("s0");<NEW_LINE>String[] fields = new String[] { "symbol", "sum(price)" };<NEW_LINE>ResultAssertTestResult expected = new <MASK><NEW_LINE>expected.addResultInsert(1200, 0, new Object[][] { { "IBM", 25d }, { "MSFT", 34d } });<NEW_LINE>expected.addResultInsert(2200, 0, new Object[][] { { "IBM", 58d }, { "YAH", 59d }, { "IBM", 85d } });<NEW_LINE>expected.addResultInsRem(3200, 0, null, null);<NEW_LINE>expected.addResultInsert(4200, 0, new Object[][] { { "YAH", 87d } });<NEW_LINE>expected.addResultInsert(5200, 0, new Object[][] { { "IBM", 109d }, { "YAH", 112d } });<NEW_LINE>expected.addResultInsRem(6200, 0, new Object[][] { { "YAH", 88d } }, new Object[][] { { "IBM", 87d } });<NEW_LINE>expected.addResultRemove(7200, 0, new Object[][] { { "MSFT", 79d }, { "IBM", 54d }, { "YAH", 54d } });<NEW_LINE>ResultAssertExecution execution = new ResultAssertExecution(stmtText, env, expected);<NEW_LINE>execution.execute(false, milestone);<NEW_LINE>}
|
ResultAssertTestResult(CATEGORY, outputLimit, fields);
|
769,703
|
public int debugFlushCommand(CommandContext<S> context) {<NEW_LINE>CommandSource source = commandSourceInterface.apply(context.getSource());<NEW_LINE>// parse arguments<NEW_LINE>Optional<String> worldName = getOptionalArgument(context, "world", String.class);<NEW_LINE>final World world;<NEW_LINE>if (worldName.isPresent()) {<NEW_LINE>world = parseWorld(worldName.get()).orElse(null);<NEW_LINE>if (world == null) {<NEW_LINE>source.sendMessage(Text.of(TextColor.RED, "There is no ", helper.worldHelperHover(), " with this name: ", TextColor.WHITE, worldName.get()));<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>world = source.getWorld().orElse(null);<NEW_LINE>if (world == null) {<NEW_LINE>source.sendMessage(Text.of(TextColor.RED, "Can't detect a location from this command-source, you'll have to define a world!"));<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>new Thread(() -> {<NEW_LINE>source.sendMessage(Text.of(TextColor.GOLD, "Saving world and flushing changes..."));<NEW_LINE>try {<NEW_LINE>if (plugin.flushWorldUpdates(world.getUUID())) {<NEW_LINE>source.sendMessage(Text.of(TextColor.GREEN, "Successfully saved and flushed all changes."));<NEW_LINE>} else {<NEW_LINE>source.sendMessage(Text.of(TextColor.RED, "This operation is not supported by this implementation (" + plugin.getImplementationType() + ")"));<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>source.sendMessage(Text.of<MASK><NEW_LINE>Logger.global.logError("Unexpected exception trying to save the world!", ex);<NEW_LINE>}<NEW_LINE>}).start();<NEW_LINE>return 1;<NEW_LINE>}
|
(TextColor.RED, "There was an unexpected exception trying to save the world. Please check the console for more details..."));
|
799,899
|
private void drawShadow(Canvas canvas, int index, float progressEndAngle, Shader shader) {<NEW_LINE>if (mProgresses[index] > 0) {<NEW_LINE>int layerId = canvas.saveLayer(mRectF.left, mRectF.top, mRectF.right, mRectF.top + mRectF.height() / 2, null, Canvas.ALL_SAVE_FLAG);<NEW_LINE>mPaint.setStyle(Paint.Style.FILL);<NEW_LINE>mPaint.setShader(shader);<NEW_LINE>canvas.drawArc(mRectF, 270 - ARC_ANGLE / <MASK><NEW_LINE>mPaint.setShader(null);<NEW_LINE>mPaint.setXfermode(mClearXfermode);<NEW_LINE>canvas.drawRect((float) (mRectF.centerX() + mRectF.width() / 2 * Math.cos((360 - progressEndAngle) * Math.PI / 180)), mRectF.top, mRectF.right, mRectF.top + mRectF.height() / 2, mPaint);<NEW_LINE>mPaint.setXfermode(null);<NEW_LINE>canvas.restoreToCount(layerId);<NEW_LINE>}<NEW_LINE>}
|
2f, ARC_ANGLE, false, mPaint);
|
1,621,718
|
public void onClick(View v) {<NEW_LINE>Comment comment = new Comment.Builder().setAttachmentImageUrl("https://raw.githubusercontent.com/wiki/sromku/android-simple-facebook/images/publish_feed.png").build();<NEW_LINE>SimpleFacebook.getInstance().publish("977576802258070_977578808924536", comment, new OnPublishListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onException(Throwable throwable) {<NEW_LINE>hideDialog();<NEW_LINE>mResult.<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFail(String reason) {<NEW_LINE>hideDialog();<NEW_LINE>mResult.setText(reason);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onThinking() {<NEW_LINE>showDialog();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onComplete(String response) {<NEW_LINE>hideDialog();<NEW_LINE>mResult.setText(response);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
|
setText(throwable.getMessage());
|
265,025
|
public static void main(String[] args) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidKeySpecException, IllegalBlockSizeException, BadPaddingException {<NEW_LINE>String plainText = "How you doing Mike?";<NEW_LINE>encrypt(plainText, getRandomKey(CIPHER, 128));<NEW_LINE>encrypt(plainText, getRandomKey(CIPHER, 192));<NEW_LINE>encrypt(plainText, getRandomKey(CIPHER, 256));<NEW_LINE>encrypt(plainText, getSecureRandomKey(CIPHER, 128));<NEW_LINE>encrypt(plainText, getSecureRandomKey(CIPHER, 192));<NEW_LINE>encrypt(plainText, getSecureRandomKey(CIPHER, 256));<NEW_LINE>encrypt(plainText, getKeyFromKeyGenerator(CIPHER, 128));<NEW_LINE>encrypt(plainText, getKeyFromKeyGenerator(CIPHER, 192));<NEW_LINE>encrypt(plainText, getKeyFromKeyGenerator(CIPHER, 256));<NEW_LINE>encrypt(plainText, getPasswordBasedKey(CIPHER, 128, new char[] { 'R', 'a', 'n', 'd', 'o', 'm' }));<NEW_LINE>encrypt(plainText, getPasswordBasedKey(CIPHER, 192, new char[] { 'R', 'a', 'n', 'd', 'o', 'm' }));<NEW_LINE>encrypt(plainText, getPasswordBasedKey(CIPHER, 256, new char[] { 'R', 'a', 'n', 'd', 'o', 'm' }));<NEW_LINE>try {<NEW_LINE>encrypt(plainText, getSecureRandomKey(CIPHER, 111));<NEW_LINE>} catch (InvalidKeyException e) {<NEW_LINE>logger.error("Unable to generate key", e);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>encrypt(plainText, getKeyFromKeyGenerator(CIPHER, 111));<NEW_LINE>} catch (InvalidParameterException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
|
logger.error("Unable to generate key", e);
|
1,680,116
|
private void listThreads() {<NEW_LINE>final Set<Thread> threads = Thread<MASK><NEW_LINE>final Map<String, Thread> sorted = Maps.newTreeMap();<NEW_LINE>for (final Thread t : threads) {<NEW_LINE>final ThreadGroup tg = t.getThreadGroup();<NEW_LINE>if (t.isAlive() && (tg == null || !tg.getName().equals("system"))) {<NEW_LINE>sorted.put(t.getName(), t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log.info("= THREADS " + Strings.repeat("=", 70));<NEW_LINE>for (final Thread t : sorted.values()) {<NEW_LINE>final ThreadGroup tg = t.getThreadGroup();<NEW_LINE>log.info("{}: \"{}\" ({}{})", t.getId(), t.getName(), (tg == null ? "" : tg.getName() + " "), (t.isDaemon() ? "daemon" : ""));<NEW_LINE>}<NEW_LINE>log.info(Strings.repeat("=", 80));<NEW_LINE>}
|
.getAllStackTraces().keySet();
|
1,040,508
|
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {<NEW_LINE>isSessionBean = in.readBoolean();<NEW_LINE>isStatelessSessionBean = in.readBoolean();<NEW_LINE>// Use thread context classloader to load home/remote/primarykey classes<NEW_LINE>// See EJB2.0 spec section 18.4.4<NEW_LINE>ClassLoader loader = Thread.currentThread().getContextClassLoader();<NEW_LINE>remoteClass = loader.loadClass(in.readUTF());<NEW_LINE>homeClass = loader.loadClass(in.readUTF());<NEW_LINE>if (!isSessionBean)<NEW_LINE>keyClass = loader.<MASK><NEW_LINE>homeHandle = (HomeHandle) in.readObject();<NEW_LINE>ejbHomeStub = homeHandle.getEJBHome();<NEW_LINE>// narrow the home so that the application doesnt have to do<NEW_LINE>// a narrow after EJBMetaData.getEJBHome().<NEW_LINE>ejbHomeStub = (EJBHome) PortableRemoteObject.narrow(ejbHomeStub, homeClass);<NEW_LINE>}
|
loadClass(in.readUTF());
|
362,686
|
private void selectBestModel(List<AssociatedPair> pairs, DogArray_I32 inliersIdx, int fitModelF, int fitRotation) {<NEW_LINE>// Use whichever inlier set is larger as it's more likely to be correct<NEW_LINE>if (inliersRotationIdx.size > inliersIdx.size) {<NEW_LINE>inliersIdx.setTo(inliersRotationIdx);<NEW_LINE>}<NEW_LINE>// if there are too few matches then it's probably noise<NEW_LINE>final int minimumAllowed = minimumInliers.computeI(pairs.size());<NEW_LINE>if (inliersIdx.size() < minimumAllowed) {<NEW_LINE>if (verbose != null)<NEW_LINE>verbose.printf("REJECTED: Inliers, pairs.size=%d inlier.size=%d < minimum.size=%d\n", pairs.size(), inliersIdx.size(), minimumAllowed);<NEW_LINE>is3D = false;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Use a ratio test to decide of there is enough information to declare this relationship has having 3D<NEW_LINE>// information.<NEW_LINE>is3D = Math.max(1, fitRotation) * ratio3D <= fitModelF;<NEW_LINE>// Prefer a more distinctive F and more points. /200 is cosmetic<NEW_LINE>double ratio = fitModelF / (double) <MASK><NEW_LINE>score = Math.min(maxRatioScore, ratio) * inliersIdx.size / 200.0;<NEW_LINE>if (verbose != null)<NEW_LINE>verbose.printf("score=%7.2f pairs=%d inliers=%d ratio=%6.2f, fitR=%d fitF=%d 3d=%s\n", score, pairs.size(), inliersIdx.size, ratio, fitRotation, fitModelF, is3D);<NEW_LINE>}
|
Math.max(1, fitRotation);
|
866,993
|
public static BeanEmbeddedMeta create(BeanDescriptorMap owner, DeployBeanPropertyAssocOne<?> prop) {<NEW_LINE>// we can get a BeanDescriptor for an Embedded bean<NEW_LINE>// and know that it is NOT recursive, as Embedded beans are<NEW_LINE>// only allow to hold simple scalar types...<NEW_LINE>BeanDescriptor<?> targetDesc = owner.descriptor(prop.getTargetType());<NEW_LINE>if (targetDesc == null) {<NEW_LINE>String msg = "Could not find BeanDescriptor for " + prop.getTargetType() + ". Perhaps the EmbeddedId class is not registered? See https://ebean.io/docs/trouble-shooting#not-registered";<NEW_LINE>throw new BeanNotRegisteredException(msg);<NEW_LINE>}<NEW_LINE>// deployment override information (column names)<NEW_LINE>String columnPrefix = prop.getColumnPrefix();<NEW_LINE>Map<String, Column> propColMap = prop.getDeployEmbedded().getPropertyColumnMap();<NEW_LINE>BeanProperty[] sourceProperties = targetDesc.propertiesNonTransient();<NEW_LINE>BeanProperty[] embeddedProperties = new BeanProperty[sourceProperties.length];<NEW_LINE>for (int i = 0; i < sourceProperties.length; i++) {<NEW_LINE>String propertyName = sourceProperties[i].name();<NEW_LINE>Column column = propColMap.get(propertyName);<NEW_LINE>String dbColumn = dbColumn(columnPrefix, column, sourceProperties[i]);<NEW_LINE>boolean dbNullable = dbNullable(column, sourceProperties[i]);<NEW_LINE>int dbLength = dbLength(column, sourceProperties[i]);<NEW_LINE>int dbScale = dbScale(column, sourceProperties[i]);<NEW_LINE>String colDefn = getDbColumnDefn<MASK><NEW_LINE>BeanPropertyOverride overrides = new BeanPropertyOverride(dbColumn, dbNullable, dbLength, dbScale, colDefn);<NEW_LINE>embeddedProperties[i] = sourceProperties[i].override(overrides);<NEW_LINE>}<NEW_LINE>return new BeanEmbeddedMeta(embeddedProperties);<NEW_LINE>}
|
(column, sourceProperties[i]);
|
978,409
|
private void drawHexagon(Canvas c, float x, float y, Paint fillPaint, Paint strokePaint) {<NEW_LINE>final float MULTIPLIER = 0.6f;<NEW_LINE>final float SIDE_MULTIPLIER = 1.4f;<NEW_LINE>Path path = new Path();<NEW_LINE>// Top-left<NEW_LINE>path.moveTo(x - SAT_RADIUS * MULTIPLIER, y - SAT_RADIUS);<NEW_LINE>// Left<NEW_LINE>path.lineTo(x - SAT_RADIUS * SIDE_MULTIPLIER, y);<NEW_LINE>// Bottom<NEW_LINE>path.lineTo(x - <MASK><NEW_LINE>path.lineTo(x + SAT_RADIUS * MULTIPLIER, y + SAT_RADIUS);<NEW_LINE>// Right<NEW_LINE>path.lineTo(x + SAT_RADIUS * SIDE_MULTIPLIER, y);<NEW_LINE>// Top-right<NEW_LINE>path.lineTo(x + SAT_RADIUS * MULTIPLIER, y - SAT_RADIUS);<NEW_LINE>path.close();<NEW_LINE>c.drawPath(path, fillPaint);<NEW_LINE>c.drawPath(path, strokePaint);<NEW_LINE>}
|
SAT_RADIUS * MULTIPLIER, y + SAT_RADIUS);
|
603,300
|
public static UserIdentity fromDelimitedKey(final SessionLabel sessionLabel, final String key) throws PwmUnrecoverableException {<NEW_LINE>JavaHelper.requireNonEmpty(key);<NEW_LINE>try {<NEW_LINE>return JsonFactory.get().deserialize(key, UserIdentity.class);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>LOGGER.trace(sessionLabel, () -> "unable to deserialize UserIdentity: " + key + " using JSON method: " + e.getMessage());<NEW_LINE>}<NEW_LINE>// old style<NEW_LINE>final StringTokenizer st = new StringTokenizer(key, DELIM_SEPARATOR);<NEW_LINE>DomainID domainID = null;<NEW_LINE>if (st.countTokens() < 2) {<NEW_LINE>final String msg = "not enough tokens while parsing delimited identity key";<NEW_LINE>throw new PwmUnrecoverableException(new ErrorInformation(PwmError.ERROR_INTERNAL, msg));<NEW_LINE>} else if (st.countTokens() > 2) {<NEW_LINE>String domainStr = "";<NEW_LINE>try {<NEW_LINE>domainStr = st.nextToken();<NEW_LINE>domainID = DomainID.create(domainStr);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>final String msg = "error decoding DomainID '" + domainStr <MASK><NEW_LINE>throw new PwmUnrecoverableException(new ErrorInformation(PwmError.ERROR_INTERNAL, msg));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (st.countTokens() > 3) {<NEW_LINE>throw new PwmUnrecoverableException(new ErrorInformation(PwmError.ERROR_INTERNAL, "too many string tokens while parsing delimited identity key"));<NEW_LINE>}<NEW_LINE>final String profileID = st.nextToken();<NEW_LINE>final String userDN = st.nextToken();<NEW_LINE>return create(userDN, profileID, domainID);<NEW_LINE>}
|
+ "' from delimited UserIdentity: " + e.getMessage();
|
99,339
|
private void paintAvailableColumns(PaintTarget target) throws PaintException {<NEW_LINE>if (columnCollapsingAllowed) {<NEW_LINE>final HashSet<Object> collapsedCols = new HashSet<Object>();<NEW_LINE>for (Object colId : visibleColumns) {<NEW_LINE>if (isColumnCollapsed(colId)) {<NEW_LINE>collapsedCols.add(colId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String[] collapsedKeys = new String[collapsedCols.size()];<NEW_LINE>int nextColumn = 0;<NEW_LINE>for (Object colId : visibleColumns) {<NEW_LINE>if (isColumnCollapsed(colId)) {<NEW_LINE>collapsedKeys[nextColumn++] = columnIdMap.key(colId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>target.addVariable(this, "collapsedcolumns", collapsedKeys);<NEW_LINE>final String[] noncollapsibleKeys = new String[noncollapsibleColumns.size()];<NEW_LINE>nextColumn = 0;<NEW_LINE>for (Object colId : noncollapsibleColumns) {<NEW_LINE>noncollapsibleKeys[nextColumn++<MASK><NEW_LINE>}<NEW_LINE>target.addVariable(this, "noncollapsiblecolumns", noncollapsibleKeys);<NEW_LINE>}<NEW_LINE>}
|
] = columnIdMap.key(colId);
|
1,701,078
|
protected boolean matchesSafely(final Iterable<String> inputUrls) {<NEW_LINE>final Set<String> urisToMatch = Sets.newHashSet(this.expectedUris);<NEW_LINE>for (String inputUrl : inputUrls) {<NEW_LINE>final List<String> matchedUrls = urisToMatch.stream().filter(inputUrl::endsWith).<MASK><NEW_LINE>if (matchedUrls.size() == 1) {<NEW_LINE>urisToMatch.remove(matchedUrls.get(0));<NEW_LINE>} else if (matchedUrls.size() == 0) {<NEW_LINE>this.mismatchDescription = "Unexpected input URL: " + inputUrl;<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>this.mismatchDescription = "Duplicate input URL: " + inputUrl;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!urisToMatch.isEmpty()) {<NEW_LINE>this.mismatchDescription = "Unmatched URLs: " + urisToMatch.toString();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>this.mismatchDescription = "Successfully matched";<NEW_LINE>return true;<NEW_LINE>}
|
collect(Collectors.toList());
|
1,465,141
|
public static void markFieldsAsImmutable(BLangClassDefinition classDef, SymbolEnv pkgEnv, BObjectType objectType, Types types, BLangAnonymousModelHelper anonymousModelHelper, SymbolTable symbolTable, Names names, Location pos) {<NEW_LINE>SymbolEnv typeDefEnv = SymbolEnv.createClassEnv(classDef, objectType.tsymbol.scope, pkgEnv);<NEW_LINE>Iterator<BField> objectTypeFieldIterator = objectType.fields.values().iterator();<NEW_LINE>Map<String, BLangSimpleVariable> classFields = new HashMap<>();<NEW_LINE>for (BLangSimpleVariable field : classDef.fields) {<NEW_LINE>classFields.put(field.name.value, field);<NEW_LINE>}<NEW_LINE>for (BLangSimpleVariable field : classDef.referencedFields) {<NEW_LINE>classFields.put(field.name.value, field);<NEW_LINE>}<NEW_LINE>while (objectTypeFieldIterator.hasNext()) {<NEW_LINE>BField typeField = objectTypeFieldIterator.next();<NEW_LINE>BLangSimpleVariable classField = classFields.get(typeField.name.value);<NEW_LINE>BType type = typeField.type;<NEW_LINE>if (!types.isInherentlyImmutableType(type)) {<NEW_LINE>BType immutableFieldType = typeField.symbol.type = ImmutableTypeCloner.getImmutableIntersectionType(pos, types, type, typeDefEnv, symbolTable, anonymousModelHelper, names, classDef.flagSet);<NEW_LINE>classField.<MASK><NEW_LINE>}<NEW_LINE>typeField.symbol.flags |= Flags.FINAL;<NEW_LINE>classField.flagSet.add(Flag.FINAL);<NEW_LINE>}<NEW_LINE>}
|
setBType(typeField.type = immutableFieldType);
|
706,161
|
public OCacheEntry loadPageForWrite(long fileId, final long pageIndex, final boolean checkPinnedPages, final int pageCount, final boolean verifyChecksum) throws IOException {<NEW_LINE>assert pageCount > 0;<NEW_LINE>fileId = checkFileIdCompatibility(fileId, storageId);<NEW_LINE>if (deletedFiles.contains(fileId)) {<NEW_LINE>throw new OStorageException("File with id " + fileId + " is deleted.");<NEW_LINE>}<NEW_LINE>final FileChanges changesContainer = fileChanges.computeIfAbsent(fileId, k -> new FileChanges());<NEW_LINE>if (changesContainer.isNew) {<NEW_LINE>if (pageIndex <= changesContainer.maxNewPageIndex) {<NEW_LINE>return changesContainer.pageChangesMap.get(pageIndex);<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>OCacheEntryChanges pageChangesContainer = changesContainer.pageChangesMap.get(pageIndex);<NEW_LINE>if (checkChangesFilledUpTo(changesContainer, pageIndex)) {<NEW_LINE>if (pageChangesContainer == null) {<NEW_LINE>final OCacheEntry delegate = readCache.loadForRead(fileId, <MASK><NEW_LINE>if (delegate != null) {<NEW_LINE>pageChangesContainer = new OCacheEntryChanges(verifyChecksum);<NEW_LINE>changesContainer.pageChangesMap.put(pageIndex, pageChangesContainer);<NEW_LINE>pageChangesContainer.delegate = delegate;<NEW_LINE>return pageChangesContainer;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (pageChangesContainer.isNew) {<NEW_LINE>return pageChangesContainer;<NEW_LINE>} else {<NEW_LINE>// Need to load the page again from cache for locking reasons<NEW_LINE>pageChangesContainer.delegate = readCache.loadForRead(fileId, pageIndex, checkPinnedPages, writeCache, verifyChecksum);<NEW_LINE>return pageChangesContainer;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
|
pageIndex, checkPinnedPages, writeCache, verifyChecksum);
|
348,384
|
public void marshall(EquipmentDetection equipmentDetection, AwsJsonWriter jsonWriter) throws Exception {<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (equipmentDetection.getBoundingBox() != null) {<NEW_LINE><MASK><NEW_LINE>jsonWriter.name("BoundingBox");<NEW_LINE>BoundingBoxJsonMarshaller.getInstance().marshall(boundingBox, jsonWriter);<NEW_LINE>}<NEW_LINE>if (equipmentDetection.getConfidence() != null) {<NEW_LINE>Float confidence = equipmentDetection.getConfidence();<NEW_LINE>jsonWriter.name("Confidence");<NEW_LINE>jsonWriter.value(confidence);<NEW_LINE>}<NEW_LINE>if (equipmentDetection.getType() != null) {<NEW_LINE>String type = equipmentDetection.getType();<NEW_LINE>jsonWriter.name("Type");<NEW_LINE>jsonWriter.value(type);<NEW_LINE>}<NEW_LINE>if (equipmentDetection.getCoversBodyPart() != null) {<NEW_LINE>CoversBodyPart coversBodyPart = equipmentDetection.getCoversBodyPart();<NEW_LINE>jsonWriter.name("CoversBodyPart");<NEW_LINE>CoversBodyPartJsonMarshaller.getInstance().marshall(coversBodyPart, jsonWriter);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>}
|
BoundingBox boundingBox = equipmentDetection.getBoundingBox();
|
1,520,316
|
public void write(org.apache.thrift.protocol.TProtocol oprot, getActiveTservers_result struct) throws org.apache.thrift.TException {<NEW_LINE>struct.validate();<NEW_LINE>oprot.writeStructBegin(STRUCT_DESC);<NEW_LINE>if (struct.success != null) {<NEW_LINE>oprot.writeFieldBegin(SUCCESS_FIELD_DESC);<NEW_LINE>{<NEW_LINE>oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.success.size()));<NEW_LINE>for (java.lang.String _iter81 : struct.success) {<NEW_LINE>oprot.writeString(_iter81);<NEW_LINE>}<NEW_LINE>oprot.writeListEnd();<NEW_LINE>}<NEW_LINE>oprot.writeFieldEnd();<NEW_LINE>}<NEW_LINE>if (struct.sec != null) {<NEW_LINE>oprot.writeFieldBegin(SEC_FIELD_DESC);<NEW_LINE>struct.sec.write(oprot);<NEW_LINE>oprot.writeFieldEnd();<NEW_LINE>}<NEW_LINE>if (struct.tnase != null) {<NEW_LINE>oprot.writeFieldBegin(TNASE_FIELD_DESC);<NEW_LINE><MASK><NEW_LINE>oprot.writeFieldEnd();<NEW_LINE>}<NEW_LINE>oprot.writeFieldStop();<NEW_LINE>oprot.writeStructEnd();<NEW_LINE>}
|
struct.tnase.write(oprot);
|
1,206,377
|
public DescribeAgentStatusResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeAgentStatusResult describeAgentStatusResult = new DescribeAgentStatusResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeAgentStatusResult;<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("AgentStatus", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeAgentStatusResult.setAgentStatus(AgentStatusJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return describeAgentStatusResult;<NEW_LINE>}
|
String currentParentElement = context.getCurrentParentElement();
|
1,248,986
|
public int calcScanParallelism(double io, SplitInfo splitInfo) {<NEW_LINE>if (lowConcurrencyQuery) {<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>ParamManager paramManager = session.getClientContext().getParamManager();<NEW_LINE>int parallelsim = -1;<NEW_LINE>if (paramManager.getBoolean(ConnectionParams.MPP_PARALLELISM_AUTO_ENABLE)) {<NEW_LINE>int maxParallelism = ExecUtils.getMppMaxParallelism(paramManager, !onlyUseReadInstance);<NEW_LINE>int minParallelism = ExecUtils.getMppMinParallelism(paramManager);<NEW_LINE>parallelsim = (int) (io / paramManager.getInt(ConnectionParams.MPP_QUERY_IO_PER_PARTITION)) + 1;<NEW_LINE>parallelsim = Math.max(Math.min(parallelsim, maxParallelism), minParallelism);<NEW_LINE>} else {<NEW_LINE>parallelsim = paramManager.getInt(ConnectionParams.MPP_PARALLELISM);<NEW_LINE>if (parallelsim == 0) {<NEW_LINE>// Parallel query is disabled but we have a parallel plan... Very strange...<NEW_LINE>parallelsim = 1;<NEW_LINE>} else if (parallelsim < 0) {<NEW_LINE>parallelsim = (int) (io / paramManager.getInt<MASK><NEW_LINE>parallelsim = Math.max(Math.min(parallelsim, ExecUtils.getMppMaxParallelism(paramManager, !onlyUseReadInstance)), ExecUtils.getMppMinParallelism(paramManager));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int dbParallelism = ExecUtils.getPolarDbCores(paramManager, !onlyUseReadInstance);<NEW_LINE>parallelsim = Math.max(Math.min(Math.min(splitInfo.getSplitCount(), dbParallelism * splitInfo.getInsCount()), parallelsim), 1);<NEW_LINE>return parallelsim;<NEW_LINE>}
|
(ConnectionParams.MPP_QUERY_IO_PER_PARTITION)) + 1;
|
501,897
|
void buildIndexCreationInfo() throws Exception {<NEW_LINE>Set<String> varLengthDictionaryColumns = new HashSet<>(_config.getVarLengthDictionaryColumns());<NEW_LINE>for (FieldSpec fieldSpec : _dataSchema.getAllFieldSpecs()) {<NEW_LINE>// Ignore virtual columns<NEW_LINE>if (fieldSpec.isVirtualColumn()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>DataType storedType = fieldSpec.getDataType().getStoredType();<NEW_LINE>ColumnStatistics columnProfile = _segmentStats.getColumnProfileFor(columnName);<NEW_LINE>boolean useVarLengthDictionary = varLengthDictionaryColumns.contains(columnName);<NEW_LINE>Object defaultNullValue = fieldSpec.getDefaultNullValue();<NEW_LINE>if (storedType == DataType.BYTES) {<NEW_LINE>if (!columnProfile.isFixedLength()) {<NEW_LINE>useVarLengthDictionary = true;<NEW_LINE>}<NEW_LINE>defaultNullValue = new ByteArray((byte[]) defaultNullValue);<NEW_LINE>}<NEW_LINE>_indexCreationInfoMap.put(columnName, new ColumnIndexCreationInfo(columnProfile, true, /*createDictionary*/<NEW_LINE>useVarLengthDictionary, false, /*isAutoGenerated*/<NEW_LINE>defaultNullValue));<NEW_LINE>}<NEW_LINE>_segmentIndexCreationInfo.setTotalDocs(_totalDocs);<NEW_LINE>}
|
String columnName = fieldSpec.getName();
|
745,474
|
public void onIEBlockPlacedBy(BlockPlaceContext context, BlockState state) {<NEW_LINE><MASK><NEW_LINE>BlockPos pos = context.getClickedPos();<NEW_LINE>BlockEntity tile = world.getBlockEntity(pos);<NEW_LINE>Player placer = context.getPlayer();<NEW_LINE>Direction side = context.getClickedFace();<NEW_LINE>float hitX = (float) context.getClickLocation().x - pos.getX();<NEW_LINE>float hitY = (float) context.getClickLocation().y - pos.getY();<NEW_LINE>float hitZ = (float) context.getClickLocation().z - pos.getZ();<NEW_LINE>ItemStack stack = context.getItemInHand();<NEW_LINE>if (tile instanceof IDirectionalTile) {<NEW_LINE>Direction f = ((IDirectionalTile) tile).getFacingForPlacement(placer, pos, side, hitX, hitY, hitZ);<NEW_LINE>((IDirectionalTile) tile).setFacing(f);<NEW_LINE>if (tile instanceof IAdvancedDirectionalTile)<NEW_LINE>((IAdvancedDirectionalTile) tile).onDirectionalPlacement(side, hitX, hitY, hitZ, placer);<NEW_LINE>}<NEW_LINE>if (tile instanceof IReadOnPlacement)<NEW_LINE>((IReadOnPlacement) tile).readOnPlacement(placer, stack);<NEW_LINE>if (tile instanceof IHasDummyBlocks)<NEW_LINE>((IHasDummyBlocks) tile).placeDummies(context, state);<NEW_LINE>if (tile instanceof IPlacementInteraction)<NEW_LINE>((IPlacementInteraction) tile).onTilePlaced(world, pos, state, side, hitX, hitY, hitZ, placer, stack);<NEW_LINE>}
|
Level world = context.getLevel();
|
720,107
|
public void execute(AdminCommandContext adminCommandContext) {<NEW_LINE>ActionReport actionReport = adminCommandContext.getActionReport();<NEW_LINE>Node node = nodes.getNode(name);<NEW_LINE>if (node == null) {<NEW_LINE><MASK><NEW_LINE>actionReport.setActionExitCode(ActionReport.ExitCode.FAILURE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (node.isDefaultLocalNode()) {<NEW_LINE>actionReport.setActionExitCode(ActionReport.ExitCode.FAILURE);<NEW_LINE>actionReport.setMessage("Cannot update default node with this command");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!StringUtils.ok(nodehost) && !StringUtils.ok(node.getNodeHost())) {<NEW_LINE>actionReport.setActionExitCode(ActionReport.ExitCode.FAILURE);<NEW_LINE>actionReport.setMessage("A node must have a host");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ParameterMap parameterMap = new ParameterMap();<NEW_LINE>parameterMap.add("DEFAULT", name);<NEW_LINE>if (nodehost != null) {<NEW_LINE>parameterMap.add("nodehost", nodehost);<NEW_LINE>}<NEW_LINE>if (nodedir != null) {<NEW_LINE>parameterMap.add("nodedir", nodedir);<NEW_LINE>}<NEW_LINE>if (installdir != null) {<NEW_LINE>parameterMap.add("installdir", installdir);<NEW_LINE>}<NEW_LINE>if (dockerImage != null) {<NEW_LINE>parameterMap.add("dockerImage", dockerImage);<NEW_LINE>}<NEW_LINE>if (dockerPasswordFile != null) {<NEW_LINE>parameterMap.add("dockerPasswordFile", dockerPasswordFile);<NEW_LINE>}<NEW_LINE>if (dockerPort != null) {<NEW_LINE>parameterMap.add("dockerPort", Integer.toString(dockerPort));<NEW_LINE>}<NEW_LINE>if (useTls != null) {<NEW_LINE>parameterMap.add("useTls", useTls.toString());<NEW_LINE>}<NEW_LINE>if (parameterMap.size() > 1) {<NEW_LINE>CommandRunner.CommandInvocation commandInvocation = commandRunner.getCommandInvocation("_update-node", actionReport, adminCommandContext.getSubject());<NEW_LINE>commandInvocation.parameters(parameterMap);<NEW_LINE>commandInvocation.execute();<NEW_LINE>}<NEW_LINE>}
|
actionReport.setMessage("No node with given name: " + name);
|
876,647
|
public void writeExternal(Element macro) throws WriteExternalException {<NEW_LINE>macro.setAttribute(ATTRIBUTE_NAME, myName);<NEW_LINE>final <MASK><NEW_LINE>for (ActionDescriptor action : actions) {<NEW_LINE>Element actionNode = null;<NEW_LINE>if (action instanceof TypedDescriptor) {<NEW_LINE>actionNode = new Element(ELEMENT_TYPING);<NEW_LINE>TypedDescriptor typedDescriptor = (TypedDescriptor) action;<NEW_LINE>actionNode.setText(typedDescriptor.getText().replaceAll(" ", " "));<NEW_LINE>actionNode.setAttribute(ATTRIBUTE_KEY_CODES, unparseKeyCodes(new Pair<List<Integer>, List<Integer>>(typedDescriptor.getKeyCodes(), typedDescriptor.getKeyModifiers())));<NEW_LINE>} else if (action instanceof IdActionDescriptor) {<NEW_LINE>actionNode = new Element(ELEMENT_ACTION);<NEW_LINE>actionNode.setAttribute(ATTRIBUTE_ID, ((IdActionDescriptor) action).getActionId());<NEW_LINE>} else if (action instanceof ShortcutActionDesciption) {<NEW_LINE>actionNode = new Element(ELEMENT_SHORTCUT);<NEW_LINE>actionNode.setAttribute(ATTRIBUTE_TEXT, ((ShortcutActionDesciption) action).getText());<NEW_LINE>}<NEW_LINE>assert actionNode != null : action;<NEW_LINE>macro.addContent(actionNode);<NEW_LINE>}<NEW_LINE>}
|
ActionDescriptor[] actions = getActions();
|
497,421
|
public void createPartControl(Composite parent) {<NEW_LINE>Server server = ServerManager.getInstance().getServer(serverId);<NEW_LINE>this.setPartName("Connections[" + server.getName() + "][" + date + "]");<NEW_LINE>GridLayout layout = new GridLayout(1, true);<NEW_LINE>layout.marginHeight = 5;<NEW_LINE>layout.marginWidth = 5;<NEW_LINE>parent.setLayout(layout);<NEW_LINE>parent.setBackground(ColorUtil.getInstance().getColor(SWT.COLOR_WHITE));<NEW_LINE>parent.setBackgroundMode(SWT.INHERIT_FORCE);<NEW_LINE>canvas = new FigureCanvas(parent);<NEW_LINE>canvas.setLayoutData(new GridData(GridData.FILL_BOTH));<NEW_LINE>canvas.setScrollBarVisibility(FigureCanvas.NEVER);<NEW_LINE>canvas.addControlListener(new ControlListener() {<NEW_LINE><NEW_LINE>public void controlMoved(ControlEvent arg0) {<NEW_LINE>}<NEW_LINE><NEW_LINE>public void controlResized(ControlEvent arg0) {<NEW_LINE>Rectangle r = canvas.getClientArea();<NEW_LINE>xyGraph.setSize(r.width, r.height);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>xyGraph = new XYGraph();<NEW_LINE>xyGraph.setShowLegend(true);<NEW_LINE>xyGraph.setShowTitle(false);<NEW_LINE>canvas.setContents(xyGraph);<NEW_LINE>xyGraph.primaryXAxis.setDateEnabled(true);<NEW_LINE>xyGraph.primaryXAxis.setShowMajorGrid(true);<NEW_LINE>xyGraph.primaryYAxis.setAutoScale(true);<NEW_LINE>xyGraph.primaryYAxis.setShowMajorGrid(true);<NEW_LINE>xyGraph.primaryXAxis.setFormatPattern("HH:mm:ss");<NEW_LINE>xyGraph.primaryYAxis.setFormatPattern("#,##0");<NEW_LINE>xyGraph.primaryXAxis.setTitle("");<NEW_LINE>xyGraph.primaryYAxis.setTitle("");<NEW_LINE>final CircularBufferDataProvider totalProvider = new CircularBufferDataProvider(true);<NEW_LINE>totalProvider.setBufferSize(BUFFER_SIZE);<NEW_LINE>totalProvider.setCurrentXDataArray(new double[] {});<NEW_LINE>totalProvider.setCurrentYDataArray(new double[] {});<NEW_LINE>totalTrace = new Trace("Total (SUM)", xyGraph.primaryXAxis, xyGraph.primaryYAxis, totalProvider);<NEW_LINE>totalTrace.setPointStyle(PointStyle.NONE);<NEW_LINE>totalTrace.setLineWidth(PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH));<NEW_LINE>totalTrace.setTraceType(TraceType.SOLID_LINE);<NEW_LINE>totalTrace.setTraceColor(ColorUtil.getInstance().getColor(SWT.COLOR_DARK_RED));<NEW_LINE>xyGraph.addTrace(totalTrace);<NEW_LINE>CircularBufferDataProvider activeProvider = new CircularBufferDataProvider(true);<NEW_LINE>activeProvider.setBufferSize(BUFFER_SIZE);<NEW_LINE>activeProvider.setCurrentXDataArray(new double[] {});<NEW_LINE>activeProvider.setCurrentYDataArray<MASK><NEW_LINE>activeTrace = new Trace("Running (SUM)", xyGraph.primaryXAxis, xyGraph.primaryYAxis, activeProvider);<NEW_LINE>activeTrace.setPointStyle(PointStyle.NONE);<NEW_LINE>activeTrace.setLineWidth(PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH));<NEW_LINE>activeTrace.setTraceType(TraceType.SOLID_LINE);<NEW_LINE>activeTrace.setTraceColor(ColorUtil.getInstance().getColor(SWT.COLOR_DARK_GREEN));<NEW_LINE>xyGraph.addTrace(activeTrace);<NEW_LINE>ScouterUtil.addHorizontalRangeListener(xyGraph.getPlotArea(), new OpenDigestTableAction(serverId), true);<NEW_LINE>IToolBarManager man = getViewSite().getActionBars().getToolBarManager();<NEW_LINE>man.add(new OpenDbDailyConnView(serverId, date));<NEW_LINE>man.add(new Action("Zoom out", ImageUtil.getImageDescriptor(Images.zoomout)) {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>long stime = DateUtil.yyyymmdd(date);<NEW_LINE>long etime = stime + DateUtil.MILLIS_PER_DAY - 1;<NEW_LINE>xyGraph.primaryXAxis.setRange(stime, etime);<NEW_LINE>double max = ChartUtil.getMax(totalProvider.iterator());<NEW_LINE>xyGraph.primaryYAxis.setRange(0, max);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>load();<NEW_LINE>}
|
(new double[] {});
|
307,501
|
private // Displays requested register or registers<NEW_LINE>void displayRegistersPostMortem(Program program) {<NEW_LINE>// Display requested register contents<NEW_LINE>for (String reg : registerDisplayList) {<NEW_LINE>if (FloatingPointRegisterFile.getRegister(reg) != null) {<NEW_LINE>// TODO: do something for double vs float<NEW_LINE>// It isn't clear to me what the best behaviour is<NEW_LINE>// floating point register<NEW_LINE>int ivalue = program.getRegisterValue(reg);<NEW_LINE>float fvalue = Float.intBitsToFloat(ivalue);<NEW_LINE>if (verbose) {<NEW_LINE>out.print(reg + "\t");<NEW_LINE>}<NEW_LINE>if (displayFormat == HEXADECIMAL) {<NEW_LINE>// display float (and double, if applicable) in hex<NEW_LINE>out.println(Binary.intToHexString(ivalue));<NEW_LINE>} else if (displayFormat == DECIMAL) {<NEW_LINE>// display float (and double, if applicable) in decimal<NEW_LINE>out.println(fvalue);<NEW_LINE>} else {<NEW_LINE>// displayFormat == ASCII<NEW_LINE>out.println(Binary.intToAscii(ivalue));<NEW_LINE>}<NEW_LINE>} else if (ControlAndStatusRegisterFile.getRegister(reg) != null) {<NEW_LINE>out.print(reg + "\t");<NEW_LINE>out.println(formatIntForDisplay((int) ControlAndStatusRegisterFile.getRegister(reg).getValue()));<NEW_LINE>} else if (verbose) {<NEW_LINE><MASK><NEW_LINE>out.println(formatIntForDisplay((int) RegisterFile.getRegister(reg).getValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
out.print(reg + "\t");
|
1,090,995
|
private static void write(Argument arg) throws Exception {<NEW_LINE>try {<NEW_LINE>Document document = DocumentHelper.createDocument();<NEW_LINE>Element persistence = document.addElement("persistence", "http://java.sun.com/xml/ns/persistence");<NEW_LINE>persistence.addAttribute(QName.get("schemaLocation", "xsi", "http://www.w3.org/2001/XMLSchema-instance"), "http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd");<NEW_LINE>persistence.addAttribute("version", "2.0");<NEW_LINE>for (Class<?> cls : scanContainerEntity(arg.getProject())) {<NEW_LINE>Element unit = persistence.addElement("persistence-unit");<NEW_LINE>unit.addAttribute("name", cls.getCanonicalName());<NEW_LINE>unit.addAttribute("transaction-type", "RESOURCE_LOCAL");<NEW_LINE>Element provider = unit.addElement("provider");<NEW_LINE>provider.addText(PersistenceProviderImpl.class.getCanonicalName());<NEW_LINE>for (Class<?> o : scanMappedSuperclass(cls)) {<NEW_LINE>Element mapped_element = unit.addElement("class");<NEW_LINE>mapped_element.addText(o.getCanonicalName());<NEW_LINE>}<NEW_LINE>Element slice_unit_properties = unit.addElement("properties");<NEW_LINE>Map<String, String> properties = new LinkedHashMap<String, String>();<NEW_LINE>for (Entry<String, String> entry : properties.entrySet()) {<NEW_LINE>Element property = slice_unit_properties.addElement("property");<NEW_LINE>property.addAttribute("name", entry.getKey());<NEW_LINE>property.addAttribute("value", entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>format.setEncoding("UTF-8");<NEW_LINE>File file = new File(arg.getPath());<NEW_LINE>XMLWriter writer = new XMLWriter(new FileWriter(file), format);<NEW_LINE>writer.write(document);<NEW_LINE>writer.close();<NEW_LINE>System.out.println("create persistence.xml at path:" + arg.getPath());<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
|
OutputFormat format = OutputFormat.createPrettyPrint();
|
345,118
|
private void loadNode1262() {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.OperationLimitsType_MaxNodesPerHistoryUpdateData, new QualifiedName(0, "MaxNodesPerHistoryUpdateData"), new LocalizedText("en", "MaxNodesPerHistoryUpdateData"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.UInt32, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType_MaxNodesPerHistoryUpdateData, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType_MaxNodesPerHistoryUpdateData, Identifiers.HasModellingRule, Identifiers.ModellingRule_Optional.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType_MaxNodesPerHistoryUpdateData, Identifiers.HasProperty, Identifiers.OperationLimitsType.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
|
(1), 0.0, false);
|
25,947
|
public void report(String type, String content) {<NEW_LINE>try {<NEW_LINE>Config config = getConfig();<NEW_LINE>if (!config.allowReports)<NEW_LINE>return;<NEW_LINE>URL url = new URL("https://www.google-analytics.com/collect");<NEW_LINE>HttpURLConnection conn = (HttpURLConnection) url.openConnection();<NEW_LINE>conn.setRequestMethod("POST");<NEW_LINE><MASK><NEW_LINE>conn.setDoOutput(true);<NEW_LINE>OutputStream os = conn.getOutputStream();<NEW_LINE>String contentParam = "exception".equals(type) ? "exd" : "cd";<NEW_LINE>String payload = "v=1&t=" + type + "&tid=" + Version.GA_ID + "&cid=" + config.getUUID() + "&an=ipscan&av=" + Version.getVersion() + "&" + contentParam + "=" + URLEncoder.encode(content, "UTF-8") + "&ul=" + config.getLocale() + "&vp=" + config.forGUI().mainWindowSize[0] + "x" + config.forGUI().mainWindowSize[1] + "&cd1=" + URLEncoder.encode(System.getProperty("os.name") + " " + System.getProperty("os.version") + " " + System.getProperty("os.arch"), "UTF-8") + "&cd2=" + URLEncoder.encode("Java " + System.getProperty("java.version"), "UTF-8");<NEW_LINE>os.write(payload.getBytes());<NEW_LINE>os.close();<NEW_LINE>conn.getContent();<NEW_LINE>conn.disconnect();<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.getLogger(getClass().getName()).log(FINE, "Failed to report", e);<NEW_LINE>}<NEW_LINE>}
|
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
|
1,130,637
|
private static void backslashreplace_internal(int start, int end, String object, StringBuilder replacement) {<NEW_LINE>for (Iterator<Integer> iter = new StringSubsequenceIterator(object, start, end, 1); iter.hasNext(); ) {<NEW_LINE><MASK><NEW_LINE>replacement.append('\\');<NEW_LINE>if (c >= 0x00010000) {<NEW_LINE>replacement.append('U');<NEW_LINE>replacement.append(hexdigits[(c >> 28) & 0xf]);<NEW_LINE>replacement.append(hexdigits[(c >> 24) & 0xf]);<NEW_LINE>replacement.append(hexdigits[(c >> 20) & 0xf]);<NEW_LINE>replacement.append(hexdigits[(c >> 16) & 0xf]);<NEW_LINE>replacement.append(hexdigits[(c >> 12) & 0xf]);<NEW_LINE>replacement.append(hexdigits[(c >> 8) & 0xf]);<NEW_LINE>} else if (c >= 0x100) {<NEW_LINE>replacement.append('u');<NEW_LINE>replacement.append(hexdigits[(c >> 12) & 0xf]);<NEW_LINE>replacement.append(hexdigits[(c >> 8) & 0xf]);<NEW_LINE>} else {<NEW_LINE>replacement.append('x');<NEW_LINE>}<NEW_LINE>replacement.append(hexdigits[(c >> 4) & 0xf]);<NEW_LINE>replacement.append(hexdigits[c & 0xf]);<NEW_LINE>}<NEW_LINE>}
|
int c = iter.next();
|
183,511
|
public Request<DetachPolicyRequest> marshall(DetachPolicyRequest detachPolicyRequest) {<NEW_LINE>if (detachPolicyRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(DetachPolicyRequest)");<NEW_LINE>}<NEW_LINE>Request<DetachPolicyRequest> request = new DefaultRequest<DetachPolicyRequest>(detachPolicyRequest, "AWSIot");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/target-policies/{policyName}";<NEW_LINE>uriResourcePath = uriResourcePath.replace("{policyName}", (detachPolicyRequest.getPolicyName() == null) ? "" : StringUtils.fromString(detachPolicyRequest.getPolicyName()));<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (detachPolicyRequest.getTarget() != null) {<NEW_LINE>String target = detachPolicyRequest.getTarget();<NEW_LINE>jsonWriter.name("target");<NEW_LINE>jsonWriter.value(target);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
|
request.addHeader("Content-Type", "application/x-amz-json-1.0");
|
1,428,957
|
private void appendWindowsInformation(FSAttributes attrs, List<String> infoList) {<NEW_LINE>if (attrs.hasWindowsFileAttributes()) {<NEW_LINE>WindowsFileAttributes windowsFileAttributes = attrs.getWindowsFileAttributes();<NEW_LINE>infoList.add("Archive: " + windowsFileAttributes.isArchive());<NEW_LINE>infoList.add("Compressed: " + windowsFileAttributes.isCompressed());<NEW_LINE>infoList.add("Directory: " + windowsFileAttributes.isDirectory());<NEW_LINE>infoList.add(<MASK><NEW_LINE>infoList.add("Hidden: " + windowsFileAttributes.isHidden());<NEW_LINE>infoList.add("Normal: " + windowsFileAttributes.isNormal());<NEW_LINE>infoList.add("Off-line: " + windowsFileAttributes.isOffline());<NEW_LINE>infoList.add("Read-only: " + windowsFileAttributes.isReadOnly());<NEW_LINE>infoList.add("Reparse: " + windowsFileAttributes.isReparsePoint());<NEW_LINE>infoList.add("Sparse: " + windowsFileAttributes.isSparseFile());<NEW_LINE>infoList.add("System: " + windowsFileAttributes.isSystem());<NEW_LINE>infoList.add("Temp: " + windowsFileAttributes.isTemporary());<NEW_LINE>infoList.add("Virtual: " + windowsFileAttributes.isVirtual());<NEW_LINE>}<NEW_LINE>}
|
"Encrypted: " + windowsFileAttributes.isEncrypted());
|
619,089
|
public void firePublisherQueueNow(Map<String, Object> dataMap) {<NEW_LINE>try {<NEW_LINE>Scheduler sched = QuartzUtils.getScheduler();<NEW_LINE>JobDetail job = sched.getJobDetail("PublishQueueJob", "dotcms_jobs");<NEW_LINE>if (job == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>job.<MASK><NEW_LINE>Calendar calendar = Calendar.getInstance();<NEW_LINE>calendar.add(Calendar.SECOND, Config.getIntProperty("PUSH_PUBLISHING_FIRING_DELAY_SEC", 2));<NEW_LINE>// SCHEDULE PUBLISH QUEUE JOB for NOW<NEW_LINE>Trigger trigger = new SimpleTrigger("PublishQueueJob" + System.currentTimeMillis(), calendar.getTime());<NEW_LINE>trigger.setJobName(job.getName());<NEW_LINE>trigger.setJobGroup(job.getGroup());<NEW_LINE>trigger.setJobDataMap(job.getJobDataMap());<NEW_LINE>sched.scheduleJob(trigger);<NEW_LINE>} catch (ObjectAlreadyExistsException e) {<NEW_LINE>// Quartz will throw this error if it is already running<NEW_LINE>Logger.debug(this.getClass(), e.getMessage(), e);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.error(this.getClass(), e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
|
setJobDataMap(new JobDataMap(dataMap));
|
860,905
|
protected void ended(GENASubscription subscription, CancelReason reason, UpnpResponse response) {<NEW_LINE>final Service service = subscription.getService();<NEW_LINE>if (service != null) {<NEW_LINE>final <MASK><NEW_LINE>final Device device = service.getDevice();<NEW_LINE>if (device != null) {<NEW_LINE>final Device deviceRoot = device.getRoot();<NEW_LINE>if (deviceRoot != null) {<NEW_LINE>final DeviceIdentity deviceRootIdentity = deviceRoot.getIdentity();<NEW_LINE>if (deviceRootIdentity != null) {<NEW_LINE>final UDN deviceRootUdn = deviceRootIdentity.getUdn();<NEW_LINE>logger.debug("A GENA subscription '{}' for device '{}' was ended", serviceId.getId(), deviceRootUdn);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ((CancelReason.EXPIRED.equals(reason) || CancelReason.RENEWAL_FAILED.equals(reason)) && upnpService != null) {<NEW_LINE>final ControlPoint cp = upnpService.getControlPoint();<NEW_LINE>if (cp != null) {<NEW_LINE>final UpnpSubscriptionCallback callback = new UpnpSubscriptionCallback(service, subscription.getActualDurationSeconds());<NEW_LINE>cp.execute(callback);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
ServiceId serviceId = service.getServiceId();
|
1,477,498
|
public String describe(ObjectName bean) throws Exception {<NEW_LINE>MBeanInfo mbinfo = mserver.getMBeanInfo(bean);<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append(bean);<NEW_LINE>sb.append('\n');<NEW_LINE>sb.append(mbinfo.getClassName());<NEW_LINE>sb.append('\n');<NEW_LINE>sb.append(" - " + mbinfo.getDescription());<NEW_LINE>sb.append('\n');<NEW_LINE>for (MBeanAttributeInfo ai : mbinfo.getAttributes()) {<NEW_LINE>sb.append(" (A) ");<NEW_LINE>sb.append(ai.getName()).append(" : ").append(toPrintableType(ai.getType())).append("");<NEW_LINE>if (!ai.isReadable()) {<NEW_LINE>sb.append(" - WRITEONLY");<NEW_LINE>} else if (ai.isWritable()) {<NEW_LINE>sb.append(" - WRITEABLE");<NEW_LINE>}<NEW_LINE>sb.append('\n');<NEW_LINE>if (!ai.getName().equals(ai.getDescription())) {<NEW_LINE>sb.append(" - " + ai.getDescription());<NEW_LINE>sb.append('\n');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (MBeanOperationInfo oi : mbinfo.getOperations()) {<NEW_LINE>sb.append(" (O) ");<NEW_LINE>sb.append(oi.getName()).append("(");<NEW_LINE>for (MBeanParameterInfo pi : oi.getSignature()) {<NEW_LINE>String name = pi.getName();<NEW_LINE>String type = toPrintableType(pi.getType());<NEW_LINE>sb.append(type).append(' ').append(name).append(", ");<NEW_LINE>}<NEW_LINE>if (oi.getSignature().length > 0) {<NEW_LINE>sb.setLength(sb.length() - 2);<NEW_LINE>}<NEW_LINE>sb.append(") : ").append(toPrintableType(oi.getReturnType()));<NEW_LINE>sb.append('\n');<NEW_LINE>if (!oi.getName().equals(oi.getDescription())) {<NEW_LINE>sb.append(<MASK><NEW_LINE>sb.append('\n');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
|
" - " + oi.getDescription());
|
688,910
|
protected void serializeFromStream() {<NEW_LINE>super.serializeFromStream();<NEW_LINE>try {<NEW_LINE>className = document.field("className");<NEW_LINE>final List<ODocument> inds = document.field("indexDefinitions");<NEW_LINE>final List<String> indClasses = document.field("indClasses");<NEW_LINE>indexDefinitions.clear();<NEW_LINE>collate = new OCompositeCollate(this);<NEW_LINE>for (int i = 0; i < indClasses.size(); i++) {<NEW_LINE>final Class<?> clazz = Class.forName<MASK><NEW_LINE>final ODocument indDoc = inds.get(i);<NEW_LINE>final OIndexDefinition indexDefinition = (OIndexDefinition) clazz.getDeclaredConstructor().newInstance();<NEW_LINE>indexDefinition.fromStream(indDoc);<NEW_LINE>indexDefinitions.add(indexDefinition);<NEW_LINE>collate.addCollate(indexDefinition.getCollate());<NEW_LINE>if (indexDefinition instanceof OIndexDefinitionMultiValue)<NEW_LINE>multiValueDefinitionIndex = indexDefinitions.size() - 1;<NEW_LINE>}<NEW_LINE>setNullValuesIgnored(!Boolean.FALSE.equals(document.<Boolean>field("nullValuesIgnored")));<NEW_LINE>} catch (final ClassNotFoundException e) {<NEW_LINE>throw OException.wrapException(new OIndexException("Error during composite index deserialization"), e);<NEW_LINE>} catch (final NoSuchMethodException e) {<NEW_LINE>throw OException.wrapException(new OIndexException("Error during composite index deserialization"), e);<NEW_LINE>} catch (final InvocationTargetException e) {<NEW_LINE>throw OException.wrapException(new OIndexException("Error during composite index deserialization"), e);<NEW_LINE>} catch (final InstantiationException e) {<NEW_LINE>throw OException.wrapException(new OIndexException("Error during composite index deserialization"), e);<NEW_LINE>} catch (final IllegalAccessException e) {<NEW_LINE>throw OException.wrapException(new OIndexException("Error during composite index deserialization"), e);<NEW_LINE>}<NEW_LINE>}
|
(indClasses.get(i));
|
399,120
|
public int initSessionAndInputs(String modelPath, boolean isTrainMode) {<NEW_LINE>if (modelPath == null) {<NEW_LINE>logger.severe(Common.addTag("session init failed"));<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>int ret = -1;<NEW_LINE>Optional<LiteSession> optTrainSession = SessionUtil.initSession(modelPath);<NEW_LINE>if (!optTrainSession.isPresent()) {<NEW_LINE>logger.severe(Common.addTag("session init failed"));<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>trainSession = optTrainSession.get();<NEW_LINE>List<MSTensor> inputs = trainSession.getInputs();<NEW_LINE>if (inputs.size() < 1) {<NEW_LINE>logger.severe(Common.addTag("inputs size error"));<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE>MSTensor inputIdTensor = trainSession.getInputsByTensorName("input_ids");<NEW_LINE>if (inputIdTensor == null) {<NEW_LINE>logger.severe(Common.addTag("labelId tensor is null"));<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>batchSize = inputIdTensor.getShape()[0];<NEW_LINE>if (batchSize <= 0) {<NEW_LINE>logger.severe(Common.addTag("batch size should bigger than 0"));<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE>dataSize = inputSize / batchSize;<NEW_LINE>maxSeqLen = dataSize;<NEW_LINE>// tokenId,inputId,maskId has same size<NEW_LINE>inputIdBufffer = ByteBuffer.allocateDirect(inputSize * Integer.BYTES);<NEW_LINE>tokenIdBufffer = ByteBuffer.allocateDirect(inputSize * Integer.BYTES);<NEW_LINE>maskIdBufffer = ByteBuffer.allocateDirect(inputSize * Integer.BYTES);<NEW_LINE>inputIdBufffer.order(ByteOrder.nativeOrder());<NEW_LINE>tokenIdBufffer.order(ByteOrder.nativeOrder());<NEW_LINE>maskIdBufffer.order(ByteOrder.nativeOrder());<NEW_LINE>if (isTrainMode) {<NEW_LINE>labelIdBufffer = ByteBuffer.allocateDirect(batchSize * Integer.BYTES);<NEW_LINE>labelIdBufffer.order(ByteOrder.nativeOrder());<NEW_LINE>}<NEW_LINE>numOfClass = NUM_OF_CLASS;<NEW_LINE>logger.info(Common.addTag("init session and input success"));<NEW_LINE>return 0;<NEW_LINE>}
|
int inputSize = inputIdTensor.elementsNum();
|
1,160,071
|
protected Object nodes(Predicate<RedisClusterNode> predicate, ClusterConnectionProvider.Intent intent, boolean dynamic) {<NEW_LINE>NodeSelectionSupport<RedisCommands<K, V>, ?> selection = null;<NEW_LINE>if (connection instanceof StatefulRedisClusterConnectionImpl) {<NEW_LINE>StatefulRedisClusterConnectionImpl<K, V> impl = (StatefulRedisClusterConnectionImpl<K, V>) connection;<NEW_LINE>if (dynamic) {<NEW_LINE>selection = new DynamicNodeSelection<RedisCommands<K, V>, Object, K, V>(impl.getClusterDistributionChannelWriter(), <MASK><NEW_LINE>} else {<NEW_LINE>selection = new StaticNodeSelection<RedisCommands<K, V>, Object, K, V>(impl.getClusterDistributionChannelWriter(), predicate, intent, StatefulRedisConnection::sync);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (connection instanceof StatefulRedisClusterPubSubConnectionImpl) {<NEW_LINE>StatefulRedisClusterPubSubConnectionImpl<K, V> impl = (StatefulRedisClusterPubSubConnectionImpl<K, V>) connection;<NEW_LINE>selection = new StaticNodeSelection<RedisCommands<K, V>, Object, K, V>(impl.getClusterDistributionChannelWriter(), predicate, intent, StatefulRedisConnection::sync);<NEW_LINE>}<NEW_LINE>NodeSelectionInvocationHandler h = new NodeSelectionInvocationHandler((AbstractNodeSelection<?, ?, ?, ?>) selection, asyncCommandsInterface, timeoutProvider);<NEW_LINE>return Proxy.newProxyInstance(NodeSelectionSupport.class.getClassLoader(), new Class<?>[] { nodeSelectionCommandsInterface, nodeSelectionInterface }, h);<NEW_LINE>}
|
predicate, intent, StatefulRedisConnection::sync);
|
1,842,460
|
private int findPLV(int M_PriceList_ID) {<NEW_LINE>final int p_WindowNo = getWindowNo();<NEW_LINE>Timestamp priceDate = null;<NEW_LINE>// Sales Order Date<NEW_LINE>String dateStr = Env.getContext(Env.getCtx(), p_WindowNo, "DateOrdered");<NEW_LINE>if (dateStr != null && dateStr.length() > 0) {<NEW_LINE>priceDate = Env.getContextAsDate(Env.getCtx(), p_WindowNo, "DateOrdered");<NEW_LINE>} else // Invoice Date<NEW_LINE>{<NEW_LINE>dateStr = Env.getContext(Env.getCtx(), p_WindowNo, "DateInvoiced");<NEW_LINE>if (dateStr != null && dateStr.length() > 0) {<NEW_LINE>priceDate = Env.getContextAsDate(Env.getCtx(), p_WindowNo, "DateInvoiced");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Today<NEW_LINE>if (priceDate == null) {<NEW_LINE>priceDate = new Timestamp(System.currentTimeMillis());<NEW_LINE>}<NEW_LINE>//<NEW_LINE>log.info("M_PriceList_ID=" + M_PriceList_ID + " - " + priceDate);<NEW_LINE>int retValue = 0;<NEW_LINE>String sql = // 1<NEW_LINE>"SELECT plv.M_PriceList_Version_ID, plv.ValidFrom " + "FROM M_PriceList pl, M_PriceList_Version plv " + "WHERE pl.M_PriceList_ID=plv.M_PriceList_ID" + " AND plv.IsActive='Y'" + " AND pl.M_PriceList_ID=? " + "ORDER BY plv.ValidFrom DESC";<NEW_LINE>// find newest one<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, null);<NEW_LINE>pstmt.setInt(1, M_PriceList_ID);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>while (rs.next() && retValue == 0) {<NEW_LINE>Timestamp plDate = rs.getTimestamp(2);<NEW_LINE>if (!priceDate.before(plDate)) {<NEW_LINE>retValue = rs.getInt(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.error(sql, e);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>Env.setContext(Env.getCtx(), p_WindowNo, "M_PriceList_Version_ID", retValue);<NEW_LINE>return retValue;<NEW_LINE>}
|
DB.close(rs, pstmt);
|
1,001,663
|
public ManifestIdentifier identify(Config config) {<NEW_LINE>final String manifestPath = config.manifest();<NEW_LINE>if (manifestPath.equals(Config.NONE)) {<NEW_LINE>return new ManifestIdentifier((String) null, null, null, null, null);<NEW_LINE>}<NEW_LINE>// Try to locate the manifest file as a classpath resource; fallback to using the base dir.<NEW_LINE>final Path manifestFile;<NEW_LINE>final String resourceName = manifestPath.startsWith("/") ? manifestPath : ("/" + manifestPath);<NEW_LINE>final URL resourceUrl = getClass().getResource(resourceName);<NEW_LINE>if (resourceUrl != null && "file".equals(resourceUrl.getProtocol())) {<NEW_LINE>// Construct a path to the manifest file relative to the current working directory.<NEW_LINE>final Path workingDirectory = Paths.get(System.getProperty("user.dir"));<NEW_LINE>final Path absolutePath = Fs.fromUrl(resourceUrl);<NEW_LINE>manifestFile = workingDirectory.relativize(absolutePath);<NEW_LINE>} else {<NEW_LINE>manifestFile = getBaseDir().resolve(manifestPath);<NEW_LINE>}<NEW_LINE>final Path baseDir = manifestFile.getParent();<NEW_LINE>final Path resDir = baseDir.<MASK><NEW_LINE>final Path assetDir = baseDir.resolve(config.assetDir());<NEW_LINE>List<ManifestIdentifier> libraries;<NEW_LINE>if (config.libraries().length == 0) {<NEW_LINE>// If there is no library override, look through subdirectories.<NEW_LINE>try {<NEW_LINE>libraries = findLibraries(resDir);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>libraries = new ArrayList<>();<NEW_LINE>for (String libraryDirName : config.libraries()) {<NEW_LINE>Path libDir = baseDir.resolve(libraryDirName);<NEW_LINE>libraries.add(new ManifestIdentifier(null, libDir.resolve(Config.DEFAULT_MANIFEST_NAME), libDir.resolve(Config.DEFAULT_RES_FOLDER), libDir.resolve(Config.DEFAULT_ASSET_FOLDER), null));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new ManifestIdentifier(config.packageName(), manifestFile, resDir, assetDir, libraries);<NEW_LINE>}
|
resolve(config.resourceDir());
|
592,526
|
public static ListStoresResponse unmarshall(ListStoresResponse listStoresResponse, UnmarshallerContext _ctx) {<NEW_LINE>listStoresResponse.setRequestId(_ctx.stringValue("ListStoresResponse.RequestId"));<NEW_LINE>listStoresResponse.setMessage(_ctx.stringValue("ListStoresResponse.Message"));<NEW_LINE>listStoresResponse.setTotalCount(_ctx.longValue("ListStoresResponse.TotalCount"));<NEW_LINE>listStoresResponse.setErrorCode(_ctx.stringValue("ListStoresResponse.ErrorCode"));<NEW_LINE>listStoresResponse.setErrorMessage(_ctx.stringValue("ListStoresResponse.ErrorMessage"));<NEW_LINE>listStoresResponse.setPageSize(_ctx.integerValue("ListStoresResponse.PageSize"));<NEW_LINE>listStoresResponse.setDynamicMessage(_ctx.stringValue("ListStoresResponse.DynamicMessage"));<NEW_LINE>listStoresResponse.setSuccess(_ctx.booleanValue("ListStoresResponse.Success"));<NEW_LINE>listStoresResponse.setDynamicCode(_ctx.stringValue("ListStoresResponse.DynamicCode"));<NEW_LINE>listStoresResponse.setPageNumber(_ctx.integerValue("ListStoresResponse.PageNumber"));<NEW_LINE>listStoresResponse.setCode(_ctx.stringValue("ListStoresResponse.Code"));<NEW_LINE>List<Store> stores = new ArrayList<Store>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListStoresResponse.Stores.Length"); i++) {<NEW_LINE>Store store = new Store();<NEW_LINE>store.setName(_ctx.stringValue("ListStoresResponse.Stores[" + i + "].Name"));<NEW_LINE>store.setWidth(_ctx.floatValue("ListStoresResponse.Stores[" + i + "].Width"));<NEW_LINE>store.setId(_ctx.longValue("ListStoresResponse.Stores[" + i + "].Id"));<NEW_LINE>store.setExtId(_ctx.stringValue("ListStoresResponse.Stores[" + i + "].ExtId"));<NEW_LINE>store.setHeight(_ctx.floatValue("ListStoresResponse.Stores[" + i + "].Height"));<NEW_LINE>store.setDesc(_ctx.stringValue("ListStoresResponse.Stores[" + i + "].Desc"));<NEW_LINE>store.setStatus(_ctx.stringValue<MASK><NEW_LINE>store.setModifiedTime(_ctx.longValue("ListStoresResponse.Stores[" + i + "].ModifiedTime"));<NEW_LINE>store.setAddress(_ctx.stringValue("ListStoresResponse.Stores[" + i + "].Address"));<NEW_LINE>store.setCreateTime(_ctx.longValue("ListStoresResponse.Stores[" + i + "].CreateTime"));<NEW_LINE>store.setCenter(_ctx.stringValue("ListStoresResponse.Stores[" + i + "].Center"));<NEW_LINE>stores.add(store);<NEW_LINE>}<NEW_LINE>listStoresResponse.setStores(stores);<NEW_LINE>return listStoresResponse;<NEW_LINE>}
|
("ListStoresResponse.Stores[" + i + "].Status"));
|
678,613
|
private static String toHexString(BigInteger value) {<NEW_LINE>int signum = value.signum();<NEW_LINE>// obvious shortcut<NEW_LINE>if (signum == 0) {<NEW_LINE>return "0";<NEW_LINE>}<NEW_LINE>// we want to work in absolute numeric value (negative sign is added afterward)<NEW_LINE>byte[] input = value.abs().toByteArray();<NEW_LINE>FormattingBuffer.StringFormattingBuffer sb = new FormattingBuffer.StringFormattingBuffer(input.length * 2);<NEW_LINE>int b;<NEW_LINE>for (int i = 0; i < input.length; i++) {<NEW_LINE><MASK><NEW_LINE>sb.append(LOOKUP.charAt(b >> 4));<NEW_LINE>sb.append(LOOKUP.charAt(b & 0x0F));<NEW_LINE>}<NEW_LINE>// before returning the char array as string, remove leading zeroes, but not the last one<NEW_LINE>String result = sb.toString().replaceFirst("^0+(?!$)", "");<NEW_LINE>return signum < 0 ? "-" + result : result;<NEW_LINE>}
|
b = input[i] & 0xFF;
|
942,209
|
public boolean createCollector(int type, long timeout) {<NEW_LINE>IntervalCollector <MASK><NEW_LINE>if (collector == null) {<NEW_LINE>switch(type) {<NEW_LINE>case COLLECT_TYPE_WIFI:<NEW_LINE>{<NEW_LINE>collector = new WifiCollector(COLLECT_TYPE_WIFI, this.context, timeout);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case COLLECT_TYPE_GEO:<NEW_LINE>{<NEW_LINE>collector = new GeolocationCollector(COLLECT_TYPE_GEO, this.context, timeout);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case COLLECT_TYPE_CELL:<NEW_LINE>{<NEW_LINE>collector = new CellCollector(COLLECT_TYPE_CELL, this.context, timeout);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (collector != null) {<NEW_LINE>this.addCollector(type, collector);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
|
collector = this.getCollector(type);
|
927,486
|
static final Map<Integer, PSPathogenTaxonScore> computeNormalizedScores(final Map<Integer, PSPathogenTaxonScore> taxIdsToScores, final PSTree tree, boolean notNormalizedByKingdom) {<NEW_LINE>// Get sum of all scores assigned under each superkingdom or the root node<NEW_LINE>final Map<Integer, Double> normalizationSums = new HashMap<>();<NEW_LINE>assignKingdoms(taxIdsToScores, normalizationSums, tree, notNormalizedByKingdom);<NEW_LINE>// Gets normalized selfScores and adds it to all ancestors<NEW_LINE>for (final Map.Entry<Integer, PSPathogenTaxonScore> entry : taxIdsToScores.entrySet()) {<NEW_LINE>final int taxId = entry.getKey();<NEW_LINE>final double selfScore = entry<MASK><NEW_LINE>final int kingdomTaxonId = entry.getValue().getKingdomTaxonId();<NEW_LINE>final double kingdomSum = normalizationSums.get(kingdomTaxonId);<NEW_LINE>final double normalizedScore;<NEW_LINE>if (kingdomSum == 0) {<NEW_LINE>normalizedScore = 0;<NEW_LINE>} else {<NEW_LINE>normalizedScore = 100.0 * selfScore / kingdomSum;<NEW_LINE>}<NEW_LINE>final List<Integer> path = tree.getPathOf(taxId);<NEW_LINE>for (final int pathTaxId : path) {<NEW_LINE>taxIdsToScores.get(pathTaxId).addScoreNormalized(normalizedScore);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return taxIdsToScores;<NEW_LINE>}
|
.getValue().getSelfScore();
|
341,561
|
private void buildCIDToGIDMap(Map<Integer, Integer> cidToGid) throws IOException {<NEW_LINE>ByteArrayOutputStream out = new ByteArrayOutputStream();<NEW_LINE>int cidMax = Collections.<MASK><NEW_LINE>for (int i = 0; i <= cidMax; i++) {<NEW_LINE>int gid;<NEW_LINE>if (cidToGid.containsKey(i)) {<NEW_LINE>gid = cidToGid.get(i);<NEW_LINE>} else {<NEW_LINE>gid = 0;<NEW_LINE>}<NEW_LINE>out.write(new byte[] { (byte) (gid >> 8 & 0xff), (byte) (gid & 0xff) });<NEW_LINE>}<NEW_LINE>InputStream input = new ByteArrayInputStream(out.toByteArray());<NEW_LINE>PDStream stream = new PDStream(document, input, COSName.FLATE_DECODE);<NEW_LINE>cidFont.setItem(COSName.CID_TO_GID_MAP, stream);<NEW_LINE>}
|
max(cidToGid.keySet());
|
435,671
|
public Mono<Layout> createLayout(String pageId, Layout layout) {<NEW_LINE>if (pageId == null) {<NEW_LINE>return Mono.error(new AppsmithException(AppsmithError.INVALID_PARAMETER, FieldName.PAGE_ID));<NEW_LINE>}<NEW_LINE>// fetch the unpublished page<NEW_LINE>Mono<PageDTO> pageMono = newPageService.findPageById(pageId, MANAGE_PAGES, false).switchIfEmpty(Mono.error(new AppsmithException(AppsmithError.INVALID_PARAMETER, FieldName.PAGE_ID)));<NEW_LINE>return pageMono.map(page -> {<NEW_LINE>List<Layout> layoutList = page.getLayouts();<NEW_LINE>if (layoutList == null) {<NEW_LINE>// no layouts exist for this page<NEW_LINE>layoutList = new ArrayList<Layout>();<NEW_LINE>}<NEW_LINE>// Adding an Id to the layout to ensure that a layout can be referred to by its ID as well.<NEW_LINE>layout.setId(new ObjectId().toString());<NEW_LINE>layoutList.add(layout);<NEW_LINE>page.setLayouts(layoutList);<NEW_LINE>return page;<NEW_LINE>}).flatMap(newPageService::saveUnpublishedPage).then<MASK><NEW_LINE>}
|
(Mono.just(layout));
|
1,019,951
|
private CrossGammaParameterSensitivity combineSensitivities(CurrencyParameterSensitivity baseDeltaSingle, CrossGammaParameterSensitivities blockCrossGamma) {<NEW_LINE>double[][] valuesTotal = new double[baseDeltaSingle.getParameterCount()][];<NEW_LINE>List<Pair<MarketDataName<?>, List<? extends ParameterMetadata>>> order = new ArrayList<>();<NEW_LINE>for (int i = 0; i < baseDeltaSingle.getParameterCount(); ++i) {<NEW_LINE>ArrayList<Double> innerList = new ArrayList<>();<NEW_LINE>for (CrossGammaParameterSensitivity gammaSingle : blockCrossGamma.getSensitivities()) {<NEW_LINE>innerList.addAll(gammaSingle.getSensitivity().row(i).toList());<NEW_LINE>if (i == 0) {<NEW_LINE>order.add(gammaSingle.getOrder().get(0));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>valuesTotal[i] = Doubles.toArray(innerList);<NEW_LINE>}<NEW_LINE>return CrossGammaParameterSensitivity.of(baseDeltaSingle.getMarketDataName(), baseDeltaSingle.getParameterMetadata(), order, baseDeltaSingle.getCurrency()<MASK><NEW_LINE>}
|
, DoubleMatrix.ofUnsafe(valuesTotal));
|
28,737
|
public boolean onPrepareOptionsMenu(Menu menu) {<NEW_LINE>MenuItem closeIssue = menu.findItem(R.id.closeIssue);<NEW_LINE>MenuItem lockIssue = menu.findItem(R.id.lockIssue);<NEW_LINE>MenuItem milestone = menu.findItem(R.id.milestone);<NEW_LINE>MenuItem labels = menu.findItem(R.id.labels);<NEW_LINE>MenuItem assignees = menu.findItem(R.id.assignees);<NEW_LINE>MenuItem edit = menu.findItem(R.id.edit);<NEW_LINE>MenuItem editMenu = menu.findItem(R.id.editMenu);<NEW_LINE>MenuItem merge = menu.findItem(R.id.merge);<NEW_LINE>MenuItem reviewers = menu.findItem(R.id.reviewers);<NEW_LINE>MenuItem pinUnpin = menu.findItem(R.id.pinUnpin);<NEW_LINE>boolean isOwner <MASK><NEW_LINE>boolean isLocked = getPresenter().isLocked();<NEW_LINE>boolean isCollaborator = getPresenter().isCollaborator();<NEW_LINE>boolean isRepoOwner = getPresenter().isRepoOwner();<NEW_LINE>boolean isMergable = getPresenter().isMergeable();<NEW_LINE>merge.setVisible(isMergable && (isRepoOwner || isCollaborator));<NEW_LINE>reviewers.setVisible((isRepoOwner || isCollaborator));<NEW_LINE>editMenu.setVisible(isOwner || isCollaborator || isRepoOwner);<NEW_LINE>milestone.setVisible(isCollaborator || isRepoOwner);<NEW_LINE>labels.setVisible(isCollaborator || isRepoOwner);<NEW_LINE>assignees.setVisible(isCollaborator || isRepoOwner);<NEW_LINE>edit.setVisible(isCollaborator || isRepoOwner || isOwner);<NEW_LINE>if (getPresenter().getPullRequest() != null) {<NEW_LINE>boolean isPinned = PinnedPullRequests.isPinned(getPresenter().getPullRequest().getId());<NEW_LINE>pinUnpin.setIcon(isPinned ? ContextCompat.getDrawable(this, R.drawable.ic_pin_filled) : ContextCompat.getDrawable(this, R.drawable.ic_pin));<NEW_LINE>closeIssue.setVisible(isRepoOwner || (isOwner || isCollaborator) && getPresenter().getPullRequest().getState() == IssueState.open);<NEW_LINE>lockIssue.setVisible(isRepoOwner || isCollaborator && getPresenter().getPullRequest().getState() == IssueState.open);<NEW_LINE>closeIssue.setTitle(getPresenter().getPullRequest().getState() == IssueState.closed ? getString(R.string.re_open) : getString(R.string.close));<NEW_LINE>lockIssue.setTitle(isLocked ? getString(R.string.unlock_issue) : getString(R.string.lock_issue));<NEW_LINE>} else {<NEW_LINE>closeIssue.setVisible(false);<NEW_LINE>lockIssue.setVisible(false);<NEW_LINE>}<NEW_LINE>return super.onPrepareOptionsMenu(menu);<NEW_LINE>}
|
= getPresenter().isOwner();
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.