content stringlengths 40 137k |
|---|
"public void test_getValues_withValidInterval() {\n Timestamp from = today.minus(15);\n Timestamp to = today.minus(5);\n int[] expectedValues = { CHECKED_EXPLICITLY, CHECKED_IMPLICITLY, CHECKED_IMPLICITLY, CHECKED_EXPLICITLY, CHECKED_EXPLICITLY, UNCHECKED, UNCHECKED, UNCHECKED, UNCHECKED, UNCHECKED, UNCHECKED };\n int[] actualValues = nonDailyHabit.getCheckmarks().getValues(new Timestamp(from), new Timestamp(to));\n assertThat(actualValues, equalTo(expectedValues));\n}\n"
|
"private double getParticipationCoefficient(Node node, Communities communities) {\n HashMap<Community, Integer> counter = new HashMap<Community, Integer>();\n for (int dst : node.getOutgoingEdges()) {\n Community community = communities.getCommunityOfNode(dst);\n int count = counter.containsKey(community) ? counter.get(community) + 1 : 1;\n counter.put(community, count);\n }\n double psum = 0;\n for (Community community : counter.keySet()) {\n psum += Math.pow((double) counter.get(community) / (double) node.getOutDegree(), 2);\n }\n return 1.0 - psum;\n}\n"
|
"public Chart getModel(String sSubType, Orientation orientation, String sDimension, Chart currentChart) {\n ChartWithAxes newChart = null;\n if (currentChart != null) {\n newChart = (ChartWithAxes) getConvertedChart(currentChart, sSubType, orientation, sDimension);\n if (newChart != null) {\n return newChart;\n }\n }\n newChart = ChartWithAxesImpl.create();\n newChart.setType(TYPE_LITERAL);\n newChart.setSubType(sSubType);\n newChart.setOrientation(orientation);\n newChart.setDimension(getDimensionFor(sDimension));\n newChart.setUnits(\"String_Node_Str\");\n ((Axis) newChart.getAxes().get(0)).setOrientation(Orientation.HORIZONTAL_LITERAL);\n ((Axis) newChart.getAxes().get(0)).setType(AxisType.TEXT_LITERAL);\n ((Axis) newChart.getAxes().get(0)).setCategoryAxis(true);\n SeriesDefinition sdX = SeriesDefinitionImpl.create();\n Series categorySeries = SeriesImpl.create();\n sdX.getSeries().add(categorySeries);\n sdX.getSeriesPalette().shift(0);\n ((Axis) newChart.getAxes().get(0)).getSeriesDefinitions().add(sdX);\n newChart.getTitle().getLabel().getCaption().setValue(getDefaultTitle());\n ((Axis) ((Axis) newChart.getAxes().get(0)).getAssociatedAxes().get(0)).setOrientation(Orientation.VERTICAL_LITERAL);\n ((Axis) ((Axis) newChart.getAxes().get(0)).getAssociatedAxes().get(0)).setType(AxisType.LINEAR_LITERAL);\n SeriesDefinition sdY = SeriesDefinitionImpl.create();\n sdY.getSeriesPalette().shift(0);\n Series valueSeries = DifferenceSeriesImpl.create();\n ((Marker) ((DifferenceSeries) valueSeries).getMarkers().get(0)).setVisible(false);\n ((DifferenceSeries) valueSeries).getLineAttributes().setColor(ColorDefinitionImpl.BLUE());\n ((DifferenceSeries) valueSeries).setStacked(false);\n sdY.getSeries().add(valueSeries);\n ((Axis) ((Axis) newChart.getAxes().get(0)).getAssociatedAxes().get(0)).getSeriesDefinitions().add(sdY);\n addSampleData(newChart);\n return newChart;\n}\n"
|
"public void encrypt(Bundle params) {\n params.putStringArray(OpenPgpConstants.PARAMS_USER_IDS, mEncryptUserIds.getText().toString().split(\"String_Node_Str\"));\n params.putBoolean(OpenPgpConstants.PARAMS_REQUEST_ASCII_ARMOR, true);\n InputStream is = getInputstream(false);\n final ByteArrayOutputStream os = new ByteArrayOutputStream();\n OpenPgpApi api = new OpenPgpApi(this, mCryptoServiceConnection.getService());\n api.encrypt(params, is, os, new MyCallback(true, os, REQUEST_CODE_ENCRYPT));\n}\n"
|
"public XmlBindings getXmlBindings(Map<String, ?> properties, ClassLoader classLoader) {\n try {\n JAXBContext jaxbContext = CompilerHelper.getXmlBindingsModelContext();\n Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();\n if (null != xmlBindingsSource) {\n return (XmlBindings) unmarshaller.unmarshal(xmlBindingsSource);\n }\n if (null != xmlBindingsURL) {\n return (XmlBindings) unmarshaller.unmarshal(xmlBindingsURL);\n }\n } catch (JAXBException e) {\n throw org.eclipse.persistence.exceptions.JAXBException.couldNotUnmarshalMetadata(e);\n }\n return null;\n}\n"
|
"private void getIcons(Context ctx) {\n mBackIcon = ctx.getDrawable(R.drawable.ic_sysbar_back);\n mBackLandIcon = mBackIcon;\n mBackAltIcon = ctx.getDrawable(R.drawable.ic_sysbar_back_ime);\n mBackAltLandIcon = mBackAltIcon;\n mHomeDefaultIcon = ctx.getDrawable(R.drawable.ic_sysbar_home);\n mRecentIcon = ctx.getDrawable(R.drawable.ic_sysbar_recent);\n mDockedIcon = ctx.getDrawable(R.drawable.ic_sysbar_docked);\n getCarModeIcons(ctx);\n}\n"
|
"private Spacing getSpacingForRecords(CsvBlock child1, CsvBlock child2) {\n Spacing spacing;\n Block fieldBlock = null;\n CsvColumnInfo columnInfo = null;\n if (child2 != null && child2.getNode().getElementType() == CsvTypes.RECORD) {\n columnInfo = formattingInfo.getColumnInfo(0);\n fieldBlock = subBlocks.get(0);\n }\n int spaces = 0;\n if (columnInfo != null) {\n spaces += columnInfo.getMaxLength() - fieldBlock.getTextRange().getLength();\n }\n spacing = Spacing.createSpacing(spaces, spaces, 0, true, formattingInfo.getCodeStyleSettings().KEEP_BLANK_LINES_IN_CODE);\n return spacing;\n}\n"
|
"public static void saveObject(Object object, String name) {\n if (saveIncomeData) {\n ObjectOutputStream oos = null;\n try {\n File dir = new File(\"String_Node_Str\");\n if (!dir.exists() || dir.exists() && dir.isFile()) {\n boolean bCreated = dir.mkdir();\n if (!bCreated) {\n return;\n }\n }\n String time = now(DATE_PATTERN);\n File f = new File(\"String_Node_Str\" + File.separator + name + '_' + time + \"String_Node_Str\");\n if (!f.exists()) {\n f.createNewFile();\n }\n oos = new ObjectOutputStream(new FileOutputStream(f));\n oos.writeObject(object);\n oos.close();\n } catch (Exception e) {\n } finally {\n StreamUtils.closeQuietly(oos);\n }\n }\n}\n"
|
"public void testCreateDoubleMapFromV8Object() {\n V8Object object = v8.executeObjectScript(\"String_Node_Str\");\n Map<String, ? super Object> map = V8ObjectUtils.toMap(object);\n assertEquals(4, map.size());\n assertEquals(1.1, (double) map.get(\"String_Node_Str\"), 0.000001);\n assertEquals(2.2, (double) map.get(\"String_Node_Str\"), 0.000001);\n assertEquals(3.3, (double) map.get(\"String_Node_Str\"), 0.000001);\n assertEquals(4.4, (double) map.get(\"String_Node_Str\"), 0.000001);\n object.release();\n}\n"
|
"protected void onResume() {\n super.onResume();\n mTmpCities = getTmpCities();\n if (!mTmpCities.isEmpty()) {\n updateUI();\n } else {\n if (PreferenceUtils.getPrefBoolean(this, FIRST_RUN_APP, true)) {\n startActivity(new Intent(MainActivity.this, QueryCityActivity.class));\n PreferenceUtils.setPrefBoolean(this, FIRST_RUN_APP, false);\n }\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_STRONGLY_TYPED_REF_CURSOR_TABLE, ddlDebug);\n try {\n Statement stmt = conn.createStatement();\n for (int i = 0; i < POPULATE_STRONGLY_TYPED_REF_CURSOR_TABLE.length; i++) {\n stmt.addBatch(POPULATE_STRONGLY_TYPED_REF_CURSOR_TABLE[i]);\n }\n stmt.executeBatch();\n } catch (SQLException e) {\n }\n runDdl(conn, CREATE_TAB1_SHADOW_TYPE, ddlDebug);\n runDdl(conn, CREATE_STRONGLY_TYPED_REF_CURSOR_TEST_PACKAGE, ddlDebug);\n runDdl(conn, CREATE_STRONGLY_TYPED_REF_CURSOR_TEST_PACKAGE_BODY, ddlDebug);\n }\n username = System.getProperty(DATABASE_USERNAME_KEY, DEFAULT_DATABASE_USERNAME);\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\" + STRONGLY_TYPED_REF_CURSOR_TEST_PACKAGE + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + STRONGLY_TYPED_REF_CURSOR_TEST_PACKAGE + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + STRONGLY_TYPED_REF_CURSOR_TEST_PACKAGE + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + STRONGLY_TYPED_REF_CURSOR_TEST_PACKAGE + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\";\n builder = new DBWSBuilder();\n DBWSTestSuite.setUp(\"String_Node_Str\");\n}\n"
|
"FrameWorldDefault getFrame() {\n update(CHANGED_TOP_LEVEL);\n return frame;\n}\n"
|
"public static void handleApplicationInstanceActivatedEvent(String appId, String instanceId) {\n if (log.isDebugEnabled()) {\n log.debug(\"String_Node_Str\" + appId + \"String_Node_Str\" + instanceId);\n }\n Applications applications = ApplicationHolder.getApplications();\n Application application = applications.getApplication(appId);\n if (application == null) {\n log.warn(String.format(\"String_Node_Str\", appId));\n return;\n }\n ApplicationStatus status = ApplicationStatus.Active;\n ApplicationInstance applicationInstance = application.getInstanceContexts(instanceId);\n if (applicationInstance.isStateTransitionValid(status)) {\n application.setStatus(status, instanceId);\n updateApplicationMonitor(appId, status, applicationInstance.getNetworkPartitionId(), instanceId);\n ApplicationHolder.persistApplication(application);\n ApplicationsEventPublisher.sendApplicationInstanceActivatedEvent(appId, instanceId);\n } else {\n log.warn(String.format(\"String_Node_Str\" + \"String_Node_Str\", appId, instanceId, applicationInstance.getStatus(), status));\n }\n}\n"
|
"public static ReturnCode updateJrxmlRelatedReport(List<String> jrxmlFileNames, List<String> jrxmlFileNamesAfterMove) {\n ReturnCode rc = new ReturnCode();\n if (jrxmlFileNames.size() == 0 || jrxmlFileNamesAfterMove.size() < jrxmlFileNames.size()) {\n rc.setOk(Boolean.FALSE);\n rc.setMessage(DefaultMessagesImpl.getString(\"String_Node_Str\"));\n return rc;\n }\n Project project = ProjectManager.getInstance().getCurrentProject();\n IRepositoryNode ReportRootFolderNode = RepositoryNodeHelper.getDataProfilingFolderNode(EResourceConstant.REPORTS);\n List<ReportRepNode> repNodes = RepositoryNodeHelper.getReportRepNodes(ReportRootFolderNode, true, true);\n for (ReportRepNode report : repNodes) {\n boolean isUpdated = false;\n EList<AnalysisMap> analysisMap = ((TdReport) report.getReport()).getAnalysisMap();\n for (AnalysisMap anaMap : analysisMap) {\n for (int i = 0; i < jrxmlFileNames.size(); i++) {\n String oldPath = jrxmlFileNames.get(i);\n if (isUsedByJrxml(new Path(oldPath), anaMap)) {\n String before = anaMap.getJrxmlSource().substring(0, anaMap.getJrxmlSource().lastIndexOf(\"String_Node_Str\" + File.separator) + 3);\n EventManager.getInstance().publish(report, EventEnum.DQ_JRXML_RENAME, before + jrxmlFileNamesAfterMove.get(i));\n anaMap.setJrxmlSource(before + jrxmlFileNamesAfterMove.get(i));\n isUpdated = true;\n }\n }\n }\n if (isUpdated) {\n try {\n ProxyRepositoryFactory.getInstance().save(project, report.getObject().getProperty().getItem());\n } catch (PersistenceException e) {\n rc.setOk(Boolean.FALSE);\n rc.setMessage(DefaultMessagesImpl.getString(\"String_Node_Str\", report.getLabel()));\n }\n }\n }\n return rc;\n}\n"
|
"public void run() {\n info.notifyRemovedIfUserMatch(sbn_light);\n}\n"
|
"public String getReport() {\n Map<Double, Integer> distHubs = new HashMap<Double, Integer>();\n for (Node node : hub_list) {\n int n_index = indicies.get(node);\n Double d = hubs[n_index];\n if (distHubs.containsKey(d)) {\n Integer v = distHubs.get(d);\n distHubs.put(d, v + 1);\n } else {\n distHubs.put(d, 1);\n }\n }\n Map<Double, Integer> distAuthorities = new HashMap<Double, Integer>();\n for (Node node : auth_list) {\n int n_index = indicies.get(node);\n Double d = authority[n_index];\n if (distAuthorities.containsKey(d)) {\n Integer v = distAuthorities.get(d);\n distAuthorities.put(d, v + 1);\n } else {\n distAuthorities.put(d, 1);\n }\n }\n XYSeries dHubsSeries = ChartUtils.createXYSeries(distHubs, \"String_Node_Str\");\n XYSeries dAuthsSeries = ChartUtils.createXYSeries(distAuthorities, \"String_Node_Str\");\n XYSeriesCollection datasetHubs = new XYSeriesCollection();\n datasetHubs.addSeries(dHubsSeries);\n XYSeriesCollection datasetAuths = new XYSeriesCollection();\n datasetAuths.addSeries(dAuthsSeries);\n JFreeChart chart = ChartFactory.createXYLineChart(\"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", datasetHubs, PlotOrientation.VERTICAL, true, false, false);\n ChartUtils.decorateChart(chart);\n ChartUtils.scaleChart(chart, dHubsSeries, true);\n String imageFile1 = ChartUtils.renderChart(chart, \"String_Node_Str\");\n JFreeChart chart2 = ChartFactory.createXYLineChart(\"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", datasetAuths, PlotOrientation.VERTICAL, true, false, false);\n ChartUtils.decorateChart(chart2);\n ChartUtils.scaleChart(chart, dAuthsSeries, true);\n String imageFile2 = ChartUtils.renderChart(chart, \"String_Node_Str\");\n String report = \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + this.epsilon + \"String_Node_Str\" + imageFile1 + \"String_Node_Str\" + imageFile2 + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\";\n return report;\n}\n"
|
"public boolean findTarget(boolean doSet) {\n if (worldObj.isRemote)\n return false;\n boolean[][] blockedColumns = new boolean[bluePrintBuilder.bluePrint.sizeX - 2][bluePrintBuilder.bluePrint.sizeZ - 2];\n for (int searchY = yCoord + 3; searchY >= 0; --searchY) {\n int startX, endX, incX;\n if (searchY % 2 == 0) {\n startX = 0;\n endX = bluePrintBuilder.bluePrint.sizeX - 2;\n incX = 1;\n } else {\n startX = bluePrintBuilder.bluePrint.sizeX - 3;\n endX = -1;\n incX = -1;\n }\n for (int searchX = startX; searchX != endX; searchX += incX) {\n int startZ, endZ, incZ;\n if (searchX % 2 == searchY % 2) {\n startZ = 0;\n endZ = bluePrintBuilder.bluePrint.sizeZ - 2;\n incZ = 1;\n } else {\n startZ = bluePrintBuilder.bluePrint.sizeZ - 3;\n endZ = -1;\n incZ = -1;\n }\n for (int searchZ = startZ; searchZ != endZ; searchZ += incZ) {\n if (!blockedColumns[searchX][searchZ]) {\n int bx = box.xMin + searchX + 1, by = searchY, bz = box.zMin + searchZ + 1;\n int blockId = worldObj.getBlockId(bx, by, bz);\n if (!BlockUtil.canChangeBlock(worldObj, bx, by, bz)) {\n blockedColumns[searchX][searchZ] = true;\n } else if (!BlockUtil.isSoftBlock(worldObj, bx, by, bz)) {\n if (doSet) {\n setTarget(bx, by + 1, bz);\n }\n return true;\n }\n }\n }\n }\n }\n return false;\n}\n"
|
"public void doexport(TreeObject[] objs, IProgressMonitor monitor) {\n if (objs.length == 0)\n return;\n monitor.beginTask(\"String_Node_Str\", IProgressMonitor.UNKNOWN);\n Exports eps = new Exports();\n List<TreeObject> exports = new ArrayList<TreeObject>();\n XtentisPort port;\n try {\n port = Util.getPort(objs[0]);\n for (TreeObject obj : objs) {\n StringWriter sw;\n ArrayList<String> items;\n switch(obj.getType()) {\n case TreeObject.DATA_CLUSTER:\n monitor.subTask(\"String_Node_Str\");\n items = new ArrayList<String>();\n WSDataClusterPK pk = (WSDataClusterPK) obj.getWsKey();\n WSDataCluster cluster = port.getDataCluster(new WSGetDataCluster(pk));\n sw = new StringWriter();\n Marshaller.marshal(cluster, sw);\n String encodedID = URLEncoder.encode(cluster.getName(), \"String_Node_Str\");\n writeString(sw.toString(), TreeObject.DATACONTAINER + \"String_Node_Str\" + encodedID);\n items.add(TreeObject.DATACONTAINER + \"String_Node_Str\" + encodedID);\n obj.setItems(items.toArray(new String[items.size()]));\n exports.add(obj);\n monitor.worked(1);\n monitor.subTask(\"String_Node_Str\" + pk.getPk() + \"String_Node_Str\");\n List<String> items1 = new ArrayList<String>();\n WSItemPKsByCriteriaResponseResults[] results = port.getItemPKsByCriteria(new WSGetItemPKsByCriteria(pk, null, null, null, (long) -1, (long) -1, 0, Integer.MAX_VALUE)).getResults();\n if (results == null)\n continue;\n for (WSItemPKsByCriteriaResponseResults item : results) {\n WSItem wsitem = port.getItem(new WSGetItem(item.getWsItemPK()));\n StringWriter sw1 = new StringWriter();\n Marshaller.marshal(wsitem, sw1);\n String uniqueId = pk.getPk() + \"String_Node_Str\" + wsitem.getConceptName() + \"String_Node_Str\";\n for (String id : wsitem.getIds()) {\n uniqueId = uniqueId + \"String_Node_Str\" + id;\n }\n writeString(sw1.toString(), TreeObject.DATACONTAINER_COTENTS + \"String_Node_Str\" + pk.getPk() + \"String_Node_Str\" + uniqueId);\n items1.add(TreeObject.DATACONTAINER_COTENTS + \"String_Node_Str\" + pk.getPk() + \"String_Node_Str\" + uniqueId);\n }\n TreeObject obj1 = new TreeObject(\"String_Node_Str\", null, TreeObject.DATA_CLUSTER_CONTENTS, null, null);\n obj1.setItems(items1.toArray(new String[items1.size()]));\n exports.add(obj1);\n monitor.worked(1);\n break;\n case TreeObject.DATA_MODEL:\n monitor.subTask(\"String_Node_Str\");\n items = new ArrayList<String>();\n WSDataModel model = port.getDataModel(new WSGetDataModel((WSDataModelPK) obj.getWsKey()));\n sw = new StringWriter();\n Marshaller.marshal(model, sw);\n writeString(sw.toString(), TreeObject.DATAMODEL_ + \"String_Node_Str\" + model.getName());\n items.add(TreeObject.DATAMODEL_ + \"String_Node_Str\" + model.getName());\n obj.setItems(items.toArray(new String[items.size()]));\n exports.add(obj);\n monitor.worked(1);\n break;\n case TreeObject.MENU:\n monitor.subTask(\"String_Node_Str\");\n items = new ArrayList<String>();\n WSMenu menu = port.getMenu(new WSGetMenu((WSMenuPK) obj.getWsKey()));\n sw = new StringWriter();\n Marshaller.marshal(menu, sw);\n writeString(sw.toString(), TreeObject.MENU_ + \"String_Node_Str\" + menu.getName());\n items.add(TreeObject.MENU_ + \"String_Node_Str\" + menu.getName());\n obj.setItems(items.toArray(new String[items.size()]));\n exports.add(obj);\n monitor.worked(1);\n break;\n case TreeObject.ROLE:\n if (Util.IsEnterPrise()) {\n monitor.subTask(\"String_Node_Str\");\n items = new ArrayList<String>();\n WSRole role = port.getRole(new WSGetRole((WSRolePK) obj.getWsKey()));\n sw = new StringWriter();\n Marshaller.marshal(role, sw);\n writeString(sw.toString(), TreeObject.ROLE_ + \"String_Node_Str\" + role.getName());\n items.add(TreeObject.ROLE_ + \"String_Node_Str\" + role.getName());\n obj.setItems(items.toArray(new String[items.size()]));\n exports.add(obj);\n monitor.worked(1);\n }\n break;\n case TreeObject.ROUTING_RULE:\n monitor.subTask(\"String_Node_Str\");\n items = new ArrayList<String>();\n WSRoutingRule RoutingRule = port.getRoutingRule(new WSGetRoutingRule((WSRoutingRulePK) obj.getWsKey()));\n sw = new StringWriter();\n Marshaller.marshal(RoutingRule, sw);\n writeString(sw.toString(), TreeObject.ROUTINGRULE_ + \"String_Node_Str\" + RoutingRule.getName());\n items.add(TreeObject.ROUTINGRULE_ + \"String_Node_Str\" + RoutingRule.getName());\n obj.setItems(items.toArray(new String[items.size()]));\n exports.add(obj);\n monitor.worked(1);\n break;\n case TreeObject.STORED_PROCEDURE:\n monitor.subTask(\"String_Node_Str\");\n items = new ArrayList<String>();\n WSStoredProcedure StoredProcedure = port.getStoredProcedure(new WSGetStoredProcedure((WSStoredProcedurePK) obj.getWsKey()));\n sw = new StringWriter();\n Marshaller.marshal(StoredProcedure, sw);\n writeString(sw.toString(), TreeObject.STOREDPROCEDURE_ + \"String_Node_Str\" + StoredProcedure.getName());\n items.add(TreeObject.STOREDPROCEDURE_ + \"String_Node_Str\" + StoredProcedure.getName());\n obj.setItems(items.toArray(new String[items.size()]));\n exports.add(obj);\n monitor.worked(1);\n break;\n case TreeObject.SYNCHRONIZATIONPLAN:\n if (Util.IsEnterPrise()) {\n monitor.subTask(\"String_Node_Str\");\n items = new ArrayList<String>();\n WSSynchronizationPlan SynchronizationPlan = port.getSynchronizationPlan(new WSGetSynchronizationPlan((WSSynchronizationPlanPK) obj.getWsKey()));\n sw = new StringWriter();\n Marshaller.marshal(SynchronizationPlan, sw);\n writeString(sw.toString(), TreeObject.SYNCHRONIZATIONPLAN_ + \"String_Node_Str\" + SynchronizationPlan.getName());\n items.add(TreeObject.SYNCHRONIZATIONPLAN_ + \"String_Node_Str\" + SynchronizationPlan.getName());\n obj.setItems(items.toArray(new String[items.size()]));\n exports.add(obj);\n monitor.worked(1);\n }\n break;\n case TreeObject.TRANSFORMER:\n monitor.subTask(\"String_Node_Str\");\n items = new ArrayList<String>();\n WSTransformer transformer = port.getTransformer(new WSGetTransformer(new WSTransformerPK(((WSTransformerV2PK) obj.getWsKey()).getPk())));\n sw = new StringWriter();\n Marshaller.marshal(transformer, sw);\n writeString(sw.toString(), TreeObject.TRANSFORMER_ + \"String_Node_Str\" + transformer.getName());\n items.add(TreeObject.TRANSFORMER_ + \"String_Node_Str\" + transformer.getName());\n obj.setItems(items.toArray(new String[items.size()]));\n exports.add(obj);\n monitor.worked(1);\n break;\n case TreeObject.UNIVERSE:\n if (Util.IsEnterPrise()) {\n monitor.subTask(\"String_Node_Str\");\n items = new ArrayList<String>();\n WSUniverse universe = port.getUniverse(new WSGetUniverse((WSUniversePK) obj.getWsKey()));\n sw = new StringWriter();\n Marshaller.marshal(universe, sw);\n writeString(sw.toString(), TreeObject.UNIVERSE_ + \"String_Node_Str\" + universe.getName());\n items.add(TreeObject.UNIVERSE_ + \"String_Node_Str\" + universe.getName());\n obj.setItems(items.toArray(new String[items.size()]));\n exports.add(obj);\n monitor.worked(1);\n }\n break;\n case TreeObject.VIEW:\n monitor.subTask(\"String_Node_Str\");\n items = new ArrayList<String>();\n WSView View = port.getView(new WSGetView((WSViewPK) obj.getWsKey()));\n sw = new StringWriter();\n Marshaller.marshal(View, sw);\n writeString(sw.toString(), TreeObject.VIEW_ + \"String_Node_Str\" + View.getName());\n items.add(TreeObject.VIEW_ + \"String_Node_Str\" + View.getName());\n obj.setItems(items.toArray(new String[items.size()]));\n exports.add(obj);\n monitor.worked(1);\n }\n }\n eps.setItems(exports.toArray(new TreeObject[exports.size()]));\n StringWriter sw = new StringWriter();\n try {\n Marshaller.marshal(eps, sw);\n writeString(sw.toString(), \"String_Node_Str\");\n } catch (Exception e) {\n }\n monitor.done();\n } catch (Exception e) {\n }\n}\n"
|
"private void performRescore() {\n RescoreDialog dialog = new RescoreDialog();\n if (dialog.process()) {\n List<AdjustScore> adjusters = new ArrayList<AdjustScore>();\n CalculateScore score = new TrainingSetScore(dialog.getTrainingSet());\n ParallelScore ps = new ParallelScore(this.population, new PrgCODEC(), adjusters, score, 0);\n ps.process();\n this.populationTable.repaint();\n }\n}\n"
|
"public boolean apply(Game game, Ability source) {\n Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source));\n Player controller = game.getPlayer(source.getControllerId());\n if (player == null || controller == null) {\n return false;\n }\n Cards cards = new CardsImpl();\n cards.addAll(player.getLibrary().getTopCards(game, 7));\n controller.moveCards(cards, Zone.EXILED, source, game);\n if (cards.getCards(new FilterCreatureCard(), game).size() > 0) {\n TargetCard target = new TargetCard(Zone.EXILED, new FilterCreatureCard());\n if (controller.chooseTarget(outcome, cards, target, source, game)) {\n Card card = cards.get(target.getFirstTarget(), game);\n if (card != null) {\n controller.moveCards(card, Zone.BATTLEFIELD, source, game, false, false, false, null);\n }\n }\n }\n return true;\n}\n"
|
"public void onVideoSizeChanged(int width, int height, int unappliedRotationDegrees, float pixelWidthHeightRatio) {\n if (contentFrame != null) {\n float aspectRatio = height == 0 ? 1 : (width * pixelWidthHeightRatio) / height;\n aspectRatioVideoFrame.setAspectRatio(aspectRatio);\n }\n}\n"
|
"public OutputStream getOutputStream(String relativePath, boolean mustExist) {\n HttpURLConnection httpUrlConnection = buildHttpUrlConnection(relativePath);\n return new HttpOutputStream(httpUrlConnection);\n}\n"
|
"public void testSaveAndRestoreMemento() throws Exception {\n AndokuPuzzle p1 = MockPuzzleSource.createPuzzle(0);\n p1.computeSolution();\n p1.setValues(0, 1, ValueSet.of(7));\n p1.setValues(0, 2, ValueSet.of(6));\n p1.setValues(0, 4, ValueSet.of(3, 4));\n p1.setValues(0, 5, ValueSet.of(8));\n p1.checkForErrors(true);\n assertEquals(2, p1.getRegionErrors().size());\n assertEquals(1, p1.getCellErrors().size());\n byte[] memento = p1.saveToMemento();\n AndokuPuzzle p2 = MockPuzzleSource.createPuzzle(0);\n assertEquals(ValueSet.none(), p2.getValues(0, 1));\n assertEquals(ValueSet.none(), p2.getValues(0, 2));\n assertEquals(ValueSet.none(), p2.getValues(0, 4));\n assertEquals(ValueSet.none(), p2.getValues(0, 5));\n assertTrue(p2.getRegionErrors().isEmpty());\n assertTrue(p2.getCellErrors().isEmpty());\n p2.restoreFromMemento(memento);\n assertEquals(ValueSet.of(7), p2.getValues(0, 1));\n assertEquals(ValueSet.of(6), p2.getValues(0, 2));\n assertEquals(ValueSet.of(3, 4), p2.getValues(0, 4));\n assertEquals(ValueSet.of(8), p2.getValues(0, 5));\n assertEquals(2, p2.getRegionErrors().size());\n assertEquals(1, p2.getCellErrors().size());\n assertEquals(p1.getRegionErrors(), p2.getRegionErrors());\n assertEquals(p1.getCellErrors(), p2.getCellErrors());\n}\n"
|
"public boolean associateIpAddressListToAccount(long userId, long accountId, long zoneId, Long vlanId, Network network) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, ResourceAllocationException {\n Account owner = _accountMgr.getActiveAccountById(accountId);\n boolean createNetwork = false;\n Transaction txn = Transaction.currentTxn();\n txn.start();\n if (network == null) {\n List<? extends Network> networks = getIsolatedNetworksWithSourceNATOwnedByAccountInZone(zoneId, owner);\n if (networks.size() == 0) {\n createNetwork = true;\n } else {\n network = networks.get(0);\n }\n }\n if (createNetwork) {\n List<? extends NetworkOffering> offerings = _configMgr.listNetworkOfferings(TrafficType.Guest, false);\n PhysicalNetwork physicalNetwork = translateZoneIdToPhysicalNetwork(zoneId);\n network = createGuestNetwork(offerings.get(0).getId(), owner.getAccountName() + \"String_Node_Str\", owner.getAccountName() + \"String_Node_Str\", null, null, null, null, owner, false, null, physicalNetwork, zoneId, ACLType.Account, null);\n if (network == null) {\n s_logger.warn(\"String_Node_Str\" + accountId + \"String_Node_Str\" + zoneId);\n return false;\n }\n }\n boolean allocateSourceNat = false;\n List<IPAddressVO> sourceNat = _ipAddressDao.listByAssociatedNetwork(network.getId(), true);\n if (sourceNat.isEmpty()) {\n allocateSourceNat = true;\n }\n List<IPAddressVO> ips = _ipAddressDao.listByVlanId(vlanId);\n boolean isSourceNatAllocated = false;\n for (IPAddressVO addr : ips) {\n if (addr.getState() != State.Allocated) {\n if (!isSourceNatAllocated && allocateSourceNat) {\n addr.setSourceNat(true);\n isSourceNatAllocated = true;\n } else {\n addr.setSourceNat(false);\n }\n addr.setAssociatedWithNetworkId(network.getId());\n addr.setAllocatedTime(new Date());\n addr.setAllocatedInDomainId(owner.getDomainId());\n addr.setAllocatedToAccountId(owner.getId());\n addr.setSystem(false);\n addr.setState(IpAddress.State.Allocating);\n markPublicIpAsAllocated(addr);\n }\n }\n txn.commit();\n return true;\n}\n"
|
"public long getDurationInMillis() {\n if (startTickNanoSeconds != null && stopTickNanoSeconds != null) {\n return (stopTickNanoSeconds - startTickNanoSeconds) / (long) Math.pow(MILLIS_FACTOR, EXPONENT);\n }\n return -1;\n}\n"
|
"public Module getSingleNodeModules() {\n File warehouseDir = new File(new File(conf.get(Constants.CFG_LOCAL_DATA_DIR), \"String_Node_Str\"), \"String_Node_Str\");\n File databaseDir = new File(new File(conf.get(Constants.CFG_LOCAL_DATA_DIR), \"String_Node_Str\"), \"String_Node_Str\");\n LOG.debug(\"String_Node_Str\", Constants.Hive.METASTORE_WAREHOUSE_DIR, warehouseDir.getAbsolutePath());\n LOG.debug(\"String_Node_Str\", Constants.Hive.DATABASE_DIR, databaseDir.getAbsolutePath());\n System.setProperty(Constants.Hive.METASTORE_WAREHOUSE_DIR, warehouseDir.getAbsolutePath());\n System.setProperty(Constants.Hive.DATABASE_DIR, databaseDir.getAbsolutePath());\n return getLocalModules();\n}\n"
|
"public void testGetDefaultTOCStyle() throws Exception {\n StyleHandle styleHandle = session.getDefaultTOCStyle(TOCHandle.defaultTOCPrefixName + \"String_Node_Str\");\n assertNotNull(styleHandle);\n DimensionHandle dimension = styleHandle.getFontSize();\n assertNotNull(dimension);\n assertEquals(\"String_Node_Str\", dimension.getValue());\n try {\n styleHandle.setCanShrink(false);\n fail();\n } catch (IllegalOperationException e) {\n assertEquals(ReadOnlyActivityStack.MESSAGE, e.getMessage());\n }\n}\n"
|
"public Job waitForCompletion(final String id, final long blockTimeout, final long pollTime) throws GenieException, InterruptedException {\n if (StringUtils.isEmpty(id)) {\n final String msg = \"String_Node_Str\";\n LOG.error(msg);\n throw new GenieException(HttpURLConnection.HTTP_BAD_REQUEST, msg);\n }\n final long startTime = System.currentTimeMillis();\n while (true) {\n final Job job = getJob(id);\n if (!job.getFinished().equals(new Date(0))) {\n return job;\n }\n long currTime = System.currentTimeMillis();\n if (currTime - startTime < blockTimeout) {\n Thread.sleep(pollTime);\n } else {\n final String msg = \"String_Node_Str\";\n LOG.error(msg);\n throw new InterruptedException(msg);\n }\n }\n}\n"
|
"private void handleAddAttachmentError(int error, int mediaTypeStringId) {\n if (error == WorkingMessage.OK) {\n return;\n }\n Resources res = getResources();\n String mediaType = res.getString(mediaTypeStringId);\n String title, message;\n switch(error) {\n case WorkingMessage.UNKNOWN_ERROR:\n message = res.getString(R.string.failed_to_add_media, mediaType);\n Toast.makeText(this, message, Toast.LENGTH_SHORT).show();\n return;\n case WorkingMessage.UNSUPPORTED_TYPE:\n title = res.getString(R.string.unsupported_media_format, mediaType);\n message = res.getString(R.string.select_different_media, mediaType);\n break;\n case WorkingMessage.MESSAGE_SIZE_EXCEEDED:\n title = res.getString(R.string.exceed_message_size_limitation, mediaType);\n message = res.getString(R.string.failed_to_add_media, mediaType);\n break;\n case WorkingMessage.IMAGE_TOO_LARGE:\n title = res.getString(R.string.failed_to_resize_image);\n message = res.getString(R.string.resize_image_error_information);\n break;\n default:\n throw new IllegalArgumentException(\"String_Node_Str\" + error);\n }\n MessageUtils.showErrorDialog(this, title, message);\n}\n"
|
"protected Double compute() {\n int tensorDim;\n if (y == null)\n tensorDim = OpExecutionerUtil.chooseElementWiseTensorDimension(x);\n else\n tensorDim = OpExecutionerUtil.chooseElementWiseTensorDimension(x, y);\n int nTensors = x.tensorssAlongDimension(tensorDim);\n if (nTensors == 1) {\n return new AccumulationOpDataBufferTask(op, 0, tensorDim, threshold, x, y, true).invoke();\n } else {\n return doTask();\n }\n}\n"
|
"public static void getSpecifiedPageNumber(HandlerContext handlerCtx) {\n String pageNumberValue = (String) handlerCtx.getInputValue(\"String_Node_Str\");\n int result = 0;\n try {\n int pageNumber = Integer.parseInt(pageNumberValue);\n if (pageNumber > 0) {\n result = (pageNumber * DEFAULT_OFFSET_INCREMENT) - DEFAULT_OFFSET_INCREMENT;\n }\n } catch (NumberFormatException ex) {\n GuiUtil.getLogger().info(NUMBER_FORMAT_EXCEPTION_MESSAGE + ex);\n }\n handlerCtx.setOutputValue(\"String_Node_Str\", result);\n}\n"
|
"public static Cell getSupercell(Cell c, List<List<Integer>> coefficients) {\n Cell cell = c.getCellWithAllAtomsInCell();\n if (coefficients.size() != Constants.numDimensions)\n throw new IllegalArgumentException(\"String_Node_Str\" + coefficients.size());\n List<Vect> newVectors = new LinkedList<Vect>();\n for (int i = 0; i < Constants.numDimensions; i++) {\n List<Integer> coefs = coefficients.get(i);\n if (coefs.size() != Constants.numDimensions)\n throw new IllegalArgumentException(\"String_Node_Str\" + coefs.size());\n Double x = coefs.get(0) * (cell.latticeVectors.get(0)).getCartesianComponents().get(0) + coefs.get(1) * (cell.latticeVectors.get(1)).getCartesianComponents().get(0) + coefs.get(2) * (cell.latticeVectors.get(2)).getCartesianComponents().get(0);\n Double y = coefs.get(0) * (cell.latticeVectors.get(0)).getCartesianComponents().get(1) + coefs.get(1) * (cell.latticeVectors.get(1)).getCartesianComponents().get(1) + coefs.get(2) * (cell.latticeVectors.get(2)).getCartesianComponents().get(1);\n Double z = coefs.get(0) * (cell.latticeVectors.get(0)).getCartesianComponents().get(2) + coefs.get(1) * (cell.latticeVectors.get(1)).getCartesianComponents().get(2) + coefs.get(2) * (cell.latticeVectors.get(2)).getCartesianComponents().get(2);\n newVectors.add(new Vect(x, y, z));\n }\n List<Site> newBasis = new LinkedList<Site>();\n int minx = 0, maxx = 0, miny = 0, maxy = 0, minz = 0, maxz = 0;\n for (int i = 0; i <= 1; i++) for (int j = 0; j <= 1; j++) for (int k = 0; k <= 1; k++) {\n int combox = i * coefficients.get(0).get(0) + j * coefficients.get(1).get(0) + k * coefficients.get(2).get(0);\n minx = Math.min(minx, combox);\n maxx = Math.max(maxx, combox);\n int comboy = i * coefficients.get(0).get(1) + j * coefficients.get(1).get(1) + k * coefficients.get(2).get(1);\n miny = Math.min(miny, comboy);\n maxy = Math.max(maxy, comboy);\n int comboz = i * coefficients.get(0).get(2) + j * coefficients.get(1).get(2) + k * coefficients.get(2).get(2);\n minz = Math.min(minz, comboz);\n maxz = Math.max(maxz, comboz);\n }\n for (Site s : cell.basis) {\n for (int i = minx; i <= maxx; i++) {\n for (int j = miny; j <= maxy; j++) {\n for (int k = minz; k <= maxz; k++) {\n Vect candidateSiteLoc = s.getCoords().plus(new Vect(new Double(i), new Double(j), new Double(k), cell.latticeVectors));\n List<Double> newFracCoords = candidateSiteLoc.getComponentsWRTBasis(newVectors);\n newBasisCandidates.add((new Site(s.getElement(), candidateSiteLoc.getVectShiftedIntoBasis(newVectors))));\n }\n }\n }\n }\n return new Cell(newVectors, newBasis, cell.getLabel());\n}\n"
|
"public double addAndReturnExcess(int x, int y, double toAdd) {\n double excess = 0;\n double newVal = get(x, y) + toAdd;\n if (newVal > MAX_VALUE) {\n excess = newVal - MAX_VALUE;\n newVal = MAX_VALUE;\n }\n set(x, y, newVal);\n return excess;\n}\n"
|
"public JsonValue encrypt(JsonValue value, String cipher, String alias) throws JsonCryptoException, JsonException {\n JsonValue result = null;\n if (value != null) {\n JsonEncryptor encryptor = getEncryptor(cipher, alias);\n result = new JsonCrypto(encryptor.getType(), encryptor.encrypt(value)).toJsonValue();\n }\n return result;\n}\n"
|
"private void testSimpleLeftJoinCube() throws Exception {\n DeployUtil.prepareTestData(\"String_Node_Str\", \"String_Node_Str\");\n SimpleDateFormat f = new SimpleDateFormat(\"String_Node_Str\");\n f.setTimeZone(TimeZone.getTimeZone(\"String_Node_Str\"));\n long dateStart;\n long dateEnd;\n ArrayList<String> jobs = new ArrayList<String>();\n CubeManager cubeMgr = CubeManager.getInstance(KylinConfig.getInstanceFromEnv());\n dateStart = cubeMgr.getCube(\"String_Node_Str\").getDescriptor().getCubePartitionDesc().getPartitionDateStart();\n dateEnd = f.parse(\"String_Node_Str\").getTime();\n jobs.addAll(this.submitJob(\"String_Node_Str\", dateStart, dateEnd, RealizationBuildTypeEnum.BUILD));\n dateStart = cubeMgr.getCube(\"String_Node_Str\").getDescriptor().getCubePartitionDesc().getPartitionDateStart();\n dateEnd = f.parse(\"String_Node_Str\").getTime();\n jobs.addAll(this.submitJob(\"String_Node_Str\", dateStart, dateEnd, CubeBuildTypeEnum.BUILD));\n waitCubeBuilt(jobs);\n}\n"
|
"public boolean onPreferenceChange(Preference preference, Object objValue) {\n if (preference == mButtonDTMF) {\n int index = mButtonDTMF.findIndexOfValue((String) objValue);\n Settings.System.putInt(mPhone.getContext().getContentResolver(), Settings.System.DTMF_TONE_TYPE_WHEN_DIALING, index);\n } else if (preference == mButtonTTY) {\n handleTTYChange(preference, objValue);\n } else if (preference == mVoicemailProviders) {\n updateVMPreferenceWidgets((String) objValue);\n final String providerVMNumber = loadNumberForVoiceMailProvider((String) objValue);\n if (providerVMNumber == null) {\n simulatePreferenceClick(mVoicemailSettings);\n } else {\n saveVoiceMailNumber(providerVMNumber);\n }\n }\n return true;\n}\n"
|
"public boolean checkFile() throws IOException {\n boolean success = true;\n if (!allocated) {\n allocate();\n } else {\n try {\n if (!super.checkFile()) {\n return false;\n }\n HashSet<String> realFiles = new HashSet<>();\n File[] realFileList = physicalFile.listFiles(this);\n for (File f : realFileList) {\n realFiles.add(f.getName());\n }\n for (Iterator<DiskNode> i = directoryEntries.iterator(); i.hasNext(); ) {\n DiskNode node = i.next();\n if (realFiles.contains(node.getPhysicalFile().getName())) {\n realFiles.remove(node.getPhysicalFile().getName());\n } else {\n i.remove();\n success = false;\n }\n if (node.isAllocated()) {\n if (!(node instanceof DirectoryNode) && !node.checkFile()) {\n success = false;\n }\n }\n }\n if (!realFiles.isEmpty()) {\n success = false;\n }\n }\n }\n if (!realFiles.isEmpty()) {\n success = false;\n realFiles.stream().forEach((fileName) -> {\n addFile(new File(physicalFile, fileName));\n });\n }\n return success;\n}\n"
|
"private double sigmoid(double[] inputs, double[] weights) {\n double value = 0.0d;\n for (int i = 0; i < inputs.length; i++) {\n value += weights[i] * inputs[i];\n }\n return 1.0d / (1.0d + BoundMath.exp(-1 * value));\n}\n"
|
"public <T> T lookup(final Class<T> type, final String identifier) throws MetadataStoreException {\n ArgumentChecks.ensureNonNull(\"String_Node_Str\", type);\n ArgumentChecks.ensureNonEmpty(\"String_Node_Str\", identifier);\n Object value;\n if (ControlledVocabulary.class.isAssignableFrom(type)) {\n value = getCodeList(type, identifier);\n } else {\n final CacheKey key = new CacheKey(type, identifier);\n synchronized (pool) {\n value = pool.get(key);\n if (value == null && type.isInterface()) {\n value = Proxy.newProxyInstance(classloader, new Class<?>[] { type, MetadataProxy.class }, new Dispatcher(identifier, this));\n pool.put(key, value);\n }\n }\n if (value == null) {\n Method method = null;\n final Class<?> subType = TableHierarchy.subType(type, identifier);\n final Dispatcher toSearch = new Dispatcher(identifier, this);\n try {\n value = subType.getConstructor().newInstance();\n final LookupInfo info = getLookupInfo(subType);\n final Map<String, Object> map = asValueMap(value);\n final Map<String, String> methods = standard.asNameMap(subType, NAME_POLICY, KeyNamePolicy.METHOD_NAME);\n for (final Map.Entry<String, Object> entry : map.entrySet()) {\n method = subType.getMethod(methods.get(entry.getKey()));\n info.setMetadataType(subType);\n final Object p = readColumn(info, method, toSearch);\n if (p != null) {\n entry.setValue(p);\n }\n }\n } catch (ReflectiveOperationException e) {\n throw new MetadataStoreException(Errors.format(Errors.Keys.UnsupportedImplementation_1, subType), e);\n } catch (SQLException e) {\n throw new MetadataStoreException(toSearch.error(method), e);\n }\n }\n }\n return type.cast(value);\n}\n"
|
"public DatabaseField getDatabaseField() {\n DatabaseField field = super.getDatabaseField();\n field.setUnique(m_unique == null ? false : m_unique.booleanValue());\n field.setScale(m_scale == null ? 0 : m_scale.intValue());\n field.setLength(m_length == null ? 0 : m_length.intValue());\n field.setPrecision(m_precision == null ? 0 : m_precision.intValue());\n field.setTableName(m_table == null ? \"String_Node_Str\" : m_table);\n return field;\n}\n"
|
"public void testIjsModule() {\n allowExternsChanges();\n test(new String[] { lines(\"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\"), lines(\"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\") }, new String[] { lines(\"String_Node_Str\", \"String_Node_Str\") });\n}\n"
|
"public void testValidateNodes1() throws DataException {\n ExprManager em = new ExprManager(null);\n Map m = new HashMap();\n m.put(\"String_Node_Str\", new ScriptExpression(\"String_Node_Str\"));\n m.put(\"String_Node_Str\", new ScriptExpression(\"String_Node_Str\"));\n m.put(\"String_Node_Str\", new ScriptExpression(\"String_Node_Str\"));\n m.put(\"String_Node_Str\", new ScriptExpression(\"String_Node_Str\"));\n m.put(\"String_Node_Str\", new ScriptExpression(\"String_Node_Str\"));\n em.addBindingExpr(null, m, 0);\n try {\n ExprManagerUtil.validateColumnBinding(em);\n } catch (DataException e) {\n fail(\"String_Node_Str\");\n }\n}\n"
|
"public void handle(Event e) {\n if (e.getKind() == EventKind.ERROR) {\n hasErrors = true;\n }\n super.handle(e);\n}\n"
|
"public ImmutablePair<PathInfoData, PathInfoData> getPath(Flow flow, Strategy strategy) throws UnroutablePathException, RecoverableException {\n long latency = 0L;\n List<PathNode> forwardNodes = new LinkedList<>();\n List<PathNode> reverseNodes = new LinkedList<>();\n if (!flow.isOneSwitchFlow()) {\n try {\n Pair<LinkedList<SimpleIsl>, LinkedList<SimpleIsl>> biPath = getPathFromNetwork(flow, strategy);\n if (biPath.getLeft().size() == 0 || biPath.getRight().size() == 0)\n throw new UnroutablePathException(flow);\n int seqId = 0;\n LinkedList<SimpleIsl> forwardIsl = biPath.getLeft();\n for (SimpleIsl isl : forwardIsl) {\n latency += isl.latency;\n forwardNodes.add(new PathNode(isl.src_dpid, isl.src_port, seqId++, (long) isl.latency));\n forwardNodes.add(new PathNode(isl.dst_dpid, isl.dst_port, seqId++, 0L));\n }\n seqId = 0;\n LinkedList<SimpleIsl> reverseIsl = biPath.getRight();\n for (SimpleIsl isl : reverseIsl) {\n reverseNodes.add(new PathNode(isl.src_dpid, isl.src_port, seqId++, (long) isl.latency));\n reverseNodes.add(new PathNode(isl.dst_dpid, isl.dst_port, seqId++, 0L));\n }\n } catch (TransientException e) {\n throw new RecoverableException(\"String_Node_Str\", e);\n } catch (ClientException e) {\n throw new RecoverableException(\"String_Node_Str\", e);\n }\n } else {\n logger.info(\"String_Node_Str\");\n }\n return new ImmutablePair<>(new PathInfoData(latency, forwardNodes), new PathInfoData(latency, reverseNodes));\n}\n"
|
"protected static void findCuts(Table table, int[] v1, int v2) {\n double bestEval = Double.POSITIVE_INFINITY;\n for (int i = 0; i < table.resp.length - 1; i++) {\n double sum1 = table.resp[i][v2][0];\n double sum2 = table.resp[i][v2][2];\n double weight1 = table.count[i][v2][0];\n double weight2 = table.count[i][v2][2];\n double eval1 = OptimUtils.getGain(sum1, weight1);\n double eval2 = OptimUtils.getGain(sum2, weight2);\n double eval = -(eval1 + eval2);\n if (eval < bestEval) {\n bestEval = eval;\n v1[0] = i;\n }\n }\n bestEval = Double.POSITIVE_INFINITY;\n for (int i = 0; i < table.resp.length - 1; i++) {\n double sum1 = table.resp[i][v2][1];\n double sum2 = table.resp[i][v2][3];\n double weight1 = table.count[i][v2][1];\n double weight2 = table.count[i][v2][3];\n double eval = -sum1 * sum1 / weight1 - sum2 * sum2 / weight2;\n if (eval < bestEval) {\n bestEval = eval;\n v1[1] = i;\n }\n }\n}\n"
|
"public static long getViaAgentId(final byte[] bytes) {\n return NumbersUtil.bytesToLong(bytes, 32);\n}\n"
|
"public Object putFromLoad(Data key, Object value, long ttl) {\n return putFromLoadInternal(key, value, ttl, false);\n}\n"
|
"private static TurboMilestone updateRandomMilestone(String repoId) {\n int i = (int) (Math.random() * milestoneCounter);\n return milestones.set(i, new TurboMilestone(repoId, (i + 1), \"String_Node_Str\" + (i + 1) + \"String_Node_Str\" + Math.random()));\n}\n"
|
"public boolean isEnabled() {\n return !Boolean.valueOf(getUserProperties().getProperty(MANIPULATIONS_DISABLED_PROP, \"String_Node_Str\"));\n}\n"
|
"public void executeCreateModelTask(CreateModelTask task) throws DBExecutionException, ModelAlreadyExistException {\n try {\n if (_xmlContainer == null) {\n throw new DBExecutionException(\"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\");\n }\n if (_xmlTransaction == null) {\n throw new DBExecutionException(\"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\");\n }\n if (task == null) {\n throw new DBExecutionException(\"String_Node_Str\" + \"String_Node_Str\");\n }\n XMLDBModel model = task.getXMLDBModel();\n if (model == null) {\n throw new DBExecutionException(\"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\");\n }\n XmlDocument doc = null;\n try {\n doc = _xmlContainer.getDocument(model.getModelName());\n } catch (XmlException e) {\n }\n if (doc != null) {\n throw new ModelAlreadyExistException(\"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\");\n } else {\n String modelBody = model.getModel();\n if (modelBody.indexOf(\"String_Node_Str\") >= 0) {\n modelBody = modelBody.substring(modelBody.indexOf(\"String_Node_Str\"));\n modelBody = modelBody.substring(modelBody.indexOf(\"String_Node_Str\") + 1);\n }\n _xmlContainer.putDocument(_xmlTransaction, model.getModelName(), modelBody);\n }\n } catch (XmlException e) {\n throw new DBExecutionException(\"String_Node_Str\" + e.getMessage(), e);\n }\n}\n"
|
"protected void onHandleIntent(Intent intent) {\n mActionCanceled.set(false);\n Bundle extras = intent.getExtras();\n if (extras == null) {\n Log.e(Constants.TAG, \"String_Node_Str\");\n return;\n }\n if (!(extras.containsKey(EXTRA_MESSENGER) || extras.containsKey(EXTRA_DATA) || (intent.getAction() == null))) {\n Log.e(Constants.TAG, \"String_Node_Str\");\n return;\n }\n Uri dataUri = intent.getData();\n mMessenger = (Messenger) extras.get(EXTRA_MESSENGER);\n Bundle data = extras.getBundle(EXTRA_DATA);\n if (data == null) {\n Log.e(Constants.TAG, \"String_Node_Str\");\n return;\n }\n OtherHelper.logDebugBundle(data, \"String_Node_Str\");\n String action = intent.getAction();\n if (ACTION_ENCRYPT_SIGN.equals(action)) {\n try {\n int source = data.get(SOURCE) != null ? data.getInt(SOURCE) : data.getInt(TARGET);\n Bundle resultData = new Bundle();\n long sigMasterKeyId = data.getLong(ENCRYPT_SIGNATURE_MASTER_ID);\n String symmetricPassphrase = data.getString(ENCRYPT_SYMMETRIC_PASSPHRASE);\n boolean useAsciiArmor = data.getBoolean(ENCRYPT_USE_ASCII_ARMOR);\n long[] encryptionKeyIds = data.getLongArray(ENCRYPT_ENCRYPTION_KEYS_IDS);\n int compressionId = data.getInt(ENCRYPT_COMPRESSION_ID);\n int urisCount = data.containsKey(ENCRYPT_INPUT_URIS) ? data.getParcelableArrayList(ENCRYPT_INPUT_URIS).size() : 1;\n for (int i = 0; i < urisCount; i++) {\n data.putInt(SELECTED_URI, i);\n InputData inputData = createEncryptInputData(data);\n OutputStream outStream = createCryptOutputStream(data);\n String originalFilename = getOriginalFilename(data);\n PgpSignEncrypt.Builder builder = new PgpSignEncrypt.Builder(new ProviderHelper(this), inputData, outStream);\n builder.setProgressable(this).setEnableAsciiArmorOutput(useAsciiArmor).setVersionHeader(PgpHelper.getVersionForHeader(this)).setCompressionId(compressionId).setSymmetricEncryptionAlgorithm(Preferences.getPreferences(this).getDefaultEncryptionAlgorithm()).setEncryptionMasterKeyIds(encryptionKeyIds).setSymmetricPassphrase(symmetricPassphrase).setOriginalFilename(originalFilename);\n try {\n CachedPublicKeyRing signingRing = new ProviderHelper(this).getCachedPublicKeyRing(sigMasterKeyId);\n long sigSubKeyId = signingRing.getSignId();\n String passphrase = PassphraseCacheService.getCachedPassphrase(this, sigSubKeyId);\n builder.setSignatureMasterKeyId(sigMasterKeyId).setSignatureSubKeyId(sigSubKeyId).setSignaturePassphrase(passphrase).setSignatureHashAlgorithm(Preferences.getPreferences(this).getDefaultHashAlgorithm()).setAdditionalEncryptId(sigMasterKeyId);\n } catch (PgpGeneralException e) {\n }\n if (source == IO_BYTES) {\n builder.setCleartextInput(true);\n }\n builder.build().execute();\n outStream.close();\n finalizeEncryptOutputStream(data, resultData, outStream);\n }\n OtherHelper.logDebugBundle(resultData, \"String_Node_Str\");\n sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY, resultData);\n } catch (Exception e) {\n sendErrorToHandler(e);\n }\n } else if (ACTION_DECRYPT_VERIFY.equals(action)) {\n try {\n String passphrase = data.getString(DECRYPT_PASSPHRASE);\n InputData inputData = createDecryptInputData(data);\n OutputStream outStream = createCryptOutputStream(data);\n Bundle resultData = new Bundle();\n PgpDecryptVerify.Builder builder = new PgpDecryptVerify.Builder(new ProviderHelper(this), new PgpDecryptVerify.PassphraseCache() {\n public String getCachedPassphrase(long masterKeyId) {\n try {\n return PassphraseCacheService.getCachedPassphrase(KeychainIntentService.this, masterKeyId);\n } catch (PassphraseCacheService.KeyNotFoundException e) {\n return null;\n }\n }\n }, inputData, outStream);\n builder.setProgressable(this).setAllowSymmetricDecryption(true).setPassphrase(passphrase);\n DecryptVerifyResult decryptVerifyResult = builder.build().execute();\n outStream.close();\n resultData.putParcelable(RESULT_DECRYPT_VERIFY_RESULT, decryptVerifyResult);\n finalizeDecryptOutputStream(data, resultData, outStream);\n OtherHelper.logDebugBundle(resultData, \"String_Node_Str\");\n sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY, resultData);\n } catch (Exception e) {\n sendErrorToHandler(e);\n }\n } else if (ACTION_DECRYPT_METADATA.equals(action)) {\n try {\n String passphrase = data.getString(DECRYPT_PASSPHRASE);\n InputData inputData = createDecryptInputData(data);\n Bundle resultData = new Bundle();\n PgpDecryptVerify.Builder builder = new PgpDecryptVerify.Builder(new ProviderHelper(this), new PgpDecryptVerify.PassphraseCache() {\n public String getCachedPassphrase(long masterKeyId) throws PgpDecryptVerify.NoSecretKeyException {\n try {\n return PassphraseCacheService.getCachedPassphrase(KeychainIntentService.this, masterKeyId);\n } catch (PassphraseCacheService.KeyNotFoundException e) {\n throw new PgpDecryptVerify.NoSecretKeyException();\n }\n }\n }, inputData, null);\n builder.setProgressable(this).setAllowSymmetricDecryption(true).setPassphrase(passphrase).setDecryptMetadataOnly(true);\n DecryptVerifyResult decryptVerifyResult = builder.build().execute();\n resultData.putParcelable(RESULT_DECRYPT_VERIFY_RESULT, decryptVerifyResult);\n OtherHelper.logDebugBundle(resultData, \"String_Node_Str\");\n sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY, resultData);\n } catch (Exception e) {\n sendErrorToHandler(e);\n }\n } else if (ACTION_EDIT_KEYRING.equals(action)) {\n try {\n SaveKeyringParcel saveParcel = data.getParcelable(EDIT_KEYRING_PARCEL);\n if (saveParcel == null) {\n Log.e(Constants.TAG, \"String_Node_Str\");\n return;\n }\n PgpKeyOperation keyOperations = new PgpKeyOperation(new ProgressScaler(this, 10, 60, 100), mActionCanceled);\n EditKeyResult modifyResult;\n if (saveParcel.mMasterKeyId != null) {\n String passphrase = data.getString(EDIT_KEYRING_PASSPHRASE);\n CanonicalizedSecretKeyRing secRing = new ProviderHelper(this).getCanonicalizedSecretKeyRing(saveParcel.mMasterKeyId);\n modifyResult = keyOperations.modifySecretKeyRing(secRing, saveParcel, passphrase);\n } else {\n modifyResult = keyOperations.createSecretKeyRing(saveParcel);\n }\n if (!modifyResult.success()) {\n SaveKeyringResult saveResult = new SaveKeyringResult(SaveKeyringResult.RESULT_ERROR, modifyResult.getLog(), null);\n sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY, saveResult);\n return;\n }\n UncachedKeyRing ring = modifyResult.getRing();\n if (mActionCanceled.get()) {\n OperationLog log = modifyResult.getLog();\n if (!modifyResult.cancelled()) {\n log.add(LogLevel.CANCELLED, LogType.MSG_OPERATION_CANCELLED, 0);\n }\n SaveKeyringResult saveResult = new SaveKeyringResult(SaveKeyringResult.RESULT_CANCELLED, log, null);\n sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY, saveResult);\n return;\n }\n SaveKeyringResult saveResult = new ProviderHelper(this, modifyResult.getLog()).saveSecretKeyRing(ring, new ProgressScaler(this, 60, 95, 100));\n if (!saveResult.success()) {\n sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY, saveResult);\n return;\n }\n if (saveParcel.mNewPassphrase != null) {\n PassphraseCacheService.addCachedPassphrase(this, ring.getMasterKeyId(), saveParcel.mNewPassphrase, ring.getPublicKey().getPrimaryUserIdWithFallback());\n }\n setProgress(R.string.progress_done, 100, 100);\n ContactSyncAdapterService.requestSync();\n sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY, saveResult);\n } catch (Exception e) {\n sendErrorToHandler(e);\n }\n } else if (ACTION_DELETE_FILE_SECURELY.equals(action)) {\n try {\n String deleteFile = data.getString(DELETE_FILE);\n try {\n PgpHelper.deleteFileSecurely(this, this, new File(deleteFile));\n } catch (FileNotFoundException e) {\n throw new PgpGeneralException(getString(R.string.error_file_not_found, deleteFile));\n } catch (IOException e) {\n throw new PgpGeneralException(getString(R.string.error_file_delete_failed, deleteFile));\n }\n sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY);\n } catch (Exception e) {\n sendErrorToHandler(e);\n }\n } else if (ACTION_IMPORT_KEYRING.equals(action)) {\n try {\n List<ParcelableKeyRing> entries;\n if (data.containsKey(IMPORT_KEY_LIST)) {\n entries = data.getParcelableArrayList(IMPORT_KEY_LIST);\n } else {\n ParcelableFileCache<ParcelableKeyRing> cache = new ParcelableFileCache<ParcelableKeyRing>(this, \"String_Node_Str\");\n entries = cache.readCacheIntoList();\n }\n ProviderHelper providerHelper = new ProviderHelper(this);\n PgpImportExport pgpImportExport = new PgpImportExport(this, providerHelper, this, mActionCanceled);\n ImportKeyResult result = pgpImportExport.importKeyRings(entries);\n if (result.mSecret > 0) {\n sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_PREVENT_CANCEL);\n providerHelper.consolidateDatabaseStep1(this);\n }\n ContactSyncAdapterService.requestSync();\n sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY, result);\n } catch (Exception e) {\n sendErrorToHandler(e);\n }\n } else if (ACTION_EXPORT_KEYRING.equals(action)) {\n try {\n boolean exportSecret = data.getBoolean(EXPORT_SECRET, false);\n long[] masterKeyIds = data.getLongArray(EXPORT_KEY_RING_MASTER_KEY_ID);\n String outputFile = data.getString(EXPORT_FILENAME);\n Uri outputUri = data.getParcelable(EXPORT_URI);\n boolean exportAll = data.getBoolean(EXPORT_ALL);\n if (outputFile != null) {\n if (!FileHelper.isStorageMounted(outputFile)) {\n throw new PgpGeneralException(getString(R.string.error_external_storage_not_ready));\n }\n }\n ArrayList<Long> publicMasterKeyIds = new ArrayList<Long>();\n ArrayList<Long> secretMasterKeyIds = new ArrayList<Long>();\n String selection = null;\n if (!exportAll) {\n selection = KeychainDatabase.Tables.KEYS + \"String_Node_Str\" + KeyRings.MASTER_KEY_ID + \"String_Node_Str\";\n for (long l : masterKeyIds) {\n selection += Long.toString(l) + \"String_Node_Str\";\n }\n selection = selection.substring(0, selection.length() - 1) + \"String_Node_Str\";\n }\n Cursor cursor = getContentResolver().query(KeyRings.buildUnifiedKeyRingsUri(), new String[] { KeyRings.MASTER_KEY_ID, KeyRings.HAS_ANY_SECRET }, selection, null, null);\n try {\n if (cursor != null && cursor.moveToFirst())\n do {\n publicMasterKeyIds.add(cursor.getLong(0));\n if (exportSecret && cursor.getInt(1) != 0)\n secretMasterKeyIds.add(cursor.getLong(0));\n } while (cursor.moveToNext());\n } finally {\n if (cursor != null) {\n cursor.close();\n }\n }\n OutputStream outStream;\n if (outputFile != null) {\n outStream = new FileOutputStream(outputFile);\n } else {\n outStream = getContentResolver().openOutputStream(outputUri);\n }\n PgpImportExport pgpImportExport = new PgpImportExport(this, new ProviderHelper(this), this);\n Bundle resultData = pgpImportExport.exportKeyRings(publicMasterKeyIds, secretMasterKeyIds, outStream);\n if (mActionCanceled.get() && outputFile != null) {\n new File(outputFile).delete();\n }\n sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY, resultData);\n } catch (Exception e) {\n sendErrorToHandler(e);\n }\n } else if (ACTION_UPLOAD_KEYRING.equals(action)) {\n try {\n String keyServer = data.getString(UPLOAD_KEY_SERVER);\n HkpKeyserver server = new HkpKeyserver(keyServer);\n ProviderHelper providerHelper = new ProviderHelper(this);\n CanonicalizedPublicKeyRing keyring = providerHelper.getCanonicalizedPublicKeyRing(dataUri);\n PgpImportExport pgpImportExport = new PgpImportExport(this, new ProviderHelper(this), this);\n try {\n pgpImportExport.uploadKeyRingToServer(server, keyring);\n } catch (Keyserver.AddKeyException e) {\n throw new PgpGeneralException(\"String_Node_Str\");\n }\n sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY);\n } catch (Exception e) {\n sendErrorToHandler(e);\n }\n } else if (ACTION_DOWNLOAD_AND_IMPORT_KEYS.equals(action) || ACTION_IMPORT_KEYBASE_KEYS.equals(action)) {\n ArrayList<ImportKeysListEntry> entries = data.getParcelableArrayList(DOWNLOAD_KEY_LIST);\n String keyServer = data.getString(DOWNLOAD_KEY_SERVER);\n ArrayList<ParcelableKeyRing> keyRings = new ArrayList<ParcelableKeyRing>(entries.size());\n for (ImportKeysListEntry entry : entries) {\n try {\n Keyserver server;\n if (entry.getOrigin() == null) {\n server = new HkpKeyserver(keyServer);\n } else if (KeybaseKeyserver.ORIGIN.equals(entry.getOrigin())) {\n server = new KeybaseKeyserver();\n } else {\n server = new HkpKeyserver(entry.getOrigin());\n }\n byte[] downloadedKeyBytes;\n if (KeybaseKeyserver.ORIGIN.equals(entry.getOrigin())) {\n downloadedKeyBytes = server.get(entry.getExtraData()).getBytes();\n } else if (entry.getFingerprintHex() != null) {\n downloadedKeyBytes = server.get(\"String_Node_Str\" + entry.getFingerprintHex()).getBytes();\n } else {\n downloadedKeyBytes = server.get(entry.getKeyIdHex()).getBytes();\n }\n keyRings.add(new ParcelableKeyRing(downloadedKeyBytes, entry.getFingerprintHex()));\n }\n Intent importIntent = new Intent(this, KeychainIntentService.class);\n importIntent.setAction(ACTION_IMPORT_KEYRING);\n Bundle importData = new Bundle();\n importData.putParcelableArrayList(IMPORT_KEY_LIST, keyRings);\n importIntent.putExtra(EXTRA_DATA, importData);\n importIntent.putExtra(EXTRA_MESSENGER, mMessenger);\n onHandleIntent(importIntent);\n } catch (Exception e) {\n sendErrorToHandler(e);\n }\n } else if (ACTION_CERTIFY_KEYRING.equals(action)) {\n try {\n long masterKeyId = data.getLong(CERTIFY_KEY_MASTER_KEY_ID);\n long pubKeyId = data.getLong(CERTIFY_KEY_PUB_KEY_ID);\n ArrayList<String> userIds = data.getStringArrayList(CERTIFY_KEY_UIDS);\n String signaturePassphrase = PassphraseCacheService.getCachedPassphrase(this, masterKeyId);\n if (signaturePassphrase == null) {\n throw new PgpGeneralException(\"String_Node_Str\");\n }\n ProviderHelper providerHelper = new ProviderHelper(this);\n CanonicalizedPublicKeyRing publicRing = providerHelper.getCanonicalizedPublicKeyRing(pubKeyId);\n CanonicalizedSecretKeyRing secretKeyRing = providerHelper.getCanonicalizedSecretKeyRing(masterKeyId);\n CanonicalizedSecretKey certificationKey = secretKeyRing.getSecretKey();\n if (!certificationKey.unlock(signaturePassphrase)) {\n throw new PgpGeneralException(\"String_Node_Str\");\n }\n UncachedKeyRing newRing = certificationKey.certifyUserIds(publicRing, userIds, null, null);\n providerHelper.savePublicKeyRing(newRing);\n sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY);\n } catch (Exception e) {\n sendErrorToHandler(e);\n }\n } else if (ACTION_DELETE.equals(action)) {\n try {\n long[] masterKeyIds = data.getLongArray(DELETE_KEY_LIST);\n boolean isSecret = data.getBoolean(DELETE_IS_SECRET);\n if (masterKeyIds.length == 0) {\n throw new PgpGeneralException(\"String_Node_Str\");\n }\n if (isSecret && masterKeyIds.length > 1) {\n throw new PgpGeneralException(\"String_Node_Str\");\n }\n boolean success = false;\n for (long masterKeyId : masterKeyIds) {\n int count = getContentResolver().delete(KeyRingData.buildPublicKeyRingUri(masterKeyId), null, null);\n success |= count > 0;\n }\n if (isSecret && success) {\n new ProviderHelper(this).consolidateDatabaseStep1(this);\n }\n if (success) {\n ContactSyncAdapterService.requestSync();\n sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY);\n }\n } catch (Exception e) {\n sendErrorToHandler(e);\n }\n } else if (ACTION_CONSOLIDATE.equals(action)) {\n ConsolidateResult result;\n if (data.containsKey(CONSOLIDATE_RECOVERY) && data.getBoolean(CONSOLIDATE_RECOVERY)) {\n result = new ProviderHelper(this).consolidateDatabaseStep2(this);\n } else {\n result = new ProviderHelper(this).consolidateDatabaseStep1(this);\n }\n sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY, result);\n }\n}\n"
|
"private void calculateWidthAndHeight() {\n String sCurrent;\n Rectangle2D box;\n float fTemp;\n Iterator<String> contentIterator = sContent.iterator();\n int iCount = 0;\n float fFontScalingFactor = 0.01f;\n while (contentIterator.hasNext()) {\n sCurrent = contentIterator.next();\n if (iCount == 1) {\n fFontScalingFactor = renderStyle.getSmallFontScalingFactor();\n }\n box = textRenderer.getBounds(sCurrent).getBounds2D();\n fHeight += box.getHeight() * fFontScalingFactor;\n fTemp = (float) box.getWidth() * fFontScalingFactor;\n if (fTemp > fWidth) {\n fWidth = fTemp;\n }\n fHeight += fSpacing;\n iCount++;\n }\n fWidth += 2 * fSpacing;\n fHeight += 2 * fSpacing;\n fTextWidth = fWidth;\n if (miniView != null) {\n fWidth += miniView.getWidth() + fSpacing * 2;\n if (fHeight < miniView.getHeight()) {\n fHeight = miniView.getHeight();\n }\n fHeight += fSpacing * 2;\n }\n vecSize.set(fWidth, fHeight);\n}\n"
|
"public long getDomainId() {\n if (publicIpId != null)\n return _networkService.getIp(getSourceIpAddressId()).getDomainId();\n if (domainId != null) {\n return domainId;\n }\n return UserContext.current().getCaller().getDomainId();\n}\n"
|
"public KernelConfiguration start(BundleContext context, EventLogger eventLogger) throws IOException {\n ServiceReference<ConfigurationAdmin> configurationAdminReference = context.getServiceReference(ConfigurationAdmin.class);\n ConfigurationAdmin configAdmin = null;\n if (configurationAdminReference != null) {\n configAdmin = (ConfigurationAdmin) context.getService(configurationAdminReference);\n }\n if (configAdmin == null) {\n throw new IllegalStateException(\"String_Node_Str\");\n }\n KernelConfiguration configuration = new KernelConfiguration(context);\n publishConfiguration(context, eventLogger, configuration, configAdmin);\n this.configAdminExporter = initializeConfigAdminExporter(context, configuration, configAdmin);\n initializeDumpContributor(context, configAdmin);\n return configuration;\n}\n"
|
"private void refreshSharedConfig() {\n VizModel vizModel = VizController.getInstance().getVizModel();\n setEnable(!vizModel.isDefaultModel());\n if (vizModel.isDefaultModel()) {\n return;\n }\n if (showEdgesCheckbox.isSelected() != vizModel.isShowEdges()) {\n showEdgesCheckbox.setSelected(vizModel.isShowEdges());\n }\n float[] edgeCol = vizModel.getEdgeUniColor();\n ((JColorButton) edgeColorButton).setColor(new Color(edgeCol[0], edgeCol[1], edgeCol[2], edgeCol[3]));\n if (sourceNodeColorCheckbox.isSelected() != !vizModel.isEdgeHasUniColor()) {\n sourceNodeColorCheckbox.setSelected(!vizModel.isEdgeHasUniColor());\n }\n if (selectionColorCheckbox.isSelected() != vizModel.isEdgeSelectionColor()) {\n selectionColorCheckbox.setSelected(vizModel.isEdgeSelectionColor());\n }\n Color in = new Color(ColorSpace.getInstance(ColorSpace.CS_sRGB), vizModel.getEdgeInSelectionColor(), 1f);\n Color out = new Color(ColorSpace.getInstance(ColorSpace.CS_sRGB), vizModel.getEdgeOutSelectionColor(), 1f);\n Color both = new Color(ColorSpace.getInstance(ColorSpace.CS_sRGB), vizModel.getEdgeBothSelectionColor(), 1f);\n if (!edgeInSelectionColorChooser.getColor().equals(in)) {\n edgeInSelectionColorChooser.setColor(in);\n }\n if (!edgeBothSelectionColorChooser.getColor().equals(both)) {\n edgeBothSelectionColorChooser.setColor(both);\n }\n if (!edgeOutSelectionColorChooser.getColor().equals(both)) {\n edgeOutSelectionColorChooser.setColor(both);\n }\n if (scaleSlider.getValue() / 10f + 0.1f != vizModel.getEdgeScale()) {\n scaleSlider.setValue((int) ((vizModel.getEdgeScale() - 0.1f) * 10));\n }\n if (metaScaleSlider.getValue() / 50f + 0.0001f != vizModel.getMetaEdgeScale()) {\n metaScaleSlider.setValue((int) ((vizModel.getMetaEdgeScale() - 0.0001f) * 50));\n }\n}\n"
|
"private String createDeployment(AWSClients aws, RevisionLocation revisionLocation) throws Exception {\n this.logger.println(\"String_Node_Str\" + revisionLocation);\n CreateDeploymentResult createDeploymentResult = aws.codedeploy.createDeployment(new CreateDeploymentRequest().withDeploymentConfigName(this.deploymentConfig).withDeploymentGroupName(deploymentGroupName).withApplicationName(this.applicationName).withRevision(revisionLocation).withDescription(\"String_Node_Str\"));\n return createDeploymentResult.getDeploymentId();\n}\n"
|
"private void writeText(int type, Object value, StyleEntry style) {\n String txt = ExcelUtil.format(value, type);\n writer.openTag(\"String_Node_Str\");\n if (type == SheetData.NUMBER) {\n if (ExcelUtil.isNaN(value) || ExcelUtil.isBigNumber(value) || ExcelUtil.isInfinity(value)) {\n writer.attribute(\"String_Node_Str\", \"String_Node_Str\");\n } else {\n writer.attribute(\"String_Node_Str\", \"String_Node_Str\");\n }\n } else if (type == SheetData.DATE) {\n writer.attribute(\"String_Node_Str\", \"String_Node_Str\");\n } else {\n writer.attribute(\"String_Node_Str\", \"String_Node_Str\");\n }\n if (style != null) {\n String textTransform = (String) style.getProperty(StyleConstant.TEXT_TRANSFORM);\n if (CSSConstants.CSS_CAPITALIZE_VALUE.equalsIgnoreCase(textTransform)) {\n txt = capitalize(txt);\n } else if (CSSConstants.CSS_UPPERCASE_VALUE.equalsIgnoreCase(textTransform)) {\n txt = txt.toUpperCase();\n } else if (CSSConstants.CSS_LOWERCASE_VALUE.equalsIgnoreCase(textTransform)) {\n txt = txt.toLowerCase();\n }\n }\n writer.text(ExcelUtil.truncateCellText(txt));\n writer.closeTag(\"String_Node_Str\");\n}\n"
|
"private static boolean evaluateInExpression(String simpleExpression, List<? extends IElementParameter> listParam) {\n String[] strings = null;\n if (simpleExpression.contains(\"String_Node_Str\")) {\n strings = simpleExpression.split(\"String_Node_Str\");\n } else {\n strings = simpleExpression.split(\"String_Node_Str\");\n }\n String variableToTest = strings[0].split(\"String_Node_Str\")[1];\n ElementParameter currentParam = (ElementParameter) listParam.get(0);\n if (variableToTest.contains(\"String_Node_Str\")) {\n IElement element = currentParam.getElement();\n if (element == null || (!(element instanceof INode))) {\n throwUnsupportedExpression(simpleExpression, currentParam);\n return false;\n }\n INode node = (INode) element;\n String valuesToTest = strings[1].substring(0, strings[1].length() - 1);\n String[] values = valuesToTest.split(\"String_Node_Str\");\n if (values.length > 1) {\n for (String value : values) {\n if (value.isEmpty() || value.trim().equals(\"String_Node_Str\")) {\n continue;\n }\n for (IMetadataTable table : node.getMetadataList()) {\n for (IMetadataColumn column : table.getListColumns()) {\n if (column.getType() != null && column.getType().equals(value)) {\n return true;\n }\n }\n }\n }\n } else {\n throwUnsupportedExpression(simpleExpression, currentParam);\n }\n } else {\n throwUnsupportedExpression(simpleExpression, currentParam);\n }\n return false;\n}\n"
|
"public void partClosed(IWorkbenchPart part) {\n if (part instanceof AbstractMultiPageTalendEditor && currentProcess != null) {\n AbstractMultiPageTalendEditor mpte = (AbstractMultiPageTalendEditor) part;\n if (mpte.isKeepPropertyLocked()) {\n currentProcess = null;\n return;\n }\n IProcess process = getJobFromActivatedEditor(part);\n if (process != null) {\n Problems.removeProblemsByProcess(process);\n Problems.removeJob(process);\n IRunProcessService service = DesignerPlugin.getDefault().getRunProcessService();\n service.removeProcess(process);\n CodeView.refreshCodeView(null);\n if (currentProcess == process) {\n Contexts.setTitle(\"String_Node_Str\");\n Contexts.clearAll();\n if (lastProcessOpened == currentProcess) {\n lastProcessOpened = null;\n }\n currentProcess = null;\n for (IJobTrackerListener listener : jobTrackerListeners) {\n listener.allJobClosed();\n }\n } else if (lastProcessOpened == process) {\n lastProcessOpened = currentProcess;\n }\n if (GlobalServiceRegister.getDefault().isServiceRegistered(ISQLBuilderService.class)) {\n ISQLBuilderService sqlBuilderService = (ISQLBuilderService) GlobalServiceRegister.getDefault().getService(ISQLBuilderService.class);\n sqlBuilderService.closeSqlBuilderDialogs(process.getName());\n }\n }\n } else if (part instanceof IEditorPart) {\n if (GlobalServiceRegister.getDefault().isServiceRegistered(IDiagramModelService.class) && CorePlugin.getDefault().getDiagramModelService().isBusinessDiagramEditor((IEditorPart) part)) {\n Contexts.setTitle(\"String_Node_Str\");\n Contexts.clearAll();\n }\n }\n if (part instanceof AbstractMultiPageTalendEditor) {\n AbstractMultiPageTalendEditor mpte = (AbstractMultiPageTalendEditor) part;\n mpte.beforeDispose();\n }\n IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();\n if (page != null) {\n if (page.getActiveEditor() != null) {\n if (!page.getActiveEditor().getSite().getId().equals(DISTARTID) && !page.getActiveEditor().getSite().getId().equals(MDMSTARTID)) {\n JobSettings.switchToCurJobSettingsView();\n }\n }\n }\n}\n"
|
"public void drawLine(PoincareNode node1, PoincareNode node2, int numberOfDetails, int mode) {\n if (numberOfDetails != 0) {\n float[] startPoint = new float[2];\n startPoint = this.projectPoint(node1.getZoomedPosition(), false);\n float[] endPoint = new float[2];\n endPoint = projectPoint(node2.getZoomedPosition(), false);\n float length = this.distancePoints(startPoint, endPoint);\n gl.glLineWidth((float) lineWidth);\n gl.glBegin(GL.GL_LINE_STRIP);\n gl.glColor3i(0, 0, 0);\n gl.glVertex3d(node1.getZoomedPosition()[0] * displayScaleFactorX + (canvasWidth / 2), node1.getZoomedPosition()[1] * displayScaleFactorY + canvasHeight / 2, -2);\n float[] eV = new float[2];\n eV[0] = endPoint[0] - startPoint[0];\n eV[1] = endPoint[1] - startPoint[1];\n eV = getEV(eV);\n float[] actPosition = new float[2];\n actPosition = startPoint.clone();\n float[] actProjectedPosition = new float[2];\n for (int i = 0; i < numberOfDetails; i++) {\n actPosition[0] = actPosition[0] + eV[0] * (length / (float) numberOfDetails);\n actPosition[1] = actPosition[1] + eV[1] * (length / (float) numberOfDetails);\n actProjectedPosition = this.projectPoint(actPosition, true);\n gl.glLineWidth((float) lineWidth);\n gl.glBegin(GL.GL_LINE_STRIP);\n gl.glColor3i(0, 0, 0);\n gl.glVertex3d(actProjectedPosition[0] * displayScaleFactorX + (canvasWidth / 2), actProjectedPosition[1] * displayScaleFactorY + canvasHeight / 2, 0);\n }\n gl.glVertex3d(node2.getZoomedPosition()[0] * displayScaleFactorX + (canvasWidth / 2), node2.getZoomedPosition()[1] * displayScaleFactorY + canvasHeight / 2, 0);\n gl.glEnd();\n } else {\n gl.glLineWidth((float) lineWidth);\n gl.glBegin(GL.GL_LINE_STRIP);\n gl.glColor3i(0, 0, 0);\n gl.glVertex3d(node1.getZoomedPosition()[0] * displayScaleFactorX + (canvasWidth / 2), node1.getZoomedPosition()[1] * displayScaleFactorY + canvasHeight / 2, 0);\n gl.glVertex3d(node2.getZoomedPosition()[0] * displayScaleFactorX + (canvasWidth / 2), node2.getZoomedPosition()[1] * displayScaleFactorY + canvasHeight / 2, 0);\n gl.glEnd();\n }\n}\n"
|
"public void handle(IOContext context) throws IOException {\n ExportHandlerContext ctx = localContext.get(context);\n if (ctx == null) {\n localContext.set(context, ctx = new ExportHandlerContext(context.channel.getFd(), context.getServerConfiguration().getDbCyclesBeforeCancel()));\n }\n ChunkedResponse r = context.chunkedResponse();\n if (ctx.parseUrl(r, context.request)) {\n ctx.compileQuery(r, factoryPool, null, cacheMisses, cacheHits);\n resume(context);\n }\n}\n"
|
"private Pair<List<TemplateJoinVO>, Integer> searchForIsosInternal(ListIsosCmd cmd) {\n TemplateFilter isoFilter = TemplateFilter.valueOf(cmd.getIsoFilter());\n Long id = cmd.getId();\n Map<String, String> tags = cmd.getTags();\n Account caller = CallContext.current().getCallingAccount();\n boolean listAll = false;\n if (isoFilter != null && isoFilter == TemplateFilter.all) {\n if (_accountMgr.isNormalUser(caller.getId())) {\n throw new InvalidParameterValueException(\"String_Node_Str\" + TemplateFilter.all + \"String_Node_Str\");\n }\n listAll = true;\n }\n List<Long> permittedDomains = new ArrayList<Long>();\n List<Long> permittedAccounts = new ArrayList<Long>();\n List<Long> permittedResources = new ArrayList<Long>();\n Ternary<Long, Boolean, ListProjectResourcesCriteria> domainIdRecursiveListProject = new Ternary<Long, Boolean, ListProjectResourcesCriteria>(cmd.getDomainId(), cmd.isRecursive(), null);\n _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccountIds, domainIdRecursiveListProject, listAll, false);\n ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third();\n List<Account> permittedAccounts = new ArrayList<Account>();\n for (Long accountId : permittedAccountIds) {\n permittedAccounts.add(_accountMgr.getAccount(accountId));\n }\n HypervisorType hypervisorType = HypervisorType.getType(cmd.getHypervisor());\n return searchForTemplatesInternal(cmd.getId(), cmd.getIsoName(), cmd.getKeyword(), isoFilter, true, cmd.isBootable(), cmd.getPageSizeVal(), cmd.getStartIndex(), cmd.getZoneId(), hypervisorType, true, cmd.listInReadyState(), permittedAccounts, caller, listProjectResourcesCriteria, tags);\n}\n"
|
"public List<String> validateQuestionDetails() {\n List<String> errors = new ArrayList<String>();\n if (generateOptionsFor == FeedbackParticipantType.NONE && numOfMsqChoices < MIN_NUM_OF_MSQ_CHOICES) {\n errors.add(ERROR_NOT_ENOUGH_MSQ_CHOICES + MIN_NUM_OF_MSQ_CHOICES + \"String_Node_Str\");\n }\n return errors;\n}\n"
|
"public void testPut_ComparableKey() {\n final boolean java6CompatibleSources = !TestUtils.isJvm() || TestUtils.getJdkVersion() < 7;\n TreeMap map = new TreeMap();\n ConflictingKey conflictingKey = new ConflictingKey(\"String_Node_Str\");\n try {\n TreeMap untypedMap = map;\n untypedMap.put(conflictingKey, \"String_Node_Str\");\n assertTrue(\"String_Node_Str\", java6CompatibleSources);\n } catch (ClassCastException e) {\n assertFalse(java6CompatibleSources);\n }\n try {\n map.put(\"String_Node_Str\", \"String_Node_Str\");\n assertFalse(\"String_Node_Str\", java6CompatibleSources);\n } catch (ClassCastException expected) {\n assertTrue(java6CompatibleSources);\n }\n}\n"
|
"private Bitmap createThumbnailFromUri(Uri uri, long id) {\n Bitmap bitmap = Util.makeBitmap(IImage.THUMBNAIL_TARGET_SIZE, IImage.THUMBNAIL_MAX_NUM_PIXELS, uri, mContentResolver);\n if (bitmap != null) {\n storeThumbnail(bitmap, id);\n } else {\n bitmap = Util.makeBitmap(IImage.MINI_THUMB_TARGET_SIZE, IImage.UNCONSTRAINED, uri, mContentResolver);\n }\n return bitmap;\n}\n"
|
"private void setCommandAndApplicationForJob(final ProcessBuilder processBuilder) throws GenieException {\n final Command command = this.commandService.getCommand(this.job.getCommandId());\n if (command.getConfigs() != null && !command.getConfigs().isEmpty()) {\n processBuilder.environment().put(\"String_Node_Str\", convertCollectionToCSV(command.getConfigs()));\n }\n if (StringUtils.isNotBlank(command.getEnvPropFile())) {\n processBuilder.environment().put(\"String_Node_Str\", command.getEnvPropFile());\n }\n final Application application = command.getApplication();\n if (application != null) {\n this.jobService.setApplicationInfoForJob(this.job.getId(), application.getId(), application.getName());\n if (application.getConfigs() != null && !application.getConfigs().isEmpty()) {\n processBuilder.environment().put(\"String_Node_Str\", convertCollectionToCSV(application.getConfigs()));\n }\n if (application.getJars() != null && !application.getJars().isEmpty()) {\n processBuilder.environment().put(\"String_Node_Str\", convertCollectionToCSV(application.getJars()));\n }\n if (StringUtils.isNotBlank(application.getEnvPropFile())) {\n processBuilder.environment().put(\"String_Node_Str\", application.getEnvPropFile());\n }\n }\n}\n"
|
"public boolean equals(Object obj) {\n if (this == obj)\n return true;\n if (obj == null)\n return false;\n if (getClass() != obj.getClass())\n return false;\n ResidueIdentifier other = (ResidueIdentifier) obj;\n return this.seqResIndex == other.seqResIndex;\n}\n"
|
"public void onPlayerChat(PlayerChatEvent event) {\n Player p = event.getPlayer();\n if (ACHelper.getInstance().getConfBoolean(\"String_Node_Str\")) {\n AFKWorker.getInstance().updateTimeStamp(p);\n if (AFKWorker.getInstance().isAfk(p))\n AFKWorker.getInstance().setOnline(p);\n }\n if (player.hasPower(Type.MUTED)) {\n event.setCancelled(true);\n Utils.sI18n(p, \"String_Node_Str\");\n }\n}\n"
|
"private boolean analyzeIn(IntrinsicModel model, ExprNode node, RecordMetadata metadata) throws ParserException {\n if (node.paramCount < 2) {\n throw QueryError.$(node.position, \"String_Node_Str\");\n }\n ExprNode col = node.paramCount < 3 ? node.lhs : node.args.getLast();\n if (col.type != ExprNode.LITERAL) {\n throw QueryError.$(col.position, \"String_Node_Str\");\n }\n String column = translator.translateAlias(col.token).toString();\n if (metadata.getColumnIndexQuiet(column) == -1) {\n throw QueryError.invalidColumn(col.position, col.token);\n }\n return analyzeInInterval(model, col, node) || analyzeListOfValues(model, col.token, metadata, node) || analyzeInLambda(model, col.token, metadata, node);\n}\n"
|
"public void export(Graph graph, String filename) throws IOException {\n if (graph.getNodeCount() <= 1)\n return;\n for (Node node : graph.getNodes()) {\n minX = Math.min((int) node.getNodeData().x(), minX);\n minY = Math.min((int) node.getNodeData().y(), minY);\n maxX = Math.max((int) node.getNodeData().x(), maxX);\n maxY = Math.max((int) node.getNodeData().y(), maxY);\n }\n int width = maxX - minX;\n int height = width * (maxY - minY) / (maxX - minX);\n image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);\n points = new float[image.getWidth()][image.getHeight()];\n for (int i = 0; i < image.getWidth(); i++) {\n for (int j = 0; j < image.getHeight(); j++) {\n image.setRGB(i, j, Color.WHITE.getRGB());\n }\n }\n for (Edge edge : graph.getEdges()) {\n FDEBLayoutData data = edge.getEdgeData().getLayoutData();\n for (int i = 0; i < data.subdivisionPoints.length - 1; i++) {\n makeLine(data.subdivisionPoints[i].x, data.subdivisionPoints[i].y, data.subdivisionPoints[i + 1].x, data.subdivisionPoints[i + 1].y);\n }\n }\n float max = 0;\n for (int i = 0; i < image.getWidth(); i++) {\n for (int j = 0; j < image.getHeight(); j++) {\n max = Math.max(max, points[i][j]);\n }\n }\n for (int i = 0; i < image.getWidth(); i++) {\n for (int j = 0; j < image.getHeight(); j++) {\n if (points[i][j] > 0) {\n image.setRGB(i, j, generateGradient(points[i][j] / max));\n }\n }\n }\n System.err.println(\"String_Node_Str\" + ImageIO.write(image, \"String_Node_Str\", new File(filename + \"String_Node_Str\")));\n}\n"
|
"protected void fullLayout() {\n FormLayout layout = new FormLayout();\n layout.marginHeight = WidgetUtil.SPACING;\n layout.marginWidth = WidgetUtil.SPACING;\n layout.spacing = WidgetUtil.SPACING;\n setLayout(layout);\n int btnWidth = 60;\n int height = QUICK_BUTTON_HEIGHT - 2;\n FormData data = new FormData();\n data.right = new FormAttachment(100);\n data.top = new FormAttachment(0, height);\n data.width = Math.max(btnWidth, btnAdd.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);\n btnAdd.setLayoutData(data);\n data = new FormData();\n data.top = new FormAttachment(btnAdd, 0, SWT.BOTTOM);\n data.left = new FormAttachment(btnAdd, 0, SWT.LEFT);\n data.width = Math.max(btnWidth, btnEdit.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);\n btnEdit.setLayoutData(data);\n data = new FormData();\n data.top = new FormAttachment(btnEdit, 0, SWT.BOTTOM);\n data.left = new FormAttachment(btnEdit, 0, SWT.LEFT);\n data.width = Math.max(btnWidth, btnDel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);\n btnDel.setLayoutData(data);\n data = new FormData();\n data.top = new FormAttachment(btnDel, 0, SWT.BOTTOM);\n data.left = new FormAttachment(btnDel, 0, SWT.LEFT);\n data.width = Math.max(btnWidth, btnUp.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);\n btnUp.setLayoutData(data);\n data = new FormData();\n data.top = new FormAttachment(btnUp, 0, SWT.BOTTOM);\n data.left = new FormAttachment(btnUp, 0, SWT.LEFT);\n data.width = Math.max(btnWidth, btnDown.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);\n btnDown.setLayoutData(data);\n data = new FormData();\n data.top = new FormAttachment(btnAdd, 0, SWT.TOP);\n data.bottom = new FormAttachment(100);\n data.left = new FormAttachment(0);\n data.right = new FormAttachment(btnAdd, 0, SWT.LEFT);\n table.setLayoutData(data);\n}\n"
|
"private static void copyDirectory(File source, File destination) throws IOException {\n if (source != null && source.isDirectory()) {\n if (destination != null && !destination.exists()) {\n destination.mkdir();\n }\n for (String child : source.list()) {\n copyDirectory(new File(source, child), new File(destination, child));\n }\n } else {\n copyFile(source, destination);\n }\n}\n"
|
"private void processActionBuilder(Iterator<ActionBuilder> actionIter) {\n if (!actionIter.hasNext()) {\n return;\n }\n ActionBuilder actionBuilder = actionIter.next();\n log.debug(\"String_Node_Str\", actionBuilder.getName(), actionBuilder.getTypeSelect());\n MetaModel model = getModel(actionBuilder);\n log.debug(\"String_Node_Str\", model);\n Integer actionType = actionBuilder.getTypeSelect();\n Action action = null;\n switch(actionType) {\n case 0:\n action = createActionRecord(model, actionBuilder, true);\n break;\n case 1:\n action = createActionRecord(model, actionBuilder, false);\n break;\n case 2:\n action = createActionView(model, actionBuilder);\n break;\n case 3:\n action = createActionReport(model, actionBuilder);\n break;\n case 4:\n action = createActionEmail(model, actionBuilder);\n break;\n case 5:\n action = createActionValidation(actionBuilder);\n break;\n default:\n processActionBuilder(actionIter);\n }\n if (action != null) {\n String modelName = \"String_Node_Str\";\n if (model != null) {\n modelName = model.getFullName();\n }\n action.setXmlId(actionBuilder.getMetaModule().getName() + \"String_Node_Str\" + action.getName());\n updateModelActionMap(modelName, action);\n }\n updateModelActionMap(modelName, action);\n processActionBuilder(actionIter);\n}\n"
|
"public static String createSessionTempDir(String tempRootDir) throws DataException {\n final String prefix = \"String_Node_Str\";\n File sessionFile = null;\n synchronized (cacheCounter2) {\n String sessionTempDir = tempRootDir + File.separator + prefix + System.currentTimeMillis() + cacheCounter2.intValue();\n cacheCounter2 = new Integer(cacheCounter2.intValue() + 1);\n sessionFile = new File(sessionTempDir);\n int i = 0;\n while (sessionFile.exists() || !sessionFile.mkdirs()) {\n i++;\n sessionTempDir = sessionTempDir + \"String_Node_Str\" + i;\n sessionFile = new File(sessionTempDir);\n if (i > MAX_DIR_CREATION_ATTEMPT)\n throw new DataException(ResourceConstants.FAIL_TO_CREATE_TEMP_DIR, sessionFile.getAbsolutePath());\n }\n sessionFile.deleteOnExit();\n }\n return getCanonicalPath(sessionFile);\n}\n"
|
"public void testSoldOut() throws InterruptedException {\n List<TicketCategoryModification> categories = Arrays.asList(new TicketCategoryModification(null, \"String_Node_Str\", AVAILABLE_SEATS - 1, new DateTimeModification(LocalDate.now().minusDays(1), LocalTime.now()), new DateTimeModification(LocalDate.now().plusDays(2), LocalTime.now()), DESCRIPTION, BigDecimal.ZERO, false, \"String_Node_Str\", true), new TicketCategoryModification(null, \"String_Node_Str\", 0, new DateTimeModification(LocalDate.now().minusDays(1), LocalTime.now()), new DateTimeModification(LocalDate.now().plusDays(2), LocalTime.now()), DESCRIPTION, BigDecimal.ZERO, false, \"String_Node_Str\", false));\n Pair<Event, String> pair = initEvent(categories, organizationRepository, userManager, eventManager);\n Event event = pair.getKey();\n List<TicketCategory> ticketCategories = eventManager.loadTicketCategories(event);\n TicketCategory bounded = ticketCategories.get(0);\n TicketCategory unbounded = ticketCategories.get(1);\n List<Integer> boundedReserved = ticketRepository.selectFreeTicketsForPreReservation(event.getId(), 20, ticketCategories.get(0).getId());\n assertEquals(19, boundedReserved.size());\n List<Integer> unboundedReserved = ticketRepository.selectNotAllocatedFreeTicketsForPreReservation(event.getId(), 20);\n assertEquals(1, unboundedReserved.size());\n List<Integer> reserved = new ArrayList<>(boundedReserved);\n reserved.addAll(unboundedReserved);\n String reservationId = UUID.randomUUID().toString();\n ticketReservationRepository.createNewReservation(reservationId, DateUtils.addHours(new Date(), 1), null, Locale.ITALIAN.getLanguage());\n ticketRepository.reserveTickets(reservationId, reserved.subList(0, 19), bounded.getId(), Locale.ITALIAN.getLanguage());\n ticketRepository.reserveTickets(reservationId, reserved.subList(19, 20), unbounded.getId(), Locale.ITALIAN.getLanguage());\n ticketRepository.updateTicketsStatusWithReservationId(reservationId, Ticket.TicketStatus.ACQUIRED.name());\n waitingQueueManager.subscribe(event, \"String_Node_Str\", \"String_Node_Str\", Locale.ENGLISH);\n Thread.sleep(100L);\n waitingQueueManager.subscribe(event, \"String_Node_Str\", \"String_Node_Str\", Locale.ITALIAN);\n List<WaitingQueueSubscription> subscriptions = waitingQueueRepository.loadAll(event.getId());\n assertTrue(waitingQueueRepository.countWaitingPeople(event.getId()) == 2);\n assertTrue(subscriptions.stream().allMatch(w -> w.getSubscriptionType().equals(WaitingQueueSubscription.Type.SOLD_OUT)));\n waitingQueueSubscriptionProcessor.distributeAvailableSeats(event);\n assertTrue(waitingQueueRepository.countWaitingPeople(event.getId()) == 2);\n Ticket firstTicket = ticketRepository.findTicketsInReservation(reservationId).get(0);\n ticketRepository.releaseTicket(reservationId, event.getId(), firstTicket.getId());\n waitingQueueSubscriptionProcessor.distributeAvailableSeats(event);\n subscriptions = waitingQueueRepository.loadAll(event.getId());\n assertEquals(1, subscriptions.stream().filter(w -> StringUtils.isNotBlank(w.getReservationId())).count());\n Optional<WaitingQueueSubscription> first = subscriptions.stream().filter(w -> w.getStatus().equals(WaitingQueueSubscription.Status.PENDING)).findFirst();\n assertTrue(first.isPresent());\n assertEquals(\"String_Node_Str\", first.get().getFullName());\n}\n"
|
"public static void main(String[] args) throws ConfigurationException, WikapidiaException {\n Options options = new Options();\n options.addOption(new DefaultOptionBuilder().withLongOpt(\"String_Node_Str\").withDescription(\"String_Node_Str\").create(\"String_Node_Str\"));\n options.addOption(new DefaultOptionBuilder().withLongOpt(\"String_Node_Str\").withDescription(\"String_Node_Str\").create(\"String_Node_Str\"));\n EnvBuilder.addStandardOptions(options);\n CommandLineParser parser = new PosixParser();\n CommandLine cmd;\n try {\n cmd = parser.parse(options, args);\n } catch (ParseException e) {\n System.err.println(\"String_Node_Str\" + e.getMessage());\n new HelpFormatter().printHelp(\"String_Node_Str\", options);\n return;\n }\n Env env = new EnvBuilder(cmd).build();\n Configurator conf = env.getConfigurator();\n String phraseAnalyzerName = cmd.getOptionValue(\"String_Node_Str\", \"String_Node_Str\");\n PhraseAnalyzer phraseAnalyzer = conf.get(PhraseAnalyzer.class, phraseAnalyzerName);\n String spatialDataFolderPath = cmd.getOptionValue('f');\n File spatialDataFolder = new File(\"String_Node_Str\");\n WikidataDao wdDao = conf.get(WikidataDao.class);\n SpatialDataDao spatialDataDao = conf.get(SpatialDataDao.class);\n LOG.log(Level.INFO, \"String_Node_Str\" + spatialDataFolderPath + \"String_Node_Str\");\n SpatialDataLoader loader = new SpatialDataLoader(spatialDataDao, wdDao, phraseAnalyzer, spatialDataFolder);\n loader.loadExogenousData();\n}\n"
|
"public Future write(Request request, Object data) throws IOException {\n Object object = invokeEncoder(request.encoders(), data);\n if (WebSocketTransport.class.isAssignableFrom(transport.getClass())) {\n webSocketWrite(request, object, data);\n } else {\n try {\n Response r = httpWrite(request, object, data).get(rootFuture.time, rootFuture.tu);\n String m = r.getResponseBody();\n if (!m.isEmpty()) {\n TransportsUtil.invokeFunction(request.decoders(), functions, String.class, m, MESSAGE.name(), request.functionResolver());\n }\n } catch (TimeoutException t) {\n logger.trace(\"String_Node_Str\", t);\n rootFuture.te = t;\n } catch (Throwable t) {\n logger.error(\"String_Node_Str\", t);\n }\n }\n return rootFuture.done();\n}\n"
|
"private void createReturn(polyglot.ast.Return retStmt) {\n polyglot.ast.Expr expr = retStmt.expr();\n soot.Value sootLocal = null;\n if (expr != null) {\n sootLocal = createExpr(expr);\n }\n if (monitorStack != null) {\n Stack putBack = new Stack();\n while (!monitorStack.isEmpty()) {\n soot.Local exitVal = (soot.Local) monitorStack.pop();\n putBack.push(exitVal);\n soot.jimple.ExitMonitorStmt emStmt = soot.jimple.Jimple.v().newExitMonitorStmt(exitVal);\n body.getUnits().add(emStmt);\n }\n while (!putBack.isEmpty()) {\n monitorStack.push(putBack.pop());\n }\n }\n if (tryStack != null && !tryStack.isEmpty()) {\n polyglot.ast.Try currentTry = (polyglot.ast.Try) tryStack.pop();\n if (currentTry.finallyBlock() != null) {\n createBlock(currentTry.finallyBlock());\n tryStack.push(currentTry);\n ReturnStmtChecker rsc = new ReturnStmtChecker();\n currentTry.finallyBlock().visit(rsc);\n if (rsc.hasRet()) {\n return;\n }\n } else {\n tryStack.push(currentTry);\n }\n }\n if (catchStack != null && !catchStack.isEmpty()) {\n polyglot.ast.Try currentTry = (polyglot.ast.Try) catchStack.pop();\n createBlock(currentTry.finallyBlock());\n catchStack.push(currentTry);\n ReturnStmtChecker rsc = new ReturnStmtChecker();\n currentTry.finallyBlock().visit(rsc);\n if (rsc.hasRet()) {\n return;\n }\n }\n if (expr == null) {\n soot.jimple.Stmt retStmtVoid = soot.jimple.Jimple.v().newReturnVoidStmt();\n body.getUnits().add(retStmtVoid);\n Util.addLnPosTags(retStmtVoid, retStmt.position());\n } else {\n if (sootLocal instanceof soot.jimple.ConditionExpr) {\n sootLocal = handleCondBinExpr((soot.jimple.ConditionExpr) sootLocal);\n }\n soot.jimple.ReturnStmt retStmtLocal = soot.jimple.Jimple.v().newReturnStmt(sootLocal);\n body.getUnits().add(retStmtLocal);\n Util.addLnPosTags(retStmtLocal.getOpBox(), expr.position());\n Util.addLnPosTags(retStmtLocal, retStmt.position());\n }\n}\n"
|
"public InetSocketAddress[] getPeers(long timeoutValue, TimeUnit timeoutUnit) throws PeerDiscoveryException {\n ArrayList<InetSocketAddress> addresses = new ArrayList<InetSocketAddress>();\n connection = null;\n BufferedReader reader = null;\n try {\n InetAddress[] ips = InetAddress.getAllByName(server);\n int ipCursorStart = (int) (Math.random() * ips.length);\n int ipCursor = ipCursorStart;\n do {\n connection = new Socket();\n try {\n InetAddress ip = ips[ipCursor];\n long timeoutMsec = TimeUnit.MILLISECONDS.convert(timeoutValue, timeoutUnit);\n log.info(\"String_Node_Str\" + ip);\n connection.connect(new InetSocketAddress(ip, port), timeoutMsec);\n } catch (SocketTimeoutException e) {\n connection = null;\n } catch (IOException e) {\n connection = null;\n }\n ipCursor = (ipCursor + 1) % ips.length;\n if (ipCursor == ipCursorStart) {\n throw new PeerDiscoveryException(\"String_Node_Str\" + server);\n }\n } while (connection == null);\n writer = new BufferedWriter(new OutputStreamWriter(connection.getOutputStream(), \"String_Node_Str\"));\n reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), \"String_Node_Str\"));\n String nickRnd = String.format(\"String_Node_Str\", new Random().nextInt(Integer.MAX_VALUE));\n String command = \"String_Node_Str\" + nickRnd;\n logAndSend(command);\n command = \"String_Node_Str\" + nickRnd + \"String_Node_Str\" + nickRnd;\n logAndSend(command);\n writer.flush();\n String currLine;\n while ((currLine = reader.readLine()) != null) {\n onIRCReceive(currLine);\n if (checkLineStatus(\"String_Node_Str\", currLine)) {\n break;\n }\n }\n logAndSend(\"String_Node_Str\" + channel);\n logAndSend(\"String_Node_Str\" + channel);\n writer.flush();\n while ((currLine = reader.readLine()) != null) {\n onIRCReceive(currLine);\n if (checkLineStatus(\"String_Node_Str\", currLine)) {\n int subIndex = 0;\n if (currLine.startsWith(\"String_Node_Str\")) {\n subIndex = 1;\n }\n String spacedList = currLine.substring(currLine.indexOf(\"String_Node_Str\", subIndex));\n addresses.addAll(parseUserList(spacedList.substring(1).split(\"String_Node_Str\")));\n } else if (checkLineStatus(\"String_Node_Str\", currLine)) {\n break;\n }\n }\n logAndSend(\"String_Node_Str\" + channel);\n logAndSend(\"String_Node_Str\");\n writer.flush();\n } catch (Exception e) {\n throw new PeerDiscoveryException(e.getMessage(), e);\n } finally {\n try {\n if (reader != null)\n reader.close();\n if (writer != null)\n writer.close();\n if (connection != null)\n connection.close();\n } catch (IOException e) {\n log.warn(\"String_Node_Str\" + e.toString());\n }\n }\n return addresses.toArray(new InetSocketAddress[] {});\n}\n"
|
"private void sendNoteByEmail(long id) {\n Uri noteUri = ContentUris.withAppendedId(getIntent().getData(), id);\n Cursor c = getContentResolver().query(noteUri, new String[] { NotePad.Notes.TITLE, NotePad.Notes.NOTE }, null, null, PreferenceActivity.getSortOrderFromPrefs(this));\n String title = \"String_Node_Str\";\n String content = getString(R.string.empty_note);\n if (c != null) {\n c.moveToFirst();\n title = c.getString(0);\n content = c.getString(1);\n }\n if (debug)\n Log.i(TAG, \"String_Node_Str\" + title);\n if (debug)\n Log.i(TAG, \"String_Node_Str\" + content);\n Intent i = new Intent();\n i.setAction(Intent.ACTION_SEND);\n i.setType(\"String_Node_Str\");\n i.putExtra(Intent.EXTRA_SUBJECT, title);\n i.putExtra(Intent.EXTRA_TEXT, content);\n try {\n startActivity(i);\n } catch (ActivityNotFoundException e) {\n Toast.makeText(this, R.string.email_not_available, Toast.LENGTH_SHORT).show();\n Log.e(TAG, \"String_Node_Str\");\n }\n}\n"
|
"private String convertScopeToDescription() {\n StringBuilder sb = new StringBuilder();\n Map<String, Counter> counts = new TreeMap<String, Counter>();\n for (IReviewScopeItem item : scope.getItems()) {\n String key = item.getType(1);\n if (!counts.containsKey(key)) {\n counts.put(key, new Counter(item));\n }\n counts.get(key).counter++;\n }\n boolean isFirstElement = true;\n for (Entry<String, Counter> type : counts.entrySet()) {\n if (isFirstElement) {\n isFirstElement = false;\n } else {\n sb.append(\"String_Node_Str\");\n }\n int count = counts.get(type).counter;\n sb.append(count);\n sb.append(\"String_Node_Str\");\n sb.append(counts.get(type).item.getType(count));\n }\n return sb.toString();\n}\n"
|
"public static String generateCreateTableStatement(JoinedFlatTableDesc intermediateTableDesc, String storageDfsDir, String jobUUID) {\n StringBuilder ddl = new StringBuilder();\n ddl.append(\"String_Node_Str\" + intermediateTableDesc.getTableName(jobUUID) + \"String_Node_Str\");\n ddl.append(\"String_Node_Str\" + \"String_Node_Str\");\n for (int i = 0; i < intermediateTableDesc.getColumnList().size(); i++) {\n IntermediateColumnDesc col = intermediateTableDesc.getColumnList().get(i);\n if (i > 0) {\n ddl.append(\"String_Node_Str\");\n }\n String fullColumnName = (col.getTableName() + \"String_Node_Str\" + col.getColumnName()).replace(\"String_Node_Str\", \"String_Node_Str\");\n ddl.append(fullColumnName + \"String_Node_Str\" + SqlHiveDataTypeMapping.getHiveDataType(col.getDataType()) + \"String_Node_Str\");\n }\n ddl.append(\"String_Node_Str\" + \"String_Node_Str\");\n ddl.append(\"String_Node_Str\" + \"String_Node_Str\");\n ddl.append(\"String_Node_Str\" + \"String_Node_Str\");\n ddl.append(\"String_Node_Str\" + storageDfsDir + \"String_Node_Str\" + intermediateTableDesc.getTableName(jobUUID) + \"String_Node_Str\" + \"String_Node_Str\");\n return ddl.toString();\n}\n"
|
"private SourceFile findSourceCoverageForElement(ICElement element) {\n List<SourceFile> sources = new ArrayList<>();\n ICProject cProject = element.getCProject();\n IPath target = GcovAnnotationModelTracker.getInstance().getBinaryPath(cProject.getProject());\n try {\n IBinary[] binaries = cProject.getBinaryContainer().getBinaries();\n for (IBinary b : binaries) {\n if (b.getResource().getLocation().equals(target)) {\n CovManager covManager = new CovManager(b.getResource().getLocation().toOSString());\n covManager.processCovFiles(covManager.getGCDALocations(), null);\n sources.addAll(covManager.getAllSrcs());\n }\n }\n } catch (IOException | CoreException | InterruptedException e) {\n }\n for (SourceFile sf : sources) {\n IPath sfPath = new Path(sf.getName());\n IFile file = STLink2SourceSupport.getFileForPath(sfPath, cProject.getProject());\n if (file != null && element.getResource().getLocation().equals(file.getLocation())) {\n return sf;\n }\n }\n IPath binFolder = target.removeLastSegments(1);\n for (SourceFile sf : sources) {\n String sfPath = Paths.get(binFolder.toOSString(), sf.getName()).normalize().toString();\n if (sfPath.equals(element.getLocationURI().getPath())) {\n return sf;\n }\n }\n return null;\n}\n"
|
"private void updateNodeOnLink(CreationTool tool) {\n try {\n Class toolClass = TargetingTool.class;\n Field targetRequestField = toolClass.getDeclaredField(\"String_Node_Str\");\n Field targetEditpartField = toolClass.getDeclaredField(\"String_Node_Str\");\n targetRequestField.setAccessible(true);\n targetEditpartField.setAccessible(true);\n Request request = (Request) targetRequestField.get(tool);\n EditPart editPart = (EditPart) targetEditpartField.get(tool);\n if ((request instanceof CreateRequest) && readOnly) {\n return;\n }\n if (request instanceof CreateRequest && selectedConnectionPart != null) {\n Object object = ((CreateRequest) request).getNewObject();\n if (object instanceof Node) {\n Node node = (Node) object;\n Point originalPoint = ((CreateRequest) request).getLocation();\n RootEditPart rep = getViewer().getRootEditPart().getRoot();\n Point viewOriginalPosition = new Point();\n if (rep instanceof ScalableFreeformRootEditPart) {\n ScalableFreeformRootEditPart root = (ScalableFreeformRootEditPart) rep;\n Viewport viewport = (Viewport) root.getFigure();\n viewOriginalPosition = viewport.getViewLocation();\n }\n Point point = new Point(originalPoint.x + viewOriginalPosition.x, originalPoint.y + viewOriginalPosition.y);\n Connection targetConnection = (Connection) selectedConnectionPart.getModel();\n if (targetConnection != null) {\n NodeContainer nodeContainer = new NodeContainer(node);\n if (getProcess() instanceof Process) {\n CreateNodeContainerCommand createCmd = new CreateNodeContainerCommand((Process) getProcess(), nodeContainer, point);\n execCommandStack(createCmd);\n Node originalTarget = (Node) targetConnection.getTarget();\n INodeConnector targetConnector = node.getConnectorFromType(EConnectionType.FLOW_MAIN);\n for (INodeConnector connector : node.getConnectorsFromType(EConnectionType.FLOW_MAIN)) {\n if (connector.getMaxLinkOutput() != 0) {\n targetConnector = connector;\n break;\n }\n }\n ConnectionCreateCommand.setCreatingConnection(true);\n if (PluginChecker.isJobLetPluginLoaded()) {\n IJobletProviderService service = (IJobletProviderService) GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);\n if (service != null && service.isJobletComponent(targetConnection.getTarget())) {\n if (targetConnection.getTarget() instanceof Node) {\n NodeContainer jobletContainer = ((Node) targetConnection.getTarget()).getNodeContainer();\n jobletContainer.getInputs().remove(targetConnection);\n }\n }\n }\n ConnectionReconnectCommand cmd2 = new ConnectionReconnectCommand(targetConnection);\n cmd2.setNewTarget(node);\n execCommandStack(cmd2);\n List<Object> nodeArgs = CreateComponentOnLinkHelper.getTargetArgs(targetConnection, node);\n ConnectionCreateCommand nodeCmd = new ConnectionCreateCommand(node, targetConnector.getName(), nodeArgs, false);\n nodeCmd.setTarget(originalTarget);\n execCommandStack(nodeCmd);\n if (node.getOutgoingConnections().size() > 0) {\n if (node.getExternalNode() instanceof MapperExternalNode) {\n CreateComponentOnLinkHelper.setupTMap(node);\n }\n if (originalTarget.getComponent().getName().equals(\"String_Node_Str\")) {\n CreateComponentOnLinkHelper.updateTMap(originalTarget, targetConnection, node.getOutgoingConnections().get(0));\n }\n originalTarget.renameData(targetConnection.getName(), node.getOutgoingConnections().get(0).getName());\n }\n if (!ConnectionCreateCommand.isCreatingConnection()) {\n return;\n }\n }\n }\n }\n }\n if (request instanceof CreateRequest) {\n CreateRequest cRequest = (CreateRequest) request;\n if (cRequest.getNewObject() instanceof Node) {\n Object newObject = (cRequest).getNewObject();\n if (newObject != null) {\n Node node = (Node) newObject;\n if (!node.getComponent().getComponentType().equals(EComponentType.JOBLET)) {\n NodeContainer nodeContainer = new NodeContainer(node);\n Point originalPoint = ((CreateRequest) request).getLocation();\n RootEditPart rep = getViewer().getRootEditPart().getRoot();\n Point viewOriginalPosition = new Point();\n if (rep instanceof ScalableFreeformRootEditPart) {\n ScalableFreeformRootEditPart root = (ScalableFreeformRootEditPart) rep;\n Viewport viewport = (Viewport) root.getFigure();\n viewOriginalPosition = viewport.getViewLocation();\n }\n Point point = new Point(originalPoint.x + viewOriginalPosition.x, originalPoint.y + viewOriginalPosition.y);\n CreateNodeContainerCommand createCmd = new CreateNodeContainerCommand((Process) getProcess(), nodeContainer, point);\n if (createCmd != null) {\n execCommandStack(createCmd);\n }\n }\n }\n IComponent component = ((Node) cRequest.getNewObject()).getComponent();\n ModulesInstaller.installModules(getSite().getShell(), component);\n }\n }\n } catch (SecurityException e) {\n ExceptionHandler.process(e);\n } catch (NoSuchFieldException e) {\n ExceptionHandler.process(e);\n } catch (IllegalArgumentException e) {\n ExceptionHandler.process(e);\n } catch (IllegalAccessException e) {\n ExceptionHandler.process(e);\n }\n}\n"
|
"protected Bundle perform(Bundle extras) throws Exception {\n QBUser user = (QBUser) extras.getSerializable(QBServiceConsts.EXTRA_USER);\n File file = (File) extras.getSerializable(QBServiceConsts.EXTRA_FILE);\n user.setOldPassword(user.getPassword());\n int authorizationType = extras.getInt(QBServiceConsts.AUTH_ACTION_TYPE, ConstsCore.NOT_INITIALIZED_VALUE);\n Bundle result = new Bundle();\n if (isLoggedViaFB(user, authorizationType)) {\n result.putSerializable(QBServiceConsts.EXTRA_USER, user);\n return result;\n }\n QBUser newUser = updateUser(user, file);\n result.putSerializable(QBServiceConsts.EXTRA_USER, newUser);\n return result;\n}\n"
|
"public void windowClosing(WindowEvent e) {\n fireWizardEvent(WizardEvent.CANCEL);\n}\n"
|
"public static void main(String[] args) throws Exception {\n int degreeOfParallelism = 2;\n JobGraph jobGraph = new JobGraph(\"String_Node_Str\");\n JobInputVertex pageWithRankInput = JobGraphUtils.createInput(PageWithRankInputFormat.class, \"String_Node_Str\", \"String_Node_Str\", jobGraph, degreeOfParallelism);\n JobInputVertex transitionMatrixInput = JobGraphUtils.createInput(TransitionMatrixInputFormat.class, \"String_Node_Str\", \"String_Node_Str\", jobGraph, degreeOfParallelism);\n TaskConfig transitionMatrixInputConfig = new TaskConfig(transitionMatrixInput.getConfiguration());\n transitionMatrixInputConfig.setComparatorFactoryForOutput(PactRecordComparatorFactory.class, 0);\n PactRecordComparatorFactory.writeComparatorSetupToConfig(transitionMatrixInput.getConfiguration(), \"String_Node_Str\", new int[] { 1 }, new Class[] { PactLong.class });\n JobTaskVertex head = JobGraphUtils.createTask(BulkIterationHeadPactTask.class, \"String_Node_Str\", jobGraph, degreeOfParallelism);\n TaskConfig headConfig = new TaskConfig(head.getConfiguration());\n headConfig.setDriver(MapDriver.class);\n headConfig.setStubClass(IdentityMap.class);\n headConfig.setMemorySize(3 * JobGraphUtils.MEGABYTE);\n headConfig.setBackChannelMemoryFraction(0.8f);\n headConfig.setNumberOfIterations(1);\n JobTaskVertex intermediate = JobGraphUtils.createTask(BulkIterationIntermediatePactTask.class, \"String_Node_Str\", jobGraph, degreeOfParallelism);\n TaskConfig intermediateConfig = new TaskConfig(intermediate.getConfiguration());\n intermediateConfig.setDriver(MatchDriver.class);\n intermediateConfig.setStubClass(DotProductMatch.class);\n intermediateConfig.setLocalStrategy(TaskConfig.LocalStrategy.HYBRIDHASH_FIRST);\n PactRecordComparatorFactory.writeComparatorSetupToConfig(intermediateConfig.getConfiguration(), \"String_Node_Str\", new int[] { 0 }, new Class[] { PactLong.class });\n PactRecordComparatorFactory.writeComparatorSetupToConfig(intermediateConfig.getConfiguration(), \"String_Node_Str\", new int[] { 0 }, new Class[] { PactLong.class });\n intermediateConfig.setMemorySize(20 * JobGraphUtils.MEGABYTE);\n intermediateConfig.setGateCached(1);\n intermediateConfig.setInputGateCacheMemoryFraction(0.5f);\n JobTaskVertex tail = JobGraphUtils.createTask(BulkIterationTailPactTask.class, \"String_Node_Str\", jobGraph, degreeOfParallelism);\n TaskConfig tailConfig = new TaskConfig(tail.getConfiguration());\n tailConfig.setLocalStrategy(TaskConfig.LocalStrategy.SORT);\n tailConfig.setDriver(ReduceDriver.class);\n tailConfig.setStubClass(DotProductReducer.class);\n PactRecordComparatorFactory.writeComparatorSetupToConfig(tail.getConfiguration(), \"String_Node_Str\", new int[] { 0 }, new Class[] { PactLong.class });\n tailConfig.setMemorySize(3 * JobGraphUtils.MEGABYTE);\n tailConfig.setNumFilehandles(2);\n JobTaskVertex sync = JobGraphUtils.createSingletonTask(BulkIterationSynchronizationPactTask.class, \"String_Node_Str\", jobGraph);\n TaskConfig syncConfig = new TaskConfig(sync.getConfiguration());\n syncConfig.setDriver(MapDriver.class);\n syncConfig.setStubClass(EmptyMapStub.class);\n JobOutputVertex output = JobGraphUtils.createFileOutput(jobGraph, \"String_Node_Str\", degreeOfParallelism);\n TaskConfig outputConfig = new TaskConfig(output.getConfiguration());\n outputConfig.setStubClass(PageWithRankOutFormat.class);\n outputConfig.setStubParameter(FileOutputFormat.FILE_PARAMETER_KEY, \"String_Node_Str\");\n JobOutputVertex fakeTailOutput = JobGraphUtils.createFakeOutput(jobGraph, \"String_Node_Str\", degreeOfParallelism);\n JobOutputVertex fakeSyncOutput = JobGraphUtils.createSingletonFakeOutput(jobGraph, \"String_Node_Str\");\n JobGraphUtils.connectLocal(pageWithRankInput, head);\n JobGraphUtils.connectLocal(head, intermediate, DistributionPattern.BIPARTITE, ShipStrategy.BROADCAST);\n JobGraphUtils.connectLocal(transitionMatrixInput, intermediate, DistributionPattern.BIPARTITE, ShipStrategy.PARTITION_HASH);\n intermediateConfig.setGateIterativeWithNumberOfEventsUntilInterrupt(0, degreeOfParallelism);\n JobGraphUtils.connectLocal(intermediate, tail, DistributionPattern.POINTWISE, ShipStrategy.FORWARD);\n tailConfig.setGateIterativeWithNumberOfEventsUntilInterrupt(0, 1);\n JobGraphUtils.connectLocal(head, sync);\n syncConfig.setGateIterativeWithNumberOfEventsUntilInterrupt(0, degreeOfParallelism);\n JobGraphUtils.connectLocal(head, output);\n JobGraphUtils.connectLocal(tail, fakeTailOutput);\n JobGraphUtils.connectLocal(sync, fakeSyncOutput);\n fakeTailOutput.setVertexToShareInstancesWith(tail);\n tail.setVertexToShareInstancesWith(head);\n pageWithRankInput.setVertexToShareInstancesWith(head);\n transitionMatrixInput.setVertexToShareInstancesWith(head);\n intermediate.setVertexToShareInstancesWith(head);\n output.setVertexToShareInstancesWith(head);\n sync.setVertexToShareInstancesWith(head);\n fakeSyncOutput.setVertexToShareInstancesWith(sync);\n GlobalConfiguration.loadConfiguration(\"String_Node_Str\");\n Configuration conf = GlobalConfiguration.getConfiguration();\n JobGraphUtils.submit(jobGraph, conf);\n}\n"
|
"static PlanarImage createScaledImage(PlanarImage sourceImage, S2SpatialResolution resolution, int level) {\n int sourceWidth = sourceImage.getWidth();\n int sourceHeight = sourceImage.getHeight();\n int targetWidth = getSizeAtResolutionLevel(L1C_TILE_LAYOUTS[0].width, level);\n int targetHeight = getSizeAtResolutionLevel(L1C_TILE_LAYOUTS[0].height, level);\n float scaleX = resolution.resolution / (float) S2SpatialResolution.R10M.resolution;\n float scaleY = resolution.resolution / (float) S2SpatialResolution.R10M.resolution;\n final Dimension tileDim = getTileDim(targetWidth, targetHeight);\n ImageLayout imageLayout = new ImageLayout();\n imageLayout.setTileWidth(tileDim.width);\n imageLayout.setTileHeight(tileDim.height);\n BorderExtender borderExtender = BorderExtender.createInstance(BorderExtender.BORDER_ZERO);\n RenderingHints renderingHints = new RenderingHints(JAI.KEY_BORDER_EXTENDER, borderExtender);\n renderingHints.put(JAI.KEY_IMAGE_LAYOUT, imageLayout);\n RenderedOp scaledImage = ScaleDescriptor.create(sourceImage, scaleX, scaleY, sourceImage.getMinX() - sourceImage.getMinX() * scaleX, sourceImage.getMinY() - sourceImage.getMinY() * scaleY, Interpolation.getInstance(Interpolation.INTERP_NEAREST), renderingHints);\n if (scaledImage.getWidth() != targetWidth || scaledImage.getHeight() != targetHeight) {\n return CropDescriptor.create(scaledImage, (float) sourceImage.getMinX(), (float) sourceImage.getMinY(), (float) targetWidth, (float) targetHeight, null);\n } else {\n return scaledImage;\n }\n}\n"
|
"protected double updateHappinessAfterVotes(Proposition proposition, int votes, double overallMovement) {\n return this.getDataModel().getCurrentHappiness();\n}\n"
|
"public List<Integer> getRowIDList() {\n ArrayList<Integer> list = new ArrayList<Integer>(metaData.nrColumns);\n for (int count = 0; count < metaData.getNrRows(); count++) {\n list.add(count);\n }\n return list;\n}\n"
|
"public ServerResponse<PageInfo> getProductByKeywordCategory(Integer categoryId, String keyword, int pageNum, int pageSize, String orderBy) {\n if (StringUtils.isBlank(keyword) && categoryId == null) {\n return ServerResponse.createByErrorCodeMessage(ResponseCode.ILLEGAL_ARGUMENT.getCode(), ResponseCode.ILLEGAL_ARGUMENT.getDescription());\n }\n List<Integer> categoryIdList = new ArrayList<>();\n if (categoryId != null) {\n Category category = categoryMapper.selectByPrimaryKey(categoryId);\n if (category == null) {\n PageHelper.startPage(pageNum, pageSize);\n List<ProductListVo> productListVoList = Lists.newArrayList();\n PageInfo pageInfo = new PageInfo(productListVoList);\n return ServerResponse.createBySuccess(pageInfo);\n }\n categoryIdList = iCategoryService.selectCategoryAndChildrenById(categoryId).getData();\n }\n if (StringUtils.isNotBlank(keyword)) {\n keyword = new StringBuilder().append(\"String_Node_Str\").append(keyword).append(\"String_Node_Str\").toString();\n }\n if (StringUtils.isNotBlank(orderBy)) {\n if (Const.ProductListOrderBy.PRICE_ASC_DESC.contains(orderBy)) {\n String[] orderArr = orderBy.split(\"String_Node_Str\");\n PageHelper.orderBy(orderArr[0] + \"String_Node_Str\" + orderArr[1]);\n }\n }\n PageHelper.startPage(pageNum, pageSize);\n keyword = StringUtils.isBlank(keyword) ? null : keyword;\n categoryIdList = categoryIdList.size() == 0 ? null : categoryIdList;\n List<Product> productList = productMapper.selectByNameAndCategoryIds(keyword, categoryIdList);\n List<ProductListVo> productListVoList = new ArrayList<>();\n for (Product product : productList) {\n ProductListVo productListVo = assembleProductListVo(product);\n productListVoList.add(productListVo);\n }\n PageInfo pageInfo = new PageInfo(productList);\n pageInfo.setList(productListVoList);\n return ServerResponse.createBySuccess(pageInfo);\n}\n"
|
"public void run() {\n DataSetHandle dsHandle = ((DataSetEditor) getContainer()).getHandle();\n try {\n DataSetMetaDataHelper.clearPropertyBindingMap(dataSetHandle, dataSetBindingMap, dataSourceBindingMap);\n } catch (SemanticException e) {\n ExceptionHandler.handle(e);\n }\n}\n"
|
"public void checkPolygonCornerDistance() {\n List<Point2D_I32> contour = new ArrayList<Point2D_I32>();\n for (int i = 0; i < 20; i++) {\n contour.add(new Point2D_I32(rand.nextInt(), rand.nextInt()));\n }\n contour.get(3).set(10, 10);\n contour.get(4).set(13, 10);\n contour.get(8).set(20, 10);\n contour.get(12).set(20, 20);\n contour.get(18).set(10, 20);\n GrowQueue_I32 corners = new GrowQueue_I32();\n corners.add(3);\n corners.add(4);\n corners.add(8);\n corners.add(12);\n corners.add(18);\n Polygon2D_F64 poly = new Polygon2D_F64(10, 10, 20, 10, 20, 20, 10, 20);\n ReduceCornersInContourPolygon alg = new ReduceCornersInContourPolygon(4, 2, true);\n assertTrue(alg.checkPolygonCornerDistance(poly, contour, corners));\n contour.get(3).set(8, 10);\n assertTrue(alg.checkPolygonCornerDistance(poly, contour, corners));\n contour.get(3).set(7, 10);\n assertFalse(alg.checkPolygonCornerDistance(poly, contour, corners));\n}\n"
|
"public List<SurfaceFormSenseScore<T, U>> disambiguate(Collection<? extends SurfaceFormSenses<T, U>> surfaceFormsSenses, Graph subgraph) {\n VertexScorer<Vertex, Double> vertexScorer = getVertexScorer(subgraph);\n List<SurfaceFormSenseScore<T, U>> senseScores = ModelTransformer.initializeScores(surfaceFormsSenses, factory);\n for (SurfaceFormSenseScore<T, U> senseScore : senseScores) {\n Vertex v = Graphs.vertexByUri(subgraph, senseScore.sense().fullUri());\n double score = (v == null) ? -1 : vertexScorer.getVertexScore(v);\n senseScore.setScore(score);\n }\n Collections.sort(senseScores);\n Collections.reverse(senseScores);\n return senseScores;\n}\n"
|
"public static NadminReturn nadminWithOutput(final int timeout, final String... args) {\n File cmd = new File(nucleusRoot, isWindows() ? \"String_Node_Str\" : \"String_Node_Str\");\n if (!cmd.canExecute()) {\n cmd = new File(nucleusRoot, isWindows() ? \"String_Node_Str\" : \"String_Node_Str\");\n }\n List<String> command = new ArrayList<String>();\n command.add(cmd.toString());\n command.add(\"String_Node_Str\");\n command.addAll(Arrays.asList(args));\n ProcessManager pm = new ProcessManager(command);\n pm.setTimeoutMsec(timeout);\n pm.setEcho(false);\n int exit;\n String myErr = \"String_Node_Str\";\n try {\n exit = pm.execute();\n } catch (ProcessManagerTimeoutException tex) {\n myErr = \"String_Node_Str\" + timeout + \"String_Node_Str\";\n exit = 1;\n } catch (ProcessManagerException ex) {\n exit = 1;\n }\n NadminReturn ret = new NadminReturn(exit, pm.getStdout(), pm.getStderr() + myErr, args[0]);\n write(ret.outAndErr);\n return ret;\n}\n"
|
"public Object apply(State callerState) {\n SSAAbstractInvokeInstruction callInstr = ir.getCalls(call)[0];\n PointerKey returnAtCallerKey = heapModel.getPointerKeyForLocal(caller, isExceptional ? callInstr.getException() : callInstr.getDef());\n Set<CGNode> possibleTargets = g.getPossibleTargets(caller, call, (LocalPointerKey) returnAtCallerKey);\n if (noOnTheFlyNeeded(callSiteAndCGNode, possibleTargets)) {\n propagateToCaller();\n } else {\n if (callToOTFTargets.get(callSiteAndCGNode).contains(callee.getMethod())) {\n propagateToCaller();\n } else {\n queryCallTargets(callSiteAndCGNode, ir, callerState);\n }\n }\n return null;\n}\n"
|
"public void showSubordinateLeaves(ActionRequest request, ActionResponse response) {\n List<User> userList = Query.of(User.class).filter(\"String_Node_Str\", AuthUtils.getUser()).fetch();\n List<Long> leaveListId = new ArrayList<Long>();\n for (User user : userList) {\n List<LeaveRequest> leaveList = Query.of(LeaveRequest.class).filter(\"String_Node_Str\", user, AuthUtils.getUser().getActiveCompany()).fetch();\n for (LeaveRequest leave : leaveList) {\n leaveListId.add(leave.getId());\n }\n }\n if (leaveListId.isEmpty()) {\n response.setNotify(I18n.get(\"String_Node_Str\"));\n } else {\n String leaveListIdStr = \"String_Node_Str\";\n if (!leaveListId.isEmpty()) {\n leaveListIdStr = Joiner.on(\"String_Node_Str\").join(leaveListId);\n }\n response.setView(ActionView.define(I18n.get(\"String_Node_Str\")).model(LeaveRequest.class.getName()).add(\"String_Node_Str\", \"String_Node_Str\").add(\"String_Node_Str\", \"String_Node_Str\").domain(\"String_Node_Str\" + leaveListIdStr + \"String_Node_Str\").map());\n }\n}\n"
|
"public static CodeBlock.Builder getSQLiteStatementMethod(AtomicInteger index, String elementName, BaseColumnAccess columnAccess, TypeName elementTypeName, boolean isModelContainerAdapter) {\n String statement = columnAccess.getColumnAccessString(elementTypeName, elementName, isModelContainerAdapter, ModelUtils.getVariable(isModelContainerAdapter));\n CodeBlock.Builder codeBuilder = CodeBlock.builder();\n String finalAccessStatement = statement;\n if (columnAccess instanceof TypeConverterAccess || isModelContainerAdapter) {\n finalAccessStatement = \"String_Node_Str\" + fullElementName;\n TypeName typeName;\n if (columnAccess instanceof TypeConverterAccess) {\n typeName = ((TypeConverterAccess) columnAccess).typeConverterDefinition.getDbTypeName();\n } else {\n typeName = elementTypeName;\n }\n codeBuilder.addStatement(\"String_Node_Str\", typeName, finalAccessStatement, statement);\n }\n if (!elementTypeName.isPrimitive()) {\n codeBuilder.beginControlFlow(\"String_Node_Str\", finalAccessStatement);\n }\n codeBuilder.addStatement(\"String_Node_Str\", BindToStatementMethod.PARAM_STATEMENT, columnAccess.getSqliteTypeForTypeName(elementTypeName, isModelContainerAdapter).getSQLiteStatementMethod(), index.intValue(), finalAccessStatement);\n if (!elementTypeName.isPrimitive()) {\n codeBuilder.nextControlFlow(\"String_Node_Str\").addStatement(\"String_Node_Str\", BindToStatementMethod.PARAM_STATEMENT, index.intValue()).endControlFlow();\n }\n return codeBuilder;\n}\n"
|
"public void removeAttribute(String key) {\n throw notSupportedOnClient();\n}\n"
|
"public void exec() {\n try {\n super.exec();\n } catch (AbortException e) {\n } catch (VMException e) {\n throw e;\n } catch (Exception e) {\n VMException lastException = new VMException(e);\n if (debugSupport != null) {\n debugSupport.notifyDebugEvent(new DebugEventError(e.getMessage()));\n suspend();\n synchronized (this) {\n while (suspended) {\n try {\n wait();\n } catch (InterruptedException e1) {\n }\n }\n }\n }\n throw lastException;\n }\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.