content stringlengths 40 137k |
|---|
"Query makeProxQuery(EasyNode parent, int slop, String field, int maxSnippets) throws QueryGenException {\n Vector terms = new Vector();\n Vector notVec = new Vector();\n for (int i = 0; i < parent.nChildren(); i++) {\n EasyNode el = parent.child(i);\n if (!el.isElement())\n continue;\n if (el.name().equals(\"String_Node_Str\")) {\n if (slop <= 0)\n error(\"String_Node_Str\");\n notVec.add(parseQuery(el, field, maxSnippets));\n } else {\n SpanQuery q;\n if (slop == 0) {\n Term t = parseTerm(el, field, \"String_Node_Str\");\n if (isWildcardTerm(t))\n q = new XtfSpanWildcardQuery(t, req.termLimit);\n else\n q = new SpanTermQuery(t);\n q.setSpanRecording(maxSnippets);\n terms.add(q);\n } else\n terms.add(parseQuery(el, field, maxSnippets));\n }\n }\n if (terms.size() == 0)\n error(\"String_Node_Str\" + parent.name() + \"String_Node_Str\" + \"String_Node_Str\");\n SpanQuery q;\n SpanQuery[] termQueries = (SpanQuery[]) terms.toArray(new SpanQuery[terms.size()]);\n if (slop < 0)\n q = new SpanExactQuery(termQueries);\n else if (terms.size() == 1)\n q = (SpanQuery) terms.elementAt(0);\n else\n q = new SpanNearQuery(termQueries, slop, slop == 0);\n q.setSpanRecording(maxSnippets);\n return q;\n}\n"
|
"public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n super.onCreateView(inflater, container, savedInstanceState);\n View view = inflater.inflate(R.layout.media_grid_fragment, container, false);\n mRecycler = view.findViewById(R.id.recycler);\n mRecycler.setHasFixedSize(true);\n int numColumns = MediaGridAdapter.getColumnCount(getActivity());\n mGridManager = new GridLayoutManager(getActivity(), numColumns);\n mRecycler.setLayoutManager(mGridManager);\n mRecycler.setAdapter(getAdapter());\n final int minDistance = WPMediaUtils.getFlingDistanceToDisableThumbLoading(getActivity());\n mRecycler.setOnFlingListener(new RecyclerView.OnFlingListener() {\n public boolean onFling(int velocityX, int velocityY) {\n if (Math.abs(velocityY) > minDistance) {\n getAdapter().setLoadThumbnails(false);\n }\n return false;\n }\n });\n mRecycler.addOnScrollListener(new RecyclerView.OnScrollListener() {\n public void onScrollStateChanged(RecyclerView recyclerView, int newState) {\n super.onScrollStateChanged(recyclerView, newState);\n if (newState == RecyclerView.SCROLL_STATE_IDLE) {\n getAdapter().setLoadThumbnails(true);\n }\n }\n });\n mEmptyView = (TextView) view.findViewById(R.id.empty_view);\n mSwipeToRefreshHelper = buildSwipeToRefreshHelper((CustomSwipeRefreshLayout) view.findViewById(R.id.ptr_layout), new RefreshListener() {\n public void onRefreshStarted() {\n if (!isAdded()) {\n return;\n }\n if (!NetworkUtils.checkConnection(getActivity())) {\n updateEmptyView(EmptyViewMessageType.NETWORK_ERROR);\n setRefreshing(false);\n return;\n }\n fetchMediaList(false);\n }\n });\n if (savedInstanceState != null) {\n restoreState(savedInstanceState);\n }\n setFilter(mFilter);\n return view;\n}\n"
|
"private boolean isAllowedInSequence(Property property) {\n if (null == property) {\n return false;\n }\n if (property.isReadOnly()) {\n return false;\n }\n if (((SDOType) dataObject.getType()).getHelperContext().getXSDHelper().isAttribute(property)) {\n throw SDOException.sequenceAttributePropertyNotSupported(property.getName());\n }\n if (property.isOpenContent() && !dataObject.getType().isOpen()) {\n return false;\n }\n if (property.isMany()) {\n return true;\n }\n if (dataObject.isSet(property)) {\n throw SDOException.sequenceDuplicateSettingNotSupportedForComplexSingleObject(getIndexForProperty(property), property.getName());\n }\n return true;\n}\n"
|
"public ArrayField doGetValue() {\n return sameDiff.getArrayFactory().seluDerivative(larg().getValue(true), rarg().getValue(true));\n}\n"
|
"private String getRedisURL(final BridgeConfig config) {\n String url = System.getenv(\"String_Node_Str\");\n if (url == null) {\n url = System.getenv(\"String_Node_Str\");\n }\n if (url != null) {\n url = config.getProperty(\"String_Node_Str\");\n }\n return url;\n}\n"
|
"public void load(InputStream input, ProgressListener listener) throws IOException {\n CRCInputStream in = new CRCInputStream(input, new CRC8());\n int type = in.read();\n if (type != TYPE_INDEX) {\n throw new IllegalFormatException(\"String_Node_Str\");\n }\n numstrings = (int) VByte.decode(in);\n this.size = VByte.decode(in);\n blocksize = (int) VByte.decode(in);\n if (!in.readCRCAndCheck()) {\n throw new CRCException(\"String_Node_Str\");\n }\n blocks = new SequenceLog64();\n blocks.load(input, listener);\n in.setCRC(new CRC32());\n int block = 0;\n int buffer = 0;\n long bytePos = 0;\n long numBlocks = blocks.getNumberOfElements();\n long numBuffers = 1 + numBlocks / BLOCK_PER_BUFFER;\n data = new byte[(int) numBuffers][];\n posFirst = new long[(int) numBuffers];\n while (block < numBlocks - 1) {\n int nextBlock = (int) Math.min(numBlocks - 1, block + BLOCK_PER_BUFFER);\n long nextBytePos = blocks.get(nextBlock);\n data[buffer] = IOUtil.readBuffer(in, (int) (nextBytePos - bytePos), null);\n posFirst[buffer] = bytePos;\n bytePos = nextBytePos;\n block += BLOCK_PER_BUFFER;\n buffer++;\n }\n if (!in.readCRCAndCheck()) {\n throw new CRCException(\"String_Node_Str\");\n }\n}\n"
|
"public static void setUp() throws WSDLException {\n if (conn == null) {\n try {\n conn = buildConnection();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n String ddlCreateProp = System.getProperty(DATABASE_DDL_CREATE_KEY, DEFAULT_DATABASE_DDL_CREATE);\n if (\"String_Node_Str\".equalsIgnoreCase(ddlCreateProp)) {\n ddlCreate = true;\n }\n String ddlDropProp = System.getProperty(DATABASE_DDL_DROP_KEY, DEFAULT_DATABASE_DDL_DROP);\n if (\"String_Node_Str\".equalsIgnoreCase(ddlDropProp)) {\n ddlDrop = true;\n }\n String ddlDebugProp = System.getProperty(DATABASE_DDL_DEBUG_KEY, DEFAULT_DATABASE_DDL_DEBUG);\n if (\"String_Node_Str\".equalsIgnoreCase(ddlDebugProp)) {\n ddlDebug = true;\n }\n if (ddlCreate) {\n runDdl(conn, CREATE_USERS_TABLE, ddlDebug);\n runDdl(conn, CREATE_USERS_ID_LIST_TYPE, ddlDebug);\n runDdl(conn, CREATE_USERS_PKG, ddlDebug);\n runDdl(conn, CREATE_USERS_BODY, ddlDebug);\n try {\n Statement stmt = conn.createStatement();\n for (int i = 0; i < POPULATE_TABLE.length; i++) {\n stmt.addBatch(POPULATE_TABLE[i]);\n }\n stmt.executeBatch();\n } catch (SQLException e) {\n }\n }\n DBWS_BUILDER_XML_USERNAME = \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\";\n DBWS_BUILDER_XML_PASSWORD = \"String_Node_Str\";\n DBWS_BUILDER_XML_URL = \"String_Node_Str\";\n DBWS_BUILDER_XML_DRIVER = \"String_Node_Str\";\n DBWS_BUILDER_XML_PLATFORM = \"String_Node_Str\";\n DBWS_BUILDER_XML_MAIN = \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\";\n builder = new DBWSBuilder();\n OracleHelper builderHelper = new OracleHelper(builder);\n builder.setBuilderHelper(builderHelper);\n DBWSTestSuite.setUp(\"String_Node_Str\");\n}\n"
|
"private void doPutMetric(final int count, final Promise<List<String>> servoInstances) {\n final Map<String, Promise<String>> metrics = Maps.newHashMap();\n final List<String> instances = servoInstances.get();\n for (final String instanceId : instances) {\n final ActivitySchedulingOptions scheduler = new ActivitySchedulingOptions();\n scheduler.setTaskList(instanceId);\n scheduler.setScheduleToCloseTimeoutSeconds(120L);\n scheduler.setStartToCloseTimeoutSeconds(10L);\n metrics.put(instanceId, vmClient.getCloudWatchMetrics(scheduler));\n }\n final Promise<Map<String, String>> metricMap = Promises.mapOfPromisesToPromise(metrics);\n client.putCloudWatchMetrics(Promise.asPromise(this.accountId), Promise.asPromise(this.loadbalancer), metricMap);\n client.putCloudWatchInstanceHealth(this.accountId, this.loadbalancer);\n final WorkflowClock clock = contextProvider.getDecisionContext().getWorkflowClock();\n final Promise<Void> timer = clock.createTimer(PUT_PERIOD_SEC);\n putCloudWatchMetricPeriodic(count + 1, timer);\n}\n"
|
"public Uri processAndSaveImage(ImagePreset preset) {\n Uri uri = resetToOriginalImageIfNeeded(preset);\n if (uri != null) {\n return null;\n }\n resetProgress();\n boolean noBitmap = true;\n int num_tries = 0;\n int sampleSize = 1;\n Uri newSourceUri = moveSrcToAuxIfNeeded(mSourceUri, mDestinationFile);\n while (noBitmap) {\n try {\n updateProgress();\n Bitmap bitmap = ImageLoader.loadOrientedBitmapWithBackouts(mContext, newSourceUri, sampleSize);\n if (bitmap == null) {\n return null;\n }\n updateProgress();\n CachingPipeline pipeline = new CachingPipeline(FiltersManager.getManager(), \"String_Node_Str\");\n bitmap = pipeline.renderFinalImage(bitmap, preset);\n updateProgress();\n Object xmp = getPanoramaXMPData(newSourceUri, preset);\n ExifInterface exif = getExifData(newSourceUri);\n updateProgress();\n long time = System.currentTimeMillis();\n exif.addDateTimeStampTag(ExifInterface.TAG_DATE_TIME, time, TimeZone.getDefault());\n exif.setTag(exif.buildTag(ExifInterface.TAG_ORIENTATION, ExifInterface.Orientation.TOP_LEFT));\n exif.removeCompressedThumbnail();\n updateProgress();\n if (putExifData(mDestinationFile, exif, bitmap)) {\n putPanoramaXMPData(mDestinationFile, xmp);\n XmpPresets.writeFilterXMP(mContext, newSourceUri, mDestinationFile, preset);\n uri = SaveImage.linkNewFileToUri(mContext, mSelectedImageUri, mDestinationFile, time);\n }\n updateProgress();\n noBitmap = false;\n UsageStatistics.onEvent(UsageStatistics.COMPONENT_EDITOR, \"String_Node_Str\", null);\n } catch (OutOfMemoryError e) {\n if (++num_tries >= 5) {\n throw e;\n }\n System.gc();\n sampleSize *= 2;\n resetProgress();\n }\n }\n return uri;\n}\n"
|
"private void calculate(Graph g) {\n Node[] nodes = g.getNodes();\n for (Node n : nodes) {\n this.map.put(n, 0.0);\n }\n for (int i = 0; i < nodes.length; i++) {\n Node s = nodes[i];\n Stack<Node> S = new Stack<Node>();\n HashMap<Node, ArrayList<Node>> P = new HashMap<Node, ArrayList<Node>>();\n for (Node n : nodes) {\n P.put(n, new ArrayList<Node>());\n }\n HashMap<Node, Integer> sigma = new HashMap<Node, Integer>();\n for (Node n : nodes) {\n sigma.put(n, 0);\n }\n sigma.put(s, 1);\n HashMap<Node, Integer> d = new HashMap<Node, Integer>();\n for (Node n : nodes) {\n d.put(n, -1);\n }\n d.put(s, 0);\n LinkedList<Node> Q = new LinkedList<Node>();\n Q.add(s);\n while (!Q.isEmpty()) {\n Node v = Q.remove();\n S.add(v);\n for (int outIndex : v.getOutgoingEdges()) {\n Node w = nodes[outIndex];\n if (d.get(w) < 0) {\n Q.add(w);\n d.put(w, d.get(v) + 1);\n }\n if (d.get(w).intValue() == d.get(v).intValue() + 1) {\n sigma.put(w, sigma.get(w) + sigma.get(v));\n P.get(w).add(v);\n }\n }\n }\n HashMap<Node, Double> delta = new HashMap<Node, Double>();\n for (Node n : nodes) {\n delta.put(n, 0.0);\n }\n while (!S.isEmpty()) {\n Node w = S.pop();\n for (Node v : P.get(w)) {\n delta.put(v, delta.get(v) + ((double) sigma.get(v)) / sigma.get(w) * (1 + sigma.get(w)));\n }\n if (w != s) {\n map.put(w, map.get(w) + delta.get(w));\n }\n }\n }\n}\n"
|
"public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n dataFetcher = new OCTranspoDataFetcher(this);\n Log.d(TAG, \"String_Node_Str\");\n db = (new DatabaseHelper(this)).getReadableDatabase();\n Log.d(TAG, \"String_Node_Str\");\n mapView = (MapView) findViewById(R.id.mapView);\n mapView.setBuiltInZoomControls(true);\n stopNumberField = (EditText) findViewById(R.id.stopNumber);\n routeNumberField = (EditText) findViewById(R.id.routeNumber);\n if (savedInstanceState != null) {\n result = (GetNextTripsForStopResult) savedInstanceState.getSerializable(\"String_Node_Str\");\n stopNumberField.setText(savedInstanceState.getString(\"String_Node_Str\"));\n routeNumberField.setText(savedInstanceState.getString(\"String_Node_Str\"));\n }\n if (result != null) {\n GeoPoint stopLocation = null;\n try {\n stopLocation = getStopLocation(result.getStopNumber());\n } catch (IllegalArgumentException e) {\n }\n displayGetNextTripsForStopResult(result, stopLocation);\n } else {\n MapController mapController = mapView.getController();\n mapController.zoomToSpan((globalMaxLatitude - globalMinLatitude), (globalMaxLongitude - globalMinLongitude));\n mapController.setCenter(new GeoPoint((globalMaxLatitude + globalMinLatitude) / 2, (globalMaxLongitude + globalMinLongitude) / 2));\n }\n final Button updateButton = (Button) findViewById(R.id.updateButton);\n updateButton.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n updateButton.setEnabled(false);\n InputMethodManager imm = (InputMethodManager) BusFollowerActivity.this.getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(updateButton.getWindowToken(), 0);\n final String stopNumber = stopNumberField.getText().toString();\n final String routeNumber = routeNumberField.getText().toString();\n new Thread(new Runnable() {\n public void run() {\n GeoPoint stopLocation = null;\n String errorString;\n try {\n stopLocation = getStopLocation(stopNumber);\n result = dataFetcher.getNextTripsForStop(stopNumber, routeNumber);\n errorString = getErrorString(result.getError());\n } catch (IOException e) {\n errorString = BusFollowerActivity.this.getString(R.string.server_error);\n } catch (XmlPullParserException e) {\n errorString = BusFollowerActivity.this.getString(R.string.invalid_response);\n } catch (IllegalArgumentException e) {\n errorString = e.getMessage();\n }\n final String errorStringFinal = errorString;\n if (errorString != null) {\n BusFollowerActivity.this.runOnUiThread(new Runnable() {\n public void run() {\n AlertDialog.Builder builder = new AlertDialog.Builder(BusFollowerActivity.this);\n builder.setTitle(R.string.error).setMessage(errorStringFinal).setNegativeButton(BusFollowerActivity.this.getString(R.string.ok), new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n dialog.cancel();\n }\n });\n AlertDialog alert = builder.create();\n alert.show();\n updateButton.setEnabled(true);\n }\n });\n return;\n }\n BusFollowerActivity.this.displayGetNextTripsForStopResult(result, stopLocation);\n mapView.post(new Runnable() {\n public void run() {\n mapView.invalidate();\n updateButton.setEnabled(true);\n }\n });\n }\n }).start();\n }\n });\n routeNumberField.setOnEditorActionListener(new TextView.OnEditorActionListener() {\n public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {\n if (actionId == EditorInfo.IME_ACTION_DONE) {\n updateButton.performClick();\n return true;\n }\n return false;\n }\n });\n}\n"
|
"public void trimToSize() {\n longs = Arrays.copyOf(longs, longsSize(size));\n countCache0 = Arrays.copyOf(countCache0, countCache0Size(size));\n}\n"
|
"public void onTabHoist(final Tab tab) {\n tab.detach();\n final View outView = findExistingTabView(webViewSlot);\n webViewSlot.removeView(outView);\n final View inView = tab.getTabView().getView();\n webViewSlot.addView(inView);\n}\n"
|
"public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException {\n try {\n return super.onTransact(code, data, reply, flags);\n } catch (RuntimeException e) {\n if (!(e instanceof SecurityException)) {\n Slog.wtf(\"String_Node_Str\", \"String_Node_Str\", e);\n }\n throw e;\n }\n}\n"
|
"public boolean canInsertItem(int slot, ItemStack stack, EnumFacing direction) {\n switch(slot) {\n case SPECIMEN_SLOT_ID:\n return isValid(stack);\n case JOURNAL_SLOT_ID:\n return this.journal == null && this.isItemValidForSlot(slot, stack);\n default:\n return false;\n }\n return false;\n}\n"
|
"public SootMethod next() {\n if (!hasNext())\n throw new NoSuchElementException();\n SootMethod n = current;\n current = null;\n SootClass currentClass = n.getDeclaringClass();\n while (true) {\n SootClass superClass = currentClass.getSuperclassUnsafe();\n if (superClass == null)\n break;\n SootMethod m = superClass.getMethodUnsafe(sigClinit);\n if (m != null) {\n current = m;\n break;\n }\n currentClass = superClass;\n }\n return n;\n}\n"
|
"public String getReturnTypeAsString() {\n return returnType.toString();\n}\n"
|
"private void setupTab(LinearLayout currentTab, String total, final StatsVisitorsAndViewsFragment.OverviewLabel itemType) {\n final TextView label;\n final TextView value;\n final ImageView icon;\n currentTab.setTag(itemType);\n if (itemType == StatsVisitorsAndViewsFragment.OverviewLabel.VIEWS) {\n currentTab.setOnClickListener(ViewsTabOnClickListener);\n } else {\n currentTab.setClickable(false);\n }\n label = (TextView) currentTab.findViewById(R.id.stats_visitors_and_views_tab_label);\n label.setText(itemType.getLabel());\n value = (TextView) currentTab.findViewById(R.id.stats_visitors_and_views_tab_value);\n value.setText(total);\n label.setTextColor(getResources().getColor(R.color.grey_darken_20));\n value.setTextColor(getResources().getColor(R.color.blue_wordpress));\n icon = (ImageView) currentTab.findViewById(R.id.stats_visitors_and_views_tab_icon);\n icon.setImageDrawable(getTabIcon(itemType));\n if (itemType == StatsVisitorsAndViewsFragment.OverviewLabel.COMMENTS) {\n currentTab.setBackgroundResource(R.drawable.stats_visitors_and_views_button_latest_white);\n } else {\n currentTab.setBackgroundResource(R.drawable.stats_visitors_and_views_button_white);\n }\n}\n"
|
"static long asPrice(String s) throws ParseException {\n if (\"String_Node_Str\".equals(s))\n return -1;\n BigDecimal v = (BigDecimal) FMT_PRICE.get().parse(s);\n return v.multiply(Values.Quote.getBigDecimalFactor()).longValue();\n}\n"
|
"protected void writeProperty(final EdmProperty edmProperty, final Property property, final Set<List<String>> selectedPaths, final JsonGenerator json) throws IOException, SerializerException {\n json.writeFieldName(edmProperty.getName());\n if (property == null || property.isNull()) {\n if (edmProperty.isNullable() == Boolean.FALSE) {\n throw new SerializerException(\"String_Node_Str\", SerializerException.MessageKeys.MISSING_PROPERTY, edmProperty.getName());\n } else {\n if (edmProperty.isCollection()) {\n json.writeStartArray();\n json.writeEndArray();\n } else {\n json.writeNull();\n }\n }\n } else {\n writePropertyValue(metadata, edmProperty, property, selectedPaths, json);\n }\n}\n"
|
"public void paint(Graphics g) {\n Graphics2D g2 = (Graphics2D) g;\n tilePainted = provisionalGUITile != null && hexMap.isTilePainted(provisionalGUITile.getTileId()) || currentGUITile != null && hexMap.isTilePainted(currentGUITile.getTileId());\n if (getAntialias()) {\n g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n } else {\n g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);\n }\n Color terrainColor = Color.WHITE;\n if (isSelected()) {\n if (!hexMap.hasMapImage()) {\n g2.setColor(highlightColor);\n g2.fill(hexagon);\n g2.setColor(terrainColor);\n g2.fill(innerHexagonSelected);\n g2.setColor(Color.black);\n g2.draw(innerHexagonSelected);\n } else {\n g2.setColor(highlightColor);\n g2.draw(hexagon);\n Stroke oldStroke = g2.getStroke();\n g2.setStroke(new BasicStroke(4));\n g2.draw(innerHexagonSelected);\n g2.setStroke(oldStroke);\n g2.setColor(Color.black);\n }\n } else if (isSelectable()) {\n if (!hexMap.hasMapImage()) {\n g2.setColor(selectableColor);\n g2.fill(hexagon);\n g2.setColor(terrainColor);\n g2.fill(innerHexagonSelectable);\n g2.setColor(Color.black);\n g2.draw(innerHexagonSelectable);\n } else {\n g2.setColor(selectableColor);\n g2.draw(hexagon);\n g2.setColor(Color.black);\n }\n }\n if (tilePainted)\n paintOverlay(g2);\n paintStationTokens(g2);\n paintOffStationTokens(g2);\n if (!tilePainted)\n return;\n FontMetrics fontMetrics = g2.getFontMetrics();\n if (getHexModel().getTileCost() > 0) {\n g2.drawString(Currency.format(getHexModel(), getHexModel().getTileCost()), rectBound.x + (rectBound.width - fontMetrics.stringWidth(Integer.toString(getHexModel().getTileCost()))) * 3 / 5, rectBound.y + ((fontMetrics.getHeight() + rectBound.height) * 9 / 15));\n }\n Map<PublicCompany, Stop> homes = getHexModel().getHomes();\n if (homes != null) {\n Stop homeCity;\n Point p;\n for (PublicCompany company : homes.keySet()) {\n if (company.isClosed())\n continue;\n if (model.hasTokenOfCompany(company))\n continue;\n homeCity = homes.get(company);\n if (homeCity == null) {\n List<Stop> stops = getHexModel().getStops();\n for (Stop stop : stops) {\n if (stop.hasTokenSlotsLeft()) {\n homeCity = stop;\n break;\n }\n }\n }\n p = getTokenCenter(1, homeCity.getBaseTokens().size(), getHexModel().getStops().size(), homeCity.getNumber() - 1);\n drawHome(g2, company, p);\n }\n }\n if (getHexModel().isBlockedForTileLays()) {\n List<PrivateCompany> privates = hexMap.getOrUIManager().getGameUIManager().getGameManager().getCompanyManager().getAllPrivateCompanies();\n for (PrivateCompany p : privates) {\n List<MapHex> blocked = p.getBlockedHexes();\n if (blocked != null) {\n for (MapHex hex : blocked) {\n if (getHexModel().equals(hex)) {\n String text = \"String_Node_Str\" + p.getId() + \"String_Node_Str\";\n g2.drawString(text, rectBound.x + (rectBound.width - fontMetrics.stringWidth(text)) * 1 / 2, rectBound.y + ((fontMetrics.getHeight() + rectBound.height) * 5 / 15));\n }\n }\n }\n }\n }\n if (model.isReservedForCompany() && currentTiled == model.getPreprintedTiled()) {\n String text = \"String_Node_Str\" + model.getReservedForCompany() + \"String_Node_Str\";\n g2.drawString(text, rectBound.x + (rectBound.width - fontMetrics.stringWidth(text)) * 1 / 2, rectBound.y + ((fontMetrics.getHeight() + rectBound.height) * 5 / 25));\n }\n}\n"
|
"public void testTwoClientsToSendAndReceive() throws Exception {\n setClientCount(2);\n clients = createClients();\n adapter0 = getOutgoingFileTransfer(0);\n adapter0.addListener(requestListener);\n adapter1 = getOutgoingFileTransfer(1);\n for (int i = 0; i < 2; i++) {\n connectClient(i);\n }\n final IFileID targetID = createFileID(adapter1, getServerConnectID(0), TESTSRCFILE);\n adapter1.sendOutgoingRequest(targetID, new File(TESTSRCFILE), senderTransferListener, null);\n sleep(5000);\n}\n"
|
"protected void onPostExecute(ArrayList<ZipObjectParcelable> zipEntries) {\n super.onPostExecute(zipEntries);\n onFinish.onAsyncTaskFinished(zipEntries);\n}\n"
|
"public void onSystemUiVisibilityChange(int visibility) {\n Toast.makeText(this, \"String_Node_Str\" + visibility, Toast.LENGTH_SHORT).show();\n if (areSystemControlsVisible(visibility) && !isFinishing()) {\n showControls();\n }\n}\n"
|
"private boolean isPositionHeader(int position) {\n if (main.islist)\n return position == 0;\n else\n return position == 0 || position == 1 || position == 2;\n}\n"
|
"private Agent createIceAgent() {\n ProtocolProviderServiceJabberImpl provider = getCallPeer().getProtocolProvider();\n NetworkAddressManagerService namSer = getNetAddrMgr();\n Agent agent = namSer.createIceAgent();\n JabberAccountID accID = (JabberAccountID) provider.getAccountID();\n if (accID.isStunServerDiscoveryEnabled()) {\n String username = provider.getOurJID();\n String password = JabberActivator.getProtocolProviderFactory().loadPassword(accID);\n StunCandidateHarvester autoHarvester = namSer.discoverStunServer(accID.getService(), StringUtils.getUTF8Bytes(username), StringUtils.getUTF8Bytes(password));\n logger.info(\"String_Node_Str\" + autoHarvester);\n if (autoHarvester != null)\n agent.addCandidateHarvester(autoHarvester);\n }\n for (StunServerDescriptor desc : accID.getStunServers()) {\n TransportAddress addr = new TransportAddress(desc.getAddress(), desc.getPort(), Transport.UDP);\n StunCandidateHarvester harvester;\n if (desc.isTurnSupported()) {\n harvester = new TurnCandidateHarvester(addr, new LongTermCredential(desc.getUsername(), desc.getPassword()));\n } else {\n harvester = new StunCandidateHarvester(addr);\n }\n logger.info(\"String_Node_Str\" + harvester);\n agent.addCandidateHarvester(harvester);\n }\n return agent;\n}\n"
|
"public static PubSubPublisher getPubsubManager(String serviceName) {\n PubSubPublisher publisher;\n if (instances.containsKey(serviceName)) {\n publisher = instances.get(serviceName);\n } else {\n publisher = new PubSubPublisher(serviceName);\n instances.put(serviceName, publisher);\n }\n return instances.get(serviceName);\n}\n"
|
"private void symmetricEncInterceptorConfigXmlGenerator(StringBuilder xml, NetworkConfig netCfg) {\n final SymmetricEncryptionConfig sec = netCfg.getSymmetricEncryptionConfig();\n if (sec != null) {\n xml.append(\"String_Node_Str\").append(sec.isEnabled()).append(\"String_Node_Str\");\n xml.append(\"String_Node_Str\").append(sec.getAlgorithm()).append(\"String_Node_Str\");\n xml.append(\"String_Node_Str\").append(sec.getSalt()).append(\"String_Node_Str\");\n xml.append(\"String_Node_Str\").append(sec.getPassword()).append(\"String_Node_Str\");\n xml.append(\"String_Node_Str\").append(sec.getIterationCount()).append(\"String_Node_Str\");\n xml.append(\"String_Node_Str\");\n }\n}\n"
|
"public CombatGroup findGroup(UUID attackerId) {\n for (CombatGroup group : groups) {\n if (group.getAttackers().contains(attackerId)) {\n return group;\n }\n return null;\n}\n"
|
"public static void testOpImage(OpImage dst, Rectangle dstRect) {\n for (int i = 0; i < dst.getNumSources(); i++) {\n PlanarImage src = dst.getSourceImage(i);\n Rectangle srcRect = dst.mapDestRect(dstRect, i);\n String message = \"String_Node_Str\" + (i + 1) + \"String_Node_Str\";\n printPixels(message, src, srcRect);\n }\n printPixels(\"String_Node_Str\", dst, dstRect);\n}\n"
|
"public void openStartElement(XPathFragment xPathFragment, NamespaceResolver namespaceResolver) {\n super.openStartElement(xPathFragment, namespaceResolver);\n try {\n String namespaceURI = xPathFragment.getNamespaceURI();\n if (namespaceURI == null) {\n NamespaceContext namespaceContext = xmlStreamWriter.getNamespaceContext();\n if (null == namespaceContext) {\n xmlStreamWriter.writeStartElement(xPathFragment.getLocalName());\n } else {\n xmlStreamWriter.writeStartElement(XMLConstants.EMPTY_STRING, xPathFragment.getLocalName(), XMLConstants.EMPTY_STRING);\n String defaultNamespace = xmlStreamWriter.getNamespaceContext().getNamespaceURI(XMLConstants.EMPTY_STRING);\n if (defaultNamespace != null && defaultNamespace.length() > 0) {\n xmlStreamWriter.writeDefaultNamespace(XMLConstants.EMPTY_STRING);\n }\n }\n } else {\n String prefix = xPathFragment.getPrefix();\n if (prefix == null) {\n prefix = XMLConstants.EMPTY_STRING;\n }\n xmlStreamWriter.writeStartElement(prefix, xPathFragment.getLocalName(), namespaceURI);\n }\n writePrefixMappings();\n } catch (XMLStreamException e) {\n throw XMLMarshalException.marshalException(e);\n }\n}\n"
|
"private static void openTraceIfNecessary(IProject project) {\n String traceToOpen = TracingRcpPlugin.getDefault().getCli().getArgument(CliParser.OPEN_FILE_LOCATION);\n if (traceToOpen != null) {\n try {\n TmfTraceFolder destinationFolder = TmfProjectRegistry.getProject(project, true).getTracesFolder();\n TmfOpenTraceHelper.openTraceFromPath(destinationFolder, traceToOpen, TracingRcpPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell());\n } catch (CoreException e) {\n TracingRcpPlugin.getDefault().logError(e.getMessage());\n }\n }\n}\n"
|
"private BinaryOperator<FundsByFunderDto> sumFunds() {\n return (fundsByFunder1, fundsByFunder2) -> FundsByFunderDto.builder().funderUserId(fundsByFunder1.getFunderUserId()).funderAddress(fundsByFunder1.getFunderAddress()).fndValue(TokenValueDto.sum(fundsByFunder1.getFndValue(), fundsByFunder2.getFndValue())).otherValue(TokenValueDto.sum(fundsByFunder1.getOtherValue(), fundsByFunder2.getOtherValue())).build();\n}\n"
|
"public boolean isTestDataComplete() {\n if (StringUtils.isEmpty(getDataFile())) {\n final int paramListSize = getParameterListSize();\n ITDManager testDataManager = getDataManager();\n List<IParamDescriptionPO> requiredParameters = new ArrayList<IParamDescriptionPO>(getParameterList());\n IParameterInterfacePO refDataCube = getReferencedDataCube();\n for (int i = 0; i < testDataManager.getDataSetCount(); i++) {\n for (IParamDescriptionPO paramDesc : requiredParameters) {\n int column = testDataManager.findColumnForParam(paramDesc.getUniqueId());\n if (refDataCube != null) {\n IParamDescriptionPO dataCubeParam = refDataCube.getParameterForName(paramDesc.getName());\n if (dataCubeParam != null) {\n column = testDataManager.findColumnForParam(dataCubeParam.getUniqueId());\n }\n }\n String value = TestDataBP.INSTANCE.getTestData(this, testDataManager, paramDesc, i);\n if (StringUtils.isBlank(value) && column >= -1) {\n if (this instanceof IExecTestCasePO) {\n IExecTestCasePO exec = (IExecTestCasePO) this;\n nodes = exec.getSpecTestCase().getUnmodifiableNodeList();\n String result = AbstractParamInterfaceBP.getValueForSpecNodeWithParamDesc(paramDesc, exec.getSpecTestCase(), column);\n if (StringUtils.isNotBlank(result)) {\n return true;\n }\n }\n }\n String value = TestDataBP.INSTANCE.getTestData(this, testDataManager, paramDesc, i);\n if (StringUtils.isNotEmpty(value)) {\n ModelParamValueConverter mpvc = new ModelParamValueConverter(value, this, paramDesc);\n List<RefToken> referenceTokens = mpvc.getRefTokens();\n String uiValue = mpvc.getGuiString();\n for (RefToken token : referenceTokens) {\n if (uiValue.contains(token.getModelString())) {\n return false;\n }\n }\n } else {\n if (this instanceof ICapPO) {\n ICapPO cap = (ICapPO) this;\n if (!ParamNameBP.isOptionalParameter(cap, paramDesc.getUniqueId())) {\n return false;\n }\n } else {\n return false;\n }\n }\n }\n }\n if ((testDataManager.getDataSetCount() == 0) && (paramListSize > 0)) {\n return false;\n }\n if (getParameterListSize() > testDataManager.getColumnCount()) {\n return false;\n }\n }\n return true;\n}\n"
|
"public void download() {\n mDownloader.setOnDownloadListener(new Downloader.OnDownloadListener() {\n\n public void onSuccess(File file) {\n mDownloadDialog.dismiss();\n onDownloadListener.onSuccess(file);\n }\n public void onFail(Exception e) {\n mDownloadDialog.dismiss();\n onDownloadListener.onFail(e);\n }\n });\n }\n ConnectingDialog.setTitle(mContext.getResources().getString(R.string.connecting));\n ConnectingDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n ConnectingDialog.setMessage(mDownloader.getURL().toString());\n if (mCancelable) {\n ConnectingDialog.setButton(DialogInterface.BUTTON_NEGATIVE, mContext.getString(R.string.cancel), new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n mDownloader.cancel();\n }\n });\n }\n ConnectingDialog.show();\n mDownloader.setOnUpdateListener(new Downloader.OnUpdateListener() {\n public void onUpdate(int MAX, int Downloaded) {\n updateProgress(MAX, Downloaded);\n }\n });\n mDownloader.download();\n Log.i(TAG, \"String_Node_Str\");\n}\n"
|
"protected Object check(HadoopServiceProperties serviceProperties, ClassLoader classLoader) throws Exception {\n Object fileSystem = null;\n try {\n Object conf = Class.forName(\"String_Node_Str\", true, classLoader).newInstance();\n URI nameNodeURI = URI.create(serviceProperties.getNameNode());\n String scheme = nameNodeURI.getScheme();\n ReflectionUtils.invokeMethod(conf, \"String_Node_Str\", new Object[] { String.format(\"String_Node_Str\", scheme), \"String_Node_Str\" });\n ReflectionUtils.invokeMethod(conf, \"String_Node_Str\", new Object[] { \"String_Node_Str\", \"String_Node_Str\" });\n ReflectionUtils.invokeMethod(conf, \"String_Node_Str\", new Object[] { \"String_Node_Str\", \"String_Node_Str\" });\n setHadoopProperties(conf, serviceProperties);\n String userName = StringUtils.trimToNull(serviceProperties.getUserName());\n String group = StringUtils.trimToNull(serviceProperties.getGroup());\n boolean useKrb = serviceProperties.isUseKrb();\n boolean useMaprTicket = serviceProperties.isMaprT();\n if (useKrb) {\n String nameNodePrincipal = serviceProperties.getPrincipal();\n ReflectionUtils.invokeMethod(conf, \"String_Node_Str\", new Object[] { \"String_Node_Str\", nameNodePrincipal });\n }\n if (useMaprTicket) {\n setMaprTicketPropertiesConfig(serviceProperties);\n }\n if (useKrb) {\n boolean useKeytab = serviceProperties.isUseKeytab();\n if (useKeytab) {\n String keytabPrincipal = serviceProperties.getKeytabPrincipal();\n String keytab = serviceProperties.getKeytab();\n ReflectionUtils.invokeStaticMethod(\"String_Node_Str\", classLoader, \"String_Node_Str\", new String[] { keytabPrincipal, keytab });\n }\n } else if (userName != null && group != null) {\n ReflectionUtils.invokeMethod(conf, \"String_Node_Str\", new Object[] { \"String_Node_Str\", userName + \"String_Node_Str\" + group });\n }\n fileSystem = ReflectionUtils.invokeStaticMethod(\"String_Node_Str\", classLoader, \"String_Node_Str\", new Object[] { nameNodeURI, conf });\n if (fileSystem != null) {\n Object pathObj = ReflectionUtils.newInstance(\"String_Node_Str\", classLoader, new Object[] { \"String_Node_Str\" });\n ReflectionUtils.invokeMethod(fileSystem, \"String_Node_Str\", new Object[] { pathObj });\n }\n } finally {\n if (fileSystem != null) {\n try {\n ReflectionUtils.invokeMethod(fileSystem, \"String_Node_Str\", new Object[0]);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n return fileSystem;\n}\n"
|
"protected void adjustGridLayout() {\n super.adjustGridLayout();\n ((GridData) verticalAlign.getComboBoxControl(getFieldEditorParent()).getLayoutData()).widthHint = 167;\n ((GridData) textAlign.getComboBoxControl(getFieldEditorParent()).getLayoutData()).widthHint = 167;\n ((GridData) textTrans.getComboBoxControl(getFieldEditorParent()).getLayoutData()).widthHint = 167;\n ((GridData) whiteSpace.getComboBoxControl(getFieldEditorParent()).getLayoutData()).widthHint = 167;\n ((GridData) display.getComboBoxControl(getFieldEditorParent()).getLayoutData()).widthHint = 167;\n ((GridData) direction.getComboBoxControl(getFieldEditorParent()).getLayoutData()).widthHint = 167;\n}\n"
|
"private Collection<RootInfo> loadRootsForAuthority(ContentResolver resolver, String authority) {\n if (DEBUG)\n Log.d(TAG, \"String_Node_Str\" + authority);\n synchronized (mObservedAuthorities) {\n if (mObservedAuthorities.add(authority)) {\n final Uri rootsUri = DocumentsContract.buildRootsUri(authority);\n mContext.getContentResolver().registerContentObserver(rootsUri, true, mObserver);\n }\n }\n final Uri rootsUri = DocumentsContract.buildRootsUri(authority);\n if (!forceRefresh) {\n final Bundle systemCache = resolver.getCache(rootsUri);\n if (systemCache != null) {\n if (DEBUG)\n Log.d(TAG, \"String_Node_Str\" + authority);\n return systemCache.getParcelableArrayList(TAG);\n }\n }\n final ArrayList<RootInfo> roots = new ArrayList<>();\n ContentProviderClient client = null;\n Cursor cursor = null;\n try {\n client = DocumentsApplication.acquireUnstableProviderOrThrow(resolver, authority);\n cursor = client.query(rootsUri, null, null, null, null);\n while (cursor.moveToNext()) {\n final RootInfo root = RootInfo.fromRootsCursor(authority, cursor);\n roots.add(root);\n }\n } catch (Exception e) {\n Log.w(TAG, \"String_Node_Str\" + authority + \"String_Node_Str\" + e);\n } finally {\n IoUtils.closeQuietly(cursor);\n ContentProviderClient.releaseQuietly(client);\n }\n if (ENABLE_SYSTEM_CACHE) {\n final Bundle systemCache = new Bundle();\n systemCache.putParcelableArrayList(TAG, roots);\n resolver.putCache(rootsUri, systemCache);\n }\n return roots;\n}\n"
|
"public boolean updateInDatabase(Context context, String oldName) {\n if (oldName == null || oldName.isEmpty()) {\n oldName = getName();\n }\n Environment oldEnvironment = getFullEnvironment(context, oldName);\n if (oldEnvironment == null)\n return false;\n ContentValues environmentValues = new ContentValues();\n environmentValues.put(EnvironmentEntry.COLUMN_NAME, getName());\n environmentValues.put(EnvironmentEntry.COLUMN_BLUETOOTH_ALL_OR_ANY, isBluetoothAllOrAny() ? 1 : 0);\n environmentValues.put(EnvironmentEntry.COLUMN_IS_ENABLED, isEnabled() ? 1 : 0);\n environmentValues.put(EnvironmentEntry.COLUMN_ENVIRONMENT_HINT, getHint());\n if (hasNoiseLevel && getNoiseLevelEnvironmentVariable() != null) {\n environmentValues.put(EnvironmentEntry.COLUMN_IS_MAX_NOISE_ENABLED, getNoiseLevelEnvironmentVariable().hasUpperLimit);\n environmentValues.put(EnvironmentEntry.COLUMN_IS_MIN_NOISE_ENABLED, getNoiseLevelEnvironmentVariable().hasLowerLimit);\n environmentValues.put(EnvironmentEntry.COLUMN_MAX_NOISE_LEVEL, getNoiseLevelEnvironmentVariable().getUpperLimit());\n environmentValues.put(EnvironmentEntry.COLUMN_MIN_NOISE_LEVEL, getNoiseLevelEnvironmentVariable().getLowerLimit());\n } else {\n environmentValues.put(EnvironmentEntry.COLUMN_IS_MAX_NOISE_ENABLED, false);\n environmentValues.put(EnvironmentEntry.COLUMN_IS_MIN_NOISE_ENABLED, false);\n }\n context.getContentResolver().update(EnvironmentEntry.buildEnvironmentUriWithId(oldEnvironment.id), environmentValues, null, null);\n if (oldEnvironment.hasLocation) {\n if (hasLocation && !oldEnvironment.locationEnvironmentVariable.equals(locationEnvironmentVariable)) {\n int updatedEntries = context.getContentResolver().update(EnvironmentEntry.buildEnvironmentUriWithIdAndLocation(oldEnvironment.id), locationEnvironmentVariable.getContentValues(), null, null);\n if (updatedEntries > 1) {\n removeFromCurrentGeofences(oldEnvironment.getLocationEnvironmentVariable(), context);\n }\n } else if (!hasLocation) {\n context.getContentResolver().delete(EnvironmentEntry.buildEnvironmentUriWithIdAndLocation(oldEnvironment.id), null, null);\n }\n } else if (hasLocation) {\n context.getContentResolver().insert(EnvironmentEntry.buildEnvironmentUriWithIdAndLocation(oldEnvironment.id), locationEnvironmentVariable.getContentValues());\n }\n if (oldEnvironment.hasWiFiNetwork) {\n if (hasWiFiNetwork && !oldEnvironment.wiFiEnvironmentVariable.equals(wiFiEnvironmentVariable)) {\n context.getContentResolver().update(EnvironmentEntry.buildEnvironmentUriWithIdAndWifi(oldEnvironment.id), wiFiEnvironmentVariable.getContentValues(), null, null);\n } else if (!hasWiFiNetwork) {\n context.getContentResolver().delete(EnvironmentEntry.buildEnvironmentUriWithIdAndWifi(oldEnvironment.id), null, null);\n }\n } else if (hasWiFiNetwork) {\n context.getContentResolver().insert(EnvironmentEntry.buildEnvironmentUriWithIdAndWifi(oldEnvironment.id), wiFiEnvironmentVariable.getContentValues());\n }\n context.getContentResolver().delete(EnvironmentEntry.buildEnvironmentUriWithIdAndBluetooth(oldEnvironment.id), null, null);\n if (hasBluetoothDevices && getBluetoothEnvironmentVariables() != null && !getBluetoothEnvironmentVariables().isEmpty()) {\n Vector<BluetoothEnvironmentVariable> bluetoothEnvironmentVariables = getBluetoothEnvironmentVariables();\n Uri insertUri = EnvironmentEntry.buildEnvironmentUriWithIdAndBluetooth(oldEnvironment.id);\n for (BluetoothEnvironmentVariable variable : bluetoothEnvironmentVariables) {\n ContentValues bluetoothValues = variable.getContentValues();\n context.getContentResolver().insert(insertUri, bluetoothValues);\n }\n }\n return true;\n}\n"
|
"protected void configureShell(Shell newShell) {\n super.configureShell(newShell);\n newShell.setText(Messages.getString(\"String_Node_Str\"));\n newShell.setSize(580, 450);\n setHelpAvailable(false);\n}\n"
|
"private void performRslCopy(MavenProject artifactProject) throws MojoExecutionException {\n List<Artifact> rslDeps = getRSLDependencies(artifactProject);\n if (rslDeps.isEmpty()) {\n return;\n }\n String[] rslUrls = getRslUrls(artifactProject);\n for (Artifact rslArtifact : rslDeps) {\n String extension;\n if (RSL.equals(rslArtifact.getScope())) {\n extension = SWF;\n } else {\n extension = SWZ;\n }\n rslArtifact = artifactFactory.createArtifactWithClassifier(rslArtifact.getGroupId(), rslArtifact.getArtifactId(), rslArtifact.getVersion(), extension, null);\n rslArtifact = replaceWithResolvedArtifact(rslArtifact);\n File[] destFiles = resolveRslDestination(rslUrls, rslArtifact, extension);\n File sourceFile = rslArtifact.getFile();\n for (File destFile : destFiles) {\n copy(sourceFile, destFile);\n }\n }\n}\n"
|
"public void visit(RolapMember member) {\n members.add(member);\n}\n"
|
"public boolean setUseGlobalBlockBlacklist(CommandSender sender, String[] args) {\n hasPermission = checkPerm(sender, \"String_Node_Str\");\n if (!hasPermission) {\n return false;\n }\n if (args.length < 4) {\n cb.plugin.sendNospawnMessage(sender, \"String_Node_Str\", ChatColor.RED);\n return false;\n }\n if (this.server.getWorld(args[1]) == null) {\n cb.plugin.sendNospawnMessage(sender, \"String_Node_Str\", ChatColor.RED);\n return false;\n }\n if (ConfigBuffer.MobMap.containsKey(mob)) {\n if (args[3].equals(\"String_Node_Str\")) {\n config.set(\"String_Node_Str\" + args[1] + \"String_Node_Str\" + args[2] + \"String_Node_Str\", true);\n cb.plugin.sendNospawnMessage(sender, args[2] + \"String_Node_Str\", ChatColor.GREEN);\n saveConfig();\n cb.readConfig();\n } else if (args[3].equals(\"String_Node_Str\")) {\n config.set(\"String_Node_Str\" + args[1] + \"String_Node_Str\" + args[2] + \"String_Node_Str\", false);\n cb.plugin.sendNospawnMessage(sender, args[2] + \"String_Node_Str\", ChatColor.GREEN);\n saveConfig();\n cb.readConfig();\n }\n return true;\n } else {\n cb.plugin.sendNospawnMessage(sender, \"String_Node_Str\" + args[2] + \"String_Node_Str\", ChatColor.RED);\n return false;\n }\n}\n"
|
"public long getLong(int length) {\n long value = 0;\n for (int i = 0; i < length; i++) {\n checkPosition();\n value |= (data.getBit(position++) ? 1L : 0L) << (i % Long.SIZE);\n }\n return value;\n}\n"
|
"public static ObjectInputStream create(BundleContext ctxt, InputStream ins) throws IOException {\n return create(ctxt, ins, null);\n}\n"
|
"static void initPredefined(RenderScript rs) {\n rs.nInitElements(A_8(rs).mID, RGBA_4444(rs).mID, RGBA_8888(rs).mID, RGB_565(rs).mID);\n}\n"
|
"public boolean setCursor(float x, float y) {\n if (intersects(x, y)) {\n x = x - myLocation[0];\n y = y - myLocation[1];\n if (showMode == 0) {\n cursorFreq = axisX4canvasView(x);\n cursorDB = axisY4canvasView(y);\n } else {\n cursorDB = 0;\n if (showFreqAlongX) {\n cursorFreq = axisBounds.width() * (xShift + (x - labelBeginX) / (canvasWidth - labelBeginX) * canvasWidth / xZoom) / canvasWidth;\n } else {\n cursorFreq = axisBounds.width() * (canvasHeight - yShift - y / labelBeginY * canvasHeight / yZoom) / canvasHeight;\n }\n if (cursorFreq < 0) {\n cursorFreq = 0;\n }\n }\n return true;\n } else {\n return false;\n }\n}\n"
|
"public static void main(String[] args) {\n try {\n File directory = new File(FileUtilities.nameToURL(\"String_Node_Str\", null, null).getFile());\n for (File file : directory.listFiles()) {\n String filename = file.getPath();\n CodeStream stream = new CodeStream(filename, null);\n TreeSet<Signature> sortedSet = new TreeSet<Signature>(stream.getAllCodeBlockSignatures());\n StringBuffer code = new StringBuffer();\n for (Signature signature : sortedSet) {\n String templateCode = stream.getCodeBlockTemplate(signature);\n String functionHeader = templateCode.split(\"String_Node_Str\")[1];\n String[] fragments = functionHeader.split(signature.functionName);\n if (fragments.length <= 1) {\n System.err.println(\"String_Node_Str\" + signature + \"String_Node_Str\" + \"String_Node_Str\" + signature.functionName);\n }\n code.append(templateCode);\n }\n if (code.toString().trim().length() > 0) {\n FileWriter writer = new FileWriter(new File(filename));\n writer.write(code.toString().replaceAll(\"String_Node_Str\", \"String_Node_Str\").replaceAll(\"String_Node_Str\", \"String_Node_Str\"));\n writer.close();\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n}\n"
|
"public static GraphDatabaseAgent randomTreeWithBackEdges(int nTips, int maxChildren, int nBackEdges, String dbname) throws IOException {\n if (nTips < 3) {\n throw new IllegalArgumentException();\n }\n GraphDatabaseAgent G = emptyGraph(dbname);\n createRandomNTree(G, nTips, maxChildren);\n List<Node> all = new ArrayList<Node>();\n for (Node n : new TopologicalOrder(G, new HashSet<Relationship>(), RelType.STREECHILDOF)) {\n if (n.getId() != 0)\n all.add(n);\n }\n int N = all.size() - 1;\n System.out.println(N);\n System.out.println(N - nTips);\n Transaction tx = G.beginTx();\n Random r = new Random();\n for (int i = 0; i < nBackEdges; i++) {\n Node p = G.getNodeById((long) r.nextInt(N - nTips) + nTips);\n LinkedList<Node> toVisit = new LinkedList<Node>();\n toVisit.add(p);\n List<Node> descendants = new ArrayList<Node>();\n while (toVisit.size() > 0) {\n addChildren(toVisit.pop(), descendants);\n }\n G.getNodeById(p).createRelationshipTo(G.getNodeById(q), RelType.STREECHILDOF);\n }\n tx.success();\n tx.finish();\n return G;\n}\n"
|
"protected void processDefaultListeners() {\n for (EntityListenerMetadata defaultListener : getProject().getDefaultListeners()) {\n EntityListenerMetadata listener = (EntityListenerMetadata) defaultListener.clone();\n listener.setEntityClass(getJavaClass());\n listener.initializeListenerClass(MetadataHelper.getClassForName(listener.getClassName(), getJavaClass().getClassLoader()));\n Method[] candidateMethods = MetadataHelper.getCandidateCallbackMethodsForEntityListener(listener);\n processCallbackMethodNames(candidateMethods, listener);\n processCallbackMethods(candidateMethods, listener);\n getDescriptor().addDefaultEventListener(listener);\n }\n}\n"
|
"public boolean save(XMLDBModel xmlDBModel) throws DBConnectionException, DBExecutionException, IllegalArgumentException, ModelAlreadyExistException, XMLDBModelParsingException {\n boolean isSuccessful = false;\n DBConnection dbConnection = null;\n try {\n if (xmlDBModel == null) {\n throw new IllegalArgumentException(\"String_Node_Str\" + \"String_Node_Str\");\n }\n xmlDBModel = populateChildModelsList(xmlDBModel);\n dbConnection = DBConnectorFactory.getSyncConnection(true);\n if (dbConnection == null) {\n throw new DBConnectionException(\"String_Node_Str\");\n }\n if (xmlDBModel.getIsNew()) {\n CreateModelTask createModelTask = new CreateModelTask(xmlDBModel);\n returnString = dbConnection.executeCreateModelTask(createModelTask);\n dbConnection.commitConnection();\n } else {\n SaveModelTask saveModelTask = new SaveModelTask(xmlDBModel);\n dbConnection.executeSaveModelTask(saveModelTask);\n isSuccessful = true;\n dbConnection.commitConnection();\n }\n } catch (DBExecutionException e) {\n if (dbConnection != null) {\n dbConnection.abortConnection();\n }\n throw new DBExecutionException(\"String_Node_Str\" + e.getMessage(), e);\n } finally {\n if (dbConnection != null) {\n dbConnection.closeConnection();\n }\n }\n isSuccessful = (isSuccessful && updateCache(xmlDBModel));\n return isSuccessful;\n}\n"
|
"private static IPath jsSdkContainerPath() {\n return new Path(VjetPlugin.JS_DEFAULT_SDK).append(VjetPlugin.JS_DEFAULT_SDK_LABEL);\n}\n"
|
"public IWizard newSchemaWizard(IWorkbench workbench, boolean creation, IRepositoryViewObject object, MetadataTable metadataTable, String[] existingNames, boolean forceReadOnly) {\n if (object == null) {\n return null;\n }\n IWorkbench wb = workbench;\n if (wb == null) {\n wb = PlatformUI.getWorkbench();\n }\n MetadataTable table = metadataTable;\n if (table == null && object instanceof MetadataTableRepositoryObject) {\n MetadataTableRepositoryObject metaTableRepObj = (MetadataTableRepositoryObject) object;\n table = metaTableRepObj.getTable();\n }\n if (table == null) {\n return null;\n }\n ConnectionItem connectionItem = (ConnectionItem) object.getProperty().getItem();\n table = SchemaUtils.getMetadataTable(connectionItem.getConnection(), table.getLabel(), table.eContainer().getClass());\n return new GenericSchemaWizard(wb, creation, object, connectionItem, table, forceReadOnly);\n}\n"
|
"protected void doCommit() {\n dataSource.getWriteLock();\n try {\n for (Map.Entry<IndexIdentifier, CommandList> entry : this.commandMap.entrySet()) {\n IndexIdentifier identifier = entry.getKey();\n IndexType type = identifier == LuceneCommand.CreateIndexCommand.FAKE_IDENTIFIER ? null : dataSource.getType(identifier);\n IndexWriter writer = null;\n IndexSearcher searcher = null;\n CommandList commandList = entry.getValue();\n Map<Long, DocumentContext> documents = new HashMap<Long, DocumentContext>();\n for (LuceneCommand command : commandList.commands) {\n if (command instanceof CreateIndexCommand) {\n CreateIndexCommand createCommand = (CreateIndexCommand) command;\n dataSource.indexStore.setIfNecessary(createCommand.getName(), createCommand.getConfig());\n continue;\n }\n if (writer == null) {\n if (isRecovery) {\n writer = dataSource.getRecoveryIndexWriter(identifier);\n } else {\n writer = dataSource.getIndexWriter(identifier);\n writer.setMaxBufferedDocs(commandList.addCount + 100);\n writer.setMaxBufferedDeleteTerms(commandList.removeCount + 100);\n }\n searcher = dataSource.getIndexSearcher(identifier).getSearcher();\n }\n if (command instanceof ClearCommand) {\n documents.clear();\n dataSource.closeWriter(writer);\n writer = null;\n dataSource.deleteIndex(identifier);\n dataSource.invalidateCache(identifier);\n continue;\n }\n Object entityId = command.entityId;\n long id = entityId instanceof Long ? (Long) entityId : ((RelationshipId) entityId).id;\n DocumentContext context = documents.get(id);\n if (context == null) {\n Document document = LuceneDataSource.findDocument(type, searcher, id);\n context = document == null ? new DocumentContext(identifier.entityType.newDocument(entityId), false, id) : new DocumentContext(document, true, id);\n documents.put(id, context);\n }\n String key = command.key;\n Object value = command.value;\n if (command instanceof AddCommand || command instanceof AddRelationshipCommand) {\n type.addToDocument(context.document, key, value);\n dataSource.invalidateCache(identifier, key, value);\n } else if (command instanceof RemoveCommand) {\n type.removeFromDocument(context.document, key, value);\n dataSource.invalidateCache(identifier, key, value);\n } else {\n throw new RuntimeException(\"String_Node_Str\" + command + \"String_Node_Str\" + command.getClass());\n }\n }\n applyDocuments(writer, type, documents);\n if (writer != null) {\n dataSource.closeWriter(writer);\n }\n dataSource.invalidateIndexSearcher(identifier);\n }\n closeTxData();\n } catch (IOException e) {\n throw new RuntimeException(e);\n } finally {\n dataSource.releaseWriteLock();\n }\n}\n"
|
"public void debugTest(Test test) throws SoarException, InterruptedException {\n final ThreadedAgent agent = ThreadedAgent.create(test.getName());\n TestRhsFunction.addTestFunction(agent.getAgent(), \"String_Node_Str\");\n TestRhsFunction.addTestFunction(agent.getAgent(), \"String_Node_Str\");\n final Map<String, Object> debugProps = new HashMap<String, Object>();\n debugProps.put(DebuggerProvider.CLOSE_ACTION, exitOnClose ? CloseAction.EXIT : CloseAction.DISPOSE);\n agent.getDebuggerProvider().setProperties(debugProps);\n agent.openDebuggerAndWait();\n final TestCase testCase = test.getTestCase();\n agent.getPrinter().print(\"String_Node_Str\", test);\n agent.getInterpreter().eval(String.format(\"String_Node_Str\", FileTools.getParent(testCase.getFile()).replace('\\\\', '/')));\n agent.getInterpreter().eval(testCase.getSetup());\n agent.getInterpreter().eval(test.getContent());\n agent.getPrinter().flush();\n}\n"
|
"public static void main(String[] args) {\n PresageConfig presageConfig = new PresageConfig();\n presageConfig.setComment(\"String_Node_Str\");\n presageConfig.setIterations(25);\n presageConfig.setRandomSeed(0);\n presageConfig.setOutputFolder(\"String_Node_Str\");\n presageConfig.setThreadDelay(1);\n presageConfig.setAutorun(false);\n String configPath = new File(System.getProperty(\"String_Node_Str\"), \"String_Node_Str\").getAbsolutePath();\n presageConfig.setPluginsConfigPath(configPath + \"String_Node_Str\");\n presageConfig.setEventscriptConfigPath(configPath + \"String_Node_Str\");\n presageConfig.setParticipantsConfigPath(configPath + \"String_Node_Str\");\n presageConfig.setEnvironmentConfigPath(configPath + \"String_Node_Str\");\n TreeMap<String, Participant> parts = new TreeMap<String, Participant>();\n PluginManager pm = new PluginManager();\n pm.addPlugin(new LineChartPlugin(configPath + \"String_Node_Str\", 1500, 1200));\n EventScriptManager ms = new EventScriptManager();\n TestAgent a = new TestAgent(20, 5);\n parts.put(a.getId(), a);\n ms.addPreEvent(new ScriptedEvent(-1, new ActivateParticipant(a.getId())));\n TestAgent b = new TestAgent(20, 3);\n parts.put(b.getId(), b);\n ms.addPreEvent(new ScriptedEvent(-1, new ActivateParticipant(b.getId())));\n HashMap<String, Food> foods = new HashMap<String, Food>();\n Food rabbit = new Food(\"String_Node_Str\", 1, 1);\n foods.put(rabbit.getId().toString(), rabbit);\n Food chicken = new Food(\"String_Node_Str\", 2, 1);\n foods.put(chicken.getId().toString(), chicken);\n EnvironmentDataModel dm = new EnvironmentDataModel(\"String_Node_Str\", foods);\n Environment environment = (Environment) new ise.gameoflife.enviroment.Environment(true, 0, dm);\n presageConfig.setEnvironmentClass(environment.getClass());\n ConfigurationWriter.write(configPath + \"String_Node_Str\", presageConfig, parts, environment, pm, ms);\n}\n"
|
"private void decodeD(Position position, ChannelBuffer buf, int selector, int event) {\n if ((selector & 0x0008) != 0) {\n position.setValid((buf.readUnsignedByte() & 0x40) != 0);\n } else {\n getLastLocation(position, null);\n }\n if ((selector & 0x0004) != 0) {\n buf.skipBytes(4);\n }\n if ((selector & 0x0008) != 0) {\n position.setTime(new Date(buf.readUnsignedInt() * 1000));\n position.setLatitude(buf.readInt() / 1000000.0);\n position.setLongitude(buf.readInt() / 1000000.0);\n position.set(Position.KEY_SATELLITES_VISIBLE, buf.readUnsignedByte());\n }\n if ((selector & 0x0010) != 0) {\n position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedByte()));\n position.set(\"String_Node_Str\", buf.readUnsignedByte());\n position.setCourse(buf.readUnsignedByte() * 2.0);\n }\n if ((selector & 0x0040) != 0) {\n position.set(Position.KEY_INPUT, buf.readUnsignedByte());\n }\n if ((selector & 0x0020) != 0) {\n position.set(Position.PREFIX_ADC + 1, buf.readUnsignedShort());\n position.set(Position.PREFIX_ADC + 2, buf.readUnsignedShort());\n position.set(Position.PREFIX_ADC + 3, buf.readUnsignedShort());\n position.set(Position.PREFIX_ADC + 4, buf.readUnsignedShort());\n }\n if ((selector & 0x8000) != 0) {\n position.set(Position.KEY_POWER, buf.readUnsignedShort() * 0.001);\n position.set(Position.KEY_BATTERY, buf.readUnsignedShort() * 0.001);\n }\n if ((selector & 0x10000) != 0) {\n buf.readUnsignedShort();\n buf.readUnsignedInt();\n }\n if ((selector & 0x20000) != 0) {\n buf.readUnsignedShort();\n buf.readUnsignedInt();\n }\n if ((selector & 0x0080) != 0) {\n position.set(\"String_Node_Str\", buf.readUnsignedInt());\n }\n if ((selector & 0x0100) != 0) {\n position.set(\"String_Node_Str\", buf.readUnsignedInt());\n }\n if ((selector & 0x0040) != 0) {\n position.set(Position.KEY_OUTPUT, buf.readUnsignedByte());\n }\n if ((selector & 0x0200) != 0) {\n position.set(Position.KEY_RFID, (((long) buf.readUnsignedShort()) << 32) + buf.readUnsignedInt());\n }\n if ((selector & 0x0400) != 0) {\n buf.readUnsignedByte();\n }\n if ((selector & 0x0800) != 0) {\n position.setAltitude(buf.readShort());\n }\n if ((selector & 0x2000) != 0) {\n buf.readUnsignedShort();\n }\n if ((selector & 0x4000) != 0) {\n buf.skipBytes(8);\n }\n if ((selector & 0x80000) != 0) {\n buf.skipBytes(11);\n }\n if ((selector & 0x1000) != 0) {\n decodeEventData(position, buf, event);\n }\n if (Context.getConfig().getBoolean(getProtocolName() + \"String_Node_Str\") && buf.readable() && (selector & 0x1000) != 0 && event == EVENT_DATA) {\n decodeCanData(buf, position);\n }\n}\n"
|
"public int hashCode() {\n final int prime = 31;\n int result = 0;\n try {\n userIdHashCode = (getUserId() == null) ? 0 : getUserId().hashCode();\n } catch (OseeCoreException ex) {\n OseeLog.log(Activator.class, Level.SEVERE, ex);\n }\n return result;\n}\n"
|
"public boolean processRequest(RequestEvent requestEvent) {\n ServerTransaction serverTransaction = requestEvent.getServerTransaction();\n SipProvider jainSipProvider = (SipProvider) requestEvent.getSource();\n Request request = requestEvent.getRequest();\n String requestMethod = request.getMethod();\n if (serverTransaction == null) {\n try {\n serverTransaction = SipStackSharing.getOrCreateServerTransaction(requestEvent);\n } catch (TransactionAlreadyExistsException ex) {\n logger.error(\"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\", ex);\n return false;\n } catch (TransactionUnavailableException ex) {\n logger.error(\"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\", ex);\n return false;\n }\n }\n boolean processed = false;\n if (requestMethod.equals(Request.INVITE)) {\n if (logger.isDebugEnabled())\n logger.debug(\"String_Node_Str\");\n DialogState dialogState = serverTransaction.getDialog().getState();\n if ((dialogState == null) || dialogState.equals(DialogState.CONFIRMED)) {\n if (logger.isDebugEnabled())\n logger.debug(\"String_Node_Str\" + dialogState);\n processInvite(jainSipProvider, serverTransaction);\n processed = true;\n } else {\n if (dialogState.equals(DialogState.TERMINATED)) {\n processStrayInvite(serverTransaction);\n } else {\n logger.error(\"String_Node_Str\" + \"String_Node_Str\");\n }\n processed = true;\n }\n } else if (requestMethod.equals(Request.ACK)) {\n processAck(serverTransaction, request);\n processed = true;\n } else if (requestMethod.equals(Request.BYE)) {\n processBye(serverTransaction, request);\n processed = true;\n } else if (requestMethod.equals(Request.CANCEL)) {\n processCancel(serverTransaction, request);\n processed = true;\n } else if (requestMethod.equals(Request.REFER)) {\n if (logger.isDebugEnabled())\n logger.debug(\"String_Node_Str\");\n processRefer(serverTransaction, request, jainSipProvider);\n processed = true;\n } else if (requestMethod.equals(Request.NOTIFY)) {\n if (logger.isDebugEnabled())\n logger.debug(\"String_Node_Str\");\n processed = processNotify(serverTransaction, request);\n }\n return processed;\n}\n"
|
"public void remove(String path) {\n for (String key : tree.keySet()) {\n if (key.startsWith(path)) {\n tree.remove(key);\n }\n}\n"
|
"protected void addProperties(Model model) {\n super.addProperties(model);\n Properties properties = model.getProperties();\n final IProcessor jProcessor = getJobProcessor();\n final IProcess process = jProcessor.getProcess();\n final IContext context = jProcessor.getContext();\n final Property property = jProcessor.getProperty();\n String jobClassPackageFolder = JavaResourcesHelper.getJobClassPackageFolder(property.getItem());\n String jobClassPackage = JavaResourcesHelper.getJobClassPackageName(property.getItem());\n String jobFolderName = JavaResourcesHelper.getJobFolderName(property.getLabel(), property.getVersion());\n Project project = ProjectManager.getInstance().getProject(property);\n if (project == null) {\n project = ProjectManager.getInstance().getCurrentProject().getEmfProject();\n }\n String mainProjectBranch = ProjectManager.getInstance().getMainProjectBranch(project);\n if (mainProjectBranch == null) {\n mainProjectBranch = SVNConstant.NAME_TRUNK;\n }\n JobInfoProperties jobInfoProp = new JobInfoProperties((ProcessItem) property.getItem(), context.getName(), isOptionChecked(TalendProcessArgumentConstant.ARG_ENABLE_APPLY_CONTEXT_TO_CHILDREN), isOptionChecked(TalendProcessArgumentConstant.ARG_ENABLE_STATISTICS));\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobPath, jobClassPackageFolder);\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobPackage, jobClassPackage);\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.ProjectName, jobInfoProp.getProperty(JobInfoProperties.PROJECT_NAME, project.getTechnicalLabel()));\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.ProjectName, jobInfoProp.getProperty(JobInfoProperties.PROJECT_NAME, project.getTechnicalLabel()).toLowerCase());\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.ProjectId, jobInfoProp.getProperty(JobInfoProperties.PROJECT_ID, String.valueOf(project.getId())));\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.ProjectBranch, jobInfoProp.getProperty(JobInfoProperties.BRANCH, mainProjectBranch));\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobName, jobInfoProp.getProperty(JobInfoProperties.JOB_NAME, property.getLabel()));\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobVersion, \"String_Node_Str\");\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobDate, jobInfoProp.getProperty(JobInfoProperties.DATE, JobInfoProperties.DATAFORMAT.format(new Date())));\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobContext, \"String_Node_Str\" + jobInfoProp.getProperty(JobInfoProperties.CONTEXT_NAME, context.getName()));\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobId, jobInfoProp.getProperty(JobInfoProperties.JOB_ID, process.getId()));\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobClass, \"String_Node_Str\");\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobStat, jobInfoProp.getProperty(JobInfoProperties.ADD_STATIC_CODE, Boolean.FALSE.toString()));\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobApplyContextToChildren, jobInfoProp.getProperty(JobInfoProperties.APPLY_CONTEXY_CHILDREN, Boolean.FALSE.toString()));\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.ProductVersion, jobInfoProp.getProperty(JobInfoProperties.COMMANDLINE_VERSION, VersionUtils.getVersion()));\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobBatClasspath, this.getWindowsClasspath());\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobBatAddition, this.getWindowsScriptAddition());\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobShClasspath, this.getUnixClasspath());\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobShAddition, this.getUnixScriptAddition());\n String finalNameStr = JavaResourcesHelper.getJobJarName(property.getLabel(), property.getVersion());\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobFinalName, finalNameStr);\n}\n"
|
"private Object txnalPut(ClusterOperation operation, String name, Object key, Object value, long timeout) {\n ThreadContext threadContext = ThreadContext.get();\n TransactionImpl txn = threadContext.getCallContext().getCurrentTxn();\n if (txn != null && txn.getStatus() == Transaction.TXN_STATUS_ACTIVE) {\n if (!txn.has(name, key)) {\n MLock mlock = new MLock();\n boolean locked = mlock.lockAndReturnOld(name, key, DEFAULT_TXN_TIMEOUT, txn.getId());\n if (!locked)\n throwCME(key);\n Object oldObject = null;\n Data oldValue = mlock.oldValue;\n if (oldValue != null) {\n oldObject = toObject(oldValue);\n }\n txn.attachPutOp(name, key, value, (oldObject == null));\n return threadContext.isClient() ? oldValue : oldObject;\n } else {\n return txn.attachPutOp(name, key, value, false);\n }\n } else {\n setLocal(operation, name, key, value, timeout, -1);\n request.longValue = (request.value == null) ? Integer.MIN_VALUE : request.value.hashCode();\n setIndexValues(request, value);\n doOp();\n Object returnObject;\n returnObject = getResultAsObject();\n if (returnObject instanceof AddressAwareException) {\n rethrowException(operation, (AddressAwareException) returnObject);\n }\n backup(CONCURRENT_MAP_BACKUP_PUT);\n return returnObject;\n }\n}\n"
|
"public void testDGMDeclaring() {\n String contents = \"String_Node_Str\";\n String target = \"String_Node_Str\";\n int start = contents.lastIndexOf(target), until = start + target.length();\n assertDeclaringType(contents, start, until, \"String_Node_Str\");\n}\n"
|
"private void triggerTagged(Node node) {\n if (this.listener != null && !node.hasProperty(Node.PROPERTY_EVENT_FIRED)) {\n if (tagTrigger == null || tagTrigger.appliesTo(node)) {\n this.listener.nodeTagged(size);\n }\n }\n}\n"
|
"public String getParams(ConstantPool constants, List<String> fullyQualifiedNames) {\n StringBuilder s = new StringBuilder();\n for (int i = 0; i < definition.operands.length; i++) {\n switch(definition.operands[i]) {\n case AVM2Code.DAT_MULTINAME_INDEX:\n if (operands[i] == 0) {\n s.append(\"String_Node_Str\");\n } else {\n s.append(\"String_Node_Str\");\n s.append(constants.constant_multiname[operands[i]].toString(constants, fullyQualifiedNames));\n }\n break;\n case AVM2Code.DAT_STRING_INDEX:\n if (operands[i] == 0) {\n s.append(\"String_Node_Str\");\n } else {\n s.append(\"String_Node_Str\");\n s.append(Helper.escapeString(constants.constant_string[operands[i]]));\n s.append(\"String_Node_Str\");\n }\n break;\n case AVM2Code.DAT_INT_INDEX:\n s.append(\"String_Node_Str\");\n s.append(constants.constant_int[operands[i]]);\n break;\n case AVM2Code.DAT_UINT_INDEX:\n s.append(\"String_Node_Str\");\n s.append(constants.constant_uint[operands[i]]);\n break;\n case AVM2Code.DAT_DOUBLE_INDEX:\n s.append(\"String_Node_Str\");\n s.append(constants.constant_double[operands[i]]);\n break;\n case AVM2Code.DAT_OFFSET:\n s.append(\"String_Node_Str\");\n s.append(\"String_Node_Str\");\n s.append(Helper.formatAddress(offset + operands[i] + getBytes().length));\n break;\n case AVM2Code.DAT_CASE_BASEOFFSET:\n s.append(\"String_Node_Str\");\n s.append(\"String_Node_Str\");\n s.append(Helper.formatAddress(offset + operands[i]));\n break;\n case AVM2Code.OPT_CASE_OFFSETS:\n s.append(\"String_Node_Str\");\n s.append(operands[i]);\n for (int j = i + 1; j < operands.length; j++) {\n s.append(\"String_Node_Str\");\n s.append(\"String_Node_Str\");\n s.append(Helper.formatAddress(offset + operands[j]));\n }\n break;\n default:\n s.append(\"String_Node_Str\");\n s.append(operands[i]);\n }\n }\n return s.toString();\n}\n"
|
"private byte[] trimQualityScores(byte[] qualityScores, int trimReadStartLength, int trimReadLength, int initialLength) {\n if (qualityScores == null)\n return null;\n int offset = trimReadStartLength;\n if (offset < 0)\n offset = 0;\n byte[] trimmedScores = new byte[Math.min(initialLength, trimReadLength) - offset];\n int trimmedIndex = 0;\n for (int i = 0; i < Math.min(initialLength, trimReadLength); i++) {\n if (i >= trimReadStartLength) {\n trimmedScores[trimmedIndex] = qualityScores[i];\n } else {\n if (i > trimReadLength)\n return trimmedScores;\n }\n trimmedIndex++;\n }\n return trimmedScores;\n}\n"
|
"public void startDependencyOnTermination(String instanceId) throws TopologyInConsistentException, MonitorNotFoundException, PolicyValidationException, PartitionValidationException {\n List<ApplicationChildContext> applicationContexts = this.startupDependencyTree.getStarAbleDependenciesByTermination(this, instanceId);\n for (ApplicationChildContext context : applicationContexts) {\n if (log.isDebugEnabled()) {\n log.debug(\"String_Node_Str\" + context.getId() + \"String_Node_Str\");\n }\n if (!this.aliasToActiveMonitorsMap.containsKey(context.getId())) {\n String msg = \"String_Node_Str\";\n throw new MonitorNotFoundException(msg);\n } else {\n Monitor monitor = aliasToActiveMonitorsMap.get(context.getId());\n monitor.createInstanceOnDemand(instanceId);\n }\n }\n}\n"
|
"public static TLAExpr InnerTokenize(PcalCharReader charReader, boolean isExpr) throws TokenizerException {\n int mode = TLA;\n ncol = charReader.getColumnNumber();\n col = ncol;\n parseExpression = isExpr;\n prevToken = \"String_Node_Str\";\n vspec = new Vector(1000, 1000);\n reader = charReader;\n linev = new Vector();\n token = \"String_Node_Str\";\n nextChar = reader.getNextChar();\n parenDepth = 0;\n inQuantifier = false;\n switch(mode) {\n case MODULE:\n state = PROLOG;\n break;\n case TLA:\n state = START;\n break;\n default:\n PcalDebug.ReportBug(\"String_Node_Str\");\n }\n ;\n exprEnd = false;\n while ((state != DONE) && !exprEnd) {\n switch(state) {\n case START:\n if (Misc.IsSpace(nextChar)) {\n skipNextChar();\n gotoStart();\n } else if (Misc.IsLetter(nextChar)) {\n addNextChar();\n state = ID;\n } else if (Misc.IsDigit(nextChar)) {\n addNextChar();\n state = NUM_OR_ID;\n } else if (nextChar == '\\\\') {\n addNextChar();\n state = BS;\n } else if (nextChar == '-') {\n addNextChar();\n state = DASH1;\n } else if (nextChar == '=') {\n addNextChar();\n state = EQ1;\n } else if (nextChar == '(') {\n skipNextChar();\n state = LEFT_PAREN;\n } else if (nextChar == '\"') {\n skipNextChar();\n state = STRING;\n } else if (nextChar == '\\n') {\n skipNextChar();\n startNewLine();\n gotoStart();\n } else if (PcalBuiltInSymbols.IsBuiltInPrefix(\"String_Node_Str\" + nextChar)) {\n addNextChar();\n state = BUILT_IN;\n } else if (nextChar == '\\t') {\n if (mode == MODULE) {\n throw new TokenizerException(\"String_Node_Str\");\n }\n ;\n state = DONE;\n } else {\n addNextChar();\n TokenizingError(\"String_Node_Str\");\n }\n ;\n break;\n case ID:\n if ((token.length() == 3) && (token.equals(\"String_Node_Str\") || token.equals(\"String_Node_Str\"))) {\n TokenOut(Token.BUILTIN);\n gotoStart();\n } else if (Misc.IsLetter(nextChar) || Misc.IsDigit(nextChar)) {\n addNextChar();\n } else if (PcalBuiltInSymbols.IsBuiltInSymbol(token)) {\n if (token.equals(\"String_Node_Str\")) {\n mdepth = mdepth + 1;\n }\n TokenOut(Token.BUILTIN);\n gotoStart();\n } else {\n TokenOut(Token.IDENT);\n gotoStart();\n }\n ;\n break;\n case NUM_OR_ID:\n if (Misc.IsDigit(nextChar)) {\n addNextChar();\n state = NUM_OR_ID;\n } else if (Misc.IsLetter(nextChar)) {\n addNextChar();\n state = ID;\n } else {\n TokenOut(Token.NUMBER);\n gotoStart();\n }\n break;\n case BS:\n if ((nextChar == 'b') || (nextChar == 'B') || (nextChar == 'o') || (nextChar == 'O') || (nextChar == 'h') || (nextChar == 'H')) {\n addNextChar();\n state = NUM_OR_BI;\n } else if (Misc.IsLetter(nextChar)) {\n state = BSBUILT_IN;\n } else if (nextChar == '*') {\n skipNextChar();\n token = \"String_Node_Str\";\n state = LINE_COMMENT;\n } else {\n state = BUILT_IN;\n }\n break;\n case NUM_OR_BI:\n if (Misc.IsDigit(nextChar)) {\n state = NUM;\n } else {\n state = BSBUILT_IN;\n }\n ;\n break;\n case NUM:\n if (Misc.IsDigit(nextChar)) {\n addNextChar();\n state = NUM;\n } else if (Misc.IsLetter(nextChar)) {\n addNextChar();\n if (token.charAt(0) == '\\\\') {\n TokenizingError(\"String_Node_Str\");\n } else {\n state = ID;\n }\n ;\n } else {\n TokenOut(Token.NUMBER);\n gotoStart();\n }\n break;\n case BSBUILT_IN:\n if (Misc.IsLetter(nextChar) && (nextChar != '_')) {\n addNextChar();\n state = BSBUILT_IN;\n } else if (PcalBuiltInSymbols.IsBuiltInSymbol(token)) {\n TokenOut(Token.BUILTIN);\n gotoStart();\n } else {\n TokenizingError(\"String_Node_Str\");\n }\n ;\n break;\n case BUILT_IN:\n if (PcalBuiltInSymbols.IsBuiltInPrefix(token + nextChar)) {\n addNextChar();\n } else {\n if (!PcalBuiltInSymbols.IsBuiltInSymbol(token)) {\n reader.backspace();\n while (!PcalBuiltInSymbols.IsBuiltInSymbol(token)) {\n reader.backspace();\n if (token.length() == 0) {\n TokenizingError(\"String_Node_Str\");\n }\n ;\n token = token.substring(0, token.length() - 1);\n }\n ;\n skipNextChar();\n }\n ;\n TokenOut(Token.BUILTIN);\n gotoStart();\n }\n break;\n case DASH1:\n if (nextChar == '-') {\n addNextChar();\n state = DASH2;\n } else {\n state = BUILT_IN;\n }\n break;\n case DASH2:\n if (nextChar == '-') {\n addNextChar();\n state = DASH3;\n } else {\n state = BUILT_IN;\n }\n break;\n case DASH3:\n if (nextChar == '-') {\n addNextChar();\n state = DASHES;\n } else {\n TokenizingError(\"String_Node_Str\");\n }\n break;\n case DASHES:\n if (nextChar == '-') {\n addNextChar();\n state = DASHES;\n } else {\n TokenOut(Token.DASHES);\n gotoStart();\n }\n break;\n case EQ1:\n if (nextChar == '=') {\n addNextChar();\n state = EQ2;\n } else {\n state = BUILT_IN;\n }\n break;\n case EQ2:\n if (nextChar == '=') {\n addNextChar();\n state = EQ3;\n } else {\n state = BUILT_IN;\n }\n break;\n case EQ3:\n if (nextChar == '=') {\n addNextChar();\n state = EQS;\n } else {\n TokenizingError(\"String_Node_Str\");\n }\n break;\n case EQS:\n if (nextChar == '=') {\n addNextChar();\n state = EQS;\n } else {\n mdepth = mdepth - 1;\n TokenOut(Token.END_MODULE);\n if ((mdepth > 0) || (mode == TLA)) {\n gotoStart();\n } else if (mdepth == 0) {\n state = EPILOG;\n } else {\n throw new TokenizerException(\"String_Node_Str\" + (reader.getLineNumber() + 1));\n }\n }\n break;\n case LEFT_PAREN:\n if (nextChar == '*') {\n skipNextChar();\n cdepth = 1;\n state = COMMENT;\n } else {\n token = \"String_Node_Str\";\n state = BUILT_IN;\n }\n break;\n case STRING:\n if (nextChar == '\\\\') {\n addNextChar();\n state = ESC_STRING;\n } else if (nextChar == '\"') {\n skipNextChar();\n TokenOut(Token.STRING);\n gotoStart();\n } else if (PcalBuiltInSymbols.IsStringChar(nextChar)) {\n addNextChar();\n state = STRING;\n } else {\n addNextChar();\n TokenizingError(\"String_Node_Str\");\n }\n break;\n case ESC_STRING:\n if ((nextChar == '\\\"') || (nextChar == '\\\\') || (nextChar == 't') || (nextChar == 'n') || (nextChar == 'f') || (nextChar == 'r')) {\n addNextChar();\n state = STRING;\n } else {\n addNextChar();\n TokenizingError(\"String_Node_Str\");\n }\n break;\n case LINE_COMMENT:\n if (nextChar == '(') {\n skipNextChar();\n state = LINE_COM_PAREN;\n } else if ((nextChar == '*') && (cdepth > 0)) {\n skipNextChar();\n state = LINE_COM_STAR;\n } else if ((nextChar == '\\n') || (nextChar == '\\t')) {\n CommentTokenOut();\n cdepth = 0;\n gotoStart();\n } else {\n if (cdepth == 0) {\n addNextChar();\n } else {\n skipNextChar();\n }\n ;\n state = LINE_COMMENT;\n }\n break;\n case LINE_COM_PAREN:\n if (nextChar == '*') {\n skipNextChar();\n cdepth = cdepth + 1;\n state = LINE_COMMENT;\n } else {\n if (cdepth == 0) {\n token = token + \"String_Node_Str\";\n }\n ;\n state = LINE_COMMENT;\n }\n break;\n case LINE_COM_STAR:\n if (nextChar == ')') {\n skipNextChar();\n cdepth = cdepth - 1;\n PcalDebug.Assert(cdepth >= 0, \"String_Node_Str\");\n state = LINE_COMMENT;\n } else {\n if (cdepth == 0) {\n token = token + \"String_Node_Str\";\n }\n ;\n state = LINE_COMMENT;\n }\n break;\n case COMMENT:\n if (nextChar == '*') {\n skipNextChar();\n state = COMMENT_STAR;\n } else if (nextChar == '(') {\n skipNextChar();\n state = COMMENT_PAREN;\n } else if (nextChar == '\\n') {\n CommentTokenOut();\n skipNextChar();\n startNewLine();\n state = OR_COMMENT;\n } else if (nextChar == '\\t') {\n throw new TokenizerException(\"String_Node_Str\");\n } else {\n if (cdepth == 1) {\n addNextChar();\n } else {\n skipNextChar();\n }\n ;\n }\n break;\n case COMMENT_STAR:\n if (nextChar == ')') {\n skipNextChar();\n cdepth = cdepth - 1;\n if (cdepth == 0) {\n CommentTokenOut();\n gotoStart();\n } else {\n state = COMMENT;\n }\n } else {\n if (cdepth == 1) {\n token = token + \"String_Node_Str\";\n }\n ;\n state = COMMENT;\n }\n break;\n case COMMENT_PAREN:\n if (nextChar == '*') {\n skipNextChar();\n cdepth = cdepth + 1;\n state = COMMENT;\n } else {\n if (cdepth == 1) {\n token = token + \"String_Node_Str\";\n }\n ;\n state = COMMENT;\n }\n break;\n case OR_COMMENT:\n if (nextChar == '*') {\n skipNextChar();\n state = OR_COMMENT_STAR;\n } else if (nextChar == '(') {\n skipNextChar();\n state = OR_COMMENT_PAREN;\n } else if (nextChar == '\\n') {\n CommentTokenOut();\n skipNextChar();\n startNewLine();\n state = OR_COMMENT;\n } else if (nextChar == '\\t') {\n throw new TokenizerException(\"String_Node_Str\");\n } else {\n if (cdepth == 1) {\n addNextChar();\n } else {\n skipNextChar();\n }\n ;\n }\n break;\n case OR_COMMENT_STAR:\n if (nextChar == ')') {\n skipNextChar();\n cdepth = cdepth - 1;\n PcalDebug.Assert(cdepth >= 0);\n if (cdepth == 0) {\n CommentTokenOut();\n gotoStart();\n } else {\n state = OR_COMMENT;\n }\n } else {\n if (cdepth == 1) {\n token = token + \"String_Node_Str\";\n }\n ;\n state = OR_COMMENT;\n }\n break;\n case OR_COMMENT_PAREN:\n if (nextChar == '*') {\n skipNextChar();\n cdepth = cdepth + 1;\n state = OR_COMMENT;\n } else {\n if (cdepth == 1) {\n token = token + \"String_Node_Str\";\n }\n ;\n state = OR_COMMENT;\n }\n break;\n case PROLOG:\n if (nextChar == '-') {\n token1 = token;\n col1 = col;\n col = ncol;\n token = \"String_Node_Str\";\n skipNextChar();\n state = PROLOG_DASH;\n } else if (nextChar == '\\n') {\n TokenOut(Token.PROLOG);\n skipNextChar();\n startNewLine();\n } else if (nextChar == '\\t') {\n throw new TokenizerException(\"String_Node_Str\");\n } else {\n addNextChar();\n }\n break;\n case PROLOG_DASH:\n PcalDebug.Assert(token.length() <= 3);\n if (nextChar == '-') {\n addNextChar();\n if (token.length() == 4) {\n state = PROLOG_DASHES;\n } else {\n }\n ;\n } else {\n token = token1 + token;\n col = col1;\n state = PROLOG;\n }\n break;\n case PROLOG_DASHES:\n if (nextChar == '-') {\n addNextChar();\n } else {\n token2 = token;\n col2 = col;\n token = \"String_Node_Str\";\n col = ncol;\n state = PROLOG_SPACES;\n }\n break;\n case PROLOG_SPACES:\n if (nextChar == ' ') {\n addNextChar();\n } else if (Misc.IsLetter(nextChar)) {\n token3 = token;\n col3 = ncol;\n token = \"String_Node_Str\";\n state = PROLOG_ID;\n } else {\n token = token1 + token2;\n col = col1;\n state = PROLOG;\n }\n break;\n case PROLOG_ID:\n if (Misc.IsLetter(nextChar)) {\n addNextChar();\n } else if (token.equals(\"String_Node_Str\")) {\n token = token1;\n col = col1;\n TokenOut(Token.PROLOG);\n token = token2;\n col = col2;\n TokenOut(Token.DASHES);\n token = \"String_Node_Str\";\n col = col3;\n TokenOut(Token.BUILTIN);\n token = \"String_Node_Str\";\n mdepth = 1;\n gotoStart();\n } else {\n token = token1 + token2 + token3;\n col = col1;\n state = PROLOG;\n }\n break;\n case EPILOG:\n if (nextChar == '\\n') {\n TokenOut(Token.EPILOG);\n skipNextChar();\n startNewLine();\n } else if (nextChar == '\\t') {\n TokenOut(Token.EPILOG);\n state = DONE;\n } else {\n addNextChar();\n }\n break;\n default:\n PcalDebug.ReportBug(\"String_Node_Str\");\n }\n ;\n }\n ;\n if (nextChar != '\\n') {\n reader.backspace();\n }\n ;\n TLAExpr rval = new TLAExpr(vspec);\n rval.normalize();\n return rval;\n}\n"
|
"private void layoutText() {\n if (getText().equals(\"String_Node_Str\"))\n return;\n Paint paint = getPaint();\n if (mTextSize != 0f)\n paint.setTextSize(mTextSize);\n if (mMinTextSize == getTextSize())\n return;\n float textWidth = paint.measureText(getText().toString());\n float boxWidth = getWidth() - getPaddingLeft() - getPaddingRight();\n if (boxWidth <= 0f)\n return;\n float textSize = getTextSize();\n if (textWidth > boxWidth) {\n float scaled = textSize * boxWidth / textWidth;\n if (scaled < mMinTextSize)\n scaled = mMinTextSize;\n paint.setTextSize(scaled);\n mTextSize = textSize;\n }\n}\n"
|
"public Object innerCall() throws Exception {\n final TransactionContext context = getEndpoint().getTransactionContext();\n final TransactionalMultiMap<Object, Object> multiMap = context.getMultiMap(name);\n return multiMap.remove(key, value);\n}\n"
|
"private Address getMemberAddress(Member member) {\n MemberImpl m = getContext().getClusterService().getMember(member.getUuid());\n if (m == null) {\n throw new HazelcastException(member + \"String_Node_Str\");\n }\n return m.getAddress();\n}\n"
|
"protected void addProperties(Model model) {\n super.addProperties(model);\n Properties properties = model.getProperties();\n final IProcessor jProcessor = getJobProcessor();\n final IProcess process = jProcessor.getProcess();\n final IContext context = jProcessor.getContext();\n final Property property = jProcessor.getProperty();\n String jobClassPackageFolder = JavaResourcesHelper.getJobClassPackageFolder(property.getItem());\n String jobClassPackage = JavaResourcesHelper.getJobClassPackageName(property.getItem());\n String jobFolderName = JavaResourcesHelper.getJobFolderName(property.getLabel(), property.getVersion());\n Project project = ProjectManager.getInstance().getProject(property);\n if (project == null) {\n project = ProjectManager.getInstance().getCurrentProject().getEmfProject();\n }\n String mainProjectBranch = ProjectManager.getInstance().getMainProjectBranch(project);\n if (mainProjectBranch == null) {\n mainProjectBranch = SVNConstant.NAME_TRUNK;\n }\n JobInfoProperties jobInfoProp = new JobInfoProperties((ProcessItem) property.getItem(), context.getName(), isApplyContextToChild(), isAddStat());\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobPath, jobClassPackageFolder);\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobPackage, jobClassPackage);\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.ProjectName, jobInfoProp.getProperty(JobInfoProperties.PROJECT_NAME, project.getTechnicalLabel()));\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.ProjectId, jobInfoProp.getProperty(JobInfoProperties.PROJECT_ID, String.valueOf(project.getId())));\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.ProjectBranch, jobInfoProp.getProperty(JobInfoProperties.BRANCH, mainProjectBranch));\n if (PomIdsHelper.FLAG_FIXING_ATIFACT_ID) {\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobName, \"String_Node_Str\");\n } else {\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobName, jobInfoProp.getProperty(JobInfoProperties.JOB_NAME, property.getLabel()));\n }\n if (PomIdsHelper.FLAG_VERSION_WITH_CLASSIFIER) {\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobVersion, jobInfoProp.getProperty(JobInfoProperties.JOB_VERSION, process.getVersion()));\n } else {\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobVersion, \"String_Node_Str\");\n }\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobDate, jobInfoProp.getProperty(JobInfoProperties.DATE, JobInfoProperties.DATAFORMAT.format(new Date())));\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobContext, \"String_Node_Str\" + jobInfoProp.getProperty(JobInfoProperties.CONTEXT_NAME, context.getName()));\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobId, jobInfoProp.getProperty(JobInfoProperties.JOB_ID, process.getId()));\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobClass, \"String_Node_Str\");\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobStat, jobInfoProp.getProperty(JobInfoProperties.ADD_STATIC_CODE, Boolean.FALSE.toString()));\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobApplyContextToChildren, jobInfoProp.getProperty(JobInfoProperties.APPLY_CONTEXY_CHILDREN, Boolean.FALSE.toString()));\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.ProductVersion, jobInfoProp.getProperty(JobInfoProperties.COMMANDLINE_VERSION, VersionUtils.getVersion()));\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobBatClasspath, this.getWindowsClasspath());\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobShClasspath, this.getUnixClasspath());\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobShAddition, this.getUnixScriptAddition());\n String finalNameExp = \"String_Node_Str\";\n String finalNameStr = PomUtil.getJobFinalName(property);\n if (PomIdsHelper.FLAG_SPECIAL_FINAL_NAME) {\n finalNameExp = \"String_Node_Str\";\n } else {\n if (PomIdsHelper.FLAG_FIXING_ATIFACT_ID) {\n if (PomIdsHelper.FLAG_VERSION_WITH_CLASSIFIER) {\n finalNameExp = \"String_Node_Str\";\n }\n } else {\n if (PomIdsHelper.FLAG_VERSION_WITH_CLASSIFIER) {\n finalNameExp = \"String_Node_Str\";\n } else {\n finalNameExp = \"String_Node_Str\";\n }\n }\n }\n checkPomProperty(properties, \"String_Node_Str\", ETalendMavenVariables.JobFinalName, finalNameExp);\n}\n"
|
"public IQ handleColibriConferenceIQ(ColibriConferenceIQ conferenceIQ, int options) throws Exception {\n String focus = conferenceIQ.getFrom();\n Conference conference;\n if ((options & OPTION_ALLOW_ANY_FOCUS) > 0) {\n options |= OPTION_ALLOW_NO_FOCUS;\n focus = null;\n }\n if (focus == null && (options & OPTION_ALLOW_NO_FOCUS) == 0) {\n return IQ.createErrorResponse(conferenceIQ, new XMPPError(XMPPError.Condition.not_authorized));\n } else if (authorizedSourcePattern != null && (focus == null || !authorizedSourcePattern.matcher(focus).matches())) {\n return IQ.createErrorResponse(conferenceIQ, new XMPPError(XMPPError.Condition.not_authorized));\n } else {\n String id = conferenceIQ.getID();\n if (id == null) {\n if (!isShutdownInProgress()) {\n conference = createConference(focus);\n } else {\n return ColibriConferenceIQ.createGracefulShutdownErrorResponse(conferenceIQ);\n }\n } else {\n conference = getConference(id, focus);\n }\n if (conference != null)\n conference.setLastKnownFocus(conferenceIQ.getFrom());\n }\n ColibriConferenceIQ responseConferenceIQ;\n if (conference == null) {\n responseConferenceIQ = null;\n } else {\n String name = conferenceIQ.getName();\n if (name != null)\n conference.setName(name);\n responseConferenceIQ = new ColibriConferenceIQ();\n conference.describeShallow(responseConferenceIQ);\n responseConferenceIQ.setGracefulShutdown(isShutdownInProgress());\n ColibriConferenceIQ.Recording recordingIQ = conferenceIQ.getRecording();\n if (recordingIQ != null) {\n String tokenIQ = recordingIQ.getToken();\n if (tokenIQ != null) {\n String tokenConfig = getConfigurationService().getString(Videobridge.MEDIA_RECORDING_TOKEN_PNAME);\n if (tokenIQ.equals(tokenConfig)) {\n ColibriConferenceIQ.Recording.State recState = recordingIQ.getState();\n boolean recording = conference.setRecording(ColibriConferenceIQ.Recording.State.ON.equals(recState) || ColibriConferenceIQ.Recording.State.PENDING.equals(recState));\n ColibriConferenceIQ.Recording responseRecordingIq = new ColibriConferenceIQ.Recording(recState);\n if (recording) {\n responseRecordingIq.setDirectory(conference.getRecordingDirectory());\n }\n responseConferenceIQ.setRecording(responseRecordingIq);\n }\n }\n }\n for (ColibriConferenceIQ.Content contentIQ : conferenceIQ.getContents()) {\n Content content = conference.getOrCreateContent(contentIQ.getName());\n if (content == null) {\n responseConferenceIQ = null;\n } else {\n ColibriConferenceIQ.Content responseContentIQ = new ColibriConferenceIQ.Content(content.getName());\n responseConferenceIQ.addContent(responseContentIQ);\n for (ColibriConferenceIQ.Channel channelIQ : contentIQ.getChannels()) {\n String channelID = channelIQ.getID();\n int channelExpire = channelIQ.getExpire();\n String channelBundleId = channelIQ.getChannelBundleId();\n RtpChannel channel = null;\n boolean channelCreated = false;\n String transportNamespace = channelIQ.getTransport() != null ? channelIQ.getTransport().getNamespace() : null;\n if (channelID == null) {\n if (channelExpire != 0) {\n channel = content.createRtpChannel(channelBundleId, transportNamespace, channelIQ.isInitiator(), channelIQ.getRTPLevelRelayType());\n if (channel instanceof VideoChannel) {\n VideoChannel videoChannel = (VideoChannel) channel;\n Integer receiveSimulcastLayer = channelIQ.getReceivingSimulcastLayer();\n videoChannel.setReceiveSimulcastLayer(receiveSimulcastLayer);\n }\n channelCreated = true;\n }\n } else {\n channel = (RtpChannel) content.getChannel(channelID);\n }\n if (channel == null) {\n responseConferenceIQ = null;\n } else {\n if (channelExpire != ColibriConferenceIQ.Channel.EXPIRE_NOT_SPECIFIED) {\n channel.setExpire(channelExpire);\n if ((channelExpire == 0) && channel.isExpired())\n continue;\n }\n String endpoint = channelIQ.getEndpoint();\n if (endpoint != null)\n channel.setEndpoint(endpoint);\n Integer lastN = channelIQ.getLastN();\n if (lastN != null)\n channel.setLastN(lastN);\n Boolean adaptiveLastN = channelIQ.getAdaptiveLastN();\n if (adaptiveLastN != null)\n channel.setAdaptiveLastN(adaptiveLastN);\n Boolean adaptiveSimulcast = channelIQ.getAdaptiveSimulcast();\n if (adaptiveSimulcast != null)\n channel.setAdaptiveSimulcast(adaptiveSimulcast);\n Boolean initiator = channelIQ.isInitiator();\n if (initiator != null)\n channel.setInitiator(initiator);\n channel.setPayloadTypes(channelIQ.getPayloadTypes());\n channel.setRtpHeaderExtensions(channelIQ.getRtpHeaderExtensions());\n channel.setDirection(channelIQ.getDirection());\n channel.setSources(channelIQ.getSources());\n channel.setSourceGroups(channelIQ.getSourceGroups());\n if (channel instanceof VideoChannel) {\n SimulcastMode simulcastMode = channelIQ.getSimulcastMode();\n if (simulcastMode != null) {\n ((VideoChannel) channel).setSimulcastMode(simulcastMode);\n }\n }\n if (channelBundleId != null) {\n TransportManager transportManager = conference.getTransportManager(channelBundleId, true);\n transportManager.addChannel(channel);\n }\n channel.setTransport(channelIQ.getTransport());\n ColibriConferenceIQ.Channel responseChannelIQ = new ColibriConferenceIQ.Channel();\n channel.describe(responseChannelIQ);\n responseContentIQ.addChannel(responseChannelIQ);\n EventAdmin eventAdmin;\n if (channelCreated && (eventAdmin = getEventAdmin()) != null) {\n eventAdmin.sendEvent(EventFactory.channelCreated(channel));\n }\n content.fireChannelChanged(channel);\n }\n if (responseConferenceIQ == null)\n break;\n }\n for (ColibriConferenceIQ.SctpConnection sctpConnIq : contentIQ.getSctpConnections()) {\n String id = sctpConnIq.getID();\n String endpointID = sctpConnIq.getEndpoint();\n SctpConnection sctpConn;\n int expire = sctpConnIq.getExpire();\n String channelBundleId = sctpConnIq.getChannelBundleId();\n if (id == null) {\n Endpoint endpoint = (endpointID == null) ? null : conference.getOrCreateEndpoint(endpointID);\n sctpConn = content.getSctpConnection(endpoint);\n if (sctpConn == null) {\n if (expire == 0)\n continue;\n int sctpPort = sctpConnIq.getPort();\n sctpConn = content.createSctpConnection(endpoint, sctpPort, channelBundleId, sctpConnIq.isInitiator());\n }\n } else {\n sctpConn = content.getSctpConnection(id);\n if (sctpConn == null && expire == 0)\n continue;\n if (endpointID != null)\n sctpConn.setEndpoint(endpointID);\n }\n if (expire != ColibriConferenceIQ.Channel.EXPIRE_NOT_SPECIFIED) {\n sctpConn.setExpire(expire);\n }\n if (sctpConn.isExpired())\n continue;\n Boolean initiator = sctpConnIq.isInitiator();\n if (initiator != null)\n sctpConn.setInitiator(initiator);\n sctpConn.setTransport(sctpConnIq.getTransport());\n if (channelBundleId != null) {\n TransportManager transportManager = conference.getTransportManager(channelBundleId, true);\n transportManager.addChannel(sctpConn);\n }\n ColibriConferenceIQ.SctpConnection responseSctpIq = new ColibriConferenceIQ.SctpConnection();\n sctpConn.describe(responseSctpIq);\n responseContentIQ.addSctpConnection(responseSctpIq);\n }\n }\n if (responseConferenceIQ == null)\n break;\n }\n for (ColibriConferenceIQ.ChannelBundle channelBundleIq : conferenceIQ.getChannelBundles()) {\n TransportManager transportManager = conference.getTransportManager(channelBundleIq.getId());\n IceUdpTransportPacketExtension transportIq = channelBundleIq.getTransport();\n if (transportManager != null && transportIq != null) {\n transportManager.startConnectivityEstablishment(transportIq);\n }\n }\n }\n if (conference != null) {\n for (ColibriConferenceIQ.Endpoint colibriEndpoint : conferenceIQ.getEndpoints()) {\n conference.updateEndpoint(colibriEndpoint);\n }\n if (responseConferenceIQ != null)\n conference.describeChannelBundles(responseConferenceIQ);\n }\n if (responseConferenceIQ != null) {\n responseConferenceIQ.setType(org.jivesoftware.smack.packet.IQ.Type.RESULT);\n }\n return responseConferenceIQ;\n}\n"
|
"public void map(LongWritable userID, VectorWritable vectorWritable, OutputCollector<LongWritable, RecommendedItemsWritable> output, Reporter reporter) throws IOException {\n if ((usersToRecommendFor != null) && !usersToRecommendFor.contains(userID.get())) {\n return;\n }\n Vector userVector = vectorWritable.get();\n Iterator<Vector.Element> userVectorIterator = userVector.iterateNonZero();\n Vector recommendationVector = new RandomAccessSparseVector(Integer.MAX_VALUE, 1000);\n while (userVectorIterator.hasNext()) {\n Vector.Element element = userVectorIterator.next();\n int index = element.index();\n Vector columnVector;\n try {\n columnVector = cooccurrenceColumnCache.get(new IntWritable(index));\n } catch (TasteException te) {\n if (te.getCause() instanceof IOException) {\n throw (IOException) te.getCause();\n } else {\n throw new IOException(te.getCause());\n }\n }\n if (columnVector != null) {\n if (booleanData) {\n columnVector.addTo(recommendationVector);\n } else {\n double value = element.get();\n columnVector.times(value).addTo(recommendationVector);\n }\n }\n }\n Queue<RecommendedItem> topItems = new PriorityQueue<RecommendedItem>(recommendationsPerUser + 1, Collections.reverseOrder(ByValueRecommendedItemComparator.getInstance()));\n Iterator<Vector.Element> recommendationVectorIterator = recommendationVector.iterateNonZero();\n LongWritable itemID = new LongWritable();\n while (recommendationVectorIterator.hasNext()) {\n Vector.Element element = recommendationVectorIterator.next();\n int index = element.index();\n if (userVector.get(index) == 0.0) {\n if (topItems.size() < recommendationsPerUser) {\n indexItemIDMap.get(new IntWritable(index), itemID);\n topItems.add(new GenericRecommendedItem(itemID.get(), (float) element.get()));\n } else if (element.get() > topItems.peek().getValue()) {\n indexItemIDMap.get(new IntWritable(index), itemID);\n topItems.add(new GenericRecommendedItem(itemID.get(), (float) element.get()));\n topItems.poll();\n }\n }\n }\n List<RecommendedItem> recommendations = new ArrayList<RecommendedItem>(topItems.size());\n recommendations.addAll(topItems);\n Collections.sort(recommendations);\n output.collect(userID, new RecommendedItemsWritable(recommendations));\n}\n"
|
"public double predictCombinationScore(Vector vector, int k) {\n return predictCombinationScore(vector, supportedCombinations.get(k));\n}\n"
|
"public void run() {\n for (IRFunction irFunction : ir.getFuncs().values()) {\n irFunction.setRecursiveCall(irFunction.recursiveCalleeSet.contains(irFunction));\n FuncInfo funcInfo = new FuncInfo();\n funcInfo.recursiveCall = irFunction.isRecursiveCall();\n funcInfoMap.put(irFunction, funcInfo);\n }\n for (IRFunction irFunction : ir.getFuncs().values()) {\n FuncInfo funcInfo = funcInfoMap.get(irFunction);\n for (BasicBlock bb : irFunction.getReversePostOrder()) {\n for (IRInstruction inst = bb.getFirstInst(); inst != null; inst = inst.getNextInst()) {\n ++funcInfo.numInst;\n if (inst instanceof IRFunctionCall) {\n FuncInfo calleeInfo = funcInfoMap.get(((IRFunctionCall) inst).getFunc());\n if (calleeInfo != null) {\n ++calleeInfo.numCalled;\n }\n }\n }\n }\n }\n List<BasicBlock> reversePostOrder = new ArrayList<>();\n List<String> unCalledFuncs = new ArrayList<>();\n boolean changed = true, thisFuncChanged;\n while (changed) {\n changed = false;\n unCalledFuncs.clear();\n for (IRFunction irFunction : ir.getFuncs().values()) {\n FuncInfo funcInfo = funcInfoMap.get(irFunction);\n reversePostOrder.clear();\n reversePostOrder.addAll(irFunction.getReversePostOrder());\n thisFuncChanged = false;\n for (BasicBlock bb : reversePostOrder) {\n for (IRInstruction inst = bb.getFirstInst(), nextInst; inst != null; inst = nextInst) {\n nextInst = inst.getNextInst();\n if (!(inst instanceof IRFunctionCall))\n continue;\n FuncInfo calleeInfo = funcInfoMap.get(((IRFunctionCall) inst).getFunc());\n if (calleeInfo == null)\n continue;\n if (calleeInfo.recursiveCall)\n continue;\n if (calleeInfo.numInst > MAX_INLINE_INST || calleeInfo.numInst + funcInfo.numInst > MAX_FUNC_INST)\n continue;\n nextInst = inlineFunctionCall((IRFunctionCall) inst);\n funcInfo.numInst += calleeInfo.numInst;\n changed = true;\n thisFuncChanged = true;\n --calleeInfo.numCalled;\n if (calleeInfo.numCalled == 0) {\n unCalledFuncs.add(((IRFunctionCall) inst).getFunc().getName());\n }\n }\n }\n if (thisFuncChanged) {\n irFunction.calcReversePostOrder();\n }\n }\n for (String funcName : unCalledFuncs) {\n ir.removeFunc(funcName);\n }\n }\n for (IRFunction irFunction : ir.getFuncs().values()) {\n irFunction.updateCalleeSet();\n }\n ir.updateCalleeSet();\n}\n"
|
"public int initFromPage(long valueCount, byte[] page, int offset) throws IOException {\n if (DEBUG)\n LOG.debug(\"String_Node_Str\" + offset + \"String_Node_Str\" + (page.length - offset));\n this.in = new ByteArrayInputStream(page, offset, page.length - offset);\n int bitWidth = BytesUtils.readIntLittleEndianOnOneByte(in);\n if (DEBUG)\n LOG.debug(\"String_Node_Str\" + bitWidth);\n decoder = new RunLengthBitPackingHybridDecoder(bitWidth, in);\n return page.length;\n}\n"
|
"public void Render(net.minecraft.tileentity.TileEntity TileEntity) {\n if (TileEntity instanceof CarriageTranslocatorEntity) {\n CarriageTranslocatorEntity Translocator = (CarriageTranslocatorEntity) TileEntity;\n if (Translocator.Player == null) {\n return;\n }\n UseFullLabel();\n if (Translocator.Player.equals(\"String_Node_Str\")) {\n UseFullIcon(CarriageDrive.PublicIcon);\n } else {\n if (Translocator.Player.equals(net.minecraft.client.Minecraft.getMinecraft().thePlayer.getDisplayName())) {\n UseFullIcon(CarriageDrive.PrivateToSelfIcon);\n } else {\n UseFullIcon(CarriageDrive.PrivateToOtherIcon);\n }\n }\n RenderOverlay(0.001, Translocator.SideClosed, false);\n for (Vanilla.DyeTypes DyeType : Vanilla.DyeTypes.values()) {\n if (CarriageDriveItem.LabelHasDye(Translocator.Label, DyeType)) {\n double GridH = ((double) (DyeType.ordinal() % 4)) / 4;\n double GridV = ((double) (DyeType.ordinal() / 4)) / 4;\n UsePartialLabel(GridH, GridV, GridH + 0.25, GridV + 0.25);\n UsePartialIcon(CarriageDrive.DyeIconSet, GridH, GridV, GridH + 0.25, GridV + 0.25);\n RenderOverlay(0.002, Translocator.SideClosed, false);\n }\n }\n }\n}\n"
|
"public ModelAndView processForm(HttpServletRequest request, HttpServletResponse response, String uuid, Class<Parameterizable> type, String action, String format, String successView, Parameterizable parameterizable, BindingResult bindingResult) throws Exception {\n Object results = null;\n ModelAndView model = new ModelAndView();\n if (bindingResult.hasErrors()) {\n request.getSession().setAttribute(WebConstants.OPENMRS_ERROR_ATTR, \"String_Node_Str\");\n return setupForm(request);\n }\n if (parameterizable == null)\n parameterizable = ParameterizableUtil.getParameterizable(uuid, type);\n if (parameterizable != null) {\n EvaluationContext evaluationContext = new EvaluationContext();\n Map<String, String> parameterValuesAsStrings = new HashMap<String, String>();\n for (Parameter parameter : parameterizable.getParameters()) {\n log.info(\"String_Node_Str\" + parameter.getName() + \"String_Node_Str\" + request.getParameter(parameter.getName()));\n parameterValuesAsStrings.put(parameter.getName(), request.getParameter(parameter.getName()));\n }\n Map<String, Object> parameterValues = new HashMap<String, Object>();\n if (parameterizable != null && parameterizable.getParameters() != null) {\n for (Parameter parameter : parameterizable.getParameters()) {\n Object paramVal = WidgetUtil.getFromRequest(parameter.getName(), parameterizable, request);\n parameterValues.put(parameter.getName(), paramVal);\n }\n }\n evaluationContext.setParameterValues(parameterValues);\n model.addObject(\"String_Node_Str\", evaluationContext);\n try {\n results = ParameterizableUtil.evaluateParameterizable(parameterizable, evaluationContext);\n request.getSession().setAttribute(\"String_Node_Str\", results);\n model.setViewName(\"String_Node_Str\");\n } catch (ParameterException e) {\n log.error(\"String_Node_Str\", e);\n request.getSession().setAttribute(WebConstants.OPENMRS_ERROR_ATTR, \"String_Node_Str\" + e.getMessage());\n setupForm(request);\n }\n }\n log.info(\"String_Node_Str\" + model.getViewName() + \"String_Node_Str\" + model.getModelMap());\n return model;\n}\n"
|
"protected Map getParsedParameters(IViewerReportDesignHandle design, Collection parameterList, HttpServletRequest request, InputOptions options) throws ReportServiceException {\n Map params = new HashMap();\n if (parameterList == null || this.parametersAsString == null)\n return params;\n for (Iterator iter = parameterList.iterator(); iter.hasNext(); ) {\n ScalarParameterHandle parameter = null;\n Object parameterObj = iter.next();\n if (parameterObj instanceof ScalarParameterHandle) {\n parameter = (ScalarParameterHandle) parameterObj;\n }\n if (parameter == null)\n continue;\n String paramName = parameter.getName();\n Object paramValueObj = this.parametersAsString.get(paramName);\n if (paramValueObj != null) {\n try {\n try {\n paramValueObj = ParameterValidationUtil.validate(parameter.getDataType(), parameter.getPattern(), paramValueObj.toString(), locale);\n } catch (ValidationValueException e1) {\n paramValueObj = ParameterValidationUtil.validate(parameter.getDataType(), ParameterValidationUtil.DEFAULT_DATETIME_FORMAT, paramValueObj.toString());\n }\n params.put(paramName, paramValueObj);\n } catch (ValidationValueException e) {\n if (ParameterAccessor.SERVLET_PATH_RUN.equalsIgnoreCase(request.getServletPath())) {\n this.exception = e;\n break;\n }\n }\n } else {\n params.put(paramName, null);\n }\n }\n return params;\n}\n"
|
"private void gatherBipartitions() {\n TLongBipartition[] summed = new BipartSetSum(bipartsByTree).toArray();\n for (int i = 0; i < original.length; i++) {\n bipart.add(original[i]);\n bipartId.put(original[i], i);\n }\n for (int i = 0; i < summed.length; i++) {\n int k = i + original.length;\n bipart.add(k, summed[i]);\n summedBipartIds.add(k);\n }\n System.out.println(\"String_Node_Str\" + original.length + \"String_Node_Str\" + summedBipartIds.size() + \"String_Node_Str\" + bipart.size());\n}\n"
|
"public void pullFile(String removeFrom, File localTo) {\n if (logger.isDebugEnabled()) {\n logger.debug(\"String_Node_Str\");\n }\n try {\n if (device.getSyncService() == null)\n throw new RuntimeException(\"String_Node_Str\");\n Method m = device.getSyncService().getClass().getDeclaredMethod(\"String_Node_Str\", String.class, String.class, ISyncProgressMonitor.class);\n m.setAccessible(true);\n device.getSyncService();\n m.invoke(device.getSyncService(), removeFrom, localTo.getAbsolutePath(), SyncService.getNullProgressMonitor());\n } catch (Exception ex) {\n logger.error(\"String_Node_Str\", ex);\n throw new AndroidScreenCastRuntimeException(ex);\n }\n if (logger.isDebugEnabled()) {\n logger.debug(\"String_Node_Str\");\n }\n}\n"
|
"public int fill(FluidStack resource, boolean doFill) {\n if (from == null || allowInsertion(sideConfig.sideTypes[sideCache[from.ordinal()]])) {\n if (resource == null) {\n return 0;\n }\n for (int j = 0; j < tanks.length && tanks[j].getSpace() > 0; j++) {\n int toFill = tanks[j].fill(new FluidStack(resource, Math.min(resource.amount, amountInput)), doFill);\n if (toFill > 0) {\n return toFill;\n }\n }\n }\n return 0;\n}\n"
|
"public Patch fromText(String input) {\n patches.clear();\n Matcher m = patchBoundaryPattern.matcher(input);\n int index = 0;\n while (m.find()) {\n int start = m.start();\n String match = input.substring(index, start);\n patches.add(new PatchEntry(match));\n index = start + 1;\n }\n if (index == 0) {\n patches.add(new PatchEntry(input));\n } else {\n patches.add(new PatchEntry(input.substring(index)));\n }\n return this;\n}\n"
|
"private String createJPQLQuery() throws ODataJPARuntimeException {\n StringBuilder jpqlQuery = new StringBuilder();\n String tableAlias = context.getJPAEntityAlias();\n String fromClause = context.getJPAEntityName() + JPQLStatement.DELIMITER.SPACE + tableAlias;\n jpqlQuery.append(JPQLStatement.KEYWORD.SELECT).append(JPQLStatement.DELIMITER.SPACE);\n jpqlQuery.append(tableAlias).append(JPQLStatement.DELIMITER.SPACE);\n jpqlQuery.append(JPQLStatement.KEYWORD.FROM).append(JPQLStatement.DELIMITER.SPACE);\n jpqlQuery.append(fromClause);\n if (context.getWhereExpression() != null) {\n jpqlQuery.append(JPQLStatement.DELIMITER.SPACE);\n jpqlQuery.append(JPQLStatement.KEYWORD.WHERE).append(JPQLStatement.DELIMITER.SPACE);\n jpqlQuery.append(context.getWhereExpression());\n }\n if (context.getOrderByCollection() != null && context.getOrderByCollection().size() > 0) {\n StringBuilder orderByBuilder = new StringBuilder();\n Iterator<Entry<String, String>> orderItr = context.getOrderByCollection().entrySet().iterator();\n int i = 0;\n while (orderItr.hasNext()) {\n if (i != 0) {\n orderByBuilder.append(JPQLStatement.DELIMITER.SPACE).append(JPQLStatement.DELIMITER.COMMA).append(JPQLStatement.DELIMITER.SPACE);\n }\n Entry<String, String> entry = orderItr.next();\n orderByBuilder.append(entry.getKey()).append(JPQLStatement.DELIMITER.SPACE);\n orderByBuilder.append(entry.getValue());\n i++;\n }\n jpqlQuery.append(JPQLStatement.DELIMITER.SPACE);\n jpqlQuery.append(JPQLStatement.KEYWORD.ORDERBY).append(JPQLStatement.DELIMITER.SPACE);\n jpqlQuery.append(orderByBuilder);\n }\n return jpqlQuery.toString();\n}\n"
|
"private Statement convertToUnion(String query, Statement statement, int startParseIndex) throws ParseException {\n int start = query.indexOf(\"String_Node_Str\", startParseIndex);\n String begin = query.substring(0, start);\n XPathToSQL2Converter converter = new XPathToSQL2Converter();\n String partList = query.substring(start);\n converter.initialize(partList);\n converter.read();\n int lastParseIndex = converter.parseIndex;\n int lastOrIndex = lastParseIndex;\n converter.read(\"String_Node_Str\");\n int level = 0;\n ArrayList<String> parts = new ArrayList<String>();\n int parseIndex;\n while (true) {\n parseIndex = converter.parseIndex;\n if (converter.readIf(\"String_Node_Str\")) {\n level++;\n } else if (converter.readIf(\"String_Node_Str\")) {\n if (level-- <= 0) {\n break;\n }\n } else if (converter.readIf(\"String_Node_Str\") && level == 0) {\n String or = partList.substring(lastOrIndex, lastParseIndex);\n parts.add(or);\n lastOrIndex = parseIndex;\n } else if (converter.currentTokenType == END) {\n throw getSyntaxError(\"String_Node_Str\");\n } else {\n converter.read();\n }\n lastParseIndex = parseIndex;\n }\n String or = partList.substring(lastOrIndex, lastParseIndex);\n parts.add(or);\n String end = partList.substring(parseIndex);\n Statement result = null;\n for (String p : parts) {\n String q = begin + p + end;\n converter = new XPathToSQL2Converter();\n Statement stat = converter.convertToStatement(q);\n if (result == null) {\n result = stat;\n } else {\n UnionStatement union = new UnionStatement(result, stat);\n union.orderList = stat.orderList;\n union.queryOptions = stat.queryOptions;\n result = union;\n }\n stat.orderList = new ArrayList<Order>();\n stat.queryOptions = new QueryOptions();\n }\n return result;\n}\n"
|
"public void preInit(FMLPreInitializationEvent event) throws Exception {\n settings.load(event);\n if (MinecraftServer.getServer() != null && MinecraftServer.getServer().isDedicatedServer()) {\n settings.isServer = true;\n } else {\n settings.isServer = false;\n ClientCommandHandler.instance.registerCommand(new ConfigGUI());\n }\n snw = NetworkRegistry.INSTANCE.newSimpleChannel(Reference.ID);\n snw.registerMessage(ResponceHandler.class, Responce.class, 0, Side.SERVER);\n snw.registerMessage(PerkInfoHandler.class, PerkInfo.class, 1, Side.CLIENT);\n snw.registerMessage(RequestHandler.class, Request.class, 2, Side.SERVER);\n}\n"
|
"public void onReceive(Context context, Intent intent) {\n String from, to;\n double amount;\n switch(intent.getAction()) {\n case ChangellyService.INFO_CURRENCIES:\n Log.d(TAG, \"String_Node_Str\");\n ArrayList<String> currenciesRes = intent.getStringArrayListExtra(ChangellyService.CURRENCIES);\n if (currenciesRes != null) {\n Log.d(TAG, \"String_Node_Str\" + currenciesRes);\n Collections.sort(currenciesRes);\n List<CurrencyAdapter.Item> itemList = new ArrayList<>();\n itemList.add(new CurrencyAdapter.Item(null, CurrencyAdapter.VIEW_TYPE_PADDING));\n for (String curr : currenciesRes) {\n if (!curr.equalsIgnoreCase(\"String_Node_Str\")) {\n itemList.add(new CurrencyAdapter.Item(curr.toUpperCase(), CurrencyAdapter.VIEW_TYPE_ITEM));\n }\n }\n itemList.add(new CurrencyAdapter.Item(null, CurrencyAdapter.VIEW_TYPE_PADDING));\n currencyAdapter.setItems(itemList);\n setLayout(ChangellyUITypes.Main);\n }\n break;\n case ChangellyService.INFO_MIN_AMOUNT:\n from = intent.getStringExtra(ChangellyService.FROM);\n to = intent.getStringExtra(ChangellyService.TO);\n amount = intent.getDoubleExtra(ChangellyService.AMOUNT, 0);\n CurrencyAdapter.Item item = currencyAdapter.getItem(currencySelector.getSelectedItem());\n if (item != null && from != null && to != null && to.equalsIgnoreCase(ChangellyService.BTC) && from.equalsIgnoreCase(item.currency)) {\n Log.d(TAG, \"String_Node_Str\" + amount + \"String_Node_Str\" + from);\n minAmount = amount;\n tvMinAmountValue.setText(getString(R.string.exchange_minimum_amount, decimalFormat.format(minAmount), item.currency));\n }\n break;\n case ChangellyService.INFO_EXCH_AMOUNT:\n from = intent.getStringExtra(ChangellyService.FROM);\n to = intent.getStringExtra(ChangellyService.TO);\n amount = intent.getDoubleExtra(ChangellyService.AMOUNT, 0);\n item = currencyAdapter.getItem(currencySelector.getSelectedItem());\n if (item != null && from != null && to != null) {\n Log.d(TAG, \"String_Node_Str\" + amount + \"String_Node_Str\" + to);\n avoidTextChangeEvent = true;\n try {\n if (to.equalsIgnoreCase(ChangellyService.BTC) && from.equalsIgnoreCase(item.currency) && fromAmount == Double.parseDouble(fromValue.getText().toString())) {\n toValue.setText(decimalFormat.format(amount));\n } else if (from.equalsIgnoreCase(ChangellyService.BTC) && to.equalsIgnoreCase(item.currency) && fromAmount == Double.parseDouble(toValue.getText().toString())) {\n fromValue.setText(decimalFormat.format(amount));\n }\n isValueForOfferOk(true);\n } catch (NumberFormatException ignore) {\n }\n avoidTextChangeEvent = false;\n }\n break;\n case INFO_ERROR:\n Toast.makeText(ChangellyActivity.this, \"String_Node_Str\", Toast.LENGTH_LONG).show();\n break;\n }\n}\n"
|
"public double evaluateDouble(Evaluator evaluator) {\n List memberList = evaluateCurrentList(listCalc, evaluator);\n return (Double) stdev(evaluator.push(false), memberList, calc, true);\n}\n"
|
"public synchronized void centerViewPort(final float[] transformedPts, final Chart<?> chart) {\n Matrix save = new Matrix();\n save.set(mMatrixTouch);\n final float x = transformedPts[0] - offsetLeft();\n final float y = transformedPts[1] - offsetTop();\n save.postTranslate(-x, -y);\n refresh(save, view, false);\n}\n"
|
"public void createInstanceFromExisting(KeplerDocumentationAttribute da) {\n Iterator itt = da.attributeList().iterator();\n while (itt.hasNext()) {\n ConfigurableAttribute att = (ConfigurableAttribute) itt.next();\n String attName = att.getName();\n if (attName.equals(\"String_Node_Str\")) {\n this.description = att.getConfigureText();\n } else if (attName.equals(\"String_Node_Str\")) {\n this.author = att.getConfigureText();\n } else if (attName.equals(\"String_Node_Str\")) {\n this.version = att.getConfigureText();\n } else if (attName.equals(\"String_Node_Str\")) {\n this.userLevelDocumentation = att.getConfigureText();\n } else if (attName.indexOf(\"String_Node_Str\") != -1) {\n String portName = attName.substring(attName.indexOf(\"String_Node_Str\") + 1, attName.length());\n String portDesc = att.getConfigureText();\n if (portName != null) {\n if (portDesc == null) {\n portDesc = \"String_Node_Str\";\n }\n portHash.put(portName, portDesc);\n }\n } else if (attName.indexOf(\"String_Node_Str\") != -1) {\n String propName = attName.substring(attName.indexOf(\"String_Node_Str\") + 1, attName.length());\n String propDesc = att.getConfigureText();\n propertyHash.put(propName, propDesc);\n }\n }\n}\n"
|
"public boolean equals(Object other) {\n if (!(other instanceof OutPoint)) {\n return false;\n }\n return txid.equals(((OutPoint) other).txid) && index == ((OutPoint) other).index;\n}\n"
|
"public void testImplicitMember() throws Exception {\n String mdx = \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\";\n Result result1 = getTestContext().executeQuery(mdx);\n String resultString1 = TestContext.toString(result1);\n Result result2 = getCubeTestContext().executeQuery(mdx);\n String resultString2 = TestContext.toString(result2);\n assertEquals(resultString1, resultString2);\n}\n"
|
"public Contact getDefaultContact(Class<? extends OperationSet> operationSet) {\n Contact defaultOpSetContact = null;\n Contact defaultContact = getDefaultContact();\n if (defaultContact != null && defaultContact.getProtocolProvider().getOperationSet(operationSet) != null) {\n defaultOpSetContact = getDefaultContact();\n } else {\n for (Contact protoContact : protoContacts) {\n PresenceStatus currentStatus = null;\n if (protoContact.getProtocolProvider().getOperationSet(operationSet) != null) {\n PresenceStatus contactStatus = protoContact.getPresenceStatus();\n if (currentStatus != null) {\n if (currentStatus.getStatus() < contactStatus.getStatus()) {\n currentStatus = contactStatus;\n defaultOpSetContact = protoContact;\n }\n } else {\n currentStatus = contactStatus;\n defaultOpSetContact = protoContact;\n }\n }\n }\n }\n return defaultOpSetContact;\n}\n"
|
"private FlowScope traverseName(Node n, FlowScope scope) {\n String varName = n.getString();\n Node value = n.getFirstChild();\n JSType type = n.getJSType();\n if (value != null) {\n scope = traverse(value, scope);\n updateScopeForTypeChange(scope, n, n.getJSType(), getJSType(value));\n return scope;\n } else {\n StaticSlot<JSType> var = scope.getSlot(varName);\n if (var != null) {\n boolean isInferred = var.isTypeInferred();\n boolean unflowable = isInferred && unflowableVarNames.contains(varName);\n boolean nonLocalInferredSlot = isInferred && syntacticScope.getParent() != null && var == syntacticScope.getParent().getSlot(varName);\n if (!unflowable && !nonLocalInferredSlot) {\n type = var.getType();\n if (type == null) {\n type = getNativeType(UNKNOWN_TYPE);\n }\n }\n }\n }\n n.setJSType(type);\n return scope;\n}\n"
|
"public FutureData<Usage> usage(Usage.Period timePeriod) {\n FutureData<Usage> future = new FutureData<Usage>();\n String period;\n switch(timePeriod) {\n case HOUR:\n period = \"String_Node_Str\";\n break;\n case CURRENT:\n period = \"String_Node_Str\";\n break;\n case DAY:\n default:\n period = \"String_Node_Str\";\n }\n URI uri = newParams().put(\"String_Node_Str\", period).forURL(config.newAPIEndpointURI(USAGE));\n Request request = config.http().GET(uri, new PageReader(newRequestCallback(future, new Usage(), config)));\n performRequest(future, request);\n return future;\n}\n"
|
"private void setupUI() {\n listView.setOnItemClickListener(this);\n listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);\n final CheckedItemAdapter adapter = new CheckedItemAdapter(getContext(), android.R.layout.simple_list_item_single_choice, android.R.id.text1, chapters);\n listView.setAdapter(adapter);\n if (selectedChapter != null) {\n int selectedItemPos = chapters.indexOf(selectedChapter);\n listView.setSelection(selectedItemPos);\n listView.setItemChecked(selectedItemPos, true);\n }\n final Filter.FilterListener filterListener = new Filter.FilterListener() {\n public void onFilterComplete(int count) {\n int index = findIndexByValueInFilteredListView(selectedChapter);\n listView.setItemChecked(index, true);\n }\n };\n cityNameSearchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\n public boolean onQueryTextSubmit(String query) {\n return false;\n }\n public boolean onQueryTextChange(String newText) {\n adapter.getFilter().filter(newText, filterListener);\n return true;\n }\n });\n cityNameSearchView.requestFocus();\n adapter.getFilter().filter(cityNameSearchView.getQuery(), filterListener);\n}\n"
|
"protected void handleDatasetComboSelectedEvent() {\n Iterator iter = null;\n DataSetHandle handle = null;\n if (datasetHandle != null) {\n handle = datasetHandle;\n } else if (dataSetName != null) {\n handle = DataUtil.findDataSet(dataSetName);\n } else {\n if (dataSetCombo.getSelectionIndex() > 0) {\n String dataset = dataSetCombo.getItem(dataSetCombo.getSelectionIndex());\n DataSetHandle datasetHandle = SessionHandleAdapter.getInstance().getModule().findDataSet(dataset);\n Iterator iter = null;\n if (datasetHandle != null) {\n try {\n CachedMetaDataHandle cmdh = DataSetUIUtil.getCachedMetaDataHandle(datasetHandle);\n iter = cmdh.getResultSet().iterator();\n } catch (SemanticException e) {\n ExceptionHandler.handle(e);\n }\n } else {\n iter = new LinkedDataSetAdapter().getDataSetResLinkedDataModel(dataset);\n }\n if (iter != null) {\n columnViewers.setInput(iter);\n } else {\n columnViewers.setInput(Collections.EMPTY_LIST.iterator());\n }\n } else {\n columnViewers.setInput(Collections.EMPTY_LIST.iterator());\n }\n }\n}\n"
|
"private IEditorInput createEditorInput(IFileStore fileStore) {\n IFile workspaceFile = getWorkspaceFile(fileStore);\n if (workspaceFile != null)\n return new FileEditorInput(workspaceFile);\n IEditorInput iei = null;\n try {\n Class.forName(\"String_Node_Str\");\n iei = new FileStoreEditorInput(fileStore);\n } catch (ClassNotFoundException e) {\n return new IEPInput() {\n public boolean exists() {\n return fileStore.fetchInfo().exists();\n }\n public ImageDescriptor getImageDescriptor() {\n return null;\n }\n public String getName() {\n return fileStore.getName();\n }\n public IPersistableElement getPersistable() {\n return null;\n }\n public String getToolTipText() {\n return fileStore.toString();\n }\n public Object getAdapter(Class adapter) {\n if (IWorkbenchAdapter.class.equals(adapter))\n return new IWorkbenchAdapter() {\n public Object[] getChildren(Object o) {\n return null;\n }\n public ImageDescriptor getImageDescriptor(Object object) {\n return null;\n }\n public String getLabel(Object o) {\n return ((FileStoreEditorInput) o).getName();\n }\n public Object getParent(Object o) {\n return null;\n }\n };\n return Platform.getAdapterManager().getAdapter(this, adapter);\n }\n public IPath getPath() {\n return new Path(fileStore.toURI().getPath());\n }\n };\n }\n return iei;\n}\n"
|
"public static boolean hasPermissions(Player player, String[] perms) {\n if (player == null || player.isOp()) {\n return true;\n }\n for (String perm : perms) {\n boolean hasperm = false;\n if (player.hasPermission(perm)) {\n hasperm = true;\n } else {\n String[] nodes = perm.split(\"String_Node_Str\");\n StringBuilder n = new StringBuilder();\n for (int i = 0; i < (nodes.length - 1); i++) {\n n.append(nodes[i] + \"String_Node_Str\");\n if (player.hasPermission(n + \"String_Node_Str\")) {\n hasperm = true;\n break;\n }\n }\n }\n if (!hasperm) {\n return false;\n }\n }\n return true;\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.