What does the ^ mean for spec attribute in PhoneGap plugin? [duplicate] - phonegap-plugins

This question already has answers here:
What's the difference between tilde(~) and caret(^) in package.json?
(19 answers)
Closed 4 years ago.
For example, I'm using <plugin name="phonegap-plugin-push" spec="^2.0.0" source="npm"> in my config.xml to add the push plugin and then build my application with PhoneGap Build.
What does the ^ mean?
I found that ~ means "greater or equal to" but can't find for the ^
Thanks in advance for any clarification !

In the simplest terms, the tilde matches the most recent minor version (the middle number). ~1.2.3 will match all 1.2.x versions but will miss 1.3.0.
The caret, on the other hand, is more relaxed. It will update you to the most recent major version (the first number). ^1.2.3 will match any 1.x.x release including 1.3.0, but will hold off on 2.0.0.
Source : Click

Related

use of internal package github.com/Azure-Samples/azure-sdk-for-go-samples/internal/config not allowed [duplicate]

This question already has an answer here:
How to disable "use of internal package not allowed"
(1 answer)
Closed 2 years ago.
I am trying to call GetVM from azure-sdk-for-go-samples/compute and when I am trying to build project it is showing the below error
use of internal package github.com/Azure-Samples/azure-sdk-for-go-samples/internal/config not allowed
test.go:17:2: use of internal package github.com/Azure-Samples/azure-sdk-for-go-samples/internal/iam not allowed
I am using Go version : 1.14.3
Note: I am cloning the repo in $GOPATH/src/githhub.com directory .
internal packages are specifically marked as not for use outside of that program or package, and therefore cannot be imported. See: https://golang.org/doc/go1.4#internalpackages

How to install Haskell with a "base" specification?

I want to run a program that demands a specific version of the base package. This version is not the one that comes with my OS's version of Haskell hence I apparently can't use my OS's version of Haskell.
It would be great of conda worked with Haskell the way it works with Python so as to create an environment for a specific version of Haskell, but such is not the case. Nor is it the case that Haskell's sandbox feature permits one to specify a version of base let alone Haskell itself.
PS: Frustratingly, the SE question "How to install an older version of base in Haskell" ended up answering another question without changing the title to reflect the question it did answer.
There is a tool that works even better then conda in Haskell called stack. Version of base is hardwired with version of ghc that is installed. You can get stack installed first and it will install version of the ghc you need automatically:
$ curl -sSL https://get.haskellstack.org/ | sh
This command will automatically install ghc-8.6.5, which is specified by lts-14.22 resolver and will make all packages available for you on demand including base
$ stack --resolver lts-14.22 ghci
To obtain the resolver specification:
Go to this table of all packages that come installed with a
particular GHC version.
If a desired base version is not available, find the scroll bar at
the bottom of the table and scroll to the right until you find one.
Say it is base-4.11.1.0, then look at the header of the column for
the ghc version that ships with this base.
In this example either one of this versions of ghc: 8.4.4, 8.4.3,
8.4.2 will have that version of base.
Go on the stackage.org home page and find in
the matching lastest resolver in the list "Latest LTS per GHC
version".
In this example, any lts-12 will do for the base above.
Latest nightly resolver will always have the newest ghc and base available on stackage.

Pyflakes "invalid syntax" and print function's variable in curly braces

I has Sublime Text 3 installed, SublimeLinter plugin and pyflakes linter.
In the pip pyflakes version is 1.6.0. OS win 7 x86.
my_name = 'Name'
print(f"My name is {my_name}.")
And here is the error:
SublimeLinter: pyflakes output:
ex3.py:9:30: invalid syntax
print(f"My name is {my_name}.")
^
Also, with this construction i have no errors:
print("My name is {}.".format(my_name))
Code is runing just fine, but why pyflakes gives me this error then? Is it pyflakes issue or what?
This is a known issue, see here:
https://gitlab.com/pycqa/flake8/issues/296
It seems to be fixed in current version...
Edit: Since you are on the latest version, maybe you are running into an issue of sublime-linter, like here:
https://forum.sublimetext.com/t/sublimelinter-pyflakes-not-matching-pyflakes-from-cli/31348/3
To test this, you could run the pyflakes command in the command line outside of sublime to see whether it works.
Edit2: As per the asker's comment, using SublimeLinter-flake8 instead of SublimeLinter-pyflakes is compatible with f-strings from python 3.6+.
(Also, sorry for the double posted answer. And thanks for deleting one, #Andy. I don't know what happened there.)
So, the best way is to use SublimeLinter-flake8 instead of SublimeLinter-pyflakes with python 3.6+, cause pyflakes linter is not compatable with 3.6 yet. Also flake8 do the same as pyflakes and much more.

only parts of pylucene are available?

i'm trying to port some Java Lucene code into pylucene (v 2.3.1). i'm
using the examples in
http://svn.apache.org/viewcvs.cgi/lucene/pylucene/trunk/samples/, and
most of pylucene seems to come into my python (ubuntu 12.04, pydev
2.6.0, eclipse 3.7.2) enviroment just fine. eg, i'm able execute
lucene.initVM() (showing JCC is in place) and to define a Porter
stemmer following the example taken from
.../samples/PorterStemmerAnalyzer.py via:
self.analyzer = PorterStemmerAnalyzer()
but when i try to create a new IndexWriter, it stumbles on the
last argument to its constructor:
self.writer = lucene.IndexWriter(self.store, self.analyzer, True, lucene.IndexWriter.MaxFieldLength.LIMITED)
i get this error:
AttributeError: type object 'IndexWriter' has no attribute 'MaxFieldLength'.
this is the error that has me stumped at the moment, but there are
several other hacks (from their version .../samples) i had also made
(but also worry about):
replace lucene.Version.LUCENE_CURRENT with lucene.LucenePackage
lucene.SimpleFSDirectory with lucene.MMapDirectory
in order to get this far.
http://lucene.apache.org/pylucene/features.html says "The PyLucene API
exposes all Java Lucene classes in a flat namespace in the PyLucene
module." this doesn't seem entirely right,
lucene.StopAnalyzer.ENGLISH_STOP_WORDS_SET is known to pydev while
lucene.ENGLISH_STOP_WORDS_SET is not.
so it seems i am getting part of/an old version of/...? pylucene
engaged correctly, but not all of it!? why might this be?
almost certainly the problem had to do with the most recent version of pylucene available as a .deb was 2.3.1 while pylucene is now at v. 3.6.1 !
making from the source distribution takes a bit of touch. the instructions from JohnW at
http://john.wesorick.com/2011/11/installing-pylucene-on-ubuntu-1110.html were helpful.
for what it's worth, here are the changes i wound up making, first to the JDK spec for linux2 in jcc/setup.py:
JDK = {
'darwin': JAVAHOME,
'ipod': '/usr/include/gcc',
'linux2': '/usr/lib/jvm/java-7-openjdk-amd64',
'sunos5': '/usr/jdk/instances/jdk1.6.0',
'win32': JAVAHOME,
'mingw32': JAVAHOME,
'freebsd7': '/usr/local/diablo-jdk1.6.0'
}
and then to the Makefile:
PREFIX_PYTHON=/usr
ANT=JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 /usr/bin/ant
PYTHON=$(PREFIX_PYTHON)/bin/python
JCC=$(PYTHON) -m jcc --shared
NUM_FILES=4
I used rikb's answer and it worked, but I had to change
'linux2': '/usr/lib/jvm/java-7-openjdk-amd64',
to...
'linux2': '/usr/lib/jvm/java-6-openjdk-amd64',
Since I'm using Java 6. It appears he is too, so perhaps he hasn't used that configuration on Linux.
Also note that if you copy and paste all or part rikb's block of stuff for the Makefile you will probably have trailing spaces on each line. Then the 'sudo make' step will fail, rather mysteriously, with a message like "make: execvp: /usr: Permission denied". This is because the trailing space after "PREFIX_PYTHON=/usr " caused make to try to execute the dir /usr.

Upgrade Mercurial installation to use a different version of Python

I have been banging on this for hours now.
I am trying to push my repo changes to kiln but I get this error:
certificate checking requires Python 2.6
I have already installed a parallel install of Python 2.6 by following the instructions from this link, but the error still persists. The system is ClearOS 5.2 by the way.
My first question is, will installing/upgrading mercurial break my existing install?
I tried to re-install following these intstructions link1 and [i lost the other link], but encountered another error.
Then I found this command debuginstall and here's the result:
[root#system mercurial-1.7.5]# hg debuginstall
Checking encoding (UTF-8)...
Checking installed modules (/usr/lib/python2.4/site-packages/mercurial)...
Checking templates...
Checking patch...
Checking commit editor...
Checking username...
no username supplied (see "hg help config")
(specify a username in your configuration file)
1 problems detected, please check your install!
My another question is, can I just change the existing hg's settings to just use the python26 which is already installed?
Thanks in advance!
Install your own python (of whatever version you need) to a separate directory (e.g.: /usr/local/python-2.7.2/) and then change the invocation of hg from #!/usr/bin/python to #!/usr/local/python-2.7.2/bin/python This way you don't disturb the existing/system installation, but you can use the version you want only where you need it. The only annoying part about this is dealing with two sets of libraries, since this is really maintaining two parallel installations. So if the 'extra' python needs libraries, you must install them manually using the invocation and paths of the extra installation. Sounds complicated, but if you only need it for one program, then you set it up once and it's good to go.

Resources