how to get top 5 semantic versions if you are using Semantic Versioning in a folder - semantic-versioning

I have a folder with lot of zip files based on semantic versions i want to get the top 5 versions and delete rest. I want to know how can i query the latest top 5 versions in a query
MyService- 1.0.2.5.zip
MyService- 1.0.2.6.zip
MyService- 1.0.2.7.zip
MyService- 2.0.0.63.zip
MyService- 2.0.0.64.zip
MyService- 2.0.0.65.zip
MyService- 2.0.0.66.zip and so on
MyService- 3.0.0.11.zip
MyService- 3.0.0.12.zip and so on
I want the top 5 or top 1 version is there any utility or function which gives me that abilitya

Searching the Google for SemVer C#, yields a couple of .NET libraries and other related information. The Google also list some Java libraries.
As for the algorithm, sort the list using the SemVer precedence semantics, specified in SemVer Specification #11, then pick the first N items in the list.

Related

What is this carbon,boron,argon , which is used for nodejs?

I am just curious, what is carbon, boron, argon which is used while describing versions of nodejs?
Actually Node.js provide code name for Long Term Support (LTS) versions.
It started from Argon (version 4.2.0 to 4.9.1). And then it went like Boron (6.9.0 to 6.16.0), Carbon(8.9.0 to 8.15.0) and Dubnium (10.13.0 to 10.15.0). Basically they name their LTS versions under Chemical elements.
Argon(Ar), Boron(B), Carbon(C) and Dubnium(Db).
They are the code names for the Nodejs versions (based on chemical names from the periodic table, names are taken alphabetically a, b, c ...), please check below link for more details,
https://nodejs.org/en/about/releases/
Now the second part,
Always try to use the stable and latest version (LTS) of Nodejs in production, currently, it is 12.18.3. But for experimenting you can go with the current version and play with new features.
With version 8+ you get async-await support of javascript in Nodejs
Don't bother with the previous version if you are starting new.
I don't know if I get your question right, but according to https://nodejs.org/en/blog/release/v8.9.0/, https://nodejs.org/en/blog/release/v6.9.0/, and https://nodejs.org/en/blog/release/v4.2.0/, these are the names of the releases.

Pharo dependency hell

I am trying to develop a simple project in Pharo, and I would like to add its dependencies in Metacello. My project depends on Glamour, Roassal and XMLSupport.
A way to cleanly install my project is to install the dependencies by hand first. Following the book Deep into Pharo one can do
Gofer new
smalltalkhubUser: 'Moose' project: 'Glamour';
package: 'ConfigurationOfGlamour';
load.
(Smalltalk at: #ConfigurationOfGlamour) perform: #loadDefault.
Gofer new smalltalkhubUser: 'ObjectProfile'
project: 'Roassal';
package: 'ConfigurationOfRoassal';
load.
(Smalltalk at: #ConfigurationOfRoassal) load.
Gofer new
squeaksource: 'XMLSupport';
package: 'ConfigurationOfXMLSupport';
load.
(Smalltalk at: #ConfigurationOfXMLSupport) perform: #loadDefault.
and then my project will work fine.
I have tried to create a ConfigurationOfMyProject using the Versionner, and I have added Glamour, Roassal and XMLSupport as dependencies, using the version that are currently installed in my image (2.6-snapshot, 1.430 and 1.2.1 respectively).
The problem is that I am not able to load my project using Metacello in a fresh image. The project loads fine, but whenever I try to load my classes I get method missing errors in Glamour. Moreover, it is apparent that something is different, because even the world menu has different entries.
I have tried other combinations of versions, including using the stable Glamour (2.1) but I have obtained more errors, including not even being able to open the project in the Versioner (it complains about a missing Roassal name).
What is the correct way to add these dependencies cleanly?
First of all I want to highlight that if configuration is in class ConfigurationOf<proj-name> you can load it as using #configuration message:
Gofer new
smalltalkhubUser: 'Moose' project: 'Glamour';
configuration;
load.
(Smalltalk at: #ConfigurationOfGlamour) perform: #loadDefault.
A I don't see your project, I can just suggest you to write configuration by hand. There is an easy tutorial called Dead simple intro to Metacello.
According to your description it should be something like:
baseline01: spec
<version: '0.1'>
spec for: #common do: [
spec blessing: #release.
spec repository: 'your repo url'.
spec
package: 'YourPackage' with: [
spec requires: #('Glamour' 'Roassal' 'XMLSupport') ].
"also maybe you have a couple of packages that depend on different projects"
spec project: 'Glamour' with: [
spec
className: 'ConfigurationOf Glamour';
repository: 'http://smalltalkhub.com/mc/Moose/Glamour/main';
version: #'2.6-snapshot' ].
spec project: 'Roassal' with: [
spec
className: 'ConfigurationOfRoassal';
repository: 'http://smalltalkhub.com/mc/ObjectProfile/Roassal/main';
version: #'1.430' ].
"and same for XMLSupport" ].
Also you can try to load #development versions, as I have an impression that projects like Roassal and Glamour have very outdated stable versions. Also please note that Roassal2 is actively developed and will replace original Roassal in Moose platform, maybe you want to consider using it.
I would seriously discourage writing configs by hand - that is the assembly code of Metacello ;) Unless you are working on cross-Smalltalk-platform projects with platform-specific code (e.g. code for Pharo 1.4 vs Squeak 4.5) - an area which hasn't been explored yet, Versionner is the tool for you. I have written dozens of configs with it and have yet to run into a roadblock.
When you say you added them as dependencies, did you just add them as projects in the "Dependent projects" pane?
If so, you also have to specify which of your project's packages depend on them. To do this, you select the relevant package of your project on the "Packages" pane.
Now, click on the edit button with the pencil icon that just became enabled. In the dialog that appears, click the green + button and add the external projects of interest.
It looks like you are trying this in an old version of Pharo?
Roassal has been superseded by Roassal2, and the support for XML is on smalltalkhub, split into ConfigurationOfXMLWriter and ConfigurationOfXMLParser, both in PharoExtras.
If you load the right groups from Glamour you don't need to describe the dependencies on Roassal, as Glamour already depends on Roassal(2). That explains your cyclic dependency.
You have also run into the problem we've recently talk about on the pharo mailing lists
that #stable is not a usable symbolic version name. In the Seaside/Magritte/Grease projects we've changed to using #'release3.1' style symbolic version names. That ensures that there is less of a ripple effect when progressing stable.
Snapshot versions should never be a dependency, they just describe what is loaded at the moment, and are basically not upgradable.
[edit]
Metacello by default tries to be smart about not installing older versions over newer. This works pretty well as long as things are not moved to different packages. So it's a bit of bad luck there that you ended up with a non-working combination.
Metacello support complex workflows, and different smalltalk projects (need to) use different workflows. It often takes some time to reach consensus on the best way to do things.
Roassal does not depend on Glamour, but you can create the cycle in your own configuration :)
Packages were moved from squeaksource to ss3 and smalltalkhub because the server had had stability problems. More recently, those problems seem to have been fixed. The xml support was split as it was noted that a lot of applications actually don't need both writing and reading of xml.
Once you have a working configuration, it might be a good idea to build and test it on the continuous integration server of pharo: http://ci.inria.fr/pharo-contribution
If not your actually application, at least the open source parts as used by you. That way the Pharo, Glamour & Roassal teams can know if a change they make breaks something.

How to find search/find npm packages [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 9 months ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
What ways are there to find npm packages?
Below is community maintained listing compiled from the answers below.
npm Specific
In console, npm search <keyword>
https://www.npmjs.org/
http://node-modules.com/ via https://stackoverflow.com/a/13593402
https://openbase.com/ via https://stackoverflow.com/a/66827908/2752520
Generic
https://github.com
https://libraries.io
Dead
http://browsenpm.org/ via https://stackoverflow.com/a/24338500
https://github.com/joyent/node/wiki/modules
http://toolbox.no.de/ aka http://nodetoolbox.com/
http://packagefinder1-enome.dotcloud.com/
http://eirikb.github.com/nipster/ via https://stackoverflow.com/a/10571033
https://nodejsmodules.org/ via https://stackoverflow.com/a/17821476
http://npmsearch.com/ via https://stackoverflow.com/a/34471018
npm search works pretty well:
npm search connect
npm view will show you the timestamp of each version and everthing else from package.json (including node version)
npm view connect
There's nipster too, based on npm + github rating.
Libraries.io is great for searching and filtering through NPM modules, you can also filter by license and keyword: https://libraries.io/search?platforms=NPM
For me the best site for this purpose is Openbase:
https://openbase.com/
By VERY far. It's stats and features are, AFAIK, unmatched by any other site.
https://npms.io is really nice, provides quality and maintenance stats too
npmsearch sorts the results by a combination of relevance and downloads. The command line version can be installed from npm:
[sudo] npm install -g npmsearch
disclamer: I am the author of npmsearch
node-modules allows you to personalize your results according to the modules that you have starred/followed on github
For a fast method available in your console, type:
npm search keyword
< Keyword > searches Title, Description, Author and Keywords of all packages.
Here's another one: https://npmaddict.com/
Not a search but daily list of New packages with at least 5 GitHub stars
https://nodejsmodules.org/ is one that lets you search, as well as browse by popularity
https://github.com/Enome/node-package-finder (Latest commit 26ff789 on 4 May 2012, should count as dead)
I personally use npmsearch.com
I'm not sure how it works internally but it usually gives the best results.
Just in case anyone comes across this question, I also created a tool to help people discover what npm packages other people are using:
http://www.npmdiscover.com
It's sad but npm search won't work for me on node version 6+.
A quick workaround is by doing a curl from the command line:
curl --fail -O https://www.npmjs.com/package/q-promise 2>&1 | grep '404'
If this command returns nothing then the module exist if it does return a 404 the name is available for you to use.
According to the NPMS (NPM Search) docs on how to perform a search query, you can use the following operators in the npmjs.com search bar:
Search Syntax
Description
scope:types
Show/filter results that belong to the #types scope
author:sindresorhus
Show/filter results in which sindresorhus is the author
maintainer:sindresorhus
Show/filter results in which sindresorhus is qualifier as a maintainer
keywords:gulpplugin
Show/filter results that have gulpplugin in the keywords (separate multiple keywords with commas, you may also exclude keywords e.g. -framework)
not:deprecated
Exclude deprecated packages from the results
not:unstable
Exclude packages whose version is < 1.0.0
not:insecure
Exclude packages that are insecure or have vulnerable dependencies (as per nsp)
is:deprecated
Show/filter is deprecated packages
is:unstable
Show/filter packages whose version is < 1.0.0
is:insecure
Show/filter packages that are insecure or have vulnerable dependencies (as per nsp)
boost-exact:false
Do not boost exact matches, defaults to true
score-effect:14
Set the effect that package scores have for the final search score, defaults to 15.3
quality-weight:1
Set the weight that quality has for the each package score, defaults to 1.95
popularity-weight:1
Set the weight that popularity has for the each package score, defaults to 3.3
maintenance-weight:1
Set the weight that the quality has for the each package score, defaults to 2.05
Further Reading
Searching for and choosing packages to download:
Find NPM packages by keywords and authors
npms / npms analyzer
NPM can feel overwhelming because it is the largest package registry! Sometimes, we need less or a more curated suggestions when looking...
This is why I built https://pkg.land
It helps you find similar packages on npm, e.g https://pkg.land/moment will suggest you dayjs, date-fns etc.
It's still in beta but I do intend to maintain and improve it over time.

Installshield 2011 - Problem Upgrading existing software with Version format 2009.727.1365

Using Installshield 2011, we're creating a major upgrade and having problems upgrading software with this Product Version format - 2009.727.1365. We keep getting the standard 'Installed software is newer than product to be installed' message. With IS 2011, the major version has to be less than 255, from what I can gather, and I think the old format we're using is breaking the check for upgrading.
I've created a test IS project upgrading from 1.00.0000 to 2.00.0000 with no issues, so I'm thinking the issue has to be related to the format of the product version already installed.
Is there a way to use InstallScript or something to compare our old format with the new one and then do an override?
Any help would be greatly appreciated. Thanks in advance!!
**I ended up using Christopher's reply in the link he provided below (Exceeding Version Limits). This seemed to handle the uninstallation of the existing product very well. Thanks again Guys!
It sounds as if you'll need to remove or modify the ISPreventDowngrade major-upgrade item, which is what detects and prevents this kind of version downgrade (and which is usually what one wants).
(Posted follow-up to question here, too: http://community.flexerasoftware.com/showthread.php?t=195076.)
Your ProductVersion property is invalid. The SDK says:
The value of the ProductVersion property is the version of the product in string format. This property is REQUIRED.
The format of the string is as follows:
major.minor.build
The first field is the major version and has a maximum value of 255. The second field is the minor version and has a maximum value of 255. The third field is called the build version or the update version and has a maximum value of 65,535.
I also recommend reading Exceeding Version Limits.
There are hacks to work around this if you understand how FindRelatedProducts and RemoveExistingProducts works.
Even though this is an older I'd like to add my two cents.
I am creating an Installshield 2012 Spring project and I had the same issue.
Our previous installers had a Product Version in the format 2005.xx.xxxx. Obviously this 2005 was an issue.
Instead of setting the ISACTIONPROP1 property to any value (as mentioned in http://community.flexerasoftware.com/showthread.php?195076-Old-Product-version-in-2009-727-1365-format).
I added a major upgrade item with the following values:
Product code of the old installers: xxx (enter yours here)
Minimum version: 2005.001.0001
Maximum version: 2005.255.65535
Version Range Inclusive (might be overkill)
With this, the system does allow the 2005.xxx.xxxx format here. It detected and removed the previous installation. For our newer installations we will use our "normal" versions:
5.008.0001
5.009.0001
...

Node INTL locale Collation

I'm working on a side project that involves sorting Japanese and Thai strings. When I was testing the sorting in client-side Javascript, I was able to use a.localeCompare(b, "languageCode") which worked. When I tried this same logic in Node, it did not work, because the Node INTL object is restricted to English as the default.
I want to customize my node build as described in the above link, and came across the ICU4C-data Node Module, which I understand contains a full set of ICU data. I've been playing around with different build flags, like the one specified by the (sparse) README: --icu-data-dir=node_modules/icu4c-data, to no avail - no matter which flags I set I cannot get the INTL Collator's compare function to give the expected results. Is there an obvious flag that I'm missing, or key assumption I have wrong?
Here are a few things important notes/resources:
The end goal is Thai & Japanese collation - if there's another approach using Node to implement this, I'm open to suggestions.
Collation must be done in Node
I'm going to be relying on Array.prototype.sort() - mainly looking for a comparator
Using Node 0.12, with ECMA support
My first time customizing a Node build (~1 month experience)
Install the full-icu package instead. It will give instructions on how to load the rest of the data.
Also note that future node versions should not require any configuration to pick up the new data, you can see #3460 if interested.
I need to fix the icu4c-data's readme to reflect this.

Resources