code
stringlengths
10
174k
nl
stringlengths
3
129k
public Object2DoubleOpenHashMap<IntRBTreeSet> confidenceMap(double supportThreshold){ List<ItemSet> itemSets=learn(); Object2DoubleOpenHashMap<IntRBTreeSet> confidenceMap=new Object2DoubleOpenHashMap<>(itemSets.size()); long intSupportThreshold=Math.round(itemSets.size() * supportThreshold); for ( ItemSet itemSet : itemSets) { if (itemSet.support >= intSupportThreshold) { IntRBTreeSet itemSetCopy=new IntRBTreeSet(itemSet.items); confidenceMap.put(itemSetCopy,itemSet.support / (double)setCount); } } return confidenceMap; }
Returns a map of associations and their confidence, where confidence is support for the itemset (that is, the number of times it appears in the input data) divided by the total number of sets (i.e., the percentage of input sets where it appears. The map returned includes only those itemsets for which the confidence is above the given threshold
public boolean isFinished(){ return finished; }
Returns true if the task has completed.
public boolean isSetValues(){ return this.values != null; }
Returns true if field values is set (has been assigned a value) and false otherwise
synchronized boolean readCertificates(){ if (metaEntries == null) { return false; } Iterator<String> it=metaEntries.keySet().iterator(); while (it.hasNext()) { String key=it.next(); if (key.endsWith(".DSA") || key.endsWith(".RSA")) { verifyCertificate(key); if (metaEntries == null) { return false; } it.remove(); } } return true; }
If the associated JAR file is signed, check on the validity of all of the known signatures.
public TrustManagerImpl(KeyStore keyStore){ this(keyStore,null); }
Creates X509TrustManager based on a keystore
private int compareLabel(JsonObject jsonObj1,JsonObject jsonObj2){ String label1=getLabel(jsonObj1); String label2=getLabel(jsonObj2); return label1.compareTo(label2); }
Compares the labels for the two given Json objects. Returns a negative integer if the first label lexicographically precedes the second label. Returns a positive integer if the first label lexicographically follows the second label. Returns zero if the labels are equal.
public void addLayoutComponent(Component component,Object constraints){ if (constraints instanceof Constraints) { putConstraints(component,(Constraints)constraints); } }
If <code>constraints</code> is an instance of <code>SpringLayout.Constraints</code>, associates the constraints with the specified component. <p>
public TechnicalServiceMultiSubscriptions(String message){ super(message); }
Constructs a new exception with the specified detail message. The cause is not initialized.
public static Core createCore(Context ctx,CoreListener listener,RcsSettings rcsSettings,ContentResolver contentResolver,LocalContentResolver localContentResolver,ContactManager contactManager,MessagingLog messagingLog,HistoryLog historyLog,RichCallHistory richCallHistory) throws IOException, KeyStoreException { if (sInstance != null) { return sInstance; } synchronized (Core.class) { if (sInstance == null) { KeyStoreManager.loadKeyStore(rcsSettings); sInstance=new Core(ctx,listener,contentResolver,localContentResolver,rcsSettings,contactManager,messagingLog,historyLog,richCallHistory); } } return sInstance; }
Instantiate the core
public ToStringBuilder append(double[] array){ style.append(buffer,null,array,null); return this; }
<p>Append to the <code>toString</code> a <code>double</code> array.</p>
public javax.naming.Context createSubcontext(String name) throws NamingException { return createSubcontext(new CompositeName(name)); }
Uses the callBindNewContext convenience function to create a new context. Throws an invalid name exception if the name is empty.
public void join(Object[] pieces){ int sum=0; for (int x=0; x < pieces.length; x++) sum+=((boolean[])(pieces[x])).length; int runningsum=0; boolean[] newgenome=new boolean[sum]; for (int x=0; x < pieces.length; x++) { System.arraycopy(pieces[x],0,newgenome,runningsum,((boolean[])(pieces[x])).length); runningsum+=((boolean[])(pieces[x])).length; } genome=newgenome; }
Joins the n pieces and sets the genome to their concatenation.
public Enumeration listOptions(){ Vector newVector=new Vector(); OptionUtils.addOption(newVector,sizeTipText(),"" + getDefaultSize(),"size"); OptionUtils.add(newVector,super.listOptions()); return OptionUtils.toEnumeration(newVector); }
Returns an enumeration of the options.
public static void clearThreadLocals(){ createInProgress=new ThreadLocal<>(); }
clear thread locals that may have been set by previous uses of CacheCreation
public boolean closed(){ return state == State.CLOSED; }
Returns <tt>true</tt> if the state is closed.
private void executeNext(){ lastSearchResult=searchExecutor.next(); processSearchResult(lastSearchResult); }
Executes next functionality.
private boolean fireSelectionListeners(final Event originalEvent){ final Event event=new Event(); event.button=originalEvent.button; event.display=this.getDisplay(); event.item=null; event.widget=this; event.data=null; event.time=originalEvent.time; event.x=originalEvent.x; event.y=originalEvent.y; for ( final SelectionListener listener : this.selectionListeners) { final SelectionEvent selEvent=new SelectionEvent(event); listener.widgetSelected(selEvent); if (!selEvent.doit) { return false; } } return true; }
Fire the selection listeners
public AccessTokensBuilder warnPercentLeft(final int warnPercentLeft){ checkLock(); this.warnPercentLeft=warnPercentLeft; return this; }
Set the threshold of the validity time left before the service issues a warning. This value can be used to detect possible access token refreshing problems e.g. Default value is 20.
public <T extends B>MinMaxPriorityQueue<T> create(){ return create(Collections.<T>emptySet()); }
Builds a new min-max priority queue using the previously specified options, and having no initial contents.
public ActivitiesAnalyzer(){ this.autoConfig=true; this.createGraphs=true; this.observedAgents=null; reset(0); }
This is how most people will probably will use this class. It has to be created an registered as ControlerListener. Then, it auto-configures itself (register as events handler, get paths to output files, ...).
public UpdateBuilder bind(String from,String to){ update=update.replace('%' + from + '%',to); return this; }
Bind a string to a name.
private static boolean isLargeText(TextView textView){ float textSize=textView.getTextSize(); if ((textSize >= ContrastUtils.WCAG_LARGE_TEXT_MIN_SIZE) || ((textSize >= ContrastUtils.WCAG_LARGE_BOLD_TEXT_MIN_SIZE) && textView.getTypeface().isBold())) { return true; } return false; }
Given a TextView, returns true if it contains text which is large for contrast purposes as defined at http://www.w3.org/TR/2008/REC-WCAG20-20081211/#larger-scaledef
public static ExtendedCoordinateSequenceFactory instance(){ return instance; }
Returns the singleton instance of ExtendedCoordinateSequenceFactory
public void printState(Vertex state,Writer writer,String indent,Set<Vertex> elements,Network network,long start,long timeout) throws IOException { if (state.getData() instanceof BinaryData) { Vertex detached=parseStateByteCode(state,(BinaryData)state.getData(),network); elements.add(detached); printState(detached,writer,indent,elements,network,start,timeout); return; } printComments(state,writer,indent,false,network); writer.write(indent); printElement(state,writer,indent,null,null,elements,network); writer.write(" {\r\n"); if ((System.currentTimeMillis() - start) > timeout) { writer.write(indent); writer.write("\t"); writer.write("** decompile timeout reached **\r\n"); writer.write(indent); writer.write("}\r\n"); return; } String childIndent=indent + "\t"; Collection<Relationship> equations=state.orderedRelationships(Primitive.DO); List<Vertex> newEquations=new ArrayList<Vertex>(); List<Vertex> newVariables=new ArrayList<Vertex>(); List<Vertex> newStates=new ArrayList<Vertex>(); if (equations != null) { for ( Relationship equation : equations) { printComments(equation.getTarget(),writer,indent,true,network); if (equation.getTarget().instanceOf(Primitive.CASE)) { printCase(equation.getTarget(),writer,childIndent,elements,newVariables,newEquations,newStates,network); } else if (equation.getTarget().instanceOf(Primitive.DO)) { writer.write(childIndent); printOperator(equation.getTarget().getRelationship(Primitive.DO),writer,indent,newEquations,newVariables,elements,network); writer.write(";\r\n"); } else if (equation.getTarget().instanceOf(Primitive.GOTO)) { printGoto(equation.getTarget(),writer,childIndent,elements,network,start,timeout); } else if (equation.getTarget().instanceOf(Primitive.PUSH)) { printPush(equation.getTarget(),writer,childIndent,elements,network,start,timeout); } else if (equation.getTarget().instanceOf(Primitive.RETURN)) { printReturn(equation.getTarget(),writer,childIndent,elements,network,start,timeout); } } } for ( Vertex variable : newVariables) { printVariable(variable,writer,childIndent,elements,network); } for ( Vertex newEquation : newEquations) { printEquation(newEquation,writer,childIndent,elements,network); } newEquations=new ArrayList<Vertex>(); newVariables=new ArrayList<Vertex>(); Collection<Relationship> quotients=state.orderedRelationships(Primitive.QUOTIENT); if (quotients != null) { for ( Relationship quotient : quotients) { writer.write(childIndent); writer.write("Answer:"); writer.write(String.format("%.02f",quotient.getCorrectness())); writer.write(":"); printElement(quotient.getTarget(),writer,indent,newEquations,newVariables,elements,network); if (quotient.hasMeta()) { writer.write(" {\r\n"); Collection<Relationship> previousRelationships=quotient.getMeta().orderedRelationships(Primitive.PREVIOUS); if (previousRelationships != null) { for ( Relationship previous : previousRelationships) { writer.write(childIndent); if (previous.getCorrectness() > 0) { writer.write("\tprevious is "); } else { writer.write("\tprevious is not "); } printElement(previous.getTarget(),writer,indent + 1,newEquations,newVariables,elements,network); writer.write(";\r\n"); } } writer.write(childIndent); writer.write("}"); } writer.write(";\r\n"); for ( Vertex variable : newVariables) { printVariable(variable,writer,childIndent,elements,network); } for ( Vertex newEquation : newEquations) { printEquation(newEquation,writer,childIndent,elements,network); } } } Collection<Relationship> possibleQuotients=state.orderedRelationships(Primitive.POSSIBLE_QUOTIENT); if (possibleQuotients != null) { for ( Relationship quotient : possibleQuotients) { writer.write(childIndent); writer.write("//Possible Quotient:"); printElement(quotient.getTarget(),writer,indent,newEquations,newVariables,elements,network); writer.write(";\r\n"); } } for ( Vertex element : newStates) { if (element.instanceOf(Primitive.STATE)) { printState(element,writer,childIndent,elements,network,start,timeout); } } writer.write(indent); writer.write("}\r\n"); }
Print the state and any referenced states or variables that have not yet been printed.
public float[] toArray(float[] result,int offset){ if (result == null || result.length - offset < 2) { throw new IllegalArgumentException(Logger.logMessage(Logger.ERROR,"Vec2","toArray","missingResult")); } result[offset++]=(float)this.x; result[offset]=(float)this.y; return result; }
Copies this vector's components to the specified single precision array. The result is compatible with GLSL uniform vectors, and can be passed to the function glUniform2fv.
public ProgressEvent(Object source,int type,String taskDescription,float finishValue,float currentValue){ super(source); this.finishedValue=finishValue; this.currentValue=currentValue; this.taskDescription=taskDescription; this.type=type; }
Construct a ProgressEvent.
public boolean isGhost(){ return false; }
Checks whether an entity is a ghost (non physically interactive).
boolean ensureCreated(){ if (!isCreated()) { XCreateWindowParams params=getDelayedParams(); params.remove(DELAYED); params.add(OVERRIDE_REDIRECT,Boolean.TRUE); params.add(XWindow.TARGET,target); init(params); } return true; }
Performs delayed creation of menu window if necessary
public void validateBusinessObjectFormat(Integer expectedBusinessObjectFormatId,String expectedNamespaceCode,String expectedBusinessObjectDefinitionName,String expectedBusinessObjectFormatUsage,String expectedBusinessObjectFormatFileType,Integer expectedBusinessObjectFormatVersion,Boolean expectedIsLatestVersion,String expectedPartitionKey,String expectedDescription,List<Attribute> expectedAttributes,List<AttributeDefinition> expectedAttributeDefinitions,Schema expectedSchema,BusinessObjectFormat actualBusinessObjectFormat){ assertNotNull(actualBusinessObjectFormat); if (expectedBusinessObjectFormatId != null) { assertEquals(expectedBusinessObjectFormatId,Integer.valueOf(actualBusinessObjectFormat.getId())); } assertEquals(expectedNamespaceCode,actualBusinessObjectFormat.getNamespace()); assertEquals(expectedBusinessObjectDefinitionName,actualBusinessObjectFormat.getBusinessObjectDefinitionName()); assertEquals(expectedBusinessObjectFormatUsage,actualBusinessObjectFormat.getBusinessObjectFormatUsage()); assertEquals(expectedBusinessObjectFormatFileType,actualBusinessObjectFormat.getBusinessObjectFormatFileType()); assertEquals(expectedBusinessObjectFormatVersion,Integer.valueOf(actualBusinessObjectFormat.getBusinessObjectFormatVersion())); assertEquals(expectedIsLatestVersion,actualBusinessObjectFormat.isLatestVersion()); assertEquals(expectedPartitionKey,actualBusinessObjectFormat.getPartitionKey()); AbstractServiceTest.assertEqualsIgnoreNullOrEmpty("description",expectedDescription,actualBusinessObjectFormat.getDescription()); if (!CollectionUtils.isEmpty(expectedAttributes)) { assertEquals(expectedAttributes,actualBusinessObjectFormat.getAttributes()); } else { assertEquals(0,actualBusinessObjectFormat.getAttributes().size()); } if (!CollectionUtils.isEmpty(expectedAttributeDefinitions)) { assertEquals(expectedAttributeDefinitions,actualBusinessObjectFormat.getAttributeDefinitions()); } else { assertEquals(0,actualBusinessObjectFormat.getAttributeDefinitions().size()); } if (expectedSchema != null) { assertNotNull(actualBusinessObjectFormat.getSchema()); AbstractServiceTest.assertEqualsIgnoreNullOrEmpty("null value",expectedSchema.getNullValue(),actualBusinessObjectFormat.getSchema().getNullValue()); AbstractServiceTest.assertEqualsIgnoreNullOrEmpty("delimiter",expectedSchema.getDelimiter(),actualBusinessObjectFormat.getSchema().getDelimiter()); AbstractServiceTest.assertEqualsIgnoreNullOrEmpty("escape character",expectedSchema.getEscapeCharacter(),actualBusinessObjectFormat.getSchema().getEscapeCharacter()); assertEquals(expectedSchema.getPartitionKeyGroup(),actualBusinessObjectFormat.getSchema().getPartitionKeyGroup()); assertEquals(expectedSchema.getColumns().size(),actualBusinessObjectFormat.getSchema().getColumns().size()); for (int i=0; i < expectedSchema.getColumns().size(); i++) { SchemaColumn expectedSchemaColumn=expectedSchema.getColumns().get(i); SchemaColumn actualSchemaColumn=actualBusinessObjectFormat.getSchema().getColumns().get(i); assertEquals(expectedSchemaColumn.getName(),actualSchemaColumn.getName()); assertEquals(expectedSchemaColumn.getType(),actualSchemaColumn.getType()); assertEquals(expectedSchemaColumn.getSize(),actualSchemaColumn.getSize()); assertEquals(expectedSchemaColumn.isRequired(),actualSchemaColumn.isRequired()); assertEquals(expectedSchemaColumn.getDefaultValue(),actualSchemaColumn.getDefaultValue()); assertEquals(expectedSchemaColumn.getDescription(),actualSchemaColumn.getDescription()); } if (CollectionUtils.isEmpty(expectedSchema.getPartitions())) { assertTrue(CollectionUtils.isEmpty(actualBusinessObjectFormat.getSchema().getPartitions())); } else { for (int i=0; i < expectedSchema.getPartitions().size(); i++) { SchemaColumn expectedPartitionColumn=expectedSchema.getPartitions().get(i); SchemaColumn actualPartitionColumn=actualBusinessObjectFormat.getSchema().getPartitions().get(i); assertEquals(expectedPartitionColumn.getName(),actualPartitionColumn.getName()); assertEquals(expectedPartitionColumn.getType(),actualPartitionColumn.getType()); assertEquals(expectedPartitionColumn.getSize(),actualPartitionColumn.getSize()); assertEquals(expectedPartitionColumn.isRequired(),actualPartitionColumn.isRequired()); assertEquals(expectedPartitionColumn.getDefaultValue(),actualPartitionColumn.getDefaultValue()); assertEquals(expectedPartitionColumn.getDescription(),actualPartitionColumn.getDescription()); } } } else { assertNull(actualBusinessObjectFormat.getSchema()); } }
Validates business object format contents against specified arguments and expected (hard coded) test values.
int findEndText(String source,int ofs){ for (int i=ofs; i < source.length(); i++) { if (isAlpha(source.charAt(i)) == false && isNumeric(source.charAt(i)) == false) { return i; } } return -1; }
Attempt to find the end of a field if the length is not known.
public DeletionConstraintException(String message){ super(message); }
Constructs a new exception with the specified detail message. The cause is not initialized.
public Response.Builder readResponse() throws IOException { if (state != STATE_OPEN_REQUEST_BODY && state != STATE_READ_RESPONSE_HEADERS) { throw new IllegalStateException("state: " + state); } try { while (true) { StatusLine statusLine=StatusLine.parse(source.readUtf8LineStrict()); Response.Builder responseBuilder=new Response.Builder().protocol(statusLine.protocol).code(statusLine.code).message(statusLine.message).headers(readHeaders()); if (statusLine.code != HTTP_CONTINUE) { state=STATE_OPEN_RESPONSE_BODY; return responseBuilder; } } } catch ( EOFException e) { IOException exception=new IOException("unexpected end of stream on " + streamAllocation); exception.initCause(e); throw exception; } }
Parses bytes of a response header from an HTTP transport.
public Polygon createPolygon(LinearRing shell,LinearRing[] holes){ return new Polygon(shell,holes,this); }
Constructs a <code>Polygon</code> with the given exterior boundary and interior boundaries.
private void refreshRestaurants(Context context,ContentProviderClient cp) throws RemoteException { int rows=Content.getCount(context,RESTAURANTS_URI); int days=30; Uri uri=Uris.limit(RESTAURANTS_URI,rows / days + 1); String[] proj={_ID,Restaurants.PLACE_ID}; String sel=Restaurants.PLACE_ID + " IS NOT NULL AND " + Restaurants.PLACE_ID+ " NOT LIKE 'NOT_FOUND_%' AND ("+ Restaurants.REFRESHED_ON+ " IS NULL OR "+ Restaurants.REFRESHED_ON+ " <= datetime('now', '-"+ days+ " days')) AND "+ Restaurants.STATUS_ID+ " = ?"; String[] args={String.valueOf(ACTIVE.id)}; String order=Restaurants.REFRESHED_ON + " IS NULL DESC, " + Restaurants.REFRESHED_ON+ ", "+ _ID; EasyCursor c=new EasyCursor(cp.query(uri,proj,sel,args,order)); Result[] results=null; try { results=RestaurantsRefreshService.refresh(c); } catch ( IOException e) { Log.e(TAG,"refreshing restaurants",e); exception(e); } c.close(); if (results != null) { for ( Result result : results) { if (result.newReviewTimes != null) { int size=result.newReviewTimes.size(); for (int i=0; i < size; i++) { cp.insert(SYNCS_URI,Syncs.values(result.newReviewTimes.keyAt(i),result.newReviewTimes.valueAt(i))); } } } } }
Download and update the details of Google Places that haven't been refreshed recently.
public static void fixRectForAspectRatio(Rect rect,int aspectRatioX,int aspectRatioY){ if (aspectRatioX == aspectRatioY && rect.width() != rect.height()) { if (rect.height() > rect.width()) { rect.bottom-=rect.height() - rect.width(); } else { rect.right-=rect.width() - rect.height(); } } }
Fix the given rectangle if it doesn't confirm to aspect ration rule.<br> Make sure that width and height are equal if 1:1 fixed aspect ratio is requested.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:57:09.918 -0500",hash_original_method="BD3CEF4F9337B2BC7C235E398D43BE2A",hash_generated_method="AEC1C8C7C09A3C195FC2992BF8B6587C") public int prestartAllCoreThreads(){ int n=0; while (addWorker(null,true)) ++n; return n; }
Starts all core threads, causing them to idly wait for work. This overrides the default policy of starting core threads only when new tasks are executed.
void pauseMigrations(List<String> migrationNames) throws VPlexApiException { s_logger.info("Pausing migrations {}",migrationNames); VPlexApiDiscoveryManager discoveryMgr=_vplexApiClient.getDiscoveryManager(); List<VPlexMigrationInfo> migrationInfoList=discoveryMgr.findMigrations(migrationNames); StringBuilder migrationArgBuilder=new StringBuilder(); for ( VPlexMigrationInfo migrationInfo : migrationInfoList) { String migrationStatus=migrationInfo.getStatus(); if (VPlexApiConstants.MIGRATION_PAUSED.equals(migrationStatus)) { continue; } else if (!VPlexApiConstants.MIGRATION_INPROGRESS.equals(migrationInfo.getStatus())) { throw VPlexApiException.exceptions.cantPauseMigrationNotInProgress(migrationInfo.getName()); } if (migrationArgBuilder.length() != 0) { migrationArgBuilder.append(","); } migrationArgBuilder.append(migrationInfo.getPath()); } String migrationPaths=migrationArgBuilder.toString(); if (migrationPaths.length() == 0) { s_logger.info("All requested migrations are already paused"); return; } URI requestURI=_vplexApiClient.getBaseURI().resolve(VPlexApiConstants.URI_PAUSE_MIGRATIONS); s_logger.info("Pause migrations URI is {}",requestURI.toString()); ClientResponse response=null; try { s_logger.info("Pausing migrations"); Map<String,String> argsMap=new HashMap<String,String>(); argsMap.put(VPlexApiConstants.ARG_DASH_M,migrationArgBuilder.toString()); JSONObject postDataObject=VPlexApiUtils.createPostData(argsMap,false); s_logger.info("Pause migrations POST data is {}",postDataObject.toString()); response=_vplexApiClient.post(requestURI,postDataObject.toString()); String responseStr=response.getEntity(String.class); s_logger.info("Pause migrations response is {}",responseStr); if (response.getStatus() != VPlexApiConstants.SUCCESS_STATUS) { if (response.getStatus() == VPlexApiConstants.ASYNC_STATUS) { s_logger.info("Pause migrations is completing asynchronously"); _vplexApiClient.waitForCompletion(response); } else { String cause=VPlexApiUtils.getCauseOfFailureFromResponse(responseStr); throw VPlexApiException.exceptions.pauseMigrationsFailureStatus(migrationNames,String.valueOf(response.getStatus()),cause); } } s_logger.info("Successfully paused migrations {}",migrationNames); } catch ( VPlexApiException vae) { throw vae; } catch ( Exception e) { throw VPlexApiException.exceptions.failedPauseMigrations(migrationNames,e); } finally { if (response != null) { response.close(); } } }
Pauses the executing migrations with the passed names.
public static AddNeuronsDialog createAddNeuronsDialog(final NetworkPanel networkPanel){ final AddNeuronsDialog addND=new AddNeuronsDialog(networkPanel); addND.combinedNeuronInfoPanel=NeuronPropertiesPanel.createNeuronPropertiesPanel(Collections.singletonList(addND.baseNeuron),addND,false); addND.init(); addND.combinedNeuronInfoPanel.getUpdateRulePanel().getCbNeuronType().addActionListener(null); return addND; }
A factory method that creates an AddNeuronsDialog to prevent references to "this" from escaping during construction.
private void send(SimpleMailMessage msg) throws MailException { mailSender.send(msg); }
Send a simple message with pre-populated values.
public static String toPMML(Instances train,Instances structureAfterFiltering,double[][] par,int numClasses){ PMML pmml=initPMML(); addDataDictionary(train,pmml); String currentAttrName=null; TransformationDictionary transformDict=null; LocalTransformations localTransforms=null; MiningSchema schema=new MiningSchema(); for (int i=0; i < structureAfterFiltering.numAttributes(); i++) { Attribute attr=structureAfterFiltering.attribute(i); Attribute originalAttr=train.attribute(attr.name()); if (i == structureAfterFiltering.classIndex()) { schema.addMiningFields(new MiningField(attr.name(),FIELDUSAGETYPE.PREDICTED)); } if (originalAttr == null) { if (localTransforms == null) { localTransforms=new LocalTransformations(); } if (transformDict == null) { transformDict=new TransformationDictionary(); } String[] nameAndValue=getNameAndValueFromUnsupervisedNominalToBinaryDerivedAttribute(train,attr); if (!nameAndValue[0].equals(currentAttrName)) { currentAttrName=nameAndValue[0]; if (i != structureAfterFiltering.classIndex()) { int mode=(int)train.meanOrMode(train.attribute(nameAndValue[0])); schema.addMiningFields(new MiningField(nameAndValue[0],FIELDUSAGETYPE.ACTIVE,MISSINGVALUETREATMENTMETHOD.AS_MODE,train.attribute(nameAndValue[0]).value(mode))); } } DerivedField derivedfield=new DerivedField(attr.name(),DATATYPE.DOUBLE,OPTYPE.CONTINUOUS); NormDiscrete normDiscrete=new NormDiscrete(nameAndValue[0],nameAndValue[1]); derivedfield.setNormDiscrete(normDiscrete); transformDict.addDerivedField(derivedfield); } else { if (i != structureAfterFiltering.classIndex()) { if (originalAttr.isNumeric()) { String mean="" + train.meanOrMode(originalAttr); schema.addMiningFields(new MiningField(originalAttr.name(),FIELDUSAGETYPE.ACTIVE,MISSINGVALUETREATMENTMETHOD.AS_MEAN,mean)); } else { int mode=(int)train.meanOrMode(originalAttr); schema.addMiningFields(new MiningField(originalAttr.name(),FIELDUSAGETYPE.ACTIVE,MISSINGVALUETREATMENTMETHOD.AS_MODE,originalAttr.value(mode))); } } } } RegressionModel model=new RegressionModel(); if (transformDict != null) { pmml.setTransformationDictionary(transformDict); } model.addContent(schema); model.setFunctionName(MININGFUNCTION.CLASSIFICATION); model.setAlgorithmName("logisticRegression"); model.setModelType("logisticRegression"); model.setNormalizationMethod(REGRESSIONNORMALIZATIONMETHOD.SOFTMAX); Output output=new Output(); Attribute classAttribute=structureAfterFiltering.classAttribute(); for (int i=0; i < classAttribute.numValues(); i++) { OutputField outputField=new OutputField(); outputField.setName(classAttribute.name()); outputField.setValue(classAttribute.value(i)); output.addOutputField(outputField); } model.addContent(output); for (int i=0; i < numClasses - 1; i++) { RegressionTable table=new RegressionTable(structureAfterFiltering.classAttribute().value(i)); int j=1; for (int k=0; k < structureAfterFiltering.numAttributes(); k++) { if (k != structureAfterFiltering.classIndex()) { Attribute attr=structureAfterFiltering.attribute(k); table.addNumericPredictor(new NumericPredictor(attr.name(),BigInteger.valueOf(1),par[j][i])); j++; } } table.setIntercept(par[0][i]); model.addContent(table); } pmml.addAssociationModelOrBaselineModelOrClusteringModes(model); try { StringWriter sw=new StringWriter(); JAXBContext jc=JAXBContext.newInstance(PMML.class); Marshaller marshaller=jc.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,true); marshaller.marshal(pmml,sw); return sw.toString(); } catch ( JAXBException e) { e.printStackTrace(); } return ""; }
Produce the PMML for a Logistic classifier
public static Set<InetAddress> myPublicIPv4(){ return publicIPv4HostAddresses; }
Get all IPv4 addresses which are assigned to the local host but are public IP addresses. These should be the possible addresses which can be used to access this peer.
public EventReplayer inAscendingOrder(){ return new EventReplayer(events,null,filter); }
Set the order to ascending.
public static ComponentUI createUI(JComponent button){ return UI; }
Required by UIManager.
private void recoverProductionAndWait(FunctionalAPIImpl impl,ConsistencyGroupCopyUID groupCopy) throws FunctionalAPIActionFailedException_Exception, FunctionalAPIInternalError_Exception, RecoverPointException, InterruptedException { logger.info("Wait for recoverProduction to complete"); impl.recoverProduction(groupCopy,true); logger.info("Wait for recoverProduction to complete"); this.waitForCGCopyState(impl,groupCopy,false,ImageAccessMode.UNKNOWN); }
Recover (restore) the production data for a CG copy. Wait for the restore to complete.
public Marker(GraphicsNode markerNode,Point2D ref,double orient){ if (markerNode == null) { throw new IllegalArgumentException(); } if (ref == null) { throw new IllegalArgumentException(); } this.markerNode=markerNode; this.ref=ref; this.orient=orient; }
Constructs a new marker.
public static UnicodeEscaper below(final int codepoint){ return outsideOf(codepoint,Integer.MAX_VALUE); }
<p>Constructs a <code>UnicodeEscaper</code> below the specified value (exclusive). </p>
@Override public double classProb(int classIndex,Instance instance,int theSubset) throws Exception { if (theSubset > -1) { return m_globalNB.classProb(classIndex,instance,theSubset); } else { throw new Exception("This shouldn't happen!!!"); } }
Return the probability for a class value
public boolean equals(Object obj2){ if (null == obj2) return false; if (obj2 instanceof XNumber) return obj2.equals(this); else if (obj2 instanceof XNodeSet) return obj2.equals(this); else if (obj2 instanceof XStringForFSB) return equals((XMLString)obj2); else return equals(obj2.toString()); }
Compares this string to the specified object. The result is <code>true</code> if and only if the argument is not <code>null</code> and is a <code>String</code> object that represents the same sequence of characters as this object.
public String globalInfo(){ return "Evaluates the classifier using cross-validation. Order can be preserved."; }
Description to be displayed in the GUI.
public SQLSetStatement parseAssign(){ accept(Token.SET); SQLSetStatement stmt=new SQLSetStatement(getDbType()); parseAssignItems(stmt.getItems(),stmt); return stmt; }
parse assign statement
private GWTJavaProblem(String filename,int offset,int length,int line,int column,GWTProblemType problemType,GdtProblemSeverity severity,String[] messageArguments,String[] problemArguments){ super(filename,offset,length,line,column,problemType,severity,messageArguments,problemArguments); }
For unit tests.
@POST @Consumes({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) @Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) @Path("/{id}/protection/continuous-copies/swap") @CheckPermission(roles={Role.TENANT_ADMIN},acls={ACL.OWN,ACL.ALL}) public TaskList swap(@PathParam("id") URI id,CopiesParam param) throws ControllerException { TaskResourceRep taskResp=null; TaskList taskList=new TaskList(); ArgValidator.checkFieldUriType(id,BlockConsistencyGroup.class,"id"); ArgValidator.checkFieldNotEmpty(param.getCopies(),"copies"); final BlockConsistencyGroup consistencyGroup=(BlockConsistencyGroup)queryResource(id); if (!consistencyGroup.created()) { throw APIException.badRequests.consistencyGroupNotCreated(); } List<Copy> copies=param.getCopies(); if (copies.size() > 1) { throw APIException.badRequests.swapCopiesParamCanOnlyBeOne(); } Copy copy=copies.get(0); ArgValidator.checkFieldUriType(copy.getCopyID(),VirtualArray.class,"copyId"); ArgValidator.checkFieldNotEmpty(copy.getType(),"type"); if (TechnologyType.RP.name().equalsIgnoreCase(copy.getType())) { taskResp=performProtectionAction(id,copy,ProtectionOp.SWAP.getRestOp()); taskList.getTaskList().add(taskResp); } else if (TechnologyType.SRDF.name().equalsIgnoreCase(copy.getType())) { taskResp=performSRDFProtectionAction(id,copy,ProtectionOp.SWAP.getRestOp()); taskList.getTaskList().add(taskResp); } else { throw APIException.badRequests.invalidCopyType(copy.getType()); } return taskList; }
Request to reverse the replication direction, i.e. R1 and R2 are interchanged.
public void testNotZero(){ byte rBytes[]={-1}; BigInteger aNumber=BigInteger.ZERO; BigInteger result=aNumber.not(); byte resBytes[]=new byte[rBytes.length]; resBytes=result.toByteArray(); for (int i=0; i < resBytes.length; i++) { assertTrue(resBytes[i] == rBytes[i]); } assertEquals("incorrect sign",-1,result.signum()); }
Not for ZERO
public String fireModelChange(PO po,int changeType){ if (po == null || m_modelChangeListeners.size() == 0) return null; String propertyName=po.get_TableName() + "*"; ArrayList<ModelValidator> list=m_modelChangeListeners.get(propertyName); if (list != null) { String error=fireModelChange(po,changeType,list); if (error != null && error.length() > 0) return error; } propertyName=po.get_TableName() + po.getAD_Client_ID(); list=m_modelChangeListeners.get(propertyName); if (list != null) { String error=fireModelChange(po,changeType,list); if (error != null && error.length() > 0) return error; } List<MTableScriptValidator> scriptValidators=MTableScriptValidator.getModelValidatorRules(po.getCtx(),po.get_Table_ID(),ModelValidator.tableEventValidators[changeType]); if (scriptValidators != null) { for ( MTableScriptValidator scriptValidator : scriptValidators) { MRule rule=MRule.get(po.getCtx(),scriptValidator.getAD_Rule_ID()); if (rule != null && rule.isActive() && rule.getRuleType().equals(MRule.RULETYPE_JSR223ScriptingAPIs) && rule.getEventType().equals(MRule.EVENTTYPE_ModelValidatorTableEvent)) { String error; try { ScriptEngine engine=rule.getScriptEngine(); MRule.setContext(engine,po.getCtx(),0); engine.put(MRule.ARGUMENTS_PREFIX + "Ctx",po.getCtx()); engine.put(MRule.ARGUMENTS_PREFIX + "PO",po); engine.put(MRule.ARGUMENTS_PREFIX + "Type",changeType); engine.put(MRule.ARGUMENTS_PREFIX + "Event",ModelValidator.tableEventValidators[changeType]); Object retval=engine.eval(rule.getScript()); error=(retval == null ? "" : retval.toString()); } catch ( Exception e) { e.printStackTrace(); error=e.toString(); } if (error != null && error.length() > 0) return error; } } } return null; }
Fire Model Change. Call modelChange method of added validators
public void write(ByteCodeWriter out) throws IOException { out.writeUTF8Const(getName()); out.writeInt(_value.length); out.write(_value,0,_value.length); }
Writes the field to the output.
public static void writeStringToFile(File file,String data,boolean append) throws IOException { writeStringToFile(file,data,Charset.defaultCharset(),append); }
Writes a String to a file creating the file if it does not exist using the default encoding for the VM.
public void shutdown(){ mClassNameToClassMap.clear(); mPackageMonitor.unregister(); }
Clears the package cache and unregisteres the package monitor
public static Date monthBefore(final Date date){ return dateFrom(date,1,CalendarUnit.MONTH,Occurrence.BEFORE); }
Finds the date value for one month before the specified time.
public boolean isActive(){ return active; }
Reports whether or not this <code>DropTarget</code> is currently active (ready to accept drops). <P>
public void testEquals(){ UsernameAttribute usernameAttribute2=new UsernameAttribute(); usernameAttribute2.setUsername(usernameValue.getBytes()); assertEquals("testequals failed",usernameAttribute,usernameAttribute2); usernameAttribute2=new UsernameAttribute(); usernameAttribute2.setUsername("some other username".getBytes()); assertFalse("testequals failed",usernameAttribute.equals(usernameAttribute2)); assertFalse("testequals failed",usernameAttribute.equals(null)); }
Test Equals
public static void checkInt(Integer expected,IonValue actual){ checkInt((expected == null ? null : expected.longValue()),actual); }
Checks that the value is an IonInt with the given value.
public static DeposePrimaryBucketResponse send(InternalDistributedMember recipient,PartitionedRegion region,int bucketId){ Assert.assertTrue(recipient != null,"DeposePrimaryBucketMessage NULL recipient"); DeposePrimaryBucketResponse response=new DeposePrimaryBucketResponse(region.getSystem(),recipient,region); DeposePrimaryBucketMessage msg=new DeposePrimaryBucketMessage(recipient,region.getPRId(),response,bucketId); Set<InternalDistributedMember> failures=region.getDistributionManager().putOutgoing(msg); if (failures != null && failures.size() > 0) { return null; } region.getPrStats().incPartitionMessagesSent(); return response; }
Sends a message to depose the primary bucket.
public CompositeTransferable(){ }
Creates a new instance of CompositeTransferable
public static <T extends SerializableEntity>Deserializer roundtripSerializableEntityWithBinarySerializer(final T originalEntity,final AccountLookup accountLookup){ final BinarySerializer binarySerializer=new BinarySerializer(); originalEntity.serialize(binarySerializer); return new BinaryDeserializer(binarySerializer.getBytes(),new DeserializationContext(accountLookup)); }
Serializes originalEntity and returns a binary Deserializer that can deserialize it.
private void addExternalLinks(Document doc,Eml eml) throws DocumentException { if (!eml.getPhysicalData().isEmpty()) { Paragraph p=new Paragraph(); p.setAlignment(Element.ALIGN_JUSTIFIED); p.setFont(font); p.add(new Phrase(getText("rtf.dtasets.external"),fontTitle)); p.add(Chunk.NEWLINE); p.add(Chunk.NEWLINE); for ( PhysicalData data : eml.getPhysicalData()) { p.add(new Phrase(getText("rtf.datasets.description"),fontTitle)); p.add(Chunk.NEWLINE); if (exists(data.getName())) { p.add(new Phrase(getText("rtf.datasets.object") + ": ",fontTitle)); p.add(data.getName()); p.add(Chunk.NEWLINE); } if (exists(data.getCharset())) { p.add(new Phrase(getText("rtf.datasets.character") + ": ",fontTitle)); p.add(data.getCharset()); p.add(Chunk.NEWLINE); } if (exists(data.getFormat())) { p.add(new Phrase(getText("rtf.datasets.format") + ": ",fontTitle)); p.add(data.getFormat()); p.add(Chunk.NEWLINE); } if (exists(data.getFormatVersion())) { p.add(new Phrase(getText("rtf.datasets.format.version") + ": ",fontTitle)); p.add(data.getFormatVersion()); p.add(Chunk.NEWLINE); } if (exists(data.getDistributionUrl())) { p.add(new Phrase(getText("rtf.datasets.distribution") + ": ",fontTitle)); Anchor distributionLink=new Anchor(data.getDistributionUrl(),fontLink); distributionLink.setReference(data.getDistributionUrl()); p.add(distributionLink); p.add(Chunk.NEWLINE); } p.add(Chunk.NEWLINE); } doc.add(p); p.clear(); } }
Add external links section.
public AuditLogTooManyRowsException(){ super(); }
Constructs a new exception with <code>null</code> as its detail message. The cause is not initialized.
private void createContent(){ switch (this.alignment) { case SWT.CENTER: createSeparator(); createTitle(); createSeparator(); break; case SWT.LEFT: createTitle(); createSeparator(); break; default : createSeparator(); createTitle(); break; } }
Create the content
public Class<?> findClass(String className,ClassLoader loader) throws ReflectionException { return loadClass(className,loader); }
Gets the class for the specified class name using the MBean Interceptor's classloader
public boolean isSetRegisterRequest(){ return this.registerRequest != null; }
Returns true if field registerRequest is set (has been assigned a value) and false otherwise
public boolean rejectIt(){ log.info("rejectIt - " + toString()); setIsApproved(false); return true; }
Reject Approval
private void prepareTechnicalProduct(TechnicalProduct tProd) throws NonUniqueBusinessKeyException { ParameterDefinition pd=TechnicalProducts.addParameterDefinition(ParameterValueType.INTEGER,"intParam",ParameterType.SERVICE_PARAMETER,tProd,mgr,null,null,true); ParameterOption option=new ParameterOption(); option.setOptionId("OPT"); option.setParameterDefinition(pd); List<ParameterOption> list=new ArrayList<ParameterOption>(); list.add(option); pd.setOptionList(list); mgr.persist(option); TechnicalProducts.addEvent("eventId",EventType.SERVICE_EVENT,tProd,mgr); }
Creates a parameter definition for the technical product and also an option for it. Furthermore an event definition for the technical product is created.
private boolean hasHour(){ return getHour() != null; }
Determines if the hour component is set.
public Tasks<BlockSnapshotSessionRestRep> linkTargets(URI snapshotSessionId,SnapshotSessionLinkTargetsParam linkTargetsParam){ return postTasks(linkTargetsParam,getIdUrl() + "/link-targets",snapshotSessionId); }
Create and link new targets to an existing BlockSnapshotSession instance. <p> API Call: <tt>POST /block/snapshot-sessions/{id}/link-targets</tt>
protected void appendAndPush(StylesheetHandler handler,ElemTemplateElement elem) throws org.xml.sax.SAXException { handler.pushElemTemplateElement(elem); }
Append the current template element to the current template element, and then push it onto the current template element stack.
public boolean storesUpperCaseQuotedIdentifiers() throws SQLException { return false; }
Does the database treat mixed case quoted SQL identifiers as case insensitive and store them in upper case?
public static String validateCheckNo(String CheckNo){ int length=checkNumeric(CheckNo).length(); if (length > 0) return ""; return "PaymentBankCheckNotValid"; }
Validate Check No
public final void initLineSource(String lineSource){ if (lineSource == null) throw new IllegalArgumentException(); if (this.lineSource != null) throw new IllegalStateException(); this.lineSource=lineSource; }
Initialize the text of the source line containing the error.
public boolean isLogicalFunction(){ return false; }
Pow is not a logical function.
public void remove(String name){ if (impl.formalArguments == null) { if (impl.hasFormalArgs) { throw new IllegalArgumentException("no such attribute: " + name); } return; } FormalArgument arg=impl.formalArguments.get(name); if (arg == null) { throw new IllegalArgumentException("no such attribute: " + name); } locals[arg.index]=EMPTY_ATTR; }
Remove an attribute value entirely (can't remove attribute definitions).
private void deleteObsoleteEntries(DBTransaction transaction,Set<SearchIndexEntry> toDelete) throws SQLException { StringBuilder sql=new StringBuilder(); sql.append("DELETE FROM searchindex WHERE id IN ("); boolean first=true; for ( SearchIndexEntry entry : toDelete) { if (first) { first=false; } else { sql.append(","); } sql.append(String.valueOf(entry.getDbId())); } sql.append(")"); if (!first) { transaction.execute(sql.toString(),null); } }
deletes obsolte entries
public FciMax(IndependenceTest independenceTest){ if (independenceTest == null || knowledge == null) { throw new NullPointerException(); } this.independenceTest=independenceTest; this.variables.addAll(independenceTest.getVariables()); buildIndexing(independenceTest.getVariables()); }
Constructs a new FCI search for the given independence test and background knowledge.
public void testOffer(){ storedQueue.clear(); assertTrue(storedQueue.isEmpty()); assertTrue(storedQueue.offer(String.valueOf(0))); assertTrue(storedQueue.offer(String.valueOf(1))); assertEquals(2,storedQueue.size()); }
Offer succeeds
private void loadDrawerFragments(){ getSupportFragmentManager().beginTransaction().replace(R.id.nav_drawer_container,new NavigationDrawerFragment()).commit(); mQueueDrawerFragment=new QueueDrawerFragment(); getSupportFragmentManager().beginTransaction().replace(R.id.current_queue_drawer_container,mQueueDrawerFragment).commit(); }
Loads the drawer fragments.
public static byte[] serializeToByteArray(Object value){ try { ByteArrayOutputStream buffer=new ByteArrayOutputStream(); try (ObjectOutputStream oos=new ObjectOutputStream(buffer)){ oos.writeObject(value); } return buffer.toByteArray(); } catch ( IOException exn) { throw new IllegalArgumentException("unable to serialize " + value,exn); } }
Serializes the argument into an array of bytes, and returns it.
private static boolean isIPv6(String host){ return host.contains(":"); }
Checks if the given host name string contains ':' as in IPv6 host address.
public static void storeBugCollection(IProject project,final SortedBugCollection bugCollection,IProgressMonitor monitor) throws IOException, CoreException { project.setSessionProperty(SESSION_PROPERTY_BUG_COLLECTION,bugCollection); if (bugCollection != null) { writeBugCollection(project,bugCollection,monitor); } }
Store a new bug collection for a project. The collection is stored in the session, and also in a file in the project.
public void lineTo(float x,float y){ mPoints.add(PathPoint.lineTo(x,y)); }
Create a straight line from the current path point to the new one specified by x and y.
public int vLength(){ return nV; }
Get number of ControlPoints in v direction
public void testUnsupportedOldIndexes() throws Exception { for (int i=0; i < unsupportedNames.length; i++) { if (VERBOSE) { System.out.println("TEST: index " + unsupportedNames[i]); } Path oldIndexDir=createTempDir(unsupportedNames[i]); TestUtil.unzip(getDataInputStream("unsupported." + unsupportedNames[i] + ".zip"),oldIndexDir); BaseDirectoryWrapper dir=newFSDirectory(oldIndexDir); dir.setCheckIndexOnClose(false); IndexReader reader=null; IndexWriter writer=null; try { reader=DirectoryReader.open(dir); fail("DirectoryReader.open should not pass for " + unsupportedNames[i]); } catch ( IndexFormatTooOldException e) { if (e.getReason() != null) { assertNull(e.getVersion()); assertNull(e.getMinVersion()); assertNull(e.getMaxVersion()); assertEquals(e.getMessage(),new IndexFormatTooOldException(e.getResourceDescription(),e.getReason()).getMessage()); } else { assertNotNull(e.getVersion()); assertNotNull(e.getMinVersion()); assertNotNull(e.getMaxVersion()); assertTrue(e.getMessage(),e.getMaxVersion() >= e.getMinVersion()); assertTrue(e.getMessage(),e.getMaxVersion() < e.getVersion() || e.getVersion() < e.getMinVersion()); assertEquals(e.getMessage(),new IndexFormatTooOldException(e.getResourceDescription(),e.getVersion(),e.getMinVersion(),e.getMaxVersion()).getMessage()); } if (VERBOSE) { System.out.println("TEST: got expected exc:"); e.printStackTrace(System.out); } } finally { if (reader != null) reader.close(); reader=null; } try { writer=new IndexWriter(dir,newIndexWriterConfig(new MockAnalyzer(random())).setCommitOnClose(false)); fail("IndexWriter creation should not pass for " + unsupportedNames[i]); } catch ( IndexFormatTooOldException e) { if (e.getReason() != null) { assertNull(e.getVersion()); assertNull(e.getMinVersion()); assertNull(e.getMaxVersion()); assertEquals(e.getMessage(),new IndexFormatTooOldException(e.getResourceDescription(),e.getReason()).getMessage()); } else { assertNotNull(e.getVersion()); assertNotNull(e.getMinVersion()); assertNotNull(e.getMaxVersion()); assertTrue(e.getMessage(),e.getMaxVersion() >= e.getMinVersion()); assertTrue(e.getMessage(),e.getMaxVersion() < e.getVersion() || e.getVersion() < e.getMinVersion()); assertEquals(e.getMessage(),new IndexFormatTooOldException(e.getResourceDescription(),e.getVersion(),e.getMinVersion(),e.getMaxVersion()).getMessage()); } if (VERBOSE) { System.out.println("TEST: got expected exc:"); e.printStackTrace(System.out); } assertTrue("got exc message: " + e.getMessage(),e.getMessage().indexOf("path=\"") != -1); } finally { if (writer != null) { try { writer.commit(); } finally { writer.close(); } } writer=null; } ByteArrayOutputStream bos=new ByteArrayOutputStream(1024); CheckIndex checker=new CheckIndex(dir); checker.setInfoStream(new PrintStream(bos,false,IOUtils.UTF_8)); CheckIndex.Status indexStatus=checker.checkIndex(); assertFalse(indexStatus.clean); assertTrue(bos.toString(IOUtils.UTF_8).contains(IndexFormatTooOldException.class.getName())); checker.close(); dir.close(); } }
This test checks that *only* IndexFormatTooOldExceptions are thrown when you open and operate on too old indexes!
public void archiveList(){ }
Archive current list when user selects "Archive" menu item
@Override public int eBaseStructuralFeatureID(int derivedFeatureID,Class<?> baseClass){ if (baseClass == VariableEnvironmentElement.class) { switch (derivedFeatureID) { default : return -1; } } if (baseClass == NamedElement.class) { switch (derivedFeatureID) { default : return -1; } } if (baseClass == PropertyNameOwner.class) { switch (derivedFeatureID) { case N4JSPackage.PROPERTY_ASSIGNMENT__DECLARED_NAME: return N4JSPackage.PROPERTY_NAME_OWNER__DECLARED_NAME; default : return -1; } } if (baseClass == TypableElement.class) { switch (derivedFeatureID) { default : return -1; } } return super.eBaseStructuralFeatureID(derivedFeatureID,baseClass); }
<!-- begin-user-doc --> <!-- end-user-doc -->
public WriteBuffer putVarInt(int x){ DataUtils.writeVarInt(ensureCapacity(5),x); return this; }
Write a variable size integer.
public static void UF8(double[] x,double[] f,int nx){ int count1=0; int count2=0; int count3=0; double sum1=0.0; double sum2=0.0; double sum3=0.0; double yj; for (int j=3; j <= nx; j++) { yj=x[j - 1] - 2.0 * x[1] * Math.sin(2.0 * PI * x[0] + j * PI / nx); if (j % 3 == 1) { sum1+=yj * yj; count1++; } else if (j % 3 == 2) { sum2+=yj * yj; count2++; } else { sum3+=yj * yj; count3++; } } f[0]=Math.cos(0.5 * PI * x[0]) * Math.cos(0.5 * PI * x[1]) + 2.0 * sum1 / (double)count1; f[1]=Math.cos(0.5 * PI * x[0]) * Math.sin(0.5 * PI * x[1]) + 2.0 * sum2 / (double)count2; f[2]=Math.sin(0.5 * PI * x[0]) + 2.0 * sum3 / (double)count3; }
Evaluates the UF8 problem.
@Override public void report(){ }
Let each extractor output some stuff to STDERR.
public static NormalizedUrl create(String url) throws MalformedURLException { return Url.create(url).normalize(); }
Returns a normalized url given a single url.
protected void resetInputValue(){ if (inputComponent != null && (inputComponent instanceof JTextField)) { optionPane.setInputValue(((JTextField)inputComponent).getText()); } else if (inputComponent != null && (inputComponent instanceof JComboBox)) { optionPane.setInputValue(((JComboBox)inputComponent).getSelectedItem()); } else if (inputComponent != null) { optionPane.setInputValue(((JList)inputComponent).getSelectedValue()); } }
Sets the input value in the option pane the receiver is providing the look and feel for based on the value in the inputComponent.
public static void editTextNodeComment(final SQLProvider provider,final INaviTextNode textNode,final Integer commentId,final Integer userId,final String newComment) throws CouldntSaveDataException { Preconditions.checkNotNull(provider,"IE02505: provider argument can not be null"); Preconditions.checkNotNull(textNode,"IE02506: groupNode argument can not be null"); Preconditions.checkNotNull(commentId,"IE02507: commentId argument can not be null"); Preconditions.checkNotNull(userId,"IE02508: userId argument can not be null"); Preconditions.checkNotNull(newComment,"IE02509: newComment argument can not be null"); PostgreSQLCommentFunctions.editComment(provider,commentId,userId,newComment); }
Edits a text node comment.
private void inorder(){ inorder(root); }
Inorder traversal from the root
public boolean isAlwaysFalse(){ return compareType == Comparison.FALSE; }
Check if the result is always false.
public void startCDATA() throws SAXException { m_handler.startCDATA(); }
Pass the call on to the underlying handler