code
stringlengths 10
174k
| nl
stringlengths 3
129k
|
---|---|
public JSONObject put(String key,int value) throws JSONException {
this.put(key,new Integer(value));
return this;
}
| Put a key/int pair in the JSONObject. |
public VNXeCommandJob restoreSnap(String snapId){
SnapRequests req=new SnapRequests(_khClient);
return req.restoreSnap(snapId,null);
}
| Restore a snapshot |
public void addLayoutComponent(String name,Component comp){
}
| Adds the specified component with the specified name to the layout. |
public void addSample(int weight,float value){
ensureSortedByIndex();
Sample newSample=recycledSampleCount > 0 ? recycledSamples[--recycledSampleCount] : new Sample();
newSample.index=nextSampleIndex++;
newSample.weight=weight;
newSample.value=value;
samples.add(newSample);
totalWeight+=weight;
while (totalWeight > maxWeight) {
int excessWeight=totalWeight - maxWeight;
Sample oldestSample=samples.get(0);
if (oldestSample.weight <= excessWeight) {
totalWeight-=oldestSample.weight;
samples.remove(0);
if (recycledSampleCount < MAX_RECYCLED_SAMPLES) {
recycledSamples[recycledSampleCount++]=oldestSample;
}
}
else {
oldestSample.weight-=excessWeight;
totalWeight-=excessWeight;
}
}
}
| Record a new observation. Respect the configured total weight by reducing in weight or removing the oldest observations as required. |
public ClientPropertiesBuilder withClientTimeout(Integer timeout){
properties.setProperty(CLIENT_CONNECTION_TIMEOUT,timeout.toString());
return this;
}
| Specify a timeout period for the client (in milliseconds). |
public ErrorDetails validateOwnerDetails(ErrorDetails errorDetails,final List<OwnerInformation> ownerDetailsList){
if (ownerDetailsList == null) {
errorDetails=new ErrorDetails();
errorDetails.setErrorCode(OWNER_DETAILS_REQ_CODE);
errorDetails.setErrorMessage(OWNER_DETAILS_REQ_MSG);
return errorDetails;
}
else {
for ( final OwnerInformation ownerDetails : ownerDetailsList) {
if (StringUtils.isBlank(ownerDetails.getMobileNumber())) {
errorDetails=new ErrorDetails();
errorDetails.setErrorCode(MOBILE_NO_REQ_CODE);
errorDetails.setErrorMessage(MOBILE_NO_REQ_MSG);
return errorDetails;
}
else {
if (ownerDetails.getMobileNumber().trim().length() != 10) {
errorDetails=new ErrorDetails();
errorDetails.setErrorCode(MOBILENO_MAX_LENGTH_ERROR_CODE);
errorDetails.setErrorMessage(MOBILENO_MAX_LENGTH_ERROR_MSG);
return errorDetails;
}
Pattern pattern=Pattern.compile("\\d{10}");
Matcher matcher=pattern.matcher(ownerDetails.getMobileNumber());
if (!matcher.matches()) {
errorDetails=new ErrorDetails();
errorDetails.setErrorCode(MOBILENO_ALPHANUMERIC_ERROR_CODE);
errorDetails.setErrorMessage(MOBILENO_ALPHANUMERIC_ERROR_MSG);
return errorDetails;
}
}
if (StringUtils.isBlank(ownerDetails.getName())) {
errorDetails=new ErrorDetails();
errorDetails.setErrorCode(OWNER_NAME_REQ_CODE);
errorDetails.setErrorMessage(OWNER_NAME_REQ_MSG);
return errorDetails;
}
else if (StringUtils.isBlank(ownerDetails.getGender())) {
errorDetails=new ErrorDetails();
errorDetails.setErrorCode(GENDER_REQ_CODE);
errorDetails.setErrorMessage(GENDER_REQ_MSG);
return errorDetails;
}
else if (StringUtils.isBlank(ownerDetails.getGuardianRelation())) {
errorDetails=new ErrorDetails();
errorDetails.setErrorCode(GUARDIAN_RELATION_REQ_CODE);
errorDetails.setErrorMessage(GUARDIAN_RELATION_REQ_MSG);
return errorDetails;
}
else if (StringUtils.isBlank(ownerDetails.getGuardian())) {
errorDetails=new ErrorDetails();
errorDetails.setErrorCode(GUARDIAN_REQ_CODE);
errorDetails.setErrorMessage(GUARDIAN_REQ_MSG);
return errorDetails;
}
}
}
return errorDetails;
}
| Validates owner details |
public DataTruncation(int index,boolean parameter,boolean read,int dataSize,int transferSize,Throwable cause){
super(THE_REASON,read ? THE_SQLSTATE_READ : THE_SQLSTATE_WRITE,THE_ERROR_CODE,cause);
this.index=index;
this.parameter=parameter;
this.read=read;
this.dataSize=dataSize;
this.transferSize=transferSize;
}
| Creates a DataTruncation. The Reason is set to "Data truncation", the error code is set to the SQLException default value and other fields are set to the values supplied on this method. |
public SimpleRegister(){
register=null;
}
| Constructs a new <tt>SimpleRegister</tt> instance. It's state will be invalid. Attempting to access this register will result in an IllegalAddressException(). It may be used to create "holes" in a Modbus register map. |
LDAPCertSelector(X509CertSelector selector,X500Principal certSubject,String ldapDN) throws IOException {
this.selector=selector == null ? new X509CertSelector() : selector;
this.certSubject=certSubject;
this.subject=new X500Name(ldapDN).asX500Principal();
}
| Creates an LDAPCertSelector. |
public FolderDescription(IFolder folder,boolean virtual){
super(folder);
this.virtual=virtual;
}
| Create a FolderDescription from the specified folder handle. Typically used when the folder handle represents a resource that actually exists, although it will not fail if the resource is non-existent. |
@Override public void updateScreen(){
tokenBox.updateCursorCounter();
}
| Called from the main game loop to update the screen. |
public Trie(){
clear();
}
| Create an emptry Trie. |
public NotificationChain basicSetExpression(Expression newExpression,NotificationChain msgs){
Expression oldExpression=expression;
expression=newExpression;
if (eNotificationRequired()) {
ENotificationImpl notification=new ENotificationImpl(this,Notification.SET,N4JSPackage.ARGUMENT__EXPRESSION,oldExpression,newExpression);
if (msgs == null) msgs=notification;
else msgs.add(notification);
}
return msgs;
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public static void mapDatasource(Map map,List props){
String value=(String)map.get("type");
String jndiName="";
LogWriterI18n writer=TransactionUtils.getLogWriterI18n();
Object ds=null;
try {
jndiName=(String)map.get("jndi-name");
if (value.equals("PooledDataSource")) {
ds=DataSourceFactory.getPooledDataSource(map,props);
ctx.rebind("java:/" + jndiName,ds);
dataSourceList.add(ds);
if (writer.fineEnabled()) writer.fine("Bound java:/" + jndiName + " to Context");
}
else if (value.equals("XAPooledDataSource")) {
ds=DataSourceFactory.getTranxDataSource(map,props);
ctx.rebind("java:/" + jndiName,ds);
dataSourceList.add(ds);
if (writer.fineEnabled()) writer.fine("Bound java:/" + jndiName + " to Context");
}
else if (value.equals("SimpleDataSource")) {
ds=DataSourceFactory.getSimpleDataSource(map,props);
ctx.rebind("java:/" + jndiName,ds);
if (writer.fineEnabled()) writer.fine("Bound java:/" + jndiName + " to Context");
}
else if (value.equals("ManagedDataSource")) {
ClientConnectionFactoryWrapper ds1=DataSourceFactory.getManagedDataSource(map,props);
ctx.rebind("java:/" + jndiName,ds1.getClientConnFactory());
dataSourceList.add(ds1);
if (writer.fineEnabled()) writer.fine("Bound java:/" + jndiName + " to Context");
}
else {
String exception="JNDIInvoker::mapDataSource::No correct type of DataSource";
if (writer.fineEnabled()) writer.fine(exception);
throw new DataSourceCreateException(exception);
}
ds=null;
}
catch ( NamingException ne) {
if (writer.infoEnabled()) writer.info(LocalizedStrings.JNDIInvoker_JNDIINVOKER_MAPDATASOURCE_0_WHILE_BINDING_1_TO_JNDI_CONTEXT,new Object[]{"NamingException",jndiName});
}
catch ( DataSourceCreateException dsce) {
if (writer.infoEnabled()) writer.info(LocalizedStrings.JNDIInvoker_JNDIINVOKER_MAPDATASOURCE_0_WHILE_BINDING_1_TO_JNDI_CONTEXT,new Object[]{"DataSourceCreateException",jndiName});
}
}
| Binds a single Datasource to the existing JNDI tree. The JNDI tree may be The Datasource properties are contained in the map. The Datasource implementation class is populated based on properties in the map. |
public long allocateSlot(int slotNumber){
return toLong(bucketNum,slotNumber);
}
| Returns a given slot in the bucket, given a slot number |
public static boolean intersectLineSegmentTriangle(Vector3d p0,Vector3d p1,Vector3d v0,Vector3d v1,Vector3d v2,double epsilon,Vector3d intersectionPoint){
return intersectLineSegmentTriangle(p0.x,p0.y,p0.z,p1.x,p1.y,p1.z,v0.x,v0.y,v0.z,v1.x,v1.y,v1.z,v2.x,v2.y,v2.z,epsilon,intersectionPoint);
}
| Determine whether the line segment with the end points <code>p0</code> and <code>p1</code> intersects the triangle consisting of the three vertices <tt>(v0X, v0Y, v0Z)</tt>, <tt>(v1X, v1Y, v1Z)</tt> and <tt>(v2X, v2Y, v2Z)</tt>, regardless of the winding order of the triangle or the direction of the line segment between its two end points, and return the point of intersection. <p> Reference: <a href="http://www.cs.virginia.edu/~gfx/Courses/2003/ImageSynthesis/papers/Acceleration/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf"> Fast, Minimum Storage Ray/Triangle Intersection</a> |
private void visitFrame(final Frame f){
int i, t;
int nTop=0;
int nLocal=0;
int nStack=0;
int[] locals=f.inputLocals;
int[] stacks=f.inputStack;
for (i=0; i < locals.length; ++i) {
t=locals[i];
if (t == Frame.TOP) {
++nTop;
}
else {
nLocal+=nTop + 1;
nTop=0;
}
if (t == Frame.LONG || t == Frame.DOUBLE) {
++i;
}
}
for (i=0; i < stacks.length; ++i) {
t=stacks[i];
++nStack;
if (t == Frame.LONG || t == Frame.DOUBLE) {
++i;
}
}
int frameIndex=startFrame(f.owner.position,nLocal,nStack);
for (i=0; nLocal > 0; ++i, --nLocal) {
t=locals[i];
frame[frameIndex++]=t;
if (t == Frame.LONG || t == Frame.DOUBLE) {
++i;
}
}
for (i=0; i < stacks.length; ++i) {
t=stacks[i];
frame[frameIndex++]=t;
if (t == Frame.LONG || t == Frame.DOUBLE) {
++i;
}
}
endFrame();
}
| Visits a frame that has been computed from scratch. |
private void reserveStock(MPPOrderBOMLine[] lines){
for ( MPPOrderBOMLine line : lines) {
line.reserveStock();
line.saveEx();
}
}
| Reserve Inventory. |
static public double jn(int n,double x) throws ArithmeticException {
int j, m;
double ax, bj, bjm, bjp, sum, tox, ans;
boolean jsum;
final double ACC=40.0;
final double BIGNO=1.0e+10;
final double BIGNI=1.0e-10;
if (n == 0) return j0(x);
if (n == 1) return j1(x);
ax=Math.abs(x);
if (ax == 0.0) return 0.0;
if (ax > (double)n) {
tox=2.0 / ax;
bjm=j0(ax);
bj=j1(ax);
for (j=1; j < n; j++) {
bjp=j * tox * bj - bjm;
bjm=bj;
bj=bjp;
}
ans=bj;
}
else {
tox=2.0 / ax;
m=2 * ((n + (int)Math.sqrt(ACC * n)) / 2);
jsum=false;
bjp=ans=sum=0.0;
bj=1.0;
for (j=m; j > 0; j--) {
bjm=j * tox * bj - bjp;
bjp=bj;
bj=bjm;
if (Math.abs(bj) > BIGNO) {
bj*=BIGNI;
bjp*=BIGNI;
ans*=BIGNI;
sum*=BIGNI;
}
if (jsum) sum+=bj;
jsum=!jsum;
if (j == n) ans=bjp;
}
sum=2.0 * sum - bj;
ans/=sum;
}
return x < 0.0 && n % 2 == 1 ? -ans : ans;
}
| Returns the Bessel function of the first kind of order <tt>n</tt> of the argument. |
@Override public SurfaceData restoreContents(){
acceleratedSurfaceLost();
return super.restoreContents();
}
| We're asked to restore contents by the accelerated surface, which means that it had been lost. |
public Object runSafely(Catbert.FastStack stack) throws Exception {
Show s=getShow(stack);
return (s == null) ? "" : s.getLanguage();
}
| Returns the language that the specified Show is in. |
private void assertWriteLittleEndian64(byte[] data,long value) throws Exception {
ByteArrayOutputStream rawOutput=new ByteArrayOutputStream();
CodedOutputStream output=CodedOutputStream.newInstance(rawOutput);
output.writeRawLittleEndian64(value);
output.flush();
assertEqualBytes(data,rawOutput.toByteArray());
for (int blockSize=1; blockSize <= 16; blockSize*=2) {
rawOutput=new ByteArrayOutputStream();
output=CodedOutputStream.newInstance(rawOutput,blockSize);
output.writeRawLittleEndian64(value);
output.flush();
assertEqualBytes(data,rawOutput.toByteArray());
}
}
| Parses the given bytes using writeRawLittleEndian64() and checks that the result matches the given value. |
private void drawX(Canvas canvas,Paint paint,float x,float y){
canvas.drawLine(x - size,y - size,x + size,y + size,paint);
canvas.drawLine(x + size,y - size,x - size,y + size,paint);
}
| The graphical representation of an X point shape. |
@SuppressWarnings({"unchecked"}) public RecordSet(Input input){
Deserializer deserializer=new Deserializer();
Map<String,Object> dataMap=input.readKeyValues(deserializer);
Object map=dataMap.get("serverinfo");
Map<String,Object> serverInfo=null;
if (map != null) {
if (!(map instanceof Map)) {
throw new RuntimeException("Expected Map but got " + map.getClass().getName());
}
serverInfo=(Map<String,Object>)map;
totalCount=(Integer)serverInfo.get("totalCount");
List<List<Object>> initialData=(List<List<Object>>)serverInfo.get("initialData");
cursor=(Integer)serverInfo.get("cursor");
serviceName=(String)serverInfo.get("serviceName");
columns=(List<String>)serverInfo.get("columnNames");
version=(Integer)serverInfo.get("version");
id=serverInfo.get("id");
this.data=new ArrayList<List<Object>>(totalCount);
for (int i=0; i < initialData.size(); i++) {
this.data.add(i + cursor - 1,initialData.get(i));
}
}
else {
throw new RuntimeException("Map (serverinfo) was null");
}
}
| Creates recordset from Input object |
public static void d(String tag,String s){
if (LDJSLOG.DEBUG >= LOGLEVEL) Log.d(tag,s);
}
| Debug log message. |
public void onTick(){
if (entity.isBurning()) {
lightLevel=15;
}
else {
lightLevel=getLightFromItemStack(entity.getEntityItem());
if (notWaterProof && entity.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(entity.posX),MathHelper.floor_double(entity.posY),MathHelper.floor_double(entity.posZ))).getBlock().getMaterial() == Material.water) {
lightLevel=0;
}
}
if (!enabled && lightLevel > 0) {
enableLight();
}
else if (enabled && lightLevel < 1) {
disableLight();
}
}
| Since they are IDynamicLightSource instances, they will already receive updates! Why do we need to do this? Because seperate Thread! |
public Column(String label,String variable,String type){
this.label=label;
this.variable=variable;
this.type=type;
}
| Creates a new column with the specified definition. |
public void createPictScenario11() throws Exception {
BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-07-31 00:00:00"));
String supplierAdminId="Pict11Supplier";
VOOrganization supplier=orgSetup.createOrganization(basicSetup.getPlatformOperatorUserKey(),supplierAdminId,"Pict11SupplierOrg",TestOrganizationSetup.ORGANIZATION_DOMICILE_DE,OrganizationRoleType.TECHNOLOGY_PROVIDER,OrganizationRoleType.SUPPLIER);
VOUser supplierAdmin=orgSetup.getUser(supplierAdminId,true);
paymentSetup.createPaymentForSupplier(basicSetup.getPlatformOperatorUserKey(),supplierAdmin.getKey(),supplier);
container.login(supplierAdmin.getKey(),ROLE_SERVICE_MANAGER,ROLE_TECHNOLOGY_MANAGER);
serviceSetup.importTechnicalServices(BaseAdmUmTest.TECHNICAL_SERVICE_EXAMPLE2_ASYNC_XML);
VOTechnicalService example2TechService=serviceSetup.getTechnicalService(VOTechServiceFactory.TECH_SERVICE_EXAMPLE2_ASYNC_ID);
setCutOffDay(supplierAdmin.getKey(),1);
String customerAdminId="Pict11DiscountedCustomer";
VOOrganization customer=orgSetup.registerCustomer("Pict11DiscountedCustomerOrg",TestOrganizationSetup.ORGANIZATION_DOMICILE_UK,customerAdminId,supplierMarketplace.getMarketplaceId(),supplier.getOrganizationId());
VOUser customerAdmin=orgSetup.getUser(customerAdminId,true);
orgSetup.updateCustomerDiscount(customer,new BigDecimal("10.00"),DateTimeHandling.calculateMillis("2013-08-02 00:00:00"),DateTimeHandling.calculateMillis("2013-08-12 00:00:00"));
orgSetup.saveAllVats(supplierAdmin.getKey(),VOVatRateFactory.newVOVatRate(new BigDecimal("13.00")),Arrays.asList(VOVatRateFactory.newVOCountryVatRate(new BigDecimal("20.00"),TestOrganizationSetup.ORGANIZATION_DOMICILE_UK),VOVatRateFactory.newVOCountryVatRate(new BigDecimal("19.00"),TestOrganizationSetup.ORGANIZATION_DOMICILE_DE)),null);
orgSetup.createMarketingPermission(supplierAdmin.getKey(),supplier.getOrganizationId(),example2TechService);
VOServiceDetails unitServTemplate=serviceSetup.createAndPublishMarketableService(supplierAdmin.getKey(),"PICT11_UNIT_WEEK_SERVICE",TestService.EXAMPLE2_ASYNC,TestPriceModel.FREE,example2TechService,supplierMarketplace);
VOServiceDetails serviceUnitDetails=serviceSetup.savePriceModelForCustomer(unitServTemplate,TestPriceModel.EXAMPLE_PICT11_UNIT_WEEK,customer);
VOServiceDetails freeTemplate=serviceSetup.createAndPublishMarketableService(supplierAdmin.getKey(),"PICT11_FREE",TestService.EXAMPLE2_ASYNC,TestPriceModel.EXAMPLE_PICT11_UNIT_WEEK,example2TechService,supplierMarketplace);
VOServiceDetails serviceFreeDetails=serviceSetup.savePriceModelForCustomer(freeTemplate,TestPriceModel.FREE,customer);
VOServiceDetails unitServTemplate2=serviceSetup.createAndPublishMarketableService(supplierAdmin.getKey(),"PICT11_2_UNIT_MONTH_SERVICE",TestService.EXAMPLE2_ASYNC,TestPriceModel.FREE,example2TechService,supplierMarketplace);
VOServiceDetails serviceUnitDetails2=serviceSetup.savePriceModelForCustomer(unitServTemplate2,TestPriceModel.EXAMPLE_PICT11_2_UNIT_WEEK,customer);
unitServTemplate=serviceSetup.registerCompatibleServices(supplierAdmin.getKey(),unitServTemplate,freeTemplate);
freeTemplate=serviceSetup.registerCompatibleServices(supplierAdmin.getKey(),freeTemplate,unitServTemplate2);
serviceUnitDetails=serviceSetup.activateMarketableService(serviceUnitDetails);
serviceFreeDetails=serviceSetup.activateMarketableService(serviceFreeDetails);
serviceUnitDetails2=serviceSetup.activateMarketableService(serviceUnitDetails2);
VORoleDefinition role=VOServiceFactory.getRole(serviceUnitDetails,"USER");
serviceUnitDetails=serviceSetup.getServiceDetails(supplierAdmin.getKey(),serviceUnitDetails);
container.login(customerAdmin.getKey(),ROLE_ORGANIZATION_ADMIN);
VOSubscriptionDetails subDetails=subscrSetup.subscribeToService("PICT_TEST_11",serviceUnitDetails,customerAdmin,role);
BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-08-01 00:00:00"));
subDetails=subscrSetup.completeAsyncSubscription(supplierAdmin.getKey(),customerAdmin,subDetails);
container.login(customerAdmin.getKey(),ROLE_ORGANIZATION_ADMIN);
subDetails=subscrSetup.modifyParameterForSubscription(subDetails,DateTimeHandling.calculateMillis("2013-08-01 00:30:00"),"BOOLEAN_PARAMETER","true");
BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-08-01 01:00:00"));
subDetails=subscrSetup.completeAsyncModifySubscription(supplierAdmin.getKey(),customerAdmin,subDetails);
BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-08-01 01:00:01"));
container.login(customerAdmin.getKey(),ROLE_ORGANIZATION_ADMIN);
VOSubscriptionDetails subDetailsOld=subDetails;
subDetails.setSubscriptionId("PICT_TEST_11" + "_SubID2");
subDetails=subscrSetup.modifySubscription(subDetails,null);
BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-08-01 01:00:01"));
subDetails=subscrSetup.completeAsyncModifySubscription(supplierAdmin.getKey(),customerAdmin,subDetailsOld);
container.login(customerAdmin.getKey(),ROLE_ORGANIZATION_ADMIN);
long roleChangeTime=DateTimeHandling.calculateMillis("2013-08-01 02:00:00");
BillingIntegrationTestBase.setDateFactoryInstance(roleChangeTime);
subDetails=subscrSetup.modifyUserRole(subDetails.getUsageLicenses().get(0),VOServiceFactory.getRole(serviceUnitDetails,"ADMIN"),subDetails.getSubscriptionId());
BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-08-01 02:00:00"));
container.login(supplierAdmin.getKey(),ROLE_SERVICE_MANAGER);
paymentSetup.deleteCustomerPaymentTypes(customer);
BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-08-01 03:00:00"));
paymentSetup.reassignCustomerPaymentTypes(customer);
subDetails=subscrSetup.getSubscriptionDetails(customerAdmin.getKey(),subDetails.getSubscriptionId());
container.login(supplierAdmin.getKey(),ROLE_SERVICE_MANAGER);
BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-08-12 12:00:00"));
paymentSetup.reassignCustomerPaymentTypes(customer);
subDetails=subscrSetup.getSubscriptionDetails(customerAdmin.getKey(),subDetails.getSubscriptionId());
container.login(supplierAdmin.getKey(),ROLE_SERVICE_MANAGER,ROLE_TECHNOLOGY_MANAGER);
subscrSetup.recordEventForSubscription(subDetails,DateTimeHandling.calculateMillis("2013-08-12 12:30:00"),"FILE_UPLOAD",10);
container.login(customerAdmin.getKey(),ROLE_ORGANIZATION_ADMIN);
subDetails=subscrSetup.modifyParameterForSubscription(subDetails,DateTimeHandling.calculateMillis("2013-08-12 15:00:00"),"BOOLEAN_PARAMETER","false");
BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-08-13 00:00:00"));
subDetails=subscrSetup.completeAsyncModifySubscription(supplierAdmin.getKey(),customerAdmin,subDetails);
container.login(customerAdmin.getKey(),ROLE_ORGANIZATION_ADMIN);
subDetails=subscrSetup.modifyParameterForSubscription(subDetails,DateTimeHandling.calculateMillis("2013-08-13 12:00:00"),"BOOLEAN_PARAMETER","true");
BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-08-14 00:00:00"));
subDetails=subscrSetup.completeAsyncModifySubscription(supplierAdmin.getKey(),customerAdmin,subDetails);
container.login(supplierAdmin.getKey(),ROLE_SERVICE_MANAGER);
BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-08-14 01:00:00"));
VOPriceModel newSubPriceModel=VOPriceModelFactory.modifyPriceModelPeriodFee(subDetails.getPriceModel(),new BigDecimal("4.00"));
subscrSetup.savePriceModelForSubscription(supplierAdmin.getKey(),subDetails,newSubPriceModel,customer);
container.login(customerAdmin.getKey(),ROLE_ORGANIZATION_ADMIN);
BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-08-14 02:00:00"));
subDetails=subscrSetup.modifyUserRole(subDetails.getUsageLicenses().get(0),VOServiceFactory.getRole(serviceUnitDetails,"USER"),subDetails.getSubscriptionId());
serviceFreeDetails=serviceSetup.getServiceDetails(supplierAdmin.getKey(),serviceFreeDetails);
container.login(customerAdmin.getKey(),ROLE_ORGANIZATION_ADMIN);
BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-08-14 23:00:00"));
VOSubscriptionDetails upgradedSubDetails=subscrSetup.upgradeSubscription(subDetails,serviceFreeDetails);
BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-08-15 00:00:00"));
upgradedSubDetails=subscrSetup.completeAsyncUpgradeSubscription(supplierAdmin.getKey(),customerAdmin,upgradedSubDetails);
container.login(customerAdmin.getKey(),ROLE_ORGANIZATION_ADMIN);
BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-08-19 00:00:00"));
VOSubscriptionDetails upgradedSubDetails2=subscrSetup.upgradeSubscription(upgradedSubDetails,serviceUnitDetails2);
BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-08-20 00:00:00"));
upgradedSubDetails2=subscrSetup.completeAsyncUpgradeSubscription(supplierAdmin.getKey(),customerAdmin,upgradedSubDetails2);
container.login(customerAdmin.getKey(),ROLE_ORGANIZATION_ADMIN);
long userterminateTime=DateTimeHandling.calculateMillis("2013-08-22 00:00:00");
BillingIntegrationTestBase.setDateFactoryInstance(userterminateTime);
subscrSetup.unsubscribeToService(upgradedSubDetails2.getSubscriptionId());
resetCutOffDay(supplierAdmin.getKey());
BillingIntegrationTestBase.updateSubscriptionListForTests("PICT_TEST_11",subDetails);
BillingIntegrationTestBase.updateSubscriptionListForTests("PICT_TEST_11",upgradedSubDetails);
BillingIntegrationTestBase.updateSubscriptionListForTests("PICT_TEST_11",upgradedSubDetails2);
BillingIntegrationTestBase.updateCustomerListForTests("PICT_TEST_11",customer);
}
| See testcase #11 in BESBillingFactorCombinations.xlsx |
protected String loadSourceCode(URL sourceUrl){
InputStreamReader isr=null;
CodeStyler cv=new CodeStyler();
String styledCode="<html><body bgcolor=\"#ffffff\"><pre>";
try {
isr=new InputStreamReader(sourceUrl.openStream(),"UTF-8");
BufferedReader reader=new BufferedReader(isr);
String line=reader.readLine();
while (line != null) {
styledCode+=cv.syntaxHighlight(line) + " \n ";
line=reader.readLine();
}
styledCode+="</pre></body></html>";
}
catch ( Exception ex) {
ex.printStackTrace();
return "Could not load file from: " + sourceUrl;
}
finally {
if (isr != null) {
try {
isr.close();
}
catch ( IOException e) {
System.err.println(e);
}
}
}
return styledCode;
}
| Reads the java source file at the specified URL and returns an HTML version stylized for display |
public static DateFormat toDateTimeFormat(String dateTimeFormat,TimeZone tz,Locale locale){
DateFormat df=null;
if (UtilValidate.isEmpty(dateTimeFormat)) {
df=DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.MEDIUM,locale);
}
else {
df=new SimpleDateFormat(dateTimeFormat,locale == null ? Locale.getDefault() : locale);
}
df.setTimeZone(tz);
return df;
}
| Returns an initialized DateFormat object. |
public void flushBuffer() throws IOException {
log.debug("flush buffer @ CompressionServletResponseWrapper");
((CompressionResponseStream)stream).flush();
}
| Flush the buffer and commit this response. |
public static double isLeftOfLine(Coordinate c0,Coordinate c1,Coordinate c2){
return (c2.x - c1.x) * (c0.y - c1.y) - (c0.x - c1.x) * (c2.y - c1.y);
}
| tests whether coordinate c0 is located left of the infinite vector that runs through c1 and c2 |
public SaturationFilter(float amount){
this.amount=amount;
canFilterIndexColorModel=true;
}
| Construct a SaturationFilter. The amount of saturation change. |
public JythonScript(Document doc){
super(doc);
}
| Initializes the script. |
public int v1(){
return v1;
}
| Returns the first element (integer). |
private void deleteStorePath(){
FileFactory.FileType fileType=FileFactory.getFileType(this.hdfsStorePath);
CarbonFile carbonFile=FileFactory.getCarbonFile(this.hdfsStorePath,fileType);
deleteRecursiveSilent(carbonFile);
}
| this method will delete the store path |
public Object runSafely(Catbert.FastStack stack) throws Exception {
String s=getString(stack);
PseudoMenu currUI=(stack.getUIMgrSafe() == null) ? null : stack.getUIMgrSafe().getCurrUI();
if (currUI != null) currUI.repaintByWidgetName(s);
return null;
}
| Finds the Widget on the current menu who's name matches the argument and then redraws all UI elements, and their children for this Widget |
public static PsiClass findClass(PsiElement element){
return (element instanceof PsiClass) ? (PsiClass)element : PsiTreeUtil.getParentOfType(element,PsiClass.class);
}
| Returns the parent class of element. If element is a class, it returns element. If element is null, it returns null. |
public TDoubleHashSet(int initialCapacity){
super(initialCapacity);
}
| Creates a new <code>TDoubleHashSet</code> instance with a prime capacity equal to or greater than <tt>initialCapacity</tt> and with the default load factor. |
public static CWindowManager instance(){
return m_instance;
}
| Returns the only valid instance of the window manager class. |
@SideEffectFree public XMLStreamException(@Nullable String msg,Location location){
super("ParseError at [row,col]:[" + location.getLineNumber() + ","+ location.getColumnNumber()+ "]\n"+ "Message: "+ msg);
this.location=location;
}
| Construct an exception with the assocated message, exception and location. |
private boolean hasTargetConnection(){
return (this.target != null);
}
| Return whether the proxy currently holds a target Connection. |
public TemporalOMGraphicList(List<OMGraphic> list){
super(list);
}
| Construct an TemporalOMGraphicList around a List of OMGraphics. The TemporalOMGraphicList assumes that all the objects on the list are OMGraphics, and never does checking. Live with the consequences if you put other stuff in there. |
public XmlChecker(){
m_domParser=null;
m_onlyCheckValidity=true;
m_infoMsg=null;
m_valid=true;
}
| Construye un objeto de la clase. |
public boolean isDeclaredProvidedByRuntime(){
return declaredProvidedByRuntime;
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
protected static void validateDocuments(Map documents) throws ValidationException {
if (documents != null) {
for (Iterator itDoc=documents.keySet().iterator(); itDoc.hasNext(); ) {
String key=(String)itDoc.next();
FlushFdrDocument document=(FlushFdrDocument)documents.get(key);
if (document.getDocumentName().length() > 32) {
if (log.isDebugEnabled()) {
log.debug("Error en la longitud del nombre del documento [" + document.getDocumentName() + "]");
}
throw new ValidationException(ValidationException.ERROR_DOCUMENT_NAME_LENGTH);
}
validatePagesDocument(document.getPages());
}
}
}
| Metodo que valida los documentos |
public static MockMotor runningMotor(double speed){
return new MockMotor(speed);
}
| Create a running mock motor. |
private void processStart(final State current){
try {
if (!isFinalStage(current)) {
TaskUtils.sendSelfPatch(this,buildPatch(current.taskState.stage,null));
}
}
catch ( Throwable e) {
failTask(e);
}
}
| Does any additional processing after the start operation has been completed. |
@Override public BlockConsistencyGroupBulkRep queryBulkResourceReps(final List<URI> ids){
Iterator<BlockConsistencyGroup> _dbIterator=_dbClient.queryIterativeObjects(getResourceClass(),ids);
return new BlockConsistencyGroupBulkRep(BulkList.wrapping(_dbIterator,MapBlockConsistencyGroup.getInstance(_dbClient)));
}
| Retrieve volume representations based on input ids. |
public void runTest() throws Throwable {
Document doc;
NodeList testList;
Node commentNode;
String commentNodeName;
int nodeType;
doc=(Document)load("hc_staff",false);
testList=doc.getChildNodes();
for (int indexN10040=0; indexN10040 < testList.getLength(); indexN10040++) {
commentNode=(Node)testList.item(indexN10040);
commentNodeName=commentNode.getNodeName();
if (equals("#comment",commentNodeName)) {
nodeType=(int)commentNode.getNodeType();
assertEquals("existingCommentNodeType",8,nodeType);
}
}
commentNode=doc.createComment("This is a comment");
nodeType=(int)commentNode.getNodeType();
assertEquals("createdCommentNodeType",8,nodeType);
}
| Runs the test case. |
public AVTPartSimple(String val){
m_val=val;
}
| Construct a simple AVT part. |
private void formatCheck(Formatter formatter) throws IOException {
List<File> problemFiles=new ArrayList<>();
for ( File file : target) {
getLogger().debug("Checking format on " + file);
if (!formatter.isClean(file)) {
problemFiles.add(file);
}
}
if (paddedCell) {
PaddedCellTaskMisc.check(this,formatter,problemFiles);
}
else {
if (!problemFiles.isEmpty()) {
if (PaddedCellTaskMisc.anyMisbehave(formatter,problemFiles)) {
throw PaddedCellTaskMisc.youShouldTurnOnPaddedCell(this);
}
else {
throw formatViolationsFor(formatter,problemFiles);
}
}
}
}
| Checks the format. |
private static void generateGraph(IDataProcessStatus schmaModel,SchemaInfo info,String tableName,String partitionID,CarbonDataLoadSchema schema,String factStoreLocation,int currentRestructNumber,List<LoadMetadataDetails> loadMetadataDetails) throws GraphGeneratorException {
DataLoadModel model=new DataLoadModel();
model.setCsvLoad(null != schmaModel.getCsvFilePath() || null != schmaModel.getFilesToProcess());
model.setSchemaInfo(info);
model.setTableName(schmaModel.getTableName());
model.setTaskNo("1");
model.setBlocksID(schmaModel.getBlocksID());
model.setFactTimeStamp(readCurrentTime());
model.setEscapeCharacter(schmaModel.getEscapeCharacter());
if (null != loadMetadataDetails && !loadMetadataDetails.isEmpty()) {
model.setLoadNames(CarbonDataProcessorUtil.getLoadNameFromLoadMetaDataDetails(loadMetadataDetails));
model.setModificationOrDeletionTime(CarbonDataProcessorUtil.getModificationOrDeletionTimesFromLoadMetadataDetails(loadMetadataDetails));
}
boolean hdfsReadMode=schmaModel.getCsvFilePath() != null && schmaModel.getCsvFilePath().startsWith("hdfs:");
int allocate=null != schmaModel.getCsvFilePath() ? 1 : schmaModel.getFilesToProcess().size();
String outputLocation=CarbonProperties.getInstance().getProperty("store_output_location","../carbon-store/system/carbon/etl");
GraphGenerator generator=new GraphGenerator(model,hdfsReadMode,partitionID,factStoreLocation,currentRestructNumber,allocate,schema,"0",outputLocation);
generator.generateGraph();
}
| generate graph |
public String globalInfo(){
return "Simple plain text format that places one statistcs result per line, as tab-separated " + "key-value pairs (separated by '=').";
}
| Description to be displayed in the GUI. |
public void accept(IBalancedVisitor<K,V> visitor){
if (root == null) return;
accept(null,root,visitor);
}
| Accept a visitor for a inorder traversal. |
public static void copyFolder(File srcFolder,File destFolder) throws CoreException, IOException {
for ( File file : srcFolder.listFiles()) {
if (file.isDirectory()) {
copyFolder(file,new File(destFolder.getAbsolutePath() + File.separator + file.getName()));
}
else {
ResourceUtils.copyFile(file,new File(destFolder.getAbsolutePath() + File.separator + file.getName()));
}
}
}
| Copies all the contents of srcFolder to destFolder. |
public String addStepsForMigrateVolumes(Workflow workflow,URI vplexURI,URI virtualVolumeURI,List<URI> targetVolumeURIs,Map<URI,URI> migrationsMap,Map<URI,URI> poolVolumeMap,URI newVpoolURI,URI newVarrayURI,boolean suspendBeforeCommit,boolean suspendBeforeDeleteSource,String opId,String waitFor) throws InternalException {
try {
_log.info("VPlex controller migrate volume {} on VPlex {}",virtualVolumeURI,vplexURI);
String volumeUserLabel="Label Unknown";
Volume virtualVolume=getDataObject(Volume.class,virtualVolumeURI,_dbClient);
if (virtualVolume != null && virtualVolume.getDeviceLabel() != null && virtualVolume.getLabel() != null) {
volumeUserLabel=virtualVolume.getLabel() + " (" + virtualVolume.getDeviceLabel()+ ")";
}
StorageSystem vplexSystem=getDataObject(StorageSystem.class,vplexURI,_dbClient);
_log.info("Got VPlex system");
waitFor=createWorkflowStepToValidateVPlexVolume(workflow,vplexSystem,virtualVolumeURI,waitFor);
Map<URI,Volume> volumeMap=new HashMap<URI,Volume>();
Map<URI,StorageSystem> storageSystemMap=new HashMap<URI,StorageSystem>();
for ( URI volumeURI : targetVolumeURIs) {
Volume volume=getDataObject(Volume.class,volumeURI,_dbClient);
volumeMap.put(volumeURI,volume);
StorageSystem storageSystem=getDataObject(StorageSystem.class,volume.getStorageController(),_dbClient);
storageSystemMap.put(volume.getStorageController(),storageSystem);
}
Volume firstVolume=volumeMap.values().iterator().next();
Project vplexProject=VPlexUtil.lookupVplexProject(firstVolume,vplexSystem,_dbClient);
URI tenantURI=vplexProject.getTenantOrg().getURI();
_log.info("Project is {}, Tenant is {}",vplexProject.getId(),tenantURI);
waitFor=createWorkflowStepsForBlockVolumeExport(workflow,vplexSystem,storageSystemMap,volumeMap,vplexProject.getId(),tenantURI,waitFor);
_log.info("Created workflow steps for volume export.");
Iterator<URI> targetVolumeIter=targetVolumeURIs.iterator();
while (targetVolumeIter.hasNext()) {
URI targetVolumeURI=targetVolumeIter.next();
_log.info("Target volume is {}",targetVolumeURI);
URI migrationURI=migrationsMap.get(targetVolumeURI);
_log.info("Migration is {}",migrationURI);
String stepId=workflow.createStepId();
_log.info("Migration opId is {}",stepId);
Workflow.Method vplexExecuteMethod=new Workflow.Method(MIGRATE_VIRTUAL_VOLUME_METHOD_NAME,vplexURI,virtualVolumeURI,targetVolumeURI,migrationURI,newVarrayURI);
Workflow.Method vplexRollbackMethod=new Workflow.Method(RB_MIGRATE_VIRTUAL_VOLUME_METHOD_NAME,vplexURI,migrationURI,stepId);
_log.info("Creating workflow migration step");
workflow.createStep(MIGRATION_CREATE_STEP,String.format("VPlex %s migrating volume",vplexSystem.getId().toString()),waitFor,vplexSystem.getId(),vplexSystem.getSystemType(),getClass(),vplexExecuteMethod,vplexRollbackMethod,stepId);
_log.info("Created workflow migration step");
}
String waitForStep=MIGRATION_CREATE_STEP;
List<URI> migrationURIs=new ArrayList<URI>(migrationsMap.values());
List<URI> migrationSources=new ArrayList<URI>();
Iterator<URI> migrationsIter=migrationsMap.values().iterator();
while (migrationsIter.hasNext()) {
URI migrationURI=migrationsIter.next();
_log.info("Migration is {}",migrationURI);
Migration migration=getDataObject(Migration.class,migrationURI,_dbClient);
Boolean rename=Boolean.TRUE;
if (migration.getSource() != null) {
migrationSources.add(migration.getSource());
}
else {
rename=Boolean.FALSE;
}
_log.info("Added migration source {}",migration.getSource());
String stepId=workflow.createStepId();
_log.info("Commit operation id is {}",stepId);
Workflow.Method vplexExecuteMethod=new Workflow.Method(COMMIT_MIGRATION_METHOD_NAME,vplexURI,virtualVolumeURI,migrationURI,rename,newVpoolURI,newVarrayURI);
Workflow.Method vplexRollbackMethod=new Workflow.Method(RB_COMMIT_MIGRATION_METHOD_NAME,migrationURIs,newVpoolURI,newVarrayURI,stepId);
_log.info("Creating workflow step to commit migration");
String stepDescription=String.format("migration commit step on VPLEX %s of volume %s",vplexSystem.getSerialNumber(),volumeUserLabel);
waitForStep=workflow.createStep(MIGRATION_COMMIT_STEP,stepDescription,waitForStep,vplexSystem.getId(),vplexSystem.getSystemType(),getClass(),vplexExecuteMethod,vplexRollbackMethod,suspendBeforeCommit,stepId);
workflow.setSuspendedStepMessage(stepId,COMMIT_MIGRATION_SUSPEND_MESSAGE);
_log.info("Created workflow step to commit migration");
}
String stepId=workflow.createStepId();
Workflow.Method vplexExecuteMethod=new Workflow.Method(DELETE_MIGRATION_SOURCES_METHOD,vplexURI,virtualVolumeURI,newVpoolURI,newVarrayURI,migrationSources);
List<String> migrationSourceLabels=new ArrayList<>();
Iterator<Volume> volumeIter=_dbClient.queryIterativeObjects(Volume.class,migrationSources);
while (volumeIter.hasNext()) {
migrationSourceLabels.add(volumeIter.next().getNativeGuid());
}
String stepDescription=String.format("post-migration delete of original source backing volumes [%s] associated with virtual volume %s",Joiner.on(',').join(migrationSourceLabels),volumeUserLabel);
workflow.createStep(DELETE_MIGRATION_SOURCES_STEP,stepDescription,waitForStep,vplexSystem.getId(),vplexSystem.getSystemType(),getClass(),vplexExecuteMethod,null,suspendBeforeDeleteSource,stepId);
workflow.setSuspendedStepMessage(stepId,DELETE_MIGRATION_SOURCES_SUSPEND_MESSAGE);
_log.info("Created workflow step to create sub workflow for source deletion");
return DELETE_MIGRATION_SOURCES_STEP;
}
catch ( Exception e) {
throw VPlexApiException.exceptions.addStepsForChangeVirtualPoolFailed(e);
}
}
| Adds steps in the passed workflow to migrate a volume. |
public void removeDragSourceMotionListener(DragSourceMotionListener dsml){
if (dsml != null) {
synchronized (this) {
motionListener=DnDEventMulticaster.remove(motionListener,dsml);
}
}
}
| Removes the specified <code>DragSourceMotionListener</code> from this <code>DragSource</code>. If a <code>null</code> listener is specified, no action is taken and no exception is thrown. If the listener specified by the argument was not previously added to this <code>DragSource</code>, no action is taken and no exception is thrown. |
public static Box computeBoundingBox(Iterable<? extends Vec4> points){
if (points == null) {
String msg=Logging.getMessage("nullValue.PointListIsNull");
Logging.logger().severe(msg);
throw new IllegalArgumentException(msg);
}
Vec4[] axes=WWMath.computePrincipalAxes(points);
if (axes == null) {
String msg=Logging.getMessage("generic.ListIsEmpty");
Logging.logger().severe(msg);
throw new IllegalArgumentException(msg);
}
Vec4 r=axes[0];
Vec4 s=axes[1];
Vec4 t=axes[2];
double minDotR=Double.MAX_VALUE;
double maxDotR=-minDotR;
double minDotS=Double.MAX_VALUE;
double maxDotS=-minDotS;
double minDotT=Double.MAX_VALUE;
double maxDotT=-minDotT;
for ( Vec4 p : points) {
if (p == null) continue;
double pdr=p.dot3(r);
if (pdr < minDotR) minDotR=pdr;
if (pdr > maxDotR) maxDotR=pdr;
double pds=p.dot3(s);
if (pds < minDotS) minDotS=pds;
if (pds > maxDotS) maxDotS=pds;
double pdt=p.dot3(t);
if (pdt < minDotT) minDotT=pdt;
if (pdt > maxDotT) maxDotT=pdt;
}
if (maxDotR == minDotR) maxDotR=minDotR + 1;
if (maxDotS == minDotS) maxDotS=minDotS + 1;
if (maxDotT == minDotT) maxDotT=minDotT + 1;
return new Box(axes,minDotR,maxDotR,minDotS,maxDotS,minDotT,maxDotT);
}
| Compute a <code>Box</code> that bounds a specified list of points. Principal axes are computed for the points and used to form a <code>Box</code>. |
public void bindAllArgsAsStrings(String[] bindArgs){
if (bindArgs != null) {
for (int i=bindArgs.length; i != 0; i--) {
bindString(i,bindArgs[i - 1]);
}
}
}
| Given an array of String bindArgs, this method binds all of them in one single call. |
private void updateProgress(String progressLabel,int progress){
if (myHost != null && ((progress != previousProgress) || (!progressLabel.equals(previousProgressLabel)))) {
myHost.updateProgress(progressLabel,progress);
}
previousProgress=progress;
previousProgressLabel=progressLabel;
}
| Used to communicate a progress update between a plugin tool and the main Whitebox user interface. |
@Override protected void keyTyped(char par1,int par2){
if (par2 == 28 || par2 == 156) actionPerformed((GuiButton)buttonList.get(0));
}
| Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). |
public boolean isValidAction(String action){
String[] options=getActionOptions();
for (int i=0; i < options.length; i++) {
if (options[i].equals(action)) return true;
}
return false;
}
| Is The Action Valid based on current state |
public static <T,A>ReaderTValue<T,A> of(final AnyMValue<Reader<T,A>> monads){
return new ReaderTValue<>(monads);
}
| Construct an MaybeT from an AnyM that wraps a monad containing Maybes |
@Override public Object createSerializableMapKeyInfo(Object key,AbstractSession session){
return key;
}
| INTERNAL: Creates the Array of simple types used to recreate this map. |
public Complex(double real,double imag){
re=real;
im=imag;
}
| Initializes a complex number from the specified real and imaginary parts. |
public EsriPolylineMList(int initialCapacity){
super(initialCapacity);
}
| Construct an EsriPolylineList with an initial capacity. |
public void runTest() throws Throwable {
Document doc;
NodeList elementList;
Node nameNode;
CharacterData child;
String childData;
doc=(Document)load("staff",true);
elementList=doc.getElementsByTagName("name");
nameNode=elementList.item(0);
child=(CharacterData)nameNode.getFirstChild();
child.insertData(0,"Mss. ");
childData=child.getData();
assertEquals("characterdataInsertDataBeginningAssert","Mss. Margaret Martin",childData);
}
| Runs the test case. |
public void close(){
if (file != null) {
try {
trace("close",name,file);
file.close();
}
catch ( IOException e) {
throw DbException.convertIOException(e,name);
}
finally {
file=null;
}
}
}
| Close the file. |
public String post(String request,String content) throws IOException {
HttpPost httpPost=new HttpPost(getBaseURL() + request);
httpPost.setEntity(new StringEntity(content,ContentType.create("application/json",StandardCharsets.UTF_8)));
return getResponse(httpPost);
}
| Processes a POST request using a URL path (with no context path) + optional query params, e.g. "/schema/fields/newfield", PUTs the given content, and returns the response content. |
private void clearCachedValues(){
cachedTemplateNumberFormats=null;
cachedTemplateNumberFormat=null;
cachedTempDateFormatArray=null;
cachedTempDateFormatsByFmtStrArray=null;
cachedCollator=null;
cachedURLEscapingCharset=null;
cachedURLEscapingCharsetSet=false;
}
| Deletes cached values that meant to be valid only during a single template execution. |
private static List<BillingResult> createBillingResults(){
createBillingResultDataMock();
billingResults=new LinkedList<BillingResult>();
for (long subscriptionKey=1; subscriptionKey <= NUMBER_SUBSCRIPTIONS; subscriptionKey++) {
BillingResult billingResult=new BillingResult();
billingResult.setKey(10000 + subscriptionKey);
billingResult.setSubscriptionKey(subscriptionKey);
billingResult.setCurrency(new SupportedCurrency(billingResultDataMock.get(subscriptionKey).currencyCode));
billingResult.setNetAmount(billingResultDataMock.get(subscriptionKey).netAmount);
billingResults.add(billingResult);
}
return billingResults;
}
| Output of the first run |
public double entropyConditionalFirst(){
return (entropyJoint() - entropySecond());
}
| Get the conditional entropy of the first clustering. (not normalized, 0 = equal) |
public static void dispatchSocketTimeout(final boolean forceCloseSocket,final List<ISpeedTestListener> listenerList,final boolean isDownload,final String errorMessage){
if (!forceCloseSocket) {
if (isDownload) {
for (int i=0; i < listenerList.size(); i++) {
listenerList.get(i).onDownloadError(SpeedTestError.SOCKET_TIMEOUT,errorMessage);
}
}
else {
for (int i=0; i < listenerList.size(); i++) {
listenerList.get(i).onUploadError(SpeedTestError.SOCKET_TIMEOUT,errorMessage);
}
}
}
}
| dispatch socket timeout error. |
public static void checkTimestamp(Timestamp expected,IonValue actual){
checkType(IonType.TIMESTAMP,actual);
IonTimestamp v=(IonTimestamp)actual;
Timestamp actualTime=v.timestampValue();
if (expected == null) {
assertTrue("expected null value",v.isNullValue());
assertNull(actualTime);
}
else {
assertEquals("timestamp",expected,actualTime);
assertEquals("timestamp content",expected.toString(),actualTime.toString());
}
}
| Checks that the value is an IonTimestamp with the given value. |
protected void read(UCharacterProperty ucharppty) throws IOException {
int count=INDEX_SIZE_;
m_propertyOffset_=m_dataInputStream_.readInt();
count--;
m_exceptionOffset_=m_dataInputStream_.readInt();
count--;
m_caseOffset_=m_dataInputStream_.readInt();
count--;
m_additionalOffset_=m_dataInputStream_.readInt();
count--;
m_additionalVectorsOffset_=m_dataInputStream_.readInt();
count--;
m_additionalColumnsCount_=m_dataInputStream_.readInt();
count--;
m_reservedOffset_=m_dataInputStream_.readInt();
count--;
m_dataInputStream_.skipBytes(3 << 2);
count-=3;
ucharppty.m_maxBlockScriptValue_=m_dataInputStream_.readInt();
count--;
ucharppty.m_maxJTGValue_=m_dataInputStream_.readInt();
count--;
m_dataInputStream_.skipBytes(count << 2);
ucharppty.m_trie_=new CharTrie(m_dataInputStream_,null);
int size=m_exceptionOffset_ - m_propertyOffset_;
m_dataInputStream_.skipBytes(size * 4);
size=m_caseOffset_ - m_exceptionOffset_;
m_dataInputStream_.skipBytes(size * 4);
size=(m_additionalOffset_ - m_caseOffset_) << 1;
m_dataInputStream_.skipBytes(size * 2);
if (m_additionalColumnsCount_ > 0) {
ucharppty.m_additionalTrie_=new CharTrie(m_dataInputStream_,null);
size=m_reservedOffset_ - m_additionalVectorsOffset_;
ucharppty.m_additionalVectors_=new int[size];
for (int i=0; i < size; i++) {
ucharppty.m_additionalVectors_[i]=m_dataInputStream_.readInt();
}
}
m_dataInputStream_.close();
ucharppty.m_additionalColumnsCount_=m_additionalColumnsCount_;
ucharppty.m_unicodeVersion_=VersionInfo.getInstance((int)m_unicodeVersion_[0],(int)m_unicodeVersion_[1],(int)m_unicodeVersion_[2],(int)m_unicodeVersion_[3]);
}
| <p>Reads uprops.icu, parse it into blocks of data to be stored in UCharacterProperty.</P |
public LogStreamMerger(LogRequest req,LogSvcPropertiesLoader propertiesLoader){
logger.trace("LogStreamMerger()");
this.request=req;
LogFileFinder fileFinder=new LogFileFinder(propertiesLoader.getLogFilePaths(),propertiesLoader.getExcludedLogFilePaths());
Map<String,List<File>> groupedLogFiles=fileFinder.findFilesGroupedByBaseName();
List<String> groups=req.getBaseNames();
if (groups == null || groups.isEmpty()) {
groups=new ArrayList<>(groupedLogFiles.keySet());
}
logger.debug("log names: {}",groups);
if (groups.retainAll(groupedLogFiles.keySet())) {
logger.info("log names after filter: {}",groups);
}
int size=groups.size();
logStreamList=new LogFileStream[size];
logHeads=new LogMessage[size];
for (int i=0; i < size; i++) {
String service=groups.get(i);
logStreamList[i]=new LogFileStream(service,groupedLogFiles.get(service),req,status);
logHeads[i]=null;
}
}
| Merges all logs on this node based on time stamp |
public static void load(final AbstractSQLProvider provider,final INaviView view,final List<INaviViewNode> nodes,final List<? extends INaviModule> modules) throws SQLException, CPartialLoadException {
Preconditions.checkNotNull(provider,"Error: provider argument can not be null");
Preconditions.checkNotNull(view,"Error: view argument can not be null");
Preconditions.checkNotNull(nodes,"Error: nodes argument can not be null");
Preconditions.checkNotNull(modules,"Error: modules argument can not be null");
final String query=" SELECT * FROM load_code_nodes(?) ";
final PreparedStatement statement=provider.getConnection().getConnection().prepareStatement(query,ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
statement.setInt(1,view.getConfiguration().getId());
final ResultSet resultSet=statement.executeQuery();
try {
final CCodeNodeParser parser=new CCodeNodeParser(new SqlCodeNodeProvider(resultSet),modules,provider);
nodes.addAll(parser.parse());
}
catch ( final ParserException e) {
CUtilityFunctions.logException(e);
}
finally {
resultSet.close();
}
}
| Loads the code nodes of a view. |
static void FindPfStepTokens(Token[][] toks){
for (int k=0; k < toks.length; k++) {
Token[] input=toks[k];
Vector outputVec=new Vector(input.length);
int i=0;
while (i < input.length) {
if ((i < input.length - 2) && (input[i].string.equals("<")) && (input[i + 1].column == input[i].column + 1)&& (input[i + 1].type == NUMBER)&& (input[i + 2].string.equals(">"))&& (input[i + 2].column == input[i + 1].column + input[i + 1].getWidth())) {
int numOfToks=3;
boolean needsSpace=true;
String str="<" + input[i + 1].string + ">";
if ((i < input.length - 3) && (input[i + 3].column == input[i + 2].column + 1) && ((input[i + 3].type == NUMBER) || (input[i + 3].type == IDENT))) {
str=str + input[i + 3].string;
numOfToks=4;
if ((i < input.length - 4) && (input[i + 4].column == input[i + 3].column + input[i + 3].getWidth()) && (input[i + 4].string.equals("."))) {
str=str + ".";
numOfToks=5;
}
;
}
;
if ((i < input.length - numOfToks) && (input[i + numOfToks].type == BUILTIN) && ((BuiltInSymbols.GetBuiltInSymbol(input[i + numOfToks].string,true).symbolType == Symbol.INFIX) || (BuiltInSymbols.GetBuiltInSymbol(input[i + numOfToks].string,true).symbolType == Symbol.PUNCTUATION))) {
needsSpace=false;
}
;
outputVec.addElement(new Token.PfStepToken(str,input[i].column,needsSpace));
i=i + numOfToks;
}
else {
outputVec.addElement(input[i]);
i=i + 1;
}
}
;
if (outputVec.size() != input.length) {
toks[k]=new Token[outputVec.size()];
for (i=0; i < outputVec.size(); i++) {
toks[k][i]=(Token)outputVec.elementAt(i);
}
;
}
}
}
| The method FindPfStepTokens replaces each sequence of three to five tokens created by TokenizeSpec for something like "<42>" or "<42>1a." into a single token of type PF_STEP. |
@Override public String toString(){
return value + " " + unit;
}
| Gets the standard string representation for such an object: <code>value " " unit</code> |
public int findRowIndex(String value,String columnName){
return findRowIndex(value,getColumnIndex(columnName));
}
| Return the row that contains the first String that matches. |
@DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-08-13 13:14:22.051 -0400",hash_original_method="F7B998F5AE180E31090E44B8A03A92F7",hash_generated_method="08FF0ED30143F58CAB4DEB62E6201927") @Override public boolean equals(Object obj){
return (obj == this);
}
| Compares this factory with an object. There is only one instance of this class. |
public CModuleConfiguration(final INaviModule module,final SQLProvider provider,final ListenerProvider<IModuleListener> listeners,final int moduleId,final String name,final String comment,final Date creationDate,final Date modificationDate,final String md5,final String sha1,final IAddress fileBase,final IAddress imageBase,final DebuggerTemplate debuggerTemplate,final boolean isStared,final INaviRawModule rawModule){
m_module=module;
m_provider=provider;
m_listeners=listeners;
m_id=moduleId;
m_name=name;
m_description=comment;
m_creationDate=new Date(creationDate.getTime());
m_modificationDate=new Date(modificationDate.getTime());
m_md5=md5;
m_sha1=sha1;
m_fileBase=fileBase;
m_imageBase=imageBase;
m_debuggerTemplate=debuggerTemplate;
m_isStared=isStared;
m_rawModule=rawModule;
updateDebugger(debuggerTemplate);
}
| Creates a new configuration object. |
public static TranBlob createBlob(byte[] bytes){
return new TranBlob(new BlobImpl(bytes),false);
}
| Create a new <tt>Blob</tt>. The returned object will be initially immutable. |
public DailyTimeIntervalScheduleBuilder onDaysOfTheWeek(Integer... onDaysOfWeek){
Set<Integer> daysAsSet=new HashSet<Integer>(12);
Collections.addAll(daysAsSet,onDaysOfWeek);
return onDaysOfTheWeek(daysAsSet);
}
| Set the trigger to fire on the given days of the week. |
public ImmutableMultimap<State,Service> servicesByState(){
return state.servicesByState();
}
| Provides a snapshot of the current state of all the services under management. <p>N.B. This snapshot is guaranteed to be consistent, i.e. the set of states returned will correspond to a point in time view of the services. |
public void removeArchive(final int index){
this.archives.removeArchive(index);
}
| Removes the specified archive from the archive registry. |
public boolean isSetHeader(){
return this.header != null;
}
| Returns true if field header is set (has been assigned a value) and false otherwise |
public static void Init(PcalCharReader charR){
addedLabels=new Vector();
addedLabelsLocs=new Vector();
nextLabelNum=1;
charReader=charR;
allLabels=new Hashtable();
hasLabel=false;
hasDefaultInitialization=false;
currentProcedure=null;
procedures=new Vector();
pSyntax=false;
cSyntax=false;
plusLabels=new Vector(0);
minusLabels=new Vector(0);
proceduresCalled=new Vector(0);
gotoUsed=false;
gotoDoneUsed=false;
omitPC=true;
omitStutteringWhenDone=true;
if (PcalParams.inputVersionNumber < PcalParams.VersionToNumber("1.5")) {
omitPC=false;
omitStutteringWhenDone=false;
}
PcalBuiltInSymbols.Initialize();
AST.ASTInit();
LATsize=0;
}
| This performs the initialization needed by the various Get... methods, including setting charReader. It is called only by GetAlgorithm. It's been made into a separate method for debugging, so the various Get methods can be tested without calling GetAlgorithm. |
public void removeAll(){
ioObjects.clear();
}
| Removes all Objects from this IOContainer. |
static MediaType createAudioType(String subtype){
return create(AUDIO_TYPE,subtype);
}
| Creates a media type with the "audio" type and the given subtype. |
protected IOContext _createContext(Object srcRef,boolean resourceManaged){
return new IOContext(_getBufferRecycler(),srcRef,resourceManaged);
}
| Overridable construction method that actually instantiates desired generator. |
public QueryExpression(){
super();
}
| Create a new QueryExpression. |
protected void parseq() throws ParseException, IOException {
current=reader.read();
skipSpaces();
boolean expectNumber=true;
for (; ; ) {
switch (current) {
default :
if (expectNumber) reportUnexpected(current);
return;
case '+':
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
break;
}
float x1=parseFloat();
skipCommaSpaces();
float y1=parseFloat();
skipCommaSpaces();
float x=parseFloat();
skipCommaSpaces();
float y=parseFloat();
pathHandler.curvetoQuadraticRel(x1,y1,x,y);
expectNumber=skipCommaSpaces2();
}
}
| Parses a 'q' command. |
public Mark popStream(){
if (includeStack.size() <= 0) {
return null;
}
IncludeState state=includeStack.pop();
cursor=state.cursor;
line=state.line;
col=state.col;
fileid=state.fileid;
fileName=state.fileName;
baseDir=state.baseDir;
stream=state.stream;
return this;
}
| /* Restores this mark's state to a previously stored stream. |
public Matrix4d shadow(Vector4dc light,double a,double b,double c,double d){
return shadow(light.x(),light.y(),light.z(),light.w(),a,b,c,d,this);
}
| Apply a projection transformation to this matrix that projects onto the plane specified via the general plane equation <tt>x*a + y*b + z*c + d = 0</tt> as if casting a shadow from a given light position/direction <code>light</code>. <p> If <tt>light.w</tt> is <tt>0.0</tt> the light is being treated as a directional light; if it is <tt>1.0</tt> it is a point light. <p> If <code>M</code> is <code>this</code> matrix and <code>S</code> the shadow matrix, then the new matrix will be <code>M * S</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * S * v</code>, the reflection will be applied first! <p> Reference: <a href="ftp://ftp.sgi.com/opengl/contrib/blythe/advanced99/notes/node192.html">ftp.sgi.com</a> |
private static boolean isGooglePlayServicesLatest(){
return findTextView("Google Play services") == null;
}
| Checks whether the Google Play Services need update. |
public void removeLineHighlight(Object tag){
if (lineHighlightManager != null) {
lineHighlightManager.removeLineHighlight(tag);
}
}
| Removes a line highlight. |
public Ed25519EncodedFieldElement multiplyAndAddModQ(final Ed25519EncodedFieldElement b,final Ed25519EncodedFieldElement c){
final long a0=0x1FFFFF & threeBytesToLong(this.values,0);
final long a1=0x1FFFFF & (fourBytesToLong(this.values,2) >> 5);
final long a2=0x1FFFFF & (threeBytesToLong(this.values,5) >> 2);
final long a3=0x1FFFFF & (fourBytesToLong(this.values,7) >> 7);
final long a4=0x1FFFFF & (fourBytesToLong(this.values,10) >> 4);
final long a5=0x1FFFFF & (threeBytesToLong(this.values,13) >> 1);
final long a6=0x1FFFFF & (fourBytesToLong(this.values,15) >> 6);
final long a7=0x1FFFFF & (threeBytesToLong(this.values,18) >> 3);
final long a8=0x1FFFFF & threeBytesToLong(this.values,21);
final long a9=0x1FFFFF & (fourBytesToLong(this.values,23) >> 5);
final long a10=0x1FFFFF & (threeBytesToLong(this.values,26) >> 2);
final long a11=(fourBytesToLong(this.values,28) >> 7);
final long b0=0x1FFFFF & threeBytesToLong(b.values,0);
final long b1=0x1FFFFF & (fourBytesToLong(b.values,2) >> 5);
final long b2=0x1FFFFF & (threeBytesToLong(b.values,5) >> 2);
final long b3=0x1FFFFF & (fourBytesToLong(b.values,7) >> 7);
final long b4=0x1FFFFF & (fourBytesToLong(b.values,10) >> 4);
final long b5=0x1FFFFF & (threeBytesToLong(b.values,13) >> 1);
final long b6=0x1FFFFF & (fourBytesToLong(b.values,15) >> 6);
final long b7=0x1FFFFF & (threeBytesToLong(b.values,18) >> 3);
final long b8=0x1FFFFF & threeBytesToLong(b.values,21);
final long b9=0x1FFFFF & (fourBytesToLong(b.values,23) >> 5);
final long b10=0x1FFFFF & (threeBytesToLong(b.values,26) >> 2);
final long b11=(fourBytesToLong(b.values,28) >> 7);
final long c0=0x1FFFFF & threeBytesToLong(c.values,0);
final long c1=0x1FFFFF & (fourBytesToLong(c.values,2) >> 5);
final long c2=0x1FFFFF & (threeBytesToLong(c.values,5) >> 2);
final long c3=0x1FFFFF & (fourBytesToLong(c.values,7) >> 7);
final long c4=0x1FFFFF & (fourBytesToLong(c.values,10) >> 4);
final long c5=0x1FFFFF & (threeBytesToLong(c.values,13) >> 1);
final long c6=0x1FFFFF & (fourBytesToLong(c.values,15) >> 6);
final long c7=0x1FFFFF & (threeBytesToLong(c.values,18) >> 3);
final long c8=0x1FFFFF & threeBytesToLong(c.values,21);
final long c9=0x1FFFFF & (fourBytesToLong(c.values,23) >> 5);
final long c10=0x1FFFFF & (threeBytesToLong(c.values,26) >> 2);
final long c11=(fourBytesToLong(c.values,28) >> 7);
long s0;
long s1;
long s2;
long s3;
long s4;
long s5;
long s6;
long s7;
long s8;
long s9;
long s10;
long s11;
long s12;
long s13;
long s14;
long s15;
long s16;
long s17;
long s18;
long s19;
long s20;
long s21;
long s22;
long s23;
long carry0;
long carry1;
long carry2;
long carry3;
long carry4;
long carry5;
long carry6;
long carry7;
long carry8;
long carry9;
long carry10;
long carry11;
long carry12;
long carry13;
long carry14;
long carry15;
long carry16;
final long carry17;
final long carry18;
final long carry19;
final long carry20;
final long carry21;
final long carry22;
s0=c0 + a0 * b0;
s1=c1 + a0 * b1 + a1 * b0;
s2=c2 + a0 * b2 + a1 * b1 + a2 * b0;
s3=c3 + a0 * b3 + a1 * b2 + a2 * b1 + a3 * b0;
s4=c4 + a0 * b4 + a1 * b3 + a2 * b2 + a3 * b1 + a4 * b0;
s5=c5 + a0 * b5 + a1 * b4 + a2 * b3 + a3 * b2 + a4 * b1 + a5 * b0;
s6=c6 + a0 * b6 + a1 * b5 + a2 * b4 + a3 * b3 + a4 * b2 + a5 * b1 + a6 * b0;
s7=c7 + a0 * b7 + a1 * b6 + a2 * b5 + a3 * b4 + a4 * b3 + a5 * b2 + a6 * b1 + a7 * b0;
s8=c8 + a0 * b8 + a1 * b7 + a2 * b6 + a3 * b5 + a4 * b4 + a5 * b3 + a6 * b2 + a7 * b1 + a8 * b0;
s9=c9 + a0 * b9 + a1 * b8 + a2 * b7 + a3 * b6 + a4 * b5 + a5 * b4 + a6 * b3 + a7 * b2 + a8 * b1 + a9 * b0;
s10=c10 + a0 * b10 + a1 * b9 + a2 * b8 + a3 * b7 + a4 * b6 + a5 * b5 + a6 * b4 + a7 * b3 + a8 * b2 + a9 * b1 + a10 * b0;
s11=c11 + a0 * b11 + a1 * b10 + a2 * b9 + a3 * b8 + a4 * b7 + a5 * b6 + a6 * b5 + a7 * b4 + a8 * b3 + a9 * b2 + a10 * b1 + a11 * b0;
s12=a1 * b11 + a2 * b10 + a3 * b9 + a4 * b8 + a5 * b7 + a6 * b6 + a7 * b5 + a8 * b4 + a9 * b3 + a10 * b2 + a11 * b1;
s13=a2 * b11 + a3 * b10 + a4 * b9 + a5 * b8 + a6 * b7 + a7 * b6 + a8 * b5 + a9 * b4 + a10 * b3 + a11 * b2;
s14=a3 * b11 + a4 * b10 + a5 * b9 + a6 * b8 + a7 * b7 + a8 * b6 + a9 * b5 + a10 * b4 + a11 * b3;
s15=a4 * b11 + a5 * b10 + a6 * b9 + a7 * b8 + a8 * b7 + a9 * b6 + a10 * b5 + a11 * b4;
s16=a5 * b11 + a6 * b10 + a7 * b9 + a8 * b8 + a9 * b7 + a10 * b6 + a11 * b5;
s17=a6 * b11 + a7 * b10 + a8 * b9 + a9 * b8 + a10 * b7 + a11 * b6;
s18=a7 * b11 + a8 * b10 + a9 * b9 + a10 * b8 + a11 * b7;
s19=a8 * b11 + a9 * b10 + a10 * b9 + a11 * b8;
s20=a9 * b11 + a10 * b10 + a11 * b9;
s21=a10 * b11 + a11 * b10;
s22=a11 * b11;
s23=0;
carry0=(s0 + (1 << 20)) >> 21;
s1+=carry0;
s0-=carry0 << 21;
carry2=(s2 + (1 << 20)) >> 21;
s3+=carry2;
s2-=carry2 << 21;
carry4=(s4 + (1 << 20)) >> 21;
s5+=carry4;
s4-=carry4 << 21;
carry6=(s6 + (1 << 20)) >> 21;
s7+=carry6;
s6-=carry6 << 21;
carry8=(s8 + (1 << 20)) >> 21;
s9+=carry8;
s8-=carry8 << 21;
carry10=(s10 + (1 << 20)) >> 21;
s11+=carry10;
s10-=carry10 << 21;
carry12=(s12 + (1 << 20)) >> 21;
s13+=carry12;
s12-=carry12 << 21;
carry14=(s14 + (1 << 20)) >> 21;
s15+=carry14;
s14-=carry14 << 21;
carry16=(s16 + (1 << 20)) >> 21;
s17+=carry16;
s16-=carry16 << 21;
carry18=(s18 + (1 << 20)) >> 21;
s19+=carry18;
s18-=carry18 << 21;
carry20=(s20 + (1 << 20)) >> 21;
s21+=carry20;
s20-=carry20 << 21;
carry22=(s22 + (1 << 20)) >> 21;
s23+=carry22;
s22-=carry22 << 21;
carry1=(s1 + (1 << 20)) >> 21;
s2+=carry1;
s1-=carry1 << 21;
carry3=(s3 + (1 << 20)) >> 21;
s4+=carry3;
s3-=carry3 << 21;
carry5=(s5 + (1 << 20)) >> 21;
s6+=carry5;
s5-=carry5 << 21;
carry7=(s7 + (1 << 20)) >> 21;
s8+=carry7;
s7-=carry7 << 21;
carry9=(s9 + (1 << 20)) >> 21;
s10+=carry9;
s9-=carry9 << 21;
carry11=(s11 + (1 << 20)) >> 21;
s12+=carry11;
s11-=carry11 << 21;
carry13=(s13 + (1 << 20)) >> 21;
s14+=carry13;
s13-=carry13 << 21;
carry15=(s15 + (1 << 20)) >> 21;
s16+=carry15;
s15-=carry15 << 21;
carry17=(s17 + (1 << 20)) >> 21;
s18+=carry17;
s17-=carry17 << 21;
carry19=(s19 + (1 << 20)) >> 21;
s20+=carry19;
s19-=carry19 << 21;
carry21=(s21 + (1 << 20)) >> 21;
s22+=carry21;
s21-=carry21 << 21;
s11+=s23 * 666643;
s12+=s23 * 470296;
s13+=s23 * 654183;
s14-=s23 * 997805;
s15+=s23 * 136657;
s16-=s23 * 683901;
s10+=s22 * 666643;
s11+=s22 * 470296;
s12+=s22 * 654183;
s13-=s22 * 997805;
s14+=s22 * 136657;
s15-=s22 * 683901;
s9+=s21 * 666643;
s10+=s21 * 470296;
s11+=s21 * 654183;
s12-=s21 * 997805;
s13+=s21 * 136657;
s14-=s21 * 683901;
s8+=s20 * 666643;
s9+=s20 * 470296;
s10+=s20 * 654183;
s11-=s20 * 997805;
s12+=s20 * 136657;
s13-=s20 * 683901;
s7+=s19 * 666643;
s8+=s19 * 470296;
s9+=s19 * 654183;
s10-=s19 * 997805;
s11+=s19 * 136657;
s12-=s19 * 683901;
s6+=s18 * 666643;
s7+=s18 * 470296;
s8+=s18 * 654183;
s9-=s18 * 997805;
s10+=s18 * 136657;
s11-=s18 * 683901;
carry6=(s6 + (1 << 20)) >> 21;
s7+=carry6;
s6-=carry6 << 21;
carry8=(s8 + (1 << 20)) >> 21;
s9+=carry8;
s8-=carry8 << 21;
carry10=(s10 + (1 << 20)) >> 21;
s11+=carry10;
s10-=carry10 << 21;
carry12=(s12 + (1 << 20)) >> 21;
s13+=carry12;
s12-=carry12 << 21;
carry14=(s14 + (1 << 20)) >> 21;
s15+=carry14;
s14-=carry14 << 21;
carry16=(s16 + (1 << 20)) >> 21;
s17+=carry16;
s16-=carry16 << 21;
carry7=(s7 + (1 << 20)) >> 21;
s8+=carry7;
s7-=carry7 << 21;
carry9=(s9 + (1 << 20)) >> 21;
s10+=carry9;
s9-=carry9 << 21;
carry11=(s11 + (1 << 20)) >> 21;
s12+=carry11;
s11-=carry11 << 21;
carry13=(s13 + (1 << 20)) >> 21;
s14+=carry13;
s13-=carry13 << 21;
carry15=(s15 + (1 << 20)) >> 21;
s16+=carry15;
s15-=carry15 << 21;
s5+=s17 * 666643;
s6+=s17 * 470296;
s7+=s17 * 654183;
s8-=s17 * 997805;
s9+=s17 * 136657;
s10-=s17 * 683901;
s4+=s16 * 666643;
s5+=s16 * 470296;
s6+=s16 * 654183;
s7-=s16 * 997805;
s8+=s16 * 136657;
s9-=s16 * 683901;
s3+=s15 * 666643;
s4+=s15 * 470296;
s5+=s15 * 654183;
s6-=s15 * 997805;
s7+=s15 * 136657;
s8-=s15 * 683901;
s2+=s14 * 666643;
s3+=s14 * 470296;
s4+=s14 * 654183;
s5-=s14 * 997805;
s6+=s14 * 136657;
s7-=s14 * 683901;
s1+=s13 * 666643;
s2+=s13 * 470296;
s3+=s13 * 654183;
s4-=s13 * 997805;
s5+=s13 * 136657;
s6-=s13 * 683901;
s0+=s12 * 666643;
s1+=s12 * 470296;
s2+=s12 * 654183;
s3-=s12 * 997805;
s4+=s12 * 136657;
s5-=s12 * 683901;
s12=0;
carry0=(s0 + (1 << 20)) >> 21;
s1+=carry0;
s0-=carry0 << 21;
carry2=(s2 + (1 << 20)) >> 21;
s3+=carry2;
s2-=carry2 << 21;
carry4=(s4 + (1 << 20)) >> 21;
s5+=carry4;
s4-=carry4 << 21;
carry6=(s6 + (1 << 20)) >> 21;
s7+=carry6;
s6-=carry6 << 21;
carry8=(s8 + (1 << 20)) >> 21;
s9+=carry8;
s8-=carry8 << 21;
carry10=(s10 + (1 << 20)) >> 21;
s11+=carry10;
s10-=carry10 << 21;
carry1=(s1 + (1 << 20)) >> 21;
s2+=carry1;
s1-=carry1 << 21;
carry3=(s3 + (1 << 20)) >> 21;
s4+=carry3;
s3-=carry3 << 21;
carry5=(s5 + (1 << 20)) >> 21;
s6+=carry5;
s5-=carry5 << 21;
carry7=(s7 + (1 << 20)) >> 21;
s8+=carry7;
s7-=carry7 << 21;
carry9=(s9 + (1 << 20)) >> 21;
s10+=carry9;
s9-=carry9 << 21;
carry11=(s11 + (1 << 20)) >> 21;
s12+=carry11;
s11-=carry11 << 21;
s0+=s12 * 666643;
s1+=s12 * 470296;
s2+=s12 * 654183;
s3-=s12 * 997805;
s4+=s12 * 136657;
s5-=s12 * 683901;
s12=0;
carry0=s0 >> 21;
s1+=carry0;
s0-=carry0 << 21;
carry1=s1 >> 21;
s2+=carry1;
s1-=carry1 << 21;
carry2=s2 >> 21;
s3+=carry2;
s2-=carry2 << 21;
carry3=s3 >> 21;
s4+=carry3;
s3-=carry3 << 21;
carry4=s4 >> 21;
s5+=carry4;
s4-=carry4 << 21;
carry5=s5 >> 21;
s6+=carry5;
s5-=carry5 << 21;
carry6=s6 >> 21;
s7+=carry6;
s6-=carry6 << 21;
carry7=s7 >> 21;
s8+=carry7;
s7-=carry7 << 21;
carry8=s8 >> 21;
s9+=carry8;
s8-=carry8 << 21;
carry9=s9 >> 21;
s10+=carry9;
s9-=carry9 << 21;
carry10=s10 >> 21;
s11+=carry10;
s10-=carry10 << 21;
carry11=s11 >> 21;
s12+=carry11;
s11-=carry11 << 21;
s0+=s12 * 666643;
s1+=s12 * 470296;
s2+=s12 * 654183;
s3-=s12 * 997805;
s4+=s12 * 136657;
s5-=s12 * 683901;
carry0=s0 >> 21;
s1+=carry0;
s0-=carry0 << 21;
carry1=s1 >> 21;
s2+=carry1;
s1-=carry1 << 21;
carry2=s2 >> 21;
s3+=carry2;
s2-=carry2 << 21;
carry3=s3 >> 21;
s4+=carry3;
s3-=carry3 << 21;
carry4=s4 >> 21;
s5+=carry4;
s4-=carry4 << 21;
carry5=s5 >> 21;
s6+=carry5;
s5-=carry5 << 21;
carry6=s6 >> 21;
s7+=carry6;
s6-=carry6 << 21;
carry7=s7 >> 21;
s8+=carry7;
s7-=carry7 << 21;
carry8=s8 >> 21;
s9+=carry8;
s8-=carry8 << 21;
carry9=s9 >> 21;
s10+=carry9;
s9-=carry9 << 21;
carry10=s10 >> 21;
s11+=carry10;
s10-=carry10 << 21;
final byte[] result=new byte[32];
result[0]=(byte)(s0);
result[1]=(byte)(s0 >> 8);
result[2]=(byte)((s0 >> 16) | (s1 << 5));
result[3]=(byte)(s1 >> 3);
result[4]=(byte)(s1 >> 11);
result[5]=(byte)((s1 >> 19) | (s2 << 2));
result[6]=(byte)(s2 >> 6);
result[7]=(byte)((s2 >> 14) | (s3 << 7));
result[8]=(byte)(s3 >> 1);
result[9]=(byte)(s3 >> 9);
result[10]=(byte)((s3 >> 17) | (s4 << 4));
result[11]=(byte)(s4 >> 4);
result[12]=(byte)(s4 >> 12);
result[13]=(byte)((s4 >> 20) | (s5 << 1));
result[14]=(byte)(s5 >> 7);
result[15]=(byte)((s5 >> 15) | (s6 << 6));
result[16]=(byte)(s6 >> 2);
result[17]=(byte)(s6 >> 10);
result[18]=(byte)((s6 >> 18) | (s7 << 3));
result[19]=(byte)(s7 >> 5);
result[20]=(byte)(s7 >> 13);
result[21]=(byte)(s8);
result[22]=(byte)(s8 >> 8);
result[23]=(byte)((s8 >> 16) | (s9 << 5));
result[24]=(byte)(s9 >> 3);
result[25]=(byte)(s9 >> 11);
result[26]=(byte)((s9 >> 19) | (s10 << 2));
result[27]=(byte)(s10 >> 6);
result[28]=(byte)((s10 >> 14) | (s11 << 7));
result[29]=(byte)(s11 >> 1);
result[30]=(byte)(s11 >> 9);
result[31]=(byte)(s11 >> 17);
return new Ed25519EncodedFieldElement(result);
}
| Multiplies this encoded field element with another and adds a third. The result is reduced modulo the group order. <br> See the comments in the method modQ() for an explanation of the algorithm. |
public AccountHeaderBuilder withProfiles(@NonNull ArrayList<IProfile> profiles){
this.mProfiles=IdDistributor.checkIds(profiles);
return this;
}
| set the arrayList of DrawerItems for the drawer |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.