version

Correct way to check Java version from BASH script

折月煮酒 提交于 2019-11-27 06:43:41
How can I check whether Java is available (in the PATH or via JAVA_HOME) from a bash script and make sure the version is at least 1.5? Perhaps something like: if type -p java; then echo found java executable in PATH _java=java elif [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then echo found java executable in JAVA_HOME _java="$JAVA_HOME/bin/java" else echo "no java" fi if [[ "$_java" ]]; then version=$("$_java" -version 2>&1 | awk -F '"' '/version/ {print $2}') echo version "$version" if [[ "$version" > "1.5" ]]; then echo version is more than 1.5 else echo version is less than 1

Changing string to byte type in Python 2.7

喜欢而已 提交于 2019-11-27 06:43:20
问题 In python 3.2, i can change the type of an object easily. For example : x=0 print(type (x)) x=bytes(0) print(type (x)) it will give me this : <class 'int'> <class 'bytes'> But, in python 2.7, it seems that i can't use the same way to do it. If i do the same code, it give me this : <type 'int'> <type 'str'> What can i do to change the type into a bytes type? 回答1: What can i do to change the type into a bytes type? You can't, there is no such type as 'bytes' in Python 2.7. From the Python 2.7

Are Apps using iAd compatible with older iOS

[亡魂溺海] 提交于 2019-11-27 06:27:58
问题 Can I add the UIBannerViewDelegate protocol to my UIViewController subclass while remaining compatible with pre-iOS 4 devices? This is NOT a duplicate, the question is specifically related to the delegate protocol. 回答1: If you weak-link the iAd framework, you will encounter no issues with a controller class that conforms to the ADBannerViewDelegate protocol. You will, of course, need to add the ADBannerView programmatically (if it exists on the running OS) or otherwise load a different Nib

How can I specify the required Node.js version in package.json?

痞子三分冷 提交于 2019-11-27 06:23:50
I have a Node.js project that requires Node version 12 or higher. Is there a way to specify this in the packages.json file, so that the installer will automatically check and inform the users if they need to upgrade? I think you can use the "engines" field: { "engines" : { "node" : ">=0.12" } } As you're saying your code definitely won't work with any lower versions, you probably want the "engineStrict" flag too: { "engineStrict" : true } Documentation for the package.json file can be found on the npmjs site Update engineStrict is now deprecated, so this will only give a warning. It's now down

How good is my method of embedding version numbers into my application using Mercurial hooks?

百般思念 提交于 2019-11-27 06:14:10
问题 This is not quite a specifc question, and more me like for a criticism of my current approach. I would like to include the program version number in the program I am developing. This is not a commercial product, but a research application so it is important to know which version generated the results. My method works as follows: There is a "pre-commit" hook in my .hg/hgrc file link to version_gen.sh version_gen.sh consists solely of: hg parent --template "r{rev}_{date|shortdate}" > version

How to determine the Boost version on a system?

杀马特。学长 韩版系。学妹 提交于 2019-11-27 06:13:16
Is there a quick way to determine the version of the Boost C++ libraries on a system? Boost Informational Macros . You need: BOOST_VERSION Tested with boost 1.51.0: std::cout << "Using Boost " << BOOST_VERSION / 100000 << "." // major version << BOOST_VERSION / 100 % 1000 << "." // minor version << BOOST_VERSION % 100 // patch level << std::endl; Output: Using Boost 1.51.0 Tested with boost versions 1.51.0 to 1.65.0 If you only need to know for your own information, just look in /usr/include/boost/version.hpp (Ubuntu 13.10) and read the information directly #include <boost/version.hpp>

How can I install a specific version of a set of Perl modules?

被刻印的时光 ゝ 提交于 2019-11-27 06:06:30
I'm tasked with replicating a production environment to create many test/sit environments. One of the things I need to do is build up Perl, with all the modules which have been installed (including internal and external modules) over the years. I could just use CPAN.pm autobundle, but this will result in the test environment having much newer versions of the external modules that production has. What is the easiest/best way to get and install (a lot of) version specific Perl modules. Make your own CPAN mirror with exactly what you want. Stratopan.com , a service, and Pinto , tools that's built

How do I find the .NET framework version used in an SSIS 2008 R2 package?

混江龙づ霸主 提交于 2019-11-27 05:58:45
问题 How do I find the .NET framework version used in an SSIS 2008 R2 package? 回答1: You have probably found an answer to your question by now. This is for others who might stumble upon this question. Here is one possible way to find out the .NET version used by an SSIS package. Version can be found with the help of a Script Task . Following example shows how this can be done. This example uses SSIS 2008 R2 . Step-by-step process: On the SSIS package's Control Flow tab, place a Script Task as shown

Java Stacktrace error Unsupported major.minor version 51.0 [duplicate]

不问归期 提交于 2019-11-27 05:55:56
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: unsupported major .minor version 51.0 I made this script, and it gives me this error: java.lang.UnsupportedClassVersionError: net/glitching/client : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(Unknown Source) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at

d3.js - v3 and v4 - Enter and Update differences

百般思念 提交于 2019-11-27 05:37:45
I'm trying to get the values for x and y to make a circles using d3.js v4. With the following code I manage to create the chart like behavior of the circles, but when I try to run the same code in v4 it doesn't work anymore. I know that there are some differences in the update to v4 but I didn't find any information about it. So i was wondering if someone can help me to run this code in d3.js v4. Here is the code using v3 (it will break using v4): var svg = d3.select('body').append('svg') .attr('width', 250) .attr('height', 250); //render the data function render(data) { //Bind var circles =