Checked vs. Jan 11, 2011
434779
@Override
	public void setXYZ(int index, Point3D pt) {
		if (index < 0 || index >= getPointCount())
			throw new IndexOutOfBoundsException();

		addAttribute(Semantics.Z);

		_verifyAllStreams();
		notifyModified(DirtyFlags.DirtyCoordinates);
		AttributeStreamOfDbl v = (AttributeStreamOfDbl) m_vertexAttributes[0];
		v.write(index * 2, pt.x);
		v.write(index * 2 + 1, pt.y);
		m_vertexAttributes[1].writeAsDbl(index, pt.z);
	}
35124
@Override
    public int compareTo(Timestamp other) {
	if (unixSec < other.unixSec) {
            return -1;
        } else if (unixSec == other.unixSec) {
            if (nanoSec < other.nanoSec) {
                return -1;
            } else if (nanoSec == other.nanoSec) {
                return 0;
            } else {
                return 1;
            }
        } else {
            return 1;
        }
    }
48454
@Override
    public String compareDatastreamChecksum(String pid,
                                            String dsID,
                                            String versionDate) {
        assertInitialized();
        try {
            MessageContext ctx = context.getMessageContext();
            return m_management.compareDatastreamChecksum(ReadOnlyContext
                    .getSoapContext(ctx), pid, dsID, DateUtility
                    .parseDateOrNull(versionDate));
        } catch (Throwable th) {
            LOG.error("Error comparing datastream checksum", th);
            throw CXFUtility.getFault(th);
        }
    }
971610
function getCheckbox(checked) {
  return checked ? utils.chalk.green(utils.figures.radioOn) : utils.figures.radioOff;
}
314261
private boolean checkPlVatId(final String pvatId) {
    final int checkSum = pvatId.charAt(11) - '0';
    final int sum = (pvatId.charAt(2) - '0') * 6 + (pvatId.charAt(3) - '0') * 5
        + (pvatId.charAt(4) - '0') * 7 + (pvatId.charAt(5) - '0') * 2 + (pvatId.charAt(6) - '0') * 3
        + (pvatId.charAt(7) - '0') * 4 + (pvatId.charAt(8) - '0') * 5 + (pvatId.charAt(9) - '0') * 6
        + (pvatId.charAt(10) - '0') * 7;
    final int calculatedCheckSumPl = sum % MODULO_11;
    return checkSum == calculatedCheckSumPl;
  }
712191
private int healthCheckFailed() {
        int oldState, newState;
        for (;;) {
            oldState = this.state;
            if ((oldState & ERROR) != ERROR) {
                newState = oldState | ERROR;
                UndertowLogger.ROOT_LOGGER.nodeIsInError(jvmRoute);
            } else if ((oldState & ERROR_MASK) == ERROR_MASK) {
                return ERROR_MASK;
            } else {
                newState = oldState +1;
            }
            if (stateUpdater.compareAndSet(this, oldState, newState)) {
                return newState & ERROR_MASK;
            }
        }
    }
829422
def _check_if_all_updated(self):
        """"""
        for g in self.toc.toc:
            if g not in self.values:
                return False
            for n in self.toc.toc[g]:
                if n not in self.values[g]:
                    return False

        return True
1332180
private void addCheckBox(Date date, boolean checkState) {

        CmsCheckBox cb = generateCheckBox(date, checkState);
        m_checkBoxes.add(cb);
        reInitLayoutElements();

    }
73027
function compare(a, b) {
    try {
        return semver.compare(a, b);
    } catch(err) {
        if(semver.valid(a)) {
            return 1
        }
        if(semver.valid(b)) {
            return -1;
        }
        return 0;
    }
}
436738
function compare(a, b, n) {
	var n2 = n,
		then = Date.now()
	while (n2--) {
		a === b
	}
	return (Date.now() - then) * 1e6 / n
}
898065
def on_checked_changed(self, group, checked_id):
        
        d = self.declaration
        if checked_id < 0:
            with self.widget.clearCheck.suppressed():
                d.checked = None
            return
        else:
            for c in self.children():
                if c.widget.getId() == checked_id:
                    with self.widget.check.suppressed():
                        d.checked = c.declaration
                    return
784380
def run_checked (self):
        """"""
        self.start_time = time.time()
        self.setName("Status")
        # the first status should be after a second
        wait_seconds = 1
        first_wait = True
        while not self.stopped(wait_seconds):
            self.log_status()
            if first_wait:
                wait_seconds = self.wait_seconds
                first_wait = False
492643
def checkState(self):
        
        if self.data is True:
            return Qt.Checked
        elif self.data is False:
            return Qt.Unchecked
        else:
            raise ValueError("Unexpected data: {!r}".format(self.data))
501273
private boolean contentEqualsUnchecked(byte[] bytes, int offset, int len) {
    if (length != len) {
      return false;
    }

    return compareToUnchecked(bytes, offset, len) == 0;
  }
953164
static void checkState(boolean check, String msg, Object... args) {
    if (!check) {
      throw new IllegalStateException(String.format(msg, args));
    }
  }
196539
private boolean checkIeVatId(final String pvatId) {
    final char checkSum = pvatId.charAt(9);
    String vatId = pvatId;
    if (pvatId.charAt(3) >= 'A' && pvatId.charAt(3) <= 'Z') {
      // old id, can be transfered to new form
      vatId = pvatId.substring(0, 2) + "0" + pvatId.substring(4, 9) + pvatId.substring(2, 3)
          + pvatId.substring(9);
    }
    final int sum = (vatId.charAt(2) - '0') * 8 + (vatId.charAt(3) - '0') * 7
        + (vatId.charAt(4) - '0') * 6 + (vatId.charAt(5) - '0') * 5 + (vatId.charAt(6) - '0') * 4
        + (vatId.charAt(7) - '0') * 3 + (vatId.charAt(8) - '0') * 2;
    final int calculatedCheckSum = sum % 23;
    final char calculatedCheckSumCharIe;
    if (calculatedCheckSum == 0) {
      calculatedCheckSumCharIe = 'W';
    } else {
      calculatedCheckSumCharIe = (char) ('A' + calculatedCheckSum - 1);
    }
    return checkSum == calculatedCheckSumCharIe;
  }
1197928
def _filtering_result_checked(self, by_or):
		''''''
		filters, results = it.imap(set, ( self.feed.filters.all(),
			self.filtering_results.values_list('filter', flat=True) ))

		# Check if conclusion can already be made, based on cached results.
		if results.issubset(filters):
			# If at least one failed/passed test is already there, and/or outcome is defined.
			try: return self._filtering_result(by_or)
			except IndexError: # inconclusive until results are consistent
				if filters == results: return not by_or

		# Consistency check / update.
		if filters != results:
			# Drop obsolete (removed, unbound from feed)
			#  filters' results (they WILL corrupt outcome).
			self.filtering_results.filter(filter__in=results.difference(filters)).delete()
			# One more try, now that results are only from feed filters' subset.
			try: return self._filtering_result(by_or)
			except IndexError: pass
			# Check if any filter-results are not cached yet, create them (perform actual filtering).
			# Note that independent filters applied first, since
			#  crossrefs should be more resource-hungry in general.
			for filter_obj in sorted(filters.difference(results), key=op.attrgetter('base.crossref')):
				filter_op = FilterResult(filter=filter_obj, post=self, result=filter_obj.handler(self))
				filter_op.save()
				if filter_op.result == by_or: return by_or # return as soon as first passed / failed

		# Final result
		try: return self._filtering_result(by_or)
		except IndexError: return not by_or