content
stringlengths 40
137k
|
---|
"public void setHome(msg_mission_item msg) {\n this.coordinate = new Coord2D(msg.y, msg.x);\n this.altitude = new Altitude(msg.z);\n myDrone.events.notifyDroneEvent(DroneEventsType.HOME);\n}\n"
|
"public Object execute(Object p1, Object p2, Object p3) {\n parameters.get(0).setValue(p1);\n parameters.get(1).setValue(p2);\n parameters.get(2).setValue(p3);\n return execute();\n}\n"
|
"protected void setUpSecureDexClassLoader() {\n if (!effectiveSecureDexClassLoader)\n return;\n Log.d(TAG_MAIN, \"String_Node_Str\");\n SecureLoaderFactory mSecureLoaderFactory = new SecureLoaderFactory(this);\n SecureDexClassLoader mSecureDexClassLoader;\n String listAPKPaths = Environment.getExternalStorageDirectory().getAbsolutePath() + \"String_Node_Str\" + exampleTestAPKPath;\n Log.i(TAG_MAIN, \"String_Node_Str\");\n mSecureDexClassLoader = mSecureLoaderFactory.createDexClassLoader(listAPKPaths, null, null, ClassLoader.getSystemClassLoader().getParent());\n try {\n Class<?> loadedClass = mSecureDexClassLoader.loadClass(classNameInAPK);\n if (loadedClass != null) {\n Log.w(TAG_MAIN, \"String_Node_Str\");\n } else {\n Log.i(TAG_MAIN, \"String_Node_Str\");\n }\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n Log.w(TAG_MAIN, \"String_Node_Str\");\n }\n mSecureDexClassLoader.wipeOutPrivateAppCachedData(true, true);\n Map<String, String> packageNamesToCertMap = new HashMap<String, String>();\n packageNamesToCertMap.put(\"String_Node_Str\", \"String_Node_Str\");\n packageNamesToCertMap.put(\"String_Node_Str\", \"String_Node_Str\");\n packageNamesToCertMap.put(\"String_Node_Str\", \"String_Node_Str\");\n Log.i(TAG_MAIN, \"String_Node_Str\");\n mSecureDexClassLoader = mSecureLoaderFactory.createDexClassLoader(exampleTestAPKPath, null, packageNamesToCertMap, ClassLoader.getSystemClassLoader().getParent());\n try {\n Class<?> loadedClass = mSecureDexClassLoader.loadClass(classNameInAPK);\n if (loadedClass != null) {\n Log.w(TAG_MAIN, \"String_Node_Str\");\n } else {\n Log.i(TAG_MAIN, \"String_Node_Str\" + \"String_Node_Str\");\n }\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n Log.w(TAG_MAIN, \"String_Node_Str\");\n }\n Log.i(TAG_MAIN, \"String_Node_Str\");\n listAPKPaths = \"String_Node_Str\" + exampleSignedAPKPath;\n mSecureDexClassLoader = mSecureLoaderFactory.createDexClassLoader(listAPKPaths, null, packageNamesToCertMap, ClassLoader.getSystemClassLoader().getParent());\n try {\n Class<?> loadedClass = mSecureDexClassLoader.loadClass(classNameInAPK);\n if (loadedClass != null) {\n Activity NasaDailyActivity = (Activity) loadedClass.newInstance();\n Log.i(TAG_MAIN, \"String_Node_Str\" + NasaDailyActivity.getLocalClassName() + \"String_Node_Str\" + NasaDailyActivity.getPackageResourcePath() + \"String_Node_Str\");\n } else {\n Log.w(TAG_MAIN, \"String_Node_Str\");\n }\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n Log.w(TAG_MAIN, \"String_Node_Str\");\n } catch (InstantiationException e) {\n e.printStackTrace();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n }\n mSecureDexClassLoader.wipeOutPrivateAppCachedData(false, true);\n}\n"
|
"private static void waitUntilZnodeAvailable(int replicaId) throws Exception {\n String znode = util.getZooKeeperWatcher().getZNodePaths().getZNodeForReplica(replicaId);\n int i = 0;\n while (i < 1000) {\n if (ZKUtil.checkExists(util.getZooKeeperWatcher(), znode) == -1) {\n Thread.sleep(100);\n i++;\n } else\n break;\n }\n if (i == 1000)\n throw new IOException(\"String_Node_Str\" + replicaId + \"String_Node_Str\");\n}\n"
|
"public void testInterfaceExtendsLoop2() {\n testClosureTypes(suppressMissingProperty(\"String_Node_Str\") + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\", \"String_Node_Str\");\n}\n"
|
"public void run() {\n parentGLCanvas.requestFocus();\n}\n"
|
"public List<List<DocumentElement>> getBody(Diagram d, List<Element> rowElements, List<String> columnIds, DiagramTableTool dtt, boolean forViewEditor) {\n List<List<DocumentElement>> res = new ArrayList<List<DocumentElement>>();\n for (Element e : rowElements) {\n if (skipIfNoDoc && ModelHelper.getComment(e).trim().equals(\"String_Node_Str\"))\n continue;\n List<DocumentElement> row = new ArrayList<DocumentElement>();\n int count = 0;\n for (String cid : columnIds) {\n if (count == 0) {\n count++;\n continue;\n }\n row.add(Common.getTableEntryFromList(getTableValues(dtt.getCellValue(d, e, cid)), false, forViewEditor));\n }\n res.add(row);\n }\n return res;\n}\n"
|
"protected Response findAttribute(String persistenceUnit, String type, String key, String attribute, HttpHeaders hh, UriInfo ui, URI baseURI) {\n PersistenceContext app = getPersistenceFactory().get(persistenceUnit, baseURI, null);\n if (app == null || app.getClass(type) == null) {\n if (app == null) {\n JPARSLogger.fine(\"String_Node_Str\", new Object[] { persistenceUnit });\n } else {\n JPARSLogger.fine(\"String_Node_Str\", new Object[] { type, persistenceUnit });\n }\n return Response.status(Status.NOT_FOUND).build();\n }\n Map<String, String> discriminators = getParameterMap(ui, persistenceUnit);\n Object id = IdHelper.buildId(app, type, key);\n Object entity = app.findAttribute(discriminators, type, id, getHintMap(ui), attribute);\n if (entity == null) {\n JPARSLogger.fine(\"String_Node_Str\", new Object[] { type, key, attribute, persistenceUnit });\n return Response.status(Status.NOT_FOUND).build();\n } else {\n return Response.ok(new StreamingOutputMarshaller(app, entity, hh.getAcceptableMediaTypes())).build();\n }\n}\n"
|
"public void run() {\n logger.debug(\"String_Node_Str\");\n Calendar expired = Calendar.getInstance();\n expired.add(Calendar.MINUTE, -3);\n List<User> usersToCheck = new ArrayList<>();\n usersToCheck.addAll(users.values());\n for (User user : usersToCheck) {\n if (user.isExpired(expired.getTime())) {\n logger.info(new StringBuilder(user.getName()).append(\"String_Node_Str\").append(user.getId()).append(\"String_Node_Str\").append(user.getHost()));\n removeUser(user.getId(), DisconnectReason.SessionExpired);\n }\n }\n logger.debug(\"String_Node_Str\");\n}\n"
|
"public void onNext(GenericOverall genericOverall) {\n inCall = true;\n if (!hasChatSupport) {\n ApplicationWideCurrentRoomHolder.getInstance().setCurrentRoomId(roomId);\n ApplicationWideCurrentRoomHolder.getInstance().setInCall(true);\n ApplicationWideCurrentRoomHolder.getInstance().setUserInRoom(userEntity);\n ncApi.pingCall(credentials, ApiUtils.getUrlForCallPing(baseUrl, roomToken)).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread()).repeatWhen(observable -> observable.delay(5000, TimeUnit.MILLISECONDS)).takeWhile(observable -> inCall).retry(3, observable -> inCall).subscribe(new Observer<GenericOverall>() {\n public void onSubscribe(Disposable d) {\n pingDisposable = d;\n }\n public void onNext(GenericOverall genericOverall) {\n }\n public void onError(Throwable e) {\n dispose(pingDisposable);\n }\n public void onComplete() {\n dispose(pingDisposable);\n }\n });\n String urlToken = null;\n if (isMultiSession) {\n urlToken = roomToken;\n }\n ncApi.pullSignalingMessages(credentials, ApiUtils.getUrlForSignaling(baseUrl, urlToken)).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread()).repeatWhen(observable -> observable).takeWhile(observable -> inCall).retry(3, observable -> inCall).subscribe(new Observer<SignalingOverall>() {\n public void onSubscribe(Disposable d) {\n signalingDisposable = d;\n }\n public void onNext(SignalingOverall signalingOverall) {\n if (signalingOverall.getOcs().getSignalings() != null) {\n for (int i = 0; i < signalingOverall.getOcs().getSignalings().size(); i++) {\n try {\n receivedSignalingMessage(signalingOverall.getOcs().getSignalings().get(i));\n } catch (IOException e) {\n Log.e(TAG, \"String_Node_Str\" + \"String_Node_Str\");\n }\n }\n }\n }\n public void onError(Throwable e) {\n dispose(signalingDisposable);\n }\n public void onComplete() {\n dispose(signalingDisposable);\n }\n });\n}\n"
|
"private void addParameterDefns() throws DataException {\n if (this.parameterHints == null)\n return;\n Iterator it = this.parameterHints.iterator();\n while (it.hasNext()) {\n ParameterHint parameterHint = (ParameterHint) it.next();\n odaStatement.addParameterHint(parameterHint);\n if (parameterHint.isInputMode()) {\n Class paramHintDataType = parameterHint.getDataType();\n if (paramHintDataType == Date.class)\n paramHintDataType = parameterHint.getEffectiveDataType(dataSource.getDriverName(), queryType);\n Object inputValue = parameterHint.getDefaultInputValue();\n if (paramHintDataType != IBlob.class && paramHintDataType != IClob.class)\n inputValue = convertToValue(parameterHint.getDefaultInputValue(), paramHintDataType);\n if (supportNamedParameter(parameterHint.getName()))\n this.setInputParamValue(parameterHint.getName(), inputValue);\n }\n }\n this.setInputParameterBinding();\n}\n"
|
"public void run() {\n while (!shutdown) {\n Serializable s;\n try {\n s = queue.take();\n if (s != null && s instanceof String && SHUTDOWN.equals(s.toString())) {\n shutdown = true;\n continue;\n }\n } catch (final InterruptedException ex) {\n continue;\n }\n final Log4jLogEvent event = Log4jLogEvent.deserialize(s);\n event.setEndOfBatch(queue.isEmpty());\n boolean success = callAppenders(event);\n if (!success && errorAppender != null) {\n try {\n errorAppender.callAppender(event);\n } catch (final Exception ex) {\n }\n }\n }\n while (!queue.isEmpty()) {\n try {\n final Serializable s = queue.take();\n if (s instanceof Log4jLogEvent) {\n final Log4jLogEvent event = Log4jLogEvent.deserialize(s);\n event.setEndOfBatch(queue.isEmpty());\n for (final AppenderControl control : appenders) {\n control.callAppender(event);\n }\n }\n } catch (final InterruptedException ex) {\n }\n }\n}\n"
|
"private ItemStack getRandomWeapon() {\n EnemyInfo enemyInfo = (EnemyInfo) this.getCapability(CapabilityEnemyInfo.ENEMY_INFO, null);\n if (enemyInfo != null) {\n LootContext context = new LootContext.Builder(this.getServer().getWorld(this.dimension)).withLootedEntity(this).build();\n ItemStack stack = null;\n if (enemyInfo.getEnemyTier() == 1) {\n CustomLootTable commonTable = (CustomLootTable) this.world.getLootTableManager().getLootTableFromLocation(new ResourceLocation(Reference.MODID, \"String_Node_Str\"));\n List<ItemStack> items = commonTable.generateLootForPools(this.rand, context);\n stack = items.get(0);\n } else if (enemyInfo.getEnemyTier() == 2) {\n CustomLootTable uncommonTable = (CustomLootTable) this.world.getLootTableManager().getLootTableFromLocation(new ResourceLocation(Reference.MODID, \"String_Node_Str\"));\n List<ItemStack> items = uncommonTable.generateLootForPools(this.rand, context);\n stack = items.get(0);\n } else if (enemyInfo.getEnemyTier() == 3) {\n CustomLootTable rareTable = (CustomLootTable) this.world.getLootTableManager().getLootTableFromLocation(new ResourceLocation(Reference.MODID, \"String_Node_Str\"));\n List<ItemStack> items = rareTable.generateLootForPools(this.rand, context);\n stack = items.get(0);\n } else if (enemyInfo.getEnemyTier() == 4) {\n CustomLootTable epicTable = (CustomLootTable) this.world.getLootTableManager().getLootTableFromLocation(new ResourceLocation(Reference.MODID, \"String_Node_Str\"));\n List<ItemStack> items = epicTable.generateLootForPools(this.rand, context);\n stack = items.get(0);\n } else if (enemyInfo.getEnemyTier() == 5) {\n CustomLootTable legendaryTable = (CustomLootTable) this.world.getLootTableManager().getLootTableFromLocation(new ResourceLocation(Reference.MODID, \"String_Node_Str\"));\n List<ItemStack> items = legendaryTable.generateLootForPools(this.rand, context);\n stack = items.get(0);\n }\n if (stack != null) {\n NBTTagCompound nbt = NBTHelper.loadStackNBT(stack);\n ItemGenerator.create(stack, nbt, world, nbt.getInteger(\"String_Node_Str\"));\n stack.setTagCompound(nbt);\n NameGenerator.generateName(stack, nbt);\n return stack;\n }\n }\n LootSlashConquer.LOGGER.info(\"String_Node_Str\");\n return null;\n}\n"
|
"private void loadDriverExtensions() {\n if (driverExtensions != null)\n return;\n driverExtensions = new HashMap();\n IExtensionRegistry extReg = Platform.getExtensionRegistry();\n IExtensionPoint extPoint = extReg.getExtensionPoint(OdaJdbcDriver.Constants.DRIVER_INFO_EXTENSION);\n IExtension[] exts = extPoint.getExtensions();\n if (exts == null)\n return;\n for (int e = 0; e < exts.length; e++) {\n IConfigurationElement[] configElems = exts[e].getConfigurationElements();\n if (configElems == null)\n continue;\n for (int i = 0; i < configElems.length; i++) {\n if (configElems[i].getName().equals(OdaJdbcDriver.Constants.DRIVER_INFO_ELEM_JDBCDRIVER)) {\n String driverClass = configElems[i].getAttribute(OdaJdbcDriver.Constants.DRIVER_INFO_ATTR_DRIVERCLASS);\n String connectionFactory = configElems[i].getAttribute(OdaJdbcDriver.Constants.DRIVER_INFO_ATTR_CONNFACTORY);\n logger.info(\"String_Node_Str\" + driverClass + \"String_Node_Str\" + connectionFactory);\n if (driverClass != null && driverClass.length() > 0 && connectionFactory != null && connectionFactory.length() > 0) {\n driverExtensions.put(driverClass, configElems[i]);\n }\n }\n }\n }\n}\n"
|
"public final Item detach(Bag container) {\n if (quantity <= 0) {\n return null;\n } else if (quantity == 1) {\n if (stackable || this instanceof Boomerang) {\n Dungeon.quickslot.convertToPlaceholder(this);\n }\n return detachAll(container);\n } else {\n quantity--;\n updateQuickslot();\n try {\n Item detached = getClass().newInstance();\n Bundle copy = new Bundle();\n this.storeInBundle(copy);\n detached.restoreFromBundle(copy);\n detached.quantity(1);\n detached.onDetach();\n return detached;\n } catch (Exception e) {\n return null;\n }\n }\n}\n"
|
"public void removeControlCausedMessageByObject() {\n IMessageManager messageManager = getMessageManager();\n if (messageManager != null && isFormReady()) {\n if (Widgets.isAccessible(getErrorMessageControl())) {\n messageManager.removeMessage(this, getErrorMessageControl());\n }\n }\n}\n"
|
"private static String _readInput() throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in, java.nio.charset.Charset.defaultCharset()));\n String userInput = null;\n try {\n userInput = br.readLine();\n } finally {\n br.close();\n }\n return userInput;\n}\n"
|
"public HearthTreeNode useHeroAbility_core(int targetPlayerIndex, Minion targetMinion, HearthTreeNode boardState, Deck deckPlayer0, Deck deckPlayer1, boolean singleRealizationOnly) throws HSException {\n if (targetPlayerIndex != 0 || !(targetMinion instanceof Hero))\n return null;\n if (singleRealizationOnly) {\n HearthTreeNode toRet = boardState;\n Minion minionToSummon = null;\n Minion[] allTotems = { new SearingTotem(), new StoneclawTotem(), new HealingTotem(), new WrathOfAirTotem() };\n for (int i = allTotems.length - 1; i > 0; --i) {\n int j = (int) (Math.random() * (i + 1));\n Minion ci = allTotems[i];\n allTotems[i] = allTotems[j];\n allTotems[j] = ci;\n }\n for (int index = 0; index < 4; ++index) {\n boolean totemAlreadySummoned = false;\n for (Minion minion : toRet.data_.getMinions(targetPlayerIndex)) {\n if (minion.getClass().equals(allTotems[index].getClass())) {\n totemAlreadySummoned = true;\n }\n }\n if (minionToSummon == null)\n return null;\n this.hasBeenUsed_ = true;\n toRet.data_.setMana_p0(toRet.data_.getMana_p0() - HERO_ABILITY_COST);\n Minion summonTarget = toRet.data_.getCharacter(targetPlayerIndex, numMinions);\n toRet = minionToSummon.summonMinion(targetPlayerIndex, summonTarget, toRet, deckPlayer0, deckPlayer1, false);\n return toRet;\n } else {\n return null;\n }\n }\n HearthTreeNode toRet = new RandomEffectNode(boardState, new HearthAction(HearthAction.Verb.HERO_ABILITY, 0, 0, targetPlayerIndex, 0));\n if (toRet != null) {\n this.hasBeenUsed_ = true;\n int numMinions = toRet.data_.getNumMinions(targetPlayerIndex);\n if (numMinions < 7) {\n Minion[] minions = { new SearingTotem(), new StoneclawTotem(), new HealingTotem(), new WrathOfAirTotem() };\n for (Minion minionToSummon : minions) {\n boolean totemAlreadySummoned = false;\n for (Minion minion : toRet.data_.getMinions(targetPlayerIndex)) {\n if (minion.getClass().equals(minionToSummon.getClass())) {\n totemAlreadySummoned = true;\n }\n }\n if (!totemAlreadySummoned) {\n HearthTreeNode newState = toRet.addChild(new HearthTreeNode((BoardState) toRet.data_.deepCopy()));\n Minion summonTarget = newState.data_.getCharacter(targetPlayerIndex, numMinions);\n newState.data_.setMana_p0(newState.data_.getMana_p0() - HERO_ABILITY_COST);\n newState = minionToSummon.summonMinion(targetPlayerIndex, summonTarget, newState, deckPlayer0, deckPlayer1, false);\n }\n }\n }\n }\n return toRet;\n}\n"
|
"protected void drawCenterText(Canvas c) {\n String centerText = mChart.getCenterText();\n if (mChart.isDrawCenterTextEnabled() && centerText != null) {\n PointF center = mChart.getCenterCircleBox();\n if (mChart.isCenterTextWordWrapEnabled()) {\n float innerRadius = mChart.isDrawHoleEnabled() && mChart.isHoleTransparent() ? mChart.getRadius() * (mChart.getHoleRadius() / 100f) : mChart.getRadius();\n RectF holeRect = mRectBuffer[0];\n holeRect.left = center.x - innerRadius;\n holeRect.top = center.y - innerRadius;\n holeRect.right = center.x + innerRadius;\n holeRect.bottom = center.y + innerRadius;\n RectF boundingRect = mRectBuffer[1];\n boundingRect.set(holeRect);\n float radiusPercent = mChart.getCenterTextRadiusPercent();\n if (radiusPercent > 0.0) {\n boundingRect.inset((boundingRect.width() - boundingRect.width() * radiusPercent) / 2.f, (boundingRect.height() - boundingRect.height() * radiusPercent) / 2.f);\n }\n if (!centerText.equals(mCenterTextLastValue) || !boundingRect.equals(mCenterTextLastBounds)) {\n mCenterTextLastBounds.set(boundingRect);\n mCenterTextLastValue = centerText;\n mCenterTextLayout = new StaticLayout(centerText, 0, centerText.length(), mCenterTextPaint, (int) Math.max(Math.ceil(mCenterTextLastBounds.width()), 1.f), Layout.Alignment.ALIGN_NORMAL, 1.f, 0.f, false);\n }\n float layoutHeight = mCenterTextLayout.getHeight();\n c.save();\n c.translate(boundingRect.centerX(), boundingRect.top + (boundingRect.height() - layoutHeight) / 2.f);\n mCenterTextLayout.draw(c);\n c.restore();\n } else {\n String[] lines = centerText.split(\"String_Node_Str\");\n float maxlineheight = 0f;\n for (String line : lines) {\n float curHeight = Utils.calcTextHeight(mCenterTextPaint, line);\n if (curHeight > maxlineheight)\n maxlineheight = curHeight;\n }\n float linespacing = maxlineheight * 0.25f;\n float totalheight = maxlineheight * lines.length - linespacing * (lines.length - 1);\n int cnt = lines.length;\n float y = center.y;\n for (int i = 0; i < lines.length; i++) {\n String line = lines[lines.length - i - 1];\n c.drawText(line, center.x, y + maxlineheight * cnt - totalheight / 2f, mCenterTextPaint);\n cnt--;\n y -= linespacing;\n }\n }\n }\n}\n"
|
"public P6Signature3 call() throws XfsException {\n P6Signature3 result;\n XfsInfoCommand<CimInfoCommand> command = new XfsInfoCommand<CimInfoCommand>(cimService, CimInfoCommand.GET_P6_SIGNATURE, getP6Signature);\n WFSResult wfsResult = null;\n try {\n wfsResult = command.call();\n result = CimFactory.create(cimService.getXfsVersion(), wfsResult.getResults(), P6Signature3.class);\n if (LOG.isInfoEnabled()) {\n LOG.info(\"String_Node_Str\", result);\n }\n } finally {\n if (wfsResult != null) {\n XfsServiceManager.getInstance().free(wfsResult);\n }\n }\n return result;\n}\n"
|
"public void onClick(DialogInterface dialog, int which) {\n ((VpnSettings) getActivity()).doAuthDialogCallback(saveUsername.isChecked(), usernameView.getText().toString(), passwordView.getText().toString());\n}\n"
|
"public void performIterationUpdates() {\n previousPoint = currentPoint.copy();\n if (subProblemSelectionMethod == SubProblemSelectionMethod.ALL) {\n primalToleranceAdder = new DoubleAdder();\n dualToleranceAdder = new DoubleAdder();\n }\n int[] selectedSubProblemIndexes = subProblemSelectionMethod.selectSubProblems(this);\n Arrays.sort(selectedSubProblemIndexes);\n Set<Integer> affectedConsensusVariables = new HashSet<>();\n List<Callable<Object>> subProblemTasks = new ArrayList<>();\n List<Callable<Object>> residualComputationTasks = new ArrayList<>();\n int temporaryIndex = 0;\n for (int subProblemIndex = 0; subProblemIndex < objective.getNumberOfTerms(); subProblemIndex++) {\n final boolean solveSubProblem = (temporaryIndex < selectedSubProblemIndexes.length && selectedSubProblemIndexes[temporaryIndex] == subProblemIndex) || currentIteration == 1;\n if (solveSubProblem || penaltyParameterSettingMethod == PenaltyParameterSettingMethod.ADAPTIVE || checkForPrimalAndDualResidualConvergence || subProblemSelectionMethod == SubProblemSelectionMethod.CONSENSUS_FOCUSED_SAMPLING) {\n int[] variableIndexes = objective.getTermVariables(subProblemIndex);\n final int currentSubProblemIndex = subProblemIndex;\n Vector variables = variableCopies.get(subProblemIndex);\n Vector multipliers = lagrangeMultipliers.get(subProblemIndex);\n Vector consensusVariables = Vectors.build(variableIndexes.length, currentPoint.type());\n consensusVariables.set(currentPoint.get(variableIndexes));\n if (currentIteration > 1 && subProblemSelectionMethod != SubProblemSelectionMethod.ALL)\n for (int variableIndex : variableIndexes) affectedConsensusVariables.add(variableIndex);\n if (solveSubProblem) {\n subProblemTasks.add(Executors.callable(() -> processSubProblem(currentSubProblemIndex, variableIndexes, variables, consensusVariables, multipliers, variableCopiesSum)));\n temporaryIndex++;\n }\n if (penaltyParameterSettingMethod == PenaltyParameterSettingMethod.ADAPTIVE || checkForPrimalAndDualResidualConvergence || subProblemSelectionMethod == SubProblemSelectionMethod.CONSENSUS_FOCUSED_SAMPLING) {\n if (subProblemSelectionMethod != SubProblemSelectionMethod.ALL) {\n primalToleranceAdder.add(-variables.norm(VectorNorm.L2_SQUARED));\n dualToleranceAdder.add(-multipliers.norm(VectorNorm.L2_SQUARED));\n }\n residualComputationTasks.add(Executors.callable(() -> computeResiduals(currentSubProblemIndex, variables, consensusVariables, multipliers, solveSubProblem)));\n }\n }\n }\n for (int constraintIndex = 0; constraintIndex < constraints.size(); constraintIndex++) {\n int[] variableIndexes = constraintsVariablesIndexes.get(constraintIndex);\n final int currentConstraintIndex = constraintIndex;\n int subProblemIndex = objective.getNumberOfTerms() + constraintIndex;\n Vector variables = variableCopies.get(subProblemIndex);\n Vector multipliers = lagrangeMultipliers.get(subProblemIndex);\n Vector consensusVariables = Vectors.build(variableIndexes.length, currentPoint.type());\n consensusVariables.set(currentPoint.get(variableIndexes));\n subProblemTasks.add(Executors.callable(() -> processConstraint(currentConstraintIndex, variableIndexes, variables, consensusVariables, multipliers, variableCopiesSum)));\n if (penaltyParameterSettingMethod == PenaltyParameterSettingMethod.ADAPTIVE || checkForPrimalAndDualResidualConvergence || subProblemSelectionMethod == SubProblemSelectionMethod.CONSENSUS_FOCUSED_SAMPLING) {\n if (subProblemSelectionMethod != SubProblemSelectionMethod.ALL) {\n primalToleranceAdder.add(-variables.norm(VectorNorm.L2_SQUARED));\n dualToleranceAdder.add(-multipliers.norm(VectorNorm.L2_SQUARED));\n }\n residualComputationTasks.add(Executors.callable(() -> computeResiduals(subProblemIndex, variables, consensusVariables, multipliers, true)));\n }\n }\n try {\n taskExecutor.invokeAll(subProblemTasks);\n } catch (InterruptedException e) {\n logger.error(\"String_Node_Str\");\n }\n if (currentIteration > 1 && subProblemSelectionMethod != SubProblemSelectionMethod.ALL) {\n int[] affectedConsensusVariablesIndexes = ArrayUtils.toPrimitive(affectedConsensusVariables.toArray(new Integer[affectedConsensusVariables.size()]));\n currentPoint.set(affectedConsensusVariablesIndexes, variableCopiesSum.get(affectedConsensusVariablesIndexes).divElementwise(variableCopiesCounts.get(affectedConsensusVariablesIndexes)).maxElementwiseInPlace(0).minElementwiseInPlace(1));\n } else {\n currentPoint = variableCopiesSum.divElementwise(variableCopiesCounts).maxElementwiseInPlace(0).minElementwiseInPlace(1);\n }\n if (penaltyParameterSettingMethod == PenaltyParameterSettingMethod.ADAPTIVE || subProblemSelectionMethod == SubProblemSelectionMethod.CONSENSUS_FOCUSED_SAMPLING || checkForPrimalAndDualResidualConvergence) {\n try {\n taskExecutor.invokeAll(residualComputationTasks);\n } catch (InterruptedException e) {\n logger.error(\"String_Node_Str\");\n }\n if (penaltyParameterSettingMethod == PenaltyParameterSettingMethod.ADAPTIVE || checkForPrimalAndDualResidualConvergence) {\n primalResidual = Math.sqrt(primalResidualSquaredTerms.sum());\n dualResidual = penaltyParameter * Math.sqrt(currentPoint.sub(previousPoint).map(x -> x * x).multElementwise(variableCopiesCounts).sum());\n }\n }\n penaltyParameterSettingMethod.updatePenaltyParameter(this);\n if (checkForObjectiveConvergence || logObjectiveValue) {\n previousObjectiveValue = currentObjectiveValue;\n currentObjectiveValue = objective.getValue(currentPoint);\n }\n if (checkForGradientConvergence || logGradientNorm) {\n previousGradient = currentGradient;\n try {\n currentGradient = objective.getGradient(currentPoint);\n } catch (NonSmoothFunctionException e) {\n throw new UnsupportedOperationException(\"String_Node_Str\" + \"String_Node_Str\");\n }\n }\n}\n"
|
"public IQueryResults execute(DataSetHandle dataSet, IQueryDefinition queryDefn, boolean useColumnHints, boolean useFilters, boolean clearCache, ExecutionContext context, DataRequestSession session) throws BirtException {\n IBaseDataSetDesign dataSetDesign = session.getModelAdaptor().adaptDataSet(dataSet);\n if (!(dataSet instanceof JointDataSetHandle || dataSet instanceof DerivedDataSetHandle) && context != null) {\n context.setReportContext(new ReportContextImpl(context));\n dataSetDesign = new ModelDteApiAdapter(context).appendRuntimeInfoToDataSet(dataSet, (BaseDataSetDesign) dataSetDesign);\n }\n if (clearCache) {\n IBaseDataSourceDesign dataSourceDesign = session.getModelAdaptor().adaptDataSource(dataSet.getDataSource());\n session.clearCache(dataSourceDesign, dataSetDesign);\n }\n if (!useColumnHints) {\n dataSetDesign.getResultSetHints().clear();\n }\n if (!useFilters) {\n dataSetDesign.getFilters().clear();\n }\n if (!(dataSet instanceof JointDataSetHandle || dataSet instanceof DerivedDataSetHandle) && context != null) {\n if (dataSet.getDataSource() != null) {\n session.defineDataSource(session.getModelAdaptor().adaptDataSource(dataSet.getDataSource()));\n }\n session.defineDataSet(dataSetDesign);\n }\n IQueryResults resultSet = executeQuery(session, queryDefn);\n saveResultToDataItems(dataSetHandle, resultSet);\n return resultSet;\n}\n"
|
"private void checkStringOption(List<ValidationMessage> errors, WrapperElement answer, NodeStack stack, Questionnaire qSrc, QuestionnaireItemComponent qItem, boolean openChoice) {\n WrapperElement v = answer.getNamedChild(\"String_Node_Str\");\n NodeStack ns = stack.push(v, -1, null, null);\n if (qItem.getOption().size() > 0) {\n List<StringType> list = new ArrayList<StringType>();\n for (QuestionnaireItemOptionComponent components : qItem.getOption()) {\n try {\n list.add(components.getValueStringType());\n } catch (FHIRException e) {\n }\n }\n if (list.isEmpty() && !openChoice) {\n rule(errors, IssueType.STRUCTURE, v.line(), v.col(), stack.getLiteralPath(), false, \"String_Node_Str\");\n } else {\n boolean found = false;\n for (StringType item : list) {\n if (item.getValue().equals((v.getAttribute(\"String_Node_Str\")))) {\n found = true;\n break;\n }\n }\n if (!found) {\n rule(errors, IssueType.STRUCTURE, v.line(), v.col(), stack.getLiteralPath(), found, \"String_Node_Str\" + v.getAttribute(\"String_Node_Str\") + \"String_Node_Str\");\n }\n }\n } else {\n hint(errors, IssueType.STRUCTURE, v.line(), v.col(), stack.getLiteralPath(), false, \"String_Node_Str\");\n}\n"
|
"protected final void emit_resolved_newarray(RVMArray array) {\n int width = array.getLogElementSize();\n Offset tibOffset = array.getTibOffset();\n int headerSize = ObjectModel.computeHeaderSize(array);\n int whichAllocator = MM_Interface.pickAllocator(array, method);\n int site = MM_Interface.getAllocationSite(true);\n int align = ObjectModel.getAlignment(array);\n int offset = ObjectModel.getOffsetForAlignment(array, false);\n asm.emitPUSH_Imm(width);\n asm.emitPUSH_Imm(headerSize);\n asm.emitPUSH_Abs(Magic.getTocPointer().plus(tibOffset));\n asm.emitPUSH_Imm(whichAllocator);\n asm.emitPUSH_Imm(align);\n asm.emitPUSH_Imm(offset);\n asm.emitPUSH_Imm(site);\n genParameterRegisterLoad(8);\n asm.emitCALL_Abs(Magic.getTocPointer().plus(Entrypoints.resolvedNewArrayMethod.getOffset()));\n asm.emitPUSH_Reg(T0);\n}\n"
|
"private Long shiftDownRight(Long position) {\n Long drShift = position >>> 9;\n return new Long(drShift & ~LEFT_MASK);\n}\n"
|
"private void processLine() {\n currentNodeSet = new MutableNodeSet(graph);\n if (line == null) {\n if (generateUnusedNodesAsSeeds) {\n Integer id = unusedNodes.pollFirst();\n if (id == null)\n currentNodeSet = null;\n else\n currentNodeSet.add(id);\n } else {\n currentNodeSet = null;\n else\n currentNodeSet.add(id);\n return;\n }\n boolean isConnected = false;\n while (!isConnected) {\n StringTokenizer st = new StringTokenizer(line);\n while (st.hasMoreTokens()) {\n String name = st.nextToken();\n int idx = namesToIndices.get(name);\n if (idx >= 0) {\n currentNodeSet.add(idx);\n unusedNodes.remove(idx);\n }\n }\n readNextLine();\n isConnected = currentNodeSet.size() > 0 && currentNodeSet.isConnected();\n if (!isConnected) {\n currentNodeSet.clear();\n if (line == null) {\n if (generateUnusedNodesAsSeeds) {\n Integer id = unusedNodes.pollFirst();\n currentNodeSet.add(id);\n } else\n currentNodeSet = null;\n return;\n }\n }\n }\n if (isConnected)\n return;\n currentNodeSet = null;\n}\n"
|
"private void writeRelationships(List<Relationship> relationships, XMLStreamWriter writer) throws XMLStreamException {\n for (Relationship edge : relationships) {\n writer.writeStartElement(GraphMLTokens.EDGE);\n writer.writeAttribute(GraphMLTokens.ID, Long.toString(edge.getId()));\n writer.writeAttribute(GraphMLTokens.SOURCE, Long.toString(edge.getStartNode().getId()));\n writer.writeAttribute(GraphMLTokens.TARGET, Long.toString(edge.getEndNode().getId()));\n writer.writeAttribute(GraphMLTokens.LABEL, edge.getType().name());\n for (String key : edge.getPropertyKeys()) {\n writer.writeStartElement(GraphMLTokens.DATA);\n writer.writeAttribute(GraphMLTokens.KEY, key);\n Object value = edge.getProperty(key);\n if (null != value) {\n if (TypeCaster.isArray(value)) {\n writeArray(value, writer);\n } else {\n writer.writeCharacters(value.toString());\n }\n }\n writer.writeEndElement();\n }\n writer.writeEndElement();\n }\n}\n"
|
"public static void main(String[] args) {\n String nameIntrinsic = null;\n int cameraId = 0;\n if (args.length >= 1) {\n cameraId = Integer.parseInt(args[0]);\n }\n if (args.length >= 2) {\n nameIntrinsic = args[1];\n } else {\n System.out.println();\n System.out.println(\"String_Node_Str\");\n System.out.println(\"String_Node_Str\");\n System.out.println();\n }\n System.out.println();\n System.out.println(\"String_Node_Str\" + cameraId);\n System.out.println(\"String_Node_Str\" + nameIntrinsic);\n System.out.println();\n Webcam webcam = Webcam.getWebcams().get(cameraId);\n UtilWebcamCapture.adjustResolution(webcam, 640, 480);\n webcam.open();\n IntrinsicParameters param;\n if (nameIntrinsic == null) {\n param = new IntrinsicParameters();\n Dimension d = webcam.getDevice().getResolution();\n param.width = d.width;\n param.height = d.height;\n param.cx = d.width / 2;\n param.cy = d.height / 2;\n param.fx = param.cx / Math.tan(UtilAngle.degreeToRadian(35));\n param.fy = param.cx / Math.tan(UtilAngle.degreeToRadian(35));\n } else {\n param = UtilIO.loadXML(nameIntrinsic);\n }\n String patternPath = UtilIO.getPathToBase() + \"String_Node_Str\";\n SquareImage_to_FiducialDetector<ImageFloat32> detector = FactoryFiducial.squareImageFast(new ConfigFiducialImage(), 100, ImageFloat32.class);\n detector.addTarget(loadImage(patternPath + \"String_Node_Str\", ImageFloat32.class), 100, 2.5);\n detector.addTarget(loadImage(patternPath + \"String_Node_Str\", ImageFloat32.class), 100, 2.5);\n detector.addTarget(loadImage(patternPath + \"String_Node_Str\", ImageFloat32.class), 100, 2.5);\n detector.addTarget(loadImage(patternPath + \"String_Node_Str\", ImageFloat32.class), 100, 2.5);\n detector.addTarget(loadImage(patternPath + \"String_Node_Str\", ImageFloat32.class), 100, 2.5);\n detector.addTarget(loadImage(patternPath + \"String_Node_Str\", ImageFloat32.class), 100, 2.5);\n detector.addTarget(loadImage(patternPath + \"String_Node_Str\", ImageFloat32.class), 100, 2.5);\n detector.addTarget(loadImage(patternPath + \"String_Node_Str\", ImageFloat32.class), 100, 2.5);\n detector.addTarget(loadImage(patternPath + \"String_Node_Str\", ImageFloat32.class), 100, 2.5);\n detector.addTarget(loadImage(patternPath + \"String_Node_Str\", ImageFloat32.class), 100, 2.5);\n detector.addTarget(loadImage(patternPath + \"String_Node_Str\", ImageFloat32.class), 100, 2.5);\n detector.addTarget(loadImage(patternPath + \"String_Node_Str\", ImageFloat32.class), 100, 2.5);\n detector.setIntrinsic(param);\n ImageFloat32 gray = new ImageFloat32(param.width, param.height);\n ImagePanel gui = new ImagePanel(param.width, param.height);\n ShowImages.showWindow(gui, \"String_Node_Str\").setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);\n Font font = new Font(\"String_Node_Str\", Font.BOLD, 24);\n while (true) {\n BufferedImage frame = webcam.getImage();\n ConvertBufferedImage.convertFrom(frame, gray);\n detector.detect(gray);\n Graphics2D g2 = frame.createGraphics();\n Se3_F64 targetToSensor = new Se3_F64();\n for (int i = 0; i < detector.totalFound(); i++) {\n detector.getFiducialToCamera(i, targetToSensor);\n double width = detector.getWidth(i);\n int id = detector.getId(i);\n Point2D_F64 p = new Point2D_F64();\n Point3D_F64 c = new Point3D_F64();\n SePointOps_F64.transform(targetToSensor, c, c);\n PerspectiveOps.convertNormToPixel(param, c.x / c.z, c.y / c.z, p);\n FontMetrics metrics = g2.getFontMetrics(font);\n String text = Integer.toString(id);\n Rectangle2D r = metrics.getStringBounds(text, null);\n g2.setColor(Color.ORANGE);\n g2.setFont(font);\n g2.drawString(text, (float) (p.x - r.getWidth() / 2), (float) (p.y + r.getHeight() / 2));\n VisualizeFiducial.drawCube(targetToSensor, param, width, g2);\n }\n if (nameIntrinsic == null) {\n g2.setColor(Color.RED);\n g2.setFont(font);\n g2.drawString(\"String_Node_Str\", 10, 20);\n }\n gui.setBufferedImageSafe(frame);\n gui.repaint();\n }\n}\n"
|
"boolean runOnce() throws ZygoteInit.MethodAndArgsCaller {\n String[] args;\n Arguments parsedArgs = null;\n FileDescriptor[] descriptors;\n try {\n args = readArgumentList();\n descriptors = mSocket.getAncillaryFileDescriptors();\n } catch (IOException ex) {\n Log.w(TAG, \"String_Node_Str\" + ex.getMessage());\n closeSocket();\n return true;\n }\n if (args == null) {\n closeSocket();\n return true;\n }\n PrintStream newStderr = null;\n if (descriptors != null && descriptors.length >= 3) {\n newStderr = new PrintStream(new FileOutputStream(descriptors[2]));\n }\n int pid = -1;\n FileDescriptor childPipeFd = null;\n FileDescriptor serverPipeFd = null;\n try {\n parsedArgs = new Arguments(args);\n if (parsedArgs.permittedCapabilities != 0 || parsedArgs.effectiveCapabilities != 0) {\n throw new ZygoteSecurityException(\"String_Node_Str\" + \"String_Node_Str\" + Long.toHexString(parsedArgs.permittedCapabilities) + \"String_Node_Str\" + Long.toHexString(parsedArgs.effectiveCapabilities));\n }\n applyUidSecurityPolicy(parsedArgs, peer, peerSecurityContext);\n applyRlimitSecurityPolicy(parsedArgs, peer, peerSecurityContext);\n applyInvokeWithSecurityPolicy(parsedArgs, peer, peerSecurityContext);\n applyseInfoSecurityPolicy(parsedArgs, peer, peerSecurityContext);\n applyDebuggerSystemProperty(parsedArgs);\n applyInvokeWithSystemProperty(parsedArgs);\n int[][] rlimits = null;\n if (parsedArgs.rlimits != null) {\n rlimits = parsedArgs.rlimits.toArray(intArray2d);\n }\n if (parsedArgs.runtimeInit && parsedArgs.invokeWith != null) {\n FileDescriptor[] pipeFds = Libcore.os.pipe();\n childPipeFd = pipeFds[1];\n serverPipeFd = pipeFds[0];\n ZygoteInit.setCloseOnExec(serverPipeFd, true);\n }\n int[] fdsToClose = { -1, -1 };\n FileDescriptor fd = mSocket.getFileDescriptor();\n if (fd != null) {\n fdsToClose[0] = fd.getInt$();\n }\n fd = ZygoteInit.getServerSocketFileDescriptor();\n if (fd != null) {\n fdsToClose[1] = fd.getInt$();\n }\n fd = null;\n pid = Zygote.forkAndSpecialize(parsedArgs.uid, parsedArgs.gid, parsedArgs.gids, parsedArgs.debugFlags, rlimits, parsedArgs.mountExternal, parsedArgs.seInfo, parsedArgs.niceName, fdsToClose);\n } catch (IOException ex) {\n logAndPrintError(newStderr, \"String_Node_Str\", ex);\n } catch (ErrnoException ex) {\n logAndPrintError(newStderr, \"String_Node_Str\", ex);\n } catch (IllegalArgumentException ex) {\n logAndPrintError(newStderr, \"String_Node_Str\", ex);\n } catch (ZygoteSecurityException ex) {\n logAndPrintError(newStderr, \"String_Node_Str\", ex);\n }\n try {\n if (pid == 0) {\n IoUtils.closeQuietly(serverPipeFd);\n serverPipeFd = null;\n handleChildProc(parsedArgs, descriptors, childPipeFd, newStderr);\n return true;\n } else {\n IoUtils.closeQuietly(childPipeFd);\n childPipeFd = null;\n return handleParentProc(pid, descriptors, serverPipeFd, parsedArgs);\n }\n } finally {\n IoUtils.closeQuietly(childPipeFd);\n IoUtils.closeQuietly(serverPipeFd);\n }\n}\n"
|
"public ManufOrder generateManufOrder(Product product, BigDecimal qtyRequested, int priority, boolean isToInvoice, BillOfMaterial billOfMaterial, LocalDateTime plannedStartDateT) throws AxelorException {\n if (billOfMaterial == null) {\n billOfMaterial = this.getBillOfMaterial(product);\n }\n Company company = billOfMaterial.getCompany();\n BigDecimal qty = qtyRequested.divide(billOfMaterial.getQty(), 2, RoundingMode.HALF_EVEN);\n ManufOrder manufOrder = this.createManufOrder(product, qty, priority, IS_TO_INVOICE, company, billOfMaterial, plannedStartDateT);\n manufOrder = manufOrderWorkflowService.plan(manufOrder);\n return manufOrderRepo.save(manufOrder);\n}\n"
|
"protected Composite getComponent(Composite parent) {\n ChartUIUtil.bindHelp(parent, ChartHelpContextIds.POPUP_AXIS_GRIDLINES);\n GridLayout glContent = new GridLayout();\n glContent.numColumns = 2;\n glContent.horizontalSpacing = 5;\n glContent.verticalSpacing = 5;\n glContent.marginHeight = 7;\n glContent.marginWidth = 7;\n GridLayout glGeneral = new GridLayout();\n glGeneral.numColumns = 10;\n glGeneral.horizontalSpacing = 5;\n glGeneral.verticalSpacing = 5;\n glGeneral.marginHeight = 4;\n glGeneral.marginWidth = 4;\n FillLayout flMajor = new FillLayout();\n cmpContent = new Composite(parent, SWT.NONE);\n cmpContent.setLayout(glContent);\n Composite choiceComposite = new Composite(cmpContent, SWT.NONE);\n GridData gd = new GridData(GridData.FILL_HORIZONTAL);\n gd.horizontalSpan = 2;\n choiceComposite.setLayoutData(gd);\n choiceComposite.setLayout(new GridLayout(2, true));\n cbHidden = new Button(choiceComposite, SWT.CHECK);\n cbHidden.setLayoutData(new GridData(GridData.FILL_BOTH));\n cbHidden.setText(Messages.getString(\"String_Node_Str\"));\n cbHidden.setSelection(!axis.getLineAttributes().isVisible());\n cbHidden.addSelectionListener(this);\n cbTickBetweenCategory = new Button(choiceComposite, SWT.CHECK);\n cbTickBetweenCategory.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));\n cbTickBetweenCategory.setText(Messages.getString(\"String_Node_Str\"));\n cbTickBetweenCategory.setSelection(axis.getScale().isTickBetweenCategories());\n cbTickBetweenCategory.addSelectionListener(this);\n cbTickBetweenCategory.setEnabled(axis.isCategoryAxis());\n cbTickBetweenCategory.setVisible((angleType == AngleType.X) && axis.isCategoryAxis());\n cmpGeneral = new Composite(cmpContent, SWT.NONE);\n GridData gdCMPGeneral = new GridData(GridData.FILL_BOTH);\n gdCMPGeneral.horizontalSpan = 2;\n gdCMPGeneral.grabExcessVerticalSpace = false;\n cmpGeneral.setLayoutData(gdCMPGeneral);\n cmpGeneral.setLayout(glGeneral);\n lblColor = new Label(cmpGeneral, SWT.NONE);\n GridData gdLBLColor = new GridData(GridData.FILL);\n lblColor.setLayoutData(gdLBLColor);\n lblColor.setText(Messages.getString(\"String_Node_Str\"));\n ColorDefinition clrCurrent = null;\n if (axis.eIsSet(ComponentPackage.eINSTANCE.getAxis_LineAttributes())) {\n clrCurrent = axis.getLineAttributes().getColor();\n }\n fccLine = new FillChooserComposite(cmpGeneral, SWT.NONE, getContext(), clrCurrent, false, false, true, true, false, false);\n GridData gdFCCLine = new GridData(GridData.FILL_BOTH);\n gdFCCLine.horizontalSpan = 9;\n gdFCCLine.heightHint = fccLine.getPreferredSize().y;\n gdFCCLine.grabExcessVerticalSpace = false;\n fccLine.setLayoutData(gdFCCLine);\n fccLine.addListener(this);\n lblColor.setEnabled(!cbHidden.getSelection());\n fccLine.setEnabled(!cbHidden.getSelection());\n lblGridStepNum = new Label(cmpGeneral, SWT.NONE);\n GridData gdLblGridStepNum = new GridData(GridData.FILL);\n lblGridStepNum.setLayoutData(gdLblGridStepNum);\n lblGridStepNum.setText(Messages.getString(\"String_Node_Str\"));\n majGridStNum = new Spinner(cmpGeneral, SWT.BORDER);\n {\n gd = new GridData(GridData.FILL_HORIZONTAL);\n gd.horizontalSpan = 4;\n majGridStNum.setLayoutData(gd);\n majGridStNum.setMinimum(1);\n majGridStNum.setSelection(getAxisForProcessing().getScale().getMajorGridsStepNumber());\n majGridStNum.addSelectionListener(this);\n }\n lblGridCount = new Label(cmpGeneral, SWT.NONE);\n GridData gdLBLGridCount = new GridData();\n lblGridCount.setLayoutData(gdLBLGridCount);\n lblGridCount.setText(Messages.getString(\"String_Node_Str\"));\n iscGridCount = new Spinner(cmpGeneral, SWT.BORDER);\n {\n gd = new GridData(GridData.FILL_HORIZONTAL);\n gd.horizontalSpan = 4;\n iscGridCount.setLayoutData(gd);\n iscGridCount.setMinimum(1);\n iscGridCount.setSelection(getAxisForProcessing().getScale().getMinorGridsPerUnit());\n iscGridCount.addSelectionListener(this);\n }\n grpMajor = new Group(cmpContent, SWT.NONE);\n GridData gdGRPMajor = new GridData(GridData.FILL_HORIZONTAL);\n grpMajor.setLayoutData(gdGRPMajor);\n grpMajor.setText(Messages.getString(\"String_Node_Str\"));\n grpMajor.setLayout(flMajor);\n gacMajor = new GridAttributesComposite(grpMajor, SWT.NONE, getContext(), axis.getMajorGrid(), axis.getOrientation().getValue());\n gacMajor.addListener(this);\n grpMinor = new Group(cmpContent, SWT.NONE);\n {\n grpMinor.setLayout(new FillLayout());\n GridData gdGRPMinor = new GridData(GridData.FILL_HORIZONTAL);\n grpMinor.setLayoutData(gdGRPMinor);\n grpMinor.setText(Messages.getString(\"String_Node_Str\"));\n }\n gacMinor = new GridAttributesComposite(grpMinor, SWT.NONE, getContext(), axis.getMinorGrid(), axis.getOrientation().getValue());\n gacMinor.addListener(this);\n setStateOfMajorGrid();\n setStateOfMinorGrid();\n return cmpContent;\n}\n"
|
"public void doImport(TreeObject[] objs, IProgressMonitor monitor) {\n monitor.beginTask(\"String_Node_Str\", IProgressMonitor.UNKNOWN);\n Reader reader = null;\n Arrays.sort(objs, new Comparator<Object>() {\n public int compare(Object o1, Object o2) {\n return ((TreeObject) o1).getType() - ((TreeObject) o2).getType();\n }\n });\n LocalTreeObjectRepository.getInstance().mergeImportCategory(objs, serverRoot);\n boolean isOverrideAll = false;\n for (TreeObject item : objs) {\n String[] subItems;\n switch(item.getType()) {\n case TreeObject.DATA_CLUSTER:\n monitor.subTask(\"String_Node_Str\");\n subItems = item.getItems();\n for (String subItem : subItems) {\n try {\n reader = new FileReader(importFolder + \"String_Node_Str\" + subItem);\n WSDataCluster model = new WSDataCluster();\n model = (WSDataCluster) Unmarshaller.unmarshal(WSDataCluster.class, reader);\n if (port.existsDataCluster(new WSExistsDataCluster(new WSDataClusterPK(model.getName()))).is_true()) {\n if (!isOverrideAll) {\n int result = isOveride(model.getName(), TreeObject.DATACONTAINER);\n if (result == IDialogConstants.CANCEL_ID) {\n return;\n }\n if (result == IDialogConstants.YES_TO_ALL_ID) {\n isOverrideAll = true;\n }\n if (result == IDialogConstants.NO_ID) {\n break;\n }\n }\n }\n port.putDataCluster(new WSPutDataCluster(model));\n } catch (Exception e1) {\n e1.printStackTrace();\n } finally {\n try {\n if (reader != null)\n reader.close();\n } catch (Exception e) {\n }\n }\n importClusterContents(item, port);\n }\n monitor.worked(1);\n break;\n case TreeObject.DATA_MODEL:\n monitor.subTask(\"String_Node_Str\");\n subItems = item.getItems();\n for (String subItem : subItems) {\n try {\n reader = new FileReader(importFolder + \"String_Node_Str\" + subItem);\n WSDataModel model = new WSDataModel();\n model = (WSDataModel) Unmarshaller.unmarshal(WSDataModel.class, reader);\n if (port.existsDataModel(new WSExistsDataModel(new WSDataModelPK(model.getName()))).is_true()) {\n if (!isOverrideAll) {\n int result = isOveride(model.getName(), TreeObject.DATAMODEL_);\n if (result == IDialogConstants.CANCEL_ID) {\n return;\n }\n if (result == IDialogConstants.YES_TO_ALL_ID) {\n isOverrideAll = true;\n }\n if (result == IDialogConstants.NO_ID) {\n break;\n }\n }\n }\n port.putDataModel(new WSPutDataModel(model));\n } catch (Exception e2) {\n e2.printStackTrace();\n } finally {\n try {\n if (reader != null)\n reader.close();\n } catch (Exception e) {\n }\n }\n }\n monitor.worked(1);\n break;\n case TreeObject.MENU:\n monitor.subTask(\"String_Node_Str\");\n subItems = item.getItems();\n for (String subItem : subItems) {\n try {\n reader = new FileReader(importFolder + \"String_Node_Str\" + subItem);\n WSMenu memu = new WSMenu();\n memu = (WSMenu) Unmarshaller.unmarshal(WSMenu.class, reader);\n if (port.existsMenu(new WSExistsMenu(new WSMenuPK(memu.getName()))).is_true()) {\n if (!isOverrideAll) {\n int result = isOveride(memu.getName(), TreeObject.MENU_);\n if (result == IDialogConstants.CANCEL_ID) {\n return;\n }\n if (result == IDialogConstants.YES_TO_ALL_ID) {\n isOverrideAll = true;\n }\n if (result == IDialogConstants.NO_ID) {\n break;\n }\n }\n }\n port.putMenu(new WSPutMenu(memu));\n } catch (Exception e2) {\n e2.printStackTrace();\n } finally {\n try {\n if (reader != null)\n reader.close();\n } catch (Exception e) {\n }\n }\n }\n monitor.worked(1);\n break;\n case TreeObject.ROLE:\n if (Util.IsEnterPrise()) {\n monitor.subTask(\"String_Node_Str\");\n subItems = item.getItems();\n for (String subItem : subItems) {\n try {\n reader = new FileReader(importFolder + \"String_Node_Str\" + subItem);\n WSRole role = new WSRole();\n role = (WSRole) Unmarshaller.unmarshal(WSRole.class, reader);\n if (port.existsRole(new WSExistsRole(new WSRolePK(role.getName()))).is_true()) {\n if (!isOverrideAll) {\n int result = isOveride(role.getName(), TreeObject.ROLE_);\n if (result == IDialogConstants.CANCEL_ID) {\n return;\n }\n if (result == IDialogConstants.YES_TO_ALL_ID) {\n isOverrideAll = true;\n }\n if (result == IDialogConstants.NO_ID) {\n break;\n }\n }\n }\n port.putRole(new WSPutRole(role));\n } catch (Exception e2) {\n e2.printStackTrace();\n } finally {\n try {\n if (reader != null)\n reader.close();\n } catch (Exception e) {\n }\n }\n }\n monitor.worked(1);\n }\n break;\n case TreeObject.ROUTING_RULE:\n monitor.subTask(\"String_Node_Str\");\n subItems = item.getItems();\n for (String subItem : subItems) {\n try {\n reader = new FileReader(importFolder + \"String_Node_Str\" + subItem);\n WSRoutingRule routingRule = new WSRoutingRule();\n routingRule = (WSRoutingRule) Unmarshaller.unmarshal(WSRoutingRule.class, reader);\n if (routingRule.getWsRoutingRuleExpressions() != null) {\n for (WSRoutingRuleExpression rule : routingRule.getWsRoutingRuleExpressions()) {\n if (rule.getWsOperator() == null)\n rule.setWsOperator(WSRoutingRuleOperator.CONTAINS);\n }\n }\n if (port.existsRoutingRule(new WSExistsRoutingRule(new WSRoutingRulePK(routingRule.getName()))).is_true()) {\n if (!isOverrideAll) {\n int result = isOveride(routingRule.getName(), TreeObject.ROUTINGRULE_);\n if (result == IDialogConstants.CANCEL_ID) {\n return;\n }\n if (result == IDialogConstants.YES_TO_ALL_ID) {\n isOverrideAll = true;\n }\n if (result == IDialogConstants.NO_ID) {\n break;\n }\n }\n }\n port.putRoutingRule(new WSPutRoutingRule(routingRule));\n } catch (Exception e2) {\n e2.printStackTrace();\n } finally {\n try {\n if (reader != null)\n reader.close();\n } catch (Exception e) {\n }\n }\n }\n monitor.worked(1);\n break;\n case TreeObject.STORED_PROCEDURE:\n monitor.subTask(\"String_Node_Str\");\n subItems = item.getItems();\n for (String subItem : subItems) {\n try {\n reader = new FileReader(importFolder + \"String_Node_Str\" + subItem);\n WSStoredProcedure model = new WSStoredProcedure();\n model = (WSStoredProcedure) Unmarshaller.unmarshal(WSStoredProcedure.class, reader);\n if (port.existsStoredProcedure(new WSExistsStoredProcedure(new WSStoredProcedurePK(model.getName()))).is_true()) {\n if (!isOverrideAll) {\n int result = isOveride(model.getName(), TreeObject.STOREDPROCEDURE_);\n if (result == IDialogConstants.CANCEL_ID) {\n return;\n }\n if (result == IDialogConstants.YES_TO_ALL_ID) {\n isOverrideAll = true;\n }\n if (result == IDialogConstants.NO_ID) {\n break;\n }\n }\n }\n port.putStoredProcedure(new WSPutStoredProcedure(model));\n } catch (Exception e2) {\n e2.printStackTrace();\n } finally {\n try {\n if (reader != null)\n reader.close();\n } catch (Exception e) {\n }\n }\n }\n monitor.worked(1);\n break;\n case TreeObject.SYNCHRONIZATIONPLAN:\n if (Util.IsEnterPrise()) {\n monitor.subTask(\"String_Node_Str\");\n subItems = item.getItems();\n for (String subItem : subItems) {\n try {\n reader = new FileReader(importFolder + \"String_Node_Str\" + subItem);\n WSSynchronizationPlan model = new WSSynchronizationPlan();\n model = (WSSynchronizationPlan) Unmarshaller.unmarshal(WSSynchronizationPlan.class, reader);\n if (port.existsSynchronizationPlan(new WSExistsSynchronizationPlan(new WSSynchronizationPlanPK(model.getName()))).is_true()) {\n if (!isOverrideAll) {\n int result = isOveride(model.getName(), TreeObject.SYNCHRONIZATIONPLAN_);\n if (result == IDialogConstants.CANCEL_ID) {\n return;\n }\n if (result == IDialogConstants.YES_TO_ALL_ID) {\n isOverrideAll = true;\n }\n if (result == IDialogConstants.NO_ID) {\n break;\n }\n }\n }\n port.putSynchronizationPlan(new WSPutSynchronizationPlan(model));\n } catch (Exception e2) {\n e2.printStackTrace();\n } finally {\n try {\n if (reader != null)\n reader.close();\n } catch (Exception e) {\n }\n }\n }\n monitor.worked(1);\n }\n break;\n case TreeObject.PICTURES_RESOURCE:\n subItems = item.getItems();\n for (String subItem : subItems) {\n try {\n Util.uploadImageFile(serverRoot.getEndpointIpAddress() + \"String_Node_Str\", importFolder + \"String_Node_Str\" + subItem, serverRoot.getUsername(), serverRoot.getPassword());\n } catch (Exception e2) {\n e2.printStackTrace();\n }\n }\n break;\n case TreeObject.WORKFLOW_PROCESS:\n monitor.subTask(\"String_Node_Str\");\n java.util.List<IAvailableModel> availablemodels = AvailableModelUtil.getAvailableModels();\n for (IAvailableModel model : availablemodels) {\n if (model.toString().indexOf(\"String_Node_Str\") != -1) {\n model.doImport(item, importFolder);\n }\n }\n break;\n case TreeObject.TRANSFORMER:\n monitor.subTask(\"String_Node_Str\");\n subItems = item.getItems();\n for (String subItem : subItems) {\n try {\n reader = new FileReader(importFolder + \"String_Node_Str\" + subItem);\n WSTransformer model = new WSTransformer();\n model = (WSTransformer) Unmarshaller.unmarshal(WSTransformer.class, reader);\n if (port.existsTransformer(new WSExistsTransformer(new WSTransformerPK(model.getName()))).is_true()) {\n if (!isOverrideAll) {\n int result = isOveride(model.getName(), TreeObject.TRANSFORMER_);\n if (result == IDialogConstants.CANCEL_ID) {\n return;\n }\n if (result == IDialogConstants.YES_TO_ALL_ID) {\n isOverrideAll = true;\n }\n if (result == IDialogConstants.NO_ID) {\n break;\n }\n }\n }\n port.putTransformer(new WSPutTransformer(model));\n } catch (Exception e2) {\n e2.printStackTrace();\n } finally {\n try {\n if (reader != null)\n reader.close();\n } catch (Exception e) {\n }\n }\n }\n monitor.worked(1);\n break;\n case TreeObject.UNIVERSE:\n if (Util.IsEnterPrise()) {\n monitor.subTask(\"String_Node_Str\");\n subItems = item.getItems();\n for (String subItem : subItems) {\n try {\n reader = new FileReader(importFolder + \"String_Node_Str\" + subItem);\n WSUniverse model = new WSUniverse();\n model = (WSUniverse) Unmarshaller.unmarshal(WSUniverse.class, reader);\n if (port.existsUniverse(new WSExistsUniverse(new WSUniversePK(model.getName()))).is_true()) {\n if (!isOverrideAll) {\n int result = isOveride(model.getName(), TreeObject.UNIVERSE_);\n if (result == IDialogConstants.CANCEL_ID) {\n return;\n }\n if (result == IDialogConstants.YES_TO_ALL_ID) {\n isOverrideAll = true;\n }\n if (result == IDialogConstants.NO_ID) {\n break;\n }\n }\n }\n port.putUniverse(new WSPutUniverse(model));\n } catch (Exception e2) {\n e2.printStackTrace();\n } finally {\n try {\n if (reader != null)\n reader.close();\n } catch (Exception e) {\n }\n }\n }\n monitor.worked(1);\n }\n break;\n case TreeObject.VIEW:\n monitor.subTask(\"String_Node_Str\");\n subItems = item.getItems();\n for (String subItem : subItems) {\n try {\n reader = new FileReader(importFolder + \"String_Node_Str\" + subItem);\n WSView model = new WSView();\n model = (WSView) Unmarshaller.unmarshal(WSView.class, reader);\n if (model.getIsTransformerActive() == null)\n model.setIsTransformerActive(new WSBoolean(false));\n if (model.getTransformerPK() == null)\n model.setTransformerPK(\"String_Node_Str\");\n if (model.getWhereConditions() != null) {\n for (WSWhereCondition ws : model.getWhereConditions()) {\n if (ws.getOperator() == null) {\n ws.setOperator(WSWhereOperator.CONTAINS);\n }\n if (ws.getStringPredicate() == null) {\n ws.setStringPredicate(WSStringPredicate.NONE);\n }\n }\n }\n if (port.existsView(new WSExistsView(new WSViewPK(model.getName()))).is_true()) {\n if (!isOverrideAll) {\n int result = isOveride(model.getName(), TreeObject.VIEW_);\n if (result == IDialogConstants.CANCEL_ID) {\n return;\n }\n if (result == IDialogConstants.YES_TO_ALL_ID) {\n isOverrideAll = true;\n }\n if (result == IDialogConstants.NO_ID) {\n break;\n }\n }\n }\n port.putView(new WSPutView(model));\n } catch (Exception e2) {\n e2.printStackTrace();\n } finally {\n try {\n if (reader != null)\n reader.close();\n } catch (Exception e) {\n }\n }\n }\n monitor.worked(1);\n break;\n }\n }\n monitor.done();\n}\n"
|
"public void stop(BundleContext bc) {\n bc.removeServiceListener(this);\n Collection<ServiceReference<ProtocolProviderService>> ppsRefs = ServiceUtils.getServiceReferences(bc, ProtocolProviderService.class);\n if (!ppsRefs.isEmpty()) {\n for (ServiceReference<ProtocolProviderService> ppsRef : ppsRefs) {\n ProtocolProviderService pps = bc.getService(ppsRef);\n this.handleProviderRemoved(pps);\n }\n }\n}\n"
|
"private static IndirectCollectionsProvider getProvider() {\n try {\n if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {\n final Class support = (Class) AccessController.doPrivileged(new PrivilegedClassForName(JDK8_SUPPORT_PROVIDER, true, IndirectCollectionsFactory.class.getClassLoader()));\n return AccessController.doPrivileged(new PrivilegedAction<IndirectCollectionsProvider>() {\n public IndirectCollectionsProvider run() {\n try {\n return (IndirectCollectionsProvider) support.newInstance();\n } catch (InstantiationException | IllegalAccessException ex) {\n throw new RuntimeException(ex);\n }\n }\n });\n } else {\n Class support = PrivilegedAccessHelper.getClassForName(JDK8_SUPPORT_PROVIDER, true, IndirectCollectionsFactory.class.getClassLoader());\n return (IndirectCollectionsProvider) PrivilegedAccessHelper.newInstanceFromClass(support);\n }\n } catch (Throwable t) {\n SessionLogEntry sle = new SessionLogEntry(null, t);\n sle.setMessage(\"String_Node_Str\");\n sle.setLevel(SessionLog.FINEST);\n sle.setNameSpace(SessionLog.MISC);\n sle.setDate(null);\n AbstractSessionLog.getLog().log(sle);\n }\n return new DefaultProvider();\n}\n"
|
"public ClassFile getClassFile2() {\n return getClassFile3(true);\n}\n"
|
"protected final void constructionFinishedEvent() {\n requestWorker();\n}\n"
|
"private JSpinner createUploadSpinner() {\n SpinnerNumberModel maxUploadSpinnerModel = new SpinnerNumberModel(UploadSettings.MAX_UPLOAD_SPEED.getValue() / 1024, UploadSettings.MAX_UPLOAD_SPEED.getMinValue().intValue() / 1024, UploadSettings.LIMIT_MAX_UPLOAD_SPEED.get() ? (UploadSettings.MAX_UPLOAD_SPEED.getValue() / 1024) : (UploadSettings.MAX_UPLOAD_SPEED.getMaxValue().intValue() / 1024), 1);\n return createSpinner(maxUploadSpinnerModel);\n}\n"
|
"public void indexPage(RawPage page) throws DaoException {\n if (closed) {\n throw new IllegalStateException(\"String_Node_Str\");\n }\n if (!language.equals(page.getLanguage())) {\n throw new IllegalStateException(\"String_Node_Str\");\n }\n try {\n Document document = new Document();\n Field localIdField = new IntField(LuceneOptions.LOCAL_ID_FIELD_NAME, page.getLocalId(), Field.Store.YES);\n Field langIdField = new IntField(LuceneOptions.LANG_ID_FIELD_NAME, page.getLanguage().getId(), Field.Store.YES);\n Field canonicalTitleField = builder.buildTextField(page, new TextFieldElements().addTitle());\n document.add(localIdField);\n document.add(langIdField);\n document.add(canonicalTitleField);\n if (!page.isRedirect()) {\n for (LuceneOptions option : options) {\n document.add(builder.buildTextField(page, option.elements));\n }\n writers.get(language).addDocument(document);\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n}\n"
|
"public void checkAndReleaseAllocatedResource(ExecutionGraph executionGraph, AllocatedResource allocatedResource) {\n if (allocatedResource == null) {\n LOG.error(\"String_Node_Str\");\n return;\n }\n if (allocatedResource.getInstance() instanceof DummyInstance) {\n LOG.debug(\"String_Node_Str\");\n return;\n }\n synchronized (executionGraph) {\n final List<ExecutionVertex> assignedVertices = executionGraph.getVerticesAssignedToResource(allocatedResource);\n if (assignedVertices.isEmpty()) {\n return;\n }\n boolean instanceCanBeReleased = true;\n final Iterator<ExecutionVertex> it = assignedVertices.iterator();\n while (it.hasNext()) {\n final ExecutionVertex vertex = it.next();\n final ExecutionState state = vertex.getExecutionState();\n if (state != ExecutionState.CREATED && state != ExecutionState.FINISHED && state != ExecutionState.FAILED) {\n instanceCanBeReleased = false;\n break;\n }\n }\n if (instanceCanBeReleased) {\n LOG.info(\"String_Node_Str\" + allocatedResource.getInstance());\n try {\n getInstanceManager().releaseAllocatedResource(executionGraph.getJobID(), executionGraph.getJobConfiguration(), allocatedResource);\n } catch (InstanceException e) {\n LOG.error(StringUtils.stringifyException(e));\n }\n }\n }\n}\n"
|
"public void testSetRemoveWorkPackageItems() {\n Collection<IAtsWorkItem> workItems = workPackageEp.getWorkItems(DemoArtifactToken.SAW_Code_Team_WorkPackage_01.getUuid());\n assertEquals(2, workItems.size());\n IAtsWorkItem workItem = workItems.iterator().next();\n JaxWorkPackageData data = new JaxWorkPackageData();\n data.setAsUserId(AtsClientService.get().getUserService().getCurrentUserId());\n data.getWorkItemUuids().add(workItem.getUuid());\n workPackageEp.deleteWorkPackageItems(data);\n assertEquals(1, workPackageEp.getWorkItems(DemoArtifactToken.SAW_Code_Team_WorkPackage_01.getUuid()).size());\n workPackageEp.setWorkPackage(DemoArtifactToken.SAW_Code_Team_WorkPackage_01.getUuid(), data);\n assertEquals(2, workPackageEp.getWorkItems(DemoArtifactToken.SAW_Code_Team_WorkPackage_01.getUuid()).size());\n}\n"
|
"static private void serializeJObject(StringBuilder sb, JsonObject jobject) {\n sb.append(\"String_Node_Str\");\n String[] keys = jobject.keySet().toArray(new String[0]);\n if (keys.length != 0) {\n String key = keys[0];\n serializeJString(sb, key);\n sb.append(\"String_Node_Str\");\n serializeAnyJValue(sb, jobject.get(key), ancestorIdSet);\n }\n for (int i = 1; i < keys.length; i++) {\n sb.append(\"String_Node_Str\");\n String key = keys[i];\n serializeJString(sb, key);\n sb.append(\"String_Node_Str\");\n serializeAnyJValue(sb, jobject.get(key));\n }\n sb.append(\"String_Node_Str\");\n}\n"
|
"public RunStats call() {\n logger.info(\"String_Node_Str\", test.getAbsoluteFile().toURI().normalize().getPath());\n try {\n final RunStats runStats = runTest(test);\n if (outputStrategy.contains(OutputStrategy.PER_TEST)) {\n writeRunStats(runStats);\n }\n return runStats;\n } catch (final IOException e) {\n return RunStats.EMPTY;\n }\n}\n"
|
"public void undo() {\n final long d0 = ref.getDataIndex();\n swap(d0);\n dataStack.setWriteDataIndex(d0);\n}\n"
|
"public Record read(Request req) {\n return nextOwnedRecord(req.name, req.recordId, req.blockId);\n}\n"
|
"protected Object _visitUserTypeDeclNode(UserTypeDeclNode node, LinkedList args) {\n NameContext ctx = new NameContext();\n ctx.environ = (Environ) node.getDefinedProperty(ENVIRON_KEY);\n ClassDecl decl = (ClassDecl) JavaDecl.getDecl((NamedNode) node);\n ctx.currentClass = decl.getDefType();\n LinkedList childArgs = TNLManip.cons(ctx);\n node.setMembers(TNLManip.traverseList(this, node, childArgs, node.getMembers()));\n return node;\n}\n"
|
"public static void beforeClass() throws IOException {\n zkServer = InMemoryZKServer.builder().setDataDir(TEMP_FOLDER.newFolder()).build();\n zkServer.startAndWait();\n conf = CConfiguration.create();\n conf.set(Constants.Zookeeper.QUORUM, zkServer.getConnectionStr());\n conf.setInt(Constants.Stream.CONTAINER_INSTANCE_ID, 0);\n conf.set(Constants.CFG_LOCAL_DATA_DIR, tmpFolder.newFolder().getAbsolutePath());\n injector = Guice.createInjector(Modules.override(new ZKClientModule(), new DataFabricModules().getInMemoryModules(), new ConfigModule(conf, new Configuration()), new AuthModule(), new DiscoveryRuntimeModule().getInMemoryModules(), new LocationRuntimeModule().getInMemoryModules(), new ExploreClientModule(), new StreamServiceRuntimeModule().getDistributedModules(), new StreamAdminModules().getInMemoryModules()).with(new AbstractModule() {\n protected void configure() {\n bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class);\n bind(StreamConsumerStateStoreFactory.class).to(LevelDBStreamConsumerStateStoreFactory.class).in(Singleton.class);\n bind(StreamAdmin.class).to(LevelDBStreamFileAdmin.class).in(Singleton.class);\n bind(StreamConsumerFactory.class).to(LevelDBStreamFileConsumerFactory.class).in(Singleton.class);\n bind(StreamFileWriterFactory.class).to(LocationStreamFileWriterFactory.class).in(Singleton.class);\n bind(StreamFileJanitorService.class).to(LocalStreamFileJanitorService.class).in(Scopes.SINGLETON);\n bind(StreamMetaStore.class).to(InMemoryStreamMetaStore.class).in(Scopes.SINGLETON);\n bind(HeartbeatPublisher.class).to(MockHeartbeatPublisher.class).in(Scopes.SINGLETON);\n }\n }));\n zkClient = injector.getInstance(ZKClientService.class);\n zkClient.startAndWait();\n streamHttpService = injector.getInstance(StreamHttpService.class);\n streamHttpService.startAndWait();\n streamService = injector.getInstance(StreamService.class);\n streamService.startAndWait();\n heartbeatPublisher = (MockHeartbeatPublisher) injector.getInstance(HeartbeatPublisher.class);\n hostname = streamHttpService.getBindAddress().getHostName();\n port = streamHttpService.getBindAddress().getPort();\n}\n"
|
"public boolean contains(Node node) {\n if (node == null) {\n throw new NullPointerException();\n }\n AbstractNode absNode = (AbstractNode) node;\n readLock();\n if (!absNode.isValid()) {\n return false;\n }\n boolean res = false;\n if (absNode.isValid()) {\n if (nodeProposition.evaluate(absNode) && dhns.getTreeStructure().getTree().contains(absNode)) {\n res = true;\n }\n }\n readUnlock();\n return res;\n}\n"
|
"private String generateRestrictionChecks(AttributeContainer.Element member) throws Exception {\n String result = \"String_Node_Str\";\n AttributeContainer.Restriction r = member.restrictions;\n String message = \"String_Node_Str\";\n String comment = \"String_Node_Str\";\n if (member.isLengthRestricted()) {\n result += JavaRestrictionHelper.createCheckCode(String.format(\"String_Node_Str\", member.name, Long.parseLong(r.length)), String.format(message, \"String_Node_Str\", member.name), String.format(comment, \"String_Node_Str\"));\n }\n if (member.isMinLengthRestricted()) {\n result += JavaRestrictionHelper.createCheckCode(String.format(\"String_Node_Str\", member.name, Long.parseLong(r.minLength)), String.format(message, \"String_Node_Str\", member.name), String.format(comment, \"String_Node_Str\"));\n }\n if (member.isMaxLengthRestricted()) {\n result += JavaRestrictionHelper.createCheckCode(String.format(\"String_Node_Str\", member.name, Long.parseLong(r.maxLength)), String.format(message, \"String_Node_Str\", member.name), String.format(comment, \"String_Node_Str\"));\n }\n if (member.isMinInclusiveRestricted()) {\n result += JavaRestrictionHelper.createCheckCode(JavaRestrictionHelper.minInclusiveExpression(member), String.format(message, \"String_Node_Str\", member.name), String.format(comment, \"String_Node_Str\"));\n }\n if (member.isMaxInclusiveRestricted()) {\n result += JavaRestrictionHelper.createCheckCode(String.format(\"String_Node_Str\", member.name, Long.parseLong(r.maxInclusive)), String.format(message, \"String_Node_Str\", member.name), String.format(comment, \"String_Node_Str\"));\n }\n if (member.isMinExclusiveRestricted()) {\n result += JavaRestrictionHelper.createCheckCode(String.format(\"String_Node_Str\", member.name, Long.parseLong(r.minExclusive)), String.format(message, \"String_Node_Str\", member.name), String.format(comment, \"String_Node_Str\"));\n }\n if (member.isMaxExclusiveRestricted()) {\n result += JavaRestrictionHelper.createCheckCode(String.format(\"String_Node_Str\", member.name, Long.parseLong(r.maxExclusive)), String.format(message, \"String_Node_Str\", member.name), String.format(comment, \"String_Node_Str\"));\n }\n if (member.isPatternRestricted()) {\n result += JavaRestrictionHelper.createPatternCheckCode(member.name, r.pattern, String.format(message, \"String_Node_Str\", member.name));\n }\n if (member.isWhiteSpaceRestricted() && (\"String_Node_Str\").equals(member.type)) {\n result += JavaRestrictionHelper.createWhiteSpaceCheckCode(member.name, r.whiteSpace);\n }\n if (member.isTotalDigitsRestricted()) {\n result += JavaRestrictionHelper.createTotalDigitsCheckCode(member.name, r.totalDigits);\n }\n if (member.isFractionDigitsRestricted()) {\n result += JavaRestrictionHelper.createFractionDigitsCheckCode(member.name, r.fractionDigits);\n }\n return result;\n}\n"
|
"public static boolean isFromLibrary(Object model) {\n if (model instanceof DesignElementHandle) {\n return DEUtil.isLinkedElement((DesignElementHandle) model);\n }\n return false;\n}\n"
|
"public void replaceVarWithURI(String var, String uri) {\n SPARQL_Term subject;\n SPARQL_Property property;\n SPARQL_Value object;\n uri = \"String_Node_Str\" + uri + \"String_Node_Str\";\n for (SPARQL_Triple triple : conditions) {\n subject = triple.getVariable();\n property = triple.getProperty();\n object = triple.getValue();\n if (subject.isVariable()) {\n if (subject.getName().equals(var)) {\n subject.setName(uri);\n subject.setIsVariable(false);\n }\n }\n if (property.isVariable()) {\n if (property.getName().equals(var)) {\n property.setName(uri);\n property.setIsVariable(false);\n }\n }\n if (object.isVariable()) {\n if (object.getName().equals(var)) {\n object.setName(uri);\n object.setIsVariable(false);\n }\n }\n }\n}\n"
|
"public void onSubmit(AjaxRequestTarget target, Form form) {\n target.addComponent(done.setDefaultModel(new Model<String>() {\n public String getObject() {\n return \"String_Node_Str\";\n }\n }));\n try {\n final UpdateDetails update = ((DefaultManager) Manager.getInstance()).getAvailableUpdates().get(0);\n URL download = new URL(update.getFile());\n final long length = update.getLength();\n URLConnection conn = download.openConnection();\n conn.connect();\n if (length > -1) {\n target.addComponent(this.setVisible(false));\n target.addComponent(run.setVisible(true));\n target.addComponent(bar.setVisible(true));\n bar.start(target);\n }\n final Thread restartThread = new Thread() {\n public void run() {\n try {\n sleep(1000);\n } catch (InterruptedException e) {\n }\n try {\n UpdatingPanel.this.runtime.restart();\n } catch (Exception e) {\n log.error(\"String_Node_Str\", e);\n }\n }\n };\n new Thread() {\n public void run() {\n try {\n byte[] buffer = new byte[4096];\n long downloaded = 0;\n InputStream in = conn.getInputStream();\n outFile = new File(org.headsupdev.agile.api.util.FileUtil.getTempDir(), new File(update.getFile()).getName());\n OutputStream out = new FileOutputStream(outFile);\n int chunk;\n while ((chunk = in.read(buffer)) > -1) {\n downloaded += chunk;\n out.write(buffer, 0, chunk);\n if (length > 0) {\n int prog = (int) (((double) downloaded / length) * 100);\n if (prog > 99) {\n prog = 99;\n }\n progress = prog;\n }\n }\n in.close();\n out.close();\n outFile = new TarFile(new GZipFile(outFile).expand(true)).expand();\n File tmpDir = new File(outFile.getAbsolutePath() + \"String_Node_Str\");\n outFile.renameTo(tmpDir);\n File[] children = tmpDir.listFiles();\n outFile = new File(outFile.getParentFile(), outFile.getName());\n children[0].renameTo(outFile);\n tmpDir.delete();\n String version = new File(update.getFile()).getName();\n version = version.substring(0, version.indexOf(\"String_Node_Str\"));\n Event event = new SystemEvent(Manager.getStorageInstance().getGlobalConfiguration().getProductName() + \"String_Node_Str\" + version, Manager.getStorageInstance().getGlobalConfiguration().getProductName() + \"String_Node_Str\" + version + \"String_Node_Str\", \"String_Node_Str\" + Manager.getStorageInstance().getGlobalConfiguration().getProductName() + \"String_Node_Str\" + version + \"String_Node_Str\" + update.getDetails());\n Manager.getStorageInstance().addEvent(event);\n Manager.getInstance().fireEventAdded(event);\n Process chmodProcess = null;\n try {\n chmodProcess = Runtime.getRuntime().exec(\"String_Node_Str\" + new File(outFile, \"String_Node_Str\").getAbsolutePath());\n chmodProcess.waitFor();\n } catch (InterruptedException e) {\n } finally {\n if (chmodProcess != null) {\n IOUtil.close(chmodProcess.getOutputStream());\n IOUtil.close(chmodProcess.getErrorStream());\n IOUtil.close(chmodProcess.getInputStream());\n chmodProcess.destroy();\n }\n }\n updateProperties(new File(new File(outFile, \"String_Node_Str\"), \"String_Node_Str\"));\n File mainDir = new File(\"String_Node_Str\");\n File backupDir = new File(mainDir, \"String_Node_Str\");\n if (backupDir.exists()) {\n for (File child : backupDir.listFiles()) {\n FileUtil.delete(child);\n }\n } else {\n backupDir.mkdir();\n }\n for (File child : mainDir.listFiles()) {\n if (child.equals(outFile)) {\n continue;\n }\n child.renameTo(new File(backupDir, child.getName()));\n }\n for (File child : outFile.listFiles()) {\n child.renameTo(new File(mainDir, child.getName()));\n }\n outFile.delete();\n progress = 100;\n restartThread.start();\n } catch (IOException e) {\n log.error(\"String_Node_Str\", e);\n }\n }\n }.start();\n } catch (IOException e) {\n log.error(\"String_Node_Str\", e);\n }\n}\n"
|
"public void modifyText(ModifyEvent arg0) {\n Granularity g = null;\n if (table.getSelection() != null && table.getSelection().length != 0) {\n g = (Granularity) table.getSelection()[0].getData();\n }\n if (g.isFormatSupported()) {\n String formatString = text.getText();\n if (g != null && model.getFormat().isValid(formatString, g.getDefaultFormat())) {\n decoration.hide();\n Format format = model.getFormat();\n format.set((Granularity) table.getSelection()[0].getData(), formatString);\n model.setFormat(format);\n } else {\n decoration.setDescriptionText(Resources.getMessage(\"String_Node_Str\"));\n Image image = FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_ERROR).getImage();\n decoration.setImage(image);\n decoration.show();\n }\n } else {\n decoration.hide();\n }\n}\n"
|
"private boolean testAndMark(ObjectReference object) {\n byte oldValue, markBits, newValue;\n oldValue = VM.objectModel.readAvailableByte(object);\n markBits = (byte) (oldValue & MARK_COUNT_MASK);\n if (markBits == markState)\n return false;\n VM.objectModel.writeAvailableByte(object, (byte) ((oldValue & ~MARK_COUNT_MASK) | markState));\n return true;\n}\n"
|
"public void execute() {\n transStart(NAME);\n CrosstabReportItemHandle reportHandle = childViewHandle.getCrosstab();\n try {\n reportHandle.pivotDimension(childViewHandle.getAxisType(), childViewHandle.getIndex(), getType(), findPosition());\n if (bool) {\n CrosstabAdaptUtil.removeInvalidBindings(reportHandle);\n }\n } catch (SemanticException e) {\n rollBack();\n ExceptionHandler.handle(e);\n }\n transEnd();\n}\n"
|
"public void generate(URL input, File outFile) throws IOException {\n InputStreamReader fr = getStream(input);\n FileWriter out = new FileWriter(outFile);\n FileWriter out1 = new FileWriter(temp1);\n FileWriter out2 = new FileWriter(temp2);\n FileWriter out3 = new FileWriter(temp3);\n ParserDelegator pd = new ParserDelegator();\n HTMLCallback cb = callbackFactory.createCallback(input, out1, out2, out3);\n pd.parse(fr, cb, ignoreCharset);\n out1.close();\n out2.close();\n out3.close();\n out.write(\"String_Node_Str\" + input + \"String_Node_Str\");\n writeRegion(out, \"String_Node_Str\", temp2);\n writeRegion(out, \"String_Node_Str\", temp1);\n out.write(\"String_Node_Str\");\n writeRegion(out, \"String_Node_Str\", temp3);\n out.write(\"String_Node_Str\");\n generateTrailer(out, cb);\n out.close();\n}\n"
|
"private synchronized void connectToHub() {\n disconnectFromHub();\n final String host = getThing().getProperties().get(HarmonyHubBindingConstants.HUB_PROPERTY_HOST);\n final String accountId = getThing().getProperties().get(HarmonyHubBindingConstants.HUB_PROPERTY_ACCOUNTID);\n final String sessionId = getThing().getProperties().get(HarmonyHubBindingConstants.HUB_PROPERTY_SESSIONID);\n if (host == null || accountId == null || sessionId == null) {\n logger.error(\"String_Node_Str\", host, accountId, sessionId);\n return;\n }\n client = HarmonyClient.getInstance();\n client.addListener(this);\n try {\n logger.debug(\"String_Node_Str\", host, sessionId, accountId);\n client.connect(host, new LoginToken(accountId, sessionId));\n heartBeatJob = scheduler.scheduleAtFixedRate(new Runnable() {\n public void run() {\n try {\n client.sendPing();\n } catch (Exception e) {\n logger.error(\"String_Node_Str\" + host, e);\n setOfflineAndReconnect();\n }\n }\n }, heartBeatInterval, heartBeatInterval, TimeUnit.SECONDS);\n updateStatus(ThingStatus.ONLINE);\n buildChannel();\n } catch (Exception e) {\n logger.error(\"String_Node_Str\" + host, e);\n setOfflineAndReconnect();\n }\n}\n"
|
"public synchronized Object processAdd(Object data) {\n Long value = (Long) data;\n for (Iterator<Long> iterator = minDeque.descendingIterator(); iterator.hasNext(); ) {\n if (iterator.next() > value) {\n iterator.remove();\n }\n }\n minDeque.addLast(value);\n if (minValue == null || minValue > value) {\n minValue = value;\n }\n return minValue;\n}\n"
|
"private static String getUrl(String site) {\n MCBouncer.log.debug(\"String_Node_Str\" + site);\n try {\n URL url = new URL(site.toString());\n BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));\n String inputLine, result = \"String_Node_Str\";\n while ((inputLine = in.readLine()) != null) {\n result = result.concat(inputLine);\n }\n in.close();\n return result;\n } catch (IOException e) {\n e.printStackTrace();\n return \"String_Node_Str\";\n }\n}\n"
|
"private void notifyRevenueAdapter(final int revenue, final boolean finalResult) {\n String modifier;\n if (finalResult)\n modifier = \"String_Node_Str\";\n else\n modifier = \"String_Node_Str\";\n log.info(\"String_Node_Str\" + modifier + \"String_Node_Str\" + revenue + \"String_Node_Str\" + getStatistics());\n revenueAdapter.notifyRevenueListener(revenue, finalResult);\n}\n"
|
"public void replacePrevPos(long newValue) {\n checkValueForPut(newValue);\n long prevPos = stepBack(searchState.searchPos);\n long oldEntry = bytes.readLong(prevPos);\n long oldValue = value(oldEntry);\n positions.clear(oldValue);\n positions.set(newValue);\n bytes.writeLong(prevPos, entry(searchHash, newValue));\n}\n"
|
"public Object get(String arg0, Scriptable scope) {\n try {\n return it.getValue(arg0);\n } catch (BirtException e) {\n return null;\n }\n}\n"
|
"public void fire() throws IllegalActionException {\n _delay = -1.0;\n if (input.hasToken(0)) {\n _currentInput = input.get(0);\n double delayValue = ((DoubleToken) _currentInput).doubleValue();\n if (delayValue < 0) {\n throw new IllegalActionException(\"String_Node_Str\");\n } else {\n _delay = delayValue;\n }\n } else {\n _currentInput = null;\n }\n Time currentTime = getDirector().getModelTime();\n _currentOutput = null;\n if (_delayedOutputTokens.size() > 0) {\n TimedEvent earliestEvent = (TimedEvent) _delayedOutputTokens.get();\n Time eventTime = earliestEvent.timeStamp;\n if (eventTime.equals(currentTime)) {\n _currentOutput = (Token) earliestEvent.contents;\n output.send(0, value.getToken());\n return;\n } else {\n }\n }\n if (_delay == 0.0) {\n output.send(0, value.getToken());\n _currentInput = null;\n }\n}\n"
|
"private boolean _setLocation(double[] location) throws IllegalActionException {\n if (_location != null) {\n if (_location.length == location.length) {\n boolean match = true;\n for (int i = 0; i < location.length; i++) {\n if (_location[i] != location[i]) {\n match = false;\n break;\n }\n }\n if (match) {\n return false;\n }\n } else {\n _location = new double[location.length];\n }\n } else {\n _location = new double[location.length];\n }\n if (location != null) {\n for (int i = 0; i < location.length; i++) {\n _location[i] = location[i];\n }\n }\n NamedObj container = getContainer();\n if (container != null) {\n container.attributeChanged(this);\n }\n if (_valueListeners != null) {\n Iterator listeners = _valueListeners.iterator();\n while (listeners.hasNext()) {\n ValueListener listener = (ValueListener) listeners.next();\n listener.valueChanged(this);\n }\n }\n return true;\n}\n"
|
"public void onClick(View v) {\n AlertDialog.Builder builder = new AlertDialog.Builder(context);\n final SeekBar seekBar2 = new SeekBar(context);\n seekBar2.setMax(30);\n seekBar2.setProgress(width);\n seekBar2.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {\n public void onProgressChanged(SeekBar seekBar2, int n, boolean bl) {\n }\n public void onStartTrackingTouch(SeekBar arg0) {\n }\n public void onStopTrackingTouch(SeekBar arg0) {\n }\n });\n builder.setNeutralButton(Common.dialog_default, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n width = 2;\n }\n });\n builder.setPositiveButton(Common.dialog_done, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n width = seekBar2.getProgress();\n }\n });\n builder.setView((View) seekBar2);\n builder.show();\n}\n"
|
"private <ID extends Serializable> ResourceSupport findRelInternal(HttpServletRequest request, String apiCategory, String model, ID uuid, String rel, Pageable page, PagedResourcesAssembler assembler, String projection) {\n checkModelPluralForm(apiCategory, model);\n DSpaceRestRepository<RestAddressableModel, ID> repository = utils.getResourceRepository(apiCategory, model);\n Class<RestAddressableModel> domainClass = repository.getDomainClass();\n LinkRest linkRest = utils.getLinkRest(rel, domainClass);\n PagedResources<? extends HALResource> result;\n if (linkRest != null) {\n LinkRestRepository linkRepository = utils.getLinkResourceRepository(apiCategory, model, linkRest.name());\n Method linkMethod = repositoryUtils.getLinkMethod(linkRest.method(), linkRepository);\n if (linkMethod == null) {\n throw new RuntimeException(\"String_Node_Str\" + rel + \"String_Node_Str\" + linkRest.name() + \"String_Node_Str\" + linkRest.method());\n } else {\n try {\n if (Page.class.isAssignableFrom(linkMethod.getReturnType())) {\n Page<? extends RestModel> pageResult = (Page<? extends RestAddressableModel>) linkMethod.invoke(linkRepository, request, uuid, page, projection);\n Link link = linkTo(this.getClass(), apiCategory, model).slash(uuid).slash(rel).withSelfRel();\n Page<HALResource> halResources = pageResult.map(linkRepository::wrapResource);\n halResources.forEach(linkService::addLinks);\n return assembler.toResource(halResources, link);\n } else {\n RestModel object = (RestModel) linkMethod.invoke(linkRepository, request, uuid, page, projection);\n Link link = linkTo(this.getClass(), apiCategory, model).slash(uuid).slash(rel).withSelfRel();\n HALResource tmpresult = linkRepository.wrapResource(object);\n tmpresult.add(link);\n return tmpresult;\n }\n } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {\n throw new RuntimeException(e.getMessage(), e);\n }\n }\n }\n RestAddressableModel modelObject = repository.findOne(uuid);\n DSpaceResource resource = repository.wrapResource(modelObject, rel);\n linkService.addLinks(resource);\n if (resource.getLink(rel) == null) {\n throw new ResourceNotFoundException(rel + \"String_Node_Str\" + model);\n } else if (resource.getEmbeddedResources().get(rel) instanceof EmbeddedPage) {\n EmbeddedPage ep = (EmbeddedPage) resource.getEmbeddedResources().get(rel);\n List<? extends RestAddressableModel> fullList = ep.getFullList();\n if (fullList == null || fullList.size() == 0) {\n return null;\n }\n int start = page.getOffset();\n int end = (start + page.getPageSize()) > fullList.size() ? fullList.size() : (start + page.getPageSize());\n DSpaceRestRepository<RestAddressableModel, ?> resourceRepository = utils.getResourceRepository(fullList.get(0).getCategory(), fullList.get(0).getType());\n PageImpl<RestAddressableModel> pageResult = new PageImpl(fullList.subList(start, end), page, fullList.size());\n result = assembler.toResource(pageResult.map(resourceRepository::wrapResource));\n for (Resource subObj : result) {\n if (subObj.getContent() instanceof HALResource) {\n linkService.addLinks((HALResource) subObj.getContent());\n }\n }\n return result;\n } else {\n return (ResourceSupport) resource.getEmbeddedResources().get(rel);\n }\n}\n"
|
"public void I_send_the_HTTP_request(String method, String url) throws Throwable {\n int pathLength = 0;\n if (this.contextPath.length() > 0) {\n pathLength += this.contextPath.length();\n }\n if (this.servletPath.length() > 0) {\n pathLength += this.servletPath.length() + 1;\n }\n request = new MockHttpServletRequest(this.wac.getServletContext(), method, url);\n request.setContextPath(this.contextPath);\n request.setServletPath(this.servletPath);\n request.addHeader(\"String_Node_Str\", host);\n for (HTTPHeader header : headers) {\n request.addHeader(header.name, header.value);\n }\n for (HTTPParam param : queryParams) {\n request.addParameter(param.name, param.value);\n }\n request.setPathInfo(url.substring(pathLength));\n chain = this.hm.getHandler(request);\n}\n"
|
"protected static String ingestJson(ObjectNode jsonInput) {\n if (jsonInput == null) {\n return null;\n }\n ArrayNode conns = null;\n JsonNode valueNode;\n if ((valueNode = jsonInput.get(\"String_Node_Str\")) != null && valueNode.isArray()) {\n conns = (ArrayNode) valueNode;\n }\n ObjectNode json = null;\n if (conns != null) {\n for (int ii = 0; ii < conns.size(); ii++) {\n json = (ObjectNode) conns.get(ii);\n JsonNode value;\n if ((value = json.get(\"String_Node_Str\")) != null && value.isTextual() && value.asText().equals(\"String_Node_Str\")) {\n break;\n }\n }\n } else {\n json = jsonInput;\n }\n String result = null;\n if (json != null) {\n if ((valueNode = json.get(\"String_Node_Str\")) != null && valueNode.isTextual()) {\n result = valueNode.asText();\n }\n if ((valueNode = json.get(\"String_Node_Str\")) != null && valueNode.isTextual()) {\n JMS_CONN_FACTORY = valueNode.asText();\n }\n if ((valueNode = json.get(\"String_Node_Str\")) != null && valueNode.isTextual()) {\n JMS_CTX_FACTORY = valueNode.asText();\n }\n if ((valueNode = json.get(\"String_Node_Str\")) != null && valueNode.isTextual()) {\n JMS_PASSWORD = valueNode.asText();\n }\n if ((valueNode = json.get(\"String_Node_Str\")) != null && valueNode.isTextual()) {\n JMS_USERNAME = valueNode.asText();\n }\n if ((valueNode = json.get(\"String_Node_Str\")) != null && valueNode.isTextual()) {\n JMS_TOPIC = valueNode.asText();\n }\n }\n return result;\n}\n"
|
"public boolean requestNewReceivingAddress(int hdAccountId) {\n int issuedIndex = this.issuedIndex(hdAccountId, AbstractHD.PathType.EXTERNAL_ROOT_PATH);\n final boolean[] result = { false };\n if (issuedIndex >= HDAccount.MaxUnusedNewAddressCount - 2) {\n String sql = \"String_Node_Str\" + \"String_Node_Str\";\n this.execQueryOneRecord(sql, new String[] { Integer.toString(hdAccountId), Integer.toString(issuedIndex - HDAccount.MaxUnusedNewAddressCount + 1), \"String_Node_Str\" }, new Function<ICursor, Void>() {\n public Void apply(ICursor c) {\n result[0] = c.getInt(0) > 0;\n return null;\n }\n });\n } else {\n result[0] = true;\n }\n if (result[0]) {\n this.updateIssuedIndex(hdAccountId, AbstractHD.PathType.EXTERNAL_ROOT_PATH, issuedIndex + 1);\n }\n return result[0];\n}\n"
|
"public void onLocationChanged(Location location) {\n mLocation = location;\n if (mLocation != null) {\n String[] args = { mLocation.getProvider(), truncateDouble(mLocation.getAccuracy()) };\n mLocationDialog.setMessage(StringUtils.getStringRobust(this, R.string.location_provider_accuracy, args));\n if (mLocation.getAccuracy() <= GeoUtils.GOOD_ACCURACY) {\n returnLocation();\n }\n mLocationDialog.setLocationFound(mLocation.getAccuracy() < GeoUtils.ACCEPTABLE_ACCURACY || mTimer.getMillisUntilFinished() == 0);\n }\n}\n"
|
"public IQueryResults executeQuery(IQueryDefinition queryDefn, Iterator paramBindingIt, Iterator filterIt, Iterator bindingIt) throws BirtException {\n return new QueryExecutionHelper(this.dataEngine, this.modelAdaptor, this.sessionContext).executeQuery(queryDefn, paramBindingIt, filterIt, bindingIt, this.sessionContext.getTopScope());\n}\n"
|
"public boolean reset() {\n boolean ok = super.reset();\n for (int i = 1; i <= 9; i++) {\n this.valueToFreq.put(String.valueOf(i), 0L);\n }\n return ok;\n}\n"
|
"public String getClassName(String jsonKey) {\n String result = toCamelCase(jsonKey);\n return StringUtils.capitalize(result);\n}\n"
|
"private void _removeEditorIcons() {\n for (Object editorIconObject : attributeList(EditorIcon.class)) {\n EditorIcon editorIcon = (EditorIcon) editorIconObject;\n String moml = \"String_Node_Str\" + editorIcon.getName() + \"String_Node_Str\";\n MoMLChangeRequest request = new MoMLChangeRequest(this, AtomicActorMatcher.this, moml);\n request.execute();\n }\n}\n"
|
"public boolean onCreateOptionsMenu(final Menu menu) {\n final RedditSubredditSubscriptionManager.SubredditSubscriptionState subredditSubscriptionState;\n final RedditSubredditSubscriptionManager subredditSubscriptionManager = RedditSubredditSubscriptionManager.getSingleton(this, user);\n if (!user.isAnonymous() && subreddit.isSubscribable() && subredditSubscriptionManager.areSubscriptionsReady()) {\n try {\n subredditSubscriptionState = subredditSubscriptionManager.getSubscriptionState(subreddit.getCanonicalName());\n } catch (RedditSubreddit.InvalidSubredditNameException e) {\n throw new UnexpectedInternalStateException(\"String_Node_Str\");\n }\n } else {\n subredditSubscriptionState = null;\n }\n OptionsMenuUtility.prepare(this, menu, false, true, false, subreddit.isSortable(), false, subredditSubscriptionState);\n return true;\n}\n"
|
"public void startEditing(final GridCell cell) {\n if (editable && getEditableGrid() != null && getEditableGrid().isAttached() && cell != null) {\n ColumnConfig<M, ?> c = columnModel.getColumn(cell.getCol());\n M value = getEditableGrid().getStore().get(cell.getRow());\n if (value != null && getEditor(c) != null) {\n BeforeStartEditEvent<M> ce = new BeforeStartEditEvent<M>(cell);\n fireEvent(ce);\n if (ce.isCancelled()) {\n return;\n }\n IsField<?> field = getEditor(c);\n if (field instanceof PlatypusAdapterField) {\n PlatypusAdapterField<?> af = (PlatypusAdapterField<?>) field;\n af.setValue(null);\n af.setErrorSupport(null);\n af.show();\n } else if (field instanceof Field<?>) {\n Field<?> ff = (Field<?>) field;\n ff.setValue(null, false, true);\n ff.setErrorSupport(null);\n ff.show();\n } else\n throw new IllegalStateException(BAD_EDITOR_FIELD);\n if (getEditableGrid().getSelectionModel() instanceof PlatypusCellSelectionModel) {\n if (GXTLogConfiguration.loggingIsEnabled()) {\n logger.finest(\"String_Node_Str\");\n }\n ((PlatypusCellSelectionModel<?>) getEditableGrid().getSelectionModel()).selectCell(cell.getRow(), cell.getCol(), true);\n }\n Element elem = getEditableGrid().getView().getCell(cell.getRow(), cell.getCol());\n elem.getFirstChildElement().getStyle().setVisibility(Style.Visibility.HIDDEN);\n cancelEditing();\n ignoreScroll = true;\n getEditableGrid().getView().ensureVisible(cell.getRow(), cell.getCol(), true);\n doStartEditing(cell);\n }\n }\n}\n"
|
"static void defineClass(ClassLoader loader, String name, byte[] bytes) {\n try {\n Method defineClass = ClassLoader.class.getDeclaredMethod(\"String_Node_Str\", new Class[] { String.class, bytes.getClass(), int.class, int.class });\n defineClass.setAccessible(true);\n defineClass.invoke(loader, new Object[] { name, bytes, new Integer(0), new Integer(bytes.length) });\n } catch (InvocationTargetException e) {\n if (e.getTargetException() instanceof LinkageError) {\n ;\n } else {\n e.printStackTrace();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n}\n"
|
"public boolean reservationExists(CacheKey key) {\n boolean found = false;\n for (SeatBlock block : reserved) {\n if (block.getKey().getShowId() == key.getShowId()) {\n if (showDao.getSectionIdByRowId(block.getKey().getRowId()) == showDao.getSectionIdByRowId(key.getRowId())) {\n return true;\n }\n }\n }\n return found;\n}\n"
|
"private void doLogging(Level level, String message, Throwable th) {\n String className = null;\n String methodName = null;\n int lineNumber = -1;\n StackTraceElement[] stack = (new Throwable()).getStackTrace();\n int ix = 0;\n while (ix < stack.length) {\n StackTraceElement frame = stack[ix];\n String cname = frame.getClassName();\n if (cname.equals(CLASS_NAME)) {\n break;\n }\n ix++;\n }\n while (ix < stack.length) {\n StackTraceElement frame = stack[ix];\n String cname = frame.getClassName();\n if (!cname.equals(CLASS_NAME)) {\n className = cname;\n methodName = frame.getMethodName();\n lineNumber = frame.getLineNumber();\n break;\n }\n ix++;\n }\n LogRecord logRecord = new LogRecord(theLevel, message);\n logRecord.setLoggerName(logger.getName());\n logRecord.setSourceClassName(className);\n logRecord.setSourceMethodName(methodName);\n logRecord.setThrown(th);\n logRecord.setSequenceNumber(lineNumber);\n logger.log(logRecord);\n}\n"
|
"protected void destroyViewSpecificContent(GL2 gl) {\n if (layoutManager != null)\n layoutManager.destroy(gl);\n}\n"
|
"public int getLength() {\n return getEndOffset() - getStartOffset();\n}\n"
|
"private void restoreState(Bundle savedInstanceState) {\n if (savedInstanceState == null)\n return;\n boolean isInMultiSelectMode = savedInstanceState.getBoolean(BUNDLE_IN_MULTI_SELECT_MODE);\n if (savedInstanceState.containsKey(BUNDLE_CHECKED_STATES)) {\n mCheckedItems.addAll(savedInstanceState.getStringArrayList(BUNDLE_CHECKED_STATES));\n if (isInMultiSelectMode) {\n mListener.onMultiSelectChange(mCheckedItems.size());\n onMultiSelectChange(mCheckedItems.size());\n }\n mGridView.setMultiSelectModeEnabled(isInMultiSelectMode);\n }\n mSavedFirstVisiblePosition = savedInstanceState.getInt(BUNDLE_SCROLL_POSITION, 0);\n mHasRetrievedAllMedia = savedInstanceState.getBoolean(BUNDLE_HAS_RETREIEVED_ALL_MEDIA, false);\n}\n"
|
"public static final List<PatientIdentifierType> GLOBAL_PROPERTY_PREFERRED_IDENTIFIER_TYPES() {\n String propertyValue = Context.getAdministrationService().getGlobalProperty(\"String_Node_Str\");\n List<PatientIdentifierType> pits = new ArrayList<PatientIdentifierType>();\n if (StringUtils.hasText(propertyValue)) {\n for (String s : propertyValue.split(\"String_Node_Str\")) {\n pits.add(Context.getPatientService().getPatientIdentifierTypeByName(s));\n }\n }\n return pits;\n}\n"
|
"public Set<A> getTakeable() {\n Set<A> as = new HashSet<>(this.actions);\n if (as.size() != this.actions.size()) {\n throw new RuntimeException(\"String_Node_Str\" + this.actions + \"String_Node_Str\");\n }\n return as;\n}\n"
|
"public boolean filter(Executable elem) throws Exception {\n Executable equivalentMethod = null;\n sd = (SymbolType) expression.getScope().getSymbolData();\n if (sd == null) {\n expression.getScope().accept(typeResolver, ctx);\n sd = (SymbolType) expression.getScope().getSymbolData();\n if (!expression.getIdentifier().equals(\"String_Node_Str\")) {\n if (methodsArray == null) {\n Set<Method> methods = MethodInspector.getVisibleMethods(sd.getClazz(), thisClass);\n methodsArray = new Method[methods.size()];\n methods.toArray(methodsArray);\n ExecutableSorter<Method> sorter = new ExecutableSorter<Method>();\n List<Method> sortedMethods = sorter.sort(methodsArray, null);\n sortedMethods.toArray(methodsArray);\n }\n ArrayFilter<Method> filter = new ArrayFilter<Method>(methodsArray);\n filter.appendPredicate(new MethodsByNamePredicate(expression.getIdentifier()));\n methodCallCandidates = filter.filter();\n }\n }\n boolean found = false;\n if (!expression.getIdentifier().equals(\"String_Node_Str\")) {\n Iterator<Method> it = methodCallCandidates.iterator();\n while (it.hasNext() && !found) {\n Method md = it.next();\n int mdParameterCount = md.getParameterTypes().length;\n int elemParameterCount = elem.getParameterTypes().length;\n Map<String, SymbolType> typeMapping = getTypeMapping();\n FunctionalGenericsBuilder<MethodReferenceExpr> builder = new FunctionalGenericsBuilder<MethodReferenceExpr>(md, typeResolver, typeMapping);\n builder.build(expression);\n SymbolType[] args = builder.getArgs();\n if (!Modifier.isStatic(md.getModifiers())) {\n if (mdParameterCount == elemParameterCount - 1) {\n Type[] genericParameterTypes = elem.getGenericParameterTypes();\n SymbolType[] genericArgs = new SymbolType[genericParameterTypes.length];\n boolean allAreGenerics = true;\n for (int i = 0; i < genericParameterTypes.length && allAreGenerics; i++) {\n if (genericParameterTypes[i] instanceof TypeVariable<?>) {\n TypeVariable<?> td = (TypeVariable<?>) genericParameterTypes[i];\n genericArgs[i] = typeMapping.get(td.getName());\n allAreGenerics = genericArgs[i] != null;\n } else {\n allAreGenerics = false;\n }\n }\n if (allAreGenerics) {\n setTypeArgs(genericArgs);\n found = super.filter(elem);\n } else {\n SymbolType[] staticArgs = new SymbolType[args.length + 1];\n for (int i = 0; i < args.length; i++) {\n staticArgs[i + 1] = args[i];\n }\n staticArgs[0] = (SymbolType) sd;\n args = staticArgs;\n setTypeArgs(args);\n found = super.filter(elem);\n }\n } else {\n Expression scope = expression.getScope();\n SymbolType stype = (SymbolType) scope.getSymbolData();\n boolean isField = stype.getField() != null;\n boolean isVariable = false;\n boolean isSuper = scope instanceof SuperExpr;\n if (!isField && !isSuper) {\n String name = scope.toString();\n isVariable = (symTable.findSymbol(name, ReferenceType.VARIABLE) != null);\n }\n if ((isField || isVariable) && mdParameterCount == elemParameterCount) {\n setTypeArgs(args);\n found = super.filter(elem);\n }\n }\n } else if (mdParameterCount == elemParameterCount) {\n setTypeArgs(args);\n found = super.filter(elem);\n }\n if (found) {\n equivalentMethod = md;\n }\n }\n } else {\n Constructor<?>[] constructors = sd.getClazz().getDeclaredConstructors();\n for (int i = 0; i < constructors.length && !found; i++) {\n FunctionalGenericsBuilder<MethodReferenceExpr> builder = new FunctionalGenericsBuilder<MethodReferenceExpr>(constructors[i], typeResolver, getTypeMapping());\n builder.build(expression);\n SymbolType[] args = builder.getArgs();\n setTypeArgs(args);\n found = super.filter(elem);\n if (found) {\n equivalentMethod = constructors[i];\n }\n }\n }\n if (found && elem instanceof Method) {\n Map<String, SymbolType> mapping = getTypeMapping();\n SymbolType realResultType = null;\n if (equivalentMethod instanceof Method) {\n realResultType = SymbolType.valueOf((Method) equivalentMethod, mapping);\n java.lang.reflect.Type genericReturnType = ((Method) elem).getGenericReturnType();\n resolveTypeMapping(genericReturnType, realResultType, mapping);\n }\n realResultType = SymbolType.valueOf(elem.getDeclaringClass(), mapping);\n expression.setSymbolData(realResultType);\n SymbolType st = SymbolType.valueOf((Method) elem, mapping);\n expression.setReferencedMethodSymbolData(st);\n expression.setReferencedArgsSymbolData(getTypeArgs());\n }\n return found;\n}\n"
|
"public List<RestrictionEffect> getApplicableRestrictionEffects(Permanent permanent, Game game) {\n List<RestrictionEffect> effects = new ArrayList<RestrictionEffect>();\n for (RestrictionEffect effect : restrictionEffects) {\n Ability ability = restrictionEffects.getAbility(effect.getId());\n if (!(ability instanceof StaticAbility) || ability.isInUseableZone(game, permanent, false)) {\n if (effect.applies(permanent, ability, game))\n effects.add(effect);\n }\n }\n return effects;\n}\n"
|
"public void drawTextureBordered(TextureRegion texture, Rect2i region, Border border, boolean tile, float ux, float uy, float uw, float uh, float alpha) {\n if (!texture.getTexture().isLoaded()) {\n return;\n }\n if (!currentTextureCropRegion.equals(requestedCropRegion) && !(currentTextureCropRegion.contains(region) && requestedCropRegion.contains(region))) {\n textureMat.setFloat4(CROPPING_BOUNDARIES_PARAM, requestedCropRegion.minX(), requestedCropRegion.maxX(), requestedCropRegion.minY(), requestedCropRegion.maxY());\n currentTextureCropRegion = requestedCropRegion;\n }\n Vector2i textureSize = new Vector2i(TeraMath.ceilToInt(texture.getWidth() * uw), TeraMath.ceilToInt(texture.getHeight() * uh));\n TextureCacheKey key = new TextureCacheKey(textureSize, region.size(), border, tile);\n usedTextures.add(key);\n Mesh mesh = cachedTextures.get(key);\n if (mesh == null || mesh.isDisposed()) {\n MeshBuilder builder = new MeshBuilder();\n float topTex = (float) border.getTop() / textureSize.y;\n float leftTex = (float) border.getLeft() / textureSize.x;\n float bottomTex = 1f - (float) border.getBottom() / textureSize.y;\n float rightTex = 1f - (float) border.getRight() / textureSize.x;\n int centerHoriz = region.width() - border.getTotalWidth();\n int centerVert = region.height() - border.getTotalHeight();\n float top = (float) border.getTop() / region.height();\n float left = (float) border.getLeft() / region.width();\n float bottom = 1f - (float) border.getBottom() / region.height();\n float right = 1f - (float) border.getRight() / region.width();\n if (border.getTop() != 0) {\n if (border.getLeft() != 0) {\n addRectPoly(builder, 0, 0, left, top, 0, 0, leftTex, topTex);\n }\n if (tile) {\n addTiles(builder, Rect2i.createFromMinAndSize(border.getLeft(), 0, centerHoriz, border.getTop()), Rect2f.createFromMinAndMax(left, 0, right, top), new Vector2i(textureSize.x - border.getTotalWidth(), border.getTop()), Rect2f.createFromMinAndMax(leftTex, 0, rightTex, topTex));\n } else {\n addRectPoly(builder, left, 0, right, top, leftTex, 0, rightTex, topTex);\n }\n if (border.getRight() != 0) {\n addRectPoly(builder, right, 0, 1, top, rightTex, 0, 1, topTex);\n }\n }\n if (border.getLeft() != 0) {\n if (tile) {\n addTiles(builder, Rect2i.createFromMinAndSize(0, border.getTop(), border.getLeft(), centerVert), Rect2f.createFromMinAndMax(0, top, left, bottom), new Vector2i(border.getLeft(), textureSize.y - border.getTotalHeight()), Rect2f.createFromMinAndMax(0, topTex, leftTex, bottomTex));\n } else {\n addRectPoly(builder, 0, top, left, bottom, 0, topTex, leftTex, bottomTex);\n }\n }\n if (tile) {\n addTiles(builder, Rect2i.createFromMinAndSize(border.getLeft(), border.getTop(), centerHoriz, centerVert), Rect2f.createFromMinAndMax(left, top, right, bottom), new Vector2i(textureSize.x - border.getTotalWidth(), textureSize.y - border.getTotalHeight()), Rect2f.createFromMinAndMax(leftTex, topTex, rightTex, bottomTex));\n } else {\n addRectPoly(builder, left, top, right, bottom, leftTex, topTex, rightTex, bottomTex);\n }\n if (border.getRight() != 0) {\n if (tile) {\n addTiles(builder, Rect2i.createFromMinAndSize(region.width() - border.getRight(), border.getTop(), border.getRight(), centerVert), Rect2f.createFromMinAndMax(right, top, 1, bottom), new Vector2i(border.getRight(), textureSize.y - border.getTotalHeight()), Rect2f.createFromMinAndMax(rightTex, topTex, 1, bottomTex));\n } else {\n addRectPoly(builder, right, top, 1, bottom, rightTex, topTex, 1, bottomTex);\n }\n }\n if (border.getBottom() != 0) {\n if (border.getLeft() != 0) {\n addRectPoly(builder, 0, bottom, left, 1, 0, bottomTex, leftTex, 1);\n }\n if (tile) {\n addTiles(builder, Rect2i.createFromMinAndSize(border.getLeft(), region.height() - border.getBottom(), centerHoriz, border.getBottom()), Rect2f.createFromMinAndMax(left, bottom, right, 1), new Vector2i(textureSize.x - border.getTotalWidth(), border.getBottom()), Rect2f.createFromMinAndMax(leftTex, bottomTex, rightTex, 1));\n } else {\n addRectPoly(builder, left, bottom, right, 1, leftTex, bottomTex, rightTex, 1);\n }\n if (border.getRight() != 0) {\n addRectPoly(builder, right, bottom, 1, 1, rightTex, bottomTex, 1, 1);\n }\n }\n mesh = builder.build();\n cachedTextures.put(key, mesh);\n }\n textureMat.setFloat2(\"String_Node_Str\", region.width(), region.height());\n textureMat.setFloat2(\"String_Node_Str\", region.minX(), region.minY());\n Rect2f textureArea = texture.getRegion();\n textureMat.setFloat2(\"String_Node_Str\", textureArea.minX() + ux * textureArea.width(), textureArea.minY() + uy * textureArea.height());\n textureMat.setFloat2(\"String_Node_Str\", uw * textureArea.width(), uh * textureArea.height());\n textureMat.setTexture(\"String_Node_Str\", texture.getTexture());\n textureMat.setFloat4(\"String_Node_Str\", 1, 1, 1, alpha);\n textureMat.bindTextures();\n mesh.render();\n}\n"
|
"public void reloadAudioSettings() {\n readPersistedSettings();\n int numStreamTypes = AudioSystem.getNumStreamTypes();\n for (int streamType = 0; streamType < numStreamTypes; streamType++) {\n VolumeStreamState streamState = mStreamStates[streamType];\n String settingName = System.VOLUME_SETTINGS[STREAM_VOLUME_ALIAS[streamType]];\n String lastAudibleSettingName = settingName + System.APPEND_FOR_LAST_AUDIBLE;\n int index = Settings.System.getInt(mContentResolver, settingName, AudioManager.DEFAULT_STREAM_VOLUME[streamType]);\n if (STREAM_VOLUME_ALIAS[streamType] != streamType) {\n index = rescaleIndex(index * 10, STREAM_VOLUME_ALIAS[streamType], streamType);\n } else {\n index *= 10;\n }\n if (streamState.muteCount() != 0 && !isStreamAffectedByMute(streamType)) {\n int size = streamState.mDeathHandlers.size();\n for (int i = 0; i < size; i++) {\n streamState.mDeathHandlers.get(i).mMuteCount = 1;\n streamState.mDeathHandlers.get(i).mute(false);\n }\n }\n if (streamState.muteCount() == 0) {\n setStreamVolumeIndex(streamType, streamState.mIndex);\n }\n }\n setRingerModeInt(getRingerMode(), false);\n}\n"
|
"private void findScrollView(ViewGroup viewGroup) {\n scrollChild = viewGroup;\n if (viewGroup.getChildCount() > 0) {\n int count = viewGroup.getChildCount();\n View child;\n for (int i = 0; i < count; i++) {\n child = viewGroup.getChildAt(i);\n if (child instanceof AbsListView || child instanceof ScrollView || child instanceof ViewPager || child instanceof WebView) {\n scrollChild = child;\n return;\n }\n }\n }\n}\n"
|
"public static IPath getWebContentPath(IProject project) {\n IPath path = null;\n if (project != null && JavaEEProjectUtilities.isDynamicWebProject(project)) {\n IVirtualComponent component = ComponentCore.createComponent(project);\n path = component.getRootFolder().getWorkspaceRelativePath();\n }\n return path;\n}\n"
|
"public List<ExecutableNodeBase> getSources() {\n List<ExecutableNodeBase> ss = new ArrayList<>();\n for (Pair<ExecutableNodeBase, Integer> s : temp) {\n ss.add(s.getKey());\n }\n return ss;\n}\n"
|
"public void remove(String s) throws Exception {\n MaterialData matdat = itemDb.get(s);\n if (isMySQL) {\n MySQLPriceList.RemoveItem(s);\n } else {\n if (NameMap.containsKey(matdat.getItemTypeId() + (double) matdat.getData() / 100)) {\n BuyMap.remove(matdat.getItemTypeId() + (double) matdat.getData() / 100);\n SellMap.remove(matdat.getItemTypeId() + (double) matdat.getData() / 100);\n NameMap.remove(matdat.getItemTypeId() + (double) matdat.getData() / 100);\n }\n } catch (Exception ex) {\n return false;\n }\n}\n"
|
"public void createOnDatabase(AbstractSession session) throws EclipseLinkException {\n if (checkIfExist(session)) {\n if (this.isAlterSupported(session)) {\n alterOnDatabase(session);\n }\n } else {\n super.createOnDatabase(session);\n }\n}\n"
|
"public Rectangle getNodeMarkRectangle() {\n Point nodeLocation;\n nodeLocation = node.getLocation();\n Dimension nodeSize;\n Dimension labelSize;\n Dimension errorNodeSize;\n Dimension progressNodeSize;\n nodeSize = node.getSize();\n Rectangle nodeRectangle = new Rectangle(nodeLocation, nodeSize);\n Rectangle statusRectangle = prepareCleanStatus(nodeLocation, nodeSize);\n labelSize = nodeLabel.getLabelSize();\n errorNodeSize = nodeError.getErrorSize();\n progressNodeSize = nodeProgressBar.getProgressSize();\n Rectangle finalRect;\n finalRect = nodeRectangle.getUnion(statusRectangle);\n finalRect.height += labelSize.height / 2;\n if (node.isErrorFlag()) {\n finalRect.height += errorNodeSize.height;\n }\n if (node.isFileScaleComponent()) {\n finalRect.height += progressNodeSize.height;\n }\n return finalRect;\n}\n"
|
"public void loadEntityCatcher(IBlockAccess world, int x, int y, int z, Block block, RenderBlocks blocks) {\n Tessellator tes = Tessellator.instance;\n Minecraft mc = FMLClientHandler.instance().getClient();\n tes.draw();\n mc.renderEngine.bindTexture(TextureMap.locationItemsTexture);\n tes.startDrawingQuads();\n tes.setNormal(1F, 1F, 0F);\n render.setOverrideBlockTexture(Item.porkRaw.getIconFromDamage(0));\n render.renderCrossedSquares(block, x, y, z);\n render.clearOverrideBlockTexture();\n tes.draw();\n tes.startDrawingQuads();\n mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);\n blocks.renderStandardBlock(block, x, y, z);\n}\n"
|
"public void init(TreeViewer viewer, IStructuredSelection selection) {\n boolean canWork = true;\n if (selection.isEmpty() || (selection.size() > 1)) {\n setEnabled(false);\n return;\n }\n List<RepositoryNode> nodes = selection.toList();\n for (RepositoryNode node : nodes) {\n if ((node.getType() != ENodeType.REPOSITORY_ELEMENT) || (node.getProperties(EProperties.CONTENT_TYPE) != ESBRepositoryNodeType.SERVICES) || (node.getObject() == null) || (ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.DELETED)) {\n canWork = false;\n break;\n } else {\n this.selection = selection;\n }\n }\n setEnabled(canWork);\n}\n"
|
"public void testPuts() throws InterruptedException {\n final String MAP_NAME = \"String_Node_Str\";\n Config config = new Config();\n final TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(1);\n final HazelcastInstance h = factory.newHazelcastInstance(config);\n final IMap<Integer, Long> map = h.getMap(MAP_NAME);\n map.put(0, 10L);\n Assert.assertEquals(148, map.getLocalMapStats().getHeapCost());\n}\n"
|
"private Pair<Unit, Integer> compareUnits(TermField[] terms) {\n Unit unit = terms[0].getParser().getUnit();\n int compatibleNumber = 0;\n for (TermField t : terms) {\n final Unit tp = t.getParser().getUnit();\n if (unit != null && tp != null && unit.isCompatible(tp)) {\n compatibleNumber++;\n }\n if (unit == null) {\n unit = t.getParser().getUnit();\n }\n }\n return new Pair<>(unit == null ? null : unit.getStandardUnit(), compatibleNumber);\n}\n"
|
"private void maintenance() {\n long time = new Date().getTime();\n if (logoutStartedAt != -1 && time > (logoutStartedAt + LOGOUT_TIMEOUT)) {\n finishLogout();\n }\n if (isLoggedIn() && logoutStartedAt == -1 && (time > sessionExpireDate.getTime() || (sessionExpireDate.getTime() - time > SESSION_LENGTH))) {\n logoutStartedAt = new Date().getTime();\n CommCareApplication._().logout();\n showLoggedOutNotification();\n }\n}\n"
|
"public byte[] getRawSoundData() {\n List<SoundStreamBlockTag> blocks = getBlocks();\n for (SoundStreamBlockTag block : blocks) {\n if (streamSoundCompression == SoundFormat.FORMAT_MP3) {\n ret.add(Arrays.copyOfRange(block.streamSoundData, 4, block.streamSoundData.length));\n } else {\n ret.add(block.streamSoundData);\n }\n } catch (IOException ex) {\n return null;\n }\n return baos.toByteArray();\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.