code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public static double cs_house(double[] x,int x_offset,double[] beta,int n){
double s, sigma=0;
int i;
if (x == null || beta == null) return (-1);
for (i=1; i < n; i++) sigma+=x[x_offset + i] * x[x_offset + i];
if (sigma == 0) {
s=Math.abs(x[x_offset + 0]);
beta[0]=(x[x_offset + 0] <= 0) ? 2.0 : 0.... | Compute a Householder reflection, overwrite x with v, where (I-beta*v*v')*x = s*e1. See Algo 5.1.1, Golub & Van Loan, 3rd ed. |
protected Expression mod(int opPos) throws TransformerException {
return compileOperation(new Mod(),opPos);
}
| Compile a 'mod' operation. |
private void applyPageCounters(Transaction tx,Page page,RouteContextList ctx) throws Exception {
List<org.apache.activemq.artemis.core.server.Queue> durableQueues=ctx.getDurableQueues();
List<org.apache.activemq.artemis.core.server.Queue> nonDurableQueues=ctx.getNonDurableQueues();
for ( org.apache.activemq.arte... | This is done to prevent non tx to get out of sync in case of failures |
protected void merge(int size,double[] scratch,DBIDArrayIter ix,DBIDArrayIter iy,PointerHierarchyRepresentationBuilder builder,double mindist,int x,int y){
ix.seek(x);
iy.seek(y);
if (LOG.isDebuggingFine()) {
LOG.debugFine("Merging: " + DBIDUtil.toString(ix) + " -> "+ DBIDUtil.toString(iy)+ " "+ mindist);
}... | Execute the cluster merge. |
private boolean isTasksComplete(){
for ( Task<T> task : tasks.getTasks()) {
if (!task.isComplete()) {
return false;
}
}
return true;
}
| Whether all tasks are complete. |
@Override protected void initGUI(){
super.initGUI();
setLayout(new BorderLayout());
m_TabbedPane=new JTabbedPane();
add(m_TabbedPane,BorderLayout.CENTER);
m_PanelFile=new JPanel(new FlowLayout(FlowLayout.LEFT));
m_PanelFile.setBorder(BorderFactory.createEmptyBorder(5,0,5,0));
add(m_PanelFile,BorderLayout.... | Initializes the widgets. |
public void insert(String s){
char[] arr=s.toCharArray();
TrieNode node=root;
for (int i=0; i < arr.length; i++) {
char c=arr[i];
if (!node.children.containsKey(c)) {
node.children.put(c,new TrieNode());
}
node=node.children.get(c);
if (i == arr.length - 1) {
node.isEnd=true;
... | Trie section |
public boolean isUserSearchByDn(){
return m_userSearchByDn;
}
| DOCUMENT ME! |
public static boolean intersectRaySphere(Vector3 rayStart,Vector3 rayEnd,Vector3 sphereCenter,double sphereRadius,Vector3 hitPoint){
rayStart=new Vector3(rayStart);
rayEnd=new Vector3(rayEnd);
Vector3 dir=Vector3.subtractAndCreate(rayEnd,rayStart);
dir.normalize();
sphereCenter=new Vector3(sphereCenter);
do... | Intersects a ray defined by the start and end point and a sphere, returning the intersection point in intersection. |
void makeProof(NodeRepresentation nodeRep,boolean isAndProof,boolean sufficesOnly){
HashSet<String> aaTestSet=new HashSet<String>();
addDeclaredSymbols(aaTestSet,goalRep);
int proofIndent=PROOF_INDENT;
String proofIndentString=StringHelper.copyString(" ",proofIndent);
String[] assumptionsText=createdAssumptio... | Creates the proof, which is a Suffices Only proof if sufficesONly = true, and otherwise is an and-split proof if isAndProof is true, and a case-split proof otherwise. |
void recomputeValue(InsDelUpdateStatistics stat){
assert this.value != null : "value in recomputeValue is null ";
this.value.clear();
for ( BFINode<EL> currentNode : this.children) {
this.value.orBloomFilter(currentNode.value);
stat.nbBFAccessed++;
}
stat.nbBFAccessed++;
}
| Recompute the value of the BloomFilter to be the or of its children |
public boolean isWarnEnabled(){
return (getLogger().isLoggable(Level.WARNING));
}
| Is warn logging currently enabled? |
public RC564Engine(){
_noRounds=12;
_S=null;
}
| Create an instance of the RC5 encryption algorithm and set some defaults |
public void flush(){
if (lastCache == null) return;
Object o=lastCache.get();
if (o == null) return;
TileCacheRed tcr=(TileCacheRed)o;
tcr.flushCache(tcr.getBounds());
}
| Flush any cached image data. |
public void close(boolean finalCall){
if (!m_open) return;
log.fine("final=" + finalCall);
if (finalCall) {
DataStatusListener evl[]=(DataStatusListener[])listenerList.getListeners(DataStatusListener.class);
for (int i=0; i < evl.length; i++) listenerList.remove(DataStatusListener.class,evl[i]);
... | Close Resultset |
private void pushPacket(IOFSwitch sw,Match match,OFPacketIn pi,OFPort outport){
if (pi == null) {
return;
}
OFPort inPort=(pi.getVersion().compareTo(OFVersion.OF_12) < 0 ? pi.getInPort() : pi.getMatch().get(MatchField.IN_PORT));
if (inPort.equals(outport)) {
if (log.isDebugEnabled()) {
log.debug("... | Pushes a packet-out to a switch. The assumption here is that the packet-in was also generated from the same switch. Thus, if the input port of the packet-in and the outport are the same, the function will not push the packet-out. |
static MutableBigInteger fixup(MutableBigInteger c,MutableBigInteger p,int k){
MutableBigInteger temp=new MutableBigInteger();
int r=-inverseMod32(p.value[p.offset + p.intLen - 1]);
for (int i=0, numWords=k >> 5; i < numWords; i++) {
int v=r * c.value[c.offset + c.intLen - 1];
p.mul(v,temp);
c.add(tem... | The Fixup Algorithm Calculates X such that X = C * 2^(-k) (mod P) Assumes C<P and P is odd. |
public String encodeBody(){
return this.privacy;
}
| Encode into a canonical string. |
public static IGraph rewireGraphProbability(final IScope scope,final IGraph graph,final Double probability){
final IList edges=graph.getEdges();
for (int i=0; i < edges.size(); i++) {
final Object currentEdge=edges.get(i);
if (scope.getRandom().between(0,1.0) <= probability) {
final Object from=graph.... | TODO does not works now Rewires a graph (in the Watts-Strogatz meaning) |
public Builder enableUrlBarHiding(){
mIntent.putExtra(EXTRA_ENABLE_URLBAR_HIDING,true);
return this;
}
| Enables the url bar to hide as the user scrolls down on the page. |
public static void importParseRules(URL rulesResource,Plugin prover){
if (rulesResource == null) {
throw new NullPointerException("Parserules resource must not be null.");
}
else {
String operatorNamePrefix="";
if (prover != null) {
operatorNamePrefix=prover.getPrefix() + ":";
}
LogServic... | This method adds the parse rules from the given resource to the import rule set. The operator name prefix describes the operators coming from plugins. The core operators do not have any name prefix, while the plugin operators are registered using <plugin>:<operatorname> |
public ObjectCopier(){
this(20480);
}
| Creates an ObjectCopier with a default 20k buffer and two threads. |
@Override public synchronized void initialize(){
if (!mRootDirectory.exists()) {
if (!mRootDirectory.mkdirs()) {
VolleyLog.e("Unable to create cache dir %s",mRootDirectory.getAbsolutePath());
}
return;
}
File[] files=mRootDirectory.listFiles();
if (files == null) {
return;
}
for ( Fil... | Initializes the DiskBasedCache by scanning for all files currently in the specified root directory. Creates the root directory if necessary. |
@Override public String toString(){
final StringBuilder sb=new StringBuilder();
if (scheme_ != null) {
sb.append(scheme_);
sb.append(':');
}
if (location_ != null) {
sb.append("//");
sb.append(location_);
}
if (path_ != null) {
sb.append(path_);
}
if (parameters_ != null) {
sb.ap... | Returns a string representation of the <tt>Url</tt> object. |
protected void paintData(Graphics2D g2,Variate.D xData,Variate.D yData){
double x1, y1, x2, y2, x;
int n=xData.getCount();
g2.setStroke(lineStroke);
for (int i=0; i < n; i+=2) {
x1=xData.get(i);
x2=xData.get(i + 1);
x=x2 - x1;
if (barCount > 1) {
x1=x1 - ((double)(barCount - 1)) * x + 2.0 ... | Paint data series |
private static boolean isKDE(){
boolean kde=false;
String[] cmd=new String[2];
cmd[0]="echo";
cmd[1]="$KDE_FULL_SESSION";
kde=isExpectedCommandOutput(cmd,"true",true);
if (!kde) {
cmd[1]="$DESKTOP_SESSION";
kde=isExpectedCommandOutput(cmd,"kde",true);
}
return kde;
}
| detects KDE desktop |
public void writeInt(int v) throws IOException {
out.write((v >>> 24) & 0xFF);
out.write((v >>> 16) & 0xFF);
out.write((v >>> 8) & 0xFF);
out.write(v & 0xFF);
}
| Write an <code>int</code> value to the underlying stream in XDR format. |
public ArrayList<ChartSet> prepareUpdateAnimation(ChartView chartView,ArrayList<float[][]> start,ArrayList<float[][]> end){
mEasing.setState(BaseEasingMethod.UPDATE);
return prepareAnimation(chartView,start,end);
}
| Method that prepares the enter animation. Defines starting points, targets, distance, yadda, as well as the first set of points to be drawn. |
private DoFnAdapters(){
}
| Should not be instantiated. |
public void returnValue() throws IOException {
writeCode(RETURN);
}
| SWFActions interface |
public CTabbedPane(){
super();
init();
}
| Creates an empty <code>TabbedPane</code> with a default tab placement of <code>JTabbedPane.TOP</code> and default tab layout policy of <code>JTabbedPane.WRAP_TAB_LAYOUT</code>. |
public static void assertJPut(String request,String content,double delta,String... tests) throws Exception {
int queryStartPos=request.indexOf('?');
String query;
String path;
if (-1 == queryStartPos) {
query="";
path=request;
}
else {
query=request.substring(queryStartPos + 1);
path=request.... | Validates the response from a PUT request matches some JSON test expressions and closes the query. The text expression is of the form path==JSON. To facilitate easy embedding in Java strings, the JSON can have double quotes replaced with single quotes. <p> Please use this with care: this makes it easy to match complete... |
public static Border createOutsetBorder(int thickness,int color){
return createCSSBorder(TYPE_OUTSET,thickness,color);
}
| Creates an outset border with the specified thickness and color |
private void gcmStatusUpdate(){
Log.d(LOG_TAG,"## gcmStatusUpdate");
if (mIsForeground) {
Log.d(LOG_TAG,"## gcmStatusUpdate : gcm status succeeds so stopForeground");
if (FOREGROUND_LISTENING_FOR_EVENTS == mForegroundServiceIdentifier) {
stopForeground(true);
mForegroundServiceIdentifier=-1;
... | The GCM status has been updated (i.e disabled or enabled). |
public void tearDown(){
super.tearDown();
}
| Tear down instance variables required by this test case. |
public CurlInterceptor(Loggable logger){
this(logger,DEFAULT_LIMIT);
}
| Interceptor responsible for printing curl logs Logs are pushed to stdout with 1MB limit |
public TransactionFeeCalculatorBeforeFork(){
this(null);
}
| Creates a default transaction fee calculator. |
public NotificationChain basicSetReaction(TransitionReaction newReaction,NotificationChain msgs){
TransitionReaction oldReaction=reaction;
reaction=newReaction;
if (eNotificationRequired()) {
ENotificationImpl notification=new ENotificationImpl(this,Notification.SET,StextPackage.TRANSITION_SPECIFICATION__REAC... | <!-- begin-user-doc --> <!-- end-user-doc --> |
@Override public void eSet(int featureID,Object newValue){
switch (featureID) {
case GamlPackage.SDISPLAY__NAME:
setName((String)newValue);
return;
}
super.eSet(featureID,newValue);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public void testPropagationDualAsync() throws Exception {
mode=DUAL_ASYNC;
checkPropagation();
}
| Ensure that data is propagated to the secondary IGFS in DUAL_SYNC mode. |
protected void postReleaseLock(RemoteThread rThread,Object lock){
Assert.assertTrue(rThread != null);
synchronized (suspendLock) {
checkDestroyed();
if (logger.isTraceEnabled(LogMarker.DLS)) {
logger.trace(LogMarker.DLS,"[postReleaseLock] rThread={} lock={} permittedRequests={} suspendQueue={}",rThread,... | Handles post release lock tasks including tracking the current suspend locking states. <p> Synchronizes on suspendLock. |
protected StringBuffer createQueryString(final String... attrNames){
StringBuffer queryString=new StringBuffer(this.queryString);
queryString.append("(");
queryString.append("[").append(attrNames[0]).append(TEXT_TYPE).append("]");
for (int i=1; i < attrNames.length; i++) {
String attrName=attrNames[i];
... | Returns the query string extended so that it filters out the items that do not have at least one of the specified attributes of type TEXT. |
@VisibleForTesting protected State buildPatch(com.vmware.xenon.common.TaskState.TaskStage stage,@Nullable Throwable e){
State state=new State();
state.taskState=new com.vmware.xenon.common.TaskState();
state.taskState.stage=stage;
if (null != e) {
state.taskState.failure=Utils.toServiceErrorResponse(e);
}... | This method builds a state object which can be used to submit a stage progress self-patch. |
public RAckHeader createRAckHeader(long rSeqNumber,long cSeqNumber,String method) throws InvalidArgumentException, ParseException {
if (method == null) throw new NullPointerException("Bad method");
if (cSeqNumber < 0 || rSeqNumber < 0) throw new InvalidArgumentException("bad cseq/rseq arg");
RAck rack=new RAc... | Creates a new RAckHeader based on the newly supplied rSeqNumber, cSeqNumber and method values. |
@Override public int eDerivedOperationID(int baseOperationID,Class<?> baseClass){
if (baseClass == VariableEnvironmentElement.class) {
switch (baseOperationID) {
case N4JSPackage.VARIABLE_ENVIRONMENT_ELEMENT___APPLIES_ONLY_TO_BLOCK_SCOPED_ELEMENTS:
return N4JSPackage.WITH_STATEMENT___APPLIES_ONLY_TO_BLOCK_SCOPE... | <!-- begin-user-doc --> <!-- end-user-doc --> |
public void testLocalsAverageCorrectly() throws Exception {
TransferEntropyCalculatorMultiVariateKernel teCalc=new TransferEntropyCalculatorMultiVariateKernel();
String kernelWidth="1";
teCalc.setProperty(TransferEntropyCalculatorMultiVariateKernel.NORMALISE_PROP_NAME,"true");
teCalc.setProperty(TransferEntropy... | Confirm that the local values average correctly back to the average value |
public Tag insertTag(final Tag parent,final String name) throws CouldntSaveDataException {
try {
if (parent == null) {
return ObjectFinders.getObject(m_manager.insertTag(m_root.getNative(),name),m_allTags.values());
}
else {
return ObjectFinders.getObject(m_manager.insertTag(parent.getNative(),na... | Inserts a new tag between a given parent tag and the children of that parent tag. |
public boolean isDistinct(){
return distinct;
}
| This method was generated by MyBatis Generator. This method corresponds to the database table iteration |
public void closeDrawer(){
if (drawerLayout != null) {
if (drawerGravity != 0) {
drawerLayout.closeDrawer(drawerGravity);
}
else {
drawerLayout.closeDrawer(sliderLayout);
}
}
}
| close the drawer |
public static Map parseNameValuePairList(String s,String defaultValue) throws java.text.ParseException {
Map map=new HashMap();
char c=' ';
int ln=s.length();
int p=0;
int keyStart;
int valueStart;
String key;
String value;
fetchLoop: while (true) {
while (p < ln) {
c=s.charAt(p);
if... | Parses a name-value pair list, where the pairs are separated with comma, and the name and value is separated with colon. The keys and values can contain only letters, digits and <tt>_</tt>. They can't be quoted. White-space around the keys and values are ignored. The value can be omitted if <code>defaultValue</code> is... |
private void rollCandle(RegularTimePeriod period,int rollupInterval,double open,double high,double low,double close,long volume,int tradeCount,double vwap,ZonedDateTime lastUpdateDate){
if (rollupInterval != this.rollingCandle.rollupInterval || this.isEmpty()) {
if (!this.isEmpty()) {
CandleItem candleItem=... | Method rollCandle. Creates a rolling candle that is the sum of the under lying candle. So 5 sec bars rolled up to 5min bars will rollup interval of 5min/5sec = 60. |
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 static void closeInputStream(InputStream stream,String tag){
if (stream != null) {
try {
stream.close();
}
catch ( IOException e) {
Log.e(tag,"Exception occured when closing InputStream." + e);
}
}
}
| Close a InputStream passed in. |
public static Properties splitPropertiesOnDelimiter(String toSplit,char delimiter){
Properties properties=new Properties();
String toSplitHalfEscaped=toSplit.replace("\\\\" + delimiter,"\\" + delimiter);
String newLineSeparated=toSplitHalfEscaped.replaceAll("([^\\\\])" + Pattern.quote(String.valueOf(delimiter)),"... | Construct a Properties object from a single string, by splitting it on a specified delimiter. <p> Example: "abc=def;car=bmw" gets converted to "abc" -> "def", and "car" -> "bmw" where: delimiter = ; </p> |
public HMMChineseTokenizer(){
this(DEFAULT_TOKEN_ATTRIBUTE_FACTORY);
}
| Creates a new HMMChineseTokenizer |
public static void main(String[] args){
if (args.length != 1) {
System.err.println("usage: java edu.illinois.cs.cogcomp.lbj.pos.POSTagTokenized <text file>");
System.exit(1);
}
String testingFile=args[0];
POSTagger tagger=new POSTagger();
Parser parser=new ColumnFormat(testingFile);
String sentence=... | Implements the program described above. |
@Override public void shutdown(){
executor.shutdown();
}
| Everything else just delegates to original executor. |
@Override public Object eGet(int featureID,boolean resolve,boolean coreType){
switch (featureID) {
case UmplePackage.ASSOCIATION_POSITION___NAME_1:
return getName_1();
case UmplePackage.ASSOCIATION_POSITION___COORDINATE_1:
return getCoordinate_1();
case UmplePackage.ASSOCIATION_POSITION___COORDINATE_2:
return get... | <!-- begin-user-doc --> <!-- end-user-doc --> |
protected boolean writeStdCompare(int type,boolean simulate){
type=type - COMPARE_NOT_EQUAL;
if (type < 0 || type > 7) return false;
if (!simulate) {
MethodVisitor mv=getController().getMethodVisitor();
OperandStack operandStack=getController().getOperandStack();
int bytecode=stdCompareCodes[type];
... | writes a std compare. This involves the tokens IF_ICMPEQ, IF_ICMPNE, IF_ICMPEQ, IF_ICMPNE, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE and IF_ICMPLT |
public void addCommand(IUndoableCommand command){
undoStack.push(command);
redoStack.clear();
fireOperationsHistoryChanged();
}
| Execute a command and push it to undo stack. |
public void mouseClicked(int p_146192_1_,int p_146192_2_,int p_146192_3_){
boolean var4=p_146192_1_ >= field_146209_f && p_146192_1_ < field_146209_f + field_146218_h && p_146192_2_ >= field_146210_g && p_146192_2_ < field_146210_g + field_146219_i;
if (field_146212_n) setFocused(var4);
if (field_146213_o && p_... | Args: x, y, buttonClicked |
public static final boolean odd(short x){
return !even(x);
}
| Check if number is odd. |
public JsonUnflattener(String json){
root=Json.parse(json);
}
| Creates a JSON unflattener. |
@Override protected EClass eStaticClass(){
return ExpressionsPackage.Literals.PARENTHESIZED_EXPRESSION;
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public static boolean endsWithIgnoreCase(String str,String suffix){
if (str == null || suffix == null) {
return false;
}
if (str.endsWith(suffix)) {
return true;
}
if (str.length() < suffix.length()) {
return false;
}
String lcStr=str.substring(str.length() - suffix.length()).toLowerCase();
... | Test if the given String ends with the specified suffix, ignoring upper/lower case. |
public void doDestroyProcess(){
synchronized (myLock) {
if (!myIsDestroyed) {
LOG.info("Destroying process by command: " + getCommandText());
myIsDestroyed=true;
myHandler.destroyProcess();
}
}
}
| ProcessHandler.destroyProcess() implementations could acquire read lock in its implementation - like OSProcessManager.getInstance(). Some commands are called under write lock - which is generally bad idea, but such logic is not refactored yet. To prevent deadlocks this method should only be called from thread that star... |
public EliasFanoLongBigList(final IntIterator iterator){
this(LongIterators.wrap(iterator));
}
| Creates a new Elias–Fano long big list. |
private void sprint(String s){
if (s == null) {
stringRep+=getIndentation();
stringRep+="<null>\n";
return;
}
if (s.compareTo("}") == 0 || s.compareTo("]") == 0) {
indentation--;
}
stringRep+=getIndentation();
stringRep+=s;
stringRep+="\n";
if (s.compareTo("{") == 0 || s.compareTo("[") =... | string formatting function. |
public MandatoryUdaMissingException(String message){
super(message);
}
| Constructs a new exception with the specified detail message. The cause is not initialized. |
protected boolean isFullDetail(Boolean fullDetailRequest){
if (fullDetailRequest == null) {
return defaultFullDetail;
}
return fullDetailRequest.booleanValue();
}
| <p>Is this field to be output in full detail.</p> <p>This method converts a detail request into a detail level. The calling code may request full detail (<code>true</code>), but a subclass might ignore that and always return <code>false</code>. The calling code may pass in <code>null</code> indicating that it doesn't c... |
public static Block fromJsonObject(final NemesisBlockInfo nemesisBlockInfo,final JSONObject jsonObject,final DeserializationContext context){
final Deserializer deserializer=new JsonDeserializer(jsonObject,context);
return deserialize(nemesisBlockInfo,deserializer);
}
| Loads the nemesis block from a json object. |
public static void configureJob(Job job,Class<?> jarByClass,Class<? extends Mapper> mapperClass,Class<? extends Reducer> reducerClass,String commaSeparatedInputFiles,String outputPath) throws IOException {
job.setJarByClass(jarByClass);
job.setJobName(jarByClass.getName());
job.setMapperClass(mapperClass);
job.... | Job configurator |
public static CCAnimation animation(String name,ArrayList<CCSpriteFrame> frames){
return new CCAnimation(name,frames);
}
| Creates a CCAnimation with a name and frames |
public static void register(Map tagletMap){
UmplesourceTaglet tag=new UmplesourceTaglet();
Taglet t=(Taglet)tagletMap.get(tag.getName());
if (t != null) {
tagletMap.remove(tag.getName());
}
tagletMap.put(tag.getName(),tag);
}
| Register this Taglet. |
public boolean consumed(){
return left == 0;
}
| Checks whether this item has already been fully consumed. |
public void reset(){
m_cachedValuesSemaphore.acquireUninterruptibly();
m_modules.clear();
m_cachedValues=null;
m_cachedValuesSemaphore.release();
fireTableDataChanged();
}
| Resets the table model. |
public boolean isPYDML(){
return scriptType.isPYDML();
}
| Is the script type PYDML? |
public static double[][] random(int m,int n,double min,double max){
double[][] array=new double[m][n];
for (int i=0; i < m; i++) {
for (int j=0; j < n; j++) {
array[i][j]=min + Random.raw() * (max - min);
}
}
return array;
}
| Generates an mxn matrix of random numbers uniformly distributed between min and max. |
public String toMultiLineString(){
return LineUtil.toMultiLineString(buffer);
}
| Returns a multi-line representation of the lines in this buffer. The last line is never terminated, all other lines are terminated with guarantee even if the line itself has an empty line ending string. |
public static void main(final String[] args) throws Exception {
int i=0;
int flags=ClassReader.SKIP_DEBUG;
boolean ok=true;
if (args.length < 1 || args.length > 2) {
ok=false;
}
if (ok && "-debug".equals(args[0])) {
i=1;
flags=0;
if (args.length != 2) {
ok=false;
}
}
if (!ok) {... | Prints the ASM source code to generate the given class to the standard output. <p> Usage: ASMifier [-debug] <binary class name or class file name> |
static void closeOnEscape(final JFrame frame){
closeOnEscape(frame,frame.getRootPane());
}
| Make the window close when the used presses escape. The event will be the same as when the user closes the window using the window manager. |
@Override public boolean canUndo(){
return ((DataSortedTableModel)m_TableData.getModel()).canUndo();
}
| returns whether an undo is possible |
protected boolean addService(Class<?> serviceClass,BeanContextServiceProvider provider,boolean fireEvent){
if (serviceClass == null || provider == null) {
throw new NullPointerException();
}
synchronized (globalHierarchyLock) {
synchronized (services) {
if (services.containsKey(serviceClass)) {
re... | Add a service to this context. <p> If the service already exists in the context, simply return false. Otherwise, the service is added and event is fired if required. </p> |
protected boolean[] runBasicTest(boolean nominalPredictor,boolean numericPredictor,boolean stringPredictor,boolean datePredictor,boolean relationalPredictor,boolean multiInstance,int classType,int classIndex,int missingLevel,boolean predictorMissing,boolean classMissing,int numTrain,int numClasses,ArrayList<String> acc... | Runs a text on the datasets with the given characteristics. |
public boolean isFinal(){
return false;
}
| Always returns 'false' since this state machine can never become final. |
public void testNonExistingIndexingFilter() throws IndexingException {
Configuration conf=NutchConfiguration.create();
String class1="NonExistingFilter";
String class2="org.apache.nutch.indexer.basic.BasicIndexingFilter";
conf.set(IndexingFilters.INDEXINGFILTER_ORDER,class1 + " " + class2);
IndexingFilters fi... | Test behaviour when defined filter does not exist. |
public q addElement(String hashcode,Element element){
addElementToRegistry(hashcode,element);
return (this);
}
| Adds an Element to the element. |
private void processRunStartedTag(String identifier){
Pattern numTestsPattern=Pattern.compile("Running (\\d+) test[s]? from .*");
Matcher numTests=numTestsPattern.matcher(identifier);
if (numTests.find()) {
try {
mNumTestsExpected=Integer.parseInt(numTests.group(1));
}
catch ( NumberFormatExcept... | Parses and stores the test identifier (class and test name). |
public static void liftingFromBottom(View view,float baseRotation,float fromY,int duration,int startDelay){
ViewHelper.setRotationX(view,baseRotation);
ViewHelper.setTranslationY(view,fromY);
ViewPropertyAnimator.animate(view).setInterpolator(new AccelerateDecelerateInterpolator()).setDuration(duration).setStartD... | Lifting view |
protected boolean includeAuthorityInRequestLine(){
return connection == null ? policy.usingProxy() : connection.getRoute().getProxy().type() == Proxy.Type.HTTP;
}
| Returns true if the request line should contain the full URL with host and port (like "GET http://android.com/foo HTTP/1.1") or only the path (like "GET /foo HTTP/1.1"). <p/> <p>This is non-final because for HTTPS it's never necessary to supply the full URL, even if a proxy is in use. |
public void testErf(){
double[] octaveResults={0.000000,0.112463,0.222703,0.328627,0.428392,0.520500,0.603856,0.677801,0.742101,0.796908,0.842701,0.880205,0.910314,0.934008,0.952285,0.966105,0.976348,0.983790,0.989091,0.992790,0.995322,0.997021,0.998137,0.998857,0.999311,0.999593,0.999764,0.999866,0.999925,0.999959,0... | Confirm that our erf() function is correct to 6 dp |
private Map<String,List<SolrDocument>> collectDocuments(String query,SolrQueryRequest req,JoinFunction collectionKey) throws IOException {
Set<String> fields=getFields(req.getParams().get(CommonParams.FL),req.getSchema().getFields());
fields.add(Schema.DATA);
if (!isEmptyArray(collectionKey.involvedFields())) {
... | Collects the document matching the given solr query request by using the given collection key function. |
public static _Fields findByThriftIdOrThrow(int fieldId){
_Fields fields=findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
| Find the _Fields constant that matches fieldId, throwing an exception if it is not found. |
public CloneableIterator<byte[]> keys(final boolean up,final byte[] firstKey) throws IOException {
assert (this.index != null) : "index == null; closeDate=" + this.closeDate + ", now="+ new Date();
if (this.index == null) {
log.severe("this.index == null in keys(); closeDate=" + this.closeDate + ", now="+ new D... | iterate over all keys |
public GitConflictException(String message,List<String> conflictingPaths){
super(message);
this.conflictingPaths=conflictingPaths;
}
| Constrcut a new GitConflictException based on message and conflict paths |
public void viewBox(float x,float y,float width,float height) throws ParseException {
hasViewBox=true;
viewBox=new float[4];
viewBox[0]=x;
viewBox[1]=y;
viewBox[2]=width;
viewBox[3]=height;
}
| Invoked when 'viewBox(x,y,width,height)' has been parsed. |
public Object runSafely(Catbert.FastStack stack) throws Exception {
PseudoMenu pm=(stack.getUIMgr() == null) ? null : stack.getUIMgr().getCurrUI();
return (pm == null) ? null : pm.getBlueprint();
}
| Gets the Widget the defines the menu that is currently loaded by the system |
@Override public Set<Statement> gather(final IGASState<Set<Statement>,Set<Statement>,Set<Statement>> state,final Value u,final Statement e){
return Collections.singleton(e);
}
| Return the edge as a singleton set. |
public void configure(ISourceViewer sourceViewer,SourceViewerConfiguration configuration){
fPrefixesMap=null;
String[] types=configuration.getConfiguredContentTypes(sourceViewer);
Map prefixesMap=new HashMap(types.length);
for (int i=0; i < types.length; i++) {
String type=types[i];
String[] prefixes=co... | Configures the action |
protected void mutation(){
}
| Invoked automatically any time a mutation operation occurs. The default implementation is a NOP. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.