content
stringlengths 40
137k
|
---|
"public void prestartAllCoreThreads() {\n synchronized (workersLock) {\n boolean startedThreads = false;\n while (currentPoolSize < corePoolSize) {\n availableWorkers.addFirst(makeNewWorker());\n startedThreads = true;\n }\n if (startedThreads) {\n workersLock.notifyAll();\n }\n }\n}\n"
|
"private String readString(InputStream is) throws IOException {\n int len = is.read();\n if (len == -1) {\n throw new EOFException();\n }\n byte[] buf = new byte[len];\n is.read(buf);\n return new String(buf, \"String_Node_Str\");\n}\n"
|
"public int getFuelProgressScaled(int i) {\n if (inventory[0] == null || !FuelMapper.isStackFuel(inventory[0])) {\n return 0;\n }\n int reqEmc = 0;\n if (inventory[lockSlot] != null) {\n reqEmc = EMCHelper.getEmcValue(inventory[lockSlot]) - EMCHelper.getEmcValue(inventory[0]);\n if (reqEmc < 0) {\n return 0;\n }\n } else {\n if (FuelMapper.getFuelUpgrade(inventory[0]) == null) {\n this.setInventorySlotContents(0, null);\n return 0;\n } else {\n reqEmc = EMCHelper.getEmcValue(FuelMapper.getFuelUpgrade(inventory[0])) - EMCHelper.getEmcValue(inventory[0]);\n }\n }\n if (this.getStoredEmc() >= reqEmc) {\n return i;\n }\n return displayEmc * i / reqEmc;\n}\n"
|
"public void pruneAsDuplicatePosition() {\n setPruned(false, Node.PRUNE_DUPLICATE_POSITION);\n}\n"
|
"public void test_FilteWithTopN() throws Exception {\n String testSQL = \"String_Node_Str\" + getTestTableName();\n ((OdaDataSetDesign) this.dataSet).setQueryText(testSQL);\n ScriptExpression[] expressions = new ScriptExpression[2];\n expressions[0] = new ScriptExpression(\"String_Node_Str\");\n expressions[1] = new ScriptExpression(\"String_Node_Str\");\n FilterDefinition filterDef = new FilterDefinition(new ConditionalExpression(\"String_Node_Str\", IConditionalExpression.OP_TOP_N, \"String_Node_Str\"));\n QueryDefinition queryDefn = newReportQuery();\n queryDefn.addFilter(filterDef);\n queryDefn.addExpression(expressions[0], BaseTransform.ON_EACH_ROW);\n queryDefn.addExpression(expressions[1], BaseTransform.AFTER_LAST_ROW);\n IPreparedQuery preparedQuery = dataEngine.prepare(queryDefn);\n IQueryResults queryResults = preparedQuery.execute(null);\n IResultIterator resultIt = queryResults.getResultIterator();\n outputQueryResult(resultIt, expressions);\n checkOutputFile();\n}\n"
|
"public long timestamp(int year, int month, int day) {\n GregorianCalendar cal = DateUtils.getStartOfTodayCalendar();\n cal.set(year, month, day, hourOfDay, minute, second);\n return cal.getTimeInMillis();\n}\n"
|
"public void reconcileBeanConfig(AnnotatedMethodStore ams) {\n if (jcp == null) {\n jcp = new JSR362ConfigurationProcessor(pad);\n }\n jcp.reconcileBeanConfig(methodStore);\n}\n"
|
"public void shouldMatchExpectedToStringOutput_WhenActualRequestHasNullHeaderValue() throws Exception {\n final StubRequest actualRequest = BUILDER.withUrl(\"String_Node_Str\").withMethodGet().withMethodPost().withMethodPut().withPost(null).withQuery(\"String_Node_Str\", \"String_Node_Str\").withQuery(\"String_Node_Str\", \"String_Node_Str\").withHeaders(\"String_Node_Str\", \"String_Node_Str\").withHeaders(\"String_Node_Str\", \"String_Node_Str\").withHeaders(\"String_Node_Str\", null).build();\n final String expectedToStringOutput = \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\";\n assertThat(actualRequest.toString()).isEqualTo(expectedToStringOutput);\n}\n"
|
"public void onResponse(JSONObject response) {\n logger.d(response.toString());\n try {\n String sessionToken = response.getString(SESSION_ID_KEY);\n Boolean isAuthenticated = Boolean.parseBoolean(response.getString(AUTHENTICATION_KEY));\n if (isAuthenticated) {\n if (isDBCleaningRequired(username, serverURL)) {\n mOpenMRS.deleteDatabase(OpenMRSSQLiteOpenHelper.DATABASE_NAME);\n OpenMRS.clearODKDirs();\n }\n mOpenMRS.setServerUrl(serverURL);\n mOpenMRS.setSessionToken(sessionToken);\n mOpenMRS.setUsername(username);\n (new VisitsManager(mContext)).getVisitType();\n new UserManager(mContext).getUserInformation(username);\n new FormsManger(mContext).getAvailableFormsList();\n ((LoginActivity) mContext).saveLocationsToDatabase();\n ((LoginActivity) mContext).finish();\n } else {\n mContext.sendBroadcast(new Intent(ApplicationConstants.CustomIntentActions.ACTION_AUTH_FAILED_BROADCAST));\n }\n } catch (JSONException e) {\n logger.d(e.toString());\n }\n}\n"
|
"public void testGetTableNamesFromQuery() throws SQLException {\n assertTrue(ExtractMetaDataFromDataBase.tableCommentsMap instanceof HashMap<?, ?>);\n assertTrue(ExtractMetaDataFromDataBase.tableCommentsMap.isEmpty());\n ResultSet mockResultSet = mock(ResultSet.class);\n when(mockResultSet.getString(1)).thenReturn(\"String_Node_Str\");\n String nameKey = mockResultSet.getString(1).trim();\n String tableComment = ExtractMetaDataFromDataBase.getTableComment(nameKey, mockResultSet, false, ExtractMetaDataUtils.conn);\n assertNotNull(tableComment);\n ExtractMetaDataFromDataBase.tableCommentsMap.put(nameKey, tableComment);\n assertNotNull(ExtractMetaDataFromDataBase.tableCommentsMap);\n assertNotNull(ExtractMetaDataFromDataBase.getTableNamesFromQuery(mockResultSet));\n}\n"
|
"public void writeStatement(MethodWriter writer) {\n this.variable.writeSet(writer, null, this.variable.value);\n}\n"
|
"protected boolean namespaceEquals(BaseID o) {\n if (!(o instanceof XMPPRoomID)) {\n return false;\n }\n XMPPRoomID other = (XMPPRoomID) o;\n return fieldEquals(other);\n}\n"
|
"public void setFontSize(int fontSize) {\n int normalTextSize;\n int smallTextSize;\n switch(fontSize) {\n case FONT_SIZE_SMALL:\n normalTextSize = (int) (getGridSize() * 0.3);\n smallTextSize = (int) (getGridSize() * 0.2);\n break;\n case FONT_SIZE_MEDIUM:\n normalTextSize = (int) (getGridSize() / 2.1);\n smallTextSize = (int) (normalTextSize * 0.5);\n break;\n case FONT_SIZE_LARGE:\n normalTextSize = (int) (getGridSize() / 1.8);\n smallTextSize = (int) (normalTextSize * 0.3);\n break;\n default:\n Log.e(LOGTAG, \"String_Node_Str\" + fontSize);\n return;\n }\n this.fontSize = fontSize;\n this.textPaint.setTextSize(normalTextSize);\n this.textSmallPaint.setTextSize(smallTextSize);\n}\n"
|
"private void extractTextureContainer(int i, int total, WadFile wad, String destination) {\n for (final String entry : wad.getWadFileEntries()) {\n updateStatus(i, total, ConvertProcess.TEXTURES);\n i++;\n if (entry.endsWith(\"String_Node_Str\")) {\n LoadingScreenFile lsf = new LoadingScreenFile(wad.getFileData(entry));\n try {\n File destFile = new File(destination + entry);\n String destFilename = destFile.getCanonicalPath();\n destFile.getParentFile().mkdirs();\n ImageIO.write(lsf.getImage(), \"String_Node_Str\", new File(destFilename.substring(0, destFilename.length() - 3).concat(\"String_Node_Str\")));\n } catch (IOException ex) {\n throw new RuntimeException(\"String_Node_Str\" + entry + \"String_Node_Str\", ex);\n }\n } else {\n wad.extractFileData(entry, destination);\n }\n }\n}\n"
|
"public boolean startsWith(RandomDataInput input) {\n long inputRemaining = input.remaining();\n if ((limitAddr - positionAddr) < inputRemaining)\n return false;\n long pos = position(), inputPos = input.position();\n UNSAFE.getLong(startAddr + pos);\n int i = 0;\n for (; i < inputRemaining - 7; i += 8) {\n if (UNSAFE.getLong(startAddr + pos + i) != input.readLong(inputPos + i))\n return false;\n }\n for (; i < inputRemaining; i++) {\n if (UNSAFE.getByte(startAddr + pos + i) != input.readByte(inputPos + i))\n return false;\n }\n return true;\n}\n"
|
"public String getClassName(String obf) {\n String r = classes.get(obf);\n if (r != null)\n return r;\n if (!obf.contains(\"String_Node_Str\") || obf.startsWith(\"String_Node_Str\"))\n return \"String_Node_Str\" + obf;\n return obf;\n}\n"
|
"private void goToEnemy(IAttackable enemy) {\n if (inSaveGotoMode) {\n goToSavely(enemy);\n } else {\n ShortPoint2D pos = super.getPos();\n EDirection dir = EDirection.getApproxDirection(pos, enemy.getPos());\n if (super.goInDirection(dir, false)) {\n return;\n } else {\n goToSavely(enemy);\n inSaveGotoMode = true;\n }\n }\n}\n"
|
"public void onInventoryChanged() {\n PacketDispatcher.sendPacketToAllAround(this.xCoord, this.yCoord, this.zCoord, 128D, this.worldObj.provider.dimensionId, getDescriptionPacket());\n worldObj.updateAllLightTypes(xCoord, yCoord, zCoord);\n if (hasGlassBell) {\n worldObj.updateAllLightTypes(xCoord, yCoord + 1, zCoord);\n }\n}\n"
|
"public static void gdp_datum_print(PointerByReference datum) {\n Pointer d = null;\n NativeSizeT length = new NativeSizeT();\n length.setValue(-1);\n if (datum == null) {\n System.out.print(\"String_Node_Str\");\n }\n System.out.print(\"String_Node_Str\" + Gdp10Library.INSTANCE.gdp_datum_getrecno(datum) + \"String_Node_Str\");\n PointerByReference dbuf = Gdp10Library.INSTANCE.gdp_datum_getbuf(datum);\n if (dbuf == null) {\n System.out.print(\"String_Node_Str\");\n } else {\n length = Gdp10Library.INSTANCE.gdp_buf_getlength(dbuf);\n System.out.print(\"String_Node_Str\" + length);\n d = Gdp10Library.INSTANCE.gdp_buf_getptr(dbuf, new NativeSizeT(length.longValue()));\n }\n EP_TIME_SPEC ts = new EP_TIME_SPEC();\n Gdp10Library.INSTANCE.gdp_datum_getts(datum, ts);\n if (ts.tv_sec != Long.MIN_VALUE) {\n Date myDate = new Date(ts.tv_sec * 1000);\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"String_Node_Str\" + ts.tv_nsec + \"String_Node_Str\");\n dateFormat.setTimeZone(TimeZone.getTimeZone(\"String_Node_Str\"));\n System.out.println(\"String_Node_Str\" + dateFormat.format(myDate));\n } else {\n System.out.print(\"String_Node_Str\");\n }\n if (length.longValue() > 0) {\n System.out.print(\"String_Node_Str\" + d.getString(0) + \"String_Node_Str\");\n }\n System.out.println(\"String_Node_Str\");\n}\n"
|
"public boolean quitRope() {\n if (editFrame.sourcePath != null && editFrame.sourceChanged) {\n int result = JOptionPane.showConfirmDialog(null, \"String_Node_Str\", \"String_Node_Str\", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);\n if (result == JOptionPane.CANCEL_OPTION) {\n return false;\n } else if (result == JOptionPane.YES_OPTION) {\n editFrame.saveAction();\n }\n }\n if (askConfirmationToQuit) {\n int result = JOptionPane.showConfirmDialog(null, \"String_Node_Str\", \"String_Node_Str\", JOptionPane.QUESTION_MESSAGE, JOptionPane.YES_NO_OPTION);\n if (result == JOptionPane.NO_OPTION) {\n return false;\n }\n }\n savePreferences();\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n closed = true;\n return closed;\n}\n"
|
"private boolean hasArgumentMark(String string, char mark) {\n int quoteIndex = -1;\n int lastEndQuoteIndex = -1;\n do {\n int markIndex = string.indexOf(mark, lastEndQuoteIndex + 1);\n if (markIndex == -1) {\n return false;\n }\n quoteIndex = string.lastIndexOf(quote, markIndex);\n if (quoteIndex == -1) {\n return true;\n } else {\n boolean hasPairedQuoteBeforeMark = false;\n while (quoteIndex != -1 && quoteIndex >= lastEndQuoteIndex) {\n if ((quoteIndex = string.lastIndexOf('\\'', quoteIndex - 1)) != -1) {\n hasPairedQuoteBeforeMark = !hasPairedQuoteBeforeMark;\n }\n }\n if (hasPairedQuoteBeforeMark) {\n return true;\n } else {\n lastEndQuoteIndex = string.indexOf('\\'', markIndex + 1);\n if (lastEndQuoteIndex == -1) {\n return true;\n }\n }\n }\n } while (true);\n}\n"
|
"private void estimateMax() {\n initializeTopDown(lattice.getTop());\n setMaximum(lattice.getTop());\n this.globalMaximum = lattice.getTop().getMaximumInformationLoss();\n ARXNode[][] levels = lattice.getLevels();\n for (int i = levels.length - 2; i >= 0; i--) {\n final ARXNode[] level = levels[i];\n for (final ARXNode node : level) {\n pullTopDown(node);\n setMaximum(node);\n this.globalMaximum = max(this.globalMaximum, node.getMaximumInformationLoss());\n }\n }\n}\n"
|
"private Html renderCartPage(final Cart cart, final UserContext userContext) {\n final CartDetailPageContent content = new CartDetailPageContent(cart, userContext, productDataConfig, i18nResolver(), reverseRouter());\n final SunrisePageData pageData = pageData(userContext, content, ctx(), session());\n return templateService().renderToHtml(\"String_Node_Str\", pageData, userContext.locales());\n}\n"
|
"public void testSettingsNoPassword() throws Exception {\n ReflectionTestUtils.setField(sut, \"String_Node_Str\", SERVER_ID);\n final Server server = mockServer();\n server.setPassword(null);\n when(settings.getServer(SERVER_ID)).thenReturn(server);\n Throwable cause = null;\n try {\n sut.execute();\n } catch (MojoExecutionException exception) {\n cause = exception.getCause();\n }\n assertThat(cause).isNotNull().isExactlyInstanceOf(MojoExecutionException.class).hasMessageStartingWith(AUTHORIZATION_EXCEPTION);\n}\n"
|
"public DetailledItem getResult(int position) throws IOException {\n String html = httpGet(opac_url + \"String_Node_Str\" + db + \"String_Node_Str\" + searchSet + \"String_Node_Str\" + (position + 1), getDefaultEncoding(), false, cookieStore);\n return parse_result(html);\n}\n"
|
"protected void configure() {\n setName(NAME);\n setDescription(DESCRIPTION);\n Map<String, String> properties = new HashMap<>();\n properties.put(Constants.PIPELINE_SPEC_KEY, GSON.toJson(spec));\n setProperties(properties);\n stageSpecs = new HashMap<>();\n useSpark = engine == Engine.SPARK;\n for (StageSpec stageSpec : spec.getStages()) {\n stageSpecs.put(stageSpec.getName(), stageSpec);\n String pluginType = stageSpec.getPlugin().getType();\n if (SparkCompute.PLUGIN_TYPE.equals(pluginType) || SparkSink.PLUGIN_TYPE.equals(pluginType)) {\n useSpark = true;\n }\n }\n PipelinePlanner planner;\n Set<String> actionTypes = ImmutableSet.of(Action.PLUGIN_TYPE, Constants.SPARK_PROGRAM_PLUGIN_TYPE);\n if (useSpark) {\n planner = new PipelinePlanner(supportedPluginTypes, ImmutableSet.<String>of(), ImmutableSet.<String>of(), actionTypes);\n } else {\n planner = new PipelinePlanner(supportedPluginTypes, ImmutableSet.of(BatchAggregator.PLUGIN_TYPE, BatchJoiner.PLUGIN_TYPE), ImmutableSet.of(SparkCompute.PLUGIN_TYPE, SparkSink.PLUGIN_TYPE), actionTypes);\n }\n plan = planner.plan(spec);\n if (plan.getPhases().size() == 1) {\n addProgram(plan.getPhases().keySet().iterator().next(), new TrunkProgramAdder(getConfigurer()));\n return;\n }\n if (plan.getPhaseConnections().isEmpty()) {\n WorkflowProgramAdder programAdder;\n WorkflowForkConfigurer forkConfigurer = getConfigurer().fork();\n programAdder = new BranchProgramAdder(forkConfigurer);\n for (String phaseName : plan.getPhases().keySet()) {\n addProgram(phaseName, programAdder);\n }\n if (forkConfigurer != null) {\n forkConfigurer.join();\n }\n return;\n }\n dag = new ControlDag(plan.getPhaseConnections());\n dag.flatten();\n String start = dag.getSources().iterator().next();\n addPrograms(start, getConfigurer());\n}\n"
|
"public Set<MetaFile> getMetaFiles(Template template) throws AxelorException, IOException {\n List<MetaAttachment> metaAttachments = Query.of(MetaAttachment.class).filter(\"String_Node_Str\", template.getId(), Template.class.getName()).fetch();\n Set<MetaFile> metaFiles = Sets.newHashSet();\n for (MetaAttachment metaAttachment : metaAttachments) {\n metaFiles.add(metaAttachment.getMetaFile());\n }\n return metaFiles;\n}\n"
|
"private boolean changeSize() {\n recycleBitmaps();\n int width = this.mapView.getWidth();\n int height = this.mapView.getHeight();\n if (width > 0 && height > 0) {\n this.bitmap1 = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);\n this.bitmap2 = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);\n this.changeSizeNeeded = false;\n this.redrawNeeded = true;\n return true;\n }\n return false;\n}\n"
|
"private void newBrowseItemView(String browseItem) throws RemoteException {\n for (XSDElementDeclaration decl : declList) {\n String fullName = BROWSE_ITEMS + decl.getName();\n if (fullName.equals(browseItem)) {\n XtentisPort port = getXtentisPort();\n WSView view = new WSView();\n WSPutView wrap = new WSPutView();\n view.setName(browseItem);\n EList<XSDIdentityConstraintDefinition> idtylist = decl.getIdentityConstraintDefinitions();\n List<String> keys = new ArrayList<String>();\n for (XSDIdentityConstraintDefinition idty : idtylist) {\n EList<XSDXPathDefinition> xpathList = idty.getFields();\n for (XSDXPathDefinition path : xpathList) {\n String key = decl.getName();\n key += \"String_Node_Str\" + path.getValue();\n keys.add(key);\n }\n }\n view.setSearchableBusinessElements(keys.toArray(new String[] {}));\n view.setViewableBusinessElements(keys.toArray(new String[] {}));\n StringBuffer desc = new StringBuffer();\n if (decl.getAnnotation() != null)\n labels = new XSDAnnotationsStructure(decl.getAnnotation()).getLabels();\n if (labels == null || labels.size() == 0)\n labels.put(\"String_Node_Str\", decl.getName());\n for (String lan : labels.keySet()) {\n desc.append(\"String_Node_Str\" + lan.toUpperCase() + \"String_Node_Str\" + labels.get(lan) + \"String_Node_Str\");\n }\n view.setDescription(desc.toString());\n wrap.setWsView(view);\n WSViewPK viewPk = new WSViewPK();\n viewPk.setPk(browseItem);\n WSDeleteView delView = new WSDeleteView();\n delView.setWsViewPK(viewPk);\n WSGetView getView = new WSGetView();\n getView.setWsViewPK(viewPk);\n try {\n port.getView(getView);\n port.deleteView(delView);\n } catch (RemoteException ex) {\n }\n port.putView(wrap);\n }\n }\n}\n"
|
"public void load() {\n this.configFolder = new File(this.plugin.getDataFolder(), this.playerName);\n this.configFolder.mkdirs();\n this.generalConfig = new Configuration(new File(this.configFolder, GENERAL_CONFIG_FILENAME));\n this.warpConfig = new Configuration(new File(this.configFolder, WARP_CONFIG_FILENAME));\n this.quotaConfig = new Configuration(new File(this.configFolder, QUOTA_CONFIG_FILENAME));\n this.generalConfig.load();\n this.warpConfig.load();\n this.quotaConfig.load();\n if (this.plugin.getPrivateWarps().get(this.playerName) == null) {\n this.plugin.getPrivateWarps().put(this.playerName, new HashMap<String, Warp>());\n }\n this.plugin.loadWarps(this.warpConfig, this.plugin.getPrivateWarps().get(this.playerName));\n ConfigurationNode homeNode = this.generalConfig.getNode(OpenWarp.HOME_KEY);\n if (homeNode != null) {\n this.plugin.setDefaultHome(this.playerName, new Warp(this.plugin, TEMP_HOME_NAME, homeNode).getLocation());\n }\n Map<String, ConfigurationNode> multiworldHomesMap = this.generalConfig.getNodes(OpenWarp.MULTIWORLD_HOMES_KEY);\n if (multiworldHomesMap != null) {\n for (String worldName : multiworldHomesMap.keySet()) {\n this.plugin.setHome(this.playerName, worldName, new Warp(this.plugin, TEMP_HOME_NAME, multiworldHomesMap.get(worldName)).getLocation());\n }\n }\n ConfigurationNode backNode = this.generalConfig.getNode(OpenWarp.BACK_KEY);\n if (backNode != null) {\n this.plugin.getLocationTracker().setPreviousLocation(this.playerName, new Warp(this.plugin, TEMP_BACK_NAME, backNode).getLocation());\n }\n ConfigurationNode stackNode = this.generalConfig.getNode(OpenWarp.STACK_KEY);\n if (stackNode != null) {\n List<Object> stackConfig = stackNode.getList(\"String_Node_Str\");\n for (Object o : stackConfig) {\n }\n }\n this.plugin.getQuotaManager().loadPrivateQuotas(this.playerName, this.quotaConfig);\n}\n"
|
"public ArrayList<Player> getManagedPlayers() {\n ArrayList<Player> players = new ArrayList<Player>();\n for (net.minecraft.server.EntityPlayerMP player : pm.getManagedPlayers()) {\n players.add(player.getPlayer());\n }\n return players;\n}\n"
|
"protected Void execute(StopContainerCmd command) {\n WebTarget webResource = getBaseResource().path(\"String_Node_Str\").resolveTemplate(\"String_Node_Str\", command.getContainerId()).queryParam(\"String_Node_Str\", String.valueOf(command.getTimeout()));\n LOGGER.trace(\"String_Node_Str\", webResource);\n webResource.request().accept(MediaType.APPLICATION_JSON).post(null).close();\n return null;\n}\n"
|
"public boolean isEmpty() {\n return buffer.get() == null || buffer.get().limit() <= 0;\n}\n"
|
"void setEndPoints(double dStart, double dEnd) {\n this.dStart = dStart;\n this.dEnd = dEnd;\n if (isTickBetweenCategory) {\n this.dStep = (dEnd - dStart) / size;\n } else {\n this.dStep = (dEnd - dStart) / (size - 1);\n }\n}\n"
|
"private Quad getQuad() {\n Vector2f scales = new Vector2f();\n BufferedImage img = getImage(scales);\n float w = img.getWidth();\n float h = img.getHeight();\n float factor = height / h;\n Quad ret;\n if (imgWidth == w && imgHeight == h) {\n ret = quad;\n TextureState texState = (TextureState) quad.getRenderState(StateType.Texture);\n Texture oldtex = texState.getTexture();\n TextureManager.releaseTexture(oldtex);\n Texture tex = TextureManager.loadTexture(img, MinificationFilter.BilinearNoMipMaps, MagnificationFilter.Bilinear, true);\n texState.setTexture(tex);\n } else {\n ret = new Quad(\"String_Node_Str\", w * factor, h * factor);\n TextureState ts = DisplaySystem.getDisplaySystem().getRenderer().createTextureState();\n Texture tex = TextureManager.loadTexture(img, MinificationFilter.BilinearNoMipMaps, MagnificationFilter.Bilinear, true);\n ts.setTexture(tex);\n ts.setEnabled(true);\n ret.setRenderState(ts);\n BlendState as = DisplaySystem.getDisplaySystem().getRenderer().createBlendState();\n as.setBlendEnabled(false);\n as.setReference(0.5f);\n as.setTestFunction(BlendState.TestFunction.GreaterThan);\n as.setTestEnabled(true);\n ret.setRenderState(as);\n ret.setLightCombineMode(LightCombineMode.Off);\n ret.updateRenderState();\n this.quad = ret;\n imgWidth = w;\n imgHeight = h;\n }\n return ret;\n}\n"
|
"public Response toResponse(UnsupportedMediaTypeException ex) {\n return Response.status(Response.Status.UNSUPPORTED_MEDIA_TYPE).build();\n}\n"
|
"private int stopAll(String callingApp) {\n int result = TextToSpeech.TTS_ERROR;\n boolean speechQueueAvailable = false;\n try {\n speechQueueAvailable = speechQueueLock.tryLock(SPEECHQUEUELOCK_TIMEOUT, TimeUnit.MILLISECONDS);\n if (speechQueueAvailable) {\n for (int i = mSpeechQueue.size() - 1; i > -1; i--) {\n if (mSpeechQueue.get(i).mType != SpeechItem.TEXT_TO_FILE) {\n mSpeechQueue.remove(i);\n }\n }\n if ((mCurrentSpeechItem != null) && ((mCurrentSpeechItem.mType != SpeechItem.TEXT_TO_FILE) || mCurrentSpeechItem.mCallingApp.equals(callingApp))) {\n result = sNativeSynth.stop();\n mKillList.put(mCurrentSpeechItem, true);\n if (mPlayer != null) {\n try {\n mPlayer.stop();\n } catch (IllegalStateException e) {\n }\n }\n mIsSpeaking = false;\n mCurrentSpeechItem = null;\n } else {\n result = TextToSpeech.TTS_SUCCESS;\n }\n Log.i(\"String_Node_Str\", \"String_Node_Str\");\n }\n } catch (InterruptedException e) {\n Log.e(\"String_Node_Str\", \"String_Node_Str\");\n e.printStackTrace();\n } finally {\n if (speechQueueAvailable) {\n speechQueueLock.unlock();\n }\n return result;\n }\n}\n"
|
"public boolean equals(Object obj) {\n if (this == obj)\n return true;\n if (obj == null)\n return false;\n if (getClass() != obj.getClass())\n return false;\n DeploymentArtifactImpl other = (DeploymentArtifactImpl) obj;\n if (artifact == null) {\n if (other.artifact != null)\n return false;\n } else if (!artifact.equals(other.artifact))\n return false;\n if (def == null) {\n if (other.def != null)\n return false;\n } else if (!def.equals(other.def))\n return false;\n if (!other.getArtifactType().equals(this.getArtifactType())) {\n return false;\n }\n if (!this.getName().equals(other.getName())) {\n return false;\n }\n return true;\n}\n"
|
"public void addOtherAbility(Card attachedTo, Ability ability) {\n Ability newAbility;\n if (ability instanceof MageSingleton) {\n newAbility = ability;\n } else {\n newAbility = ability.copy();\n }\n newAbility.setSourceId(attachedTo.getId());\n newAbility.setControllerId(attachedTo.getOwnerId());\n if (!cardState.containsKey(attachedTo.getId())) {\n cardState.put(attachedTo.getId(), new CardState());\n }\n cardState.get(attachedTo.getId()).addAbility(ability);\n addAbility(ability, attachedTo.getId(), attachedTo);\n}\n"
|
"public void onActionMove(MotionEvent event) {\n final int pointerIndex = event.findPointerIndex(mEditorView.getActivePointerId());\n final int x = (int) event.getX(pointerIndex);\n final int y = (int) event.getY(pointerIndex);\n if (!isRunning) {\n int xGrid = rasterGridHelper.getTouchOnGrid(mEditorView.scaledX(mEditorView.getLastTouchX()));\n gridElements = rasterGridHelper.getElementsOnGrid(xGrid);\n isRunning = true;\n }\n if (!mEditorView.scaleDetectorActive()) {\n final int offX = x - mEditorView.getLastTouchX();\n final int offY = y - mEditorView.getLastTouchY();\n mTweetFlow.moveGridElements(gridElements, offX, offY);\n mEditorView.redraw();\n }\n mEditorView.setLastTouch(x, y);\n}\n"
|
"public void testExtensibility() throws Exception {\n String baseXml = TestHelper.getResourceAsString(\"String_Node_Str\", \"String_Node_Str\");\n JSONJAXBContext jsonContext = new JSONJAXBContext(JSONConfiguration.natural().build(), \"String_Node_Str\");\n Unmarshaller jaxbUnmarshaller = jsonContext.createUnmarshaller();\n Object fromXml = jaxbUnmarshaller.unmarshal(new StringReader(baseXml));\n StringWriter sw = new StringWriter();\n jsonContext.createJSONMarshaller().marshallToJSON(fromXml, sw);\n String jsonRepresentation = sw.toString();\n System.out.println(jsonRepresentation);\n}\n"
|
"public long nextPos() {\n long pos = searchPos;\n while (true) {\n long entry = bytes.readInt48(pos);\n if (entry == UNSET_ENTRY) {\n searchState.searchPos = pos;\n return -1L;\n }\n pos = step(pos);\n if (key(entry) == searchHash) {\n searchPos = pos;\n return value(entry);\n }\n }\n}\n"
|
"private void commutative(OPT_Instruction s, OPT_Operator opCode, OPT_IR ir) {\n OPT_RegisterOperand result = Binary.getClearResult(s);\n OPT_Operand op1 = Binary.getClearVal1(s);\n OPT_Operand op2 = Binary.getClearVal2(s);\n if (result.similar(op1)) {\n OPT_DefUse.removeUse(op1.asRegister());\n OPT_DefUse.removeDef(result);\n OPT_DefUse.recordDefUse(result);\n BinaryAcc.mutate(s, opCode, result, op2);\n return;\n }\n if (result.similar(op2)) {\n OPT_DefUse.removeUse(op2.asRegister());\n OPT_DefUse.removeDef(result);\n OPT_DefUse.recordDefUse(result);\n BinaryAcc.mutate(s, opCode, result, op1);\n return;\n }\n if (OPTIMIZE) {\n if (op1.isRegister()) {\n OPT_RegisterOperand rop1 = op1.asRegister();\n if (!rop1.register.spansBasicBlock() && isDead(rop1.register)) {\n if (result.register.isSSA() && !result.register.spansBasicBlock() && rop1.register.isSSA()) {\n OPT_DefUse.removeDef(result);\n OPT_DefUse.removeUse(rop1);\n OPT_DefUse.recordDefUse(rop1);\n OPT_DefUse.mergeRegisters(ir, rop1.register, result.register);\n rop1.register.putSSA(false);\n BinaryAcc.mutate(s, opCode, rop1, op2);\n return;\n } else {\n OPT_DefUse.removeDef(result);\n OPT_DefUse.removeUse(rop1);\n OPT_DefUse.recordDefUse(rop1);\n BinaryAcc.mutate(s, opCode, rop1, op2);\n OPT_Instruction move = Move.create(getMoveOp(result.type), result, rop1.copy());\n OPT_DefUse.updateDUForNewInstruction(move);\n s.insertAfter(move);\n return;\n }\n }\n }\n if (op2.isRegister()) {\n OPT_RegisterOperand rop2 = op2.asRegister();\n if (!rop2.register.spansBasicBlock() && isDead(rop2.register)) {\n if (result.register.isSSA() && !result.register.spansBasicBlock()) {\n OPT_DefUse.removeUse(rop2);\n OPT_DefUse.removeDef(result);\n OPT_DefUse.recordDefUse(rop2);\n OPT_DefUse.mergeRegisters(ir, rop2.register, result.register);\n rop2.register.putSSA(false);\n BinaryAcc.mutate(s, opCode, rop2, op1);\n return;\n } else {\n OPT_DefUse.removeDef(result);\n OPT_DefUse.removeUse(rop2);\n OPT_DefUse.recordDefUse(rop2);\n BinaryAcc.mutate(s, opCode, rop2, op1);\n OPT_Instruction move = Move.create(getMoveOp(result.type), result, rop2.copy());\n OPT_DefUse.updateDUForNewInstruction(move);\n s.insertAfter(move);\n return;\n }\n }\n }\n }\n OPT_Instruction move = Move.create(getMoveOp(result.type), result.copyRO(), op1.copy());\n OPT_DefUse.updateDUForNewInstruction(move);\n s.insertBefore(move);\n OPT_DefUse.removeDef(result);\n OPT_DefUse.recordDefUse(result);\n if (op1.isRegister()) {\n OPT_DefUse.removeUse(op1.asRegister());\n }\n BinaryAcc.mutate(s, opCode, result, op2);\n}\n"
|
"public void startWave() {\n if (currentWave == AMOUNT_OF_WAVES) {\n currentWave = 0;\n int rankTemp;\n for (int index = enemies.size() - 1; index >= 0; --index) {\n if (enemies.get(index).rank <= 4) {\n rankTemp = enemies.get(index).rank;\n enemies.get(index).setStats(enemyStats[rankTemp][0], enemyStats[rankTemp][1], enemyStats[rankTemp][2], enemyStats[rankTemp][3], enemyStats[rankTemp][4], rankTemp + 1);\n }\n }\n }\n int temp;\n int tempRandA, tempRandB;\n for (int index = 0; index < AMOUNT_OF_ENEMIES_PER_WAVE; ++index) {\n if (waves[currentWave][index] != -1) {\n temp = waves[currentWave][index];\n tempRandA = randomGen.nextInt(7) + 1;\n tempRandB = randomGen.nextInt(2);\n enemies.get(temp).setActive();\n enemies.get(temp).x = spawnPoints[tempRandA][tempRandB][0];\n enemies.get(temp).y = spawnPoints[tempRandA][tempRandB][1];\n ++enemiesLeft;\n }\n }\n ++currentWave;\n}\n"
|
"public void setCondensedKeys(CondenseType condenseType) {\n if (mKeyboardCondenser.setCondensedKeys(condenseType)) {\n computeNearestNeighbors();\n}\n"
|
"public <T> CursorEntity<T> graphGetEdgesByExampleMap(String graphName, Class<T> clazz, Map<String, Object> vertexExample) throws ArangoException {\n validateCollectionName(graphName);\n String query = \"String_Node_Str\";\n Map<String, Object> bindVars = new MapBuilder().put(GRAPH_NAME, graphName).put(VERTEX_EXAMPLE, vertexExample).get();\n return this.executeQuery(query, bindVars, clazz, true, 20, null);\n}\n"
|
"protected Config loadConfig() throws IOException {\n if (getGitDir() != null) {\n File path = safeFS().resolve(getGitDir(), \"String_Node_Str\");\n FileBasedConfig cfg = new FileBasedConfig(path, safeFS());\n try {\n cfg.load();\n } catch (ConfigInvalidException err) {\n throw new IllegalArgumentException(MessageFormat.format(JGitText.get().repositoryConfigFileInvalid, path.getAbsolutePath(), err.getMessage()));\n }\n return cfg;\n } else {\n return new Config();\n }\n}\n"
|
"private NodeRef recursiveCopy(NodeRef sourceNodeRef, NodeRef destinationParent, QName destinationAssocTypeQName, QName destinationQName, boolean copyChildren, Map<NodeRef, NodeRef> copiedChildren) {\n QName sourceTypeRef = this.nodeService.getType(sourceNodeRef);\n TypeDefinition typeDef = dictionaryService.getType(sourceTypeRef);\n if (typeDef == null) {\n throw new InvalidTypeException(sourceTypeRef);\n }\n PolicyScope copyDetails = getCopyDetails(sourceNodeRef, destinationParentRef.getStoreRef(), true);\n Map<QName, Serializable> typeProps = copyDetails.getProperties();\n Map<QName, Serializable> properties = new HashMap<QName, Serializable>();\n if (typeProps != null) {\n properties.putAll(typeProps);\n }\n for (AspectDefinition aspectDef : typeDef.getDefaultAspects()) {\n Map<QName, Serializable> aspectProps = copyDetails.getProperties(aspectDef.getName());\n if (aspectProps != null) {\n properties.putAll(aspectProps);\n }\n }\n AssociationDefinition assocDef = dictionaryService.getAssociation(destinationAssocTypeQName);\n if (!assocDef.isChild()) {\n throw new AlfrescoRuntimeException(\"String_Node_Str\" + destinationAssocTypeQName);\n } else {\n ChildAssociationDefinition childAssocDef = (ChildAssociationDefinition) assocDef;\n if (!childAssocDef.getDuplicateChildNamesAllowed()) {\n properties.remove(ContentModel.PROP_NAME);\n }\n }\n ChildAssociationRef destinationChildAssocRef = this.nodeService.createNode(destinationParent, destinationAssocTypeQName, destinationQName, sourceTypeRef, properties);\n NodeRef destinationNodeRef = destinationChildAssocRef.getChildRef();\n copiedChildren.put(sourceNodeRef, destinationNodeRef);\n this.ruleService.disableRules(destinationNodeRef);\n try {\n Map<QName, Serializable> copyProperties = new HashMap<QName, Serializable>();\n copyProperties.put(ContentModel.PROP_COPY_REFERENCE, sourceNodeRef);\n this.nodeService.addAspect(destinationNodeRef, ContentModel.ASPECT_COPIEDFROM, copyProperties);\n copyAspects(destinationNodeRef, copyDetails);\n copyAssociations(destinationNodeRef, copyDetails, copyChildren, copiedChildren);\n copyPermissions(sourceNodeRef, destinationNodeRef);\n } finally {\n this.ruleService.enableRules(destinationNodeRef);\n }\n return destinationNodeRef;\n}\n"
|
"public BufferedImage expensiveRecolorOperations(boolean forMain, BTProgressMonitor monitor) throws IOException, AsynchExitRequestException {\n Dimension screenSize = (forMain) ? Toolkit.getDefaultToolkit().getScreenSize() : new Dimension(800, 400);\n screenSize.setSize((int) (screenSize.getWidth() * 0.8), (int) (screenSize.getHeight() * 0.4));\n colGen_.newColorModel();\n bfp_.changePaint(monitor);\n int[] zoomLevels = bfp_.getZoomController().getZoomLevels();\n BufferedImage topImage = null;\n if (forMain) {\n BufferBuilder bb = new BufferBuilder(null, 100, bfp_, bfp_.getBucketRend(), bfp_.getBufImgStack());\n topImage = bb.buildBufs(preZooms, bfp_, 24, monitor);\n bfp_.setBufBuilder(bb);\n } else {\n BufferBuilder bb = new BufferBuilder(bfp_, bfp_.getBucketRend(), bfp_.getBufImgStack());\n topImage = bb.buildOneBuf(preZooms);\n bfp_.setBufBuilder(null);\n }\n return (topImage);\n}\n"
|
"void showInputMethodMenu() {\n if (DEBUG)\n Slog.v(TAG, \"String_Node_Str\");\n hideInputMethodMenu();\n final Context context = mContext;\n final PackageManager pm = context.getPackageManager();\n String lastInputMethodId = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD);\n if (DEBUG)\n Slog.v(TAG, \"String_Node_Str\" + lastInputMethodId);\n final List<InputMethodInfo> immis = getEnabledInputMethodList();\n if (immis == null) {\n return;\n }\n synchronized (mMethodMap) {\n hideInputMethodMenuLocked();\n int N = immis.size();\n mItems = new CharSequence[N];\n mIms = new InputMethodInfo[N];\n int j = 0;\n for (int i = 0; i < N; ++i) {\n InputMethodInfo property = immis.get(i);\n if (property == null) {\n continue;\n }\n mItems[j] = property.loadLabel(pm);\n mIms[j] = property;\n j++;\n }\n }\n AlertDialog.OnClickListener adocl = new AlertDialog.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n hideInputMethodMenu();\n }\n };\n TypedArray a = context.obtainStyledAttributes(null, com.android.internal.R.styleable.DialogPreference, com.android.internal.R.attr.alertDialogStyle, 0);\n mDialogBuilder = new AlertDialog.Builder(context).setTitle(com.android.internal.R.string.select_input_method).setOnCancelListener(new OnCancelListener() {\n public void onCancel(DialogInterface dialog) {\n hideInputMethodMenu();\n }\n }).setIcon(a.getDrawable(com.android.internal.R.styleable.DialogPreference_dialogTitle));\n a.recycle();\n mDialogBuilder.setSingleChoiceItems(mItems, checkedItem, new AlertDialog.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n synchronized (mMethodMap) {\n if (mIms == null || mIms.length <= which) {\n return;\n }\n InputMethodInfo im = mIms[which];\n hideInputMethodMenu();\n if (im != null) {\n setInputMethodLocked(im.getId());\n }\n }\n }\n });\n synchronized (mMethodMap) {\n mSwitchingDialog = mDialogBuilder.create();\n mSwitchingDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_INPUT_METHOD_DIALOG);\n mSwitchingDialog.show();\n }\n}\n"
|
"public static final boolean alarmExists(ContentResolver cr, long eventId, long begin, long alarmTime) {\n String[] projection = new String[] { ALARM_TIME };\n Cursor cursor = query(cr, projection, WHERE_ALARM_EXISTS, new String[] { Long.toString(eventId), Long.toString(begin), Long.toString(alarmTime) }, null);\n boolean found = false;\n try {\n if (cursor != null && cursor.getCount() > 0) {\n found = true;\n }\n } finally {\n if (cursor != null) {\n cursor.close();\n }\n }\n return found;\n}\n"
|
"public Publisher<T> apply(Flowable<T> upstream) {\n HideAtStartShowAtError<T> delegate = new HideAtStartShowAtError<>(view.hideErrorState(), view.showErrorState(), error -> !(error instanceof ContentNotFoundError), uiScheduler);\n return upstream.compose(delegate);\n}\n"
|
"private void outputIndexEntryEclipseIndexsee(final IndexTerm term, final XMLStreamWriter serializer) throws XMLStreamException {\n final List<IndexTermTarget> targets = term.getTargetList();\n final int targetNum = targets.size();\n if (targets != null && !targets.isEmpty()) {\n for (final IndexTermTarget target : targets) {\n final String targetUri = target.getTargetURI();\n final String targetName = target.getTargetName();\n if (targetUri == null) {\n serializer.writeStartElement(\"String_Node_Str\");\n serializer.writeAttribute(\"String_Node_Str\", target.getTargetName());\n serializer.writeEndElement();\n } else {\n serializer.writeStartElement(\"String_Node_Str\");\n serializer.writeAttribute(\"String_Node_Str\", replaceExtName(targetUri));\n if (targetName.trim().length() > 0) {\n serializer.writeAttribute(\"String_Node_Str\", target.getTargetName());\n }\n serializer.writeEndElement();\n }\n }\n }\n}\n"
|
"protected ModelNode buildOperationRequest(CommandContext ctx, final String operation) throws CommandFormatException {\n ParsedCommandLine args = ctx.getParsedCommandLine();\n DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder();\n if (ctx.isDomainMode()) {\n final String profile = this.profile.getValue(args);\n if (profile == null) {\n throw new OperationFormatException(\"String_Node_Str\");\n }\n builder.addNode(\"String_Node_Str\", profile);\n }\n final String name = this.name.getValue(ctx.getParsedCommandLine(), true);\n for (OperationRequestAddress.Node node : nodePath) {\n builder.addNode(node.getType(), node.getName());\n }\n builder.addNode(type, name);\n builder.setOperationName(operation);\n final Map<String, CommandArgument> argsMap = loadArguments(ctx, operation);\n for (String argName : args.getPropertyNames()) {\n if (argName.equals(\"String_Node_Str\")) {\n continue;\n }\n if (argsMap == null) {\n if (argName.equals(this.name.getFullName())) {\n continue;\n }\n throw new CommandFormatException(\"String_Node_Str\" + operation + \"String_Node_Str\" + this.name.getFullName() + \"String_Node_Str\");\n }\n final ArgumentWithValue arg = (ArgumentWithValue) argsMap.get(argName);\n if (arg == null) {\n if (argName.equals(this.name.getFullName())) {\n continue;\n }\n throw new CommandFormatException(\"String_Node_Str\" + argName + \"String_Node_Str\" + operation + \"String_Node_Str\");\n }\n final String propName;\n if (argName.charAt(1) == '-') {\n propName = argName.substring(2);\n } else {\n propName = argName.substring(1);\n }\n final String valueString = args.getPropertyValue(argName);\n ModelNode nodeValue = arg.getValueConverter().fromString(valueString);\n builder.getModelNode().get(propName).set(nodeValue);\n }\n return builder.buildRequest();\n}\n"
|
"Option<MatchResult> unapplyToken(Token token) {\n if (token instanceof Token.FloatToken) {\n return Option.Some(new MatchResult(token));\n } else {\n return Option.None();\n }\n return Option.None();\n}\n"
|
"public void doSave(IProgressMonitor monitor) {\n if (masterPage.isDirty()) {\n masterPage.doSave(monitor);\n setPartName(masterPage.getIntactElemenetName());\n ConnectionItem item = (ConnectionItem) ((ConnectionItemEditorInput) this.getEditorInput()).getItem();\n if (item instanceof DatabaseConnectionItem) {\n String name = ((DatabaseConnectionItem) item).getConnection().getName();\n CWMPlugin.getDefault().updateConnetionAliasByName(item.getConnection(), masterPage.getOldDataproviderName());\n masterPage.setOldDataproviderName(name);\n }\n }\n setEditorObject(masterPage.getConnectionRepNode());\n super.doSave(monitor);\n}\n"
|
"public void testNumSamplesMultipleFiles() {\n try {\n final String tempFile = TestFileUtils.createTempFileDir(TEST_DATA1, TEST_DATA1, TEST_DATA1, TEST_DATA1);\n final Configuration conf = new Configuration();\n conf.setString(FileInputFormat.FILE_PARAMETER_KEY, tempFile.replace(\"String_Node_Str\", \"String_Node_Str\"));\n final TestDelimitedInputFormat format = new TestDelimitedInputFormat();\n format.configure(conf);\n TestFileSystem.resetStreamOpenCounter();\n format.getStatistics(null);\n Assert.assertEquals(\"String_Node_Str\", DEFAULT_NUM_SAMPLES, TestFileSystem.getNumtimeStreamOpened());\n conf.setString(TestDelimitedInputFormat.NUM_STATISTICS_SAMPLES, \"String_Node_Str\");\n final TestDelimitedInputFormat format2 = new TestDelimitedInputFormat();\n format2.configure(conf);\n TestFileSystem.resetStreamOpenCounter();\n format2.getStatistics(null);\n Assert.assertEquals(\"String_Node_Str\", 8, TestFileSystem.getNumtimeStreamOpened());\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail(e.getMessage());\n }\n}\n"
|
"public void write() throws IOException {\n OutputStream outStream = null;\n XMLStreamWriter out = null;\n try {\n outStream = new FileOutputStream(new File(tempDir, JOB_FILE));\n out = XMLOutputFactory.newInstance().createXMLStreamWriter(outStream, \"String_Node_Str\");\n out.writeStartDocument();\n out.writeStartElement(ELEMENT_JOB);\n for (final Map.Entry<String, Object> e : prop.entrySet()) {\n out.writeStartElement(ELEMENT_PROPERTY);\n out.writeAttribute(ATTRIBUTE_NAME, e.getKey());\n if (e.getValue() instanceof String) {\n out.writeStartElement(ELEMENT_STRING);\n out.writeCharacters(e.getValue().toString());\n out.writeEndElement();\n } else if (e.getValue() instanceof Set) {\n out.writeStartElement(ELEMENT_SET);\n final Set<?> s = (Set<?>) e.getValue();\n for (final Object o : s) {\n out.writeStartElement(ELEMENT_STRING);\n out.writeCharacters(o.toString());\n out.writeEndElement();\n }\n out.writeEndElement();\n } else if (e.getValue() instanceof Map) {\n out.writeStartElement(ELEMENT_MAP);\n final Map<?, ?> s = (Map<?, ?>) e.getValue();\n for (final Map.Entry<?, ?> o : s.entrySet()) {\n out.writeStartElement(ELEMENT_ENTRY);\n out.writeAttribute(ATTRIBUTE_KEY, o.getKey().toString());\n out.writeStartElement(ELEMENT_STRING);\n out.writeCharacters(o.getValue().toString());\n out.writeEndElement();\n out.writeEndElement();\n }\n out.writeEndElement();\n } else {\n out.writeStartElement(e.getValue().getClass().getName());\n out.writeCharacters(e.getValue().toString());\n out.writeEndElement();\n }\n out.writeEndElement();\n }\n out.writeEndElement();\n out.writeEndDocument();\n } catch (final IOException e) {\n throw new IOException(\"String_Node_Str\" + e.getMessage());\n } catch (final XMLStreamException e) {\n throw new IOException(\"String_Node_Str\" + e.getMessage());\n } finally {\n if (out != null) {\n try {\n out.close();\n } catch (final XMLStreamException e) {\n throw new IOException(\"String_Node_Str\" + e.getMessage());\n }\n }\n if (outStream != null) {\n try {\n outStream.close();\n } catch (final IOException e) {\n throw new IOException(\"String_Node_Str\" + e.getMessage());\n }\n }\n }\n final Properties p = new Properties();\n for (final Map.Entry<String, Object> e : prop.entrySet()) {\n if (e.getValue() instanceof Set) {\n p.put(e.getKey(), StringUtils.assembleString((Collection) e.getValue(), COMMA));\n } else if (e.getValue() instanceof Map) {\n p.put(e.getKey(), StringUtils.assembleString((Map) e.getValue(), COMMA));\n } else {\n p.put(e.getKey(), e.getValue());\n }\n }\n FileOutputStream propertiesOutputStream = null;\n try {\n propertiesOutputStream = new FileOutputStream(new File(tempDir, FILE_NAME_DITA_LIST));\n p.store(propertiesOutputStream, null);\n propertiesOutputStream.flush();\n } catch (final IOException e) {\n throw new IOException(\"String_Node_Str\" + e.getMessage());\n } finally {\n if (propertiesOutputStream != null) {\n try {\n propertiesOutputStream.close();\n } catch (final IOException e) {\n throw new IOException(\"String_Node_Str\" + e.getMessage());\n }\n }\n }\n FileOutputStream xmlOutputStream = null;\n try {\n xmlOutputStream = new FileOutputStream(new File(tempDir, FILE_NAME_DITA_LIST_XML));\n p.storeToXML(xmlOutputStream, null);\n xmlOutputStream.flush();\n } catch (final IOException e) {\n throw new IOException(\"String_Node_Str\" + e.getMessage());\n } finally {\n if (xmlOutputStream != null) {\n try {\n xmlOutputStream.close();\n } catch (final IOException e) {\n throw new IOException(\"String_Node_Str\" + e.getMessage());\n }\n }\n }\n}\n"
|
"protected void refreshVisuals() {\n ConnectionPart connectionPart;\n connectionPart = (ConnectionPart) getParent();\n Connection conn = (Connection) connectionPart.getModel();\n IElementParameter element = conn.getElementParameter(EParameterName.TRACES_CONNECTION_ENABLE.getName());\n Boolean flag = false;\n if (element != null) {\n flag = (Boolean) element.getValue();\n }\n ConnectionTraceFigure htmlFigure = (ConnectionTraceFigure) getFigure();\n ConnectionTrace connectionTrace = (ConnectionTrace) getModel();\n TraceData trace = connectionTrace.getTrace();\n if (trace == null) {\n Point offset = conn.getConnectionLabel().getOffset();\n connectionTrace.getOffset().x = offset.x;\n connectionTrace.getOffset().y = offset.y;\n this.removeEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE);\n } else {\n this.installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new ConnTextMovePolicy());\n }\n htmlFigure.setTraceData(trace, flag, conn.checkTraceShowEnable());\n Dimension size = htmlFigure.getPreferredSize();\n connectionTrace.setSize(size);\n String connectionName = ((Connection) connectionPart.getModel()).getConnectionLabel().getLabelText();\n Point offset = ((ConnectionTrace) getModel()).getOffset();\n ConnectionTraceConstraint constraint = new ConnectionTraceConstraint(connectionName, size, \"String_Node_Str\", offset, (PolylineConnection) connectionPart.getFigure());\n connectionPart.setLayoutConstraint(this, getFigure(), constraint);\n}\n"
|
"public void onUpdateProperties(NodeRef commentsRollupNode, Map<QName, Serializable> before, Map<QName, Serializable> after) {\n Serializable newCommentCount = after.get(ForumModel.PROP_COMMENT_COUNT);\n if (newCommentCount != null) {\n Integer newCommentCountInt = (Integer) newCommentCount;\n if (newCommentCountInt == COUNT_TRIGGER_VALUE) {\n if (log.isDebugEnabled()) {\n StringBuilder msg = new StringBuilder();\n msg.append(commentsRollupNode).append(\"String_Node_Str\").append(ForumModel.PROP_COMMENT_COUNT.getLocalName()).append(\"String_Node_Str\").append(newCommentCountInt);\n log.debug(msg.toString());\n log.debug(\"String_Node_Str\");\n }\n final Integer realCommentTotal = calculateCommentTotalByNodeCounting(commentsRollupNode);\n if (realCommentTotal != null && realCommentTotal != -1) {\n nodeService.setProperty(commentsRollupNode, ForumModel.PROP_COMMENT_COUNT, realCommentTotal);\n }\n }\n }\n}\n"
|
"public void sendEvents(final int eventType, final String name, final Data key, final Data value, final Map<Address, Boolean> mapListeners) {\n if (mapListeners != null) {\n final PacketQueue sq = PacketQueue.get();\n final Set<Map.Entry<Address, Boolean>> listeners = mapListeners.entrySet();\n for (final Map.Entry<Address, Boolean> listener : listeners) {\n final Address address = listener.getKey();\n final boolean includeValue = listener.getValue();\n if (address.isThisAddress()) {\n try {\n final Data eventKey = (key != null) ? ThreadContext.get().hardCopy(key) : null;\n Data eventValue = null;\n if (includeValue)\n eventValue = ThreadContext.get().hardCopy(value);\n enqueueEvent(eventType, name, eventKey, eventValue, address);\n } catch (final Exception e) {\n e.printStackTrace();\n }\n } else {\n final PacketQueue.Packet packet = sq.obtainPacket();\n packet.reset();\n try {\n final Data eventKey = key;\n Data eventValue = null;\n if (includeValue)\n eventValue = value;\n packet.set(name, OP_EVENT, eventKey, eventValue);\n packet.longValue = eventType;\n } catch (final Exception e) {\n e.printStackTrace();\n }\n final boolean sent = send(packet, address);\n if (!sent)\n packet.returnToContainer();\n }\n }\n }\n}\n"
|
"public Integer checkin(final Long poid, final String comment, String deserializerName, Long fileSize, DataHandler dataHandler, Boolean merge, Boolean sync) throws ServerException, UserException {\n requireAuthenticationAndRunningServer();\n final BimDatabaseSession session = bimServer.getDatabase().createSession();\n try {\n File homeDirIncoming = new File(bimServer.getHomeDir(), \"String_Node_Str\");\n if (!homeDirIncoming.isDirectory()) {\n homeDirIncoming.mkdir();\n }\n File userDirIncoming = new File(homeDirIncoming, getCurrentUser().getUsername());\n if (!userDirIncoming.exists()) {\n userDirIncoming.mkdir();\n }\n InputStream inputStream = null;\n String fileName = dataHandler.getName();\n if (fileName == null || fileName.trim().equals(\"String_Node_Str\")) {\n inputStream = dataHandler.getInputStream();\n } else {\n if (fileName.contains(\"String_Node_Str\")) {\n fileName = fileName.substring(fileName.lastIndexOf(\"String_Node_Str\") + 1);\n }\n if (fileName.contains(\"String_Node_Str\")) {\n fileName = fileName.substring(fileName.lastIndexOf(\"String_Node_Str\") + 1);\n }\n DateFormat dateFormat = new SimpleDateFormat(\"String_Node_Str\");\n fileName = dateFormat.format(new Date()) + \"String_Node_Str\" + fileName;\n File file = new File(userDirIncoming, fileName);\n inputStream = new MultiplexingInputStream(dataHandler.getInputStream(), new FileOutputStream(file));\n }\n try {\n EmfDeserializer deserializer = bimServer.getEmfDeserializerFactory().createDeserializer(deserializerName);\n if (deserializer == null) {\n throw new UserException(\"String_Node_Str\" + deserializerName + \"String_Node_Str\");\n }\n try {\n deserializer.init(bimServer.getPluginManager().requireSchemaDefinition());\n } catch (PluginException e) {\n throw new UserException(e);\n }\n IfcModelInterface model = deserializer.read(inputStream, fileName, false, fileSize);\n if (model.size() == 0) {\n throw new DeserializeException(\"String_Node_Str\");\n }\n User user = (User) session.get(StorePackage.eINSTANCE.getUser(), currentUoid, false, null);\n CheckinDatabaseAction checkinDatabaseAction = new CheckinDatabaseAction(bimServer, null, accessMethod, poid, currentUoid, model, comment, merge, true);\n LongCheckinAction longAction = new LongCheckinAction(bimServer, user, checkinDatabaseAction);\n bimServer.getLongActionManager().start(longAction);\n if (sync) {\n longAction.waitForCompletion();\n }\n return longAction.getId();\n } catch (UserException e) {\n throw e;\n } catch (DeserializeException e) {\n throw new UserException(e);\n } finally {\n inputStream.close();\n }\n } catch (UserException e) {\n throw e;\n } catch (Throwable e) {\n LOGGER.error(\"String_Node_Str\", e);\n throw new ServerException(e);\n } finally {\n session.close();\n }\n}\n"
|
"private void emptyLibs() {\n File libsDir = org.eclipse.core.runtime.Platform.getLocation().append(JavaUtils.JAVA_PROJECT_NAME).append(File.separator).append(JavaUtils.JAVA_LIB_DIRECTORY).toFile();\n if (libsDir.exists() && libsDir.isDirectory()) {\n FilesUtils.emptyFolder(libsDir);\n }\n}\n"
|
"public Object unmarshalEntity(Class type, MediaType acceptedMedia, InputStream in) throws JAXBException {\n Unmarshaller unmarshaller = getJAXBContext().createUnmarshaller();\n unmarshaller.setProperty(UnmarshallerProperties.JSON_INCLUDE_ROOT, Boolean.FALSE);\n unmarshaller.setProperty(UnmarshallerProperties.MEDIA_TYPE, acceptedMedia.toString());\n unmarshaller.setAdapter(new LinkAdapter(getBaseURI().toString(), this));\n unmarshaller.setEventHandler(new ValidationEventHandler() {\n public boolean handleEvent(ValidationEvent event) {\n if (event.getSeverity() != ValidationEvent.WARNING) {\n return false;\n }\n return true;\n }\n });\n for (XmlAdapter adapter : getAdapters()) {\n unmarshaller.setAdapter(adapter);\n }\n if (acceptedMedia == MediaType.APPLICATION_JSON_TYPE) {\n JAXBElement<?> element = unmarshaller.unmarshal(new StreamSource(in), type);\n if (element.getValue() instanceof List<?>) {\n for (Object object : (List<?>) element.getValue()) {\n wrap(object);\n }\n return element.getValue();\n } else {\n wrap(element.getValue());\n }\n return element.getValue();\n } else {\n wrap(element.getValue());\n }\n return element.getValue();\n}\n"
|
"public void writeStatement(MethodWriter writer) throws BytecodeException {\n FieldAccess access = (FieldAccess) this.instance;\n IDataMember f = access.field;\n if (this.writeIINC(writer, f)) {\n return;\n }\n f.writeSet(writer, access.instance, new MethodCall(this.position, access, this.method, this.arguments), this.getLineNumber());\n}\n"
|
"public void entrySetShouldContainEntries() {\n addTwoElements();\n final Set<Entry<Integer, Integer>> entrySet = map.entrySet();\n assertEquals(2, entrySet.size());\n assertFalse(entrySet.isEmpty());\n final Iterator<Entry<Integer, Integer>> it = entrySet.iterator();\n assertTrue(it.hasNext());\n assertEntryIs(it.next(), 1, 1);\n assertTrue(it.hasNext());\n assertEntryIs(it.next(), 2, 3);\n assertFalse(it.hasNext());\n}\n"
|
"public java.lang.Long getMyLongWrapperTest() {\n return getLong(START_PROPERTY_INDEX + 56);\n}\n"
|
"public void begin() throws CompassException {\n if (log.isDebugEnabled()) {\n log.debug(\"String_Node_Str\" + Thread.currentThread().getName() + \"String_Node_Str\" + System.identityHashCode(compass) + \"String_Node_Str\" + System.identityHashCode(session) + \"String_Node_Str\");\n }\n session.getSearchEngine().begin(transactionIsolation);\n state = STARTED;\n}\n"
|
"protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {\n String value = getAddress();\n if (StringUtils.isBlank(value)) {\n resultListModel.setObject(Collections.<GeocodingResult>emptyList());\n } else {\n List<GeocodingResult> results = null;\n try {\n results = geocodingService.geocode(value);\n resultListModel.setObject(results);\n } catch (Exception e) {\n log.error(\"String_Node_Str\" + value + \"String_Node_Str\" + e.getMessage(), e);\n resultListModel.setObject(Collections.<GeocodingResult>emptyList());\n }\n }\n self.setVisible(true);\n target.add(self);\n AjaxEventSender.send(this, GeocodingResult.class);\n}\n"
|
"public void testNull() {\n gffl.parse(gffl.EMPTY_STRING, false, new RandomWrapper(42));\n gffl.setKeepNull(true);\n assertEquals(0, gffl.generateMaskedRow(0L).longValue());\n assertEquals(null, gffl.generateMaskedRow(null));\n}\n"
|
"public void createOneUnit(final TreeItem treeItem, IndicatorUnit indicatorUnit) {\n final TreeItem indicatorItem = new TreeItem(treeItem, SWT.NONE);\n final IndicatorUnit unit = indicatorUnit;\n IndicatorEnum indicatorType = indicatorUnit.getType();\n indicatorItem.setData(MODELELEMENT_INDICATOR_KEY, treeItem.getData(MODELELEMENT_INDICATOR_KEY));\n indicatorItem.setData(INDICATOR_UNIT_KEY, unit);\n indicatorItem.setData(viewKey, this);\n indicatorItem.setImage(0, getIndicatorImage(unit));\n String indicatorName = getIndicatorName(indicatorUnit);\n String label = indicatorName == null ? \"String_Node_Str\" : indicatorName;\n indicatorItem.setText(0, label);\n TreeEditor optionEditor;\n optionEditor = new TreeEditor(tree);\n Label optionLabel = new Label(tree, SWT.NONE);\n optionLabel.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));\n optionLabel.setImage(ImageLib.getImage(ImageLib.INDICATOR_OPTION));\n optionLabel.setToolTipText(DefaultMessagesImpl.getString(\"String_Node_Str\"));\n optionLabel.pack();\n optionLabel.setData(indicatorUnit);\n optionLabel.addMouseListener(new MouseAdapter() {\n public void mouseDown(MouseEvent e) {\n openIndicatorOptionDialog(null, indicatorItem);\n }\n });\n optionEditor.minimumWidth = optionLabel.getImage().getBounds().width;\n optionEditor.horizontalAlignment = SWT.CENTER;\n optionEditor.setEditor(optionLabel, indicatorItem, 1);\n TreeEditor delEditor = new TreeEditor(tree);\n Label delLabel = new Label(tree, SWT.NONE);\n delLabel.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));\n delLabel.setImage(ImageLib.getImage(ImageLib.DELETE_ACTION));\n delLabel.setToolTipText(DefaultMessagesImpl.getString(\"String_Node_Str\"));\n delLabel.pack();\n delLabel.addMouseListener(new MouseAdapter() {\n public void mouseDown(MouseEvent e) {\n ModelElementIndicator meIndicator = (ModelElementIndicator) treeItem.getData(MODELELEMENT_INDICATOR_KEY);\n deleteIndicatorItems(meIndicator, unit);\n if (indicatorItem.getParentItem() != null && indicatorItem.getParentItem().getData(INDICATOR_UNIT_KEY) != null) {\n setElements(modelElementIndicators);\n } else {\n removeItemBranch(indicatorItem);\n }\n }\n });\n delEditor.minimumWidth = delLabel.getImage().getBounds().width;\n delEditor.horizontalAlignment = SWT.CENTER;\n if (AnalysisColumnTreeViewer.VIEWER_KEY.equals(viewKey)) {\n delEditor.setEditor(delLabel, indicatorItem, 4);\n } else if (AnalysisColumnSetTreeViewer.VIEWER_KEY.equals(viewKey)) {\n delEditor.setEditor(delLabel, indicatorItem, 3);\n }\n indicatorItem.setData(ITEM_EDITOR_KEY, new TreeEditor[] { optionEditor, delEditor });\n if (indicatorType.hasChildren()) {\n indicatorItem.setData(treeItem.getData(MODELELEMENT_INDICATOR_KEY));\n createIndicatorItems(indicatorItem, indicatorUnit.getChildren());\n }\n createIndicatorParameters(indicatorItem, indicatorUnit);\n Display.getCurrent().asyncExec(new Runnable() {\n public void run() {\n tree.getColumn(0).setWidth(tree.getColumn(0).getWidth() + 1);\n tree.getColumn(0).setWidth(tree.getColumn(0).getWidth() - 1);\n }\n });\n}\n"
|
"protected void _resolveProperties(NamedObj analyzer) throws KernelException {\n NamedObj toplevel = _toplevel();\n PropertyConstraintHelper toplevelHelper = (PropertyConstraintHelper) getHelper(toplevel);\n toplevelHelper.reinitialize();\n toplevelHelper._addDefaultConstraints(_getConstraintType(actorConstraintType.stringValue()));\n toplevelHelper._setConnectionConstraintType(_getConstraintType(connectionConstraintType.stringValue()), _getConstraintType(compositeConnectionConstraintType.stringValue()), _getConstraintType(fsmConstraintType.stringValue()), _getConstraintType(expressionASTNodeConstraintType.stringValue()));\n List<Inequality> constraintList = toplevelHelper.constraintList();\n List<Inequality> errorList = constraintList;\n List<Inequality> testList = errorList;\n _resolveProperties(toplevel, toplevelHelper, testList);\n if (!checkForErrors()) {\n return;\n int blockSize = errorList.size() / 2;\n WHILE_LOOP: while (blockSize >= 1) {\n for (int i = 0; i < errorList.size(); i += blockSize) {\n try {\n Set<Inequality> tmpSet = new HashSet(errorList.subList(i, Math.min(errorList.size(), i + blockSize)));\n testList = new LinkedList(errorList);\n testList.removeAll(tmpSet);\n if (testList.size() > 0) {\n _resolveProperties(toplevel, toplevelHelper, testList);\n checkResolutionErrors();\n }\n } catch (TypeConflictException ex) {\n System.err.println(\"String_Node_Str\");\n throw ex;\n } catch (PropertyResolutionException ex) {\n System.err.println(\"String_Node_Str\");\n errorList = testList;\n continue WHILE_LOOP;\n }\n }\n blockSize /= 2;\n }\n System.out.println(errorList);\n}\n"
|
"public void drawCylinder(RenderProps props, float[] coords0, float[] coords1, double r, boolean capped) {\n pushModelMatrix();\n RigidTransform3d lineRot = getLineTransform(coords0, coords1);\n mulModelMatrix(lineRot);\n double dx = coords1[0] - coords0[0];\n double dy = coords1[1] - coords0[1];\n double dz = coords1[2] - coords0[2];\n double len = Math.sqrt(dx * dx + dy * dy + dz * dz);\n scaleModelMatrix(r, r, len);\n maybeUpdateState(gl);\n int nslices = props.getPointSlices();\n GL3Object cylinder = myGLResources.getCylinder(gl, nslices, capped);\n cylinder.draw(gl, getRegularProgram(gl));\n popModelMatrix();\n}\n"
|
"protected void removeTempDemoProject() throws PersistenceException, CoreException {\n if (tempDemoProject != null) {\n ProjectManager.getInstance().getFolders(tempDemoProject.getEmfProject()).clear();\n final IProject project = ResourceModelUtils.getProject(tempDemoProject);\n project.delete(true, null);\n }\n}\n"
|
"private static void append0(CharSink sink, int val) {\n if (Math.abs(val) < 10) {\n sink.put('0');\n }\n Numbers.append(sink, val);\n}\n"
|
"public String _s(int res_id) {\n return OResource.string(mContext, res_id);\n}\n"
|
"public Prediction computeWeightedVote() {\n int n = votes.size();\n if (n > 0) {\n int numOutputs = outputAttributesCount.length;\n weights = new double[n][numOutputs];\n weightedVote = new MultiLabelPrediction(numOutputs);\n double[] sumError = new double[numOutputs];\n for (int o = 0; o < numOutputs; o++) {\n for (int i = 0; i < n; i++) {\n if (votes.get(i).hasVotesForAttribute(o) && errors.get(i) != null) {\n weights[i][o] = 1.0 / (errors.get(i)[o] + EPS);\n sumError[o] += weights[i][o];\n }\n }\n int numClasses = votes.get(0).numClasses(o);\n for (int i = 0; i < n; i++) {\n if (votes.get(i).hasVotesForAttribute(o)) {\n if (sumError[o] > 0)\n weights[i][o] /= sumError[o];\n else\n weights[i][o] = 1.0 / outputAttributesCount[o];\n }\n weightedVote.setVotes(o, votes.get(i).getVotes(o));\n }\n }\n }\n return weightedVote;\n}\n"
|
"private static void read(SBOLDocument doc, BufferedInputStream in) throws IOException, SBOLValidationException {\n so = new SequenceOntology();\n nextLine = null;\n featureMode = false;\n originMode = false;\n doc.addNamespace(URI.create(gbNamespace), gbPrefix);\n BufferedReader br = new BufferedReader(new InputStreamReader(in));\n String strLine;\n String id = \"String_Node_Str\";\n String version = \"String_Node_Str\";\n boolean featureMode = false;\n int featureCnt = 0;\n int refCnt = 0;\n StringBuilder sbSequence = new StringBuilder();\n String elements = null;\n String description = \"String_Node_Str\";\n URI type = ComponentDefinition.DNA;\n ComponentDefinition topCD = null;\n List<Annotation> annotations = new ArrayList<Annotation>();\n List<Annotation> nestedAnnotations = null;\n Annotation annotation = null;\n while ((strLine = readGenBankLine(br)) != null) {\n strLine = strLine.trim();\n if (strLine.startsWith(\"String_Node_Str\")) {\n String[] strSplit = strLine.split(\"String_Node_Str\");\n id = strSplit[1];\n if (strSplit[4].toUpperCase().contains(\"String_Node_Str\")) {\n type = ComponentDefinition.RNA;\n }\n annotation = new Annotation(new QName(gbNamespace, \"String_Node_Str\", gbPrefix), strSplit[4]);\n annotations.add(annotation);\n for (int i = 5; i < strSplit.length; i++) {\n if (strSplit[i].startsWith(\"String_Node_Str\") || strSplit[i].startsWith(\"String_Node_Str\")) {\n annotation = new Annotation(new QName(gbNamespace, \"String_Node_Str\", gbPrefix), strSplit[i]);\n } else if (strSplit[i].length() == 3) {\n annotation = new Annotation(new QName(gbNamespace, \"String_Node_Str\", gbPrefix), strSplit[i]);\n } else {\n annotation = new Annotation(new QName(gbNamespace, \"String_Node_Str\", gbPrefix), strSplit[i]);\n }\n annotations.add(annotation);\n }\n } else if (strLine.startsWith(\"String_Node_Str\")) {\n description = strLine.replaceFirst(\"String_Node_Str\", \"String_Node_Str\");\n } else if (strLine.startsWith(\"String_Node_Str\")) {\n String[] strSplit = strLine.split(\"String_Node_Str\");\n String accession = strSplit[1];\n id = accession;\n } else if (strLine.startsWith(\"String_Node_Str\")) {\n String[] strSplit = strLine.split(\"String_Node_Str\");\n version = strSplit[1].split(\"String_Node_Str\")[1];\n if (!id.equals(strSplit[1].split(\"String_Node_Str\")[0])) {\n throw new SBOLValidationException(\"String_Node_Str\");\n }\n if (strSplit.length > 2) {\n annotation = new Annotation(new QName(gbNamespace, \"String_Node_Str\", gbPrefix), strSplit[2]);\n annotations.add(annotation);\n }\n } else if (strLine.startsWith(\"String_Node_Str\")) {\n String annotationStr = strLine.replace(\"String_Node_Str\", \"String_Node_Str\").trim();\n annotation = new Annotation(new QName(gbNamespace, \"String_Node_Str\", gbPrefix), annotationStr);\n annotations.add(annotation);\n } else if (strLine.startsWith(\"String_Node_Str\")) {\n String annotationStr = strLine.replace(\"String_Node_Str\", \"String_Node_Str\").trim();\n annotation = new Annotation(new QName(gbNamespace, \"String_Node_Str\", gbPrefix), annotationStr);\n annotations.add(annotation);\n } else if (strLine.startsWith(\"String_Node_Str\")) {\n String annotationStr = strLine.replace(\"String_Node_Str\", \"String_Node_Str\").trim();\n annotation = new Annotation(new QName(gbNamespace, \"String_Node_Str\", gbPrefix), annotationStr);\n annotations.add(annotation);\n } else if (strLine.startsWith(\"String_Node_Str\")) {\n String annotationStr = strLine.replace(\"String_Node_Str\", \"String_Node_Str\").trim();\n nestedAnnotations = new ArrayList<Annotation>();\n Annotation labelAnnotation = new Annotation(new QName(gbNamespace, \"String_Node_Str\", gbPrefix), annotationStr);\n nestedAnnotations.add(labelAnnotation);\n URI nestedURI = URI.create(URIPrefix + \"String_Node_Str\" + id + \"String_Node_Str\" + refCnt);\n refCnt++;\n annotation = new Annotation(new QName(gbNamespace, \"String_Node_Str\", gbPrefix), new QName(gbNamespace, \"String_Node_Str\", gbPrefix), nestedURI, nestedAnnotations);\n annotations.add(annotation);\n } else if (strLine.startsWith(\"String_Node_Str\")) {\n String annotationStr = strLine.replace(\"String_Node_Str\", \"String_Node_Str\").trim();\n Annotation nestedAnnotation = new Annotation(new QName(gbNamespace, \"String_Node_Str\", gbPrefix), annotationStr);\n nestedAnnotations.add(nestedAnnotation);\n annotation.setNestedAnnotations(nestedAnnotations);\n } else if (strLine.startsWith(\"String_Node_Str\")) {\n String annotationStr = strLine.replace(\"String_Node_Str\", \"String_Node_Str\").trim();\n Annotation nestedAnnotation = new Annotation(new QName(gbNamespace, \"String_Node_Str\", gbPrefix), annotationStr);\n nestedAnnotations.add(nestedAnnotation);\n annotation.setNestedAnnotations(nestedAnnotations);\n } else if (strLine.startsWith(\"String_Node_Str\")) {\n String annotationStr = strLine.replace(\"String_Node_Str\", \"String_Node_Str\").trim();\n Annotation nestedAnnotation = new Annotation(new QName(gbNamespace, \"String_Node_Str\", gbPrefix), annotationStr);\n nestedAnnotations.add(nestedAnnotation);\n annotation.setNestedAnnotations(nestedAnnotations);\n } else if (strLine.startsWith(\"String_Node_Str\")) {\n String annotationStr = strLine.replace(\"String_Node_Str\", \"String_Node_Str\").trim();\n Annotation nestedAnnotation = new Annotation(new QName(gbNamespace, \"String_Node_Str\", gbPrefix), annotationStr);\n nestedAnnotations.add(nestedAnnotation);\n annotation.setNestedAnnotations(nestedAnnotations);\n } else if (strLine.startsWith(\"String_Node_Str\")) {\n String annotationStr = strLine.replace(\"String_Node_Str\", \"String_Node_Str\").trim();\n Annotation nestedAnnotation = new Annotation(new QName(gbNamespace, \"String_Node_Str\", gbPrefix), annotationStr);\n nestedAnnotations.add(nestedAnnotation);\n annotation.setNestedAnnotations(nestedAnnotations);\n } else if (strLine.startsWith(\"String_Node_Str\")) {\n String annotationStr = strLine.replace(\"String_Node_Str\", \"String_Node_Str\").trim();\n annotation = new Annotation(new QName(gbNamespace, \"String_Node_Str\", gbPrefix), annotationStr);\n annotations.add(annotation);\n } else if (strLine.startsWith(\"String_Node_Str\")) {\n topCD = doc.createComponentDefinition(id, version, type);\n topCD.addRole(SequenceOntology.ENGINEERED_REGION);\n if (!description.equals(\"String_Node_Str\")) {\n topCD.setDescription(description);\n }\n topCD.setAnnotations(annotations);\n featureMode = true;\n } else if (strLine.startsWith(\"String_Node_Str\")) {\n seqMode = true;\n featureMode = false;\n } else {\n if (featureMode) {\n if (strLine.startsWith(\"String_Node_Str\")) {\n String[] splitStr = strLine.split(\"String_Node_Str\");\n String tag = splitStr[0].replace(\"String_Node_Str\", \"String_Node_Str\");\n String value = splitStr[1];\n SequenceAnnotation sa = topCD.getSequenceAnnotation(\"String_Node_Str\" + (featureCnt - 1));\n annotation = new Annotation(new QName(gbNamespace, tag, gbPrefix), value);\n sa.addAnnotation(annotation);\n continue;\n }\n strLine = strLine.replace(\"String_Node_Str\", \"String_Node_Str\");\n String[] strSplit = strLine.split(\"String_Node_Str\");\n URI role = convertGenBanktoSO(strSplit[0]);\n ComponentDefinition feature = doc.createComponentDefinition(\"String_Node_Str\" + featureCnt, version, type);\n feature.addRole(role);\n String range = strSplit[1];\n OrientationType orientation = OrientationType.INLINE;\n if (range.startsWith(\"String_Node_Str\")) {\n orientation = OrientationType.REVERSECOMPLEMENT;\n range = range.replace(\"String_Node_Str\", \"String_Node_Str\").replace(\"String_Node_Str\", \"String_Node_Str\");\n }\n if (range.startsWith(\"String_Node_Str\")) {\n range = range.replace(\"String_Node_Str\", \"String_Node_Str\").replace(\"String_Node_Str\", \"String_Node_Str\");\n String[] ranges = range.split(\"String_Node_Str\");\n int rangeCnt = 0;\n SequenceAnnotation sa = null;\n for (String r : ranges) {\n r = r.replace(\"String_Node_Str\", \"String_Node_Str\").replace(\"String_Node_Str\", \"String_Node_Str\");\n String[] rangeSplit = r.split(\"String_Node_Str\");\n int start = Integer.parseInt(rangeSplit[0]);\n int end = Integer.parseInt(rangeSplit[1]);\n if (rangeCnt == 0) {\n sa = topCD.createSequenceAnnotation(\"String_Node_Str\" + featureCnt, \"String_Node_Str\" + rangeCnt, start, end, orientation);\n sa.setComponent(\"String_Node_Str\" + featureCnt);\n } else if (sa != null) {\n sa.addRange(\"String_Node_Str\" + rangeCnt, start, end, orientation);\n }\n rangeCnt++;\n }\n } else if (range.contains(\"String_Node_Str\")) {\n String[] rangeSplit = range.split(\"String_Node_Str\");\n int at = Integer.parseInt(rangeSplit[0]);\n SequenceAnnotation sa = topCD.createSequenceAnnotation(\"String_Node_Str\" + featureCnt, \"String_Node_Str\", at, orientation);\n sa.setComponent(\"String_Node_Str\" + featureCnt);\n } else {\n range = range.replace(\"String_Node_Str\", \"String_Node_Str\").replace(\"String_Node_Str\", \"String_Node_Str\");\n String[] rangeSplit = range.split(\"String_Node_Str\");\n int start = Integer.parseInt(rangeSplit[0]);\n int end = Integer.parseInt(rangeSplit[1]);\n if (start > end) {\n int temp = start;\n start = end;\n end = temp;\n }\n SequenceAnnotation sa = topCD.createSequenceAnnotation(\"String_Node_Str\" + featureCnt, \"String_Node_Str\", start, end, orientation);\n sa.setComponent(\"String_Node_Str\" + featureCnt);\n }\n featureCnt++;\n }\n if (seqMode) {\n String[] strSplit = strLine.split(\"String_Node_Str\");\n for (int i = 1; i < strSplit.length; i++) {\n elements += strSplit[i];\n }\n }\n }\n }\n Sequence sequence = doc.createSequence(id + \"String_Node_Str\", version, elements, Sequence.IUPAC_DNA);\n topCD.addSequence(sequence);\n createSubComponentDefinitions(doc, topCD, type, elements, version);\n br.close();\n}\n"
|
"public boolean onCommand(CommandSender slapper, Command command, String label, String[] split) {\n if (plugin.usePermissions) {\n if (!(plugin.permissionHandler.has((Player) slapper, \"String_Node_Str\"))) {\n slapper.sendMessage(ChatColor.RED + \"String_Node_Str\");\n return true;\n }\n } else if (!(slapper.isOp())) {\n slapper.sendMessage(ChatColor.RED + \"String_Node_Str\");\n return true;\n }\n String slapperName;\n if (slapper instanceof Player) {\n Player slapperCast = (Player) slapper;\n slapperName = slapperCast.getDisplayName();\n } else if (slapper instanceof ConsoleCommandSender) {\n slapperName = \"String_Node_Str\";\n } else {\n slapperName = \"String_Node_Str\";\n }\n if (split.length == 1 || split.length == 2) {\n List<Player> matchedPlayers = plugin.getServer().matchPlayer(split[0]);\n String slappeeName = split[0];\n if (matchedPlayers.size() == 1) {\n if (split.length == 1) {\n slapPlayer(matchedPlayers.get(0), 2, slapperName);\n } else {\n float force;\n try {\n force = Float.parseFloat(split[1]);\n } catch (NumberFormatException e) {\n slapper.sendMessage(\"String_Node_Str\");\n return true;\n }\n if (force > 10) {\n force = 10;\n } else if (force <= 0) {\n force = 0.1f;\n }\n slapPlayer(matchedPlayers.get(0), force, slapperName);\n }\n } else if (matchedPlayers.isEmpty()) {\n slapper.sendMessage(\"String_Node_Str\" + slappeeName + \"String_Node_Str\");\n } else if (matchedPlayers.size() > 1) {\n slapper.sendMessage(slappeeName + \"String_Node_Str\");\n } else {\n slapper.sendMessage(\"String_Node_Str\");\n }\n return true;\n } else {\n return false;\n }\n}\n"
|
"public Object getNewObject() {\n OPMConsumptionEventLink link = OPMFactory.eINSTANCE.createOPMConsumptionEventLink();\n link.setId(OPMIdManager.getNextId());\n return link;\n}\n"
|
"public void startElement(String uri, String localname, String qname, Attributes attrs) throws SAXException {\n Element ele = null;\n if (stack.size() > 0) {\n ele = (Element) stack.getFirst();\n if (ele == null) {\n return;\n }\n }\n Tag t = getTag(localname, qname);\n stack.addFirst(t.processTag(ele, attrs));\n}\n"
|
"public Set<String> getIdentifiers() throws GuacamoleException {\n return permissionCheckService.retrieveConnectionNames(user_id, MySQLConstants.CONNECTION_READ);\n}\n"
|
"private void shareTorrentFile(BTData btData, File torrentFile) {\n if (SharingSettings.SHARE_DOWNLOADED_FILES_IN_NON_SHARED_DIRECTORIES.getValue() && !btData.isPrivate()) {\n final File tFile = getSharedTorrentMetaDataFile(btData);\n fileManager.getGnutellaFileList().remove(tFile);\n File backup = null;\n if (tFile.exists()) {\n backup = new File(tFile.getParent(), tFile.getName().concat(\"String_Node_Str\"));\n FileUtils.forceRename(tFile, backup);\n }\n if (FileUtils.copy(torrentFile, tFile)) {\n fileManager.getGnutellaFileList().add(tFile);\n } else {\n if (backup != null) {\n if (FileUtils.forceRename(backup, tFile)) {\n fileManager.getGnutellaFileList().add(tFile);\n }\n }\n }\n }\n}\n"
|
"public void addServerAndSync(ServerSessionManager session) throws InterruptedException {\n synchronized (this) {\n logger.warning(\"String_Node_Str\" + session.getServerURL());\n synchronized (avatarConfigServers) {\n if (avatarConfigServers.containsKey(session) == true) {\n logger.info(\"String_Node_Str\" + session.getServerURL() + \"String_Node_Str\");\n return;\n }\n }\n ServerSyncThread t = null;\n try {\n logger.info(\"String_Node_Str\" + session.getServerURL());\n t = new ServerSyncThread(session);\n t.scheduleSync(true);\n logger.info(\"String_Node_Str\" + session.getServerURL() + \"String_Node_Str\");\n } catch (ContentRepositoryException excp) {\n logger.log(Level.WARNING, \"String_Node_Str\" + \"String_Node_Str\" + session.getServerURL(), excp);\n return;\n }\n synchronized (avatarConfigServers) {\n avatarConfigServers.put(session, t);\n logger.info(\"String_Node_Str\" + session.getServerURL() + \"String_Node_Str\");\n }\n }\n}\n"
|
"public void onTimeSet(TimePicker view, int hour, int minute) {\n Log.v(TAG, \"String_Node_Str\" + (hour < 10 ? \"String_Node_Str\" + hour : hour) + \"String_Node_Str\" + (minute < 10 ? \"String_Node_Str\" + minute : minute));\n mInputEditText.setText(\"String_Node_Str\" + (hour < 10 ? \"String_Node_Str\" + hour : hour) + \"String_Node_Str\" + (minute < 10 ? \"String_Node_Str\" + minute : minute));\n mPickableInstance.onPickerDismissed();\n}\n"
|
"public void optimize() {\n boolean firstPassDFA = useDFA() && !config.doOptimizeFastOnly();\n if (firstPassDFA) {\n executor.dataflowAnalysis(false);\n }\n executor.buildCallGraph(firstPassDFA);\n executor.dumpCallgraph(\"String_Node_Str\");\n executor.removeDebugAttributes();\n executor.cleanupMethodCode();\n executor.performSimpleInline();\n if (useDFA()) {\n executor.dataflowAnalysis(true);\n }\n executor.buildCallGraph(useDFA());\n if (useWCA()) {\n wcetTool.rebuildCallGraph();\n } else {\n logger.info(\"String_Node_Str\");\n }\n executor.performGreedyOptimizer();\n executor.cleanupMethodCode();\n executor.removeUnusedMembers();\n executor.relinkInvokesuper();\n executor.cleanupConstantPool();\n}\n"
|
"public void fire() throws IllegalActionException {\n super.fire();\n if (input.getWidth() > 0 && input.hasToken(0)) {\n if (_tableau != null) {\n _tableau.close();\n _tableau = null;\n }\n Entity model = ((ActorToken) input.get(0)).getEntity();\n Configuration configuration = (Configuration) Configuration.findEffigy(toplevel()).toplevel();\n try {\n _parser.reset();\n NamedObj newModel = _parser.parse(model.exportMoML());\n _tableau = configuration.openInstance(newModel);\n } catch (NameDuplicationException e) {\n throw new IllegalActionException(this, e, \"String_Node_Str\");\n }\n }\n}\n"
|
"public void onSuccess(List<ErrorTimeSlotData> dataRanges) {\n String serviceOpName = selectionContext.getSelection(ObjectType.ServiceName);\n if (selectionContext.getSelection(ObjectType.OperationName) != null) {\n serviceOpName += \"String_Node_Str\" + selectionContext.getSelection(ObjectType.OperationName);\n }\n String graphTitle = ConsoleUtil.messages.graphTitle(\"String_Node_Str\", serviceOpName, durationHrs);\n ErrorPresenter.this.view.activate();\n ErrorPresenter.this.view.setServiceApplicationErrorTrendData(dataRanges, minAggregationPeriod, durationHrs, graphTitle);\n}\n"
|
"public boolean execute(final PlotPlayer player, String... args) {\n Plot plot;\n String world;\n if (player != null) {\n final Location loc = player.getLocation();\n world = loc.getWorld();\n if (!PlotSquared.isPlotWorld(world)) {\n MainUtil.sendMessage(player, C.NOT_IN_PLOT_WORLD);\n return false;\n }\n plot = MainUtil.getPlot(loc);\n if (plot == null) {\n return !sendMessage(player, C.NOT_IN_PLOT);\n }\n } else {\n if (args.length < 2) {\n MainUtil.sendMessage(null, C.INFO_SYNTAX_CONSOLE);\n return false;\n }\n final PlotWorld plotworld = PlotSquared.getPlotWorld(args[0]);\n if (plotworld == null) {\n MainUtil.sendMessage(player, C.NOT_VALID_WORLD);\n return false;\n }\n try {\n final String[] split = args[1].split(\"String_Node_Str\");\n final PlotId id = new PlotId(Integer.parseInt(split[0]), Integer.parseInt(split[1]));\n plot = MainUtil.getPlot(plotworld.worldname, id);\n if (plot == null) {\n MainUtil.sendMessage(player, C.NOT_VALID_PLOT_ID);\n return false;\n }\n world = args[0];\n if (args.length == 3) {\n args = new String[] { args[2] };\n } else {\n args = new String[0];\n }\n } catch (final Exception e) {\n MainUtil.sendMessage(player, C.INFO_SYNTAX_CONSOLE);\n return false;\n }\n }\n if ((args.length == 1) && args[0].equalsIgnoreCase(\"String_Node_Str\")) {\n new InfoInventory(plot, player).build().display();\n return true;\n }\n final boolean hasOwner = plot.hasOwner();\n boolean containsEveryone;\n boolean trustedEveryone;\n {\n containsEveryone = (plot.helpers != null) && plot.helpers.contains(DBFunc.everyone);\n trustedEveryone = (plot.trusted != null) && plot.trusted.contains(DBFunc.everyone);\n }\n if (!hasOwner && !containsEveryone && !trustedEveryone) {\n MainUtil.sendMessage(player, C.PLOT_INFO_UNCLAIMED, (plot.id.x + \"String_Node_Str\" + plot.id.y));\n return true;\n }\n String owner = \"String_Node_Str\";\n if (plot.owner_ == null) {\n owner = \"String_Node_Str\";\n } else {\n owner = getPlayerList(plot.getOwners());\n }\n String info = C.PLOT_INFO.s();\n if (args.length == 1) {\n info = getCaption(args[0].toLowerCase());\n if (info == null) {\n MainUtil.sendMessage(player, \"String_Node_Str\");\n return false;\n }\n }\n info = format(info, world, plot, player);\n MainUtil.sendMessage(player, C.PLOT_INFO_HEADER);\n MainUtil.sendMessage(player, info, false);\n return true;\n}\n"
|
"protected void onResume() {\n super.onResume();\n if (CommCareApplication._().getCurrentApp() != null) {\n platform = CommCareApplication._().getCommCarePlatform();\n }\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {\n refreshActionBar();\n }\n dispatchHomeScreen();\n}\n"
|
"public void addItemModel(Item item, int meta, ModelResourceLocation location) {\n ModelLoader.setCustomModelResourceLocation(item, meta, location);\n}\n"
|
"public void setTokenPublisher(TokenPublisher tokenPublisher) {\n _tokenPublisher = tokenPublisher;\n}\n"
|
"public void listOfStrings() {\n ListSchema listSchema = deserialize(\"String_Node_Str\", ListSchema.class);\n List<String> stringList = listSchema.strings();\n assertEquals(\"String_Node_Str\", stringList.get(0));\n assertEquals(\"String_Node_Str\", stringList.get(1));\n assertEquals(\"String_Node_Str\", stringList.get(2));\n}\n"
|
"protected void saveStates() {\n RunTimeContext rtc = context.line.getRunTimeContext();\n if (context.line.isLastRuntimeSeriesInAxis()) {\n rtc.putState(STACKED_SERIES_LOCATION_KEY, null);\n rtc.putState(AREA_ENVELOPS, null);\n } else {\n List<double[]> list = new ArrayList<double[]>();\n for (Location lo : loa) {\n double[] l = new double[] { lo.getX(), lo.getY() };\n list.add(l);\n }\n rtc.putState(STACKED_SERIES_LOCATION_KEY, list);\n rtc.putState(AREA_ENVELOPS, envelops);\n }\n}\n"
|
"public void formSaveCallback() {\n if (!hasSaved) {\n savingFormOnKeySessionExpiration = true;\n saveDataToDisk(EXIT, false, null, true);\n }\n}\n"
|
"public List<CssDeclaration> getCssDeclarations(IElement element, MediaDeviceDescription deviceDescription) {\n List<CssRuleSet> ruleSets = getCssRuleSets(element, deviceDescription);\n Map<String, CssDeclaration> declarations = new LinkedHashMap<>();\n Collections.sort(ruleSets, new CssRuleSetComparator());\n for (CssRuleSet ruleSet : ruleSets) {\n populateDeclarationsMap(ruleSet.getNormalDeclarations(), declarations);\n }\n for (CssRuleSet ruleSet : ruleSets) {\n populateDeclarationsMap(ruleSet.getImportantDeclarations(), declarations);\n }\n return new ArrayList<>(declarations.values());\n}\n"
|
"public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_filter);\n receivedFilters = getIntent().getStringArrayExtra(INPUT_FILTER_ARRAY);\n currentDistance = getIntent().getIntExtra(INPUT_DISTANCE, DEFAULT_DISTANCE_IN_KILOMETERS);\n setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_multiple_choice, FilterManager.availableFilters));\n getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);\n checkInputFilters();\n distanceSeekBar = (SeekBar) findViewById(R.id.distance_seekbar);\n distanceTextView = (TextView) findViewById(R.id.distance_textview);\n distanceSeekBar.setMax(MAX_DISTANCE_IN_KILOMETERS - 1);\n distanceSeekBar.setOnSeekBarChangeListener(listener);\n updateUI();\n}\n"
|
"public void run() {\n String prefix = \"String_Node_Str\";\n int index = 1;\n while (true) {\n RpcObject rpc = createRpc(prefix + index);\n logger.info(\"String_Node_Str\" + rpc);\n connector.sendRpcObject(rpc, 10000);\n index++;\n try {\n Thread.currentThread().sleep(10000L);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n}\n"
|
"public void exceptionOnSchedule() throws JobExecutionException {\n JobDetail detail = job.scheduleWithForceUpdate(consumer);\n assertNotNull(detail);\n when(ctx.getMergedJobDataMap()).thenReturn(detail.getJobDataMap());\n when(curator.lockAndLoadByUuid(consumerUuid)).thenReturn(consumer);\n when(rules.getStatus(eq(consumer), any(Date.class), eq(false), eq(false))).thenThrow(new RuleExecutionException(\"String_Node_Str\"));\n job.execute(ctx);\n}\n"
|
"private RunOverview[] createModel(File file) {\n Gson gson = new Gson();\n RunOverview[] fromJson;\n try (Reader r = Files.newReader(file, Charset.defaultCharset())) {\n fromJson = gson.fromJson(r, RunOverview[].class);\n Arrays.sort(fromJson, Collections.reverseOrder());\n return fromJson;\n } catch (JsonSyntaxException | JsonIOException | IOException e) {\n log.error(\"String_Node_Str\" + file.getAbsolutePath(), e);\n return new RunOverview[0];\n }\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.