Get the native library version of the snappy

@return native library version
552179
public static String getNativeLibraryVersion()
    {
        URL versionFile = SnappyLoader.class.getResource("/org/xerial/snappy/VERSION");

        String version = "unknown";
        try {
            if (versionFile != null) {
                InputStream in = null;
                try {
                    Properties versionData = new Properties();
                    in = versionFile.openStream();
                    versionData.load(in);
                    version = versionData.getProperty("version", version);
                    if (version.equals("unknown")) {
                        version = versionData.getProperty("SNAPPY_VERSION", version);
                    }
                    version = version.trim().replaceAll("[^0-9\\.]", "");
                }
                finally {
                    if(in != null) {
                        in.close();
                    }
                }
            }
        }
        catch (IOException e) {
            e.printStackTrace();
        }
        return version;
    }
1229739
public function getVersion()
    {
        $composer = $this->getComposer();

        // try getting the version from the local repository
        $packages = $composer->getRepositoryManager()->getLocalRepository()->getCanonicalPackages();
        foreach ($packages as $package) {
            if ($package->getName() === static::PACKAGE_NAME) {
                $version = $package->getPrettyVersion();
                break;
            }
        }

        // let's take a look at the aliases
        $aliases = $composer->getLocker()->getAliases();
        foreach ($aliases as $idx => $alias) {
            if ($alias['package'] === static::PACKAGE_NAME) {
                return $alias['alias'];
            }
        }

        // fallback to the hardcoded latest version, if "dev-master" was set
        if ($version === 'dev-master') {
            return $this->getLatestPhantomJsVersion();
        }

        // grab version from commit-reference, e.g. "dev-master#<commit-ref> as version"
        if (preg_match('/dev-master#(?:.*)(\d.\d.\d)/i', $version, $matches)) {
            return $matches[1];
        }

        // grab version from a Composer patch version tag with a patch level, like "1.9.8-p02"
        if (preg_match('/(\d.\d.\d)(?:(?:-p\d{2})?)/i', $version, $matches)) {
            return $matches[1];
        }

        // let's take a look at the root package
        if (!empty($version)) {
            $version = $this->getRequiredVersion($composer->getPackage());
        }

        return $version;
    }
28648
public static String getBuildVersion(){
    return VersionInfo.getVersion() + 
    " from " + VersionInfo.getRevision() +
    " by " + VersionInfo.getUser() + 
    " on " + VersionInfo.getDate();
  }
942561
private static File extractLibraryFile(String libFolderForCurrentOS, String libraryFileName, String targetFolder)
    {
        String nativeLibraryFilePath = libFolderForCurrentOS + "/" + libraryFileName;

        // Attach UUID to the native library file to ensure multiple class loaders can read the libsnappy-java multiple times.
        String uuid = UUID.randomUUID().toString();
        String extractedLibFileName = String.format("snappy-%s-%s-%s", getVersion(), uuid, libraryFileName);
        File extractedLibFile = new File(targetFolder, extractedLibFileName);

        try {
            // Extract a native library file into the target directory
            InputStream reader = null;
            FileOutputStream writer = null;
            try {
                reader = SnappyLoader.class.getResourceAsStream(nativeLibraryFilePath);
                try {
                    writer = new FileOutputStream(extractedLibFile);

                    byte[] buffer = new byte[8192];
                    int bytesRead = 0;
                    while ((bytesRead = reader.read(buffer)) != -1) {
                        writer.write(buffer, 0, bytesRead);
                    }
                }
                finally {
                    if (writer != null) {
                        writer.close();
                    }
                }
            }
            finally {
                if (reader != null) {
                    reader.close();
                }

                // Delete the extracted lib file on JVM exit.
                extractedLibFile.deleteOnExit();
            }

            // Set executable (x) flag to enable Java to load the native library
            boolean success = extractedLibFile.setReadable(true) &&
                    extractedLibFile.setWritable(true, true) &&
                    extractedLibFile.setExecutable(true);
            if (!success) {
                // Setting file flag may fail, but in this case another error will be thrown in later phase
            }

            // Check whether the contents are properly copied from the resource folder
            {
                InputStream nativeIn = null;
                InputStream extractedLibIn = null;
                try {
                    nativeIn = SnappyLoader.class.getResourceAsStream(nativeLibraryFilePath);
                    extractedLibIn = new FileInputStream(extractedLibFile);

                    if (!contentsEquals(nativeIn, extractedLibIn)) {
                        throw new SnappyError(SnappyErrorCode.FAILED_TO_LOAD_NATIVE_LIBRARY, String.format("Failed to write a native library file at %s", extractedLibFile));
                    }
                }
                finally {
                    if (nativeIn != null) {
                        nativeIn.close();
                    }
                    if (extractedLibIn != null) {
                        extractedLibIn.close();
                    }
                }
            }

            return new File(targetFolder, extractedLibFileName);
        }
        catch (IOException e) {
            e.printStackTrace(System.err);
            return null;
        }
    }
1277969
public function getVersion()
	{
		$filename = dirname( $this->container->get( 'kernel' )->getRootDir() ) . DIRECTORY_SEPARATOR . 'composer.lock';

		if( file_exists( $filename ) === true && ( $content = file_get_contents( $filename ) ) !== false
			&& ( $content = json_decode( $content, true ) ) !== null && isset( $content['packages'] )
		) {
			foreach( (array) $content['packages'] as $item )
			{
				if( $item['name'] === 'aimeos/aimeos-symfony' ) {
					return $item['version'];
				}
			}
		}

		return '';
	}
59139
function getInstalledNPMVersion () {
  return new Promise((resolve, reject) => {
    let nodeVersion

    exec('npm -v', (err, stdout) => {
      if (err) {
        reject(new Error('Could not determine npm version.'))
      } else {
        nodeVersion = stdout.replace(/\n/, '')
        resolve(nodeVersion)
      }
    })
  })
}
745170
private static Version extractVersion() {
		VersionInfo versionInfo = VersionInfo.getVersionInfo();
		String versionString = versionInfo.getVersion();
		String[] splits = versionString.split("\\.");
		int major = 0;
		int minor = 0;
		int patch = 0;
		int build = 0;
		try {
			major = Integer.parseInt(splits[0]);
			minor = Integer.parseInt(splits[1]);
			patch = Integer.parseInt(splits[2]);
			build = Integer.parseInt(splits[3]);
		} catch (Exception ignored) {

		}
		return new Version(major, minor, patch, build);
	}
1249077
def get_version(self):
        

        ptr = self._get_version_func(self.alpr_pointer)
        version_number = ctypes.cast(ptr, ctypes.c_char_p).value
        version_number = _convert_from_charp(version_number)
        self._free_json_mem_func(ctypes.c_void_p(ptr))
        return version_number
307052
public static Integer getMajorVersion() {
        if (VERSION.equals("UNKNOWN")) {
            return null;
        }

        final String[] versionParts = VERSION.split("\\.");
        return Integer.parseInt(versionParts[0]);
    }
1192720
public static <K, N> InternalTimersSnapshotReader<K, N> getReaderForVersion(
		int version, ClassLoader userCodeClassLoader) {

		switch (version) {
			case NO_VERSION:
				return new InternalTimersSnapshotReaderPreVersioned<>(userCodeClassLoader);

			case 1:
				return new InternalTimersSnapshotReaderV1<>(userCodeClassLoader);

			case InternalTimerServiceSerializationProxy.VERSION:
				return new InternalTimersSnapshotReaderV2<>(userCodeClassLoader);

			default:
				// guard for future
				throw new IllegalStateException(
					"Unrecognized internal timers snapshot writer version: " + version);
		}
	}
1355741
private Version parseVersion() {
        int major = intOf(consumeNextToken(NUMERIC).lexeme);
        int minor = 0;
        if (tokens.positiveLookahead(DOT)) {
            tokens.consume();
            minor = intOf(consumeNextToken(NUMERIC).lexeme);
        }
        int patch = 0;
        if (tokens.positiveLookahead(DOT)) {
            tokens.consume();
            patch = intOf(consumeNextToken(NUMERIC).lexeme);
        }
        return versionFor(major, minor, patch);
    }
607552
public double getRequiredVersion() {

        if (m_requiredVersion == 0) {
            String versionStr = getConfigurationContentStringValue(NODE_VERSION);
            try {
                m_requiredVersion = Double.parseDouble(versionStr);
            } catch (Exception e) {
                // the version number is not in the correct format
                LOG.error(
                    Messages.get().getBundle().key(
                        Messages.LOG_USERAGREEMENT_WRONG_VERSION_2,
                        versionStr,
                        getConfigurationContent().getFile().getRootPath()));
            }
        }
        return m_requiredVersion;
    }
397354
def get_version():
    
    major_value = ctypes.c_int(0)
    major = ctypes.pointer(major_value)
    minor_value = ctypes.c_int(0)
    minor = ctypes.pointer(minor_value)
    rev_value = ctypes.c_int(0)
    rev = ctypes.pointer(rev_value)
    _glfw.glfwGetVersion(major, minor, rev)
    return major_value.value, minor_value.value, rev_value.value
1309568
public static String getVersion() {
		String version = EnvironmentInformation.class.getPackage().getImplementationVersion();
		return version != null ? version : UNKNOWN;
	}
772453
public java.lang.String getVersion() {
    java.lang.Object ref = version_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      if (bs.isValidUtf8()) {
        version_ = s;
      }
      return s;
    }
  }
910713
public static String getVersionString() {
		String versionString = "UNKNOWN";
		Properties propeties = getProperites();
		if(propeties != null) {
			versionString = propeties.getProperty("finmath-lib.version");
		}
		return versionString;
	}
1235427
function retrieveSnappy() {
  var snappy = null;
  try {
    snappy = require_optional('snappy');
  } catch (error) {} // eslint-disable-line
  if (!snappy) {
    snappy = {
      compress: noSnappyWarning,
      uncompress: noSnappyWarning,
      compressSync: noSnappyWarning,
      uncompressSync: noSnappyWarning
    };
  }
  return snappy;
}