Return true if dotted version string is equal or higher than requested version.

See http://jsfiddle.net/mar10/FjSAN/
513330
function isVersionAtLeast(dottedVersion, major, minor, patch){
	var i, v, t,
		verParts = $.map($.trim(dottedVersion).split("."), function(e){ return parseInt(e, 10); }),
		testParts = $.map(Array.prototype.slice.call(arguments, 1), function(e){ return parseInt(e, 10); });

	for( i = 0; i < testParts.length; i++ ){
		v = verParts[i] || 0;
		t = testParts[i] || 0;
		if( v !== t ){
			return ( v > t );
		}
	}
	return true;
}
798523
public boolean match( VersionID vid )
    {
        if ( _isCompound )
        {
            if ( !_rest.match( vid ) )
            {
                return false;
            }
        }
        return ( _usePrefixMatch )
                ? this.isPrefixMatch( vid )
                : ( _useGreaterThan ) ? vid.isGreaterThanOrEqual( this ) : matchTuple( vid );
    }
719715
function compareVersions(v1, v2) {
    if (semver.gt(v1.tag, v2.tag)) {
        return -1;
    }
    if (semver.lt(v1.tag, v2.tag)) {
        return 1;
    }
    return 0;
}
307377
def _is_version_range(req):
    """"""

    assert len(req.specifier) > 0
    specs = list(req.specifier)
    if len(specs) == 1:
        # "foo > 2.0" or "foo == 2.4.3"
        return specs[0].operator != '=='
    else:
        # "foo > 2.0, < 3.0"
        return True
751601
function validVersion(version, spec) {
  // Normalize route versions
  var test = spec.versions || [spec.version]

  // Check for direct version match
  if (~test.indexOf(version)) {
    return true
  }

  // Use semver and attempt to match on supplied version
  return !!test.filter(function(v) {
    return semver.satisfies(v, version)
  }).length
}
669402
def is_version(value):
    """"""
    try:
        value = str(value)
        if not parse_ver('1.4') <= parse_ver(value):
            raise ValueError()
        return value
    except (AttributeError, TypeError, ValueError):
        raise vol.Invalid(
            '{} is not a valid version specifier'.format(value))
856766
def version_greater(minimum, version):
    

    # Chop up the version strings
    minimum = [int(i) for i in minimum.split('.')]
    version = [int(i) for i in version.split('.')]

    # Compare the versions element by element
    for mini, vers in zip(minimum, version):
        if vers < mini:
            # If it's less than, we definitely don't match
            return False
        elif vers > mini:
            # If it's greater than, we definitely match
            return True

        # OK, the elements are equal; loop around and check out the
        # next element

    # All elements are equal
    return True
1183116
def _validate_python_version(s):
    ""
    if not s:
        return True
    toks = s.split('.')
    if len(toks) != 2:
        return False
    try:
        int(toks[0])
        int(toks[1])
    except ValueError:
        return False
    return True
206096
public static boolean greaterOrEqualsVersion(String versionA, String versionB) {
        String largerVersion = extractLargerVersion(versionA, versionB);
        return largerVersion != null && largerVersion.equals(versionA);
    }
58483
def check_version(server, version, filename, timeout=SHORT_TIMEOUT):
    """"""

    address = VERSION_ENDPOINT.format(server=server)

    print('Checking for software updates...')
    log.info('Existing OK version: %s', version)
    log.info('Checking latest version from %s', address)

    try:
        response = requests.get(address, timeout=timeout)
        response.raise_for_status()
    except (requests.exceptions.RequestException, requests.exceptions.BaseHTTPError) as e:
        print('Network error when checking for updates.')
        log.warning('Network error when checking version from %s: %s', address,
                    str(e), stack_info=True)
        return False

    response_json = response.json()
    if not _validate_api_response(response_json):
        print('Error while checking updates: malformed server response')
        log.info('Malformed response from %s: %s', address, response.text)
        return False

    current_version = response_json['data']['results'][0]['current_version']
    if current_version == version:
        print('OK is up to date')
        return True

    download_link = response_json['data']['results'][0]['download_link']

    log.info('Downloading version %s from %s', current_version, download_link)

    try:
        response = requests.get(download_link, timeout=timeout)
        response.raise_for_status()
    except (requests.exceptions.RequestException, requests.exceptions.BaseHTTPError) as e:
        print('Error when downloading new version of OK')
        log.warning('Error when downloading new version of OK: %s', str(e),
                    stack_info=True)
        return False

    log.info('Writing new version to %s', filename)

    zip_binary = response.content
    try:
        _write_zip(filename, zip_binary)
    except IOError as e:
        print('Error when downloading new version of OK')
        log.warning('Error writing to %s: %s', filename, str(e))
        return False
    else:
        print('Updated to version: {}'.format(current_version))
        log.info('Successfully wrote to %s', filename)
        return True
696159
def version_ok(self, version):
        """"""
        return self.attribute is None or self.format is None or \
            str(version) != "unknown" and version >= self.requested_version
495467
def _compare_versions(v1, v2):
    
    def normalize(v):
        # strip trailing .0 or .00 or .0.0 or ...
        v = re.sub(r'(\.0+)*$', '', v)
        result = []
        for part in v.split('.'):
            # just digits
            m = re.match(r'^(\d+)$', part)
            if m:
                result.append(int(m.group(1)))
                continue
            # digits letters
            m = re.match(r'^(\d+)([a-zA-Z]+)$', part)
            if m:
                result.append(int(m.group(1)))
                result.append(m.group(2))
                continue
            # digits letters digits
            m = re.match(r'^(\d+)([a-zA-Z]+)(\d+)$', part)
            if m:
                result.append(int(m.group(1)))
                result.append(m.group(2))
                result.append(int(m.group(3)))
                continue
        return tuple(result)

    n1 = normalize(v1)
    n2 = normalize(v2)

    return (n1 > n2) - (n1 < n2)
101785
public static boolean isValidVersion(final String version) {
        return StringUtils.isNotBlank(version)
                && (ALTERNATE_PATTERN.matcher(version).matches() || STANDARD_PATTERN
                        .matcher(version).matches());
    }
316842
public boolean isValidNamedVersion(final String s) {
    if (SEMANTIC_RANGE_SPECIAL_CHARS.matcher(s).find()
        || SET_RANGE_SPECIAL_CHARS.matcher(s).find()
        || INVALID_VERSION_CHARS.matcher(s).find()
        ) {
      return false;
    }
    return true;
  }
542581
def _get_version():
    '''
    
    '''
    version_string = __salt__['cmd.run'](
        [_check_pkgin(), '-v'],
        output_loglevel='trace')
    if version_string is None:
        # Dunno why it would, but...
        return False

    version_match = VERSION_MATCH.search(version_string)
    if not version_match:
        return False

    return version_match.group(1).split('.')
422580
def contains_version(self, version):
        """"""
        if len(self.bounds) < 5:
            # not worth overhead of binary search
            for bound in self.bounds:
                i = bound.version_containment(version)
                if i == 0:
                    return True
                if i == -1:
                    return False
        else:
            _, contains = self._contains_version(version)
            return contains

        return False
1071686
function(sVersion) {

		if (!sVersion || typeof sVersion !== 'string') {
			return false;
		}

		//Match 0 or 1 of the following symbols - "*" or "-" or the following pattern of digits - "<digit>.<digit><digit>"
		var versionRegEx = /^\*$|^\-$|^\d\.\d\d$/;

		if (sVersion.match(versionRegEx)) {
			return true;
		}

		return false;

	}