code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public RotationAnimation(View view){
this.view=view;
degrees=360;
pivot=PIVOT_CENTER;
interpolator=new AccelerateDecelerateInterpolator();
duration=DURATION_LONG;
listener=null;
}
| This animation rotates the view by a customizable number of degrees and at a customizable pivot point. |
protected void validateClusterHosts(){
if (hostCluster != null) {
VcenterDataCenter datacenter=getModelClient().datacenters().findById(datacenterId);
Cluster cluster=getModelClient().clusters().findById(hostCluster.getId());
ClusterComputeResource vcenterCluster=vmware.getCluster(datacenter.getLabel(),clu... | Validates the vCenter cluster hosts match the same hosts we have in our database for the cluster. If there is a mismatch the check will fail the order. |
public PaymentGatewayExt(){
}
| Creates a new instance of PaymentGatewayExt |
public boolean equals(Object o){
return this == o;
}
| Equal iff the same instance. |
protected Instances headerFromXML() throws Exception {
Instances result;
Element root;
Element node;
Vector<Element> list;
ArrayList<Attribute> atts;
Version version;
int[] classIndex;
root=m_Document.getDocumentElement();
version=new Version();
if (version.isOlder(root.getAttribute(ATT_VERSION))) {... | generates the header from the XML document |
public static void validateInput(String field,String message) throws CheckException {
validateInputSizeMax(field,message,64);
}
| Valid classic input. |
public boolean verifyKeyedChecksum(byte[] data,int size,byte[] key,byte[] checksum,int usage) throws KrbCryptoException {
try {
byte[] newCksum=Aes128.calculateChecksum(key,usage,data,0,size);
return isChecksumEqual(checksum,newCksum);
}
catch ( GeneralSecurityException e) {
KrbCryptoException ke=new ... | Verifies keyed checksum. |
public static ActionBarBackground fadeOut(AppCompatActivity activity){
ActionBarBackground abColor=new ActionBarBackground(activity);
abColor.fadeOut();
return abColor;
}
| Fade the ActionBar background to zero opacity |
public boolean onUpOrCancel(){
boolean state=isPressed();
setPressed(false);
return state;
}
| Set state for an onUpOrCancel event. |
protected void storeState(){
}
| Additional state information, outside of the sub-model is stored by this call. |
public RollingResourceAppender(Layout layout,Resource res,Charset charset,boolean append,RetireListener listener) throws IOException {
this(layout,res,charset,append,DEFAULT_MAX_FILE_SIZE,DEFAULT_MAX_BACKUP_INDEX,60,listener);
}
| Instantiate a RollingFileAppender and open the file designated by <code>filename</code>. The opened filename will become the ouput destination for this appender. <p>If the <code>append</code> parameter is true, the file will be appended to. Otherwise, the file desginated by <code>filename</code> will be truncated befor... |
public int delete(DatabaseConnection databaseConnection,PreparedDelete<T> preparedDelete) throws SQLException {
CompiledStatement stmt=preparedDelete.compile(databaseConnection,StatementType.DELETE);
try {
return stmt.runUpdate();
}
finally {
stmt.close();
}
}
| Delete rows that match the prepared statement. |
protected boolean engineVerify(byte[] sigBytes) throws SignatureException {
if (sigBytes == null) {
throw new NullPointerException("sigBytes == null");
}
return checkSignature(sigBytes,0,0);
}
| Verifies the signature bytes. |
public boolean deleteFriendBytes(byte[] key){
SQLiteDatabase db=getWritableDatabase();
if (db == null) return false;
if (key == null) {
throw new IllegalArgumentException("Null friend deleted through addFriendBytes()");
}
return deleteFriend(bytesToBase64(key));
}
| Delete the given bytes as a friend. |
public void write(String string,Color color){
setForeground(color);
write(string);
}
| Set the foreground to prescribed color and write text to screen |
public static void createImageToFileSystem(String url,Component targetList,int targetOffset,String targetKey,String destFile,Image placeholder,byte priority){
createImageToFileSystem(url,targetList,null,targetOffset,targetKey,destFile,null,priority,placeholder,defaultMaintainAspectRatio);
}
| Constructs an image request that will automatically populate the given list when the response arrives, it will cache the file locally as a file in the file storage. This assumes the GenericListCellRenderer style of list which relies on a map based model approach. |
public TypeConstraintItemProvider(AdapterFactory adapterFactory){
super(adapterFactory);
}
| This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- end-user-doc --> |
public void handleKeepAliveSignal(long platformIdent){
AgentStatusData agentStatusData=agentStatusDataMap.get(platformIdent);
if (null != agentStatusData) {
agentStatusData.setLastKeepAliveTimestamp(System.currentTimeMillis());
if (agentStatusData.getAgentConnection() == AgentConnection.NO_KEEP_ALIVE) {
... | Registers the time when the last keep-alive was received for a given platform ident. |
public FutureW<T> future(String key,Executor ex){
return pipes.oneOrErrorAsync(key,ex);
}
| Asynchronously extract a single data point from the named Queue. |
public byte[] decrypt(byte[] cipherText){
int length=cipherText.length;
if (length % 8 != 0) {
System.out.println("Array must be a multiple of 8");
return null;
}
byte[] clearText=new byte[length];
int count=length / 8;
for (int i=0; i < count; i++) encrypt(cipherText,i * 8,clearText,i * 8);
ret... | decrypts an array where the length must be a multiple of 8 |
public TurnVectors(int normalCount,int totalCount,int ssCount,int jsCount,int wsCount,int dsCount,int scCount,int aeroCount,int evenCount,int min){
this.numEven=evenCount;
this.numNormal=normalCount;
this.numTotal=totalCount;
this.numSS=ssCount;
this.numJS=jsCount;
this.numWS=wsCount;
this.numDS=dsCount;
... | Construct empty <code>Vectors</code> with the given capacities. |
private static long calcSize(long size,long skip,long limit){
return size >= 0 ? Math.max(-1,Math.min(size - skip,limit)) : -1;
}
| Calculates the sliced size given the current size, number of elements skip, and the number of elements to limit. |
public void replaceTags(Map<String,String> newTags){
if (newTags == null) {
throw new IllegalArgumentException("Replacing the current tags with a null map.");
}
tags.clear();
for ( Entry<String,String> tag : newTags.entrySet()) {
putTag(tag.getKey(),tag.getValue());
}
}
| Replacing the current tags with the tags contained on the given map. |
public void testNextDoubleBounded2(){
SplittableRandom sr=new SplittableRandom();
for (double least=0.0001; least < 1.0e20; least*=8) {
for (double bound=least * 1.001; bound < 1.0e20; bound*=16) {
double f=sr.nextDouble(least,bound);
assertTrue(least <= f && f < bound);
int i=0;
double ... | nextDouble(least, bound) returns least <= value < bound; repeated calls produce at least two distinct results |
public static Link createLink(Composite parent,String text,Font font,int hspan){
Link l=new Link(parent,SWT.UNDERLINE_LINK);
l.setFont(font);
l.setText(text);
GridData gd=new GridData(GridData.BEGINNING,GridData.VERTICAL_ALIGN_CENTER,true,false,hspan,1);
l.setLayoutData(gd);
return l;
}
| Creates a new link widget |
public Key min(){
if (isEmpty()) throw new NoSuchElementException("Priority queue underflow");
return pq[1];
}
| Returns a smallest key on this priority queue. |
public List<ErrorLogger.ErrorObject> buildPackingList_2007(@Nonnull org.smpte_ra.schemas.st0429_8_2007.PKL.UserText annotationText,@Nonnull org.smpte_ra.schemas.st0429_8_2007.PKL.UserText issuer,@Nonnull org.smpte_ra.schemas.st0429_8_2007.PKL.UserText creator,@Nonnull List<PackingListBuilderAsset_2007> assets) throws I... | A method to build a PackingList document compliant with the st0429-8:2007 schema |
public static byte[] encodeFloat(Number number){
ByteBuffer fBuf=null;
if (number instanceof Float) {
fBuf=ByteBuffer.allocate(4);
fBuf.putFloat(number.floatValue());
}
else {
fBuf=ByteBuffer.allocate(8);
fBuf.putDouble(number.doubleValue());
}
return fBuf.array();
}
| Encodes a floating point value. |
protected PDFDestination(PDFObject pageObj,int type){
this.pageObj=pageObj;
this.type=type;
}
| Creates a new instance of PDFDestination |
public static boolean matchPinyinUnits(final List<PinyinUnit> pinyinUnits,final String baseData,String search,StringBuffer chineseKeyWord){
if ((null == pinyinUnits) || (null == search) || (null == chineseKeyWord)) {
return false;
}
StringBuffer matchSearch=new StringBuffer();
matchSearch.delete(0,matchSear... | Match Pinyin Units |
public boolean isLoaded(){
return m_addressSpace.isLoaded();
}
| Returns a flag that indicates whether the address space is loaded. |
public void map(Text key,Writable value,OutputCollector<Text,ObjectWritable> output,Reporter reporter) throws IOException {
ObjectWritable objWrite=new ObjectWritable();
objWrite.set(value);
output.collect(key,objWrite);
}
| Convert values to ObjectWritable |
static LegacyGWTHostPageSelectionTreeItem[] buildTree(Map<String,Set<String>> modulesHostPages){
List<LegacyGWTHostPageSelectionTreeItem> treeItems=new ArrayList<LegacyGWTHostPageSelectionTreeItem>();
for ( String moduleName : modulesHostPages.keySet()) {
LegacyGWTHostPageSelectionTreeItem moduleItem=new Legac... | Builds the tree nodes for a set of modules and host pages. |
private void addTraceHeaders(RoutingContext ctx,ProxyContext pc){
for ( String th : pc.traceHeaders) {
ctx.response().headers().add(XOkapiHeaders.TRACE,th);
}
}
| Add the trace headers to the response |
public void init(CredentialInfo info,APIAccessCallBack apiAccessCallBack,Context appContext){
IdentityProxy.clientID=info.getClientID();
IdentityProxy.clientSecret=info.getClientSecret();
this.apiAccessCallBack=apiAccessCallBack;
context=appContext;
SharedPreferences mainPref=context.getSharedPreferences(Cons... | Initializing the IDP plugin and obrtaining the access token. |
@Override public boolean acceptSource(final Object source){
return source instanceof GamaCSVFile;
}
| Method acceptSource() |
public boolean isLastChunk(){
if ((this.lastChunk & 0X01) == 0X01) {
return true;
}
return false;
}
| Answers whether this is the last chunk. |
public double convertToAttribX(double scx){
double temp=m_XaxisEnd - m_XaxisStart;
double temp2=((scx - m_XaxisStart) * (m_maxX - m_minX)) / temp;
temp2=temp2 + m_minX;
return temp2;
}
| convert a Panel x coordinate to a raw x value. |
@Override @SuppressWarnings("unchecked") public List<StoragePool> matchStoragePoolsWithAttributeOn(List<StoragePool> pools,Map<String,Object> attributeMap,StringBuffer errorMessage){
List<StoragePool> matchedPools=new ArrayList<StoragePool>();
Set<String> systems=(Set<String>)attributeMap.get(Attributes.storage_sys... | Check if the CoS and pools are in the same varray and filter out the pools if they are not in the same varray. |
public Boolean isShellAccess(){
return shellAccess;
}
| Gets the value of the shellAccess property. |
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:34:18.130 -0500",hash_original_method="45431E38A045C0C983A2E1F24B9ACFC3",hash_generated_method="75FF6DCE1A5016BCF3AE6BCA9B4BE9D0") public LayerDrawable(Drawable[] layers){
t... | Create a new layer drawable with the list of specified layers. |
public static String guessFormat(String name){
String ext=FileUtil.getFilenameExtension(name);
for ( String format : FORMATS) {
if (format.equals(ext)) {
return ext;
}
}
return null;
}
| Guess a supported format from the file name. For "auto" format handling. |
@SuppressWarnings("TooBroadScope") private void flush(){
Collection<Entry> entries0;
rwLock.writeLock().lock();
try {
entries0=entries;
entries=new ConcurrentLinkedDeque8<>();
}
finally {
rwLock.writeLock().unlock();
}
cnt.set(0);
if (!entries0.isEmpty()) {
boolean addHdr=!file.exists();... | Flush buffered entries to disk. |
public void testExtractEncodingFromElidedLine(){
String encoding=ExtractXMLEncoding.extractEncoding(elidedLine);
assertEquals("iso-8859-1",encoding);
}
| Some books have no newline after the xml element. My code failed to extract the encoding corectly. This test will help me fix my parsing code and make sure I don't make the mistake in future. |
private void handleStartedStage(final State current) throws RpcException {
switch (current.taskState.subStage) {
case GET_HOST_INFO:
this.getHostInfo(current);
break;
case TRIGGER_SCAN:
this.triggerImageScan(current);
break;
case WAIT_FOR_SCAN_COMPLETION:
this.waitForImageScanCompletion(current);
break;
case TRIG... | Process patch requests when service is in STARTED stage. |
public boolean isRelevant(final int minimumWords){
return this.dict.size() >= minimumWords;
}
| a property that is used during the construction of recommendation: if the dictionary is too small, then the non-existence of constructed words is not relevant for the construction of artificially constructed words If this property returns true, all other words must be in the dictionary |
public static Date parseDateStrictly(final String str,final Locale locale,final String... parsePatterns) throws ParseException {
return parseDateWithLeniency(str,null,parsePatterns,false);
}
| <p>Parses a string representing a date by trying a variety of different parsers, using the default date format symbols for the given locale..</p> <p>The parse will try each parse pattern in turn. A parse is only deemed successful if it parses the whole of the input string. If no parse patterns match, a ParseException i... |
public static void main(String[] args){
junit.textui.TestRunner.run(suite());
}
| for running the test from commandline |
@Override public void reset(){
editorSite.getActionBars().getStatusLineManager().setErrorMessage(null);
}
| Sets clears the status line |
public static double[][] makeDelayEmbeddingVector(double[][] data,int k,int startKthPoint,int numEmbeddingVectors) throws Exception {
if (startKthPoint < k - 1) {
throw new Exception("Start point t=" + startKthPoint + " is too early for a "+ k+ " length embedding vector");
}
if (numEmbeddingVectors + startKth... | Constructs numEmbeddingVectors embedding vectors of k time points for the data, including all multivariate values at each time point. Return only a subset, with the first embedding vector having it's last time point at t=startKthPoint |
public void addOnItemTouchListener(RecyclerView.OnItemTouchListener listener){
mRecycler.addOnItemTouchListener(listener);
}
| Add the onItemTouchListener for the recycler |
protected void rethrow(SQLException cause,String sql,Object[] params) throws SQLException {
StringBuilder msg=new StringBuilder(cause.getMessage());
msg.append(" Query: ");
msg.append(sql);
msg.append(" Parameters: ");
if (params == null) {
msg.append("[]");
}
else {
msg.append(Arrays.asList(params... | Throws a new exception with a more informative error message. |
public final void yyclose() throws java.io.IOException {
zzAtEOF=true;
zzEndRead=zzStartRead;
if (zzReader != null) zzReader.close();
}
| Closes the input stream. |
public AlgorithmTerminationException(Algorithm algorithm,String message){
super(algorithm,message);
}
| Constructs an algorithm termination exception originating from the specified algorithm with the given message. |
public static Token newSymbol(String type,int startLine,int startColumn){
return new Token(Types.lookupSymbol(type),type,startLine,startColumn);
}
| Creates a token that represents a symbol, using a library for the type. |
public static Optional<Excerpt> freshBuilder(Block block,Metadata metadata){
if (!metadata.getBuilderFactory().isPresent()) {
return Optional.absent();
}
Excerpt defaults=block.declare("_defaults","%s _defaults = %s;",metadata.getGeneratedBuilder(),metadata.getBuilderFactory().get().newBuilder(metadata.getBui... | Declares a fresh Builder to copy default property values from. |
protected boolean executeInternal(String sql,int fetchSize) throws SQLException {
executing=true;
QueryException exception=null;
lock.lock();
try {
executeQueryProlog();
batchResultSet=null;
ExecutionResult internalExecutionResult;
if (options.allowMultiQueries || options.rewriteBatchedStatement... | executes a query. |
void fullyUnlock(){
takeLock.unlock();
putLock.unlock();
}
| Unlocks to allow both puts and takes. |
public static void send(InternalDistributedMember recipient,int processorId,ReplySender dm,boolean result,VersionedObjectList versions,ReplyException ex){
Assert.assertTrue(recipient != null,"RemoveAllReplyMessage NULL reply message");
RemoveAllReplyMessage m=new RemoveAllReplyMessage(processorId,result,versions,ex... | Send an ack |
@Override public synchronized V put(K key,V value){
mbean.puts.incrementAndGet();
CacheEntry<V> entry=newSoftCacheEntry(key,value);
CacheEntry<V> oldEntry=cacheEntries.put(key,entry);
return safeValue(oldEntry);
}
| Adds an object to the cache. |
public static LatLon locationFromUTMCoord(int zone,String hemisphere,double easting,double northing,Globe globe){
UTMCoord coord=UTMCoord.fromUTM(zone,hemisphere,easting,northing,globe);
return new LatLon(coord.getLatitude(),coord.getLongitude());
}
| Convenience method for converting a UTM coordinate to a geographic location. |
private void verify(final Task<Diff> task,final Diff decodedDiff,final Diff originalDiff) throws SQLConsumerException {
String orig=originalDiff.toString();
String deco=decodedDiff.toString();
boolean notEqual=!orig.equals(deco);
if (notEqual && MODE_SURROGATES == SurrogateModes.REPLACE) {
char[] origDiff=o... | Verifies that the decoded diff is identical to the original diff. |
private RUtils(){
throw new Error("Do not need instantiate!");
}
| Don't let anyone instantiate this class. |
public ExamineSslAction(KseFrame kseFrame){
super(kseFrame);
putValue(ACCELERATOR_KEY,KeyStroke.getKeyStroke(res.getString("ExamineSslAction.accelerator").charAt(0),Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() + InputEvent.ALT_MASK));
putValue(LONG_DESCRIPTION,res.getString("ExamineSslAction.statusbar"));... | Construct action. |
public static String toNullIfEmptyOrWhitespace(String s){
return (StringUtil.isEmptyOrWhitespace(s)) ? null : s;
}
| Helper function for turning empty or whitespace strings into a null. |
public static void play(double sample){
if (Double.isNaN(sample)) throw new IllegalArgumentException("sample is NaN");
if (sample < -1.0) sample=-1.0;
if (sample > +1.0) sample=+1.0;
short s=(short)(MAX_16_BIT * sample);
buffer[bufferSize++]=(byte)s;
buffer[bufferSize++]=(byte)(s >> 8);
if (bufferSi... | Writes one sample (between -1.0 and +1.0) to standard audio. If the sample is outside the range, it will be clipped. |
public void execute(TransformerImpl transformer) throws TransformerException {
}
| This is the normal call when xsl:fallback is instantiated. In accordance with the XSLT 1.0 Recommendation, chapter 15, "Normally, instantiating an xsl:fallback element does nothing." |
public EaseOut(float overshoot){
this.overshoot=overshoot;
}
| Easing equation function for a back (overshooting cubic easing: (overshoot+1)*t^3 - overshoot*t^2) easing out: decelerating from zero velocity. |
public Swagger2MarkupConfigBuilder withFlatBody(){
config.flatBodyEnabled=true;
return this;
}
| Optionally isolate the body parameter, if any, from other parameters. |
public static <T>T newInstance(Class<T> cl,Object contextProvider){
Check.assumeNotNull(contextProvider,"contextProvider not null");
final Properties ctx=getCtx(contextProvider);
final String trxName=getTrxName(contextProvider);
return create(ctx,cl,trxName);
}
| Creates a new instance of given object using same context and trxName as <code>contextProvider</code> |
public static void printResults(PowerDatacenter datacenter,List<Vm> vms,double lastClock,String experimentName,boolean outputInCsv,String outputFolder){
Log.enable();
List<Host> hosts=datacenter.getHostList();
int numberOfHosts=hosts.size();
int numberOfVms=vms.size();
double totalSimulationTime=lastClock;
... | Prints the results. |
public Instance calcPivot(MyIdxList list1,MyIdxList list2,Instances insts){
int classIdx=m_Instances.classIndex();
double[] attrVals=new double[insts.numAttributes()];
Instance temp;
for (int i=0; i < list1.length(); i++) {
temp=insts.instance(list1.get(i).idx);
for (int k=0; k < temp.numValues(); k++) ... | Calculates the centroid pivot of a node based on the list of points that it contains (tbe two lists of its children are provided). |
private static void usage(){
int consoleWidth=ConsoleUtil.getConsoleWidth();
if (consoleWidth <= 0) {
consoleWidth=80;
}
System.out.println("java -cp baksmali.jar org.jf.dexlib2.analysis.DumpFields -d path/to/framework/jar/files <dex-file>");
}
| Prints the usage message. |
public static byte[] decode(char[] in,int iOff,int iLen){
if (iLen % 4 != 0) throw new IllegalArgumentException("Length of Base64 encoded input string is not a multiple of 4.");
while (iLen > 0 && in[iOff + iLen - 1] == '=') iLen--;
int oLen=(iLen * 3) / 4;
byte[] out=new byte[oLen];
int ip=iOff;
int iE... | Decodes a byte array from Base64 format. No blanks or line breaks are allowed within the Base64 encoded input data. |
public Stream<? extends SymbolInformation> search(String query){
Stream<SymbolInformation> classes=allSymbols(ElementKind.CLASS);
Stream<SymbolInformation> methods=allSymbols(ElementKind.METHOD);
return Stream.concat(classes,methods).filter(null);
}
| Search all indexed symbols |
public void cancel(){
cancel=true;
}
| Calling this method cancels the event |
public static ButtonDialog createNewDialog(String uri){
ButtonDialogBuilder builder=new ButtonDialogBuilder("browser_unavailable");
JPanel mainPanel=new JPanel(new GridBagLayout());
GridBagConstraints gbc=new GridBagConstraints();
gbc.insets=new Insets(5,5,5,5);
gbc.gridy=0;
gbc.gridx=0;
JTextField urlTex... | Creates a new BrowserUnavailable ButtonDialog |
@RequestProcessing(value="/verifycode/remove-expired",method=HTTPRequestMethod.GET) public void removeExpriedVerifycodes(final HTTPRequestContext context,final HttpServletRequest request,final HttpServletResponse response) throws Exception {
final String key=Symphonys.get("keyOfSymphony");
if (!key.equals(request.g... | Remove expired verifycodes. |
private void updateAndRender(float targetProgress){
if (this.fadeTimeMs > 0) {
if (targetProgress > 0f && this.progress == 0f) this.fadeIn();
else if (targetProgress < 1f && this.progress == 1f) this.fadeIn();
else if (targetProgress == 0f && this.progress > 0f) this.fadeOut();
else if ... | Set the progress value and render it |
public IllegalArgumentException(String message){
super(message);
}
| Constructs a new exception with the specified detail message. The cause is not initialized. |
public String encodeBody(){
return encodeBody(new StringBuffer()).toString();
}
| Return canonical header content. (encoded header except headerName:) |
public void removeIndex(IIndex index){
if (index != null) {
indices.remove(index);
}
}
| Removes the given index. |
public void remove(){
purge(cursor);
}
| Removes the match from the cursor position. This also ensures that the node is removed from the active set so that it is not longer considered a relevant output node. |
public double computeSecondCover(boolean leaf){
double max=0.;
for ( DistanceEntry<E> e : secondAssignments) {
double cover=leaf ? e.getDistance() : (e.getEntry().getCoveringRadius() + e.getDistance());
max=cover > max ? cover : max;
}
return max;
}
| Compute the covering radius of the second assignment. |
public Random(){
this(System.currentTimeMillis());
}
| Creates a new random number generator. Its seed is initialized to a value based on the current time: public Random() { this(System.currentTimeMillis()); } See Also:System.currentTimeMillis() |
@Override public void run(){
amIActive=true;
String inputHeader=null;
String outputHeader=null;
double zConvFactor=1;
if (args.length <= 0) {
showFeedback("Plugin parameters have not been set.");
return;
}
inputHeader=args[0];
outputHeader=args[1];
zConvFactor=Double.parseDouble(args[2]);
if... | Used to execute this plugin tool. |
public void draw(Canvas c,Rect bounds){
final RectF arcBounds=mTempBounds;
arcBounds.set(bounds);
arcBounds.inset(mStrokeInset,mStrokeInset);
final float startAngle=(mStartTrim + mRotation) * 360;
final float endAngle=(mEndTrim + mRotation) * 360;
float sweepAngle=endAngle - startAngle;
mPaint.setColor(mC... | Draw the progress spinner |
public boolean declaresMethod(String subsignature){
checkLevel(SIGNATURES);
return declaresMethod(Scene.v().getSubSigNumberer().findOrAdd(subsignature));
}
| Does this class declare a method with the given subsignature? |
public static void scrollToVisible(JTable table,int row,int col){
if (!(table.getParent() instanceof JViewport)) return;
JViewport viewport=(JViewport)table.getParent();
Rectangle rect=table.getCellRect(row,col,true);
Point pt=viewport.getViewPosition();
rect.setLocation(rect.x - pt.x,rect.y - pt.y);
view... | Assumes table is contained in a JScrollPane. Scrolls the cell (rowIndex, vColIndex) so that it is visible within the viewport. |
public boolean isCrossFadeEnabled(){
return mCrossFade;
}
| Indicates whether the cross fade is enabled for this transition. |
public static AnnotatedClass construct(Class<?> cls,AnnotationIntrospector aintr,MixInResolver mir){
List<Class<?>> st=ClassUtil.findSuperTypes(cls,null);
AnnotatedClass ac=new AnnotatedClass(cls,st,aintr,mir,null);
ac.resolveClassAnnotations();
return ac;
}
| Factory method that instantiates an instance. Returned instance will only be initialized with class annotations, but not with any method information. |
private String validateSnmpDirectory(String snmpDir){
return snmpDir;
}
| SnmpDirectory must be specified if SNMP is enabled. This directory must also exist. |
public void swap(String n0,String n1){
if (n0 == null || n1 == null) {
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,"Can not swap unnamed cores.");
}
solrCores.swap(n0,n1);
coresLocator.swap(this,solrCores.getCoreDescriptor(n0),solrCores.getCoreDescriptor(n1));
log.info("swapped: " + n0 + "... | Swaps two SolrCore descriptors. |
public char next(){
if (_length <= ++_pos) {
_pos=_length;
return DONE;
}
else return _string.charAt(_pos);
}
| reads a character from the cursor |
public void searchStopped(){
}
| Called when the user presses the cancel search button or presses escape while the search is in focus. |
public static double tau_b(ExampleSet eSet,Attribute a,Attribute b,double fuzz) throws OperatorException {
ExampleSet e=extract(eSet,a,b);
FuzzyComp fc=new FuzzyComp(fuzz);
int c=0;
int d=0;
int ta=0;
int tb=0;
int n=0;
Iterator<Example> i=e.iterator();
while (i.hasNext()) {
Example z1=i.next();
... | Computes Kendall's tau-b rank correlation statistic, ignoring examples containing missing values, with approximate comparisons. |
public final void renameAttributeValue(Attribute att,String val,String name){
int v=att.indexOfValue(val);
if (v == -1) throw new IllegalArgumentException(val + " not found");
renameAttributeValue(att.index(),v,name);
}
| Renames the value of a nominal (or string) attribute value. This change only affects this dataset. |
public ElemTemplateElement appendChild(ElemTemplateElement newChild){
int type=((ElemTemplateElement)newChild).getXSLToken();
switch (type) {
case Constants.ELEMNAME_TEXTLITERALRESULT:
case Constants.ELEMNAME_APPLY_TEMPLATES:
case Constants.ELEMNAME_APPLY_IMPORTS:
case Constants.ELEMNAME_CALLTEMPLATE:
case Constants.... | Add a child to the child list. <!ELEMENT xsl:attribute %char-template;> <!ATTLIST xsl:attribute name %avt; #REQUIRED namespace %avt; #IMPLIED %space-att; > |
public void sendCanMessage(CanMessage m,CanListener reply){
log.debug("TrafficController sendCanMessage() " + m.toString());
sendMessage(m,reply);
}
| Forward a preformatted message to the actual interface. |
public ParsedURLData parseURL(ParsedURL baseURL,String urlStr){
if (urlStr.length() == 0) return baseURL.data;
int idx=0, len=urlStr.length();
if (len == 0) return baseURL.data;
char ch=urlStr.charAt(idx);
while ((ch == '-') || (ch == '+') || (ch == '.')|| ((ch >= 'a') && (ch <= 'z'))|| ((ch >= 'A') && (c... | Parses the string as a sub URL of baseURL, and returns the results of parsing in the ParsedURLData object. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.