content stringlengths 40 137k |
|---|
"public String toString() {\n return lexicalTransition.to.id + \"String_Node_Str\" + (surface.isEmpty() ? \"String_Node_Str\" : surface);\n}\n"
|
"public void add(Reader in) throws IOException, ParseException {\n LineNumberReader br = new LineNumberReader(in);\n StringBuffer newBr = new StringBuffer();\n String line = null;\n String[] parts;\n try {\n while ((line = br.readLine()) != null) {\n if (line.length() == 0 || line.charAt(0) == '#') {\n continue;\n }\n String[] sides = line.split(\"String_Node_Str\");\n if (sides.length > 1) {\n String[] names = getNames(sides[1]);\n parts = AuthorUtils.splitName(sides[0]);\n if (isLongForm(parts) && containsLongForm(names) > 0) {\n newBr.append(escape(makeShortForm(parts)) + \"String_Node_Str\" + sides[0] + \"String_Node_Str\" + buildLine(names));\n newBr.append(\"String_Node_Str\");\n }\n } else {\n String[] names = getNames(sides[0]);\n if (containsLongForm(names) > 1) {\n String newLine = buildLine(names);\n for (int i = 0; i < names.length; i++) {\n parts = names[i].split(\"String_Node_Str\");\n if (isLongForm(parts)) {\n newBr.append(escape(makeShortForm(parts)) + \"String_Node_Str\" + newLine);\n newBr.append(\"String_Node_Str\");\n }\n }\n }\n }\n }\n } catch (IllegalArgumentException e) {\n ParseException ex = new ParseException(\"String_Node_Str\" + br.getLineNumber(), 0);\n ex.initCause(e);\n throw ex;\n } finally {\n br.close();\n }\n super.add(new InputStreamReader(new ByteArrayInputStream(newBr.toString().getBytes()), Charset.forName(\"String_Node_Str\").newDecoder()));\n}\n"
|
"public static Map<CtVariableAccess, CtVariableReference> convertIngredient(VarMapping varMapping, Map<String, CtVariable> mapToFollow) {\n Map<CtVariableAccess, CtVariableReference> originalMap = new HashMap<>();\n Map<VarWrapper, List<CtVariable>> mappedVars = varMapping.getMappedVariables();\n for (VarWrapper var : mappedVars.keySet()) {\n CtVariable varNew = mapToFollow.get(var.getVar().getVariable().getSimpleName());\n CtVariableReference newVarReference = varNew.getReference();\n CtVariableAccess originalVarAccessDestination = var.getVar();\n CtVariableAccess newVarAccessDestination = null;\n if (newVarReference instanceof CtLocalVariableReference || newVarReference instanceof CtParameterReference) {\n if (originalVarAccessDestination instanceof CtFieldWrite || originalVarAccessDestination instanceof CtVariableWrite) {\n newVarAccessDestination = MutationSupporter.getFactory().Core().createVariableWrite();\n newVarAccessDestination.setVariable(newVarReference);\n } else {\n newVarAccessDestination = MutationSupporter.getFactory().Code().createVariableRead(newVarReference, varNew.hasModifier(ModifierKind.STATIC));\n }\n } else if (newVarReference instanceof CtFieldReference) {\n if (originalVarAccessDestination instanceof CtFieldWrite<?> || originalVarAccessDestination instanceof CtFieldRead<?>) {\n newVarAccessDestination = MutationSupporter.getFactory().Core().createFieldWrite();\n } else {\n newVarAccessDestination = MutationSupporter.getFactory().Core().createFieldRead();\n }\n newVarAccessDestination.setVariable(newVarReference);\n }\n if (newVarAccessDestination != null) {\n originalMap.put(new VarAccessWrapper(newVarAccessDestination), originalVarAccessDestination);\n originalVarAccessDestination.replace(newVarAccessDestination);\n } else {\n logger.error(\"String_Node_Str\");\n }\n }\n return originalMap;\n}\n"
|
"public boolean applies(GameEvent event, Ability source, Game game) {\n Permanent permanent = game.getPermanent(event.getTargetId());\n if (permanent == null) {\n permanent = game.getPermanentEntering(event.getTargetId());\n }\n return permanent != null && permanent.getControllerId().equals(source.getControllerId()) && !landPlayed;\n}\n"
|
"private int extractRecursive(FSEntry rec, File outDir, ProgressMonitor progressDialog, ObjectContainer<Boolean> overwriteAll, boolean dataFork, boolean resourceFork) {\n if (!dataFork && !resourceFork) {\n throw new IllegalArgumentException(\"String_Node_Str\");\n if (progressDialog.cancelSignaled()) {\n progressDialog.confirmCancel();\n return 0;\n }\n int errorCount = 0;\n if (!outDir.exists()) {\n String[] options = new String[] { \"String_Node_Str\", \"String_Node_Str\" };\n int reply = JOptionPane.showOptionDialog(this, \"String_Node_Str\" + outDir.getAbsolutePath() + \"String_Node_Str\" + \"String_Node_Str\", \"String_Node_Str\", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[0]);\n if (reply != 0) {\n ++errorCount;\n progressDialog.signalCancel();\n return errorCount;\n } else {\n if (!outDir.mkdirs()) {\n JOptionPane.showMessageDialog(this, \"String_Node_Str\" + outDir.getAbsolutePath() + \"String_Node_Str\", \"String_Node_Str\", JOptionPane.ERROR_MESSAGE);\n ++errorCount;\n progressDialog.signalCancel();\n return errorCount;\n }\n }\n }\n if (rec instanceof FSFile) {\n if (dataFork)\n errorCount += extractFile((FSFile) rec, outDir, progressDialog, overwriteAll, false);\n if (resourceFork)\n errorCount += extractFile((FSFile) rec, outDir, progressDialog, overwriteAll, true);\n } else if (rec instanceof FSFolder) {\n String dirName = rec.getName();\n progressDialog.updateCurrentDir(dirName);\n FSEntry[] contents = ((FSFolder) rec).list();\n File thisDir = new File(outDir, dirName);\n if (!overwriteAll.o && thisDir.exists()) {\n String[] options = new String[] { \"String_Node_Str\", \"String_Node_Str\" };\n int reply = JOptionPane.showOptionDialog(this, \"String_Node_Str\" + thisDir.getAbsolutePath() + \"String_Node_Str\" + \"String_Node_Str\", \"String_Node_Str\", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[0]);\n if (reply != 0) {\n ++errorCount;\n progressDialog.signalCancel();\n return errorCount;\n }\n }\n if (thisDir.mkdir() || thisDir.exists()) {\n for (FSEntry outRec : contents) {\n errorCount += extractRecursive(outRec, thisDir, progressDialog, overwriteAll, dataFork, resourceFork);\n }\n } else {\n int reply = JOptionPane.showConfirmDialog(this, \"String_Node_Str\" + thisDir.getAbsolutePath() + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\", \"String_Node_Str\", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE);\n if (reply == JOptionPane.NO_OPTION)\n progressDialog.signalCancel();\n ++errorCount;\n }\n }\n return errorCount;\n}\n"
|
"private TreeOperation handleBackspaceOrDeleteKeyOnEmptyTexts(boolean isBackspace, Node node, List<Integer> path, Node rightParagraph, Node leftParagraph) {\n org.xwiki.gwt.dom.client.Document document = getTextArea().getDocument();\n Range range = document.createRange();\n if (isBackspace) {\n range.setStart(document.getBody().getFirstChild(), 0);\n range.setEndBefore(node);\n } else {\n range.setStartAfter(node);\n Node lastChild = document.getBody().getLastChild();\n range.setEnd(lastChild, lastChild.getChildCount());\n }\n TreeOperation op = null;\n List<Text> nonEmptyTextNodes = getNonEmptyTextNodes(range);\n if (nonEmptyTextNodes.size() > 0) {\n int idx = isBackspace ? nonEmptyTextNodes.size() - 1 : 0;\n Node prevNonEmptyTextNode = nonEmptyTextNodes.get(idx);\n log.fine(\"String_Node_Str\" + prevNonEmptyTextNode.getNodeValue());\n if (node.getParentNode() == prevNonEmptyTextNode.getParentNode()) {\n int deletePos = isBackspace ? prevNonEmptyTextNode.getNodeValue().length() - 1 : 0;\n op = new TreeDeleteText(clientJupiter.getSiteId(), deletePos, TreeHelper.toIntArray(path));\n } else {\n if ((isBackspace && leftParagraph != null) || (!isBackspace && rightParagraph != null)) {\n int lBbrCount = Element.as(leftParagraph).getElementsByTagName(BR).getLength();\n int rBbrCount = Element.as(rightParagraph).getElementsByTagName(BR).getLength();\n op = new TreeMergeParagraph(clientJupiter.getSiteId(), path.get(0), leftParagraph.getChildCount() - lBbrCount, rightParagraph.getChildCount() - rBbrCount);\n op.setPath(TreeHelper.toIntArray(path));\n }\n }\n }\n return op;\n}\n"
|
"public Dimension getSize() {\n DimensionHandle handle = ((ReportItemHandle) getHandle()).getWidth();\n int px = 0;\n int py = 0;\n if (!DesignChoiceConstants.UNITS_PERCENTAGE.equals(handle.getUnits())) {\n px = (int) DEUtil.convertoToPixel(handle);\n }\n handle = ((ReportItemHandle) getHandle()).getHeight();\n int py = (int) DEUtil.convertoToPixel(handle);\n px = Math.max(0, px);\n py = Math.max(0, py);\n return new Dimension(px, py);\n}\n"
|
"public void writeData(ObjectDataOutput out) throws IOException {\n out.writeInt(partitionId);\n out.writeObject(oldOwner);\n out.writeObject(newOwner);\n MigrationStatus.writeTo(status, out);\n}\n"
|
"public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n this.controller = (Controller) this.getArguments().getSerializable(\"String_Node_Str\");\n if (controller == null) {\n MessageModel error = new MessageModel(\"String_Node_Str\", MessageModel.ErrorType.ERROR);\n controller = new MessageController<MessageModel>(error);\n Logger.log(\"String_Node_Str\", \"String_Node_Str\");\n }\n int layoutId = controller.getView();\n View view = inflater.inflate(layoutId, container, false);\n controller.attach(view, this);\n return view;\n}\n"
|
"public void testForwardDifferenceHessianApproximationGivenGradient() {\n AbstractFunction function = new RosenbrockFunction();\n DerivativesApproximation derivativesApproximation = new DerivativesApproximation(function, DerivativesApproximationMethod.FORWARD_DIFFERENCE);\n RealVector point = new ArrayRealVector(new double[] { -1.2, 1 });\n double[][] actualResultTemp = derivativesApproximation.approximateHessianGivenGradient(point).getData();\n double[][] expectedResultTemp = function.getHessian(point).getData();\n double[] actualResult = new double[actualResultTemp.length * actualResultTemp[0].length];\n double[] expectedResult = new double[expectedResultTemp.length * expectedResultTemp[0].length];\n for (int i = 0; i < actualResultTemp.length; i++) {\n for (int j = 0; j < actualResultTemp[0].length; j++) {\n actualResult[i * actualResultTemp[0].length + j] = actualResultTemp[i][j];\n expectedResult[i * expectedResultTemp[0].length + j] = expectedResultTemp[i][j];\n }\n }\n Assert.assertArrayEquals(expectedResult, actualResult, 1e-4);\n}\n"
|
"protected void onResume() {\n super.onResume();\n if (mButtonDTMF != null) {\n int dtmf = Settings.System.getInt(getContentResolver(), Settings.System.DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_NORMAL);\n mButtonDTMF.setValueIndex(dtmf);\n }\n if (mButtonAutoRetry != null) {\n int autoretry = Settings.System.getInt(getContentResolver(), Settings.System.CALL_AUTO_RETRY, 0);\n mButtonAutoRetry.setChecked(autoretry != 0);\n }\n if (mButtonHAC != null) {\n int hac = Settings.System.getInt(getContentResolver(), Settings.System.HEARING_AID, 0);\n mButtonHAC.setChecked(hac != 0);\n }\n if (mButtonTTY != null) {\n int settingsTtyMode = Settings.Secure.getInt(getContentResolver(), Settings.Secure.PREFERRED_TTY_MODE, Phone.TTY_MODE_OFF);\n mButtonTTY.setValue(Integer.toString(settingsTtyMode));\n updatePreferredTtyModeSummary(settingsTtyMode);\n }\n}\n"
|
"public static void checkHyperlinkTextDecoration(IStyle style, StringBuffer content) {\n String linethrough = null;\n String overline = null;\n if (style != null) {\n buildTextDecoration(content, style.getTextLineThrough(), style.getTextUnderline(), style.getTextOverline());\n }\n content.append(\"String_Node_Str\");\n if (overline != null && \"String_Node_Str\".equalsIgnoreCase(overline)) {\n addPropValue(content, overline);\n }\n if (linethrough != null && !\"String_Node_Str\".equalsIgnoreCase(linethrough)) {\n addPropValue(content, linethrough);\n }\n content.append(\"String_Node_Str\");\n}\n"
|
"public Taxonomy saveTaxonomy(Object taxonomySource) {\n if (taxonomySource == null) {\n throw new CmsException(\"String_Node_Str\");\n }\n if (taxonomySource instanceof String) {\n ImportConfiguration configuration = ImportConfiguration.taxonomy().persist(PersistMode.PERSIST_ENTITY_TREE).build();\n return importDao.importTaxonomy((String) taxonomySource, configuration);\n }\n if (!(taxonomySource instanceof Taxonomy)) {\n throw new CmsException(\"String_Node_Str\" + taxonomySource.getClass().getName());\n }\n Taxonomy taxonomy = (Taxonomy) taxonomySource;\n if (StringUtils.isBlank(taxonomy.getName())) {\n throw new CmsException(\"String_Node_Str\");\n }\n changeIdentifierIfTaxonomyIsBuiltIn(taxonomy, Taxonomy.SUBJECT_TAXONOMY_NAME);\n String taxonomyName = taxonomy.getName();\n boolean taxonomyNameIsAReservedName = isTaxonomyNameAReservedName(taxonomyName);\n if (!taxonomyNameIsAReservedName) {\n if (!XMLChar.isValidNCName(taxonomyName)) {\n throw new CmsException(\"String_Node_Str\" + taxonomyName + \"String_Node_Str\");\n } else if (!cmsRepositoryEntityUtils.isValidSystemName(taxonomyName)) {\n throw new CmsException(\"String_Node_Str\" + taxonomyName + \"String_Node_Str\" + CmsConstants.SYSTEM_NAME_REG_EXP);\n }\n }\n Session session = null;\n SaveMode saveMode = null;\n try {\n saveMode = StringUtils.isBlank(taxonomy.getId()) ? SaveMode.INSERT : SaveMode.UPDATE_ALL;\n session = getSession();\n Node taxonomyRootJcrNode = JcrNodeUtils.getTaxonomyRootNode(session);\n Node taxonomyJcrNode = null;\n switch(saveMode) {\n case INSERT:\n throwExceptionIfTaxonomyNameExists(taxonomy, taxonomyRootJcrNode);\n if (taxonomyNameIsAReservedName) {\n throw new CmsException(\"String_Node_Str\" + taxonomy.getName());\n }\n taxonomyJcrNode = taxonomyRootJcrNode.addNode(taxonomyName, CmsBuiltInItem.Taxonomy.getJcrName());\n cmsRepositoryEntityUtils.createCmsIdentifier(taxonomyJcrNode, taxonomy, false);\n break;\n case UPDATE_ALL:\n if (Taxonomy.SUBJECT_TAXONOMY_NAME.equalsIgnoreCase(taxonomyName)) {\n taxonomyJcrNode = taxonomyRootJcrNode.getNode(Taxonomy.SUBJECT_TAXONOMY_NAME);\n } else {\n taxonomyJcrNode = cmsRepositoryEntityUtils.retrieveUniqueNodeForCmsRepositoryEntity(session, taxonomy);\n }\n if (taxonomyJcrNode == null) {\n if (taxonomyNameIsAReservedName) {\n throw new CmsException(\"String_Node_Str\" + taxonomyName + \"String_Node_Str\" + taxonomy.getId());\n }\n if (taxonomyRootJcrNode.hasNode(taxonomyName)) {\n if (cmsRepositoryEntityUtils.hasCmsIdentifier(taxonomyRootJcrNode.getNode(taxonomyName))) {\n String taxonomyJcrNodeIdentifier = cmsRepositoryEntityUtils.getCmsIdentifier(taxonomyRootJcrNode.getNode(taxonomyName));\n if (StringUtils.equals(taxonomyJcrNodeIdentifier, taxonomy.getId())) {\n logger.warn(\"String_Node_Str\" + taxonomy.getId() + \"String_Node_Str\" + \"String_Node_Str\" + taxonomyName + \"String_Node_Str\" + taxonomy.getId() + \"String_Node_Str\");\n taxonomyJcrNode = taxonomyRootJcrNode.getNode(taxonomyName);\n } else {\n throw new CmsException(\"String_Node_Str\" + taxonomyName + \"String_Node_Str\" + taxonomyJcrNodeIdentifier + \"String_Node_Str\" + taxonomy.getId());\n }\n } else {\n throw new CmsException(\"String_Node_Str\" + taxonomyName + \"String_Node_Str\" + \"String_Node_Str\" + taxonomy.getId());\n }\n } else {\n taxonomyJcrNode = taxonomyRootJcrNode.addNode(taxonomyName, CmsBuiltInItem.Taxonomy.getJcrName());\n cmsRepositoryEntityUtils.createCmsIdentifier(taxonomyJcrNode, taxonomy, true);\n }\n }\n if (taxonomyJcrNode.getParent() == null || (!taxonomyJcrNode.getParent().isNodeType(CmsBuiltInItem.RepositoryUser.getJcrName()) && !taxonomyJcrNode.getParent().isNodeType(CmsBuiltInItem.TaxonomyRoot.getJcrName()))) {\n throw new CmsException(\"String_Node_Str\" + taxonomyName + \"String_Node_Str\" + taxonomyJcrNode.getPath());\n }\n if (!taxonomyJcrNode.getName().equals(taxonomyName)) {\n if (isTaxonomyNameAReservedName(taxonomyJcrNode.getName())) {\n throw new CmsException(\"String_Node_Str\" + taxonomyJcrNode.getName() + \"String_Node_Str\");\n }\n throwExceptionIfTaxonomyNameExists(taxonomy, taxonomyRootJcrNode);\n if (!taxonomyNameIsAReservedName) {\n session.move(taxonomyJcrNode.getPath(), taxonomyRootJcrNode.getPath() + CmsConstants.FORWARD_SLASH + taxonomyName);\n }\n }\n break;\n default:\n break;\n }\n if (taxonomyJcrNode != null) {\n cmsLocalizationUtils.updateCmsLocalization(taxonomy, taxonomyJcrNode);\n cmsRepositoryEntityUtils.setSystemProperties(taxonomyJcrNode, taxonomy);\n }\n if (SaveMode.INSERT == saveMode) {\n saveRootTopics(taxonomy);\n }\n session.save();\n return taxonomy;\n } catch (CmsException e) {\n throw e;\n } catch (Exception e) {\n throw new CmsException(e);\n }\n}\n"
|
"private Map<String, AbstractPropertyValue> getInitialCapabilityProperties(String capabilityName, NodeTemplate nodeTemplate) {\n Map<String, AbstractPropertyValue> properties = Maps.newHashMap();\n if (nodeTemplate.getCapabilities() != null && nodeTemplate.getCapabilities().get(capabilityName) != null && nodeTemplate.getCapabilities().get(capabilityName).getProperties() != null) {\n properties = nodeTemplate.getCapabilities().get(capabilityName).getProperties();\n }\n return properties;\n}\n"
|
"public long readDiscontinuity() {\n long positionUs = enabledSources[0].readDiscontinuity();\n if (positionUs != C.UNSET_TIME_US) {\n for (int i = 1; i < enabledSources.length; i++) {\n if (enabledSources[i].seekToUs(positionUs) != positionUs) {\n throw new IllegalStateException(\"String_Node_Str\");\n }\n }\n }\n for (int i = 1; i < enabledSources.length; i++) {\n if (enabledSources[i].readDiscontinuity() != C.UNSET_TIME_US) {\n throw new IllegalStateException(\"String_Node_Str\");\n }\n }\n return C.UNSET_TIME_US;\n}\n"
|
"public void run() {\n offscreenCanvas.disposeAttached();\n}\n"
|
"private int[] findLocalsForValueNumber(int pc, int vn) {\n IBasicBlock bb = shrikeCFG.getBlockForInstruction(pc);\n int firstInstruction = bb.getFirstInstructionIndex();\n int[] locals = block2LocalState[bb.getNumber()];\n for (int i = firstInstruction; i <= pc; i++) {\n if (localStoreMap[i] != null) {\n IntPair p = localStoreMap[i];\n locals = setLocal(locals, p.getY(), p.getX());\n }\n }\n return extractIndices(locals, vn);\n}\n"
|
"private void init() {\n initNavigationView();\n BottomNavigationViewHelper.disableShiftMode(mBottomNavigationView);\n mPresenter.setCurrentPage(Constants.TYPE_MAIN_PAGER);\n bottomNavigationBar.setOnNavigationItemSelectedListener(item -> {\n switch(item.getItemId()) {\n case R.id.tab_main_pager:\n mTitleTv.setText(getString(R.string.home_pager));\n switchFragment(0);\n mMainPagerFragment.reload();\n mPresenter.setCurrentPage(Constants.TYPE_MAIN_PAGER);\n break;\n case R.id.tab_knowledge_hierarchy:\n mTitleTv.setText(getString(R.string.knowledge_hierarchy));\n switchFragment(1);\n mKnowledgeHierarchyFragment.reload();\n mPresenter.setCurrentPage(Constants.TYPE_KNOWLEDGE);\n break;\n case R.id.tab_navigation:\n switchNavigation();\n break;\n case R.id.tab_project:\n switchProject();\n break;\n default:\n break;\n }\n return true;\n });\n ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, mDrawerLayout, mToolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close) {\n public void onDrawerSlide(View drawerView, float slideOffset) {\n View mContent = mDrawerLayout.getChildAt(0);\n float scale = 1 - slideOffset;\n float endScale = 0.8f + scale * 0.2f;\n float startScale = 1 - 0.3f * scale;\n drawerView.setScaleX(startScale);\n drawerView.setScaleY(startScale);\n drawerView.setAlpha(0.6f + 0.4f * (1 - scale));\n mContent.setTranslationX(drawerView.getMeasuredWidth() * (1 - scale));\n mContent.invalidate();\n mContent.setScaleX(endScale);\n mContent.setScaleY(endScale);\n }\n };\n toggle.syncState();\n mDrawerLayout.addDrawerListener(toggle);\n}\n"
|
"private IThriftPool getPoolUsingPolicy() {\n if (!hostPools.isEmpty()) {\n logger.info(\"String_Node_Str\", loadBalancingPolicy.getClass().getSimpleName());\n return (IThriftPool) loadBalancingPolicy.getPool(hostPools.values());\n }\n throw new KunderaException(\"String_Node_Str\");\n}\n"
|
"private void extractVpkFile(Path tfpath, String vpkname, Path dest, List<String> files) {\n List<String> cmds = new ArrayList<>();\n try {\n Path vpktool = resolveVpkToolPath(tfpath);\n cmds.add(vpktool.toString());\n cmds.add(\"String_Node_Str\");\n cmds.add(Paths.get(vpkname).toAbsolutePath().toString());\n cmds.addAll(files);\n ProcessBuilder pb = new ProcessBuilder(cmds);\n pb.directory(dest.toFile());\n Process pr = pb.start();\n try (BufferedReader input = newProcessReader(pr)) {\n String line;\n while ((line = input.readLine()) != null) {\n log.fine(\"String_Node_Str\" + line);\n }\n }\n pr.waitFor();\n } catch (InterruptedException | IOException e) {\n log.info(\"String_Node_Str\" + vpkname);\n }\n}\n"
|
"void compress(int page) {\n ByteBuffer[] list = data;\n if (page >= list.length) {\n return;\n }\n ByteBuffer d = list[page];\n int len = LZF.compress(d, 0, compressOutputBuffer, 0);\n d = ByteBuffer.allocateDirect(len);\n d.put(compressOutputBuffer, 0, len);\n list[page] = d;\n}\n"
|
"public void updateAllEnabledOrNot() {\n String jobIdInOozie = getJobIdInOozie();\n String pathValue = executeJobComposite.getPathValue();\n Button runBtn = executeJobComposite.getRunBtn();\n Button scheduleBtn = executeJobComposite.getScheduleBtn();\n Button killBtn = executeJobComposite.getKillBtn();\n boolean isRunBtnEnabled = false;\n boolean isScheduleBtnEnabled = false;\n boolean isKillBtnEnabled = false;\n if (pathValue != null && !\"String_Node_Str\".equals(pathValue) && isSettingDone()) {\n if (jobIdInOozie != null && !\"String_Node_Str\".equals(jobIdInOozie)) {\n try {\n JobSubmission.Status status = checkJobSubmissionStaus(jobIdInOozie);\n switch(status) {\n case RUNNING:\n isRunBtnEnabled = false;\n isScheduleBtnEnabled = false;\n isKillBtnEnabled = true;\n break;\n case PREP:\n case SUCCEEDED:\n case KILLED:\n isRunBtnEnabled = true;\n isScheduleBtnEnabled = true;\n isKillBtnEnabled = false;\n break;\n case FAILED:\n case SUSPENDED:\n isKillBtnEnabled = true;\n isScheduleBtnEnabled = true;\n isRunBtnEnabled = true;\n }\n } catch (JobSubmissionException e) {\n isRunBtnEnabled = true;\n isScheduleBtnEnabled = true;\n isKillBtnEnabled = false;\n org.talend.commons.exception.ExceptionHandler.process(e);\n }\n } else {\n isRunBtnEnabled = true;\n isScheduleBtnEnabled = true;\n isKillBtnEnabled = false;\n }\n }\n updateBtn(runBtn, isRunBtnEnabled);\n updateBtn(scheduleBtn, isScheduleBtnEnabled);\n updateBtn(killBtn, isKillBtnEnabled);\n updatePathEnabledOrNot();\n updateOutputTxtEnabledOrNot();\n}\n"
|
"private void checkPermissions() {\n if (isVoiceOnlyCall) {\n onMicrophoneClick();\n } else if (getActivity() != null) {\n requestPermissions(PERMISSIONS_CALL, 100);\n }\n}\n"
|
"public void realmListener_realmResultShouldBeSynced() {\n final Realm realm = looperThread.getRealm();\n final RealmResults<AllTypes> results = realm.where(AllTypes.class).findAll();\n assertEquals(1, results.size());\n realm.executeTransactionAsync(new Realm.Transaction() {\n public void execute(Realm realm) {\n AllTypes allTypes = realm.where(AllTypes.class).findFirst();\n assertNotNull(allTypes);\n allTypes.deleteFromRealm();\n assertEquals(0, realm.where(AllTypes.class).count());\n }\n });\n realm.addChangeListener(new RealmChangeListener<Realm>() {\n public void onChange(Realm element) {\n assertEquals(0, realm.where(AllTypes.class).count());\n assertEquals(0, results.size());\n looperThread.testComplete();\n }\n });\n}\n"
|
"public static boolean isSpreadsheet(String url) {\n if (url == null) {\n return false;\n }\n url = url.toLowerCase(Locale.ROOT);\n return url.endsWith(\"String_Node_Str\") || url.endsWith(\"String_Node_Str\");\n}\n"
|
"public long getSetUID(SharedPreferences sp, Context ctx) {\n long tempID = this.getUID();\n if (tempID >= 0) {\n return tempID;\n }\n final AccountManager manager = AccountManager.get(ctx);\n final Account[] accounts = manager.getAccounts();\n String username = getGmail(accounts);\n if (!username.equals(\"String_Node_Str\")) {\n long uid = sp.getLong(\"String_Node_Str\", -1);\n UIDtoken.INSTANCE.setUID(uid);\n if (uid < 0) {\n NetHelper NH = new NetHelper();\n long UID = NH.getID(username);\n SharedPreferences.Editor editor = sp.edit();\n editor.putLong(\"String_Node_Str\", UID);\n editor.putString(\"String_Node_Str\", username);\n editor.commit();\n UIDtoken.INSTANCE.setUID(UID);\n return UID;\n } else {\n UIDtoken.INSTANCE.setUID(uid);\n return uid;\n }\n } else {\n Context context = ctx;\n String loginPrompt = ctx.getString(R.string.error_login_message);\n CharSequence text = loginPrompt;\n Toast toast = Toast.makeText(context, text, 1000);\n toast.show();\n }\n return -5;\n}\n"
|
"private void createTabs(PropertiableFile propertiableFile, final FileInfoType type) {\n List<Tabs> tabs = new ArrayList<Tabs>();\n tabs.add(Tabs.GENERAL);\n Torrent torrent = (Torrent) propertiableFile.getProperty(FilePropertyKey.TORRENT);\n if (torrent != null) {\n if (torrent.isEditable()) {\n tabs.add(Tabs.LIMITS);\n }\n if (torrent.hasMetaData()) {\n tabs.add(Tabs.BITTORENT);\n tabs.add(Tabs.TRACKERS);\n }\n if (torrent.isEditable()) {\n tabs.add(Tabs.TRANSFERS);\n if (type == FileInfoType.DOWNLOADING_FILE) {\n tabs.add(Tabs.PIECES);\n }\n }\n } else {\n if (type == FileInfoType.LOCAL_FILE) {\n tabs.add(Tabs.SHARING);\n }\n if (type != FileInfoType.REMOTE_FILE) {\n tabs.add(Tabs.TRANSFERS);\n }\n if (type == FileInfoType.DOWNLOADING_FILE) {\n tabs.add(Tabs.PIECES);\n }\n }\n tabPanel.setTabs(tabs);\n}\n"
|
"public void detach() {\n if (target.invisible > 0)\n target.invisible--;\n stealthed = false;\n cooldown = 18 - (level / 2);\n super.detach();\n}\n"
|
"public Type getResultType(Validator validator, Exp[] args) {\n if (args.length == 1) {\n Dimension defaultTimeDimension = validator.getQuery().getCube().getTimeDimension();\n if (defaultTimeDimension == null) {\n throw MondrianResource.instance().NoTimeDimensionInCube.ex(getName());\n }\n Hierarchy hierarchy = defaultTimeDimension.getHierarchy();\n return new SetType(MemberType.forHierarchy(hierarchy));\n } else {\n Type type = args[1].getType();\n Type memberType = TypeUtil.toMemberOrTupleType(type);\n return new SetType(memberType);\n }\n}\n"
|
"public void onPictureTaken(byte[] data, Camera camera) {\n showPicture(PictureUtils.bitmapFromRawBytes(data, mPictureView.getWidth(), mPictureView.getHeight()));\n}\n"
|
"public Builder setCallbackType(int callbackType) {\n if (!isValidCallbackType(callbackType)) {\n throw new IllegalArgumentException(\"String_Node_Str\" + callbackType);\n }\n mCallbackType = callbackType;\n return this;\n}\n"
|
"public void run() {\n try {\n InputStreamReader inputStreamReader = new InputStreamReader(_inputStream, Charset.defaultCharset());\n BufferedReader bufferedReader = new BufferedReader(inputStreamReader);\n String line = null;\n while ((line = bufferedReader.readLine()) != null) {\n _fmuBuilder.stdout(line);\n }\n } catch (IOException ioe) {\n _fmuBuilder.stderr(\"String_Node_Str\" + ioe);\n }\n}\n"
|
"public void runRead(final Unmarshaller unmarshaller) throws Throwable {\n final String o1 = (String) unmarshaller.readObject();\n final Integer o2 = (Integer) unmarshaller.readObject();\n assertSame(o1, unmarshaller.readObject());\n assertSame(o2, unmarshaller.readObject());\n final String o1p = (String) unmarshaller.readObject();\n final Integer o2p = (Integer) unmarshaller.readObject();\n assertNotSame(o1, o1p);\n assertNotSame(o2, o2p);\n assertSame(o1p, unmarshaller.readObject());\n assertSame(o2p, unmarshaller.readObject());\n}\n"
|
"private Boolean moved() {\n Side side = getSide();\n Position pos = getPosition();\n return !((side == Side.WHITE && pos.y == 1) || (side == Side.BLACK && pos.y == 6));\n}\n"
|
"private static int maxU(short[] array, int startIndex, int rows, int columns, int stride) {\n int output = array[startIndex] & 0xFFFF;\n for (int y = 0; y < rows; y++) {\n int index = startIndex + y * stride;\n int end = index + columns;\n for (; index < end; index++) {\n int v = array[index] & 0xFFFF;\n if (v > output)\n output = v;\n }\n }\n return output;\n}\n"
|
"public Bitmap getIcon(Resources res) {\n if (drone.isConnectionAlive()) {\n return BitmapFactory.decodeResource(res, R.drawable.quad);\n }\n return BitmapFactory.decodeResource(res, R.drawable.quad_disconnect);\n}\n"
|
"public String format() {\n final StringBuilder sb = new StringBuilder();\n if (betweenMs > 0) {\n long day = betweenMs / DateUnit.DAY.getMillis();\n long hour = betweenMs / DateUnit.HOUR.getMillis() - day * 24;\n long minute = betweenMs / DateUnit.MINUTE.getMillis() - day * 24 * 60 - hour * 60;\n long second = betweenMs / DateUnit.SECOND.getMillis() - ((day * 24 + hour) * 60 + minute) * 60;\n long millisecond = betweenMs - (((day * 24 + hour) * 60 + minute) * 60 + second) * 1000;\n final int level = this.level.ordinal();\n int levelCount = 0;\n if (isLevelCountValid(levelCount) && 0 != day && level >= Level.DAY.ordinal()) {\n sb.append(day).append(Level.DAY.name);\n levelCount++;\n }\n if (isLevelCountValid(levelCount) && 0 != hour && level >= Level.HOUR.ordinal()) {\n sb.append(hour).append(Level.HOUR.name);\n levelCount++;\n }\n if (isLevelCountValid(levelCount) && 0 != minute && level >= Level.MINUTE.ordinal()) {\n sb.append(minute).append(Level.MINUTE.name);\n levelCount++;\n }\n if (isLevelCountValid(levelCount) && 0 != second && level >= Level.MINUTE.ordinal()) {\n sb.append(second).append(Level.MINUTE.name);\n levelCount++;\n }\n if (isLevelCountValid(levelCount) && 0 != millisecond && level >= Level.MILLSECOND.ordinal()) {\n sb.append(millisecond).append(Level.MILLSECOND.name);\n levelCount++;\n }\n }\n if (StrUtil.isEmpty(sb)) {\n sb.append(0).append(this.level.name);\n }\n return sb.toString();\n}\n"
|
"private void removeConditional(ManaType manaType, Ability ability, Game game) {\n for (ConditionalMana mana : getConditionalMana()) {\n if (mana.get(manaType) > 0 && mana.apply(ability, game, mana.getManaProducerId())) {\n mana.set(manaType, mana.get(manaType) - 1);\n GameEvent event = new GameEvent(GameEvent.EventType.MANA_PAYED, ability.getId(), mana.getManaProducerId(), ability.getControllerId(), 0, mana.getFlag());\n event.setData(mana.getManaProducerOriginalId().toString());\n game.fireEvent(event);\n break;\n }\n }\n}\n"
|
"private static List<String> system(String... command) {\n try {\n final ProcessBuilder builder = new ProcessBuilder(command);\n builder.redirectError(ProcessBuilder.Redirect.INHERIT);\n final Process process = builder.start();\n Preconditions.checkState(0 == process.waitFor(), \"String_Node_Str\", Arrays.asList(command), IOUtils.toString(process.getErrorStream()));\n try (InputStream stream = process.getInputStream()) {\n return IOUtils.readLines(stream);\n }\n } catch (final Exception e) {\n throw Throwables.propagate(e);\n }\n}\n"
|
"private static void addYearIntervals(int period, int count, LongList out) {\n int k = out.size();\n long lo = out.getQuick(k - 2);\n long hi = out.getQuick(k - 1);\n for (int i = 0, n = count - 1; i < n; i++) {\n lo = Dates.addYear(lo, period);\n hi = Dates.addYear(hi, period);\n append(out, lo, hi);\n }\n}\n"
|
"public void configureCursors(MouseEvent e) throws Exception {\n Object mode = map.getTools().getInstalled();\n if (mode == MouseTools.VIEW) {\n ensureCursor(Cursors.ZOOM);\n } else if (mode == MouseTools.NAVIGATION) {\n Point2D.Double cartPt = map.getPane().awtScreen2Cartesian(e.getPoint());\n Point2D.Double goePt = map.getPane().cartesian2Geo(cartPt);\n boolean shapeSelected = map.selectedGeometryHitted(GeometryUtils.createPoint(goePt));\n boolean pointSelected = map.selectedPointHitted(GeometryUtils.createPoint(goePt));\n if (shapeSelected || pointSelected) {\n if (pointSelected) {\n ensureCursor(Cursors.PAN_POINT);\n } else {\n ensureCursor(Cursors.HAND);\n }\n } else {\n ensureCursor(Cursors.ZOOM);\n }\n } else if (mode == MouseTools.SELECTION) {\n Point2D.Double cartPt = map.getPane().awtScreen2Cartesian(e.getPoint());\n Point2D.Double goePt = map.getPane().cartesian2Geo(cartPt);\n boolean shapeSelected = map.selectedGeometryHitted(GisUtilities.createPoint(goePt));\n boolean pointSelected = map.selectedPointHitted(GisUtilities.createPoint(goePt));\n if (shapeSelected || pointSelected) {\n if (pointSelected) {\n ensureCursor(Cursors.PAN_POINT);\n } else {\n ensureCursor(Cursors.HAND);\n }\n } else {\n ensureCursor(Cursors.CROSS);\n }\n } else if (mode == MouseTools.EDITING) {\n ensureCursor(Cursors.DRAW);\n } else if (mode == MouseTools.VERTICES_EDITING) {\n Point2D.Double cartPt = map.getPane().awtScreen2Cartesian(e.getPoint());\n Point2D.Double goePt = map.getPane().cartesian2Geo(cartPt);\n boolean shapeSelected = map.selectedPointHitted(GisUtilities.createPoint(goePt));\n if (shapeSelected) {\n ensureCursor(Cursors.PAN_POINT);\n } else {\n ensureCursor(Cursors.CROSS);\n }\n }\n}\n"
|
"public void startList(IListContent list) {\n adjustInline();\n styles.push(list.getComputedStyle());\n writeBookmark(list);\n Object listToc = list.getTOC();\n if (listToc != null) {\n tableTocs.add(new TocInfo(listToc.toString(), tocLevel));\n }\n increaseTOCLevel(list);\n if (context.isLastTable()) {\n wordWriter.insertHiddenParagraph();\n }\n wordWriter.startTable(list.getComputedStyle(), context.getCurrentWidth());\n}\n"
|
"public void sendChangesImpl(List<Action> actions, NoSqlEntityManager mgr) throws ConnectionException {\n Keyspace keyspace = columnFamilies.getKeyspace();\n MutationBatch m1 = keyspace.prepareMutationBatch();\n MutationBatch m = m1.setConsistencyLevel(ConsistencyLevel.CL_QUORUM);\n for (Action action : actions) {\n if (action instanceof Persist) {\n persist((Persist) action, mgr, m);\n } else if (action instanceof Remove) {\n remove((Remove) action, m);\n } else if (action instanceof PersistIndex) {\n persistIndex((PersistIndex) action, mgr, m);\n } else if (action instanceof RemoveIndex) {\n removeIndex((RemoveIndex) action, m);\n }\n }\n long time = System.currentTimeMillis();\n m.execute();\n if (log.isInfoEnabled()) {\n long total = System.currentTimeMillis() - time;\n log.info(\"String_Node_Str\" + total + \"String_Node_Str\");\n }\n}\n"
|
"public String getFullProductName() {\n return this.getSpecificationVendor() + \"String_Node_Str\" + this.getProductName();\n}\n"
|
"public void widgetSelected(SelectionEvent event) {\n boolean selected = butt.getSelection();\n if (selected == rule.getProperty(bp))\n return;\n rule.setProperty(bp, Boolean.valueOf(selected));\n listener.changed(rule, desc, Boolean.valueOf(selected));\n}\n"
|
"protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {\n FMLClientHandler.instance().getClient().renderEngine.func_110577_a(TEXTURE);\n GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);\n containerWidth = (this.width - this.xSize) / 2;\n containerHeight = (this.height - this.ySize) / 2;\n this.drawTexturedModalRect(containerWidth, containerHeight, 0, 0, this.xSize, this.ySize);\n}\n"
|
"public void whenBuildFinishesThenBuildSuccessEventFired() throws ExecutionException, InterruptedException {\n BuildTarget target = BuildTargetFactory.newInstance(\"String_Node_Str\");\n CachingBuildRuleParams params = new CachingBuildRuleParams(target, ImmutableSortedSet.<BuildRule>of(), ImmutableSet.of(BuildTargetPattern.MATCH_ALL), artifactCache);\n StepRunner stepRunner = createNiceMock(StepRunner.class);\n expect(stepRunner.getListeningExecutorService()).andStubReturn(MoreExecutors.sameThreadExecutor());\n JavaPackageFinder packageFinder = createNiceMock(JavaPackageFinder.class);\n replay(stepRunner, packageFinder);\n EventBus bus = new EventBus();\n Listener listener = new Listener();\n bus.register(listener);\n DummyRule rule = new DummyRule(params, false, false, false);\n File root = new File(\"String_Node_Str\");\n BuildContext context = BuildContext.builder().setEventBus(bus).setProjectRoot(root).setDependencyGraph(createMock(DependencyGraph.class)).setProjectFilesystem(new ProjectFilesystem(root)).setCommandRunner(stepRunner).setJavaPackageFinder(packageFinder).build();\n ListenableFuture<BuildRuleSuccess> build = rule.build(context);\n build.get();\n assertSeenEventsContain(ImmutableList.<BuildEvent>of(BuildEvents.started(rule), BuildEvents.finished(rule, SUCCESS, MISS)), listener.getSeen());\n}\n"
|
"public static ComputationManager createMpiComputationManager(CommandLine line, FileSystem fileSystem) {\n Path tmpDir = fileSystem.getPath(line.hasOption(\"String_Node_Str\") ? line.getOptionValue(\"String_Node_Str\") : System.getProperty(\"String_Node_Str\"));\n Path statisticsDbDir = line.hasOption(\"String_Node_Str\") ? fileSystem.getPath(line.getOptionValue(\"String_Node_Str\")) : null;\n String statisticsDbName = line.hasOption(\"String_Node_Str\") ? line.getOptionValue(\"String_Node_Str\") : null;\n int coresPerRank = Integer.parseInt(line.getOptionValue(\"String_Node_Str\"));\n boolean verbose = line.hasOption(\"String_Node_Str\");\n Path stdOutArchive = line.hasOption(\"String_Node_Str\") ? fileSystem.getPath(line.getOptionValue(\"String_Node_Str\")) : null;\n ComponentDefaultConfig config = ComponentDefaultConfig.load();\n MpiExecutorContext mpiExecutorContext = new MpiExecutorContext();\n MpiStatisticsFactory statisticsFactory = createMpiStatisticsFactory(config, statisticsDbDir, statisticsDbName);\n try {\n return new MpiComputationManager(tmpDir, statisticsFactory.create(statisticsDbDir, statisticsDbName), new MpiExecutorContext(), coresPerRank, verbose, stdOutArchive);\n } catch (IOException e) {\n throw new UncheckedIOException(e);\n } catch (InterruptedException e) {\n throw new UncheckedInterruptedException(e);\n }\n}\n"
|
"public HttpResponse execute(HttpRequest request) throws IOException {\n try {\n HttpResponse response = HttpRequests.execute(request, httpRequestConfig);\n switch(response.getResponseCode()) {\n case HttpURLConnection.HTTP_UNAVAILABLE:\n throw new ServiceUnavailableException(discoverableServiceName, response.getResponseBodyAsString());\n case HttpURLConnection.HTTP_FORBIDDEN:\n throw new UnauthorizedException(response.getResponseBodyAsString());\n default:\n return response;\n }\n return response;\n } catch (ConnectException e) {\n throw new ServiceUnavailableException(discoverableServiceName, e);\n }\n}\n"
|
"public int compare(TreeEntry o1, TreeEntry o2) {\n return o2.getName().length() - o1.getName().length();\n}\n"
|
"protected void handleGroupAction() {\n SeriesDefinition sdBackup = (SeriesDefinition) EcoreUtil.copy(seriesdefinition);\n GroupSortingDialog groupDialog = createGroupSortingDialog(sdBackup);\n if (groupDialog.open() == Window.OK) {\n if (!sdBackup.eIsSet(DataPackage.eINSTANCE.getSeriesDefinition_Sorting())) {\n seriesdefinition.eUnset(DataPackage.eINSTANCE.getSeriesDefinition_Sorting());\n } else {\n seriesdefinition.setSorting(sdBackup.getSorting());\n }\n ChartAdapter.beginIgnoreNotifications();\n List<?> sds = ChartUIUtil.getAllOrthogonalSeriesDefinitions(context.getModel());\n for (int i = 0; i < sds.size(); i++) {\n if (i != 0) {\n SeriesDefinition sdf = (SeriesDefinition) sds.get(i);\n if (!sdBackup.eIsSet(DataPackage.eINSTANCE.getSeriesDefinition_Sorting())) {\n sdf.eUnset(DataPackage.eINSTANCE.getSeriesDefinition_Sorting());\n } else {\n sdf.setSorting(sdBackup.getSorting());\n }\n }\n }\n ChartAdapter.endIgnoreNotifications();\n seriesdefinition.setSortKey(sdBackup.getSortKey());\n seriesdefinition.getSortKey().eAdapters().addAll(seriesdefinition.eAdapters());\n if (seriesdefinition.getQuery() != null) {\n if (sdBackup.getQuery().getGrouping() == null) {\n return;\n }\n seriesdefinition.getQuery().setGrouping(sdBackup.getQuery().getGrouping());\n seriesdefinition.getQuery().getGrouping().eAdapters().addAll(seriesdefinition.getQuery().eAdapters());\n ChartUIUtil.checkGroupType(context, context.getModel());\n }\n }\n}\n"
|
"protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);\n setContentView(R.layout.activity_combined);\n mChart = (CombinedChart) findViewById(R.id.chart1);\n mChart.setDescription(\"String_Node_Str\");\n mChart.setDrawGridBackground(false);\n mChart.setDrawBarShadow(false);\n mChart.setDrawOrder(new DrawOrder[] { DrawOrder.BAR, DrawOrder.LINE });\n YAxis rightAxis = mChart.getAxisRight();\n rightAxis.setDrawGridLines(false);\n YAxis leftAxis = mChart.getAxisLeft();\n leftAxis.setDrawGridLines(false);\n XAxis xAxis = mChart.getXAxis();\n xAxis.setPosition(XAxisPosition.BOTH_SIDED);\n CombinedData data = new CombinedData(mMonths);\n data.setData(generateLineData());\n data.setData(generateBarData());\n mChart.setData(data);\n mChart.invalidate();\n}\n"
|
"public byte[] getUnmalleableBytes() {\n byte[] scriptBytes = script.getUnmalleableBytes();\n if (scriptBytes == null) {\n return null;\n }\n ByteWriter writer = new ByteWriter(32 + 4 + scriptBytes.length + 4);\n writer.putSha256Hash(outPoint.txid, true);\n writer.putIntLE(outPoint.index);\n writer.putBytes(scriptBytes);\n writer.putIntLE(sequence);\n return writer.toBytes();\n}\n"
|
"public static IPropertyTabUI buildFilterPage(Composite parent, Object input) {\n GridLayout gl = new GridLayout();\n parent.setLayout(gl);\n FormPage page = new FormPage(FormPropertyDescriptor.FULL_FUNCTION, new FilterHandleProvider(), false, true);\n page.setInput(input);\n page.buildUI(parent);\n return page;\n}\n"
|
"public static byte[] toBytes(Object source) throws BirtException {\n if (source == null)\n return null;\n if (source instanceof byte[])\n return (byte[]) source;\n else if (source instanceof Blob) {\n try {\n return ((Blob) source).getBytes((long) 1, (int) ((Blob) source).length());\n } catch (SQLException e) {\n throw new CoreException(ResourceConstants.CONVERT_FAILS, new Object[] { source.toString(), \"String_Node_Str\" });\n }\n } else\n throw new CoreException(ResourceConstants.CONVERT_FAILS, new Object[] { source.toString(), \"String_Node_Str\" });\n}\n"
|
"public void publishEvent(ActivityEvent event) {\n checkNotNull(event);\n DynamoActivityEvent hashKey = new DynamoActivityEvent();\n hashKey.setHealthCode(event.getHealthCode());\n hashKey.setEventId(event.getEventId());\n ActivityEvent savedEvent = mapper.load(hashKey);\n if (isLaterNonEnrollmentEvent(savedEvent, event)) {\n mapper.save(event);\n }\n}\n"
|
"public <T> T remove(String name) {\n names.remove(name);\n return (T) sMap.remove(makeKey(name));\n}\n"
|
"public void finalizeStructure() {\n final int layerCount = layers.size();\n this.inputCount = layers.get(0).getCount();\n this.outputCount = layers.get(layerCount - 1).getCount();\n this.layerCounts = new int[layerCount];\n this.layerContextCount = new int[layerCount];\n this.weightIndex = new int[layerCount];\n this.layerIndex = new int[layerCount];\n this.activationFunctions = new ActivationFunction[layerCount];\n this.layerFeedCounts = new int[layerCount];\n this.biasActivation = new double[layerCount];\n int index = 0;\n int neuronCount = 0;\n int weightCount = 0;\n for (int i = layers.size() - 1; i >= 0; i--) {\n final Layer layer = layers.get(i);\n Layer nextLayer = null;\n if (i > 0) {\n nextLayer = layers.get(i - 1);\n }\n this.biasActivation[index] = 1;\n this.layerCounts[index] = layer.getTotalCount();\n this.layerFeedCounts[index] = layer.getCount();\n this.activationFunctions[index] = layer.getActivation();\n neuronCount += layer.getTotalCount();\n if (nextLayer != null) {\n weightCount += layer.getCount() * nextLayer.getTotalCount();\n }\n if (index == 0) {\n this.weightIndex[index] = 0;\n this.layerIndex[index] = 0;\n } else {\n this.weightIndex[index] = this.weightIndex[index - 1] + (this.layerCounts[index] * this.layerFeedCounts[index - 1]);\n this.layerIndex[index] = this.layerIndex[index - 1] + this.layerCounts[index - 1];\n }\n int neuronIndex = 0;\n for (int j = layers.size() - 1; j >= 0; j--) {\n neuronIndex += layers.get(j).getTotalCount();\n }\n Layer prev = null;\n if (i < this.layers.size() - 1) {\n prev = this.layers.get(i + 1);\n }\n layer.finalizeStructure(this, index, prev, this.layerIndex[index], this.weightIndex[index], this.layerFeedCounts[index]);\n index++;\n }\n this.weights = new double[weightCount];\n this.layerOutput = new double[neuronCount];\n this.layerSums = new double[neuronCount];\n index = 0;\n for (int i = 0; i < this.layerIndex.length; i++) {\n final boolean hasBias = this.layerFeedCounts[i] != this.layerCounts[i];\n Arrays.fill(this.layerOutput, index, index + this.layerFeedCounts[i], 0);\n index += this.layerFeedCounts[i];\n if (hasBias) {\n this.layerOutput[index++] = this.biasActivation[i];\n }\n }\n}\n"
|
"private void processChart(Worksheet sheet, Map data) {\n String widgetId = (String) data.get(\"String_Node_Str\");\n int keyCode = (Integer) data.get(\"String_Node_Str\");\n DrawingManager dm = ((SheetCtrl) sheet).getDrawingManager();\n if (KeyEvent.DELETE == keyCode) {\n List<Chart> charts = dm.getCharts();\n for (Chart chart : charts) {\n if (chart != null && chart.getChartId().equals(widgetId)) {\n Ranges.range(sheet).deleteChart(chart);\n }\n }\n }\n}\n"
|
"public Object executeImpl(ExecutionEvent event) {\n ProjectDialog.ProjectData project = null;\n boolean cancelPressed = false;\n ProjectDialog dialog = null;\n List<IProjectPO> projList = checkAllAvailableProjects();\n if (!projList.isEmpty()) {\n if (ProjectUIBP.getInstance().shouldPerformAutoProjectLoad()) {\n project = ProjectUIBP.getMostRecentProjectData();\n } else {\n dialog = openProjectOpenDialog(projList);\n if (dialog == null || dialog.getReturnCode() == Window.CANCEL) {\n cancelPressed = true;\n } else {\n project = dialog.getSelection();\n }\n }\n if (!cancelPressed) {\n loadProject(project, projList);\n }\n }\n return null;\n}\n"
|
"public final Attr setAttributeNodeNS(Attr newAttr) {\n Attribute attr = (Attribute) newAttr;\n int j = getAttributeIndex(0, attr.getNamespace().getURI(), attr.getLocalName(), 0);\n if (j >= 0) {\n return getAttributeItems().set(j, (Attribute) newAttr);\n } else {\n getAttributeItems().add((Attribute) newAttr);\n return null;\n }\n}\n"
|
"public List<String> getBranches() {\n return parseBranches();\n}\n"
|
"public ExecutionResult execute(Item item) {\n ProcessType processType = getProcessType(item);\n if (getProject().getLanguage() != ECodeLanguage.JAVA || processType == null) {\n return ExecutionResult.NOTHING_TO_DO;\n }\n try {\n for (Object o : processType.getNode()) {\n NodeType node = (NodeType) o;\n if (ComponentUtilities.getNodeProperty(node, \"String_Node_Str\") != null) {\n if (ComponentUtilities.getNodeProperty(node, \"String_Node_Str\") == null) {\n ComponentUtilities.addNodeProperty(node, \"String_Node_Str\", \"String_Node_Str\");\n ComponentUtilities.getNodeProperty(node, \"String_Node_Str\").setValue(\"String_Node_Str\");\n }\n }\n }\n if (modified) {\n ProxyRepositoryFactory.getInstance().save(item, true);\n return ExecutionResult.SUCCESS_NO_ALERT;\n } else {\n return ExecutionResult.NOTHING_TO_DO;\n }\n } catch (Exception e) {\n ExceptionHandler.process(e);\n return ExecutionResult.FAILURE;\n }\n}\n"
|
"public boolean checkTrigger(GameEvent event, Game game) {\n Permanent enchantment = game.getPermanent(this.getSourceId());\n if (enchantment != null && enchantment.getAttachedTo() != null) {\n Player player = game.getPlayer(enchantment.getAttachedTo());\n if (player != null && game.getActivePlayerId().equals(player.getId())) {\n this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId()));\n return true;\n }\n }\n return false;\n}\n"
|
"private void addTower(int playerId, int x, int y, int radius) {\n blockArea(getTowerBlockArea(x, y), true);\n grid.addTowerAndOccupyArea((byte) playerId, new MapCircle(new ShortPoint2D(x, y), radius), getGroundArea(new ShortPoint2D(x, y)));\n}\n"
|
"protected int validateSubstringExpression(SubstringExpression expression) {\n int result = 0;\n if (expression.hasFirstExpression()) {\n Expression firstExpression = expression.getFirstExpression();\n StateFieldPathExpression pathExpression = getStateFieldPathExpression(firstExpression);\n if (pathExpression != null) {\n boolean valid = validateStateFieldPathExpression(pathExpression, PathType.BASIC_FIELD_ONLY);\n updateStatus(result, 0, valid);\n } else {\n firstExpression.accept(this);\n }\n }\n expression.getSecondExpression().accept(this);\n expression.getThirdExpression().accept(this);\n return result;\n}\n"
|
"protected final void initialize() {\n super.initialize();\n setExplosion(20);\n setLabelPosition(Position.OUTSIDE_LITERAL);\n setLeaderLineAttributes(LineAttributesImpl.create(null, LineStyle.SOLID_LITERAL, 1));\n setLeaderLineLength(40);\n setLeaderLineStyle(LeaderLineStyle.STRETCH_TO_SIDE_LITERAL);\n getLabel().setVisible(true);\n final Label la = LabelImpl.create();\n la.getCaption().getFont().setSize(16);\n la.getCaption().getFont().setBold(true);\n setTitle(la);\n setTitlePosition(Position.BELOW_LITERAL);\n}\n"
|
"public ArrayList<Job> getExpiredJobs() {\n ArrayList expiredJobs = new ArrayList();\n Iterator<Job> jobs = getJobs();\n while (jobs.hasNext()) {\n Job job = jobs.next();\n long executedTime = job.getCommandExecutionDate();\n long currentTime = System.currentTimeMillis();\n long jobsRetentionPeriod = 86400000;\n managedJobConfig = domain.getExtensionByType(ManagedJobConfig.class);\n jobsRetentionPeriod = convert(managedJobConfig.getJobRetentionPeriod());\n if (currentTime - executedTime > jobsRetentionPeriod && job.exitCode.equals(AdminCommandState.State.COMPLETED.name())) {\n expiredJobs.add(job);\n }\n }\n return expiredJobs;\n}\n"
|
"BasicProcedureContext create(DataFabricFacade dataFabricFacade) {\n DataSetContext dataSetContext = dataFabricFacade.getDataSetContext();\n Map<String, DataSet> dataSets = DataSets.createDataSets(dataSetContext, procedureSpec.getDataSets());\n BasicProcedureContext context = new BasicProcedureContext(program, runId, instanceId, instanceCount, dataSets, userArguments, procedureSpec, collectionService);\n if (dataSetContext instanceof DataSetInstantiationBase) {\n ((DataSetInstantiationBase) dataSetContext).setMetricsCollector(collectionService, context.getSystemMetrics());\n }\n return context;\n}\n"
|
"public Map<Long, Data> compareAndRemove(Collection<Data> dataList, boolean retain) {\n final LinkedHashMap<Long, Data> map = new LinkedHashMap<Long, Data>();\n for (QueueItem item : getItemQueue()) {\n if (item.getData() == null && store.isEnabled()) {\n try {\n load(item);\n } catch (Exception e) {\n throw new HazelcastException(e);\n }\n }\n boolean contains = dataList.contains(item.getData());\n if ((retain && !contains) || (!retain && contains)) {\n map.put(item.getItemId(), item.getData());\n }\n }\n mapIterateAndRemove(map);\n return map;\n}\n"
|
"public SparseVector saxpyInPlace(double scalar, Vector vector) {\n checkVectorSize(vector);\n if (vector.type() != VectorType.SPARSE) {\n for (int i = 0; i < size; i++) {\n this.set(i, this.get(i) + scalar * vector.get(i));\n }\n } else {\n List<Integer> keysUnion = new ArrayList<>(hashMap.keySet());\n keysUnion.addAll(((SparseVector) vector).hashMap.keySet());\n for (int key : keysUnion) {\n this.set(key, this.get(key) + scalar * vector.get(key));\n }\n }\n return this;\n}\n"
|
"public Map<TableId, TableStats> getTableStats(HBaseAdmin admin) throws IOException {\n Map<TableId, TableStats> datasetStat = Maps.newHashMap();\n ClusterStatus clusterStatus = admin.getClusterStatus();\n for (ServerName serverName : clusterStatus.getServers()) {\n Map<byte[], RegionLoad> regionsLoad = clusterStatus.getLoad(serverName).getRegionsLoad();\n for (RegionLoad regionLoad : regionsLoad.values()) {\n TableName tableName = HRegionInfo.getTable(regionLoad.getName());\n HTableDescriptor tableDescriptor;\n try {\n tableDescriptor = admin.getTableDescriptor(tableName);\n } catch (TableNotFoundException exception) {\n LOG.warn(\"String_Node_Str\", tableName, exception.getMessage());\n continue;\n }\n if (!isCDAPTable(tableDescriptor)) {\n continue;\n }\n TableId tableId = HTableNameConverter.from(tableDescriptor);\n TableStats stat = datasetStat.get(tableId);\n if (stat == null) {\n stat = new TableStats(regionLoad.getStorefileSizeMB(), regionLoad.getMemStoreSizeMB());\n datasetStat.put(tableId, stat);\n } else {\n stat.incStoreFileSizeMB(regionLoad.getStorefileSizeMB());\n stat.incMemStoreSizeMB(regionLoad.getMemStoreSizeMB());\n }\n }\n }\n return datasetStat;\n}\n"
|
"private void applyChangeToLocalDocument(boolean local, IDocumentChange change) {\n System.out.println();\n System.out.println(name + \"String_Node_Str\" + document.get());\n System.out.println(name + (local ? \"String_Node_Str\" : \"String_Node_Str\") + \"String_Node_Str\" + change);\n try {\n document.replace(change.getOffset(), change.getLengthOfReplacedText(), change.getText());\n } catch (BadLocationException e) {\n e.printStackTrace();\n }\n System.out.println(name + \"String_Node_Str\" + document.get());\n}\n"
|
"private IdJson saveAzureCredential(User user, CredentialJson credentialJson) {\n AzureCredential azureCredential = azureCredentialConverter.convert(credentialJson);\n azureCredential.setAzureCredentialOwner(user);\n azureCredentialRepository.save(azureCredential);\n azureCertificateService.generateCertificate(azureCredential, user);\n websocketService.sendToTopicUser(user.getEmail(), WebsocketEndPoint.CREDENTIAL, new StatusMessage(azureCredential.getId(), azureCredential.getName(), Status.CREATE_COMPLETED.name()));\n return new IdJson(azureCredential.getId());\n}\n"
|
"private static void putValue(CharSink sink, ColumnType type, Record rec, int col) {\n switch(type) {\n case BOOLEAN:\n sink.put(rec.getBool(col));\n break;\n case BYTE:\n sink.put(rec.get(col));\n break;\n case DOUBLE:\n sink.putJson(rec.getDouble(col), 10);\n break;\n case FLOAT:\n sink.putJson(rec.getFloat(col), 10);\n break;\n case INT:\n final int i = rec.getInt(col);\n if (i == Integer.MIN_VALUE) {\n sink.put(\"String_Node_Str\");\n } else {\n Numbers.append(sink, i);\n }\n break;\n case LONG:\n final long l = rec.getLong(col);\n if (l == Long.MIN_VALUE) {\n sink.put(\"String_Node_Str\");\n } else {\n sink.put(l);\n }\n break;\n case DATE:\n final long d = rec.getDate(col);\n if (d == Long.MIN_VALUE) {\n sink.put(\"String_Node_Str\");\n break;\n }\n sink.put('\"').putISODate(d).put('\"');\n break;\n case SHORT:\n sink.put(rec.getShort(col));\n break;\n case STRING:\n putStringOrNull(sink, rec.getFlyweightStr(col));\n break;\n case SYMBOL:\n putStringOrNull(sink, rec.getSym(col));\n break;\n case BINARY:\n sink.put('[');\n sink.put(']');\n break;\n default:\n break;\n }\n}\n"
|
"public void sort() {\n i = 0;\n while (i < aDat.length) {\n j = aDat.length - 1;\n while (j > i) {\n cond = aDat[j] < aDat[j - 1];\n temp = aDat[j];\n aDat[j] = Native.condMove(aDat[j - 1], aDat[j], cond);\n aDat[j - 1] = Native.condMove(temp, aDat[j - 1], cond);\n j = j - 1;\n }\n i = i + 1;\n }\n}\n"
|
"public void process(Pair<Pair<GenericData.Record, Integer>, Pair<Integer, GenericData.Record>> input, Emitter<Pair<Integer, GenericData.Record>> emitter) {\n if (lastKey == null || !lastKey.equals(input.first().first())) {\n if (lastKey != null) {\n GenericData.Record wrapper = new GenericData.Record(wrapperSchema);\n wrapper.put(\"String_Node_Str\", lastValue);\n increment(\"String_Node_Str\", \"String_Node_Str\" + outputIndex);\n emitter.emit(Pair.of(outputIndex, wrapper));\n }\n lastKey = input.first().first();\n outputIndex = (Integer) lastKey.get(\"String_Node_Str\");\n lastValue = new GenericData.Record(schemas.get(outputIndex));\n GenericRecord innerKey = (GenericRecord) lastKey.get(\"String_Node_Str\");\n for (Schema.Field sf : innerKey.getSchema().getFields()) {\n lastValue.put(sf.name(), innerKey.get(sf.name()));\n }\n }\n GenericData.Record value = input.second().second();\n for (Schema.Field sf : value.getSchema().getFields()) {\n lastValue.put(sf.name(), value.get(sf.name()));\n }\n}\n"
|
"public Collection<FieldHookDefinition> getMissingValidators(final Iterable<FieldHookDefinition> validators) {\n for (FieldHookDefinition validator : validators) {\n if (validator instanceof UnscaledValueValidator) {\n if (((UnscaledValueValidator) validator).hasUppuerBoundDefined()) {\n return Collections.emptyList();\n }\n }\n }\n return Lists.<FieldHookDefinition>newArrayList(new UnscaledValueValidator(null, null, NumberService.DEFAULT_MAX_DIGITS_IN_INTEGER));\n}\n"
|
"public static void init() throws Exception {\n cConf.set(Constants.CFG_LOCAL_DATA_DIR, tmpFolder.newFolder().getAbsolutePath());\n Injector injector = Guice.createInjector(new ConfigModule(cConf), new DiscoveryRuntimeModule().getInMemoryModules(), new SystemDatasetRuntimeModule().getInMemoryModules(), Modules.override(new DataSetsModules().getInMemoryModules()).with(new AbstractModule() {\n protected void configure() {\n bind(OwnerStore.class).to(InMemoryOwnerStore.class).in(Scopes.SINGLETON);\n }\n }), new DataFabricModules().getInMemoryModules(), new NonCustomLocationUnitTestModule().getModule(), new TransactionMetricsModule(), new NotificationFeedServiceRuntimeModule().getInMemoryModules(), new ExploreClientModule(), new ViewAdminModules().getInMemoryModules(), new AuthorizationTestModule(), new AuthenticationContextModules().getNoOpModule(), new AuthorizationEnforcementModule().getInMemoryModules(), Modules.override(new StreamAdminModules().getInMemoryModules()).with(new AbstractModule() {\n\n protected void configure() {\n bind(StreamMetaStore.class).to(InMemoryStreamMetaStore.class);\n bind(UGIProvider.class).to(UnsupportedUGIProvider.class);\n bind(OwnerAdmin.class).to(DefaultOwnerAdmin.class);\n }\n }));\n setupNamespaces(injector.getInstance(NamespacedLocationFactory.class));\n streamAdmin = injector.getInstance(StreamAdmin.class);\n coordinatorClient = injector.getInstance(StreamCoordinatorClient.class);\n coordinatorClient.startAndWait();\n}\n"
|
"private boolean canShowSettings() {\n return mPlugin.isInstalled() && isNotAutoManaged() && mPlugin.isActive() && !TextUtils.isEmpty(mPlugin.getSettingsUrl());\n}\n"
|
"public ClassInfoList intersect(final ClassInfoList... others) {\n final Set<ClassInfo> reachableClassesIntersection = new HashSet<>(reachableClasses);\n final Set<ClassInfo> directlyRelatedClassesIntersection = new HashSet<>();\n if (directlyRelatedClasses != null) {\n directlyRelatedClassesIntersection.addAll(directlyRelatedClasses);\n }\n for (final ClassInfoList other : others) {\n reachableClassesIntersection.retainAll(other);\n if (other.directlyRelatedClasses != null) {\n directlyRelatedClassesIntersecion.retainAll(other.directlyRelatedClasses);\n }\n }\n return new ClassInfoList(reachableClassesIntersection, directlyRelatedClassesIntersecion);\n}\n"
|
"public void addOutputSubstrates(List<Substrate> subs) {\n Substrate dpad = new Substrate(new Pair<Integer, Integer>(3, 2), Substrate.OUTPUT_SUBSTRATE, new Triple<Integer, Integer, Integer>(0, Substrate.OUTPUT_SUBSTRATE, 0), \"String_Node_Str\");\n dpad.addDeadNeuron(0, 0);\n dpad.addDeadNeuron(2, 0);\n dpad.addDeadNeuron(1, 1);\n subs.add(dpad);\n Substrate cstick = new Substrate(new Pair<Integer, Integer>(2, 1), Substrate.OUTPUT_SUBSTRATE, new Triple<Integer, Integer, Integer>(0, Substrate.OUTPUT_SUBSTRATE, 0), \"String_Node_Str\");\n subs.add(cstick);\n}\n"
|
"public void managerStateChanged(Manager manager) {\n Manager.State newState = manager.getState();\n if (newState != _previousState) {\n if (newState == Manager.IDLE || _areThereActiveErrorHighlights()) {\n ChangeRequest request = _getClearAllErrorHighlightsChangeRequest();\n manager.requestChange(request);\n }\n String statusMessage = manager.getStatusMessage();\n if (statusMessage.equals(_previousStatusMessage)) {\n _previousStatusMessage = statusMessage;\n statusMessage = \"String_Node_Str\";\n } else {\n _previousStatusMessage = statusMessage;\n }\n if (!statusMessage.isEmpty()) {\n statusMessage = \"String_Node_Str\" + statusMessage;\n } else {\n statusMessage = \"String_Node_Str\";\n }\n getFrame().report(manager.getState().getDescription() + statusMessage);\n _previousState = newState;\n if (newState == Manager.INITIALIZING || newState == Manager.ITERATING || newState == Manager.PREINITIALIZING || newState == Manager.RESOLVING_TYPES || newState == Manager.WRAPPING_UP || newState == Manager.EXITING) {\n ((ButtonFigureAction) _runModelAction).setSelected(true);\n ((ButtonFigureAction) _pauseModelAction).setSelected(false);\n ((ButtonFigureAction) _stopModelAction).setSelected(false);\n } else if (newState == Manager.PAUSED) {\n ((ButtonFigureAction) _runModelAction).setSelected(false);\n ((ButtonFigureAction) _pauseModelAction).setSelected(true);\n ((ButtonFigureAction) _stopModelAction).setSelected(false);\n } else {\n ((ButtonFigureAction) _runModelAction).setSelected(false);\n ((ButtonFigureAction) _pauseModelAction).setSelected(false);\n ((ButtonFigureAction) _stopModelAction).setSelected(true);\n }\n }\n}\n"
|
"public void handleRequest(final HttpServerExchange exchange) {\n final ModelNode dmr;\n final OperationResponse response;\n final HeaderMap requestHeaders = exchange.getRequestHeaders();\n final boolean cachable;\n final boolean get = exchange.getRequestMethod().equals(Methods.GET);\n final boolean encode = Common.APPLICATION_DMR_ENCODED.equals(requestHeaders.getFirst(Headers.ACCEPT)) || Common.APPLICATION_DMR_ENCODED.equals(requestHeaders.getFirst(Headers.CONTENT_TYPE));\n final OperationParameter.Builder operationParameterBuilder = new OperationParameter.Builder(get).encode(encode);\n final int streamIndex = getStreamIndex(exchange, requestHeaders);\n try {\n if (get) {\n GetOperation operation = getOperation(exchange);\n operationParameterBuilder.maxAge(operation.getMaxAge());\n dmr = convertGetRequest(exchange, operation);\n cachable = operation.getMaxAge() > 0;\n } else {\n dmr = convertPostRequest(exchange, encode);\n cachable = false;\n }\n boolean pretty = false;\n if (dmr.hasDefined(JSON_PRETTY)) {\n String jsonPretty = dmr.get(JSON_PRETTY).asString();\n pretty = jsonPretty.equals(\"String_Node_Str\") || jsonPretty.equals(\"String_Node_Str\");\n }\n operationParameterBuilder.pretty(pretty);\n } catch (Exception e) {\n ROOT_LOGGER.debugf(\"String_Node_Str\", e.getMessage());\n Common.sendError(exchange, false, e.toString());\n return;\n }\n final ResponseCallback callback = new ResponseCallback() {\n void doSendResponse(final OperationResponse response) {\n boolean closeResponse = true;\n try {\n ModelNode responseNode = response.getResponseNode();\n if (responseNode.hasDefined(OUTCOME) && FAILED.equals(responseNode.get(OUTCOME).asString())) {\n Common.sendError(exchange, encode, responseNode);\n return;\n }\n if (streamIndex < 0) {\n writeResponse(exchange, 200, responseNode, operationParameterBuilder.build());\n } else {\n List<OperationResponse.StreamEntry> streamEntries = response.getInputStreams();\n if (streamIndex >= streamEntries.size()) {\n Common.sendError(exchange, encode, new ModelNode(HttpServerLogger.ROOT_LOGGER.invalidUseStreamAsResponseIndex(streamIndex, streamEntries.size())), 400);\n } else {\n closeResponse = false;\n writeResponse(exchange, 200, response, streamIndex, operationParameterBuilder.build());\n }\n }\n } finally {\n if (closeResponse) {\n StreamUtils.safeClose(response);\n }\n }\n }\n };\n final boolean sendPreparedResponse = sendPreparedResponse(dmr);\n final ModelController.OperationTransactionControl control = sendPreparedResponse ? new ModelController.OperationTransactionControl() {\n public void operationPrepared(final ModelController.OperationTransaction transaction, final ModelNode result) {\n transaction.commit();\n result.get(OUTCOME).set(SUCCESS);\n result.get(RESULT);\n callback.sendResponse(OperationResponse.Factory.createSimple(result));\n }\n } : ModelController.OperationTransactionControl.COMMIT;\n try {\n dmr.get(OPERATION_HEADERS, ACCESS_MECHANISM).set(AccessMechanism.HTTP.toString());\n response = modelController.execute(new OperationBuilder(dmr).build(), OperationMessageHandler.logging, control);\n if (cachable && streamIndex > -1) {\n MessageDigest md = MessageDigest.getInstance(\"String_Node_Str\");\n md.update(response.toString().getBytes());\n ETag etag = new ETag(false, HexConverter.convertToHexString(md.digest()));\n operationParameterBuilder.etag(etag);\n if (!ETagUtils.handleIfNoneMatch(exchange, etag, false)) {\n exchange.setResponseCode(304);\n DomainUtil.writeCacheHeaders(exchange, 304, operationParameterBuilder.build());\n exchange.endExchange();\n return;\n }\n }\n } catch (Throwable t) {\n ROOT_LOGGER.modelRequestError(t);\n Common.sendError(exchange, encode, t.getLocalizedMessage());\n return;\n }\n callback.sendResponse(response);\n}\n"
|
"public void close() {\n try {\n if (mEnv != null) {\n mEnv.close();\n mEnv = null;\n }\n if (mSavedCD != null)\n SystemEnvironment.getInstance().setProperty(\"String_Node_Str\", mSavedCD);\n if (mSession != null) {\n mSession.release();\n mSession = null;\n }\n } catch (CoreException e) {\n mLogger.error(\"String_Node_Str\", e);\n }\n}\n"
|
"public boolean isParsingOK() {\n return parsingOK;\n}\n"
|
"public void preUpdate() {\n pre_update_count++;\n}\n"
|
"public final void postCopy(ObjectReference object, ObjectReference typeRef, int bytes, int allocator) throws InlinePragma {\n CopyMS.msSpace.postCopy(object, true);\n}\n"
|
"private void processClass(ClassDoc clazz) throws IOException {\n String packageName = clazz.containingPackage().name();\n String dir = destDir + \"String_Node_Str\" + packageName.replace('.', '/');\n (new File(dir)).mkdirs();\n String fileName = dir + \"String_Node_Str\" + clazz.name() + \"String_Node_Str\";\n String className = getClass(clazz);\n FileWriter out = new FileWriter(fileName);\n PrintWriter writer = new PrintWriter(new BufferedWriter(out));\n writer.println(\"String_Node_Str\" + \"String_Node_Str\");\n String language = \"String_Node_Str\";\n writer.println(\"String_Node_Str\" + \"String_Node_Str\" + language + \"String_Node_Str\" + language + \"String_Node_Str\");\n writer.println(\"String_Node_Str\");\n writer.println(className);\n writer.println(\"String_Node_Str\");\n writer.println(\"String_Node_Str\");\n writer.println(\"String_Node_Str\");\n writer.println(\"String_Node_Str\");\n writer.println(\"String_Node_Str\" + className + \"String_Node_Str\");\n writer.println(formatText(clazz.commentText()) + \"String_Node_Str\");\n ConstructorDoc[] constructors = clazz.constructors();\n MethodDoc[] methods = clazz.methods();\n ExecutableMemberDoc[] constructorsMethods = new ExecutableMemberDoc[constructors.length + methods.length];\n System.arraycopy(constructors, 0, constructorsMethods, 0, constructors.length);\n System.arraycopy(methods, 0, constructorsMethods, constructors.length, methods.length);\n Arrays.sort(constructorsMethods, new Comparator<ExecutableMemberDoc>() {\n public int compare(ExecutableMemberDoc a, ExecutableMemberDoc b) {\n if (a.isStatic() != b.isStatic()) {\n return a.isStatic() ? -1 : 1;\n }\n return a.name().compareTo(b.name());\n }\n });\n ArrayList<String> signatures = new ArrayList<String>();\n boolean hasMethods = false;\n int id = 0;\n for (int i = 0; i < constructorsMethods.length; i++) {\n ExecutableMemberDoc method = constructorsMethods[i];\n String name = method.name();\n if (skipMethod(method)) {\n continue;\n }\n if (!hasMethods) {\n writer.println(\"String_Node_Str\");\n hasMethods = true;\n }\n String type = getTypeName(method.isStatic(), false, getReturnType(method));\n writer.println(\"String_Node_Str\" + id + \"String_Node_Str\" + id + \"String_Node_Str\");\n writer.println(\"String_Node_Str\" + type + \"String_Node_Str\");\n Parameter[] params = method.parameters();\n StringBuilder buff = new StringBuilder();\n StringBuilder buffSignature = new StringBuilder(name);\n buff.append('(');\n for (int j = 0; j < params.length; j++) {\n if (j > 0) {\n buff.append(\"String_Node_Str\");\n }\n buffSignature.append('_');\n Parameter param = params[j];\n boolean isVarArgs = method.isVarArgs() && j == params.length - 1;\n String typeName = getTypeName(false, isVarArgs, param.type());\n buff.append(typeName);\n buffSignature.append(StringUtils.replaceAll(typeName, \"String_Node_Str\", \"String_Node_Str\"));\n buff.append(' ');\n buff.append(param.name());\n }\n buff.append(')');\n if (isDeprecated(method)) {\n name = \"String_Node_Str\" + name + \"String_Node_Str\";\n }\n String signature = buffSignature.toString();\n while (signatures.size() < i) {\n signatures.add(null);\n }\n signatures.add(i, signature);\n writer.println(\"String_Node_Str\" + signature + \"String_Node_Str\" + signature + \"String_Node_Str\" + name + \"String_Node_Str\" + buff.toString());\n String firstSentence = getFirstSentence(method.firstSentenceTags());\n if (firstSentence != null) {\n writer.println(\"String_Node_Str\" + formatText(firstSentence) + \"String_Node_Str\");\n }\n writer.println(\"String_Node_Str\");\n writer.println(\"String_Node_Str\" + id + \"String_Node_Str\" + id + \"String_Node_Str\");\n writer.println(\"String_Node_Str\" + type + \"String_Node_Str\");\n writeMethodDetails(writer, clazz, method, signature);\n writer.println(\"String_Node_Str\");\n id++;\n }\n if (hasMethods) {\n writer.println(\"String_Node_Str\");\n }\n FieldDoc[] fields = clazz.fields();\n if (clazz.interfaces().length > 0) {\n fields = clazz.interfaces()[0].fields();\n }\n Arrays.sort(fields, new Comparator<FieldDoc>() {\n public int compare(FieldDoc a, FieldDoc b) {\n return a.name().compareTo(b.name());\n }\n });\n int fieldId = 0;\n for (FieldDoc field : fields) {\n if (skipField(clazz, field)) {\n continue;\n }\n String name = field.name();\n String text = field.commentText();\n if (text == null || text.trim().length() == 0) {\n addError(\"String_Node_Str\" + getLink(clazz, field.position().line()) + \"String_Node_Str\" + name);\n }\n if (text != null && text.startsWith(\"String_Node_Str\")) {\n continue;\n }\n if (fieldId == 0) {\n writer.println(\"String_Node_Str\");\n }\n String type = getTypeName(true, false, field.type());\n writer.println(\"String_Node_Str\" + type + \"String_Node_Str\");\n String constant = field.constantValueExpression();\n String link = getFieldLink(text, constant, clazz, name);\n writer.print(\"String_Node_Str\" + link + \"String_Node_Str\" + name + \"String_Node_Str\");\n if (constant == null) {\n writer.println();\n } else {\n writer.println(\"String_Node_Str\" + constant);\n }\n writer.println(\"String_Node_Str\");\n fieldId++;\n }\n if (fieldId > 0) {\n writer.println(\"String_Node_Str\");\n }\n Arrays.sort(fields, new Comparator<FieldDoc>() {\n public int compare(FieldDoc a, FieldDoc b) {\n String ca = a.constantValueExpression();\n if (ca == null) {\n ca = a.name();\n }\n String cb = b.constantValueExpression();\n if (cb == null) {\n cb = b.name();\n }\n return ca.compareTo(cb);\n }\n });\n for (FieldDoc field : fields) {\n writeFieldDetails(writer, clazz, field);\n }\n writer.println(\"String_Node_Str\");\n writer.close();\n out.close();\n}\n"
|
"protected void init() {\n assert (content instanceof IImageContent);\n image = (IImageContent) content;\n maxWidth = parent.getCurrentMaxContentWidth();\n Dimension contentDimension = getSpecifiedDimension(image);\n root = (ContainerArea) createInlineContainer(image, true, true);\n validateBoxProperty(root.getStyle(), maxWidth, context.getMaxHeight());\n root.setAllocatedWidth(maxWidth);\n int maxContentWidth = root.getContentWidth();\n if (contentDimension.getWidth() > maxContentWidth) {\n contentDimension.setDimension(maxContentWidth, (int) (maxContentWidth / contentDimension.getRatio()));\n }\n ImageArea imageArea = (ImageArea) AreaFactory.createImageArea(image);\n imageArea.setWidth(contentDimension.getWidth());\n imageArea.setHeight(contentDimension.getHeight());\n root.addChild(imageArea);\n imageArea.setPosition(root.getContentX(), root.getContentY());\n root.setContentWidth(contentDimension.getWidth());\n root.setContentHeight(Math.min(context.getMaxHeight(), contentDimension.getHeight()));\n}\n"
|
"private void createPlayer(EvercamCamera camera) {\n startTime = new Date();\n if (evercamCamera.hasRtspUrl()) {\n Log.e(TAG, \"String_Node_Str\" + createUri(camera));\n nativeSetUri(createUri(camera));\n play(camera);\n surfaceView.setVisibility(View.VISIBLE);\n imageView.setVisibility(View.GONE);\n hideProgressView();\n } else {\n showImagesVideo = true;\n createBrowseJpgTask();\n }\n}\n"
|
"public void modifyText(ModifyEvent e) {\n String lowerStr = lowerText.getText();\n String higherStr = higherText.getText();\n if (!higherStr.equals(\"String_Node_Str\") && !CheckValueUtils.isNumberWithNegativeValue(higherStr)) {\n updateStatus(IStatus.ERROR, MSG_ONLY_NUMBER);\n } else if (lowerStr != \"String_Node_Str\" && higherStr != \"String_Node_Str\" && Double.valueOf(lowerStr) > Double.valueOf(higherStr)) {\n updateStatus(IStatus.ERROR, \"String_Node_Str\");\n } else {\n updateStatus(IStatus.OK, MSG_OK);\n }\n parameter.setMaxThreshold(higherText.getText());\n}\n"
|
"protected void browseFoldersInternal(final String library, final String identity, final Subscriber<List<Bundleable>> subscriber, final Bundle args) {\n Observable<Bundleable> o = Observable.create(new Observable.OnSubscribe<Bundleable>() {\n public void call(Subscriber<? super Bundleable> subscriber) {\n browseFolders(library, identity, subscriber, args);\n }\n }).subscribeOn(scheduler);\n final String q = args.<Uri>getParcelable(Extras.URI).getQueryParameter(Q.Q);\n if (StringUtils.equals(q, Q.FOLDERS_ONLY)) {\n o = o.filter(new Func1<Bundleable, Boolean>() {\n public Boolean call(Bundleable bundleable) {\n return bundleable instanceof Folder;\n }\n });\n } else if (StringUtils.equals(q, Q.TRACKS_ONLY)) {\n o = o.filter(new Func1<Bundleable, Boolean>() {\n public Boolean call(Bundleable bundleable) {\n return bundleable instanceof Track;\n }\n });\n }\n o.compose(new BundleableListTransformer<Bundleable>(FolderTrackCompare.func(args.getString(SORTORDER)))).subscribe(subscriber);\n}\n"
|
"protected String toHex(double color) {\n String prefix = \"String_Node_Str\";\n int roundedColor = (int) Math.round(color);\n if (roundedColor < 16)\n prefix = \"String_Node_Str\";\n return prefix + Integer.toHexString((int) Math.round(color));\n}\n"
|
"private void performClose() {\n if (error)\n return;\n if (EncogWorkBench.askQuestion(\"String_Node_Str\", \"String_Node_Str\")) {\n if (this.getEncogObject() != null) {\n Object obj = ((ProjectEGFile) this.getEncogObject()).getObject();\n if (obj instanceof NEATPopulation) {\n saveNEATPopulation();\n } else {\n saveMLMethod();\n }\n }\n if (this.train.canContinue()) {\n TrainingContinuation cont = train.pause();\n String name = FileUtil.getFileName(this.getEncogObject().getFile());\n name = FileUtil.forceExtension(name + \"String_Node_Str\", \"String_Node_Str\");\n File path = new File(name);\n EncogWorkBench.getInstance().save(path, cont);\n EncogWorkBench.getInstance().refresh();\n }\n EncogWorkBench.getInstance().refresh();\n } else {\n if (this.getEncogObject() != null) {\n ((ProjectEGFile) this.getEncogObject()).revert();\n }\n }\n}\n"
|
"public void drawSprite(int cornerX, int cornerY) {\n Minecraft mc = Minecraft.getMinecraft();\n if (drawBackround) {\n mc.renderEngine.bindTexture(TEXTURE_SLOT);\n gui.drawTexturedModalRect(cornerX + x - 1, cornerY + y - 1, 0, 0, 18, 18);\n }\n if (!isDefined()) {\n return;\n }\n if (getItemStack() != null) {\n drawStack(getItemStack());\n } else if (getIcon() != null) {\n mc.renderEngine.bindTexture(getTexture());\n GL11.glDisable(GL11.GL_LIGHTING);\n GL11.glEnable(GL11.GL_ALPHA_TEST);\n GL11.glEnable(GL11.GL_BLEND);\n gui.drawTexturedModelRectFromIcon(cornerX + x, cornerY + y, getIcon(), 16, 16);\n GL11.glPopAttrib();\n }\n}\n"
|
"public void testSubQuery4() throws Exception {\n this.GEN_add_filter = true;\n this.GEN_add_group = true;\n this.GEN_add_subquery = true;\n this.genBasicIV();\n this.closeArchiveWriter();\n DataEngineContext deContext2 = newContext(DataEngineContext.MODE_UPDATE, fileName, fileName);\n myPreDataEngine = DataEngine.newDataEngine(deContext2);\n this.UPDATE_add_filter = 0;\n this.UPDATE_add_same_group = true;\n this.UPDATE_add_subquery = 2;\n this.updatePreBasicIV();\n this.closeArchiveReader();\n this.closeArchiveWriter();\n DataEngineContext deContext3 = newContext(DataEngineContext.MODE_UPDATE, fileName, fileName);\n myPreDataEngine = DataEngine.newDataEngine(deContext3);\n this.PRE_execute_query = true;\n this.PRE_basedon_genfilter = true;\n this.PRE_add_group = 0;\n this.UPDATE_add_subquery = 2;\n this.preBasicIV();\n this.checkOutputFile();\n}\n"
|
"public void launch(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {\n this.config = config;\n Oprofile.OprofileProject.setProject(getProject());\n LaunchOptions options = new LaunchOptions();\n options.loadConfiguration(config);\n IPath exePath = getExePath(config);\n options.setBinaryImage(exePath.toOSString());\n Oprofile.OprofileProject.setProfilingBinary(options.getOprofileComboText());\n OprofileDaemonEvent[] daemonEvents = null;\n ArrayList<OprofileDaemonEvent> events = new ArrayList<>();\n if (!config.getAttribute(OprofileLaunchPlugin.ATTR_USE_DEFAULT_EVENT, false)) {\n OprofileCounter[] counters = oprofileCounters(config);\n for (int i = 0; i < counters.length; ++i) {\n if (counters[i].getEnabled()) {\n OprofileDaemonEvent[] counterEvents = counters[i].getDaemonEvents();\n events.addAll(Arrays.asList(counterEvents));\n }\n }\n daemonEvents = new OprofileDaemonEvent[events.size()];\n events.toArray(daemonEvents);\n }\n if (!preExec(options, daemonEvents, launch)) {\n return;\n }\n Process process = null;\n if (OprofileProject.getProfilingBinary().equals(OprofileProject.OPCONTROL_BINARY)) {\n String[] arguments = getProgramArgumentsArray(config);\n IRemoteCommandLauncher launcher = RemoteProxyManager.getInstance().getLauncher(oprofileProject());\n IPath workingDirPath = new Path(oprofileWorkingDirURI(config).getPath());\n for (int i = 0; i < options.getExecutionsNumber(); i++) {\n process = launcher.execute(exePath, arguments, getEnvironment(config), workingDirPath, monitor);\n DebugPlugin.newProcess(launch, process, renderProcessLabel(exePath.toOSString()));\n try {\n process.waitFor();\n } catch (InterruptedException e) {\n process.destroy();\n Status status = new Status(IStatus.ERROR, OprofileLaunchPlugin.PLUGIN_ID, OprofileLaunchMessages.getString(\"String_Node_Str\"));\n throw new CoreException(status);\n }\n }\n }\n if (OprofileProject.getProfilingBinary().equals(OprofileProject.OPERF_BINARY)) {\n String eventsString = null;\n StringBuilder spec = new StringBuilder();\n spec.append(EVENTS);\n boolean isCommaAllowed = false;\n for (int i = 0; i < events.size(); i++) {\n OprofileDaemonEvent event = events.get(i);\n if (isCommaAllowed) {\n spec.append(',');\n }\n spec.append(event.getEvent().getText());\n spec.append(OPD_SETUP_EVENT_SEPARATOR);\n spec.append(event.getResetCount());\n spec.append(OPD_SETUP_EVENT_SEPARATOR);\n spec.append(event.getEvent().getUnitMask().getMaskValue());\n spec.append(OPD_SETUP_EVENT_SEPARATOR);\n spec.append((event.getProfileKernel() ? OPD_SETUP_EVENT_TRUE : OPD_SETUP_EVENT_FALSE));\n spec.append(OPD_SETUP_EVENT_SEPARATOR);\n spec.append((event.getProfileUser() ? OPD_SETUP_EVENT_TRUE : OPD_SETUP_EVENT_FALSE));\n isCommaAllowed = true;\n }\n eventsString = spec.toString();\n ArrayList<String> argArray = new ArrayList<>(Arrays.asList(getProgramArgumentsArray(config)));\n IRemoteFileProxy proxy = RemoteProxyManager.getInstance().getFileProxy(OprofileProject.getProject());\n IFileStore dataFolder = proxy.getResource(oprofileWorkingDirURI(config).getPath() + IPath.SEPARATOR + OPROFILE_DATA);\n if (!dataFolder.fetchInfo().exists()) {\n dataFolder.mkdir(EFS.SHALLOW, null);\n }\n argArray.add(0, exePath.toOSString());\n if (events.size() > 0) {\n argArray.add(0, eventsString);\n }\n argArray.add(0, SESSION_DIR + oprofileWorkingDirURI(config).getPath() + IPath.SEPARATOR + OPROFILE_DATA);\n argArray.add(0, OprofileProject.OPERF_BINARY);\n for (int i = 0; i < options.getExecutionsNumber(); i++) {\n if (i != 0) {\n argArray.add(APPEND);\n }\n String[] arguments = new String[argArray.size()];\n arguments = argArray.toArray(arguments);\n try {\n process = RuntimeProcessFactory.getFactory().exec(arguments, OprofileProject.getProject());\n } catch (IOException e1) {\n process.destroy();\n Status status = new Status(IStatus.ERROR, OprofileLaunchPlugin.PLUGIN_ID, OprofileLaunchMessages.getString(\"String_Node_Str\"));\n throw new CoreException(status);\n }\n DebugPlugin.newProcess(launch, process, renderProcessLabel(exePath.toOSString()));\n try {\n process.waitFor();\n } catch (InterruptedException e) {\n process.destroy();\n Status status = new Status(IStatus.ERROR, OprofileLaunchPlugin.PLUGIN_ID, OprofileLaunchMessages.getString(\"String_Node_Str\"));\n throw new CoreException(status);\n }\n }\n }\n postExec(options, daemonEvents, process);\n}\n"
|
"public float compute(Iterable<Integer> a, Iterable<Integer> b, IProgressMonitor monitor) {\n Pair<List<Float>, Integer> asp = getValues(a, this.clinicalVariable);\n List<Float> as = asp.getFirst();\n int asurvived = asp.getSecond();\n if (monitor.isCanceled())\n return Float.NaN;\n Pair<List<Float>, Integer> bsp = getValues(b, this.clinicalVariable);\n List<Float> bs = bsp.getFirst();\n int bsurvived = bsp.getSecond();\n if (monitor.isCanceled())\n return Float.NaN;\n float r = Statistics.logRank(as, asurvived, bs, bsurvived);\n if (Float.isInfinite(r))\n return Float.NaN;\n return r;\n}\n"
|
"public static boolean isTimeMirror(IAggregationResultSet rs, int index) {\n for (int i = index; i < rs.getLevelCount(); i++) {\n if (rs.getLevelAttributes(i) == null || !isTimeMirrorAttributes(service.getLevelType(rs.getLevel(i))))\n return false;\n }\n return true;\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.