code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public ComputeElementRestRep rediscover(URI id){
return client.post(ComputeElementRestRep.class,getIdUrl() + "/discover",id);
}
| Rediscover a compute element. <p> API Call: <tt>POST /vdc/compute-elements/{id}/discover</tt> |
public Iterator<E> iterator(){
return new Itr();
}
| Returns an iterator over the elements in this queue in proper sequence. The elements will be returned in order from first (head) to last (tail). <p>The returned iterator is <a href="package-summary.html#Weakly"><i>weakly consistent</i></a>. |
public int addAggregate(AggregateFunctionExpression aggregate){
int position=groupBy.size() + aggregates.size();
aggregates.add(aggregate);
options.add(aggregate.getOption());
return position;
}
| Add a new aggregate and return its position. |
public static void main(String args[]) throws Exception {
Security.setProperty("jdk.tls.disabledAlgorithms","");
setupBasePort();
RmiBootstrapTest manager=new RmiBootstrapTest();
try {
manager.run(args);
}
catch ( RuntimeException r) {
System.out.println("Test Failed: " + r.getMessage());
System... | Calls run(args[]). exit(1) if the test fails. |
@Override protected void drawXLabels(List<Double> xLabels,Double[] xTextLabelLocations,Canvas canvas,Paint paint,int left,int top,int bottom,double xPixelsPerUnit,double minX,double maxX){
int length=xLabels.size();
if (length > 0) {
boolean showLabels=mRenderer.isShowLabels();
boolean showGridY=mRenderer.i... | The graphical representation of the labels on the X axis. |
public List<EvaluationStatistics> retrieve(MultiLabelClassifier classifier,Instances dataset){
List<EvaluationStatistics> result;
String cls;
String rel;
result=new ArrayList<>();
cls=Utils.toCommandLine(classifier);
rel=dataset.relationName();
for ( EvaluationStatistics stat : m_Statistics) {
if (st... | Retrieves the statis for the specified combination of classifier and dataset. |
public static boolean isLeapYear(int year){
return (year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0));
}
| Determines if a year is a leap year. |
public void updateGeoDescription(Context context,String fallbackNumber){
String number=TextUtils.isEmpty(phoneNumber) ? fallbackNumber : phoneNumber;
geoDescription=getGeoDescription(context,number);
}
| Updates this CallerInfo's geoDescription field, based on the raw phone number in the phoneNumber field. (Note that the various getCallerInfo() methods do *not* set the geoDescription automatically; you need to call this method explicitly to get it.) |
synchronized SignatureData createSignatureData(String signature,int signerIndex){
return new SignatureData(signature,hashChainResult,hashChains != null ? hashChains[signerIndex] : null);
}
| Returns the signature data for a given signer -- either normal signature or batch signature with corresponding hash chain and hash chain result. |
public SimpleScheduleBuilder withIntervalInMinutes(int intervalInMinutes){
this.interval=intervalInMinutes * DateBuilder.MILLISECONDS_IN_MINUTE;
return this;
}
| Specify a repeat interval in minutes - which will then be multiplied by 60 * 1000 to produce milliseconds. |
public CShowOptionsDialogAction(final JFrame parent,final DebugTargetSettings debugTarget,final IDebugger debugger){
super("Show Options");
Preconditions.checkNotNull(parent,"IE01471: Parent argument can not be null");
Preconditions.checkNotNull(debugTarget,"IE01472: Debug target argument can not be null");
Pre... | Creates a new action object. |
public synchronized OMGraphicList prepare(){
Projection projection=getProjection();
if (projection == null) {
Debug.error("DTED Layer needs to be added to the MapBean before it can draw images!");
return new OMGraphicList();
}
DTEDCacheManager cache=getCache();
if (!(projection instanceof EqualArc)) {... | Prepares the graphics for the layer. This is where the getRectangle() method call is made on the dted. <p> Occasionally it is necessary to abort a prepare call. When this happens, the map will set the cancel bit in the LayerThread, (the thread that is running the prepare). If this Layer needs to do any cleanups during ... |
Circle2D(){
this(0,0,1);
}
| Create a default Circle2D with (0,0) for (x,y) and 1 for radius |
public Graph search(){
lookupArrows=new ConcurrentHashMap<>();
final List<Node> nodes=new ArrayList<>(variables);
this.effectEdgesGraph=getEffectEdges(nodes);
if (adjacencies != null) {
adjacencies=GraphUtils.replaceNodes(adjacencies,nodes);
}
Graph graph;
if (initialGraph == null) {
graph=new Edg... | Greedy equivalence search: Start from the empty graph, add edges till model is significant. Then start deleting edges till a minimum is achieved. |
private static void write(CharSequence from,File to,Charset charset,boolean append) throws IOException {
asCharSink(to,charset,modes(append)).write(from);
}
| Private helper method. Writes a character sequence to a file, optionally appending. |
@DSComment("Private Method") @DSBan(DSCat.PRIVATE_METHOD) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:58:13.011 -0500",hash_original_method="64392856CD4BE8946E6224874D95C0C3",hash_generated_method="BCF93A278DC9D95CE64E1A5A048773E7") private int socksGetServerPort(){
InetSocket... | Gets the SOCKS proxy server port. |
private void writeMajorStatisticsString(BufferedWriter output,SAZone zone) throws IOException {
output.write(zone.getName());
output.write(delimiter);
output.write(String.valueOf(zone.getMajorActivityCount()));
output.write(delimiter);
for (int i=0; i < 24; i++) {
output.write(String.valueOf(zone.getMajor... | Method to create a statistics string for 'major' activities. |
public MockHttpSession(ServletContext servletContext,String id){
this.servletContext=(servletContext != null ? servletContext : new MockServletContext());
this.id=(id != null ? id : Integer.toString(nextId++));
}
| Create a new MockHttpSession. |
private EditVariableDialog(final Window parent,final String title,final String variableName){
super(parent,title,ModalityType.APPLICATION_MODAL);
this.parent=parent;
setLayout(new BorderLayout());
new CDialogEscaper(this);
nameField.setText(variableName);
nameField.setSelectionStart(0);
nameField.setSelec... | Creates a new dialog to rename a variable. |
public static void addGzipHeader(HttpServletResponse response) throws GzipResponseHeadersNotModifiableException {
response.setHeader("Content-Encoding","gzip");
boolean containsEncoding=response.containsHeader("Content-Encoding");
if (!containsEncoding) {
throw new GzipResponseHeadersNotModifiableException("F... | Adds the gzip HTTP header to the response. <p/> <p> This is need when a gzipped body is returned so that browsers can properly decompress it. </p> |
public void store(Word value,Offset offset){
}
| Stores the word value in the memory location pointed to by the current instance. |
public static MemcacheClientBuilder<String> newStringClient(Charset charset){
return new MemcacheClientBuilder<>(new StringTranscoder(charset));
}
| Create a client builder with a basic string transcoder using the supplied Charset. |
static void loadActionMap(LazyActionMap map){
map.put(new Actions(Actions.TOGGLE_SORT_ORDER));
map.put(new Actions(Actions.SELECT_COLUMN_TO_LEFT));
map.put(new Actions(Actions.SELECT_COLUMN_TO_RIGHT));
map.put(new Actions(Actions.MOVE_COLUMN_LEFT));
map.put(new Actions(Actions.MOVE_COLUMN_RIGHT));
map.put(n... | Populates TableHeader's actions. |
protected void initModel() throws Exception {
if (m_Model == null) {
m_Model=(Classifier)SerializationHelper.read(m_ModelFile.getAbsolutePath());
}
}
| loads the serialized model if necessary, throws an Exception if the derserialization fails. |
@Override public void teardown(){
}
| a noop |
public DenseFeatureStore(){
this.instanceList=new ObjectArrayList<>();
this.featureNames=null;
}
| Creates an empty feature store |
public ImageIcon loadImage(String imageName){
try {
ClassLoader classloader=getClass().getClassLoader();
java.net.URL url=classloader.getResource(imageName);
if (url != null) {
ImageIcon icon=new ImageIcon(url);
return icon;
}
}
catch ( Exception e) {
e.printStackTrace();
}
thr... | Helper method to load an image file from the CLASSPATH |
public void remove(XAtom atom){
atoms.remove(atom);
}
| Removes atom from the list. Does nothing if arrays doesn't conaint this atom. |
public Object runSafely(Catbert.FastStack stack) throws Exception {
return new Integer(!Sage.WINDOWS_OS ? 0 : Sage.readDwordValue(Sage.HKEY_LOCAL_MACHINE,"SOFTWARE\\Frey Technologies\\Common\\DSFilters\\MpegDeMux","AudioDelay"));
}
| Gets the audio delay in milliseconds to apply when playing back MPEG2 files (Windows only) |
public int rank(DoubleMatrix2D A){
return svd(A).rank();
}
| Returns the effective numerical rank of matrix <tt>A</tt>, obtained from Singular Value Decomposition. |
private String encodeToString(String in,int flags) throws Exception {
String b64=Base64.encodeToString(in.getBytes(),flags);
String dec=decodeString(b64);
assertEquals(in,dec);
return b64;
}
| Encodes the string 'in' using 'flags'. Asserts that decoding gives the same string. Returns the encoded string. |
public boolean login(final String userName,final String hashedPassword){
final Connection con=Database.getConnection();
try {
PreparedStatement ps=con.prepareStatement("select username from ta_users where username = ? and password = ?");
ps.setString(1,userName);
ps.setString(2,hashedPassword);
fin... | Validate the username password, returning true if the user is able to login. This has the side effect of updating the users last login time. |
public long xminimum(){
return this.minValue;
}
| deprecated Returns the minimum element legal to the stored in the receiver. Remark: This does not mean that such a minimum element is currently contained in the receiver. |
public StringRequest(int method,String url,Listener<String> listener,ErrorListener errorListener){
super(method,url,errorListener);
mListener=listener;
}
| Creates a new request with the given method. |
public void test_getPeerPort() throws NoSuchAlgorithmException {
SSLEngine e=getEngine();
assertEquals("Incorrect default value of peer port",-1,e.getPeerPort());
e=getEngine("www.fortify.net",80);
assertEquals("Incorrect peer port",80,e.getPeerPort());
}
| Test for <code>getPeerPort()</code> method |
public static boolean allAscii(String s){
int len=s.length();
for (int i=0; i < len; ++i) {
if ((s.charAt(i) & 0xff80) != 0) {
return false;
}
}
return true;
}
| Determines if a string contains only ascii characters |
public DoubleVector cat(DoubleVector v){
DoubleVector w=new DoubleVector(size() + v.size());
w.set(0,size() - 1,this,0);
w.set(size(),size() + v.size() - 1,v,0);
return w;
}
| Combine two vectors together |
public void removeKey(K key){
map.remove(key);
}
| Completely removes all values associated with a key |
protected JvmRuntimeMeta createJvmRuntimeMetaNode(String groupName,String groupOid,ObjectName groupObjname,MBeanServer server){
return new JvmRuntimeMetaImpl(this,objectserver);
}
| Factory method for "JvmRuntime" group metadata class. You can redefine this method if you need to replace the default generated metadata class with your own customized class. |
public boolean calculateTaxTotal(){
log.fine("");
DB.executeUpdateEx("DELETE C_OrderTax WHERE C_Order_ID=" + getC_Order_ID(),get_TrxName());
m_taxes=null;
BigDecimal totalLines=Env.ZERO;
ArrayList<Integer> taxList=new ArrayList<Integer>();
MOrderLine[] lines=getLines();
for (int i=0; i < lines.length; i++... | Calculate Tax and Total |
Log createLogFromClassName(String classLabel) throws Exception {
Class<?> clazz=Class.forName(logClassName);
@SuppressWarnings("unchecked") Constructor<Log> constructor=(Constructor<Log>)clazz.getConstructor(String.class);
return constructor.newInstance(classLabel);
}
| Try to create the log from the class name which may throw. |
@DSComment("Package priviledge") @DSBan(DSCat.DEFAULT_MODIFIER) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:36:13.733 -0500",hash_original_method="AF3B09D914ADDB679280100B7539789D",hash_generated_method="AF3B09D914ADDB679280100B7539789D") void restartConnection(boolean proceed){... | Restart a secure connection suspended waiting for user interaction. |
public void addHam(Reader stream) throws java.io.IOException {
addTokenOccurrences(stream,hamTokenCounts);
hamMessageCount++;
}
| Adds a message to the ham list. |
public void addTree(Tree tree,HashMap<String,Integer> taxonMap){
samples++;
List<Clade> clades=new ArrayList<Clade>();
List<Clade> parentClades=new ArrayList<Clade>();
getClades(tree,tree.getRoot(),parentClades,clades,taxonMap);
for ( Clade c : clades) {
if (cladeProbabilities.containsKey(c.getBits())) {... | increments the number of occurrences for all conditional clades |
public void createUnderlying(){
if (Platform.isFxApplicationThread()) {
options=new com.lynden.gmapsfx.shapes.PolylineOptions();
if (path != null) {
LatLong[] ary=path.stream().map(null).collect(Collectors.toList()).toArray(new LatLong[0]);
MVCArray a=new MVCArray(ary);
options.path(a);
... | Creates the underlying PolylineOptions |
@Override public int read() throws IOException {
return in.read();
}
| Reads a single byte from the filtered stream and returns it as an integer in the range from 0 to 255. Returns -1 if the end of this stream has been reached. |
public MP3Player(PlayerCallback playerCallback){
this(playerCallback,DEFAULT_AUDIO_BUFFER_CAPACITY_MS,DEFAULT_DECODE_BUFFER_CAPACITY_MS);
}
| Creates a new player. |
@Override protected void onPause(){
super.onPause();
LOG.d(TAG,"Paused the activity.");
if (this.appView != null) {
this.appView.handlePause(this.keepRunning);
}
}
| Called when the system is about to start resuming a previous activity. |
protected void detailExecuteLogic(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response){
logger.info("Inicio de detailExecuteLogic");
ServiceRepository services=ServiceRepository.getInstance(ServiceClient.create(getAppUser(request)));
GestionAuditoriaBI service=services.lo... | Muestra el detalle de una pista pistas de auditoria. |
private void createLanesFor3WayNetwork(MutableScenario sc){
LaneDefinitions11 lanes=new LaneDefinitions11Impl();
LaneDefinitionsFactory11 fac=lanes.getFactory();
LanesToLinkAssignment11 l2l=fac.createLanesToLinkAssignment(Id.create(13,Link.class));
lanes.addLanesToLinkAssignment(l2l);
LaneData11 lane=fac.crea... | Creates lanes for the 3 way network, ids ascending from left to right |
public void testReadTime() throws Exception {
long currentTimeMillis;
long count=0;
for (int i=0; i < 5; i++) {
logger.info("System.currentTimeMillis() invocation count: " + count);
for (int j=0; j < 1000000; j++) {
count++;
currentTimeMillis=0;
currentTimeMillis=System.currentTimeMillis... | Test the time required to read time from the VM. |
public static int safeNegate(int value){
if (value == Integer.MIN_VALUE) {
throw new ArithmeticException("Integer.MIN_VALUE cannot be negated");
}
return -value;
}
| Negates the input throwing an exception if it can't negate it. |
@Override public void println(int priority,String tag,String msg,Throwable tr){
String useMsg=msg;
if (useMsg == null) {
useMsg="";
}
if (tr != null) {
msg+="\n" + Log.getStackTraceString(tr);
}
Log.println(priority,tag,useMsg);
if (mNext != null) {
mNext.println(priority,tag,msg,tr);
}
}
| Prints data out to the console using Android's native log mechanism. |
@Nullable private Figure readElement(IXMLElement elem) throws IOException {
if (DEBUG) {
System.out.println("SVGInputFormat.readElement " + elem.getName() + " line:"+ elem.getLineNr());
}
Figure f=null;
if (elem.getNamespace() == null || elem.getNamespace().equals(SVG_NAMESPACE)) {
String name=elem.getN... | Reads an SVG element of any kind. |
public static Matrix read(BufferedReader input) throws java.io.IOException {
StreamTokenizer tokenizer=new StreamTokenizer(input);
tokenizer.resetSyntax();
tokenizer.wordChars(0,255);
tokenizer.whitespaceChars(0,' ');
tokenizer.eolIsSignificant(true);
java.util.Vector<Object> v=new java.util.Vector<Object>(... | Read a matrix from a stream. The format is the same the print method, so printed matrices can be read back in (provided they were printed using US Locale). Elements are separated by whitespace, all the elements for each row appear on a single line, the last row is followed by a blank line. |
public static String[] explode(final String str,final char delimiter){
return explode(str,delimiter,0);
}
| Splits a string at the specified delimiter into multiple substrings. This method is similar to <code>String.split()</code>, but does only take a single char as a delimiter and not a regular expression, making this method a lot faster than <code>String.split()</code> if no regular expressions are required. |
public NetworkResponse performRequest(Request<?> request) throws HttpException {
while (true) {
HttpResponse httpResponse=null;
byte[] responseContents=null;
Map<String,String> responseHeaders=new HashMap<String,String>();
try {
Map<String,String> headers=new HashMap<String,String>();
http... | Actually executing a request |
public ObjectiveComparator(int objective){
this.objective=objective;
}
| Constructs a comparator for comparing solutions using the value of the specified objective. |
public void analyzeFrames(){
log.debug("Analyzing frames");
timePosMap=new HashMap<Integer,Long>();
samplePosMap=new HashMap<Integer,Long>();
int sample=1;
Long pos=null;
if (videoSamplesToChunks != null) {
int compositeIndex=0;
CompositionTimeSampleRecord compositeTimeEntry=null;
if (compositio... | Performs frame analysis and generates metadata for use in seeking. All the frames are analyzed and sorted together based on time and offset. |
public boolean isBlank(){
if (blank == null) {
blank=Boolean.valueOf(StringUtil.isBlank(nodeValue));
}
return blank.booleanValue();
}
| Returns <code>true</code> if text content is blank. |
public final void turnTo(double azimuth,double elevation){
if (!is3dMode) elevation=0.0d;
heading.azimuth=Geometric.clampAngleRadians(azimuth);
heading.elevation=Geometric.clampAngleRadians(elevation);
velocity.set(heading.toCartesian());
}
| Turn the agent to the given angle given in radians. |
public boolean containsNeuron(final Neuron n){
return neuronList.contains(n);
}
| True if the group contains the specified neuron. |
public static int EIO(){
return Errno.EIO.intValue();
}
| I/O error |
public static long addCap(long a,long b){
long res=a + b;
if (res < 0L) {
return Long.MAX_VALUE;
}
return res;
}
| Cap an addition to Long.MAX_VALUE |
public UnsyncBufferedOutputStream(OutputStream out){
buf=new byte[size];
this.out=out;
}
| Creates a buffered output stream without synchronization |
protected POInfo initPO(Properties ctx){
POInfo poi=POInfo.getPOInfo(ctx,Table_ID,get_TrxName());
return poi;
}
| Load Meta Data |
public static final byte composeDatagramMode(byte esmClass){
return composeMessagingMode(esmClass,SMPPConstant.ESMCLS_DATAGRAM_MODE);
}
| Messaging Mode. |
public void onPackageDisappeared(String packageName,int reason){
}
| Called when a package disappears for any reason. |
public boolean canBeShortAddress(int address){
return ((address >= 1) && (address <= 127));
}
| The short addresses 1-127 are available |
public Generator(Grammar grammar,Precedences precedences,Verbosity verbosity){
this.grammar=grammar;
this.precedences=precedences;
this.verbosity=verbosity;
this.debugOut=System.out;
}
| A generator needs a grammar and precedences (optional) to do its work. The given verbosity tells the generator how many debug messages are requested. |
public char next(char c) throws JSONException {
char n=this.next();
if (n != c) {
throw this.syntaxError("Expected '" + c + "' and instead saw '"+ n+ "'");
}
return n;
}
| Consume the next character, and check that it matches a specified character. |
public static boolean pointInPolygon(double[] x,double[] y,double lat,double lon){
assert x.length == y.length;
boolean inPoly=false;
for (int i=1; i < x.length; i++) {
if (x[i] < lon && x[i - 1] >= lon || x[i - 1] < lon && x[i] >= lon) {
if (y[i] + (lon - x[i]) / (x[i - 1] - x[i]) * (y[i - 1] - y[i]) <... | simple even-odd point in polygon computation 1. Determine if point is contained in the longitudinal range 2. Determine whether point crosses the edge by computing the latitudinal delta between the end-point of a parallel vector (originating at the point) and the y-component of the edge sink NOTE: Requires polygon poi... |
public void addFilter(NodeFilter f){
this.filters.add(f);
updateShownNodes();
if (this.refreshTimer == null) {
this.refreshTimer=new Timer(AUTO_REFRESH_DELAY,this);
this.refreshTimer.start();
}
}
| Adds a new node filter to the node chooser |
public PeriodType withMinutesRemoved(){
return withFieldRemoved(5,"NoMinutes");
}
| Returns a version of this PeriodType instance that does not support minutes. |
public boolean equals(Object other){
if (this == other) return true;
if (!(other instanceof CRLExtensions)) return false;
Collection<Extension> otherC=((CRLExtensions)other).getAllExtensions();
Object[] objs=otherC.toArray();
int len=objs.length;
if (len != map.size()) return false;
Extension otherE... | Compares this CRLExtensions for equality with the specified object. If the <code>other</code> object is an <code>instanceof</code> <code>CRLExtensions</code>, then all the entries are compared with the entries from this. |
private boolean saveBitmap(String fullPath,Bitmap bitmap){
if (fullPath == null || bitmap == null) return false;
boolean fileCreated=false;
boolean bitmapCompressed=false;
boolean streamClosed=false;
File imageFile=new File(fullPath);
if (imageFile.exists()) if (!imageFile.delete()) return false;
tr... | Saves the Bitmap as a PNG file at path 'fullPath' |
void updatePendingNodes(final int newLandmarkIndex,final Node toNode,final RouterPriorityQueue<Node> pendingNodes){
Iterator<Node> it=pendingNodes.iterator();
PreProcessLandmarks.LandmarksData toRole=getPreProcessData(toNode);
ArrayList<Double> newEstRemTravCosts=new ArrayList<Double>();
ArrayList<Node> nodesTo... | If a landmark has been added to the set of the active landmarks, this function re-evaluates the estimated remaining travel time based on the new set of active landmarks of the nodes contained in pendingNodes. If this estimation improved, the node's position in the pendingNodes queue is updated. |
@Override public void eUnset(int featureID){
switch (featureID) {
case GamlPackage.ACTION_ARGUMENTS__ARGS:
getArgs().clear();
return;
}
super.eUnset(featureID);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public String cancelReview(){
manageReviewModel.setServiceReview(null);
setForwardUrl(getRequest());
return OUTCOME_MARKETPLACE_REDIRECT;
}
| Sets the current service review to null to discard changes on the review. |
public CacheMetricsImpl(GridCacheContext<?,?> cctx){
assert cctx != null;
this.cctx=cctx;
if (cctx.isNear()) dhtCtx=cctx.near().dht().context();
if (cctx.store().store() instanceof GridCacheWriteBehindStore) store=(GridCacheWriteBehindStore)cctx.store().store();
delegate=null;
}
| Creates cache metrics; |
public boolean xPathExists(String xpathExpr){
try {
if (XPath.selectSingleNode(this.xmlDocument,xpathExpr) == null) return false;
return true;
}
catch ( Exception ex) {
return false;
}
}
| Does an xPath expression exist |
@RequestMapping(value={"/",""},method=RequestMethod.POST) @ResponseBody public RestWrapper update(@ModelAttribute("busdomain") @Valid BusDomain busDomain,BindingResult bindingResult,Principal principal){
RestWrapper restWrapper=null;
if (bindingResult.hasErrors()) {
BindingResultError bindingResultError=new Bin... | This method calls proc UpdateBusDomain and updates the record passed. It also validates the values passed. |
private int[] readTypeAnnotations(final MethodVisitor mv,final Context context,int u,boolean visible){
char[] c=context.buffer;
int[] offsets=new int[readUnsignedShort(u)];
u+=2;
for (int i=0; i < offsets.length; ++i) {
offsets[i]=u;
int target=readInt(u);
switch (target >>> 24) {
case 0x00:
case 0x01:
... | Parses a type annotation table to find the labels, and to visit the try catch block annotations. |
public double doOperation() throws OperatorFailedException {
if (DEBUG) {
c2cLikelihood.outputTreeToFile("beforeTSSA.nex",false);
}
BranchMapModel branchMap=c2cLikelihood.getBranchMap();
double logq=0;
NodeRef i;
ArrayList<NodeRef> eligibleNodes=getEligibleNodes(tree,branchMap);
i=eligibleNodes.get(Ma... | Do a probabilistic subtree slide move. |
public void removeConversation(String name){
conversations.remove(name.toLowerCase());
}
| Removes a conversation by name |
public Desert(){
super();
}
| Needed by CGLib |
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 synchronized void init(String recoverTest){
RecoverTester tester=RecoverTester.getInstance();
if (StringUtils.isNumber(recoverTest)) {
tester.setTestEvery(Integer.parseInt(recoverTest));
}
FilePathRec.setRecorder(tester);
}
| Initialize the recover test. |
private Validator createValidator(FaceletContext ctx){
String id=owner.getValidatorId(ctx);
if (id == null) {
throw new TagException(owner.getTag(),"A validator id was not specified. Typically the validator id is set in the constructor ValidateHandler(ValidatorConfig)");
}
return ctx.getFacesContext().getAp... | Template method for creating a Validator instance |
@Override protected void loadPlugins(){
this.pickingPlugin=new PickingGraphMousePlugin<V,E>();
this.animatedPickingPlugin=new AnimatedPickingGraphMousePlugin<V,E>();
this.translatingPlugin=new TranslatingGraphMousePlugin(InputEvent.BUTTON1_MASK);
this.scalingPlugin=new ScalingGraphMousePlugin(new CrossoverScali... | create the plugins, and load the plugins for TRANSFORMING mode |
public <T extends JCTree>void printExprs(List<T> trees,String sep) throws IOException {
if (trees.nonEmpty()) {
printExpr(trees.head);
for (List<T> l=trees.tail; l.nonEmpty(); l=l.tail) {
print(sep);
printExpr(l.head);
}
}
}
| Derived visitor method: print list of expression trees, separated by given string. |
public Tee(){
this(null);
}
| initializes the object, with a default printstream. |
public void omitField(final Class<?> definedIn,final String fieldName){
if (fieldAliasingMapper == null) {
throw new InitializationException("No " + FieldAliasingMapper.class.getName() + " available");
}
fieldAliasingMapper.omitField(definedIn,fieldName);
}
| Prevents a field from being serialized. To omit a field you must always provide the declaring type and not necessarily the type that is converted. |
public boolean isRunning(){
return running;
}
| Return <code>true</code> if the UDP relay server is running. |
@Override protected DocWriter createWriter(final MBasicTable table,final Document document,final OutputStream out){
final RtfWriter2 writer=RtfWriter2.getInstance(document,out);
final String title=buildTitle(table);
if (title != null) {
final HeaderFooter header=new RtfHeaderFooter(new Paragraph(title));
... | We create a writer that listens to the document and directs a RTF-stream to out |
public double manhattanDistance(final Int3D p){
final double dx=Math.abs((double)this.x - p.x);
final double dy=Math.abs((double)this.y - p.y);
final double dz=Math.abs((double)this.z - p.z);
return dx + dy + dz;
}
| Returns the manhtattan distance FROM this Double3D TO the specified point |
public MultipartBuilder attachment(InputStream is,String filename){
return bodyPart(new StreamDataBodyPart(ATTACHMENT_NAME,is,filename));
}
| Adds a named attachment. |
public static IMethodBinding findOverriddenMethod(IMethodBinding overriding,boolean testVisibility){
List<IMethodBinding> findOverriddenMethods=findOverriddenMethods(overriding,testVisibility,true);
if (findOverriddenMethods.isEmpty()) {
return null;
}
return findOverriddenMethods.get(0);
}
| Finds the method that is overridden by the given method. The search is bottom-up, so this returns the nearest defining/declaring method. |
public String globalInfo(){
return "Evaluate the performance of batch trained clusterers.";
}
| Global info for this bean |
public static RenameFileDialogFragment newInstance(OCFile file){
RenameFileDialogFragment frag=new RenameFileDialogFragment();
Bundle args=new Bundle();
args.putParcelable(ARG_TARGET_FILE,file);
frag.setArguments(args);
return frag;
}
| Public factory method to create new RenameFileDialogFragment instances. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.