code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
private Sprite preparePlaceholder(Sprite original){
if ((original == null) || (TransparencyMode.TRANSPARENCY == Transparency.BITMASK)) {
return original;
}
BufferedImage img=new BufferedImage(original.getWidth(),original.getHeight(),BufferedImage.TYPE_INT_ARGB);
Graphics g=img.createGraphics();
original.d... | Prepare a version of the place holder Sprite, that is suitable for the transparency mode of the client. |
public boolean containsKey(K key){
return map.containsKey(key);
}
| Check for key in map |
public CFunctionNameTypePair(final String name,final FunctionType functionType){
m_name=name;
m_functionType=functionType;
}
| Creates a new pair of function name and function type. |
public void invalidate(){
this.authScheme=null;
this.authScope=null;
this.credentials=null;
}
| Invalidates the authentication state by resetting its parameters. |
public String toString(){
return new String(value);
}
| Converts the string value to its <CODE>String</CODE> form. |
private void updateAnimationTime(){
long now=android.os.SystemClock.uptimeMillis();
if (mMovieStart == 0) {
mMovieStart=now;
}
int dur=movie.duration();
if (dur == 0) {
dur=DEFAULT_MOVIE_VIEW_DURATION;
}
mCurrentAnimationTime=(int)((now - mMovieStart) % dur);
}
| Calculate current animation time |
public RequestHandle put(Context context,String url,RequestParams params,ResponseHandlerInterface responseHandler){
return put(context,url,paramsToEntity(params,responseHandler),null,responseHandler);
}
| Perform a HTTP PUT request and track the Android Context which initiated the request. |
@Override public void updateScreen(){
}
| Called from the main game loop to update the screen. |
public double eval(double params[]){
return (params[0] + params[1] + params[2]+ params[3]);
}
| Evaluate the addition of 4 parameters. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-02-25 10:38:07.739 -0500",hash_original_method="DC5C6AC2DFC5703884925E95380CED47",hash_generated_method="1DE3EAECC7BBF780F5F9D829D9A6954B") public static boolean isNegativeTransient(int reply){
return (reply >= 400 && reply < 500);
}
| Determine if a reply code is a negative transient response. All codes beginning with a 4 are negative transient responses. The NNTP server will send a negative transient response on the failure of a correctly formatted command that could not be performed for some reason. For example, retrieving an article that does n... |
public boolean isStreaming(){
return false;
}
| Tells that this entity is not streaming. |
synchronized String createLocalId(){
long localIdNumber=random.nextLong();
String localId="local_" + Long.toHexString(localIdNumber);
if (!isLocalId(localId)) {
throw new IllegalStateException("Generated an invalid local id: \"" + localId + "\". "+ "This should never happen. Contact us at https://parse.com/he... | Creates a new local id. |
public DeclutterMatrix(){
this(0,0);
}
| Create a new matrix, with null dimensions |
public Network filterLinksOutsideEnvelope(Network net,Envelope envelope){
NetworkFilterManager filterManager=new NetworkFilterManager(net);
filterManager.addLinkFilter(new EnvelopeLinkStartEndFilter(envelope));
Network newNetwork=filterManager.applyFilters();
return newNetwork;
}
| reduce the network size: delete all edges outside the envelope |
public void trim(final int ego){
this.alters[ego].trim();
}
| Memory optimisation: shrinks storing arrays so that they do not contain unused slots. |
public Page(Properties ctx,int pageNo){
m_ctx=ctx;
m_pageNo=pageNo;
if (m_pageInfo == null || m_pageInfo.length() == 0) m_pageInfo=String.valueOf(m_pageNo);
}
| Layout for Page |
private void scheduleCleanerJob(IPreferencePageContainer preferencePageContainer,String folderNameToClean){
DerivedResourceCleanerJob derivedResourceCleanerJob=cleanerProvider.get();
derivedResourceCleanerJob.setUser(true);
derivedResourceCleanerJob.initialize(getProject(),folderNameToClean);
if (preferencePage... | This method has been copied from org.eclipse.xtext.builder.preferences.BuilderPreferencePage. |
public CSVDataSourceFactory(){
super("csv",CSV_MIME_TYPES,CSV_FILE_ENDINGS,CSVFormatSpecificationWizardStep.CSV_FORMAT_SPECIFICATION_STEP_ID);
}
| Constructs a new factory instance. |
public boolean isInFlight(){
if (!worldObj.isRemote) {
return isInFlight;
}
return this.dataWatcher.getWatchableObjectByte(16) == 1;
}
| If the rocket is in flight, ie the rocket has taken off and has not touched the ground |
public void parseForMethod(GenericDeclaration genericDecl,SignatureTag signature,SootClassType[] rawExceptionTypes){
setInput(genericDecl,signature);
if (!eof) {
parseMethodTypeSignature(rawExceptionTypes);
}
else {
if (genericDecl instanceof SootMethodType) {
SootMethodType m=(SootMethodType)gener... | Parses the generic signature of a method and creates the data structure representing the signature. |
public CaseInsensitiveHashSet(String[] a,int offset,int length,float f){
super(a,offset,length,f,CaseInsensitiveHashingStrategy.INSTANCE);
}
| Creates a new hash set and fills it with the elements of a given array. |
public static void cancel(String flowName){
Flow flow=sFlowMap.get(flowName);
if (flow != null) {
flow.cancel();
}
}
| Cancel the flow. |
public void addDataChangedListener(DataChangedListener l){
mv.addDataChangeListener(l);
}
| Allows tracking selection changes in the calendar in real time |
public static NodeResponse send(InternalDistributedMember recipient,PartitionedRegion r,int bucketId,int bucketSize) throws ForceReattemptException {
Assert.assertTrue(recipient != null,"CreateBucketMessage NULL recipient");
NodeResponse p=new NodeResponse(r.getSystem(),recipient);
CreateBucketMessage m=new Creat... | Sends a PartitionedRegion manage bucket request to the recipient |
public RuntimeCopyException(String s){
super(s);
}
| Constructs an exception. |
private Collection<? extends ImmutableClassType> narrowByAnnotationSearch(ClassCache classCache,String annotation){
if (null == annotation) {
return Collections.emptyList();
}
Collection<? extends ImmutableAnnotationType> annotationTypes=classCache.getLookupService().findAnnotationTypesByPattern(annotation,fa... | Search by the annotation defined in the assignment. |
public String toString(){
return " at " + this.index + " [character "+ this.character+ " line "+ this.line+ "]";
}
| Make a printable string of this JSONTokener. |
public GraphicComponent(GraphicAttribute graphic,Decoration decorator,int[] charsLtoV,byte[] levels,int start,int limit,AffineTransform baseTx){
if (limit <= start) {
throw new IllegalArgumentException("0 or negative length in GraphicComponent");
}
this.graphic=graphic;
this.graphicAdvance=graphic.getAdvanc... | Create a new GraphicComponent. start and limit are indices into charLtoV and levels. charsLtoV and levels may be adopted. |
public static boolean maybeEmtpy(RegExp re){
RegExp2 r;
switch (re.type) {
case sym.BAR:
{
r=(RegExp2)re;
return maybeEmtpy(r.r1) || maybeEmtpy(r.r2);
}
case sym.CONCAT:
{
r=(RegExp2)re;
return maybeEmtpy(r.r1) && maybeEmtpy(r.r2);
}
case sym.STAR:
case sym.QUESTION:
return true;
case sym.PL... | Checks if the expression potentially matches the empty string. |
@Inject public LineageResource(LineageService lineageService){
this.lineageService=lineageService;
}
| Created by the Guice ServletModule and injected with the configured LineageService. |
public PeerReflexiveCandidate(TransportAddress transportAddress,Component parentComponent,LocalCandidate base,long priority){
super(transportAddress,parentComponent,CandidateType.PEER_REFLEXIVE_CANDIDATE,CandidateExtendedType.STUN_PEER_REFLEXIVE_CANDIDATE,base);
super.setBase(base);
super.priority=priority;
}
| Creates a <tt>PeerReflexiveCandidate</tt> instance for the specified transport address and properties. |
public static void unskipRefCountTracking(){
getInstance().unskipRefCountTracking();
}
| Call this method to undo a call to skipRefCountTracking. |
public LifeDrainArea(final int width,final int height,final int interval,final double damageRatio,final int minimumDamage){
super(width,height,interval);
this.damageRatio=damageRatio;
this.minimumDamage=minimumDamage;
setResistance(50);
}
| Create a damaging area. |
public static <K>MapStack<K> create(MapStack<K> source){
MapStack<K> newValue=new MapStack<K>();
newValue.stackList.addAll(source.stackList);
return newValue;
}
| Does a shallow copy of the internal stack of the passed MapStack; enables simultaneous stacks that share common parent Maps |
@Override public NotificationChain eInverseRemove(InternalEObject otherEnd,int featureID,NotificationChain msgs){
switch (featureID) {
case N4mfPackage.PROJECT_DEPENDENCY__VERSION_CONSTRAINT:
return basicSetVersionConstraint(null,msgs);
}
return super.eInverseRemove(otherEnd,featureID,msgs);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
private static void outputConsole(KeywordCollection bestKeywords){
logHeadline("Results");
for ( KeywordInfo keyword : bestKeywords.getListSortedByScore()) {
log(keyword.toString());
}
}
| Outputs the results on the console (sorted, best first). |
private boolean isValidItemIndex(int index){
return viewAdapter != null && viewAdapter.getItemsCount() > 0 && (isCyclic || index >= 0 && index < viewAdapter.getItemsCount());
}
| Checks whether intem index is valid |
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) private void formatTextWithLabel(AccessibilityNodeInfoCompat node,SpannableStringBuilder builder){
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) return;
AccessibilityNodeInfo info=(AccessibilityNodeInfo)node.getInfo();
if (info == null) return;
... | If the supplied node has a label, replaces the builder text with a version formatted with the label. |
public Resource fromFileName(String file){
for ( Resource f : this) {
if (f.getFileName().equalsIgnoreCase(file)) return f;
}
return null;
}
| Gets a resource from its filename. |
public void addParent(NodeCollection parentCollection,CommonNodeMaintainer nodeMaintainer){
if (parents.isEmpty()) {
parents.add(parentCollection);
parentCollection.getHaltStepNode().setToNode(initStepNode);
nodeMaintainer.getRestartNodes().add(parentCollection.getHaltStepNode());
}
else {
parents.... | This method traverses through each process node and checks for parent(s) and populates the parent collection <p/> Populating parentCollection. For processes with only parent, the parent process is added to parentCollection. The haltStepNode of parent process is directed to initStepNode of the current process, thereby e... |
public static String toBinaryString(int i){
return IntegralToString.intToBinaryString(i);
}
| Converts the specified integer into its binary string representation. The returned string is a concatenation of '0' and '1' characters. |
public boolean isProcessed(){
Object oo=get_Value(COLUMNNAME_Processed);
if (oo != null) {
if (oo instanceof Boolean) return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
| Get Processed. |
public static String expandPrefix(NavigableSet<String> names,String prefix){
String name=prefix;
if (!names.contains(name)) {
final String closest=names.ceiling(prefix);
if (closest != null && closest.startsWith(prefix)) {
final String higher=names.higher(closest);
if (higher == null || !higher.... | Expand a name if it is an unambiguous prefix of an entry in the given set of names |
public Keyboard(Context context){
DisplayMetrics dm=context.getResources().getDisplayMetrics();
mDisplayWidth=dm.widthPixels;
mDisplayHeight=dm.heightPixels;
Config config=Config.get();
mDefaultHorizontalGap=config.getPixel("horizontal_gap");
mDefaultVerticalGap=config.getPixel("vertical_gap");
mDefaultWi... | Creates a keyboard from the given xml key layout file. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-03-24 16:07:15.203 -0400",hash_original_method="8EAA66237FD0D657A6089CD6D204D973",hash_generated_method="D21A37F8C83D2EFC3CCA72F9E806CE49") public boolean startTone(int toneType){
return startTone(toneType,-1);
}
| This method starts the playback of a tone of the specified type. only one tone can play at a time: if a tone is playing while this method is called, this tone is stopped and replaced by the one requested. |
public static int overloadError(int one,int two){
return one + two;
}
| This method is called via reflection from the database. |
public BoundsOutlineHandle(Figure owner,AttributeKey<Stroke> stroke1Enabled,AttributeKey<Color> strokeColor1Enabled,AttributeKey<Stroke> stroke2Enabled,AttributeKey<Color> strokeColor2Enabled,AttributeKey<Stroke> stroke1Disabled,AttributeKey<Color> strokeColor1Disabled,AttributeKey<Stroke> stroke2Disabled,AttributeKey<... | Creates a bounds outline handle for resizing or transforming a component. |
public int lengthSubjectName(){
return this.length(Constants.SignatureSpecNS,Constants._TAG_X509SUBJECTNAME);
}
| Method lengthSubjectName |
private double E(Instances inst,boolean change_weights) throws Exception {
double loglk=0.0, sOW=0.0;
for (int l=0; l < inst.numInstances(); l++) {
Instance in=inst.instance(l);
loglk+=in.weight() * logDensityForInstance(in);
sOW+=in.weight();
if (change_weights) {
m_weights[l]=distributionFor... | The E step of the EM algorithm. Estimate cluster membership probabilities. |
public ICalDate(ICalDate date){
this(date,(date.rawComponents == null) ? null : new DateTimeComponents(date.rawComponents),date.hasTime);
}
| Copies another iCal date-time value. |
public boolean simulate_natives(){
return soot.PhaseOptions.getBoolean(options,"simulate-natives");
}
| Simulate Natives -- Simulate effects of native methods in standard class library. When this option is set to true, the effects of native methods in the standard Java class library are simulated. |
public boolean equals(Object another){
if (!(another instanceof HttpPrincipal)) {
return false;
}
HttpPrincipal theother=(HttpPrincipal)another;
return (username.equals(theother.username) && realm.equals(theother.realm));
}
| Compares two HttpPrincipal. Returns <code>true</code> if <i>another</i> is an instance of HttpPrincipal, and its username and realm are equal to this object's username and realm. Returns <code>false</code> otherwise. |
public LocalePreference(final I18NBundleProvider i18nBundleProvider){
super(ApplicationPreferences.getPreferences());
locale=fromString(getValue());
this.i18nBundleProvider=i18nBundleProvider;
}
| Constructs locale preference with the default preferences object. |
public void dispatch(EventType type){
dispatch(new AppEvent(type));
}
| The dispatcher will query its controllers and pass the application event to controllers that can handle the particular event type. |
protected static int assertNonNegative(final String msg,final int v){
if (v < 0) throw new IllegalArgumentException(msg);
return v;
}
| Throws exception unless the value is non-negative. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:32:43.591 -0500",hash_original_method="33710CB1E65A2C52E9ABEE23433BB87F",hash_generated_method="33710CB1E65A2C52E9ABEE23433BB87F") void addCookie(Cookie cookie){
if (cookie.domain == null || cookie.path == null || cookie.name == null... | Add a cookie to the database |
public void testReadFEN() throws ChessParseError {
String fen="rnbqk2r/1p3ppp/p7/1NpPp3/QPP1P1n1/P4N2/4KbPP/R1B2B1R b kq - 0 1";
Position pos=TextIO.readFEN(fen);
assertEquals(fen,TextIO.toFEN(pos));
assertEquals(pos.getPiece(Position.getSquare(0,3)),Piece.WQUEEN);
assertEquals(pos.getPiece(Position.getSquare... | Test of readFEN method, of class TextIO. |
public void add(Resource s,URI p,Value o){
add(s,p,o,null,StatementEnum.Explicit);
}
| Add an "explicit" statement to the buffer (flushes on overflow, no context). |
public StringBuilder(){
super(16);
}
| Constructs a string builder with no characters in it and an initial capacity of 16 characters. |
public boolean isDerivedReference(){
return getDerivedReferenceBase() != null;
}
| Check whether this value is a derived reference. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:00:10.891 -0500",hash_original_method="6A2E08939F192DB9BEF6B9CE1D1800F8",hash_generated_method="39A4C997697F55BFCE6668965317B68A") public JSONStringer endArray() throws JSONException {
return close(Scope.EMPTY_ARRAY,Scope.NONEMPTY_AR... | Ends encoding the current array. |
public static void rFindAndRecompileIndexingHOP(StatementBlock sb,ProgramBlock pb,String var,ExecutionContext ec,boolean force) throws DMLRuntimeException {
if (pb instanceof IfProgramBlock && sb instanceof IfStatementBlock) {
IfProgramBlock ipb=(IfProgramBlock)pb;
IfStatementBlock isb=(IfStatementBlock)sb;
... | NOTE: if force is set, we set and recompile the respective indexing hops; otherwise, we release the forced exec type and recompile again. Hence, any changes can be exactly reverted with the same access behavior. |
protected boolean createMatchRecord(boolean invoice,int M_InOutLine_ID,int Line_ID,BigDecimal qty,String trxName){
if (qty.compareTo(Env.ZERO) == 0) return true;
log.fine("IsInvoice=" + invoice + ", M_InOutLine_ID="+ M_InOutLine_ID+ ", Line_ID="+ Line_ID+ ", Qty="+ qty);
boolean success=false;
MInOutLine sLin... | Create Matching Record |
private IOneDriveClient loginAndBuildClient(final Activity activity) throws ClientException {
mClient.validate();
mClient.getAuthenticator().init(mClient.getExecutors(),mClient.getHttpProvider(),activity,mClient.getLogger());
IAccountInfo silentAccountInfo=null;
try {
silentAccountInfo=mClient.getAuthentica... | Login a user and then returns the OneDriveClient |
private void showFeedback(String message){
if (myHost != null) {
myHost.showFeedback(message);
}
else {
System.out.println(message);
}
}
| Used to communicate feedback pop-up messages between a plugin tool and the main Whitebox user-interface. |
public VmPipeAcceptor(Executor executor){
super(new DefaultVmPipeSessionConfig(),executor);
idleChecker=new IdleStatusChecker();
executeWorker(idleChecker.getNotifyingTask(),"idleStatusChecker");
}
| Creates a new instance. |
public static Observable<NetworkServiceDiscoveryInfo> advertise(@NonNull Context context,@NonNull String serviceName,@NonNull String serviceLayer,int servicePort,@Nullable Map<String,String> attributes){
OnSubscribeEvent<NetworkServiceDiscoveryInfo> onSubscribe=AdvertiseOnSubscribeFactory.from(context,serviceName,ser... | This method is the one used in order to advertise the service on the network. As per default, this call will be executed on a proper Scheduler and return its result onto the main thread. |
private static String jsonValue(Object in){
final String value;
if (in instanceof Optional<?>) {
final Optional<?> o=(Optional<?>)in;
return o.map(null).orElse("null");
}
else if (in == null) {
value="null";
}
else if (in instanceof Byte || in instanceof Short || in instanceof Integer|| in ins... | Parse the specified value into JSON. |
boolean useReadCache(String name,IOContext context){
if (!blockCacheReadEnabled) {
return false;
}
if (blockCacheFileTypes != null && !isCachableFile(name)) {
return false;
}
switch (context.context) {
default :
{
return true;
}
}
}
| Determine whether read caching should be used for a particular file/context. |
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:57:35.414 -0500",hash_original_method="3CF6FD97C48E1A2587C7ECF97400CD4D",hash_generated_method="C5AAECEF0E5071D0AE6573D79D97CE47") public void logp(Level logLevel,String sourc... | Logs a message of the given level with the specified source class name, source method name and parameter. |
protected void doPlainAuth(String initialClientResponse,ImapSession session,String tag,ImapCommand command,Responder responder){
String pass=null;
String user=null;
try {
String userpass=new String(Base64.decodeBase64(initialClientResponse));
StringTokenizer authTokenizer=new StringTokenizer(userpass,"\0"... | Parse the initialClientResponse and do a PLAIN AUTH with it |
private String createNewTable(Fusiontables fusiontables,Track track) throws IOException {
Table table=new Table();
table.setName(track.getName());
table.setDescription(track.getDescription());
table.setIsExportable(true);
table.setColumns(Arrays.asList(new Column().setName("name").setType("STRING"),new Column... | Creates a new table. |
public void initializeMethodParameter(LocalVariableNode p,V value){
if (value != null) {
localVariableValues.put(new FlowExpressions.LocalVariable(p.getElement()),value);
}
}
| Set the abstract value of a method parameter (only adds the information to the store, does not remove any other knowledge). Any previous information is erased; this method should only be used to initialize the abstract value. |
public final PrivateKey generatePrivate(KeySpec keySpec) throws InvalidKeySpecException {
if (serviceIterator == null) {
return spi.engineGeneratePrivate(keySpec);
}
Exception failure=null;
KeyFactorySpi mySpi=spi;
do {
try {
return mySpi.engineGeneratePrivate(keySpec);
}
catch ( Excepti... | Generates a private key object from the provided key specification (key material). |
public static void main(final String[] args){
DOMTestCase.doMain(hc_nodereplacechildoldchildnonexistent.class,args);
}
| Runs this test from the command line. |
Image scaledImpl(int width,int height){
if (width == -1) {
return scaledHeight(height);
}
if (height == -1) {
return scaledWidth(width);
}
Dimension d=new Dimension(width,height);
Image i=getCachedImage(d);
if (i != null) {
return i;
}
if (svgData != null) {
try {
i=createSVG(svg... | Returns a scaled version of this image image using the given width and height, this is a fast algorithm that preserves translucent information. The method accepts -1 to preserve aspect ratio in the given axis. |
protected void selectHorizontalAutoTickUnit(Graphics2D g2,Rectangle2D dataArea,RectangleEdge edge){
long shift=0;
if (this.timeline instanceof SegmentedTimeline) {
shift=((SegmentedTimeline)this.timeline).getStartTime();
}
double zero=valueToJava2D(shift + 0.0,dataArea,edge);
double tickLabelWidth=estimat... | Selects an appropriate tick size for the axis. The strategy is to display as many ticks as possible (selected from a collection of 'standard' tick units) without the labels overlapping. |
public DoubleMatrix2D like(int rows,int columns){
return new DenseDoubleMatrix2D(rows,columns);
}
| Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of rows and columns. For example, if the receiver is an instance of type <tt>DenseDoubleMatrix2D</tt> the new matrix must also be of type <tt>DenseDoubleMatrix2D</tt>, if the receiver is an instance of ... |
protected void onClusterItemRendered(T clusterItem,Marker marker){
}
| Called after the marker for a ClusterItem has been added to the map. |
private QueryTask queryForHostSystem(String parentComputeLink,String hardwareUuid){
QuerySpecification qs=new QuerySpecification();
qs.query.addBooleanClause(Query.Builder.create().addFieldClause(ComputeState.FIELD_NAME_ID,hardwareUuid).build());
qs.query.addBooleanClause(Query.Builder.create().addFieldClause(Com... | Builds a query for finding a HostSystems by their hardwareUuid. |
public final void addItem(final int id,@StringRes final int titleId,@DrawableRes final int iconId){
Item item=new Item(getContext(),id,titleId);
item.setIcon(getContext(),iconId);
adapter.add(item);
adaptGridViewHeight();
}
| Adds a new item to the bottom sheet. |
private boolean checkForUpdates(List<AuthnProvider> providers){
if (_lastKnownConfiguration != null) {
if (_lastKnownConfiguration.keySet().size() != providers.size()) {
return true;
}
for ( AuthnProvider provider : providers) {
if (!_lastKnownConfiguration.containsKey(provider.getId())) {
... | checks to see if any of the provider configuration is updated from when we have seen it last |
public void add(T object){
if (mOriginalValues != null) {
synchronized (mLock) {
mOriginalValues.add(object);
if (mNotifyOnChange) notifyDataSetChanged();
}
}
else {
mObjects.add(object);
if (mNotifyOnChange) notifyDataSetChanged();
}
}
| Adds the specified object at the end of the array. |
public IsochroneFeature(int cutoffSec,WebMercatorGridPointSet points,int[] times){
times=Arrays.copyOf(times,times.length);
for (int x=0; x < points.width; x++) {
times[x]=Integer.MAX_VALUE;
times[(int)((points.height - 1) * points.width) + x]=Integer.MAX_VALUE;
}
for (int y=0; y < points.height; y++) {... | Create an isochrone for the given cutoff, using a Marching Squares algorithm. https://en.wikipedia.org/wiki/Marching_squares |
public DoubleVector plus(double x){
return copy().plusEquals(x);
}
| Adds a value to all the elements |
public Shape createScrollCap(int x,int y,int w,int h){
path.reset();
path.moveTo(x,y);
path.lineTo(x,y + h);
path.lineTo(x + w,y + h);
addScrollGapPath(x,y,w,h,true);
path.closePath();
return path;
}
| Return a path for a scroll bar cap. This is used when the buttons are placed together at the opposite end of the scroll bar. |
protected void doFireDocumentChanged2(DocumentEvent event){
DocumentPartitioningChangedEvent p=fDocumentPartitioningChangedEvent;
fDocumentPartitioningChangedEvent=null;
if (p != null && !p.isEmpty()) fireDocumentPartitioningChanged(p);
Object[] listeners=fPrenotifiedDocumentListeners.getListeners();
for (i... | Notifies all listeners about the given document change. Uses a robust iterator. <p/> Executes all registered post notification replace operation. <p/> This method will be renamed to <code>doFireDocumentChanged</code>. |
public DirichletDataSetProbs(DataSet dataSet,double symmValue){
if (dataSet == null) {
throw new NullPointerException();
}
if (symmValue < 0.0) {
throw new IllegalArgumentException();
}
this.dataSet=dataSet;
this.symmValue=symmValue;
dims=new int[dataSet.getNumColumns()];
for (int i=0; i < dims.... | Creates a cell count table for the given data set. |
public void open(OutputStream os) throws IOException {
this.out=os;
this.len=0;
}
| Reopen this output stream on <code>os</code>. This method need not be called on a newly initialized stream, but it can be called after the stream has been closed to re-open the stream on a different underlying stream without requiring internal resources to be re-allocated. |
public void createSeries(CandleDataset candleDataset,int seriesIndex){
if (candleDataset.getSeries(seriesIndex) == null) {
throw new IllegalArgumentException("Null source (XYDataset).");
}
for (int i=0; i < candleDataset.getSeries(seriesIndex).getItemCount(); i++) {
this.updateSeries(candleDataset.getSeri... | Method createSeries. |
private int search(final byte[] key,final byte[][] keys,final int start,final int length){
if (length == 1) {
final byte[] tstkey=keys[start];
if (tstkey == null) return -(start + 1);
final int res=BytesUtil.compareBytes(key,tstkey);
if (res == 0) {
return start;
}
else if (res < 0)... | Optimized search for ordered insertion point using binary chop. TODO: Could be further optimized ignoring prefix bits Note that it does not return the first found position but the first index position to match |
public boolean isSetType(){
return this.type != null;
}
| Returns true if field type is set (has been assigned a value) and false otherwise |
public static byte[] combine(String rootname,List<String> fragments){
final StringBuilder buffer=new StringBuilder();
buffer.append(HEADER);
buffer.append(String.format("<%s>%n",rootname));
for ( final String f : fragments) {
buffer.append(String.format("%s%n",f));
}
buffer.append(String.format("</%s>%... | Combines the given list of fragments into a single XML file with the given root element. |
protected boolean isValid(){
boolean wordWrap=isWordWrapEnabled();
if (wordWrap) {
return outlineWrapped != null;
}
else {
return outlineUnwrapped != null;
}
}
| Returns whether the cached values in this label are valid. |
private void updateProgress(String progressLabel,int progress){
if (myHost != null && ((progress != previousProgress) || (!progressLabel.equals(previousProgressLabel)))) {
myHost.updateProgress(progressLabel,progress);
}
previousProgress=progress;
previousProgressLabel=progressLabel;
}
| Used to communicate a progress update between a plugin tool and the main Whitebox user interface. |
private static void createLuceneWikipediaIndex(String language) throws UIMAException, IOException {
CollectionReader reader=createReader(ExtendedWikipediaArticleReader.class,WikipediaReaderBase.PARAM_HOST,"YOUR_HOST",WikipediaReaderBase.PARAM_DB,"YOUR_DB",WikipediaReaderBase.PARAM_USER,"YOUR_USERNAME",WikipediaReader... | Creates a Lucene index from Wikipedia based on lower cased stems with length >=3 containing only characters. |
public Object clone(){
MyIdentityHashMap<K,V> result=null;
try {
result=(MyIdentityHashMap<K,V>)super.clone();
}
catch ( CloneNotSupportedException e) {
}
result.table=new Entry[table.length];
result.entrySet=null;
result.modCount=0;
result.size=0;
result.init();
result.putAllForCreate(this);
... | Returns a shallow copy of this <tt>MyIdentityHashMap</tt> instance: the keys and values themselves are not cloned. |
protected int sp2px(int spVal){
return (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,spVal,getResources().getDisplayMetrics());
}
| sp 2 px |
public void clearReminders(){
super.removeElement(Reminder.KEY);
}
| Removes all existing event reminder instances. |
private void resizeCluster(final ClusterResizeTask currentState){
ClusterMaintenanceTaskService.State patchState=new ClusterMaintenanceTaskService.State();
patchState.taskState=new TaskState();
patchState.taskState.stage=TaskState.TaskStage.STARTED;
Operation patchOperation=Operation.createPatch(UriUtils.buildU... | Performs the resize operation using SlavesNodeRollout. On successful completion, it marks the cluster as READY and moves the current task to FINISHED state. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.