Prefer the default browser in openBrowser 🔥🦊

This fixes #1826
The problem is that if Chrome is currently running it doesn't matter that you have another browser set as your default, Chrome will be used.
I only noticed this recently as I haven't been running Chrome as much anymore and the script started opening Firefox by default. 🎉  🔥🦊
Testing
To test, use the following test script (from the README).
// openBrowser.test.js
var openBrowser = require('./openBrowser');

if (openBrowser('http://localhost:3000')) {
  console.log('The browser tab has been opened!');
}

node openBrowser.test.js
Before this change:

With Chrome running this would open up Chrome even if it is not the default browser
Chrome reuses the same tab on OS X, a nice feature!

After this change:

With Chrome running, but not set as the default, this opens the default (Firefox, Safari, Chrome Canary, or other)
With Chrome set as the default browser the tab reuse feature continues to work as before

Notes

I added wait: false to the options because it was causing the script to hang waiting on the browser process to exit, which is unlikely.  Here are the option notes from opn

Wait for the opened app to exit before fulfilling the promise. If false it's fulfilled immediately when opening the app.

I updated the README section slightly to remove an unneeded import

Hopefully async / await code is ok.  I saw it used in another place in the repo. ♻

Hopefully async / await code is ok. I saw it used in another place in the repo

We probably use it in our own end-to-end tests which get compiled. But I don’t think we can use it in Node environment yet because those files are not compiled.

Yep, just tested on node 6.9.1 (and the package.json asks for >= 6) and it doesn't work.  I was on node v8.
This will be a little more complicated without await.
I've got a Windows box, I'm just waiting for it to finish updating before I can try this out.

Why would it be more complicated without await? It seems like you await in the very beginning so you might as well remove both async and await. Unless I'm missing something.

Hmm, I'm not super excited by this though I understand the reasoning.
My reasoning: I prefer Firefox as my main browser, for browsing, but I do prefer Chrome for dev which is why I do have it open.
The optimal thing, which does not exists to my knowledge however is a way to set dev browser and browser browser (😉) separately.

Even with this change we will still support the BROWSER env.  Which allows you to do the following:
BROWSER=firefox yarn start
BROWSER=safari yarn start

Many people may prefer Chrome for developing over their default browser; why not just add BROWSER=firefox to your .env file so that it doesn't re-use chrome?

Picking this up from @clarkbw.

Many people may prefer Chrome for developing over their default browser; why not just add BROWSER=firefox to your .env file so that it doesn't re-use chrome?

I understand that we had one anecdote here in the comments that has 2 browsers. #1826 was filed from a user who asked to have his default browser honored. This change further hardens the opening script to work on machines without Chrome (if it is hard to imagine for you, think about emerging markets where users don't install all the browsers, users that avoid specific companies for privacy reasons, etc).

I'm closing this out as I'm not working on it anymore.  If someone else wants to pick this up they'll need to sign the CLA etc anyway in another PR.


Some experience with the project

The file attached is my thoughts based on some testings and overall experience of the project.
Great project and hopefully this helps a little bit.
Geeksay.pdf

Hii, I want to contribute for the above tasks, can you guide me through the process?


HOSTEDCP-934: [release-4.13] Validate PublishingStrategyMapping

cherry-pick of #2324

/lgtm

/approve


Organize Microsoft.Extensions.Localization

As we knew ResourceManagerStringLocalizer is the default StringLocalizer for localization in ASP.NET Core, but the needs for Pluralization or adding a new localizer such as POStringLocalizer required the namespace to be organize to have namespace per StringLocalizer, this is common in other ASP.NET Core repos such as Configuration, Security .. ect
IMHO it would be nice if we add resource management classes to Microsoft.Extensions.Localization.ResourceManager namespace, so each upcoming StringLocalizer will be placed to a separated namespace which makes the things more organized than what we have right now
I knew perhaps it's too late, but may be we can consider it for upcoming next release
/cc @Eilon

Hi @hishamco , if I understood correctly, is this a breaking change? If so, there usually has to be an extremely high value to the change to justify making a breaking change.
I agree there could be better ways to organize the namespaces, but, at this time I don't see a value that is high enough.
Can you share more info on this?

Yep it's a breaking change, that's why I suggest it would be suitable for 3.0.0, perhaps the main issue that we don't think about this, because we have only one resource provider which is ResourceManager, IMHO this will have great value if we planned to support POStringLocalizer which is asked a lot by the community, FYI this is already done in the past, but the PR is closed for unknown reason
So supporting POStringLocalizer and pluralization #17 #305 in 3.0.0 alongside with the namespaces organization will add a value, and makes me happy too 😄

Closing because there are no plans to implement this. Moving just a few types to a new namespace is just too small a change to make it worth doing a breaking change. We can add new types to new namespaces if there's enough to justify it.

As I said before it will have a good value if we support a new StringLocalizer


Flutter 2.0.1 stable channel

the Intl  0.17.0 code generator generates code that does not compile. (dart sdk: ">=2.12.0 <3.0.0") it seems that generated files are not null safe.
Error message:
Lib/generated/intl/messages_all.dart:34:14: Error: The value 'null' can't be returned from a function with return type 'MessageLookupByLibrary' because 'MessageLookupByLibrary' is not nullable.

'MessageLookupByLibrary' is from 'package:intl/message_lookup_by_library.dart' ('/C:/Users/jeanr/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/intl-0.17.0/lib/message_lookup_by_library.dart').
return null;

Also in the file l10n.dart the following errors are generated:

For the code S();:

Non-nullable instance field 'current' must be initialized. (not_initialized_non_nullable_instance_field at lib/generated/l10n.dart:16)

For the code static S current;

The non-nullable variable 'current' must be initialized. (not_initialized_non_nullable_variable at lib/generated/l10n.dart:18)

For the code return Localizations.of<S>(context, S);

A value of type 'S?' can't be returned from the method 'of' because it has a return type of 'S'. (return_of_invalid_type at lib/generated/l10n.dart:35)

Hi @jrcollin, @mrcsilva,
According to the generated code, I assume that these issues are related to the intl_utils package 😕.
If that is the case, you can solve this by upgrading the intl_utils package to the 2.1.0 version.
In case that you are using Flutter Intl extension for VS Code or Flutter Intl plugin for Android Studio, just upgrade them to the latest version.
Hope it helps!

Hi @lzoran,
Thanks for your help! After updating Flutter Intl plugin for Android Studio/IntelliJ the generation changed and error messages were gone.

Hi @lzoran,
Thanks a lot for your help, effectively it works. I am a little confused about which package does what..


Add NANOVDB_USE_SYNC_CUDA_MALLOC define to force sync CUDA malloc

In virtualized environments that slice up the GPU and share it between instances as vGPU's, GPU unified memory is usually disabled out of security considerations. Asynchronous CUDA malloc/free depends on GPU unified memory, so before, it was not possible to deploy and run NanoVDB code in such environments.
This commit adds macros CUDA_MALLOC and CUDA_FREE and replaces all CUDA alloc/free calls with these macros. CUDA_MALLOC and CUDA_FREE expand to asynchronous CUDA malloc & free if the following two conditions are met:

CUDA version needs to be >= 11.2 as this is the first version that supports cudaMallocAsync/cudaMallocFree
NANOVDB_USE_SYNC_CUDA_MALLOC needs to undefined

In all other cases, CUDA_MALLOC and CUDA_FREE expand to synchronous cudaMalloc/cudaFree.
Since NanoVDB is distributed as header-only, setting the NANOVDB_USE_SYNC_CUDA_MALLOC flag should be handled by the project's build system itself.

@kmuseth that was the first solution I tried, but it didn’t work, because the cudaMalloc and cudaFree would still be resolved to the CUDA ones and not the redefined ones from the NanoVDB header. Without any modification to our build I still got CUDA ‘not supported’ errors on allocations.
Maybe this can be worked around with some linker directives but that seems brittle and could require possible annoying changes to the build system of project that includes the NanoVDB headers.

This was on Linux by the way, so it’s interesting it did work on your side, I assume there could be some link differences between our builds. I could double check next week to verify again to be sure and to find out why.

@w0utert I think you're right so I changed my implementation by simply placing the definitions of a namespace (nanovdb). So in the end my solution looks very much like yours, except I define functions vs macros. Let me create a PR that includes this fix plus a ton of other (long overdue) improvements to NanoVDB. I'll point you the the relevant changes so you can validate that it does indeed work for you.
A warning, this new PR introduces new namespace in NanoVDB tools so your client code might need to be tweaked a bit :)

@kmuseth sounds good, that’s actually nicer than using macro’s! I will try your PR early next week and report back, but I’m pretty sure it will work.

@kmuseth
I tested the feature/nanovdb_v32.7 branch from your fork and it works on Linux as well, thanks!
-Wouter

@w0utert  excellent - so are you okay if we close this PR?

@kmuseth yes, you can close this PR!


YouTube: many related channels being searched, leading to recursion error

Checklist

[ ] I'm reporting a broken site support issue
[x ] I've verified that I'm running youtube-dl version 2020.11.29
[ x] I've checked that all provided URLs are alive and playable in a browser
[x ] I've checked that all URLs and arguments with special characters are properly quoted or escaped
[x ] I've searched the bugtracker for similar bug reports including closed ones
[ ] I've read bugs section in FAQ

Verbose log

PASTE VERBOSE LOG HERE

Description

Recently i noticed that additional channels were being downloaded that were not specified in my configuration file.  the time to processed my file also increased 5x.  I added the --playlist-end 30 to my file to try to help with this, and now i get a recursion error.  Has something changed where yt-dl now crawls related channels too?  Is there a setting to change this?
youtube recursion.txt

In new Youtube UI channel links point to Home tab that is downloaded. If you need to download another tab - pass the URL of that tab.

@dstftw thank you for the quick fix.
on a tangent, but related matter about time?  i've poured over the output file settings many times and have tried various options.  How does one use the playlist-index successfully without yt-dl searching all the videos of a channel.  I use playlist-reverse, dateafter now-30days, and it still has to look at every single video on the channel and decide to download or not.  I tried using playlist-end 30, but then the ids start at 30 (or whatever number used).
Is there a parameter i've missed to use?  I'm using this with Plex and always trying to guarantee a unique episode number in the filename:  --output '/workdir/%(uploader)s [%(channel_id)s]/%(playlist_index)s - %(title)s [%(id)s].%(ext)s'