code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public void initializeWith(IntArrayList list,DictionaryMap map){
for ( int key : list) {
add(map.get(key));
}
}
| Initializes this Column with the given values for performance |
public ResultEntry(NondominatedPopulation population,TypedProperties properties){
this(population,properties == null ? null : properties.getProperties());
}
| Constructs a result file entry with the specified non-dominated population and auxiliary properties. |
public double time(){
return getTime();
}
| Returns the current timestep |
public void shutDown(){
FrescoPlusCore.shutDownDraweeControllerBuilderSupplier();
FrescoPlusView.shutDown();
ImagePipelineFactory.shutDown();
}
| Shuts FrescoPlusInitializer down. |
public void write(byte x){
writeByte(x & 0xff);
}
| Writes the 8-bit byte to the binary output stream. |
public void filterUnsafeOrUnnecessaryRequest(Map<String,NodeReqResponse> nodeDataMapValidSource,Map<String,NodeReqResponse> nodeDataMapValidSafe){
for ( Entry<String,NodeReqResponse> entry : nodeDataMapValidSource.entrySet()) {
String hostName=entry.getKey();
NodeReqResponse nrr=entry.getValue();
Map<Str... | Filter unsafe or unnecessary request. |
public boolean contains(String key){
return sharedPreferences.contains(key);
}
| Checks whether the preferences contains a preference. |
private static String massageURI(String uri){
uri=uri.trim();
int protocolEnd=uri.indexOf(':');
if (protocolEnd < 0) {
uri="http://" + uri;
}
else if (isColonFollowedByPortNumber(uri,protocolEnd)) {
uri="http://" + uri;
}
return uri;
}
| Transforms a string that represents a URI into something more proper, by adding or canonicalizing the protocol. |
public void removeElements(final int from,final int to){
it.unimi.dsi.fastutil.Arrays.ensureFromTo(size,from,to);
System.arraycopy(a,to,a,from,size - to);
size-=(to - from);
int i=to - from;
while (i-- != 0) a[size + i]=null;
}
| Removes elements of this type-specific list using optimized system calls. |
public void addAttributeNS(QName name,String type,String value){
int index=fLength;
if (fLength++ == fAttributes.length) {
Attribute[] attributes;
if (fLength < SIZE_LIMIT) {
attributes=new Attribute[fAttributes.length + 4];
}
else {
attributes=new Attribute[fAttributes.length << 1];
}
... | Adds an attribute. The attribute's non-normalized value of the attribute will have the same value as the attribute value until set using the <code>setNonNormalizedValue</code> method. Also, the added attribute will be marked as specified in the XML instance document unless set otherwise using the <code>setSpecified</co... |
private static void copySwap(Object[] src,int from,Object[] dst,int to,int len){
if (src == dst && from + len > to) {
int new_to=to + len - 1;
for (; from < to; from++, new_to--, len--) {
dst[new_to]=src[from];
}
for (; len > 1; from++, new_to--, len-=2) {
swap(from,new_to,dst);
}
}
... | Copies object from one array to another array with reverse of objects order. Source and destination arrays may be the same. |
public double distance(Vector3 a){
return Vector3.distance(a,this);
}
| Gets the distance between this Vector3 and a given Vector3. |
@Override public void run(){
amIActive=true;
String streamsHeader=null;
String pointerHeader=null;
String outputHeader=null;
int row, col, x, y;
float progress=0;
double z;
int i, c;
int[] dX=new int[]{1,1,1,0,-1,-1,-1,0};
int[] dY=new int[]{-1,0,1,1,1,0,-1,-1};
double[] inflowingVals=new double[]... | Used to execute this plugin tool. |
public ByteVector put8(final long l){
int length=this.length;
if (length + 8 > data.length) {
enlarge(8);
}
byte[] data=this.data;
int i=(int)(l >>> 32);
data[length++]=(byte)(i >>> 24);
data[length++]=(byte)(i >>> 16);
data[length++]=(byte)(i >>> 8);
data[length++]=(byte)i;
i=(int)l;
data[len... | Puts a long into this byte vector. The byte vector is automatically enlarged if necessary. |
public KMLBalloonStyle(String namespaceURI){
super(namespaceURI);
}
| Construct an instance. |
public ShortArrayList bottom(int n){
ShortArrayList bottom=new ShortArrayList();
short[] values=data.toShortArray();
ShortArrays.parallelQuickSort(values);
for (int i=0; i < n && i < values.length; i++) {
bottom.add(values[i]);
}
return bottom;
}
| Returns the smallest ("bottom") n values in the column |
public boolean isConstructor(){
return (Objects.equal(this.getName(),"constructor") && (!this.isStatic()));
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public void closeDialog(){
setVisible(false);
ModificationRegistery.unregisterEditor(getEditor());
doDefaultCloseAction();
}
| Closes the dialog. |
public static char toCharValue(boolean b){
return (char)(b ? 1 : 0);
}
| cast a boolean value to a char value |
public synchronized void clear(){
mCategories.clear();
mValues.clear();
}
| Removes all the existing values from the series. |
public void addDocument(String name,int parentDivId,String fileExt,int sortOrder,String pathDocumentFile,String pathDocAnnFile) throws Exception {
checkExistsParent(parentDivId);
checkValidDocumentName(parentDivId,name);
m_documents.addNewDocument(name,parentDivId,fileExt,sortOrder,pathDocumentFile,pathDocAnnFile... | Agrega un nuevo documento a un clasificador |
public void onDown(long time){
mDragLock=DragLock.NONE;
if (mOverviewAnimationType == OverviewAnimationType.NONE) {
stopScrollingMovement(time);
}
mScrollingTab=null;
commitDiscard(time,false);
}
| Get called on down touch event. |
protected InferredType mergeTarget(final TypeVariable target,final InferenceResult subordinate){
final InferredValue inferred=this.get(target);
if (inferred instanceof InferredTarget) {
InferredType newType=mergeTarget(((InferredTarget)inferred).target,subordinate);
if (newType == null) {
final Inferr... | Performs a merge for a specific target, we keep only results that lead to a concrete type |
private void timeout(boolean suspectThem,boolean severeAlert){
if (!this.processTimeout()) return;
Set activeMembers=getDistributionManagerIds();
long timeout=getAckWaitThreshold();
final Object[] msgArgs=new Object[]{Long.valueOf(timeout + (severeAlert ? getSevereAlertThreshold() : 0)),this,getDistributionMa... | process a wait-timeout. Usually suspectThem would be used in the first timeout, followed by a subsequent use of disconnectThem |
@Override public void updateAsciiStream(int columnIndex,InputStream x,long length) throws SQLException {
try {
if (isDebugEnabled()) {
debugCode("updateAsciiStream(" + columnIndex + ", x, "+ length+ "L);");
}
checkClosed();
Value v=conn.createClob(IOUtils.getAsciiReader(x),length);
update(co... | Updates a column in the current or insert row. |
public static void alert(Context context,OsmElement e){
Preferences prefs=new Preferences(context);
if (!prefs.generateAlerts()) {
return;
}
LocationManager locationManager=(LocationManager)context.getApplicationContext().getSystemService(Context.LOCATION_SERVICE);
Location location=null;
try {
loca... | Generate an alert/notification if something is problematic about the OSM object |
private MutableBigInteger divideLongMagnitude(long ldivisor,MutableBigInteger quotient){
MutableBigInteger rem=new MutableBigInteger(new int[intLen + 1]);
System.arraycopy(value,offset,rem.value,1,intLen);
rem.intLen=intLen;
rem.offset=1;
int nlen=rem.intLen;
int limit=nlen - 2 + 1;
if (quotient.value.len... | Divide this MutableBigInteger by the divisor represented by positive long value. The quotient will be placed into the provided quotient object & the remainder object is returned. |
public boolean isFatalEnabled(){
return (getLogger().isLoggable(Level.SEVERE));
}
| Is fatal logging currently enabled? |
private void addProteinToBatch(Protein protein){
proteinsAwaitingPersistence.add(protein);
if (proteinsAwaitingPersistence.size() == proteinInsertBatchSize) {
persistBatch();
}
}
| Adds a protein to the batch of proteins to be persisted. If the maximum batch size is reached, store all these proteins (by calling persistBatch().) |
public Account(Account other){
if (other.isSetUserid()) {
this.userid=other.userid;
}
if (other.isSetPasswd()) {
this.passwd=other.passwd;
}
}
| Performs a deep copy on <i>other</i>. |
public final AC shrink(){
return shrink(100f,curIx);
}
| Specifies that the current row/column's shrink weight withing the columns/rows with the <code>shrink priority</code> 100f. <p> Same as <code>shrink(100f)</code>. <p> For a more thorough explanation of what this constraint does see the White Paper or Cheat Sheet at www.migcomponents.com. |
public Optional<T> filter(Predicate<? super T> predicate){
if (!isPresent()) return this;
return predicate.test(value) ? this : Optional.<T>empty();
}
| Performs filtering on inner value if present. |
private DateUtils(){
}
| This class should not be instantiated. |
@Override protected EClass eStaticClass(){
return TypesPackage.Literals.TENUM;
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public void sort(ArrayList<Value[]> rows){
Collections.sort(rows,this);
}
| Sort a list of rows. |
private void generateMatrix(){
final int dwidth=mDrawable.getIntrinsicWidth();
final int dheight=mDrawable.getIntrinsicHeight();
final int vwidth=mAllowCrop ? sCropSize : getWidth();
final int vheight=mAllowCrop ? sCropSize : getHeight();
final boolean fits=(dwidth < 0 || vwidth == dwidth) && (dheight < 0 || ... | Generates the initial transformation matrix for drawing. Additionally, it sets the minimum and maximum scale values. |
public LingRunner(GraphSource graphWrapper,Parameters params,KnowledgeBoxModel knowledgeBoxModel){
super(graphWrapper.getGraph(),params,knowledgeBoxModel);
}
| Constucts a wrapper for the given EdgeListGraph. |
protected void onServiceStarted(){
}
| Called when the service has been started. The device name and address are set. It nRF Logger is installed than logger was also initialized. |
private int indexOf(K key){
for (int i=0, n=entries.size(); i < n; i++) if (keyEquality.areEqual(entries.get(i).getKey(),key)) return i;
return -1;
}
| Returns the index for the specified key. |
public void addNotificationListener(NotificationListener listener,NotificationFilter filter,Object handback) throws IllegalArgumentException {
broadcaster.addNotificationListener(listener,filter,handback);
}
| MBean Notification support You shouldn't update these methods |
public double calculateSimilarity(PatternReference pattern){
if (patterns.isEmpty()) {
return 0;
}
else {
final double sum=patterns.stream().map(null).reduce(0.0,null);
return sum / size();
}
}
| Calculate similarity (similarity measure is as defined by the pattern). |
protected void update(ControlDecoration decoration,IStatus status){
if (status == null || status.isOK()) {
decoration.hide();
}
else {
decoration.setImage(getImage(status));
decoration.setDescriptionText(getDescriptionText(status));
decoration.showHoverText(getDescriptionText(status));
decorati... | Updates the visibility, image, and description text of the given ControlDecoration to represent the given status. |
public TransferSubscriptionsResponse TransferSubscriptions(RequestHeader RequestHeader,UnsignedInteger[] SubscriptionIds,Boolean SendInitialValues) throws ServiceFaultException, ServiceResultException {
TransferSubscriptionsRequest req=new TransferSubscriptionsRequest(RequestHeader,SubscriptionIds,SendInitialValues);... | Synchronous TransferSubscriptions service request. |
protected void loadSteps(){
if (stepsHash != null) {
loadStepsSet();
return;
}
if (toReplace != null) {
steps=toReplace;
size=steps.length;
toReplace=null;
}
int toBeRemovedSize=toBeRemoved.size();
if (toBeRemovedSize > 0) {
boolean ensuresOrder=this.ensuresOrder && canEnsureOrder();... | Subclasses should call this method as more or less the first thing in their step(...) method. This method replaces, removes, and adds new Steppables to the internal array as directed by the user. After calling this method, the Sequence is ready to have the Steppables in its internal array stepped. |
public static void formatJapaneseNumber(Editable text){
JapanesePhoneNumberFormatter.format(text);
}
| Formats a phone number in-place using the Japanese formatting rules. Numbers will be formatted as: <p><code> 03-xxxx-xxxx 090-xxxx-xxxx 0120-xxx-xxx +81-3-xxxx-xxxx +81-90-xxxx-xxxx </code></p> |
public static int[] matrixToArray(int[][] input,int fromRow,int rows,int fromColumn,int columns){
int[] output=new int[rows * columns];
for (int c=0; c < columns; c++) {
for (int r=0; r < rows; r++) {
output[c * rows + r]=input[r + fromRow][c + fromColumn];
}
}
return output;
}
| Converts a 2 dimensional array into a single dimension. Places each column on top of each other. Provides controllers for selecting a subset of rows or columns. |
@Override public void map(LongWritable key,Text value,Context context) throws IOException, InterruptedException {
heartBeater.needHeartBeat();
try {
runner.map(value.toString(),context.getConfiguration(),context);
}
finally {
heartBeater.cancelHeartBeat();
}
}
| Extract content from the path specified in the value. Key is useless. |
public boolean isPersistent(){
return persistent;
}
| Check if this database disk-based. |
@EventHandler public void onPlayerJoin(PlayerJoinEvent event){
Player player=event.getPlayer();
playerChannels.put(player,new PlayerChannel(player));
}
| Adds a new player channel whenever a player joins the server. |
public void undoCommand(IUndoableCommand command){
IUndoableCommand temp;
do {
temp=undoStack.pop();
temp.undo();
redoStack.push(temp);
}
while (temp != command);
fireOperationsHistoryChanged();
}
| Undo the command. Restore the state of the target to the previous state before this command has been executed. |
private static void checkEqualPartitionMaps(Map<Integer,ClusterNode> map1,Map<Integer,ClusterNode> map2){
assertEquals(map1.size(),map2.size());
for ( Integer i : map1.keySet()) {
assertTrue(map2.containsKey(i));
assertEquals(map1.get(i),map2.get(i));
}
}
| Check equal maps. |
public TransactionDeadlockException(String msg){
super(msg);
}
| Creates new deadlock exception with given error message. |
public void put(AuthTimeWithHash t,KerberosTime currentTime) throws KrbApErrException {
if (entries.isEmpty()) {
entries.addFirst(t);
}
else {
AuthTimeWithHash temp=entries.getFirst();
int cmp=temp.compareTo(t);
if (cmp < 0) {
entries.addFirst(t);
}
else if (cmp == 0) {
throw n... | Puts the authenticator timestamp into the cache in descending order, and throw an exception if it's already there. |
public int selectedWaysCount(){
return selectedWays == null ? 0 : selectedWays.size();
}
| Return how many ways are selected |
public void init(ServletConfig config) throws ServletException {
super.init(config);
if (!WebEnv.initWeb(config)) throw new ServletException("BasketServlet.init");
}
| Initialize global variables |
@SuppressWarnings("unchecked") public static final <K,V>Map<K,V> mergeMapEntry(CodedInputByteBufferNano input,Map<K,V> map,MapFactory mapFactory,int keyType,int valueType,V value,int keyTag,int valueTag) throws IOException {
map=mapFactory.forMap(map);
final int length=input.readRawVarint32();
final int oldLimit=... | Merges the map entry into the map field. Note this is only supposed to be called by generated messages. |
public synchronized boolean hasService(Class serviceClass){
if (serviceClass == null) throw new NullPointerException("serviceClass");
synchronized (BeanContext.globalHierarchyLock) {
if (services.containsKey(serviceClass)) return true;
BeanContextServices bcs=null;
try {
bcs=(BeanContextServic... | has a service, which may be delegated |
public static int readSingleByte(InputStream in) throws IOException {
byte[] buffer=new byte[1];
int result=in.read(buffer,0,1);
return (result != -1) ? buffer[0] & 0xff : -1;
}
| Implements InputStream.read(int) in terms of InputStream.read(byte[], int, int). InputStream assumes that you implement InputStream.read(int) and provides default implementations of the others, but often the opposite is more efficient. |
public static void tred2(int n,double[][] V,double[] d,double[] e){
for (int j=0; j < n; j++) {
d[j]=V[n - 1][j];
}
for (int i=n - 1; i > 0; i--) {
double scale=0.0;
double h=0.0;
for (int k=0; k < i; k++) {
scale=scale + Math.abs(d[k]);
}
if (scale == 0.0) {
e[i]=d[i - 1];
... | Symmetric Householder reduction to tridiagonal form, taken from JAMA package. This is derived from the Algol procedures tred2 by Bowdler, Martin, Reinsch, and Wilkinson, Handbook for Auto. Comp., Vol.ii-Linear Algebra, and the corresponding Fortran subroutine in EISPACK. |
public void addMessageListener(MessageListener listener){
m_notifier.add(listener);
}
| addMessageListener() - |
public static final int[] toIntArray(String s){
s=new String(s.trim());
if (s.length() <= 2) return new int[]{};
return toIntArray((s.substring(1,s.length() - 1)).split(","));
}
| ToIntArray - Return an int[] from a String, e.g., "[0,1,2,0]" to [0,1,2,3]. |
public LambdaBlock(ToplevelPane pane,int arity){
super(pane);
this.loadFXML("LambdaBlock");
this.arity=arity;
this.signature.setText("");
this.explicitSignature=Optional.empty();
this.definitionName.setText("");
this.definitionName.setVisible(false);
this.allDefinitionUsers=new ArrayList<>();
this.bod... | Constructs a DefinitionBlock that is an untyped lambda of n arguments. |
void unlink(Node<E> p,Node<E> trail){
p.item=null;
trail.next=p.next;
if (last == p) last=trail;
if (count.getAndDecrement() == capacity) notFull.signal();
}
| Unlinks interior Node p with predecessor trail. |
public static void i(String msg,Throwable thr){
if (DEBUG) Log.i(TAG,buildMessage(msg),thr);
}
| Send a INFO log message and log the exception. |
public SpotPrice toAwsObject(){
SpotPrice spotPrice=new SpotPrice();
spotPrice.setAvailabilityZone(availabilityZone);
spotPrice.setInstanceType(type);
spotPrice.setSpotPrice(this.spotPrice);
return spotPrice;
}
| Converts this object into an AWS equivalent object. |
public static SnmpEngineId createEngineId(int port) throws UnknownHostException {
int suniana=42;
InetAddress address=null;
address=InetAddress.getLocalHost();
return createEngineId(address,port,suniana);
}
| Generates a unique engine Id. The engine Id unicity is based on the host IP address and port. The IP address used is the localhost one. The creation algorithm uses the SUN Microsystems IANA number (42). |
private void returnData(Object ret){
if (myHost != null) {
myHost.returnData(ret);
}
}
| Used to communicate a return object from a plugin tool to the main Whitebox user-interface. |
private DoubleDBIDList refineRange(DoubleDBIDList neighc,double adjustedEps){
ModifiableDoubleDBIDList n=DBIDUtil.newDistanceDBIDList(neighc.size());
for (DoubleDBIDListIter neighbor=neighc.iter(); neighbor.valid(); neighbor.advance()) {
DoubleDBIDPair p=neighbor.getPair();
double dist=p.doubleValue();
... | Refine a range query. |
@Override protected void tearDown() throws Exception {
terminateApplication();
mApplication=null;
scrubClass(ApplicationTestCase.class);
super.tearDown();
}
| Shuts down the Application under test. Also makes sure all resources are cleaned up and garbage collected before moving on to the next test. Subclasses that override this method should make sure they call super.tearDown() at the end of the overriding method. |
public int skipBytes(int num) throws IOException {
return inputStream.skipBytes(num);
}
| skip ahead in the stream |
public final int countActions(){
return mActions.size();
}
| Return the number of actions in the filter. |
@Override public void run(){
amIActive=true;
String NIRHeader=null;
String RedHeader=null;
String outputHeader=null;
int row, col, x, y;
double[] NIRVal;
double[] redVal;
float progress=0;
int a;
if (args.length <= 0) {
showFeedback("Plugin parameters have not been set.");
return;
}
for ... | Used to execute this plugin tool. |
public Vector3f normalize(){
float length=x * x + y * y + z * z;
if (length != 1f && length != 0f) {
length=1.0f / FastMath.sqrt(length);
return new Vector3f(x * length,y * length,z * length);
}
return clone();
}
| <code>normalize</code> returns the unit vector of this vector. |
@Thunk int compareTitles(String titleA,String titleB){
boolean aStartsWithLetter=(titleA.length() > 0) && Character.isLetterOrDigit(titleA.codePointAt(0));
boolean bStartsWithLetter=(titleB.length() > 0) && Character.isLetterOrDigit(titleB.codePointAt(0));
if (aStartsWithLetter && !bStartsWithLetter) {
return... | Compares two titles with the same return value semantics as Comparator. |
public RE simplifyOps() throws InterruptedException {
if (Thread.interrupted()) throw new InterruptedException();
RE res;
switch (this.op) {
case EMPTY:
case EPSILON:
case RANGE:
case STRING:
return this;
case STAR:
case PLUS:
case OPTION:
res=new RE(this.op);
res.meta=meta;
res.unaryArg=unaryArg.simplifyOp... | For a regular expression that contains string operations, return a regular expression that matches a language of the image of the operations, removing all string operation nodes. This is conservative, and the result may match a superset of the language matched by the original regular expression. |
@Override public void run(){
amIActive=true;
RandomAccessFile rIn=null;
ByteBuffer buf;
String inputFilesString=null;
String[] XYZFiles;
double x, y, north, south, east, west;
double z;
float minValue, maxValue;
float featureValue;
int numVertices;
byte classValue, numReturns, returnNum;
int a, ... | Used to execute this plugin tool. |
protected void decodeAtom(PushbackInputStream inStream,OutputStream outStream,int l) throws IOException {
int i, p1, p2, np1, np2;
byte a=-1, b=-1, c=-1;
byte high_byte, low_byte;
byte tmp[]=new byte[3];
i=inStream.read(tmp);
if (i != 3) {
throw new CEStreamExhausted();
}
for (i=0; (i < 64) && ((a =... | Decode one atom - reads the characters from the input stream, decodes them, and checks for valid parity. |
public void tagFrameLabel(String label) throws IOException {
if (tags != null) {
tags.tagFrameLabel(label);
}
}
| SWFTagTypes interface |
public synchronized void stop(){
watch=false;
notify();
}
| Stop watching. |
public void confirmByte(char lastByte){
pktStat=PacketStatus.COMPLEMENT;
writeChar((char)~lastByte,true);
}
| confirm reception of last byte by sending complement of it back |
public void paint(Graphics a,JComponent b){
for (int i=0; i < uis.size(); i++) {
((ComponentUI)(uis.elementAt(i))).paint(a,b);
}
}
| Invokes the <code>paint</code> method on each UI handled by this object. |
private void encodeDelete(final DiffPart part) throws EncodingException {
data.writeBit(0);
data.writeBit(1);
data.writeBit(1);
data.writeValue(codecData.getBlocksizeS(),part.getStart());
data.writeValue(codecData.getBlocksizeE(),part.getLength());
data.writeFillBits();
}
| Encodes a Delete operation. |
public static Map<String,Object> testRandomAuthorize(DispatchContext dctx,Map<String,? extends Object> context){
Locale locale=(Locale)context.get("locale");
Map<String,Object> result=ServiceUtil.returnSuccess();
String refNum=UtilDateTime.nowAsString();
Random r=new Random();
int i=r.nextInt(9);
if (i < 5 ... | Test authorize - does random declines |
public void testBug19803348() throws Exception {
Connection testConn=null;
try {
testConn=getConnectionWithProps("useInformationSchema=false,getProceduresReturnsFunctions=false,nullCatalogMeansCurrent=false");
DatabaseMetaData dbmd=testConn.getMetaData();
String testDb1="testBug19803348_db1";
String... | Tests fix for BUG#19803348 - GETPROCEDURES() RETURNS INCORRECT O/P WHEN USEINFORMATIONSCHEMA=FALSE. Composed by two parts: 1. Confirm that getProcedures() and getProcedureColumns() aren't returning more results than expected (as per reported bug). 2. Confirm that the results from getProcedures() and getProcedureColumns... |
public StringBuffer numberToString(final String strNumberToConvert){
String strNumber="", signBit="";
if (strNumberToConvert.startsWith("-")) {
strNumber="" + strNumberToConvert.substring(1,strNumberToConvert.length());
signBit="-";
}
else strNumber="" + strNumberToConvert;
final DecimalFormat dft=ne... | function to format amount into to Indaian rupees format |
public double nextDouble(double mean,double gamma,double cut){
if (gamma == 0.0) return mean;
if (cut == Double.NEGATIVE_INFINITY) {
double val=Math.atan(-mean / gamma);
double rval=this.uniform.nextDoubleFromTo(val,Math.PI / 2.0);
double displ=gamma * Math.tan(rval);
return Math.sqrt(mean * mean ... | Returns a mean-squared random number from the distribution; bypasses the internal state. |
public void testRealmJMXAuthenticatorRandomNumberGenerator(){
int randomNumber=SecurityHelper.getRandomInt(0,0,0);
assertTrue(randomNumber == 0);
randomNumber=SecurityHelper.getRandomInt(-1,-10,1);
assertTrue(randomNumber == 0);
randomNumber=SecurityHelper.getRandomInt(-10,2,1);
assertTrue(MessageFormat.for... | Confirm that RealmJMXAuthenticator.getRandomInt(min, max) always returns a coherent value |
public boolean hasRecvSequenceNumber(){
return recvSequenceNumber != null;
}
| Check whether recv sequence number has been set. |
public LicensePanel(AssetPackProject project){
this.project=project;
initComponents();
setName("License");
jTextArea1.setText(project.getLicense());
}
| Creates new form LicensePanel |
public ProcessTerminatedAbnormallyException(final int exitValue,final String message,final Throwable cause){
super(message,cause);
this.exitValue=exitValue;
}
| Constructs an instance of the ProcessTerminatedAbnormallyException class with the given exit value of the process as well as a message indicating the reason of the abnormal termination along with a Throwable representing the underlying cause of the process termination. </p> |
protected void addTrailerToOutput(byte[] msg,int offset,AbstractMRMessage m){
incomingLength=((SerialMessage)m).getResponseLength();
currentAddr=((SerialMessage)m).getAddr();
return;
}
| Although this protocol doesn't use a trailer, we implement this method to set the expected reply length and address for this message. |
public static void main(String... a){
print("Object",new Object());
print("Timestamp",new java.sql.Timestamp(0));
print("Date",new java.sql.Date(0));
print("Time",new java.sql.Time(0));
print("BigDecimal",new BigDecimal("0"));
print("BigInteger",new BigInteger("0"));
print("String",new String("Hello"));
... | Run just this test. |
public SQLException(String theReason,Throwable theCause){
super(theReason,theCause);
}
| Creates an SQLException object. The Reason string is set to the given and the cause Throwable object is set to the given cause Throwable object. |
@Override public void write(byte[] value) throws IOException {
if (isFirstTime) {
init();
isFirstTime=false;
}
checkAndWriteDictionaryChunkToFile();
oneDictionaryChunkList.add(ByteBuffer.wrap(value));
totalRecordCount++;
}
| This method will write the data in thrift format to disk. This method will be guided by parameter dictionary_one_chunk_size and data will be divided into chunks based on this parameter |
public boolean remove(HttpConnection connection){
TimeValues times=connectionToTimes.remove(connection);
if (times == null) {
log.warn("Removing a connection that never existed!");
return true;
}
else {
return System.currentTimeMillis() <= times.timeExpires;
}
}
| Removes the given connection from the list of connections to be closed when idle. This will return true if the connection is still valid, and false if the connection should be considered expired and not used. |
@RequestProcessing(value="/about",method=HTTPRequestMethod.GET) @Before(adviceClass={StopwatchStartAdvice.class,AnonymousViewCheck.class}) @After(adviceClass=StopwatchEndAdvice.class) public void showAbout(final HTTPRequestContext context,final HttpServletRequest request,final HttpServletResponse response) throws Excep... | Shows about. |
protected void sendMessage(boolean flush) throws IOException {
sendMessage();
if (flush) flush();
}
| Send outgoing message and optionally flush stream. |
public void storeOriginals(){
mStartingStartTrim=mStartTrim;
mStartingEndTrim=mEndTrim;
mStartingRotation=mRotation;
}
| If the start / end trim are offset to begin with, store them so that animation starts from that offset. |
private void writeQNameAttribute(java.lang.String namespace,java.lang.String attName,javax.xml.namespace.QName qname,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
java.lang.String attributeNamespace=qname.getNamespaceURI();
java.lang.String attributePrefix=xmlWriter.getPre... | Util method to write an attribute without the ns prefix |
private static Channel configureChannel(ChannelType channel_type) throws IllegalArgumentException {
if (channel_type == null) {
throw new IllegalArgumentException("Cannot configure a network channel from a null type.");
}
ChannelQueue channel=new ChannelQueue(channel_type.getName());
channel.setWeight(chann... | TODO Documentation |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.