content stringlengths 40 137k |
|---|
"private List<String> getProjectDependentClasspath(IProject project, boolean needExported) {\n if (!hasJavaNature(project)) {\n return Collections.emptyList();\n }\n List<String> retValue = new ArrayList<String>();\n IJavaProject fCurrJProject = JavaCore.create(project);\n IClasspathEntry[] classpathEntries = null;\n boolean projectExists = (project.exists() && project.getFile(\"String_Node_Str\").exists());\n if (projectExists) {\n if (classpathEntries == null) {\n classpathEntries = fCurrJProject.readRawClasspath();\n }\n }\n if (classpathEntries != null) {\n retValue = resolveClasspathEntries(classpathEntries, needExported, fCurrJProject);\n }\n return retValue;\n}\n"
|
"private void addGroupFileViewer(final Composite parent, final int width, int height) {\n tabFolder = new CTabFolder(parent, SWT.BORDER);\n tabFolder.setLayoutData(new GridData(GridData.FILL_BOTH));\n GridData tabFolderLayoutData = (GridData) tabFolder.getLayoutData();\n tabFolderLayoutData.heightHint = height;\n previewTabItem = new CTabItem(tabFolder, SWT.BORDER);\n previewTabItem.setText(Messages.getString(\"String_Node_Str\"));\n outputTabItem = new CTabItem(tabFolder, SWT.BORDER);\n outputTabItem.setText(Messages.getString(\"String_Node_Str\"));\n Composite previewComposite = Form.startNewGridLayout(tabFolder, 1);\n outputComposite = Form.startNewGridLayout(tabFolder, 1);\n Composite compositeDelimitedFilePreviewButton = Form.startNewDimensionnedGridLayout(previewComposite, 4, width, HEIGHT_BUTTON_PIXEL);\n GridData groupLayoutData = (GridData) compositeDelimitedFilePreviewButton.getLayoutData();\n groupLayoutData.heightHint = -1;\n groupLayoutData.minimumHeight = -1;\n groupLayoutData.minimumWidth = -1;\n groupLayoutData.widthHint = -1;\n groupLayoutData.grabExcessVerticalSpace = false;\n firstRowIsCaptionCheckbox = new Button(compositeDelimitedFilePreviewButton, SWT.CHECK);\n firstRowIsCaptionCheckbox.setText(Messages.getString(\"String_Node_Str\"));\n firstRowIsCaptionCheckbox.setAlignment(SWT.LEFT);\n previewButton = new Button(compositeDelimitedFilePreviewButton, SWT.NONE);\n previewButton.setText(Messages.getString(\"String_Node_Str\"));\n previewButton.setSize(WIDTH_BUTTON_PIXEL, HEIGHT_BUTTON_PIXEL);\n new Label(compositeDelimitedFilePreviewButton, SWT.NONE);\n previewInformationLabel = new Label(compositeDelimitedFilePreviewButton, SWT.NONE);\n previewInformationLabel.setText(\"String_Node_Str\");\n previewInformationLabel.setForeground(getDisplay().getSystemColor(SWT.COLOR_BLUE));\n Composite compositeDelimitedFilePreview = Form.startNewDimensionnedGridLayout(previewComposite, 1, width, height);\n delimitedFilePreview = new ShadowProcessPreview(compositeDelimitedFilePreview, null, width, height - 10);\n delimitedFilePreview.newTablePreview();\n previewTabItem.setControl(previewComposite);\n outputTabItem.setControl(outputComposite);\n tabFolder.setSelection(previewTabItem);\n tabFolder.pack();\n}\n"
|
"public ClassDefinitionBuilder addFloatField(String fieldName) {\n check();\n fieldDefinitions.add(new FieldDefinitionImpl(index++, fieldName, FieldType.FLOAT));\n return this;\n}\n"
|
"protected Void visitLongLiteral(LongLiteral node, SubscriptContext context) {\n validateNestedArrayAccess(context);\n long value = node.getValue();\n if (value < 1 || value > MAX_VALUE) {\n throw new UnsupportedOperationException(String.format(Locale.ENGLISH, \"String_Node_Str\", MAX_VALUE));\n }\n context.index((int) value);\n return null;\n}\n"
|
"protected void resetProjectOperationSelection() {\n selectExistingProject.setSelection(true);\n refreshProjectListAreaEnable(selectExistingProject.isEnabled());\n importDemoProject.setSelection(false);\n executeImportDemoProject.setVisible(false);\n importLocalProject.setSelection(false);\n executeImportLocalProject.setVisible(false);\n createSandBoxProject.setSelection(false);\n executeCreateSandBoxProject.setVisible(false);\n createNewProject.setSelection(false);\n createNewProject.setText(Messages.getString(\"String_Node_Str\"));\n newProjectName.setVisible(false);\n executeCreateNewProject.setVisible(false);\n if (needCheckError) {\n try {\n checkErrors();\n } catch (PersistenceException e) {\n CommonExceptionHandler.process(e);\n }\n } else {\n changeFinishButtonAction();\n refreshUIFinishButtonEnable();\n finishButton.getShell().setDefaultButton(finishButton);\n }\n}\n"
|
"public void run() {\n ArraySet<Integer> persistentTaskIds = new ArraySet<Integer>();\n while (true) {\n final boolean probablyDone;\n synchronized (TaskPersister.this) {\n probablyDone = mWriteQueue.isEmpty();\n }\n if (probablyDone) {\n if (DEBUG)\n Slog.d(TAG, \"String_Node_Str\");\n persistentTaskIds.clear();\n synchronized (mService) {\n final ArrayList<TaskRecord> tasks = mService.mRecentTasks;\n if (DEBUG)\n Slog.d(TAG, \"String_Node_Str\" + tasks);\n for (int taskNdx = tasks.size() - 1; taskNdx >= 0; --taskNdx) {\n final TaskRecord task = tasks.get(taskNdx);\n if (DEBUG)\n Slog.d(TAG, \"String_Node_Str\" + task + \"String_Node_Str\" + task.isPersistable);\n if ((task.isPersistable || task.inRecents) && !task.stack.isHomeStack()) {\n if (DEBUG)\n Slog.d(TAG, \"String_Node_Str\" + task);\n persistentTaskIds.add(task.taskId);\n } else {\n if (DEBUG)\n Slog.d(TAG, \"String_Node_Str\" + task);\n }\n }\n }\n removeObsoleteFiles(persistentTaskIds);\n }\n final WriteQueueItem item;\n synchronized (TaskPersister.this) {\n if (mNextWriteTime != FLUSH_QUEUE) {\n mNextWriteTime = SystemClock.uptimeMillis() + INTER_WRITE_DELAY_MS;\n if (DEBUG)\n Slog.d(TAG, \"String_Node_Str\" + INTER_WRITE_DELAY_MS + \"String_Node_Str\" + mNextWriteTime + \"String_Node_Str\");\n }\n while (mWriteQueue.isEmpty()) {\n if (mNextWriteTime != 0) {\n mNextWriteTime = 0;\n TaskPersister.this.notifyAll();\n }\n try {\n if (DEBUG)\n Slog.d(TAG, \"String_Node_Str\");\n TaskPersister.this.wait();\n } catch (InterruptedException e) {\n }\n }\n item = mWriteQueue.remove(0);\n long now = SystemClock.uptimeMillis();\n if (DEBUG)\n Slog.d(TAG, \"String_Node_Str\" + now + \"String_Node_Str\" + mNextWriteTime + \"String_Node_Str\" + mWriteQueue.size());\n while (now < mNextWriteTime) {\n try {\n if (DEBUG)\n Slog.d(TAG, \"String_Node_Str\" + (mNextWriteTime - now));\n TaskPersister.this.wait(mNextWriteTime - now);\n } catch (InterruptedException e) {\n }\n now = SystemClock.uptimeMillis();\n }\n }\n if (item instanceof ImageWriteQueueItem) {\n ImageWriteQueueItem imageWriteQueueItem = (ImageWriteQueueItem) item;\n final String filename = imageWriteQueueItem.mFilename;\n final Bitmap bitmap = imageWriteQueueItem.mImage;\n if (DEBUG)\n Slog.d(TAG, \"String_Node_Str\" + filename);\n FileOutputStream imageFile = null;\n try {\n imageFile = new FileOutputStream(new File(sImagesDir, filename));\n bitmap.compress(Bitmap.CompressFormat.PNG, 100, imageFile);\n } catch (Exception e) {\n Slog.e(TAG, \"String_Node_Str\" + filename, e);\n } finally {\n if (imageFile != null) {\n try {\n imageFile.close();\n } catch (IOException e) {\n }\n }\n }\n } else if (item instanceof TaskWriteQueueItem) {\n StringWriter stringWriter = null;\n TaskRecord task = ((TaskWriteQueueItem) item).mTask;\n if (DEBUG)\n Slog.d(TAG, \"String_Node_Str\" + task);\n synchronized (mService) {\n if (task.inRecents) {\n try {\n if (DEBUG)\n Slog.d(TAG, \"String_Node_Str\" + task);\n stringWriter = saveToXml(task);\n } catch (IOException e) {\n } catch (XmlPullParserException e) {\n }\n }\n }\n if (stringWriter != null) {\n FileOutputStream file = null;\n AtomicFile atomicFile = null;\n try {\n atomicFile = new AtomicFile(new File(sTasksDir, String.valueOf(task.taskId) + RECENTS_FILENAME + TASK_EXTENSION));\n file = atomicFile.startWrite();\n file.write(stringWriter.toString().getBytes());\n file.write('\\n');\n atomicFile.finishWrite(file);\n } catch (IOException e) {\n if (file != null) {\n atomicFile.failWrite(file);\n }\n Slog.e(TAG, \"String_Node_Str\" + atomicFile + \"String_Node_Str\" + e);\n }\n }\n }\n }\n}\n"
|
"public FeatureVector getExpectedFeatureCounts(FgModel model, double[] params) {\n model.updateModelFromDoubles(params);\n FgModel feats = model.getDenseCopy();\n feats.zero();\n for (int i = 0; i < data.size(); i++) {\n LFgExample ex = data.get(i);\n FactorGraph fgLatPred = ex.getFgLatPred();\n fgLatPred.updateFromModel(model);\n FgInferencer infLatPred = infFactory.getInferencer(fgLatPred);\n infLatPred.run();\n addExpectedFeatureCounts(fgLatPred, infLatPred, 1.0 * ex.getWeight(), feats);\n }\n double[] f = new double[model.getNumParams()];\n feats.updateDoublesFromModel(f);\n return new FeatureVector(f);\n}\n"
|
"public boolean onKeyDown(int keyCode, KeyEvent event) {\n return mScrollView != null && mScrollView.executeKeyEvent(event);\n}\n"
|
"private static Runfiles collectRunfiles(RuleContext context, CcLinkingOutputs linkingOutputs, CcLibraryHelper.Info info, LinkStaticness linkStaticness, NestedSet<Artifact> filesToBuild, Iterable<Artifact> fakeLinkerInputs, boolean fake, ImmutableSet<CppSource> cAndCppSources) {\n Runfiles.Builder builder = new Runfiles.Builder(context.getWorkspaceName(), context.getConfiguration().legacyExternalRunfiles());\n Function<TransitiveInfoCollection, Runfiles> runfilesMapping = CppRunfilesProvider.runfilesFunction(linkStaticness != LinkStaticness.DYNAMIC);\n builder.addTransitiveArtifacts(filesToBuild);\n builder.addArtifacts(linkingOutputs.getLibrariesForRunfiles(true));\n builder.addRunfiles(context, RunfilesProvider.DEFAULT_RUNFILES);\n builder.add(context, runfilesMapping);\n CcToolchainProvider toolchain = CppHelper.getToolchain(context);\n if (linkStaticness == LinkStaticness.DYNAMIC) {\n builder.addTransitiveArtifacts(toolchain.getDynamicRuntimeLinkInputs());\n }\n if (linkCompileOutputSeparately) {\n builder.addArtifacts(LinkerInputs.toLibraryArtifacts(info.getCcLinkingOutputs().getExecutionDynamicLibraries()));\n }\n boolean linkshared = isLinkShared(context);\n if (!linkshared) {\n TransitiveInfoCollection malloc = CppHelper.mallocForTarget(context);\n builder.addTarget(malloc, RunfilesProvider.DEFAULT_RUNFILES);\n builder.addTarget(malloc, runfilesMapping);\n }\n if (fake) {\n builder.addSymlinksToArtifacts(Iterables.filter(fakeLinkerInputs, Artifact.MIDDLEMAN_FILTER));\n builder.addTransitiveArtifacts(toolchain.getCrosstool());\n builder.addTransitiveArtifacts(toolchain.getLibcLink());\n ImmutableSet.Builder<Artifact> sourcesBuilder = ImmutableSet.<Artifact>builder();\n for (CppSource cppSource : cAndCppSources) {\n sourcesBuilder.add(cppSource.getSource());\n }\n builder.addSymlinksToArtifacts(sourcesBuilder.build());\n CppCompilationContext cppCompilationContext = info.getCppCompilationContext();\n builder.addSymlinksToArtifacts(cppCompilationContext.getDeclaredIncludeSrcs());\n builder.addSymlinksToArtifacts(cppCompilationContext.getAdditionalInputs());\n builder.addSymlinksToArtifacts(cppCompilationContext.getTransitiveModules(CppHelper.usePic(context, !isLinkShared(context))));\n }\n return builder.build();\n}\n"
|
"private static void addChildFilesToList(File directory, List<File> list, String fileExtension) {\n File[] filesInThisDir = directory.listFiles();\n if (filesInThisDir == null)\n return;\n for (File f : filesInThisDir) {\n if (f.isDirectory())\n addChildFilesToList(f, list, fileExtension);\n else if (fileExtension == null || fileExtension.equalsIgnoreCase(getFileExtension(f)))\n list.add(f);\n }\n}\n"
|
"public boolean onOptionsItemSelected(MenuItem item) {\n boolean result = true;\n switch(item.getItemId()) {\n case R.id.action_itinerary:\n computeItinerary();\n result = false;\n break;\n case R.id.action_route:\n computeOptimizedItinerary();\n result = false;\n break;\n case R.id.action_locate_ext_poi:\n locateExtPoi();\n result = false;\n break;\n case R.id.action_clear_itinerary:\n if (mItineraryRenderer != null) {\n mItineraryRenderer.clear();\n }\n result = false;\n break;\n case R.id.action_clear_all:\n mItineraryRenderer.clear();\n mMapView.clearRenderer(GfxRto.class);\n result = false;\n break;\n case R.id.action_information:\n displayUIInformation();\n result = false;\n break;\n case R.id.action_switch_site:\n MainActivity act = (MainActivity) getActivity();\n result = false;\n break;\n }\n return result;\n}\n"
|
"public Status process() throws EventDeliveryException {\n Status status = Status.BACKOFF;\n Transaction transaction = this.getChannel().getTransaction();\n try {\n transaction.begin();\n List<Event> eventList = this.takeEventsFromChannel(this.getChannel(), this.batchSize);\n status = Status.BACKOFF;\n if (!eventList.isEmpty()) {\n if (eventList.size() == this.batchSize) {\n this.sinkCounter.incrementBatchCompleteCount();\n } else {\n this.sinkCounter.incrementBatchUnderflowCount();\n }\n for (Event event : eventList) {\n final DBObject document = this.eventParser.parse(event);\n getDBCollection(event).save(document);\n }\n this.sinkCounter.addToEventDrainSuccessCount(eventList.size());\n } else {\n this.sinkCounter.incrementBatchEmptyCount();\n }\n transaction.commit();\n status = Status.READY;\n } catch (ChannelException e) {\n e.printStackTrace();\n transaction.rollback();\n status = Status.BACKOFF;\n this.sinkCounter.incrementConnectionFailedCount();\n } catch (Throwable t) {\n t.printStackTrace();\n transaction.rollback();\n status = Status.BACKOFF;\n if (t instanceof Error) {\n throw new MongoSinkException(t);\n }\n } finally {\n transaction.close();\n }\n return status;\n}\n"
|
"private Intent encryptAndSignImpl(Intent data, InputStream inputStream, OutputStream outputStream, boolean sign) {\n try {\n boolean asciiArmor = data.getBooleanExtra(OpenPgpApi.EXTRA_REQUEST_ASCII_ARMOR, true);\n String originalFilename = data.getStringExtra(OpenPgpApi.EXTRA_ORIGINAL_FILENAME);\n if (originalFilename == null) {\n originalFilename = \"String_Node_Str\";\n }\n boolean enableCompression = data.getBooleanExtra(OpenPgpApi.EXTRA_ENABLE_COMPRESSION, true);\n int compressionId;\n if (enableCompression) {\n compressionId = PgpSecurityConstants.OpenKeychainCompressionAlgorithmTags.USE_DEFAULT;\n } else {\n compressionId = PgpSecurityConstants.OpenKeychainCompressionAlgorithmTags.UNCOMPRESSED;\n }\n long[] keyIds;\n {\n HashSet<Long> encryptKeyIds = new HashSet<>();\n if (data.hasExtra(OpenPgpApi.EXTRA_USER_IDS)) {\n String[] userIds = data.getStringArrayExtra(OpenPgpApi.EXTRA_USER_IDS);\n boolean isOpportunistic = data.getBooleanExtra(OpenPgpApi.EXTRA_OPPORTUNISTIC_ENCRYPTION, false);\n KeyIdResult result = returnKeyIdsFromEmails(data, userIds, isOpportunistic);\n if (result.mResultIntent != null) {\n return result.mResultIntent;\n }\n encryptKeyIds.addAll(result.mKeyIds);\n }\n if (data.hasExtra(OpenPgpApi.EXTRA_KEY_IDS)) {\n for (long keyId : data.getLongArrayExtra(OpenPgpApi.EXTRA_KEY_IDS)) {\n encryptKeyIds.add(keyId);\n }\n }\n keyIds = getUnboxedLongArray(encryptKeyIds);\n }\n long inputLength = inputStream.available();\n InputData inputData = new InputData(inputStream, inputLength, originalFilename);\n PgpSignEncryptInputParcel pseInput = new PgpSignEncryptInputParcel();\n pseInput.setEnableAsciiArmorOutput(asciiArmor).setVersionHeader(null).setCompressionAlgorithm(compressionId).setSymmetricEncryptionAlgorithm(PgpSecurityConstants.OpenKeychainSymmetricKeyAlgorithmTags.USE_DEFAULT).setEncryptionMasterKeyIds(keyIds);\n if (sign) {\n Intent signKeyIdIntent = getSignKeyMasterId(data);\n if (signKeyIdIntent.getIntExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR) == OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED) {\n return signKeyIdIntent;\n }\n long signKeyId = signKeyIdIntent.getLongExtra(OpenPgpApi.EXTRA_SIGN_KEY_ID, Constants.key.none);\n if (signKeyId == Constants.key.none) {\n throw new Exception(\"String_Node_Str\");\n } else {\n pseInput.setSignatureMasterKeyId(signKeyId);\n try {\n long signSubKeyId = mProviderHelper.getCachedPublicKeyRing(pseInput.getSignatureMasterKeyId()).getSecretSignId();\n pseInput.setSignatureSubKeyId(signSubKeyId);\n } catch (PgpKeyNotFoundException e) {\n throw new Exception(\"String_Node_Str\", e);\n }\n }\n pseInput.setSignatureHashAlgorithm(PgpSecurityConstants.OpenKeychainHashAlgorithmTags.USE_DEFAULT).setAdditionalEncryptId(signKeyId);\n }\n if (data.getIntExtra(OpenPgpApi.EXTRA_API_VERSION, -1) < 7) {\n String accName = data.getStringExtra(OpenPgpApi.EXTRA_ACCOUNT_NAME);\n if (TextUtils.isEmpty(accName)) {\n accName = \"String_Node_Str\";\n }\n final AccountSettings accSettings = mApiPermissionHelper.getAccSettings(accName);\n if (accSettings == null || (accSettings.getKeyId() == Constants.key.none)) {\n return mApiPermissionHelper.getCreateAccountIntent(data, accName);\n }\n pseInput.setAdditionalEncryptId(accSettings.getKeyId());\n }\n CryptoInputParcel inputParcel = CryptoInputParcelCacheService.getCryptoInputParcel(this, data);\n if (inputParcel == null) {\n inputParcel = new CryptoInputParcel(new Date());\n }\n if (data.hasExtra(OpenPgpApi.EXTRA_PASSPHRASE)) {\n inputParcel.mPassphrase = new Passphrase(data.getCharArrayExtra(OpenPgpApi.EXTRA_PASSPHRASE));\n }\n PgpSignEncryptOperation op = new PgpSignEncryptOperation(this, mProviderHelper, null);\n PgpSignEncryptResult pgpResult = op.execute(pseInput, inputParcel, inputData, outputStream);\n if (pgpResult.isPending()) {\n ApiPendingIntentFactory piFactory = new ApiPendingIntentFactory(getBaseContext());\n RequiredInputParcel requiredInput = pgpResult.getRequiredInputParcel();\n PendingIntent pIntent = piFactory.requiredInputPi(data, requiredInput, pgpResult.mCryptoInputParcel);\n Intent result = new Intent();\n result.putExtra(OpenPgpApi.RESULT_INTENT, pIntent);\n result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED);\n return result;\n } else if (pgpResult.success()) {\n Intent result = new Intent();\n result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_SUCCESS);\n return result;\n } else {\n LogEntryParcel errorMsg = pgpResult.getLog().getLast();\n throw new Exception(getString(errorMsg.mType.getMsgId()));\n }\n } catch (Exception e) {\n Log.d(Constants.TAG, \"String_Node_Str\", e);\n Intent result = new Intent();\n result.putExtra(OpenPgpApi.RESULT_ERROR, new OpenPgpError(OpenPgpError.GENERIC_ERROR, e.getMessage()));\n result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR);\n return result;\n }\n}\n"
|
"public static WidgetConfiguration loadConfiguration(Context context, int appWidgetId) {\n SharedPreferences widgetPrefs = context.getSharedPreferences(Constants.WIDGET_PREFS, 0);\n WidgetConfiguration widgetConfiguration = new WidgetConfiguration();\n widgetConfiguration.setShowUserComments(widgetPrefs.getBoolean(Constants.WIDGET_SHOW_USERCOMMENTS + appWidgetId, false));\n widgetConfiguration.setShowUserPhotos(widgetPrefs.getBoolean(Constants.WIDGET_SHOW_USERPHOTOS + appWidgetId, false));\n return widgetConfiguration;\n}\n"
|
"private boolean connectedCodeBase() {\n if (delegate != null)\n return true;\n if (conn.getCodeBaseIOR() == null) {\n if (conn.getBroker().transportDebugFlag)\n conn.dprint(\"String_Node_Str\" + conn);\n return false;\n }\n synchronized (iorMapLock) {\n if (delegate != null)\n return true;\n delegate = (CodeBase) CachedCodeBase.iorToCodeBaseObjMap.get(conn.getCodeBaseIOR());\n if (delegate != null)\n return true;\n delegate = CodeBaseHelper.narrow(getObjectFromIOR());\n CachedCodeBase.iorToCodeBaseObjMap.put(conn.getCodeBaseIOR(), delegate);\n }\n return true;\n}\n"
|
"public void testTouchIsDisabledOnGestureUntilAllPointersAreUp() {\n final int primaryKey1 = 'a';\n final int keyAIndex = findKeyIndex(primaryKey1);\n final int keyFIndex = findKeyIndex('f');\n final int keyJIndex = findKeyIndex('j');\n AnyKeyboard.AnyKey key1 = (AnyKeyboard.AnyKey) mEnglishKeyboard.getKeys().get(keyAIndex);\n AnyKeyboard.AnyKey key2 = (AnyKeyboard.AnyKey) mEnglishKeyboard.getKeys().get(keyJIndex);\n Assert.assertFalse(mViewUnderTest.areTouchesDisabled(null));\n ViewTestUtils.navigateFromTo(mViewUnderTest, key1, key2, 100, true, false);\n InOrder inOrder = Mockito.inOrder(mMockKeyboardListener);\n inOrder.verify(mMockKeyboardListener).onPress(primaryKey1);\n Mockito.verify(mMockKeyboardListener).onFirstDownKey(primaryKey1);\n for (int keyIndex = keyAIndex; keyIndex < keyFIndex; keyIndex++) {\n inOrder.verify(mMockKeyboardListener).onRelease(mEnglishKeyboard.getKeys().get(keyIndex).getCodeAtIndex(0, false));\n inOrder.verify(mMockKeyboardListener).onPress(mEnglishKeyboard.getKeys().get(keyIndex + 1).getCodeAtIndex(0, false));\n }\n inOrder.verify(mMockKeyboardListener).onSwipeRight(false);\n inOrder.verifyNoMoreInteractions();\n Assert.assertTrue(mViewUnderTest.areTouchesDisabled());\n ViewTestUtils.navigateFromTo(mViewUnderTest, key2, key2, 20, false, true);\n Assert.assertFalse(mViewUnderTest.areTouchesDisabled());\n}\n"
|
"public Vec3d getRenderPosition(BlockPos pos, long tick, float partialTicks) {\n long diff = tickFinished - tickStarted;\n long afterTick = tick - tickStarted;\n float interp = (afterTick + partialTicks) / diff;\n interp = Math.max(0, Math.min(1, interp));\n Vec3d center = new Vec3d(pos).addVector(0.5, 0.5, 0.5);\n Vec3d vecSide = side == null ? center : VecUtil.offset(center, side, 0.5);\n Vec3d vecFrom;\n Vec3d vecTo;\n if (interp < 0.5) {\n vecFrom = start;\n vecTo = center;\n interp *= 2;\n } else {\n vecFrom = center;\n vecTo = end;\n interp = (interp - 0.5f) * 2;\n }\n return VecUtil.scale(vecFrom, 1 - interp).add(VecUtil.scale(vecTo, interp));\n}\n"
|
"public void replaceSciptPack(ScriptPack pack, String as) throws AVM2ParseException, CompilationException, IOException, InterruptedException {\n String scriptName = pack.getPathScriptName() + \"String_Node_Str\";\n int oldIndex = pack.scriptIndex;\n int newIndex = script_info.size();\n String documentClass = \"String_Node_Str\";\n loopt: for (Tag t : swf.tags) {\n if (t instanceof SymbolClassTag) {\n SymbolClassTag sc = (SymbolClassTag) t;\n for (int i = 0; i < sc.tags.length; i++) {\n if (sc.tags[i] == 0) {\n documentClass = sc.names[i];\n break loopt;\n }\n }\n }\n }\n boolean isDocumentClass = documentClass.equals(pack.getPath().toString());\n ScriptInfo si = script_info.get(oldIndex);\n si.delete(this, true);\n int newClassIndex = instance_info.size();\n for (Trait t : si.traits.traits) {\n if (t instanceof TraitClass) {\n TraitClass tc = (TraitClass) t;\n newClassIndex = tc.class_info + 1;\n }\n }\n ActionScriptParser.compile(as, this, new ArrayList<ABC>(), isDocumentClass, scriptName, newClassIndex);\n script_info.set(oldIndex, script_info.get(newIndex));\n script_info.remove(newIndex);\n pack();\n ((Tag) parentTag).setModified(true);\n}\n"
|
"public String toString() {\n double[] aux = this.instanceData.toDoubleArray();\n StringBuilder str = new StringBuilder();\n for (int attIndex = 0; attIndex < this.numAttributes(); attIndex++) {\n if (this.attribute(attIndex).isNominal()) {\n int valueIndex = (int) this.value(attIndex);\n String stringValue = this.attribute(attIndex).value(valueIndex);\n str.append(stringValue).append(\"String_Node_Str\");\n } else if (this.attribute(attIndex).isNumeric()) {\n str.append(this.value(attIndex)).append(\"String_Node_Str\");\n } else if (this.attribute(attIndex).isDate()) {\n SimpleDateFormat dateFormatter = new SimpleDateFormat(\"String_Node_Str\");\n str.append(dateFormatter.format(this.value(attIndex))).append(\"String_Node_Str\");\n }\n }\n return str.toString();\n}\n"
|
"public void onPlayerQuit(PlayerQuitEvent event) {\n Player player = event.getPlayer();\n Messages.sendMessage(Message.left_server, player, null);\n if (event.getPlayer().getHealth() == 0 || event.getPlayer().getHealth() == -1) {\n player.setHealth(20);\n player.teleport(player.getWorld().getSpawnLocation());\n }\n long thetimestamp = System.currentTimeMillis() / 1000;\n if (Config.session_enabled && Config.session_start.equalsIgnoreCase(\"String_Node_Str\")) {\n this.plugin.AuthDB_Sessions.put(Encryption.md5(player.getName() + Util.craftFirePlayer.getIP(player)), thetimestamp);\n EBean EBeanClass = EBean.checkPlayer(player, true);\n EBeanClass.setSessiontime(thetimestamp);\n this.plugin.AuthDB_AuthTime.put(player.getName(), thetimestamp);\n }\n if (checkGuest(player, Config.guests_inventory) == false && this.plugin.isRegistered(\"String_Node_Str\", player.getName()) == false && this.plugin.isRegistered(\"String_Node_Str\", Util.checkOtherName(player.getName())) == false) {\n ItemStack[] theinv;\n if (Config.hasBackpack) {\n theinv = new ItemStack[252];\n } else {\n theinv = new ItemStack[36];\n }\n player.getInventory().setContents(theinv);\n }\n Processes.Logout(player);\n}\n"
|
"public static String getHandleInterfaceName(Role self, EndpointState s) {\n return \"String_Node_Str\" + self + \"String_Node_Str\" + s.getTakeable().stream().sorted(IOACTION_COMPARATOR).map((a) -> ActionInterfaceGenerator.getActionString(a)).collect(Collectors.joining(\"String_Node_Str\"));\n}\n"
|
"public void modelCheck() throws Exception {\n report(\"String_Node_Str\");\n if (this.checkLiveness) {\n report(\"String_Node_Str\");\n LiveCheck.init(this.tool, this.actions, this.metadir);\n report(\"String_Node_Str\");\n }\n boolean recovered = this.recover();\n if (!recovered) {\n if (!this.checkAssumptions())\n return;\n try {\n report(\"String_Node_Str\");\n MP.printMessage(EC.TLC_COMPUTING_INIT);\n if (!this.doInit(false)) {\n report(\"String_Node_Str\");\n return;\n }\n } catch (Throwable e) {\n report(\"String_Node_Str\");\n report(e);\n if (this.errState != null) {\n MP.printError(EC.TLC_INITIAL_STATE, new String[] { msg, this.errState.toString() });\n } else {\n MP.printError(EC.GENERAL, e.getMessage());\n }\n this.tool.setCallStack();\n try {\n this.numOfGenStates = 0;\n this.doInit(true);\n } catch (Throwable e1) {\n MP.printError(EC.TLC_NESTED_EXPRESSION, this.tool.getCallStack().toString());\n }\n this.printSummary(false);\n this.cleanup(false);\n report(\"String_Node_Str\");\n return;\n }\n if (this.numOfGenStates == this.theFPSet.size()) {\n String plural = (this.numOfGenStates == 1) ? \"String_Node_Str\" : \"String_Node_Str\";\n MP.printMessage(EC.TLC_INIT_GENERATED1, new String[] { String.valueOf(this.numOfGenStates), plural });\n } else {\n MP.printMessage(EC.TLC_INIT_GENERATED1, new String[] { String.valueOf(this.numOfGenStates), String.valueOf(this.theFPSet.size()) });\n }\n }\n report(\"String_Node_Str\");\n if (this.actions.length == 0) {\n this.reportSuccess();\n this.printSummary(true);\n this.cleanup(true);\n report(\"String_Node_Str\");\n return;\n }\n boolean success = false;\n try {\n report(\"String_Node_Str\");\n success = this.runTLC(Integer.MAX_VALUE);\n if (!success) {\n report(\"String_Node_Str\");\n return;\n }\n if (this.errState == null) {\n if (this.checkLiveness) {\n MP.printMessage(EC.TLC_CHECKING_TEMPORAL_PROPS, \"String_Node_Str\");\n report(\"String_Node_Str\");\n success = LiveCheck.check();\n report(\"String_Node_Str\");\n if (!success) {\n report(\"String_Node_Str\");\n return;\n }\n }\n success = true;\n this.reportSuccess();\n } else if (this.keepCallStack) {\n this.tool.setCallStack();\n try {\n this.doNext(this.predErrState, new ObjLongTable(10));\n } catch (Throwable e) {\n MP.printError(EC.TLC_NESTED_EXPRESSION, this.tool.getCallStack().toString());\n }\n }\n } catch (Exception e) {\n report(\"String_Node_Str\");\n success = false;\n MP.printError(EC.GENERAL, e.getMessage());\n } finally {\n this.printSummary(success);\n this.cleanup(success);\n }\n report(\"String_Node_Str\");\n}\n"
|
"public void abort(OperationContext context, Transaction transaction) throws OperationException, TException {\n MetricsHelper helper = newHelper(\"String_Node_Str\");\n if (Log.isTraceEnabled())\n Log.trace(\"String_Node_Str\");\n try {\n TOperationContext tcontext = wrap(context);\n client.abort(tcontext, wrap(transaction));\n if (Log.isTraceEnabled())\n Log.trace(\"String_Node_Str\");\n helper.success();\n } catch (TOperationException te) {\n helper.failure();\n throw unwrap(te);\n } catch (TException te) {\n helper.failure();\n throw te;\n }\n}\n"
|
"private static String createSHA1String(final File file) throws IOException {\n FileInputStream fis = new FileInputStream(file);\n MessageDigest md = null;\n try {\n md = MessageDigest.getInstance(\"String_Node_Str\");\n } catch (NoSuchAlgorithmException e) {\n throw new IOException(\"String_Node_Str\");\n }\n byte[] buffer = new byte[16384];\n int read;\n while ((read = fis.read(buffer)) != -1) {\n long start = System.currentTimeMillis();\n md.update(buffer, 0, read);\n long end = System.currentTimeMillis();\n long interval = Math.abs(end - start);\n try {\n Thread.sleep(interval * 2);\n } catch (InterruptedException e) {\n }\n }\n fis.close();\n byte[] sha1 = md.digest();\n return UrnType.URN_NAMESPACE_ID + UrnType.SHA1_STRING + Base32.encode(sha1);\n}\n"
|
"public void testLateRootTask() throws InterruptedException {\n final String rootTaskId = \"String_Node_Str\";\n final String[] childTaskIds = new String[] { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\" };\n final AtomicInteger numMsgs = new AtomicInteger(0);\n final EStage<GroupCommunicationMessage> senderStage = new SyncStage<>(new EventHandler<GroupCommunicationMessage>() {\n\n public void onNext(final GroupCommunicationMessage msg) {\n numMsgs.getAndIncrement();\n }\n }, 1);\n final CommunicationGroupDriverImpl communicationGroupDriver = new CommunicationGroupDriverImpl(GroupName.class, new AvroConfigurationSerializer(), senderStage, new BroadcastingEventHandler<RunningTask>(), new BroadcastingEventHandler<FailedTask>(), new BroadcastingEventHandler<FailedEvaluator>(), new BroadcastingEventHandler<GroupCommunicationMessage>(), \"String_Node_Str\", 4, 2);\n communicationGroupDriver.addBroadcast(BroadcastOperatorName.class, BroadcastOperatorSpec.newBuilder().setSenderId(rootTaskId).build()).addReduce(ReduceOperatorName.class, ReduceOperatorSpec.newBuilder().setReceiverId(rootTaskId).build());\n final ExecutorService pool = Executors.newFixedThreadPool(4);\n final CountDownLatch countDownLatch = new CountDownLatch(4);\n for (int index = 0; index < 3; index++) {\n final String childId = childTaskIds[index];\n pool.submit(new Runnable() {\n public void run() {\n final Configuration childTaskConf = TaskConfiguration.CONF.set(TaskConfiguration.IDENTIFIER, childId).set(TaskConfiguration.TASK, DummyTask.class).build();\n communicationGroupDriver.addTask(childTaskConf);\n communicationGroupDriver.runTask(childId);\n countDownLatch.countDown();\n }\n });\n }\n pool.submit(new Runnable() {\n public void run() {\n try {\n Thread.sleep(3000);\n } catch (final InterruptedException e) {\n throw new RuntimeException(e);\n }\n final Configuration rootTaskConf = TaskConfiguration.CONF.set(TaskConfiguration.IDENTIFIER, rootTaskId).set(TaskConfiguration.TASK, DummyTask.class).build();\n communicationGroupDriver.addTask(rootTaskConf);\n communicationGroupDriver.runTask(rootTaskId);\n countDownLatch.countDown();\n }\n });\n pool.shutdown();\n final boolean allThreadsFinished = countDownLatch.await(10, TimeUnit.SECONDS);\n assertTrue(\"String_Node_Str\", allThreadsFinished);\n assertEquals(\"String_Node_Str\", 12, numMsgs.get());\n}\n"
|
"void handleBeforeAttributeName() {\n if (tryCreateTagEnd()) {\n return;\n }\n if (consumeWhitespace()) {\n return;\n }\n RawTextNode identifier = consumeHtmlIdentifier(EXPECTED_ATTRIBUTE_NAME);\n if (identifier == null) {\n context.resetAttribute();\n return;\n }\n context.startAttribute(identifier);\n}\n"
|
"public void build(String[] args) throws IOException {\n super.build(args);\n MechModel mech = new MechModel(\"String_Node_Str\");\n addModel(mech);\n addVerticalSprings(mech);\n for (AxialSpring s : mech.axialSprings()) {\n s.setRenderProps(null);\n }\n RenderProps.setLineStyle(mech, LineStyle.CYLINDER);\n RenderProps.setLineRadius(mech, 0.02);\n}\n"
|
"public void commitWallPost(UUID txnId, String args) throws IOException {\n Object[] objArgs = parseArgs(args);\n List<String> nameList = (List<String>) objArgs[0];\n String message = (String) objArgs[1];\n List<File> oldTemps = Utility.getMatchingFiles(addr, WALL_POST_TEMP_PREFIX);\n for (File f : oldTemps) {\n String txnIdString = txnId.toString();\n String fileTxnString = f.getName().substring(f.getName().indexOf(\"String_Node_Str\") + 2);\n printOutput(\"String_Node_Str\" + fileTxnString + \"String_Node_Str\" + txnIdString);\n if (!fileTxnString.equals(txnIdString)) {\n printOutput(\"String_Node_Str\" + f.getName());\n this.getWriter(f.getName(), false).delete();\n }\n }\n for (String name : nameList) {\n if (Utility.fileExists(this, MESSAGES_PREFIX + name)) {\n String tempFileName = getWallTempName(txnId, name);\n PersistentStorageReader tempReader = null;\n if (Utility.fileExists(this, tempFileName)) {\n tempReader = this.getReader(tempFileName);\n }\n if (tempReader != null && tempReader.ready()) {\n char[] buf = new char[MAX_FILE_SIZE];\n tempReader.read(buf, 0, MAX_FILE_SIZE);\n PersistentStorageWriter postsFileWriter = this.getWriter(MESSAGES_PREFIX + name, false);\n postsFileWriter.write(buf);\n } else {\n assert (Utility.fileExists(this, MESSAGES_PREFIX + name));\n PersistentStorageReader masterFileReader = this.getReader(MESSAGES_PREFIX + name);\n char[] buf = new char[MAX_FILE_SIZE];\n int length = masterFileReader.read(buf, 0, MAX_FILE_SIZE);\n String contents;\n if (length == -1) {\n contents = \"String_Node_Str\";\n } else {\n contents = new String(buf, 0, length);\n }\n contents += message + '\\n';\n PersistentStorageWriter tempWriter = this.getWriter(tempFileName, false);\n tempWriter.write(contents);\n PersistentStorageWriter masterWriter = this.getWriter(MESSAGES_PREFIX + name, false);\n masterWriter.write(contents);\n }\n }\n }\n if (addr == CLIENT_ID) {\n printOutput(\"String_Node_Str\");\n }\n}\n"
|
"private Object populateEntityFromHbaseData(Object entity, HBaseData hbaseData, EntityMetadata m, String rowKey, List<String> relationNames) {\n try {\n PropertyAccessorHelper.setId(entity, m, new String(hbaseData.getRowKey()));\n List<KeyValue> hbaseValues = hbaseData.getColumns();\n Map<String, Object> relations = new HashMap<String, Object>();\n List<Column> columns = m.getColumnsAsList();\n for (Column column : columns) {\n Field columnField = column.getField();\n String columnName = column.getName();\n for (KeyValue colData : hbaseValues) {\n String hbaseColumn = Bytes.toString(colData.getFamily());\n String colName = hbaseColumn;\n if (colName != null && colName.equalsIgnoreCase(columnName.toLowerCase())) {\n byte[] hbaseColumnValue = colData.getValue();\n PropertyAccessorHelper.set(entity, columnField, hbaseColumnValue);\n } else if (relationNames != null && relationNames.contains(colName)) {\n relations.put(colName, Bytes.toString(colData.getValue()));\n }\n }\n }\n List<EmbeddedColumn> columnFamilies = m.getEmbeddedColumnsAsList();\n for (EmbeddedColumn columnFamily : columnFamilies) {\n Field columnFamilyFieldInEntity = columnFamily.getField();\n Class<?> columnFamilyClass = columnFamilyFieldInEntity.getType();\n Map<String, Field> columnNameToFieldMap = MetadataUtils.createColumnsFieldMap(m, columnFamily);\n if (Collection.class.isAssignableFrom(columnFamilyClass)) {\n Field embeddedCollectionField = columnFamily.getField();\n Object[] embeddedObjectArr = new Object[hbaseValues.size()];\n Object embeddedObject = MetadataUtils.getEmbeddedGenericObjectInstance(embeddedCollectionField);\n int prevCFNameCounter = 0;\n for (KeyValue colData : hbaseValues) {\n String cfInHbase = Bytes.toString(colData.getFamily());\n if (!cfInHbase.startsWith(columnFamily.getName())) {\n if (relationNames != null && relationNames.contains(cfInHbase)) {\n relations.put(cfInHbase, Bytes.toString(colData.getValue()));\n }\n continue;\n }\n String cfNamePostfix = MetadataUtils.getEmbeddedCollectionPostfix(cfInHbase);\n int cfNameCounter = Integer.parseInt(cfNamePostfix);\n if (cfNameCounter != prevCFNameCounter) {\n prevCFNameCounter = cfNameCounter;\n embeddedObject = MetadataUtils.getEmbeddedGenericObjectInstance(embeddedCollectionField);\n }\n setHBaseDataIntoObject(colData, columnFamilyFieldInEntity, columnNameToFieldMap, embeddedObject);\n embeddedObjectArr[cfNameCounter] = embeddedObject;\n ElementCollectionCacheManager.getInstance().addElementCollectionCacheMapping(rowKey, embeddedObject, cfInHbase);\n }\n Collection embeddedCollection = MetadataUtils.getEmbeddedCollectionInstance(embeddedCollectionField);\n embeddedCollection.addAll(Arrays.asList(embeddedObjectArr));\n embeddedCollection.removeAll(Collections.singletonList(null));\n embeddedObjectArr = null;\n if (embeddedCollection != null && !embeddedCollection.isEmpty()) {\n PropertyAccessorHelper.set(entity, embeddedCollectionField, embeddedCollection);\n }\n } else {\n Object columnFamilyObj = columnFamilyClass.newInstance();\n for (KeyValue colData : hbaseValues) {\n String cfInHbase = Bytes.toString(colData.getFamily());\n if (!cfInHbase.equals(columnFamily.getName())) {\n if (relationNames != null && relationNames.contains(cfInHbase)) {\n relations.put(cfInHbase, Bytes.toString(colData.getValue()));\n }\n continue;\n }\n String colName = Bytes.toString(colData.getQualifier());\n byte[] columnValue = colData.getValue();\n Field columnField = columnNameToFieldMap.get(colName);\n if (columnField != null) {\n if (columnFamilyFieldInEntity.isAnnotationPresent(Embedded.class) || columnFamilyFieldInEntity.isAnnotationPresent(ElementCollection.class)) {\n PropertyAccessorHelper.set(columnFamilyObj, columnField, columnValue);\n } else {\n columnFamilyObj = Bytes.toString(columnValue);\n }\n }\n }\n PropertyAccessorHelper.set(entity, columnFamilyFieldInEntity, columnFamilyObj);\n }\n }\n if (!relations.isEmpty()) {\n return new EnhanceEntity(entity, rowKey, relations);\n }\n return entity;\n } catch (PropertyAccessException e1) {\n throw new RuntimeException(e1.getMessage());\n } catch (InstantiationException e1) {\n throw new RuntimeException(e1.getMessage());\n } catch (IllegalAccessException e1) {\n throw new RuntimeException(e1.getMessage());\n }\n}\n"
|
"public void perform(Arguments arguments, PrintStream output) throws Exception {\n DatasetId instance = cliConfig.getCurrentNamespace().dataset(arguments.get(ArgumentName.DATASET.toString()));\n DatasetMeta meta = datasetClient.get(instance);\n Table table = Table.builder().setHeader(\"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\").setRows(ImmutableList.of(meta), new RowMaker<DatasetMeta>() {\n public List<?> makeRow(DatasetMeta object) {\n return Lists.newArrayList(object.getHiveTableName(), GSON.toJson(object.getSpec()), GSON.toJson(object.getType()));\n }\n }).build();\n cliConfig.getTableRenderer().render(cliConfig, output, table);\n}\n"
|
"private void killJobOnUnix(final int pid) throws GenieException {\n try {\n final Calendar tomorrow = Calendar.getInstance(JobConstants.UTC);\n tomorrow.add(Calendar.DAY_OF_YEAR, 1);\n final ProcessChecker processChecker = new UnixProcessChecker(pid, this.executor, tomorrow.getTime());\n processChecker.checkProcess();\n } catch (final ExecuteException ee) {\n log.debug(\"String_Node_Str\", pid);\n return;\n } catch (final IOException ioe) {\n throw new GenieServerException(\"String_Node_Str\" + pid, ioe);\n }\n try {\n final CommandLine killCommand;\n if (this.runAsUser) {\n killCommand = new CommandLine(\"String_Node_Str\");\n killCommand.addArgument(\"String_Node_Str\");\n } else {\n killCommand = new CommandLine(\"String_Node_Str\");\n }\n killCommand.addArguments(Integer.toString(pid));\n this.executor.execute(killCommand);\n } catch (final IOException ioe) {\n throw new GenieServerException(\"String_Node_Str\" + pid, ioe);\n }\n}\n"
|
"protected boolean explainExpression(String expression) {\n if (expression == null || expression.isEmpty()) {\n return false;\n }\n return !expression.startsWith(\"String_Node_Str\");\n}\n"
|
"public void handleUpdate(ServerContext context, UpdateRequest request, ResultHandler<Resource> handler) {\n try {\n String objectClass = getObjectClass(context);\n RequestHandler delegate = objectClassHandlers.get(objectClass);\n if (null != delegate) {\n delegate.handleUpdate(context, request, handler);\n } else {\n handler.handleError(new NotFoundException(\"String_Node_Str\" + objectClass));\n }\n } catch (ResourceException e) {\n handler.handleError(e);\n } catch (Exception e) {\n handler.handleError(new InternalServerErrorException(e.getMessage(), e));\n }\n}\n"
|
"public void testAbstractCovariance_GRE272() {\n runNegativeTest(new String[] { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\" }, \"String_Node_Str\");\n}\n"
|
"public boolean checkReadOnly() {\n IProxyRepositoryFactory repFactory = DesignerPlugin.getDefault().getProxyRepositoryFactory();\n boolean readOnlyLocal = !isLastVersion(property.getItem()) || !repFactory.isEditableAndLockIfPossible(property.getItem());\n this.setReadOnly(readOnlyLocal);\n return readOnlyLocal;\n}\n"
|
"void processMasternodeBroadcast(MasternodeBroadcast mnb) {\n lock.lock();\n try {\n if (mapSeenMasternodeBroadcast.containsKey(mnb.getHash())) {\n params.masternodeSync.addedMasternodeList(mnb.getHash());\n return;\n }\n mapSeenMasternodeBroadcast.put(mnb.getHash(), mnb);\n } finally {\n lock.unlock();\n }\n mapSeenMasternodeBroadcast.put(mnb.getHash(), mnb);\n int nDoS = 0;\n if (!mnb.checkAndUpdate()) {\n return;\n }\n if (!DarkSendSigner.isVinAssociatedWithPubkey(params, mnb.vin, mnb.pubkey)) {\n log.info(\"String_Node_Str\");\n return;\n }\n if (mnb.checkInputsAndAdd()) {\n } else {\n log.info(\"String_Node_Str\" + mnb.address.toString());\n }\n}\n"
|
"public void testImplementingInterface2() {\n runConformTest(new String[] { \"String_Node_Str\", \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" }, \"String_Node_Str\");\n}\n"
|
"protected void createContents() {\n super.createContents();\n shlNewSet.setText(\"String_Node_Str\");\n text.setEditable(false);\n text.removeModifyListener(new ModifyKey());\n btnOk.setEnabled(true);\n for (String value : values) {\n TableItem item = new TableItem(table, SWT.NONE);\n item.setText(value);\n }\n}\n"
|
"public synchronized String getFileName() {\n if (_fileName != null)\n return _fileName;\n String ret = null;\n if (dloaders.size() > 0)\n ret = ((HTTPDownloader) dloaders.get(0)).getRemoteFileDesc().getFileName();\n else if (files != null && files.size() > 0)\n ret = ((RemoteFileDesc) files.get(0)).getFileName();\n else if (allFiles.length > 0)\n ret = allFiles[0].getFileName();\n else\n ret = UNKNOWN_FILENAME;\n return CommonUtils.convertFileName(ret);\n}\n"
|
"public void testExtendingInterface2() {\n runNegativeTest(new String[] { \"String_Node_Str\", \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" }, \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\");\n}\n"
|
"public void convertToProcessNode(ConnectionItem connectionItem, String tableName) throws ProcessorException {\n EDatabaseComponentName name = EDatabaseComponentName.getCorrespondingComponentName(connectionItem, ERepositoryObjectType.METADATA_CONNECTIONS);\n String componentName = null;\n componentName = name.getDefaultComponentName();\n IComponent dbInputComponent = ComponentsFactoryProvider.getInstance().get(componentName, ComponentCategory.CATEGORY_4_DI.getName());\n Process process = new Process(GuessSchemaProcess.getNewmockProperty());\n node = new Node(dbInputComponent, process);\n selectedContext = node.getProcess().getContextManager().getDefaultContext();\n IMetadataTable table = UpdateRepositoryUtils.getTableByName(connectionItem, tableName);\n if (table == null) {\n table = new MetadataTable();\n table.setTableName(tableName);\n table.setLabel(tableName);\n }\n IElementParameter propertyParam = ((Node) node).getElementParameterFromField(EParameterFieldType.PROPERTY_TYPE);\n IElementParameter schemaParam = ((Node) node).getElementParameterFromField(EParameterFieldType.SCHEMA_TYPE);\n String propertyId = connectionItem.getProperty().getId();\n String schema = databaseConnection.getUiSchema();\n String dbType = databaseConnection.getDatabaseType();\n String value = connectionItem.getProperty().getId() + \"String_Node_Str\" + table.getLabel();\n CompoundCommand cc = new CompoundCommand();\n ChangeValuesFromRepository changeValueCommand = new ChangeValuesFromRepository(node, databaseConnection, propertyParam.getName() + \"String_Node_Str\" + EParameterName.REPOSITORY_PROPERTY_TYPE.getName(), propertyId);\n cc.add(changeValueCommand);\n RepositoryChangeMetadataCommand changeMetadataCommand = new RepositoryChangeMetadataCommand((Node) node, schemaParam.getName() + \"String_Node_Str\" + EParameterName.REPOSITORY_SCHEMA_TYPE.getName(), value, table, null, null);\n cc.add(changeMetadataCommand);\n QueryGuessCommand queryGuessCommand = new QueryGuessCommand(node, node.getMetadataList().get(0), schema, dbType, databaseConnection);\n cc.add(queryGuessCommand);\n cc.execute();\n IElementParameter query = node.getElementParameter(\"String_Node_Str\");\n memoSQL = query.getValue().toString();\n String memoSQLTemp = TalendTextUtils.removeQuotesIfExist(memoSQL);\n if ((memoSQLTemp == null || memoSQLTemp.equals(\"String_Node_Str\")) && tableName != null && !tableName.equals(\"String_Node_Str\")) {\n memoSQL = \"String_Node_Str\" + tableName;\n memoSQL = TalendTextUtils.addSQLQuotes(memoSQL);\n }\n}\n"
|
"public Resource createResource(String identifier) throws RbacManagerException {\n return null;\n}\n"
|
"private Position parsePositionReport2(ChannelBuffer buf, int sequenceNumber, long timestamp) {\n Position position = new Position();\n position.setProtocol(getProtocolName());\n position.set(Event.KEY_INDEX, sequenceNumber);\n position.setDeviceId(getDeviceId());\n position.setTime(convertTimestamp(timestamp));\n position.setLatitude(buf.readInt() * 0.0000001);\n position.setLongitude(buf.readInt() * 0.0000001);\n buf.readUnsignedByte();\n position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedByte()));\n short flags = buf.readUnsignedByte();\n position.setValid((flags & 0x80) == 0x80 && (flags & 0x40) == 0x40);\n position.set(Event.KEY_SATELLITES, buf.readUnsignedByte());\n buf.readUnsignedInt();\n return position;\n}\n"
|
"private void readTileData(File outputFile, int tileX, int tileY, int tileWidth, int tileHeight, int jp2TileX, int jp2TileY, int jp2TileWidth, int jp2TileHeight, short[] tileData, Rectangle destRect) throws IOException {\n synchronized (this) {\n if (!locks.containsKey(outputFile)) {\n locks.put(outputFile, new Object());\n }\n }\n final Object lock = locks.get(outputFile);\n synchronized (lock) {\n Jp2File jp2File = getOpenJ2pFile(outputFile);\n int jp2Width = jp2File.width;\n int jp2Height = jp2File.height;\n if (jp2Width > jp2TileWidth || jp2Height > jp2TileHeight) {\n throw new IllegalStateException(String.format(\"String_Node_Str\", jp2Width, jp2TileWidth, jp2Height, jp2TileHeight));\n }\n int jp2X = destRect.x - jp2TileX * jp2TileWidth;\n int jp2Y = destRect.y - jp2TileY * jp2TileHeight;\n if (jp2X < 0 || jp2Y < 0) {\n throw new IllegalStateException(String.format(\"String_Node_Str\", jp2X, jp2Y));\n }\n final ImageInputStream stream = jp2File.stream;\n if (jp2X == 0 && jp2Width == tileWidth && jp2Y == 0 && jp2Height == tileHeight && tileWidth * tileHeight == tileData.length) {\n stream.seek(jp2File.dataPos);\n stream.readFully(tileData, 0, tileData.length);\n } else {\n final Rectangle jp2FileRect = new Rectangle(0, 0, jp2Width, jp2Height);\n final Rectangle tileRect = new Rectangle(jp2X, jp2Y, tileWidth, tileHeight);\n final Rectangle intersection = jp2FileRect.intersection(tileRect);\n if (!intersection.isEmpty()) {\n long seekPos = jp2File.dataPos + S2Config.SAMPLE_BYTE_COUNT * (intersection.y * jp2Width + intersection.x);\n int tilePos = 0;\n for (int y = 0; y < intersection.height; y++) {\n stream.seek(seekPos);\n stream.readFully(tileData, tilePos, intersection.width);\n seekPos += S2Config.SAMPLE_ELEM_SIZE * jp2Width;\n tilePos += tileWidth;\n for (int x = intersection.width; x < tileWidth; x++) {\n tileData[y * tileWidth + x] = S2Config.FILL_CODE_OUT_OF_X_BOUNDS;\n }\n }\n for (int y = intersection.height; y < tileWidth; y++) {\n for (int x = 0; x < tileWidth; x++) {\n tileData[y * tileWidth + x] = S2Config.FILL_CODE_OUT_OF_Y_BOUNDS;\n }\n }\n } else {\n Arrays.fill(tileData, S2Config.FILL_CODE_NO_INTERSECTION);\n }\n }\n }\n}\n"
|
"public static ValueAndError empty() {\n return EMPTY_VALUE_AND_ERROR;\n}\n"
|
"public SkyValue compute(SkyKey skyKey, Environment env) throws RecursiveFilesystemTraversalFunctionException, InterruptedException {\n TraversalRequest traversal = (TraversalRequest) skyKey.argument();\n try {\n FileInfo rootInfo = lookUpFileInfo(env, traversal);\n if (!rootInfo.type.exists()) {\n if (rootInfo.type.isSymlink()) {\n return resultForDanglingSymlink(traversal.root.asRootedPath(), rootInfo);\n } else {\n return RecursiveFilesystemTraversalValue.EMPTY;\n }\n }\n if (rootInfo.type.isFile()) {\n return resultForFileRoot(traversal.path, rootInfo);\n }\n PkgLookupResult pkgLookupResult = checkIfPackage(env, traversal, rootInfo);\n traversal = pkgLookupResult.traversal;\n if (pkgLookupResult.isConflicting()) {\n throw new RecursiveFilesystemTraversalFunctionException(new GeneratedPathConflictException(traversal));\n } else if (pkgLookupResult.isPackage() && !traversal.skipTestingForSubpackage) {\n String msg = traversal.errorInfo + \"String_Node_Str\" + traversal.path.getRootRelativePath().getPathString();\n switch(traversal.crossPkgBoundaries) {\n case CROSS:\n env.getListener().handle(Event.warn(null, msg));\n break;\n case DONT_CROSS:\n return RecursiveFilesystemTraversalValue.EMPTY;\n case REPORT_ERROR:\n throw new RecursiveFilesystemTraversalFunctionException(new CannotCrossPackageBoundaryException(msg));\n default:\n throw new IllegalStateException(traversal.toString());\n }\n }\n Collection<SkyKey> dependentKeys = createRecursiveTraversalKeys(env, traversal);\n return resultForDirectory(traversal, rootInfo, traverseChildren(env, dependentKeys));\n } catch (IOException e) {\n throw new RecursiveFilesystemTraversalFunctionException(new FileOperationException(\"String_Node_Str\" + e.getMessage()));\n } catch (MissingDepException e) {\n return null;\n }\n}\n"
|
"public long getIteration() {\n return iterations.get() - 1;\n}\n"
|
"private void skipWhitespace() {\n while (ch <= ' ' && length-- > 0) {\n ch = input.nextChar();\n }\n}\n"
|
"private void createBuildPropertiesFile(final String featureLocation, final String[][] configurations) throws IOException {\n File file = new File(featureLocation);\n if (!file.exists() || !file.isDirectory()) {\n if (!file.mkdirs()) {\n throw new IOException(Messages.creatorCouldntCopy + \"String_Node_Str\" + file);\n }\n }\n Properties properties = new Properties();\n handleRootFiles(configurations, properties, featureLocation);\n handleJREInfo(configurations, properties);\n handleExportSource(properties);\n File fileToSave = new File(file, ICoreConstants.BUILD_FILENAME_DESCRIPTOR);\n save(fileToSave, properties, \"String_Node_Str\");\n}\n"
|
"public void insertModel(MLModelNew model) throws DatabaseHandlerException {\n Connection connection = null;\n PreparedStatement insertStatement = null;\n try {\n connection = dbh.getDataSource().getConnection();\n connection.setAutoCommit(false);\n insertStatement = connection.prepareStatement(SQLQueries.INSERT_MODEL);\n insertStatement.setString(1, model.getName());\n insertStatement.setLong(2, model.getAnalysisId());\n insertStatement.setLong(3, model.getVersionSetId());\n insertStatement.setInt(4, model.getTenantId());\n insertStatement.setString(5, model.getUserName());\n insertStatement.setString(6, model.getStorageType());\n insertStatement.setString(7, model.getStorageDirectory());\n insertStatement.setString(8, MLConstants.MODEL_STATUS_NOT_STARTED);\n insertStatement.execute();\n connection.commit();\n if (logger.isDebugEnabled()) {\n logger.debug(\"String_Node_Str\");\n }\n } catch (SQLException e) {\n MLDatabaseUtils.rollBack(connection);\n throw new DatabaseHandlerException(\"String_Node_Str\" + \"String_Node_Str\" + e.getMessage(), e);\n } finally {\n MLDatabaseUtils.enableAutoCommit(connection);\n MLDatabaseUtils.closeDatabaseResources(connection, insertStatement);\n }\n}\n"
|
"public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception {\n if (e.getCause() instanceof ReadTimeoutException) {\n log.error(\"String_Node_Str\", this.proxy.getSlicer().getSliceName(), this.proxy.getSlicer().getControllerAddress().toString());\n ctx.getChannel().close();\n } else if (e.getCause() instanceof HandshakeTimeoutException) {\n log.error(\"String_Node_Str\" + this.proxy.getSlicer().getSliceName() + \"String_Node_Str\" + this.proxy.getSlicer().getControllerAddress().toString() + \"String_Node_Str\");\n ctx.getChannel().close();\n } else if (e.getCause() instanceof ClosedChannelException) {\n log.debug(\"String_Node_Str\");\n } else if (e.getCause() instanceof IOException) {\n log.error(\"String_Node_Str\" + this.proxy.getSlicer().getSliceName() + \"String_Node_Str\" + this.proxy.getSlicer().getControllerAddress().toString() + \"String_Node_Str\", e.getCause().getMessage());\n if (log.isDebugEnabled()) {\n log.debug(\"String_Node_Str\", e.getCause());\n }\n ctx.getChannel().close();\n } else if (e.getCause() instanceof SwitchStateException) {\n log.error(\"String_Node_Str\" + this.proxy.getSlicer().getSliceName() + \"String_Node_Str\" + this.proxy.getSlicer().getControllerAddress().toString() + \"String_Node_Str\", this.proxy.getSlicer().getSliceName(), e.getCause().getMessage());\n if (log.isDebugEnabled()) {\n log.debug(\"String_Node_Str\", e.getCause());\n }\n ctx.getChannel().close();\n } else if (e.getCause() instanceof MessageParseException) {\n log.error(\"String_Node_Str\" + this.proxy.getSlicer().getSliceName() + \"String_Node_Str\" + this.proxy.getSlicer().getControllerAddress().toString() + \"String_Node_Str\", e.getCause());\n ctx.getChannel().close();\n } else if (e.getCause() instanceof StorageException) {\n log.error(\"String_Node_Str\" + this.proxy.getSlicer().getSliceName() + \"String_Node_Str\" + this.proxy.getSlicer().getControllerAddress().toString() + \"String_Node_Str\", e.getCause());\n } else if (e.getCause() instanceof RejectedExecutionException) {\n log.warn(\"String_Node_Str\");\n } else {\n try {\n log.error(\"String_Node_Str\" + this.proxy.getSlicer().getSliceName() + \"String_Node_Str\" + this.proxy.getSlicer().getControllerAddress().toString() + \"String_Node_Str\" + this.state, e.getCause());\n } catch (NullPointerException bad) {\n log.error(\"String_Node_Str\" + bad.getMessage());\n ctx.getChannel().close();\n }\n ctx.getChannel().close();\n }\n}\n"
|
"public void onPlayerMove(PlayerMoveEvent event) {\n if (event.isCancelled())\n return;\n if (Jail.prisoners.containsKey(event.getPlayer().getName().toLowerCase())) {\n JailPrisoner prisoner = Jail.prisoners.get(event.getPlayer().getName().toLowerCase());\n if (prisoner.isBeingReleased() || prisoner.getJail() == null)\n return;\n prisoner.setAFKTime(0);\n JailZone jail = prisoner.getJail();\n if (!jail.getSettings().getBoolean(Setting.EnablePlayerMoveProtection))\n return;\n if (!jail.isInside(event.getTo())) {\n if (jail.getSettings().getString(Setting.PlayerMoveProtectionAction).equals(\"String_Node_Str\") && prisoner.canGuardsBeSpawned() && (!Util.isServer18() || event.getPlayer().getGameMode() == GameMode.SURVIVAL)) {\n if (prisoner.getGuards().size() > 0) {\n for (Wolf w : prisoner.getGuards().toArray(new Wolf[0])) {\n if (w == null || w.isDead()) {\n prisoner.getGuards().remove(w);\n Jail.guards.remove(w);\n continue;\n }\n if (w.getTarget() == null)\n w.setTarget(event.getPlayer());\n if (jail.getSettings().getInt(Setting.GuardTeleportDistance) > 0 && (w.getWorld() != w.getTarget().getWorld() || w.getLocation().distanceSquared(w.getTarget().getLocation()) > jail.getSettings().getInt(Setting.GuardTeleportDistance)))\n w.teleport(w.getTarget().getLocation());\n }\n } else\n prisoner.spawnGuards(jail.getSettings().getInt(Setting.NumbefOfGuards), event.getTo(), event.getPlayer());\n } else if (jail.getSettings().getString(Setting.PlayerMoveProtectionAction).equals(\"String_Node_Str\")) {\n prisoner.delete();\n plugin.getServer().broadcastMessage(event.getPlayer().getName() + \"String_Node_Str\");\n return;\n } else {\n if (!prisoner.canGuardsBeSpawned()) {\n Jail.log.warning(\"String_Node_Str\" + prisoner.getName() + \"String_Node_Str\");\n prisoner.setGuardCanBeSpawned(true);\n }\n if (jail.getSettings().getInt(Setting.PlayerMoveProtectionPenalty) > 0 && prisoner.getRemainingTime() > 0) {\n Util.Message(jail.getSettings().getString(Setting.MessageEscapePenalty), event.getPlayer());\n prisoner.setRemainingTime(prisoner.getRemainingTime() + jail.getSettings().getInt(Setting.PlayerMoveProtectionPenalty) * 6);\n InputOutput.UpdatePrisoner(prisoner);\n } else {\n Util.Message(jail.getSettings().getString(Setting.MessageEscapeNoPenalty), event.getPlayer());\n }\n Location teleport;\n teleport = prisoner.getTeleportLocation();\n event.setTo(teleport);\n }\n } else if (jail.getSettings().getString(Setting.PlayerMoveProtectionAction).equals(\"String_Node_Str\")) {\n for (Object o : prisoner.getGuards().toArray()) {\n Wolf w = (Wolf) o;\n prisoner.getGuards().remove(w);\n Jail.guards.remove(w);\n w.remove();\n }\n }\n }\n}\n"
|
"public Employee process(Employee item) {\n LOG.info(\"String_Node_Str\" + item);\n taxCalculatorService.calculateTax(item);\n return item;\n}\n"
|
"protected ViewModel doGet(HttpServletRequest request, HttpServletResponse response) throws Exception {\n String sptoken = Strings.clean(request.getParameter(\"String_Node_Str\"));\n if (isJsonPreferred(request, response)) {\n Map<String, Object> model = new HashMap<String, Object>(1);\n if (sptoken == null) {\n model.put(\"String_Node_Str\", \"String_Node_Str\");\n model.put(\"String_Node_Str\", i18n(request, \"String_Node_Str\"));\n } else {\n try {\n Application application = (Application) request.getAttribute(Application.class.getName());\n application.verifyPasswordResetToken(sptoken);\n return new DefaultViewModel(\"String_Node_Str\");\n } catch (ResourceException re) {\n model = errorMap.toErrorMap(re.getStormpathError());\n }\n }\n return new DefaultViewModel(\"String_Node_Str\", model);\n }\n if (sptoken == null) {\n return new DefaultViewModel(forgotPasswordUri).setRedirect(true);\n } else {\n try {\n Application application = (Application) request.getAttribute(Application.class.getName());\n application.verifyPasswordResetToken(sptoken);\n } catch (ResourceException re) {\n return new DefaultViewModel(errorUri).setRedirect(true);\n }\n return super.doGet(request, response);\n }\n}\n"
|
"public static synchronized void savePreferences() {\n boolean shouldSave = getBooleanPreference(Preference.TYPES.SAVE_PREFS);\n System.out.println(\"String_Node_Str\" + shouldSave);\n try {\n for (Preference p : prefArray) {\n if (p.getValue() == null || ((!shouldSave || !p.shouldSave()) && !p.forceSave())) {\n myPrefs.remove(p.getPrefType().name());\n } else {\n myPrefs.put(p.getPrefType().name(), String.valueOf(p.getValue()));\n }\n }\n myPrefs.sync();\n } catch (BackingStoreException bse) {\n }\n}\n"
|
"public void modifyText(ModifyEvent e) {\n String min = lowerText.getText();\n String max = higherText.getText();\n if (!CheckValueUtils.isEmpty(max)) {\n if (isRangeForDate) {\n if (!CheckValueUtils.isDateValue(max)) {\n updateStatus(IStatus.ERROR, MSG_ONLY_DATE);\n }\n } else {\n if (!CheckValueUtils.isNumberWithNegativeValue(max)) {\n updateStatus(IStatus.ERROR, MSG_ONLY_NUMBER);\n }\n }\n if (!CheckValueUtils.isEmpty(min) && CheckValueUtils.isAoverB(min, max)) {\n updateStatus(IStatus.ERROR, UIMessages.MSG_LOWER_LESS_HIGHER);\n } else {\n updateStatus(IStatus.OK, MSG_OK);\n }\n } else {\n updateStatus(IStatus.OK, UIMessages.MSG_INDICATOR_WIZARD);\n }\n}\n"
|
"public EntityRotFX spawnFogParticle(double x, double y, double z, int parRenderOrder) {\n double speed = 0D;\n Random rand = new Random();\n EntityRotFX entityfx = particleBehaviorFog.spawnNewParticleIconFX(Minecraft.getMinecraft().theWorld, tex, x, y, z, (rand.nextDouble() - rand.nextDouble()) * speed, 0.0D, (rand.nextDouble() - rand.nextDouble()) * speed, parRenderOrder);\n particleBehaviorFog.initParticle(entityfx);\n entityfx.setCanCollide(false);\n entityfx.callUpdatePB = false;\n boolean debug = false;\n if (debug) {\n } else {\n }\n if (levelCurIntensityStage == STATE_NORMAL) {\n entityfx.setMaxAge(300 + rand.nextInt(100));\n } else {\n entityfx.setMaxAge((size / 2) + rand.nextInt(100));\n }\n if (entityfx.getEntityId() % 20 < 5 && isSpinning()) {\n entityfx.renderOrder = 1;\n entityfx.setMaxAge((size) + rand.nextInt(100));\n }\n float randFloat = (rand.nextFloat() * 0.6F);\n float baseBright = 0.7F;\n if (levelCurIntensityStage > STATE_NORMAL) {\n baseBright = 0.2F;\n } else if (attrib_precipitation) {\n baseBright = 0.2F;\n } else if (manager.isVanillaRainActiveOnServer) {\n baseBright = 0.2F;\n } else {\n float adj = Math.min(1F, levelWater / levelWaterStartRaining) * 0.6F;\n baseBright -= adj;\n }\n float finalBright = Math.min(1F, baseBright + randFloat);\n entityfx.setRBGColorF(finalBright, finalBright, finalBright);\n if (debug) {\n if (levelTemperature < 0) {\n entityfx.setRBGColorF(0, 0, finalBright);\n } else if (levelTemperature > 0) {\n entityfx.setRBGColorF(finalBright, 0, 0);\n }\n }\n ExtendedRenderer.rotEffRenderer.addEffect(entityfx);\n particleBehaviorFog.particles.add(entityfx);\n return entityfx;\n}\n"
|
"public static void toBean(AccountPo src, Account desc) {\n AssertUtil.canNotEmpty(src, \"String_Node_Str\");\n AssertUtil.canNotEmpty(desc, \"String_Node_Str\");\n desc.setCreateTime(src.getCreateTime());\n try {\n desc.setAddress(Address.fromHashs(src.getAddress()));\n } catch (NulsException e) {\n Log.error(e);\n }\n desc.setAlias(src.getAlias());\n desc.setExtend(src.getExtend());\n desc.setPriKey(src.getPriKey());\n desc.setPubKey(src.getPubKey());\n desc.setEncryptedPriKey(src.getEncryptedPriKey());\n if (src.getPriKey() != null && src.getPriKey().length > 1) {\n desc.setEcKey(ECKey.fromPrivate(new BigInteger(desc.getPriKey())));\n } else {\n desc.setEcKey(ECKey.fromEncrypted(new EncryptedData(src.getEncryptedPriKey()), src.getPubKey()));\n }\n desc.setStatus(src.getStatus());\n}\n"
|
"public IConnector getConnector() {\n try {\n return new StreamingConnector();\n } catch (InitializationException e) {\n Assert.fail(\"String_Node_Str\");\n return null;\n }\n}\n"
|
"protected SearchRequestResult parse_search(String html, int page) {\n Document doc = Jsoup.parse(html);\n if (doc.select(\"String_Node_Str\").size() > 0) {\n if (doc.select(\"String_Node_Str\").text().trim().startsWith(\"String_Node_Str\")) {\n return new SearchRequestResult(new ArrayList<SearchResult>(), 0, 1, 1);\n } else if (!doc.select(\"String_Node_Str\").text().trim().contains(\"String_Node_Str\") && !doc.select(\"String_Node_Str\").text().trim().contains(\"String_Node_Str\")) {\n last_error = doc.select(\"String_Node_Str\").text().trim();\n return null;\n }\n } else if (doc.select(\"String_Node_Str\").size() > 0) {\n if (doc.select(\"String_Node_Str\").text().trim().contains(\"String_Node_Str\")) {\n last_error = \"String_Node_Str\";\n return null;\n } else {\n last_error = \"String_Node_Str\" + doc.select(\"String_Node_Str\").text().trim();\n return null;\n }\n } else {\n return null;\n }\n updateRechnr(doc);\n reusehtml = html;\n results_total = -1;\n if (doc.select(\"String_Node_Str\").text().trim().contains(\"String_Node_Str\")) {\n results_total = 200;\n } else {\n String resultnumstr = doc.select(\"String_Node_Str\").first().text();\n resultnumstr = resultnumstr.substring(0, resultnumstr.indexOf(\"String_Node_Str\")).trim();\n results_total = Integer.parseInt(resultnumstr);\n }\n List<SearchResult> results = new ArrayList<SearchResult>();\n Elements tables = doc.select(\"String_Node_Str\").first().select(\"String_Node_Str\");\n for (int i = 0; i < tables.size(); i++) {\n Element tr = tables.get(i);\n SearchResult sr = new SearchResult();\n if (tr.select(\"String_Node_Str\").first().select(\"String_Node_Str\").size() > 0) {\n String imgUrl = tr.select(\"String_Node_Str\").first().select(\"String_Node_Str\").first().attr(\"String_Node_Str\");\n sr.setCover(imgUrl);\n }\n String mType = tr.select(\"String_Node_Str\").last().text().trim().replace(\"String_Node_Str\", \"String_Node_Str\");\n if (data.has(\"String_Node_Str\")) {\n try {\n sr.setType(MediaType.valueOf(data.getJSONObject(\"String_Node_Str\").getString(mType.toLowerCase())));\n } catch (JSONException e) {\n sr.setType(defaulttypes.get(mType.toLowerCase()));\n } catch (IllegalArgumentException e) {\n sr.setType(defaulttypes.get(mType.toLowerCase()));\n }\n } else {\n sr.setType(defaulttypes.get(mType.toLowerCase()));\n }\n String title = tr.select(\"String_Node_Str\").get(1).text().trim().replace(\"String_Node_Str\", \"String_Node_Str\");\n String additionalInfo = \"String_Node_Str\";\n if (title.contains(\"String_Node_Str\")) {\n additionalInfo += title.substring(title.indexOf(\"String_Node_Str\"));\n title = title.substring(0, title.indexOf(\"String_Node_Str\") - 1).trim();\n }\n String author = tr.select(\"String_Node_Str\").get(2).text().trim().replace(\"String_Node_Str\", \"String_Node_Str\");\n additionalInfo += \"String_Node_Str\" + author;\n String publisher = tr.select(\"String_Node_Str\").get(3).text().trim().replace(\"String_Node_Str\", \"String_Node_Str\");\n additionalInfo += \"String_Node_Str\" + publisher;\n String year = tr.select(\"String_Node_Str\").get(4).text().trim().replace(\"String_Node_Str\", \"String_Node_Str\");\n additionalInfo += \"String_Node_Str\" + year + \"String_Node_Str\";\n sr.setInnerhtml(\"String_Node_Str\" + title + \"String_Node_Str\" + additionalInfo);\n sr.setNr(10 * (page - 1) + i);\n sr.setId(null);\n results.add(sr);\n }\n resultcount = results.size();\n return new SearchRequestResult(results, results_total, page);\n}\n"
|
"public EF_LearningBayesianNetwork transitionModel(EF_LearningBayesianNetwork bayesianNetwork, PlateuStructure plateuStructure) {\n for (Variable localVar : this.localHiddenVars) {\n Normal normalGlobalHiddenPreviousTimeStep = plateuStructure.getEFParameterPosterior(localVar).toUnivariateDistribution();\n EF_Normal normal = bayesianNetwork.getDistribution(localVar);\n double variance = normalGlobalHiddenPreviousTimeStep.getVariance() + this.transtionVariance;\n double mean = normalGlobalHiddenPreviousTimeStep.getMean();\n normal.setNaturalWithMeanPrecision(mean, 1 / variance);\n normal.fixNumericalInstability();\n normal.updateMomentFromNaturalParameters();\n }\n if (fading < 1.0) {\n bayesianNetwork.getParametersVariables().getListOfParamaterVariables().stream().forEach(var -> {\n EF_BaseDistribution_MultinomialParents dist = bayesianNetwork.getDistribution(var);\n EF_UnivariateDistribution prior = dist.getBaseEFUnivariateDistribution(0);\n NaturalParameters naturalParameters = prior.getNaturalParameters();\n naturalParameters.multiplyBy(fading);\n prior.setNaturalParameters(naturalParameters);\n dist.setBaseEFDistribution(0, prior);\n });\n }\n return bayesianNetwork;\n}\n"
|
"protected boolean _isSearchCriteriaSet() {\n if (_commandSearchCriteria == null || _commandSearchCriteria.equals(\"String_Node_Str\")) {\n return false;\n }\n return false;\n}\n"
|
"public void setUp() throws Exception {\n super.setUp();\n consumer = (DuplicateArtifactsConsumer) lookup(KnownRepositoryContentConsumer.class, \"String_Node_Str\");\n assertNotNull(consumer);\n config = new ManagedRepositoryConfiguration();\n config.setId(TEST_REPO);\n config.setLocation(new File(\"String_Node_Str\").getAbsolutePath());\n metadataRepository = mock(MetadataRepository.class);\n RepositorySession session = mock(RepositorySession.class);\n when(session.getRepository()).thenReturn(metadataRepository);\n RepositorySessionFactory factory = (RepositorySessionFactory) lookup(RepositorySessionFactory.class);\n when(factory.createSession()).thenReturn(session);\n pathTranslator = (RepositoryPathTranslator) lookup(RepositoryPathTranslator.class, \"String_Node_Str\");\n when(pathTranslator.getArtifactForPath(TEST_REPO, TEST_FILE)).thenReturn(TEST_METADATA);\n}\n"
|
"public void breakpointAdded(IBreakpoint breakpoint) {\n if (!supportsBreakpoint(breakpoint)) {\n return;\n }\n try {\n if (!breakpoint.isEnabled()) {\n return;\n }\n } catch (CoreException e1) {\n return;\n }\n ScriptLineBreakpoint scriptPoint = (ScriptLineBreakpoint) breakpoint;\n try {\n if (scriptPoint.shouldSkipBreakpoint()) {\n return;\n }\n } catch (CoreException e1) {\n }\n JsLineBreakPoint point = createJsLineBreakPoint(scriptPoint);\n try {\n if (ScriptLineBreakpoint.RUNTOLINE.equals(((ScriptLineBreakpoint) breakpoint).getType())) {\n reportVM.addBreakPoint(point);\n } else if ((!breakPoints.contains(point))) {\n breakPoints.add(point);\n reportVM.addBreakPoint(point);\n }\n } catch (VMException e) {\n logger.warning(e.getMessage());\n }\n}\n"
|
"public boolean onLongClick(View v) {\n int position = getAdapterPosition();\n if (Utils.isWeekOfYearEnabled()) {\n if (position % 8 == 0) {\n return false;\n }\n position = fixForWeekOfYearNumber(position);\n }\n if (totalDays < position - 6 - startingDayOfWeek || position - 7 - startingDayOfWeek < 0) {\n return false;\n }\n monthFragment.onLongClickItem(days.get(position - 7 - startingDayOfWeek).getJdn());\n onClick(v);\n return false;\n}\n"
|
"private void setPropertiesFormEditable(boolean visible) {\n clearContextParams();\n EDBParamName sidOrDatabase = null;\n if (EDatabaseTypeName.ORACLEFORSID.getProduct().equals(getConnection().getProductId())) {\n if (EDatabaseConnTemplate.ORACLESN.getDBDisplayName().equals(getConnection().getDatabaseType())) {\n sidOrDatabaseText.setLabelText(Messages.getString(\"String_Node_Str\"));\n sidOrDatabaseText.setLabelWidth(65);\n sidOrDatabase = EDBParamName.ServiceName;\n } else if (EDatabaseConnTemplate.ORACLEFORSID.getDBDisplayName().equals(getConnection().getDatabaseType())) {\n sidOrDatabaseText.setLabelText(Messages.getString(\"String_Node_Str\"));\n sidOrDatabase = EDBParamName.Sid;\n } else if (EDatabaseConnTemplate.ORACLE_OCI.getDBDisplayName().equals(getConnection().getDatabaseType())) {\n sidOrDatabaseText.setLabelText(Messages.getString(\"String_Node_Str\"));\n sidOrDatabase = EDBParamName.Sid;\n }\n } else {\n sidOrDatabaseText.setLabelText(Messages.getString(\"String_Node_Str\"));\n sidOrDatabase = EDBParamName.Database;\n if (EDatabaseConnTemplate.INFORMIX.getDBDisplayName().equals(getConnection().getDatabaseType())) {\n sidOrDatabaseText.setLabelText(Messages.getString(\"String_Node_Str\"));\n }\n }\n if (EDatabaseTypeName.MSODBC.getDisplayName().equals(dbTypeCombo.getText())) {\n sidOrDatabaseText.setLabelText(Messages.getString(\"String_Node_Str\"));\n }\n if (EDatabaseTypeName.GODBC.getDisplayName().equals(dbTypeCombo.getText())) {\n sidOrDatabaseText.setLabelText(Messages.getString(\"String_Node_Str\"));\n }\n if (EDatabaseConnTemplate.GENERAL_JDBC.getDBTypeName().equals(dbTypeCombo.getText())) {\n addContextParams(EDBParamName.JdbcUrl, visible);\n addContextParams(EDBParamName.DriverJar, visible);\n addContextParams(EDBParamName.MappingFile, visible);\n addContextParams(EDBParamName.ClassName, visible);\n }\n addContextParams(EDBParamName.Login, visible);\n addContextParams(EDBParamName.Password, visible);\n boolean isOracle = visible && oracleVersionEnable();\n boolean isAS400 = visible && as400VersionEnable();\n boolean isMySQL = visible && asMySQLVersionEnable();\n boolean isVertica = visible && asVerticaVersionEnable();\n boolean isSAS = visible && asSASVersionEnable();\n boolean isHbase = visible && asHbaseVersionEnable();\n dbVersionCombo.setEnabled(!isReadOnly() && (isOracle || isAS400 || isMySQL || isVertica || isSAS || EDatabaseConnTemplate.ACCESS.getDBTypeName().equals(dbTypeCombo.getText()) || EDatabaseConnTemplate.MSSQL05_08.getDBDisplayName().equals(dbTypeCombo.getText())));\n usernameText.setEditable(visible);\n passwordText.setEditable(visible);\n serverText.setEditable(false);\n portText.setEditable(false);\n sidOrDatabaseText.setEditable(false);\n datasourceText.setEditable(false);\n additionParamText.setEditable(false);\n schemaText.setEditable(false);\n fileField.setEditable(false);\n directoryField.setEditable(false);\n mappingFileText.setEditable(false);\n mappingSelectButton.setEnabled(false);\n if (EDatabaseConnTemplate.GODBC.getDBTypeName().equals(dbTypeCombo.getText()) || EDatabaseConnTemplate.GENERAL_JDBC.getDBTypeName().equals(dbTypeCombo.getText())) {\n addContextParams(EDBParamName.MappingFile, true);\n mappingFileText.show();\n mappingFileText.setEditable(true);\n mappingSelectButton.setVisible(true);\n mappingSelectButton.setEnabled(true);\n } else {\n addContextParams(EDBParamName.MappingFile, false);\n mappingFileText.hide();\n mappingFileText.setEditable(false);\n mappingSelectButton.setVisible(false);\n mappingSelectButton.setEnabled(false);\n }\n if (dbTypeCombo.getSelectionIndex() < 0) {\n urlConnectionStringText.setEditable(false);\n } else {\n EDatabaseConnTemplate template = EDatabaseConnTemplate.indexOfTemplate(dbTypeCombo.getText());\n String s = \"String_Node_Str\";\n if (template != null) {\n EDatabaseVersion4Drivers version = null;\n if (EDatabaseTypeName.HIVE.getDisplayName().equals(template.getDBDisplayName())) {\n version = EDatabaseVersion4Drivers.indexOfByVersionDisplay(hiveModeCombo.getText());\n s = template.getUrlTemplate(version);\n } else {\n version = EDatabaseVersion4Drivers.indexOfByVersionDisplay(dbVersionCombo.getText());\n s = template.getUrlTemplate(version);\n }\n }\n if (isHbase || isDBTypeSelected(EDatabaseConnTemplate.ORACLE_RAC)) {\n urlConnectionStringText.hide();\n } else {\n urlConnectionStringText.show();\n }\n if (isDBTypeSelected(EDatabaseConnTemplate.ORACLE_RAC)) {\n serverText.setLabelText(Messages.getString(\"String_Node_Str\"));\n } else {\n serverText.setLabelText(Messages.getString(\"String_Node_Str\"));\n }\n hideHBaseSettings(!isHbase);\n urlConnectionStringText.setEditable(!visible);\n boolean schemaTextIsShow = true;\n if (template == EDatabaseConnTemplate.MSSQL) {\n schemaText.show();\n schemaText.setEditable(true);\n addContextParams(EDBParamName.Schema, true);\n } else if (template == EDatabaseConnTemplate.VERTICA || template == EDatabaseConnTemplate.INFORMIX) {\n schemaText.show();\n schemaText.setEditable(true);\n addContextParams(EDBParamName.Schema, true);\n } else if (template == EDatabaseConnTemplate.GENERAL_JDBC) {\n String jdbcUrlString = \"String_Node_Str\";\n if (isContextMode()) {\n if (selectedContextType == null) {\n selectedContextType = ConnectionContextHelper.getContextTypeForContextMode(getShell(), getConnection(), true);\n }\n if (selectedContextType != null) {\n jdbcUrlString = ConnectionContextHelper.getOriginalValue(selectedContextType, getConnection().getURL());\n }\n } else {\n jdbcUrlString = generalJdbcUrlText.getText();\n }\n if (jdbcUrlString.contains(\"String_Node_Str\")) {\n jDBCschemaText.setHideWidgets(false);\n addContextParams(EDBParamName.Schema, true);\n } else {\n jDBCschemaText.setHideWidgets(true);\n addContextParams(EDBParamName.Schema, false);\n }\n } else {\n schemaTextIsShow = false;\n }\n if (s.contains(EDatabaseConnVar.HOST.getVariable()) || isHbase) {\n if (!EDatabaseConnTemplate.GENERAL_JDBC.getDBTypeName().equals(dbTypeCombo.getText())) {\n serverText.show();\n serverText.setEditable(visible);\n if (isHbase) {\n String serverName = getConnection().getServerName();\n if (serverName == null || \"String_Node_Str\".equals(serverName)) {\n serverText.setText(EDatabaseConnTemplate.HBASE.getUrlTemplate(EDatabaseVersion4Drivers.HBASE));\n }\n }\n addContextParams(EDBParamName.Server, visible);\n }\n } else {\n if (isHiveDBConnSelected()) {\n if (isHiveEmbeddedMode()) {\n portText.show();\n serverText.show();\n portText.setEditable(true);\n serverText.setEditable(true);\n hideMappingFileRelatedWidgets(true);\n } else {\n portText.show();\n serverText.show();\n portText.setEditable(true);\n serverText.setEditable(visible);\n hideMappingFileRelatedWidgets(true);\n }\n addContextParams(EDBParamName.Server, visible);\n } else {\n serverText.hide();\n }\n addContextParams(EDBParamName.Server, false);\n }\n if (s.contains(EDatabaseConnVar.PORT.getVariable()) || isHbase) {\n portText.show();\n portText.setEditable(visible);\n addContextParams(EDBParamName.Port, visible);\n } else {\n if (isHiveDBConnSelected()) {\n portText.show();\n portText.setEditable(visible);\n addContextParams(EDBParamName.Port, visible);\n } else {\n portText.hide();\n }\n addContextParams(EDBParamName.Port, false);\n }\n if (s.contains(EDatabaseConnVar.SID.getVariable()) || s.contains(EDatabaseConnVar.SERVICE_NAME.getVariable())) {\n if (!EDatabaseConnTemplate.GENERAL_JDBC.getDBTypeName().equals(dbTypeCombo.getText())) {\n if (EDatabaseTypeName.HIVE.getDisplayName().equalsIgnoreCase(dbTypeCombo.getText())) {\n if (isHiveEmbeddedMode()) {\n portText.show();\n serverText.show();\n serverText.setEditable(true);\n sidOrDatabaseText.hide();\n sidOrDatabaseText.setEditable(false);\n hideMappingFileRelatedWidgets(true);\n } else {\n portText.show();\n serverText.show();\n serverText.setEditable(true);\n sidOrDatabaseText.show();\n sidOrDatabaseText.setEditable(true);\n hideMappingFileRelatedWidgets(true);\n }\n } else {\n sidOrDatabaseText.show();\n sidOrDatabaseText.setEditable(visible);\n }\n addContextParams(sidOrDatabase, visible);\n } else {\n sidOrDatabaseText.hide();\n addContextParams(sidOrDatabase, false);\n }\n } else {\n if (template.getDbType() != EDatabaseTypeName.JAVADB_EMBEDED) {\n sidOrDatabaseText.hide();\n addContextParams(sidOrDatabase, false);\n }\n }\n if (s.contains(EDatabaseConnVar.FILENAME.getVariable())) {\n fileField.show();\n fileField.setEditable(!isReadOnly() && visible);\n addContextParams(EDBParamName.File, visible);\n boolean isSqlLite = false;\n if (template.getDbType() == EDatabaseTypeName.SQLITE) {\n isSqlLite = true;\n usernameText.hide();\n passwordText.hide();\n } else {\n isSqlLite = false;\n usernameText.show();\n passwordText.show();\n }\n usernameText.setEditable(!isSqlLite);\n passwordText.setEditable(!isSqlLite);\n addContextParams(EDBParamName.Login, !isSqlLite);\n addContextParams(EDBParamName.Password, !isSqlLite);\n } else {\n fileField.hide();\n addContextParams(EDBParamName.File, false);\n usernameText.show();\n passwordText.show();\n if (isHbase) {\n usernameText.hide();\n passwordText.hide();\n } else if (isHiveDBConnSelected()) {\n if (isHiveEmbeddedMode()) {\n usernameText.show();\n passwordText.show();\n serverText.setEditable(true);\n hideMappingFileRelatedWidgets(true);\n } else {\n usernameText.show();\n passwordText.show();\n hideMappingFileRelatedWidgets(true);\n }\n }\n addContextParams(EDBParamName.Login, true);\n addContextParams(EDBParamName.Password, true);\n }\n if (s.contains(EDatabaseConnVar.DATASOURCE.getVariable())) {\n datasourceText.show();\n datasourceText.setEditable(visible);\n addContextParams(EDBParamName.Datasource, visible);\n } else {\n datasourceText.hide();\n addContextParams(EDBParamName.Datasource, false);\n }\n if (s.contains(EDatabaseConnVar.DBROOTPATH.getVariable())) {\n directoryField.show();\n directoryField.setEditable(visible);\n sidOrDatabaseText.setEditable(visible);\n addContextParams(EDBParamName.DBRootPath, visible);\n addContextParams(sidOrDatabase, visible);\n } else {\n directoryField.hide();\n addContextParams(EDBParamName.DBRootPath, false);\n }\n if (EDatabaseConnTemplate.isSchemaNeeded(getConnection().getDatabaseType())) {\n schemaText.show();\n schemaText.setEditable(visible);\n if (isHbase) {\n schemaText.setLabelText(\"String_Node_Str\");\n }\n addContextParams(EDBParamName.Schema, visible);\n } else {\n if (!schemaTextIsShow) {\n schemaText.hide();\n addContextParams(EDBParamName.Schema, false);\n }\n }\n if (EDatabaseConnTemplate.isAddtionParamsNeeded(getConnection().getDatabaseType()) && !EDatabaseConnTemplate.GENERAL_JDBC.getDBTypeName().equals(dbTypeCombo.getText()) && visible) {\n additionParamText.show();\n additionParamText.setEditable(true);\n addContextParams(EDBParamName.AdditionalParams, true);\n } else {\n additionParamText.hide();\n addContextParams(EDBParamName.AdditionalParams, false);\n }\n if (EDatabaseConnTemplate.FIREBIRD.equals(template)) {\n portText.show();\n portText.setEditable(true);\n addContextParams(EDBParamName.Port, true);\n }\n if (isHiveDBConnSelected()) {\n if (isHiveEmbeddedMode()) {\n usernameText.hide();\n passwordText.hide();\n portText.show();\n serverText.show();\n hideMappingFileRelatedWidgets(true);\n } else {\n portText.show();\n serverText.show();\n usernameText.show();\n passwordText.show();\n hideMappingFileRelatedWidgets(true);\n }\n schemaText.hide();\n }\n }\n doHiveUIContentsLayout();\n hbaseSettingGroup.layout();\n hadoopPropGrp.layout();\n metastorePropGrp.layout();\n compositeDbSettings.layout();\n typeDbCompositeParent.layout();\n newParent.layout();\n databaseSettingGroup.layout();\n compositeGroupDbSettings.layout();\n}\n"
|
"public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {\n try {\n flushText();\n int len = atts.getLength();\n serializer.startElement(namespaceURI, localName, getPrefix(qName), null);\n for (int i = 0; i < len; i++) {\n String qname = atts.getQName(i);\n if (qname.startsWith(\"String_Node_Str\"))\n continue;\n String prefix = getPrefix(qname);\n serializer.getNamespaceContext().declareNamespace(atts.getURI(i), prefix, true);\n }\n for (int i = 0; i < prefixMap.size(); i += 2) {\n serializer.getNamespaceContext().put(prefixMap.get(i + 1), prefixMap.get(i));\n }\n serializer.endNamespaceDecls(null);\n for (int i = 0; i < len; i++) {\n if (atts.getQName(i).startsWith(\"String_Node_Str\"))\n continue;\n serializer.attribute(atts.getURI(i), atts.getLocalName(i), atts.getValue(i));\n }\n prefixMap.clear();\n serializer.endAttributes();\n } catch (IOException e) {\n throw new SAXException2(e);\n } catch (XMLStreamException e) {\n throw new SAXException2(e);\n }\n}\n"
|
"public static Date toDateWithCheck(String source, ULocale locale) throws BirtException {\n DateFormat dateFormat = DateFormatFactory.getDateInstance(DateFormat.SHORT, locale);\n Date resultDate = null;\n try {\n resultDate = dateFormat.parse(source);\n } catch (ParseException e) {\n return toDate(source, locale);\n }\n if (DateUtil.checkValid(dateFormat, source) == false) {\n throw new CoreException(ResourceConstants.CONVERT_FAILS, new Object[] { source.toString(), \"String_Node_Str\" });\n }\n return resultDate;\n}\n"
|
"public static Address allocateContiguousChunks(int descriptor, Space space, int chunks, Address previous) {\n lock.acquire();\n int chunk = regionMap.alloc(chunks);\n if (VM.VERIFY_ASSERTIONS)\n VM.assertions._assert(chunk != 0);\n if (chunk == -1) {\n Log.write(\"String_Node_Str\");\n Log.write(space.getName());\n Log.write(\"String_Node_Str\");\n Log.write(chunks);\n Log.write(\"String_Node_Str\");\n Log.write(chunks << Space.LOG_BYTES_IN_CHUNK);\n Log.writeln(\"String_Node_Str\");\n Space.printVMMap();\n VM.assertions.fail(\"String_Node_Str\");\n }\n totalAvailableDiscontiguousChunks -= chunks;\n Address rtn = addressForChunkIndex(chunk);\n insert(rtn, Extent.fromIntZeroExtend(chunks << Space.LOG_BYTES_IN_CHUNK), descriptor, space);\n if (head.isZero()) {\n if (VM.VERIFY_ASSERTIONS)\n VM.assertions._assert(nextLink[chunk] == 0);\n } else {\n nextLink[chunk] = getChunkIndex(head);\n prevLink[getChunkIndex(head)] = chunk;\n }\n if (VM.VERIFY_ASSERTIONS)\n VM.assertions._assert(prevLink[chunk] == 0);\n lock.release();\n return rtn;\n}\n"
|
"public DescribeLoadBalancersResponseType describeLoadBalancers(DescribeLoadBalancersType request) throws EucalyptusCloudException {\n DescribeLoadBalancersResponseType reply = request.getReply();\n final Context ctx = Contexts.lookup();\n final UserFullName ownerFullName = ctx.getUserFullName();\n final Set<String> requestedNames = Sets.newHashSet();\n if (!request.getLoadBalancerNames().getMember().isEmpty()) {\n requestedNames.addAll(request.getLoadBalancerNames().getMember());\n }\n Set<String> allowedLBNames = null;\n String marker = request.getMarker();\n if (marker != null && marker.startsWith(\"String_Node_Str\")) {\n String instanceId = marker.replace(\"String_Node_Str\", \"String_Node_Str\");\n return describeLoadBalancersServo(instanceId, reply);\n } else {\n final Function<Set<String>, Set<String>> lookupLBNames = new Function<Set<String>, Set<String>>() {\n public Set<String> apply(final Set<String> identifiers) {\n final Predicate<? super LoadBalancer> requestedAndAccessible = LoadBalancingMetadatas.filteringFor(LoadBalancer.class).byId(identifiers).byPrivileges().buildPredicate();\n final List<LoadBalancer> lbs = Entities.query(LoadBalancer.named(ownerFullName, null), true);\n return Sets.newHashSet(Iterables.transform(Iterables.filter(lbs, requestedAndAccessible), LoadBalancingMetadatas.toDisplayName()));\n }\n };\n allowedLBNames = Entities.asTransaction(LoadBalancer.class, lookupLBNames).apply(requestedNames);\n }\n final Function<String, LoadBalancer> getLoadBalancer = new Function<String, LoadBalancer>() {\n public LoadBalancer apply(final String lbName) {\n try {\n return Entities.uniqueResult(LoadBalancer.named(ownerFullName, lbName));\n } catch (NoSuchElementException ex) {\n return null;\n } catch (Exception ex) {\n LOG.warn(\"String_Node_Str\" + lbName, ex);\n return null;\n }\n }\n };\n final Function<Set<String>, Set<LoadBalancerDescription>> lookupLBDescriptions = new Function<Set<String>, Set<LoadBalancerDescription>>() {\n public Set<LoadBalancerDescription> apply(final Set<String> input) {\n final Set<LoadBalancerDescription> descs = Sets.newHashSet();\n for (String lbName : input) {\n LoadBalancerDescription desc = new LoadBalancerDescription();\n final LoadBalancer lb = Entities.asTransaction(LoadBalancer.class, getLoadBalancer).apply(lbName);\n if (lb == null)\n continue;\n desc.setLoadBalancerName(lbName);\n desc.setCreatedTime(lb.getCreationTimestamp());\n final LoadBalancerDnsRecord dns = lb.getDns();\n desc.setDnsName(dns.getDnsName());\n if (lb.getBackendInstances().size() > 0) {\n desc.setInstances(new Instances());\n desc.getInstances().setMember(new ArrayList<Instance>(Collections2.transform(lb.getBackendInstances(), new Function<LoadBalancerBackendInstance, Instance>() {\n public Instance apply(final LoadBalancerBackendInstance be) {\n Instance instance = new Instance();\n instance.setInstanceId(be.getInstanceId());\n return instance;\n }\n })));\n }\n if (lb.getZones().size() > 0) {\n desc.setAvailabilityZones(new AvailabilityZones());\n desc.getAvailabilityZones().setMember(new ArrayList<String>(Collections2.transform(lb.getZones(), new Function<LoadBalancerZone, String>() {\n public String apply(final LoadBalancerZone zone) {\n return zone.getName();\n }\n })));\n }\n if (lb.getListeners().size() > 0) {\n desc.setListenerDescriptions(new ListenerDescriptions());\n desc.getListenerDescriptions().setMember(new ArrayList<ListenerDescription>(Collections2.transform(lb.getListeners(), new Function<LoadBalancerListener, ListenerDescription>() {\n public ListenerDescription apply(final LoadBalancerListener input) {\n ListenerDescription desc = new ListenerDescription();\n Listener listener = new Listener();\n listener.setLoadBalancerPort(input.getLoadbalancerPort());\n listener.setInstancePort(input.getInstancePort());\n if (input.getInstanceProtocol() != PROTOCOL.NONE)\n listener.setInstanceProtocol(input.getInstanceProtocol().name());\n listener.setProtocol(input.getProtocol().name());\n if (input.getCertificateId() != null)\n listener.setSslCertificateId(input.getCertificateId());\n desc.setListener(listener);\n return desc;\n }\n })));\n }\n try {\n int interval = lb.getHealthCheckInterval();\n String target = lb.getHealthCheckTarget();\n int timeout = lb.getHealthCheckTimeout();\n int healthyThresholds = lb.getHealthyThreshold();\n int unhealthyThresholds = lb.getHealthCheckUnhealthyThreshold();\n final HealthCheck hc = new HealthCheck();\n hc.setInterval(interval);\n hc.setHealthyThreshold(healthyThresholds);\n hc.setTarget(target);\n hc.setTimeout(timeout);\n hc.setUnhealthyThreshold(unhealthyThresholds);\n desc.setHealthCheck(hc);\n } catch (IllegalStateException ex) {\n ;\n } catch (Exception ex) {\n ;\n }\n descs.add(desc);\n }\n return descs;\n }\n };\n Set<LoadBalancerDescription> descs = lookupLBDescriptions.apply(allowedLBNames);\n DescribeLoadBalancersResult descResult = new DescribeLoadBalancersResult();\n LoadBalancerDescriptions lbDescs = new LoadBalancerDescriptions();\n lbDescs.setMember(new ArrayList<LoadBalancerDescription>(descs));\n descResult.setLoadBalancerDescriptions(lbDescs);\n reply.setDescribeLoadBalancersResult(descResult);\n reply.set_return(true);\n return reply;\n}\n"
|
"public boolean applies(GameEvent event, Ability source, Game game) {\n return true;\n}\n"
|
"public LongMonitoringCounter reset() {\n return this;\n}\n"
|
"public void writeArtwork(final BufferedImage img) {\n try {\n final StandardArtwork s = new StandardArtwork();\n ImageIO.write(img, \"String_Node_Str\", this.entry.getCoverTempFile());\n s.setFromFile(this.entry.getCoverTempFile());\n this.tag.deleteArtworkField();\n this.tag.addField(s);\n } catch (FieldDataInvalidException | IOException e) {\n Logging.log(\"String_Node_Str\", e);\n }\n}\n"
|
"public static QualifiedName fromNode(Node qnameNode) {\n if (qnameNode == null || !qnameNode.isQualifiedName()) {\n return null;\n }\n if (qnameNode.isGetProp()) {\n String pname = qnameNode.getLastChild().getString();\n return join(fromNode(qnameNode.getFirstChild()), new QualifiedName(pname));\n }\n return new QualifiedName(qnameNode.getQualifiedName());\n}\n"
|
"public void initialize(DynMap config) throws Exception {\n if (config == null) {\n throw new Exception(\"String_Node_Str\");\n }\n this.setMaxWorkerThreads(config.getInteger(\"String_Node_Str\", 10));\n this.setMaxIOThreads(config.getInteger(\"String_Node_Str\", 8));\n List<String> controllerPackages = config.getList(String.class, \"String_Node_Str\");\n if (controllerPackages != null) {\n for (String c : controllerPackages) {\n this.getRouter().addControllerPackage(c);\n }\n }\n List<String> filters = config.getList(String.class, \"String_Node_Str\");\n if (filters != null) {\n this.getRouter().setFilters(\"String_Node_Str\", filters);\n }\n this.getRouter().setServer(this);\n DynMap listeners = config.getMap(\"String_Node_Str\", new DynMap());\n for (String name : listeners.keySet()) {\n DynMap listenerConfig = listeners.getMap(name, new DynMap());\n ServerListenerBase listener = null;\n if (listenerConfig.containsKey(\"String_Node_Str\")) {\n listener = Reflection.instance(ServerListenerBase.class, listenerConfig.getString(\"String_Node_Str\"), this, listenerConfig);\n } else {\n Class<? extends ServerListenerBase> cls = this.listenerClasses.get(name);\n if (cls == null) {\n log.warn(\"String_Node_Str\" + name + \"String_Node_Str\");\n continue;\n }\n listener = Reflection.instance(cls, this, listenerConfig);\n }\n if (listener == null) {\n log.warn(\"String_Node_Str\" + name + \"String_Node_Str\");\n continue;\n }\n this.listeners.put(name, listener);\n }\n}\n"
|
"private void reset(Lattice lattice) {\n for (Node[] level : lattice.getLevels()) {\n for (Node node : level) {\n if (node.isAnonymous()) {\n node.setNotTagged();\n node.setNotChecked();\n node.setAnonymous(false);\n node.setKAnonymous(false);\n }\n }\n }\n}\n"
|
"protected BigInteger convertObjectToBigInteger(Object sourceObject) throws ConversionException {\n if (sourceObject instanceof String) {\n String sourceString = (String) sourceObject;\n if (sourceString.length() == 0) {\n return null;\n } else if (sourceString.charAt(0) == PLUS) {\n return super.convertObjectToBigInteger(sourceString.substring(1));\n }\n }\n return super.convertObjectToBigInteger(sourceObject);\n}\n"
|
"public float[] asFloat() {\n ensureNotFreed();\n float[] ret = new float[length];\n JCuda.cudaMemcpy(Pointer.to(ret), pointer(), length * elementSize(), cudaMemcpyKind.cudaMemcpyDeviceToHost);\n return ret;\n}\n"
|
"protected void createFieldEditors() {\n IntegerFieldEditor prefixLengthEditor = new IntegerFieldEditor(Constants.PREF_MIN_PREFIX_LENGTH_FOR_TYPES, Messages.PREFPAGE_LABEL_PREFIX_LENGTH, getFieldEditorParent());\n prefixLengthEditor.setValidRange(1, 99);\n Text control = prefixLengthEditor.getTextControl(getFieldEditorParent());\n ControlDecoration dec = new ControlDecoration(control, SWT.TOP | SWT.LEFT, getFieldEditorParent());\n FieldDecoration infoDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(DEC_INFORMATION);\n dec.setImage(infoDecoration.getImage());\n dec.setDescriptionText(Messages.PREFPAGE_TOOLTIP_PREFIX_LENGTH);\n addField(prefixLengthEditor);\n}\n"
|
"public static String getAggregateFunctionExpr(SeriesDefinition orthoSD, String strBaseAggExp, Query orthQuery) throws ChartException {\n String strOrthoAgg = null;\n SeriesGrouping grouping = orthoSD.getGrouping();\n if (orthQuery != null && orthQuery.getGrouping() != null && orthQuery.getGrouping().isEnabled()) {\n strOrthoAgg = orthQuery.getGrouping().getAggregateExpression();\n } else if (grouping != null && grouping.isEnabled()) {\n strOrthoAgg = grouping.getAggregateExpression();\n }\n if (strBaseAggExp == null && strOrthoAgg != null) {\n IAggregateFunction aFunc = PluginSettings.instance().getAggregateFunction(strOrthoAgg);\n if (aFunc != null && aFunc.getType() != IAggregateFunction.RUNNING_AGGR) {\n strOrthoAgg = null;\n }\n }\n if (strOrthoAgg == null || \"String_Node_Str\".equals(strOrthoAgg)) {\n strOrthoAgg = strBaseAggExp;\n }\n return strOrthoAgg;\n}\n"
|
"private AccessTokenResult tokenAuthenticationRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {\n OAuthGrantRequestAuthenticationResult authenticationResult;\n try {\n Application app = getApplication(request);\n OAuthPasswordGrantRequestAuthentication passwordGrantRequest = createPasswordGrantAuthenticationRequest(request);\n authenticationResult = Authenticators.OAUTH_PASSWORD_GRANT_REQUEST_AUTHENTICATOR.forApplication(app).authenticate(passwordGrantRequest);\n } catch (ResourceException e) {\n log.debug(\"String_Node_Str\", e.getMessage(), e);\n throw convertToOAuthException(e, OAuthErrorCode.INVALID_REQUEST);\n }\n return createAccessTokenResult(request, response, authenticationResult);\n}\n"
|
"public void startRequest(DIRRequest rq) {\n xtreemfs_address_mappings_removeRequest request = (xtreemfs_address_mappings_removeRequest) rq.getRequestMessage();\n BabuDBInsertGroup ig;\n try {\n ig = database.createInsertGroup();\n } catch (BabuDBException e) {\n if (e.getErrorCode() == ErrorCode.NO_ACCESS && dbsReplicationManager != null)\n rq.sendRedirectException(dbsReplicationManager.getMaster());\n else\n rq.sendInternalServerError(e);\n return;\n }\n ig.addDelete(DIRRequestDispatcher.INDEX_ID_ADDRMAPS, request.getUuid().getBytes());\n database.insert(ig, rq).registerListener(new BabuDBRequestListener<Object>() {\n public void finished(Object arg0, Object context) {\n ((DIRRequest) context).sendSuccess(request.createDefaultResponse());\n }\n public void failed(BabuDBException ex, Object context) {\n Logging.logError(Logging.LEVEL_ERROR, this, ex);\n if (ex.getErrorCode() == ErrorCode.NO_ACCESS && dbsReplicationManager != null)\n ((DIRRequest) context).sendRedirectException(dbsReplicationManager.getMaster());\n else\n ((DIRRequest) context).sendInternalServerError(ex);\n }\n });\n}\n"
|
"public String getResponsetemplate() {\n JSONObject jsonRecord = JSONObject.fromObject(customRecord.getOutMessage());\n return VELOCIMACRO_RESPONSE_PREFIX + \"String_Node_Str\" + jsonRecord.toString() + \"String_Node_Str\" + VELOCIMACRO_SUFFIX;\n}\n"
|
"protected <T extends AbstractObject> T copyWithNewUUID(Map<String, String> oldToNewUUIDMapping, T original) {\n T copy = (T) original.clone();\n copy.setId(UUID.randomUUID().toString());\n oldToNewUUIDMapping.put(original.getId(), copy);\n return copy;\n}\n"
|
"public String createdDocumentDestination() {\n List<Documents> documentsList = new ArrayList<Documents>();\n List<String> vendorCodeDocument = new ArrayList<String>();\n List<OrderItems> orderItemsList = new ArrayList<OrderItems>();\n Orders orderEntity = orderService.findOrdersById(orderIdParam);\n order = transformToOrderFormBean(orderEntity);\n orderItemsList = operationsService.findAllOrderItemsByOrderId(orderIdParam);\n for (OrderItems everyItem : orderItemsList) {\n if (vendorCodeDocument.isEmpty()) {\n vendorCodeDocument.add(everyItem.getVendorDestination());\n } else {\n if (!vendorCodeDocument.contains(everyItem.getVendorDestination())) {\n vendorCodeDocument.add(everyItem.getVendorDestination());\n }\n }\n }\n List<Documents> proforma = documentsService.findDocumentNameAndId(\"String_Node_Str\", orderIdParam);\n for (String itemVendor : vendorCodeDocument) {\n if (itemVendor != null) {\n if (proforma.size() == 0) {\n Documents documentEntity = new Documents();\n Client client = clientService.findClientById(getClientId().toString());\n documentEntity.setClient(client);\n documentEntity.setDocumentName(DocumentsConstants.HOUSE_WAYBILL_DESTINATION);\n documentEntity.setReferenceId(orderEntity.getOrderId());\n documentEntity.setReferenceTable(\"String_Node_Str\");\n documentEntity.setOrderNumber(orderEntity.getOrderNumber());\n documentEntity.setCreatedDate(new Date());\n documentEntity.setDocumentStatus(\"String_Node_Str\");\n documentEntity.setVendorCode(itemVendor);\n documentEntity.setReferenceNumber(orderEntity.getOrderNumber());\n documentEntity.setFinalOutboundStage(0);\n documentEntity.setDocumentProcessed(2);\n documentsService.addDocuments(documentEntity);\n } else {\n clearErrorsAndMessages();\n addActionError(\"String_Node_Str\");\n for (OrderItems orderItemsElem : orderItemsList) {\n orderItems.add(transformToOrderItemFormBean(orderItemsElem));\n }\n return INPUT;\n }\n } else {\n clearErrorsAndMessages();\n addActionError(\"String_Node_Str\");\n for (OrderItems orderItemsElem : orderItemsList) {\n orderItems.add(transformToOrderItemFormBean(orderItemsElem));\n }\n return INPUT;\n }\n }\n clearErrorsAndMessages();\n addActionMessage(\"String_Node_Str\");\n for (OrderItems orderItemsElem : orderItemsList) {\n orderItems.add(transformToOrderItemFormBean(orderItemsElem));\n }\n return SUCCESS;\n}\n"
|
"public RenderedImage create(ParameterBlock paramBlock, RenderingHints renderHints) {\n ImagingListener listener = ImageUtil.getImagingListener(renderHints);\n SeekableStream src = (SeekableStream) paramBlock.getObjectParameter(0);\n try {\n src.seek(0L);\n } catch (IOException e) {\n listener.errorOccurred(JaiI18N.getString(\"String_Node_Str\"), e, this, false);\n return null;\n }\n ImageDecodeParam param = null;\n if (paramBlock.getNumParameters() > 1) {\n param = (ImageDecodeParam) paramBlock.getObjectParameter(1);\n }\n String[] names = ImageCodec.getDecoderNames(src);\n OperationRegistry registry = JAI.getDefaultInstance().getOperationRegistry();\n int bound = OpImage.OP_IO_BOUND;\n ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);\n if (renderHints != null) {\n RenderingHints.Key key;\n key = JAI.KEY_OPERATION_REGISTRY;\n if (renderHints.containsKey(key)) {\n registry = (OperationRegistry) renderHints.get(key);\n }\n key = JAI.KEY_OPERATION_BOUND;\n if (renderHints.containsKey(key)) {\n bound = ((Integer) renderHints.get(key)).intValue();\n }\n }\n for (int i = 0; i < names.length; i++) {\n RenderedImageFactory rif = null;\n try {\n rif = RIFRegistry.get(registry, names[i]);\n } catch (IllegalArgumentException iae) {\n }\n if (rif != null) {\n RenderedImage im = RIFRegistry.create(registry, names[i], paramBlock, renderHints);\n if (im != null) {\n return im;\n }\n }\n }\n boolean canAttemptRecovery = src.canSeekBackwards();\n long streamPosition = Long.MIN_VALUE;\n if (canAttemptRecovery) {\n try {\n streamPosition = src.getFilePointer();\n } catch (IOException ioe) {\n listener.errorOccurred(JaiI18N.getString(\"String_Node_Str\"), ioe, this, false);\n canAttemptRecovery = false;\n }\n }\n for (int i = 0; i < names.length; i++) {\n ImageDecoder dec = ImageCodec.createImageDecoder(names[i], src, param);\n RenderedImage im = null;\n try {\n im = dec.decodeAsRenderedImage();\n } catch (OutOfMemoryError memoryError) {\n if (canAttemptRecovery) {\n TileCache cache = RIFUtil.getTileCacheHint(renderHints);\n if (cache != null) {\n cache.flush();\n }\n System.gc();\n try {\n src.seek(streamPosition);\n im = dec.decodeAsRenderedImage();\n } catch (IOException ioe) {\n listener.errorOccurred(JaiI18N.getString(\"String_Node_Str\"), ioe, this, false);\n im = null;\n }\n } else {\n String message = JaiI18N.getString(\"String_Node_Str\");\n listener.errorOccurred(message, new ImagingException(message, memoryError), this, false);\n }\n } catch (IOException e) {\n listener.errorOccurred(JaiI18N.getString(\"String_Node_Str\"), e, this, false);\n im = null;\n }\n if (im != null) {\n return new DisposableNullOpImage(im, layout, renderHints, bound);\n }\n }\n return null;\n}\n"
|
"private boolean openBank() {\n try {\n if (!bank.isOpen()) {\n if (menu.isOpen()) {\n mouse.moveSlightly();\n sleep(random(40, 60));\n }\n RSObject bankBooth = objects.getNearest(Bank.BANK_BOOTHS);\n RSNPC banker = npcs.getNearest(Bank.BANKERS);\n RSObject bankChest = objects.getNearest(Bank.BANK_CHESTS);\n int dist = calc.distanceTo(bankBooth);\n if (banker != null && bankBooth != null && calc.distanceTo(banker) < dist) {\n if (calc.distanceBetween(banker.getLocation(), bankBooth.getLocation()) <= 1) {\n if (random(1, 3) >= 2) {\n banker = null;\n } else {\n bankBooth = null;\n }\n } else {\n bankBooth = null;\n }\n }\n if (bankChest != null && calc.distanceTo(bankChest) < dist) {\n bankBooth = null;\n banker = null;\n }\n if (((bankBooth != null) && (calc.distanceTo(bankBooth) < 5) && calc.tileOnMap(bankBooth.getLocation()) && calc.canReach(bankBooth.getLocation(), true)) || ((banker != null) && (calc.distanceTo(banker) < 8) && calc.tileOnMap(banker.getLocation()) && calc.canReach(banker.getLocation(), true)) || ((bankChest != null) && (calc.distanceTo(bankChest) < 8) && calc.tileOnMap(bankChest.getLocation()) && calc.canReach(bankChest.getLocation(), true) && !bank.isOpen())) {\n if (bankBooth != null) {\n Point loc = getLocation(bankBooth);\n for (int i = 0; i < 10 && !menu.contains(\"String_Node_Str\"); i++) {\n mouseMove(loc);\n if (menu.contains(\"String_Node_Str\")) {\n sleep(random(20, 60));\n if (menu.contains(\"String_Node_Str\")) {\n sleep(random(20, 60));\n if (menu.contains(\"String_Node_Str\")) {\n break;\n }\n }\n }\n }\n if (doMenuAction(\"String_Node_Str\")) {\n int count = 0;\n while (!bank.isOpen() && ++count <= 10) {\n sleep(random(200, 300));\n if (getMyPlayer().isMoving()) {\n count = 0;\n }\n }\n } else {\n camera.turnTo(bankBooth);\n }\n } else if (banker != null) {\n RSModel m = banker.getModel();\n if (m == null) {\n m = banker.getModel();\n if (m == null) {\n return false;\n }\n }\n Point loc = pointOnScreen(m);\n for (int i = 0; i < 10 && !menu.contains(\"String_Node_Str\"); i++) {\n mouseMove(loc);\n if (menu.contains(\"String_Node_Str\")) {\n sleep(random(20, 60));\n if (menu.contains(\"String_Node_Str\")) {\n sleep(random(20, 60));\n if (menu.contains(\"String_Node_Str\")) {\n break;\n }\n }\n }\n }\n if (doMenuAction(\"String_Node_Str\")) {\n int count = 0;\n while (!bank.isOpen() && ++count <= 10) {\n sleep(random(200, 300));\n if (getMyPlayer().isMoving()) {\n count = 0;\n }\n }\n } else {\n camera.turnTo(banker);\n }\n } else if (bankChest != null) {\n Point loc = getLocation(bankChest);\n for (int i = 0; i < 10 && !menu.contains(\"String_Node_Str\") && !menu.contains(\"String_Node_Str\"); i++) {\n mouseMove(loc);\n if (menu.contains(\"String_Node_Str\") || menu.contains(\"String_Node_Str\")) {\n sleep(random(20, 60));\n if (menu.contains(\"String_Node_Str\") || menu.contains(\"String_Node_Str\")) {\n sleep(random(20, 60));\n if (menu.contains(\"String_Node_Str\") || menu.contains(\"String_Node_Str\")) {\n break;\n }\n }\n }\n }\n if (doMenuAction(\"String_Node_Str\") || doMenuAction(\"String_Node_Str\")) {\n int count = 0;\n while (!bank.isOpen() && ++count <= 10) {\n sleep(random(200, 300));\n if (getMyPlayer().isMoving()) {\n count = 0;\n }\n }\n } else {\n camera.turnTo(bankBooth);\n }\n }\n } else {\n if (bankBooth != null) {\n walking.walkTo(bankBooth.getLocation());\n } else if (banker != null) {\n walking.walkTo(banker.getLocation());\n } else if (bankChest != null) {\n walking.walkTo(bankChest.getLocation());\n } else {\n return false;\n }\n }\n }\n return bank.isOpen();\n } catch (Exception e) {\n return false;\n }\n}\n"
|
"public int run(final Configuration config, final PropertyManagement runTimeProperties) throws Exception {\n final DataStorePluginOptions dataStoreOptions = ((PersistableStore) runTimeProperties.getProperty(StoreParam.INPUT_STORE)).getDataStoreOptions();\n GeoWaveInputFormat.setDataStoreName(config, dataStoreOptions.getType());\n GeoWaveInputFormat.setStoreConfigOptions(config, dataStoreOptions.getFactoryOptionsAsMap());\n runTimeProperties.setConfig(new ParameterEnum[] { CentroidParameters.Centroid.EXTRACTOR_CLASS, CentroidParameters.Centroid.WRAPPER_FACTORY_CLASS }, config, GroupAssignmentMapReduce.class);\n NestedGroupCentroidAssignment.setParameters(config, getScope(), runTimeProperties);\n CentroidManagerGeoWave.setParameters(config, getScope(), runTimeProperties);\n NestedGroupCentroidAssignment.setZoomLevel(config, getScope(), zoomLevel);\n return super.run(config, runTimeProperties);\n}\n"
|
"public void run() {\n oldValue = recordStore.getMapEntry(dataKey).getValue();\n final Object valueBeforeProcess = mapService.toObject(oldValue);\n final MapEntrySimple entry = new MapEntrySimple(mapService.toObject(dataKey), valueBeforeProcess);\n response = mapService.toData(entryProcessor.process(entry));\n final Object valueAfterProcess = entry.getValue();\n if (dataOldValue == null && valueAfterProcess == null) {\n eventType = __NO_NEED_TO_FIRE_EVENT;\n } else if (valueAfterProcess == null) {\n recordStore.remove(dataKey);\n eventType = EntryEventType.REMOVED;\n } else {\n if (dataOldValue == null) {\n eventType = EntryEventType.ADDED;\n } else if (!entry.isModified()) {\n eventType = __NO_NEED_TO_FIRE_EVENT;\n } else {\n eventType = EntryEventType.UPDATED;\n }\n dataValue = mapService.toData(entry.getValue());\n recordStore.put(new AbstractMap.SimpleImmutableEntry<Data, Object>(dataKey, dataValue));\n }\n}\n"
|
"public CompilationResult compileOnMemory(Collection<CtClass> ctClassList, URL[] cp) {\n Map<String, String> toCompile = new HashMap<String, String>();\n prettyPrinter = new DefaultJavaPrettyPrinter(getEnvironment());\n for (CtClass ctClass : ctClassList) {\n try {\n this.getProcessingManager().process(ctClass);\n String[] tmp = ctClass.getQualifiedName().split(\"String_Node_Str\");\n char[][] pack = new char[tmp.length - 1][];\n toCompile.put(ctClass.getQualifiedName(), sourceForModelledClass(ctClass));\n }\n } catch (Exception e) {\n e.printStackTrace();\n List<String> errors = new ArrayList<String>();\n errors.add(e.getMessage());\n CompilationResult rbc = new CompilationResult(null, errors);\n return rbc;\n }\n List<String> cps = new ArrayList<>();\n cps.add(\"String_Node_Str\");\n String s = \"String_Node_Str\";\n for (URL url : cp) {\n s += ((url.getPath()) + File.pathSeparator);\n }\n cps.add(s);\n CompilationResult rbc = dcc.javaBytecodeFor(toCompile, new HashMap<String, byte[]>(), cps);\n return rbc;\n}\n"
|
"public void reset() {\n mCheckedItems.clear();\n mGridView.setSelection(0);\n mGridView.requestFocusFromTouch();\n mGridView.setSelection(0);\n mGridAdapter.swapCursor(null);\n resetSpinnerAdapter();\n clearCheckedItems();\n mHasRetrievedAllMedia = false;\n}\n"
|
"public void doProcessing(SamplePacket samples) {\n this.fftBlock.applyWindow(samples.re(), samples.im());\n this.fftBlock.fft(samples.re(), samples.im());\n double realPower;\n double imagPower;\n int size = samples.size();\n for (int i = 0; i < size; i++) {\n int targetIndex = (i + size / 2) % size;\n realPower = samples.re(i) / fftSize;\n realPower = realPower * realPower;\n imagPower = samples.im(i) / fftSize;\n imagPower = imagPower * imagPower;\n mag[targetIndex] = 10 * Math.log10(Math.sqrt(realPower + imagPower));\n }\n}\n"
|
"public Range execute(Document document) {\n Range caret = document.getSelection().getRangeAt(0);\n TreeCaretPosition startSelection = treeOperationFactory.createCaretPosition(getOperation().getSiteId(), caret, caret.getStartOffset());\n TreeCaretPosition endSelection = treeOperationFactory.createCaretPosition(getOperation().getSiteId(), caret, caret.getEndOffset());\n Iterator<TreeOperation> it = ((TreeCompositeOperation) getOperation()).getOperations().iterator();\n while (it.hasNext()) {\n TreeOperation op = it.next();\n startSelection = (TreeCaretPosition) op.transform(startSelection);\n endSelection = (TreeCaretPosition) op.transform(endSelection);\n DomOperation domOperation = domOperationFactory.createDomOperation(op, this.isRemote);\n domOperation.execute(document);\n }\n Node startContainer = EditorUtils.getChildNodeFromLocator(document.getBody(), startSelection.getPath());\n caret.setStart(startContainer, startSelection.getPosition());\n Node endContainer = EditorUtils.getChildNodeFromLocator(document.getBody(), endSelection.getPath());\n caret.setEnd(endContainer, endSelection.getPosition());\n return caret;\n}\n"
|
"public void mouseDragged(MouseEvent evt) {\n if ((_target != null) && ((evt.getModifiers() & InputEvent.BUTTON1_MASK) != 0)) {\n setPosition(evt.getX(), evt.getY());\n }\n}\n"
|
"public boolean onTouch(View v, MotionEvent event) {\n float pos = event.getY();\n if (event.getAction() == 0)\n mLastYPos = pos;\n if (event.getAction() > 1) {\n if (((mLastYPos - pos) > 2.0f) || ((pos - mLastYPos) > 2.0f))\n mScrollDetected = true;\n }\n mLastYPos = pos;\n if (event.getAction() == MotionEvent.ACTION_UP && !mScrollDetected) {\n if (mActivity != null && mActivity.getSupportActionBar().isShowing()) {\n setContentEditingModeVisible(true);\n return false;\n }\n Layout layout = ((TextView) v).getLayout();\n int x = (int) event.getX();\n int y = (int) event.getY();\n x += v.getScrollX();\n y += v.getScrollY();\n if (layout != null) {\n int line = layout.getLineForVertical(y);\n int charPosition = layout.getOffsetForHorizontal(line, x);\n final Spannable s = mContentEditText.getText();\n if (s == null)\n return false;\n WPImageSpan[] image_spans = s.getSpans(charPosition, charPosition, WPImageSpan.class);\n if (image_spans.length != 0) {\n final WPImageSpan span = image_spans[0];\n if (!span.isVideo()) {\n LayoutInflater factory = LayoutInflater.from(getActivity());\n final View alertView = factory.inflate(R.layout.alert_image_options, null);\n if (alertView == null)\n return false;\n final EditText imageWidthText = (EditText) alertView.findViewById(R.id.imageWidthText);\n final EditText titleText = (EditText) alertView.findViewById(R.id.title);\n final EditText caption = (EditText) alertView.findViewById(R.id.caption);\n final CheckBox featuredCheckBox = (CheckBox) alertView.findViewById(R.id.featuredImage);\n final CheckBox featuredInPostCheckBox = (CheckBox) alertView.findViewById(R.id.featuredInPost);\n if (WordPress.getCurrentBlog().isFeaturedImageCapable()) {\n featuredCheckBox.setVisibility(View.VISIBLE);\n featuredInPostCheckBox.setVisibility(View.VISIBLE);\n }\n featuredCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n if (isChecked) {\n featuredInPostCheckBox.setVisibility(View.VISIBLE);\n } else {\n featuredInPostCheckBox.setVisibility(View.GONE);\n }\n }\n });\n final SeekBar seekBar = (SeekBar) alertView.findViewById(R.id.imageWidth);\n final Spinner alignmentSpinner = (Spinner) alertView.findViewById(R.id.alignment_spinner);\n ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(getActivity(), R.array.alignment_array, android.R.layout.simple_spinner_item);\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n alignmentSpinner.setAdapter(adapter);\n imageWidthText.setText(String.valueOf(span.getWidth()) + \"String_Node_Str\");\n seekBar.setProgress(span.getWidth());\n titleText.setText(span.getTitle());\n caption.setText(span.getCaption());\n featuredCheckBox.setChecked(span.isFeatured());\n if (span.isFeatured())\n featuredInPostCheckBox.setVisibility(View.VISIBLE);\n else\n featuredInPostCheckBox.setVisibility(View.GONE);\n featuredInPostCheckBox.setChecked(span.isFeaturedInPost());\n alignmentSpinner.setSelection(span.getHorizontalAlignment(), true);\n final int maxWidth = MediaUtils.getMinimumImageWitdh(getActivity(), span.getImageSource());\n seekBar.setMax(maxWidth / 10);\n if (span.getWidth() != 0)\n seekBar.setProgress(span.getWidth() / 10);\n seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {\n public void onStopTrackingTouch(SeekBar seekBar) {\n }\n public void onStartTrackingTouch(SeekBar seekBar) {\n }\n public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n if (progress == 0)\n progress = 1;\n imageWidthText.setText(progress * 10 + \"String_Node_Str\");\n }\n });\n imageWidthText.setOnFocusChangeListener(new View.OnFocusChangeListener() {\n public void onFocusChange(View v, boolean hasFocus) {\n if (hasFocus) {\n imageWidthText.setText(\"String_Node_Str\");\n }\n }\n });\n imageWidthText.setOnEditorActionListener(new TextView.OnEditorActionListener() {\n public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {\n int width = getEditTextIntegerClamped(imageWidthText, 10, maxWidth);\n seekBar.setProgress(width / 10);\n imageWidthText.setSelection((String.valueOf(width).length()));\n InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(imageWidthText.getWindowToken(), InputMethodManager.RESULT_UNCHANGED_SHOWN);\n return true;\n }\n });\n AlertDialog ad = new AlertDialog.Builder(getActivity()).setTitle(getString(R.string.image_settings)).setView(alertView).setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int whichButton) {\n String title = (titleText.getText() != null) ? titleText.getText().toString() : \"String_Node_Str\";\n span.setTitle(title);\n span.setHorizontalAlignment(alignmentSpinner.getSelectedItemPosition());\n span.setWidth(getEditTextIntegerClamped(imageWidthText, 10, maxWidth));\n String captionText = (caption.getText() != null) ? caption.getText().toString() : \"String_Node_Str\";\n span.setCaption(captionText);\n span.setFeatured(featuredCheckBox.isChecked());\n if (featuredCheckBox.isChecked()) {\n WPImageSpan[] click_spans = s.getSpans(0, s.length(), WPImageSpan.class);\n if (click_spans.length > 1) {\n for (WPImageSpan verifySpan : click_spans) {\n if (verifySpan != span) {\n verifySpan.setFeatured(false);\n verifySpan.setFeaturedInPost(false);\n }\n }\n }\n }\n span.setFeaturedInPost(featuredInPostCheckBox.isChecked());\n }\n }).setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int whichButton) {\n dialog.dismiss();\n }\n }).create();\n ad.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);\n ad.show();\n mScrollDetected = false;\n return true;\n }\n } else {\n mContentEditText.setMovementMethod(ArrowKeyMovementMethod.getInstance());\n int selectionStart = mContentEditText.getSelectionStart();\n if (selectionStart >= 0 && mContentEditText.getSelectionEnd() >= selectionStart)\n mContentEditText.setSelection(selectionStart, mContentEditText.getSelectionEnd());\n }\n MediaGalleryImageSpan[] gallerySpans = s.getSpans(charPosition, charPosition, MediaGalleryImageSpan.class);\n if (gallerySpans.length > 0) {\n final MediaGalleryImageSpan gallerySpan = gallerySpans[0];\n startMediaGalleryActivity(gallerySpan.getMediaGallery());\n }\n }\n } else if (event.getAction() == 1) {\n mScrollDetected = false;\n }\n return false;\n}\n"
|
"private static Object readSingleValue(final byte tagType, final ByteBuffer byteBuffer, final ValidationStringency validationStringency) {\n switch(tagType) {\n case 'Z':\n return readNullTerminatedString(byteBuffer);\n case 'A':\n return (char) byteBuffer.get();\n case 'I':\n final long val = byteBuffer.getInt() & 0xffffffffL;\n if (val <= Integer.MAX_VALUE) {\n return (int) val;\n }\n if (!SAMUtils.isValidUnsignedIntegerAttribute(val)) {\n SAMUtils.processValidationError(new SAMValidationError(SAMValidationError.Type.TAG_VALUE_TOO_LARGE, \"String_Node_Str\" + val, null), validationStringency);\n }\n return val;\n case 'i':\n return byteBuffer.getInt();\n case 's':\n return (int) byteBuffer.getShort();\n case 'S':\n return byteBuffer.getShort() & 0xffff;\n case 'c':\n return (int) byteBuffer.get();\n case 'C':\n return (int) byteBuffer.get() & 0xff;\n case 'f':\n return byteBuffer.getFloat();\n case 'H':\n final String hexRep = readNullTerminatedString(byteBuffer);\n return StringUtil.hexStringToBytes(hexRep);\n default:\n throw new SAMFormatException(\"String_Node_Str\" + (char) tagType);\n }\n}\n"
|
"public void render(Component comp, Writer out) throws IOException {\n final SmartWriter wh = new SmartWriter(out);\n final Menu self = (Menu) comp;\n final String uuid = self.getUuid();\n if (self.isTopmost()) {\n wh.write(\"String_Node_Str\").write(uuid).write(\"String_Node_Str\");\n wh.write(self.getOuterAttrs()).write(self.getInnerAttrs()).write(\"String_Node_Str\");\n wh.write(\"String_Node_Str\").write(uuid).write(\"String_Node_Str\");\n if (self.isImageAssigned()) {\n wh.write(\"String_Node_Str\");\n if (self.getLabel().length() > 0)\n wh.write(\"String_Node_Str\");\n wh.write(\"String_Node_Str\");\n }\n wh.write(\"String_Node_Str\");\n String imagesrc;\n if (self.getImageContent() != null)\n imagesrc = \"String_Node_Str\" + self.getContentSrc() + \"String_Node_Str\";\n else {\n final String src = self.getSrc();\n if (src != null && src.length() > 0)\n imagesrc = \"String_Node_Str\" + exec.encodeURL(src) + \"String_Node_Str\";\n else\n imagesrc = \"String_Node_Str\";\n }\n wh.write(\"String_Node_Str\").write(uuid).write(\"String_Node_Str\").write(imagesrc).write(\"String_Node_Str\");\n new Out(self.getLabel()).render(out);\n wh.write(\"String_Node_Str\").write(self.getMenupopup()).writeln(\"String_Node_Str\");\n } else {\n wh.write(\"String_Node_Str\").write(uuid).write(\"String_Node_Str\");\n wh.write(self.getOuterAttrs()).write(self.getInnerAttrs()).write(\"String_Node_Str\").write(uuid).write(\"String_Node_Str\").write(self.getImgTag());\n new Out(self.getLabel()).render(out);\n wh.write(\"String_Node_Str\").write(self.getMenupopup()).writeln(\"String_Node_Str\");\n }\n}\n"
|
"public Collection getParameterDefns(boolean includeParameterGroups) {\n Collection original = ((ReportRunnable) runnable).getParameterDefns(includeParameterGroups);\n Iterator iter = original.iterator();\n params = new ArrayList();\n while (iter.hasNext()) {\n ParameterDefnBase pBase = (ParameterDefnBase) iter.next();\n try {\n params.add(paraBase.clone());\n } catch (CloneNotSupportedException e) {\n log.log(Level.SEVERE, e.getMessage(), e);\n }\n }\n if (params != null) {\n iter = params.iterator();\n while (iter.hasNext()) {\n IParameterDefnBase pBase = (IParameterDefnBase) iter.next();\n if (pBase instanceof ScalarParameterDefn) {\n ((ScalarParameterDefn) pBase).setReportDesign(runnable.getDesignHandle().getDesign());\n ((ScalarParameterDefn) pBase).setLocale(locale);\n ((ScalarParameterDefn) pBase).evaluateSelectionList();\n } else if (pBase instanceof ParameterGroupDefn) {\n Iterator iter2 = ((ParameterGroupDefn) pBase).getContents().iterator();\n while (iter2.hasNext()) {\n IParameterDefnBase p = (IParameterDefnBase) iter2.next();\n if (p instanceof ScalarParameterDefn) {\n ((ScalarParameterDefn) p).setReportDesign(runnable.getDesignHandle().getDesign());\n ((ScalarParameterDefn) p).setLocale(locale);\n ((ScalarParameterDefn) pBase).evaluateSelectionList();\n }\n }\n }\n }\n }\n return params;\n}\n"
|
"protected Rect growDown(final int w, final int h) {\n final Node down = new Node(mRoot.x, mRoot.y + mRoot.height, mRoot.width, h);\n final Node right = mRoot;\n mRoot = new Node(mRoot.x, mRoot.y, mRoot.width, mRoot.height + h);\n mRoot.split(down, right);\n return down.occupy(w, h);\n}\n"
|
"protected void addDefaultComponents(Entity entity, Node rootNode) {\n super.addDefaultComponents(entity, rootNode);\n if (transparency != null) {\n applyTransparency(TransparencyMode.DEFAULT, transparency);\n }\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.