Improve error message when Navigator.pop() is called accidentally

Description
This pull request just added error message that Navigator.pop may have called accidentally.
Related Issues
Fixes https://github.com/flutter/flutter/issues/50258
Tests

navigator_test.dart
Added a test to check the error message is showing properly.

Checklist
Before you create this PR, confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

[x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
[x] I signed the CLA.
[x] I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
[x] I read the Tree Hygiene wiki page, which explains my responsibilities.
[x] I updated/added relevant documentation (doc comments with ///).
[x] All existing and new tests are passing.
[x] The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
[x] I am willing to follow-up on review comments in a timely manner.

Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.

[x] No, no existing tests failed, so this is not a breaking change.
[ ] Yes, this is a breaking change.

@chunhtai I've updated the message, but I'm not very sure if this would be helpful to users. 🤔

@JuYeong0413 it does not looks it will add much information about the error, and i could not think of better message, because we cannot really tell what cause this assertion. I suggest we should instead try to catch this error in earlier stage and report the error there instead.

I was thinking about checking the _history.length when Navigator.pop() is called, and print the message there.
It's updated in https://github.com/flutter/flutter/pull/64409/commits/0fa3eb4c87b8ada4f122d58ba75681133569c8e2, but I couldn't find out how to check the debugPrint in the test. Is there any existing tests I could use an example to write the test about this?

@JuYeong0413 Do you still have plans to follow-up on this one?

@goderbauer Sorry for the delay. I would like to keep working on this, but I don't have time to look at this for a few weeks and I felt I need to study much more about Navigator to improve the error message.
I'll close this for now and re-open when I'm ready. Thanks for the ping :-)


[Protocol] Adjustments related to the PE direction in EPI sequences (DWI, fMRI, fieldmaps)

Importantly, we should check/change the gradient rise time depending on the PE direction to avoid warning messages from the scanner, which will prevent us from acquiring the data (issue with the field map in the RL PE direction on July 14th 2023) => Ideally, we should check the different PE variants during the next session to be able to run the whole protocol in the different configurations and prevent any discrepancy in the acquisitions from one session to the other, but also depending on the operator, so that we keep consistent between sessions/operators.
(from https://github.com/TheAxonLab/hcph-sops/issues/181#issuecomment-1719762301)

I believe this should be okay - maybe test one of the HCPh_{RL,LR} next week? @esavary @acionca

I think this is safe to close at this point of history. Please reopen if I'm wrong.


Implement OutputStructE and OutputStruct

Implemented OutputStructE and OutputStruct as per the this comment on PR 513.
Includes passing tests for both a single struct and a list of structs.
TestOutputStruct 2020-07-06T11:06:41-04:00 retry.go:72: terraform [init -upgrade=false]
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66: Running command terraform with args [init -upgrade=false]
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66: Initializing the backend...
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66: Terraform has been successfully initialized!
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66: You may now begin working with Terraform. Try running "terraform plan" to see
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66: any changes that are required for your infrastructure. All Terraform commands
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66: should now work.
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66: If you ever set or change modules or backend configuration for Terraform,
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66: rerun this command to reinitialize your working directory. If you forget, other
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66: commands will detect it and remind you to do so if necessary.
TestOutputStruct 2020-07-06T11:06:41-04:00 retry.go:72: terraform [get -update]
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66: Running command terraform with args [get -update]
TestOutputStruct 2020-07-06T11:06:41-04:00 retry.go:72: terraform [apply -input=false -auto-approve -lock=false]
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66: Running command terraform with args [apply -input=false -auto-approve -lock=false]
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66: Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66: Outputs:
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66: list_of_objects = [
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:   {
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:     "somebool" = true
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:     "somefloat" = 0.1
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:     "someint" = 1
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:     "somestring" = "two"
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:   },
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:   {
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:     "somebool" = false
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:     "somefloat" = 0.3
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:     "someint" = 4
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:     "somestring" = "five"
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:   },
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66: ]
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66: object = {
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:   "listmaps" = [
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:     {
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:       "five" = 5
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:       "six" = "six"
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:     },
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:   ]
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:   "liststrings" = [
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:     "seven",
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:     "eight",
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:     "nine",
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:   ]
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:   "somebool" = true
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:   "somefloat" = 0.1
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:   "someint" = 1
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:   "somemap" = {
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:     "four" = "four"
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:     "three" = 3
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:   }
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66:   "somestring" = "two"
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66: }
TestOutputStruct 2020-07-06T11:06:41-04:00 retry.go:72: terraform [output -no-color -json object]
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66: Running command terraform with args [output -no-color -json object]
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66: {"listmaps":[{"five":5,"six":"six"}],"liststrings":["seven","eight","nine"],"somebool":true,"somefloat":0.1,"someint":1,"somemap":{"four":"four","three":3},"somestring":"two"}
TestOutputStruct 2020-07-06T11:06:41-04:00 retry.go:72: terraform [output -no-color -json list_of_objects]
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66: Running command terraform with args [output -no-color -json list_of_objects]
TestOutputStruct 2020-07-06T11:06:41-04:00 logger.go:66: [{"somebool":true,"somefloat":0.1,"someint":1,"somestring":"two"},{"somebool":false,"somefloat":0.3,"someint":4,"somestring":"five"}]
PASS
ok      github.com/gruntwork-io/terratest/modules/terraform     0.475s

Thanks for the review! All changes applied!

Tests passed! Merging now.

https://github.com/gruntwork-io/terratest/releases/tag/v0.28.8


TokamakDOM subscribing GestureView to move/up listeners

          It might be better to have a single listener at the app level, with a Combine publisher that sends values to each subscribing `GestureView`.

The listeners also need to be removed at some point.
Originally posted by @carson-katri in https://github.com/TokamakUI/Tokamak/pull/538#discussion_r1299236455

Not sure if this is going to be viable solution after changes introduced here
https://github.com/shial4/Tokamak/pull/1

resolved in primary PR, closing this


Change default school from University of Maryland to University of Washington

This is under Person > Positions.

Good catch!
Sent from my iPhone

On Jul 4, 2018, at 5:51 PM, Aileen Zeng<EMAIL_ADDRESS>wrote:
This is under Person > Positions.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.


Task/68/long form

Codecov Report

Merging #71 (481cb15) into main (1e292f5) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #71   +/-   ##
=======================================
  Coverage   89.49%   89.49%
=======================================
  Files          14       14
  Lines         257      257
  Branches       29       29
=======================================
  Hits          230      230
  Misses         27       27

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1e292f5...481cb15. Read the comment docs.


Running Sugarizer from a web server without Sugarizer Server

Before v1.0, it was possible to run Sugarizer from a web server without Sugarizer Server.
It's no longer possible without an error.

A new "no Server mode" is now available (need at least https://github.com/llaske/sugarizer/commit/028f185e47e4fed34381a6a10193db6f45206f4d).
To run it:

Retrieve the Sugarizer latest dev branch on https://github.com/llaske/sugarizer/tree/dev
Change the value of constant.serverMode to true in js/constant.js (https://github.com/llaske/sugarizer/blob/dev/js/constant.js#L46)
Expose the content of the Sugarizer directory on a web server (Apache, nginx, ...)
Run if from a browser

In that mode Sugarizer consider that it always run locally - exactly like if it's used from file:/// - even when called remotely (with http://...).
Sugarizer should work like usual except:

No password is need to create a new user
Journal is stored locally (no server synchronization)
All Journal content is lost when the user do a Sugarizer logoff or clear its browser cache
No access to private/shared journal
No collaboration with other users
Impossible to connect to a remote Sugarizer server (except if localized on the same web server)

The "no Server mode" is nice because it don't need to set up node.js/MongoDB to run Sugarizer remotely. BTW the drawback is a limited experience for the user:

The user will lose all its work when the browser cache will be clear
It's not possible to user collaboration feature and presence

https://github.com/llaske/sugarizer/commit/dd3c58d56981e4dfa6d94601b95d7117a3bc9241


Update type hints in helpers.write_timdex_records_to_json

NOTE: reworking of PR https://github.com/MITLibraries/transmogrifier/pull/95 with convention branch name
Helpful background context
While onboarding and reading through the codebase to understand how it works, I found myself tripping on a variable name and type in the helpers.write_timdex_records_to_json function that the CLI calls.
It looks as though sometime last year, the Transformer class had an interator pattern introduced that slightly changed downstream types.  Instead of passing an iterator of records, an actual Transformer instance is passed, where calling next(transformer_instance) will produce a transformed record.
How can a reviewer manually see the effects of these changes?
No changes to functionality of code, just type hints.
Can confirm that all testing and linting passes:
make test
make lint

And, can confirm via built-in type hinting from an IDE that the types are correct:

Additional changes

syntax for isort linting updated
commit https://github.com/MITLibraries/transmogrifier/pull/96/commits/7254a081a10e9fb85345cde340c6ece195003c1a updates dependencies and reverts a workaround for click and mpy conflict

Developer

[X] All new ENV is documented in README
[X] Stakeholder approval has been confirmed (or is not needed)

Code Reviewer

[ ] The commit message is clear and follows our guidelines
(not just this pull request message)
[ ] There are appropriate tests covering any new functionality
[ ] The documentation has been updated or is unnecessary
[ ] The changes have been verified
[ ] New dependencies are appropriate or there were no changes

Includes new or updated dependencies?
NO

Resolves #92


[Bug]: Embedded video thumbnails not appearing in full page screenshots

Minimal, reproducible example
import puppeteer from 'puppeteer';

const browser = await puppeteer.launch({
    executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
    headless: true, // Run in headful mode
    args: ['--disable-features=site-per-process'],
  });

  //Go to any webpage with a video at the bottom/not at the top
  await page.goto('https://jobbuddytech.com', { waitUntil: 'networkidle0' });
  const screenshotBuffer = await page.screenshot({ fullPage: true });

  //Embedded thumbnail video not appearing

Background
I'm trying to take full page screenshots of websites. I want the screenshot to be as visually similar to what a user would see as possible. I am having trouble getting embedded video thumbnails to appear in the screenshot as they appear to the user. Usually it's just a blank box when using the fullPage: true option for the screenshot method (as above).
I've tried all kinds of awaits, but they don't make a difference. The only things I found to work were to programatically scroll, take screenshots, and stitch them back together. This results in some problems where sticky elements exist. And I've tried setting the viewport to the document.body.scrollHeight and doing a full page screenshot. This creates some strange looking screenshots in some of my examples (too long, repeated elements etc)
Please advise if there's a solution to this.
Expectation
I would expect the embedded video thumbnail to appear in screenshots as it does it a user viewing with a browser.
Reality
Where the embedded video thumbnail should be, is just blank
Puppeteer configuration file (if used)
No response
Puppeteer version
22.13.1
Node version
20
Package manager
npm
Package manager version
10.2.4
Operating system
macOS

I sometimes succeed with taking the screenshot after scrolling through the site slowly:
import puppeteer from 'puppeteer';

const browser = await puppeteer.launch({
    headless: false,
    channel: 'chrome-canary',
    defaultViewport: null
});

const page = await browser.newPage();

await page.goto('https://jobbuddytech.com', { waitUntil: 'networkidle0' });

for (let i = 0; i < 10; i++) {
  await page.mouse.wheel({deltaY: 400});
  await new Promise(resolve => setTimeout(resolve, 1000));
}

await page.evaluate(() => {
  window.scrollTo(0, 0)
});
await new Promise(resolve => setTimeout(resolve, 3000));

await page.screenshot({ fullPage: true, path: 'thumbnails.png' });

await browser.close()

In general, the site seems to be lazy loading content including the video preview so it might not available for screenshot taking. Also, I think there is another issue for long screenshots (I think Chrome limit is around 16k).
Also, it seems to work better with Firefox:

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch({
    headless: false,
    product: 'firefox',
    protocol: 'webDriverBiDi',
    defaultViewport: null
});

const page = await browser.newPage();

await page.goto('https://jobbuddytech.com', { waitUntil: 'networkidle0' });

for (let i = 0; i < 10; i++) {
  await page.mouse.wheel({deltaY: 400});
  await new Promise(resolve => setTimeout(resolve, 1000));
}

await page.evaluate(() => {
  window.scrollTo(0, 0)
});
await new Promise(resolve => setTimeout(resolve, 3000));

await page.screenshot({ fullPage: true, path: 'thumbnails.png' });

await browser.close()

Just tested this and it worked really nicely, thankyou so much! I was stuck on this for hours 😮💨 Would be really nice if this worked out the box, but happy to go with your suggestion for now. Thanks again

Just bumping this, would be really nice if this worked on chromium


Fix version warning for rcs

Fixes #653.

Closing as this solution is a bit too hacky and the workaround in 693 is good enough for now.


Add ADOPTERS.md file

This file will display users of Inspektor Gadget.

Thanks. The tests still fail but it is not related to this change, so I will merge.


add docker stats

Hello,
Nice work.
Could be very useful to have the docker stats of containers' resource usage statistics too !
(cf docker stats)
Regards,

Have you checked out the 0.8.0-beta tag? I added the stats endpoint in #135, planning to put out a new release soon.

Hmm very nice indeed !!
I do not know your roadmap, but some suggestions:

it is currently too hidden. Should probably be on top, or on the side of the containers page. At least a snapshot.
a global view of the stats of all containers or in a stats tab, with common scales to be comparable (using max amount of mem, 100%cpu and so on

Really really useful and slick, thanks

If it's a common use I'm definitely open to adding stats links on rows in the containers view.
Re: the global view, I think we're limited to the info we can get via the /info endpoint (docs). Generating stats even for a single container is pretty taxing on the daemon, I think we might kill it if we polled all running containers and compiled their stats.

About he global view, you could just lower the poll frequency. it does not have to be every second, could be every 15 0r 30s

Having some summary graphs to illustrate CPU / net / IO against different containers would be amazing (If I had the time I'd have a stab myself) - It would act as a lightweight topbeat/kibana alternative. Maybe a little off topic and a big milestone but I think using something like ajaxterm as a means to docker exec (as a lot of the time most people will use a shell like bash) would be cool

Reclassified as a need for some global stats about the containers.


adding a license

👋 @jonstacks - just adding an a license. You cool with MIT? I put you in the copyright, which I am not for sure about.

Hey @jonstacks really sweet project!
Would love to see this PR land.

Thanks @dustinsmith1024!


Where generated text is being stored?

hey are stored in the  samples folder. For example, the full directory could beexperiments/out/20200311/image_coco_rmc_vanilla_RSGAN_adam_bs64_sl20_sn0_dec0_ad-exp_npre150_nadv2000_ms1_hs256_nh2_ds5_dlr1e-4_glr1e-4_tem100_demb64_nrep64_hdim32_sd171/samples.


Watch an external folder

I'm wondering if that's possible to watch an external folder, because I use a shared folder between two node applications, when a file is changed inside the shared folder, the servers doens't restart.
Any way to achieve that? The three folders are at the same level.

This is possible, but it's a bit hacky. You'd need to make the --watchDirectory a parent directory of both of those and place the .foreverignore in there with complete paths. So in this setup:
my-apps/
  .foreverignore
  shared/
  app1/
  app2/

Your .foreverignore would then have to have:
shared/whatever
shared/something-else-ignored
app1/ignore-this-too
app2/and-ignore-this

Then you'd have to start forever as so:
cd my-apps
forever start app1/script.js -w --watchDirectory $PWD


Improve coverage test naming

https://github.com/apple/swift/pull/32434#pullrequestreview-432639714

cc @compnerd

@swift-ci please test

the windows failure here is from a diff test, known issue?

@compnerd Mind checking up on this one

@swift-ci please test Windows platform

windows failure looks unrelated 😬

The CI bots seem green, the build failure is:
 S:\jenkins\workspace\swift-PR-windows\lldb\source\Plugins\ExpressionParser\Swift\SwiftExpressionParser.cpp(1671,22): error: no matching function for call to 'performIRGeneration'
    auto GenModule = swift::performIRGeneration(
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~

CC: @JDevlieghere in case Jonas has ideas

@swift-ci please test

The CI bots seem green, the build failure is:
 S:\jenkins\workspace\swift-PR-windows\lldb\source\Plugins\ExpressionParser\Swift\SwiftExpressionParser.cpp(1671,22): error: no matching function for call to 'performIRGeneration'
    auto GenModule = swift::performIRGeneration(
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~

CC: @JDevlieghere in case Jonas has ideas

I think this was a race between PR from @hamishknight and @varungandhi-apple backporting the explicit std::string conversion.


[Runtime] In various enumTagSinglePayload functions, don't read getEx traInhabitantIndex or storeExtraInhabitant unless it actually has extra inhabitants.

This code would previously read off the end of the allocated metadata to fetch these values. This was usually harmless, as the value was never used in that case. However, on rare occasions the metadata would be right before unmapped memory, and this read would crash trying to access that unmapped memory.
rdar://problem/39866044

@swift-ci please test

Build failed
Swift Test Linux Platform
Git Sha - b964cde3dcee3057f8dc9290cd18ffcd40ea51f6

@swift-ci please test linux


Error On Create:  Binding to null instances is not allowed

I'm new to the Java world, so forgive me if this is a simple issue.  But, I'm running into the following error when I try to create an API from my swagger.json:
    $ ./aws-api-import.sh --create ./swagger.json
    2015-07-21 11:59:09,719 ERROR - Error importing API from Swagger
    com.google.inject.CreationException: Unable to create injector, see the following errors:

    1) Binding to null instances is not allowed. Use toProvider(Providers.of(null)) if this is your intended behaviour.
      at com.amazonaws.service.apigateway.importer.config.ApiImporterModule.configure(ApiImporterModule.java:44)

    1 error
        at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:466)
        at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:155)
        at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
        at com.google.inject.Guice.createInjector(Guice.java:96)
        at com.google.inject.Guice.createInjector(Guice.java:73)
        at com.google.inject.Guice.createInjector(Guice.java:62)
        at com.amazonaws.service.apigateway.importer.ApiImporterMain.execute(ApiImporterMain.java:91)
        at com.amazonaws.service.apigateway.importer.ApiImporterMain.main(ApiImporterMain.java:62)

Same error here, does it supports swagger 2.0 ?

Swagger 2.0 is supported. Do you have the aws cli installed and configured via 'aws configure'?

It should now fallback to a default region if the region is not configured by the CLI. Let me know if you have any other issues.

Yep, for the record I hadn't configured the aws-cli.
Thanks Ryan

Yes, I had configured aws cli with multiple profiles, and a default profile working.


Autotune: Modify test for correct meals announcement

see https://github.com/openaps/oref0/issues/1383
With current code uam data are always categorized as basal even if categorize-uam-as-basal is false (default setting)
I propose this modification to have autotune works as expected in documentation (there is a security warning in documentation for this setting...)

The description isn't quite correct: UAM data are categorized as basal for individuals who sometimes announce meals. For those doing full UAM all the time (what the UAM detection code was written for), they're unlikely to always get UAMs categorized as basal.
Per https://github.com/openaps/oref0/issues/1383#issuecomment-685291622, the current behavior is what we found to work best during development, for multiple individuals. If you want to propose a modification, we'll need to demonstrate across multiple people's Nightscout data that autotune correctly converges on realistic basals.

Ok, thank you for the answer.
I understand better the reason for the current code (maybe the log message and doc could be improved a little bit to be consistent with your answer ...).
If this has already been tested I close the PR

If you can think of any ways to improve the documentation or good comments or similar, I would really appreciate a pull request for those. That’s one of the hardest things to do as someone who is so close to the algorithms: figure out how to explain them to people who aren’t.

Ok, I'll try to propose some little improvements in log message (easier to do) or doc...
Today I'm still working on raw iob calculation for autotune in my androidAPS plugin, because I still not have same results than oref0 calculation :(
AutotuneCore is ok (exactly same results with 3 digits) but not autotunePrep due to getIOB(IOBInputs)[0] call (current functions in AAPS doesn't integrate a "currentBasal" average value as reference and I have difficulties to understand exact calculation algorithm in iob lib of oref0...)


Replace polyprism Cython code with pure numpy

Experimenting with this to see if I can at least match the speed with some clever math optimizations.
Checklist:

[ ] Make tests for new code (at least 80% coverage)
[ ] Create/update docstrings
[ ] Include relevant equations and citations in docstrings
[ ] Docstrings follow the style conventions
[ ] Code follows PEP8 style conventions
[ ] Code and docs have been spellchecked
[ ] Include new dependencies in doc/install.rst, environment.yml, ci/requirements-conda.txt and ci/requirements-pip.txt.
[ ] Documentation builds properly (run cd doc; make locally)
[ ] Changelog entry (leave for last to avoid conflicts)

Currently trying to optimize gz. Tried to replace two arctan2 calls with a single one using an identity. Doesn't work because the identity isn't always value. There don't seem to be any easy optimizations for this code but the numpy version seems to run just as fast as the Cython version.

gzz didn't yield any speedups but got the same speed as Cython version.

Combined 4 log calls in kernelxx into a single one. Benchmark results:
master
gxx: 1 loop, best of 3: 213 ms per loop
branch
gxx: 10 loops, best of 3: 153 ms per loop

Used same optimization for gyy (collapse logs).

Finished  optimizations (see results of benchmark in PR description).

@birocoles a bit of a heads-up on this PR. I've simplified some of your original code. Don't know if @leobvital is using the code for Fatiando or implemented his own, but this is much simpler to read now. The tests are also improved and I've learned how to use pytest better.

Very good @leouieda ! @leobvital is using the Fatiando code but I think that these changes will not affect his work.


Mention destroy method (added by #17067) in API docs

It was nice to be able to use the destroy method from #17067. However, there's no mention of its existence in the docs... so this PR updates the API methods section to let readers know that it's available.

Thanks!


Refactored a call header

@nickoneill I ran the app locally and made a issue request with a bogus issue id and I just get a bare-bones sidebar with no relevant message (see attached screenshot).

Not sure how this was working on my machine earlier, a couple runtime errors. Works now.


Upload image problem after Deployment

Hello dear Krysiak,
I have watched the upload image functionality video on Youtube a while ago and implemented which it works nice locally. but after deployment I get error for all edit and list components that I have provided.
the following pictures are the errors that I get in console log

"admin-bro": "^2.2.4",
"admin-bro-expressjs": "^2.0.5",
"admin-bro-mongoose": "^0.5.0",
Would be immensely grateful for any assistance.

I think I could find the problem
component.bundle.js respondes with a status of 500  ❗ ❗ ❗ ❗ ❗

in NODE_ENV=production (assume that this is your env setting after deployment), on run, admin tries to bundle components.bundle.js and write to .adminbro/bundle.js. Apparently this failed.
In order to debug this run admin locally in NODE_ENV set to production (remember after the run you will have to delete cached .adminro folder). You should see errors.
If not maybe you don't have access to write files in production. Then the simplest solution would be to simply bundle files before the deployment and add them to the repo.

PS: you can also use @admin-bro/upload feature which works with the latest version: https://itnext.io/the-easiest-and-fastest-way-to-upload-files-in-node-js-4b49e0123190

thanks, you're right I just change development to production in my NODE_ENV and now it works fine.


The social media icons in the footer might be improved

When a user visits a website, they typically want to interact with the owner, and social networking icons are a convenient way to do so; hence, they should be appealing.
To make it more appealing, I'll include hover functionality so that the icons change color as someone hovers over them.
Please assign this problem to me; I believe I can resolve it as a GSSOC'23 contributor.

please assign it to me.. i want to fix that

please assign this task to me

@akshitagupta15june Please assign this issue to me


Preloader added

What is the change?
I added a pre loader to the website.
Related issue?
closes: Add Preloader #105
Checklist:
Before you create this PR, confirm all the requirements listed below by checking the checkboxes [x]:

[x] I have followed the Code of Conduct.
[x] I have  checked there aren't other open Pull Requests for the same update/change.
[x] I have you tested the code before submission.
[x] I have commented my code, particularly in hard-to-understand areas.
[x] My changes generates no new warnings.
[x] I'm JWOC contributor.

Screenshots (if any)

I have added the animated pre loader @Chaitalishetty . If there is any issue please tell me.
Thank you

Also create a new branch while pushing to the repo so that you can branch out your code from main.

@sorba160 This looks good . But can you make the loader gif based on the theme of the website. Like you can do some animation with the logo or related to that.

Ok I am trying .

Also create a new branch while pushing to the repo so that you can branch out your code from I


add managed labels for copied secret and configmap

Although we add manage-by-secretshare: "true" for original secret before we copy its in to the target namespace, We did not get the latest updated secret from the client.
Therefore, the new generated secret in target namespace will not contain the label manage-by-secretshare: "true".
It leads to the case that when we delete the secret that is generated by secretshare, the deleted secret will not trigger the reconciliation of the controller due to the lack of label.

/cherry-pick release-eus


def tweak, mitotic spindle elongation

GO:0000022
Name	mitotic spindle elongation
Ontology	Biological Process
Definition	The cell cycle process in which the distance is lengthened between poles of the MITOTIC spindle. MITOTIC spindle elongation begins during MITOTIC prophase and ends during MITOTIC anaphase B.

Done, thanks.


Some NAS-DS01Z not recognized

Is your problem within Home Assistant (Core or Z-Wave JS Integration)?
NO, my problem is NOT within Home Assistant or the ZWave JS integration
Is your problem within ZWaveJS2MQTT?
NO, my problem is NOT within ZWaveJS2MQTT
Checklist

[X] I have checked the troubleshooting section and my problem is not described there.

[X] I have read the changelog and my problem was not mentioned there.

Describe the bug
I bought a batch of "Neo NAS-DS01Z" Door-Window-Sensors. All of them work just fine, but some are not recognized fully. I attached the debug log for an interview of Node 046, which is one of the sensors with the issue.
Device information
Adapter Version in iobroker: 2.2.0
Installed DB: 8.4.2-20210929
How are you using node-zwave-js?

[ ] zwavejs2mqtt Docker image (latest)
[ ] zwavejs2mqtt Docker image (dev)
[ ] zwavejs2mqtt Docker manually built (please specify branches)
[X] ioBroker.zwave2 adapter (please specify version)
[ ] HomeAssistant zwave_js integration  (please specify version)
[ ] pkg
[ ] node-red-contrib-zwave-js (please specify version, double click node to find out)
[ ] Manually built from GitHub (please specify branch)
[ ] Other (please describe)

Which branches or versions?
version:
node-zwave-js branch:
zwavejs2mqtt branch:
Did you change anything?
no
If yes, what did you change?
No response
Did this work before?
Don't know, this is a new device
If yes, where did it work?
No response
Attach Driver Logfile
zwavejs_2021-10-08.log

The device that isn't recognized has a fingerprint of
manufacturer id: 0x0258
product type:    0x0200
product id:      0x1022

which we don't have a configuration file for. Please fill out the following issue template and provide all information you have there:
https://github.com/zwave-js/node-zwave-js/issues/new?assignees=&labels=config+⚙&template=device_config.yml&title=Missing+device+configuration%3A+<enter+manufacturer+and+device+name>
Especially the manual (photo or PDF) with the config parameters would be helpful.


titan init overwrite idea

Hey guys :wave:
When I did titan init it blew away my package.json. It's not a problem as one should expect any init to write to a fresh directory. Maybe it could give a warning (y/n)? in the prompt.
Did you ever talk about that?

Fixed in commit https://github.com/titan-suite/cli/commit/aba19e7d077fd26a9852bafc2c2611ac7a80b775

Thank you @ToJen. I will try this later

v9.11.2


[tiered-storage]managedLedgerDataReadPriority may not work?

Describe the bug
from this PR's configuration #8717 Configurable data source for offloaded messages ,  we could set data read priority bookkeeper-first or tiered-storage-first by cli cmd or set managedLedgerDataReadPriority in broker.conf.
but seem it not work when i set managedLedgerDataReadPriority in broker.conf
To Reproduce
write a unit-test in ServiceConfigurationTest

set managedLedgerDataReadPriority=bookkeeper-first in configurations/pulsar_broker_test.conf
init serviceConfig and run test to create offloadPolicies by serviceConfig
check if offloadPolicies's ReadPriority equals to bookkeeper-first

Expected behavior
offloadPolicies's ReadPriority equals to bookkeeper-first  & the unit test pass
Screenshots
configurations/pulsar_broker_test.conf

unit test

unit test failed

Desktop (please complete the following information):

OS: local unit test

Additional context
Add any other context about the problem here.

Related PR https://github.com/apache/pulsar/pull/17803


[stable/jenkins] increase retries for sidecar reload

What this PR does / why we need it:
This is an attempt to fix ci build errors fro Jenkins chart.
I0614 18:14:07.070] [2020-06-14 18:14:04] Selected resource type: ('configmap',)
I0614 18:14:07.071] [2020-06-14 18:14:04] Config for cluster api loaded...
I0614 18:14:07.071] [2020-06-14 18:14:04] Unique filenames will not be enforced.
I0614 18:14:07.072] [2020-06-14 18:14:04] Working on configmap jenkins-presubmit-22641-1272230382288244742-i02ztn8t8l/jenkins-i02ztn8t8l-jenkins-jcasc-config
I0614 18:14:07.072] [2020-06-14 18:14:04] File in configmap jcasc-default-config.yaml ADDED
I0614 18:14:07.073] 2020-06-14 18:14:04,907 WARNING Retrying (Retry(total=4, connect=4, read=5, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fc06091ad10>: Failed to establish a new connection: [Errno 111] Connection refused')': /reload-configuration-as-code/?casc-reload-token=jenkins-i02ztn8t8l-85c5968964-vz5fq
I0614 18:14:07.073] 2020-06-14 18:14:05,308 WARNING Retrying (Retry(total=3, connect=3, read=5, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fc06092b3d0>: Failed to establish a new connection: [Errno 111] Connection refused')': /reload-configuration-as-code/?casc-reload-token=jenkins-i02ztn8t8l-85c5968964-vz5fq
I0614 18:14:07.074] 2020-06-14 18:14:06,109 WARNING Retrying (Retry(total=2, connect=2, read=5, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fc06092b8d0>: Failed to establish a new connection: [Errno 111] Connection refused')': /reload-configuration-as-code/?casc-reload-token=jenkins-i02ztn8t8l-85c5968964-vz5fq

As you can see from the logs the sidecar container is trying to send a reload configuration as code request, but Jenkins is not fully started yet. I am increasing the REQ_RETRY_CONNECT as documented in https://github.com/kiwigrid/k8s-sidecar.
Which issue this PR fixes
(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)

fixes #

Special notes for your reviewer:
Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

[x] DCO signed
[x] Chart Version bumped
[x] Title of the PR starts with chart name (e.g. [stable/mychartname])

/assign @wmcdona89

Ah...thanks for investigating and fixing!
/lgtm

/retest

@wmcdona89 Any idea why tests are failing?

/retest

The error is always:
I0615 09:13:39.525] E0615 09:13:39.506976     193 portforward.go:233] lost connection to pod
214
I0615 09:13:39.525] Error: transport is closing

Not sure where this is coming from. in one of the previous logs I wasn't sure if the init container had already finished. So I added some debug output.
This build was already killed before any of the init container output was shown:
https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/helm_charts/22787/pull-charts-e2e/1272456875333390339/
So it's probably a totally unrelated issue.

Testing infra was fixed, so last failure shouldn't happen again.
But version needs another bump first, since #22641 was just merged

Try retest after resolving merge conflict

@scottrigby Many thanks for fixing the test infra!!!

/lgtm


Make Topics collapsable or even better: drop down menu

Is your feature request related to a problem?
Thinking about people who might use this fantastic plugin with many topics, the sidebar would always have many links on top which are rarely clicked because I think topics are not changed that often.
This takes up a lot of space which could be resolved in two ways, how one may ask...?
Describe the solution you'd like
I can think of one rather easy to implement solution which would be nice already and another really cool solution (see below).
The first solution would make the topics collapsable, like Starlight sidebar groups can be collapsed. This would mean that if a user stays within one topic, they are neither distracted by other topics nor is the space in the sidebar wasted...
The maintainer could then choose if the want the topic section tk be collapsable with an configuration option because this feature is only necessary if many topics exist.
Describe alternatives you've considered
My second solution / thought would be really cool but harder to implement / it probably needs further discussion about the exact design choices.
I was thinking about hiding the topic selection in a drop down menu, so the user can select the topic once and then stays within the topic.
As an example for what I mean I can provide the following one: Shadcn/ui has a cleanly looking dropdown menu on this example page: https://ui.shadcn.com/examples/dashboard.
Look for the component that has the content "Alicia Koch" and click on it. That implementation is exactly what I envisioned for the topic selection for this plugin. But as I said, harder to implement and further discussion required...
The most ideal option imho would be that the maintainer can choose between all three modes (not collapsable, collapsable, dropdown menu). However, this is too good to be true (see below why)...
Additional Context
Because I maintain one single Starlight plugin myself, I kinda know how hard it is to make users wishes / feature request come true. I have to admit that implementing ideas from other users doesn't make fun as much as implementing my own stuff cause most of the time I don't see the reasoning behind those ideas.
While I manage one plugin and struggle already, Hideoo manages -- how many are there now? -- like 10 or something. In other words: I don't know how they are able to achieve so many great things. And that's the reason why I think that all three topic options are too good to be true. It's the same problem like in so many other open-source projects. Instead of creating something together, people are just asking the maintainer to add new stuff and even more new stuff without contributing themselves. And because I don't like that, this feature request is not a request really. It's just an idea, not meant to be implemented anytime soon...
In short: don't make HiDeoo work too hard, he already did more than enough for the whole Astro community!

wrong repo, idk why, sry...


ciao-cert: Rename signer flag for clarity

Previously the -server and -server-cert flag were used to indicate that
the certificate being generated would be either the signing certificate
or signed by the signing certificate. This change updates the flags to
be -anchor and -anchor-cert to separate the ssntp.SERVER role term from
the trust anchor term used in the same command and APIs.

The motivation for this is that I was incredibly confused by the term server when talking about the certificate and I thought there was some sort of relation between that and the ssntp role that was embedded in the certificate. Based on existing tests and my own findings that does not appear to be the case and I do not find other documents which contradict these. That being the case, simply renaming the options and a few functions/documentation avoids the possible confusion of these two distinct uses.
As an aside my findings are that the anchor doesn't need to be a specific role (it was largely hinted through documentation/use that the ssntp.SCHEDULER or ssntp.SERVER roles were supposed to be the anchor though). There doesn't seem to be any tests which contradict this finding and there are tests which have for example ssntp.AGENT role certificates as the trust anchor. If this is not supposed to happen then this change needs further refinement.

Coverage increased (+0.04%) to 64.892% when pulling 5695226ffdf05fe5cf1c0046cf30fec4aab8d284 on bryteise:cert-signer-rename into cc089c2ca1e9adbf3b6a5150806f0a98f47597a1 on 01org:master.

Coverage remained the same at 64.854% when pulling 5695226ffdf05fe5cf1c0046cf30fec4aab8d284 on bryteise:cert-signer-rename into cc089c2ca1e9adbf3b6a5150806f0a98f47597a1 on 01org:master.

+1 on the ansible part

Tested on SingleVM.


Fix for 3.1

I was able to get this functioning i 3.1 but in order to do it I needed to basically remove all of those init scripts that you have.
I did not fully understand how they were being used.
I would think that many of the objects that you have created need to be converted into GDS classes now so that they are registered globally.
I did not make a pull request because I was not sure what your approach to fixing this is.

I did use the DEV branch. I also noticed that there are a couple of PR's in the queue so I was not sure what you were doing with those as well.
I would love to help where I can.

PRs are mostly outdated, they were submitted at the same time I was doing same fixes myself. So I do plan to review them once again and maybe merge some code from them.
Right now I don't have that much time to spend on this project. So mostly it works like this: I get an issue, I fix it, add some more stuff. Maybe rewrite some code I don't like, first version was written so it just works.
I'll have a look at project state when I'll be at home. Do you use Discord, Telegram or ...? We can add each other so connection is smoother and faster.
Best.

So I took a look at the project and was astonished. I made several dozen changes and and forgot about them. I'll review them if they are at least something close to ready and push them soon.

I cant get this to work in 3.1.
Right now I'm seeing line 22 on CommandBuilder.gd saying "Identifier Callback is not declared in the current scope".

It should be all fixed. Closing for now.


KYLIN-3094 Upgrade zookeeper version from 3.4.8 to 3.4.12

Can one of the admins verify this patch?

Codecov Report

Merging #151 into master will increase coverage by <.01%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##             master     #151      +/-   ##
============================================
+ Coverage     22.14%   22.14%   +<.01%
  Complexity     4020     4020
============================================
  Files          1012     1012
  Lines         61207    61207
  Branches       8768     8768
============================================
+ Hits          13554    13555       +1
  Misses        46413    46413
+ Partials       1240     1239       -1

Impacted Files
Coverage Δ
Complexity Δ

...lin/dict/lookup/cache/RocksDBLookupTableCache.java
76.68% <0%> (+0.51%)
27% <0%> (ø)
:arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9fa82a4...6868483. Read the comment docs.

Pull Request Test Coverage Report for Build 3212

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 24.174%

Totals

Change from base Build 3210:
0.0%

Covered Lines:
14796

Relevant Lines:
61207

💛  - Coveralls


Fuse Bundle size issue

Describe the bug
 A clear and concise description of what the bug is.
if you visit<EMAIL_ADDRESS>the
Version
 The Fuse.js version where this bug is happening.
0.4.0
Is this a regression?
no
🔬Minimal Reproduction
go to<EMAIL_ADDRESS>Additional context

JShint is taking 30% of the bundle size and underscore is also over represented.

The linked version 0.4.0 was 119.1kB/39.4kB, but the current version 6.6.2 is only 15.4kB/5.1kB, with no dependencies.
I suppose this issue could be closed now?


For rejected promises that were expected to be fulfilled, log the error that was thrown

  1) my project's component A should do something asynchronous:
     AssertionError: expected promise to be fulfilled but it was rejected with { Object (type, filename, ...) }

  2) my project's component B should do another asynchronous thing:
     AssertionError: expected promise to be fulfilled but it was rejected with { Object (type, filename, ...) }

It would be great if those printed the entire error object, just like when I add the catch block to my code to debug:
.then (data) -> doStuff data
.catch (error) -> console.log error

Apologies if this has been discussed already / is implemented and I just can't find it on the docs.

(@domenic this looks to be the same kind of issue as domenic/sinon-chai#67).
From a quick glance, I think we could get this diffing properly by just passing true as an additional argument into assertion.assert on lines 76 and 80. I'm not sure if any extra work is involved - but I'd say @JaKXz if you're up for making a PR, give that a go and see if it does what you want :smile:.

@keithamus I tried that locally - passing in true for the Assertion.prototype.assert method's showDiff parameter, but it didn't seem to work :(
        // These are for clarity and to bypass Chai refusing to allow `undefined` as actual when used with `assert`.
        function assertIfNegated(assertion, message, extra) {
            assertion.assert(true, null, message, extra.expected, extra.actual, true);
        }

        function assertIfNotNegated(assertion, message, extra) {
            assertion.assert(false, message, null, extra.expected, extra.actual, true);
        }

I also noticed that config API has showDiff set to true already, and I don't think I've changed it anywhere in my project, so unless my understanding of the "diff" message is wrong, I think there might be more work involved? Not 100% sure, will keep poking around.

@JaKXz it's worth reading domenic/sinon-chai#67 as it offers a bit more context about the showDiff behaviour. If diffs aren't showing with true passed, then it could be that the reporter you're using doesn't output diffs. Which test runner and reporter are you using?

I also have this problem using cucumber.js.
During testing to see if it was cucumber.js or chai-as-promised, I had two test cases:
In one test case, I simply returned a rejected promise to cucumber.js with an Error instance. This was automatically printed to the output using the toString() method of the error instance, which I verified was called on my error instance by overriding its toString. Which is what I want, the full output of the error.
In the other test case, I used chai-as-promised like so: expect(thePromise).to.eventually.be.fulfilled. In this case what I get is the type of output shown in the original issue description.

I'm rolling up all bugs in the category "isRejected/rejectedWith doesn't behave like Chai's error rejectors" into #166.


Add ironiapi tests

/test ironic-operator-build-deploy-kuttl
/test ironic-operator-build-deploy-tempest
Issue with RPM repos, not related to this change:
Errors during downloading metadata for repository 'localdev-rhel-8-server-ose-rpms'
https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/pr-logs/pull/openstack-k8s-operators_ironic-operator/313/pull-ci-openstack-k8s-operators-ironic-operator-main-ironic-operator-build-deploy-kuttl/1687425423689912320/artifacts/build-logs/openstack-operator-ci-build-deploy-kuttl.log

/approve


Merge over https://github.com/soler91/noita-together/pull/99

merged via 933b25588e0d7b95e1134882389f798da1202d69


Document which installation method is best

In docs/installation.rst, we should make it clear that pip installing the most recent stable release is the preferred way to install the package.

Doing this.


js file is too large

why field.js is too large ? nova is too slow with it

I believe it's because it loads all of the FontAwesome icons.
I don't maintain this anymore i'm afraid. You're welcome to make any changes and i will merge them in.


GitHub Workflows: add --use-new-run to kaniko

Describe your changes
Let's see if it could help us:

Use the experimental run implementation for detecting changes without requiring file system snapshots. In some cases, this may improve build performance by 75%.

https://github.com/GoogleContainerTools/kaniko#flag---use-new-run
Issue ticket number and link
Checklist before requesting a review

[ ] I have performed a self-review of my code.
[ ] If it is a core feature, I have added thorough tests.
[ ] Do we need to implement analytics? if so did you add the relevant metrics to the dashboard?
[ ] If this PR requires public announcement, mark it with /release-notes label and add several sentences in this section.

Checklist before merging

[ ] Do not forget to reformat commit message to not include the above checklist

No significant improvement in speed here


Helper function for defining differentiable solves.

custom_implicit_solve is a helper function designed help library authors (most notably for jax.scipy.optimize) define derivatives for functions that perform an implicit solve.
See the tests for an example of intended usage, defining a differentiable version of binary search.
This will start to become actually useful once we define some (differentiable) functions for matrix-free linear solves.

Actually, I need to revise what I said in that last parenthetical: I think custom_transforms will check for and raise an error if it sees closed-over differentiated values, but to handle them we need the JVP rule signature to change. That might take more thinking!

With help from @dougalm, there are real issues with func having closed-over traces here, and that won't be caught anywhere. We might need to write this in terms of more core APIs to handle that  case. To handle differentiation of a higher-order function, we need to do stuff like in lax_control_flow.py. :/
Want to land and iterate, or brainstorm more?

Well, we definitely shouldn't merge it yet since the math is wrong :).
Let me try to fix that first, then let's brainstorm how to get it fully working.

Math should be fixed now if you want to take another look.

Nice! I admit I didn't check the math before; usually I put my faith in numerical checks, but I guess the first time it got fooled.
If we put this in api.py, we should prefix this name with an underscore for now. Adding things to api.py is expensive, in that it defines the least-likely-to-break/disappear part of the API, and I realized later that this is going to take more work to make airtight. The reason is that we'll need to make some significant revisions to make differentiation work when func or solve close over traced values (e.g. values with respect to which we're differentiating). That's likely not a quick fix, and I'd have to think about how exactly to do it, but it'll probably end up looking something like what we do in lax_control_flow.py. (We should probably also add a warning to the docstring that this doesn't handle closed-over values in func or solve.)
Another option is to put this in jax.experimental.
Overall, though, I like the idea of landing this so we can iterate on it, since it already handles some useful cases and also defines a great API.
What do you think?
That was the main content of this follow-up review. This latter part is just a comment on math notation: I'd write the notation differently, because IMO "total derivatives" are just an obfuscation of the functions being differentiated. I'd also write the derivatives in terms of positional arguments rather than names, and avoid introducing x in addition to u and m. I'd write it like
F(u(m), m) = 0  # system of equations in m
∂_0 F(u(m), m) ∂ u(m) + ∂_1 F(u(m), m) = 0
∂ u(m) = - ∂_0 F(u*, m)^{-1} ∂_1 F(u*, m)

Now we have an expression for the Jacobian of the solution map u(m), and so we can write down a VJP or a JVP pretty easily just by contracting on the left or right by a vector.
That's just a difference in notation though: the result, and the underlying meaning of the expressions, is the same.

Here's how I'm inclined to write things down the math:
      # F(u(m), m) = 0  # system of equations in m
      # ∂/∂m F(u(m), m) = 0
      # ∂F/∂u ∂u/∂m + ∂F/∂m = 0
      # ∂u/∂m = -(∂F/∂u)^{-1} ∂F/∂m

I agree that it's better to write down a derivation for the Jacobian rather than the JVP.
It was not clear to me what the notation ∂ u(m) means. It took me a while to figure out from context that it means the partial derivatives with respect to all arguments.
The notation ∂_0 also looks a little strange to me, though the main reason I don't like it is that it requires always explicitly requiring out F(u, m) which I think slightly obfuscates the (simple) math.
Also, if we use positional notation for partial derivatives, we should probably  rewrite F(m, u(m)) or change the interface to expect func(solution, params), because otherwise it will be confusing that the code uses the opposite indexing notation. Actually, maybe this worth making consistent anyways -- I am inclined to switch to func(solution, params) since F(m, u(m)) looks a little funny to me.

As for its provenance, that derivative notation is what we use in the Autodiff Cookbook, and it models JAX and Autograd's own differentiation API too. I got it from Spivak's Calculs on Manifolds, also used in Functional Differential Geometry and The Structure and Interpretation of Classical Mechanics; the latter is what I linked in my comment, though the Prologue section of the free Functional Differential Geometry is probably even clearer in explaining why the notation is good. I find that notation to be the simplest, but certainly opinions on notation can differ, and I can't give a better defense than in SICM! I just wanted to offer an alternative. (By the way, something unfortunate about what you wrote is that ∂/∂m F(u(m), m) and ∂F/∂m mean different things! In what I wrote, there's only one thing going on: differentiation of functions.)
The notation isn't too important though, since we agree on the underlying math!
To clarify my comments about the code: there are several kinds of issues here that can crop up here when the functions involved close over values involved in differentiation. All the ones that custom_transforms can possibly catch lead to explicit error messages, but some can't be. In particular, if the only traced values are in the closure of func, there's no way for JAX to see them.
This closure problem involving higher-order primitives (i.e. primitives that take functions as arguments) is one we're familiar with, and one that we have two ways to solve: one is how we solve it with jit (which is a wrapper around the primitive xla_call, which takes a function argument) and the other is how we solve it in lax_control_flow.py. That latter approach also underlies how custom_transforms itself works. We'd probably want to use that technique again here.

I'm happy to differ to you on notation, you've assuredly spent more time thinking about this than I have :)
This should be ready to merge now, assuming tests pass. Note that I swapped the expected order of the arguments to func to func(solution, params) to match the math.

Excellent, thanks for this! Looking forward to following up on Thursday (and maybe on chat even sooner). In the meantime I'll try to land the no-more-tuples branch, which might make handling closures properly marginally easier.


Smaller vs bigger PRs for few updates.

I have few updates like some refactoring, more tests and more browser detections. Would you prefer separate pull requests for each of these (and each added browser) or you'd be fine having a bigger pull request with everything?

I'm fine with both, thanks


multi: fix input pkscript construction, add round trip spend test

Spun off of #159.
Fixes multiple issues that caused round-trip (minter->receiver->minter) spends to fail:

The input TaroCommitment tree was being mutated when computing new TaroCommitments.
The input TaroCommitment tree includes asset leaves with SplitCommitments populated, which does not match the tree used for the actual transfer TX.

For the receiver to spend back to the minter, they need to recompute the pkScript used in the anchor output. Both of these issues caused the pkScript to be computed incorrectly in inputAnchorPkScript(). The mismatched pkScript caused transaction broadcast to fail.
The new itest includes a round-trip spend to test this fix.

Rebased!


[npm] Update both dependencies and devDependencies

Allow the ability to check and update both npm dependencies and devDependencies.
Currently I see the option to only update either npm dependencies or devDependencies, but not both.
Current dependabot config.
version: 2
updates:
  - package-ecosystem: 'npm'
    directory: '/'
    schedule:
      interval: 'daily'
    allow:
      - dependency-type: 'direct'
    open-pull-requests-limit: 15

Using link as reference

@Clumsy-Coder direct should pick from both dependencies and devDependencies. Are you saying that's not the case with your repo?

It seemed that way at first. Will it still update dependencies and devDependencies if dependency-type: 'direct' was not present?

Yes, it would. From your reference:

By default all dependencies that are explicitly defined in a manifest or lock file are kept up to date.

Ok. I finally see the dependencies and devDependencies update pull requests.
It showed up pretty late. I'm guessing dependencies take priority.
Closing issue


Error trying to install Bot Framework Channel Emulator

PLATFORM VERSION INFO
Windows 			: 10.0.10586.0 (Win32NT)
Common Language Runtime 	: 4.0.30319.42000
System.Deployment.dll 		: 4.6.1078.0 built by: NETFXREL3STAGE
clr.dll 			: 4.6.1080.0 built by: NETFXREL3STAGE
dfdll.dll 			: 4.6.1038.0 built by: NETFXREL2
dfshim.dll 			: 10.0.10586.0 (th2_release.151029-1700)
SOURCES
Deployment url			: http://download.botframework.com/bf-v3/tools/emulator/Bot Framework Channel Emulator.application
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of http://download.botframework.com/bf-v3/tools/emulator/Bot Framework Channel Emulator.application resulted in exception. Following failure messages were detected:
+ Exception reading manifest from http://download.botframework.com/bf-v3/tools/emulator/Bot Framework Channel Emulator.application: the manifest may not be valid or the file could not be opened.
+ DTD is prohibited in this XML document.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [9/22/2016 9:40:54 AM] : Activation of http://download.botframework.com/bf-v3/tools/emulator/Bot Framework Channel Emulator.application has started.
ERROR DETAILS
Following errors were detected during this operation.
* [9/22/2016 9:40:55 AM] System.Deployment.Application.InvalidDeploymentException (ManifestParse)
- Exception reading manifest from http://download.botframework.com/bf-v3/tools/emulator/Bot Framework Channel Emulator.application: the manifest may not be valid or the file could not be opened.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirectBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Xml.XmlException
- DTD is prohibited in this XML document.
- Source: System.Xml
- Stack trace:
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ParseDoctypeDecl()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Deployment.Application.ManifestValidatingReader.XmlFilteredReader.Read()
at System.Xml.XsdValidatingReader.Read()
at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.

@jockorob  it looks like the most common problem related to this type of error is that the manifest doesn't get downloaded for some reason. I'm seeing that the install path we provide is http, but the server enforces https via internal redirect, and I'm wondering if somehow that could be an issue in some situations.
are you behind a firewall? if yes can you try from another location?
what browser are you doing this from? with what add ons? can you try changing browser?

@jockorob are you still having this issue?

No it just got it resolved.  I am behind a firewall.  Originally, I had white listed https://download.botframework.com:443 but not http://download.botframework.com/.  Once I got the IT guy to white list the second link as well it worked.  Thanks for the help.

Great, thanks for confirming!


Cannot select a blob and its snapshot at the same time by pressing 'Ctrl+click' to select the second item

Storage Explorer Version: 1.24.0-dev
Build Number: 20220407.3
Branch: main
Platform/OS: Windows 10/Linux Ubuntu 20.04/MacOS Monterey 12.3 (Apple M1 Pro)
Architecture ia32\x64
How Found: From running test cases
Regression From: Previous release (1.23.0)
Steps to Reproduce

Expand one ADLS Gen2 storage account -> Blob Containers.
Select one blob container which contains blobs.
Select one blob -> Create a snapshot for it -> Switch to snapshot view.
Select the blob snapshot -> Press 'Ctrl' -> Click the blob.
Check whether both the blob and the snapshot are selected.

Expected Experience
Both the blob and the snapshot are selected.
Actual Experience
No item is selected.

Verified this issue on the build main/20220414.17. Fixed.


Talking Character: Getting HTTP 403 for staging-sanbox bison API, but can't activate it from console - getting "Failed to load"

Talking Character: Getting a 403 error that can't be fixed from console for the chat bison staging-sandbox API:
HTTP request: https://autopush-generativelanguage.sandbox.googleapis.com/v1beta1/models/chat-bison-001:generateMessage?key=
HTTP response 403:
{
"error": {
"code": 403,
"message": "Generative Language API (Staging) has not been used in project  before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/staging-generativelanguage.sandbox.googleapis.com/overview?project= then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"status": "PERMISSION_DENIED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.Help",
"links": [
{
"description": "Google developers console API activation",
"url": "https://console.developers.google.com/apis/api/staging-generativelanguage.sandbox.googleapis.com/overview?project="
}
]
},
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "SERVICE_DISABLED",
"domain": "googleapis.com",
"metadata": {
"consumer": "projects/",
"service": "staging-generativelanguage.sandbox.googleapis.com"
}
}
]
}
}
When visiting the suggested staging-sandbox URL - Getting the following console error:
Failed to load.
There was an error while loading /apis/library/staging-generativelanguage.sandbox.googleapis.com?project=. Please try again.
It may be a browser or network issue. Go to the loading issues help page  to troubleshoot the issue.

Can you try updating the base URL in constants.ts to see if that helps? I'm not an owner of this project but those URLs won't be publicly accessible, so you can try the new base URL I've proposed in https://github.com/google/generative-ai-docs/pull/87. Let me know if that works.

Should be fixed by: https://github.com/google/generative-ai-docs/pull/87


What is the method can be used to send an event from native module to JS？

According to React Native documentation, you can use sendAppEventWithName to send an event from native code to JS. But in my XCode, code suggestions tell me that this method is deprecated.

This issue indicates that sendDeviceEventWithName should work but actually it's also deprecated.
What is the proper way to send an event to JS?

I figured it out by reading its source code. Using the RCTEventEmitter class.
MyModule.h
#import "RCTEventEmitter.h"
#import "RCTBridgeModule.h"

@interface MyModule : RCTEventEmitter <RCTBridgeModule>

@end

MyModule.m
@implementation MyModule

RCT_EXPORT_MODULE();

- (void)tellJS () {
  [sendEventWithName:@"sayHello" body:@"Hello"];
}

@end

So you can send an event called sayHello with data Hello to JavaScript by calling the tellJS method.
In JavaScript side, you have to use the NativeModules module to get this native module and wrap it in NativeEventEmitter class so that you can receive events.
import { NativeModules, NativeEventEmitter } from 'react-native'

const myModuleEvt = new NativeEventEmitter(NativeModules.MyModule)
myModuleEvt.addListener('sayHello', (data) => console.log(data))

@livoras
First issue, shouldn't:
 [sendEventWithName:@"sayHello" body:@"Hello"];

Be:
 [self sendEventWithName:@"sayHello" body:@"Hello"];

Second issue: RCTEventEmitter.m is throwing an error:
- (void)sendEventWithName:(NSString *)eventName body:(id)body
{
  RCTAssert(_bridge != nil, @"bridge is not set. This is probably because you've "
            "explicitly synthesized the bridge in %@, even though it's inherited "
            "from RCTEventEmitter.", [self class]);

  if (RCT_DEBUG && ![[self supportedEvents] containsObject:eventName]) {
    RCTLogError(@"`%@` is not a supported event type for<EMAIL_ADDRESS>Supported events are: `%@`",
                eventName, [self class], [[self supportedEvents] componentsJoinedByString:@"`, `"]);
  }
  if (_listenerCount > 0) {
    [_bridge<EMAIL_ADDRESS>                      args:body ? @[eventName, body] : @[eventName]];
  } else {
    RCTLogWarn(@"Sending `%@` with no listeners registered.", eventName);
  }
}

_bridge is nil and it's throwing an exception. Should we open another ticket on fixing the documentation on the proper way to do this? I think it's still not fully clear.

I  have the same problem, the bridge is nil. Have you resolve it? @joekim

@purplepeng I ended up just creating a native module and using callbacks instead. Haven't tested it again recently.

I got it to work in swift... here is the snippets
// in my module...
@objc(YourModule)
class YourModule: RCTEventEmitter {

  override func supportedEvents() -> [String]! {
    return ["UploadProgress"]
  }

further down in the class
    // A progress event occurred, notify the user...
    uploadTask.observeStatus(.Progress) { (snapshot:FIRStorageTaskSnapshot) in

      if let progress = snapshot.progress {

        let percentComplete =  Double(progress.completedUnitCount) / Double(fs)

        let ret : [String:AnyObject] = [
          "completedUnitCount": String(progress.completedUnitCount),
          "percentComplete": String(percentComplete),
          "totalUnitCount": String(fs)
        ]

        self.sendEventWithName("UploadProgress", body: ret )
      }
    }

In my react-native code
    const myModuleEvt = new NativeEventEmitter(NativeModules.YourModule)
    var subscription = myModuleEvt.addListener(
      'UploadProgress',
      (progress) => {
        console.log("UploadProgress")
        console.log(JSON.stringify(progress, null, 2))
      }
    );

@joekim @aaronksaunders @livoras  Thank you. It works for me. I realized the process of sent event from native to JS in two separate module before, so it doesn't work.

so , the start of 'send event from iOS to javascript' is still javascript,am i right? 3Q

what about android?  this seems to create module scoped events, but how do we do this in android?

@purplepeng can you explain what you meant by "I realized the process of sent event from native to JS in two separate module before, so it doesn't work."
I am trying to send an event to JS and keep seeing the error that the bridge is not set.

@aaronksaunders thanks for tip but how to deal a viewmanager in the same time?
@objc(RNAnalogClockSwift)
class RNAnalogClockManager: RCTViewManager, RCTEventEmitter {

throws: Multiple inheritance from classes 'RCTViewManager' and 'RCTEventEmitter'

Sorry, I'm a bit confused how to deal sending event since this deprecation.
Previous way was far easier to figure out and implement.

@andybangs
I have resolved the problem with following code.
#import "RCTBridgeModule.h"
#import "RCTEventEmitter.h"

@interface RCTUserManager : RCTEventEmitter <RCTBridgeModule>
@end

@implementation RCTUserManager

RCT_EXPORT_MODULE();

- (NSArray<NSString *> *)supportedEvents
{
  return @[AuthorizationWasFailedNotification,AuthorizationWasSucceedNotification,AuthorizationWasInvalidNotification,AuthorizationWasCancelledNotification];
}

RCT_EXPORT_METHOD(signinWithUserName:(NSString *)userName
                  password:(NSString *)password
                  resolver:(RCTPromiseResolveBlock)resolve
                  rejecter:(RCTPromiseRejectBlock)reject)
{
  [self.userModel signinWithUserName:userName
                            password:password
                          completion:^(STIHTTPResponseError *e) {
                            if ( e ) {
                              NSError * error;
                              reject([NSString stringWithFormat:@"%@",@(e.code)],e.message,error);
                            }
                            else
                            {
                              NSDictionary * data = @{@"token":self.userModel.token,@"user":[self.userModel.user JSONStringRepresentation]};
                              resolve([data JSONStringRepresentation]);
                              **[self sendEventWithName:AuthorizationWasSucceedNotification body:[data JSONStringRepresentation]];**
                            }
                          }];
}

But，I added [self sendEventWithName:AuthorizationWasSucceedNotification body:[data JSONStringRepresentation]]; in other module，not in this RCTUserManager,so it didn't work. Hope can help you.

@purplepeng it looks like you are subclassing RCTEventEmitter, but actually using a promise to interact with React Native. Are you successfully listening to your  [self sendEventWithName:body:]; call in JS, or just relying on your promise resolve block? Or both?

@andybangs
Both. In my react-native code, the part of event as below:
componentDidMount() {
    const authModuleEvent = new NativeEventEmitter(NativeModules.UserManager)
    signinSubscription = authModuleEvent.addListener('AuthorizationWasSucceedNotification',
     (reminder) => {
     ...
});
}
componentWillUnmount() {
      signinSubscription.remove();
    }

@purplepeng  any word on how to do this on the android side?

bridge still nil. What is wrong with this?
#import "RCTBridgeModule.h"
#import "RCTEventEmitter.h"

@interface HelperManager : RCTEventEmitter <RCTBridgeModule>

- (void)sendURLSchemeParameters:(NSURL *)url;

@end

#import "HelperManager.h"

@implementation HelperManager

RCT_EXPORT_MODULE();

- (NSArray<NSString *> *)supportedEvents {
  return @[@"URL_SCHEME"];
}

RCT_EXPORT_METHOD(sendURLSchemeParameters:(NSURL *)url) {
  [self sendEventWithName:@"URL_SCHEME" body:@{}];
}
@end

Can we please have an insight on how to handle this now? I made a bridge using the doc but knowing that this method is deprecated, I'm not really confident...
I think this needs to be documented as this means every lib using this are going to break when the update removing the support of the deprecated methods is going to land!

@lazarte @julien-rodrigues: Here is a stripped down version of a functioning subclass of RCTEventEmitter in my app. Hope this helps.

@andybangs Thanks a lot for your gist. This is exactly what I'm trying to achieve.
I'm receiving a Firebase dynamic link on application's openUrl and I need to be able to fire an event with the "decoded" link that my RN bridge would listen and forward it to the JS side.
I have a question tho. Do you start listening on the Obective C event in the init of your class? or do you have a kind of configure method that adds the listener?
Thanks again

@andybangs Just tried to replace my implementation with yours and I keep having this:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'bridge is not set. This is probably because you've explicitly synthesized the bridge in TestClass, even though it's inherited from RCTEventEmitter.

@julien-rodrigues

I expose a startListening method to be called in a RN component’s componentWillMount method
My subclass of RCTEventEmitter handles firing notifications

To continue with my example above, I am not explicitly instantiating my GSEventEmitter class anywhere because RN creates the instance for me. I import the GSEventEmitter header file in whatever other class I want to emit an event from to use it. Here is another stripped down gist of how I am doing this: https://gist.github.com/andybangs/5f1ee78247b0346e24d55119c6a02afa
Hope this helps, and let me know if you have any other questions.

@andybangs Thanks a lot for your time 👍
Yes that's really more clear to me now lol
This implementation is different from what I've done and I understand now why I got conflicts.
I was trying to go full native. I was attaching the listener by myself in AppDelegate and then fired the event when the FirebaseSDK was done computing the incoming link. Which then fired the JS event. So either the event was fired before the JS side was listening or the JS handler was not attached on the right instance(?).
Either way I like your idea, I'm going to try it out. Thanks for sharing

Facing the same problem, subclassed the RCTEventEmitter but stuck on the bridge is nil assertion error (bridge is not set. This is probably because you've explicitly synthesized the bridge in ReactNativeEventManager, even though it's inherited from RCTEventEmitter.).
`#import <React/RCTEventEmitter.h>
@interface ReactNativeEventManager : RCTEventEmitter
-(void)postEvent:(NSNotification *)notification;
@end`
`#import "ReactNativeEventManager.h"
@implementation ReactNativeEventManager
RCT_EXPORT_MODULE();
-(void)postEvent:(NSNotification *)notification {
NSString *eventName = notification.userInfo[@"name"];
[self sendEventWithName:eventName body:[notification userInfo]];
}

(NSArray<NSString *> *)supportedEvents {
return @[@"add-exchange", @"open-exchange"];
}

@end`
Anybody an idea on how to solve this? Did try all of the above solutions, but none of them seem to work. :(

@VincentdeWit94 did you check out the gists I posted above that utilize NSNotificationCenter?
Example subclass of RCTEventEmitter: https://gist.github.com/andybangs/c4651a3916ebde0df1c977b220bbec4b
Example usage: https://gist.github.com/andybangs/5f1ee78247b0346e24d55119c6a02afa

This entire thread has been helpful, appreciate it, but I'm not quite there yet.
@andybangs if I'm not mistaken you created a .m file just for raising the event (handleBeaconSightingNotification); then you import that into your .m file that will emit the event calling the GSEventEmitter method???

@TheoGit that sounds about right. It may not be how usage is shown in the docs, but is the solution I'm currently relying on to get past that "bridge is not set..." error that others have also posted about here.
My subclass of RCTEventEmitter, GSEventEmitter, is modeled after how RCTLinkingManager in the RN codebase subclasses RCTEventEmitter. Although the code itself is not up to date, the idea to try this came from the accepted answer of this SO post: http://stackoverflow.com/questions/36092903/listening-for-events-in-react-native-ios.
In my application, GSEventEmitter handles all native events that need to be emitted to JS, so I import and use GSEventEmitter.h in a number of other classes. In the example above I use it in GSBeaconManager.m to emit beacon sightings with the following call:
[GSEventEmitter application:[UIApplication sharedApplication] beaconSighted:beaconID];

Here is another example:
I already have native code for registering notification settings, so instead of using the RN PushNotificationIOS abstraction, I use my Objective-C code and a method I define in GSEventEmitter called + (BOOL)application:(UIApplication *)application notificationsRegistered:(UIUserNotificationSettings *)notificationSettings; that I call in my AppDelegate and listen for in JS.
// AppDelegate.m
...
- (void)application:(UIApplication *)application
didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
  [GSEventEmitter application:[UIApplication sharedApplication]
      notificationsRegistered:notificationSettings];
}
...

// Welcome.js
...
componentWillMount() {
  const { GSEventEmitter } = NativeModules;
  const { NOTIFICATIONS_REGISTERED, SIGHTED_BEACON } = GSEventEmitter;
  const { addBeacon } = this.props.actions;

  this.eventEmitter = new NativeEventEmitter(GSEventEmitter);
  this.eventEmitter.addListener(NOTIFICATIONS_REGISTERED, this.handleNotificationsRegistered);
  this.eventEmitter.addListener(SIGHTED_BEACON, (data) => addBeacon(data.payload));
}

componentDidMount() {
  const { GSNotificationManager } = NativeModules;
  GSNotificationManager.registerNotifications();
}

componentWillUnmount() {
  this.eventEmitter.remove();
}

handleNotificationsRegistered() {
  const { GSBeaconManager } = NativeModules;
  GSBeaconManager.startListening();
}
...

@andybangs I really appreciate the time/explanation - will do my best to reproduce this; the only part confusing for me is the delegate (GMBLBeaconManagerDelegate) - thank you again!

@TheoGit: No problem. I included the GMBLBeaconDelegate protocol only as an example of how I am using my subclass of RCTEventEmitter. In that example, the method – beaconManager:didReceiveBeaconSighting: tells the instance of GMBLBeaconManager when a beacon is sighted. The relevant part to this discussion, is the call in that method [GSEventEmitter application:[UIApplication sharedApplication] beaconSighted:beaconID]; which emits an event that I am listening for in JS.

@livoras Thank you. It works for me.

@andybangs this is working; I had to make a few tweaks (like NativeAppEventEmitter instead of NativeEventEmitter) but overall it was your suggestion of subclassing RCTEVentEmitter that I finally understood after reading and re-reading; thanks again this thread as been invaluable.

@andybangs your example worked for me.

i dont work for me  i am begin flustered

@purplepeng Can you give me a way to contact you  i  have  some question  want to Consult you

@andybangs
Actually, no need to use NotificationCenter, RCTBridge has a method called module(for: AnyClass),
which can get an instance of RCTEventEmitter, then you can call your fuction to send event

@hitbear518  Can you give more insights on how to use module(for: ) and get the instance of RCTEventEmitter? Thanks a lot

@xaviraol Here's what i did:

subcass RCTEventEmitter

class FooModule: RCTEventEmitter {
...
}

export it to js

@interface RCT_EXTERN_MODULE(FooModule, NSObject)
...
@end

3.get the RCTBridge(I saved it as singleton), then get the module to send event
if let fooModule = MyRCTBridgeDelegate.sharedInstance.bridge.module(for: FooModule) as? FooModule {
    fooModule.sendMyEvent()
}

then you can subscript the event from js code

thanks @hitbear518 !!!

@hitbear518 would it be possible to provide a more complete example of your implementation?

@aaronksaunders How are you instantiating the RCTEventEmitter (YourModule)? I have my code pretty much exactly the same as yours, but if I instantiate MyEventEmitter, the bridge variable is null and the app crashes. I've read that I should "let react instiatate modules" but I'm not quite clear on how to do this. It seems possible in ObjeC but how to do it in Swift?? I'm missing something simple I'm sure, any help would be appreciated.

@hitbear518  I make it out,thanks.

@aaronksaunders You shouldn't instantiate your emitter yourself. Look here.
"When you used the macro RCT_EXPORT_MODULE() React-Native will instantiate the class for you, and any subsequent alloc/inits will create new instances, unrelated the original. The bridge will not be instantiated in these new instances."
The solution is to override startObserving and stopObserving and listen to NSNotifications.

I used both Objective-C and Swift to test, but I still get "_bridge is nil and it's throwing an exception"
Here's what I did:
#import <React/RCTBridgeModule.h>
#import <React/RCTEventEmitter.h>

@interface RNEventManager : RCTEventEmitter <RCTBridgeModule>

@end

// RNEventManager.m
#import "RNEventManager.h"

@implementation RNEventManager

RCT_EXPORT_MODULE();

- (NSArray<NSString *> *)supportedEvents
{
  return @[@"ExportDescriptionViewWillAppear"];
}

@end

And I called sendEventWithName:body: in viewWillAppear of ExportDescription.
So did I miss something?

Okay, I seem to have managed to get it to work using Swift. It's almost the same as @hitbear518 proposed.
EventEmitter.swift
@objc(EventEmitter)
class EventEmitter: RCTEventEmitter {

  @objc
  override func supportedEvents() -> [String] {
    return ["event1", "event2"]
  }
}

EventEmitterBridge.m
#import "React/RCTBridgeModule.h"
#import "React/RCTEventEmitter.h"

@interface RCT_EXTERN_MODULE(EventEmitter, RCTEventEmitter)
@end

And then in my other module I'm doing something like this:
MyOtherModule.swift
var bridge: RCTBridge!

@objc(MyOtherModule)
class MyOtherModule {

  func sendSomeEvent() {
    if let eventEmitter = bridge.module(for: EventEmitter.self) as? EventEmitter {
          self.sendEvent(withName: "event1", body: "Woot!")
    }
  }
}

I don't have a single clue how and why this is working since my iOS / Swift knowledge is basically non-existent, but apparently, the var bridge: RCTBridge! object gets somehow synthesized (is that what this is called?) so it is available in MyOtherModule.
I'm also not sure if I used the module(for:) thingy correctly but it seems to work.
As mentioned before the EventEmitter should not be instantiated manually.

@sandromartis you should have your "MyOtherModule" inherit RCTEventEmitter (you kind of did with the EventEmitter class already). Then you can use sendEvent from there.
There must be something missing from the code example you've given because I don't understand why bridge: RCTBridge! is available in MyOtherModule.

@chourobin The thing is that I cannot make MyOtherModule inherit from RCTEventEmitter because it is already inheriting from RCTViewManager.
That's why I created a new module EventEmitter that inherits from RCTEventEmitter which creates the whole problem of accessing it in MyOtherModule.
Now that I'm writing this I realize that bridge: RCTBridge! is probably available in MyOtherModule because that one is inheriting from RCTViewManager. No clue how this is working but I haven't added anything else. It's just the RN boilerplate.
I guess if you don't have an RCTViewManager you probably have to set the bridge to a global value in AppDelegate.m. Something like this:
#import "AppDelegate.h"

#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>

var bridge: RCTBridge!

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

  ...

  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                      moduleName:@"LayerTwo"
                                               initialProperties:nil
                                                   launchOptions:launchOptions];

  bridge = rootView.bridge;

  ...

}

@end

Let me know if that makes sense or if I'm talking complete bullshit. I'm totally new to all this react-native and native iOS development stuff.

@sandromartis nope that makes sense. just fyi, there is another api for sending events from ui-based modules, and it's by using RCTBubblingEventBlock or RCTDirectEventBlock. I had a gist that summarizes some of this info if it's helpful:
https://gist.github.com/chourobin/f83f3b3a6fd2053fad29fff69524f91c#file-events-ui-md

I subclasses RCTEventEmitter for a background timer and for some reason the events fire in the background in the emulator but not on my real iOS device. Does anyone know why this happens? sendDeviceEventWithName works perfectly but it sends a deprecation warning.

Finally, I got the solution.
#import "RNNotification.h"
@implementation RNNotification

RCT_EXPORT_MODULE();

+ (id)allocWithZone:(NSZone *)zone {
    static RNNotification *sharedInstance = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        sharedInstance = [super allocWithZone:zone];
    });
    return sharedInstance;
}

- (NSArray<NSString *> *)supportedEvents
{
    return @[@"EventReminder"];
}

- (void)sendNotificationToReactNative
{
    [self sendEventWithName:@"EventReminder" body:@{@"name": @"name"}];
}

When you use it!
RNNotification *notification = [RNNotification allocWithZone: nil];
[notification sendNotificationToReactNative]

I fix this problem by:

(NSArray<NSString*> *)supportedEvents {
AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
delegate.MyViewController = self;
return @[@"CancelEvent", @"OKEvent"];
}

Globally , call delegate.MyViewController 's function to send events;

@Liqiankun  Your solution Works like a charm . Much Appreciated :)

This doesn't seem to work on versions before 0.47.0.
Its easily reproducible:

Make a new app that supports 0.46.0: react-native init TestProject --version<EMAIL_ADDRESS>Use @LiangQiao's singleton to emit events
Nothing gets received on JS layer

Can someone comment on this?

This may help you.
BKLEventEmitter.h
#import <React/RCTBridgeModule.h>
#import <React/RCTEventEmitter.h>

@interface BKLEventEmitter : RCTEventEmitter <RCTBridgeModule>
+ (void)emitEventWithName:(NSString *)name andPayload:(NSDictionary *)payload;
@end

BKLEventEmitter.m
@implementation BKLEventEmitter

RCT_EXPORT_MODULE();

- (NSArray<NSString *> *)supportedEvents {
    // register name, may be more...
    return @[@"NotificationName"];
}

- (void)startObserving {
    NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
    for (NSString *notificationName in [self supportedEvents]) {
        [center addObserver:self
               selector:@selector(emitEventInternal:)
                   name:notificationName
                 object:nil];
    }
}

- (void)stopObserving {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

- (void)emitEventInternal:(NSNotification *)notification {
    [self sendEventWithName:notification.name
                   body:notification.userInfo];
}

+ (void)emitEventWithName:(NSString *)name andPayload:(NSDictionary *)payload {
    [[NSNotificationCenter defaultCenter] postNotificationName:name
                                                    object:self
                                                  userInfo:payload];
}

@end

Finally use it!! You must ensure that the name is already registered.
[BKLEventEmitter emitEventWithName:@"NoticationName" andPayload:nil];

@ZionChang Great piece of code!!
Unfortunately, it was my ignorance that left out an integral piece of code in the new 0.46.0 RN app I made. Regardless, I like the static method calls much more than having an extra object. Much appreciated

If any one still looking for solutions even after trying everything above and nothing worked for you. Please refer this link
https://github.com/facebook/react-native/issues/15421
answer by @Liqiankun helped me solve my issue after banging my head and trying many ways to get the event working.
I even tried maintaining the bridge from the root view and assigning the bridge before dispatching the event. It did not work for me.

@ZionChang this looks really good but how do you call the instance method startObserving?  I'm pretty new to Objective-C so it's not clear to me.

@ZionChang I read the code for RCTEventEmitter and saw that the startObserving method is called when you call addListener from JavaScript.
My issue is I'm emitting the event before the listener was attached!
Working on it...

@niksoper no need to call addListener which is called in react-native source code, just call emitEventWithName.

just starting out using events to communicate from objective-c to js. this is all pretty confusing at the moment. I have a "working" version but I don't understand it since I have to use NativeEventEmitter and DeviceEventEmitter to receive events from objective-c:
const communicationModuleEmitter = new NativeEventEmitter(CommunicationModule);
const subscription = communicationModuleEmitter.addListener(
  'genericLogEvent',
  (e) => console.log('got a genericLogEvent: ', e),
);

along with
const subscribeForNativeEvents = (eventID, callback) => {
  LOG_S().d('Subscribing to ' + eventID);
  DeviceEventEmitter.addListener(eventID, callback);
};
subscribeForNativeEvents('genericLogEvent', (event) => {
  console.log('got a generic event!!!', event);
});

this is the native objective-c side:
RCT_EXPORT_METHOD(foo)
{
  RCTLogInfo(@"foo");
  [self emitMessageToRN:@"genericLogEvent" :@{ @"logMessage": @"event from foo" }];
}

this setup will give me the following result:
D got a generic event!!! "type is: object : {"logMessage":"event from foo"}"
anyone knows why I need to subscribe both with DeviceEventEmitter and NativeEventEmitter? I tried to find documentation on this but haven't found a lot.

@ZionChang but with no listeners the event will be useless and emitEventWithName will go nowhere.
My reading of the RCTEventEmitter source tells me that startObserving will only be called once you've added a listener in JavaScript - which is presumably an optimisation:
RCT_EXPORT_METHOD(addListener:(NSString *)eventName)
{
  if (RCT_DEBUG && ![[self supportedEvents] containsObject:eventName]) {
    RCTLogError(@"`%@` is not a supported event type for<EMAIL_ADDRESS>Supported events are: `%@`",
                eventName, [self class], [[self supportedEvents] componentsJoinedByString:@"`, `"]);
  }
  _listenerCount++;
  if (_listenerCount == 1) {
    [self startObserving];
  }
}

I know that, like I said, such as you can call [BKLEventEmitter emitEventWithName:@"NoticationName" andPayload:nil]; in viewDidAppear which is a native method of UIViewController. And method named addListener will be called by react-native automatically. You can have a try and make a breakpoint to test it.
@niksoper


Download file name appears weird

Prior to 3.5 update, I was able to download files with proper extension and whatever was added into the DownloadData(file_name).
Now the file names consist of utf-8" in the beginning. Ex: utf-8''20221110-14%3A55%3A34_output.xlsx
file = datetime.now().strftime("%Y%m%d-%H:%M:%S_") + "output.xlsx"
df.to_excel(f"files/{file}")
file_path = f"files/{file}"
return FileResponse(path=file_path, filename=file)

updated functionality with 0.3.6 version