content stringlengths 40 137k |
|---|
"protected RT setException(Exception exception) {\n if (exception == null) {\n throw new IllegalArgumentException(\"String_Node_Str\");\n }\n if (!isExceptionType()) {\n throw new IllegalArgumentException(\"String_Node_Str\" + type);\n }\n this.exception = exception;\n return (R) this;\n}\n"
|
"public static void startCommandLineWebsiteChecking() {\n PAXChecker.continueProgram(new Runnable() {\n public void run() {\n String input;\n while (true) {\n try {\n input = myScanner.nextLine();\n } catch (Exception e) {\n System.out.println(\"String_Node_Str\");\n continue;\n }\n switch(input.toLowerCase()) {\n case \"String_Node_Str\":\n case \"String_Node_Str\":\n case \"String_Node_Str\":\n System.exit(0);\n break;\n case \"String_Node_Str\":\n case \"String_Node_Str\":\n case \"String_Node_Str\":\n case \"String_Node_Str\":\n PAXChecker.sendTestEmail();\n break;\n case \"String_Node_Str\":\n case \"String_Node_Str\":\n Audio.playAlarm();\n break;\n case \"String_Node_Str\":\n case \"String_Node_Str\":\n forceRefresh = true;\n break;\n case \"String_Node_Str\":\n case \"String_Node_Str\":\n UpdateHandler.loadVersionNotes();\n UpdateHandler.autoUpdate();\n break;\n case \"String_Node_Str\":\n case \"String_Node_Str\":\n case \"String_Node_Str\":\n case \"String_Node_Str\":\n case \"String_Node_Str\":\n System.out.println(\"String_Node_Str\");\n java.util.Iterator<Email.EmailAddress> it = Email.getAddressList().iterator();\n while (it.hasNext()) {\n System.out.println(it.next().getCompleteAddress());\n }\n break;\n case \"String_Node_Str\":\n Browser.openLinkInBrowser(\"String_Node_Str\");\n break;\n case \"String_Node_Str\":\n case \"String_Node_Str\":\n case \"String_Node_Str\":\n case \"String_Node_Str\":\n case \"String_Node_Str\":\n System.out.println(UpdateHandler.getVersionNotes());\n break;\n default:\n if (input.toLowerCase().startsWith(\"String_Node_Str\") || input.toLowerCase().startsWith(\"String_Node_Str\")) {\n Email.addEmailAddress(input.substring(input.indexOf(\"String_Node_Str\") + 1).trim());\n continue;\n } else if (input.toLowerCase().startsWith(\"String_Node_Str\") || input.toLowerCase().startsWith(\"String_Node_Str\")) {\n System.out.println(UpdateHandler.getVersionNotes(input.substring(input.indexOf(\"String_Node_Str\") + 1)).trim());\n continue;\n }\n System.out.println(\"String_Node_Str\" + input.toLowerCase());\n System.out.println(\"String_Node_Str\");\n System.out.println(\"String_Node_Str\");\n System.out.println(\"String_Node_Str\");\n System.out.println(\"String_Node_Str\");\n System.out.println(\"String_Node_Str\");\n System.out.println(\"String_Node_Str\");\n System.out.println(\"String_Node_Str\");\n System.out.println(\"String_Node_Str\");\n System.out.println(\"String_Node_Str\");\n System.out.println(\"String_Node_Str\");\n System.out.println(\"String_Node_Str\");\n break;\n }\n }\n }\n }, \"String_Node_Str\");\n PAXChecker.continueProgram(new Runnable() {\n public void run() {\n int seconds = getRefreshTime();\n do {\n long startMS = System.currentTimeMillis();\n if (Paxsite.isPAXWebsiteUpdated()) {\n final String link = Paxsite.getCurrentButtonLink();\n System.out.println(\"String_Node_Str\" + link);\n Email.sendEmailInBackground(\"String_Node_Str\", \"String_Node_Str\" + link);\n Browser.openLinkInBrowser(link);\n Audio.playAlarm();\n break;\n } else if (Showclix.isShowclixUpdated()) {\n final String link = Showclix.getShowclixLink();\n System.out.println(\"String_Node_Str\" + link);\n Email.sendEmailInBackground(\"String_Node_Str\", \"String_Node_Str\" + link);\n Browser.openLinkInBrowser(link);\n Audio.playAlarm();\n break;\n }\n System.out.println(\"String_Node_Str\" + DataTracker.getDataUsedMB() + \"String_Node_Str\");\n while (System.currentTimeMillis() - startMS < (seconds * 1000)) {\n if (forceRefresh) {\n forceRefresh = false;\n break;\n }\n try {\n Thread.sleep(100);\n } catch (InterruptedException iE) {\n }\n }\n } while (true);\n System.out.println(\"String_Node_Str\");\n }\n });\n}\n"
|
"public DataDistribution<VehicleState> createInitialParticles(int numParticles) {\n final StandardRoadTrackingFilter trackingFilter = new StandardRoadTrackingFilter(parameters.getObsVariance(), parameters.getOffRoadStateVariance(), parameters.getOnRoadStateVariance());\n final MultivariateGaussian initialBelief = trackingFilter.createInitialLearnedObject();\n final Vector xyPoint = initialObservation.getProjectedPoint();\n initialBelief.setMean(VectorFactory.getDefault().copyArray(new double[] { xyPoint.getElement(0), 0d, xyPoint.getElement(1), 0d }));\n final List<StreetEdge> initialEdges = inferredGraph.getNearbyEdges(initialBelief, trackingFilter);\n final DataDistribution<VehicleState> initialDist = new DefaultDataDistribution<VehicleState>(numParticles);\n final Set<InferredPathEntry> evaluatedPaths = Sets.newHashSet();\n if (!initialEdges.isEmpty()) {\n for (final Edge nativeEdge : initialEdges) {\n final InferredEdge edge = inferredGraph.getInferredEdge(nativeEdge);\n final PathEdge pathEdge = PathEdge.getEdge(edge, 0d);\n final InferredPath path = InferredPath.getInferredPath(pathEdge);\n evaluatedPaths.add(new InferredPathEntry(path, null, null, null, Double.NEGATIVE_INFINITY));\n final VehicleState state = new VehicleState(this.inferredGraph, initialObservation, pathEdge.getInferredEdge(), parameters);\n final VehicleStateConditionalParams edgeLoc = new VehicleStateConditionalParams(pathEdge, initialObservation.getProjectedPoint());\n final double lik = state.getProbabilityFunction().evaluate(edgeLoc);\n initialDist.increment(state, lik);\n }\n }\n final VehicleState state = new VehicleState(this.inferredGraph, initialObservation, InferredEdge.getEmptyEdge(), parameters);\n final double lik = state.getProbabilityFunction().evaluate(new VehicleStateConditionalParams(initialObservation.getProjectedPoint()));\n initialDist.increment(state, lik);\n final DataDistribution<VehicleState> retDist = new DefaultDataDistribution<VehicleState>(initialDist.sample(threadRandom.get(), numParticles));\n return retDist;\n}\n"
|
"public Collection<TreeFacetField> prune(Collection<TreeFacetField> unprunedTrees) {\n Collection<TreeFacetField> prunedTrees = new TreeSet<>(Comparator.comparingLong(TreeFacetField::getCount).thenComparing(TreeFacetField::getValue).reversed());\n Collection<TreeFacetField> incoming = unprunedTrees.stream().map(TreeFacetField::clone).collect(Collectors.toList());\n long total = getNodeTotal(incoming);\n int itCount = 1;\n while (prunedTrees.size() < datapoints && !incoming.isEmpty()) {\n int minCount = Math.round((total / datapoints) / itCount);\n if (minCount == 0 && Math.round((total / datapoints) / (itCount - 1)) > 1) {\n break;\n }\n prunedTrees.addAll(getNodesWithCount(incoming, minCount));\n itCount++;\n }\n if (prunedTrees.size() > datapoints) {\n prunedTrees = prunedTrees.stream().limit(datapoints).collect(Collectors.toList());\n }\n incoming = new LinkedList<>(unprunedTrees);\n trimIncomingNodes(incoming, prunedTrees, 0);\n TreeFacetField otherNode = buildOtherNode(incoming);\n prunedTrees.add(otherNode);\n return prunedTrees;\n}\n"
|
"public void ejectFuel(boolean dumpAll, CoordTriplet destination) {\n int amtEjected = 0;\n String fuelReactantType = fuelContainer.getFuelType();\n if (fuelReactantType == null) {\n return;\n }\n int minimumReactantAmount = Reactants.getMinimumReactantToProduceSolid(fuelReactantType);\n if (fuelContainer.getFuelAmount() >= minimumReactantAmount) {\n for (TileEntityReactorAccessPort port : attachedAccessPorts) {\n if (fuelContainer.getFuelAmount() < minimumReactantAmount) {\n continue;\n }\n if (!port.isConnected()) {\n continue;\n }\n if (destination != null && !destination.equals(port.xCoord, port.yCoord, port.zCoord)) {\n continue;\n }\n int reactantEjected = port.emitReactant(fuelReactantType, fuelContainer.getFuelAmount());\n fuelContainer.dumpFuel(reactantEjected);\n amtEjected += reactantEjected;\n }\n }\n if (dumpAll) {\n amtEjected += fuelContainer.getFuelAmount();\n fuelContainer.setFuel(null);\n }\n if (amtEjected > 0) {\n markReferenceCoordForUpdate();\n markReferenceCoordDirty();\n }\n}\n"
|
"public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {\n int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);\n if (meta == 1) {\n return myTank.fill(resource, doFill);\n } else if (meta > 0 && hasPrimary()) {\n return getPrimaryTileEntity().fill(from, resource, doFill);\n } else {\n return 0;\n }\n}\n"
|
"public JsonObject switchUserOrg(int orgId) {\n Map<String, String> headers = new HashMap<String, String>();\n String grafanaCookie = getUserCookies();\n headers.put(\"String_Node_Str\", grafanaCookie);\n Map<String, String> grafanaResponseCookies = new HashMap<String, String>();\n String grafanaCurrentOrg = getGrafanaCurrentOrg(headers);\n grafanaResponseCookies.put(\"String_Node_Str\", grafanaCurrentOrg);\n String grafanaCurrentOrgRole = getCurrentOrgRole(headers, grafanaCurrentOrg);\n grafanaResponseCookies.put(\"String_Node_Str\", grafanaCurrentOrgRole);\n httpRequest.setAttribute(\"String_Node_Str\", grafanaResponseCookies);\n Authentication auth = SecurityContextHolder.getContext().getAuthentication();\n List<GrantedAuthority> updatedAuthorities = new ArrayList<>(auth.getAuthorities());\n updatedAuthorities.add(SpringAuthorityUtil.getSpringAuthorityRole(grafanaCurrentOrgRole));\n Authentication newAuth = new UsernamePasswordAuthenticationToken(auth.getPrincipal(), auth.getCredentials(), updatedAuthorities);\n SecurityContextHolder.getContext().setAuthentication(newAuth);\n String apiUrl = ApplicationConfigProvider.getInstance().getGrafana().getGrafanaEndpoint() + \"String_Node_Str\" + orgId;\n ClientResponse response = RestHandler.doPost(apiUrl, null, headers);\n return PlatformServiceUtil.buildSuccessResponseWithData(new JsonParser().parse(response.getEntity(String.class)));\n}\n"
|
"public void startPage(IPageContent page) throws IOException, BirtException {\n if (previousPage != null) {\n outputPrePageProperties();\n previousPage = page;\n context.resetWidth();\n } else {\n previousPage = page;\n boolean isRtl = false;\n String creator = null;\n String title = null;\n String comments = null;\n String subject = null;\n if (reportContent != null) {\n ReportDesignHandle designHandle = reportContent.getDesign().getReportDesign();\n creator = designHandle.getAuthor();\n title = reportContent.getTitle();\n description = designHandle.getDescription();\n subject = designHandle.getSubject();\n IContent rootContent = reportContent.getRoot();\n isRtl = rootContent != null && rootContent.isRTL();\n }\n wordWriter.start(isRtl, creator, title, description, subject);\n drawDocumentBackground();\n }\n computePageProperties(page);\n context.addWidth(contentWidth);\n wordWriter.startPage();\n}\n"
|
"protected List<List<DoubleSolution>> evaluateSwarm(List<List<DoubleSolution>> swarm) {\n List<List<DoubleSolution>> swarms = new ArrayList<>(problem.getNumberOfObjectives());\n for (int i = 0; i < psoIsland.size(); i++) {\n swarms.add(i, psoIsland.get(i).evaluateSwarm(swarmList.get(i)));\n updateArchive(swarmList.get(i));\n }\n return swarms;\n}\n"
|
"public boolean equals(Object obj) {\n if (obj == null) {\n return false;\n }\n if (getClass() != obj.getClass()) {\n return false;\n }\n final LogootDocumentChar other = (LogootDocumentChar) obj;\n if (this.idTable != other.idTable && (this.idTable == null || !this.idTable.equals(other.idTable))) {\n return false;\n }\n if (this.documentStr != other.documentStr && (this.documentStr == null || !this.documentStr.equals(other.documentStr))) {\n return false;\n }\n return true;\n}\n"
|
"public Boolean call() throws Exception {\n if (importFiles.isEmpty()) {\n throw new OseeArgumentException(\"String_Node_Str\");\n }\n List<IOseeBranch> branches = new LinkedList<IOseeBranch>();\n for (String branchIdString : branchIds) {\n IOseeBranch branch = branchCache.getById(Integer.parseInt(branchIdString));\n branches.add(branch);\n }\n for (String fileToImport : importFiles) {\n URI uri = new URI(\"String_Node_Str\" + fileToImport);\n console.writeln(\"String_Node_Str\", uri);\n Callable<URI> callable = orcsBranch.importBranch(uri, branches, options);\n callable.call();\n checkForCancelled();\n }\n return Boolean.TRUE;\n}\n"
|
"protected void prepareHandlers(final Context context) {\n super.prepareHandlers(context);\n addHandler(Attributes.TextView.HTML, new StringAttributeProcessor<T>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, T view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n view.setText(Html.fromHtml(attributeValue));\n }\n });\n addHandler(Attributes.TextView.Text, new StringAttributeProcessor<T>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, T view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n view.setText(attributeValue);\n }\n });\n addHandler(Attributes.TextView.DrawablePadding, new StringAttributeProcessor<T>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, T view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n view.setCompoundDrawablePadding(ParseHelper.parseDimension(attributeValue, context));\n }\n });\n addHandler(Attributes.TextView.TextSize, new DimensionAttributeProcessor<T>() {\n\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, T view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n view.setTextSize(ParseHelper.parseDimension(attributeValue, context));\n }\n });\n addHandler(Attributes.TextView.Gravity, new StringAttributeProcessor<T>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, T view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n view.setGravity(ParseHelper.parseGravity(attributeValue));\n }\n });\n addHandler(Attributes.TextView.TextColor, new ColorResourceProcessor<T>() {\n public void setColor(T view, int color) {\n view.setTextColor(color);\n }\n public void setColor(T view, ColorStateList colors) {\n view.setTextColor(colors);\n }\n });\n addHandler(Attributes.TextView.TextColorHint, new ColorResourceProcessor<T>() {\n public void setColor(T view, int color) {\n view.setHintTextColor(color);\n }\n public void setColor(T view, ColorStateList colors) {\n view.setHintTextColor(colors);\n }\n });\n addHandler(Attributes.TextView.TextColorLink, new ColorResourceProcessor<T>() {\n public void setColor(T view, int color) {\n view.setLinkTextColor(color);\n }\n public void setColor(T view, ColorStateList colors) {\n view.setLinkTextColor(colors);\n }\n });\n addHandler(Attributes.TextView.TextColorHighLight, new ColorResourceProcessor<T>() {\n public void setColor(T view, int color) {\n view.setHighlightColor(color);\n }\n public void setColor(T view, ColorStateList colors) {\n }\n });\n addHandler(Attributes.TextView.DrawableLeft, new DrawableResourceProcessor<T>(context) {\n public void setDrawable(T view, Drawable drawable) {\n Drawable[] compoundDrawables = view.getCompoundDrawables();\n view.setCompoundDrawablesWithIntrinsicBounds(drawable, compoundDrawables[1], compoundDrawables[2], compoundDrawables[3]);\n }\n });\n addHandler(Attributes.TextView.DrawableTop, new DrawableResourceProcessor<T>(context) {\n public void setDrawable(T view, Drawable drawable) {\n Drawable[] compoundDrawables = view.getCompoundDrawables();\n view.setCompoundDrawablesWithIntrinsicBounds(compoundDrawables[0], drawable, compoundDrawables[2], compoundDrawables[3]);\n }\n });\n addHandler(Attributes.TextView.DrawableRight, new DrawableResourceProcessor<T>(context) {\n public void setDrawable(T view, Drawable drawable) {\n Drawable[] compoundDrawables = view.getCompoundDrawables();\n view.setCompoundDrawablesWithIntrinsicBounds(drawable, compoundDrawables[1], drawable, compoundDrawables[3]);\n }\n });\n addHandler(Attributes.TextView.DrawableBottom, new DrawableResourceProcessor<T>(context) {\n public void setDrawable(T view, Drawable drawable) {\n Drawable[] compoundDrawables = view.getCompoundDrawables();\n view.setCompoundDrawablesWithIntrinsicBounds(drawable, compoundDrawables[1], compoundDrawables[2], drawable);\n }\n });\n addHandler(Attributes.TextView.MaxLines, new StringAttributeProcessor<T>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, T view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n view.setMaxLines(ParseHelper.parseInt(attributeValue));\n }\n });\n addHandler(Attributes.TextView.Ellipsize, new StringAttributeProcessor<T>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, T view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n Enum ellipsize = ParseHelper.parseEllipsize(attributeValue);\n view.setEllipsize((android.text.TextUtils.TruncateAt) ellipsize);\n }\n });\n addHandler(Attributes.TextView.PaintFlags, new StringAttributeProcessor<T>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, T view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n if (attributeValue.equals(\"String_Node_Str\"))\n view.setPaintFlags(view.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);\n }\n });\n addHandler(Attributes.TextView.Prefix, new StringAttributeProcessor<T>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, T view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n view.setText(attributeValue + view.getText());\n }\n });\n addHandler(Attributes.TextView.Suffix, new StringAttributeProcessor<T>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, T view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n view.setText(view.getText() + attributeValue);\n }\n });\n addHandler(Attributes.TextView.TextStyle, new StringAttributeProcessor<T>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, T view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n int typeface = ParseHelper.parseTypeFace(attributeValue);\n view.setTypeface(Typeface.defaultFromStyle(typeface));\n }\n });\n addHandler(Attributes.TextView.SingleLine, new StringAttributeProcessor<T>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, T view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n view.setSingleLine(ParseHelper.parseBoolean(attributeValue));\n }\n });\n addHandler(Attributes.TextView.TextAllCaps, new StringAttributeProcessor<T>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, T view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {\n view.setAllCaps(ParseHelper.parseBoolean(attributeValue));\n }\n }\n });\n addHandler(Attributes.TextView.Hint, new StringAttributeProcessor<T>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, T view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n view.setHint(attributeValue);\n }\n });\n}\n"
|
"public void setOutputValue(String varName, double value) throws NoRoomException, IllegalActionException {\n for (IOPort port : (List<IOPort>) outputPortList()) {\n if (port != output) {\n if (port.getName().equals(varName)) {\n _bufferOutputValue.add(new Object[] { port, new DoubleToken(value) });\n }\n }\n }\n}\n"
|
"protected void runTableAnalysis(String tableName) {\n Package parentPack = (Package) currentSelectionSchemaIndicator.getAnalyzedElement();\n TdTable tdTable = getTable(parentPack, tableName);\n if (null == tdTable) {\n FolderNodeHelper.getTableFolderNode(parentPack).loadChildren();\n tdTable = getTable(parentPack, tableName);\n }\n try {\n List<TdTable> tdTables = DqRepositoryViewService.getTables(tdDataProvider, catalogObj, tableName, true);\n if (!tdTables.isEmpty()) {\n TdTable table = tdTables.get(0);\n if (!CatalogHelper.getTables(catalogObj).contains(table)) {\n CatalogHelper.addTables(tdTables, catalogObj);\n }\n List<TdColumn> columns = DqRepositoryViewService.getColumns(tdDataProvider, table, null, true);\n new AnalyzeColumnSetAction(columns.toArray(new TdColumn[columns.size()])).run();\n } else {\n MessageUI.openWarning(\"String_Node_Str\" + tableName + \"String_Node_Str\");\n }\n } catch (TalendException e) {\n e.printStackTrace();\n }\n}\n"
|
"public Object run() throws StepExecutionException {\n for (int i = getStartingColIndex(searchType); i < m_table.getColumnCount(); ++i) {\n if (MatchUtil.getInstance().match(getCellText(implRow, i), value, operator)) {\n return Boolean.TRUE;\n }\n }\n return new Boolean(false);\n}\n"
|
"private void createBelongsField(final CtClass ctClass, final String pluginIdentifier, final XMLStreamReader reader) throws ModelXmlCompilingException {\n String plugin = getStringAttribute(reader, \"String_Node_Str\");\n if (plugin == null) {\n plugin = pluginIdentifier;\n }\n String model = getStringAttribute(reader, \"String_Node_Str\");\n createField(ctClass, getStringAttribute(reader, NAME), ClassNameUtils.getFullyQualifiedClassName(plugin, model));\n}\n"
|
"private String getParameterValueWithContext(IElement elem, String key, IContext context) {\n if (elem == null || key == null) {\n return \"String_Node_Str\";\n String actualKey = this.getParaNameFromRepositoryName(key);\n if (actualKey != null) {\n return fetchElementParameterValue(elem, context, actualKey);\n } else {\n return fetchElementParameterValue(elem, context, key);\n }\n}\n"
|
"protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_map);\n ButterKnife.bind(this);\n BmobIM.getInstance().setOnConnectStatusChangeListener(new ConnectStatusChangeListener() {\n public void onChange(ConnectionStatus status) {\n Toast.makeText(MapActivity.this, status.getMsg(), Toast.LENGTH_SHORT).show();\n L.i(BmobIM.getInstance().getCurrentStatus().getMsg());\n if (status.equals(ConnectionStatus.DISCONNECT)) {\n checkConnect();\n } else if (status.equals(ConnectionStatus.NETWORK_UNAVAILABLE)) {\n toast(\"String_Node_Str\");\n }\n }\n });\n List<BmobIMConversation> list = BmobIM.getInstance().loadAllConversation();\n if (null != list) {\n mIMConversations.addAll(list);\n }\n User user = BmobUser.getCurrentUser(User.class);\n mSendToUsername = user.getContact().get(0).getUsername();\n checkConversations(mSendToUsername, true);\n initLocation();\n mMapView.onCreate(savedInstanceState);\n init();\n checkLocationPermission();\n EventBus.getDefault().register(this);\n}\n"
|
"public void enable() throws ServiceRegistrationException {\n if (State.ENABLED.ordinal() > this.stateMachine.getState().ordinal()) {\n try {\n final Callable<CheckedListenableFuture<Cluster>> transition = Automata.sequenceTransitions(this, State.PENDING, State.AUTHENTICATING, State.STARTING, State.STARTING_NOTREADY, State.NOTREADY, State.DISABLED, State.ENABLING, State.ENABLING_RESOURCES, State.ENABLING_NET, State.ENABLING_VMS, State.ENABLING_ADDRS, State.ENABLING_VMS_PASS_TWO, State.ENABLING_ADDRS_PASS_TWO, State.ENABLED);\n ServiceRegistrationException fail = null;\n for (int i = 0; i < CLUSTER_STARTUP_SYNC_RETRIES; i++) {\n CheckedListenableFuture<Cluster> res = Threads.lookup(ClusterController.class, Cluster.class).submit(transition).get();\n try {\n res.get();\n fail = null;\n break;\n } catch (Exception ex) {\n Logs.exhaust().error(ex, ex);\n fail = new ServiceRegistrationException(\"String_Node_Str\" + this.configuration + \"String_Node_Str\" + ex.getMessage(), ex);\n }\n }\n if (fail == null) {\n throw fail;\n }\n } catch (NoSuchElementException ex) {\n throw ex;\n } catch (Exception ex) {\n LOG.error(ex, ex);\n throw new ServiceRegistrationException(\"String_Node_Str\" + this.configuration + \"String_Node_Str\" + ex.getMessage(), ex);\n }\n }\n}\n"
|
"public void checkForModUpdates() throws ModUpdateFailedException {\n for (Mod mod : sm.getMods()) {\n submitDownloadWorkflow(CheckForUpdateWorkflow.forExistingFile(mod, true, sm));\n }\n}\n"
|
"public void onPageRequest(PageRequest request) {\n view.clearFrom();\n loadElement();\n setPageTitle(I18N.CONSTANTS.globalContactsExportConfiguration());\n}\n"
|
"public boolean checkFlight(Player player, Distance distance) {\n if (distance.getYDifference() > 400) {\n return false;\n }\n double y1 = distance.fromY();\n double y2 = distance.toY();\n Block block = player.getLocation().getBlock().getRelative(BlockFace.DOWN);\n if (y1 == y2 && !isMovingExempt(player) && player.getVehicle() == null && player.getFallDistance() == 0 && !Utilities.isOnLilyPad(player)) {\n String name = player.getName();\n if (Utilities.cantStandAt(block) && !Utilities.isOnLilyPad(player) && !Utilities.canStand(player.getLocation().getBlock()) && !Utilities.isSubmersed(player)) {\n int violation = 1;\n if (!flightViolation.containsKey(name)) {\n flightViolation.put(name, violation);\n } else {\n violation = flightViolation.get(name) + 1;\n flightViolation.put(name, violation);\n }\n if (violation >= FLIGHT_LIMIT) {\n flightViolation.put(name, 1);\n return true;\n }\n if (flightViolation.containsKey(name) && flightViolation.get(name) > 0) {\n for (int i = FLY_LOOP; i > 0; i--) {\n Location newLocation = new Location(player.getWorld(), player.getLocation().getX(), player.getLocation().getY() - i, player.getLocation().getZ());\n Block lower = newLocation.getBlock();\n if (lower.getTypeId() == 0) {\n player.teleport(newLocation);\n break;\n }\n }\n }\n }\n }\n return false;\n}\n"
|
"public void actionPerform(Database database, IdeFacade ideFacade) throws LiquibaseException {\n String input = ideFacade.promptForString(getTitle(), \"String_Node_Str\", null);\n if (input != null) {\n StringWriter writer = new StringWriter();\n ideFacade.getMigrator(null, database).rollbackSQL(input, writer);\n ideFacade.displayOutput(\"String_Node_Str\", writer.toString());\n }\n}\n"
|
"public void setupAppInfo(String[] args, boolean loadTransitiveHull) {\n if (args.length == 0 || \"String_Node_Str\".equals(args[0])) {\n System.out.println(\"String_Node_Str\");\n if (config.getOptions().containsOption(Config.SHOW_HELP)) {\n System.out.println(\"String_Node_Str\");\n }\n System.exit(2);\n }\n appInfo.setClassPath(new ClassPath(config.getOption(Config.CLASSPATH)));\n String[] natives = Config.splitStringList(config.getOption(Config.NATIVE_CLASSES));\n for (String n : natives) {\n appInfo.addNative(n.replaceAll(\"String_Node_Str\", \"String_Node_Str\"));\n }\n if (config.hasOption(Config.LIBRARY_CLASSES)) {\n String[] libs = Config.splitStringList(config.getOption(Config.LIBRARY_CLASSES));\n for (String lib : libs) {\n appInfo.addLibrary(lib.replaceAll(\"String_Node_Str\", \"String_Node_Str\"));\n }\n }\n if (config.hasOption(Config.IGNORE_CLASSES)) {\n String[] ignore = Config.splitStringList(config.getOption(Config.IGNORE_CLASSES));\n for (String cls : ignore) {\n appInfo.addLibrary(cls.replaceAll(\"String_Node_Str\", \"String_Node_Str\"));\n }\n }\n if (config.hasOption(Config.EXCLUDE_LIBRARIES)) {\n appInfo.setLoadLibraries(!config.getOption(Config.EXCLUDE_LIBRARIES));\n }\n if (config.hasOption(Config.LOAD_NATIVES)) {\n appInfo.setLoadNatives(config.getOption(Config.LOAD_NATIVES));\n }\n String[] roots = Config.splitStringList(config.getOption(Config.ROOTS));\n for (String root : roots) {\n ClassInfo rootInfo = appInfo.loadClass(root.replaceAll(\"String_Node_Str\", \"String_Node_Str\"));\n if (rootInfo == null) {\n System.out.println(\"String_Node_Str\" + root + \"String_Node_Str\");\n System.exit(4);\n }\n appInfo.addRoot(rootInfo);\n }\n try {\n MethodInfo main = getMainMethod(args[0].replaceAll(\"String_Node_Str\", \"String_Node_Str\"));\n appInfo.setMainMethod(main);\n } catch (Config.BadConfigurationException e) {\n System.out.println(e.getMessage());\n if (config.getOptions().containsOption(Config.SHOW_HELP)) {\n System.out.println(\"String_Node_Str\");\n }\n System.exit(2);\n }\n for (int i = 1; i < args.length; i++) {\n ClassInfo clsInfo = appInfo.loadClass(args[i].replaceAll(\"String_Node_Str\", \"String_Node_Str\"));\n appInfo.addRoot(clsInfo);\n }\n if (loadTransitiveHull) {\n new AppLoader().loadAll();\n }\n}\n"
|
"public void startList(IListContent list) {\n ContainerSizeInfo size = engine.getCurrentContainer().getSizeInfo();\n ColumnsInfo table = LayoutUtil.createTable(list, size.getWidth());\n engine.addTable(list, table, size);\n if (list.getChildren() == null) {\n HyperlinkDef link = parseHyperLink(list);\n BookmarkDef bookmark = getBookmark(list);\n engine.addData(ExcelLayoutEngine.EMPTY, list.getComputedStyle(), link, bookmark);\n }\n}\n"
|
"private void addOverlay(Node node, IDecoration decoration) {\n ValidationFindings findings = ValidationManager.validate(node);\n if (findings != null)\n if (!ValidationManager.isValid(findings, FindingType.ERROR))\n decoration.addOverlay(errorDesc, IDecoration.BOTTOM_LEFT);\n else if (!ValidationManager.isValid(findings, FindingType.WARNING))\n decoration.addOverlay(warningDesc, IDecoration.BOTTOM_LEFT);\n}\n"
|
"protected void createToolItems(ToolBarManager tbm) {\n final Action nextDiff = new AbstractCompareAction(ResourceBundle.getBundle(BUNDLE_NAME), \"String_Node_Str\") {\n public void run() {\n navigate(true);\n }\n };\n final ActionContributionItem nextDiffContribution = new ActionContributionItem(nextDiff);\n nextDiffContribution.setVisible(true);\n tbm.appendToGroup(\"String_Node_Str\", nextDiffContribution);\n final Action previousDiff = new AbstractCompareAction(ResourceBundle.getBundle(BUNDLE_NAME), \"String_Node_Str\") {\n public void run() {\n navigate(false);\n }\n };\n final ActionContributionItem previousDiffContribution = new ActionContributionItem(previousDiff);\n previousDiffContribution.setVisible(true);\n tbm.appendToGroup(\"String_Node_Str\", previousDiffContribution);\n IContributionItem[] icItems = tbm.getItems();\n for (IContributionItem conbItem : icItems) {\n if (conbItem instanceof ActionContributionItem) {\n IAction action = ((ActionContributionItem) conbItem).getAction();\n if (action != null && action instanceof ChangePropertyAction) {\n tbm.remove(conbItem);\n conbItem.dispose();\n continue;\n }\n if (((ActionContributionItem) conbItem).getAction() != null && ((ActionContributionItem) conbItem).getAction().getActionDefinitionId() != null) {\n if (((ActionContributionItem) conbItem).getAction().getActionDefinitionId().equals(COPY_LEFT_TO_RIGHT_ID)) {\n tbm.remove(conbItem);\n conbItem.dispose();\n }\n }\n }\n }\n tbm.update(true);\n}\n"
|
"public void testComputedMeasureCache() throws Exception {\n ICubeQueryDefinition cqd = new CubeQueryDefinition(cubeName);\n IEdgeDefinition columnEdge = cqd.createEdge(ICubeQueryDefinition.COLUMN_EDGE);\n IEdgeDefinition rowEdge = cqd.createEdge(ICubeQueryDefinition.ROW_EDGE);\n IDimensionDefinition dim1 = columnEdge.createDimension(\"String_Node_Str\");\n IHierarchyDefinition hier1 = dim1.createHierarchy(\"String_Node_Str\");\n hier1.createLevel(\"String_Node_Str\");\n hier1.createLevel(\"String_Node_Str\");\n hier1.createLevel(\"String_Node_Str\");\n IDimensionDefinition dim2 = rowEdge.createDimension(\"String_Node_Str\");\n IHierarchyDefinition hier2 = dim2.createHierarchy(\"String_Node_Str\");\n hier2.createLevel(\"String_Node_Str\");\n cqd.createComputedMeasure(\"String_Node_Str\", DataType.DOUBLE_TYPE, new ScriptExpression(\"String_Node_Str\"));\n IBinding binding1 = new Binding(\"String_Node_Str\");\n binding1.setExpression(new ScriptExpression(\"String_Node_Str\"));\n cqd.addBinding(binding1);\n IBinding binding2 = new Binding(\"String_Node_Str\");\n binding2.setExpression(new ScriptExpression(\"String_Node_Str\"));\n cqd.addBinding(binding2);\n IBinding binding3 = new Binding(\"String_Node_Str\");\n binding3.setExpression(new ScriptExpression(\"String_Node_Str\"));\n cqd.addBinding(binding3);\n IBinding binding4 = new Binding(\"String_Node_Str\");\n binding4.setExpression(new ScriptExpression(\"String_Node_Str\"));\n cqd.addBinding(binding4);\n IBinding binding5 = new Binding(\"String_Node_Str\");\n binding5.setExpression(new ScriptExpression(\"String_Node_Str\"));\n cqd.addBinding(binding5);\n DataEngineImpl engine = (DataEngineImpl) DataEngine.newDataEngine(DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION, null, null, null));\n this.createCube(engine);\n cqd.setCacheQueryResults(true);\n IPreparedCubeQuery pcq = engine.prepare(cqd, null);\n ICubeQueryResults queryResults = pcq.execute(null);\n CubeCursor cursor = queryResults.getCubeCursor();\n cqd.setQueryResultsID(queryResults.getID());\n pcq = engine.prepare(cqd, null);\n queryResults = pcq.execute(null);\n cursor = queryResults.getCubeCursor();\n List columnEdgeBindingNames = new ArrayList();\n columnEdgeBindingNames.add(\"String_Node_Str\");\n columnEdgeBindingNames.add(\"String_Node_Str\");\n columnEdgeBindingNames.add(\"String_Node_Str\");\n List rowEdgeBindingNames = new ArrayList();\n rowEdgeBindingNames.add(\"String_Node_Str\");\n this.printCube(cursor, columnEdgeBindingNames, rowEdgeBindingNames, \"String_Node_Str\");\n}\n"
|
"protected void getAllInternal(Set<? extends K> keys, Collection<Data> dataKeys, ExpiryPolicy expiryPolicy, List<Object> resultingKeyValuePairs, long startNanos) {\n Map<Object, Data> keyMap = null;\n if (serializeKeys) {\n toDataKeysWithReservations(keys, dataKeys, null, null);\n }\n Collection<?> ncKeys = serializeKeys ? dataKeys : new ArrayList<Object>(keys);\n populateResultFromNearCache(ncKeys, resultingKeyValuePairs);\n if (ncKeys.isEmpty()) {\n return;\n }\n if (!serializeKeys) {\n keyMap = toDataKeys(ncKeys, dataKeys);\n }\n Map<Object, Long> reservations = getNearCacheReservations(ncKeys, keyMap);\n try {\n int currentSize = resultingKeyValuePairs.size();\n super.getAllInternal(keys, dataKeys, expiryPolicy, resultingKeyValuePairs, startNanos);\n populateResultFromRemote(currentSize, resultingKeyValuePairs, reservations);\n } finally {\n releaseRemainingReservedKeys(reservations);\n }\n}\n"
|
"public Module<Tensor> getInstance(FgModelIdentity mid, FactorGraph fg, VarConfig goldConfig, double weight, int curIter, int maxIter) {\n Module<Tensor> mt = mtFac.getInstance(mid, fg, goldConfig, 1.0, curIter, maxIter);\n Algebra s = mt.getAlgebra();\n ScalarMultiply scale = new ScalarMultiply(mt, s.fromReal(weight));\n return new TopoOrder<Tensor>(QLists.getList(mid, scale.getInputs().get(1)), scale, \"String_Node_Str\");\n}\n"
|
"public void checkAccessBlocked(FsAction access, String userName, String... groups) throws AccessControlException {\n try {\n checkAccess(access, userName, groups);\n Assert.fail(\"String_Node_Str\" + path + \"String_Node_Str\" + access + \"String_Node_Str\" + userName + \"String_Node_Str\" + Arrays.asList(groups));\n } catch (AccessControlException ace) {\n Assert.assertNotNull(ace);\n }\n}\n"
|
"public Iterator<URI> listBlobIds(final String filterPrefix) throws IOException {\n if (filterPrefix == null || filterPrefix.length() == 0) {\n return new HDFSIdIterator(getFiles(new Path(this.store.getId().toASCIIString() + \"String_Node_Str\"), new ArrayList<FileStatus>(), true));\n }\n int delim = filterPrefix.lastIndexOf('/');\n List<FileStatus> files = new ArrayList<FileStatus>();\n Path path = new Path(this.store.getId().toASCIIString() + \"String_Node_Str\" + (delim > -1 ? filterPrefix.substring(0, delim) : \"String_Node_Str\"));\n List<FileStatus> tmpFiles = getFiles(path, new ArrayList<FileStatus>(), false);\n for (FileStatus f : tmpFiles) {\n log.debug(\"String_Node_Str\" + f.getPath().getName());\n if (f.getPath().getName().startsWith(filterPrefix)) {\n files.add(f);\n }\n }\n return new HDFSIdIterator(files);\n}\n"
|
"private void adjustDirection(List columns, List rows) {\n String area, otherArea;\n List workList = null;\n if (isVertical()) {\n workList = rows;\n area = ROWAREA_ROW;\n otherArea = ROWAREA_COLUMN;\n } else {\n workList = columns;\n area = COLUMNAREA_COLUMN;\n otherArea = COLUMNAREA_ROW;\n }\n if (workList.size() != 1) {\n return;\n }\n Object obj = workList.get(0);\n if (!(obj instanceof VirtualCrosstabCellAdapter)) {\n return;\n }\n CrosstabCellAdapter adapter = (CrosstabCellAdapter) obj;\n List measures = getMeasreViewHandleList();\n if (measures.size() > 0) {\n int number;\n if (isVertical()) {\n number = addMesureHeaderToVirtual(workList, 1, 1, 2, 1, measures);\n adapter.setRowSpan(number);\n } else {\n number = addMesureHeaderToVirtual(workList, 2, 1, 1, 1, measures);\n adapter.setColumnSpan(number);\n }\n if (number == 0) {\n number = 1;\n }\n map.put(area, Integer.valueOf(number));\n if (isHideHeader()) {\n map.put(otherArea, Integer.valueOf(1));\n } else {\n map.put(otherArea, Integer.valueOf(2));\n }\n }\n}\n"
|
"public void writeToNBT(NBTTagCompound nbt, MappingRegistry registry) {\n nbt.setInteger(\"String_Node_Str\", registry.getIdForBlock(block));\n nbt.setInteger(\"String_Node_Str\", meta);\n if (storedRequirements.length > 0) {\n NBTTagList rq = new NBTTagList();\n for (ItemStack stack : storedRequirements) {\n NBTTagCompound sub = new NBTTagCompound();\n stack.writeToNBT(sub);\n registry.stackToRegistry(sub);\n rq.appendTag(sub);\n }\n nbt.setTag(\"String_Node_Str\", rq);\n }\n}\n"
|
"protected void beforeActivityLaunched() {\n SettingsUtils.markTosAccepted(InstrumentationRegistry.getTargetContext(), true);\n SettingsUtils.setAttendeeAtVenue(InstrumentationRegistry.getTargetContext(), false);\n mAccountName = LoginUtils.setFirstAvailableAccountAsActive(InstrumentationRegistry.getTargetContext());\n}\n"
|
"public List<Resource> query(QueryRequest request) throws ResourceException {\n List<Resource> results = new ArrayList<Resource>();\n logger.trace(\"String_Node_Str\", request.getResourceName(), request.getResourceName());\n Map<String, Object> result = new HashMap<String, Object>();\n ODatabaseDocumentTx db = getConnection();\n try {\n long start = System.currentTimeMillis();\n List<ODocument> queryResult = queries.query(request.getResourceName(), request, db);\n long end = System.currentTimeMillis();\n if (queryResult != null) {\n long convStart = System.currentTimeMillis();\n for (ODocument entry : queryResult) {\n Map<String, Object> convertedEntry = DocumentUtil.toMap(entry);\n results.add(new Resource((String) convertedEntry.get(DocumentUtil.TAG_ID), (String) convertedEntry.get(DocumentUtil.TAG_REV), new JsonValue(convertedEntry)));\n }\n long convEnd = System.currentTimeMillis();\n result.put(QueryConstants.STATISTICS_CONVERSION_TIME, Long.valueOf(convEnd - convStart));\n }\n result.put(QueryConstants.STATISTICS_QUERY_TIME, Long.valueOf(end - start));\n if (logger.isDebugEnabled()) {\n logger.debug(\"String_Node_Str\", new Object[] { results.size(), result.get(QueryConstants.STATISTICS_QUERY_TIME), result.get(QueryConstants.STATISTICS_CONVERSION_TIME) });\n }\n return results;\n } finally {\n if (db != null) {\n db.close();\n }\n }\n}\n"
|
"public void work() {\n if (s_logger.isTraceEnabled()) {\n s_logger.trace(\"String_Node_Str\");\n }\n final SecurityGroupWorkVO work = _workDao.take(_serverId);\n if (work == null) {\n if (s_logger.isTraceEnabled()) {\n s_logger.trace(\"String_Node_Str\");\n }\n return;\n }\n Long userVmId = work.getInstanceId();\n if (work.getStep() == Step.Done) {\n if (s_logger.isDebugEnabled()) {\n s_logger.debug(\"String_Node_Str\" + userVmId);\n }\n Set<Long> affectedVms = new HashSet<Long>();\n affectedVms.add(userVmId);\n scheduleRulesetUpdateToHosts(affectedVms, true, _timeBetweenCleanups * 1000l);\n }\n UserVm vm = null;\n Long seqnum = null;\n s_logger.debug(\"String_Node_Str\" + work);\n final Transaction txn = Transaction.currentTxn();\n txn.start();\n try {\n vm = _userVMDao.acquireInLockTable(work.getInstanceId());\n if (vm == null) {\n s_logger.warn(\"String_Node_Str\" + userVmId);\n return;\n }\n Long agentId = null;\n VmRulesetLogVO log = _rulesetLogDao.findByVmId(userVmId);\n if (log == null) {\n s_logger.warn(\"String_Node_Str\" + userVmId);\n return;\n }\n seqnum = log.getLogsequence();\n if (vm != null && vm.getState() == State.Running) {\n Map<PortAndProto, Set<String>> rules = generateRulesForVM(userVmId);\n agentId = vm.getHostId();\n if (agentId != null) {\n _rulesetLogDao.findByVmId(work.getInstanceId());\n SecurityIngressRulesCmd cmd = generateRulesetCmd(vm.getInstanceName(), vm.getPrivateIpAddress(), vm.getPrivateMacAddress(), vm.getId(), generateRulesetSignature(rules), seqnum, rules);\n Commands cmds = new Commands(cmd);\n try {\n _agentMgr.send(agentId, cmds, _answerListener);\n } catch (AgentUnavailableException e) {\n s_logger.debug(\"String_Node_Str\" + userVmId + \"String_Node_Str\" + agentId + \"String_Node_Str\");\n _workDao.updateStep(work.getInstanceId(), seqnum, Step.Done);\n }\n }\n }\n } finally {\n if (locked) {\n _userVMDao.releaseFromLockTable(userVmId);\n _workDao.updateStep(work.getId(), Step.Done);\n }\n txn.commit();\n }\n}\n"
|
"private void processReport(long hostId, Map<Long, VirtualMachine.PowerState> translatedInfo) {\n if (s_logger.isDebugEnabled())\n s_logger.debug(\"String_Node_Str\" + hostId + \"String_Node_Str\" + translatedInfo.size());\n for (Map.Entry<Long, VirtualMachine.PowerState> entry : translatedInfo.entrySet()) {\n if (s_logger.isDebugEnabled())\n s_logger.debug(\"String_Node_Str\" + hostId + \"String_Node_Str\" + entry.getKey() + \"String_Node_Str\" + entry.getValue());\n if (_instanceDao.updatePowerState(entry.getKey(), hostId, entry.getValue())) {\n if (s_logger.isDebugEnabled())\n s_logger.debug(\"String_Node_Str\" + hostId + \"String_Node_Str\" + entry.getKey() + \"String_Node_Str\" + entry.getValue());\n _messageBus.publish(null, VirtualMachineManager.Topics.VM_POWER_STATE, PublishScope.GLOBAL, entry.getKey());\n } else {\n if (s_logger.isDebugEnabled())\n s_logger.debug(\"String_Node_Str\" + entry.getKey());\n }\n }\n List<VMInstanceVO> vmsThatAreMissingReport = _instanceDao.findByHostInStates(hostId, VirtualMachine.State.Running, VirtualMachine.State.Stopping, VirtualMachine.State.Starting);\n java.util.Iterator<VMInstanceVO> it = vmsThatAreMissingReport.iterator();\n while (it.hasNext()) {\n VMInstanceVO instance = it.next();\n if (translatedInfo.get(instance.getId()) != null)\n it.remove();\n }\n if (vmsThatAreMissingReport.size() > 0) {\n Date currentTime = DateUtil.currentGMTTime();\n if (s_logger.isDebugEnabled())\n s_logger.debug(\"String_Node_Str\" + currentTime.getTime());\n long milliSecondsGracefullPeriod = PingInterval.value() * 2000L;\n for (VMInstanceVO instance : vmsThatAreMissingReport) {\n Date vmStateUpdateTime = instance.getUpdateTime();\n if (vmStateUpdateTime == null) {\n s_logger.warn(\"String_Node_Str\" + instance.getId());\n vmStateUpdateTime = currentTime;\n }\n if (s_logger.isDebugEnabled())\n s_logger.debug(\"String_Node_Str\" + hostId + \"String_Node_Str\" + instance.getId() + \"String_Node_Str\" + vmStateUpdateTime.getTime());\n long milliSecondsSinceLastStateUpdate = currentTime.getTime() - vmStateUpdateTime.getTime();\n if (milliSecondsSinceLastStateUpdate > milliSecondsGracefullPeriod) {\n s_logger.debug(\"String_Node_Str\" + instance.getId() + \"String_Node_Str\" + milliSecondsSinceLastStateUpdate + \"String_Node_Str\");\n if (_instanceDao.updatePowerState(instance.getId(), hostId, VirtualMachine.PowerState.PowerReportMissing)) {\n if (s_logger.isDebugEnabled())\n s_logger.debug(\"String_Node_Str\" + hostId + \"String_Node_Str\" + instance.getId() + \"String_Node_Str\");\n _messageBus.publish(null, VirtualMachineManager.Topics.VM_POWER_STATE, PublishScope.GLOBAL, instance.getId());\n } else {\n if (s_logger.isDebugEnabled())\n s_logger.debug(\"String_Node_Str\" + instance.getId());\n }\n } else {\n s_logger.debug(\"String_Node_Str\" + instance.getId() + \"String_Node_Str\" + milliSecondsSinceLastStateUpdate + \"String_Node_Str\");\n }\n }\n }\n if (s_logger.isDebugEnabled())\n s_logger.debug(\"String_Node_Str\" + hostId);\n}\n"
|
"public void execute(RepositoryNode sourceNode, RepositoryNode targetNode) throws Exception {\n if (!validateAction(sourceNode, targetNode)) {\n return;\n }\n if (targetNode.getType() == ENodeType.REPOSITORY_ELEMENT) {\n targetNode = targetNode.getParent();\n }\n final IPath path = RepositoryNodeUtilities.getPath(targetNode);\n if (sourceNode.getType().equals(ENodeType.REPOSITORY_ELEMENT)) {\n final Item originalItem = sourceNode.getObject().getProperty().getItem();\n List<IRepositoryViewObject> allVersion = factory.getAllVersion(originalItem.getProperty().getId());\n if (allVersion.size() == 1) {\n copySingleVersionItem(originalItem, path);\n } else if (allVersion.size() > 1) {\n PastSelectorDialog dialog = new PastSelectorDialog(Display.getCurrent().getActiveShell(), allVersion, sourceNode);\n if (dialog.open() == Window.OK) {\n final Set<IRepositoryViewObject> selectedVersionItems = dialog.getSelectedVersionItems();\n final IWorkspaceRunnable op = new IWorkspaceRunnable() {\n public void run(IProgressMonitor monitor) throws CoreException {\n try {\n Iterator<IRepositoryViewObject> iterator = selectedVersionItems.iterator();\n while (iterator.hasNext()) {\n IRepositoryViewObject repObj = iterator.next();\n Item selectedItem = repObj.getProperty().getItem();\n if (!iterator.hasNext() && isHadoopClusterItem(selectedItem)) {\n copyHadoopClusterItem(selectedItem, path);\n return;\n }\n }\n String id = null;\n String label = null;\n boolean isfirst = true;\n boolean needSys = true;\n for (IRepositoryViewObject object : selectedVersionItems) {\n Item selectedItem = object.getProperty().getItem();\n Item copy = null;\n if (isfirst) {\n copy = factory.copy(selectedItem, path);\n id = copy.getProperty().getId();\n label = copy.getProperty().getLabel();\n isfirst = false;\n } else {\n copy = factory.copy(selectedItem, path, label);\n }\n copy.getProperty().setId(id);\n if (needSys && originalItem instanceof RoutineItem) {\n String lastestVersion = getLastestVersion(selectedVersionItems);\n if (lastestVersion.equals(copy.getProperty().getVersion())) {\n synDuplicatedRoutine((RoutineItem) copy, selectedItem.getProperty().getLabel());\n needSys = false;\n }\n }\n if (copy instanceof ProcessItem) {\n RelationshipItemBuilder.getInstance().addOrUpdateItem(copy);\n }\n factory.save(copy);\n }\n } catch (PersistenceException e) {\n ExceptionHandler.process(e);\n } catch (BusinessException e) {\n ExceptionHandler.process(e);\n }\n }\n };\n IRunnableWithProgress iRunnableWithProgress = new IRunnableWithProgress() {\n public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {\n IWorkspace workspace = ResourcesPlugin.getWorkspace();\n try {\n ISchedulingRule schedulingRule = workspace.getRoot();\n workspace.run(op, schedulingRule, IWorkspace.AVOID_UPDATE, monitor);\n } catch (CoreException e) {\n throw new InvocationTargetException(e);\n }\n }\n };\n try {\n new ProgressMonitorDialog(null).run(false, false, iRunnableWithProgress);\n } catch (InvocationTargetException e) {\n ExceptionHandler.process(e);\n } catch (InterruptedException e) {\n }\n }\n }\n }\n}\n"
|
"public BufferedImage expensiveModelOperations(BuildData bfnbd, boolean forMain, BTProgressMonitor monitor) throws IOException, AsynchExitRequestException {\n Dimension screenSize = (forMain && (headlessOracle_ == null)) ? Toolkit.getDefaultToolkit().getScreenSize() : new Dimension(600, 800);\n BioFabricNetwork bfn = new BioFabricNetwork(bfnbd, pMan_, monitor);\n bfp_.installModel(bfn, monitor);\n int[] preZooms = bfp_.calcZoomSettings(screenSize);\n BufferedImage topImage = null;\n if (headlessOracle_ == null) {\n if (forMain) {\n BufferBuilder bb = new BufferBuilder(null, 100, bfp_, bfp_.getBucketRend(), bfp_.getBufImgStack());\n topImage = bb.buildBufs(preZooms, bfp_, 25, monitor);\n bfp_.setBufBuilder(bb);\n } else {\n BufferBuilder bb = new BufferBuilder(bfp_, bfp_.getBucketRend(), bfp_.getBufImgStack());\n topImage = bb.buildOneBuf();\n bfp_.setBufBuilder(null);\n }\n }\n return (topImage);\n}\n"
|
"public <K, V> Cache<K, V> configureCache(String cacheName, Configuration<K, V> configuration) {\n if (isClosed()) {\n throw new IllegalStateException();\n }\n if (cacheName == null) {\n throw new NullPointerException(\"String_Node_Str\");\n }\n if (configuration == null) {\n throw new NullPointerException(\"String_Node_Str\");\n }\n if ((!configuration.isStoreByValue()) && configuration.isTransactionsEnabled()) {\n throw new IllegalArgumentException(\"String_Node_Str\");\n }\n if (configuration.getTransactionIsolationLevel() == IsolationLevel.NONE && configuration.getTransactionMode() != Mode.NONE) {\n throw new IllegalArgumentException(\"String_Node_Str\");\n }\n if (configuration.getTransactionIsolationLevel() != IsolationLevel.NONE && configuration.getTransactionMode() == Mode.NONE) {\n throw new IllegalArgumentException(\"String_Node_Str\");\n }\n synchronized (caches) {\n RICache<?, ?> cache = caches.get(cacheName);\n if (cache == null) {\n cache = new RICache<K, V>(this, cacheName, getClassLoader(), configuration);\n caches.put(cache.getName(), cache);\n }\n return (Cache<K, V>) cache;\n }\n}\n"
|
"public void update(DataDistribution<VehicleState> target, Observation obs) {\n final double timeDiff = prevTime == 0 ? 0 : (obs.getTimestamp().getTime() - prevTime) / 1000;\n prevTime = obs.getTimestamp().getTime();\n if (timeDiff <= 0)\n return;\n final Multimap<VehicleState, DefaultWeightedValue<InferredPathEntry>> stateToPaths = HashMultimap.create();\n final Set<InferredPath> evaluatedPaths = Sets.newHashSet();\n final List<DefaultWeightedValue<VehicleState>> resampler = Lists.newArrayList();\n for (final VehicleState state : target.getDomain()) {\n state.getMovementFilter().predict(state.getBelief(), PathEdge.getEdge(state.getInferredEdge()), PathEdge.getEdge(state.getInferredEdge(), 0d));\n final Set<InferredPath> instStateTransitions = inferredGraph.getPaths(state, obs.getObsCoords());\n state.getMovementFilter().setCurrentTimeDiff(timeDiff);\n double totalLogLik = Double.NEGATIVE_INFINITY;\n for (final InferredPath path : instStateTransitions) {\n final InferredPathEntry infPath = path.getPredictiveLogLikelihood(obs, state);\n if (isDebug)\n evaluatedPaths.add(infPath);\n totalLogLik = LogMath.add(totalLogLik, infPath.getTotalLogLikelihood());\n stateToPaths.put(state, new DefaultWeightedValue<InferredPathEntry>(infPath, infPath.getTotalLogLikelihood()));\n }\n resampler.add(new DefaultWeightedValue<VehicleState>(state, totalLogLik));\n }\n final Random rng = getRandom();\n final DataDistribution<VehicleState> resampleDist = StatisticsUtil.getLogNormalizedDistribution(resampler);\n final ArrayList<? extends VehicleState> smoothedStates = resampleDist.sample(rng, getNumParticles());\n target.clear();\n if (isDebug)\n this.filterInfo.put(obs, new FilterInformation(evaluatedPaths, resampleDist));\n for (final VehicleState state : smoothedStates) {\n final VehicleState newState = state.clone();\n final DataDistribution<InferredPathEntry> instStateDist = StatisticsUtil.getLogNormalizedDistribution(Lists.newArrayList(stateToPaths.get(newState)));\n final InferredPathEntry sampledPathEntry = instStateDist.sample(rng);\n final PathEdge sampledEdge;\n if (sampledPathEntry.getPath().getEdges().size() > 1) {\n final DataDistribution<PathEdge> pathEdgeDist = StatisticsUtil.getLogNormalizedDistribution(sampledPathEntry.getEdgeToPredictiveBelief());\n sampledEdge = pathEdgeDist.sample(rng);\n } else {\n sampledEdge = sampledPathEntry.getPath().getEdges().get(0);\n }\n final MultivariateGaussian sampledBelief = sampledPathEntry.getEdgeToPredictiveBelief().get(sampledEdge).getValue().clone();\n final StandardRoadTrackingFilter updatedFilter = sampledPathEntry.getFilter().clone();\n updatedFilter.measure(sampledBelief, obs.getProjectedPoint(), sampledEdge);\n InferredEdge prevEdge = sampledPathEntry.getPath().getEdges().get(0).getInferredEdge();\n final EdgeTransitionDistributions updatedEdgeTransDist = newState.getEdgeTransitionDist().clone();\n for (final PathEdge edge : sampledPathEntry.getPath().getEdges()) {\n if (prevEdge != null)\n updatedEdgeTransDist.update(prevEdge, edge.getInferredEdge());\n if (!edge.isEmptyEdge()) {\n edge.getInferredEdge().getVelocityEstimator().update(edge.getInferredEdge().getVelocityPrecisionDist(), sampledBelief.getMean().getElement(1));\n }\n prevEdge = edge.getInferredEdge();\n }\n final VehicleState newTransState = new VehicleState(this.inferredGraph, obs, updatedFilter, sampledBelief, updatedEdgeTransDist, sampledEdge, sampledPathEntry.getPath(), state);\n target.set(newTransState, 1d / smoothedStates.size());\n }\n}\n"
|
"private Integer maxScore(Role role, MachineState state, int alpha, int beta, int depth) throws GoalDefinitionException, MoveDefinitionException, TransitionDefinitionException {\n if (stateMachine.isTerminal(state)) {\n numStatesExpanded++;\n return stateMachine.getGoal(state, role);\n }\n String stateString = Canonicalizer.stateString(state);\n Integer cacheValue;\n if (externalCache != null && (cacheValue = externalCache.get(stateString)) != null) {\n extCacheHit++;\n return cacheValue;\n }\n String alphaBetaStateString = Canonicalizer.stateStringAlphaBeta(stateString, alpha, beta);\n if (useCaching && (cacheValue = maxStateScores.get(alphaBetaStateString)) != null) {\n maxCacheHit++;\n return cacheValue;\n }\n numStatesExpanded++;\n int bestValue = Integer.MIN_VALUE;\n boolean heuristicUsed = false, nullValueReturned = false;\n List<Move> moves = stateMachine.getLegalMoves(state, role);\n if (depth > maxDepth) {\n heuristicUsed = true;\n if (heuristic != null) {\n Integer value = heuristic.getScore(state, role);\n if (value != null)\n return -value;\n return null;\n } else {\n return null;\n }\n } else {\n for (Move move : moves) {\n if (stopExecution) {\n break;\n }\n Integer value = minScore(role, move, state, alpha, beta, depth);\n if (value != null) {\n int testValue = value;\n if (value < 0) {\n testValue = -testValue;\n heuristicUsed = true;\n }\n if (testValue > bestValue)\n bestValue = testValue;\n alpha = Math.max(alpha, bestValue);\n if (alpha >= beta) {\n bestValue = alpha;\n break;\n }\n } else {\n nullValueReturned = true;\n }\n }\n if (bestValue == 0 && nullValueReturned)\n return null;\n if (bestValue == Integer.MIN_VALUE)\n return null;\n if (!stopExecution && !heuristicUsed)\n maxStateScores.put(alphaBetaStateString, bestValue);\n return heuristicUsed ? -bestValue : bestValue;\n }\n}\n"
|
"public void endEntity(String name) throws SAXException {\n if (null != lexicalHandler) {\n lexicalHandler.endEntity(name);\n }\n}\n"
|
"public void updateStoragePool(StoragePool storagePool, Map<String, String> details) {\n String capacityBytes = details.get(PrimaryDataStoreLifeCycle.CAPACITY_BYTES);\n String capacityIops = details.get(PrimaryDataStoreLifeCycle.CAPACITY_IOPS);\n StoragePoolVO storagePoolVO = _storagePoolDao.findById(storagePool.getId());\n try {\n if (capacityBytes != null) {\n long usedBytes = _capacityMgr.getUsedBytes(storagePoolVO);\n if (Long.parseLong(capacityBytes) < usedBytes) {\n throw new CloudRuntimeException(\"String_Node_Str\");\n }\n UpdateTsmStorageCmdResponse updateTsmStorageCmdResponse = ElastistorUtil.updateElastistorTsmStorage(capacityBytes, storagePool.getUuid());\n if (updateTsmStorageCmdResponse.getStorage().getId() != null) {\n _storagePoolDao.updateCapacityBytes(storagePool.getId(), Long.parseLong(capacityBytes));\n s_logger.info(\"String_Node_Str\");\n } else {\n throw new CloudRuntimeException(\"String_Node_Str\" + updateTsmStorageCmdResponse.toString());\n }\n }\n if (capacityIops != null) {\n long usedIops = _capacityMgr.getUsedIops(storagePoolVO);\n if (Long.valueOf(capacityIops) < usedIops) {\n throw new CloudRuntimeException(\"String_Node_Str\");\n }\n UpdateTsmCmdResponse updateTsmCmdResponse = ElastistorUtil.updateElastistorTsmIOPS(capacityIops, storagePool.getUuid());\n if (updateTsmCmdResponse.getTsm(0).getUuid() != null) {\n _storagePoolDao.updateCapacityIops(storagePool.getId(), Long.valueOf(capacityIops));\n s_logger.info(\"String_Node_Str\");\n } else {\n throw new CloudRuntimeException(\"String_Node_Str\" + updateTsmCmdResponse.toString());\n }\n }\n } catch (Throwable e) {\n throw new CloudRuntimeException(\"String_Node_Str\" + e);\n }\n}\n"
|
"void animateCollapse() {\n if (SPEW) {\n Log.d(TAG, \"String_Node_Str\" + mExpanded + \"String_Node_Str\" + mExpandedVisible + \"String_Node_Str\" + mAnimating + \"String_Node_Str\" + mAnimVel);\n }\n if (!mExpandedVisible) {\n return;\n }\n prepareTracking(mDisplay.getHeight() - 1);\n performFling(mDisplay.getHeight() - 1, -2000.0f, true);\n}\n"
|
"static void awaitDatabases() throws InterruptedException {\n if (!BootstrapArgs.isCloudController()) {\n while (list(filterBootedSyncedDbs).isEmpty()) {\n TimeUnit.SECONDS.sleep(3);\n LOG.info(\"String_Node_Str\");\n }\n if (Databases.shouldInitialize()) {\n doInitialize();\n }\n } else if (BootstrapArgs.isCloudController()) {\n for (Host coordinator = Hosts.getCoordinator(); !coordinator.hasSynced() && !coordinator.hasBootstrapped() && !coordinator.isLocalHost(); coordinator = Hosts.getCoordinator()) {\n TimeUnit.SECONDS.sleep(3);\n LOG.info(\"String_Node_Str\");\n }\n }\n}\n"
|
"protected String dump(boolean canonical) {\n StringBuffer buf = new StringBuffer();\n if (canonical)\n buf.append('<');\n buf.append(getNodeTypeSymbol());\n buf.append(' ');\n buf.append(searched.getCanonicalForm());\n if (canonical) {\n buf.append('>');\n int ln = getRegulatedChildCount();\n for (int i = 0; i < ln; i++) {\n Case cas = (Case) getRegulatedChild(i);\n buf.append(cas.getCanonicalForm());\n }\n buf.append(\"String_Node_Str\").append(getNodeTypeSymbol()).append('>');\n }\n return buf.toString();\n}\n"
|
"public void test() throws GerbilException {\n DatasetConfiguration datasetConfig = new NIFFileDatasetConfig(\"String_Node_Str\", TASK1_FILE, false, ExperimentType.A2KB, null, null);\n Dataset dataset = datasetConfig.getDataset(ExperimentType.A2KB);\n Map<String, Document> uriInstanceMapping = new HashMap<String, Document>(EXPECTED_DOCUMENTS.length);\n for (Document document : EXPECTED_DOCUMENTS) {\n uriInstanceMapping.put(document.getDocumentURI(), document);\n }\n Document expectedDoc;\n Set<Marking> expectedMarkings;\n for (Document document : dataset.getInstances()) {\n Assert.assertTrue(uriInstanceMapping.containsKey(document.getDocumentURI()));\n expectedDoc = uriInstanceMapping.get(document.getDocumentURI());\n Assert.assertEquals(expectedDoc.getText(), document.getText());\n Assert.assertEquals(\"String_Node_Str\" + expectedDoc.getMarkings().toString() + \"String_Node_Str\" + document.getMarkings().toString() + \"String_Node_Str\", expectedDoc.getMarkings().size(), document.getMarkings().size());\n expectedMarkings = new HashSet<Marking>(expectedDoc.getMarkings());\n for (Marking marking : document.getMarkings()) {\n Assert.assertTrue(\"String_Node_Str\" + marking + \"String_Node_Str\" + expectedMarkings.toString() + \"String_Node_Str\", expectedMarkings.contains(marking));\n }\n }\n}\n"
|
"private GetWorkResponse getWorkUnsafe(GetWorkRequest request) {\n LOG.info(String.format(\"String_Node_Str\", request.getMinionId(), request.getFinishedTargets().size(), request.getMaxWorkUnitsToFetch()));\n checkBuildId(request.getStampedeId());\n Preconditions.checkArgument(request.isSetMinionId());\n Preconditions.checkArgument(request.isSetLastExitCode());\n GetWorkResponse response = new GetWorkResponse();\n response.setContinueBuilding(true);\n response.setWorkUnits(new ArrayList<>());\n synchronized (lock) {\n if (exitCodeFuture.isDone()) {\n response.setContinueBuilding(false);\n return response;\n }\n if (request.getLastExitCode() != 0) {\n LOG.error(String.format(\"String_Node_Str\", request.getMinionId(), request.getLastExitCode()));\n exitCodeFuture.complete(request.getLastExitCode());\n response.setContinueBuilding(false);\n return response;\n }\n List<WorkUnit> newWorkUnitsForMinion = allocator.dequeueZeroDependencyNodes(request.getMinionId(), request.getFinishedTargets(), request.getMaxWorkUnitsToFetch());\n if (allocator.isBuildFinished()) {\n exitCodeFuture.complete(0);\n LOG.info(String.format(\"String_Node_Str\", request.minionId));\n response.setContinueBuilding(false);\n } else {\n response.setWorkUnits(newWorkUnitsForMinion);\n }\n return response;\n }\n}\n"
|
"public void flipTestBigA() {\n final int numCases = 1000;\n final BitSet bs = new BitSet();\n final Random r = new Random(3333);\n int checkTime = 2;\n RoaringBitmap rb1 = new RoaringBitmap(), rb2 = null;\n for (int i = 0; i < numCases; ++i) {\n final int start = r.nextInt(65536 * 20);\n int end = r.nextInt(65536 * 20);\n if (r.nextDouble() < 0.1)\n end = start + r.nextInt(100);\n if ((i & 1) == 0) {\n rb2 = RoaringBitmap.flip(rb1, start, end);\n int r1 = r.nextInt(65536 * 20);\n int r2 = r.nextInt(65536 * 20);\n rb1.flip(r1, r2);\n } else {\n rb1 = RoaringBitmap.flip(rb2, start, end);\n RoaringBitmap tmpsh = slowflip(rb2, start, end);\n assert (tmpsh.equals(rb1));\n rb2.flip(r.nextInt(65536 * 20), r.nextInt(65536 * 20));\n }\n if (start < end)\n bs.flip(start, end);\n if (r.nextDouble() < 0.2 && (i & 1) == 0) {\n final RoaringBitmap mask = new RoaringBitmap();\n final BitSet mask1 = new BitSet();\n final int startM = r.nextInt(65536 * 20);\n final int endM = startM + 100000;\n mask.flip(startM, endM);\n mask1.flip(startM, endM);\n mask.flip(0, 65536 * 20 + 100000);\n mask1.flip(0, 65536 * 20 + 100000);\n rb2.and(mask);\n bs.and(mask1);\n }\n if (i > checkTime) {\n System.out.println(\"String_Node_Str\" + i + \"String_Node_Str\" + rb2.getCardinality());\n final RoaringBitmap rb = (i & 1) == 0 ? rb2 : rb1;\n final boolean status = equals(bs, rb);\n Assert.assertTrue(status);\n checkTime *= 1.5;\n }\n }\n}\n"
|
"public void testGetScannerBeforeTimestamp() throws IOException {\n Table table = getDefaultTable();\n byte[] rowKey = dataHelper.randomData(\"String_Node_Str\");\n byte[] qual = dataHelper.randomData(\"String_Node_Str\");\n byte[][] values = dataHelper.randomData(\"String_Node_Str\", 2);\n long ts1 = 100000l;\n long ts2 = 200000l;\n table.put(new Put(rowKey).addColumn(COLUMN_FAMILY, qual, ts1, values[0]));\n table.put(new Put(rowKey).addColumn(COLUMN_FAMILY, qual, ts2, values[1]));\n Scan scan1 = new Scan().withStartRow(rowKey).withStopRow(rowFollowing(rowKey)).setTimeRange(0, ts1);\n try (ResultScanner resultScanner = table.getScanner(scan1)) {\n Assert.assertNull(resultScanner.next());\n }\n Scan scan2 = new Scan().withStartRow(rowKey).withStopRow(rowFollowing(rowKey)).setTimeRange(0, ts2 + 1);\n try (ResultScanner resultScanner = table.getScanner(scan2)) {\n Result result = resultScanner.next();\n Assert.assertNotNull(result);\n Assert.assertArrayEquals(values[1], CellUtil.cloneValue(result.getColumnLatestCell(COLUMN_FAMILY, qual)));\n }\n Scan scan3 = new Scan().withStartRow(rowKey).withStopRow(rowFollowing(rowKey)).setTimeRange(0, ts1 + 1);\n try (ResultScanner resultScanner = table.getScanner(scan3)) {\n Result result = resultScanner.next();\n Assert.assertNotNull(result);\n Assert.assertArrayEquals(values[0], CellUtil.cloneValue(result.getColumnLatestCell(COLUMN_FAMILY, qual)));\n }\n}\n"
|
"public static Context createContext(HttpServletRequest req, Object obj) {\n Context context = Lang.context();\n Object globalContext = Mvcs.getServletContext().getAttribute(Loading.CONTEXT_NAME);\n if (globalContext != null) {\n context.putAll((Context) globalContext);\n }\n Map<String, Object> req_attr = new HashMap<String, Object>();\n for (Enumeration<String> en = req.getAttributeNames(); en.hasMoreElements(); ) {\n String tem = en.nextElement();\n a.put(tem, req.getAttribute(tem));\n }\n context.set(\"String_Node_Str\", a);\n Map<String, String> p = new HashMap<String, String>();\n for (Object o : req.getParameterMap().keySet()) {\n String key = (String) o;\n String value = req.getParameter(key);\n p.put(key, value);\n context.set(key, value);\n }\n context.set(\"String_Node_Str\", p);\n Map<String, String> u = new HashMap<String, String>();\n AtMap at = Mvcs.getAtMap();\n if (at != null) {\n for (Object o : at.keys()) {\n String key = (String) o;\n u.put(key, at.get(key));\n }\n context.set(\"String_Node_Str\", u);\n }\n if (null != obj)\n context.set(ViewProcessor.DEFAULT_ATTRIBUTE, obj);\n return context;\n}\n"
|
"public static void killed(Player _player) {\n Sentence sentence = sentences.get(_player.getName());\n if (sentence != null) {\n String message = sentence.executioner.getMessage();\n if (message != null && !sentence.flags.contains(\"String_Node_Str\")) {\n message = Wrath.get().getComms().parse(message, sentence.player, sentence.target);\n Wrath.get().getComms().broadcast(null, message);\n }\n remove(_player);\n }\n}\n"
|
"public void start(final Settings settings, final Properties properties) throws CacheException {\n LOG.log(Level.INFO, \"String_Node_Str\");\n if (instance == null || !instance.getLifecycleService().isRunning()) {\n instanceLoader = HazelcastInstanceFactory.createInstanceLoader(properties);\n instance = instanceLoader.loadInstance();\n }\n}\n"
|
"public void testDoPostUnauthorizedWhenParticipantInvalid() throws Exception {\n when(req.getHeaders(\"String_Node_Str\")).thenReturn(convertRawEnumerationToGeneric(generateOAuthHeader(\"String_Node_Str\")));\n servlet.doPost(req, resp);\n verify(resp).setStatus(HttpServletResponse.SC_UNAUTHORIZED);\n}\n"
|
"public void init() throws Exception {\n _node1 = new ServerDispatcher(Listener.NULL_LISTENER);\n _node2 = new ServerDispatcher(Listener.NULL_LISTENER);\n _tport1 = new TransportImpl(new FailureDetectorImpl(5000), \"String_Node_Str\".getBytes());\n _node1.init(_tport1);\n _tport2 = new TransportImpl(new FailureDetectorImpl(5000), \"String_Node_Str\".getBytes());\n _node2.init(_tport2);\n}\n"
|
"private boolean hasWritePermission(Uri uri) {\n final int uid = Binder.getCallingUid();\n if (uid == mMyUid) {\n return true;\n }\n final Context context = getContext();\n final String wperm = getWritePermission();\n final int pid = Binder.getCallingPid();\n if (mExported && (wperm == null || context.checkPermission(wperm, pid, uid) == PackageManager.PERMISSION_GRANTED)) {\n return true;\n }\n PathPermission[] pps = getPathPermissions();\n if (pps != null) {\n final String path = uri.getPath();\n int i = pps.length;\n while (i > 0) {\n i--;\n final PathPermission pp = pps[i];\n final String ppwperm = pp.getWritePermission();\n if (ppwperm != null && pp.match(path)) {\n if (context.checkPermission(ppwperm, pid, uid) == PackageManager.PERMISSION_GRANTED) {\n return true;\n }\n }\n }\n }\n if (context.checkUriPermission(uri, pid, uid, Intent.FLAG_GRANT_WRITE_URI_PERMISSION) == PackageManager.PERMISSION_GRANTED) {\n return true;\n }\n return false;\n}\n"
|
"private void buildHeader(MPIBuffer buffer, MPISendMessage sendMessage) {\n if (buffer.getCapacity() < HEADER_SIZE) {\n throw new RuntimeException(\"String_Node_Str\");\n }\n ByteBuffer byteBuffer = buffer.getByteBuffer();\n byteBuffer.putInt(sendMessage.getSource());\n byteBuffer.putInt(sendMessage.getFlags());\n byteBuffer.putInt(sendMessage.getDestintationIdentifier());\n byteBuffer.putInt(0);\n sendMessage.setWrittenHeaderSize(16);\n buffer.setSize(16);\n}\n"
|
"public static String asString(ByteBuffer buff) {\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n int i = 0;\n int n = buff.capacity() - offset;\n while (i < n) {\n byte b = buff.get(offset + i);\n if (b == 0) {\n break;\n }\n out.write(b);\n }\n return new String(out.toByteArray());\n}\n"
|
"private void marshalSimpleValue(XPathFragment xmlRootFragment, MarshalRecord marshalRecord, Object originalValue, Object object, Object value, AbstractSession session, NamespaceResolver namespaceResolver) {\n if (xmlRootFragment != null) {\n QName qname = ((XMLRoot) originalValue).getSchemaType();\n value = getValueToWrite(qname, value, (XMLConversionManager) session.getDatasourcePlatform().getConversionManager(), namespaceResolver);\n Namespace generatedNamespace = setupFragment(((XMLRoot) originalValue), xmlRootFragment, marshalRecord);\n getXPathNode().startElement(marshalRecord, xmlRootFragment, object, session, namespaceResolver, null, null);\n if (generatedNamespace != null) {\n marshalRecord.attribute(XMLConstants.XMLNS_URL, XMLConstants.XMLNS_URL, XMLConstants.XMLNS + \"String_Node_Str\" + generatedNamespace.getPrefix(), generatedNamespace.getNamespaceURI());\n }\n updateNamespaces(qname, marshalRecord, null);\n }\n if (value instanceof String) {\n marshalRecord.characters((String) value);\n } else {\n marshalRecord.node((org.w3c.dom.Node) value, marshalRecord.getNamespaceResolver());\n }\n if (xmlRootFragment != null) {\n marshalRecord.endElement(xmlRootFragment, namespaceResolver);\n }\n}\n"
|
"protected void updateCursorSnap() {\n if (levelCursor == null) {\n isSnapped = false;\n return;\n }\n Vector2D nearestPoint = null;\n double closestSq = Double.MAX_VALUE;\n for (Wall2D wall : level.getWalls()) {\n double dist = wall.from().distanceSq(levelCursor);\n if (dist < closestSq && dist < snapDistance * snapDistance) {\n nearestPoint = wall.from();\n closestSq = dist;\n }\n dist = wall.to().distanceSq(levelCursor);\n if (dist < closestSq && dist < snapDistance) {\n nearestPoint = wall.to();\n closestSq = dist;\n }\n }\n if (isDrawing && drawingPoints.size() > 2 && levelToView(levelCursor).distance(levelToView(drawingPoints.get(0))) < snapDistance) {\n nearestPoint = drawingPoints.get(0);\n }\n if (nearestPoint != null) {\n isSnapped = true;\n levelCursor = nearestPoint;\n } else {\n isSnapped = false;\n }\n}\n"
|
"public void createAndShowTempSwf(TreeItem tagObj) {\n SWF swf = null;\n try {\n if (tempFile != null) {\n tempFile.delete();\n }\n tempFile = File.createTempFile(\"String_Node_Str\", \"String_Node_Str\");\n tempFile.deleteOnExit();\n Color backgroundColor = View.getSwfBackgroundColor();\n if (tagObj instanceof Tag) {\n Tag tag = (Tag) tagObj;\n swf = tag.getSwf();\n if (tag instanceof FontTag) {\n backgroundColor = View.getDefaultBackgroundColor();\n }\n } else if (tagObj instanceof Frame) {\n Frame fn = (Frame) tagObj;\n swf = fn.getSwf();\n if (fn.timeline.timelined == swf) {\n SetBackgroundColorTag setBgColorTag = swf.getBackgroundColor();\n if (setBgColorTag != null) {\n backgroundColor = setBgColorTag.backgroundColor.toColor();\n }\n }\n }\n int frameCount = 1;\n float frameRate = swf.frameRate;\n HashMap<Integer, VideoFrameTag> videoFrames = new HashMap<>();\n if (tagObj instanceof DefineVideoStreamTag) {\n DefineVideoStreamTag vs = (DefineVideoStreamTag) tagObj;\n SWF.populateVideoFrames(vs.getCharacterId(), swf.tags, videoFrames);\n frameCount = videoFrames.size();\n }\n List<SoundStreamBlockTag> soundFrames = new ArrayList<>();\n if (tagObj instanceof SoundStreamHeadTypeTag) {\n soundFrames = ((SoundStreamHeadTypeTag) tagObj).getBlocks();\n frameCount = soundFrames.size();\n }\n if ((tagObj instanceof DefineMorphShapeTag) || (tagObj instanceof DefineMorphShape2Tag)) {\n frameRate = MainPanel.MORPH_SHAPE_ANIMATION_FRAME_RATE;\n frameCount = (int) (MainPanel.MORPH_SHAPE_ANIMATION_LENGTH * frameRate);\n }\n if (tagObj instanceof DefineSoundTag) {\n frameCount = 1;\n }\n if (tagObj instanceof DefineSpriteTag) {\n frameCount = ((DefineSpriteTag) tagObj).frameCount;\n }\n byte[] data;\n try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {\n SWFOutputStream sos2 = new SWFOutputStream(baos, SWF.DEFAULT_VERSION);\n RECT outrect = new RECT(swf.displayRect);\n if (tagObj instanceof FontTag) {\n outrect.Xmin = 0;\n outrect.Ymin = 0;\n outrect.Xmax = FontTag.PREVIEWSIZE * 20;\n outrect.Ymax = FontTag.PREVIEWSIZE * 20;\n }\n int width = outrect.getWidth();\n int height = outrect.getHeight();\n sos2.writeRECT(outrect);\n sos2.writeFIXED8(frameRate);\n sos2.writeUI16(frameCount);\n new SetBackgroundColorTag(swf, new RGB(backgroundColor)).writeTag(sos2);\n if (tagObj instanceof Frame) {\n Frame fn = (Frame) tagObj;\n Timelined parent = fn.timeline.timelined;\n List<Tag> subs = fn.timeline.tags;\n List<Integer> doneCharacters = new ArrayList<>();\n int frameCnt = 0;\n for (Tag t : subs) {\n if (t instanceof ShowFrameTag) {\n frameCnt++;\n continue;\n }\n if (frameCnt > fn.frame) {\n break;\n }\n if (t instanceof DoActionTag || t instanceof DoInitActionTag) {\n continue;\n }\n Set<Integer> needed = new HashSet<>();\n t.getNeededCharactersDeep(needed);\n for (int n : needed) {\n if (!doneCharacters.contains(n)) {\n classicTag(swf.getCharacter(n)).writeTag(sos2);\n doneCharacters.add(n);\n }\n }\n if (t instanceof CharacterTag) {\n int characterId = ((CharacterTag) t).getCharacterId();\n if (!doneCharacters.contains(characterId)) {\n doneCharacters.add(((CharacterTag) t).getCharacterId());\n }\n }\n classicTag(t).writeTag(sos2);\n if (parent != null) {\n if (t instanceof PlaceObjectTypeTag) {\n PlaceObjectTypeTag pot = (PlaceObjectTypeTag) t;\n int chid = pot.getCharacterId();\n int depth = pot.getDepth();\n MATRIX mat = pot.getMatrix();\n if (mat == null) {\n mat = new MATRIX();\n }\n mat = Helper.deepCopy(mat);\n RECT r = parent.getRect();\n mat.translateX += width / 2 - r.getWidth() / 2;\n mat.translateY += height / 2 - r.getHeight() / 2;\n new PlaceObject2Tag(swf, false, false, false, false, false, true, false, true, depth, chid, mat, null, 0, null, 0, null).writeTag(sos2);\n }\n }\n }\n new ShowFrameTag(swf).writeTag(sos2);\n } else {\n boolean isSprite = false;\n if (tagObj instanceof DefineSpriteTag) {\n isSprite = true;\n }\n int chtId = 0;\n if (tagObj instanceof CharacterTag) {\n chtId = ((CharacterTag) tagObj).getCharacterId();\n }\n if (tagObj instanceof DefineBitsTag) {\n JPEGTablesTag jtt = swf.getJtt();\n if (jtt != null) {\n jtt.writeTag(sos2);\n }\n } else if (tagObj instanceof AloneTag) {\n } else {\n Set<Integer> needed = new HashSet<>();\n ((Tag) tagObj).getNeededCharactersDeep(needed);\n for (int n : needed) {\n if (isSprite && chtId == n) {\n continue;\n }\n CharacterTag characterTag = swf.getCharacter(n);\n if (characterTag instanceof DefineBitsTag) {\n JPEGTablesTag jtt = swf.getJtt();\n if (jtt != null) {\n jtt.writeTag(sos2);\n }\n }\n classicTag(characterTag).writeTag(sos2);\n }\n }\n classicTag((Tag) tagObj).writeTag(sos2);\n MATRIX mat = new MATRIX();\n mat.hasRotate = false;\n mat.hasScale = false;\n mat.translateX = 0;\n mat.translateY = 0;\n if (tagObj instanceof BoundedTag) {\n RECT r = ((BoundedTag) tagObj).getRect();\n mat.translateX = -r.Xmin;\n mat.translateY = -r.Ymin;\n mat.translateX = mat.translateX + width / 2 - r.getWidth() / 2;\n mat.translateY = mat.translateY + height / 2 - r.getHeight() / 2;\n } else {\n mat.translateX = width / 4;\n mat.translateY = height / 4;\n }\n if (tagObj instanceof FontTag) {\n FontTag ft = (FontTag) classicTag((Tag) tagObj);\n int countGlyphsTotal = ft.getGlyphShapeTable().size();\n int countGlyphs = Math.min(SHAPERECORD.MAX_CHARACTERS_IN_FONT_PREVIEW, countGlyphsTotal);\n int fontId = ft.getFontId();\n int cols = (int) Math.ceil(Math.sqrt(countGlyphs));\n int rows = (int) Math.ceil(((float) countGlyphs) / ((float) cols));\n if (rows == 0) {\n rows = 1;\n cols = 1;\n }\n int x = 0;\n int y = 0;\n int firstGlyphIndex = fontPageNum * SHAPERECORD.MAX_CHARACTERS_IN_FONT_PREVIEW;\n countGlyphs = Math.min(SHAPERECORD.MAX_CHARACTERS_IN_FONT_PREVIEW, countGlyphsTotal - firstGlyphIndex);\n List<SHAPE> shapes = ft.getGlyphShapeTable();\n int maxw = 0;\n for (int f = firstGlyphIndex; f < firstGlyphIndex + countGlyphs; f++) {\n RECT b = shapes.get(f).getBounds();\n if (b.Xmin == Integer.MAX_VALUE) {\n continue;\n }\n if (b.Ymin == Integer.MAX_VALUE) {\n continue;\n }\n int w = (int) (b.getWidth() / ft.getDivider());\n if (w > maxw) {\n maxw = w;\n }\n x++;\n }\n x = 0;\n int BORDER = 3 * 20;\n int textHeight = height / rows;\n while (maxw * textHeight / 1024.0 > width / cols - 2 * BORDER) {\n textHeight--;\n }\n MATRIX tmat = new MATRIX();\n for (int f = firstGlyphIndex; f < firstGlyphIndex + countGlyphs; f++) {\n if (x >= cols) {\n x = 0;\n y++;\n }\n List<TEXTRECORD> rec = new ArrayList<>();\n TEXTRECORD tr = new TEXTRECORD();\n RECT b = shapes.get(f).getBounds();\n int xmin = b.Xmin == Integer.MAX_VALUE ? 0 : (int) (b.Xmin / ft.getDivider());\n xmin *= textHeight / 1024.0;\n int ymin = b.Ymin == Integer.MAX_VALUE ? 0 : (int) (b.Ymin / ft.getDivider());\n ymin *= textHeight / 1024.0;\n int w = (int) (b.getWidth() / ft.getDivider());\n w *= textHeight / 1024.0;\n int h = (int) (b.getHeight() / ft.getDivider());\n h *= textHeight / 1024.0;\n tr.fontId = fontId;\n tr.styleFlagsHasFont = true;\n tr.textHeight = textHeight;\n tr.xOffset = -xmin;\n tr.yOffset = 0;\n tr.styleFlagsHasXOffset = true;\n tr.styleFlagsHasYOffset = true;\n tr.glyphEntries = new ArrayList<>(1);\n tr.styleFlagsHasColor = true;\n tr.textColor = new RGB(0, 0, 0);\n GLYPHENTRY ge = new GLYPHENTRY();\n double ga = ft.getGlyphAdvance(f);\n int cw = ga == -1 ? w : (int) (ga / ft.getDivider() * textHeight / 1024.0);\n ge.glyphAdvance = 0;\n ge.glyphIndex = f;\n tr.glyphEntries.add(ge);\n rec.add(tr);\n tmat.translateX = x * width / cols + width / cols / 2 - w / 2;\n tmat.translateY = y * height / rows + height / rows / 2;\n new DefineTextTag(swf, 999 + f, new RECT(0, cw, ymin, ymin + h), new MATRIX(), rec).writeTag(sos2);\n new PlaceObject2Tag(swf, false, false, false, true, false, true, true, false, 1 + f, 999 + f, tmat, null, 0, null, 0, null).writeTag(sos2);\n x++;\n }\n new ShowFrameTag(swf).writeTag(sos2);\n } else if ((tagObj instanceof DefineMorphShapeTag) || (tagObj instanceof DefineMorphShape2Tag)) {\n new PlaceObject2Tag(swf, false, false, false, true, false, true, true, false, 1, chtId, mat, null, 0, null, 0, null).writeTag(sos2);\n new ShowFrameTag(swf).writeTag(sos2);\n for (int ratio = 0; ratio < 65536; ratio += 65536 / frameCount) {\n new PlaceObject2Tag(swf, false, false, false, true, false, true, false, true, 1, chtId, mat, null, ratio, null, 0, null).writeTag(sos2);\n new ShowFrameTag(swf).writeTag(sos2);\n }\n } else if (tagObj instanceof SoundStreamHeadTypeTag) {\n for (SoundStreamBlockTag blk : soundFrames) {\n blk.writeTag(sos2);\n new ShowFrameTag(swf).writeTag(sos2);\n }\n } else if (tagObj instanceof DefineSoundTag) {\n ExportAssetsTag ea = new ExportAssetsTag(swf);\n DefineSoundTag ds = (DefineSoundTag) tagObj;\n ea.tags.add(ds.soundId);\n ea.names.add(\"String_Node_Str\");\n ea.writeTag(sos2);\n List<Action> actions;\n DoActionTag doa;\n doa = new DoActionTag(swf, null);\n actions = ASMParser.parse(0, false, \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\", swf.version, false);\n doa.setActions(actions);\n doa.writeTag(sos2);\n new ShowFrameTag(swf).writeTag(sos2);\n actions = ASMParser.parse(0, false, \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\", swf.version, false);\n doa.setActions(actions);\n doa.writeTag(sos2);\n new ShowFrameTag(swf).writeTag(sos2);\n actions = ASMParser.parse(0, false, \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\", swf.version, false);\n doa.setActions(actions);\n doa.writeTag(sos2);\n new ShowFrameTag(swf).writeTag(sos2);\n actions = ASMParser.parse(0, false, \"String_Node_Str\" + \"String_Node_Str\", swf.version, false);\n doa.setActions(actions);\n doa.writeTag(sos2);\n new ShowFrameTag(swf).writeTag(sos2);\n new ShowFrameTag(swf).writeTag(sos2);\n } else if (tagObj instanceof DefineVideoStreamTag) {\n new PlaceObject2Tag(swf, false, false, false, false, false, true, true, false, 1, chtId, mat, null, 0, null, 0, null).writeTag(sos2);\n List<VideoFrameTag> frs = new ArrayList<>(videoFrames.values());\n Collections.sort(frs, new Comparator<VideoFrameTag>() {\n public int compare(VideoFrameTag o1, VideoFrameTag o2) {\n return o1.frameNum - o2.frameNum;\n }\n });\n boolean first = true;\n int ratio = 0;\n for (VideoFrameTag f : frs) {\n if (!first) {\n ratio++;\n new PlaceObject2Tag(swf, false, false, false, true, false, false, false, true, 1, 0, null, null, ratio, null, 0, null).writeTag(sos2);\n }\n f.writeTag(sos2);\n new ShowFrameTag(swf).writeTag(sos2);\n first = false;\n }\n } else if (tagObj instanceof DefineSpriteTag) {\n DefineSpriteTag s = (DefineSpriteTag) tagObj;\n Tag lastTag = null;\n for (Tag t : s.subTags) {\n if (t instanceof EndTag) {\n break;\n } else if (t instanceof PlaceObjectTypeTag) {\n PlaceObjectTypeTag pt = (PlaceObjectTypeTag) t;\n MATRIX m = pt.getMatrix();\n MATRIX m2 = new Matrix(m).preConcatenate(new Matrix(mat)).toMATRIX();\n pt.writeTagWithMatrix(sos2, m2);\n lastTag = t;\n } else {\n t.writeTag(sos2);\n lastTag = t;\n }\n }\n if (!s.subTags.isEmpty() && (lastTag != null) && (!(lastTag instanceof ShowFrameTag))) {\n new ShowFrameTag(swf).writeTag(sos2);\n }\n } else {\n new PlaceObject2Tag(swf, false, false, false, true, false, true, true, false, 1, chtId, mat, null, 0, null, 0, null).writeTag(sos2);\n new ShowFrameTag(swf).writeTag(sos2);\n }\n }\n new EndTag(swf).writeTag(sos2);\n data = baos.toByteArray();\n }\n try (OutputStream fos = new BufferedOutputStream(new FileOutputStream(tempFile))) {\n SWFOutputStream sos = new SWFOutputStream(fos, Math.max(10, swf.version));\n sos.write(\"String_Node_Str\".getBytes());\n sos.write(swf.version);\n sos.writeUI32(sos.getPos() + data.length + 4);\n sos.write(data);\n fos.flush();\n }\n if (flashPanel != null) {\n flashPanel.displaySWF(tempFile.getAbsolutePath(), backgroundColor, frameRate);\n }\n showFlashViewerPanel();\n } catch (IOException | ActionParseException ex) {\n Logger.getLogger(PreviewPanel.class.getName()).log(Level.SEVERE, null, ex);\n }\n}\n"
|
"protected boolean needRepeat() {\n ITableContent table = (ITableContent) content;\n if (table != null && table.isHeaderRepeat()) {\n return true;\n }\n return false;\n}\n"
|
"public File getIndex(Set<Long> jobIDs) {\n ArgumentNotValid.checkNotNull(jobIDs, \"String_Node_Str\");\n File cacheFile = new File(dir, StringUtils.conjoin(\"String_Node_Str\", jobIDs) + \"String_Node_Str\" + requestType + \"String_Node_Str\");\n if (jobIDs.isEmpty()) {\n cacheFile = new File(dir, \"String_Node_Str\" + requestType + \"String_Node_Str\");\n }\n if (!cacheFile.exists()) {\n log.warn(\"String_Node_Str\" + cacheFile + \"String_Node_Str\" + jobIDs);\n }\n return new JobIndex(cacheFile, jobIDs);\n}\n"
|
"private void cleanTempTables(boolean closeSession) throws SQLException {\n if (localTempTables != null && localTempTables.size() > 0) {\n synchronized (database) {\n for (Table table : ObjectArray.newInstance(localTempTables.values())) {\n if (closeSession || table.getOnCommitDrop()) {\n modificationId++;\n table.setModified();\n localTempTables.remove(table.getName());\n table.removeChildrenAndResources(this);\n } else if (table.getOnCommitTruncate()) {\n table.truncate(this);\n }\n }\n }\n }\n}\n"
|
"public void connectionClosed() {\n handleConnectionClosed(new IOException(\"String_Node_Str\"));\n}\n"
|
"private void testGeneratedIdentity(String dataType, String generateType) throws Exception {\n Statement s = createStatement();\n s.execute(\"String_Node_Str\" + dataType + \"String_Node_Str\" + generatedType + \"String_Node_Str\" + \"String_Node_Str\");\n PreparedStatement implicit = prepareStatement(\"String_Node_Str\");\n implicit.executeUpdate();\n implicit.executeUpdate();\n implicit.executeUpdate();\n PreparedStatement explicit = prepareStatement(\"String_Node_Str\" + \"String_Node_Str\");\n explicit.executeUpdate();\n explicit.executeUpdate();\n explicit.executeUpdate();\n}\n"
|
"public void start() {\n Preconditions.checkState(nodeManager != null, \"String_Node_Str\");\n supervisor.start();\n LOGGER.info(\"String_Node_Str\");\n supervisor.supervise(nodeManager, new LifecycleSupervisor.SupervisorPolicy.AlwaysRestartPolicy(), LifecycleState.START);\n lifecycleState = LifecycleState.START;\n}\n"
|
"public void run() {\n if (nodeToProve != null) {\n module = (IFile) ResourceHelper.getResourceByModuleName(nodeToProve.getLocation().source());\n return;\n }\n TLAEditor editor = EditorUtil.getTLAEditorWithFocus();\n Assert.isNotNull(editor, \"String_Node_Str\");\n module = ((FileEditorInput) editor.getEditorInput()).getFile();\n ParseResult parseResult = ResourceHelper.getValidParseResult(module);\n if (parseResult == null) {\n parseResult = new ModuleParserLauncher().parseModule(module, new NullProgressMonitor());\n }\n if (parseResult.getStatus() != IParseConstants.PARSED) {\n return;\n }\n String moduleName = ResourceHelper.getModuleName(module);\n IDocument document = editor.getDocumentProvider().getDocument(editor.getEditorInput());\n nodeToProve = ResourceHelper.getPfStepOrUseHideFromMod(parseResult, moduleName, (ITextSelection) editor.getSelectionProvider().getSelection(), document);\n if (nodeToProve == null) {\n nodeToProve = parseResult.getSpecObj().getExternalModuleTable().getModuleNode(UniqueString.uniqueStringOf(moduleName));\n return;\n }\n}\n"
|
"protected ModelAndView processFormSubmission(HttpServletRequest request, HttpServletResponse response, Object obj, BindException errors) throws Exception {\n Person person = (Person) obj;\n if (!Context.isAuthenticated()) {\n errors.reject(\"String_Node_Str\");\n } else {\n if (person.getPersonName().getGivenName().trim().equals(\"String_Node_Str\"))\n errors.rejectValue(\"String_Node_Str\", \"String_Node_Str\");\n if (person.getPersonName().getFamilyName() == \"String_Node_Str\")\n errors.rejectValue(\"String_Node_Str\", \"String_Node_Str\");\n if (person.getGender() == null || person.getGender().equals(\"String_Node_Str\"))\n errors.rejectValue(\"String_Node_Str\", \"String_Node_Str\");\n for (PersonAttributeType type : Context.getPersonService().getPersonAttributeTypes(PERSON_TYPE.PERSON, null)) {\n String paramName = type.getPersonAttributeTypeId().toString();\n String value = request.getParameter(paramName);\n if (value != null) {\n PersonAttribute attribute = new PersonAttribute(type, value);\n try {\n Object hydratedObject = attribute.getHydratedObject();\n if (hydratedObject == null || \"String_Node_Str\".equals(hydratedObject.toString())) {\n attribute.setValue(\"String_Node_Str\");\n } else if (hydratedObject instanceof Attributable) {\n attribute.setValue(((Attributable) hydratedObject).serialize());\n } else if (!hydratedObject.getClass().getName().equals(type.getFormat()))\n throw new APIException();\n } catch (APIException e) {\n errors.rejectValue(\"String_Node_Str\", \"String_Node_Str\" + type.getName() + \"String_Node_Str\" + value + \"String_Node_Str\");\n log.warn(\"String_Node_Str\" + value + \"String_Node_Str\" + paramName, e);\n attribute.setValue(\"String_Node_Str\");\n }\n person.addAttribute(attribute);\n }\n }\n if (person.getBirthdate() != null) {\n if (person.getBirthdate().after(new Date()))\n errors.rejectValue(\"String_Node_Str\", \"String_Node_Str\");\n else {\n Calendar c = Calendar.getInstance();\n c.setTime(new Date());\n c.add(Calendar.YEAR, -120);\n if (person.getBirthdate().before(c.getTime())) {\n errors.rejectValue(\"String_Node_Str\", \"String_Node_Str\");\n }\n }\n }\n if (person.isPersonVoided())\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"String_Node_Str\", \"String_Node_Str\");\n if (person.isDead() && (person.getCauseOfDeath() == null))\n errors.rejectValue(\"String_Node_Str\", \"String_Node_Str\");\n }\n if (log.isDebugEnabled())\n log.debug(\"String_Node_Str\" + person.printAttributes());\n return super.processFormSubmission(request, response, person, errors);\n}\n"
|
"public FieldData processFieldData(FieldData fieldData, PrestoContextRules rules, PrestoField field) {\n Collection<PrestoType> availableFieldValueTypes = field.getAvailableFieldValueTypes();\n if (availableFieldValueTypes.isEmpty()) {\n throw new RuntimeException(\"String_Node_Str\" + field.getId() + \"String_Node_Str\");\n }\n PrestoType type = availableFieldValueTypes.iterator().next();\n PrestoView valueView = field.getValueView(type);\n List<PrestoField> fields = type.getFields(valueView);\n List<FieldData> valueFields = new ArrayList<FieldData>();\n for (PrestoField valueField : fields) {\n if (!subrules.isHiddenField(valueField)) {\n FieldData fd = getPresto().getFieldDataNoValues(rules, valueField);\n fd = getPresto().getProcessor().processFieldData(fd, rules, valueField, getType(), getStatus());\n valueFields.add(fd);\n }\n }\n fieldData.setValueFields(valueFields);\n FieldDataValues fieldDataValues = setFieldDataValues(rules, field, fieldData);\n int size = fieldDataValues.size();\n Collection<Value> newValues = new ArrayList<Value>(size);\n for (int i = 0; i < size; i++) {\n Object inputValue = fieldDataValues.getInputValue(i);\n Value outputValue = fieldDataValues.getOutputValue(i);\n newValues.add(postProcessValue(rules, field, inputValue, outputValue, fields));\n }\n fieldData.setValues(newValues);\n return fieldData;\n}\n"
|
"public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {\n if (ID == GUI_ID_JOURNAL) {\n return getServerGuiElementForJournal(player, world);\n }\n if (ID == GUI_TABLE) {\n return new CotainerTable(player.inventory);\n }\n TileEntity tileEntity = world.getBlockTileEntity(x, y, z);\n if (tileEntity instanceof TileEntityDecomposer)\n return new ContainerDecomposer(player.inventory, (TileEntityDecomposer) tileEntity);\n if (tileEntity instanceof TileEntityMicroscope)\n return new ContainerMicroscope(player.inventory, (TileEntityMicroscope) tileEntity);\n if (tileEntity instanceof TileEntitySynthesis)\n return new ContainerSynthesis(player.inventory, (TileEntitySynthesis) tileEntity);\n if (tileEntity instanceof TileEntityFusion) {\n player.sendChatToPlayer(\"String_Node_Str\");\n return new ContainerFusion(player.inventory, (TileEntityFusion) tileEntity);\n if (tileEntity instanceof TileEntityProxy)\n return getServerGuiElementFromProxy((TileEntityProxy) tileEntity, player);\n if (tileEntity instanceof TileEntityBlueprintProjector)\n return new ContainerProjector(player.inventory, (TileEntityBlueprintProjector) tileEntity);\n if (tileEntity instanceof TileEntityChemicalStorage)\n return new ContainerChemicalStorage(player.inventory, (TileEntityChemicalStorage) tileEntity);\n return null;\n}\n"
|
"public int abandonAudioFocus(IAudioFocusDispatcher fl, String clientId) {\n Log.i(TAG, \"String_Node_Str\" + clientId);\n try {\n synchronized (mAudioFocusLock) {\n removeFocusStackEntry(clientId, true);\n }\n } catch (java.util.ConcurrentModificationException cme) {\n Log.e(TAG, \"String_Node_Str\" + cme);\n cme.printStackTrace();\n }\n return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;\n}\n"
|
"public void placeComponents(Composite parent) {\n Series series = seriesDefn.getDesignTimeSeries();\n linkSeries = new Link(parent, SWT.NONE);\n {\n GridData gd = new GridData(GridData.FILL_HORIZONTAL);\n linkSeries.setLayoutData(gd);\n linkSeries.setText(\"String_Node_Str\" + seriesName + \"String_Node_Str\");\n linkSeries.addSelectionListener(this);\n }\n List<String> keys = null;\n if (getContext().getUIServiceProvider() != null) {\n keys = getContext().getUIServiceProvider().getRegisteredKeys();\n }\n txtTitle = new ExternalizedTextEditorComposite(parent, SWT.BORDER | SWT.SINGLE, -1, -1, keys, getContext().getUIServiceProvider(), getSeriesIdentifierText(series));\n {\n GridData gd = new GridData(GridData.FILL_HORIZONTAL);\n txtTitle.setLayoutData(gd);\n txtTitle.addListener(this);\n }\n cmbTypes = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);\n {\n GridData gd = new GridData(GridData.FILL_HORIZONTAL);\n cmbTypes.setLayoutData(gd);\n cmbTypes.addSelectionListener(this);\n if (iSeriesDefinitionIndex == 0) {\n cmbTypes.setEnabled(false);\n }\n }\n if (!series.getClass().isAssignableFrom(SeriesImpl.class)) {\n initZOrderUI(parent);\n initVisibleUI(parent, series);\n initStackUI(parent, series);\n initTranslucentUI(parent, series);\n setTypeComboState();\n setStackedBoxState();\n } else {\n Label dummy = new Label(parent, SWT.CHECK);\n GridData gd = new GridData();\n gd.horizontalSpan = 4;\n dummy.setLayoutData(gd);\n }\n populateLists(seriesDefn.getDesignTimeSeries());\n}\n"
|
"protected void updateRtLFlag() throws EngineException {\n if (renderOptions == null)\n return;\n IReportRunnable runnable = executionContext.getRunnable();\n if (runnable == null)\n return;\n ReportDesignHandle handle = (ReportDesignHandle) runnable.getDesignHandle();\n if (handle != null) {\n Object bidiFlag = renderOptions.getOption(IRenderOption.RTL_FLAG);\n if (Boolean.TRUE.equals(bidiFlag)) {\n if (!handle.isDirectionRTL()) {\n updateBidiStyle(true);\n }\n } else if (handle.isDirectionRTL()) {\n renderOptions.setOption(IRenderOption.RTL_FLAG, new Boolean(true));\n IRenderOption renderOptions2 = executionContext.getRenderOption();\n if (renderOptions2 != null) {\n renderOptions2.setOption(IRenderOption.RTL_FLAG, new Boolean(true));\n executionContext.setRenderOption(renderOptions2);\n }\n }\n }\n}\n"
|
"public void run() {\n for (ChartWithData chartData : IndicatorChartFactory.createChart(columnIndicator, true)) {\n ExpandableComposite subComp = toolkit.createExpandableComposite(comp, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT | ExpandableComposite.EXPANDED);\n subComp.setText(chartData.getChartType().getLiteral());\n subComp.setLayoutData(new GridData(GridData.FILL_BOTH));\n final Composite composite = toolkit.createComposite(subComp, SWT.NULL);\n composite.setLayout(new GridLayout(2, false));\n composite.setLayoutData(new GridData(GridData.FILL_BOTH));\n final Analysis analysis = masterPage.getAnalysisHandler().getAnalysis();\n ChartTableFactory.createTable(composite, chartData, analysis);\n final JFreeChart chart = chartData.getChart();\n final EIndicatorChartType chartType = chartData.getChartType();\n if (chart != null) {\n Composite frameComp = toolkit.createComposite(composite, SWT.EMBEDDED);\n frameComp.setLayout(new GridLayout());\n GridData gd = new GridData();\n gd.heightHint = 230;\n gd.widthHint = 460;\n if (chartData.getChartType() == EIndicatorChartType.SUMMARY_STATISTICS) {\n gd = new GridData();\n gd.heightHint = 450;\n gd.widthHint = 150;\n }\n frameComp.setLayoutData(gd);\n Frame frame = SWT_AWT.new_Frame(frameComp);\n frame.setLayout(new java.awt.GridLayout());\n ChartPanel chartPanel = new ChartPanel(chart);\n addMouseListenerForChart(chartPanel, chartType, analysis);\n frame.add(chartPanel);\n frame.pack();\n frame.validate();\n }\n subComp.setClient(composite);\n subComp.addExpansionListener(new ExpansionAdapter() {\n public void expansionStateChanged(ExpansionEvent e) {\n form.reflow(true);\n }\n });\n }\n}\n"
|
"private int fromString(String string, Location loc, int base) throws EvalException {\n String prefix = getIntegerPrefix(string);\n String digits;\n if (prefix == null) {\n digits = string;\n if (base == 0) {\n if (string.length() > 1 && string.startsWith(\"String_Node_Str\")) {\n throw new EvalException(loc, Printer.format(\"String_Node_Str\", stringForErrors));\n }\n base = 10;\n }\n } else {\n digits = string.substring(prefix.length());\n int expectedBase = intPrefixes.get(prefix);\n if (base == 0) {\n base = expectedBase;\n } else if (base != expectedBase) {\n throw new EvalException(loc, Printer.format(\"String_Node_Str\", base, string));\n }\n }\n if (base < 2 || base > 36) {\n throw new EvalException(loc, \"String_Node_Str\");\n }\n try {\n return Integer.parseInt(digits, base);\n } catch (NumberFormatException e) {\n throw new EvalException(loc, Printer.format(\"String_Node_Str\", base, string));\n }\n}\n"
|
"private static ZipFile getZipFile(URL url) {\n if (MinecraftUtil.isCoreFile(url))\n return null;\n ZipFile zipFile0 = null;\n try {\n File file = new File(url.toURI());\n zipFile0 = new ZipFile(file);\n return zipFile0;\n } catch (Exception e) {\n ModSystemTweaker.logger.warning(e);\n }\n return null;\n}\n"
|
"public void testAuthUserIDAccess() throws AuthPelpException {\n IUserID id = _campusConnection.getUserID();\n Assert.assertNotNull(id);\n Assert.assertEquals(((UserID) id), TestPeLP.getUser(_campusConnection, 3).getUserID());\n}\n"
|
"public void processDelta(final IResourceDelta rootDelta) {\n final List<IFile> added = new ArrayList<IFile>();\n final List<IFile> removed = new ArrayList<IFile>();\n IResourceDeltaVisitor visitor = new IResourceDeltaVisitor() {\n public boolean visit(IResourceDelta delta) {\n IResource resource = delta.getResource();\n if (FactoriesUtil.isEmfFile(resource.getFileExtension())) {\n if (delta.getKind() == IResourceDelta.ADDED) {\n added.add((IFile) resource);\n }\n if (delta.getKind() == IResourceDelta.REMOVED) {\n removed.add((IFile) resource);\n }\n }\n return true;\n }\n };\n try {\n rootDelta.accept(visitor);\n } catch (CoreException e1) {\n log.error(e1);\n }\n List<Runnable> refreshedRannables = new ArrayList<Runnable>();\n for (IFile file : removed) {\n try {\n refreshedRannables.add(getDeleteRunnable(file));\n } catch (Exception e) {\n log.error(e);\n }\n }\n for (IFile file : added) {\n Resource resource = null;\n try {\n resource = RepResourceFileHelper.getInstance().getFileResource(file);\n if (resource != null && checkResource(resource)) {\n refreshedRannables.add(getRefreshRunnable(resource));\n }\n } catch (Exception e) {\n log.error(e);\n e.printStackTrace();\n }\n }\n if (refreshedRannables != null && refreshedRannables.size() > 0) {\n postEventExecute(refreshedRannables);\n }\n}\n"
|
"public RemoteRenderedOp create(String opName, ParameterBlock args, RenderingHints hints) {\n if (opName == null) {\n throw new IllegalArgumentException(JaiI18N.getString(\"String_Node_Str\"));\n }\n if (args == null) {\n throw new IllegalArgumentException(JaiI18N.getString(\"String_Node_Str\"));\n }\n getServerSupportedOperationList();\n OperationDescriptor odesc = (OperationDescriptor) odHash.get(new CaselessStringKey(opName));\n if (odesc == null) {\n throw new IllegalArgumentException(JaiI18N.getString(\"String_Node_Str\"));\n }\n if (!odesc.isModeSupported(\"String_Node_Str\")) {\n throw new IllegalArgumentException(JaiI18N.getString(\"String_Node_Str\"));\n }\n if (!RenderedImage.class.isAssignableFrom(odesc.getDestClass(\"String_Node_Str\"))) {\n throw new IllegalArgumentException(JaiI18N.getString(\"String_Node_Str\"));\n }\n StringBuffer msg = new StringBuffer();\n args = (ParameterBlock) args.clone();\n if (!odesc.validateArguments(\"String_Node_Str\", args, msg)) {\n throw new IllegalArgumentException(msg.toString());\n }\n RenderingHints mergedHints;\n if (hints == null) {\n mergedHints = renderingHints;\n } else if (renderingHints.isEmpty()) {\n mergedHints = hints;\n } else {\n mergedHints = new RenderingHints((Map) renderingHints);\n mergedHints.add(hints);\n }\n RemoteRenderedOp op = new RemoteRenderedOp(operationRegistry, protocolName, serverName, opName, args, mergedHints);\n if (odesc.isImmediate()) {\n PlanarImage im = null;\n im = op.getRendering();\n if (im == null) {\n return null;\n }\n }\n return op;\n}\n"
|
"public static Document addUsageCols(final Document doc, final InstanceUsageArtEntity entity, final Units units) throws IOException {\n doc.addValCol((long) entity.getInstanceCnt());\n doc.addValCol(UnitUtil.convertTime(entity.getDurationMs(), TimeUnit.MS, units.getTimeUnit()));\n if (entity.getDurationMs() > 0) {\n doc.addValCol(entity.getCpuUtilizationMs() == null ? null : ((double) entity.getCpuUtilizationMs() / (double) entity.getDurationMs()));\n } else {\n doc.addValCol(0d);\n }\n doc.addValCol(UnitUtil.convertSize(entity.getNetTotalInMegs(), SizeUnit.MB, units.getSizeUnit()));\n doc.addValCol(UnitUtil.convertSize(entity.getNetTotalOutMegs(), SizeUnit.MB, units.getSizeUnit()));\n doc.addValCol(UnitUtil.convertSize(entity.getDiskReadMegs(), SizeUnit.MB, units.getSizeUnit()));\n doc.addValCol(UnitUtil.convertSize(entity.getDiskWriteMegs(), SizeUnit.MB, units.getSizeUnit()));\n doc.addValCol(entity.getDiskReadOps());\n doc.addValCol(entity.getDiskWriteOps());\n doc.addValCol(UnitUtil.convertTime(entity.getDiskReadTime(), TimeUnit.MS, TimeUnit.SECS));\n doc.addValCol(UnitUtil.convertTime(entity.getDiskWriteTime(), TimeUnit.MS, TimeUnit.SECS));\n return doc;\n}\n"
|
"Pair<String, List<SqlStatement.Type>> makeChildMemberSql(RolapMember member, DataSource dataSource, MemberChildrenConstraint constraint) {\n SqlQuery sqlQuery = SqlQuery.newQuery(dataSource, \"String_Node_Str\" + member);\n AggStar aggStar = chooseAggStar(constraint, member);\n constraint.addMemberConstraint(sqlQuery, null, aggStar, member);\n RolapLevel level = (RolapLevel) member.getLevel().getChildLevel();\n boolean levelCollapsed = (aggStar != null) && isLevelCollapsed(aggStar, (RolapCubeLevel) level);\n boolean multipleCols = SqlMemberSource.levelContainsMultipleColumns(level);\n if (levelCollapsed && !multipleCols) {\n RolapStar.Column starColumn = ((RolapCubeLevel) level).getStarKeyColumn();\n int bitPos = starColumn.getBitPosition();\n AggStar.Table.Column aggColumn = aggStar.lookupColumn(bitPos);\n String q = aggColumn.generateExprString(sqlQuery);\n sqlQuery.addSelectGroupBy(q, starColumn.getInternalType());\n sqlQuery.addOrderBy(q, true, false, true);\n aggColumn.getTable().addToFrom(sqlQuery, false, true);\n return sqlQuery.toSqlAndTypes();\n }\n hierarchy.addToFrom(sqlQuery, level.getKeyExp());\n String q = level.getKeyExp().getExpression(sqlQuery);\n sqlQuery.addSelectGroupBy(q, level.getInternalType());\n constraint.addLevelConstraint(sqlQuery, null, aggStar, level);\n if (levelCollapsed) {\n RolapStar.Column starColumn = ((RolapCubeLevel) level).getStarKeyColumn();\n int bitPos = starColumn.getBitPosition();\n AggStar.Table.Column aggColumn = aggStar.lookupColumn(bitPos);\n RolapStar.Condition condition = new RolapStar.Condition(level.getKeyExp(), aggColumn.getExpression());\n sqlQuery.addWhere(condition.toString(sqlQuery));\n hierarchy.addToFromInverse(sqlQuery, level.getKeyExp());\n RolapCubeLevel parentLevel = (RolapCubeLevel) level.getParentLevel();\n boolean isUnique = level.isUnique();\n while (parentLevel != null && !parentLevel.isAll() && !isUnique) {\n hierarchy.addToFromInverse(sqlQuery, parentLevel.getKeyExp());\n starColumn = parentLevel.getStarKeyColumn();\n bitPos = starColumn.getBitPosition();\n aggColumn = aggStar.lookupColumn(bitPos);\n condition = new RolapStar.Condition(parentLevel.getKeyExp(), aggColumn.getExpression());\n sqlQuery.addWhere(condition.toString(sqlQuery));\n parentLevel = parentLevel.getParentLevel();\n }\n }\n if (level.hasCaptionColumn()) {\n MondrianDef.Expression captionExp = level.getCaptionExp();\n if (!levelCollapsed) {\n hierarchy.addToFrom(sqlQuery, captionExp);\n }\n String captionSql = captionExp.getExpression(sqlQuery);\n sqlQuery.addSelectGroupBy(captionSql, null);\n }\n if (!levelCollapsed) {\n hierarchy.addToFrom(sqlQuery, level.getOrdinalExp());\n }\n String orderBy = level.getOrdinalExp().getExpression(sqlQuery);\n sqlQuery.addOrderBy(orderBy, true, false, true);\n if (!orderBy.equals(q)) {\n sqlQuery.addSelectGroupBy(orderBy, null);\n }\n RolapProperty[] properties = level.getProperties();\n for (RolapProperty property : properties) {\n final MondrianDef.Expression exp = property.getExp();\n if (!levelCollapsed) {\n hierarchy.addToFrom(sqlQuery, exp);\n }\n final String s = exp.getExpression(sqlQuery);\n String alias = sqlQuery.addSelect(s, null);\n if (!sqlQuery.getDialect().allowsSelectNotInGroupBy() || !property.dependsOnLevelValue()) {\n sqlQuery.addGroupBy(s, alias);\n }\n }\n return sqlQuery.toSqlAndTypes();\n}\n"
|
"private Object handleAuthenticated() {\n if (isOwnerConnection()) {\n final String uuid = getUuid();\n final String localMemberUUID = clientEngine.getLocalMember().getUuid();\n principal = new ClientPrincipal(uuid, localMemberUUID);\n reAuthLocal();\n Collection<MemberImpl> members = nodeEngine.getClusterService().getMemberList();\n for (MemberImpl member : members) {\n if (!member.localMember()) {\n ClientReAuthOperation op = new ClientReAuthOperation(uuid);\n op.setCallerUuid(localMemberUUID);\n nodeEngine.getOperationService().send(op, member.getAddress());\n }\n }\n }\n boolean isNotMember = clientEngine.getClusterService().getMember(principal.getOwnerUuid()) == null;\n if (isNotMember) {\n throw new AuthenticationException(\"String_Node_Str\" + principal.getOwnerUuid() + \"String_Node_Str\");\n }\n endpoint.authenticated(principal, credentials, isOwnerConnection());\n endpointManager.registerEndpoint(endpoint);\n clientEngine.bind(endpoint);\n final Address thisAddress = clientEngine.getThisAddress();\n return encodeAuth(thisAddress, principal.getUuid(), principal.getOwnerUuid());\n}\n"
|
"private void onPlayerQuitNPCMode(Player quitPlr) {\n if (plugin.hasDataContainer(quitPlr.getName())) {\n PlayerDataContainer quitDataContainer = plugin.getPlayerData(quitPlr.getName());\n if (!quitDataContainer.hasPVPtagExpired()) {\n if (plugin.isDebugEnabled()) {\n plugin.log.info(\"String_Node_Str\");\n }\n if (plugin.settings.isInstaKill()) {\n quitPlr.setHealth(0);\n plugin.removeDataContainer(quitPlr.getName());\n } else {\n final NPC npc = plugin.spawnNpc(quitPlr.getName(), quitPlr.getLocation());\n if (npc.getBukkitEntity() instanceof Player) {\n Player npcPlayer = (Player) npc.getBukkitEntity();\n plugin.copyContentsNpc(npc, quitPlr);\n String plrName = quitPlr.getName();\n plugin.npcm.rename(plrName, plugin.getNpcName(plrName));\n npcPlayer.setHealth(quitPlr.getHealth());\n quitDataContainer.setSpawnedNPC(true);\n quitDataContainer.setNPCId(quitPlr.getName());\n quitDataContainer.setShouldBePunished(true);\n quitPlr.getWorld().createExplosion(quitPlr.getLocation(), explosionDamage);\n }\n }\n }\n }\n}\n"
|
"private void moveBottomButtons() {\n if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {\n mBottomButtonsLayout.setOrientation(LinearLayout.HORIZONTAL);\n if (getResources().getInteger(R.integer.isSW600DP) == 0) {\n setSecondaryButtonVisible(true);\n } else {\n setSecondaryButtonVisible(false);\n }\n ViewCompat.setPaddingRelative(mIconSwitcher, mIconSwitcher.getPaddingLeft(), mIconSwitcher.getPaddingBottom(), mIconSwitcher.getPaddingRight(), mIconSwitcher.getPaddingBottom());\n } else {\n mBottomButtonsLayout.setOrientation(LinearLayout.VERTICAL);\n setSecondaryButtonVisible(false);\n mIconSwitcher.setPadding(mIconSwitcher.getPaddingLeft(), 0, mIconSwitcher.getPaddingRight(), mIconSwitcher.getPaddingBottom());\n }\n}\n"
|
"private void updateROMDataSetParameterName(DataElementAttributes dataAttrs, OdaDataSetParameter setParam, List retList) {\n if (dataAttrs == null)\n return;\n String nativeName = dataAttrs.getName();\n String name = setParam.getName();\n if (StringUtil.isBlank(name) || !name.equalsIgnoreCase(nativeName)) {\n setParam.setName(nativeName);\n }\n setParam.setNativeName(nativeName);\n}\n"
|
"private void createLinkSettingsSection(final Composite container) {\n GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).span(3, 1).applyTo(new Label(container, SWT.NONE));\n final Label linksLabel = new Label(container, SWT.NONE);\n linksLabel.setText(WizardMessages.getString(\"String_Node_Str\"));\n GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).span(COLUMNS, 1).applyTo(linksLabel);\n final TableViewer linksTableViewer = createLinksTable(container);\n GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).hint(200, 100).applyTo(linksTableViewer.getTable());\n final Composite buttonsContainers = new Composite(container, SWT.NONE);\n GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).grab(false, false).applyTo(buttonsContainers);\n GridLayoutFactory.fillDefaults().numColumns(1).margins(0, 0).spacing(SWT.DEFAULT, 0).applyTo(buttonsContainers);\n final Button addButton = new Button(buttonsContainers, SWT.NONE);\n GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).grab(true, false).applyTo(addButton);\n addButton.setText(WizardMessages.getString(\"String_Node_Str\"));\n addButton.addSelectionListener(onAddLink());\n final Button editButton = new Button(buttonsContainers, SWT.NONE);\n GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).grab(true, false).applyTo(editButton);\n editButton.setText(WizardMessages.getString(\"String_Node_Str\"));\n editButton.setEnabled(false);\n editButton.addSelectionListener(onEditLink(linksTableViewer));\n final Button removeButton = new Button(buttonsContainers, SWT.NONE);\n GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).grab(true, false).applyTo(removeButton);\n removeButton.setText(WizardMessages.getString(\"String_Node_Str\"));\n removeButton.addSelectionListener(onRemoveLinks(linksTableViewer));\n removeButton.setEnabled(false);\n ViewerSupport.bind(linksTableViewer, model.getLinks(), BeanProperties.values(ContainerLinkModel.class, ContainerLinkModel.CONTAINER_NAME, ContainerLinkModel.CONTAINER_ALIAS));\n linksTableViewer.addSelectionChangedListener(onSelectionChanged(editButton, removeButton));\n}\n"
|
"public void updateEntity() {\n super.updateEntity();\n if (data.moved) {\n data.afterMoveCheck(worldObj);\n worldObj.scheduleBlockUpdate(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord), 80);\n }\n if (master == null && !isMaster())\n findMaster();\n if (master == null && !isMaster())\n return;\n if (getIntalledUpgrades().contains(EnumMachineUpgrades.AUTO_OUTPUT)) {\n for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {\n Location location = new Location(this).move(direction);\n TileEntity entity = location.getTileEntity();\n if (entity != null && entity instanceof IFluidHandler && !(entity instanceof TileCoolingTower) && master.output.getFluidType() != null) {\n IFluidHandler tank = (IFluidHandler) entity;\n master.drain(direction, tank.fill(direction.getOpposite(), new FluidStack(master.output.getFluidType(), 100), true), true);\n }\n }\n }\n if (!isMaster())\n return;\n if (input.getFluid() != null && input.getFluid().amount <= 0)\n input.setFluid(null);\n if (output.getFluid() != null && output.getFluid().amount <= 0)\n output.setFluid(null);\n int max = 20;\n while (!coolant.isEmpty() && heat > 0 && max > 0) {\n ICoolant cooling = CoolantManager.INSTANCE.getCoolant(coolant.getFluid().getFluid());\n if (cooling == null)\n break;\n coolant.drain(1, true);\n heat -= cooling.getDegreesCoolingPerMB(heat) * 1.5;\n max--;\n }\n if (heat > 80 || recipe == null || output.isFull() || input.isEmpty() || !input.getFluid().isFluidEqual(recipe.getInput()) || input.getFluidAmount() < recipe.getInput().amount || (!output.isEmpty() && !output.getFluid().isFluidEqual(recipe.getOutput())) || output.getCapacity() - output.getFluidAmount() < recipe.getOutput().amount)\n return;\n input.drain(recipe.getInput().amount, true);\n output.fill(recipe.getOutput(), true);\n heat += recipe.getHeat();\n}\n"
|
"private int evaluatePeriodsNForTrailingFunction(String n) throws DataException, BirtException {\n int num = 0;\n if (n == null || n.trim().equals(\"String_Node_Str\")) {\n return 1;\n }\n try {\n num = Integer.valueOf(n);\n } catch (Exception e) {\n num = (Integer) ScriptEvalUtil.evalExpr(new ScriptExpression(n), this.context.getDataEngineContext().getScriptContext(), \"String_Node_Str\", 0);\n }\n return num;\n}\n"
|
"private void RenderScatterPoints(GL gl) {\n float XScale = renderStyle.getRenderWidth() - XYAXISDISTANCE * 2.0f;\n float YScale = renderStyle.getRenderHeight() - XYAXISDISTANCE * 2.0f;\n float x = 0.0f;\n float y = 0.0f;\n for (Integer iContentIndex : contentVA) {\n if (iContentIndex == -1) {\n continue;\n }\n xnormalized = set.get(SELECTED_X_AXIS).getFloat(EDataRepresentation.NORMALIZED, iContentIndex);\n ynormalized = set.get(SELECTED_Y_AXIS).getFloat(EDataRepresentation.NORMALIZED, iContentIndex);\n x = xnormalized * XScale;\n y = ynormalized * YScale;\n float[] fArMappingColor = colorMapper.getColor(Math.max(xnormalized, ynormalized));\n DrawPointPrimitive(gl, x, y, 0.0f, fArMappingColor, 1.0f, iContentIndex, 1.0f);\n }\n}\n"
|
"public void delete(DatasetModuleId datasetModuleId) throws Exception {\n NamespaceId namespaceId = datasetModuleId.getParent();\n if (NamespaceId.SYSTEM.equals(namespaceId)) {\n throw new UnsupportedOperationException(String.format(\"String_Node_Str\", datasetModuleId.getModule(), datasetModuleId.getNamespace()));\n }\n ensureNamespaceExists(namespaceId);\n DatasetModuleMeta moduleMeta = typeManager.getModule(datasetModuleId);\n if (moduleMeta == null) {\n throw new DatasetModuleNotFoundException(datasetModuleId);\n }\n try {\n typeManager.deleteModule(datasetModuleId);\n } catch (DatasetModuleConflictException e) {\n throw new DatasetModuleCannotBeDeletedException(datasetModuleId, e.getMessage());\n }\n}\n"
|
"private void loadLinkedProjects(final LinkedProjectType linkedProjectType) {\n if (linkedProjectType == null || linkedProjectType == LinkedProjectType.FUNDING_PROJECT) {\n view.getFundingProjectsGrid().getStore().removeAll();\n view.getFundingProjectsGrid().getStore().add(getProject().getFunding());\n }\n if (linkedProjectType == null || linkedProjectType == LinkedProjectType.FUNDED_PROJECT) {\n view.getFundedProjectsGrid().getStore().removeAll();\n dispatch.execute(new GetLinkedProjects(getProject().getId(), LinkedProjectType.FUNDED_PROJECT, ProjectDTO.Mode._USE_PROJECT_MAPPER), new CommandResultHandler<ListResult<ProjectFundingDTO>>() {\n protected void onCommandSuccess(final ListResult<ProjectFundingDTO> result) {\n view.getFundedProjectsGrid().getStore().add(result.getList());\n }\n }, new LoadingMask(view.getFundedProjectsGrid()));\n }\n}\n"
|
"protected void connectToShadow() throws SQLException, InaccessibleConfigurationFileException, DriverNotFoundException {\n connectToDatabase(\"String_Node_Str\");\n}\n"
|
"protected void executeCommand(AdminCommandContext context, Properties extraProps) throws Exception {\n String dataSourceName = batchRuntimeHelper.getDataSourceLookupName();\n InitialContext ctx = new InitialContext();\n Object object = ctx.lookup(dataSourceName);\n if (object instanceof DataSource) {\n dataSource = DataSource.class.cast(object);\n String prefix = batchRuntimeConfiguration.getTablePrefix();\n String suffix = batchRuntimeConfiguration.getTablePrefix();\n jobInstanceTableKey = prefix + \"String_Node_Str\" + suffix;\n createTables();\n queryToGetUniqueJobNames = \"String_Node_Str\" + jobInstanceTableKey;\n ColumnFormatter columnFormatter = new ColumnFormatter(getDisplayHeaders());\n if (isSimpleMode()) {\n extraProps.put(SIMPLE_MODE, true);\n Map<String, Integer> jobsInstanceCount = new HashMap<>();\n if (jobName != null) {\n jobsInstanceCount.put(jobName, getJobInstanceCount(jobName));\n } else {\n List<String> jobNames = executeQuery(queryToGetUniqueJobNames, \"String_Node_Str\");\n for (String job_Name : jobNames) {\n jobsInstanceCount.put(job_Name, getJobInstanceCount(job_Name));\n }\n }\n extraProps.put(LIST_BATCH_JOBS, findSimpleJobInfo(jobsInstanceCount, columnFormatter));\n } else {\n extraProps.put(SIMPLE_MODE, false);\n Map<String, Object> map = new HashMap<>();\n map.put(\"String_Node_Str\", getAllJobInstanceCount());\n extraProps.put(LIST_JOBS_COUNT, map);\n List<Map<String, Object>> jobExecutions = new ArrayList<>();\n extraProps.put(LIST_BATCH_JOBS, jobExecutions);\n Map<String, Integer> jobsInstanceCount = new HashMap<>();\n if (Arrays.asList(getOutputHeaders()).contains(INSTANCE_COUNT)) {\n List<String> jobNames = executeQuery(queryToGetUniqueJobNames, \"String_Node_Str\");\n for (String jobName : jobNames) {\n jobsInstanceCount.put(jobName, getJobInstanceCount(jobName));\n }\n }\n List<Long> jobInstanceIDs = getJobInstanceIDs();\n JobOperator jobOperator = AbstractListCommand.getJobOperatorFromBatchRuntime();\n for (Long jobExecution : jobInstanceIDs) {\n try {\n if (glassFishBatchSecurityHelper.isVisibleToThisInstance(((TaggedJobExecution) jobOperator.getJobExecution(jobExecution)).getTagName())) {\n jobExecutions.add(handleJob(jobOperator.getJobExecution(jobExecution), columnFormatter, jobsInstanceCount));\n }\n } catch (Exception ex) {\n logger.log(Level.WARNING, \"String_Node_Str\" + ex);\n logger.log(Level.FINE, \"String_Node_Str\", ex);\n }\n }\n }\n context.getActionReport().setMessage(columnFormatter.toString());\n }\n}\n"
|
"public static void restoreGhostHero(Level level, int pos) {\n if (heldGhost != null) {\n level.mobs.add(heldGhost);\n int ghostPos;\n do {\n ghostPos = pos + PathFinder.NEIGHBOURS8[Random.Int(8)];\n } while (Level.solid[ghostPos] || level.findMob(ghostPos) != null);\n heldGhost.pos = pos;\n heldGhost = null;\n }\n}\n"
|
"protected static Vector2f getMinMinkowskyDifference(Vector2f[] A, Vector2f[] B, float radius, Vector2f minDistance) {\n if (Vector2f.ZERO.equals(minDistance)) {\n return minDistance;\n }\n boolean flip = minDistance != null;\n for (int ii = 0, nn = A.length; ii < nn; ii++) {\n Vector2f start = A[ii];\n Vector2f end = A[(ii + 1) % nn];\n Vector2f sprime = Vector2f.ZERO;\n Vector2f eprime = Vector2f.ZERO;\n Vector2f perp = new Vector2f(start.y - end.y, end.x - start.x);\n float dot = Float.NEGATIVE_INFINITY;\n int dj = 0;\n for (int jj = 0, mm = B.length; jj < mm; jj++) {\n float odot = perp.dot(B[jj]);\n if (odot > dot) {\n dot = odot;\n sprime = B[jj];\n eprime = sprime;\n dj = jj;\n } else if (FloatMath.epsilonEquals(odot, dot)) {\n Vector2f perp2 = new Vector2f(B[jj].y - sprime.y, sprime.x - B[jj].x);\n if (perp.dot(perp2) < 0) {\n sprime = B[jj];\n } else {\n eprime = B[jj];\n }\n }\n }\n if (flip) {\n sprime = sprime.subtract(start);\n eprime = eprime.subtract(end);\n } else {\n sprime = start.subtract(sprime);\n eprime = end.subtract(eprime);\n }\n Vector2f distance = new Vector2f();\n getOutsideLinePenetration(sprime, eprime, radius, Vector2f.ZERO, distance);\n if (minDistance == null || minDistance.distanceSquared(Vector2f.ZERO) > distance.distanceSquared(Vector2f.ZERO)) {\n minDistance = distance;\n if (minDistance.equals(Vector2f.ZERO)) {\n break;\n }\n }\n }\n return minDistance;\n}\n"
|
"public boolean apply(Game game, Ability source) {\n Player controller = game.getPlayer(source.getControllerId());\n if (controller != null) {\n Mana mana = getMana(game, source);\n checkToFirePossibleEvents(mana, game, source);\n controller.getManaPool().addMana(mana, game, source);\n return true;\n }\n return false;\n}\n"
|
"protected Calc compileCall(final ResolvedFunCall call, ExpCompiler compiler, ResultStyle resultStyle) {\n final Calc ncalc = compiler.compileIter(call.getArg(0));\n if (ncalc == null) {\n return null;\n }\n final Calc calc = call.getArgCount() > 1 ? compiler.compileScalar(call.getArg(1), true) : new ValueCalc(call);\n if (ncalc instanceof ListCalc) {\n return genListCalc(call, ncalc, calc);\n } else {\n return genIterCalc(call, ncalc, calc);\n }\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.