Checked vs. Jan 11, 2011
557634
int queryCoordinates(Point2D[] dst, int dstSize, int beginIndex,
			int endIndex) {
		int endIndexC = endIndex < 0 ? m_pointCount : endIndex;
		endIndexC = Math.min(endIndexC, beginIndex + dstSize);

		if (beginIndex < 0 || beginIndex >= m_pointCount
				|| endIndexC < beginIndex)
			throw new IllegalArgumentException();

		AttributeStreamOfDbl xy = (AttributeStreamOfDbl) getAttributeStreamRef(VertexDescription.Semantics.POSITION);
		int j = 0;
		double[] dstArray = new double[dst.length * 2];
		xy.readRange(2 * beginIndex, (endIndexC - beginIndex) * 2, dstArray, j, true);

		for (int i = 0; i < dst.length; i++) {
			dst[i] = new Point2D(dstArray[i * 2], dstArray[i * 2 + 1]);
		}

		// for (int i = beginIndex; i < endIndexC; i++, j++)
		// {
		// xy.read(2 * i, dst[j]);
		// }

		return endIndexC;
	}
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;
            }
        }
    }
1104448
function visit(state, filePath, one, done) {
  var file

  // Don’t walk into places multiple times.
  if (own.call(state.checked, filePath)) {
    done([])
    return
  }

  state.checked[filePath] = true

  file = vfile(filePath)

  stat(resolve(filePath), onstat)

  function onstat(error, stats) {
    var real = Boolean(stats)
    var results = []
    var result

    if (state.broken || !real) {
      done([])
    } else {
      result = state.test(file, stats)

      if (mask(result, INCLUDE)) {
        results.push(file)

        if (one) {
          state.broken = true
          return done(results)
        }
      }

      if (mask(result, BREAK)) {
        state.broken = true
      }

      if (state.broken || !stats.isDirectory() || mask(result, SKIP)) {
        return done(results)
      }

      readdir(filePath, onread)
    }

    function onread(error, entries) {
      visitAll(state, entries, filePath, one, onvisit)
    }

    function onvisit(files) {
      done(results.concat(files))
    }
  }
}
36605
def changed(self, *value):
        """"""
        if self._last_checked_value != value:
            self._last_checked_value = value
            return True
        return False
953164
static void checkState(boolean check, String msg, Object... args) {
    if (!check) {
      throw new IllegalStateException(String.format(msg, args));
    }
  }
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))
1043302
function getCheckedAndUnchecked (checkboxes) {
  var checked = [], unchecked = [];
  for (var i = 0; i < arguments.length; i++) {
    var checkbox = arguments[i];
    if (checkbox.is(":checked")) {
      checked.push(checkbox.data("value"));
    }
    else {
      unchecked.push(checkbox.data("value"));
    }
  }
  return { checked: checked, unchecked: unchecked };
}
53750
function compare (a, b) {
    if (a.timeStamp > b.timeStamp) {
      return -1;
    }
    if (a.timeStamp < b.timeStamp) {
      return 1;
    }

    return 0;
  }
234279
@Override
  public boolean isModified()
  {
    long now = CurrentTime.currentTime();
    long lastCheckTime = _lastCheckTime.get();
    
    if (now <= lastCheckTime + _checkInterval) {
      return _isModified;
    }

    if (! _lastCheckTime.compareAndSet(lastCheckTime, now)) {
      return _isModified;
    }

    if (isModifiedImpl()) {
      _isModified = true;
      //_lastCheckTime.set(0);
    }
    else {
      _isModified = false;
    }

    return _isModified;
  }
894769
private static int checkEdge(int width, int x, int col, int edge)
    {
        int ix = x + col;
        if (ix < 0)
        {
            if (edge == CLAMP_EDGES)
            {
                ix = 0;
            }
            else
            {
                ix = (x + width) % width;
            }
        }
        else if (ix >= width)
        {
            if (edge == CLAMP_EDGES)
            {
                ix = width - 1;
            }
            else
            {
                ix = (x + width) % width;
            }
        }
        return ix;
    }
708962
@Override
    public int compareTo(final BlockingState arg0) {
        // effective_date column NOT NULL
        final int comparison = effectiveDate.compareTo(arg0.getEffectiveDate());
        if (comparison == 0) {
            // Keep a stable ordering for ties
            final int comparison2 = createdDate.compareTo(arg0.getCreatedDate());
            if (comparison2 == 0 && arg0 instanceof DefaultBlockingState) {
                final DefaultBlockingState other = (DefaultBlockingState) arg0;
                // New element is last
                if (totalOrdering == null) {
                    return 1;
                } else if (other.getTotalOrdering() == null) {
                    return -1;
                } else {
                    return totalOrdering.compareTo(other.getTotalOrdering());
                }
            } else {
                return comparison2;
            }
        } else {
            return comparison;
        }
    }
544019
def checkback ( tmp, len ) # :nodoc:
      if len > 0 then
	i = len
	len.times do
	  i = i - 1
	  return i if cmp( tmp, i )
	end
      end
      return -1
    end
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
1134216
function checkOlderIE() {
  const ua = navigator.userAgent;
  const isIE = ua.indexOf('MSIE') !== -1 || ua.indexOf('Trident') !== -1;
  if (!isIE) {
    return false;
  }
  const version = ua.match(/(MSIE\s|Trident.*rv:)([\w.]+)/)[2];
  const versionNumber = parseFloat(version);
  if (versionNumber < 10) {
    return true;
  }
  return false;
}
1055442
function(a, b) {
        if ((a.timesNotSelected || 0) < b.timesNotSelected) {
            return -1;
        }
        else if ((a.timesNotSelected || 0) > b.timesNotSelected) {
            return 1;
        }
        return 0;
    }
212827
def updateCheckedText(self):
        
        if not self.isCheckable():
            return
        
        indexes = self.checkedIndexes()
        items = self.checkedItems()

        if len(items) < 2 or self.separator():
            self.lineEdit().setText(self.separator().join(items))
        else:
            self.lineEdit().setText('{0} items selected'.format(len(items)))
        
        if not self.signalsBlocked():
            self.checkedItemsChanged.emit(items)
            self.checkedIndexesChanged.emit(indexes)
403068
def set_checked(self, checked):
        
        if not checked:
            self.widget.clearCheck()
        else:
            #: Checked is a reference to the radio declaration
            #: so we need to get the ID of it
            rb = checked.proxy.widget
            if not rb:
                return
            self.widget.check(rb.getId())