code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public void drawPalette(int[] colors,int selectedColor){
drawPalette(colors,selectedColor,null);
}
| Adds swatches to table in a serpentine format. |
public static void assertEquals(String message,Attribute expected,Attribute actual,boolean compareDefaultValues){
Assert.assertEquals(message + " (attribute name)",expected.getName(),actual.getName());
Assert.assertEquals(message + " (attribute type of attribute '" + expected.getName()+ "': expected '"+ Ontology.AT... | Tests two attributes by using the name, type, block, type, default value and the nominal mapping |
private void updateProgress(int progress){
if (myHost != null && progress != previousProgress) {
myHost.updateProgress(progress);
}
previousProgress=progress;
}
| Used to communicate a progress update between a plugin tool and the main Whitebox user interface. |
public static Object prompt(Context cx,Scriptable thisObj,Object[] args,Function funObj){
WindowWrapper ww=(WindowWrapper)thisObj;
Window window=ww.window;
Object result;
switch (args.length) {
case 0:
result="";
break;
case 1:
String message=(String)Context.jsToJava(args[0],String.class);
result=window.pro... | Wraps the 'prompt' method of the Window interface. |
public static String crossValidateModel(String clustererString,Instances data,int numFolds,String[] options,Random random) throws Exception {
Clusterer clusterer=null;
String[] savedOptions=null;
double CvAv=0.0;
StringBuffer CvString=new StringBuffer();
if (options != null) {
savedOptions=new String[opti... | Performs a cross-validation for a DensityBasedClusterer clusterer on a set of instances. |
public static LRIcon my(final String name){
return new LRIcon(my_(name));
}
| Returns the my image icon resource specified by its name. |
public boolean addAuthIndex(String userName,String indexName){
if (userName == null || userName.equals("") || indexName == null || indexName.equals("")) {
return false;
}
userName=userName.toLowerCase();
indexName=indexName.toLowerCase();
if (userName.equals("root")) {
return false;
}
UserData use... | add permission to an user with specified indices |
private Provider createFromSimpleObject(SimpleObject simpleObject){
checkRequiredFields(simpleObject,REQUIRED_FIELDS);
String fullName=simpleObject.get(GIVEN_NAME) + " " + simpleObject.get(FAMILY_NAME);
Person person=new Person();
PersonName personName=new PersonName();
personName.setGivenName((String)simpleO... | Adds a new Provider (with associated User and Person). |
public static void decideChangeZone(final Entity entity,final int x,final int y){
final StendhalRPZone origin=entity.getZone();
final int entity_x=x + origin.getX();
final int entity_y=y + origin.getY();
final StendhalRPZone zone=SingletonRepository.getRPWorld().getZoneAt(origin.getLevel(),entity_x,entity_y,ent... | Change an entity's zone based on it's global world coordinates. |
public void stopDeceleration(){
mDecelerationAngularVelocity=0.f;
}
| Sets the deceleration-angular-velocity to 0f |
private static void refreshViews(String key){
synchronized (sViews) {
if (sViews.get(key) != null) {
for ( Set<LiveView> views : sViews.get(key).values()) {
for ( LiveView view : views) {
view.refresh(key);
}
}
}
}
}
| Refresh all views that are registered to listen for updates to the given preference Convenience method for #refreshViews(String key) |
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value="SBSC_USE_STRINGBUFFER_CONCATENATION") public void sendPacket(byte[] packet,int repeats){
if (repeats != 1) {
log.warn("Only single transmissions currently available");
}
int[] msgAsInt=MakePacket.createStream(packet);
if (msgAsInt[0] == 0) {
log... | Send a specific packet to the rails. |
public static void addFiles(final Project findBugsProject,File clzDir,final Pattern pat){
if (clzDir.isDirectory()) {
clzDir.listFiles(new FileCollector(pat,findBugsProject));
}
}
| recurse add all the files matching given name pattern inside the given directory and all subdirectories |
@Override public Uri[] createBeamUris(NfcEvent nfcEvent){
Log.i(TAG,"Beam event in progress; createBeamUris() called.");
Uri photoUri=Uri.parse(CONTENT_BASE_URI + FILENAME);
Log.i(TAG,"Sending URI: " + photoUri);
return new Uri[]{photoUri};
}
| Callback for Beam events (large file version). The return value here should be an array of content:// or file:// URIs to send. Note that the system must have read access to whatever URIs are provided here. |
public Object parse(Map params,URL url){
return parseURL(url,params);
}
| Parse a JSON data structure from content at a given URL. Convenience variant when using Groovy named parameters for the connection params. |
public static void main(String[] args) throws IgniteException {
try (Ignite ignite=Ignition.start("examples/config/example-ignite.xml")){
System.out.println();
System.out.println(">>> Entry processor example started.");
try (IgniteCache<Integer,Integer> cache=ignite.getOrCreateCache(CACHE_NAME)){
po... | Executes example. |
@Override public String toString(){
return String.format("BreakpointManager (Managing %d Breakpoints)",breakpointManager.getNumberOfBreakpoints(BreakpointType.REGULAR));
}
| Returns a string representation of the breakpoint manager. |
public SCW(){
this(0.5,Mode.SCWI,true);
}
| Creates a new SCW learner |
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. |
public SimpleFragmentIntent<F> putExtras(SimpleFragmentIntent<?> src){
if (src.extras != null) {
if (extras == null) {
extras=new Bundle(src.extras);
}
else {
extras.putAll(src.extras);
}
}
return this;
}
| Copy all extras in 'src' in to this intent. |
public String doubleMetaphone(String value,boolean alternate){
value=cleanInput(value);
if (value == null) {
return null;
}
boolean slavoGermanic=isSlavoGermanic(value);
int index=isSilentStart(value) ? 1 : 0;
DoubleMetaphoneResult result=new DoubleMetaphoneResult(this.getMaxCodeLen());
while (!result... | Encode a value with Double Metaphone, optionally using the alternate encoding. |
public UnitVarianceTransform(){
}
| Creates a new object for transforming datasets |
public String metaLocation(){
return metaLocation;
}
| Returns the URL specified by <samp>META </samp> <samp>HTTP-EQUIV </samp> elements of location type. More precisely, this method returns a non- <code>null</code> result iff there is at least one <samp>META HTTP-EQUIV </samp> element specifying a location URL (if there is more than one, we keep the first one). |
public static boolean deleteQuietly(File file){
if (file == null) {
return false;
}
try {
if (file.isDirectory()) {
cleanDirectory(file);
}
}
catch ( Exception ignored) {
}
try {
return file.delete();
}
catch ( Exception ignored) {
return false;
}
}
| Deletes a file, never throwing an exception. If file is a directory, delete it and all sub-directories. <p/> The difference between File.delete() and this method are: <ul> <li>A directory to be deleted does not have to be empty.</li> <li>No exceptions are thrown when a file or directory cannot be deleted.</li> </ul> |
public static long generateZeroMask(final int lsb,final int width,final OperandSize size){
Preconditions.checkNotNull(size,"Size argument can not be null");
Preconditions.checkPositionIndex(lsb,size.getBitSize() - 1);
Preconditions.checkArgument(width >= 1);
Preconditions.checkPositionIndex((lsb + width) - 1,si... | Generates a mask which starts at the lsb parameter and is width wide |
@Override public void startHandshake() throws IOException {
if (appDataIS == null) {
throw new IOException("Socket is not connected.");
}
if (socket_was_closed) {
throw new IOException("Socket has already been closed.");
}
if (!handshake_started) {
handshake_started=true;
if (sslParameters.get... | Performs the handshake process over the SSL/TLS connection as described in rfc 2246, TLS v1 specification http://www.ietf.org/rfc/rfc2246.txt. If the initial handshake has been already done, this method initiates rehandshake. This method works according to the specification of implemented class. |
protected boolean scrollLineEnd(TextView widget,Spannable buffer){
final int maxScrollX=getScrollBoundsRight(widget) - getInnerWidth(widget);
int scrollX=widget.getScrollX();
if (scrollX < maxScrollX) {
widget.scrollTo(maxScrollX,widget.getScrollY());
return true;
}
return false;
}
| Performs a scroll to line end action. Scrolls to the end of the line. |
public static LatLon greatCircleEndPosition(LatLon p,double greatCircleAzimuthRadians,double pathLengthRadians){
if (p == null) {
String message=Logging.getMessage("nullValue.LatLonIsNull");
Logging.logger().severe(message);
throw new IllegalArgumentException(message);
}
return greatCircleEndPosition(... | Computes the location on a great circle arc with the given starting location, azimuth, and arc distance. This method uses a spherical model, not elliptical. |
public void deleteAppWidgetId(int appWidgetId){
synchronized (mViews) {
mViews.remove(appWidgetId);
try {
sService.deleteAppWidgetId(appWidgetId,mContext.getUserId());
}
catch ( RemoteException e) {
throw new RuntimeException("system server dead?",e);
}
}
}
| Stop listening to changes for this AppWidget. |
public T caseFunctionDeclaration(FunctionDeclaration object){
return null;
}
| Returns the result of interpreting the object as an instance of '<em>Function Declaration</em>'. <!-- begin-user-doc --> This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc --> |
public static <T>T switchNode(final INaviViewNode node,final INodeTypeCallback<T> callback){
Preconditions.checkNotNull(node,"IE00121: Node argument can not be null");
Preconditions.checkNotNull(callback,"IE00970: Callback argument can not be null");
if (node instanceof INaviCodeNode) {
return callback.handle... | Switches over an INaviViewNode |
protected void fireContentsChanged(Object source,int index0,int index1){
Object[] listeners=listenerList.getListenerList();
ListDataEvent e=null;
for (int i=listeners.length - 2; i >= 0; i-=2) {
if (listeners[i] == ListDataListener.class) {
if (e == null) {
e=new ListDataEvent(source,ListDataEve... | <code>AbstractListModel</code> subclasses must call this method <b>after</b> one or more elements of the list change. The changed elements are specified by the closed interval index0, index1 -- the endpoints are included. Note that index0 need not be less than or equal to index1. |
public PurchasableEntity(Class<? extends Entity> clazz,long cost,ItemStack render,boolean lead){
this.product=render;
this.eClass=clazz;
this.cost=cost;
this.lead=lead;
this.resource=clazz.getSimpleName().toLowerCase(Locale.ENGLISH);
}
| If lead is true, entity spawns with a lead, otherwise, entity spawns mounting the player |
public E element(){
return getFirst();
}
| Gets but does not remove the head element of this deque. It throws an exception if the deque is empty. |
private boolean shouldUseShortName(Generator gen,Type type){
requireNonNull(gen);
requireNonNull(type);
final DependencyManager mgr=gen.getDependencyMgr();
if (mgr.isIgnored(type.getName())) {
return true;
}
if (mgr.isLoaded(type.getName())) {
return true;
}
final Optional<String> current=mgr.ge... | Returns whether or not to use the short name for the type. |
void deleteFiles(){
boolean needsDestroy=this.deleted.compareAndSet(false,true);
if (needsDestroy) {
this.getOplogSet().removeOverflow(this);
deleteFile();
}
}
| deletes the oplog's file(s) |
public static Set<Sequence> defaultSeeds(){
List<Object> seeds=new ArrayList<>(primitiveSeeds);
return SeedSequences.objectsToSeeds(seeds);
}
| A set of sequences that create primitive values, e.g. int i = 0; or String s = "hi"; |
final public SyntaxTreeNode Theorem() throws ParseException {
SyntaxTreeNode tn;
Token t;
bpa("Theorem");
expecting="THEOREM, PROPOSITION";
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case THEOREM:
t=jj_consume_token(THEOREM);
break;
case PROPOSITION:
t=jj_consume_token(PROPOSITION);
break;
default :
jj... | Theorem ::= ( <THEOREM> | <PROPOSITION> ) ( Identifier <DEF> )? ( AssumeProve | Expression ) * Produces a Theorem node tn with tn.zero containing 2 or 4 nodes, depending on whether or not the "Identifier <DEF>" is present. |
public double kincaid(List<String> words,int nrofSentences){
words=filterWords(words);
int nrofSyllables=this.syllableCounter.countSyllables(words);
return kincaid(words.size(),nrofSyllables,nrofSentences);
}
| Calculate Kincaid Formula (reading grade). |
public AnnotationMirror division(AnnotatedTypeMirror lht,AnnotatedTypeMirror rht){
if (UnitsRelationsTools.hasNoUnits(lht)) {
if (UnitsRelationsTools.hasSpecificUnit(rht,millisecond)) {
return kilohertz;
}
else if (UnitsRelationsTools.hasSpecificUnit(rht,second)) {
return hertz;
}
}
r... | Division of a scalar by seconds yields Hertz. Division of a scalar by milliseconds yields Kilohertz. Other divisions yield an unannotated value. |
public void deleteAttribute(boolean multiple){
if (!isPanelSelected()) {
return;
}
if (multiple) {
getCurrentPanel().deleteAttributes();
}
else {
getCurrentPanel().deleteAttribute();
}
}
| deletes the current selected Attribute or several chosen ones |
public Weeks plus(int weeks){
if (weeks == 0) {
return this;
}
return Weeks.weeks(FieldUtils.safeAdd(getValue(),weeks));
}
| Returns a new instance with the specified number of weeks added. <p> This instance is immutable and unaffected by this method call. |
protected AbstractDescendantSelector(Selector ancestor,SimpleSelector simple){
ancestorSelector=ancestor;
simpleSelector=simple;
}
| Creates a new DescendantSelector object. |
public static void plotResults(DataSequence orig,DataSequence predicted,ArrayList<Anomaly> anomalyList,Properties config){
GUIUtils gui=new GUIUtils("EGADS GUI",orig,predicted,anomalyList,config);
gui.pack();
gui.setVisible(true);
JFrame frame=new JFrame("EGADS GUI");
JOptionPane.showMessageDialog(frame,"Clic... | Starting point for the forecasting charting demo application. |
protected void adjustForLength(int length){
int size=this.getLattice().size() - 2;
if (size > length) {
LOG.warn("sentence {} too long {}, truncating to length {}",id(),size,length);
String[] tokens=source.split("\\s+");
source=tokens[0];
for (int i=1; i < length; i++) source+=" " + tokens[i];
... | If the input sentence is too long (not counting the <s> and </s> tokens), it is truncated to the maximum length, specified with the "maxlen" parameter. Note that this code assumes the underlying representation is a sentence, and not a lattice. Its behavior is undefined for lattices. |
public boolean matches(String domain){
if (pattern != null) {
return pattern.matcher(domain).matches();
}
return this.domain.equals(domain);
}
| Tells whether or not the given domain is excluded. |
public void clearStack(){
top=0;
}
| Clears the operand stack of this frame. |
public void connect(NetworkInterface anotherInterface){
if (isScanning() && anotherInterface.getHost().isRadioActive() && isWithinRange(anotherInterface)&& !isConnected(anotherInterface)&& (this != anotherInterface)) {
int conSpeed=anotherInterface.getTransmitSpeed(this);
if (conSpeed > this.transmitSpeed) {
... | Tries to connect this host to another host. The other host must be active and within range of this host for the connection to succeed. |
public <T>boolean unset(ConfigurationKey<T> key){
if (key == null) {
throw new IllegalArgumentException("key must not be null!");
}
return this.configMap.remove(key) != null;
}
| Unsets the given key and its value. |
public void removeAttackReqeust(){
if (originalSoapAction != null && attackRequest != null) {
attackRequest.getOperation().setAction(originalSoapAction);
originalSoapAction=null;
}
if (attackRequest != null) {
attackRequest.getOperation().removeRequest(attackRequest);
attackRequest=null;
}
}
| Observer function which is called if the attack request is removed. |
private static boolean isServerProblem(Object error){
return (error instanceof ServerError) || (error instanceof AuthFailureError);
}
| Determines whether the error is related to server |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:55:32.612 -0500",hash_original_method="A36333A6F745F23182438BFF478F971C",hash_generated_method="3E83C3693072E036EE6283AD07E42258") public String encode(){
return encode(new StringBuffer()).toString();
}
| Construct a URL from the parsed structure. |
private void updateProgress(int progress){
if (myHost != null && progress != previousProgress) {
myHost.updateProgress(progress);
}
previousProgress=progress;
}
| Used to communicate a progress update between a plugin tool and the main Whitebox user interface. |
public void output(Vertex output){
if (!isEnabled()) {
return;
}
Vertex sense=output.mostConscious(Primitive.SENSE);
if ((sense == null) || (!getPrimitive().equals(sense.getData()))) {
return;
}
Vertex target=output.mostConscious(Primitive.TARGET);
String replyTo=target.mostConscious(Primitive.WOR... | Output the email reply. |
public void text(String str,float x1,float y1,float x2,float y2){
if (textFont == null) {
defaultFontOrDeath("text");
}
float hradius, vradius;
switch (rectMode) {
case CORNER:
x2+=x1;
y2+=y1;
break;
case RADIUS:
hradius=x2;
vradius=y2;
x2=x1 + hradius;
y2=y1 + vradius;
x1-=hradius;
y1-=vradius;
break;
... | Draw text in a box that is constrained to a particular size. The current rectMode() determines what the coordinates mean (whether x1/y1/x2/y2 or x/y/w/h). <P/> Note that the x,y coords of the start of the box will align with the *ascent* of the text, not the baseline, as is the case for the other text() functions. <P/>... |
public void withVoidTransaction(@NotNull Propagation propagation,@NotNull Isolation isolation,@NotNull VoidTransactionCallback callback){
withTransaction(propagation,isolation,fromVoidCallback(callback));
}
| Executes a block of code with given propagation and isolation. |
public void addFocusListener(FocusListener l){
}
| Adds the specified focus listener to receive focus events from this component. |
public static LikeExpression notLike(String propertyName,String value){
return new LikeExpression(getPropExpr(propertyName),new ConstantExpression(value),true);
}
| SQL-Like negated (not like). |
static MediaType createApplicationType(String subtype){
return create(APPLICATION_TYPE,subtype);
}
| Creates a media type with the "application" type and the given subtype. |
public boolean checkForDangerousProps(){
final Map<String,String> dangerousProps=new HashMap<String,String>();
dangerousProps.put("ro.debuggable","1");
dangerousProps.put("ro.secure","0");
boolean result=false;
String[] lines=propsReader();
for ( String line : lines) {
for ( String key : dangerousPr... | Checks for several system properties for |
public static String toString(Reader input) throws IOException {
StringWriter sw=new StringWriter();
copy(input,sw);
return sw.toString();
}
| Get the contents of a <code>Reader</code> as a String. <p> This method buffers the input internally, so there is no need to use a <code>BufferedReader</code>. |
public void reset(){
npoints=0;
bounds=null;
path=new GeneralPath();
closedPath=null;
}
| Resets this <code>Polygon</code> object to an empty polygon. |
public Mul4(){
super("mul4",4);
}
| The multiplication of 4 parameters. |
public static final Geo[] hull(Geo[] geos){
return hull(geos,0);
}
| Using Graham's scan. |
public void addValue(final double value){
if (dataSetSize == dataSet.length) {
final int newLength=(int)(GROWTH_RATE * dataSetSize);
final double[] newDataSet=new double[newLength];
java.lang.System.arraycopy(dataSet,0,newDataSet,0,dataSetSize);
dataSet=newDataSet;
}
dataSet[dataSetSize]=value;
... | Adds a single value to the data set and updates any statistics that are calculated cumulatively. |
private int appendHeader(int field){
switch (field) {
case PduHeaders.MMS_VERSION:
appendOctet(field);
int version=mPduHeader.getOctet(field);
if (0 == version) {
appendShortInteger(PduHeaders.CURRENT_MMS_VERSION);
}
else {
appendShortInteger(version);
}
break;
case PduHeaders.MESSAGE_ID:
case PduHeaders.TRA... | Append header to mMessage. |
public static String convertParametrizedType(Type type,ParameterizedType parameterizedType,Type rawType){
if (List.class.equals(rawType)) {
return "Array<" + convertType(parameterizedType.getActualTypeArguments()[0]) + ">";
}
else if (Map.class.equals(rawType)) {
return "Map<" + convertType(parameterized... | Handle convert of a parametrized Java type to TypeScript type |
public void execute(MethodInfo method,int pos,CodeIterator iter,Frame frame,Subroutine subroutine) throws BadBytecode {
this.lastPos=pos;
int opcode=iter.byteAt(pos);
switch (opcode) {
case NOP:
break;
case ACONST_NULL:
frame.push(Type.UNINIT);
break;
case ICONST_M1:
case ICONST_0:
case ICONST_1:
case ICONST_... | Execute the instruction, modeling the effects on the specified frame and subroutine. If a subroutine is passed, the access flags will be modified if this instruction accesses the local variable table. |
public void cancelPairing(){
for ( DeviceService service : services.values()) {
service.cancelPairing();
}
}
| Explicitly cancels pairing on all services that require pairing. In some services, this will hide a prompt that is displaying on the device. |
public void addBehavior(String behavior){
if (null == this.behaviors) {
this.behaviors=new ArrayList<String>(5);
}
this.behaviors.add(behavior);
}
| <p class="changed_added_2_0"></p> |
public Position(){
lineNumber=1;
columnNumber=0;
}
| Creates a position for the start of an entity: the line number is 1 and the column number is 0. |
private RefreshNotificationType(String type,String msg){
this.type=type;
this.msg=msg;
}
| Creates a new instance of RefreshNotificationType. |
public static void main(String[] args){
String[] a=StdIn.readAllStrings();
Quick.sort(a);
show(a);
assert isSorted(a);
StdRandom.shuffle(a);
StdOut.println();
for (int i=0; i < a.length; i++) {
String ith=(String)Quick.select(a,i);
StdOut.println(ith);
}
}
| Reads in a sequence of strings from standard input; quicksorts them; and prints them to standard output in ascending order. Shuffles the array and then prints the strings again to standard output, but this time, using the select method. |
private static boolean isSorted(Comparable[] a){
for (int i=1; i < a.length; i++) if (less(a[i],a[i - 1])) return false;
return true;
}
| Check if array is sorted - useful for debugging. |
protected SVGGraphicsElement(){
}
| Creates a new SVGGraphicsElement. |
@Override public void updateBlob(String columnLabel,Blob x) throws SQLException {
try {
if (isDebugEnabled()) {
debugCode("updateBlob(" + quote(columnLabel) + ", x);");
}
checkClosed();
Value v;
if (x == null) {
v=ValueNull.INSTANCE;
}
else {
v=conn.createBlob(x.getBinaryStr... | Updates a column in the current or insert row. |
public void java_lang_System_arraycopy(SootMethod method,ReferenceVariable thisVar,ReferenceVariable returnVar,ReferenceVariable params[]){
ReferenceVariable srcElm=helper.arrayElementOf(params[0]);
ReferenceVariable dstElm=helper.arrayElementOf(params[2]);
ReferenceVariable tmpVar=helper.tempLocalVariable(method... | Copies an array from the specified source array, beginning at the specified position, to the specified position of the destination array. NOTE: If the content of array is reference type, then it is necessary to build a connection between elements of two arrays dst[] = src[] public static native void arraycopy(java.la... |
protected void updateFallState(double par1,boolean par3){
final int i=MathHelper.floor_double(this.posX);
final int j=MathHelper.floor_double(this.posY);
final int k=MathHelper.floor_double(this.posZ);
if (par3) {
if (this.fallDistance > 3.0F) {
this.fall(this.fallDistance);
if (!this.worldObj.i... | Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround |
public boolean isPDF(){
return m_name.toLowerCase().endsWith(".pdf");
}
| Is attachment entry a PDF |
protected TargetImpl(){
super();
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
private void saveAccount(){
AccountsSource accountsSource=new AccountsSource(getApplicationContext());
accountsSource.wOpen();
try {
if (isEditing) {
account.setUrlShaarli(this.urlShaarli);
account.setUsername(this.username);
account.setPassword(this.password);
account.setBasicAuthUser... | Save a new account into the database, should be called only if the account was verified. |
public void spaceVertical(ArrayList<Integer> nodes){
if (m_bNeedsUndoAction) {
addUndoAction(new spaceVerticalAction(nodes));
}
int nMinY=-1;
int nMaxY=-1;
for (int iNode=0; iNode < nodes.size(); iNode++) {
int nY=getPositionY(nodes.get(iNode));
if (nY < nMinY || iNode == 0) {
nMinY=nY;
... | space out set of nodes evenly between top and bottom most node in the list |
public Object runSafely(Catbert.FastStack stack) throws Exception {
int v=getInt(stack);
CaptureDeviceInput conn=getCapDevInput(stack);
if (conn != null) conn.setSaturation(v);
return null;
}
| Sets the saturation for capture on this CaptureDeviceInput. This only affects analog capture devices |
public void testAttributeWithMissing(){
((MergeManyValues)m_Filter).setAttributeIndex("5");
((MergeManyValues)m_Filter).setMergeValueRange("1,2");
Instances result=useFilter();
assertEquals(m_Instances.numAttributes(),result.numAttributes());
assertEquals(m_Instances.numInstances(),result.numInstances());
i... | Tests attribute with missing values. |
public static void debug(Logger log,String msg,IoBuffer buf){
}
| Format debug message |
public static SimpleName[] findByNode(ASTNode root,SimpleName name){
IBinding binding=name.resolveBinding();
if (binding != null) {
return findByBinding(root,binding);
}
SimpleName[] names=findByProblems(root,name);
if (names != null) {
return names;
}
int parentKind=name.getParent().getNodeType()... | Find all nodes connected to the given name node. If the node has a binding then all nodes connected to this binding are returned. If the node has no binding, then all nodes that also miss a binding and have the same name are returned. |
public static <T>LazyPSetX<T> generate(long limit,Supplier<T> s){
return fromStreamS(ReactiveSeq.generate(s).limit(limit));
}
| Generate a LazyPStackX from the provided Supplier up to the provided limit number of times |
public static boolean isPropertyArray(String name){
return name.trim().endsWith("[]");
}
| Returns true if the name indicates that the type is an array type. |
public void test_webapp_structure_favicon() throws Exception {
doGET(m_serviceURL + "/html/favicon.ico");
}
| The <code>favicon.ico</code> file. |
public T caseRegularExpressionBody(RegularExpressionBody object){
return null;
}
| Returns the result of interpreting the object as an instance of '<em>Body</em>'. <!-- begin-user-doc --> This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc --> |
public QuartzSchedulerResources(){
}
| <p> Create an instance with no properties initialized. </p> |
public static Attribute createAttribute(Attribute attribute,String functionName){
Attribute result=(Attribute)attribute.clone();
if (functionName == null) {
result.setName(attribute.getName());
}
else {
result.setName(functionName + "(" + attribute.getName()+ ")");
result.setConstruction(functionName... | Simple clone factory method for attributes. Returns the clone of the given attribute and sets the function name to the given one if not null. In this case the attribute is used as an argument of returned attribute. This method might be usefull for example to create a prediction attribute with the same properties as the... |
public static <K,V>ConcurrentHashMap<K,V> concurrentHashMap(){
return new ConcurrentHashMap<K,V>();
}
| Create a new ConcurrentHashMap. |
public CModuleUpdater(final ZyGraph graph){
m_graph=graph;
}
| Creates a new updater object. |
public Matrix4 scale(float scaleX,float scaleY,float scaleZ){
tmp[M00]=scaleX;
tmp[M01]=0;
tmp[M02]=0;
tmp[M03]=0;
tmp[M10]=0;
tmp[M11]=scaleY;
tmp[M12]=0;
tmp[M13]=0;
tmp[M20]=0;
tmp[M21]=0;
tmp[M22]=scaleZ;
tmp[M23]=0;
tmp[M30]=0;
tmp[M31]=0;
tmp[M32]=0;
tmp[M33]=1;
mul(val,tmp);
r... | Postmultiplies this matrix with a scale matrix. Postmultiplication is also used by OpenGL ES' 1.x glTranslate/glRotate/glScale. |
public CreateRequest(String path,LwM2mObjectInstance instance){
this(null,new LwM2mPath(path),instance.getId(),instance.getResources().values().toArray((new LwM2mResource[instance.getResources().size()])));
}
| Creates a request for creating an instance of a particular object.</br> If the path is an object path, the instance id will be chosen by the client and accessible in the CreateResponse. To choose instance id at server side, the path must be an object instance path. |
public static boolean putLong(Context context,String key,long value){
SharedPreferences settings=context.getSharedPreferences(PREFERENCE_NAME,Context.MODE_PRIVATE);
SharedPreferences.Editor editor=settings.edit();
editor.putLong(key,value);
return editor.commit();
}
| put long preferences |
private double classifyInstance(Instance example) throws Exception {
boolean passedAllTests=true;
for (Enumeration<Test> e=new WekaEnumeration<Test>(m_RuleList); passedAllTests && e.hasMoreElements(); ) {
Test test=e.nextElement();
passedAllTests=test.passesTest(example);
}
if (passedAllTests) {
ret... | classifies the given example |
public void sample(String input,String output,int numPosts) throws IOException {
Random random=new Random();
JsonUtil J=new JsonUtil();
Map<String,List<String>> userposts=new Hashtable<String,List<String>>();
RecordReader reader=new RecordReader(input);
while (reader.next()) {
Post p=J.fromJson(reader.val... | Load all data into the memory, then sample numPosts posts for each user. |
@Category(FlakyTest.class) @Test public void testMultipleManagersInSameProcess() throws Exception {
MembershipManager m1=null, m2=null;
Locator l=null;
int mcastPort=AvailablePortHelper.getRandomAvailableUDPPort();
try {
int port=AvailablePortHelper.getRandomAvailableTCPPort();
InetAddress localHost=Soc... | This test creates a locator with a colocated membership manager and then creates a second manager that joins the system of the first. It then makes assertions about the state of the membership view, closes one of the managers and makes more assertions. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.