content stringlengths 40 137k |
|---|
"public static int[] generateColorMap(int[] gradient, int size, double opacity) {\n int[] values = new int[gradient.length];\n int[] colors = new int[gradient.length];\n int interval = (size - 1) / (gradient.length - 1);\n int i;\n for (i = 0; i < gradient.length; i++) {\n values[i] = i * interval;\n colors[i] = gradient[i];\n }\n Log.e(\"String_Node_Str\", Arrays.toString(values));\n int[] colorMap = new int[size];\n int lowColorStop = 0;\n for (i = 0; i < size; i++) {\n Log.e(\"String_Node_Str\", \"String_Node_Str\" + i + \"String_Node_Str\" + lowColorStop);\n if (lowColorStop + 1 < values.length) {\n if (i > values[lowColorStop + 1])\n lowColorStop++;\n }\n if (lowColorStop < values.length - 1) {\n colorMap[i] = interpolateColor(interval * lowColorStop, i, interval * (lowColorStop + 1), colors[lowColorStop], colors[lowColorStop + 1]);\n } else {\n colorMap[i] = colors[colors.length - 1];\n }\n if (opacity != 1) {\n int c = colorMap[i];\n colorMap[i] = Color.argb((int) (Color.alpha(c) * opacity), Color.red(c), Color.green(c), Color.blue(c));\n }\n }\n return colorMap;\n}\n"
|
"public void testQuery() {\n final int entityCount = 10;\n final int queryCount = 3;\n insertDummyEntities(entityCount);\n sleep(2);\n List<DummyEntity> list = null;\n for (int i = 0; i < queryCount; i++) {\n list = executeQuery(sf);\n assertEquals(entityCount, list.size());\n sleepAtLeastSeconds(1);\n }\n assertNotNull(list);\n Session session = sf.openSession();\n Transaction tx = session.beginTransaction();\n try {\n for (DummyEntity dummy : list) {\n session.delete(dummy);\n }\n tx.commit();\n } catch (Exception e) {\n tx.rollback();\n e.printStackTrace();\n } finally {\n session.close();\n }\n Statistics stats = sf.getStatistics();\n assertEquals(1, stats.getQueryCachePutCount());\n assertEquals(1, stats.getQueryCacheMissCount());\n assertEquals(queryCount - 1, stats.getQueryCacheHitCount());\n assertEquals(1, stats.getQueryExecutionCount());\n assertEquals(entityCount, stats.getEntityInsertCount());\n assertEquals(entityCount, stats.getEntityLoadCount());\n assertEquals(entityCount, stats.getEntityDeleteCount());\n assertEquals(entityCount * (queryCount - 1) * 2, stats.getSecondLevelCacheHitCount());\n assertEquals(entityCount, stats.getSecondLevelCacheMissCount());\n stats.logSummary();\n}\n"
|
"public void buildWidgetPanel() {\n add(getLabel());\n value = config.getConfigOptionValue(component, configOption);\n if (((URLConfigOption) configOption).refersToOWLClass()) {\n comboBox = new JComboBox();\n ReasonerComponent reasoner = config.getReasoner();\n String baseURI = reasoner.getBaseURI();\n Map<String, String> prefixes = reasoner.getPrefixes();\n classes = new LinkedList<NamedClass>(reasoner.getNamedClasses());\n for (NamedClass clazz : classes) {\n comboBox.addItem(clazz.toManchesterSyntaxString(baseURI, prefixes));\n }\n comboBox.addActionListener(this);\n NamedClass valueNc = new NamedClass(value.toString());\n comboBox.setSelectedItem(valueNc.toManchesterSyntaxString(baseURI, prefixes));\n add(comboBox);\n } else {\n stringField = new JTextField(35);\n if (value != null) {\n stringField.setText(value.toString());\n }\n stringField.setToolTipText(configOption.getAllowedValuesDescription());\n setButton = new JButton(\"String_Node_Str\");\n setButton.addActionListener(this);\n add(stringField);\n add(setButton);\n if (((URLConfigOption) configOption).refersToFile()) {\n chooseLocalButton = new JButton(\"String_Node_Str\");\n chooseLocalButton.addActionListener(this);\n add(new JLabel(\"String_Node_Str\"));\n add(chooseLocalButton);\n }\n }\n}\n"
|
"public List getGlobal(String whereSql, String clusterName, String tableName) {\n if (StringUtil.isBlank(whereSql)) {\n return null;\n }\n try {\n String versionKey = _buildGlobalVersion(clusterName, tableName);\n if (_exists(versionKey)) {\n int version = Integer.parseInt((String) this.memClient.get(versionKey));\n String cacheKey = _buildGlobalCacheKey(whereKey, clusterName, tableName, version);\n List data = (List) this.memClient.get(cacheKey);\n if (LOG.isDebugEnabled() && data != null) {\n LOG.debug(\"String_Node_Str\" + cacheKey + \"String_Node_Str\");\n }\n return data;\n }\n } catch (Exception e) {\n LOG.warn(\"String_Node_Str\");\n }\n return null;\n}\n"
|
"public InputStream getInputStream(String url) throws IOException {\n HttpGet get = new HttpGet(url);\n HttpResponse response = this.client.execute(get);\n StatusLine statusLine = response.getStatusLine();\n if (!SardineUtil.isGoodResponse(statusLine.getStatusCode()))\n throw new IOException(\"String_Node_Str\" + statusLine.getStatusCode() + \"String_Node_Str\" + statusLine.getReasonPhrase() + \"String_Node_Str\" + url);\n return response.getEntity().getContent();\n}\n"
|
"public void onOptionClick(IconMenu.OptionClickEvent event) {\n event.setWillClose(false);\n event.setWillDestroy(false);\n IconMenu menu = event.getMenu();\n switch(event.getPosition()) {\n case 5:\n event.setWillClose(true);\n event.setWillDestroy(true);\n return;\n case 4:\n if (active) {\n menu.getOption(4).setMaterial(REDSTONE_BLOCK).setTitle(Util.formatText(Translation.getString(\"String_Node_Str\", myPet.getOwner().getLanguage()), RED + Translation.getString(\"String_Node_Str\", myPet.getOwner().getLanguage()))).setLore(RESET + Translation.getString(\"String_Node_Str\", myPet.getOwner().getLanguage()));\n active = false;\n } else {\n menu.getOption(4).setMaterial(EMERALD_BLOCK).setTitle(\"String_Node_Str\" + GREEN + \"String_Node_Str\").setLore(RESET + \"String_Node_Str\" + RED + \"String_Node_Str\");\n active = true;\n }\n menu.update();\n break;\n case 3:\n beacon.active = active;\n beacon.selectedBuffs.clear();\n beacon.selectedBuffs.addAll(selectedBuffs);\n beacon.reciever = reciever;\n event.setWillClose(true);\n event.setWillDestroy(true);\n break;\n case 21:\n if (reciever != BeaconReciever.Owner) {\n menu.getOption(21).setMeta(ownerMeta, false, false);\n if (menu.getOption(22) != null) {\n menu.getOption(22).setMeta(partyMeta);\n }\n menu.getOption(23).setMeta(disabledMeta);\n reciever = BeaconReciever.Owner;\n menu.update();\n }\n break;\n case 22:\n if (reciever != BeaconReciever.Party) {\n menu.getOption(21).setMeta(disabledMeta);\n menu.getOption(22).setMeta(partyMeta);\n menu.getOption(23).setMeta(disabledMeta);\n reciever = BeaconReciever.Party;\n menu.update();\n }\n break;\n case 23:\n if (reciever != BeaconReciever.Everyone) {\n menu.getOption(21).setMeta(disabledMeta);\n if (menu.getOption(22) != null) {\n menu.getOption(22).setMeta(disabledMeta);\n }\n menu.getOption(23).setMeta(everyoneMeta);\n reciever = BeaconReciever.Everyone;\n menu.update();\n }\n break;\n default:\n if (buffPositionItems.containsKey(event.getPosition())) {\n int selectedBuff = buffPositionItems.get(event.getPosition());\n if (selectableBuffs > 1) {\n if (selectedBuffs.indexOf(selectedBuff) != -1) {\n selectedBuffs.remove(selectedBuffs.indexOf(selectedBuff));\n menu.getOption(buffItemPositions.get(selectedBuff)).setGlowing(false);\n menu.update();\n } else if (selectableBuffs > selectedBuffs.size()) {\n selectedBuffs.add(selectedBuff);\n menu.getOption(buffItemPositions.get(selectedBuff)).setGlowing(true);\n menu.update();\n } else {\n break;\n }\n if (selectableBuffs > selectedBuffs.size()) {\n menu.setOption(13, new IconMenuItem().setMaterial(POTION).setTitle(BLUE + Util.formatText(Translation.getString(\"String_Node_Str\", myPet.getOwner().getLanguage()), selectableBuffs - selectedBuffs.size())).setAmount(selectableBuffs - selectedBuffs.size()));\n } else {\n menu.setOption(13, new IconMenuItem().setMaterial(GLASS_BOTTLE).setTitle(GRAY + Util.formatText(Translation.getString(\"String_Node_Str\", myPet.getOwner().getLanguage()), 0)));\n }\n } else {\n if (!selectedBuffs.contains(selectedBuff)) {\n if (selectedBuffs.size() != 0 && menu.getOption(buffItemPositions.get(selectedBuff)) != null) {\n menu.getOption(buffItemPositions.get(selectedBuffs.get(0))).setGlowing(false);\n selectedBuffs.clear();\n }\n selectedBuffs.add(selectedBuff);\n menu.getOption(buffItemPositions.get(selectedBuff)).setGlowing(true);\n menu.update();\n }\n }\n }\n }\n}\n"
|
"public Enumeration collectTests() {\n return new ArrayEnumeration(new String[] { name });\n}\n"
|
"public void objectToEntry(final Page page, final TupleOutput output) {\n try {\n final DataOutputStream dataOutput = new DataOutputStream(mByteHandler.serialize(output));\n PagePersistenter.serializePage(dataOutput, page);\n ByteStreams.copy(new ByteArrayInputStream(output.toByteArray()), dataOutput);\n dataOutput.close();\n } catch (final IOException e) {\n LOGGER.error(e.getMessage(), e);\n }\n}\n"
|
"private CacheConnection getAvailableConnection() throws DataException {\n Iterator it = this.getOdaConnections().iterator();\n while (it.hasNext()) {\n CacheConnection c = (CacheConnection) (it.next());\n if (c.currentStatements < c.maxStatements)\n return c;\n }\n return newConnection();\n}\n"
|
"public void testProjectFacet() throws Exception {\n Project project = projectFactory.createTempProject();\n ConfigurationFacet facet = facetFactory.install(project, ConfigurationFacet.class);\n Assert.assertFalse(facet.getConfigLocation().exists());\n Configuration config = facet.getConfiguration();\n config.setProperty(\"String_Node_Str\", \"String_Node_Str\");\n Assert.assertTrue(facet.getConfigLocation().exists());\n}\n"
|
"public void onLoadMore(boolean loadMore) {\n if (mCanLoadMorePosts && !mIsFetchingPosts)\n requestPosts(loadMore);\n}\n"
|
"public void onResponse(Call call, Response response) {\n if (response.body() instanceof SystemUser) {\n SystemUser systemUser = ((SystemUser) response.body());\n SystemUser currentSystemuser = mSystemUser;\n currentSystemuser.setOutgoingCli(systemUser.getOutgoingCli());\n currentSystemuser.setMobileNumber(systemUser.getMobileNumber());\n currentSystemuser.setClient(systemUser.getClient());\n currentSystemuser.setAppAccountUri(systemUser.getAppAccountUri());\n mJsonStorage.save(currentSystemuser);\n mSystemUser = currentSystemuser;\n String phoneAccountId = mSystemUser.getPhoneAccountId();\n if (phoneAccountId != null) {\n Call<PhoneAccount> apicall = mApi.phoneAccount(phoneAccountId);\n apicall.enqueue(this);\n } else {\n mJsonStorage.remove(PhoneAccount.class);\n }\n } else if (response.body() instanceof PhoneAccount) {\n mJsonStorage.save(response.body());\n mListener.onFinish(this);\n }\n}\n"
|
"public void setRuntimeArgs(ProgramId program, Map<String, String> runtimeArgs) throws IOException, UnauthenticatedException, ProgramNotFoundException, UnauthorizedException {\n String path = String.format(\"String_Node_Str\", program.getApplication(), program.getVersion(), program.getType().getCategoryName(), program.getProgram());\n URL url = config.resolveNamespacedURLV3(program.getNamespaceId(), path);\n HttpRequest request = HttpRequest.put(url).withBody(GSON.toJson(runtimeArgs)).build();\n HttpResponse response = restClient.execute(request, config.getAccessToken(), HttpURLConnection.HTTP_NOT_FOUND);\n if (response.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {\n throw new ProgramNotFoundException(program);\n }\n}\n"
|
"public IConsumerContainerSelector run() {\n synchronized (consumerContainerSelectorTrackerLock) {\n if (consumerContainerSelectorTracker == null) {\n consumerContainerSelectorTracker = new ServiceTracker(getRSABundleContext(), IConsumerContainerSelector.class.getName(), null);\n consumerContainerSelectorTracker.open();\n }\n }\n return (IConsumerContainerSelector) consumerContainerSelectorTracker.getService();\n}\n"
|
"public boolean equals(Object theObj) {\n if (this == theObj) {\n return true;\n }\n if (theObj == null) {\n return false;\n }\n if (!(theObj instanceof ResourceIndexedSearchParamDate)) {\n return false;\n }\n ResourceIndexedSearchParamDate obj = (ResourceIndexedSearchParamDate) theObj;\n EqualsBuilder b = new EqualsBuilder();\n b.append(getParamName(), obj.getParamName());\n b.append(getResource(), obj.getResource());\n b.append(getTimeFromDate(getValueHigh()), getTimeFromDate(obj.getValueHigh()));\n b.append(getTimeFromDate(getValueLow()), getTimeFromDate(obj.getValueLow()));\n return b.isEquals();\n}\n"
|
"public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {\n IJavaElement javaElement = getContext();\n if (javaElement != null) {\n initializeJavaProject(javaElement, configuration);\n } else {\n configuration.setAttribute(ATTR_PROJECT_NAME, \"String_Node_Str\");\n }\n JettyPluginConstants.setClasspathProvider(configuration, JettyPluginConstants.CLASSPATH_PROVIDER_JETTY);\n String projectName = \"String_Node_Str\";\n try {\n projectName = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, \"String_Node_Str\");\n } catch (CoreException e) {\n }\n String launchConfigName = projectName;\n if ((launchConfigName == null) || (launchConfigName.length() == 0)) {\n launchConfigName = \"String_Node_Str\";\n }\n launchConfigName = getLaunchConfigurationDialog().generateName(launchConfigName);\n configuration.rename(launchConfigName);\n try {\n String webAppDir = \"String_Node_Str\";\n if ((projectName != null) && (projectName.length() > 0)) {\n IResource resource = findWebappDir(ResourcesPlugin.getWorkspace().getRoot().getProject(projectName));\n if (resource != null) {\n webAppDir = getWebappText(resource);\n }\n }\n JettyPluginConstants.setWebAppDir(configuration, webAppDir);\n JettyPluginConstants.setContext(configuration, JettyPluginConstants.getContext(configuration));\n JettyPluginConstants.setPort(configuration, JettyPluginConstants.getPort(configuration));\n JettyPluginConstants.setConfigs(configuration, JettyPluginConstants.getConfigs(configuration));\n } catch (CoreException e) {\n JettyPlugin.error(\"String_Node_Str\", e);\n }\n}\n"
|
"private void fillinSearchResult(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletException, IOException {\n URLCodec theURLCodec = new URLCodec();\n String theQueryString = aRequest.getParameter(\"String_Node_Str\");\n String theBasePath = basePath;\n String theBackLink = basePath;\n if (!StringUtils.isEmpty(theQueryString)) {\n try {\n theBasePath = theBasePath + \"String_Node_Str\" + theURLCodec.encode(theQueryString);\n theBackLink = theBackLink + \"String_Node_Str\" + theURLCodec.encode(theQueryString);\n } catch (EncoderException e) {\n e.printStackTrace();\n }\n }\n Map<String, String> theDrilldownDimensions = new HashMap<>();\n String thePathInfo = aRequest.getPathInfo();\n if (!StringUtils.isEmpty(thePathInfo)) {\n String theWorkingPathInfo = thePathInfo;\n if (theWorkingPathInfo.startsWith(\"String_Node_Str\")) {\n theWorkingPathInfo = theWorkingPathInfo.substring(1);\n }\n String[] thePaths = StringUtils.split(theWorkingPathInfo, \"String_Node_Str\");\n for (int i = 0; i < thePaths.length; i++) {\n try {\n String theDecodedValue = theURLCodec.decode(thePaths[i]);\n String theEncodedValue = theURLCodec.encode(theDecodedValue);\n theBasePath = theBasePath + \"String_Node_Str\" + theEncodedValue;\n if (i < thePaths.length - 1) {\n theBackLink = theBackLink + \"String_Node_Str\" + thePaths[i];\n }\n String theDecodedValue = theURLCodec.decode(thePaths[i]);\n if (i == 0) {\n theQueryString = theDecodedValue;\n } else {\n FacetSearchUtils.addToMap(theDecodedValue, theDrilldownDimensions);\n }\n } catch (DecoderException e) {\n LOGGER.error(\"String_Node_Str\" + aRequest.getPathInfo(), e);\n }\n }\n if (basePath.equals(theBackLink)) {\n theBackLink = null;\n }\n } else {\n theBackLink = null;\n }\n if (!StringUtils.isEmpty(theQueryString)) {\n aRequest.setAttribute(\"String_Node_Str\", theQueryString);\n try {\n aRequest.setAttribute(\"String_Node_Str\", backend.performQuery(theQueryString, theBackLink, theBasePath, theDrilldownDimensions));\n } catch (Exception e) {\n e.printStackTrace();\n }\n } else {\n aRequest.setAttribute(\"String_Node_Str\", \"String_Node_Str\");\n }\n aRequest.setAttribute(\"String_Node_Str\", serverBase);\n aRequest.getRequestDispatcher(\"String_Node_Str\").forward(aRequest, aResponse);\n}\n"
|
"public void initTable(List<String> headers, List<MetadataColumn> columnMap) {\n TableLayout tLayout = new TableLayout();\n innerTable.setLayout(tLayout);\n innerTable.setHeaderVisible(true);\n innerTable.setLinesVisible(true);\n GridData gd = new GridData(GridData.FILL_BOTH);\n innerTable.setLayoutData(gd);\n for (int index = 0; index < headers.size(); index++) {\n String columnLabel = headers.get(index);\n if (columnLabel != null) {\n if (columnLabel.length() == 1) {\n columnLabel = columnLabel + PluginConstant.SPACE_STRING + PluginConstant.SPACE_STRING;\n }\n tLayout.addColumnData(new ColumnPixelData(columnLabel.length() * getHeaderDisplayWeight(index)));\n new TableColumn(innerTable, SWT.LEFT).setText(columnLabel);\n }\n }\n CellEditor[] editors = getCellEditor(headers, columnMap);\n addContextMenu();\n AbstractMatchCellModifier<T> cellModifier = getTableCellModifier();\n if (cellModifier != null) {\n cellModifier.setColumnMap(columnMap);\n this.setCellModifier(cellModifier);\n }\n this.setCellEditors(editors);\n this.setColumnProperties(headers.toArray(new String[headers.size()]));\n this.setContentProvider(getTableContentProvider());\n this.setLabelProvider(getTableLabelProvider());\n GridData tableGD = new GridData(GridData.FILL_BOTH);\n tableGD.heightHint = getTableHeightHint();\n innerTable.setLayoutData(tableGD);\n}\n"
|
"LayoutInflater getInflater() {\n if (mInflater == null) {\n Context wrappedContext = new ContextThemeWrapper(getContext(), THEME_RES_FOR_TYPE[mMenuType]);\n mInflater = (LayoutInflater) wrappedContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n }\n return mInflater;\n}\n"
|
"public <IdType> List<IdType> persistArrayApi11(Class<?> modelClass, JSONArray jsonArray) throws JSONException {\n try {\n enableWriteAheadLogging();\n mDatabase.beginTransactionNonExclusive();\n List<IdType> id_list = persistArrayOfObjects(modelClass, jsonArray);\n mDatabase.setTransactionSuccessful();\n return id_list;\n } catch (JSONException e) {\n throw e;\n } finally {\n if (mDatabase.inTransaction()) {\n mDatabase.endTransaction();\n }\n }\n}\n"
|
"public ExitStatus afterStep(StepExecution se) {\n logger.info(\"String_Node_Str\" + se.getStepName());\n if (clusteringService != null) {\n VmEventProcessor processor = clusteringService.getEventProcessor();\n processor.tryResume();\n }\n ExecutionContext jec = se.getJobExecution().getExecutionContext();\n if (se.getStatus().equals(BatchStatus.COMPLETED)) {\n jec.put(se.getStepName() + \"String_Node_Str\", true);\n jobExecutionStatusHolder.setCurrentStepProgress(se.getJobExecution().getId(), 1);\n } else {\n for (Throwable t : se.getFailureExceptions()) {\n String msg = t.getMessage();\n if (msg != null && !msg.isEmpty()) {\n TrackableTasklet.putIntoJobExecutionContext(jec, JobConstants.CURRENT_ERROR_MESSAGE, msg);\n break;\n }\n }\n }\n return se.getExitStatus();\n}\n"
|
"public org.osgi.service.remoteserviceadmin.ImportReference getImportReference() {\n Throwable t = getException();\n if (t != null)\n return null;\n return importReference;\n}\n"
|
"public Object runSave() {\n switch(event.getID()) {\n case ControlEvent.CONTROL_DOWNLOAD_START:\n stopButton.setEnabled(true);\n pauseButton.setEnabled(true);\n playButton.setEnabled(false);\n speedmeter.start();\n break;\n case ControlEvent.CONTROL_ALL_DOWNLOADS_FINISHED:\n case ControlEvent.CONTROL_DOWNLOAD_STOP:\n stopButton.setEnabled(false);\n setPause(false);\n pauseButton.setEnabled(false);\n playButton.setEnabled(true);\n if (speedmeter != null)\n speedmeter.stop();\n break;\n }\n return null;\n}\n"
|
"private void applyBackgroundVerticalPosition(BackgroundInfo binfo, String yposition) {\n if (yposition.endsWith(\"String_Node_Str\")) {\n binfo.setBackgroundYPositionAbsolute(false);\n try {\n binfo.setBackgroundYPosition((int) Double.parseDouble(yposition.substring(0, yposition.length() - 1).trim()));\n } catch (NumberFormatException nfe) {\n binfo.setBackgroundYPosition(0);\n }\n } else {\n switch(yposition) {\n case CENTER:\n binfo.setBackgroundYPositionAbsolute(false);\n binfo.setBackgroundYPosition(50);\n case RIGHT:\n binfo.setBackgroundYPositionAbsolute(false);\n binfo.setBackgroundYPosition(100);\n case LEFT:\n binfo.setBackgroundYPositionAbsolute(false);\n binfo.setBackgroundYPosition(0);\n case BOTTOM:\n binfo.setBackgroundYPositionAbsolute(false);\n binfo.setBackgroundYPosition(100);\n case TOP:\n binfo.setBackgroundYPositionAbsolute(false);\n binfo.setBackgroundYPosition(0);\n case INHERIT:\n BackgroundInfo bi = this.getPreviousRenderState().getBackgroundInfo();\n if (bi != null) {\n binfo.setBackgroundYPositionAbsolute(bi.isBackgroundYPositionAbsolute());\n binfo.setBackgroundYPosition(bi.getBackgroundYPosition());\n }\n case INITIAL:\n binfo.setBackgroundYPositionAbsolute(true);\n binfo.setBackgroundYPosition(HtmlValues.getPixelSize(yposition, this, 0));\n default:\n binfo.setBackgroundYPositionAbsolute(true);\n binfo.setBackgroundYPosition(HtmlValues.getPixelSize(yposition, this, 0));\n }\n }\n}\n"
|
"private String[] getCipherSuites(final List<CipherSuites> cipherSuites) {\n final List<String> suites = new ArrayList<>();\n if (cipherSuites != null && !cipherSuites.isEmpty()) {\n cipherSuites.stream().forEach(cs -> {\n suites.add(cs.getSuiteName());\n });\n }\n return suites.toArray(new String[suites.size()]);\n}\n"
|
"protected void onDragEnd(String id, int x, int y, AjaxRequestTarget ajaxRequestTarget) {\n if (getCurrentDragOperation() != DRAGNDROP.NONE) {\n JSDNDEvent event = WebCellBasedView.this.createScriptEvent(EventType.onDragEnd, getDragComponent(), null);\n event.setData(getDragData());\n event.setDataMimeType(getDragDataMimeType());\n event.setDragResult(getDropResult() ? getCurrentDragOperation() : DRAGNDROP.NONE);\n WebCellBasedView.this.onDragEnd(event);\n }\n super.onDragEnd(id, x, y, ajaxRequestTarget);\n}\n"
|
"private void doAppendMessage(final Request<RpcWireRequest, RpcReply> request) {\n final AppendEntries appendMessage = request.getRequest().getAppendMessage();\n if (appendMessage.getTerm() < currentTerm) {\n AppendEntriesReply m = new AppendEntriesReply(currentTerm, false, 0);\n RpcReply reply = new RpcReply(m);\n request.reply(reply);\n return;\n }\n if (appendMessage.getTerm() > currentTerm) {\n setCurrentTerm(appendMessage.getTerm());\n }\n if (myState != State.FOLLOWER) {\n haltLeader();\n }\n lastRPC = info.currentTimeMillis();\n long theLeader = appendMessage.getLeaderId();\n if (whosLeader != theLeader) {\n LOG.debug(\"String_Node_Str\", myId, theLeader);\n whosLeader = theLeader;\n stateChangeChannel.publish(new ReplicatorInstanceEvent(ReplicatorInstanceEvent.EventType.LEADER_ELECTED, this, whosLeader, info.currentTimeMillis(), null));\n }\n long msgPrevLogIndex = appendMessage.getPrevLogIndex();\n long msgPrevLogTerm = appendMessage.getPrevLogTerm();\n if (msgPrevLogIndex != 0 && log.getLogTerm(msgPrevLogIndex) != msgPrevLogTerm) {\n AppendEntriesReply m = new AppendEntriesReply(currentTerm, false, log.getLastIndex());\n RpcReply reply = new RpcReply(m);\n request.reply(reply);\n return;\n }\n if (appendMessage.getEntriesList().isEmpty()) {\n AppendEntriesReply m = new AppendEntriesReply(currentTerm, true, 0);\n RpcReply reply = new RpcReply(m);\n request.reply(reply);\n long newCommitIndex = Math.min(appendMessage.getCommitIndex(), log.getLastIndex());\n setLastCommittedIndex(newCommitIndex);\n return;\n }\n ListenableFuture<ArrayList<LogEntry>> entriesToCommitFuture = validateAndFixLocalLog(request, appendMessage);\n Futures.addCallback(entriesToCommitFuture, new FutureCallback<ArrayList<LogEntry>>() {\n public void onSuccess(ArrayList<LogEntry> entriesToCommit) {\n ListenableFuture<Boolean> logCommitNotification = log.logEntries(entriesToCommit);\n Futures.addCallback(logCommitNotification, new FutureCallback<Boolean>() {\n public void onSuccess(Boolean result) {\n AppendEntriesReply m = new AppendEntriesReply(currentTerm, true, 0);\n RpcReply reply = new RpcReply(m);\n request.reply(reply);\n lastCommittedIndex = Math.min(appendMessage.getCommitIndex(), log.getLastIndex());\n notifyLastCommitted();\n }\n public void onFailure(Throwable t) {\n AppendEntriesReply m = new AppendEntriesReply(currentTerm, false, 0);\n RpcReply reply = new RpcReply(m);\n request.reply(reply);\n }\n }, fiber);\n }\n public void onFailure(Throwable t) {\n AppendEntriesReply m = new AppendEntriesReply(currentTerm, false, 0);\n RpcReply reply = new RpcReply(m);\n request.reply(reply);\n }\n }, fiber);\n}\n"
|
"protected IFigure createFigure() {\n IConnection conn = (IConnection) getModel();\n ConnectionFigure connection = new ConnectionFigure(conn, conn.getSourceNodeConnector().getConnectionProperty(conn.getLineStyle()), conn.getSource());\n if (((Connection) getModel()).isActivate()) {\n connection.setAlpha(-1);\n } else {\n ((ConnectionFigure) connection).setAlpha(Connection.ALPHA_VALUE);\n }\n if (PluginChecker.isAutoParalelPluginLoaded()) {\n connection.updateStatus();\n }\n return connection;\n}\n"
|
"private void rollback0(long address, boolean writeDiscard) throws JournalException {\n if (address == -1L) {\n notifyTxError(JournalEvents.EVT_JNL_UNKNOWN_TRANSACTION);\n throw new IncompatibleJournalException(\"String_Node_Str\", this.getLocation());\n }\n txLog.read(address, tx);\n if (tx.address == 0) {\n throw new JournalException(\"String_Node_Str\");\n }\n if (writeDiscard) {\n LOG.info().$(\"String_Node_Str\").$(metadata.getLocation()).$(\"String_Node_Str\").$(tx.txn).$(\"String_Node_Str\").$ts(tx.timestamp).$();\n writeDiscardFile(tx.journalMaxRowID);\n }\n rollbackPartitions(tx);\n Partition<T> lag = getIrregularPartition();\n if (tx.lagName != null && tx.lagName.length() > 0 && (lag == null || !tx.lagName.equals(lag.getName()))) {\n Partition<T> newLag = createTempPartition(tx.lagName);\n setIrregularPartition(newLag);\n newLag.applyTx(tx.lagSize, tx.lagIndexPointers);\n } else if (lag != null && tx.lagName == null) {\n removeIrregularPartitionInternal();\n } else if (lag != null) {\n lag.truncate(tx.lagSize);\n }\n if (tx.symbolTableSizes.length == 0) {\n for (int i = 0, sz = getSymbolTableCount(); i < sz; i++) {\n getSymbolTable(i).truncate();\n }\n } else {\n for (int i = 0, sz = getSymbolTableCount(); i < sz; i++) {\n getSymbolTable(i).truncate(tx.symbolTableSizes[i]);\n }\n }\n appendTimestampLo = -1;\n appendTimestampHi = -1;\n appendPartition = null;\n txLog.writeTxAddress(tx.address);\n txActive = false;\n}\n"
|
"public static void render(float renderYaw, float renderPitch) {\n GL11.glRotatef(180F, 0F, 0F, 1F);\n GL11.glRotatef(180F, 0F, 1F, 0F);\n GL11.glRotatef(renderYaw, 0F, 1F, 0F);\n MODEL.renderBody(0.0625F);\n MODEL.renderRadar(0.0625F);\n MODEL.renderCannon(0.0625F, (float) Math.toRadians(renderPitch));\n}\n"
|
"public static boolean isSigned(Item book) {\n return book != null && book.getType() == ItemType.WrittenBook;\n}\n"
|
"public synchronized int getNumberOfStartsNotFinished() {\n for (DatenDownload datenDownload : this) {\n Start s = datenDownload.start;\n if (s != null) {\n if (s.status < Start.STATUS_FERTIG) {\n return this.size();\n }\n }\n }\n return 0;\n}\n"
|
"public Control createPart(Composite parent) {\n if (shell == null) {\n shell = parent.getShell();\n }\n Composite main = new Composite(parent, SWT.NONE);\n GridLayoutFactory.fillDefaults().numColumns(1).applyTo(main);\n GridDataFactory.fillDefaults().grab(true, true).applyTo(main);\n Label commandDisplayName = new Label(main, SWT.NONE);\n GridDataFactory.fillDefaults().grab(false, false).applyTo(commandDisplayName);\n commandDisplayName.setText(\"String_Node_Str\");\n displayName = new Text(main, SWT.BORDER);\n GridDataFactory.fillDefaults().grab(true, false).applyTo(displayName);\n Label terminalLocationLabel = new Label(main, SWT.NONE);\n GridDataFactory.fillDefaults().grab(false, false).applyTo(terminalLocationLabel);\n terminalLocationLabel.setText(\"String_Node_Str\");\n terminalLocation = new Text(main, SWT.BORDER);\n GridDataFactory.fillDefaults().grab(true, false).applyTo(terminalLocation);\n final Button terminalButton = new Button(main, SWT.CHECK);\n int padding = 20;\n GridDataFactory.fillDefaults().grab(false, false).indent(padding, SWT.DEFAULT).applyTo(terminalButton);\n terminalButton.setText(\"String_Node_Str\");\n terminalButton.setSelection(applyTerminalToAllCommands);\n terminalButton.addSelectionListener(new SelectionAdapter() {\n public void widgetSelected(SelectionEvent event) {\n applyTerminalToAllCommands = terminalButton.getSelection();\n }\n });\n Label fileSelectionLabel = new Label(main, SWT.NONE);\n GridDataFactory.fillDefaults().grab(false, false).applyTo(fileSelectionLabel);\n fileSelectionLabel.setText(\"String_Node_Str\");\n locationField = new Text(main, SWT.BORDER);\n GridDataFactory.fillDefaults().grab(false, false).applyTo(locationField);\n Composite buttonArea = new Composite(main, SWT.NONE);\n GridLayoutFactory.fillDefaults().numColumns(1).applyTo(buttonArea);\n GridDataFactory.fillDefaults().grab(false, false).applyTo(buttonArea);\n findApplicationButton = new Button(buttonArea, SWT.PUSH);\n GridDataFactory.fillDefaults().grab(false, false).applyTo(findApplicationButton);\n findApplicationButton.setText(\"String_Node_Str\");\n findApplicationButton.addSelectionListener(new SelectionAdapter() {\n public void widgetSelected(SelectionEvent event) {\n handleChange(event);\n }\n });\n displayName.addModifyListener(new ModifyListener() {\n public void modifyText(ModifyEvent event) {\n handleChange(event);\n }\n });\n findApplicationButton = new Button(buttonArea, SWT.PUSH);\n GridDataFactory.fillDefaults().grab(false, false).applyTo(findApplicationButton);\n findApplicationButton.setText(\"String_Node_Str\");\n findApplicationButton.addSelectionListener(new SelectionAdapter() {\n\n public void modifyText(ModifyEvent event) {\n handleChange(event);\n }\n });\n if (predefined != null && !predefined.isEmpty()) {\n Label templates = new Label(main, SWT.NONE);\n GridDataFactory.fillDefaults().grab(false, false).applyTo(templates);\n templates.setText(\"String_Node_Str\");\n Composite predefinedArea = new Composite(main, SWT.NONE);\n GridLayoutFactory.fillDefaults().numColumns(1).applyTo(predefinedArea);\n GridDataFactory.fillDefaults().grab(false, false).applyTo(predefinedArea);\n predefinedCommands = new Combo(predefinedArea, SWT.BORDER | SWT.READ_ONLY);\n GridDataFactory.fillDefaults().grab(false, false).applyTo(predefinedCommands);\n predefinedCommands.setEnabled(true);\n predefinedCommands.addSelectionListener(new SelectionAdapter() {\n public void widgetSelected(SelectionEvent event) {\n int selectionIndex = predefinedCommands.getSelectionIndex();\n if (selectionIndex != -1) {\n int predefIndex = selectionIndex - 1;\n ServiceCommand value = predefIndex >= 0 && predefIndex < predefined.size() ? predefined.get(predefIndex) : null;\n setPredefinedCommand(value);\n }\n }\n });\n predefinedCommands.add(\"String_Node_Str\");\n for (ServiceCommand option : predefined) {\n predefinedCommands.add(option.getExternalApplication().getDisplayName());\n }\n predefinedCommands.select(0);\n }\n Text argsLabel = new Text(main, SWT.MULTI);\n GridDataFactory.fillDefaults().grab(false, false).applyTo(argsLabel);\n argsLabel.setText(\"String_Node_Str\");\n argsLabel.setBackground(main.getBackground());\n options = new Text(main, SWT.MULTI | SWT.WRAP | SWT.BORDER);\n options.addTraverseListener(new TraverseListener() {\n public void keyTraversed(TraverseEvent event) {\n if (event.detail == SWT.TRAVERSE_RETURN && (event.stateMask & SWT.MODIFIER_MASK) != 0) {\n event.doit = true;\n }\n }\n });\n options.addModifyListener(new ModifyListener() {\n public void modifyText(ModifyEvent event) {\n handleChange(event);\n }\n });\n GridDataFactory.fillDefaults().grab(true, true).hint(30, IDialogConstants.ENTRY_FIELD_WIDTH).applyTo(options);\n Text optionsDescription = new Text(main, SWT.MULTI | SWT.BORDER);\n GridDataFactory.fillDefaults().grab(true, true).hint(30, IDialogConstants.ENTRY_FIELD_WIDTH).applyTo(optionsDescription);\n optionsDescription.setEditable(false);\n optionsDescription.setText(getOptionsDescription());\n optionsDescription.setBackground(main.getBackground());\n readValues();\n return main;\n}\n"
|
"private void updateRankedList() {\n selectedTablePerspectiveIndex = 0;\n updateScoredTablePerspectives();\n rankColumn.clear();\n rankedElementToElementLayout.clear();\n rankedElements = new ArrayList<RankedElement>();\n for (TablePerspective scoredTablePerspective : tablePerspectives) {\n if (referenceTablePerspective.getRecordSubTablePerspectives().size() > 1) {\n float score = scoredTablePerspective.getContainerStatistics().getAdjustedRandIndex().getScore(referenceTablePerspective, true);\n RankedElement rankedElement = new RankedElement(score, scoredTablePerspective, null);\n rankedElements.add(rankedElement);\n } else {\n HashMap<TablePerspective, Float> subTablePerspectiveToScore = referenceTablePerspective.getContainerStatistics().getJaccardIndex().getScore(scoredTablePerspective, true);\n for (TablePerspective subTablePerspective : subTablePerspectiveToScore.keySet()) {\n RankedElement rankedElement = new RankedElement(subTablePerspectiveToScore.get(subTablePerspective), scoredTablePerspective, subTablePerspective);\n rankedElements.add(rankedElement);\n }\n }\n }\n Collections.sort(rankedElements);\n int rank = 0;\n for (RankedElement rankedElement : rankedElements) {\n BigDecimal bd = new BigDecimal(rankedElement.getScore()).setScale(2, RoundingMode.HALF_EVEN);\n float score = bd.floatValue();\n Row rankedElementLayout = new Row(\"String_Node_Str\");\n rankedElementLayout.setPixelSizeX(VENDING_MACHINE_PIXEL_WIDTH);\n rankedElementLayout.setPixelSizeY(30);\n String rankString = \"String_Node_Str\" + (++rank) + \"String_Node_Str\" + score + \"String_Node_Str\" + rankedElement.getColumnTablePerspective().getDataDomain().getLabel() + \"String_Node_Str\" + rankedElement.getColumnTablePerspective().getRecordPerspective().getLabel();\n if (rankedElement.getGroupTablePerspective() != null)\n rankString += \"String_Node_Str\" + rankedElement.getGroupTablePerspective().getLabel();\n RankNumberRenderer rankNumberRenderer = new RankNumberRenderer(rankString, getTextRenderer());\n rankedElementLayout.setRenderer(rankNumberRenderer);\n rankedElementToElementLayout.put(rankedElement, rankedElementLayout);\n rankColumn.append(rankedElementLayout);\n if (rank >= MAX_RANKED_ELEMENTS)\n break;\n }\n TablePerspective tablePerspective = rankedElements.get(selectedTablePerspectiveIndex).getColumnTablePerspective();\n addTablePerspectiveToStratomex(tablePerspective);\n brickColumnManager.moveBrickColumn(brickColumnManager.getBrickColumn(tablePerspective), brickColumnManager.indexOfBrickColumn(referenceBrickColumn) + 1);\n rankedElementToElementLayout.get(rankedElements.get(0)).addBackgroundRenderer(highlightRankBackgroundRenderer);\n stratomex.updateLayout();\n stratomex.setLayoutDirty();\n}\n"
|
"public void testXmlSchemaUnqualified() throws Exception {\n InputStream inputStream = ClassLoader.getSystemResourceAsStream(XMLSCHEMA_UNQUALIFIED);\n jaxbContext = DynamicJAXBContextFactory.createContextFromXSD(inputStream, null, null, null);\n DynamicEntity person = jaxbContext.newDynamicEntity(PACKAGE + \"String_Node_Str\" + PERSON);\n assertNotNull(\"String_Node_Str\", person);\n person.set(\"String_Node_Str\", 456);\n person.set(\"String_Node_Str\", \"String_Node_Str\");\n Document marshalDoc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();\n jaxbContext.createMarshaller().marshal(person, marshalDoc);\n Node node = marshalDoc.getChildNodes().item(0);\n assertEquals(\"String_Node_Str\", \"String_Node_Str\", node.getNamespaceURI());\n assertNotNull(\"String_Node_Str\", node.getPrefix());\n DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();\n if (builderFactory.getClass().getPackage().getName().contains(\"String_Node_Str\")) {\n return;\n } else {\n Node attr = node.getAttributes().item(0);\n assertNull(\"String_Node_Str\" + attr.getPrefix() + \"String_Node_Str\", attr.getPrefix());\n }\n Node childNode = node.getChildNodes().item(0);\n assertNull(\"String_Node_Str\", childNode.getPrefix());\n}\n"
|
"public void debug(Object message, Throwable t) {\n if (isDebugEnabled())\n logger.log(SELF_FQCN, Level.DEBUG, message, t);\n}\n"
|
"public Object getEntityFromDocument(Class<?> entityClass, EntityMetadata m, DBObject document, List<String> relations) {\n Object entity = null;\n try {\n entity = entityClass.newInstance();\n String rowKey = (String) document.get(\"String_Node_Str\");\n PropertyAccessorHelper.setId(entity, m, rowKey);\n List<Column> columns = m.getColumnsAsList();\n for (Column column : columns) {\n setColumnValue(document, entity, column);\n }\n List<EmbeddedColumn> embeddedColumns = m.getEmbeddedColumnsAsList();\n for (EmbeddedColumn embeddedColumn : embeddedColumns) {\n Field embeddedColumnField = embeddedColumn.getField();\n Object embeddedDocumentObject = document.get(embeddedColumnField.getName());\n if (embeddedDocumentObject != null) {\n if (embeddedDocumentObject instanceof BasicDBList) {\n Class embeddedObjectClass = PropertyAccessorHelper.getGenericClass(embeddedColumnField);\n Collection embeddedCollection = DocumentObjectMapper.getCollectionFromDocumentList((BasicDBList) embeddedDocumentObject, embeddedColumnField.getType(), embeddedObjectClass, embeddedColumn.getColumns());\n PropertyAccessorHelper.set(entity, embeddedColumnField, embeddedCollection);\n } else if (embeddedDocumentObject instanceof BasicDBObject) {\n Object embeddedObject = null;\n if (embeddedColumnField.isAnnotationPresent(Embedded.class)) {\n embeddedObject = DocumentObjectMapper.getObjectFromDocument((BasicDBObject) embeddedDocumentObject, embeddedColumn.getField().getType(), embeddedColumn.getColumns());\n } else {\n embeddedObject = ((BasicDBObject) embeddedDocumentObject).get(embeddedColumn.getName());\n }\n PropertyAccessorHelper.set(entity, embeddedColumnField, embeddedObject);\n } else {\n throw new PersistenceException(\"String_Node_Str\" + \"String_Node_Str\");\n }\n }\n }\n if (relations != null) {\n EnhanceEntity e = null;\n Map<String, Object> relationValue = new HashMap<String, Object>();\n for (String r : relations) {\n if (relationValue == null) {\n relationValue = new HashMap<String, Object>();\n }\n Object colValue = document.get(r);\n relationValue.put(r, colValue);\n }\n e = new EnhanceEntity(entity, PropertyAccessorHelper.getId(entity, m), relationValue);\n return e;\n }\n return entity;\n } catch (InstantiationException e) {\n log.error(\"String_Node_Str\" + entityClass + \"String_Node_Str\" + e.getMessage());\n return entity;\n } catch (IllegalAccessException e) {\n log.error(\"String_Node_Str\" + e.getMessage());\n return entity;\n } catch (PropertyAccessException e) {\n log.error(\"String_Node_Str\" + e.getMessage());\n return entity;\n }\n}\n"
|
"public String getSigningProfile() {\n if (model.getProfiles() != null && model.getProfiles().getProfile() != null) {\n for (Profile profile : model.getProfiles().getProfile()) {\n List<Plugin> plugin = profile.getBuild().getPlugins().getPlugin();\n for (Plugin plugin2 : plugin) {\n List<PluginExecution> execution = plugin2.getExecutions().getExecution();\n if (getSigningProfilePlugin(profile, execution).equals(profile.getId())) {\n return getSigningProfilePlugin(profile, execution);\n }\n }\n }\n }\n return \"String_Node_Str\";\n}\n"
|
"public boolean equals(Object o) {\n if (this == o)\n return true;\n if (o == null || getClass() != o.getClass())\n return false;\n if (null == this.getColumnNames())\n return false;\n UniqueConstraint that = (UniqueConstraint) o;\n boolean result = false;\n result = !(getColumnNames() != null ? !getColumnNames().equalsIgnoreCase(that.getColumnNames()) : that.getColumnNames() != null) && isDeferrable() == that.isDeferrable() && isInitiallyDeferred() == that.isInitiallyDeferred() && isDisabled() == that.isDisabled();\n if (result) {\n if (null == this.getTable()) {\n result = null == that.getTable();\n } else if (null == that.getTable()) {\n result = false;\n } else {\n result = this.getTable().getName().equals(that.getTable().getName());\n }\n }\n return result;\n}\n"
|
"public boolean checkVisuals(Player player, Block targetBlock, Block playerClick) {\n if (isInteracting(player) || playerClick.isLiquid()) {\n return false;\n }\n double x = targetBlock.getX() - playerClick.getX() * ((targetBlock.getX() - playerClick.getX() * 1) < 0 ? -1 : 1);\n double y = targetBlock.getY() - playerClick.getY() * ((targetBlock.getY() - playerClick.getY() * 1) < 0 ? -1 : 1);\n double z = targetBlock.getZ() - playerClick.getZ() * ((targetBlock.getZ() - playerClick.getZ() * 1) < 0 ? -1 : 1);\n return x >= VISUALS_MAXOFFSET || y >= VISUALS_MAXOFFSET || z >= VISUALS_MAXOFFSET;\n}\n"
|
"public Collection<IEventExecTestCasePO> getAllEventEventExecTC() {\n Collection<IEventExecTestCasePO> evHandlers = getEventExecTcMap().values();\n setParents(evHandlers);\n return Collections.unmodifiableCollection(evHandlers);\n}\n"
|
"public void loginOnClickListener(View view) {\n String userEmail = emailEditText.getText().toString();\n String userPassword = passwordEditText.getText().toString();\n if (isValidUserDate(userEmail, userPassword)) {\n login(userEmail, userPassword);\n } else {\n DialogUtils.showLong(LoginActivity.this, getString(R.string.dlg_not_all_fields_entered));\n }\n}\n"
|
"public void setProperties(Property[] properties) {\n this.properties = ArrayUtils.clone(properties);\n}\n"
|
"public void onResponseReceived(Request request, Response response) {\n if (response.getStatusCode() != Response.SC_OK) {\n errorLogger.log(Level.SEVERE, \"String_Node_Str\" + url + \"String_Node_Str\" + response.getStatusCode() + \"String_Node_Str\" + response.getText());\n callback.onFailure(new Throwable(\"String_Node_Str\" + response.getStatusCode()));\n } else if (response.getHeader(ERROR_HEADER) != null && response.getHeader(ERROR_HEADER).length() > 0) {\n errorLogger.log(Level.SEVERE, \"String_Node_Str\" + url + \"String_Node_Str\" + response.getStatusCode() + \"String_Node_Str\" + response.getText());\n callback.onFailure(new Throwable(ConsoleUtil.messages.badRequestData()));\n } else {\n ErrorMetricsMetadataResponse metricsResponse = ErrorMetricsMetadataResponse.fromJSON(response.getText());\n if (metricsResponse == null) {\n callback.onFailure(new Throwable(ConsoleUtil.messages.badOrMissingResponseData()));\n } else {\n ErrorDetailJS js = metricsResponse.getReturnData();\n if (js == null)\n callback.onFailure(new Throwable(ConsoleUtil.messages.badOrMissingResponseData()));\n else\n callback.onSuccess(js);\n }\n }\n}\n"
|
"public static TypedReturnCode<IndicatorUnit> createIndicatorUnit(Pattern pattern, ModelElementIndicator modelElementIndicator, Analysis analysis, IndicatorDefinition indicatorDefinition) {\n TypedReturnCode<IndicatorUnit> result = new TypedReturnCode<IndicatorUnit>();\n for (Indicator indicator : modelElementIndicator.getIndicators()) {\n if (UDIHelper.getMatchingIndicatorName(indicatorDefinition, pattern).equals(indicator.getName()) && indicator instanceof PatternMatchingIndicator) {\n result.setOk(false);\n result.setMessage(DefaultMessagesImpl.getString(\"String_Node_Str\"));\n return result;\n }\n }\n Indicator patternMatchingIndicator = null;\n String expressionType = DomainHelper.getExpressionType(pattern);\n boolean isSQLPattern = (ExpressionType.SQL_LIKE.getLiteral().equals(expressionType));\n if (indicatorDefinition != null) {\n patternMatchingIndicator = UDIFactory.createUserDefIndicator(indicatorDefinition, pattern);\n } else {\n patternMatchingIndicator = isSQLPattern ? PatternIndicatorFactory.createSqlPatternMatchingIndicator(pattern) : PatternIndicatorFactory.createRegexpMatchingIndicator(pattern);\n }\n IEditorPart theEdit = CorePlugin.getDefault().getCurrentActiveEditor();\n if (theEdit != null && theEdit instanceof AnalysisEditor && analysis.getContext().getConnection() == null) {\n theEdit.doSave(null);\n }\n ExecutionLanguage executionLanguage = analysis.getParameters().getExecutionLanguage();\n DbmsLanguage dbmsLanguage = DbmsLanguageFactory.createDbmsLanguage(analysis);\n if (dbmsLanguage.isSql()) {\n MessageUI.openWarning(DefaultMessagesImpl.getString(\"String_Node_Str\"));\n result.setOk(false);\n return result;\n }\n boolean isJavaEngin = ExecutionLanguage.JAVA.equals(executionLanguage);\n Expression returnExpression = dbmsLanguage.getRegexp(pattern, isJavaEngin);\n if ((ExpressionType.REGEXP.getLiteral().equals(expressionType) || ExpressionType.SQL_LIKE.getLiteral().equals(expressionType)) && returnExpression == null) {\n String executeType = isJavaEngin ? executionLanguage.getName() : dbmsLanguage.getDbmsName();\n boolean openPattern = MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), DefaultMessagesImpl.getString(\"String_Node_Str\"), DefaultMessagesImpl.getString(\"String_Node_Str\", executeType));\n if (openPattern) {\n RepositoryNode node = (RepositoryNode) RepositoryNodeHelper.recursiveFind(pattern);\n if (RepositoryNodeHelper.canOpenEditor(node)) {\n new OpenItemEditorAction(node).run();\n }\n }\n result.setOk(false);\n return result;\n }\n String javaRexex = DomainHelper.getJavaRegexp(pattern);\n if (javaRexex == null) {\n }\n DataManager dm = analysis.getContext().getConnection();\n if (dm != null) {\n TypedReturnCode<java.sql.Connection> trc = JavaSqlFactory.createConnection((Connection) dm);\n boolean isDelimitedFileConnection = ConnectionUtils.isDelimitedFileConnection((DataProvider) dm);\n boolean isMdmConnection = ConnectionUtils.isMdmConnection((DataProvider) dm);\n if (trc != null) {\n java.sql.Connection conn = trc.getObject();\n if (isDelimitedFileConnection) {\n dbmsLanguage = DbmsLanguageFactory.createDbmsLanguage((DelimitedFileConnection) dm);\n } else if (isMdmConnection) {\n dbmsLanguage = DbmsLanguageFactory.createDbmsLanguage((MDMConnection) dm);\n } else {\n try {\n SoftwareSystem softwareSystem = DatabaseContentRetriever.getSoftwareSystem(conn);\n dbmsLanguage = DbmsLanguageFactory.createDbmsLanguage(softwareSystem);\n } catch (SQLException e) {\n log.error(e, e);\n }\n }\n }\n if (!(isSQLPattern || DefinitionHandler.getInstance().canRunRegularExpressionMatchingIndicator(dbmsLanguage, isJavaEngin, pattern) || isDelimitedFileConnection)) {\n result.setOk(false);\n result.setMessage(DefaultMessagesImpl.getString(\"String_Node_Str\"));\n return result;\n }\n }\n if (indicatorDefinition == null) {\n if (!DefinitionHandler.getInstance().setDefaultIndicatorDefinition(patternMatchingIndicator)) {\n log.error(DefaultMessagesImpl.getString(\"String_Node_Str\", patternMatchingIndicator.getName()));\n }\n } else {\n patternMatchingIndicator.setIndicatorDefinition(indicatorDefinition);\n }\n IndicatorEnum type = IndicatorEnum.findIndicatorEnum(patternMatchingIndicator.eClass());\n IndicatorUnit addIndicatorUnit = modelElementIndicator.addSpecialIndicator(type, patternMatchingIndicator);\n DependenciesHandler.getInstance().setUsageDependencyOn(analysis, pattern);\n result.setOk(true);\n result.setMessage(DefaultMessagesImpl.getString(\"String_Node_Str\"));\n result.setObject(addIndicatorUnit);\n return result;\n}\n"
|
"private File getJrxmlFolderFromReport(TdReport rep, IFolder folder) {\n File jrxmlFolderFile = null;\n String repFileString = new File(rep.eResource().getURI().toFileString()).getAbsolutePath();\n String projectString = folder.getProject().getLocation().toFile().getAbsolutePath();\n if (repFileString.startsWith(projectString)) {\n jrxmlFolderFile = folder.getLocation().toFile();\n } else {\n String jrxmlFolderString = folder.getLocation().toString();\n jrxmlFolderFile = new File(jrxmlFolderString.replaceFirst(projectString, repFileString.substring(0, repFileString.indexOf(EResourceConstant.DATA_PROFILING.getPath()) - 1)));\n }\n return jrxmlFolderFile;\n}\n"
|
"public void disableFollow() {\n if (isFollowEnabled.compareAndSet(true, false)) {\n if (GuidedPoint.isGuidedMode(drone)) {\n drone.getGuidedPoint().pauseAtCurrentLocation();\n }\n roiEstimator.disableFollow();\n }\n roiEstimator.disableFollow();\n}\n"
|
"public String parse(int ident) {\n String space, content;\n if (ident < 0)\n ident = 0;\n space = \"String_Node_Str\";\n for (int i = 0; i < ident; i++) space += \"String_Node_Str\";\n content = space + \"String_Node_Str\";\n content += space + \"String_Node_Str\";\n content += space + \"String_Node_Str\";\n if (getId() != null)\n content += \"String_Node_Str\" + getId() + \"String_Node_Str\";\n if (getTitle() != null)\n content += \"String_Node_Str\" + getTitle() + \"String_Node_Str\";\n if (getXmlns() != null)\n content += \"String_Node_Str\" + getXmlns() + \"String_Node_Str\";\n content += \"String_Node_Str\";\n if (getHead() != null)\n content += getHead().parse(ident + 1);\n if (getBody() != null)\n content += getBody().parse(ident + 1);\n content += space + \"String_Node_Str\";\n return content;\n}\n"
|
"private void addTypeArgumentsIfAvailable(String signature) {\n int firstParen = signature.indexOf('(');\n if (firstParen == 0)\n return;\n int p = 1;\n boolean lastMappingFound = false;\n while (!lastMappingFound) {\n int q = signature.indexOf(':', p);\n String typeVar = signature.substring(p, q);\n q++;\n if (signature.charAt(q) == ':') {\n q++;\n }\n int r = signature.indexOf(':', q);\n if (r < 0) {\n r = firstParen - 2;\n lastMappingFound = true;\n } else {\n r = signature.lastIndexOf(';', r);\n p = r + 1;\n }\n String typeArg = signature.substring(q, r);\n addTypeMapping(ownerTypeDesc, typeVar, typeArg);\n }\n}\n"
|
"public final GLCanvas getParentGLCanvas() {\n if (this.isRenderedRemote())\n return getRemoteRenderingGLView().getParentGLCanvas();\n return parentGLCanvas;\n}\n"
|
"private static void doHoist(Logger logger, Instruction inst, int hoistDepth, HoistTracking state) {\n assert (hoistDepth > 0);\n logger.trace(\"String_Node_Str\" + hoistDepth + \"String_Node_Str\" + inst.toString());\n HoistTracking ancestor = state.getAncestor(hoistDepth);\n logger.trace(\"String_Node_Str\" + ancestor.block.getType());\n ancestor.addInstruction(inst);\n relocateVarDefs(state, inst, ancestor);\n ancestor.updateState(inst);\n}\n"
|
"public synchronized String getPluginLocalizedValue(String key, boolean keepAmpersands) throws MissingResourceException {\n if (myBundle == null) {\n ServiceTracker localizationTracker;\n BundleContext context = Activator.getDefault().getBundle().getBundleContext();\n localizationTracker = new ServiceTracker(context, BundleLocalization.class.getName(), null);\n localizationTracker.open();\n BundleLocalization location = (BundleLocalization) localizationTracker.getService();\n if (location != null)\n myBundle = location.getLocalization(Activator.getDefault().getBundle(), Locale.getDefault().toString());\n }\n if (myBundle != null) {\n String raw = myBundle.getString(key);\n if (keepAmpersands || raw.indexOf(AMPERSAND) < 0)\n return raw;\n StringBuilder sb = new StringBuilder(raw.length());\n for (int i = 0; i < raw.length(); i++) {\n char c = raw.charAt(i);\n if (c != AMPERSAND)\n sb.append(c);\n }\n return sb.toString();\n }\n return sb.toString();\n}\n"
|
"public static Uri makeAndInsertUri(Context context, Uri sourceUri) {\n long time = System.currentTimeMillis();\n String filename = new SimpleDateFormat(TIME_STAMP_NAME).format(new Date(time));\n File saveDirectory = getFinalSaveDirectory(context, sourceUri);\n File file = new File(saveDirectory, filename + \"String_Node_Str\");\n return linkNewFileToUri(context, sourceUri, file, time);\n}\n"
|
"private void testResultMarginalsHelper(boolean logDomain) {\n double[] root = new double[] { 1, 2, 3 };\n double[][] child = new double[][] { { 0, 4, 5 }, { 6, 0, 7 }, { 8, 9, 0 } };\n FactorGraph fg = new FactorGraph();\n int n = root.length;\n ProjDepTreeFactor treeFac = new ProjDepTreeFactor(n, VarType.PREDICTED);\n treeFac.updateFromModel(null, logDomain);\n LinkVar[] rootVars = treeFac.getRootVars();\n LinkVar[][] childVars = treeFac.getChildVars();\n for (int i = -1; i < n; i++) {\n for (int j = 0; j < n; j++) {\n if (i != j) {\n ExplicitFactor f;\n if (i == -1) {\n f = new ExplicitFactor(new VarSet(rootVars[j]));\n f.setValue(LinkVar.TRUE, root[j]);\n f.setValue(LinkVar.FALSE, 1.0);\n } else {\n f = new ExplicitFactor(new VarSet(childVars[i][j]));\n f.setValue(LinkVar.TRUE, child[i][j]);\n f.setValue(LinkVar.FALSE, 1.0);\n }\n if (logDomain) {\n f.convertRealToLog();\n }\n fg.addFactor(f);\n }\n }\n }\n fg.addFactor(treeFac);\n BeliefPropagationPrm prm = new BeliefPropagationPrm();\n prm.maxIterations = 1;\n prm.logDomain = logDomain;\n prm.schedule = BpScheduleType.TREE_LIKE;\n prm.updateOrder = BpUpdateOrder.SEQUENTIAL;\n prm.normalizeMessages = normalizeMessages;\n BeliefPropagation bp = new BeliefPropagation(fg, prm);\n bp.run();\n BfsBpSchedule schedule = new BfsBpSchedule(fg);\n System.out.println();\n for (FgEdge edge : schedule.getOrder()) {\n System.out.println(edge.toString());\n }\n System.out.println();\n for (int i = -1; i < n; i++) {\n for (int j = 0; j < n; j++) {\n if (i != j) {\n System.out.format(\"String_Node_Str\", i, j, getExpectedCount(bp, rootVars, childVars, logDomain, i, j));\n }\n }\n }\n double Z = 45 + 28 + 20 + 84 + 162 + 216 + 96;\n assertEquals((28 + 84) / Z, getExpectedCount(bp, rootVars, childVars, logDomain, 1, 2), 1e-3);\n assertEquals((45 + 162 + 216) / Z, getExpectedCount(bp, rootVars, childVars, logDomain, 2, 1), 1e-3);\n assertEquals((28 + 20 + 96) / Z, getExpectedCount(bp, rootVars, childVars, logDomain, 0, 1), 1e-3);\n assertEquals((96 + 216) / Z, getExpectedCount(bp, rootVars, childVars, logDomain, 2, 0), 1e-3);\n assertEquals((45 + 28 + 20) / Z, getExpectedCount(bp, rootVars, childVars, logDomain, -1, 0), 1e-13);\n assertEquals((162 + 216 + 96) / Z, getExpectedCount(bp, rootVars, childVars, logDomain, -1, 2), 1e-3);\n double[] trees = new double[] { 45, 28, 20, 84, 162, 216, 96 };\n double expectedRbar = 0;\n for (int t = 0; t < trees.length; t++) {\n expectedRbar += trees[t] * FastMath.log(trees[t]);\n }\n System.out.println(\"String_Node_Str\" + expectedRbar);\n assertEquals(45 + 28 + 20 + 84 + 162 + 216 + 96, logDomain ? FastMath.exp(bp.getPartition()) : bp.getPartition(), 1e-3);\n BruteForceInferencer bf = new BruteForceInferencer(fg, logDomain);\n bf.run();\n BeliefPropagationTest.assertEqualMarginals(fg, bf, bp, 1e-10);\n}\n"
|
"public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.menu_sync, menu);\n syncItem = menu.findItem(R.id.action_sync);\n if (centerId != -1) {\n List<MeetingCenter> center = new ArrayList<MeetingCenter>();\n center.addAll(Select.from(MeetingCenter.class).where(Condition.prop(\"String_Node_Str\").eq(centerId)).list());\n if (center.size() > 0 && center.get(0).getIsSynced() == 1)\n syncItem.setEnabled(false);\n }\n}\n"
|
"public void actionPerformed(ActionEvent e) {\n String searchText = parentWindow.getCurrentSearchText();\n if (searchText == null)\n return;\n Vector<ProtocolProviderService> telephonyProviders = CallManager.getTelephonyProviders();\n ProtocolProviderService callProvider = null;\n if (telephonyProviders.size() == 1) {\n CallManager.createCall(telephonyProviders.get(0), searchText);\n } else if (telephonyProviders.size() > 1) {\n ChooseCallAccountPopupMenu chooseAccountDialog = new ChooseCallAccountPopupMenu(callContact, searchText, telephonyProviders);\n chooseAccountDialog.showPopupMenu();\n }\n}\n"
|
"public void verifySubtypeChain(List<JSType> typeChain, boolean checkSubtyping) throws Exception {\n for (int i = 0; i < typeChain.size(); i++) {\n for (int j = 0; j < typeChain.size(); j++) {\n JSType typeI = typeChain.get(i);\n JSType typeJ = typeChain.get(j);\n JSType namedTypeI = getNamedWrapper(\"String_Node_Str\", typeI);\n JSType namedTypeJ = getNamedWrapper(\"String_Node_Str\", typeJ);\n JSType proxyTypeI = new ProxyObjectType(registry, typeI);\n JSType proxyTypeJ = new ProxyObjectType(registry, typeJ);\n if (i == j) {\n assertTrue(typeI + \"String_Node_Str\", typeI.isEquivalentTo(typeI));\n assertTrue(\"String_Node_Str\" + typeI + \"String_Node_Str\", namedTypeI.isEquivalentTo(namedTypeI));\n assertTrue(\"String_Node_Str\" + typeI + \"String_Node_Str\", proxyTypeI.isEquivalentTo(proxyTypeI));\n } else {\n boolean shouldCheck = true;\n ObjectType objectI = typeI.toObjectType();\n ObjectType objectJ = typeJ.toObjectType();\n if (objectI != null && objectJ != null) {\n FunctionType constructorI = objectI.getConstructor();\n FunctionType constructorJ = objectJ.getConstructor();\n if (constructorI != null && constructorJ != null && constructorI.isStructuralInterface() && constructorJ.isStructuralInterface()) {\n if (constructorI.isEquivalentTo(constructorJ)) {\n shouldCheck = false;\n }\n }\n }\n if (shouldCheck) {\n assertFalse(typeI + \"String_Node_Str\" + typeJ, typeI.isEquivalentTo(typeJ));\n assertFalse(\"String_Node_Str\" + typeI + \"String_Node_Str\" + typeJ, namedTypeI.isEquivalentTo(namedTypeJ));\n assertFalse(\"String_Node_Str\" + typeI + \"String_Node_Str\" + typeJ, proxyTypeI.isEquivalentTo(proxyTypeJ));\n }\n }\n assertTrue(typeJ + \"String_Node_Str\" + typeI, typeJ.canCastTo(typeI));\n assertTrue(typeJ + \"String_Node_Str\" + namedTypeI, typeJ.canCastTo(namedTypeI));\n assertTrue(typeJ + \"String_Node_Str\" + proxyTypeI, typeJ.canCastTo(proxyTypeI));\n assertTrue(\"String_Node_Str\" + typeJ + \"String_Node_Str\" + typeI, namedTypeJ.canCastTo(typeI));\n assertTrue(\"String_Node_Str\" + typeJ + \"String_Node_Str\" + typeI, namedTypeJ.canCastTo(namedTypeI));\n assertTrue(\"String_Node_Str\" + typeJ + \"String_Node_Str\" + typeI, namedTypeJ.canCastTo(proxyTypeI));\n assertTrue(\"String_Node_Str\" + typeJ + \"String_Node_Str\" + typeI, proxyTypeJ.canCastTo(typeI));\n assertTrue(\"String_Node_Str\" + typeJ + \"String_Node_Str\" + typeI, proxyTypeJ.canCastTo(namedTypeI));\n assertTrue(\"String_Node_Str\" + typeJ + \"String_Node_Str\" + typeI, proxyTypeJ.canCastTo(proxyTypeI));\n if (typeI.isSubtypeOf(typeJ) && typeJ.isSubtypeOf(typeI)) {\n continue;\n }\n if (checkSubtyping) {\n if (i <= j) {\n assertTrue(typeJ + \"String_Node_Str\" + typeI, typeJ.isSubtypeOf(typeI));\n assertTrue(\"String_Node_Str\" + typeJ + \"String_Node_Str\" + typeI, namedTypeJ.isSubtypeOf(namedTypeI));\n assertTrue(\"String_Node_Str\" + typeJ + \"String_Node_Str\" + typeI, proxyTypeJ.isSubtypeOf(proxyTypeI));\n } else {\n assertFalse(typeJ + \"String_Node_Str\" + typeI, typeJ.isSubtypeOf(typeI));\n assertFalse(\"String_Node_Str\" + typeJ + \"String_Node_Str\" + typeI, namedTypeJ.isSubtypeOf(namedTypeI));\n assertFalse(\"String_Node_Str\" + typeJ + \"String_Node_Str\" + typeI, proxyTypeJ.isSubtypeOf(proxyTypeI));\n }\n JSType expectedSupremum = i < j ? typeI : typeJ;\n JSType expectedInfimum = i > j ? typeI : typeJ;\n assertTypeEquals(expectedSupremum + \"String_Node_Str\" + typeI + \"String_Node_Str\" + typeJ, expectedSupremum, typeI.getLeastSupertype(typeJ));\n assertTypeEquals(expectedInfimum + \"String_Node_Str\" + typeI + \"String_Node_Str\" + typeJ, expectedInfimum, typeI.getGreatestSubtype(typeJ));\n }\n }\n }\n}\n"
|
"public Response deleteCollectionItem(Integer collectionId, Integer itemId, String user_ip, String user_agent, String xforwarderfor, HttpHeaders headers, HttpServletRequest request) throws WebApplicationException {\n log.info(\"String_Node_Str\" + itemId + \"String_Node_Str\" + collectionId + \"String_Node_Str\");\n org.dspace.core.Context context = null;\n try {\n context = createContext(getUser(headers));\n org.dspace.content.Collection dspaceCollection = findCollection(context, collectionId, org.dspace.core.Constants.WRITE);\n org.dspace.content.Item item = null;\n org.dspace.content.ItemIterator dspaceItems = dspaceCollection.getItems();\n while (dspaceItems.hasNext()) {\n org.dspace.content.Item dspaceItem = dspaceItems.next();\n if (dspaceItem.getID() == itemId) {\n item = dspaceItem;\n }\n }\n if (item == null) {\n context.abort();\n log.warn(\"String_Node_Str\" + itemId + \"String_Node_Str\");\n throw new WebApplicationException(Response.Status.NOT_FOUND);\n } else if (!AuthorizeManager.authorizeActionBoolean(context, item, org.dspace.core.Constants.REMOVE)) {\n context.abort();\n if (context.getCurrentUser() != null) {\n log.error(\"String_Node_Str\" + context.getCurrentUser().getEmail() + \"String_Node_Str\");\n } else {\n log.error(\"String_Node_Str\");\n }\n throw new WebApplicationException(Response.Status.UNAUTHORIZED);\n }\n writeStats(dspaceCollection, UsageEvent.Action.UPDATE, user_ip, user_agent, xforwarderfor, headers, request, context);\n writeStats(item, UsageEvent.Action.REMOVE, user_ip, user_agent, xforwarderfor, headers, request, context);\n dspaceCollection.removeItem(item);\n context.complete();\n } catch (ContextException e) {\n processException(\"String_Node_Str\" + itemId + \"String_Node_Str\" + collectionId + \"String_Node_Str\" + e.getMessage(), context);\n } catch (SQLException e) {\n processException(\"String_Node_Str\" + itemId + \"String_Node_Str\" + collectionId + \"String_Node_Str\" + e, context);\n } catch (AuthorizeException e) {\n processException(\"String_Node_Str\" + itemId + \"String_Node_Str\" + collectionId + \"String_Node_Str\" + e, context);\n } catch (IOException e) {\n processException(\"String_Node_Str\" + itemId + \"String_Node_Str\" + collectionId + \"String_Node_Str\" + e, context);\n } finally {\n processFinally(context);\n }\n log.info(\"String_Node_Str\" + itemId + \"String_Node_Str\" + collectionId + \"String_Node_Str\");\n return Response.ok().build();\n}\n"
|
"public static boolean cancellingBlockBreak(Block block, Player player) {\n if (block == null)\n return false;\n if (player != null && (Permission.has(player, Permission.ADMIN) || Permission.has(player, Permission.MOD)))\n return false;\n if (uSign.isSign(block))\n block.getState().update();\n if (restrictedSign(block))\n return !restrictedSign.canDestroy(player, uBlock.findRestrictedSign(block));\n Sign sign = uBlock.findSign(block, (player != null ? uLongName.stripName(player.getName()) : null));\n if (!isCorrectSign(sign, block))\n return false;\n if (playerIsNotOwner(player, sign))\n return !isAdmin(player);\n if (weShouldReturnMoney() && !Permission.has(player, Permission.NOFEE)) {\n float refundPrice = Config.getFloat(Property.SHOP_REFUND_PRICE);\n Economy.add(uLongName.getName(sign.getLine(0)), refundPrice);\n player.sendMessage(Config.getLocal(Language.SHOP_REFUNDED).replace(\"String_Node_Str\", Economy.formatBalance(refundPrice)));\n }\n return false;\n}\n"
|
"public void creeperDeathEvent(LivingDeathEvent evt) {\n if (evt.entityLiving instanceof EntityCreeper) {\n if (CREEPER_BLOW_UP_IN_FIRE) {\n if (evt.source == DamageSource.onFire || evt.source == DamageSource.inFire) {\n evt.setCanceled(true);\n boolean flag = evt.entityLiving.worldObj.getGameRules().getGameRuleBooleanValue(\"String_Node_Str\");\n if (((EntityCreeper) evt.entityLiving).getPowered()) {\n evt.entityLiving.worldObj.createExplosion(evt.entityLiving, evt.entityLiving.posX, evt.entityLiving.posY, evt.entityLiving.posZ, 6f, flag);\n } else {\n evt.entityLiving.worldObj.createExplosion(evt.entityLiving, evt.entityLiving.posX, evt.entityLiving.posY, evt.entityLiving.posZ, 3f, flag);\n }\n }\n }\n }\n}\n"
|
"public ImageProcessingThread(int numThread, int numProcessors, File[] imageFiles, boolean storeResults, boolean showResults, String storeDir) {\n this.numThread = numThread;\n this.numThreads = numThreads;\n this.imageFiles = imageFiles;\n this.storeResults = storeResults;\n this.showResults = showResults;\n this.storeDir = storeDir;\n}\n"
|
"void writeGetConstructionProxy() throws IOException {\n out.writeLine(\"String_Node_Str\", SuppressWarnings.class).openScope(\"String_Node_Str\", ConstructionProxy.class, Class.class);\n for (Map.Entry<Class<?>, ConstructionProxy<?>> entry : constructionProxies.entrySet()) {\n Class<?> implementation = entry.getKey();\n out.openScope(\"String_Node_Str\", implementation);\n out.openScope(\"String_Node_Str\", ConstructionProxy.class, ConstructionProxy.class, implementation);\n out.openScope(\"String_Node_Str\", implementation, Object.class, InvocationTargetException.class);\n out.openScope(\"String_Node_Str\", implementation);\n int argument = 0;\n for (Iterator<Parameter<?>> i = entry.getValue().getParameters().iterator(); i.hasNext(); ) {\n Parameter<?> parameter = i.next();\n String separator = i.hasNext() ? \"String_Node_Str\" : \"String_Node_Str\";\n out.writeLine(\"String_Node_Str\", parameter.getKey().getTypeLiteral().getType(), argument, separator);\n argument++;\n }\n out.closeScope(\"String_Node_Str\");\n out.closeScope(\"String_Node_Str\");\n out.openScope(\"String_Node_Str\", List.class, Parameter.class);\n out.openScope(\"String_Node_Str\", Arrays.class, Parameter.class);\n argument = 0;\n for (Iterator<Parameter<?>> i = entry.getValue().getParameters().iterator(); i.hasNext(); ) {\n Parameter<?> parameter = i.next();\n String separator = i.hasNext() ? \"String_Node_Str\" : \"String_Node_Str\";\n out.writeLine(\"String_Node_Str\", Parameter.class, argument, keyLiteral(parameter.getKey()), Nullability.class, parameter.getNullability(), separator);\n argument++;\n }\n out.closeScope(\"String_Node_Str\");\n out.closeScope(\"String_Node_Str\");\n out.openScope(\"String_Node_Str\", Member.class);\n out.writeLine(\"String_Node_Str\");\n out.closeScope(\"String_Node_Str\");\n out.closeScope(\"String_Node_Str\");\n out.closeScope(\"String_Node_Str\");\n }\n out.writeLine();\n out.writeLine(\"String_Node_Str\", IllegalArgumentException.class);\n out.closeScope(\"String_Node_Str\");\n}\n"
|
"private String processConstantString(String s) throws PathEngineException {\n StringBuilder b = new StringBuilder();\n int i = 1;\n while (i < s.length() - 1) {\n char ch = s.charAt(i);\n if (ch == '\\\\') {\n i++;\n switch(s.charAt(i)) {\n case 't':\n b.append('\\t');\n break;\n case 'r':\n b.append('\\r');\n break;\n case 'n':\n b.append('\\n');\n break;\n case 'f':\n b.append('\\f');\n break;\n case '\\'':\n b.append('\\'');\n break;\n case '\\\\':\n b.append('\\\\');\n break;\n case '/':\n b.append('/');\n break;\n case 'u':\n i++;\n int uc = Integer.parseInt(s.substring(i, i + 4), 16);\n b.append((char) uc);\n i = i + 4;\n break;\n default:\n throw new PathEngineException(\"String_Node_Str\" + s.charAt(i));\n }\n } else {\n b.append(ch);\n i++;\n }\n }\n return b.toString();\n}\n"
|
"public static void main(String[] args) {\n Display display = Display.getDefault();\n Shell shell = new Shell(display, SWT.CLOSE);\n shell.setSize(600, 400);\n shell.setLayout(new GridLayout());\n c3dViewer = new SwtLiveChartViewer(shell, SWT.NO_BACKGROUND);\n c3dViewer.setLayoutData(new GridData(GridData.FILL_BOTH));\n c3dViewer.addPaintListener(c3dViewer);\n shell.open();\n while (!shell.isDisposed()) {\n if (!display.readAndDispatch())\n display.sleep();\n }\n display.dispose();\n}\n"
|
"public ResponseEntity searchDomain(String name, HttpServletRequest request, HttpServletResponse response) {\n String decodeDomain = name;\n String punyDomainName = decodeDomain;\n try {\n decodeDomain = DomainUtil.iso8859Decode(name);\n decodeDomain = DomainUtil.decodeAndTrimAndReplaceAsciiToLowercase(decodeDomain);\n } catch (Exception e) {\n return RestResponseUtil.createResponse400();\n }\n if (StringUtils.isBlank(decodeDomain)) {\n return RestResponseUtil.createResponse400();\n }\n decodeDomain = StringUtil.getNormalization(decodeDomain);\n if (StringUtil.ASTERISK.equals(decodeDomain) || decodeDomain.startsWith(StringUtil.ASTERISK)) {\n return RestResponseUtil.createResponse422();\n }\n decodeDomain = DomainUtil.deleteLastPoint(decodeDomain);\n decodeDomain = StringUtils.lowerCase(decodeDomain);\n DomainSearch domainSearch = searchService.searchDomain(queryParser.parseDomainQueryParam(decodeDomain, decodeDomain));\n if (null != domainSearch) {\n if (domainSearch.getHasNoAuthForAllObjects()) {\n return RestResponseUtil.createResponse403();\n }\n responseDecorator.decorateResponse(domainSearch);\n return RestResponseUtil.createResponse200(domainSearch);\n }\n return RestResponseUtil.createResponse404();\n}\n"
|
"public void doRepaint() {\n currentViewer.repaint();\n}\n"
|
"public void onNameTag(AsyncPlayerReceiveNameTagEvent e) {\n List<Element> elements = Methods.getBendingPlayer(e.getNamedPlayer().getName()).getElements();\n if (elements != null && plugin.getConfig().getBoolean(\"String_Node_Str\")) {\n if (elements.size() < 1)\n e.setTag(ChatColor.LIGHT_PURPLE + e.getNamedPlayer().getName());\n else if (elements.get(0).equals(Element.Earth))\n e.setTag(ChatColor.GREEN + e.getNamedPlayer().getName());\n else if (elements.get(0).equals(Element.Air))\n e.setTag(ChatColor.GRAY + e.getNamedPlayer().getName());\n else if (elements.get(0).equals(Element.Water))\n e.setTag(ChatColor.AQUA + e.getNamedPlayer().getName());\n else if (elements.get(0).equals(Element.Fire))\n e.setTag(ChatColor.RED + e.getNamedPlayer().getName());\n else if (elements.get(0).equals(Element.Chi))\n e.setTag(ChatColor.GOLD + e.getNamedPlayer().getName());\n }\n}\n"
|
"public synchronized void drawPlot(Graphics graphics, boolean clearfirst) {\n if (graphics == null) {\n System.out.println(\"String_Node_Str\");\n return;\n }\n Thread.yield();\n Rectangle drawRect = bounds();\n graphics.setPaintMode();\n if (clearfirst) {\n graphics.clearRect(0, 0, drawRect.width, drawRect.height);\n }\n graphics.setFont(_titlefont);\n FontMetrics tfm = graphics.getFontMetrics();\n graphics.setFont(_superscriptfont);\n FontMetrics sfm = graphics.getFontMetrics();\n graphics.setFont(_labelfont);\n FontMetrics lfm = graphics.getFontMetrics();\n if (_errorMsg != null) {\n int fheight = lfm.getHeight() + 2;\n int msgy = fheight;\n graphics.setColor(Color.black);\n for (int i = 0; i < _errorMsg.length; i++) {\n graphics.drawString(_errorMsg[i], 10, msgy);\n msgy += fheight;\n }\n return;\n }\n if (!_xRangeGiven) {\n if (_xBottom > _xTop) {\n _setXRange(0, 0);\n } else {\n _setXRange(_xBottom, _xTop);\n }\n }\n if (!_yRangeGiven) {\n if (_yBottom > _yTop) {\n _setYRange(0, 0);\n } else {\n _setYRange(_yBottom, _yTop);\n }\n }\n int titley = 0;\n int titlefontheight = tfm.getHeight();\n if (_title != null || _yExp != 0) {\n titley = titlefontheight + _topPadding;\n }\n graphics.setFont(_labelfont);\n int labelheight = lfm.getHeight();\n int halflabelheight = labelheight / 2;\n int ySPos = drawRect.height - 5;\n if (_xExp != 0 && _xticks == null) {\n int xSPos = drawRect.x + drawRect.width - _rightPadding;\n String superscript = Integer.toString(_xExp);\n xSPos -= sfm.stringWidth(superscript);\n graphics.setFont(_superscriptfont);\n graphics.drawString(superscript, xSPos, ySPos - halflabelheight);\n xSPos -= lfm.stringWidth(\"String_Node_Str\");\n graphics.setFont(_labelfont);\n graphics.drawString(\"String_Node_Str\", xSPos, ySPos);\n _bottomPadding = (3 * labelheight) / 2 + 5;\n }\n if (_xlabel != null && _bottomPadding < labelheight + 5) {\n _bottomPadding = titlefontheight + 5;\n }\n _uly = drawRect.y + titley + 5;\n _lry = drawRect.height - labelheight - _bottomPadding - 3;\n int height = _lry - _uly;\n _yscale = height / (_yMax - _yMin);\n _ytickscale = height / (_ytickMax - _ytickMin);\n int ny = 2 + height / (labelheight + 10);\n double yStep = _roundUp((_ytickMax - _ytickMin) / (double) ny);\n double yStart = yStep * Math.ceil(_ytickMin / yStep);\n int widesty = 0;\n String[] ylabels = new String[ny];\n int[] ylabwidth = new int[ny];\n int ind = 0;\n if (_yticks == null) {\n int numfracdigits = _numFracDigits(yStep);\n for (double ypos = yStart; ypos <= _ytickMax; ypos += yStep) {\n if (ind >= ny)\n break;\n String yl = _formatNum(ypos, numfracdigits);\n ylabels[ind] = yl;\n int lw = lfm.stringWidth(yl);\n ylabwidth[ind++] = lw;\n if (lw > widesty) {\n widesty = lw;\n }\n }\n } else {\n Enumeration nl = _yticklabels.elements();\n while (nl.hasMoreElements()) {\n String label = (String) nl.nextElement();\n int lw = lfm.stringWidth(label);\n if (lw > widesty) {\n widesty = lw;\n }\n }\n }\n if (_ylabel != null) {\n _ulx = drawRect.x + widesty + lfm.stringWidth(\"String_Node_Str\") + _leftPadding;\n } else {\n _ulx = drawRect.x + widesty + _leftPadding;\n }\n int legendwidth = _drawLegend(graphics, drawRect.width - _rightPadding, _uly);\n _lrx = drawRect.width - legendwidth - _rightPadding;\n int width = _lrx - _ulx;\n _xscale = width / (_xMax - _xMin);\n _xtickscale = width / (_xtickMax - _xtickMin);\n graphics.setColor(_background);\n graphics.fillRect(_ulx, _uly, width, height);\n graphics.setColor(_foreground);\n graphics.drawRect(_ulx, _uly, width, height);\n int tickLength = 5;\n int xCoord1 = _ulx + tickLength;\n int xCoord2 = _lrx - tickLength;\n if (_yticks == null) {\n ind = 0;\n for (double ypos = yStart; ypos <= _ytickMax; ypos += yStep) {\n if (ind >= ny)\n break;\n int yCoord1 = _lry - (int) ((ypos - _ytickMin) * _ytickscale);\n int offset = 0;\n if (ind > 0)\n offset = halflabelheight;\n graphics.drawLine(_ulx, yCoord1, xCoord1, yCoord1);\n graphics.drawLine(_lrx, yCoord1, xCoord2, yCoord1);\n if (_grid && yCoord1 != _uly && yCoord1 != _lry) {\n graphics.setColor(Color.lightGray);\n graphics.drawLine(xCoord1, yCoord1, xCoord2, yCoord1);\n graphics.setColor(_foreground);\n }\n graphics.drawString(ylabels[ind], _ulx - ylabwidth[ind++] - 4, yCoord1 + offset);\n }\n if (_yExp != 0) {\n graphics.drawString(\"String_Node_Str\", 2, titley);\n graphics.setFont(_superscriptfont);\n graphics.drawString(Integer.toString(_yExp), lfm.stringWidth(\"String_Node_Str\") + 2, titley - halflabelheight);\n graphics.setFont(_labelfont);\n }\n } else {\n Enumeration nt = _yticks.elements();\n Enumeration nl = _yticklabels.elements();\n while (nl.hasMoreElements()) {\n String label = (String) nl.nextElement();\n double ypos = ((Double) (nt.nextElement())).doubleValue();\n if (ypos > _yMax || ypos < _yMin)\n continue;\n int yCoord1 = _lry - (int) ((ypos - _yMin) * _ytickscale);\n int offset = 0;\n if (ypos < _lry - labelheight)\n offset = halflabelheight;\n graphics.drawLine(_ulx, yCoord1, xCoord1, yCoord1);\n graphics.drawLine(_lrx, yCoord1, xCoord2, yCoord1);\n if (_grid && yCoord1 != _uly && yCoord1 != _lry) {\n graphics.setColor(Color.lightGray);\n graphics.drawLine(xCoord1, yCoord1, xCoord2, yCoord1);\n graphics.setColor(_foreground);\n }\n graphics.drawString(label, _ulx - lfm.stringWidth(label) - 3, yCoord1 + offset);\n }\n }\n int yCoord1 = _uly + tickLength;\n int yCoord2 = _lry - tickLength;\n if (_xticks == null) {\n int nx = 10;\n double xStep = 0.0;\n int numfracdigits = 0;\n int charwidth = lfm.stringWidth(\"String_Node_Str\");\n int count = 0;\n while (count++ <= 10) {\n xStep = _roundUp((_xtickMax - _xtickMin) / (double) nx);\n numfracdigits = _numFracDigits(xStep);\n int intdigits = _numIntDigits(_xtickMax);\n int inttemp = _numIntDigits(_xtickMin);\n if (intdigits < inttemp) {\n intdigits = inttemp;\n }\n int maxlabelwidth = charwidth * (numfracdigits + 2 + intdigits);\n int savenx = nx;\n nx = 2 + width / (maxlabelwidth + 10);\n if (nx - savenx <= 1 || savenx - nx <= 1)\n break;\n }\n xStep = _roundUp((_xtickMax - _xtickMin) / (double) nx);\n numfracdigits = _numFracDigits(xStep);\n double xStart = xStep * Math.ceil(_xtickMin / xStep);\n for (double xpos = xStart; xpos <= _xtickMax; xpos += xStep) {\n String xticklabel = _formatNum(xpos, numfracdigits);\n xCoord1 = _ulx + (int) ((xpos - _xtickMin) * _xtickscale);\n graphics.drawLine(xCoord1, _uly, xCoord1, yCoord1);\n graphics.drawLine(xCoord1, _lry, xCoord1, yCoord2);\n if (_grid && xCoord1 != _ulx && xCoord1 != _lrx) {\n graphics.setColor(Color.lightGray);\n graphics.drawLine(xCoord1, yCoord1, xCoord1, yCoord2);\n graphics.setColor(_foreground);\n }\n int labxpos = xCoord1 - lfm.stringWidth(xticklabel) / 2;\n graphics.drawString(xticklabel, labxpos, _lry + 3 + labelheight);\n }\n } else {\n Enumeration nt = _xticks.elements();\n Enumeration nl = _xticklabels.elements();\n while (nl.hasMoreElements()) {\n String label = (String) nl.nextElement();\n double xpos = ((Double) (nt.nextElement())).doubleValue();\n if (xpos > _xMax || xpos < _xMin)\n continue;\n xCoord1 = _ulx + (int) ((xpos - _xtickMin) * _xtickscale);\n graphics.drawLine(xCoord1, _uly, xCoord1, yCoord1);\n graphics.drawLine(xCoord1, _lry, xCoord1, yCoord2);\n if (_grid && xCoord1 != _ulx && xCoord1 != _lrx) {\n graphics.setColor(Color.lightGray);\n graphics.drawLine(xCoord1, yCoord1, xCoord1, yCoord2);\n graphics.setColor(_foreground);\n }\n int labxpos = xCoord1 - lfm.stringWidth(label) / 2;\n graphics.drawString(label, labxpos, _lry + 3 + labelheight);\n }\n }\n graphics.setColor(_foreground);\n if (_title != null) {\n graphics.setFont(_titlefont);\n int titlex = _ulx + (width - tfm.stringWidth(_title)) / 2;\n graphics.drawString(_title, titlex, titley);\n }\n graphics.setFont(_labelfont);\n if (_xlabel != null) {\n int labelx = _ulx + (width - lfm.stringWidth(_xlabel)) / 2;\n graphics.drawString(_xlabel, labelx, ySPos);\n }\n int charcenter = 2 + lfm.stringWidth(\"String_Node_Str\") / 2;\n int charheight = labelheight;\n if (_ylabel != null) {\n int yl = _ylabel.length();\n int starty = _uly + (_lry - _uly) / 2 - yl * charheight / 2 + charheight;\n for (int i = 0; i < yl; i++) {\n String nchar = _ylabel.substring(i, i + 1);\n int cwidth = lfm.stringWidth(nchar);\n graphics.drawString(nchar, charcenter - cwidth / 2, starty);\n starty += charheight;\n }\n }\n}\n"
|
"private static Date today() {\n Calendar calendar = Calendar.getInstance(timeZone);\n calendar.set(Calendar.HOUR_OF_DAY, 0);\n calendar.clear(Calendar.MINUTE);\n calendar.clear(Calendar.SECOND);\n calendar.clear(Calendar.MILLISECOND);\n return calendar.getTime();\n}\n"
|
"public void checkReadyStatus() {\n LeanUtils.runJavascriptOnWebView(this.mWebview, \"String_Node_Str\");\n}\n"
|
"public String getMalesRanking() {\n url.append(\"String_Node_Str\");\n String result = YoubuyService.handleGet(YoubuyService.handleArguments(url, vc));\n url = new StringBuffer(url.substring(0, 21));\n return result;\n}\n"
|
"public void updateRepresentationType(String aipId, String representationId, String type) throws RequestNotValidException, NotFoundException, GenericException, AuthorizationDeniedException {\n Representation representation = this.retrieveRepresentation(aipId, representationId);\n representation.setType(type);\n notifyRepresentationUpdated(representation);\n updateAIPMetadata(retrieveAIP(aipId));\n}\n"
|
"public void drawHighlighted(Canvas c, Highlight[] indices) {\n for (int i = 0; i < indices.length; i++) {\n LineDataSet set = mChart.getLineData().getDataSetByIndex(indices[i].getDataSetIndex());\n if (set == null || !set.isHighlightEnabled())\n continue;\n mHighlightPaint.setColor(set.getHighLightColor());\n int xIndex = indices[i].getXIndex();\n if (xIndex > mChart.getXChartMax() * mAnimator.getPhaseX())\n continue;\n final float yVal = set.getYValForXIndex(xIndex);\n if (yVal == Float.NaN)\n continue;\n float y = yValue * mAnimator.getPhaseY();\n float[] pts = new float[] { xIndex, mChart.getYChartMax(), xIndex, mChart.getYChartMin(), mChart.getXChartMin(), y, mChart.getXChartMax(), y };\n mChart.getTransformer(set.getAxisDependency()).pointValuesToPixel(pts);\n c.drawLines(pts, mHighlightPaint);\n }\n}\n"
|
"private static void updateLibrariesAndClasspath(IProcess process) {\n try {\n Set<String> neededLibraries = getNeededLibrariesForProcess(process);\n ILibraryManagerService repositoryBundleService = CorePlugin.getDefault().getRepositoryBundleService();\n File libDir = getJavaProjectLibFolder();\n List<String> jarNamesInLib = new ArrayList<String>();\n File[] jarFiles = libDir.listFiles(FilesUtils.getAcceptJARFilesFilter());\n if (jarFiles != null && jarFiles.length > 0) {\n for (File file : jarFiles) {\n if (file.isFile()) {\n String fileName = file.getName();\n if (!neededLibraries.contains(fileName)) {\n FilesUtils.removeFile(file);\n } else {\n jarNamesInLib.add(file.getName());\n }\n }\n }\n }\n for (String lib : neededLibraries) {\n if (!jarNamesInLib.contains(lib)) {\n repositoryBundleService.retrieve(lib, libDir.getAbsolutePath());\n jarNamesInLib.add(lib);\n }\n }\n boolean modified = false;\n IClasspathEntry jreClasspathEntry = JavaCore.newContainerEntry(new Path(\"String_Node_Str\"));\n IClasspathEntry classpathEntry = JavaCore.newSourceEntry(javaProject.getPath().append(JavaUtils.JAVA_SRC_DIRECTORY));\n IClasspathEntry[] classpathEntryArray = javaProject.getRawClasspath();\n if (!ArrayUtils.contains(classpathEntryArray, jreClasspathEntry)) {\n classpathEntryArray = (IClasspathEntry[]) ArrayUtils.add(classpathEntryArray, jreClasspathEntry);\n modified = true;\n }\n if (!ArrayUtils.contains(classpathEntryArray, classpathEntry)) {\n IClasspathEntry source = null;\n for (IClasspathEntry entry : classpathEntryArray) {\n if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE) {\n source = entry;\n break;\n }\n }\n if (source != null) {\n classpathEntryArray = (IClasspathEntry[]) ArrayUtils.remove(classpathEntryArray, ArrayUtils.indexOf(classpathEntryArray, source));\n }\n classpathEntryArray = (IClasspathEntry[]) ArrayUtils.add(classpathEntryArray, classpathEntry);\n modified = true;\n }\n jarFiles = libDir.listFiles(FilesUtils.getAcceptJARFilesFilter());\n for (File jarFile : jarFiles) {\n IClasspathEntry newEntry = JavaCore.newLibraryEntry(new Path(jarFile.getAbsolutePath()), null, null);\n if (!ArrayUtils.contains(classpathEntryArray, newEntry)) {\n classpathEntryArray = (IClasspathEntry[]) ArrayUtils.add(classpathEntryArray, newEntry);\n modified = true;\n }\n }\n int exchange = 2;\n for (String jar : jarNamesInLib) {\n int index = indexOfEntry(classpathEntryArray, jar);\n if (index < 0) {\n throw new BusinessException(\"String_Node_Str\" + jar);\n }\n if (index >= 0 && index != exchange) {\n IClasspathEntry entry = classpathEntryArray[index];\n IClasspathEntry first = classpathEntryArray[exchange];\n classpathEntryArray[index] = first;\n classpathEntryArray[exchange] = entry;\n }\n exchange++;\n }\n List<IClasspathEntry> classpathEntryList = new ArrayList<IClasspathEntry>(Arrays.asList(classpathEntryArray));\n for (Iterator<IClasspathEntry> iterator = classpathEntryList.iterator(); iterator.hasNext(); ) {\n IClasspathEntry entry = iterator.next();\n if (classpathEntryList.indexOf(entry) > 1) {\n IPath path = entry.getPath();\n if (path != null && !jarNamesInLib.contains(path.lastSegment())) {\n iterator.remove();\n modified = true;\n }\n }\n }\n classpathEntryArray = classpathEntryList.toArray(new IClasspathEntry[classpathEntryList.size()]);\n if (modified) {\n javaProject.setRawClasspath(classpathEntryArray, null);\n }\n javaProject.setOutputLocation(javaProject.getPath().append(JavaUtils.JAVA_CLASSES_DIRECTORY), null);\n } catch (JavaModelException e) {\n ExceptionHandler.process(e);\n } catch (BusinessException e) {\n ExceptionHandler.process(e);\n }\n}\n"
|
"public static int hasPermissionRange(Player player, String stub, int range) {\n if (player == null || player.isOp()) {\n return range;\n }\n if (player.hasPermission(stub + \"String_Node_Str\")) {\n return range;\n }\n for (int i = range; i > 0; i--) {\n if (player.hasPermission(stub + \"String_Node_Str\" + i)) {\n return i;\n }\n }\n return 0;\n}\n"
|
"public void processOK(ClientTransaction clientTransatcion, Response response) {\n int requestedExpiration = 0;\n Request register = clientTransatcion.getRequest();\n ContactHeader contactHeader = (ContactHeader) register.getHeader(ContactHeader.NAME);\n if (contactHeader != null)\n requestedExpiration = contactHeader.getExpires();\n else\n requestedExpiration = 0;\n if (requestedExpiration <= 0) {\n ExpiresHeader expiresHeader = register.getExpires();\n if (expiresHeader != null)\n requestedExpiration = expiresHeader.getExpires();\n }\n int grantedExpiration = registrationsExpiration;\n expiresHeader = response.getExpires();\n if (expiresHeader != null) {\n grantedExpiration = expiresHeader.getExpires();\n } else {\n ContactHeader contactHeader = (ContactHeader) response.getHeader(ContactHeader.NAME);\n if (contactHeader != null) {\n grantedExpiration = contactHeader.getExpires();\n } else {\n grantedExpiration = requestedExpiration;\n }\n }\n if (grantedExpiration <= 0 || requestedExpiration <= 0) {\n setRegistrationState(RegistrationState.UNREGISTERED, RegistrationStateChangeEvent.REASON_USER_REQUEST, \"String_Node_Str\");\n } else {\n int scheduleTime = grantedExpiration;\n String keepAliveMethod = sipProvider.getAccountID().getAccountPropertyString(KEEP_ALIVE_METHOD);\n if ((keepAliveMethod != null && keepAliveMethod.equalsIgnoreCase(\"String_Node_Str\")) || keepAliveMethod == null) {\n int registrationInterval = sipProvider.getAccountID().getAccountPropertyInt(KEEP_ALIVE_INTERVAL, KEEP_ALIVE_INTERVAL_DEFAULT_VALUE);\n if (registrationInterval < grantedExpiration) {\n scheduleTime = registrationInterval;\n }\n }\n scheduleReRegistration(scheduleTime);\n setRegistrationState(RegistrationState.REGISTERED, RegistrationStateChangeEvent.REASON_NOT_SPECIFIED, null);\n }\n}\n"
|
"public void loadInMemoryStorage(final ColumnBinary columnBinary, final IMemoryAllocator allocator) throws IOException {\n ByteBuffer headerWrapBuffer = ByteBuffer.wrap(columnBinary.binary, columnBinary.binaryStart, columnBinary.binaryLength);\n int minCharLength = headerWrapBuffer.getInt();\n headerWrapBuffer.position(headerWrapBuffer.position() + minCharLength);\n int maxCharLength = headerWrapBuffer.getInt();\n headerWrapBuffer.position(headerWrapBuffer.position() + maxCharLength);\n int headerSize = Integer.BYTES + minCharLength + Integer.BYTES + maxCharLength;\n ICompressor compressor = FindCompressor.get(columnBinary.compressorClassName);\n byte[] binary = compressor.decompress(columnBinary.binary, columnBinary.binaryStart + headerSize, columnBinary.binaryLength - headerSize);\n ByteBuffer wrapBuffer = ByteBuffer.wrap(binary, 0, binary.length);\n int minLength = wrapBuffer.getInt();\n int maxLength = wrapBuffer.getInt();\n boolean hasNull = wrapBuffer.getInt() == 1;\n byte[] nullFlagBytes = new byte[columnBinary.rowCount];\n boolean[] isNullArray = new boolean[columnBinary.rowCount];\n if (hasNull) {\n wrapBuffer.get(nullFlagBytes);\n }\n ILengthMaker lengthMaker = chooseLengthMaker(hasNull, minLength, maxLength);\n int[] startArray = lengthMaker.getStartArray(wrapBuffer, columnBinary.rowCount);\n int binaryStart = wrapBuffer.position();\n allocator.setBytesAndLength(binary, binaryStart, binary.length - binaryStart, startArray, isNullArray);\n allocator.setValueCount(columnBinary.rowCount);\n}\n"
|
"private void failContentTypeCreation(final String contentType, final Class<? extends Throwable> expectedExceptionClass) throws Throwable {\n try {\n ContentType mt = ContentType.create(contentType);\n Assert.fail(\"String_Node_Str\" + expectedExceptionClass + \"String_Node_Str\" + contentType + \"String_Node_Str\");\n } catch (Exception e) {\n assertEquals(expectedExceptionClass, e.getClass());\n }\n}\n"
|
"public static void recordSourceMap(List<Map<Range, SourceInfo>> sourceInfoMaps, List<SyntheticArtifact> artifacts, int permutationId) {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n SourceMapGenerator generator = SourceMapGeneratorFactory.getInstance(SourceMapFormat.V3);\n OutputStreamWriter out = new OutputStreamWriter(baos);\n int fragment = 0;\n if (!sourceInfoMaps.isEmpty()) {\n for (Map<Range, SourceInfo> sourceMap : sourceInfoMaps) {\n generator.reset();\n Set<Range> rangeSet = sourceMap.keySet();\n Range[] ranges = rangeSet.toArray(new Range[rangeSet.size()]);\n Arrays.sort(ranges, Range.DEPENDENCY_ORDER_COMPARATOR);\n for (Range r : ranges) {\n SourceInfo si = sourceMap.get(r);\n if (si.getFileName() == null || si.getStartLine() < 0) {\n continue;\n }\n if (r.getStartLine() == 0 || r.getEndLine() == 0) {\n continue;\n }\n generator.addMapping(si.getFileName(), null, new FilePosition(si.getStartLine() - 1, 0), new FilePosition(r.getStartLine(), r.getStartColumn()), new FilePosition(r.getEndLine(), r.getEndColumn()));\n }\n try {\n baos.reset();\n generator.appendTo(out, \"String_Node_Str\" + fragment);\n out.flush();\n artifacts.add(new SymbolMapsLinker.SourceMapArtifact(permutationId, fragment, baos.toByteArray()));\n fragment++;\n } catch (IOException e) {\n throw new InternalCompilerException(e.toString(), e);\n }\n }\n }\n}\n"
|
"private boolean checkProperty(Property property, String[] field) {\n if (property == null) {\n log.debug(\"String_Node_Str\");\n return false;\n }\n if (field.length > 1) {\n if (property.getTarget() == null) {\n log.debug(\"String_Node_Str\", property.getName());\n return null;\n }\n String[] subFields = Arrays.copyOfRange(field, 1, field.length);\n Property subProperty = Mapper.of(property.getTarget()).getProperty(subFields[0]);\n return checkProperty(subProperty, subFields);\n }\n return true;\n}\n"
|
"public long entriesPerSegment() {\n long epg1 = (long) ((entries * INCREASE_ENTRIES_PER_SECTOR) / segments);\n return (Math.max(1, epg1) + 63) & ~63;\n}\n"
|
"public void testIndexerExceptions() throws Exception {\n RepositoryIndexingFactory factory = (RepositoryIndexingFactory) lookup(RepositoryIndexingFactory.ROLE);\n Artifact artifact = createArtifact(\"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\");\n try {\n File notIndexDir = new File(\"String_Node_Str\");\n factory.createArtifactRepositoryIndex(notIndexDir, repository);\n fail(\"String_Node_Str\");\n } catch (RepositoryIndexException e) {\n assertTrue(true);\n }\n try {\n File notIndexDir = new File(\"String_Node_Str\");\n ArtifactRepositoryIndex indexer = factory.createArtifactRepositoryIndex(notIndexDir, repository);\n indexer.indexArtifact(artifact);\n fail(\"String_Node_Str\");\n } catch (RepositoryIndexException e) {\n assertTrue(true);\n }\n artifact = createArtifact(\"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\");\n try {\n File notIndexDir = new File(\"String_Node_Str\");\n ArtifactRepositoryIndex indexer = factory.createArtifactRepositoryIndex(notIndexDir, repository);\n indexer.indexArtifact(artifact);\n fail(\"String_Node_Str\");\n } catch (RepositoryIndexException e) {\n assertTrue(true);\n }\n try {\n File notIndexDir = new File(\"String_Node_Str\");\n ArtifactRepositoryIndex indexer = factory.createArtifactRepositoryIndex(notIndexDir, repository);\n indexer.indexArtifact(artifact);\n fail(\"String_Node_Str\");\n } catch (RepositoryIndexException e) {\n assertTrue(true);\n }\n}\n"
|
"private void hilightBlock(int index) {\n if (index == -1) {\n return;\n }\n Coordinate c = indexToCoordinate.get(index);\n RFTools.instance.hilightBlock(c, mc.theWorld.getTotalWorldTime() + 20 * NetworkMonitorItem.hilightTime);\n mc.getMinecraft().thePlayer.closeScreen();\n}\n"
|
"static String checkEmptyQuery(String myquery) {\n if (myquery == null || myquery.equals(\"String_Node_Str\") || myquery.equals(\"String_Node_Str\")) {\n myquery = \"String_Node_Str\";\n }\n return myquery;\n}\n"
|
"public void drawValues(Canvas c) {\n PointF center = mChart.getCenterCircleBox();\n float r = mChart.getRadius();\n float rotationAngle = mChart.getRotationAngle();\n float[] drawAngles = mChart.getDrawAngles();\n float[] absoluteAngles = mChart.getAbsoluteAngles();\n float off = r / 10f * 3.6f;\n if (mChart.isDrawHoleEnabled()) {\n off = (r - (r / 100f * mChart.getHoleRadius())) / 2f;\n }\n r -= off;\n PieData data = mChart.getData();\n List<PieDataSet> dataSets = data.getDataSets();\n boolean drawXVals = mChart.isDrawSliceTextEnabled();\n int cnt = 0;\n for (int i = 0; i < dataSets.size(); i++) {\n PieDataSet dataSet = dataSets.get(i);\n if (!dataSet.isDrawValuesEnabled() && !drawXVals)\n continue;\n applyValueTextStyle(dataSet);\n List<Entry> entries = dataSet.getYVals();\n for (int j = 0, maxEntry = Math.min((int) Math.ceil(entries.size() * mAnimator.getPhaseX()), entries.size()); j < maxEntry; j++) {\n float offset = drawAngles[cnt] / 2;\n float x = (float) (r * Math.cos(Math.toRadians((rotationAngle + absoluteAngles[cnt] - offset) * mAnimator.getPhaseY())) + center.x);\n float y = (float) (r * Math.sin(Math.toRadians((rotationAngle + absoluteAngles[cnt] - offset) * mAnimator.getPhaseY())) + center.y);\n float value = mChart.isUsePercentValuesEnabled() ? entries.get(j).getVal() / mChart.getYValueSum() * 100f : entries.get(j).getVal();\n String val = dataSet.getValueFormatter().getFormattedValue(value);\n boolean drawYVals = dataSet.isDrawValuesEnabled();\n if (drawXVals && drawYVals) {\n float lineHeight = (mValuePaint.ascent() + mValuePaint.descent()) * 1.6f;\n y -= lineHeight / 2;\n c.drawText(val, x, y, mValuePaint);\n if (j < data.getXValCount())\n c.drawText(data.getXVals().get(j), x, y + lineHeight, mValuePaint);\n } else if (drawXVals && !drawYVals) {\n if (j < data.getXValCount())\n c.drawText(data.getXVals().get(j), x, y, mValuePaint);\n } else if (!drawXVals && drawYVals) {\n c.drawText(val, x, y, mValuePaint);\n }\n cnt++;\n }\n }\n}\n"
|
"public void testGetDbTypeByClassNameAndDriverJar() {\n Assert.assertNull(extractMetaManger.getDbTypeByClassNameAndDriverJar(null, null));\n Assert.assertEquals(extractMetaManger.getDbTypeByClassNameAndDriverJar(\"String_Node_Str\", null), EDatabaseTypeName.MYSQL.getXmlName());\n Assert.assertEquals(extractMetaManger.getDbTypeByClassNameAndDriverJar(\"String_Node_Str\", null), EDatabaseTypeName.REDSHIFT.getXmlName());\n Assert.assertEquals(extractMetaManger.getDbTypeByClassNameAndDriverJar(\"String_Node_Str\", \"String_Node_Str\"), EDatabaseTypeName.PSQL.getXmlName());\n Assert.assertEquals(extractMetaManger.getDbTypeByClassNameAndDriverJar(\"String_Node_Str\", \"String_Node_Str\"), EDatabaseTypeName.ACCESS.getXmlName());\n}\n"
|
"public GameResult checkGameOver(int turnCount, GameRecord record) {\n if (!boardModel_.isAlive_p0()) {\n return new GameResult(s0_, inactivePlayerIndex, turnCount + 1, record);\n } else if (!boardModel_.isAlive_p1()) {\n return new GameResult(s0_, s0_, turnCount + 1, record);\n }\n return null;\n}\n"
|
"public boolean addFilters(FilterDescriptorBase... newFilters) {\n List<FilterDescriptorBase> filtersCopy = filters == null ? new ArrayList<>() : new ArrayList<>(Arrays.asList(filters));\n List<FilterDescriptorBase> newFilterList = Arrays.asList(newFilters);\n boolean result = filtersCopy.addAll(newFilterList);\n this.setFilters(filtersCopy.toArray(new FilterDescriptorBase[filtersCopy.size()]));\n return result;\n}\n"
|
"public boolean ircCommand(String host, String nick, String[] command) {\n if (!j2.ircEnable)\n return false;\n int lvl = 0;\n String adminName = \"String_Node_Str\";\n synchronized (adminsLock) {\n for (ircAdmin admin : admins) {\n if (admin != null && admin.getHostname().equals(host)) {\n lvl = admin.getLevel();\n adminName = admin.getUsername();\n }\n }\n }\n if (command[0].charAt(0) == '.') {\n command[0] = command[0].substring(1);\n }\n if (lvl == 0 || (lvl == 2 && !ircLevel2(command[0]))) {\n return false;\n }\n String commands = j2.combineSplit(0, command, \"String_Node_Str\");\n String com = command[0];\n boolean done = false;\n if (com.equalsIgnoreCase(\"String_Node_Str\") && command.length > 2) {\n j2.kickbans.callKick(command[1], adminName, j2.combineSplit(2, command, \"String_Node_Str\"));\n done = true;\n }\n if (com.equalsIgnoreCase(\"String_Node_Str\") && command.length > 2) {\n j2.kickbans.callBan(adminName, command, new Location(j2.getServer().getWorlds().get(0), 0, 0, 0, 0, 0));\n done = true;\n }\n if (com.equalsIgnoreCase(\"String_Node_Str\") && command.length > 1) {\n j2.chat.gMsg(adminName, j2.combineSplit(1, command, \"String_Node_Str\"));\n done = true;\n }\n if (com.equalsIgnoreCase(\"String_Node_Str\") && command.length > 1) {\n j2.chat.aMsg(adminName, j2.combineSplit(1, command, \"String_Node_Str\"));\n done = true;\n }\n if (com.equalsIgnoreCase(\"String_Node_Str\") && command.length > 2) {\n j2.kickbans.callAddBan(adminName, command, new Location(j2.getServer().getWorlds().get(0), 0, 0, 0, 0, 0));\n done = true;\n }\n if (com.equalsIgnoreCase(\"String_Node_Str\") && command.length > 1) {\n j2.kickbans.unban(adminName, command[1]);\n done = true;\n }\n if (done) {\n j2.log.log(Level.INFO, \"String_Node_Str\" + adminName + \"String_Node_Str\" + nick + \"String_Node_Str\" + host + \"String_Node_Str\" + commands);\n } else {\n j2.log.log(Level.INFO, \"String_Node_Str\" + adminName + \"String_Node_Str\" + nick + \"String_Node_Str\" + host + \"String_Node_Str\" + commands);\n }\n return done;\n}\n"
|
"private int incrementAndGet(long hash) {\n final int count;\n try {\n lock.lock();\n Integer i = playerToPacketCount.get(hash);\n if (i == null) {\n count = 1;\n } else {\n count = i + 1;\n }\n playerToPacketCount.put(hash, count);\n }\n return count;\n}\n"
|
"public void addGesture(String entryName, Gesture gesture) {\n if (entryName == null || entryName.length() == 0) {\n return;\n }\n ArrayList<Gesture> gestures = mNamedGestures.get(entryName);\n if (gestures == null) {\n gestures = new ArrayList<Gesture>();\n mNamedGestures.put(entryName, gestures);\n }\n gestures.add(gesture);\n mClassifier.addInstance(Instance.createInstance(mSequenceType, gesture, entryName));\n mChanged = true;\n}\n"
|
"public void notTest5() {\n System.out.println(\"String_Node_Str\");\n final short[] content = new short[32768 - 5];\n content[0] = 0;\n content[1] = 2;\n content[2] = 4;\n content[3] = 6;\n content[4] = 8;\n for (int i = 10; i <= 32767; ++i) content[i - 10 + 5] = (short) i;\n final MappeableContainer c = makeContainer(content);\n final MappeableContainer c1 = c.not(4, 1000);\n assertTrue(c1 instanceof MappeableBitmapContainer);\n assertEquals(31773, c1.getCardinality());\n final MappeableContainer c2 = c1.not(4, 999);\n assertTrue(c2 instanceof MappeableBitmapContainer);\n assertTrue(checkContent(c2, content));\n}\n"
|
"public void updateView(boolean forceUpdatePoster, GUIMain gui) {\n boolean posterFileUpdateOccured = false;\n boolean fanartFileUpdateOccured = false;\n if (!forceUpdatePoster && gui.getCurrentlySelectedMovieFileList().size() > 0) {\n File potentialOtherPosterJpg = new File(Movie.getFileNameOfPoster(gui.getCurrentlySelectedMovieFileList().get(0), true));\n File potentialOtherFanartJpg = new File(Movie.getFileNameOfFanart(gui.getCurrentlySelectedMovieFileList().get(0), true));\n File standardPosterJpg = new File(Movie.getFileNameOfPoster(gui.getCurrentlySelectedMovieFileList().get(0), false));\n File standardFanartJpg = new File(Movie.getFileNameOfFanart(gui.getCurrentlySelectedMovieFileList().get(0), false));\n if (gui.getCurrentlySelectedPosterFileList().get(0).exists()) {\n try {\n BufferedImage img = ImageIO.read(gui.getCurrentlySelectedPosterFileList().get(0));\n if (img != null) {\n BufferedImage scaledImage = ArtWorkPanel.resizeToPoster(img);\n this.setNewPoster(scaledImage);\n posterFileUpdateOccured = true;\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n if (gui.getCurrentlySelectedPosterFileList().get(0).exists()) {\n try {\n BufferedImage img = ImageIO.read(gui.getCurrentlySelectedFanartFileList().get(0));\n if (img != null) {\n BufferedImage scaledImage = ArtWorkPanel.resizeToFanart(img);\n this.setNewFanart(scaledImage);\n fanartFileUpdateOccured = true;\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n if (gui.getCurrentlySelectedMovieFileList().get(0).isDirectory() && potentialOtherPosterJpg.exists() && !posterFileUpdateOccured) {\n try {\n BufferedImage img = ImageIO.read(potentialOtherPosterJpg);\n if (img != null) {\n BufferedImage scaledImage = ArtWorkPanel.resizeToPoster(img);\n this.setNewPoster(scaledImage);\n posterFileUpdateOccured = true;\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n if (gui.getCurrentlySelectedMovieFileList().get(0).isDirectory() && potentialOtherFanartJpg.exists() && !fanartFileUpdateOccured) {\n try {\n BufferedImage img = ImageIO.read(potentialOtherFanartJpg);\n if (img != null) {\n BufferedImage scaledImage = ArtWorkPanel.resizeToFanart(img);\n this.setNewFanart(scaledImage);\n fanartFileUpdateOccured = true;\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n if (standardPosterJpg.exists() && !posterFileUpdateOccured) {\n try {\n this.setNewPoster(new ImageIcon(standardPosterJpg.getCanonicalPath()));\n posterFileUpdateOccured = true;\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n if (standardFanartJpg.exists() && !fanartFileUpdateOccured) {\n try {\n BufferedImage img = ImageIO.read(standardFanartJpg);\n if (img != null) {\n BufferedImage scaledImage = ArtWorkPanel.resizeToFanart(img);\n this.setNewFanart(scaledImage);\n fanartFileUpdateOccured = true;\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n if (gui.movieToWriteToDiskList.size() > 0 && gui.movieToWriteToDiskList.get(0) != null && gui.movieToWriteToDiskList.get(0).hasPoster() && !posterFileUpdateOccured) {\n try {\n Image posterImage = gui.movieToWriteToDiskList.get(0).getPosters()[0].getThumbImage();\n ImageIcon newPosterIcon = new ImageIcon(posterImage);\n BufferedImage img = (BufferedImage) newPosterIcon.getImage();\n BufferedImage scaledImage = ArtWorkPanel.resizeToPoster(img);\n this.setNewPoster(scaledImage);\n posterFileUpdateOccured = true;\n } catch (IOException e) {\n e.printStackTrace();\n JOptionPane.showMessageDialog(null, ExceptionUtils.getStackTrace(e), \"String_Node_Str\", JOptionPane.ERROR_MESSAGE);\n }\n }\n if (gui.movieToWriteToDiskList.size() > 0 && gui.movieToWriteToDiskList.get(0) != null && gui.movieToWriteToDiskList.get(0).hasFanart() && !fanartFileUpdateOccured) {\n System.out.println(\"String_Node_Str\");\n try {\n Image fanartImage = gui.movieToWriteToDiskList.get(0).getFanart()[0].getThumbImage();\n ImageIcon newFanartIcon = new ImageIcon(fanartImage);\n BufferedImage img = (BufferedImage) newFanartIcon.getImage();\n BufferedImage scaledImage = ArtWorkPanel.resizeToFanart(img);\n this.setNewFanart(scaledImage);\n fanartImage = scaledImage;\n } catch (IOException e) {\n e.printStackTrace();\n JOptionPane.showMessageDialog(null, ExceptionUtils.getStackTrace(e), \"String_Node_Str\", JOptionPane.ERROR_MESSAGE);\n }\n }\n}\n"
|
"public void testCursorModel3() throws OLAPException, BirtException {\n ICubeQueryDefinition cqd = new CubeQueryDefinition(CubeCreator.cubeName);\n cqd.createMeasure(\"String_Node_Str\");\n cqd.createMeasure(\"String_Node_Str\");\n IEdgeDefinition columnEdge = cqd.createEdge(ICubeQueryDefinition.ROW_EDGE);\n IDimensionDefinition timeDim = columnEdge.createDimension(\"String_Node_Str\");\n IHierarchyDefinition timeHier = timeDim.createHierarchy(\"String_Node_Str\");\n timeHier.createLevel(\"String_Node_Str\");\n IBinding rowGrandTotal = new Binding(\"String_Node_Str\");\n rowGrandTotal.setAggrFunction(BuiltInAggregationFactory.TOTAL_SUM_FUNC);\n rowGrandTotal.setExpression(new ScriptExpression(\"String_Node_Str\"));\n rowGrandTotal.addAggregateOn(\"String_Node_Str\");\n IBinding columnGrandTotal = new Binding(\"String_Node_Str\");\n columnGrandTotal.setAggrFunction(BuiltInAggregationFactory.TOTAL_SUM_FUNC);\n columnGrandTotal.setExpression(new ScriptExpression(\"String_Node_Str\"));\n columnGrandTotal.addAggregateOn(\"String_Node_Str\");\n columnGrandTotal.addAggregateOn(\"String_Node_Str\");\n columnGrandTotal.addAggregateOn(\"String_Node_Str\");\n cqd.addBinding(rowGrandTotal);\n cqd.addBinding(columnGrandTotal);\n BirtCubeView cubeView = new BirtCubeView(new CubeQueryExecutor(cqd, this.scope, DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION, scope, null, null)));\n CubeCursor dataCursor = cubeView.getCubeCursor();\n EdgeCursor rowCursor = cubeView.getRowEdgeView().getEdgeCursor();\n DimensionCursor timeCursor = (DimensionCursor) rowCursor.getDimensionCursor().get(0);\n rowCursor.beforeFirst();\n while (rowCursor.next()) {\n print(timeCursor.getObject(\"String_Node_Str\"));\n print(dataCursor.getObject(\"String_Node_Str\"));\n print(dataCursor.getObject(\"String_Node_Str\"));\n }\n System.out.println(\"String_Node_Str\");\n timeCursor.beforeFirst();\n while (timeCursor.next()) {\n print(timeCursor.getString(0));\n print(dataCursor.getObject(0));\n print(dataCursor.getObject(1));\n }\n}\n"
|
"public void initComponents() {\n setLayout(new GridBagLayout());\n GridBagConstraints c = new GridBagConstraints();\n humanPlay = new JButton(\"String_Node_Str\");\n humanPlay.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n if (!clicked) {\n clicked = true;\n setupPopup(false);\n }\n }\n });\n networkPlay = new JButton(\"String_Node_Str\");\n networkPlay.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n final JFrame pop = new JFrame(\"String_Node_Str\");\n pop.setLayout(new FlowLayout());\n pop.setSize(350, 150);\n pop.setResizable(false);\n pop.setLocationRelativeTo(null);\n JPanel options = new JPanel();\n final JLabel label = new JLabel(\"String_Node_Str\");\n final JButton client = new JButton(\"String_Node_Str\");\n client.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n final JFrame popped = new JFrame(\"String_Node_Str\");\n popped.setLayout(new GridBagLayout());\n popped.setSize(370, 150);\n popped.setResizable(false);\n popped.setLocationRelativeTo(null);\n GridBagConstraints c = new GridBagConstraints();\n final JLabel hoster = new JLabel(\"String_Node_Str\");\n final JTextField computer = new JTextField(\"String_Node_Str\", 2);\n final JButton save = new JButton(\"String_Node_Str\");\n save.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n if (computer.getText().equals(\"String_Node_Str\")) {\n JOptionPane.showMessageDialog(null, \"String_Node_Str\");\n return;\n } else if (computer.getText().length() < 2) {\n try {\n int hostNumber = Integer.parseInt(computer.getText());\n if (hostNumber > 25 || hostNumber < 1)\n throw new Exception();\n host = \"String_Node_Str\" + hostNumber;\n } catch (Exception ne) {\n JOptionPane.showMessageDialog(null, \"String_Node_Str\");\n return;\n }\n } else {\n try {\n int hostNumber = Integer.parseInt(computer.getText());\n if (hostNumber > 25 || hostNumber < 1)\n throw new Exception();\n host = \"String_Node_Str\" + hostNumber;\n } catch (Exception ne) {\n JOptionPane.showMessageDialog(null, \"String_Node_Str\");\n return;\n }\n }\n NewGameMenu.cancelled = false;\n Thread client;\n try {\n client = new Thread(new Runnable() {\n public void run() {\n try {\n new NetworkClient().join(host);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n });\n client.start();\n Driver.getInstance().setPanel(new NetLoading(client));\n } catch (Exception e1) {\n e1.printStackTrace();\n }\n popped.dispose();\n pop.dispose();\n }\n });\n final JButton back = new JButton(\"String_Node_Str\");\n back.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n popped.dispose();\n }\n });\n JPanel everything = new JPanel();\n everything.setLayout(new GridBagLayout());\n c.gridx = 0;\n c.gridy = 0;\n c.gridwidth = 2;\n c.insets = new Insets(3, 3, 3, 3);\n popped.add(hoster, c);\n c.gridx = 0;\n c.gridy = 1;\n c.gridwidth = 1;\n everything.add(new JLabel(\"String_Node_Str\"), c);\n c.gridx = 1;\n c.gridy = 1;\n c.gridwidth = 1;\n everything.add(computer, c);\n c.gridx = 0;\n c.gridy = 2;\n c.gridwidth = 1;\n everything.add(back, c);\n c.gridx = 1;\n c.gridy = 2;\n c.gridwidth = 1;\n everything.add(save, c);\n c.gridx = 0;\n c.gridy = 1;\n c.gridwidth = 2;\n popped.add(everything, c);\n popped.setVisible(true);\n }\n });\n final JButton host = new JButton(\"String_Node_Str\");\n host.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n setupPopup(true);\n pop.dispose();\n }\n });\n options.add(label);\n pop.add(options);\n pop.add(host);\n pop.add(client);\n pop.setVisible(true);\n }\n });\n AIPlay = new JButton(\"String_Node_Str\");\n AIPlay.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n final JFrame popped = new JFrame(\"String_Node_Str\");\n popped.setLayout(new GridBagLayout());\n popped.setSize(225, 150);\n popped.setResizable(false);\n popped.setLocationRelativeTo(null);\n GridBagConstraints c = new GridBagConstraints();\n final JComboBox dropdown = new JComboBox(Builder.getArray());\n c.gridx = 0;\n c.gridy = 0;\n popped.add(new JLabel(\"String_Node_Str\"), c);\n c.gridx = 1;\n c.gridy = 0;\n c.insets = new Insets(3, 0, 3, 0);\n popped.add(dropdown, c);\n c.gridx = 0;\n c.gridy = 1;\n popped.add(new JLabel(\"String_Node_Str\"), c);\n String[] allFiles = FileUtility.getAIFileList();\n List<String> tempFiles = new ArrayList<String>();\n for (String st : allFiles) if (st.endsWith(\"String_Node_Str\"))\n tempFiles.add(st);\n String[] files = new String[tempFiles.size()];\n tempFiles.toArray(files);\n if (files.length == 0) {\n JOptionPane.showMessageDialog(null, \"String_Node_Str\", \"String_Node_Str\", JOptionPane.ERROR_MESSAGE);\n return;\n }\n final JComboBox ai = new JComboBox(files);\n c.gridx = 1;\n c.gridy = 1;\n c.fill = GridBagConstraints.HORIZONTAL;\n popped.add(ai, c);\n JButton next = new JButton(\"String_Node_Str\");\n next.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n final String choice = (String) ai.getSelectedItem();\n File file = FileUtility.getAIFile(choice);\n if (ai.getSelectedItem() == null) {\n JOptionPane.showMessageDialog(null, \"String_Node_Str\", \"String_Node_Str\", JOptionPane.ERROR_MESSAGE);\n return;\n }\n Game toPlay = Builder.newGame((String) dropdown.getSelectedItem());\n JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\n StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, Locale.getDefault(), null);\n String[] compileOptions = new String[] { \"String_Node_Str\", \"String_Node_Str\" };\n Iterable<String> compilationOptions = Arrays.asList(compileOptions);\n List<File> sourceFileList = new ArrayList<File>();\n sourceFileList.add(file);\n Iterable<? extends JavaFileObject> compilationUnits = fileManager.getJavaFileObjectsFromFiles(sourceFileList);\n CompilationTask task = compiler.getTask(null, fileManager, null, compilationOptions, null, compilationUnits);\n boolean result = task.call();\n if (!result) {\n JOptionPane.showMessageDialog(null, \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\");\n return;\n }\n try {\n fileManager.close();\n } catch (IOException e) {\n }\n final AIPlugin plugin;\n final AIAdapter ai = new AIAdapter(toPlay);\n try {\n ClassLoader c = ClassLoader.getSystemClassLoader();\n Class<?> klazz = c.loadClass(choice.substring(0, choice.indexOf(\"String_Node_Str\")));\n Constructor<?> construct = klazz.getConstructor();\n plugin = (AIPlugin) construct.newInstance();\n Thread aiThread;\n aiThread = new Thread(new Runnable() {\n public void run() {\n try {\n ai.runGame(plugin);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n });\n aiThread.start();\n } catch (Exception e1) {\n e1.printStackTrace();\n }\n try {\n PlayNetGame png = new PlayNetGame(toPlay, false, false);\n png.setAIGame(true);\n Driver.getInstance().setPanel(png);\n } catch (Exception e) {\n return;\n }\n popped.dispose();\n }\n });\n JButton back = new JButton(\"String_Node_Str\");\n back.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n popped.dispose();\n }\n });\n JPanel buttons = new JPanel();\n buttons.setLayout(new FlowLayout());\n buttons.add(back);\n buttons.add(next);\n c.gridx = 0;\n c.gridy = 2;\n c.gridwidth = 2;\n popped.add(buttons, c);\n popped.setVisible(true);\n }\n });\n backButton = new JButton(\"String_Node_Str\");\n backButton.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n Driver.getInstance().revertPanel();\n }\n });\n try {\n if (InetAddress.getLocalHost().getHostName().contains(\"String_Node_Str\")) {\n c.gridx = 0;\n c.gridy = 0;\n c.ipadx = 0;\n c.insets = new Insets(5, 50, 5, 50);\n c.anchor = GridBagConstraints.CENTER;\n add(new JLabel(\"String_Node_Str\"), c);\n c.gridy = 1;\n c.gridwidth = 2;\n c.insets = new Insets(0, 5, 20, 5);\n c.fill = GridBagConstraints.HORIZONTAL;\n add(AIPlay, c);\n c.gridx = 0;\n c.gridy = 2;\n add(backButton, c);\n } else {\n c.gridx = 0;\n c.gridy = 0;\n c.fill = GridBagConstraints.HORIZONTAL;\n c.insets = new Insets(5, 5, 0, 5);\n add(humanPlay, c);\n c.gridx = 0;\n c.gridy = 1;\n c.insets = new Insets(0, 5, 20, 5);\n c.fill = GridBagConstraints.HORIZONTAL;\n add(AIPlay, c);\n c.gridx = 0;\n c.gridy = 2;\n add(backButton, c);\n }\n } catch (Exception e) {\n }\n}\n"
|
"private void processCategoryChildren(AtlasGlossaryCategory newObj, AtlasGlossaryCategory existing, RelationshipOperation op) throws AtlasBaseException {\n Set<AtlasRelatedCategoryHeader> newChildren = newObj.getChildrenCategories();\n Set<AtlasRelatedCategoryHeader> existingChildren = existing.getChildrenCategories();\n switch(op) {\n case CREATE:\n if (DEBUG_ENABLED) {\n LOG.debug(\"String_Node_Str\", existing.getDisplayName(), Objects.nonNull(newChildren) ? newChildren.size() : \"String_Node_Str\");\n }\n createCategoryRelationships(existing, newChildren.values());\n break;\n case UPDATE:\n if (CollectionUtils.isEmpty(existingChildren)) {\n if (DEBUG_ENABLED) {\n LOG.debug(\"String_Node_Str\", existing.getDisplayName(), Objects.nonNull(newChildren) ? newChildren.size() : \"String_Node_Str\");\n }\n createCategoryRelationships(existing, newChildren);\n break;\n }\n if (CollectionUtils.isEmpty(newChildren)) {\n if (DEBUG_ENABLED) {\n LOG.debug(\"String_Node_Str\", existing.getDisplayName(), existingChildren.size());\n }\n deleteCategoryRelationships(existing, existingChildren);\n break;\n }\n Set<AtlasRelatedCategoryHeader> toCreate = newChildren.stream().filter(c -> Objects.isNull(c.getRelationGuid())).collect(Collectors.toSet());\n createCategoryRelationships(existing, toCreate);\n Set<AtlasRelatedCategoryHeader> toUpdate = newChildren.stream().filter(c -> Objects.nonNull(c.getRelationGuid()) && existingChildren.contains(c)).collect(Collectors.toSet());\n updateCategoryRelationships(existing, toUpdate);\n Set<AtlasRelatedCategoryHeader> toDelete = existingChildren.stream().filter(c -> !toCreate.contains(c) && !toUpdate.contains(c)).collect(Collectors.toSet());\n deleteCategoryRelationships(existing, toDelete);\n break;\n case DELETE:\n deleteCategoryRelationships(existing, existingChildren);\n break;\n }\n}\n"
|
"public ImmutableMap<String, String> getReverseClasses() {\n return this.reverseClasses.build();\n}\n"
|
"protected void adjustLength(int adjustment) {\n if (length != UNKNOWN_LENGTH)\n length += adjustment;\n if (parent != null)\n parent.adjustLength(newArraySize, adjustment);\n}\n"
|
"static void train(Config config) throws Exception {\n String archive = config.getString(\"String_Node_Str\");\n int numIterations = config.getInt(\"String_Node_Str\");\n int numLeaves = config.getInt(\"String_Node_Str\");\n double learningRate = config.getDouble(\"String_Node_Str\");\n int minDataPerLeaf = config.getInt(\"String_Node_Str\");\n String modelName = config.getString(\"String_Node_Str\");\n double featureSamplingRate = config.getDouble(\"String_Node_Str\");\n double dataSamplingRate = config.getDouble(\"String_Node_Str\");\n StopWatch stopWatch = new StopWatch();\n stopWatch.start();\n MultiLabelClfDataSet dataSet = loadTrainData(config);\n MultiLabelClfDataSet testDataSet = loadTestData(config);\n Set<String> featuresToUseOption = Arrays.stream(config.getString(\"String_Node_Str\").split(\"String_Node_Str\")).map(string -> string.trim()).collect(Collectors.toSet());\n FeatureMappers featureMappers = dataSet.getSetting().getFeatureMappers();\n Set<Integer> initialFeatures = new HashSet<>();\n for (CategoricalFeatureMapper mapper : featureMappers.getCategoricalFeatureMappers()) {\n if (mapper.getSource().equalsIgnoreCase(\"String_Node_Str\")) {\n for (int j = mapper.getStart(); j <= mapper.getEnd(); j++) {\n initialFeatures.add(j);\n }\n }\n }\n for (NumericalFeatureMapper mapper : featureMappers.getNumericalFeatureMappers()) {\n if (mapper.getSource().equalsIgnoreCase(\"String_Node_Str\")) {\n initialFeatures.add(mapper.getFeatureIndex());\n }\n }\n Set<Integer> unigramFeatures = new HashSet<>();\n for (NumericalFeatureMapper mapper : featureMappers.getNumericalFeatureMappers()) {\n if (mapper.getSource().equalsIgnoreCase(\"String_Node_Str\") && mapper.getFeatureName().split(\"String_Node_Str\").length == 1) {\n unigramFeatures.add(mapper.getFeatureIndex());\n }\n }\n Set<Integer> ngramFeatures = new HashSet<>();\n for (NumericalFeatureMapper mapper : featureMappers.getNumericalFeatureMappers()) {\n if (mapper.getSource().equalsIgnoreCase(\"String_Node_Str\") && mapper.getFeatureName().split(\"String_Node_Str\").length > 1) {\n ngramFeatures.add(mapper.getFeatureIndex());\n }\n }\n if (initialFeatures.size() + unigramFeatures.size() + ngramFeatures.size() != dataSet.getNumFeatures()) {\n throw new RuntimeException(\"String_Node_Str\");\n }\n Set<Integer> featuresToUse = new HashSet<>();\n if (featuresToUseOption.contains(\"String_Node_Str\")) {\n featuresToUse.addAll(initialFeatures);\n }\n if (featuresToUseOption.contains(\"String_Node_Str\")) {\n featuresToUse.addAll(unigramFeatures);\n }\n if (featuresToUseOption.contains(\"String_Node_Str\")) {\n featuresToUse.addAll(ngramFeatures);\n }\n int[] activeFeatures = featuresToUse.stream().mapToInt(i -> i).toArray();\n int numClasses = dataSet.getNumClasses();\n System.out.println(\"String_Node_Str\" + numClasses);\n IMLGBConfig imlgbConfig = new IMLGBConfig.Builder(dataSet).dataSamplingRate(dataSamplingRate).featureSamplingRate(featureSamplingRate).learningRate(learningRate).minDataPerLeaf(minDataPerLeaf).numLeaves(numLeaves).numSplitIntervals(config.getInt(\"String_Node_Str\")).build();\n IMLGradientBoosting boosting = new IMLGradientBoosting(numClasses);\n List<MultiLabel> assignments = DataSetUtil.gatherLabels(dataSet);\n boosting.setAssignments(assignments);\n boosting.setPriorProbs(dataSet);\n boosting.setTrainConfig(imlgbConfig);\n boosting.setActiveFeatures(activeFeatures);\n for (int i = 0; i < numIterations; i++) {\n System.out.println(\"String_Node_Str\" + i);\n boosting.boostOneRound();\n if (config.getBoolean(\"String_Node_Str\")) {\n System.out.println(\"String_Node_Str\" + Accuracy.accuracy(boosting, dataSet));\n System.out.println(\"String_Node_Str\" + Overlap.overlap(boosting, dataSet));\n System.out.println(\"String_Node_Str\" + Accuracy.accuracy(boosting, testDataSet));\n System.out.println(\"String_Node_Str\" + Overlap.overlap(boosting, testDataSet));\n }\n }\n File serializedModel = new File(archive, modelName);\n boosting.serialize(serializedModel);\n System.out.println(stopWatch);\n}\n"
|
"private Pair<Integer, JSONObject> handleHTTPResponse(HttpURLConnection connection, Boolean skipError) throws OCSyncException {\n BufferedReader reader;\n String response;\n try {\n BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));\n StringBuilder stringBuilder = new StringBuilder();\n String line;\n while ((line = reader.readLine()) != null) {\n stringBuilder.append(line).append(\"String_Node_Str\");\n }\n response = stringBuilder.toString();\n int status = connection.getResponseCode();\n switch(status) {\n case 200:\n {\n try {\n JSONObject jsonResponse = new JSONObject(response);\n return new Pair<>(status, jsonResponse);\n } catch (JSONException e) {\n if (!skipError) {\n if (response.contains(\"String_Node_Str\") && response.contains(\"String_Node_Str\")) {\n Log.e(OCHttpClient.TAG, \"String_Node_Str\");\n throw new OCSyncException(R.string.err_sync_ocsms_not_installed_or_oc_upgrade_required, OCSyncErrorType.SERVER_ERROR);\n } else {\n Log.e(OCHttpClient.TAG, \"String_Node_Str\", e);\n throw new OCSyncException(R.string.err_sync_http_request_parse_resp, OCSyncErrorType.PARSE);\n }\n }\n }\n break;\n }\n case 403:\n {\n throw new OCSyncException(R.string.err_sync_auth_failed, OCSyncErrorType.AUTH);\n }\n default:\n {\n Log.e(OCHttpClient.TAG, \"String_Node_Str\" + status);\n Log.e(OCHttpClient.TAG, \"String_Node_Str\" + status + \"String_Node_Str\" + response);\n throw new OCSyncException(R.string.err_sync_http_request_returncode_unhandled, OCSyncErrorType.SERVER_ERROR);\n }\n }\n } catch (IOException e) {\n throw new OCSyncException(R.string.err_sync_http_request_ioexception, OCSyncErrorType.IO);\n }\n return new Pair<>(0, null);\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.