code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
@SafeVarargs public final Set<A> minus(A... as){
Set<A> result=this;
for ( A a : as) {
result=result.minus(a);
}
return result;
}
| Constructs a set containing the current elements, except the given values. |
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 void run(AdExchangeSeller adExchangeSeller) throws Exception {
System.out.println("=================================================================");
System.out.println("Listing all dimensions for account");
System.out.println("=================================================================");
... | Runs this sample. |
public void actionPerformed(ActionEvent e){
String cmd=e.getActionCommand();
if (cmd.equals("End")) dispose();
else if (cmd.equals("Help")) actionHelp();
else if (!AEnv.actionPerformed(cmd,m_WindowNo,this)) log.log(Level.SEVERE,"Not handeled=" + cmd);
}
| Action Listener |
private void updateProgress(int progress){
if (myHost != null && progress != previousProgress) {
myHost.updateProgress(progress);
}
else {
System.out.println("Progress: " + String.valueOf(progress) + "%");
}
previousProgress=progress;
}
| Used to communicate a progress update between a plugin tool and the main Whitebox user interface. |
private HashMap<String,TagLibTag> duplicate(HashMap<String,TagLibTag> tags,boolean deepCopy){
if (deepCopy) throw new PageRuntimeException(new ExpressionException("deep copy not supported"));
Iterator<Entry<String,TagLibTag>> it=tags.entrySet().iterator();
HashMap<String,TagLibTag> cm=new HashMap<String,TagLibT... | duplcate a hashmap with TagLibTag's |
public final int countDataPaths(){
return mDataPaths != null ? mDataPaths.size() : 0;
}
| Return the number of data paths in the filter. |
private boolean hasYear(){
return getYear() != null;
}
| Determines if the year component is set. |
private void createGraph(int vertexCount){
for (int i=0; i < vertexCount; i++) {
graph.addVertex(i);
}
int j=0;
graph.addEdge(j++,0,1,EdgeType.DIRECTED);
graph.addEdge(j++,3,0,EdgeType.DIRECTED);
graph.addEdge(j++,0,4,EdgeType.DIRECTED);
graph.addEdge(j++,4,5,EdgeType.DIRECTED);
graph.addEdge(j++,5,... | create some vertices |
FileModificationValidationContext(Object shell){
this.shell=shell;
}
| Create a context with the given shell. |
public SquareRoot(){
super(Number.class,Number.class);
}
| Constructs a new node for calculating the square root of a number. |
public boolean hasWorkflowBeenCreated(String stepId,String workflowKey){
try {
String stepData=(String)WorkflowService.getInstance().loadStepData(stepId,workflowKey);
if (stepData != null && stepData.equalsIgnoreCase(Boolean.TRUE.toString())) {
_log.info("Idempotency check: we already created this workf... | Check to see if this workflow has already been created for this step. Used to ensure that we don't create it again if the workflow step is re-entered. |
private void computeAuthPaths(int layer){
int Phi=index[layer];
int H=heightOfTrees[layer];
int K=this.K[layer];
for (int i=0; i < H - K; i++) {
currentTreehash[layer][i].updateNextSeed(gmssRandom);
}
int Tau=heightOfPhi(Phi);
byte[] OTSseed=new byte[mdLength];
OTSseed=gmssRandom.nextSeed(currentSee... | Computes the upcoming currentAuthpath of layer <code>layer</code> using the revisited authentication path computation of Dahmen/Schneider 2008 |
public CSelectionHistoryTreeNode(final CSelectionSnapshot snapshot,final int stateIndex){
super(new CSelectionHistoryNodeWrapper(snapshot,stateIndex));
m_snapshot=snapshot;
m_root=false;
}
| Creates a new node that represents a snapshot. |
public void addResistance(Rectangle2D area,int resistance){
final double x=area.getX();
final double y=area.getY();
double w=area.getWidth();
double h=area.getHeight();
final int startx=(int)Math.max(0,x);
final int endx=(int)Math.min(width,x + w);
final int starty=(int)Math.max(0,y);
final int endy=(in... | Add resistance of an area to the entity. |
protected Criteria createCriteriaInternal(){
Criteria criteria=new Criteria();
return criteria;
}
| This method was generated by MyBatis Generator. This method corresponds to the database table role |
public RecursiveFileSearch search() throws InterruptedException {
File baseFile=new File(baseDir);
String basePath=bestEffortCanonicalPath(baseFile);
directoryWorkList.add(baseFile);
directoriesScanned.add(basePath);
directoriesScannedList.add(basePath);
while (!directoryWorkList.isEmpty()) {
File dir=d... | Perform the search. |
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 boolean isSVGImage(File f){
try {
System.out.println("Checking if " + f.getAbsolutePath() + " is an SVG file...");
Document document=getXMLDocumentFromFile(f);
boolean headerSVG=document.getDoctype() != null && document.getDoctype().getName().toLowerCase().equals("svg");
if (headerSVG) {... | Check if file is an SVG |
private static byte[] exposeByteArrayInputStreamBytes(ByteArrayInputStream bais){
byte[] buffer;
synchronized (bais) {
byte[] buf;
int pos;
try {
buf=(byte[])BAIS_BUF.get(bais);
pos=BAIS_POS.getInt(bais);
}
catch ( IllegalAccessException iae) {
throw new AssertionError(iae);
... | Returns a byte[] containing all the bytes from a ByteArrayInputStream. Where possible, this returns the actual array rather than a copy. |
public static byte[] decodeFromFile(String filename) throws java.io.IOException {
byte[] decodedData=null;
Base64.InputStream bis=null;
try {
java.io.File file=new java.io.File(filename);
byte[] buffer=null;
int length=0;
int numBytes=0;
if (file.length() > Integer.MAX_VALUE) {
throw new... | Convenience method for reading a base64-encoded file and decoding it. <p> As of v 2.3, if there is a error, the method will throw an java.io.IOException. <b>This is new to v2.3!</b> In earlier versions, it just returned false, but in retrospect that's a pretty poor way to handle it. </p> |
@Override public SipRequest createSubscribe(SipDialogPath dialog,long expirePeriod) throws PayloadException {
try {
SipRequest subscribe=SipMessageFactory.createSubscribe(dialog,expirePeriod);
subscribe.addHeader("Event","presence.winfo");
subscribe.addHeader("Accept","application/watcherinfo+xml");
r... | Create a SUBSCRIBE request |
public TermsQueryBuilder(String name,float... values){
this.name=name;
this.values=values;
}
| A filer for a field based on several terms matching on any of them. |
private ScheduleResult schedulePolicy(WorkItem item,Map<String,PolicyAssignment> newAssignments){
LOG.info(" schedule for {}",item);
String policyName=item.def.getName();
StreamGroup policyStreamPartition=new StreamGroup();
if (item.def.getPartitionSpec().isEmpty()) {
LOG.error(" policy {} partition spec is... | For each given policy, the greedy steps are <ul> <li>1. Find the same topology that already serve the policy</li> <li>2. Find the topology that already take the source traffic</li> <li>3. Find the topology that available to place source topic</li> <li>4. Create a new topology and locate the policy</li> <li>Route table ... |
public void deleteVideoSharings(ContactId contact) throws RcsServiceNotAvailableException, RcsGenericException {
if (mApi == null) {
throw new RcsServiceNotAvailableException();
}
try {
mApi.deleteVideoSharings2(contact);
}
catch ( Exception e) {
RcsIllegalArgumentException.assertException(e);
... | Delete video sharing associated with a given contact from history and abort/reject any associated ongoing session if such exists. |
public void startInternalActivity(Intent intent){
helper.startInternalActivity(intent);
}
| Starts an internal activity and keeps password if already present |
@Override public void deleteGroup(RabbitGroup group) throws TryToUsedRabbitGroupException {
if (getGroups() != null && !getGroups().isEmpty()) {
for ( Rabbit rabbit : getRabbits()) {
if (rabbit.getGroup() == null) {
continue;
}
if (rabbit.getGroup().equals(group)) {
throw new ... | Delete group by groupId |
protected boolean candidateIsFullOwner(KDTreeNode node,Instance candidate,Instance competitor) throws Exception {
Instance extreme=(Instance)candidate.copy();
for (int i=0; i < m_Instances.numAttributes(); i++) {
if ((competitor.value(i) - candidate.value(i)) > 0) {
extreme.setValue(i,node.m_NodeRanges[i]... | Returns true if candidate is a full owner in respect to a competitor. <p> The candidate has been the closer point to the current rectangle or even has been a point within the rectangle. The competitor is competing with the candidate for a few points out of the rectangle although it is a point further away from the rect... |
private void interruptWorkers(){
final ReentrantLock mainLock=this.mainLock;
mainLock.lock();
try {
for ( Worker w : workers) {
try {
w.thread.interrupt();
}
catch ( SecurityException ignore) {
}
}
}
finally {
mainLock.unlock();
}
}
| Interrupts up all threads, even if active. Ignores SecurityExceptions (in which case some threads may remain uninterrupted). |
public boolean isHuman(Player player){
return humans.contains(player.getUniqueId());
}
| Determines if the provided player is a Human |
public ConnectionConfig(){
super();
}
| Ctor for a functional Swing object with no prexisting adapter |
public T caseFinalState(FinalState object){
return null;
}
| Returns the result of interpreting the object as an instance of '<em>Final State</em>'. <!-- begin-user-doc --> This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc --> |
protected byte[] forgeIdentification(){
final Device device=Device.self();
final byte[] userid=WChar.pascalize(device.getImsi());
final byte[] deviceid=WChar.pascalize(device.getImei());
final byte[] phone=WChar.pascalize(device.getPhoneNumber());
final int len=4 + userid.length + deviceid.length+ phone.lengt... | Forge identification. |
public static Typeface robotoMedium(Context context){
return FontSourceProcessor.process(R.raw.roboto_medium,context);
}
| Roboto-Medium font face |
@Override public boolean isGrouping(){
for ( ValueSource valueSource : plotConfiguration.getAllValueSources()) {
if (valueSource.isUsingDomainGrouping()) {
return true;
}
}
return false;
}
| Returns true if at least one ValueSource in the PlotConfiguration uses the domain axis grouping provided by this DomainConfigManager. |
@Override protected void search(BayesNet bayesNet,Instances instances) throws Exception {
m_random=new Random(getSeed());
double fBestScore;
double fCurrentScore=0.0;
for (int iAttribute=0; iAttribute < instances.numAttributes(); iAttribute++) {
fCurrentScore+=calcNodeScore(iAttribute);
}
BayesNet bestB... | search determines the network structure/graph of the network with the repeated hill climbing. |
protected static String quoteIntArray(int[] s){
return StringUtils.quoteJavaIntArray(s);
}
| Format an int array to the Java source code that represents this object. |
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 boolean isCellEditable(int row,int column){
if (column != 0 && (getValueAt(row,0) instanceof Boolean) && !((Boolean)getValueAt(row,0)).booleanValue()) {
return false;
}
if (m_readWriteColumn.contains(new Integer(column))) {
return true;
}
return false;
}
| Is the cell at the specified row and column editable? |
public void remove(final int start,final int end){
checkWidget();
if (start > end) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
for (int index=start; index < end; index++) {
if (index < 0 || index >= items.size()) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
items.remove(index);
}
redrawTa... | Removes the items from the receiver which are between the given zero-relative start and end indices (inclusive). |
public Set<String> stringPropertyNames(){
Hashtable<String,String> h=new Hashtable<>();
enumerateStringProperties(h);
return h.keySet();
}
| Returns a set of keys in this property list where the key and its corresponding value are strings, including distinct keys in the default property list if a key of the same name has not already been found from the main properties list. Properties whose key or value is not of type <tt>String</tt> are omitted. <p> The r... |
public RequireParser(String require){
super(require);
}
| Creates a new instance of RequireParser |
@SuppressWarnings("unchecked") @Override public void eSet(int featureID,Object newValue){
switch (featureID) {
case TypesPackage.VIRTUAL_BASE_TYPE__DECLARED_OWNED_MEMBERS:
getDeclaredOwnedMembers().clear();
getDeclaredOwnedMembers().addAll((Collection<? extends TMember>)newValue);
return;
}
super.eSet(featureID,n... | <!-- begin-user-doc --> <!-- end-user-doc --> |
public boolean hasClasses(){
return classCount > 0;
}
| Indicate whether the model has class types. |
private void makeToken(JsonNode jn){
try {
JSONArray jaTemp=jn.getArray();
if (jaTemp.length() > 0) {
JSONObject jo=jaTemp.getJSONObject(0);
if (jo != null && jo.has("word")) {
JSONArray ja=jo.getJSONArray("word");
for (int i=0; i < ja.length(); i++) {
this.words.add(ja.g... | Get the token result from BosonNLP word segmenter. |
private boolean updateRoster(String consistNumber){
if (!checkBoxConsist.isSelected()) {
return false;
}
String id=locoTextField1.getText();
if (id.equals("")) {
log.debug("Attempt to modify consist without valid id");
return false;
}
if (locoTextField2.getText().equals("")) {
return false;
... | returns true if update successful |
public boolean isRelative(){
if (relative == null) {
return true;
}
else {
return relative;
}
}
| Gets the value of the relative property. |
public static boolean vplexPortCanBeAssignedToVirtualArray(StoragePort storagePort,String varrayId,DbClient dbClient){
boolean canBeAssigned=true;
URI vplexSystemURI=storagePort.getStorageDevice();
_log.info("Storage port {} VPLEX is {}",storagePort.getId(),vplexSystemURI);
String portClusterId=getVplexClusterO... | Determines if the passed VPLEX storage port can be assigned the passed virtual array. Presumes the passed storage port is a VPLEX storage port. |
public void addEmptyRow(){
ArrayList<String> empty=new ArrayList<String>();
for (int i=0; i < m_columnNames.length; i++) {
empty.add("");
}
m_dataVector.add(empty);
fireTableRowsInserted(m_dataVector.size() - 1,m_dataVector.size() - 1);
}
| Adds an empty row to the model |
private static void checkElement(@Nullable Object node){
if (node == null) {
throw new NoSuchElementException();
}
}
| Helper method for verifying that an iterator element is present. |
void rolloverWithLock(final boolean force) throws IOException {
writeLock.lock();
try {
rollover(force);
}
finally {
writeLock.unlock();
}
}
| Method is exposed for unit testing |
public RefactoringResult applyRefactoring(String sessionId) throws RefactoringException {
RefactoringSession session=getRefactoringSession(sessionId);
RefactoringResult result=session.apply();
deleteRefactoringSession(sessionId);
return result;
}
| Apply refactoring. |
@DSSpec(DSCat.IO) @DSSink({DSSinkKind.NETWORK}) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:01:09.466 -0500",hash_original_method="C7F824EB5C9CE82C3E815BE1E94821BC",hash_generated_method="2F6F8FCE8DC2AA447CE6E550ABE70F33") @Override public void write(int oneByte) throws IOExcept... | Method acts as described in spec for superclass. |
private List<FacetResult> search() throws IOException {
DirectoryReader indexReader=DirectoryReader.open(indexDir);
IndexSearcher searcher=new IndexSearcher(indexReader);
TaxonomyReader taxoReader=new DirectoryTaxonomyReader(taxoDir);
FacetsCollector fc=new FacetsCollector();
FacetsCollector.search(searcher,n... | User runs a query and counts facets. |
public static byte[] stringToUtf8Bytes(String string){
int len=string.length();
byte[] bytes=new byte[len * 3];
int outAt=0;
for (int i=0; i < len; i++) {
char c=string.charAt(i);
if ((c != 0) && (c < 0x80)) {
bytes[outAt]=(byte)c;
outAt++;
}
else if (c < 0x800) {
bytes[outAt]... | Converts a string into its Java-style UTF-8 form. Java-style UTF-8 differs from normal UTF-8 in the handling of character '\0' and surrogate pairs. |
public static String encodeMatrixParam(String value){
return encodeValue(value,matrixParameterEncoding);
}
| Keep encoded values "%..." and template parameters intact. |
public void testOneNodeCloseEvent() throws Throwable {
testSessionClose(1);
}
| Tests session close events. |
public Reason(){
super(NAME);
}
| Set the cause. /** Creates a new instance of Reason |
public void clear(){
for ( List<V> value : map.values()) {
value.clear();
}
map.clear();
}
| Clears all entries from the multimap. |
public void open() throws IOException {
connection=new DatagramSocket();
connection.setSoTimeout(timeout);
}
| Open the datagram connection |
@Override public Pair<OperandSize,String> generate(final ITranslationEnvironment environment,final long offset,final List<ReilInstruction> instructions) throws InternalTranslationException {
Preconditions.checkNotNull(environment,"Error: Argument environment can't be null");
Preconditions.checkNotNull(instructions,... | Generates code for the Parity condition. |
private void initialize(String dbDriver,String dbURL,String dbUser,String dbPassword,int maxConnections,int maxStatementsPerConnection,String dbValidationQuery,boolean validateOnCheckout,int idleValidationSeconds,int maxIdleSeconds) throws SQLException, SchedulerException {
if (dbURL == null) {
throw new SQLExcep... | Create the underlying C3PO ComboPooledDataSource with the default supported properties. |
public SamzaContainerContext(int id,Config config,Collection<TaskName> taskNames){
this.id=id;
this.config=config;
this.taskNames=Collections.unmodifiableCollection(taskNames);
}
| An immutable context object that can passed to tasks to give them information about the container in which they are executing. |
public void add(JTaskPaneGroup taskpaneGroup){
register(taskpaneGroup);
if (selection == null) {
if (taskpaneGroup.isExpanded()) {
selection=taskpaneGroup;
}
}
else {
taskpaneGroup.setExpanded(false);
}
maybeUpdateSelection(taskpaneGroup);
}
| Adds a <code>JTaskPaneGroup</code> to this group. |
public boolean hasEndOfTransmissionFlag(){
return !mMessage.get(sEndOfTransmissionFlag);
}
| Inverted Flags - 0 = flag is true |
public void visitParameter(String name,int access){
if (api < Opcodes.ASM5) {
throw new RuntimeException();
}
if (mv != null) {
mv.visitParameter(name,access);
}
}
| Visits a parameter of this method. |
public FileAlreadyExistsException(String file){
super(file);
}
| Constructs an instance of this class. |
public void stop(final long bytes){
this.stop();
mNumberOfBytes+=bytes;
}
| Stops the clock and accumulate time and bytes |
public static LoggingFraction createTraceLoggingFraction(){
return createDefaultLoggingFraction(Level.TRACE);
}
| Create a default TRACE logging fraction. |
public static void createAllTables(SQLiteDatabase db,boolean ifNotExists){
HideImageDao.createTable(db,ifNotExists);
}
| Creates underlying database table using DAOs. |
public Media createMedia(String uri,boolean isVideo,Runnable onCompletion) throws IOException {
MMAPIPlayer player=MMAPIPlayer.createPlayer(uri,onCompletion);
if (isVideo) {
VideoMainScreen video=new VideoMainScreen(player,this);
return video;
}
return player;
}
| Plays the sound in the given URI which is partially platform specific. |
protected void createLines(){
log.fine("Lines #" + m_lines.size());
for (int i=0; i < m_lines.size(); i++) {
WFLine line=(WFLine)m_lines.get(i);
Rectangle from=findBounds(line.getAD_WF_Node_ID());
Rectangle to=findBounds(line.getAD_WF_Next_ID());
line.setFromTo(from,to);
}
}
| Create Lines. Called by WF Layout Manager |
public static int largestElementLen(String setDefinition){
return largestElementLen(parseSet(setDefinition));
}
| Utility method for external callers. |
private void burrowCave(Point point,LayerDefinition layer){
Queue<Point> branchPoints=new LinkedList<Point>();
HashSet<Point> visited=new HashSet<Point>();
branchPoints.add(point);
List<Point> neighbours=getUnvisitedNeighbours(point,visited);
do {
visited.add(point);
if (neighbours.size() > 0) {
... | Make the tunnels. The actual maze generation algorithm. |
public Object runSafely(Catbert.FastStack stack) throws Exception {
String varName=getString(stack);
sage.msg.SystemMessage sm=getSysMsg(stack);
if (sm != null) return sm.getMessageVarValue(varName);
else return null;
}
| Returns the SystemMessage variable property associated with the specified SystemMessage. Depending upon the type of message; different variables will be assigned that can be used to do further analysis/processing on the message or to guide the user through resolution steps. |
public boolean removeFragment(FeedbackFragment fragment){
return mFragments.remove(fragment);
}
| Removes the indicated fragment. |
private void tituloGrafico(String titulo){
tituloGrafico.setText(titulo + " " + LocalDate.now().getYear());
}
| Titulo graficos dashboard |
public static void sendExceptionCount(){
sMoveToFrontExceptionHistogram.commitHistogram();
}
| Send the number of times an exception was caught when trying to move a task back to front. |
public void voidIt(){
String docStatus=getDocStatus();
if (DOCSTATUS_Voided.equals(docStatus)) {
log.warning("Activity already voided - " + this);
return;
}
BigDecimal qtyRequired=getQtyRequired();
if (qtyRequired.signum() != 0) {
addDescription(Msg.getMsg(getCtx(),"Voided") + " (" + qtyRequired+ ... | Void Activity |
public static void maybeQuote2(int version,StringBuffer buf,String value){
if (value == null || value.length() == 0) {
buf.append("\"\"");
}
else if (containsCTL(value,version)) throw new IllegalArgumentException("Control character in cookie value, consider BASE64 encoding your value");
else if (already... | Quotes values using rules that vary depending on Cookie version. |
public synchronized void stopPreview(){
if (autoFocusManager != null) {
autoFocusManager.stop();
autoFocusManager=null;
}
if (camera != null && previewing) {
camera.stopPreview();
previewCallback.setHandler(null,0);
previewing=false;
}
}
| Tells the camera to stop drawing preview frames. |
public static double[] scale(double fac,double[] vector){
int n=vector.length;
double[] res=new double[n];
for (int i=0; i < n; ++i) {
res[i]=fac * vector[i];
}
return (res);
}
| Scales a vector and returns the result in a new vector object. |
public static StopContainerParams create(@NotNull String container){
return new StopContainerParams().withContainer(container);
}
| Creates arguments holder with required parameters. |
@Override public boolean equals(Object obj){
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final TSDBEntity other=TSDBEntity.class.cast(obj);
if ((_scope == null) ? (other._scope != null) : !_scope.equals(other._scope)) {
return false;
}
if ((_metric ... | Determines if another object is equivalent to this entity. |
private LinkedList<WorkListItem> buildFindBugsAnnotationCodebaseList(){
return createFindBugsLibWorkList("annotations.jar");
}
| Create a worklist that will add the FindBugs lib/annotations.jar to the classpath. |
public void addLayer(QGisLayer layer){
this.layers.add(layer);
}
| Adds a new layer to the layers list. |
@SuppressWarnings("unused") private static void readProperties(final NodeList children,final Properties props){
for (int i=0; i < children.getLength(); i++) {
final Node child=children.item(i);
if ("property".equalsIgnoreCase(child.getNodeName())) {
props.setProperty(getAttributeValue(child,"name"),getA... | Reads properties from amongst the given children. When a "properties" element is encountered, it recursively calls itself with the children of this node. This function ensures backward compatibility with tmx version 0.99a. |
private boolean filterParameter(Parameter parameter){
return (!config.isFlatBodyEnabled() || !StringUtils.equals(parameter.getIn(),"body"));
}
| Filter parameters to display in parameters section |
public EnvironmentDestructionException(final Throwable cause){
super(cause);
}
| Constructs a new exception with the specified cause and a detail message of <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of <tt>cause</tt>). |
public static boolean intersectSegmentCircle(Vector2 start,Vector2 end,Vector2 center,float squareRadius){
tmp.set(end.x - start.x,end.y - start.y,0);
tmp1.set(center.x - start.x,center.y - start.y,0);
float l=tmp.len();
float u=tmp1.dot(tmp.nor());
if (u <= 0) {
tmp2.set(start.x,start.y,0);
}
else i... | Returns wheter the given line segment intersects the given circle. |
public static boolean isAccessContainer(Properties ctx,int CM_Container_ID,int AD_Role_ID,int C_BPGroup_ID){
return true;
}
| Access to Container |
public ArrayList<IMultiPoint> search(IHypercube hc){
ArrayList<IMultiPoint> retval=new ArrayList<IMultiPoint>();
double[] low_raw=new double[hc.dimensionality()];
double[] high_raw=new double[hc.dimensionality()];
for (int i=0; i < low_raw.length; i++) {
low_raw[i]=hc.getLeft(i + 1);
high_raw[i]=hc.getR... | Perform brute force search of all points within given region. |
protected void sequence_LeftHandSideExpression_ParameterizedPropertyAccessExpressionTail_TypeArguments_IndexedAccessExpression_1_2_1_0_ParameterizedCallExpression_1_2_0_0_ParameterizedPropertyAccessExpression_1_2_2_0_TaggedTemplateString_1_2_3_0_0(ISerializationContext context,ParameterizedPropertyAccessExpression sema... | Contexts: LeftHandSideExpression.ParameterizedCallExpression_1_2_0_0<Yield> returns ParameterizedPropertyAccessExpression LeftHandSideExpression.ParameterizedCallExpression_1_2_0_0<PostfixExpression.Yield> returns ParameterizedPropertyAccessExpression LeftHandSideExpression.ParameterizedCallExpression_1_2_0_0<CastExpre... |
public synchronized boolean isParsing(){
return parsing;
}
| Whether the helper is currently performing a parsing operation. |
public static void validateRules(List<FirewallState.Allow> rules){
for ( FirewallState.Allow rule : rules) {
validateRuleName(rule.name);
rule.protocol=validateProtocol(rule.protocol);
new SubnetUtils(rule.ipRange);
validatePorts(rule.ports);
}
}
| Ensure that the allow rules conform to standard firewall practices. |
private void updateWithoutTimer(final boolean animate){
if (pomodoroMaster.isOngoing()) {
mStartStopButton.setImageResource(R.drawable.ic_action_stop_96dp);
final DateTime nextPomodoro=pomodoroMaster.getNextPomodoro();
if (nextPomodoro != null) {
final float progress=1 - (float)(nextPomodoro.getMill... | Update the UI with an optional animation. |
public void reset(){
slots.clear();
active=false;
}
| Reset back to the default state (no drag in progress). |
public void organizeArticles(final List<JSONObject> articles) throws RepositoryException {
for ( final JSONObject article : articles) {
organizeArticle(article);
}
}
| Organizes the specified articles. <ul> <li>converts create/update/latest comment time (long) to date type</li> <li>generates author thumbnail URL</li> <li>generates author name</li> <li>escapes article title < and ></li> <li>generates article heat</li> <li>generates article view count display format(1k+/1.5k+...)... |
public void testBackgroundSyncFailure_DoesNotDisplaySyncError(){
mController.init();
SyncFinishedEvent event=new SyncFailedEvent();
mFakeEventBus.post(event);
verify(mMockUi,times(0)).showRefreshError();
}
| Tests that a background sync does not result in a sync error being displayed. |
public void removeCSSNavigableDocumentListener(CSSNavigableDocumentListener l){
EventListener[] listeners=(EventListener[])cssNavigableDocumentListeners.get(l);
if (listeners == null) {
return;
}
removeEventListenerNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,"DOMNodeInserted",listeners[0],false);
removeEvent... | Removes an event listener for mutations on the CSSNavigableDocument tree. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.