[$500] Manage members - Page is blinking after removing user from Workspace

If you haven’t already, check out our contributing guidelines for onboarding and email<EMAIL_ADDRESS>to request to join our Slack channel!

Action Performed:

Launch the app
Go to Setting > Workspace > Manage members
Invite few members(if you haven't)
Delete the member

Expected Result:
Page is not blinking after removing user from Workspace
Actual Result:
Page is blinking after removing user from Workspace
Workaround:
Unknown
Platform:

Where is this issue occurring?

Web
iOS
Desktop App
Mobile Web

Version Number: <IP_ADDRESS>
Reproducible in staging?: Yes
Reproducible in production?: Yes
Email or phone of affected tester (no customers): any
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
https://user-images.githubusercontent.com/93399543/167718604-608be40f-3ae8-406f-8e0b-e96cf02e1b14.mp4
Expensify/Expensify Issue URL:
Issue reported by: Applause
Slack conversation:
View all open jobs on GitHub

Proposal
When we remove a member removeMembers function gets called and inside it we update the policy after removing the users using Onyx.set
https://github.com/Expensify/App/blob/572f6cb1b161fbb90fad17569f10c4af4926e773/src/libs/actions/Policy.js#L296-L302
We are doing the same thing again here. It's not needed and removing it will solve this.
https://github.com/Expensify/App/blob/572f6cb1b161fbb90fad17569f10c4af4926e773/src/libs/actions/Policy.js#L519-L527
I propose that following changes -
function subscribeToPolicyEvents() {
-    _.each(allPolicies, (policy, key) => {
+    _.each(allPolicies, (policy) => {
        const pusherChannelName = `public-policyEditor-${policy.id}${CONFIG.PUSHER.SUFFIX}`;
        Pusher.subscribe(pusherChannelName, 'policyEmployeeRemoved', ({removedEmails, policyExpenseChatIDs, defaultRoomChatIDs}) => {
-            const policyWithoutEmployee = _.clone(policy);
-            policyWithoutEmployee.employeeList = _.without(policy.employeeList, ...removedEmails);
-
-            // Remove the members from the policy
-            Onyx.set(key, policyWithoutEmployee);

            // Refetch the policy expense chats to update their state
            if (!_.isEmpty(policyExpenseChatIDs)) {
                Report.fetchChatReportsByIDs(policyExpenseChatIDs);
            }

@thesahindia I went through your profile. Based on what I see, policyEmployeeRemoved is an event subscribed via Pusher, so I am guessing it is to sync between devices. If we remove this, it might not sync.

I agree with @mananjadhav — we're going to need that value in Onyx & for Pusher.

Switching this back to Weekly since we're still open to more proposals.

Page is not blinking after removing the user from Workspace

what do we mean by "blinking" ? what's the expected CX here?

if by "blinking", the reference is to the reload/refresh of members list after a user is deleted, then it's not reproducible on the web app.
https://user-images.githubusercontent.com/26037206/169663776-db84c117-2522-43fe-93ea-6419b2a2709e.mp4

Thanks for the comment @grvsood. I am guessing you can reproduce it when you would have some more members than just the admin. Here's the video that I could reproduce.
https://user-images.githubusercontent.com/3069065/169666306-49b93c7f-c71b-40a8-b452-69df4b406fe8.mov

Proposal
When removeMembers method is called, we update the persistent storage. code
We are also subscribed to policyEmployeeRemoved policy to reflect the change on other devices. code.
Listening to this policy change and updating the storage is redundant when the change in employeeList attribute is on the same device as persistent storage is already updated when called by removeMembers method.
Hence adding below check we can skip updating the persistent storage  ( aka Onyx ) on current device.
Changes to subscribeToPolicyEvents method
function subscribeToPolicyEvents() {
  _.each(allPolicies, (policy, key) => {
    const pusherChannelName = `public-policyEditor-${policy.id}${CONFIG.PUSHER.SUFFIX}`;
    Pusher.subscribe(
      pusherChannelName,
      'policyEmployeeRemoved',
      ({removedEmails, policyExpenseChatIDs, defaultRoomChatIDs}) => {
        const policyWithoutEmployee = _.clone(policy);
        policyWithoutEmployee.employeeList = _.without(
          policy.employeeList,
          ...removedEmails,
        );

+         Onyx.get(key).then((existingPolicyValue) => {

+           if (existingPolicyValue != undefined) { // I need to validate if this check is required or not.
+             if ( existingPolicyValue.employeeList != undefined &&
+             JSON.stringify(existingPolicyValue.employeeList.sort()) !=
+              JSON.stringify(policyWithoutEmployee.employeeList.sort())
+           ) {
               Onyx.set(key, policyWithoutEmployee);
+            }
+          } else {
+            Onyx.set(key, policyWithoutEmployee);
+          }
+         });

And thus accordingly we need to expose the Onyx.get method as well.
We can do that by making following change to Onyx.js in react-native-onyx.
const Onyx = {
    connect,
+   get,
    disconnect,
    set,

@thesahindia I went through your proposal. Based on what I see, policyEmployeeRemoved is an event subscribed via Pusher, so I am guessing it is to sync between devices. If we remove this, it might not sync.

Hi @mananjadhav, I think there's a misunderstanding. I am not suggesting the removal of policyEmployeeRemoved. I am suggesting that we remove line 523-527
https://github.com/Expensify/App/blob/572f6cb1b161fbb90fad17569f10c4af4926e773/src/libs/actions/Policy.js#L523-L527
Because we are executing the same code already when removeMembers gets called

I didn't get the pushed notification part, can you explain why we need that particular code for pushed notification implementation as I was unable to find that use.

Doubling time!

not overdue

@mananjadhav Oooh, I think I understand what @thesahindia is getting at with his proposal. We were subscribed to changes on the policy to begin with, and that the Onyx.set on line 527 updates it again, which causes is to redraw it again, despite the fact that nothing has changed. Is that correct @thesahindia?
Would you please perform a test where you are logged into User A and User B who are both on the same policy, then as User A, remove User C, and verify that User B's user list reflects the change?

@deetergp, yeah I have tested that and it's working fine.

Would you please perform a test where you are logged into User A and User B who are both on the same policy, then as User A, remove User C, and verify that User B's user list reflects the change?

I think we have another bug, while testing this I am sometimes seeing same user two times in the member list of the announce room and the removed member is still showing up even after tons of refreshes

Thanks for the clarification here @deetergp. Sorry about the confusion @thesahindia.

It doesn't work right now in Main so I guess we don't have this implemented.

@deetergp Could you shed some light on @thesahindia's comment that the sync doesn't exist as of now? I am not sure about that part of the feature.

I think we have another bug, while testing this I am sometimes seeing same user two times

@thesahindia If you have the reproducible steps for the bug, please post it on the slack channel to track and log an issue.

not overdue - we're still reviewing proposals

It doesn't work right now in Main so I guess we don't have this implemented.

@thesahindia Okay, that's good to know. It's a feature we should add, but it is definitely out of scope for this issue. Just to confirm, with your  proposal, both the the user doing the removing and the user being removed see the change? The remover sees the the user being removed disappear from the list and the user being removed no longer sees the room?

The remover sees the the user being removed disappear from the list

@deetergp, I think the sync is broken or something. After removing a member, it won't go away from your room member list. It takes too much time to update. I tested this on main.

user being removed no longer sees the room?

Yeah this works fine.

not overdue, proposals are being reviewed

@thesahindia I'm not sure I understand. I'm checked out to main and logged in as the workspace admin. When I remove User B, I see that user drop off the list of workspace members, so that seems to be working correct. And if I am logged in as User B, I don't see myself having been removed as the removal occurs, but if I try to reply, refresh or do anything else in that chat, I see a message telling me that User B is no longer a part of that workspace. So that's working well enough in main. Though ideally it should probably happen immediately, it's outside of the scope of this issue.
If you proposal doesn't change how that works, then let's go with your proposal.

Though ideally it should probably happen immediately, it's outside of the scope of this issue.

@deetergp I am guessing thats what @thesahindia meant here.

@thesahindia I'm not sure I understand. I'm checked out to main and logged in as the workspace admin. When I remove User B, I see that user drop off the list of workspace members.

Yeah, that works fine. I misinterpreted the question and thought it was about announce room's members list.

@deetergp Are we good here to accept @thesahiindia's proposal?
@grvsood Sorry I saw the comments I didn't give feedback on your proposal (I thought I did). While your solution might work, performing the process of Onyx.get, etc. doesn't look like a good solution for such a trivial case. Also, my experience with JSON.stringify with objects, dates, etc. is unreliable, and comparing them with sort is inefficient. We don't want to break something when we add more data to the objects or have complex structures like graphs with circular dependency.

Are we good here to accept @thesahiindia's proposal?

@mananjadhav Yes, let's go with @thesahindia's solution. 👍

@adelekennedy, the job is no longer available, can you please create a new one?

Not overdue. We've accepted a proposal so setting it back to weekly.

I missed adding the weekly label

Also, bumping @adelekennedy to re-add the job in Upwork so @thesahindia can start work on it.

reopened! @thesahindia do you mind applying here?

reopened! @thesahindia do you mind applying here?

Applied ✅

@thesahindia Any updates for me on this one?

@mananjadhav, I have pushed the code now.

Issue not reproducible during KI retests. (First week)

Still going through tests - not overdue

Issue not reproducible during KI retests. (Second week)

@adelekennedy It looks like this one is good to go and we should pay @thesahindia for their effort 👍

@deetergp ty ty, I'll pay this out in 7 days!

This hit production but the title wasn't updated

Issue not reproducible during KI retests. (Third week)

@adelekennedy  Quick bump. The regression period is complete. PR was deployed 8 days back.  For some reason title wasn't updated.

Issue not reproducible during KI retests. (Fourth week) Are we good to close this?

@mvtglobally Payments are pending for this one. We can close this out once that is through.
@adelekennedy quick reminder

Hmm, do we know why the title didn't change? Happy to pay out but I'm concerned that something is broken here @deetergp

No reporting bonus, C+: @mananjadhav, Contributor: @thesahindia

Bump for upwork.
cc: @adelekennedy

bump @adelekennedy @deetergp for Upwork

Strange - I'm not getting any notifications from this GH, I just sent the payment through with a bonus for waiting

Thanks @adelekennedy for the quick TAT and bonus 🤑


VLAZ: Watch onestopcontentsolutions.com

VLAZ requests the watch of the watch_keyword onestopcontentsolutions\.com. See the MS search here and the Stack Exchange search in text, in URLs, and in code.

onestopcontentsolutions\.com has been seen in 1 true positive, 0 false positives, and 0 NAAs.

Approved by Jeff Schaller in Charcoal HQ


Test specs and testing in general

Test specs and testing in general hyperlinked to https://blog.botframework.com/2018/02/01/contributing-luis-microsoft-recognizers-text-part-3/ is not working.

@jimongit,it seems the link you shared is incorrect. The correct link is https://blog.botframework.com/2018/02/12/contributing-luis-microsoft-recognizers-text-part-3/
Where did you see the link you shared? Also, in the correct link all specs/URLs seem correct. Can you give more details about what you meant?
I'll close this issue for now, but please reply on it and we can re-open as needed.


Compress Data in EntityStore

Using the :compress option, compress and decompress data over the wire
to Redis. This improves bandwidth consumption, RAM usage, and reduces
the amount of storage space needed to run your Redis cache server.

1. Why did you implement compression only for this gem? Is this approach applicable to `redis-store`? In this way, the entire set of gems can benefit from it.

I don't believe it's actually necessary in the main gem for a few reasons. For starters, the only other place I can think of where the size of a cache fragment would actually get to the point of needing compression would be redis-activesupport, which already benefits from ActiveSupport::Cache::Entry's use of compression on objects above 1K. I took a similar approach in this gem.

2. Assuming very low latency between the app server and Redis server, is compression worth? Compression and decompression will have their own downsides like memory allocation, CPU consumption, GC pressure. Did you run benchmarks to understand the effects of compression on the app that uses it, and what's the memory savings for Redis?

Compression is possibly not worth it, which is why it's off by default. The reason why I built this was because an application we maintain at work was hitting the upper limit of AWS bandwidth allocation between ElastiCache and the app server(s), which apparently is 15Gbps. I opened this pull request primarily to show you and the rest of the core team what we were doing, but it's also where we can collect test results and benchmarks to make sure this is truly a good idea.

3. Would this require a major release bump (assuming SemVer)? If I have an app running this gem, I turn on compression, am I still able to read/write already existing data from Redis? Or what if I want to switch adapter, from builtin solution to `snappy`? Should we think of a migration tool?

I was trying to make it relatively painless to turn on compression, so when you read something from Redis that isn't compressed, you won't get an error. That said, switching compression algorithms at the moment might be a little problematic, you'd have to blow away the cache in order for it to work properly.

@tubbo thanks, your comments make sense.
I'll try to review the code soon. To be clear, is this PR an extraction of already existing code used in your production app?
Anyone else in @redis-store/core-team has an opinion?

@tubbo Gotcha. Let us to know how it goes. Please make sure to give credit to the original code. 👍

Initial testing proved that a lot of assumptions I had about Zlib and Rack::Cache were fundamentally wrong 🤣. Dealt with a lot of garbled text and incomplete responses until my teammate @MMartyn discovered that the encoding coming out of Zlib::Inflate was actually ASCII, not UTF-8. Additionally, it turns out that you can't pass options down through Rack::Cache, which I'm probably going to open a proposal PR on that project about. Right now, the option is configured by setting a value on the Redis::Rack::Cache module, which isn't ideal but it's the only way I can think of getting this to work without additional code in rack-cache.

Quick update on this...
We were able to do some real-world load testing on a staging server and found that, while overall time is pretty much the same due to the application needing to compress/decompress the data as it comes over the wire, throughput to the Redis server was cut by almost 80%. We did this load test yesterday, November 7th, 2019.
As you can see, the load for Rack::Cache in the application pretty much stays the same throughout the last seven days:

However, during the last load test (prior to enabling compression), this is what the traffic to Redis looked like:

And now, after compression:

As you can see, the same amount of load applied to the application is sending almost 80% less traffic to Redis.
So what does this mean?
This feature is certainly not something that every application is going to need, which is one reason why it will remain off by default.
I'm going to merge this because it seems to have little effect on the application's memory and CPU usage, and provides a benefit for large-scale applications that rely on HTTP cache reads to maintain performance.

Quick update on this...
We were able to do some real-world load testing on a staging server and found that, while overall time is pretty much the same due to the application needing to compress/decompress the data as it comes over the wire, throughput to the Redis server was cut by almost 80%. We did this load test yesterday, November 7th, 2019. Compression was enabled on November 3rd, 2019.
Over the last seven days, the load for Rack::Cache in the application pretty much stays the same:

You can see when compression was enabled on the 3rd, as the get time decreases and the middleware time increases.
However, during the last load test (prior to enabling compression), this is what the traffic from Redis to the app servers looked like:

And now, after compression:

As you can see, Redis is now sending approximately 80% less data back to the application over the wire, under the same amount of load stress.
So what does this mean?
This feature is certainly not something that every application is going to need, which is one reason why it will stay off by default.
I'm going to merge this because it seems to have little effect on the application's memory and CPU usage, and provides a benefit for large-scale applications that rely on HTTP cache reads to maintain performance.

@tubbo Thanks for taking care of this and for the follow up from the production standpoint. My apologize if I didn't provide a review in time. Please let us to know how it goes in the long run. Cheers!

No problem. Seems to be going well for the site we deployed it to. :)


Audioplayer repeats

Deployed to: http://staging.quran.com:32769

Deployed to: http://staging.quran.com:32780

Deployed to: http://staging.quran.com:32794

UI reviewed and code reviewed. All Good.

thank you sir! LEts merge this


Implemented data(name, value)

New feature, fixes #4.

This is looking really good, a couple of notes:

There are some leftovers in the test (beforeEach, afterEach, typeof base.after, etc)
See the two notes in the code

Everything else looks perfect, I'll merge it when changed, thank you for the pull request!

Should i fix it two in the .attr() plugin?

Oh wow, totally, I completely missed that! Thanks :smile:

perfect :+1:


[MM-14355] Show correct webhook profile picture on post icon override enabled

Summary
Show correct webhook profile picture on post icon override enabled
Ticket Link
Jira ticket: MM-14355
Device Information
This PR was tested on: [iOS simulator, Android emulator]

@enahum The in-app notification is working as expected. See screen recording with the following simulations of webhooks:

1st notificarion - showing user profile icon when override profile picture is set to false even if wehook has icon_url
2nd notification - showing webhook icon_url when override profile picture is set to true
3rd notification - showing default webhook icon when no icon_url from webhook

@saturninoabril, don’t forget to merge and cherry-pick ;)

@enahum Thanks for the reminder and yeah I missed it yesterday :)


[Bug] Votekicks being deemed as "not possible" when they are

I've noticed that whenever a player using TF2BD joins a match and a votekick is requested by TF2BD the tool will fail to start the votekick for a good 5-15 seconds after joining the match. It says this is because 0% of friendly players are connected, but this happens even when having a full team.

That was added to make sure the vote doesn't fail, because team mates are still joining. When they've chosen a class they could see the vote window, but iirc couldn't vote.

Set Autp votekick delay to 0 in the settings to disable the new behavior.

Ah, I see. My bad, I believed this was a bug.


Add helm 3.8.2 to PipeCD prerequisites

What this PR does / why we need it:
Helm 3.8.2 required when running PipeCD in local environment
Helm is used to execute make run/pipecd
https://github.com/pipe-cd/pipecd/blob/633f8f143fb2c0042215981e68609344eded6136/Makefile#L108
https://github.com/pipe-cd/pipecd/blob/633f8f143fb2c0042215981e68609344eded6136/Makefile#L109
Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a user-facing change?:

Thank you for your contributions.
Please leave a comment cla sign to sign CLA assignment and fill NONE at Does this PR introduce a user-facing change?:

cla sign

/cla sign

cla sign

should be /cla sign

/cla sign

@knanao

fill NONE at Does this PR introduce a user-facing change?:

How should I do it?🙇

@TonkyH
Sorry, my explanation wasn't clear.
Please update the PR description like below.
Does this PR introduce a user-facing change?:

NONE

@knanao
Thank you so much for your detailed explanation!!
Fixed!🚀


Additional tests and tweaks for CRS_Tests.py for logging

Finally got a chance to review both PRs thanks guys!

Conflicts have been merged, should be good to go!


Raise exception when empty filter value provided.

This change is

Coverage increased (+0.02%) to 93.984% when pulling 2e1f846df031b2f0ac2c5d143c6116bf933f971c on maruqu:master into<PHONE_NUMBER>0f5fcbfd2ff4cc530ba9308976ca1a on socialwifi:master.


Added PowerShell and PSConfig steps to remove-a-server-from-a-farm-in-sharepoint-2013.md

https://github.com/MicrosoftDocs/OfficeDocs-SharePoint/issues/1810

@TroyStarr can you review?

@JohanFreelancer9 Copy editing is needed for this PR. Thanks.


DOC: add community and ecosystem sections

This PR addresses a request to distinguish between the BIDS specification and its ecosystem @franklin-feingold
what I did:

Put each sentence on its own line ... no line breaks within a sentence --> This will make inspection of the diff much easier in the future
added a short section stating that we are an open community
added section to distinguish BIDS specification vs. ecosystem
put link info from bottom into its own section and turn it into list

thank you for putting together @sappelhoff ! I had a minor suggestion - overall I think it looks good and denotes the differences

I'll go ahead and merge this now. The last open point was whether to mention "openneuro" or rather "bids-examples" in a paragraph.
This can be resolved in a later PR.


Improve presentation of add Member dialog

Fixes #6499
This PR:

Adds 'sticky' property so that a dialog can support content where header and footer are sticky
Wires this into add members dialog

Result:

To Test:

Create a few project roles
Go to the local cluster -> Cluster -> Projects/Namespaces.
Choose a project and from the three dots, choose 'Edit Config'. Click 'Add' beneath members.
Shrink the height of the browser window
Verify that the middle content of the dialog scrolls - as shown above

@aalves08 Can you review please?

Going to take a look now @nwmac

@aalves08 Updated with you suggestion - can you take a quick look again - thanks!


Use buffers for sample data

Issue #56 explores the idea of using buffers as provided by the buffered commands API as a source for bitmap data.
We could also use buffers for sample data.
This is probably significantly easier to achieve than for bitmaps - our enhanced samples generator could fairly easily be adapted to use buffers.
This could allow for the programatic generation of samples on the VDP.
We could allocate a block of buffer IDs to be used for samples.  The existing "upload sample" command could be changed to automatically place its data into a buffer and then instantly be available for use with other buffered command API calls.

Deleting a buffer would probably be effectively "safe" - the EnhancedSamplesGenerator class should be able to be adjusted to cope with its source buffer being deleted...
Quite what we should do if a buffer is replaced is another question.
Ideally deleting a buffer that is being used for a sample should remove that sample from the sound system, as if the "clear sample" command were used.

storing samples in buffers was added in #61


Add a lazy DFA.

A lazy DFA is much faster than executing an NFA because it doesn't
repeat the work of following epsilon transitions over and and over.
Instead, it computes states during search and caches them for reuse. We
avoid exponential state blow up by bounding the cache in size. When the
DFA isn't powerful enough to fulfill the caller's request (e.g., return
sub-capture locations), it still runs to find the boundaries of the
match and then falls back to NFA execution on the matched region. The
lazy DFA can otherwise execute on every regular expression except for
regular expressions that contain word boundary assertions (\b or
\B). (They are tricky to implement in the lazy DFA because they are
Unicode aware and therefore require multi-byte look-behind/ahead.)
The implementation in this PR is based on the implementation in Google's
RE2 library.
Adding a lazy DFA was a substantial change and required several
modifications:

The compiler can now produce both Unicode based programs (still used by the
NFA engines) and byte based programs (required by the lazy DFA, but possible
to use in the NFA engines too). In byte based programs, UTF-8 decoding is
built into the automaton.
A new Exec type was introduced to implement the logic for compiling
and choosing the right engine to use on each search.
Prefix literal detection was rewritten to work on bytes.
Benchmarks were overhauled and new ones were added to more carefully
track the impact of various optimizations.
A new HACKING.md guide has been added that gives a high-level
design overview of this crate.

Other changes in this commit include:

Protection against stack overflows. All places that once required
recursion have now either acquired a bound or have been converted to
using a stack on the heap.
Update the Aho-Corasick dependency, which includes memchr2 and
memchr3 optimizations.
Add PCRE benchmarks using the Rust pcre bindings.

Closes #66, #146.

cc @alexcrichton I don't think this PR is possible to review, it's too big. Two things for you I think:

There should be no public API changes.
I've added benchmarks for PCRE, which introduces a dev-dependency on the pcre crate. I think this is causing the test/benchmark build to fail on Windows. I'd be fine skipping benchmarks on Windows, but I'm not sure how to do that. (I guess worst case scenario is to separate benchmarks into a different crate? Blech. Or can I use a feature?)

 There are a few regexes where some performance is left on the table, but I think it's an otherwise pretty strong showing!

Previous to this PR, the regex! macro was "generally slower."  Some thoughts:

Maybe the pcre benchmarks could be behind an off-by-default feature? The Travis CI could then just do cargo bench --features pcre or something like that.
Should we jettison regex_macros entirely? If it's basically always slower and nightly-only, maybe it should be revisited at a later date if at all?
I like to hear the sound of no API changes!

@alexcrichton For optional pcre, I tried doing that, but Cargo gives:
Caused by:
  Dev-dependencies are not allowed to be optional: `pcre`

I guess I could put pcre into [dependencies] proper and make it optional, but that feels wrong.

Should we jettison regex_macros entirely? If it's basically always slower and nightly-only, maybe it should be revisited at a later date if at all?

Hmm. I wouldn't necessarily be opposed, because using it is almost always wrong now. I guess it could still technically be useful if you want to execute a regex without allocating (which limits one to is_match, find and find_iter, I think), but that isn't necessarily a goal of regex!---it just happens to be that way now. (Of course, maybe it should be a goal, I don't know.)
There are also a few crates using it.

cc @Geal @Manishearth @llogiq @kbknapp (We are talking about possibly removing the regex! macro. See benchmarks above.)

Could you modify regex! to use Regex with lazy_static!?

@pczarn I don't think we could use lazy_static! explicitly (since that would require all users to add #[macro_use] extern crate lazy_static;), but I think it might be possible to inline the logic from lazy_static! into regex!. The important bit is making sure that one can still do static RE: Regex = regex!("..."); which can be done today I think. At that point though, I question whether it's worth it at all. (I guess a benefit is that the syntax of the regex is guaranteed to be correct.)

Yeah, but we also have a Syntax check for dynamic regexes with clippy, so the advantage is somewhat diminished.

@BurntSushi about pcre ah oh well, so long as the CI passes on Windows seems fine to me!

@BurntSushi nice work! And thanks for the heads up!

@pczarn Thanks for the review! I've made both of your suggested changes. Nice catch!
I've also separated the PCRE benchmarks into their own sub-crate. We'll run them on Travis but not AppVeyor.

Should we jettison regex_macros entirely? If it's basically always slower and nightly-only, maybe it should be revisited at a later date if at all?

There might be a gap in the logic of assuming regex_macros to be "basically always slower".
Benchmarks only take into account the cost of executing already constructed automata. The automata construction isn't benchmarked.
But keeping the compiled automata in some static variable or field isn't always convenient.
Now, I haven't benchmarked it myself, but from a recent reddit thread numbers on regex performance I'm pretty sure regex! will be much faster than Regex if constructed in place instead of being cached somewhere.
On a different note I'd like to point that the benchmarks probably only compare the new lazy DFA engine with the default PCRE engine. But the default PCRE engine isn't the fastest engine around. If we're serious about performance, then the JIT PCRE engine should be accounted for.
And regex! compiling the regular expression to native code (Like Ragel does) might be a good way to beat the JIT PCRE in the long term.

AIUI regex!() is slower than Regex on usage, excluding instantiation, too.

Wow, this is great! Nice work, @BurntSushi.

@ArtemGr I don't think anyone have claimed that. The implementation just happens to be slow in this case.

There might be a gap in the logic of assuming regex_macros

The benchmarks speak for themselves. :-)

Benchmarks only take into account the cost of executing already constructed automata. The automata construction isn't benchmarked.

The automata construction is benchmarked. I've even taken a profiler to it to improve compile times. It is of course true that compilation is not benchmarked in the benchmarks for searching text, because that seems really strange.
It is of course true that regex! will always have faster compilation time at runtime, since it is at 0.

Now, I haven't benchmarked it myself, but from a recent reddit thread numbers on regex performance I'm pretty sure regex! will be much faster than Regex if constructed in place instead of being cached somewhere.

Could you explain more? I'm not sure I understand. Is there any particular reason why lazy_static! doesn't help you here? You can see an example here: https://github.com/rust-lang-nursery/regex#usage-avoid-compiling-the-same-regex-in-a-loop

On a different note I'd like to point that the benchmarks probably only compare the new lazy DFA engine with the default PCRE engine. But the default PCRE engine isn't the fastest engine around. If we're serious about performance, then the JIT PCRE engine should be accounted for.

I may have made a mistake benchmarking PCRE, but neglecting the JIT is certainly not one of them. I am, in fact, serious about performance! You can check out how PCRE regexes are constructed for the benchmarks here: https://github.com/rust-lang-nursery/regex/blob/master/benches/bench_pcre.rs#L54-L71 --- If I'm doing anything wrong, I would like to correct it.
And I have even made sure that the PCRE bindings are really enabling the JIT too.

We are already beating JIT PCRE now on many of the micro benchmarks. But yes, certainly something like Ragel should probably be in the regex! macro's future, but it may need to be augmented with other things to support sub-capture locations. It's quite a big undertaking!
To be clear: I welcome improvements to the benchmark suite. I wrote many of them (not all), so the suite is likely biased in favor of regexes that are better executed by this library. A possibly better methodology would be to grep source code for use of regexes and use those instead. That is however a lot of work, especially since performance can vary greatly based on the input, which is harder to capture from real world usage.

I guess a benefit is that the syntax of the regex is guaranteed to be correct.

That is actually my favorite feature of the macro. Forcing the regex to be checked at compile time removes an error check I need to handle in my code, even it it's just with unwrap. The performance boost was icing on the cake.

Could you explain more? I'm not sure I understand. Is there any particular reason why lazy_static! doesn't help you here?

When prototyping it's much easier to throw a quick regex!("re").is_match() than look for the right place to throw a static variable into. The principle is aptly covered here: http://www.youtube.com/watch?v=5Nc68IdNKdg.

A lot of users come from interpreted languages where the regular expressions are cached by the language. Idea of caching the regular expression manually might be alien to them.

You can check out how PCRE regexes are constructed for the benchmarks here: https://github.com/rust-lang-nursery/regex/blob/master/benches/bench_pcre.rs#L54-L71 --- If I'm doing anything wrong, I would like to correct it.

Looks good!
And thanks for the updated benchmarks.

@ArtemGr Thanks for responding. There's no question that regex! is a nice ergonomic win, and the only real reason why it's possible is because its runtime cost is free(ish), ceteris paribus. Doing automatic caching of a regex at runtime feels like bad juju to me. ("You mean when my Regex goes out of scope it actually leaves some of its state behind in some global cache somewhere?") I'd rather take it as an opportunity to educate others about the cost centers in their program. With that said, if there's anything more I can do on the documentation front (there's examples now in the API docs and the README added recently) to help facilitate that, then I'd be happy to hear thoughts.

With that said, if there's anything more I can do on the documentation front (there's examples now in the API docs and the README added recently) to help facilitate that, then I'd be happy to hear thoughts.

Cool, next time I peruse the regex docs I'll watch out for any place that could be improved.
Also, beating PCRE-JIT is impressive! I'm impressed!  : )
Congratz!

So, after this DFA update my regex replace operation no longer works anymore.  Example code:
    let code = re.replace_all(&code, "$1");```

This code is to work around an [issue with rust-bindgen](https://github.com/crabtw/rust-bindgen/issues/236) by replacing extra generated bitfields.  After updating to the latest regex crate, this regex no longer works (no matches are found).

Please advise. Thanks.

@jnicholls Probably best to file a new issue. Could you also show some text that should be matched? Thanks.

@BurntSushi Thanks, #169 created.


fix: update function check_list_traces for consistency check with bulk traces

This PR is related to PR 75 in sdtrace_cp.
Summary
Previously, for:
traces = EVCDeploy.run_bulk_sdntraces(uni_list)

The response was a dictionary where the keys were switches and the values were lists of paths.
Now the response is simpler: A list of lists (paths).
This PR updates check_list_traces to use the new version of PUT /traces from sdntrace_cp
Also, previously the following error was obtained:
  File "/home/gretel/repos_kytos/env_for_kytos/var/lib/kytos/napps/kytos/mef_eline/main.py", line 99, in execute_consistency
    circuits_checked = EVCDeploy.check_list_traces(circuits_to_check)
  File "/home/gretel/repos_kytos/env_for_kytos/var/lib/kytos/napps/../napps/kytos/mef_eline/models/evc.py", line 1232, in check_list_traces
    id_trace = str(trace[0]['dpid']) + ':' + str(trace[0]['port'])
TypeError: string indices must be integers

Now it is verified that each trace is not empty to avoid the error.

@viniarck, As you suggested, I created the PR #281.


Enhancement: Process all Outlook message headers, either copying the as-is or translating them to respective Simple Java Mail API calls

When using the EmailConverter.outlookMsgToEmail method, the headers are missing in the Email object returned.  Below is a sample which shows the headers are retrieved when using OutlookMessageParser's parseMsg however using the same input file with EmailConverter shows no headers are retrieved.
package com.test;

import java.io.File;
import java.io.IOException;

import org.simplejavamail.api.email.Email;
import org.simplejavamail.converter.EmailConverter;
import org.simplejavamail.outlookmessageparser.OutlookMessageParser;

public class TestEmailHeaders {

  public static void main(String[] args) {
    OutlookMessageParser msgp = new OutlookMessageParser();
    org.simplejavamail.outlookmessageparser.model.OutlookMessage msg;

    String inputFileName = "YourEmailFile.msg"; //  <--- Update this with the name of an Outlook email file (.msg) on your system.

    try {
      msg = msgp.parseMsg(inputFileName);
      System.out.println(">>> Headers from msg: " + msg.getHeaders());

      Email email = EmailConverter.outlookMsgToEmail(new File(inputFileName));
      System.out.println(">>> Headers from email: " + email.getHeaders());

    } catch (IOException e) {
      // This should never occur during this test.
      e.printStackTrace();
    }

  }
}

In the output from the above, you will notice that the ">>> Headers from msg:" is followed by a number of headers but the ">>> Headers from email: {}" indicates that there are no headers returned from the Email's getHeaders() method.
The problem may stem from the buildEmailFromOutlookMessage method in org/simplejavamail/internal/outlooksupport/converter/OutlookEmailConverter which does not appear to copy the headers from the OutlookMessage to the Email object after converting them from a string.

Correct you are... hmm, I wonder why I left it out.

Released in 7.4.0


Drawable userdata is not nullable

Just a reminder to fix it once changes in OPC are merged.

Still not nullable?
https://github.com/OpenMods/OpenPeripheral-Addons/blob/master/src/main/java/openperipheral/addons/glasses/drawable/Drawable.java#L273-L277


SVG code in infowindows issue

Original HTML code here.
Result:

https://ekaitzht.cartodb.com/viz/ac7ed3aa-a34a-11e4-8f25-0e4fddd5de28/embed_map
SB/5028255

that would be a security issue


int32 value type incorrect on Windows

I encountered an incorrect value type when using int32 values on Window (tested with python 3.11 and 3.12, pip 24.0, pylsl 1.16.1). The minimum example below correctly prints <class 'ctypes.c_int'> both on Linux (current Arch) and MacOS (Darwin, M1).
But on Window 11 it prints <class 'ctypes.c_long'> which would be int64 data type. Also the data transfer fails if you pull the data into an numpy.int32 buffer.
Minimum example:
import pylsl

feature_info = pylsl.StreamInfo(
    name="test",
    type="EEG",
    channel_count=1,
    nominal_srate=1,
    channel_format=pylsl.cf_int32,
    source_id="testid",
)
outlet = pylsl.StreamOutlet(feature_info)

streams = pylsl.resolve_byprop("name", "test", timeout=1)
inlet = pylsl.StreamInlet(streams[0])

print(inlet.value_type)

I also checked the other data types from pylsl.string2fmt on all three OSs and all others works correctly.

Hi @matthiasdold, I added a unit test and it doesn't seem to trigger this error. Can you confirm that the unit test is testing the write thing?
https://github.com/labstreaminglayer/pylsl/blob/main/test/test_format.py

Hi @cboulay ,
thanks for looking into this!
I could not replicate the issue with your test, so I dug deeper. I now understand that this is not a pylsl problem, but an unexpected behavior. Therefore, here in detail, as it might help others in the future:
It all boils down to ctypes.c_long being different data types on Windows and Unix systems - 32bit for Windows and 64bit on Unix.
The problem I encountered can be replicated by this example:
import ctypes
import time
import pylsl
import numpy as np

def test_with_derived_buffer_data_type():

    # Create outlet -> inlet pair
    feature_info = pylsl.StreamInfo(
        name="test",
        type="EEG",
        channel_count=1,
        nominal_srate=1,
        channel_format=pylsl.cf_int32,
        source_id='testid123',
    )
    outlet = pylsl.StreamOutlet(feature_info)
    streams = pylsl.resolve_byprop("name", "test", timeout=1)
    inlet = pylsl.StreamInlet(streams[0])

    # Derive the buffer from the value_type (incorrectly assuming c_long is int64 on all OS!)
    dtype_map = {
        ctypes.c_int: np.int32,
        ctypes.c_long: np.int64,
    }

    # Buffer will be int64, but data is int32
    n_buffer = 10_000                           # this needs to be large enough
    buffer = np.zeros(n_buffer).astype(dtype_map[inlet.value_type])
    data = np.ones(5).astype(np.int32)          # as the outlet was specified for int32

    n_push = 2
    times = []

    # try a few times to get the data
    i = 0
    while i < 10 and len(times) < 1:
        print(times)
        outlet.push_chunk(data[:n_push])            # we need to push more than 1 for it to fail! (oddly, once we pushed more than 1 sample, the next time we just push 1, it also fails.)
        time.sleep(0.5)
        _, times = inlet.pull_chunk(dest_obj=buffer)
        i += 1

    assert (buffer[:n_push] == data[:n_push]).all(), f"{data[:n_push]=} and {buffer[:n_push]=} do not match!"

The problem therefore is by assuming the dtype_map between ctypes and numpy types, as defined above, would work on all OS, which it does not!
One should therefore refrain from comparing the inlet.value_type to ctypes for deriving the streams data type and instead always use the inlet.info().channel_format() and match it against the pylsl.cf_* types (enum values).

The only thing you can rely on is that c_long is at least 32 bytes, meaning that this is not limited to the listed OS, but a general problem. See also https://en.cppreference.com/w/cpp/language/types

Numpy writes in regard to the data model for generic int and long dtypes, claiming that numpy.int is  64bit on 64bit systems and 32bit on 32bit systems and long is an alias of numpy.int*
But numpy offers several C compatible dtypes, e.g.  numpy.intc which is compatible with C int and numpy.uintc which is compatible with C uint.
For intc, it mentions that the alias is platform specific, e.g

Canonical name:
numpy.intc
Alias on this platform (Linux x86_64):
numpy.int32: 32-bit signed integer (-2_147_483_648 to 2_147_483_647).

https://numpy.org/doc/2.1/reference/arrays.scalars.html#numpy.intc
Maybe you want to give those C-compatible dtypes (i.e. numpy.intc and numpy.longlong a try and see how they behave?  (although we should probably also test whether this stil works when the datamodel for outlet and inlet differs)

Thanks for the detail @agricolab!
I will have a look over the weekend and come up with a test in case it fails. For my application (which creates a ring buffer with data type derived from the inlet, I get correct behavior when using inlet.info().channel_format() (https://github.com/matthiasdold/dareplane-pyutils/blob/f83f38647f3a871021847fb9de7eef92b86a27af/src/dareplane_utils/stream_watcher/lsl_stream_watcher.py#L164C1-L174C78)


KAFKA-9137: FETCH_SESSION_ID_NOT_FOUND caused by incorrect FetchSessionCache eviction

KAFKA-9137 describes a case where fetch sessions appear to be prematurely evicted from the FetchSessionCache causing frequent FETCH_SESSION_ID_NOT_FOUND errors and fetch session restarts.
I believe the handling in kafka.server.FetchSession is incorrect in two ways. Firstly it only touches the cache entry if the number of partitions changed between fetches. This means that a fetch session that is in steady state will not have its last used time updated. The second problem is that it supplies the current lastUsedMs as the current time when updating lastUsedMs for the session. As a result, even when the cache entry is touched, the time is not updated. Overall I believe this means that every entry's lastUsedMs will be the time it was created. When the fetch session becomes full, the oldest entry will be evicted, not the least recently used entry. Note that this also breaks the privileged session semantics as recently used ReplicaFetcher sessions will be considered to have been lost as they will not be considered used for longer than MIN_INCREMENTAL_FETCH_SESSION_EVICTION_MS.
The cache itself is currently tested reasonably well, but the integration between FetchSession and FetchSessionCache is not currently tested. I have added a new test that tests the integration point between FetchSession and FetchSessionCache by adding new sessions and incrementally fetching them to check whether the right session is evicted.

I think it'd probably be good to add another test of this behavior. I'll think about any other tests we may be missing for the integration between the FetchSessionCache and the FetchSession code.

Thanks for this, @lbradstreet.  I think this is a long-standing bug that led to us not properly prioritizing larger fetch requests and replica fetch requests.

@cmccabe I renamed the test and have also added a test for the privileged session management which I thought needed more testing. Let me know what you think and whether you think anything else is required.

LGTM


Fix sort command

Fixes sort command. It was implemented but accidentally removed while resolving a merge conflict... oops. lol

LGTM! 🤣


Grant permissions on selected tables, sequences and functions inside a postgresql schema

The current database_postgresql_user resource can only set perms at the database and schema levels which is not enough to replicate the flexibility and complexity of the GRANT command in PostgreSQL.
So I've added actions and attributes for granting perms on some or all tables, sequences and functions in a schema:
    # grant all privileges on all tables, sequences and functions in public schema of foo db
    postgresql_database_user 'foo_user' do
      connection postgresql_connection_info
      database_name 'foo'
      schema_name 'public'
      tables [:all]
      sequences [:all]
      functions [:all]
      privileges [:all]
      action [:grant, :grant_schema, :grant_table, :grant_sequence, :grant_function]
    end ```

:+1:  This is a fairly critical feature for PostgreSQL users.
Without it the database_postgresql_user LWRP is fairly useless as granting :all rights on a schema doesn't by default authorize the user to perform any queries on tables in that schema.

I've updated the PR from master and added a test case checking that a non-superadmin user that is granted access to a database and schema can view a table.

:+1: from my side as well. We face a similar need.

This PR was updated so that Travis build passes. The build is actually failing for MySQL, but that has nothing to do with this PR (and also fails on master). The important thing is that all PostgreSQL tests pass.
@tas50 could you please have a look at this and let us know if there is any interest into merging this feature ?

Closing this in favor of #213.


Bug in policyMatcher w.r.t. to HSP

Bug Report

General Information

Environment description (GKE, VM-Kubeadm, vagrant-dev-env, minikube, microk8s, ...) *
Kernel version (run uname -a) *
Orchestration system version in use (e.g. kubectl version, ...)
Link to relevant artifacts (policies, deployments scripts, ...)
Target containers/pods

To Reproduce

Apply a host security policy https://github.com/kubearmor/KubeArmor/blob/main/examples/host-security-policies/hsp-kubearmor-dev-proc-path-block.yaml

Run a separate command and pass the resource name in policy as argument.
grep /usr/bin/diff *

Expected behavior
No Alert
Screenshots

Fixes related to this issue


Improve rabbitmq transport logging on connection errors

This should fix issue #30

Closes #30

@moises-silva @cwjohnston I would love to see log lines like https://github.com/sensu/sensu/blob/master/lib/sensu/daemon.rb#L256, using "transport connection error" as the message, then use :error or :reason as context keys.

Otherwise these log events lack context.

@portertech so far this lib hasn't pulled in sensu-logger for testing, using Ruby's built-in Logger class instead. It seems like Logger doesn't accept the same data hash argument Sensu::Logger uses for providing additional context. Should we change the tests to bring in Sensu::Logger?

@cwjohnston yes, let's pull it in without a version constraint.

Fantastic!

@portertech disregarding the one failure here, i think this is good to merge.
I believe the single failed platform in question relates to my accidentally pushing (and subsequently deleting) the branch of same name on this repo. I had meant to push to sangoma/sensu-transport fork to update this pull request, and I guess travis decided they would be the same PR? 🤔

@cwjohnston ok, going to merge this, we can address the build failures if they continue on jruby.


[OODT-1009] Replace CORBA dependencies with reflection

I removed the compile-time dependencies to CORBA package in oodt-commons module, and replaced them with reflection-based dependency resolving.
All test cases passed after the change was made on JDK 10

@yasithmilinda If the dependencies are removed in JDK 10, do you have an idea where they get resolved from in the runtime once your reflection based change is done?
Did you try building OODT in any other JDK version other than JDK 10 after the change?

Hi @IMS94, I believe we can use https://mvnrepository.com/artifact/org.glassfish.corba/glassfish-corba-omgapi/4.2.1 as a drop-in replacement for JDK 10 and above. I'll check if it could be used.
Is CORBA a dependency that cannot be avoided or replaced?

@chrismattmann Do we need CORBA dependencies? What is the use of that?


Orientation of captured image is wrong on iOS

https://github.com/wix/react-native-camera-kit/issues/253
@gran33 - what do you think? It appears that you wrote that code few years ago :)

Anyone wants to review?

This has been fixed now.


Substring Levenshtein

Is it possible to add a method, so when given substring a, string b, and a maximum normalized edit distance value; the method returns indexes for all occurrences of a in b, where the normalized Levenshtein is lower or equal to the given maximum edit distance value.

Hi Geoffrey,
There is a very useful use case for this option: implementing Peter Norvig's spellchecker
His edits() and edits2() functions return all the words within a distance of 1-2 in the Damerau-Levenshtein metric. The problem is that they are quite slow as they are implemented in pure Python (right now they are taking 90% of the time in a script I've been running for several hours)
Cheers,
Sergio

Good suggestion.


Templatefactory

@jccosta branch with merged conflicts fixed.

@jccosta with the latest changes in vcs it seems that your works looks a bit off see:
https://open.cdash.org/viewTest.php?onlyfailed&buildid=4507856
for example:
https://open.cdash.org/testDetails.php?test=474205321&build=4507856
To obtain the latest nightly vcs please run:
conda install -n nightly -c uvcdat/label/nightly -c uvcdat vcs cdms2
source activate nightly

@doutriaux1,I will take a look on it. Something in vcs has changed.
Thanks!

@doutriaux1
I ran a set of tests: https://open.cdash.org/viewTest.php?buildid=4508179
All plots seem to be ok, the problem is with the baseline images for some of the plots.
Can you confirm it?

@jccosta you're right your test appear to be correct could you please just update the baselines? there's a script to do this: https://github.com/UV-CDAT/uvcmetrics/blob/master/src/python/devel/update_metrics_baselines.py

@doutriaux1
I will do it later today.


Added unit tests for handlers/common_handlers.go

Signed-off-by: Shikhar Vashistha <>
Description
This PR is a part of #3988 to increase codecov test coverage
Notes for Reviewers
Signed commits

[x] Yes, I signed my commits.

Codecov Report

Merging #4042 (7c40f12) into master (e1ece53) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #4042   +/-   ##
=======================================
  Coverage   18.95%   18.95%
=======================================
  Files          64       64
  Lines        4992     4992
=======================================
  Hits          946      946
  Misses       3757     3757
  Partials      289      289

Flag
Coverage Δ

integrationtests
?

unittests
18.95% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Continue to review full report at Codecov.

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

@shikharvashistha thank you for this PR. As you mentioned in the PR description, this does increases the code coverage however I am not sure if it is actually testing something, correct me if I am wrong.
Are you planning to add something more to these tests in this PR?

What do you mean by "actually" testing here ?
Isn't it the test for common_handlers.go ?


Feature Request - Function and class coverage in "coverage report"

Problem
As stated in this thread, function and class coverage has been added in coverage v7.5.0!
Thank you @nedbat for this game-changer feature!
The problem is that it requires to open two HTML files ("class_index.html" and "function_index.html") in a browser at each run of coverage html, which doesn't suit terminal-based CI/CD pipelines and workflows.
Feature Request
I kindly request, if possible, to have the same content of "class_index.html" and "function_index.html" as output of the coverage report command? - i.e:
coverage report --functions
coverage report --classes

Current Workaround
The very inelegant workaround I'm using at the moment on my Debian 12-based devcontainer is the following one:

Install the latest version of coverage (>= 7.5.0):

pip install coverage==7.6.1

Install html2text:

wget http://ftp.de.debian.org/debian/pool/main/h/html2text/html2text_1.3.2a-28_amd64.deb
dpkg -i html2text_1.3.2a-28_amd64.deb

Run the following commands in my tests folders:

cd tests
coverage run
coverage html

A htmlcov sub-folder is created, containing the two HTML files we need ("class_index.html" and "function_index.html").

Extract and format the table from the HTML file(s):

cd htmlcov
sed -n '/
/,/<\/table>/p' class_index.html > class_index.txt
html2text -width 400 class_index.txt

Done!

As you can imagine, it's not the most practical solution.

I have an old branch that adds something like this: https://github.com/nedbat/coveragepy/compare/master...devdanzin:coveragepy:report_on_regions. There's a sample of what it outputs (or used to, not sure it's working after recent refactorings) in issue #1793 (where it was decided to not add this information to the textual report then).
I won't be able to work on it for a couple of weeks, but would be glad to polish and update it if it's deemed desirable. Feel free to adapt it and submit as a PR before I'm back if you want to (and @nedbat agrees, of course).

@devdanzin
Thank you for your answer!

I won't be able to work on it for a couple of weeks, but would be glad to polish and update it if it's deemed desirable. Feel free to adapt it and submit as a PR before I'm back if you want to

I'm a Python developer myself, but I'm not familiar with the coverage.py codebase and it would take me some days in sequence to understand its structure (which I lack of at the moment) before being able to contribute.
I bet it will be way faster to wait for somebody else to add this feature! I'll keep using my workaround until then!

@devdanzin
Thank you for your time and work!
I'll try to find two hours to setup a temp devcontainer and try it out.
How can I install your updated version of coverage.py? Does pip install <github link> work?
In the meanwhile, I do provide to you a first quick answer!
I would expect your feature to outputs a formatted table like the one that I get from my latest workaround:

The screenshot comes from the following project: nwreadinglist.
My latest workaround works by installing Pandoc in the dev environment (devcontainer):
FROM python:3.12.5-bookworm

# ...
RUN pip install coverage==7.6.1
# ...

RUN wget https://github.com/jgm/pandoc/releases/download/3.4/pandoc-3.4-1-amd64.deb \
    && dpkg -i pandoc-3.4-1-amd64.deb \
    && rm -f pandoc-3.4-1-amd64.deb

and asking it to format the table I extract from htmlcov:
cd tests
coverage run -m unittest nwreadinglisttests.py
coverage html --omit=nwreadinglisttests.py && sed -n '/
/,/<\/table>/p' htmlcov/class_index.html | pandoc --from html --to plain && sleep 3 && rm -rf htmlcov

How can I install your updated version of coverage.py? Does pip install <github link> work?

I tested and pip install -U git+https://github.com/devdanzin/coveragepy.git@report_on_regions seems to work for that.

I would expect your feature to output a formatted table like the one that I get from my latest workaround:

Currently output for coverage report --functions --classes (it's possible to pass either, both or none) is formatted like below. It should be simple to format like what you have, except that it's not currently possible to get the excluded lines data from the text report (see https://github.com/nedbat/coveragepy/issues/814).
Name                                              Stmts   Miss  Cover
---------------------------------------------------------------------
coverage/version.py                                  16      0   100%
coverage/version.py: function _make_url               1      0   100%
coverage/version.py: function _make_version           8      0   100%
setup.py                                             68     25    63%
setup.py: class BuildFailed                           2      2     0%
setup.py: class ve_build_ext                         12     12     0%
setup.py: function BuildFailed.__init__               2      2     0%
setup.py: function main                               8      5    38%
setup.py: function ve_build_ext.build_extension       8      8     0%
setup.py: function ve_build_ext.run                   4      4     0%
---------------------------------------------------------------------
TOTAL                                                84     25    70%

@devdanzin
Finally Sunday! I apologize for the slightly delayed answer!

except that it's not currently possible to get the excluded lines data from the text report

As far as there is the class name and the coverage % in a formatted table, it's good enough to quickly add tests where required!
Thank you for your work so far! I'll update this thread once I try it out!

@devdanzin
Sorry for the delay! Seems to work okay! I would definitely create a pull request for it!


on failure callback on this operator doesn't work

This operator does nothing custom to the on_failure_callback behaviour. I believe it might be an issue with your Airflow installation and/or usage in your case. Please share any details or steps to reproduce. I am closing the issue while it has no details.


Prevent login after registration

When I register a new user, the new user is automatically logged in. How can I prevent that?

If you use allauth and set email verification to mandatory, by default django-rest-auth won't return a token on registration.
Alternatively, modify your URL registration to point to your own version of the RegisterView. The current implementation returns a token in the create() function.

I have the same problem, I'd like to use the same create but without the return, is it mandatory to return the token?

Was this ever solved? I am currently experiencing this issue.

@KennyLepping This solution is for dj-rest-auth, a fork of this project, but I hope it helps. My use case was that I wanted admin users to create other users, with lesser scope. This was an internal business app that would not have open-to-the-whole-internet registration. The workflow I had in mind was that an admin would create a new user, and then ask them to reset their password to login. The password reset process would act as an email verification.
TL;DR: I subclassed the dj-rest-auth RegisterView. I everything is the same, except for the perform_create(self, serializer) method, where I removed a call to allauth's function complete_signup(request, user, email_verification, success_url, signal_kwargs=None).
# views.py

from allauth.account import app_settings as allauth_settings

from django.conf import settings

from dj_rest_auth.app_settings import (
    JWTSerializer, TokenSerializer, create_token,
)
from dj_rest_auth.utils import jwt_encode

from dj_rest_auth.registration.views import RegisterView

class CustomRegisterView(RegisterView):

    def perform_create(self, serializer):
        user = serializer.save(self.request)
        if allauth_settings.EMAIL_VERIFICATION != \
                allauth_settings.EmailVerificationMethod.MANDATORY:
            if getattr(settings, 'REST_USE_JWT', False):
                self.access_token, self.refresh_token = jwt_encode(user)
            elif not getattr(settings, 'REST_SESSION_LOGIN', False):
                # Session authentication isn't active either, so this has to be
                #  token authentication
                create_token(self.token_model, user, serializer)
        return user

Later, I use this as,
from .views import CustomRegisterView
from .serializers import AdminCreateSerializer

class AdminView(CustomRegisterView):
    serializer_class = AdminCreateSerializer

Hope that helps.

@cjohnson318 I am also using dj-rest-auth with your same aproach where the user have to change their password via reset link.
I have created a custom serializer for the CustomRegisterView
`
class RegisterWithMailSendSerializer(RegisterSerializer):
def save(self, request, **kwargs):
    adapter = get_adapter()
    user = adapter.new_user(request)
    self.cleaned_data = self.get_cleaned_data()
    # user = adapter.save_user(request, user, self, commit=False)
    user = adapter.save_user(request, user, self, commit=True)
    if "password1" in self.cleaned_data:
        try:
            adapter.clean_password(self.cleaned_data['password1'],
                                   user=user)
        except DjangoValidationError as exc:
            raise serializers.ValidationError(
                detail=serializers.as_serializer_error(exc))
    user.save()
    self.custom_signup(request, user)
    setup_user_email(request, user, [])
    # pg = PasswordResetTokenGenerator()
    # pg_token = pg.make_token(user)
    frontend_site = settings.FRONTEND_APP_BASE_URL
    token_generator = kwargs.get('token_generator',
                                 default_token_generator)
    temp_key = token_generator.make_token(user)
    path = reverse(
        'password_reset_confirm',
        args=[user_pk_to_url_str(user), temp_key],
    )
    full_url = frontend_site + path
    context = {
        'current_site': frontend_site,
        'user': user,
        'password_reset_url': full_url,
        'request': request,
    }
    if app_settings.AUTHENTICATION_METHOD != app_settings.AuthenticationMethod.EMAIL:
        context['username'] = user_username(user)

    email = self.get_cleaned_data()['email']
    get_adapter(request).send_mail('password_reset_key', email, context)
    return user

def custom_signup(self, request, user):
    print('CUSTOM SIGNUP FUNCTION')

`
and this send me a querystring containing uid and token for password reset BUT if I try to reset password with those value I get "invalid token".
How and where you manage the sending links to user for password reset?


Error: Cannot find module 'react-datepicker/dist/react-datepicker.css'

I'm new at react I'm not able to import react-datepicker.css getting Cannot find module error.
This is my source code
form.js
import React from 'react'
import ReactDOM from 'react-dom'
import DatePicker from 'react-datepicker'

require('react-datepicker/dist/react-datepicker.css');

let Form = React.createClass({
    displayName: 'Example',

    getInitialState: function() {
        return {
            startDate: moment()
        };
    },

    handleChange: function(date) {
        this.setState({
            startDate: date
        });
    },

    render: function() {
        return (

Welcome To Events Page

          <form>
          Event:<input type="text" name="eventName" placeholder="Event Name"/>

          Date:<DatePicker
            selected={this.state.startDate}
            onChange={this.handleChange} />;
          </form>

)
    }
});

export default Form;

Folder Structure:

Console:

You'll need to configure your module bundler (e.g. webpack, browserify) to handle CSS files, or add the stylesheet to your HTML manually.

Hi Rafeememon,
Please share some details about adding the css files into webpack and htm manually.
Whenever i am adding the below import to my search.js file.
import 'react-datepicker/dist/datepicker.css'
Date picker is integrated but the style is not applied.
Iam getting the below exception.
Uncaught Error: Cannot find module "react-datepicker/dist/datepicker.css"
at webpackMissingModule (index.js:61718)
at Object.defineProperty.value (index.js:6
Regards,
Vijay


snackbar autoHideDuration doesn't treat null like the docs say

In 1.0.0-beta.20  If I set autoHideDuration={null}, onRequestClose() is triggered immediately as if the value is 0

[x ] I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior
The docs say autoHideDuration will be disabled if set to null
Current Behavior
Currently null is treated like 0, however I can set it to undefined and it works like it used to.
I want to keep the snackbar visible indefinitely only if there are more details (accessed through a link in the snnackbar), so code looks something like this:
<Snackbar
      onRequestClose={onDismiss}
      autoHideDuration={hasMoreDetails ? null : 4000}
      action={[ renderDetailsButton(hasMoreDetails),     <CloseButton />    ]}
/>

The workaround is fine
  autoHideDuration={hasMoreDetails ? undefined : 4000}
.. but then the docs need updating
Your Environment

Tech
Version

Material-UI
1.0.0-beta.20

React
15.6.2

browser
chrome

@hoolymama The behavior was changed in https://github.com/callemall/material-ui/pull/8448/files#diff-c54f3a36461afdc2f6227a9ca87424a4L252. I can't remember the motivation for such change.
Also, this change wasn't documented as a breaking change.
As far as I know, It shouldn't have been changed. What do you think of putting the null logic back? Do you want to take care of it?

@oliviertassinari I think the logic is fine as it is so long as the docs say the same thing.
Semantically, I guess null is slightly better in cases where you need to have the prop present and assign something, like my example.
I'm happy to change it back if you like.

@hoolymama Sorry, didn't want to take away your work :see_no_evil: I was just thinking that this might need a test, so I added a test and ended up changing it back right away…

Did this change again? Looks like the type is only accepting a number and not a null value:
https://github.com/TeamWertarbyte/material-ui/blob/master/src/Snackbar/Snackbar.js#L52

@brunomonteirosud You have linked a different project.

@oliviertassinari Oops, my bad. Not sure how I got that 😅
Anyway, I am trying to achieve the same behaviour above, and I got a type error:

Type null is not assignable to type number

So I was confused if this changed was implemented or not...

@brunomonteirosud Thank you for the report. It's a bug with our TypeScript definitions. Do you want to submit a pull request with this fix :)?
diff --git a/packages/material-ui/src/Snackbar/Snackbar.d.ts b/packages/material-ui/src/Snackbar/Snackbar.d.ts
index 9a2a3e896..f0535fd15 100644
--- a/packages/material-ui/src/Snackbar/Snackbar.d.ts
+++ b/packages/material-ui/src/Snackbar/Snackbar.d.ts
@@ -16,7 +16,7 @@ export interface SnackbarProps
   > {
   action?: SnackbarContentProps['action'];
   anchorOrigin?: SnackbarOrigin;
-  autoHideDuration?: number;
+  autoHideDuration?: number | null;
   ClickAwayListenerProps?: Partial<ClickAwayListenerProps>;
   ContentProps?: Partial<SnackbarContentProps>;
   disableWindowBlurListener?: boolean;

Sure, happy to do it!
I am pretty new to this process of contributing...I tried to follow the instructions from this link but wasn't able to checkout the project.
Is git clone git@github.com:brunomonteirosud/material-ui.git the correct path? Do you need to authorize me first?
Thanks

You need to fork the project first.

🤦♂ my bad...
Just opened the request: https://github.com/mui-org/material-ui/pull/16257


docs: add decision record about using maven artifacts

What this PR changes/adds
Adds a D-R about using only Maven artifacts (instead of local checkouts) and how the versioning is supposed to work.
Why it does that
While local checkouts have their upsides, I find them cumbersome and quirky to work with.
Further notes
_List other areas of code that have changed but are not necessarily linked to the main feature. .
Linked Issue(s)
.
Checklist

[ ] added appropriate tests?
[ ] performed checkstyle check locally?
[ ] added/updated copyright headers?
[ ] documented public classes/methods?
[x] added/updated relevant documentation?
[x] assigned appropriate label? (exclude from changelog with label no-changelog)
[x] formatted title correctly? (take a look at the CONTRIBUTING and styleguide for details)

One question of understanding: what exactly do you mean by and other projects? General rule 2 and 3 would also refer to all implementation projects inside the eclipse-dataspaceconnector org in Github, right? What else?

"other projects" = "our projects" = every original project in the eclipse-dataspaceconnector org (no IDS forks).
I'll harmonize the wording.


Fix update dataload status error

Signed-off-by: Ruofeng Lei<EMAIL_ADDRESS>
Ⅰ. Describe what this PR does
Dataload controller try to update the Dataload status using name/namespace in ctx which is the name of Dataset but not Dataload
Fix this by replacing ctx with targetDataload
Ⅱ. Does this pull request fix one issue?

Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews

Thanks for reporting and fixing this bug!
I think there are still some similar mistakes in implement.go too, would you like also fix that?

OK I'll check and fix that.
BTW, I noticed that you suggest to change the NamespacedName in the ctx. Should I change it to Dataload's name or keep as the Dataset's name? Which should be better?

Sorry to give an improper suggestion at first. After then I double checked the code and found the ctx will be used somewhere else(for example, here), and it requires ctx.Name should be Dataset's name. So I think it's better to keep it as the Dataset's name.

Thanks for reporting and fixing this bug!
I think there are still some similar mistakes in implement.go too, would you like also fix that?

OK I'll check and fix that.
BTW, I noticed that you suggest to change the NamespacedName in the ctx. Should I change it to Dataload's name or keep as the Dataset's name? Which should be better?

Sorry to give an improper suggestion at first. After then I double checked the code and found the ctx will be used somewhere else(for example, here), and it requires ctx.Name should be Dataset's name. So I think it's better to keep it as the Dataset's name.

👌


Update UI of patient and drug display

Updated UI of patient and drug display upon click event.
Updated css files to preserve old styles and added new ones for field
labels.
Changed the accessibility modifier of drugAllergy field of DrugAllergy
class to public, to follow the accessibility of other sibling classes.

Fix #177

Update UG to include screenshots and more guidance for jdk installation
Change the ordering of features


BZ#1518390-Pass additional information to the API when refreshing a dialog field

Very similar to https://github.com/ManageIQ/manageiq-ui-classic/pull/2885, except for refreshing dialogs in the service UI.
The resource action id, target id, and target type need to be passed to the API in order to establish the context for dialog fields when they are refreshed via the /service_dialogs endpoint, otherwise certain automate methods can fail.
@miq-bot add_label gaprindashvili/yes, bug
There is no current BZ that deals with this since https://bugzilla.redhat.com/show_bug.cgi?id=1518390 is talking about the classic UI, but it's the closest relative. I just wanted to put this PR out there to get ahead of a potential BZ popping up with the same issue but for the service UI.
@chalettu Please review!

@eclarizio if yah get a chance... can ya fix the indentation errors that travis is 😭ing about?

@chalettu could ya review this one when you get a chance?

Gaprindashvili backport details:
$ git log -1
commit 734f7f04c500fef7e5f29c87406837983ee5d583
Author: Allen Wight<EMAIL_ADDRESS>Date:   Wed Jan 17 08:52:31 2018 -0500

    Merge pull request #1324 from eclarizio/dialog_refresh_targets

    BZ#1518390-Pass additional information to the API when refreshing a dialog field
    (cherry picked from commit 3d43dbf2cb92cc0751a493940b07eabd0fa648a3)

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1543180


Clean up openforcefield/tests/utils.py, fix docstrings

Resolves  #768 - for now, just seeing what happens

[ ] Tag issue being addressed
[ ] Add tests
[ ] Update docstrings/documentation, if applicable
[ ] Lint codebase
[ ] Update changelog

Posting the relevant file here as I find codecov's UI difficult to nagivate: https://codecov.io/gh/openforcefield/openforcefield/src/6ba553a4d3baa1086c55694993754dc0eef99510/openforcefield/tests/utils.py

At least of the tests is leaking for reasons I can't isolate at the moment - if you run all tests (like CI does) the below test fails, but you can run it at the module or class scope and it runs just fine
$ pytest -v  --doctest-modules --doctest-continue-on-failure openforcefield
# lots of other output
============================================================================== short test summary info ==============================================================================
FAILED openforcefield/tests/test_forcefield.py::TestForceField::test_load_bad_string - TypeError: argument of type 'NoneType' is not iterable
$ pytest -v  --doctest-modules --doctest-continue-on-failure openforcefield/tests/test_forcefield.py::TestForceField
# passes!
$ pytest -v  --doctest-modules --doctest-continue-on-failure openforcefield/tests/test_forcefield.py::TestForceField::test_load_bad_string
# also passess!

The bizarre errors may be related to the same issue that cropped up in #722 - fixing or punting on that may help push each of these PRs forward.

Pausing this until #722 is merged, and then splitting off tests/utils.py and doctests as separate tasks.


Add quantum-classical addition bloq

As a part of adding PsiQuantum ECC-256 Primitives from https://arxiv.org/pdf/2306.08585.pdf we must first add a bloq for quantum-classical addition. We do so by simply converting a classical integer k into a quantum parameter using XGates corresponding to the binary representation of the integer. This approach is shown in fig 2a at https://arxiv.org/pdf/2001.09580.pdf.

From communications offline: There's apparently a bug where np.uint + python int gives you a float. And split/join give uints. https://github.com/numpy/numpy/issues/7126
Do you have a minimal example of where this comes into play? I'm not seeing the issues with the following thing I threw together
@frozen
class SetInt(Bloq):
    bitsize: int
    k: int

    @cached_property
    def signature(self) -> 'Signature':
        return Signature([Register('x', bitsize=self.bitsize, side=Side.RIGHT)])

    def on_classical_vals(self) -> Dict[str, 'ClassicalValT']:
        return {'x': 0 + self.k}

    def build_composite_bloq(self, bb: 'BloqBuilder') -> Dict[str, 'SoquetT']:
        k = bb.allocate(n=self.bitsize)

        # Get binary representation of k and split k into separate wires.
        k_split = bb.split(k)
        binary_rep = list(iter_bits(self.k, self.bitsize))

        # Apply XGates to qubits in k where the bitstring has value 1. Apply CNOTs when the gate is
        # controlled.
        for i in range(self.bitsize):
            if binary_rep[i] == 1:
                k_split[i] = bb.add(XGate(), q=k_split[i])

        # Rejoin the qubits representing k for in-place addition.
        k = bb.join(k_split)
        return {'x': k}

def test_set_int():
    si = SetInt(k=5, bitsize=4)
    ret1 = si.call_classically()
    ret2 = si.decompose_bloq().call_classically()
    print()
    print(ret1)
    print(ret2)

From communications offline: There's apparently a bug where np.uint + python int gives you a float. And split/join give uints. numpy/numpy#7126
Do you have a minimal example of where this comes into play? I'm not seeing the issues with the following thing I threw together
@frozen
class SetInt(Bloq):
    bitsize: int
    k: int

    @cached_property
    def signature(self) -> 'Signature':
        return Signature([Register('x', bitsize=self.bitsize, side=Side.RIGHT)])

    def on_classical_vals(self) -> Dict[str, 'ClassicalValT']:
        return {'x': 0 + self.k}

    def build_composite_bloq(self, bb: 'BloqBuilder') -> Dict[str, 'SoquetT']:
        k = bb.allocate(n=self.bitsize)

        # Get binary representation of k and split k into separate wires.
        k_split = bb.split(k)
        binary_rep = list(iter_bits(self.k, self.bitsize))

        # Apply XGates to qubits in k where the bitstring has value 1. Apply CNOTs when the gate is
        # controlled.
        for i in range(self.bitsize):
            if binary_rep[i] == 1:
                k_split[i] = bb.add(XGate(), q=k_split[i])

        # Rejoin the qubits representing k for in-place addition.
        k = bb.join(k_split)
        return {'x': k}

def test_set_int():
    si = SetInt(k=5, bitsize=4)
    ret1 = si.call_classically()
    ret2 = si.decompose_bloq().call_classically()
    print()
    print(ret1)
    print(ret2)

This specifically occurs when I do a join before an Add() bloq. If you add an Add() bloq after the join the output of the ClassicalValT b (b = a + b) will give you an error as it is a float not an int. I just committed the test which is giving this error and you can try it out yourself.

here's the latest, open issue on numpy: https://github.com/numpy/numpy/issues/20905
In the classical simulation protocol, we do indeed want to support both python integers (which are bigint, which is relevant for the numbers used in factoring algorithms) and numpy integers (which can be put into an ndarray).
Reading the linked numpy issues, I guess there is an ambiguity in what you want when you add a unit64 to a bigint. For better or for worse, I think the fix should be to cast self.k to a np.uint inside the on_classical_vals function. We want to match the behavior of the bloq decomposition which itself has to care about overflows and stuff. Honestly: if we wanted to be 100% accurate we'd have to support overflows for arbitrary bitsize-bit integers

diff --git a/qualtran/bloqs/arithmetic/addition.py b/qualtran/bloqs/arithmetic/addition.py
index ebcd587a..d5a1edc8 100644
--- a/qualtran/bloqs/arithmetic/addition.py
+++ b/qualtran/bloqs/arithmetic/addition.py
@@ -82,7 +82,8 @@ class Add(GateWithRegisters, cirq.ArithmeticGate):
     def on_classical_vals(
         self, a: 'ClassicalValT', b: 'ClassicalValT'
     ) -> Dict[str, 'ClassicalValT']:
-        return {'a': a, 'b': a + b}
+        assert self.bitsize <= 64 # TODO: be smarter
+        return {'a': a, 'b': np.uint64(a) + np.uint64(b)}

     def short_name(self) -> str:
         return "a+b"

Sorry this is so ugly. I rebased it using the commits adding MultiControlX so I could implement classical simulation of the bloq before I go snowboarding this weekend. The commits/merge got a little out of hand.


dead link https://developer.mozilla.org/en-US/docs/Web/API/DOMPoint/fromPoint

Request type

[ ] New documentation
[x] Correction or update

Details
The left navigation bar at https://developer.mozilla.org/en-US/docs/Web/API/DOMPoint has a section for functions with the function fromPoint(). This function should be a link to a mozilla web docs page at https://developer.mozilla.org/en-US/docs/Web/API/DOMPoint/fromPoint about the function fromPoint(); however, it is a deadlink. In the content of the page there is a link to the same function found at https://developer.mozilla.org/en-US/docs/Web/API/DOMPointReadOnly/fromPoint It should be noted that DOMPoint inherits functions from DOMPointReadOnly so I'm assuming https://developer.mozilla.org/en-US/docs/Web/API/DOMPoint/fromPoint should redirect to https://developer.mozilla.org/en-US/docs/Web/API/DOMPointReadOnly/fromPoint

The sidebar link on the DOMPoint page now works properly, and leads to DOMPoint.fromPoint(), which has unique content different from DOMPointReadOnly.fromPoint().


Apply fixes from StyleCI

This pull request applies code style fixes from an analysis carried out by StyleCI.

For more information, click here.

Coverage remained the same at 0.0% when pulling 61360e0cb3d1a5dbf0c64b28e5a243ec3494bdb6 on analysis-qMNQG4 into 6894a846d2214e2e3451d675bcde752037363a8c on master.


chore: update packages

update packages (especially minimatch)
solve security ad warning: Regular Expression Denial of Service
https://nodesecurity.io/check/gulp.spritesmith

Looks good at a glance. I'm going to sanity check by looking at the major changes to verify we aren't accidentally breaking anything.

Alright, done looking over dependencies. Everything looks good:

async 0.9.0 -> 2.1.5

Good: https://github.com/caolan/async/blob/v2.1.5/CHANGELOG.md
1.x - No breaking changes, only moving to SemVer
2.x - Standardizing error/callback handling

gulp-util 2.x -> 3.x

Good: https://github.com/gulpjs/gulp-util/compare/v2.2.20...v3.0.0
Added error properties (most likely caution than necessary)

minimatch 2.x -> 3.x

Good: https://github.com/isaacs/minimatch/commits/v3.0.3
Dropped browser.js from package.json

through2 0.x -> 2.x

Good: https://github.com/rvagg/through2/tree/v2.0.3
Jumped from 0.x to 2.x
Major upgrade of its dependencies

gulp-csso 0.x -> 3.x

Good: https://github.com/ben-eb/gulp-csso/blob/v3.0.0/CHANGELOG.md
1.x - Dropped stream support
2.x - Upgraded CSSO
3.x - Upgraded CSSO again

gulp-imagemin 1.x -> 3.x

Good - https://github.com/sindresorhus/gulp-imagemin/commits/v3.1.1
2.x - Upgraded imagemin
3.x - Upgraded imagemin again

merge-stream 0.x -> 1.x

Good: https://github.com/grncdr/merge-stream/commits/v1.0.1
Moved to readable-stream

This has been released in 6.4.0. Thanks for your work!


Suggestion: Move makefile and resources outside of the src folder

This is more of making this a bit easier to work with and that is having the makefile at the top level of the project folder. Also would like to see the resource folder at the top level to not clutter up the src folder.

Also it would be nice to have the .o files go somewhere else instead of the src folder.

@jalexcole this templates works ok for me in the current build directories configuration. I know it's not the most professional one but it's simple to work with. Maybe I review it on the future.

i think you can change some things like this
# Define all source files required
PROJECT_SOURCE_FILES ?= \
    raylib_game.c \
    screen_logo.c \
    screen_title.c \
    screen_options.c \
    screen_gameplay.c \
    screen_ending.c

by
SRC = src/
PROJECT_SOURCE_FILES ?= $(wildcard $(SRC)*.c $(SRC)**/*.c)

and put your makefile at root project folder


move setup/try buttons

Idea: moving the buttons to the first part of the page? (had to change the color too)

the Setup color is on hover/active

I like that

These buttons are not accessible. You need to make it more clear that they are buttons

@thejameskyle should the colors be inverted or should it just have an outline?

An outline would be enough

Cool simple enough?

Yeah that should be fine


Switching from 1.2.1 to 2.x.x drastically slows my app

In my app I allocate realtime video frames (24MB per frame * 60fps)
In my app I time the processing of a frame in milliseconds.
Using ffi: ^1.2.1 I get 8-11ms per frame
Using ffi: ^2.0.0 I get 70 to 200ms per frame in DEBUG mode and 20-30ms in RELEASE mode which makes my app unusable.
I suspect that it has something to do with the switch mentioned in the changelog of 2.0.0

Switch Windows memory allocation to use CoTaskMemAlloc and CoTaskMemFree

I've also found an article that talks about a bug in windows 10 which supposedly makes this a lot slower:
https://randomascii.wordpress.com/2022/07/11/slower-memory-zeroing-through-parallelism/
For now I can't upgrade to ffi 2.x.x since I can't use my app with this version.
Is this a known thing?
EDIT: switching from ffi.calloc to ffi.malloc reduces the time immensly but of course is not always applicable

calloc and malloc both use CoTaskMemAlloc.
https://github.com/dart-lang/ffi/blob/18b2b549d55009ff594600b04705ff6161681e07/lib/src/allocation.dart#L30-L32
The only difference is zero-ing out the memory.
https://github.com/dart-lang/ffi/blob/18b2b549d55009ff594600b04705ff6161681e07/lib/src/allocation.dart#L137-L139
Are you allocating large chunks of memory?
https://github.com/dart-lang/ffi/blob/18b2b549d55009ff594600b04705ff6161681e07/lib/src/allocation.dart#L105-L110
For large chunks, using memset would probably be much faster than the manual loop above.
https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/memset-wmemset?view=msvc-170
Could you check if using memset instead of a manual loop is faster? If so we can make a PR for that. (We never ran into this on the other platforms, because they support allocating zeroed out memory. I don't see something similar for Windows.)

cc @timsneath who introduced the zeroing out of memory for Windows.

Are you allocating large chunks of memory?

Yes. It is about 24 MB per frame at for example 60fps. That would be 1.44 GB per second. (of course every frame gets freed)

For large chunks, using memset would probably be much faster than the manual loop above.

How do I access memset in dart?

Try
typedef _dart_memset = void Function(Pointer<Uint8>, int, int);
typedef _c_memset = Void Function(Pointer<Uint8>, Int32, IntPtr);

    fbMemset = DynamicLibrary.process()
        .lookupFunction<_c_memset, _dart_memset>('memset');

You probably need to be on the master branch to get access to DynamicLibrary.process() on Windows as I added that recently to dart:ffi.

I've written a short dart example to test this:
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef _dart_memset = void Function(Pointer<Uint8> dest, int value, int count);
typedef _c_memset = Void Function(Pointer<Uint8> dest, Int32 value, IntPtr count);

/// Sets a buffer to a specified character.
///
/// [dest] Pointer to destination.
/// [value] value to set.
/// [count] Number of characters.
final memset = DynamicLibrary.process().lookupFunction<_c_memset, _dart_memset>('memset');

void main(List<String> arguments) {
  Stopwatch sw = Stopwatch()..start();
  for (int i = 0; i < 1000; i++) {
    Pointer<Uint8> p = malloc.call<Uint8>(1024 * 1024); // 1 MiB
    malloc.free(p);
  }
  sw.stop();
  int us = sw.elapsedMicroseconds;
  print("Allocating 1000 * 1MiB with malloc took \t\t$usμs.");

  sw.reset();
  sw.start();
  for (int i = 0; i < 1000; i++) {
    Pointer<Uint8> p = calloc.call<Uint8>(1024 * 1024); // 1 MiB
    calloc.free(p);
  }
  sw.stop();
  us = sw.elapsedMicroseconds;
  print("Allocating 1000 * 1MiB with calloc took \t\t$usμs.");

  sw.reset();
  sw.start();
  for (int i = 0; i < 1000; i++) {
    Pointer<Uint8> p = malloc.call<Uint8>(1024 * 1024); // 1 MiB
    memset(p, 0, 1024 * 1024);
    calloc.free(p);
  }
  sw.stop();
  us = sw.elapsedMicroseconds;
  print("Allocating 1000 * 1MiB with malloc + memset took \t$usμs.");
}

ffi: ^2.0.1

Allocating 1000 * 1MiB with malloc took                            7.028μs.        (7ms)
Allocating 1000 * 1MiB with calloc took                        3.294.333μs. (3294ms)
Allocating 1000 * 1MiB with malloc + memset took        187.259μs.   (187ms)

ffi: ^1.2.1

Allocating 1000 * 1MiB with malloc took                        7.338μs.         (7ms)
Allocating 1000 * 1MiB with calloc took                          6.357μs.        (6ms)
Allocating 1000 * 1MiB with malloc + memset took    191.216μs.    (191ms)

in ffi 1.2.1 calloc takes roughly the same amount of time as malloc
in ffi 2.0.1 calloc is 17x slower than malloc + memset.

@dcharkes btw:

Still says "not available on Windows" in the doc comments.
Still works thoough :D

Thanks for the benchmarks!
We migrated from
result = winHeapAlloc(processHeap, /*flags=*/ HEAP_ZERO_MEMORY, byteCount).cast();

to
      result = winCoTaskMemAlloc(byteCount).cast();
      _zeroMemory(result, byteCount);

in

https://github.com/dart-lang/ffi/pull/144

to enable using NativeFinalizers. HeapFree does not have the same signature as free, while CoTaskMemFree does.
We should probably replace the zeroing loop with memset once DynamicLibrary.process() windows availability is available in Dart/Flutter stable.
@MindStudioOfficial could you check at which allocation size the loop and memset are the same speed? (I suspect that for very small allocations, the loop is faster.)
@timsneath looks like our migration to CoTaskMemAlloc has a severe performance regression. I suspect that by now you're already using NativeFinalizers and depending on being able to use CoTaskMemFree.
@MindStudioOfficial as a workaround, you could define your own Allocator which copies the sources from the older package:ffi.
I wonder if we should include a setting/parameter or an extra allocator on windows to re-expose allocating with HeapAlloc which does then not support using NativeFinalizers.

We should probably replace the zeroing loop with memset once DynamicLibrary.process() windows availability is available in Dart/Flutter stable.

Why not in Dart itself? memory.asTypedList(...).fillRange(...)?

That's another good thing to try. Though I would expect memset to be faster for 1 MB chunks.

@dcharkes btw:
Still says "not available on Windows" in the doc comments.
Still works thoough :D

Oopsie 🙃
https://dart-review.googlesource.com/c/sdk/+/264940

Some more benchmarks

Size in KiB
malloc in μs
calloc in μs
malloc+memset in μs

2000
28
8037
62

4000
20
12065
87

6000
20
18784
126

8000
19
25437
154

10000
23
28993
186

12000
23
34216
203

14000
24
41588
243

16000
167
50309
1758

18000
124
56043
1994

20000
140
61813
2129

22000
130
72455
2280

24000
139
74347
2749

26000
131
80171
2710

28000
130
88833
2406

30000
120
100929
3311

32000
122
102998
3013

34000
110
104624
2139

36000
103
111944
2351

38000
100
122905
2520

40000
122
121536
6003

42000
144
127213
2850

44000
133
140059
3196

46000
136
156606
2843

48000
94
165196
2157

50000
95
167505
2077

52000
94
213821
2271

54000
90
179461
2338

56000
96
176380
2398

58000
103
186485
2941

60000
170
191335
2809

62000
97
187990
2787

64000
69
192022
2861

66000
86
206934
2685

68000
90
208057
2921

70000
73
224153
2753

72000
112
219760
3309

74000
86
222953
3671

76000
210
235642
3556

78000
96
253633
3273

80000
100
294777
3754

82000
104
309105
3297

84000
114
328592
3682

86000
104
300506
3382

88000
112
343889
3383

90000
114
354755
3845

92000
113
289370
4120

94000
120
284351
4024

96000
127
306265
4069

98000
87
300042
4237

100000
129
312252
4147

Thanks @MindStudioOfficial! ❤
What for smaller values? (In a longer loop)

Size in KiB
malloc in μs
calloc in μs
malloc+memset in μs

2000
28
8037
62

Does calloc in μs ever drop under malloc+memset? For a single byte? For 10 bytes?
And could you verify whether .asTypedList .fillRange is slower than memset? (I could check on a Linux machine easily, but it's better to be sure for your Windows setup.)

I did more benchmarks this time using a logarithmic approach for the sizes.
Every chucksize gets allocated 1000 times for statistical stability hence the "1000 *"

Size in Bytes
malloc in μs
calloc in μs
malloc+memset in μs
fillRange in μs

1000 * 1
111
93
109
79

1000 * 2
68
81
79
85

1000 * 4
65
85
78
119

1000 * 8
78
88
77
114

1000 * 16
67
91
75
123

1000 * 32
64
97
80
212

1000 * 64
69
159
74
254

1000 * 128
70
178
79
441

1000 * 256
68
205
82
777

1000 * 512
143
409
91
1564

1000 * 1024
54
666
75
2804

1000 * 2048
116
1133
95
5238

1000 * 4096
93
1828
128
10560

1000 * 8192
101
3949
201
21530

1000 * 16384
106
7676
314
40361

1000 * 32768
95
14229
558
80580

1000 * 65536
128
31589
1058
160970

1000 * 131072
117
58080
1879
331348

1000 * 262144
151
123197
4144
654644

1000 * 524288
128
231918
7360
1319933

1000 * 1048576
4911
626603
191911
2888054

Y axis is logarithmic!

Sweet! ❤
So CoTaskMemAlloc with memset is always faster than CoTaskMemAlloc with .asTypedList and CoTaskMemAlloc with the loop.
And CoTaskMemAlloc with memset is order of magnitude slower than HeapAlloc with the HEAP_ZERO_MEMORY flag for 100kb+ allocations.
I've filed

https://github.com/dart-lang/ffi/issues/160

to use memset.
For the large allocations maybe we should provide another allocator for windows. (But that will not allow us to use NativeFinalizers to clean up the memory.)
Thanks so much for the benchmarks @MindStudioOfficial! Are you unblocked by either using a malloc+memset or the older a copy of the older ffi calloc (without support for native finalizers).

Does calloc in μs ever drop under malloc+memset? For a single byte? For 10 bytes?

Doesn't look like it.

And could you verify whether .asTypedList().fillRange is slower than memset?

Its the slowest

Are you unblocked by either using a malloc+memset[...]

Yes, I've made sure to use malloc whenever possible (mostly the data is overridden anyway).

I've also tried using the c style calloc:
typedef _c_calloc = Pointer<Void> Function(IntPtr number, IntPtr size);
typedef _dart_calloc = Pointer<Void> Function(int number, int size);

final ccalloc = DynamicLibrary.process().lookupFunction<_c_calloc, _dart_calloc>('calloc');

Which came out around as fast as malloc+memset but faster for smaller values.

We don't use malloc and calloc on Windows on Windows, because every .dll has it's own implementation of malloc/calloc/free and will segfault if you pass memory from one dll to another.

I've also tried using the c style calloc: Which came out faster than malloc+memset.

Calloc can be faster than malloc + memset because OS zeroes out virtual memory anyway before handling out pages, and a clever implementation of calloc can avoid repeating that work. I'd imagine if calloc calls sbrk() or equivalent syscall, it wouldn't zero out that memory again.
The difference between winHeapMemAlloc and winCoTaskMemAlloc could be along same lines.

Footnote: speedup from using memset is also expected. memset always almost uses SIMD or special instruction under the hood. I once benchmarked a naive AVX256 memset and compared with setting Uint64s to 0, AVX one was ~2.5 times faster. I assume libc impl will be much more clever.


Recommended vs Mandatory policies for macOS

Neither this page nor the Edge policies page (https://docs.microsoft.com/en-us/DeployEdge/microsoft-edge-policies) explain how to set a macOS policy in Intune to Recommended vs Mandatory. Can this be added?
The Edge policies page lists all the Edge policies has both Recommended and Mandatory policy locations for Windows, but not for macOS.
The documentation on "Configure policy settings on Windows" describes the difference: https://docs.microsoft.com/en-us/deployedge/configure-microsoft-edge#configure-policy-settings-on-windows
According to https://stackoverflow.com/questions/38206916/mandatory-chrome-policies-on-mac there are two different locations for the plist depending on if you want to set a policy as Recommended (~/Library/Preferences/) vs Mandatory (/Library/Managed Preferences/), but this page doesn't explain how to pick one when configuring a policy with Intune.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 3c05c4e5-63bf-1b01-52e5-bd7ee10c737e
Version Independent ID: 4ab1fe14-adf0-4588-19fd-5cac5e703b13
Content: Configure Microsoft Edge for macOS using a .plist
Content Source: edgeenterprise/configure-microsoft-edge-on-mac.md
Product: microsoft-edge
GitHub Login: @kelleyvice-msft
Microsoft Alias: brianalt

Clean up of old issues.  I can confirm that this issue has been passed on to the team but they have not had a chance to address yet and there is currently no ETA.
For immediate help you can reach out to Support (https://developer.microsoft.com/en-us/microsoft-edge/support/) or the FastTrack team (https://docs.microsoft.com/en-us/fasttrack/products-and-capabilities#microsoft-edge) for assistance with MS Edge deployment.

This is still the case sadly, any updates @Y-Kelly?


Error while creating a tenant user.

Getting an error while creating a user on the tenant website.

The failed request in the network console is as follows.

This could be a lot of things, but I'd start with basic troubleshooting. The 403 makes me wonder if the token is attached to the outbound request. If it is, then I'd check the logs (kubectl logs <pod>) on the service you're trying to hit. Same thing is true of the other issue you reported. Sorry I can't be of more help, but there are too many variables to pinpoint it without some significant time spent troubleshooting.

hey its working, sorry for the trouble.

No worries, glad it's working!