Update our Twilio error codes to handle the new 30034, 'blocked due to unregistered campaign'

User Story - Business Need
As of July 5, Twilio now requires that all 10DLC campaigns must be fully registered. Gradual blocking is in place (meaning, a permanent-failure, the sms will never be sent by Twilio) until August 31, 2023, at which time all messages sent through a campaign that is not fully registered will be blocked. Their new ErrorCode for this is 30034. Our code does not check for this ErrorCode, and thanks to a try/catch we do report the status as permanent-failure but do not provide a status_reason.
"status": "permanent-failure",
"status_reason": null,

Twilio callback response (account redacted) from our CloudWatch shows:
2023-07-17T17:27:14 delivery delivery INFO no-request-id "retrieved delivery status: {'payload': 'ErrorCode=30034&SmsSid=SMbeb97038066158ae063d47bb53357dcd&SmsStatus=undelivered&MessageStatus=undelivered&To=%2B14254147755&MessageSid=SMbeb97038066158ae063d47bb53357dcd&AccountSid=REDACTED&From=%2B19703005680&ApiVersion=2010-04-01', 'reference': 'SMbeb97038066158ae063d47bb53357dcd', 'record_status': 'permanent-failure'}" [in /app/app/celery/process_delivery_status_result_tasks.py:236]

[ ] Ticket is understood, and QA has been contacted (if the ticket has a QA label).

User Story(ies)
As a client of the notification-api
I want  to understand why my message failed to send by looking at the status_reason in the notifications response
So that  I can take the appropriate action in my Twilio account for my campaign.
As a VANotify engineer
I want  to include a status_reason in the notifications response for any 30034 errors sent back by Twilio
So that  I can be assured my clients have the information they need.
Additional Info and Resources

Twilio blog announcing the change.
Engineering Checklist

[ ] Twilio ErrorCodes are updated in our app to include the 30034 ErrorCode
[ ] This error code is translated correctly for both status and status_reason

[ ] status_reason should be approved by Kyle and Melanie

[ ] Documentation on Twilio delivery status is updated - https://github.com/department-of-veterans-affairs/vanotify-team/blob/master/Engineering/SPIKES/SMS-Delivery-Status.md

Acceptance Criteria

GIVEN an authorized API user sends an sms notification using a Twilio 10DLC or Toll-free number that is not registered
WHEN the notification fails and a Twilio status is received with a status code of 30034
THEN the notification status is set to permanent-failure
AND the status_reason provides an explanation on why this failed
AND the notification is not retried nor delivered
QA Considerations

[ ] As long as there are still unregistered campaigns in Dev/Perf (Loma Linda account), send a Twilio message in Postman and see the expected result as in the AC above.

Hey team! Please add your planning poker estimate with Zenhub @cris-oddball @EvanParish @justaskdavidb2 @k-macmillan @kalbfled @ldraney @nikolai-efimov

After reviewing the code it seems that it would be much more complicated than initially anticipated to add a custom status_reason for this twilio status code. We are currently just mapping twilio statuses to the ones we use in our platform and that does not include custom status_reason messages. I'm still looking into how I might accomplish this, but it might not be as simple as we were hoping. Maybe I'm overlooking a simple solution that will make this easy?

Approved, merged and deploying to Perf for testing.


HowTo SSL-Termination

Hi there,
I'm trying to configure the marathon-lb to do SSL termination but did not find any documentation on this. Is this possbile and if, how?
Thanks!

@dArignac https://github.com/mesosphere/marathon-lb#providing-ssl-certificates

Ah alright, thank you!
How would I define the HAPROXY_SSL_CERT  within an options file? with "env"?
{
  "marathon-lb": {
    "name": "marathon-lb-external",
    "instances": 1,
    "haproxy-group": "external",
    "bind-http-https": true,
    "role": "slave_public",
    "env": {
      "HAPROXY_SSL_CERT": "<MYCERT>"
    }
  }
}

Hi there,
I solved it by updating an existing marathon-lb instance via the REST API updating the applications "env" and setting HAPROXY_SSL_CERT to the certificate content.
Basically this can be done as in this script: https://github.com/mesosphere/letsencrypt-dcos/blob/master/post_cert.py


can this library provide conversion to xyY color space as well

We are planning to use this library for color conversions and it looks great, the only missing part is it doesn't provide conversion to xyY color space.
please include that.

I am looking for that functionality as well!
It is relatively easy to convert XYZ to xyY, and since this library provides XYZ -> RGB you can basically do anything once you converted XYZ to xyY.
x = X/(X+Y+Z)
y = Y/(X+Y+Z)
Y = Y

Feel free to submit a PR :)


Improve the editor's Find in Files function

Disable Whole Words and Match Case by default

These tend to get in the way when you're doing a quick search. Most editors seem to reuse the previous setting when opening the dialog, so I could try implementing that instead.

Hide the Cancel button once the search is completed
Pad line numbers to the right for more readable search results

Thanks!


Library cannot read file, that exiftool reads properly

        let file_reader = std::fs::File::open(i.path()).unwrap();
        match nom_exif::parse_jpeg_exif(file_reader) {
            Ok(_) => {
                println!("{}: OK", path_str);
            }
            Err(e) => {
                println!("{}: {}", path_str, e);
            }
        }

shows error
/home/rafal/Downloads/Untitled Folder/301581895-a7b4390a-e9f4-46cc-b04f-eb1ba677204c.jpg: parse failed; error: Map on Result;

problematic file
301581895-a7b4390a-e9f4-46cc-b04f-eb1ba677204c.jpg.zip
exiftool only warning - properly parse entire file
[minor] Skipped unknown 7 bytes after JPEG APP1 segment

Is it possible to ignore the errors and return the exif data that was extracted correctly?

Sorry for replying so late, I will reopen this issue and try to improve it. Thank you for your feedback!

This problem has been completely solved!
The reason for this problem is that when parsing IFD, as long as one of the DirectoryEntry fails to parse, it will stop parsing and report an error. The new implementation will ignore the errors encountered during parsing of DirectoryEntry, and continue trying to parse subsequent data.
If you are interested in the implementation details, you can refer to this commit.
If you encounter other problems, please feel free to submit a bug, thank you!


feat: allowOutsideReadDir configuration

Load file from an external folder now fails because of this check :
An asset cannot be read from a location outside the project
Introduced by the PR:
64c6031#diff-9eb0a75e499bdadd44d6dc62218812b8
With allowOutsideOutDir property asset configuration the user can decide to allow this kind of behaviour:
"assets": [
  {
    "glob": "**/*",
    "input": "/temp-folder/outside-allowed/of/project",
    "output": "../not-dist/some/folder/",
    "allowOutsideReadDir": true
  },
]

it is false by default and be enabled by the user only when he knows the security risk behind this kind of decision.
See issue: https://github.com/angular/angular-cli/issues/8783

Hi guys this PR is needed to our project https://github.com/Alfresco/alfresco-ng2-components in order to update the angular cli. If you want I am happy to illustrate a possible scenario

Interested in how this will get resolved as well. Wouldn't having a mono repo with common assets in an external directory be a good use case for this feature? In my case, I have Ethereum contracts in one project that needs to be compiled and then used by an admin app and a consumer app. All 3 projects are in the same mono repo at the same level.

@eromano Could you add a warning on compilation when the configuration option is present (and error out if it's not)?
The reason this check is there is so that people cannot ng build && deploy and end up with files they don't want (or aren't aware of) from, e.g., their home directory. There's a way to copy all your SSH keys for example to the assets directory, and someone who doesn't know better will end up with their CD keys available publicly.
This will be all removed in the soon future (next major), but we can make that fix in 1.7.0.

Hi,
When will this be merged? I'm in need of this change as well.
Thanks.

@hansl I have added the warning. I don't know if this PR still make sense or not.
Sorry for the late response but I didn't notice the mention

+1 on this one too, we use a shared folder for assets outside of the project and pull them in through .angular-cli.json.

@hansl should I rebase it another time? or there are no intention to merge it?

This would be a greatly appreciated feature. We have a lot of shared assets that will benefit from this.

We are using sibling shared modules and this missing feature is a problem.

Any news about this?

Sorry this got stale @eromano
Sounds like this change is still needed? Will discuss with @hansl

We are okay with accepting a PR to read assets from outside the project. But this needs some work to re-base first (likely just make the change again fresh).

Thanks for your PR. Though I'll be closing as per @alexeagle comment. Please re-open the PR when the issues are fixed and is in a mergeable state.


modules: fff: Fix issue with tests being skipped in CI

The filter in the testcase.yaml made it impossible for these to run.
Also, the Kconfig names for the options didn't really make much sense
so they were renamed to avoid conflict.
This fixes an issue found by #36433.
Signed-off-by: Yuval Peress<EMAIL_ADDRESS>

just found the minutes:
https://github.com/zephyrproject-rtos/zephyr/pull/38730 - can we from the TSC provide clarity that the FFF module shouldn't be needed since we're importing the header?
[Yuval] For functionality, we don’t need it. But would be beneficial for future updates.
Discussion Result: Adding as an excluded module. In CI, it will be pulled in and the tests will run.
Reference: docs.zephyrproject.org/latest/guides/west/manifest.html#project-groups-and-active-projects

In CI, it will be pulled in and the tests will run.

@nashif Right, the issue is the last part "In CI, it will be pulled in and the tests will run.". The FFF module isn't being pulled into the CI though I can't quite figure out why.

As it stands, this PR will pass CI but not actually run the FFF test suite. This is caused by the CI not first running $ west config manifest.group-filter -- +ci which is the final step needed to unblock #36433


wish to  add grpc traceing

wish to  add grpc traceing

Since @ascrutae can't finish the plugin in time, I will push it to the 3.2.2 milestone.

We are going to support gRPC-java 1.6+. Check here: #521

#521 Merged and Provided.


How to get a 'label' tooltip view mode, when all the tooltips are shown by enabling 'showAllTooltips: true'

Expected Behavior

mode: 'label' in tooltips,
showAllTooltips: true in Options
So the tooltips should be shown in label mode.
Current Behavior

Instead of label mode ,getting the point mode in tooltip.
Possible Solution

Steps to Reproduce (for bugs)

Context

Environment

Chart.js version:
Browser name and version:
Link to your project:

@sg12056 do you have a fiddle with this? showAllTooltips isn't a chartjs option

Please ask questions on StackOverflow: https://stackoverflow.com/questions/tagged/chart.js


Network Subgraph's latest indexed block () is higher than Network's latest block ()

Hi. i dont really understand this message, what can i do?
on discord the advice is to ignore it, but it's really spamming my logs
is my arbitrum node too slow?
Network Subgraph's latest indexed block (226189029) is higher than Network's latest block (226189010) {
  latestIndexedBlock: 226189029,
  latestNetworkBlock: 226189010,
  blockDistance: -19,
  freshnessThreshold: 200,
  subgraph: 'Network Subgraph',
  retriesLeft: Infinity
}
Network Subgraph's latest indexed block (226189029) is higher than Network's latest block (226189010) {
  latestIndexedBlock: 226189029,
  latestNetworkBlock: 226189010,
  blockDistance: -19,
  freshnessThreshold: 200,
  subgraph: 'Network Subgraph',
  retriesLeft: Infinity
}
Network Subgraph's latest indexed block (226189029) is higher than Network's latest block (226189010) {
  latestIndexedBlock: 226189029,
  latestNetworkBlock: 226189010,
  blockDistance: -19,
  freshnessThreshold: 200,
  subgraph: 'Network Subgraph',
  retriesLeft: Infinity
}
Network Subgraph's latest indexed block (226189030) is higher than Network's latest block (226189010) {
  latestIndexedBlock: 226189030,
  latestNetworkBlock: 226189010,
  blockDistance: -20,
  freshnessThreshold: 200,
  subgraph: 'Network Subgraph',
  retriesLeft: Infinity
}

i found the following variables to make is less often.. but i would like to understand it..
Environment="INDEXER_AGENT_SUBGRAPH_MAX_BLOCK_DISTANCE=200"
Environment="DEFAULT_SUBGRAPH_FRESHNESS_SLEEP_MILLISECONDS=30000"

References:
https://discord.com/channels/438038660412342282/737341252835737641/1240770568412860456
https://discord.com/channels/438038660412342282/737341252835737641/1247640502627467295

my quick fix is: comment this log out:
https://github.com/graphprotocol/indexer/blob/8f1071729fc12265191f7ab1d8323eb0ce530dea/packages/indexer-common/src/subgraphs.ts#L477-L481


Fix: kustomize json patch trait definition

What this PR does / why we need it:
Fix wrong cue def in json-patch trait
Which issue(s) this PR fixes:

Fixes #
Special notes for your reviewer:

@Somefive Need your approval


Render angular components inside swiper.appendSlide() shows empty slide

I am trying to load my angular component inside swiper.appendSlide like this
var swiper = new Swiper('.swiper-container', {
      pagination: {
        el: '.swiper-pagination',
        type: 'fraction',
      },
      navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
      },
    });
    swiper.appendSlide('
Slide 1
')
    swiper.appendSlide('
<app-Hello-Component></app-Hello-Component>
')

It shows me two slides but second slide is empty and do not render my component app-Hello-Component. What should i do if i want to append slides dynamically with angular components inside swiper-slide?

What should i do if i want to append slides dynamically with angular components inside swiper-slide?

StackOverflow fits better for such kind of questions


ci: update cilium-cli to v0.10.4

See individual commits.

/ci-aks

/ci-aws-cni

/ci-eks

/ci-external-workloads

/ci-gke

/ci-multicluster

Affected CI workflows passed, removing test commit and marking as ready for review.

CI passed on all affected workflows, removing test commit again.


is't working with the only .scss extention?

Hi, bourbon working else with the .sass extention or only .scss extention?
Thank so much!

Hi @jairorudas. Yes, you can import it into a .sass file and it will work fine. You can use the Sass syntax for all of the mixins and functions.
(If you've downloaded the source files for some reason those will need to stay the .scss filetype, but you probably haven't)

Thank very much @joshuaogle  for your help!!


Rollup syntax

npx rollup --no-treeshaking --format=esm Font.js > Font.rolled.js
should be
npx rollup --no-treeshake --format=esm Font.js > Font.rolled.js
At least, On My Machine™

But when loading the rolled version in the browser, I get
Uncaught SyntaxError: Identifier 'lazy' has already been declared

rollup doesn't minify by default, so: where in the resulting bundle does that error pop up?


We received an air themed email

Has anyone encountered a similar situation?
No subject, no content

What version of bosun are you using?

yes

Self compiled, the last commit:
commit bedabb504344b762f6a90f57bfca038fcfdbcdd9
Merge: c8af246 6f7dca9
Author: Matt Jibson<EMAIL_ADDRESS>Date:   Mon May 18 18:29:13 2015 -0400
Merge pull request #973 from bosun-monitor/expr-short-circuit

Short circuit || and &&

T_T why,  How to debug

Closing as very old and not enough info to attempt to reproduce


[WIP] Goodbye, Jellyfish 👋

What it says on the tin.

 [Uploader] Migrate Devices from Jellyfish to Platorm

This PR has been superseded by #1599 .


6 columns - with latest table fix - still problem in firewall log view on dashboard

There are only three possibilities when there is not enough space (this is the underlying issue, nothing else) so:
Overflow, cutoff, or text-wrap.
The first fix we did made the overflow bearable not breaking the tables / zebra at the same time. Progress. :)
Martin then added text wraps recently in one widget. I've added it to a few more, but it's a larger effort to fix all widgets.

And it's not going to be very easy with this widget, here's what happens when a v6 entry appears. So it will need wrapping for both source and destination.

@marjohn56 any news on this?
Regards rene

Not yet René, sadly I have very little spare time at present. I'll try and look at this as soon as I'm able.

It's back to the old issue now. It wraps text but Firefox ignores it. I would like to move on to other issues as it's not very fixable because it all goes back to "you're not giving the widget enough space to display its values".


[ENH] Add block iterator

Description of changes
Summarize the changes made by this PR.

Improvements & Bug fixes

...

New functionality

...

Test plan
How are these changes tested?

[ ] Tests pass locally with pytest for python, yarn test for js

Documentation Changes
Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs repository?

[!WARNING]
This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

#1822  👈
#1821
#1820
#1819
main

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @HammadB and the rest of your teammates on  Graphite


Unable to export PDF due to "500 - Internal server error"

It seems to be a server error; not sure what's the scope that it can influence.

Try print to PDF in the meantime.

Got it. Though it takes one more step for me to crop the pdf manually, it works. Thanks! It also helps if the original function comes back :)

It seems to be a server error; not sure what's the scope that it can influence.


groupshared types emit false uninitialized warnings

for example
groupshared int myInt;

void set(__ref groupshared int i){ i = 1; }

void main(){
  set(myInt);
  use(myInt);
}

Both set and used lines generate uninitialized global warnings.
This is because the uninitialized checker's checkCallUsage doesn't correctly look through rate qualified types.

@venkataram-nv for visibility


[Feat]: Sitemap addition

What feature?
I have an idea to add a sitemap to the site to make it easier for the user to navigate the site.
Add screenshots
Add screenshots
Code of Conduct

[X] I agree to follow this project's Code of Conduct

yeah, we can add a sitemap for SEO. do you want to work on this issue? also, are you a GSSoC contributor? @krishnamangal98

Yes, I want to work on this issue and I am also a GSSoC contributor.

Completed. Thanks for your contributions 🎉 ❤


JDA registration speed on the jda vs on a guild

Hey there,
I dived into the source of litecommands-jda and checked the implementation of the command registration.
I'm having the issue that my commands take very long to update/upsert if I'm using litecommands instead of using jda directly.
After I checked the way litecommands registers the commands on the JDA instance using the upsertCommands(..) method, I checked the jda implementation and noticed, that there's a big difference if you call jda.upsertCommands(..) vs guild.upsertCommands(..). Looking at the source and documentation of jda itself, these are two completley different endpoints of the discord api. That means discord is updating the guild commands much faster than the registration on the JDA instance.
Now my question is: Could there be a method to update Commands specifically on a guild or a guild list, instead of just using the JDA instance itself, so we can speed up command registration?
I'm talking about the registration speed of several hours vs. instantly. 🙂
The mentioned endpoint difference:
For the bot itself it uses these two
https://github.com/discord-jda/JDA/blob/master/src/main/java/net/dv8tion/jda/internal/requests/restaction/CommandCreateActionImpl.java#L50
https://github.com/discord-jda/JDA/blob/master/src/main/java/net/dv8tion/jda/api/requests/Route.java#L64
and these two get called for the guild
https://github.com/discord-jda/JDA/blob/master/src/main/java/net/dv8tion/jda/internal/requests/restaction/CommandCreateActionImpl.java#L57
https://github.com/discord-jda/JDA/blob/master/src/main/java/net/dv8tion/jda/api/requests/Route.java#L71
(I already wrote in the discord server and just created a issue for the case.)

Thanks for your report, I intend to make changes to this issue


fix(SDKManager): SDK Switcher unloads when persistOnLoad is true fixes #1272

Fix discussed with @bddckr on Slack.

There were the following issues with your Pull Request

Commit: dcaec35456e57af50976378504b3d4933e3518de
Your commit message body contains a line that is longer than 72 characters

Guidelines are available at https://github.com/thestonefox/SteamVR_Unity_Toolkit

This message was auto-generated by https://gitcop.com

There were the following issues with your Pull Request

Commit: 2c5c41cfb6c92a30037dcdf251dee9e00f201cf6
Your commit message body contains a line that is longer than 72 characters

Guidelines are available at https://github.com/thestonefox/SteamVR_Unity_Toolkit

This message was auto-generated by https://gitcop.com


About.vue: Optimize mail text with debug information

This PR adds debug information to the mail skeleton which is created when clicking on the contact name. This should help to have basic but important information at hand without any further mail communication being necessary.

This partly addresses #66 - so a mail send to the contact address would contain some of the the basic information required to investigate bug reports.


Add 'status' field and 'offers'/'history' subresources

'Decision' better covers the range of responses to an application - providers could reject an application instead of making an offer.
This PR adds more fake applications with only 'decision' information, illustrating some of the possible back-and-forths between candidates and providers.

Bit of a change of direction here - thanks for the feedback @adrianclay and James!
This PR only covers what you GET from /applications - I'm interested to hear how you might expect to interact with this API if you wanted to do some of the things I listed above.

We've decided to push forward with the tech docs rather than this implementation of the API for the moment, as the cost/benefit is better.


Hooks on logins

It'd be nice if the loginAction() function would always call one of two hooks (if set, of course); one for a successful login attempt and one for a failed login attempt.

When discussing this with Slaven, we did not want to open ourselves to any additional attack vectors of letting anyone trying to bruteforce your website with success/fail messages (other than the current lightweight alert).

Well, this could actually be used to improve the site security in a plugin (for example). I've written security plugins for WordPress that utilize hooks to communicate with fail2ban to make brute-force attacks much harder. One could also easily implement login throttling if these hooks were present, as well as 2FA.
The hooks won't be doing anything unless something, well, hooks them :sunglasses:
Just my two cents :blush:


Make tests executable by ctest

Missing add_test() added to make the tests executable by ctest.

Thanks for the PR!


Update .travis.yml

simplify travis.

Thank you @lowks, however I incline not to merge this as the Travis native support for Elixir is far away from complete and robust: random kiex failures, compilation of Elixir from the source most of the time.


Use output_type properly

I was looking into if we required a specific capitalization for the output_type input variable and it turns out we are just hard coding the output_type to visit.  We should fix that and also lower case the string before converting to the enum.
https://github.com/LLNL/serac/blob/bd957565001c35e8bece9c8bc2958e049f803be5/src/drivers/serac.cpp#L118

Right now the conversion logic is just part of the test schema:
https://github.com/LLNL/serac/blob/0e62839e258a738e0f74b84524990bfeb981640e/tests/test_utilities.cpp#L33-L35
https://github.com/LLNL/serac/blob/0e62839e258a738e0f74b84524990bfeb981640e/tests/test_utilities.cpp#L182-L191
but I think this can be moved to input.cpp.


RuntimeError: Invalid magic number; corrupt file?

(base) root@dgx2:~/data/gvision/CrowdDet-master/tools# python3 train.py -md rcnn_fpn_baseline
Num of GPUs:2, learning rate:0.00500, mini batch size:2,
train_epoch:30, iter_per_epoch:3750, decay_epoch:[20, 26]
Init multi-processing training...
Traceback (most recent call last):
File "train.py", line 174, in
run_train()
File "train.py", line 171, in run_train
multi_train(args, config, Network)
File "train.py", line 155, in multi_train
torch.multiprocessing.spawn(train_worker, nprocs=num_gpus, args=(train_config, network, config))
File "/opt/conda/lib/python3.6/site-packages/torch/multiprocessing/spawn.py", line 200, in spawn
return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
File "/opt/conda/lib/python3.6/site-packages/torch/multiprocessing/spawn.py", line 158, in start_processes
while not context.join():
File "/opt/conda/lib/python3.6/site-packages/torch/multiprocessing/spawn.py", line 119, in join
raise Exception(msg)
Exception:
-- Process 0 terminated with the following error:
Traceback (most recent call last):
File "/opt/conda/lib/python3.6/site-packages/torch/multiprocessing/spawn.py", line 20, in _wrap
fn(i, *args)
File "/root/data/gvision/CrowdDet-master/tools/train.py", line 82, in train_worker
backbone_dict = torch.load(train_config.init_weights)
File "/opt/conda/lib/python3.6/site-packages/torch/serialization.py", line 593, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/opt/conda/lib/python3.6/site-packages/torch/serialization.py", line 765, in _legacy_load
raise RuntimeError("Invalid magic number; corrupt file?")
RuntimeError: Invalid magic number; corrupt file?

Try the newest pre-trained backbone model and update pytorch to at leaset 1.5.0.
model: https://drive.google.com/file/d/1lfYQHC63oM2Dynbfj6uD7XnpDIaA5kNr/view?usp=sharing


Reduce number of clicks for default behavior and make it accessible via keyboard

I would like to have a keyboard shortcut to trigger the 'Save my tabs!' menu. Ctrl+Shift+D would be a reasonable decision, but I read somewhere that it is not allowed to overwrite built-in shortcuts, is it?
I would love to have the 'Create new folder' input field pre-filled with a customizable prefix or suffix, for instance the ISO timestamp or what you are using for the 'Use existing folder' dropdown (btw: this is a bit misleading, because you wouldn't search there for a folder with actual timestamp).
Last but not least place the cursor to the input field by default and make it possible to execute with Return/Enter.

Linked to https://github.com/salvoventura/save-my-tabs/issues/10#issuecomment-962654777
In this post I describe my current workflow using built-in keyboard shortcuts only and how this plugin can help to make it more comfortable.


A 'fix' for changing context on subsequent generations

An draft PR with a possible solution to #261

@soenneker no worries, it's more of a suggestion of how it could be fixed. I don't like how coupled it is to the underlying implementation of Bogus. If they alter how the count it indexed could brake in weirder ways.


Update roadmap.md

It looks like you used a tool for rendering the changes without confirming the changes are actually needed or correct


Improve imports structure

Description
The previous import structure was prone to cyclical imports and in some cases would error out with undefined variable X on doing from .X import *; __all__= (X.__all__). Also, sometimes package internal imports were from gluonnlp.X import Y, where they should have used a relative module internal path. The PR also sorts the changed imports alphabetically.
Checklist
Essentials

[X] Changes are complete (i.e. I finished coding on this PR)
[X] All changes have test coverage
[X] Code is well-documented

Changes

[X] Improve internal import structure

Comments
This also follows the common practice described in http://platanios.org/assets/pdf/teaching/writing_python_libraries.pdf

@szha It seems after fixing the imports, the failure on CI become reproducible. Based on that I found the following invalid cell in the language_model.ipynb: https://github.com/dmlc/gluon-nlp/pull/248/commits/46de92c99d316251a0b331e4875e8c01aa267124

Job PR-248/4 is complete.
Docs are uploaded to http://gluon-nlp-staging.s3-accelerate.dualstack.amazonaws.com/PR-248/4/index.html


sl modal: There are no references to Ember.$, $ or jQuery

not ok 542 PhantomJS 1.9 - Unit | Component | sl modal: There are no references to Ember.$, $ or jQuery
    ---
        actual: >
            null
        message: >
            Died on test #1     at test (http://localhost:7357/assets/test-support.js:3025)
                at testWrapper (http://localhost:7357/assets/test-support.js:6192)
                at test (http://localhost:7357/assets/test-support.js:6205)
                at http://localhost:7357/assets/tests.js:25525
                at http://localhost:7357/assets/vendor.js:152
                at tryFinally (http://localhost:7357/assets/vendor.js:33)
                at http://localhost:7357/assets/vendor.js:158
                at http://localhost:7357/assets/test-loader.js:60
                at http://localhost:7357/assets/test-loader.js:51
                at http://localhost:7357/assets/test-loader.js:82
                at http://localhost:7357/assets/test-support.js:6024: Attempted to wrap $ which is already wrapped
        Log: |
    ...

Will likely be resolved by https://github.com/softlayer/sl-ember-components/issues/1503

Resolved by https://github.com/softlayer/sl-ember-components/issues/1503


A possible replacement for ProGuard

Hi,
At ScalaDays I was made aware that Sébastien Doeraene (@sjrd) and the Scala.JS team had developed their own tool for stripping out classes and methods. It is 1-2 orders of magnitude faster then ProGuard, because it emits information straight from the compiler, and is incremental. Unfortunately, it’s currently limited to the Scala.JS compiler, and will require some work to be adapted. But I feel that it could be a tremendous benefit for the Scala-on-Android community.
Below is the outline provided by Sébastien himself:

So the actual work is done in ScalaJSOptimizer under:
https://github.com/scala-js/scala-js/tree/master/tools/src/main/scala/scala/scalajs/tools/optimizer
It relies on the analysis performed in Analyzer, then it strips useless things in ScalaJSOptimizer (or rather, emits only the necessary parts in a new place).

This tool reads information stored in .sjsir files, which are the IR files of Scala.js. They are created by the Scala.js compiler plugin in
https://github.com/scala-js/scala-js/blob/master/compiler/src/main/scala/scala/scalajs/compiler/GenJSFiles.scala#L26
based on information collected in
https://github.com/scala-js/scala-js/blob/master/compiler/src/main/scala/scala/scalajs/compiler/ClassInfos.scala
by
https://github.com/scala-js/scala-js/blob/master/compiler/src/main/scala/scala/scalajs/compiler/GenJSCode.scala
However, it is likely that you can find the same information directly from .class files.

The really important thing for speed is in the optimizer. From the .sjsir files, it reads the following condensed information:
https://github.com/scala-js/scala-js/blob/master/ir/src/main/scala/scala/scalajs/ir/Infos.scala
This is the stuff it really cares about, and that you should construct differently from .class files. The important thing is to keep these information in memory between two runs, in a cache that invalidates the data only if the underlying .class file has changed. In Scala.js we do that here:
https://github.com/scala-js/scala-js/blob/master/tools/src/main/scala/scala/scalajs/tools/optimizer/ScalaJSOptimizer.scala#L289
Now, the analyzer can run from scratch on these data every time, because that step is fast. You can probably reuse the Analyzer almost as is:
https://github.com/scala-js/scala-js/blob/master/tools/src/main/scala/scala/scalajs/tools/optimizer/Analyzer.scala
Then comes the emission of what's needed. Again, this has to be "incremental" in the sense that it has to avoid re-emitting the purged .class files if 1) their original .class file has not changed and 2) the parts within that the analyzer selected has stayed the same. In Scala.js we keep that in memory as well, but in your case you can probably cache the resulting .class files on disk, or any other format that is best to hand over to DES.
Subsequently, DES should be reapplied only to the purged .class files that have changed since last time.

That's basically the idea. Feel free to ask any details.

An advantage of this approach over a faster Proguard is that it would allow creation of library projects that are, presumably, much easier to consume from Java-based android projects.

This is really out of the scope for this plugin.
If someone wants to write scala.dx, yay (and I've thought about it, but no, maybe scala 2.12/3.x+ will force hands), but yeah, otherwise far out of scope.

Also, this wouldn't enable making scala libraries easier to consume from java projects, you'd still have to go through the pre-dexed libraries setup, and compile against the original jar, etc. It's painful.
The best approach if you want to use scala libraries from java projects: let the build pull in scala-library transitively, enable proguard, add scala rules in your aar's proguard.txt


Use JULIA_DEBUG environment variable for additional modules to show.

Implemented. Modules specified are treated like other included modules, then included files are added, then excluded files are removed.


Files disappear from staged list after further modifications in commit workflow

Hello Team,
I have encountered a recurring issue during the commit workflow where files are not correctly identified as either staged or unstaged after subsequent modifications. Here's the problem sequence:

I modify a file named 'A'.
I stage the file 'A' using git add A or a GUI equivalent.
The file 'A' now appears correctly in the staged changes list.
I make further changes to the file 'A' without restaging it.
Upon checking the list of staged files to commit, file 'A' no longer appears in the staged changes list, which seems incorrect.

I would expect the file 'A' to remain in the staged list, showing that it has staged changes, with indications that more unstaged changes are also present. This issue causes confusion and could potentially lead to incomplete commits.
Can we look into why the system is not correctly handling the staged files after they're modified again?
Thank you for your attention to this matter.
Best regards,
[your name]

Have fixed it.


More backports for shapely 2.0.2

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

33 of 33 (100.0%)  changed or added relevant lines in 2 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage increased (+0.5%) to 87.806%

Totals

Change from base Build<PHONE_NUMBER>:
0.5%

Covered Lines:
2549

Relevant Lines:
2903

💛  - Coveralls

A minor suggestion is to add an entry to CHANGES.txt / docs/release/2.x.rst for permitting compatibility with Cython 3.

Good point, will add that to https://github.com/shapely/shapely/pull/1906 (this PR should be pure backports)


Error creating video Files

Issue summary
Getting Invalid video url when trying to create a FILE of contentType: 'VIDEO'.
Expected behavior
Create the video file, the same way it does when the contentType is IMAGE or FILE.
Actual behavior
Throws an error:
- field:
  - files
  - '11'
  - originalSource
  message: Invalid video url=https://cdn.shopify.com/videos/c/o/v/ec9ffaaf421145ccb962663d4fe70102.mp4

Steps to reproduce the problem
files = []
files << {
  alt: 'Lorem ipsum',
  contentType: 'VIDEO',
  originalSource: 'https://cdn.shopify.com/videos/c/o/v/ec9ffaaf421145ccb962663d4fe70102.mp4'
}
client = ShopifyAPI::GraphQL.client
query = client.parse <<-'GRAPHQL'
  mutation ($files: [FileCreateInput!]!) {
    fileCreate(files: $files) {
      userErrors {
        field
        message
      }
    }
  }
GRAPHQL
result = client.query(query, variables: { files: files })
if errors = result.original_hash.dig("data", "fileCreate", "userErrors")
  puts errors.to_yaml
end

Specifications

shopify_api version: 9.5.1
Shopify API version used: 2022-04

Ok, I found out that originalSource needs to be "An external URL (for images only) or a staged upload URL."
It will be great if videos could also be created from external URL, and we can avoid having to download the video and then upload it again through the stagedUploadsCreate moutation.


JACCG/ CoreNLP annotator error when running pipeline_server.py

I can run jaccg on the terminal without issue.
When using the below however;

./script/pipeline_server.py  -P "-Xmx4g -cp jigg-0.6.1.jar jigg.pipeline.Pipeline -annotators ssplit,mecab,jaccg"

The below error is returned.
I have extended the timeout time to allow the necessary libraries/packages to be loaded, but there still seems to be a problem in returning the command prompt character ">".
Using mecab, cabocha annotators works fine. The error is returned with jaccg only.
 Traceback (most recent call last):   File "./script/pipeline_server.py", line 83, in <module>     pipeline = Pipeline(options.pipeline)   File "./script/pipeline_server.py", line 20, in __init__     self.pipeline.expect("> ", timeout=5000)   File "/usr/local/lib/python2.7/site-packages/pexpect/spawnbase.py", line 321, in expect     timeout, searchwindowsize, async)   File "/usr/local/lib/python2.7/site-packages/pexpect/spawnbase.py", line 345, in expect_list     return exp.expect_loop(timeout)   File "/usr/local/lib/python2.7/site-packages/pexpect/expect.py", line 105, in expect_loop     return self.eof(e)   File "/usr/local/lib/python2.7/site-packages/pexpect/expect.py", line 50, in eof     raise EOF(msg) pexpect.exceptions.EOF: End Of File (EOF). Empty string style platform. <pexpect.pty_spawn.spawn object at 0x10d356810> command: /usr/bin/java args: ['/usr/bin/java', '-Xmx4g', '-cp', 'jigg-0.6.1.jar', 'jigg.pipeline.Pipeline', '-annotators', 'ssplit,mecab,jaccg'] buffer (last 100 chars): '' before (last 100 chars): '     < str>: Path to the trained model (you can omit this if you load a jar which packs models) []\r\n' after: <class 'pexpect.exceptions.EOF'> match: None match_index: None exitstatus: None flag_eof: True pid: 81078 child_fd: 6 closed: False timeout: 30 delimiter: <class 'pexpect.exceptions.EOF'> logfile: None logfile_read: None logfile_send: None maxread: 2000 ignorecase: False searchwindowsize: None delaybeforesend: 0.05 delayafterclose: 0.1 delayafterterminate: 0.1 searcher: searcher_re:     0: re.compile("> ")

Does the same error occur when replacing the line 68 on the server code
start = incoming.find("<sentences>")

with
start = incoming.find("<root>")

?
This works in my environment. But the script is for much older version, and I'm not sure this simple fix is sufficient. I will commit it if it works for you.

I actually made this change already - and yes, I still get the above error.
The original server code made a call to transccg-0.2.jar, which isn't in the 0.6.1 bundle of course, so here i am using jigg-0.6.1.jar instead.
However despite the change when using jaccg annotation, or the full corenlp stack like the below;
./script/pipeline_server.py -P "-Xmx4g -cp jigg-0.6.1.jar jigg.pipeline.Pipeline -annotators corenlp[tokenize,ssplit,parse,lemma,ner,dcoref]"

The error is coming from the call to self.pipeline.expect(). The below is suggesting that after the jigg command is run, the characters "> " aren't identified.
File "./script/pipeline_server.py", line 85, in
pipeline = Pipeline(options.pipeline)
File "./script/pipeline_server.py", line 20, in init
self.pipeline.expect("> ", timeout=5000)
File "/usr/local/lib/python2.7/site-packages/pexpect/spawnbase.py", line 390, in expect_exact
return exp.expect_loop(timeout)
File "/usr/local/lib/python2.7/site-packages/pexpect/expect.py", line 105, in expect_loop
return self.eof(e)
File "/usr/local/lib/python2.7/site-packages/pexpect/expect.py", line 50, in eof
raise EOF(msg)
pexpect.exceptions.EOF: End Of File (EOF). Empty string style platform.
<pexpect.pty_spawn.spawn object at 0x110575850>
command: /usr/bin/java
args: ['/usr/bin/java', '-Xmx4g', '-cp', 'jigg-0.6.1.jar', 'jigg.pipeline.Pipeline', '-annotators', 'corenlp[tokenize,ssplit,parse,lemma,ner,dcoref]']
buffer (last 100 chars): ''
before (last 100 chars): '\r\n\tat edu.stanford.nlp.parser.common.ParserGrammar.loadModel(ParserGrammar.java:185)\r\n\t... 30 more\r\n'
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: None
flag_eof: True
pid: 7438
child_fd: 6
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 1000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_string:
0: "> "

Probably the reason is that model files are missing for jaccg and corenlp.
Please try the following:
./script/pipeline_server.py -P "-Xmx4g -cp \"jigg-0.6.1.jar:stanford-corenlp-3.6.0-models.jar\" jigg.pipeline.Pipeline -annotators corenlp[tokenize,ssplit,parse,lemma,ner,dcoref]"

with the appropriate path to the model. jaccg is as well.

Returns the same error I am afraid -
pexpect.exceptions.EOF: End Of File (EOF). Empty string style platform.

Sorry for late response. I revised the server code in the latest develop version so could you try it? It outputs the messages from Jigg when an error occurs. We may specify the reason of fail from those outputs.

Likewise - apologies for getting back late.
With your try/exception modifications here are the outputs.
For JACCG, I ran the download script as instructed but get the below error anyway. As evidence that the download script ran successfully, I can see the jigg-0.6.1-models.jar jar in the jigg-0.6.1 directory.
For CoreNLP it seems to be complaining about "edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz" not being available.
JACCG
Command
./script/pipeline_server.py -P "-Xmx4g -cp jigg-0.6.1.jar jigg.pipeline.Pipeline -annotators ssplit,mecab,jaccg"

Output
INFO:__main__:java -Xmx4g -cp jigg-0.6.1.jar jigg.pipeline.Pipeline -annotators ssplit,mecab,jaccg
INFO:__main__:Spawning Jigg process...
ERROR:__main__:Failed to set up the pipeline! Maybe the arguments given to jigg are corrupted?
ERROR:__main__:Loading parser model in ccg-models/parser/beam=64.ser.gz ...Loading parser model in ccg-models/parser/beam=64.ser.gz ...Failed to start CCG parser. Make sure the model file of CCG is already installed. If not, execute the following command in jigg directory:
  ./script/download_models.sh

  jaccg.model                    < str>: Path to the trained model (you can omit this if you load a jar which packs models) []

CoreNLP with all annotations
Command
./script/pipeline_server.py -P "-Xmx4g -cp jigg-0.6.1.jar jigg.pipeline.Pipeline -annotators corenlp[tokenize,ssplit,parse,lemma,ner,dcoref]"

Output
INFO:__main__:Spawning Jigg process...
ERROR:__main__:Failed to set up the pipeline! Maybe the arguments given to jigg are corrupted?
ERROR:__main__:[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator tokenize
[main] INFO edu.stanford.nlp.pipeline.TokenizerAnnotator - TokenizerAnnotator: No tokenizer type provided. Defaulting to PTBTokenizer.
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator ssplit
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator parse
[main] INFO edu.stanford.nlp.parser.common.ParserGrammar - Loading parser from serialized file edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz ...
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator tokenize
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator ssplit
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator parse
[main] INFO edu.stanford.nlp.parser.common.ParserGrammar - Loading parser from serialized file edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz ...
Exception in thread "main" edu.stanford.nlp.io.RuntimeIOException: java.io.IOException: Unable to open "edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz" as class path, filename or URL
	at edu.stanford.nlp.parser.common.ParserGrammar.loadModel(ParserGrammar.java:188)
	at edu.stanford.nlp.pipeline.ParserAnnotator.loadModel(ParserAnnotator.java:212)
	at edu.stanford.nlp.pipeline.ParserAnnotator.<init>(ParserAnnotator.java:115)
	at edu.stanford.nlp.pipeline.AnnotatorImplementations.parse(AnnotatorImplementations.java:150)
	at edu.stanford.nlp.pipeline.AnnotatorFactories$11.create(AnnotatorFactories.java:463)
	at edu.stanford.nlp.pipeline.AnnotatorPool.get(AnnotatorPool.java:85)
	at edu.stanford.nlp.pipeline.StanfordCoreNLP.construct(StanfordCoreNLP.java:375)
	at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:139)
	at jigg.pipeline.StanfordCoreNLPAnnotator.<init>(StanfordCoreNLPAnnotator.scala:60)
	at jigg.pipeline.StanfordCoreNLPAnnotator$.fromProps(StanfordCoreNLPAnnotator.scala:784)
	at jigg.pipeline.StanfordCoreNLPAnnotator$.fromProps(StanfordCoreNLPAnnotator.scala:747)
	at jigg.pipeline.Pipeline$$anonfun$getAnnotator$1.apply(Pipeline.scala:185)
	at jigg.pipeline.Pipeline$$anonfun$getAnnotator$1.apply(Pipeline.scala:185)
	at scala.Option.map(Option.scala:146)
	at jigg.pipeline.Pipeline.getAnnotator(Pipeline.scala:184)
	at jigg.pipeline.Pipeline$$anonfun$5.apply(Pipeline.scala:136)
	at jigg.pipeline.Pipeline$$anonfun$5.apply(Pipeline.scala:136)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
	at scala.collection.Iterator$class.foreach(Iterator.scala:742)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1194)
	at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
	at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
	at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
	at scala.collection.AbstractTraversable.map(Traversable.scala:104)
	at jigg.pipeline.Pipeline.createAnnotatorList(Pipeline.scala:136)
	at jigg.pipeline.Pipeline.annotatorList$lzycompute(Pipeline.scala:130)
	at jigg.pipeline.Pipeline.annotatorList(Pipeline.scala:130)
	at jigg.pipeline.Pipeline.close(Pipeline.scala:132)
	at jigg.pipeline.Pipeline$.main(Pipeline.scala:399)
	at jigg.pipeline.Pipeline.main(Pipeline.scala)
Caused by: java.io.IOException: Unable to open "edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz" as class path, filename or URL
	at edu.stanford.nlp.io.IOUtils.getInputStreamFromURLOrClasspathOrFileSystem(IOUtils.java:485)
	at edu.stanford.nlp.io.IOUtils.readObjectFromURLOrClasspathOrFileSystem(IOUtils.java:323)
	at edu.stanford.nlp.parser.common.ParserGrammar.loadModel(ParserGrammar.java:185)
	... 30 more

For both commands, the reason of errors seems to be that the model is not included in the current class path of java.
You should modify the command as follows:
./script/pipeline_server.py -P "-Xmx4g -cp \"jigg-0.6.1.jar:jigg-0.6.1-models.jar\" jigg.pipeline.Pipeline -annotators ssplit,mecab,jaccg"

That is, the download model jar should be explicitly included in -cp argument. The escape \" is necessary here.
The error in corenlp seems similar. The corenlp model file should be stated in -cp.

This is strange - I am using command above with the escapes but seem to get the same error...
Any way to check that the jar file is valid perhaps??
$ ./script/pipeline_server.py -P "-Xmx4g -cp \"jigg-0.6.1.jar:jigg-0.6.1-models.jar\" jigg.pipeline.Pipeline -annotators ssplit,mecab,jaccg"

INFO:__main__:java -Xmx4g -cp "jigg-0.6.1.jar:jigg-0.6.1-models.jar" jigg.pipeline.Pipeline -annotators ssplit,mecab,jaccg
INFO:__main__:Spawning Jigg process...
ERROR:__main__:Failed to set up the pipeline! Maybe the arguments given to jigg are corrupted?
ERROR:__main__:Loading parser model in ccg-models/parser/beam=64.ser.gz ...Loading parser model in ccg-models/parser/beam=64.ser.gz ...Failed to start CCG parser. Make sure the model file of CCG is already installed. If not, execute the following command in jigg directory:
  ./script/download_models.sh

  jaccg.model                    < str>: Path to the trained model (you can omit this if you load a jar which packs models) []

Excuse me cutting in.
In my case,  -corenlp.ner.useSUTime false option is needed for calling corenlp[ner] annotator.
If you run jigg without this option, you may see the following message:
$ java -cp target/jigg-assembly-0.6.1.jar jigg.pipeline.Pipeline -annotators "corenlp[tokenize, ssplit, parse, lemma, ner, dcoref]"
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Djava.library.path=/home/kyoshinaga/local/HDFJAVA-3.2.1-Linux/HDF_Group/HDFJAVA/3.2.1/lib
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator tokenize
[main] INFO edu.stanford.nlp.pipeline.TokenizerAnnotator - TokenizerAnnotator: No tokenizer type provided. Defaulting to PTBTokenizer.
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator ssplit
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator parse
[main] INFO edu.stanford.nlp.parser.common.ParserGrammar - Loading parser from serialized file edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz ...
done [0.4 sec].
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator lemma
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator ner
Loading classifier from edu/stanford/nlp/models/ner/english.all.3class.distsim.crf.ser.gz ... done [1.3 sec].
Loading classifier from edu/stanford/nlp/models/ner/english.muc.7class.distsim.crf.ser.gz ... done [0.5 sec].
Loading classifier from edu/stanford/nlp/models/ner/english.conll.4class.distsim.crf.ser.gz ... done [0.6 sec].
[main] INFO edu.stanford.nlp.time.JollyDayHolidays - Initializing JollyDayHoliday for SUTime from classpath edu/stanford/nlp/models/sutime/jollyday/Holidays_sutime.xml as sutime.binder.1.
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator tokenize
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator ssplit
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator parse
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator lemma
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator ner
Loading classifier from edu/stanford/nlp/models/ner/english.all.3class.distsim.crf.ser.gz ... done [1.1 sec].
Loading classifier from edu/stanford/nlp/models/ner/english.muc.7class.distsim.crf.ser.gz ... done [0.4 sec].
Loading classifier from edu/stanford/nlp/models/ner/english.conll.4class.distsim.crf.ser.gz ... done [0.5 sec].
[main] INFO edu.stanford.nlp.time.JollyDayHolidays - Initializing JollyDayHoliday for SUTime from classpath edu/stanford/nlp/models/sutime/jollyday/Holidays_sutime.xml as sutime.binder.1.
Exception in thread "main" edu.stanford.nlp.util.ReflectionLoading$ReflectionLoadingException: Error creating edu.stanford.nlp.time.TimeExpressionExtractorImpl
        at edu.stanford.nlp.util.ReflectionLoading.loadByReflection(ReflectionLoading.java:40)
        at edu.stanford.nlp.time.TimeExpressionExtractorFactory.create(TimeExpressionExtractorFactory.java:57)
        at edu.stanford.nlp.time.TimeExpressionExtractorFactory.createExtractor(TimeExpressionExtractorFactory.java:38)
        at edu.stanford.nlp.ie.regexp.NumberSequenceClassifier.<init>(NumberSequenceClassifier.java:82)
        at edu.stanford.nlp.ie.NERClassifierCombiner.<init>(NERClassifierCombiner.java:85)
        at edu.stanford.nlp.pipeline.AnnotatorImplementations.ner(AnnotatorImplementations.java:108)
        at edu.stanford.nlp.pipeline.AnnotatorFactories$6.create(AnnotatorFactories.java:333)
        at edu.stanford.nlp.pipeline.AnnotatorPool.get(AnnotatorPool.java:85)
        at edu.stanford.nlp.pipeline.StanfordCoreNLP.construct(StanfordCoreNLP.java:375)
        at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:139)
        at jigg.pipeline.StanfordCoreNLPAnnotator.<init>(StanfordCoreNLPAnnotator.scala:60)
        at jigg.pipeline.StanfordCoreNLPAnnotator$.fromProps(StanfordCoreNLPAnnotator.scala:797)
        at jigg.pipeline.StanfordCoreNLPAnnotator$.fromProps(StanfordCoreNLPAnnotator.scala:754)
        at jigg.pipeline.Pipeline$$anonfun$getAnnotator$1.apply(Pipeline.scala:181)
        at jigg.pipeline.Pipeline$$anonfun$getAnnotator$1.apply(Pipeline.scala:181)
        at scala.Option.map(Option.scala:146)
        at jigg.pipeline.Pipeline.getAnnotator(Pipeline.scala:180)
        at jigg.pipeline.Pipeline$$anonfun$5.apply(Pipeline.scala:139)
        at jigg.pipeline.Pipeline$$anonfun$5.apply(Pipeline.scala:139)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
        at scala.collection.Iterator$class.foreach(Iterator.scala:742)
        at scala.collection.AbstractIterator.foreach(Iterator.scala:1194)
        at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
        at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
        at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
        at scala.collection.AbstractTraversable.map(Traversable.scala:104)
        at jigg.pipeline.Pipeline.createAnnotatorList(Pipeline.scala:139)
        at jigg.pipeline.Pipeline.annotatorList$lzycompute(Pipeline.scala:133)
        at jigg.pipeline.Pipeline.annotatorList(Pipeline.scala:133)
        at jigg.pipeline.Pipeline.close(Pipeline.scala:135)
        at jigg.pipeline.Pipeline$.main(Pipeline.scala:401)
        at jigg.pipeline.Pipeline.main(Pipeline.scala)
Caused by: edu.stanford.nlp.util.MetaClass$ClassCreationException: MetaClass couldn't create public edu.stanford.nlp.time.TimeExpressionExtractorImpl(java.lang.String,java.util.Properties) with args [sutime, {}]
        at edu.stanford.nlp.util.MetaClass$ClassFactory.createInstance(MetaClass.java:235)
        at edu.stanford.nlp.util.MetaClass.createInstance(MetaClass.java:380)
        at edu.stanford.nlp.util.ReflectionLoading.loadByReflection(ReflectionLoading.java:38)
        ... 32 more
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at edu.stanford.nlp.util.MetaClass$ClassFactory.createInstance(MetaClass.java:231)
        ... 34 more
Caused by: java.lang.RuntimeException: Error initializing binder 1
        at edu.stanford.nlp.time.Options.<init>(Options.java:92)
        at edu.stanford.nlp.time.TimeExpressionExtractorImpl.init(TimeExpressionExtractorImpl.java:45)
        at edu.stanford.nlp.time.TimeExpressionExtractorImpl.<init>(TimeExpressionExtractorImpl.java:39)
        ... 39 more
Caused by: java.lang.NullPointerException: Missing URL.
        at de.jollyday.HolidayManager.getInstance(HolidayManager.java:190)
        at edu.stanford.nlp.time.JollyDayHolidays.init(JollyDayHolidays.java:55)
        at edu.stanford.nlp.time.Options.<init>(Options.java:90)
        ... 41 more

How do i make use of the -corenlp.ner.useSUTime false option for the command?
Neither
./script/pipeline_server.py -P "-Xmx4g -cp \"jigg-0.6.1.jar:jigg-0.6.1-models.jar\" jigg.pipeline.Pipeline -corenlp.ner.useSUTime false -annotators corenlp[tokenize,ssplit,parse,lemma,ner,dcoref]"

not
./script/pipeline_server.py -P "-Xmx4g -cp \"jigg-0.6.1.jar:jigg-0.6.1-models.jar\" jigg.pipeline.Pipeline -annotators corenlp[tokenize,ssplit,parse,lemma,ner,dcoref] -corenlp.ner.useSUTime false"

seem to help.

@JSB97 The next line of your output
INFO:__main__:java -Xmx4g -cp "jigg-0.6.1.jar:jigg-0.6.1-models.jar" jigg.pipeline.Pipeline -annotators ssplit,mecab,jaccg

says it tried to do call this command. Could you try this command in the terminal? If this does work, please tell me your current environment (OS etc).

Sure here is the output of the command;
I am on using the below (let me know if there are other dependencies you need)
Mac OS X (10.11.2)
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)
Loading parser model in ccg-models/parser/beam=64.ser.gz ...Loading parser model in ccg-models/parser/beam=64.ser.gz ...Failed to start CCG parser. Make sure the model file of CCG is already installed. If not, execute the following command in jigg directory:
  ./script/download_models.sh

  jaccg.model                    < str>: Path to the trained model (you can omit this if you load a jar which packs models) []

The output suggests you failed to load the model jar from the terminal as well. Is "jigg-0.6.1.models.jar" placed in the current directory?

There was indeed a models.jar file, but it seems the ./download_scripts.sh script had not run successfully. The model file size was only few bytes (which doesn't make sense), so edited the script. All good now :+1:
Running the server as;
./script/pipeline_server.py -P "-Xmx4g -cp \"jigg-0.6.1.jar:jigg-0.6.1-models.jar\" jigg.pipeline.Pipeline -annotators ssplit,mecab,jaccg"

and passing data to the server as;
./script/client.py -i some_japanese.txt

now gives the desired result;
<root>
  <document id="d0">
    <sentences>
      <sentence characterOffsetBegin="0" characterOffsetEnd="9" id="s0">
        今日の天気は良い。
...


godemo-1560945851 to 0.0.2

Promote godemo-1560945851 to version 0.0.2

[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by:
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approvers:
If they are not already assigned, you can assign the PR to them by writing /assign  in a comment when ready.
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

OWNERS

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@dcanadillas: The following test failed, say /retest to rerun them all:

Test name
Commit
Details
Rerun command

promotion-build
b4f0137a88fb9b225fa9030af1d82301b8d044a0
link
/test this

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.


Update lr_logger.py

when logging learning_rate, we should provide different choices to log including 'step' and 'epoch'
What does this PR do?

Fixes # (issue)
Before submitting

[ ] Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
[ ] Did you read the contributor guideline, Pull Request section?
[ ] Did you make sure your PR does only one thing, instead of bundling different changes together? Otherwise, we ask you to create a separate PR for every change.
[ ] Did you make sure to update the documentation with your changes?
[ ] Did you write any new necessary tests?
[ ] Did you verify new and existing tests pass locally with your changes?
[ ] If you made a notable change (that affects users), did you update the CHANGELOG?

PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃

Hello @aiyolo! Thanks for opening this PR.

In the file pytorch_lightning/callbacks/lr_logger.py:

Line 71:61: E712 comparison to True should be 'if cond is True:' or 'if cond:'
Line 77:61: E712 comparison to True should be 'if cond is True:' or 'if cond:'
Line 79:1: W293 blank line contains whitespace

Do see the Hitchhiker's guide to code style

@aiyolo mind mark comments as resolved if you did it so we know it is ready for another review round...

Just a suggestion: How about interval or step parameter that takes a string 'global_step' or 'epoch' just like we have for schedulers :) ?

CI test fails with errors like assert all(len(lr) == trainer.max_epochs for k, lr in lr_logger.lrs.items()), \             'Length of logged learning rates exceeds the number of epochs'
I think the reason is that,  in current implementation, we record learning_rate on every epoch, and the x-axis is global_step, so that len(lr) == trainer.max_epochs, however, in my commits, we record learnning_rate every step in default, therefore, CI test fails.
so, how to deal with this confict? to modify the  test case or my my commits?

@aiyolo if you change:
all(len(lr) == trainer.max_epoch for k, lr in lr_logger.lrs.items())
to
all(len(lr) == trainer.global_step for k, lr in lr_logger.lrs.items())
the tests should pass

On second thought, it is probably better if we parametrize this so we test for both settings. Something like this should do the job:
@pytest.mark.parametrize("logging_interval", ['step', 'epoch'])
def test_lr_logger_multi_lrs(tmpdir, logging_interval):
    """ Test that learning rates are extracted and logged for multi lr schedulers. """
    tutils.reset_seed()

    model = EvalModelTemplate()
    model.configure_optimizers = model.configure_optimizers__multiple_schedulers

    lr_logger = LearningRateLogger(interval=logging_interval)
    trainer = Trainer(
        default_root_dir=tmpdir,
        max_epochs=2,
        limit_val_batches=0.1,
        limit_train_batches=0.5,
        callbacks=[lr_logger],
    )
    result = trainer.fit(model)
    assert result

    assert lr_logger.lrs, 'No learning rates logged'
    assert len(lr_logger.lrs) == len(trainer.lr_schedulers), \
        'Number of learning rates logged does not match number of lr schedulers'
    assert all([k in ['lr-Adam', 'lr-Adam-1'] for k in lr_logger.lrs.keys()]), \
        'Names of learning rates not set correctly'
    if logging_interval=='step':
        expected_number_logged = trainer.global_step
    else:
        expected_number_logged = trainer.current_epoch+1 # zero based
    assert all(len(lr) == expected_number_logged for k, lr in lr_logger.lrs.items()), \
        'Length of logged learning rates do not match the expected number'

@aiyolo what will happen if I have one scheduler that updates every epoch and one scheduler that updates every step? will the results will be logged correctly?

@aiyolo what will happen if I have one scheduler that updates every epoch and one scheduler that updates every step? will the results will be logged correctly?

lr_logger.py first extracts lr from an optimizer and then log it, so if scheduler updates every epoch(100 batch_step per epoch), and we log lr every step, then we will record same lrs in  the 100 batch step.  For detailed results, please refer to the images below.
for example, if we use
schedulers = [{'scheduler': torch.optim.lr_scheduler.ExponentialLR(optimizers[0], 0.99),
    'interval': 'epoch'}]
lr_logger = LearningRateLogger(interval='step')

cheduler_step_vs_interval_step

scheduler_step_vs_interval_epoc

scheduler_epoch_vs_interval_step

scheduler_epoch_vs_interval_epoch

@aiyolo so maybe my question was not clear enough: if i have two scheduler defined as
scheduler1 = {'scheduler': torch.optim.lr_scheduler.ExponentialLR(optimizers[0], 0.99),
    'interval': 'epoch'}
scheduler2 = {'scheduler': torch.optim.lr_scheduler.ExponentialLR(optimizers[1], 0.99),
    'interval': 'step'}
schedulers = [scheduler1, scheduler2]

can I still have the option to log scheduler1 every epoch and scheduler2 every step (match how often they update) or will this force them to log at the same time?

@aiyolo so maybe my question was not clear enough: if i have two scheduler defined as
scheduler1 = {'scheduler': torch.optim.lr_scheduler.ExponentialLR(optimizers[0], 0.99),
    'interval': 'epoch'}
scheduler2 = {'scheduler': torch.optim.lr_scheduler.ExponentialLR(optimizers[1], 0.99),
    'interval': 'step'}
schedulers = [scheduler1, scheduler2]

can I still have the option to log scheduler1 every epoch and scheduler2 every step (match how often they update) or will this force them to log at the same time?

yes, this will force them to log at the time. to support different log_interval, I think we should add an optional key in every scheduler, like {'sheduler':..., 'log_interval':...}.

But the current implementation support this already. The log interval is determined by the "interval"  key.

emm..., so you mean we should log lr according to interval key in the scheduler, however, in this case, what if we want to record lr every epoch, but the interval='step' in the scheduler?

Then I guess the compromise is:
LrLoggerCallback(interval=None): default behavior, lr are loggede according to their individual "interval" key
LrLoggerCallback(interval="epoch"): force all lr to log every epoch
LrLoggerCallback(interval="step): force all lr to log every step

much better!


traders-little-helper: Add version <IP_ADDRESS>

Closes #10482

[x] I have read the Contributing Guide.

/verify

/verify


Replace arrows when typographer enabled

Wouldn't it be nice also to replace arrows when in typographer mode?
Something like:
->→→
=>→⇒
etc.

These replacements should be skipped inside code blocks, I suppose.

All format extensions should be done via plugins. Existing features are frozen and updated only when commonmark spec changes.


dl-button: disable-message prop to show when dl-button is disable

Is your feature request related to a problem? Please describe.
is look like the requests to hint user why is button disable are pop all the time , so it will be nice to make standard way to show that.
Describe the solution you'd like
replace to tooltip with disable-message when a button is disabled.
Describe alternatives you've considered
show small text under the button

normal tool tip:
disable tool tip:

@perydataloop you can just replace the tooltip text you pass to the component with the text you want. adding an extra property for this case seems redundant.
example
<dl-button   :disabled="this.disabled"  :tooltip="this.disabled ? 'disabled text' : 'text'" />

@fadiDL sure can do, but it seems by dl-input that we going on a path of explicit message for any state, and I think a prop like disable-message will cause wide adoption of an explanation, of why the button disable


Add versions to ReadTheDocs documentation

Currently, it only shows latest and stable.

Done! This needs to manually be done in ReadTheDocs. Will add a note in contributing.md


Request to add my project to Brainhack

Hello
@me-pic
This is the revise version of my project adding.
Best,
Roqa

LGTM thanks! merging.


undefined type from optional chaining doesn't produce correct generic inference candidate from union

TypeScript Version:  10/18/2019 nightly

Search Terms: optional chaining generic inference undefined
Code
declare function unbox<T>(box: { value: T | undefined }): T;
declare const su: string | undefined;

const b1 = { value: su?.length };
// Incorrect error - T inferred to be number | undefined
const v1: number = unbox(b1);

// No error
const b2 = { value: su?.length as number | undefined };
const v2: number = unbox(b2);

// No error
const b3: { value: number | undefined } = { value: su?.length  };
const v3: number = unbox(b3);

Expected behavior: In all cases, T should be inferred to be number
Actual behavior: When the undefined part of the union of the type of value originates in an optional chaining, it doesn't infer correctly
Playground Link: http://www.typescriptlang.org/play/?ts=Nightly&ssl=1&ssc=1&pln=15&pc=1#code/CYUwxgNghgTiAEAzArgOzAFwJYHtXzQCMcAPAHgBUA+ACmJIC54BveANygmRCYvgB8CqUIiyoQweAF8AlLwDcAWABQoSLARg8AZwzxtyJrphiA5gKEixEpcpVbUu+IQCM8ALwt2nbkeQB+ADoIEFRTDAALaVsAehj4AEl0HBg4THgQVJT4AFp4PjFETLhJDBxnBFRkAFtCTIs0K3Fgex09NhcmKtr6zyJSOhcZWxU4+AA5cuKU1sc9QgAmDy8OLh59AODQ8KiobXhuupgG4RBRZujZpzYFrpqj5f6SOgXhlVH4yYysmCv5gGYmKxVr4Dvd6oJGmdrJIpMtgT51gYgiEwpF4JdlA5roCwT1jn1UPQ6P83sogA (nightly link)
Related Issues: Nope

cc @rbuckton who was looking at this with us

I think I've come across the same issue. This is my code:
let values = { a: 1 } as { a: number } | undefined;

let a = values?.a;
assertDefined(a); // This does not narrow the type to number
console.log(a.toString()); // Error: Object is possibly undefined

function assertDefined<T>(x: T | undefined | null): asserts x is T {
    if (x == null) {
        throw new Error('Expected a value');
    }
}

Playground link

This is in the 3.7.2 milestone but the fix didn't actually make it in (playground link). Would be good to get this in 3.7.3.

@typescript-bot cherry-pick this to release-3.7


How To Pass MoPub Native Ad To Flutter?

Question
I'm researching how to integrate MoPub's Android and iOS native ads implementation over to Flutter. What data from the native ad received from MoPub in the onNativeLoad method below would need to be passed in order for Flutter to display properly?
Potential Solution
Based on MoPub's documentation for manual native ads integration (on Android) the ad data can be received and passed via an EventChannel in order to display in Flutter's UI. I'm not sure which information from the NativeAd object would need to be passed to Flutter.
     moPubNativeNetworkListener = new MoPubNative.MoPubNativeNetworkListener() {
         @Override
         public void onNativeLoad(final NativeAd nativeAd) {
             Log.d("MoPub", "Native ad has loaded.");
         }
         @Override
         public void onNativeFail(NativeErrorCode errorCode) {
             Log.d("MoPub", "Native ad failed to load with error: " + errorCode.toString());
         }
     };

Developer's usage of MoPub on Flutter would key as it allows access to the major ad networks and thus provides effective monetization. I've created a corresponding StackOverflow post.
Thank you!

@AdamSHurwitz Where are you with this?

@charleshan I have not pursued building out this package for MoPub on Android and iOS. However, based on the development of the rest of the Flutter technical ecosystem it may become a future focus.
Currently, I'm creating an amazing Android experience for Coinverse, the first crypto news app for audiocasts. Based on how Dart/Flutter develops it's ability to handle audio content with a library similar to ExoPlayer for Android, the YouTube library, and foreground services, I'll assess when to move forward with Flutter.

Is there a timeline for this plugin?

Hi,
Were you able to find a solution to integrating MoPub with Flutter?

@ammarhemani, I have not pursued this implementation strategy with Flutter. In addition to building a MoPub solution from the ground up, I also would need to bridge other libraries such as Android's ExoPlayer and YouTube API functionality.
Once Flutter offers rich media libraries I'm open to consider.

This sounds like a use case that's covered by platform views, so I don't think there's anything actionable here at this point. If at some point someone builds this plugin and finds that there is functionality they need in the plugin system in order to do so, please file an issue with the specific request.


How to update the title in languages via PHP

Hello,
I've a small big problem,  how to edit the title of the Woocommerce product via PHP in non-main language with this plugin and polylang?
e.g. I have a post in English, and have addition languages in Thai and Chinese.
If I update the 'post_title' only the main language is updated,  but not the other languages.

you need to switch to the Thai version of the post and edit the title there....
Please read the Polylang documentation and make sure you understand how to use Polylang for editing normal posts before applying to products - it's the same, a Product is a special type of Post.
This plugin does not change the handling of title, it mainly extends the Polylang Post handling for the extra woocommerce fields and concepts, so will close as out of scope of this plugin.


Can't add a new plugin

I'm trying to add the following plugin:
http://blog.ionelmc.ro/2013/10/17/tinymce-formatting-toolbar-buttons/
what's the best way to do so?

Apparently it works out of the box.
Actually there are couple of ways as described in the docs:
Add a new plugin to the tinymce plugins folder - notice that it should be plugin.min.js or plugin.js depend on the version of tinymce that you are using - this will get loaded automatically.
The other way is to just init it like so:
tinyMCE.PluginManager.add('stylebuttons', function(editor, url) {


[Global Offset] 👀Make offset relative to a pre-set default

This will unclutter the UI and make the change easy to understand. For example, if global offset is 0.010, and it was changed to 0.013, display +3 instead.
This will require storing the "default" global offset value somewhere. The default should be settable in metrics, do not assume a value.

Think of the ways global offset can be changed, and when this default value should and should not be updated.


Concurrent limited requests are not sent immediately

So this is a tricky one that's been following us since we started using Guzzle (v4); we found a workaround in Guzzle 5 (in RingPHP); but the issue returned in Guzzle 6.
The issue lies with CurlMultiHandler. When a request in created in a complete or error event (and now in middleware), it is added to the curl multi handle via curl_multi_add_handle. That's all good, but the HTTP request won't be sent until we call curl_multi_exec. The problem is, curl_multi_exec is called in tick() method after curl_multi_select, meaning that the handler will wait for any already sent request to complete before sending the request that was just added to the pool.
In Guzzle 4 I created a custom CurlMultiHandler that only added 3 lines to the original handler. I tried to get them into Guzzle 5, but it wasn't the most efficient method: https://github.com/guzzle/RingPHP/pull/18
After that I discovered that I can set the request's future option to true, and I would get exactly what I wanted, an additional call to curl_multi_exec exactly when I needed it: https://github.com/guzzle/RingPHP/blob/master/src/Client/CurlMultiHandler.php#L162
In Guzzle 6 I see this issue still persists. Here at ManageWP we use Guzzle extensively, so we forked our own server.js to support dynamic request duration and wrote tests for this exact case (every milisecond matters to us). For now I ended up creating a custom multi handler that calls additional curl_multi_exec if needed (kinda like RingPHP). @mtdowling, if I have your green light, I can port those tests and merge the server.js that supports dynamic request duration. With that said, I still don't know a better way to solve this issue. Maybe set a flag after the first call to curl_multi_exec, so any new requests (in addRequest) are sent immediately.
Let me know if I missed something or wasn't clear enough.

I would not want to always call curl_multi_exec again after processing the completed messages as that would significantly increase CPU utilization. However, maybe there's a way to determine if new requests were added to the multi handle while processing messages, and if so, call curl_multi_exec.

Here's what we're using now:
In tick:
// ...
// Step through the task queue which may add additional requests.
P\queue()->run();

if ($this->active &&
    curl_multi_select($this->_mh, $this->selectTimeout) === -1
) {
    // Perform a usleep if a select returns -1.
    // See: https://bugs.php.net/bug.php?id=61141
    usleep(250);
}
while (curl_multi_exec($this->_mh, $this->active) === CURLM_CALL_MULTI_PERFORM);

$this->running = true;

$this->processMessages();

if (!$this->active && !$this->delays && P\queue()->isEmpty()) {
    $this->running = false;
}

I've added $this->running just above and below $this->processMessages();.
Also, in addRequest:
// ...
curl_multi_add_handle($this->_mh, $easy->handle);
if ($this->running) {
    while (curl_multi_exec($this->_mh, $this->active) === CURLM_CALL_MULTI_PERFORM);
    // If a request was completed between the last curl_multi_exec and this one,
    // we should process it right away; otherwise it will get processed only after
    // the next curl_multi_select call.
    $this->processMessages();
}

Does something like that make sense?

We don't want to process messages when adding requests as that can have unintended side effects (e.g., resolving requests and fulfilling promises before the stack unwinds in the promise trampoline causing recursion).
Instead of calling curl_multi_exec for each individual request added during a call to processMessages(), perhaps we can use a single extra curl_multi_exec if we detect that a handle was added while processing messages. This could be done using a simple $state flag on the class:
    private function processMessages()
    {
        $this->state = self::STATE_PROCESSING;
        while ($done = curl_multi_info_read($this->_mh)) {
            $id = (int) $done['handle'];
            curl_multi_remove_handle($this->_mh, $done['handle']);
            if (!isset($this->handles[$id])) {
                // Probably was cancelled.
                continue;
            }
            $entry = $this->handles[$id];
            unset($this->handles[$id], $this->delays[$id]);
            $entry['easy']->errno = $done['result'];
            $entry['deferred']->resolve(
                CurlFactory::finish(
                    $this,
                    $entry['easy'],
                    $this->factory
                )
            );
        }

        if ($this->state === self::STATE_NEEDS_EXEC) {
            $this->state = self::STATE_DEFAULT;
            return true;
        }
        $this->state = self::STATE_DEFAULT;
        return false;
    }

    private function addRequest(array $entry)
    {
        $easy = $entry['easy'];
        $id = (int) $easy->handle;
        $this->handles[$id] = $entry;
        if (empty($easy->options['delay'])) {
            curl_multi_add_handle($this->_mh, $easy->handle);
            if ($this->state === self::STATE_PROCESSING) {
                $this->state === self::STATE_NEEDS_EXEC;
            }
        } else {
            $this->delays[$id] = microtime(true) + ($easy->options['delay'] / 1000);
        }
    }

    /**
     * Ticks the curl event loop.
     */
    public function tick()
    {
        // Add any delayed handles if needed.
        if ($this->delays) {
            $currentTime = microtime(true);
            foreach ($this->delays as $id => $delay) {
                if ($currentTime >= $delay) {
                    unset($this->delays[$id]);
                    curl_multi_add_handle(
                        $this->_mh,
                        $this->handles[$id]['easy']->handle
                    );
                }
            }
        }

        // Step through the task queue which may add additional requests.
        P\queue()->run();

        if ($this->active &&
            curl_multi_select($this->_mh, $this->selectTimeout) === -1
        ) {
            // Perform a usleep if a select returns -1.
            // See: https://bugs.php.net/bug.php?id=61141
            usleep(250);
        }

        do {
            while (curl_multi_exec($this->_mh, $this->active) === CURLM_CALL_MULTI_PERFORM);
        } while ($this->processMessages());
    }

Something like the above could work. What do you think?

@mtdowling That makes sense, and it's also better performance-wise. Although, we have a special use case (or maybe it's not so special) that this solution doesn't fully resolve.
We have a throttling middleware that throttles request to a single server by intercepting a request with a promise:
$promise = new P\Promise([P\queue(), 'run']);

, so the next request we send is added during
// Step through the task queue which may add additional requests.
P\queue()->run();

inside the tick() method, and requests that are added there do not trigger curl_multi_exec() in time and are not sent immediately.
If we were to call curl_multi_exec() and process messages right after P\queue()->run();, there could be new messages in P\queue()->run();, so we would have to put it inside a loop too.
This is what I ended up with:
    /**
     * Ticks the curl event loop.
     */
    public function tick()
    {
        // Add any delayed handles if needed.
        if ($this->delays) {
            $currentTime = microtime(true);
            foreach ($this->delays as $id => $delay) {
                if ($currentTime >= $delay) {
                    unset($this->delays[$id]);
                    curl_multi_add_handle(
                        $this->_mh,
                        $this->handles[$id]['easy']->handle
                    );
                }
            }
        }

        do {
            // Step through the task queue which may add additional requests.
            P\queue()->run();

            $queueClean = true;

            if ($this->state === self::STATE_NEEDS_EXEC) {
                $queueClean = false;
                do {
                    while (curl_multi_exec($this->_mh, $this->active) === CURLM_CALL_MULTI_PERFORM);
                } while ($this->processMessages());
            }
        } while (!$queueClean);

        if ($this->active &&
            curl_multi_select($this->_mh, $this->selectTimeout) === -1
        ) {
            // Perform a usleep if a select returns -1.
            // See: https://bugs.php.net/bug.php?id=61141
            usleep(250);
        }

        do {
            while (curl_multi_exec($this->_mh, $this->active) === CURLM_CALL_MULTI_PERFORM);
        } while ($this->processMessages());
    }

    private function addRequest(array $entry)
    {
        $easy = $entry['easy'];
        $id = (int) $easy->handle;
        $this->handles[$id] = $entry;
        if (empty($easy->options['delay'])) {
            curl_multi_add_handle($this->_mh, $easy->handle);
            $this->state = self::STATE_NEEDS_EXEC;
        } else {
            $this->delays[$id] = microtime(true) + ($easy->options['delay'] / 1000);
        }
    }

It might contain some redundant code, but it passes all our tests. The only different behavior is, the first call to tick() is blocking until a first response is received by cURL, and it kinda conflicts with what I said in https://github.com/guzzle/guzzle/issues/1127#issuecomment-112437287.
Thoughts?

I think this is adding up to a lot of changes to address more or less an edge case, and I'd prefer to not place all of that additional logic in the main curl multi loop if possible.
Maybe there's a better way that does what we both want but in fewer code changes that don't really affect the performance of the main curl loop. Maybe it would be easier to asses this in a pull request.


Remove artifact directories for libraries/build scripts from the current workspace

For recent versions of rust, compilation may create directories which match
the "/**/lib{}*" glob, so test the file type and remove these as well.

Hey!
Do you have an example?

This is on an internal project using nightly-2021-02-11, so I can't share the source code, but here's the error from the docker build:
   Compiling entrypoints v0.1.0 (/opt/app/footie-rs/entrypoints)
    Finished release [optimized + debuginfo] target(s) in 4m 19s
Error: Failed to cook recipe.
Caused by:
    0: Failed to clean up dummy compilation artifacts.
    1: failed to remove file `/opt/app/footie-rs/target/release/build/libfootie-e4e8542fac544050`
    2: Is a directory (os error 21)
The command '/bin/sh -c cargo chef cook --release --recipe-path recipe.json' returned a non-zero code: 1
ERROR: Job failed: exit code 1

On my local machine (which is a mac), I see
➜  footie-rs git:(feature/cargo_chef_test) cd target/debug
➜  debug git:(feature/cargo_chef_test) find **/libfootie* -type d
build/libfootie-98a1cf61cfcb223f
build/libfootie-98a1cf61cfcb223f/out
build/libfootie-ad274a4a08c4e09a
build/libfootie-ad274a4a08c4e09a/build_script_build-ad274a4a08c4e09a.dSYM
build/libfootie-ad274a4a08c4e09a/build_script_build-ad274a4a08c4e09a.dSYM/Contents
build/libfootie-ad274a4a08c4e09a/build_script_build-ad274a4a08c4e09a.dSYM/Contents/Resources
build/libfootie-ad274a4a08c4e09a/build_script_build-ad274a4a08c4e09a.dSYM/Contents/Resources/DWARF
incremental/libfootie-2z8us7gt3o99j
incremental/libfootie-2z8us7gt3o99j/s-fwm719acp4-1qkl7ns-16qt4kmsoogoj

(The hashes are different probably because the project changed between these builds.)

I guess it could be related to our specific build, and not the version of rust...

Also note that the project in question is creating python bindings for a rust library using pyo3, so that might be another reason that the directory is created.
It also has a build.rs script, which doesn't seem to be doing anything special, so I can try removing that to see if it makes a difference.

So, the build.rs uses the built crate, which outputs files to ./target/debug/build/libfootie-98a1cf61cfcb223f/out/built.rs.  I think this is the main culprit.
Do you need any further information?

The change is quite small in scope so I'm happy to merge based on the information you provided 🙇🏼

Thank you!


Syntax Error: unexpected tLABEL

Getting the following error when trying to load the gem:
/gems_path/.gem/ruby/1.9.1/gems/slack-notifier-2.1.0/lib/slack-notifier.rb:6:in `require_relative': /gems_path/.gem/ruby/1.9.1/gems/slack-notifier-2.1.0/lib/slack-notifier/util/link_formatter.rb:20: syntax error, unexpected tLABEL (SyntaxError)         def initialize string, formats: [:html, :markdown]                                        ^ /gems_path/.gem/ruby/1.9.1/gems/slack-notifier-2.1.0/lib/slack-notifier/util/link_formatter.rb:63: syntax error, unexpected keyword_end, expecting $end         from /gems_path/.gem/ruby/1.9.1/gems/slack-notifier-2.1.0/lib/slack-notifier.rb:6:in `<top (required)>'         from /gems_path/.gem/ruby/1.9.1/gems/bundler-1.11.2/lib/bundler/runtime.rb:77:in `require'         from /gems_path/.gem/ruby/1.9.1/gems/bundler-1.11.2/lib/bundler/runtime.rb:77:in `block (2 levels) in require'         from /gems_path/.gem/ruby/1.9.1/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'         from /gems_path/.gem/ruby/1.9.1/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'         from /gems_path/.gem/ruby/1.9.1/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'         from /gems_path/.gem/ruby/1.9.1/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'         from /gems_path/.gem/ruby/1.9.1/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'         from build.rb:3:in `<main>'
I'm running Ruby version 1.9.3p551

As of 2.0 support for ruby 1.9.3 was dropped so I could use keyword arguments (1.9.3 has been EOL for more than two years).
If you drop back to 1.5.1 you should be fine, but check it's readme since the call signature has change a little bit. Sorry the change there wasn't better called out in the changelog, I took way to long for 2.0 and forgot a few things 😁

Thanks for the clarification! I agree with you that the readme/changelog should be updated with this information.


ELASTIC_APM_SERVICE_NAME ELASTIC_APM_SECRET_TOKEN

add ELASTIC_APM_SERVICE_NAME and ELASTIC_APM_SECRET_TOKEN so that apm can be connected with

good catch, thx @zffocussss !

you are welcome,as your plugin help me as well.


Created admin account cause error

Thanks a lot for this project.
npm start works fine.
I used my root account created couple Admin Group and Admin users.
Then I created an account, testadmin, and loged in.
Then I use my root account to link this testadmin with an created Admin user.
Then I use testadmin log out and log in again, it shows me Admin panel, cool.....
However, if I click Admins, Admin Group buttons, it does not really work properly, the Admin Group does not shows up any record,
Sometimes, after i lick Admins, I got 2 accounts records, But If I click Admin Group, the page does not even change
and I got these errors:
`Debug: pre, error
{"msec":0.5672759991139174,"assign":"ensureAdminGroup","error":{"data":null,"isBoom":true,"isServer":false,"output":{"statusCode":400,"payload":{"statusCode":400,"error":"Bad Request","message":"Missing admin group membership to [root]."},"headers":{"content-type":"application/json; charset=utf-8","strict-transport-security":"max-age=15768000","x-frame-options":"DENY","x-xss-protection":"1; mode=block","x-download-options":"noopen","x-content-type-options":"nosniff","cache-control":"no-cache","vary":"accept-encoding","content-encoding":"gzip"}}}}

Debug: pre, error
{"msec":0.5735299997031689,"assign":"ensureAdminGroup","error":{"data":null,"isBoom":true,"isServer":false,"output":{"statusCode":400,"payload":{"statusCode":400,"error":"Bad Request","message":"Missing admin group membership to [root]."},"headers":{"content-type":"application/json; charset=utf-8","strict-transport-security":"max-age=15768000","x-frame-options":"DENY","x-xss-protection":"1; mode=block","x-download-options":"noopen","x-content-type-options":"nosniff","cache-control":"no-cache","vary":"accept-encoding","content-encoding":"gzip"}}}}

Debug: pre, error
{"msec":0.4814910013228655,"assign":"ensureAdminGroup","error":{"data":null,"isBoom":true,"isServer":false,"output":{"statusCode":400,"payload":{"statusCode":400,"error":"Bad Request","message":"Missing admin group membership to [root]."},"headers":{"content-type":"application/json; charset=utf-8","strict-transport-security":"max-age=15768000","x-frame-options":"DENY","x-xss-protection":"1; mode=block","x-download-options":"noopen","x-content-type-options":"nosniff","cache-control":"no-cache","vary":"accept-encoding","content-encoding":"gzip"}}}}`

Thanks for opening an issue.
The key thing that sticks out to me is:

Missing admin group membership to [root]

Out of the box, this is to be expected. By default we don't let administrators manage other administrators unless they're part of the root group. And I don't suggest adding administrators to that group either. What I do suggest is to change route authorization to fit your specific needs.
Here is an example of where we add this check to a route config: https://github.com/jedireza/aqua/blob/3a00d782d4c053583ef0a4e1a481ee6d49f2eac3/server/api/admins.js#L34-L36
Here is where you can put new authorization "preware" (similar to ensureAdminGroup).
https://github.com/jedireza/aqua/blob/3a00d782d4c053583ef0a4e1a481ee6d49f2eac3/server/auth.js#L74
Also take a look at the route config auth options:
http://hapijs.com/api#route-options


how to reduce loading delay in ionic app

Ionic version:  (check one with "x")
[ ] 1.x
[ ] 2.x
I'm submitting a ...  (check one with "x")
[ ] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior:

Expected behavior:

Steps to reproduce:

Related code:
insert any relevant code here

Other information:

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):
insert the output from ionic info here

Thanks for the issue! Please visit our forum or slack channel for questions about the framework. :smile:
If you believe this is an issue with the framework, please create a new issue with answers to the pre-populated questions:


Does this support Windows?

Does this support the latest rust on Windows as well? Also will this check for rust updates before compile to be sure the current build tool chain is installed/up to date?

I didn't test on windows, but I don't see any reason why it should not work on windows.

@AraHaan would you mind test it on windows?

Sure, if I had an test rust python module / pachage on pypi that would require building in rust.

if you have windows with rust toolchain you can use example from this repo

ok


Provide async authenticator for connect

Hi there,
In our browser based use case, we use a JWT to authenticate with NATS.
With nats.ws version 1.0.0-117, it is possible to provide an authenticator like this: () => ({ jwt: token })
What we would like to do is to return a Promise instead of a plain object, because our access to the token is Promise-based, in case the token needs to be fetched.
With the current implementation, we would need to eagerly request a token and set it in a closure so that we can provide it synchronously in the callback, but this is prone to volatile errors.

While this sounds like a good idea, it creates a number of ripples that potentially could create a number of other issues, as the authentication path is subject to delays that won't be supported during the connection sequence - as expected response from the INFO protocol is time-sensitive.
While the connection process is asynchronous, you are aware of when this happens and can easily delay your connection until you have retrieved the necessary credentials.

While this sounds like a good idea, it creates a number of ripples that potentially could create a number of other issues, as the authentication path is subject to delays that won't be supported during the connection sequence - as expected response from the INFO protocol is time-sensitive.
While the connection process is asynchronous, you are aware of when this happens and can easily delay your connection until you have retrieved the necessary credentials.