format macros

This will be interesting...

The strategy here will be to get the text for the macro, replace every $foo in the body of the macro with a string of the same length, e.g., xfoo. Then re-parse it and format it and convert the xfoos back to $foos (obvs we need to check that there is no xfoo in the body before substituting).
We'll need to format the decl of the macro, and find the body, I suppose, using token trees.

Google led me here. Is it worth closing this issue now, since rustfmt does have basic macro support?

Would it be possible to like annotate the macro like
#[rustfmt(struct_init)]
macro_rules! foo...

where the syntax for foo! would be
foo! {
  foo: "abcd",
  bar: 1,
};

?

Would it be possible to like annotate the macro like

Suppose it could be possible for those defined within the project being formatted, but practicality would be questionable since I imagine rustfmt would have to do an upfront walk of the entire tree to search for such attributed defs. Wouldn't be possible at all for defs residing outside the current project, as rustfmt wouldn't have insight into those attributes.
That bifurcation would result in different formatting in cases like a crate's documentation vs. what consumers would see in the formatted version of the instances where they call those macros.

Fairly new to rust, and I'm curious, why is formatting macros in rust hard.  How does it compare to formatting macros or templates in C++?

@drbartling A Rust macro defines its own custom syntax. So rustfmt has to either hard-code support for it, or somehow expand it to figure out what it does, or have the developer annotate the macro to teach rustfmt how to format it.
Only the latter two options can work for all use cases. But macros can be imported, so rustfmt will have to be extended to resolve names across modules/crates. This is a big step up from its current approach, where it only looks at a single file in isolation.

@lambda-fairy a fourth intermediate option would be to annotate each macro invocation, instead of the macro definition, with hints on how to format it. I guess most of the time a basic "add/remove 1 tabulation level after {/}" + "insert a new line after a semicolon" could really improve readability even if it is not perfect. I agree it is not as ideal as inferring formatting from the macro definition, but it would be easier to actually implement.

Not all macros define custom syntax, eg println!.
It's especially inconveinent when an entire definition of a function is wrapped within a macro to hand-format it.

While I'm thinking about it, why not just let the macro invocation formatting untouched? As @lambda-fairy said, a Rust macro defines its own custom syntax, and rustfmt is a Rust syntax formatting tool. Why not let the writer be in charge of formatting what is inside a macro invocation?

This is to me a very good idea. But how would such an API look like? How could macro authors (both procedural and declarative) go about instructing rustfmt how to format their syntax?
I think the majority of macros use rust syntax, and there should be a simple attribute that can be attached to the macro definition that tells rustfmt to format invocations as rust code.
For the custom syntax, I don't have a clue how procedural macros could go about doing this. For declarative macros, breaking changes aside, I could see it working by defining the syntax structure within the patterns themselves.

If we just solved the case of a rust syntax embedded in a macro - e.g. the cfg-if crate is a good example of this - it would help developers a lot.

I'm wondering, is there a reason rustfmt can't format simple "known" macro arguments, like expr, block, etc? I have a really simple macro that is literally just a few lines that surrounds a block with an if/else block:
macro_rules! section {
        ($title:literal, $body:expr) => {
        let span_section = trace_span!(target: UI_TRACE_BUILD_INTERFACE, $title).entered();
        let maybe_node = ui.tree_node_config($title).opened(true, Condition::FirstUseEver).push(); // Should be open by default
        if let Some(opened_node) = maybe_node {
            trace!(target: UI_TRACE_BUILD_INTERFACE, "node expanded");
            $body
            opened_node.end();
        }
        else{
            trace!(target: UI_TRACE_BUILD_INTERFACE, "node closed");
        }
        span_section.exit();
    };
}

In this example, $body is a simple block argument, which should be easily parseable since it has to be valid rust. However, rustfmt ignores it, which makes it tricky to work with (when I use it, I have many levels of nesting and it is hard to manually format it every time I change a few lines).
Would it be possible to simply tell rustfmt that a few certain argument types can be formatted, possibly with the ability to annotate the macro with a no_format attribute if it shouldn't be formatted? Would this solve the problem?

@Ararem rustfmt doesn't do any macro expansion and therefore doesn't know that $body:expr is going to expand to a block. Most expressions need a trailing ; if they aren't the last item in a block so adding a trailing ; to $body should solve your issue.
macro_rules! section {
        ($title:literal, $body:expr) => {
        let span_section = trace_span!(target: UI_TRACE_BUILD_INTERFACE, $title).entered();
        let maybe_node = ui.tree_node_config($title).opened(true, Condition::FirstUseEver).push(); // Should be open by default
        if let Some(opened_node) = maybe_node {
            trace!(target: UI_TRACE_BUILD_INTERFACE, "node expanded");
-            $body
+            $body;
            opened_node.end();
        }
        else{
            trace!(target: UI_TRACE_BUILD_INTERFACE, "node closed");
        }
        span_section.exit();
    };
}

Adding the ; and then running rustfmt produces:
macro_rules! section {
    ($title:literal, $body:expr) => {
        let span_section = trace_span!(target: UI_TRACE_BUILD_INTERFACE, $title).entered();
        let maybe_node = ui
            .tree_node_config($title)
            .opened(true, Condition::FirstUseEver)
            .push(); // Should be open by default
        if let Some(opened_node) = maybe_node {
            trace!(target: UI_TRACE_BUILD_INTERFACE, "node expanded");
            $body;
            opened_node.end();
        } else {
            trace!(target: UI_TRACE_BUILD_INTERFACE, "node closed");
        }
        span_section.exit();
    };
}

@ytmimi I may have been unclear - it was where I was using the macro that it didn't format correctly, not the macro definition. And regarding the macro expansion, does that mean that rustfmt doesn't know that it's a body block when I use it, either?
If this is the case, how about implementing an approach similar to gene-michaels - where it attempts to parse it as valid rust, and if it does, then it formats it. Or would that also still cause issues?

@Ararem it might be better to open up a new issue to discuss your issue in more detail

@Ararem it might be better to open up a new issue to discuss your issue in more detail
I was slightly wrong as to the cause, but will do soon.
Apologies for cluttering this issue. Shall I delete my previous comments?

@ytmimi Have created issue #5652

is there a way for proc macro developers to provide rustfmt with a formatting routine?

@dvc94ch there is no way for a macro author to tell rustfmt how to format their macro. If you'd like, you can open a new issue to discuss your specific use case in more detail.

As far as I know, dioxus fmt is the only project to provide macro formatting.
https://github.com/DioxusLabs/dioxus/tree/master/packages/autofmt
It would be great to allow dioxus fmt to hook into cargo fmt somehow.

Would it be possible for a library author to add some kind of instructions for rustfmt on how to format its macros invocation?
Maybe some kind of macro_rules! too but for formating, let's call it  rustfmt_rules! defined just after the definition of the macro.
For the instructions I was thinking reusing some of the fragment-specifier from the macros system itself.
For example for tokio::select! it could be:
/// In tokio/src/macros/select.rs

#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
macro_rules! select {
    ...
}

rustfmt_rules! select {
    $(biased;\n):?
    $($:pat = $:expr$(, if $:expr ):? => $:expr,\n)*
    $(else => $:expr):?
}

In the rustfmt_rules! we proceed in order.
First, we can see a capturing group $( ), that is qualified with :?, it would mean an optional group that may not be present. Inside the caturing group, we have a regex biased;\n, so the formating should be just "biased;" and newline.
Next, we have zero or more repetitions group $( )*, inside we have a Rust pattern $:pat follow by " = " and a valid Rust expression $:expr, followed by an optional group (", " + Rust expression), then a litteral " => ", Rust expression, "," and newline.
Last line, we have an optional group "else => " +  valid Rust expression.
So this is kind of a reuse of the macro system, but instead of parsing, it would be used to inform rustfmt how to format (litteral, newline, valid Rust code...)

@GilShoshan94 that suggestion was previously made above, and the challenges/rationale against has similarly already been shared

What sort of issues would there be with only adjusting spacing around punctuation? Not applying wrapping or anything else to the content, but I think a simple subset might handle the most common mistakes I make:

No spaces before or after: .,::
Space after but not before: ., :, ], ),
Space before but not after: [, (
Space on both sides: =>, {, }, operators
Replace multiple spaces with a single space
Don't adjust indentation within the section, but make sure the lowest indentation level within the section is one more than the macro (if multiline)

// before
macro!(
foo =>bar; Baz:qux
    [ "quux",corge]);

// after
macro!(
    foo => bar; Baz: qux
        ["quux", corge]
);

Contextual reminder: rustfmt operates on the AST, and does not directly work with input files. For macro calls, rustfmt doesn't really directly process the arg tokensteams either; it chucks the tokens back to rustc_parse, and if rustc_parse says those tokens look like some other type of valid Rust syntax (e.g. an expression), then rustfmt is able to apply the associated rules. This is important to keep in mind because it's not a question of "adjusting" things like existing whitespace/indentation in an input file.
I don't think that's behavior we'd want to drop in lieu of more simplified token-by-token processing (even if feasible), because many users/many call sites want the args to be formatted just like regular Rust code. I'm also not sure if/how well those two models could coexist, or even if one could truly define a singular set of by-token rules that would work unequivocally across all macros (my gut says that at a minimum there would be pairs of macros with conflicting needs e.g. what makes sense for html! may be contrary to the needs of some other macro).
TBH I think the only feasible path forward that maintains a cohesive formatting experience with the rest of the code is to have better support for macros that do work with valid-Rust syntax (there's some challenges in the current model that are solvable, e.g. calls with tokenstreams that can be parsed as multiple types of valid syntax, designating/handling specified macros with args that are mostly valid syntax, etc.) and then potentially starting to special case individual macros, preferably with the majority being able to utilize a relatively small set of formatting patterns.
However, I don't expect any changes/improvements on this front for the foreseeable future; we've too little bandwidth and too many cases of valid Rust syntax that rustfmt doesn't yet support which takes priority.

Why not just add rust formatting for info!() macros? Or macros which are simply like function calls (except using ! in their name).

What about a way for individual macro creators to dictate how their macros are formatted? Something like a trait, but specific to cargo fmt that has an optional implementation if the macro creator so chooses to implement it. I could see large framework creators like tokio-rs taking the time to implement this, while smaller crates don't have to.

Want to reiterate that the suggestion in https://github.com/rust-lang/rustfmt/issues/8#issuecomment-2197671615 and alluded to again in the IRLO thread noted https://github.com/rust-lang/rustfmt/issues/8#issuecomment-2334077035 has been suggested and responded to multiple times in this thread (e.g. https://github.com/rust-lang/rustfmt/issues/8#issuecomment-1470141940)
Different tools operate at different stages of the process for varying and valid reasons based on their own respective purposes and contexts/constraints.
rustfmt operates at an early stage in the process, directly on the AST, which allows it do things like still being able to format code that doesn't compile. Even if we momentarily presume there's a mechanism that makes it both possible and desirable for macro authors to dictate their own formatting, there's a technical problem because that's not information that would be accessible in the earlier stages like lexing & AST generation, and would require rustfmt to shift to some post expansion, resolution, etc. which would in turn result in certain features/capabilities no longer being possible
Furthermore, I'd just pose the question as to whether or not it would truly be desirable for consumers of a macro.
Imagine a scenario where you're using multiple 3rd party macros, each of which has authors that have widely diverging formatting that starkly contradict each other (e.g. within your own codebase you've got standard rustfmt'ed code using 4 space indents immediately followed by one macro callsite where the author forced 8 space indents that's then followed by another macro call that's got 2 space indents, etc.)
Each macro author would also ostensibly have the autonomy to change their formatting whenever they wanted (i.e. i'm not aware of any semver spec requirement that would force macro authors specifying their own formatting rules to have to do a major version bump if they changed their formatting rules), so I think you'd be forced to ensure that relevant dependencies are pinned to an exact version to ensure formatting is consistent for all your contributors and that CI checks don't fail because you have an ephemeral CI environment that picks up a different version of a transitive dependency, upgrades on dependencies containing macros would potentially introduce code diffs, etc.
What about configuration options? Macro authors could conceivably want to enable configurable options for their bespoke macro formatting, and if so, where would those be defined? Would they want their users to be able to specify those in the standard rustfmt config file? how would rustfmt (and the rustfmt team) be able to marry those options correctly with whatever version of the dependency that defines the macro & macro formatting rules? what if macro authors wanted their own config file?
I ask these questions somewhat rhetorically to convey some skepticism. I'm sure there's people smarter than me that could devise grand solutions for all of these, but I'm still not convinced it would be the right solution to the problem.
A big part of the approach and bounding constraints (e.g. stability guarantee) for rustfmt are centered around tenants like consistency and minimizing formatting-driven code churn. I feel like positioning rustfmt as a general purpose formatting platform would run counter to that or at a minimum create a very conceivable surface for those tenants to be directly contradicted.

@calebcartwright
First of all, thank you for your detailed reply and summarizing the discussion so far for me. Let's see.

that's not information that would be accessible in the earlier stages like lexing & AST generation

I understand the current constraints of rustfmt with respect to early processing stages, but aren't proc macros processed in a compilation unit separate from consuming code? Perhaps this is a misunderstanding on my part, but wouldn't defining syntax metadata/parser/etc. in the same compilation unit allow potential consumers of said data, like rustfmt, to access it at any stage of processing the inputs to a macro, as long as it is exposed somehow?

Imagine a scenario where you're using multiple 3rd party macros, each of which has authors that have widely diverging formatting that starkly contradict each other (e.g. within your own codebase you've got standard rustfmt'ed code using 4 space indents immediately followed by one macro callsite where the author forced 8 space indents that's then followed by another macro call that's got 2 space indents, etc.)

I feel it would be the responsibility of the library developer to provide a formatting experience that does not conflict with the user's needs. Eg. rustfmt doesn't force you to use specific indentation, so why should they? Though I suppose there could be edge cases where a certain kind of formatting is genuinely needed for the macro to work, in which case... This seems more like a functionality issue than a formatting one, as the mismatch would exist independently of formatting tools. I hope I understood your concern correctly.

Each macro author would also ostensibly have the autonomy to change their formatting whenever they wanted (i.e. i'm not aware of any semver spec requirement that would force macro authors specifying their own formatting rules to have to do a major version bump if they changed their formatting rules)

It is impossible to force or expect a developer to interpret semver in a specific way, but this would directly impact the user experience when working with a macro. I think it would be reasonable to expect stability guarantees similar to those provided by rustfmt. Naturally, developers will avoid introducing changes that disrupt CI processes, as stability is a key factor for adoption.
I understand and share the concern of formatting and macro definition versions being entangled, and it's not something I quite have a good solution to. Maybe establishing formal guidelines or best practices around versioning for macro formatting rules would help clarify these expectations without enforcing rigid rules. If this isn't satisfactory, perhaps a community discussion could help find a common ground. 😉

What about configuration options?

If rustfmt were to adopt such an interface, external files could be one approach, potentially with a hardcoded filename and a discovery algorithm similar to rustfmt’s own. This would avoid cluttering the existing configuration schema, and it’s just one example of how these challenges could be addressed
I’m not advocating for a specific solution here, but rather exploring possibilities to demonstrate that practical solutions are out there. Of course, these are just initial thoughts, and community feedback would be essential in refining any approach.

I feel like positioning rustfmt as a general purpose formatting platform would run counter to that or at a minimum create a very conceivable surface for those tenants to be directly contradicted.

I sympathize with that concern. This is one of the thoughts that have been on my mind. Expanding it into a general-purpose formatting platform could indeed lead to complexities that might compromise consistency and stability.
To clarify, rustfmt is mentioned here mainly because it’s been the focal point for much of the community's requests and discussions on the topics. I’m not entirely convinced that adapting rustfmt is necessarily the best or only approach, but there’s clearly significant interest in improving the toolchain's capabilities when working with macros.
Different use cases and values exist across the community. I believe it would be beneficial to create a space where these discussions can take place. I am interested in exploring how we can address these needs without compromising on the goals of any part of the toolchain.

but wouldn't defining syntax metadata/parser/etc. in the same compilation unit allow potential consumers of said data, like rustfmt, to access it at any stage of processing the inputs to a macro, as long as it is exposed somehow?

if Rust's AST contained the information then yes, any tool that works with Rust's AST would have access to that information.
Whether Rust's AST should or feasibly could contain that type of metadata, and what the associated impacts could be is a different discussion for different people (and I know you're just trying to facilitate such a discussion, I'm just noting that we can't really speak to that beyond personal thoughts & opinions)

I understand the current constraints of rustfmt with respect to early processing stages, but aren't proc macros processed in a compilation unit separate from consuming code? Perhaps this is a misunderstanding on my part, but wouldn't defining syntax metadata/parser/etc. in the same compilation unit allow potential consumers of said data, like rustfmt, to access it at any stage of processing the inputs to a macro, as long as it is exposed somehow?

To add to Caleb's comment above, rustfmt can really only reliably and consistently format your code based on information in the AST. rustfmt is capable of formatting code that doesn't compile (as long as it parses), and it's possible to format code for a project before it's ever been compiled. Relying on the output from compilation and potentially introducing formatting differences between pre / post compilation would not be ideal.


⚠ Bofrost.fr has degraded performance

In 220ce0c, Bofrost.fr (https://www.bofrost.fr) experienced degraded performance:

HTTP code: 200
Response time: 1088 ms

Resolved: Bofrost.fr performance has improved in 6180484 after 14 minutes.


Add ReactNative helper

@alfonsogarciacaro could you please release this? Would love to test it from package

Done! :+1:

here is a sample: https://github.com/Krzysztof-Cieslak/fable-react_native-demo/blob/master/src/ImagePickerApp.fs#L28

This looks really useful! I'll try to add more helpers for the other components :+1:

that would be awesome.

meanwhile I'm trying to do the actual prototype ;-)


Using logger with webpack watch: true throws error

entry.message can be undefined when using webpack with watch: true
PR Checklist
Please check to confirm your PR fulfills the following requirements:

[ ] The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-commit-message-guidelines
[ ] Tests for the changes have been added (for bug fixes / features)
[ ] Docs have been added / updated (for bug fixes / features)

PR Type
What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: N/A
What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

Thank you for your contribution. However, since the Contributor License Agreement (CLA) hasn't been signed, we're unable to proceed with this pull request.


Ability for plugins to bundle templates

Plugins should be able to bundle templates.
The Datasette template loader should then consult those plugins first when loading a template.
Jinja2 has a PackageLoader class that can help with this: http://jinja.pocoo.org/docs/2.10/api/#jinja2.PackageLoader
Refs #14

No need to use PackageLoader after all, we can use the same mechanism we used for the static path:
https://github.com/simonw/datasette/blob/b55809a1e20986bb2e638b698815a77902e8708d/datasette/utils.py#L694-L695


Expected object of device type cuda but got device type cpu

Hi, Thank you for your great work!
I've got a problem. Can you help me?
RuntimeError: Expected object of device type cuda but got device type cpu for argument #1 'self' in call to _th_index_select

Problem solved Thank you


Poor Performance With Lots Of Text

I'm running into an issue where users need to be able to copy & paste + type large amounts of text for a given field of data, such as a report description.
Once a large amount of text has been entered, when typing, the WYSIWYG editor begins to lag significantly, making it almost unusable. The problem seems to affect at least Chrome and IE, but probably most/all browsers.
I'll include a link to a Plunker demonstrating the issue. Run the code, then start typing in the WYSIWYG on the right hand side. The faster you type, the more you'll notice the lag. Now clear all the text out, and start typing again. You'll see the lag is gone. While this example is kind of extreme, the problem is, on Internet Explorer, and on less performant systems, the threshold for "large" amounts of text is as low as 50 words before the lag starts to make the WYSIWYG unusable. Also note, that this doesn't seem to be an issue when using only TinyMCE (sans Angular & ui-tinymce).
Plunker: https://plnkr.co/edit/mpRJHBr67962YqWdJ4UF
Let me know if I can provide any more info to help, or if you have suggestions on a workaround or fixes.

Do you notice these issues on TinyMCE's demo pages without the use of our library?

It does not happen on the demo pages, only when using ui-tinymce directive.

Thanks for reporting, I do see the same thing you are seeing.
I will look into this, but I'm not sure what is causing it off the top of my head. Going to mark it as an enhancement since nothing is really broken.
If you have any fixes please feel free to put out a PR.

Pull request issued, please review and advise, thanks.

Although a pull request making this issue better has been merged in, I am going to leave the ticket open for now to see if we can improve upon it even more.

Having a similar issue.  Anyone have other thoughts on how to improve performance here?  I'm a little stumped.  Though the problem seems to be the ed.on ('something has changed'){ ed.save(); update...}
function.

@lauraerinmann, after this comment a new version was released to debounce updates.
This should have solved the issue a bit, I suggest updating to see some improvement. Will leave this PR open to see if we can't improve it more.

@deeg yeah I noticed those changes and I added them to my application.  Still the same issue when the amount of the content in the editor is sufficiently large.


problem with AvailablePhoneNumbers.all

This is the error I get with ExTwilio.AvailablePhoneNumber.all()
** (Protocol.UndefinedError) protocol Enumerable not implemented for nil. This protocol is implemented for: Date.Range, File.Stream, Function, GenEvent.Stream, HashDict, HashSet, IO.Stream, List, Map, MapSet, Range, Stream
    (elixir) lib/enum.ex:1: Enumerable.impl_for!/1
    (elixir) lib/enum.ex:141: Enumerable.reduce/3
    (elixir) lib/stream.ex:1411: Stream.do_enum_resource/6
    (elixir) lib/enum.ex:1919: Enum.reverse/1
    (elixir) lib/enum.ex:2588: Enum.to_list/1
    (elixir) lib/enum.ex:1163: Enum.into/2
    (ex_twilio) lib/ex_twilio/resources/available_phone_number.ex:20: ExTwilio.AvailablePhoneNumber.all/1

The problem seems to be because of the way ExTwilio is expecting the body to be. The response body has the following structure:
{
	"uri": "/2010-04-01/Accounts/AC6fc00e901b08cf09d865ba437f8ae0d1/AvailablePhoneNumbers.json",
	"countries": [{
		"country_code": "IL",
		"country": "Israel",
		"uri": "/2010-04-01/Accounts/AC6fc00e901b08cf09d865ba437f8ae0d1/AvailablePhoneNumbers/IL.json",
		"beta": false,
		"subresource_uris": {
			"local": "/2010-04-01/Accounts/AC6fc00e901b08cf09d865ba437f8ae0d1/AvailablePhoneNumbers/IL/Local.json",
			"toll_free": "/2010-04-01/Accounts/AC6fc00e901b08cf09d865ba437f8ae0d1/AvailablePhoneNumbers/IL/TollFree.json",
			"mobile": "/2010-04-01/Accounts/AC6fc00e901b08cf09d865ba437f8ae0d1/AvailablePhoneNumbers/IL/Mobile.json"
		}
	}, {
		"country_code": "US",
		"country": "United States",
		"uri": "/2010-04-01/Accounts/AC6fc00e901b08cf09d865ba437f8ae0d1/AvailablePhoneNumbers/US.json",
		"beta": false,
		"subresource_uris": {
			"local": "/2010-04-01/Accounts/AC6fc00e901b08cf09d865ba437f8ae0d1/AvailablePhoneNumbers/US/Local.json",
			"toll_free": "/2010-04-01/Accounts/AC6fc00e901b08cf09d865ba437f8ae0d1/AvailablePhoneNumbers/US/TollFree.json"
		}
	}]
}

Looks like the implementation would try to look at available_phone_numbers key under the response but the result does not have that.
Also, I am not sure how we would go about fixing this esp. it would be probably good to generate ExTwilio.AvailablePhoneNumbers.US.all() and so

Also just hit this

Should you find yourself hitting this issue, and you don't really need to have a specific number, you can use IncomingPhoneNumber.create/2 and supply an area_code, like so:
ExTwilio.IncomingPhoneNumber.create(area_code: "415")

(I just spent far too long figuring that out, so I figured I'd save someone else the time).

When running ExTwilio.AvailablePhoneNumber.all() the error referenced in the original issue above still occurs. @mjaric is correct that this is because the returned data from Twilio isn't what ex_twilio expects as it is a list of countries and types of phone numbers (Local, Mobile, Tollfree) instead of the numbers themselves.
I still can't find this documented anywhere, but after digging into the code I found that the UrlGenerator does understand the country and type specific requests that the AvailablePhoneNumber endpoint returns.
The only way to make the .all() function work is to provide the two correct options, even though none are explicitly required. More options can be added to filter the results, but the first two must always be provided.
For example:
    # US Local Numbers
    ExTwilio.AvailablePhoneNumber.all(iso_country_code: "US", type: "Local")

    # US Local Numbers for an area code
    ExTwilio.AvailablePhoneNumber.all(iso_country_code: "US", type: "Local", area_code: "321")


Updated to Swift 2 syntax

Looks like that mostly failed because Travis still doesn't support Swift 2.0 (though it is listed as high priority on their site)
Cloning @piercifani's branch, I can confirm the example project builds and runs fine. Trying to build the framework target in isolation fails for me due to screwy build settings to do with the pods and the (non-existent) tests for the framework, but it's not hard to fix.
Oh and the tests in the example project fail because the system font and navigation bar background have changed - that's another topic for another time.

@piercifani I've merged #25 in favour of this, initially due to the test failure.  Thanks a lot for your PR all the same.


Track metrics (costs) throughout delegation

What is the problem that this fixes or functionality that this introduces? Does it fix any open issues?
OpenDevin tracks costs and allow users to set up a max budget for each task, but it doesn't work for delegates. Specifically, parents and children don't share the budget. This means execution for a task can exceed its preset budget.
Give a brief summary of what the PR does, explaining any non-trivial design decisions

When a parent delegates to a child, it needs to deduct current accumulated cost from the budget.
When a child returns control to its parent, the parent should update its metrics.

Other references

This PR is not ready for review; this is trickier than I initially expected.

This could be interesting for this PR's topic:
https://github.com/BerriAI/litellm/pull/4349


Suggestion: consistent config or use browserslist for build config

Currently the default build config is inconsistent:

TypeScript transpilation is set on es5 (so for IE),
but polyfills are set for evergreen (so not for IE),
and now auto-prefixer is set on IE9+ with default browserslist file in v6.

The default configuration should at least be consistent for those 3 aspects of compatibility.
I know that the TS target was stuck on es5 because of one special case (about tests I guess), I don't know if it's still a problem (@filipesilva ?).
But the CLI could do even better: now that there is an explicit default browserslist file, maybe it could use it to adapt the configuration of TS and polyfills automatically.

I don't quite follow the logic that es5 is for IE. There's a couple of reasons for the es5 default:

no browser/node has 100% ES6 compatibility: https://kangax.github.io/compat-table/es6/
JIT does not work with ES2015 https://github.com/angular/angular-cli/issues/7797 (which leads to tests not working as well, because they run in JIT

So it isn't really a matter of using es5 for IE, nor of being inconsistent.
The suggestion of using browserlist to determine polyfills is already put forward in https://github.com/angular/angular-cli/issues/6577 though. It's a cool idea to use it to choose a es2016 target as well. I'll mark this one as a duplicate and add that suggestion there.

The only thing missing in ES2015 support in modern browsers is proper tail calls, and as far as I know, it doesn't prevent from serving es2015 right now. More and more people are already doing it.
Still, the 2 other aspects (polyfills and auto-prefixer) are inconsistent: first is configured for evergreen by default and require action for IE support, second is configured for IE by default.

For es2015 target, from official APF v6:

Now that all evergreen browsers natively support ES2015 (ES6), we encourage that the whole front-end ecosystem transitions over to distributing JS code at the ES2015 language level. Doing so will simplify the build process and will enable new optimizations resulting in better optimizations during packaging and minification

I think you're right, regardless of the ES2015 question, the polyfills-browserlist question is still valid on its own.
APF recommends that ES2015 code is distributed, but that's a library packaging concern. I'm not sure it's applicable for apps. Just because evergreen browsers support ES2015 doesn't mean you want your app to be bundled to ES2015, or that you only want to support evergreen browsers. The APF recommendation just says that libraries should have that option.

Thanks for reopening the issue.
About ES2015, if it's recommended to distribute librairies in ES2015, it's a fortiori recommended for apps too. Otherwise, if the all apps always retarget to ES5, then having the library distributed in ES2015 was not necessary in the first place.
Of course, which configuration should be enabled by default (evergreen or old browsers) would be a huge debate, with a lot of pros and cons on each side.
But a major point is: I think there is an important and good reason polyfills are configured for evergreen only by default: it's because activating all the polyfills has a huge size/performance impact. It is certainly why that choice was done in the first place. And, correct me if I'm wrong, but I don't think you'll change your mind about this (and it's good for me).
Then, as users who wants IE support have to take action for polyfills, it would be better if the other aspects (ES target and auto-prefixer) were consistent and configured for evergreen by default too.
That way, only people needing IE support would have to take action, instead of currently everyone has to take action to match their needs (of course, you can build for evergreen without taking action with the current options, but then you're not in an optimized configuration, which is one of the main goals of the CLI).


Merge before the new release

The merge will wait until this fixed https://github.com/dice-group/Ontolearn/issues/270


[EXP] How to use unocss?

What is the example you wish to see?
This one is hard to show because it is automatically generated and the code written is the same as normal. Here's an example:
The framework already supports tailwindcss. If I want to use unocss, how can I load it? I can't find the way to load other extensions
Is there any context that might help us understand?
unocss Just a plug-in, the code effect is of no reference, because just like writing a normal class name, want to know how to make it work
Code of Conduct

[X] I agree to follow this project's Code of Conduct
[X] I checked the current issues for duplicate problems.

Thanks for filing an issue - Can unocss be used as a postcss plugin?

感谢您提交问题 - unocss 可以用作 postcss 插件吗？

According to the information I have inquired, it seems that it cannot be used directly

I'd also like to know if UnoCSS can be used in a Plasmo extension. Thanks!

Thanks for filing an issue - Can unocss be used as a postcss plugin?

Unocss has @unocss/postcss plugins, but it use cjs. I followed the example provided by unocss to integrate with postcss, but I keep getting an error that says "Could not resolve module 'node:fs/promises'". Is this because plasmo's build and bundling tool is not compatible?
This is unocss's doc about how to use postcss plugins: https://unocss.dev/integrations/postcss#postcss-plugin

Thanks for filing an issue - Can unocss be used as a postcss plugin?

Unocss has @unocss/postcss plugins, but it use cjs. I followed the example provided by unocss to integrate with postcss, but I keep getting an error that says "Could not resolve module 'node:fs/promises'". Is this because plasmo's build and bundling tool is not compatible?
This is unocss's doc about how to use postcss plugins: https://unocss.dev/integrations/postcss#postcss-plugin

@louisgv Hello,I found it is parcel's version reason. parcel has fix this error in v2.10.0, and plasmo latest version (0.84.2) use parcel with v2.9.3.
When plasmo will update parcel's  version?
parcel fix node:path error in this mr: https://github.com/parcel-bundler/parcel/pull/9244

Same problem, could you please solve this problems


Optimize roots storage

Use cache for roots table in consensus engine
Refactor election module to use this cache
Minor optimization for emitter's tx turns
rm MaxValidators constant

Codecov Report

Merging #385 into master will increase coverage by 0.13%.
The diff coverage is 75.39%.

@@            Coverage Diff             @@
##           master     #385      +/-   ##
==========================================
+ Coverage   48.18%   48.31%   +0.13%
==========================================
  Files         129      130       +1
  Lines        9002     9017      +15
==========================================
+ Hits         4338     4357      +19
- Misses       4304     4306       +2
+ Partials      360      354       -6

Impacted Files
Coverage Δ

gossip/handler.go
50.11% <ø> (+0.47%)
:arrow_up:

poset/epoch.go
64% <ø> (-4.58%)
:arrow_down:

gossip/emitter.go
40.74% <0%> (-0.42%)
:arrow_down:

integration/assembly.go
63.33% <100%> (ø)
:arrow_up:

poset/checkpoint.go
73.33% <100%> (ø)
:arrow_up:

poset/poset.go
82.92% <100%> (+3.08%)
:arrow_up:

poset/election/election.go
94.11% <100%> (+0.36%)
:arrow_up:

poset/store.go
46.57% <50%> (+1.12%)
:arrow_up:

inter/pos/validators.go
51.92% <50%> (ø)
:arrow_up:

poset/config.go
50% <50%> (ø)

... and 6 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 5d50a7f...1acca90. Read the comment docs.


Toolbar font & size

Description of the Bug
The MDToolbar widget does not allow changing font style or font size.

@rubengerad ```python
from kivy.lang import Builder
from kivymd.app import MDApp
KV = '''
BoxLayout:
orientation: "vertical"
MDToolbar:
    id: toolbar
    title: "MDToolbar"

MDLabel:
    text: "Content"
    halign: "center"

'''
class Test(MDApp):
def build(self):
return Builder.load_string(KV)
def on_start(self):
    self.root.ids.toolbar.ids.label_title.font_style = "Button"

Test().run()```

The given solution seems incorrect and unable to affect any change to
Toolbar font family, font style or font size.
KV file
#:set default_font_size "16sp" # Using kivy method to set a default size
MDToolbar:
id:dashtoolbar
title: 'Dashboard'
pos_hint: {'top':.87}
# label_title:  # does not have font_style settable attribute
font_style:'Custom'
font_name: 'resources/fonts/Pacifico-Regular'
height:'50dp'
font_size: default_font_size # Tried kivy method for global
default size but does not work.
App.py
Builder.load_string(dashboard_layout)
def on_start(self):
self.root.ids.dashtoolbar.ids.label_title.font_style = 'Button'
#AttributeError: 'NoneType' object has no attribute 'ids'
The MDToolbar attributes do not support any changes to font, style or
size, making it difficult to work with.  Hoping for a bugfix release
soon.
Please be advised that all the code changes have been implemented
here, the purpose of the project is to create a blueprint for my team
to follow and set some common standards for future projects.
https://github.com/rubengerad/kivymd-blueprint
Thanks for the navigationlayout link Yuri, it worked.
On Wed, 19 Aug 2020 at 17:53, Yuri Ivanov<EMAIL_ADDRESS>wrote:

@rubengerad https://github.com/rubengerad ```python
from kivy.lang import Builder
from kivymd.app import MDApp
KV = '''
BoxLayout:
orientation: "vertical"
MDToolbar:
id: toolbar
title: "MDToolbar"
MDLabel:
text: "Content"
halign: "center"
'''
class Test(MDApp):
def build(self):
return Builder.load_string(KV)
def on_start(self):
self.root.ids.toolbar.ids.label_title.font_style = "Button"
Test().run()```
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/kivymd/KivyMD/issues/469#issuecomment-676262552, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/ACOQG3VZNEZHBHEB2KRR3JDSBO72ZANCNFSM4QES6RHQ
.

@rubengerad https://github.com/rubengerad/kivymd-blueprint - bad decision!

That worked thank you bro


How to test networks that takes 2D tensor as input

I have a network which takes a 2d tensor as an input I'm able to train the network by passing the input and output tensors in a loop as follows.
                        for(int i=0;i<TrainingData.Count;i++)
                        {
                            sess.run( optimize,
                                new FeedItem(ToInput, NDFromFloatArray(TrainingData[i].Inputs["ToFeatures"]) ),
                                new FeedItem(Output, TrainingData[i].Output) );

                        }

This code executes correctly, However when it comes to testing the model on the validation set the examples show all values are passed in one array rather than one at a time in a loop.
The example I've found only take a single value so they are just an array of values.
How do i correctly format my array of 2d tensors so they can be used as an input in the following example?
                    NDArray inputs = ValidationInputData( "ToFeatures" );
                    NDArray Outputs = ValidationOutputData();
                    FeedItem F1 = new FeedItem( ToInput, inputs );
                    FeedItem F2 = new FeedItem( Output, Outputs );

                    var ValidationResult = sess.run( tf.reduce_sum(tf.pow(FinalOutput - Output, 2.0f)) / (2.0f * ValidationData.Count), F1,F2);

                    Console.WriteLine($"Validation Results {ValidationResult}");

Is there an example of preparing the data to test a graph which takes a 2d tensor as an input?

Try tf.convert_to_tensor.

What object type should i be passing to the FeedItem?
I'm trying to create a Tensor[] array then populating each slot on the array with tf.convert_to_tensor then passing that to the feed item.

    Tensor[] NDValidationData;

        NDValidationData = new Tensor[ValidationData.Count];

        for(int i=0;i<ValidationData.Count;i++){

            NDValidationData[i] = tf.convert_to_tensor(  ValidationData[i].Inputs[InputSet] );

        }

        return NDValidationData;

{System.NotImplementedException: _run subfeed   at Tensorflow.BaseSession._run(Object fetches, FeedItem[] feed_dict)   at DeepLearningNetwork.TrainNetwork() in /BeliefRefinery/classes/StoredData/DeepLearningNetwork.cs:line 134   at TrainNeuralNetwork.CalculateAttribute() in /BeliefRefinery/classes/Attributes/TrainNeuralNetwork.cs:line 21   at CalculatedAttribute.TryCalculateAttribute() in /BeliefRefinery/classes/framework/CalculatedAttribute.cs:line 149}

If I understand you correctly, you want to feed a 2D array into a tensor, right?
Have you checked out my NeuralNetXor example? see NeuralNetXor.cs
This is the 2d data:
NDArray data= new float[,]
            {
                {1, 0 },
                {1, 1 },
                {0, 0 },
                {0, 1 }
            };

This is the tensor:

            var features = tf.placeholder(tf.float32, new TensorShape(4, 2));

and this is how the data is fed into the run method:
var result = sess.run(new ITensorOrOperation[] { train_op, gs, loss }, new FeedItem(features, data), new FeedItem(labels, y_));

Hope this helps.

@Rleahy That's a good example though.

@henon Thanks for the example however its not quite what I'm struggling with
Using the Liner Regressions example as a reference.
 for (int epoch = 0; epoch < training_epochs; epoch++)
                {
                    foreach (var (x, y) in zip<float>(train_X, train_Y))
                    {
//Here Tensors are added to the feedItem in a loop one one tensor at a time then executed.
                        sess.run(optimizer,
                            new FeedItem(X, x),
                            new FeedItem(Y, y));
                    }

                    // Display logs per epoch step
                    if ((epoch + 1) % display_step == 0)
                    {
//Here multiple data points are passed at once the array seems to contain the tensor values of all data points used to calculate the accuracy of the model.
                        var c = sess.run(cost,
                            new FeedItem(X, train_X),
                            new FeedItem(Y, train_Y));
                        Console.WriteLine($"Epoch: {epoch + 1} cost={c} " + $"W={sess.run(W)} b={sess.run(b)}");
                    }
}

What i need is an example of how to build and format the train_Y and train_X arrays in the above example if there input is a 2D tensor, rather than a single value.

for linear regression train_X is not 2D, it is 1D. Also, the data is passed as a NumSharp NDArray into the FeedItem.
This is from our Linear regression example:
            NDArray train_X = np.array(3.3f, 4.4f, 5.5f, 6.71f, 6.93f, 4.168f, 9.779f, 6.182f, 7.59f, 2.167f,
             7.042f, 10.791f, 5.313f, 7.997f, 5.654f, 9.27f, 3.1f);
            NDArray train_Y = np.array(1.7f, 2.76f, 2.09f, 3.19f, 1.694f, 1.573f, 3.366f, 2.596f, 2.53f, 1.221f,
                         2.827f, 3.465f, 1.65f, 2.904f, 2.42f, 2.94f, 1.3f);

you could also write it like this (using implicit conversion)
NDArray train_X = new float[] { 3.3f, 4.4f, 5.5f, 6.71f, 6.93f, 4.168f, 9.779f, 6.182f, 7.59f, 2.167f,
             7.042f, 10.791f, 5.313f, 7.997f, 5.654f, 9.27f, 3.1f };

2D array can be NDArray train_X = new float[,]{{1f, 2f}, {3f, 4f}}.

@henon @Oceania2018  Thanks again for the advice I'm sorry I'm not been clear enough with my question.
I'm trying to reproduce the linear regression example with more complex inputs.
If X or Y in the example took inputs of a more complex shape such as (3,2) or (3,2,2) rather than just of shape(1) how would that change the away NDArrays are defined for testing.
So if the liner regression example at lines 38 and 39
var X = tf.placeholder(tf.float32);
var Y = tf.placeholder(tf.float32);

was changed to
var X = tf.placeholder(tf.float32,new TensorShape(3,2));
var Y = tf.placeholder(tf.float32,new TensorShape(3,2,2));

How would that change the train_X and train_Y NDArrays that are used to calculate the training cost on line 88 of the example?
      var training_cost = sess.run(cost,
                    new FeedItem(X, train_X),
new FeedItem(Y, train_Y));

I've tried defining an NDArray of shape(10,3,2) to represent 10 sample inputs to X but it throws an out of bounds exception I'm hoping for an example of the correct way to do it.

Have you checked the KMeansClustering example?
If it doesn't help you out. You might have to provide the python code, then we can debug it.

ok, I understand now what you mean. check out this link tf.placeholder
if you do not specify the shape you can feed data of any shape. if you specify it you must feed data in exactly that shape. that is why feeding an array of shap (10,3,2) doesn't work when you define the placeholder with shape (3, 2, 2)
I don't know if it is possible to feed in multiple items with complex shapes but the analogy to feeding a 1D array instead of a scalar when applied to your example would mean you have to add a dimension to feed multiples of that complex shape. i.e (with a placeholder that has no shape defined) feed an array of (10, 3, 2, 2) to feed 10 items of shape (3, 2, 2). that would be my understanding.

PS: the extra dimension is added at the front because in tensorflow dimension order is major-to-minor (akin to row-major at rank 2). See Shapes and Layout

@henon  Yes that's what i'm asking :)
However i've already tried the solution your suggesting and it results in a runtime error.
I have rewritten and cut down the liner regression example to demonstrate that error
  public class LinearRegression
    {

        // Parameters
        float learning_rate = 0.01f;
        NDArray train_X, train_Y;
        int n_samples;

        public void Run()
        {

            PrepareData();

            var X = tf.placeholder(tf.float32, new TensorShape(3,2));
            var Y = tf.placeholder(tf.float32);
            var W = tf.Variable(-0.06f, name: "weight");
            var b = tf.Variable(-0.73f, name: "bias");
            var pred = tf.add(tf.multiply(X, W), b);
            var cost = tf.reduce_sum(tf.pow(pred - Y, 2.0f)) / (2.0f * n_samples);
            var optimizer = tf.train.GradientDescentOptimizer(learning_rate).minimize(cost);
            var init = tf.global_variables_initializer();
            Session sess = tf.Session();
            sess.run(init);

            // Fit all training data runs without issue
            for(int i=0;i<n_samples;i++)
            {

                sess.run(optimizer,
                    new FeedItem(X, train_X[i]),
                    new FeedItem(Y, train_Y[i]));
                    Console.WriteLine($"TrainingIteration: {i + 1}");
            }

            //error occures here
            //An unhandled exception of type 'System.Exception' occurred in TensorFlow.NET.dll: 'Incompatible shapes: [4,3,2] vs. [4][[{{node sub}}]]'
            var c = sess.run(cost,
            new FeedItem(X, train_X),
            new FeedItem(Y, train_Y));

            Console.WriteLine("Finished executing");

        }

        private void PrepareData()
        {
            //setup array for 4 datapoints of shape (3,2) values unimportant for now as we simply want get the code to execute.
            train_X = new NDArray(typeof(float));
            train_X = train_X.arange(4*3*2).reshape(4,3,2);
            //4 outputs to match inputs
            train_Y = np.array(1.7f, 2.76f, 2.09f, 3.19f);

            n_samples = train_X.shape[0];
        }

    }

Add the class to your project then create an instance and call run() in program main.
Can you tell me if this is a bug or have i made a mistake setting up my arrays? If i have made a mistake how should i correct it?

This one is easy to spot, no need to execute it. As I said before
var X = tf.placeholder(tf.float32, new TensorShape(3,2));
must not be defined with a shape if you plan to feed it this way, so try this var X = tf.placeholder(tf.float32);.
By the way, you can easily execute the same in Python and see what errors tensorflow throws in Python. Only if they are different, it is a bug in TensorFlow.NET.

How should i evaluate the cost of the model if one of my placeholders uses a TensorShape?
The model i'm producing has a large number of high rank tensors as inputs, defining each input as an individual value will quickly become a huge mess.
If i wanted to stick with the shape (3,2) input how would i rewrite the

you can do that (looping in your program). you can also use loops within tensorflow. but this question is best put to the tensorflow community. My knowledge is not detailed enough to answer that.


Do not remove/update un-Labled resources in virtual cluster

do not remove/update unlabled (PublicObjectKey!=true) resources in virtual cluster
/assign @christopherhein @Fei-Guo

/lgtm
/approve

Just a note for later, let's make sure we add a couple test cases to catch these additions.


Allow user to individualize settings for each layer

To allow greater flexibility, let the user to customize settings for each layer separately. For example, the user would want to enable a setting (e.g. "Autocrop") for all layers except one. While it could be done with some workarounds (e.g. export again with autocrop disabled), they are quite inconvenient. This information should be stored somewhere in the layers/image so as to preserve it between GIMP sessions.

With the added support for custom layer tags and the upcoming support for custom operations, users may be able to apply specific operations to an arbitrary group of layers (defined by filters or custom tags). In other words, different operations can be possibly applied to each layer.


Stack trace not print

I'm using gcc 4.9.2 on centos 7. I've defined ELPP_STACKTRACE. However, when my app crashed, its stack trace did not show up.

can you add a minimal example to reproduce this issue? Have you seen samples? samples/STL

After I define ELPP_STACKTRACE_ON_CRASH, stack trace is correctly showed up. However I can not get the corresponding source line number.
2015-11-04 17:05:43,774633 CRASH HANDLED; Application has crashed due to [SIGSEGV] signal
    ======= Backtrace: =========
    [1] bin/abstor() [0x511f12]
    [2] bin/abstor() [0x5120dc]
    [3] /lib64/libc.so.6+0x35650 [0x7f695c8b1650]
    [4] /lib64/libc.so.6+0x147c79 [0x7f695c9c3c79]
    [5] /lib64/libstdc++.so.6:std::basic_streambuf<char, std::char_traits<char> >::xsputn(char const*, long)+0x70 [0x7f695d1f4db0]
    [6] /lib64/libstdc++.so.6:std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long)+0x215 [0x7f695d1ebac5]
    [7] bin/abstor:ab::Database::create_table(std::string, std::string, unsigned long)+0x196 [0x58c390]
    [8] bin/abstor:main+0x4ab [0x512b1c]
    [9] /lib64/libc.so.6:__libc_start_main+0xf5 [0x7f695c89daf5]
    [10] bin/abstor() [0x511a39]

It's out of our control especially in single header library, we have to rely on backtrace_symbols and backtrace from cxxabi.h and execinfo.h - this is your compiler's job to provide more details (in mangled form)


Remove unchangeable dimensions from Improve Results - filter outputs page

What
Use showChange to avoid including dimensions that cannot be changed in Improve Results hints
How to review
Tests pass
Sense check
Who can review
FE Go dev

No longer required.


In a multiple-consumer scenario for commands, MassTransit doesn't retry on exceptions?

I was trying out MassTransit 3.1.2 with RabbitMQ with
var busControl = Bus.Factory.CreateUsingRabbitMq(
    cfg =>
    {
        var host = cfg.Host(
            new Uri("rabbitmq://otherhost/msgbus"),
            h => { h.Username("guest"); h.Password("guest"); });
        cfg.UseRetry(Retry.Immediate(5));
    });

and
var address = "rabbitmq://otherhost/msgbus/foo_queue";
var sendEndpoint = busControl.GetSendEndpoint(new Uri(address)).GetAwaiter().GetResult();

while sending messages using:
sendEndpoint.Send<IFoo>(new FooCommand($"{++count}", value)).GetAwaiter().GetResult();

On the consumer side, I was having two of them (in different processes) configured as
cfg.ReceiveEndpoint(host, "foo_queue", e => { e.Consumer<NotifyMerchantConsumer>(); });

where one of the consumer implementations would print out the received message on the command line and the other one would throw exceptions instead.
When I now published a couple of messages in a sequence, the "good" process would retrieve the first, third, fifth etc. whereas the "bad" one would get the second, fourth, sixth, and so on. Because it would throw instead of behaving nicely, the messages eventually ended up in the _error queue.
However, I did not see MassTransit retry the messages at all.

So, what you've done by running two consumers on the same endpoint address is created a send/receive conversation between a message producer and a queue. By sending directly to the queue, you're writing a single message to a queue.
In the case where you have two separate processes reading from the same queue, they are going to compete for messages, with the first available process reading the next message on the queue. This is why you see what you're seeing - the message is only consumed by one of the consumers.
Normally, you would use publish to get multiple copies of the message delivered to unique queues for each consumer. However, you're sending a command -- something that needs to be done in a separate and special way.
There are a couple of ways this can be done, both of which are leveraging the features of RabbitMQ:
First, you can wire tap the command queue, by binding the command queue exchange to another queue:
cfg.ReceiveEndpoint(host, "foo_queue", e => e.Consumer<NotifyMerchantConsumer>());

cfg.ReceiveEndpoint(host, "foo_audit", e =>
{
    e.Bind("foo_queue"); // binds to the foo_queue exchange
    e.Consumer<AuditMergeConsumer>();
}

This will add a binding to the foo__queue exchange to the foo__audit exchange, which results in a copy of each message being delivered to the audit queue.
The other way is essentially the same, but create a command exchange and having both consumer endpoints bind to that exchange:
e.Bind("foo_command");

Each endpoint would bind to that exchange, and the send endpoint address would be the /foo_command address.
I'm pretty sure one of these two options will address your needs.

Should have mentioned that this is a load balancing scenario. I do want the command be processed by exactly one workery, but if that one fails, another one should get the chance.

So that will happen if the process crashes, as the message will not be acknowledged. This will allow another worker to pick up the message.
If you want to retry, you have to add middleware as shown above to the service with the receive endpoint. That will retry the consumer until the retry attempts are exhausted - after which the message will be moved to the error queue.

Not sure I can follow. I tried creating two anonymous queues that Bind to foo_exchange:
cfg.ReceiveEndpoint(host,e =>
    {
        e.Bind("foo_exchange",c =>
            {
                c.Durable = true;
            });

        e.Consumer<FooConsumer>();
    });

But then I didn't know what to do at the sender. So I played around, cleared all the exchanges and queues from the virtual host and then obtained the send endpoint as before. The exchange seems to be created automatically (durable and auto-delete), but now attempts to Send<IFoo>(...) to it result in a 406 Precondition Failed:
The AMQP operation was interrupted: AMQP close-reason, initiated by Peer,
code=406, text="PRECONDITION_FAILED - inequivalent arg 'auto_delete' for
exchange 'foo_exchange' in vhost 'msgbus': received 'false' but current is 'true'",
classId=40, methodId=10, cause=

First of all, what would be the correct way to define an exchange in MassTransit?

 However, it does so in the very same process; what I want instead is to have it tried by another available worker in case the current process is deadlocked, that is, basically have it put back on the original queue up to N times. Is that possible?

Use the message redelivery feature with the message scheduler as shown in the documentation:
http://docs.masstransit-project.com/en/latest/scheduling/redeliver.html

But doesn't that circumvent the retry features? Worst case scenario would be a ping pong of the very same message between the worker nodes. (Apart from that, Quartz seems like overkill, adding another layer of exchanges and queues when I really don't need delayed scheduling.)

You can prevent ping pong situation by checking redelivery count (If redelivery count >limit then throw or something).

Well, you could always catch the exception and send it back to the same queue, but there is no guarantee that the same node will not pick it up again.

Okay. Thanks so far! :) I might come back to it, but since it's not an urgent thing (and apparently not a bug) I'm closing this.


Fixed broken links for listed REST API.

@toanant : Thanks for your contribution! The author, @cynthn, has been notified to review your proposed change.

Verified links work correctly--thank you!


Url navigation change

I'm using the task system to run a chunk of tasks, then check for "completion" in another function. I'm trying to wait for the page to change and data to exist on page or check to see if the Url has changed.
What's the best pattern for this?  The page has no unique elements so the current page's (WaitVisible) wont work.

To be honest, the best way to accomplish a lot of this would be to monitor the Network domain events. The model we have with chromedp though, doesn't monitor Network events, but uses the Page and DOM events. There's "yet another dimension" though, for monitoring above the "Page" level that can only be surfaced through monitoring Network events.
Timing is definitely difficult; you'll see this problem exists more or less in all the various mechanisms for testing/driving browsers. It's difficult to give a general answer that you would always do XYZ, as every page/site is so different, that there's no real catchall. Typically, however, we use WaitNotVisible and then WaitVisible to essentially wait for page-level changes. Since in the ways that we use chromedp, we're not monitoring the low-level Network events.

So in this exact instance, there's no direct element that identifies this unique page. There is unique content on the page, but "WaitVisible" for specific text isn't accessable.
Maybe make the following externally accessable? Or wrap it in some Action we can then chain to WaitVisible?
	textJS = `(function(a) {
		var s = '';
		for (var i = 0; i < a.length; i++) {
			if (a[i].offsetParent !== null) {
				s += a[i].textContent;
			}
		}
		return s;
	})($x('%s/node()'))`

Right now I'm trying to do something like this
	to := time.Second * 5
	found := false

	for {
		// err := chromedp.ActionFunc(func(ctx context.Context, h cdp.Handler) error {
		fn := chromedp.QueryAfter(".content .contentblock .subline span", func(ctx context.Context, h cdp.Handler, nodes ...*cdp.Node) error {
			if len(nodes) == 0 {
				return nil
			}

			for _, node := range nodes {
				var txt string
				if err := chromedp.EvaluateAsDevTools(fmt.Sprintf(textJS, node.FullXPath()), &txt).Do(ctx, h); err != nil {
					return err
				}

				if strings.ContainsAny(txt, "Thank you") {
					found = true
				}
			}

			return nil
		})

		if err := m.chrome.Run(context.Background(), fn); err != nil {
			panic(err)
		}

		if found {
			return true
		}

		time.Sleep(to)
	}

This code obviously has a bunch of flaws and possible dead locks.
How would I monitor the nextwork events?

The real problem is, even if I run this code, it can happen so fast that knowing if ti SHOULD run becomes the issue. The page needs to have been loaded or some javascript needs to have been executed.
For example some background ajax that says that an input is invalid.

Can an action retry a whole task list? IE: this failed, retry?

Can an action retry a whole task list? IE: this failed, retry?

No, but there's an interesting idea there in terms of a high level action that might make sense. I'll think about it, and let me see about putting something like that in.

So in this exact instance, there's no direct element that identifies this unique page. There is unique content on the page, but "WaitVisible" for specific text isn't accessable.

As far as Chrome is concerned, there's no difference between text / or some other node. You just need to know how to write your selectors. You can do it with either CSS or XPath.
It would be something like this: .//*[contains(text(),"search text")]. If you use this with WaitVisible, then you would end up waiting for the node, as the visibility check that is performed is almost identical.
If you need to run javascript, btw, just use the Eval actions.

Looks like the discussion here ended long ago, so I'm closing.


Add round-trip casts between unicode and ASCIIDType

Since Numpy stores unicode data internally as UCS4, I can do these casts relatively straightforwardly without worrying about encoding details.
For unicode to ASCII, I check character by character (e.g. 4 bytes at a time) if the UCS4 character is valid ASCII, if it is I assign the first byte of the character to the corresponding byte of the output array. If we find an invalid ASCII character, we re-acquire the GIL, set a TypeError, release the GIL, and return.
For ASCII to unicode, no error checking is needed, so we just set the ASCII character to the first byte of the corresponding character in the output array, and set the rest of the bytes in the character to zero.
This also includes some other misc fixes I noticed along the way around error checking and handling reference counts.
Finally, mostly as a note to myself to check this tomorrow, I noticed that if I do a round-trip from unicode to ascii back to unicode, but I phrase it like this:
arr = np.array(["hello", "this", "is", "an", "array"])
ascii_arr = arr.astype(ASCIIDType(5))
round_trip_arr = ascii_arr.astype(np.unicode_)

the resulting array will still have ASCIIDType(5) as the dtype. If I specify the output dtype as a string (ascii_arr.astype('U5') as I've done in the round-trip test I added in this PR), it works fine. I need to look into the implementation of astype to understand why that's happening, I suspect it's a numpy bug.

Thanks so much for the comments @seberg, I learn a ton every time you give me code review.
Would you mind taking another look at this when you have a chance?


TCP Steal/mirror doesn't work with shared sockets

Bug Description
When a parent process binds a socket, then children sockets listen/accept on that socket mirrord doesn't intercept those calls because the fd isn't managed (doesn't exist in our fork).
Using this issue to document use cases where this happens for now:

uvicorn when using --reload flag.

Steps to Reproduce
from fastapi import FastAPI
import sys
app = FastAPI()

@app.get("/")
async def root():
    print("cake")
    return {"message": "Hello World"}

@app.get("/hello/{name}")
async def say_hello(name: str):
    print("pake")
    return {"message": f"Hello {name}"}

run with mirrord exec --target pod/pod uvicorn --  --reload --port 80 main:app
Backtrace
No response
Relevant Logs
No response
Your operating system and version
macOS
Local process
python
Local process version
No response
Additional Info
No response

Possible solutions:

hooking fork/exec, then passing down the SOCKET/FILES fd struct as environment variable for fds that aren't CLOEXEC
Use shared memory (shmem) for SOCKET/FILES (dunno about this..)
on listen with missing fd (this happens on uvicorn + reloader case) use getsockname to resolve addr and then decide if to add the socket and backfill the information. This is pretty good approach but has some caveats:

It would work only on the listen case, not if listen is called in parent and accept in child (not sure if this happens and what happens in this case)
the socket information we would get from getsockname would be the "fake port" and not the one the remote would need to listen for, so maybe this is impossible ;(

Please let us know if this is impacting anyone so we can know if we need to prioritize it.

This would probably affect me if not already blocked by this issue

I'm not blocked by this, but it does affect my productivity.
MacOS M1 Pro

I'm not blocked by this, but it does affect my productivity.

I'm running 3.75.0 and I'm not getting traffic with --reload and I do get traffic without it

Also doesn't work when using Uvicorn with more than one worker process.

Happening to me on 3.84.1. I am not using the operator. Not sure if that matters.

Ran into the same issue. Might be worth flagging this in the docs somewhere until its fixed

I've been exploring this, and here are a few solutions I can think of:

:earth_americas:  how can it be global, if the code is flat

The main issue we have is that our sockfds are stored in a per-layer global SOCKETS, which are not being shared between forks. So the proposal here is to just move the SOCKETS global to the intproxy, and change every operation that calls SOCKETS.[get|take](&sockfd) to use make_proxy_request_with_response (or something similar).
A problem with this solution is that now every sockfd becomes shared between execs and forks, which is not ideal. Another (minor) problem is that we must manually remember to call insert after take, as some operations call SOCKETS.take to modify the socket, meh.

:donkey: every masterpiece has its cheap copy

Instead of moving the whole SOCKETS to intproxy, whenever we detect a fork (new layer connection?), we send a copy of the SOCKETS minus the ones with CLOEXEC to the intproxy, which in turn sets the new layer connection's SOCKETS to this curated copy.

:peach: thicc intproxy

Delegate more work to the intproxy, by moving the socket/ops there, and creating some sort of MirrordSocket API that keeps an association between a sockfd and the pid that created it, so we can avoid leaking sockfds.
That's it, so far. I'm leaning more towards the :donkey: solution, as :earth_americas: is a bug waiting to happen, and :peach: is too big of a pointless refactor.

🫏 is what would make most sense and is how it works in terms of OS level too.
We can actually pass all SOCKETS downstream and iterate each fd and see if it's still open (so we'll just follow OS logic if cloexec or not)

Fixed in #2610

Looks like the problem is still there on macOS + vscode.


Move usher options endpoint to fastapi

Summary:

What: Move the usher tree options endpoint to fastapi, and python formatting for the CLI.
Env: https://usher-frontend.dev.czgenepi.org/

Demos:
Checklist:

[x] I merged latest <base branch>
[x] I manually verified the change
[x] I added labels to my PR
[ ] I tested in multiple browsers
[ ] I added relevant unit tests
[ ] I have notified others of changes they need to make locally (migrations, jobs, package updates, etc)

make sure the frontend is migrated before merging, i can help with this if you need it

I updated the API url in the front end in this PR!

cool! I just had a blind moment of panic 😅


[Distributed mode] is there any specific configuration to write test result from servers?

Hi,
I ran test in distributed mode, and I saw the jmeter servers didn't write test result to InfluxDB. They sent those results back to jmeter controller, then controller inject data to InfluxDB.
Could you consider for giving an option to allow jmeter servers send test log directly to InfluxDB?
Thank you.

Hi @anna-phuongnguyen,
The plugin should work in the cluster mode. Please make sure that you have to put that plugin on each slave, master to avoid compilation errors. Please keep in mind in the cluster mode the virtual users chart will show the users per node (but not the sum).  The InfluxDB can be overloaded in cluster mode due to a lot of connections.
BR,
Mike

Thank you for your response @mderevyankoaqa
Yes it works in distributed mode. But there are 2 issues:

It doesn't work with InfluxDB connection info are retrieved from properties file. E.g.  jmeter -n -t test.jmx -G influxdb.properties
To by pass the 1st issue, we have to pass-q influxdb.properties to the run command beside -G.
jmeter -n -t test.jmx -G influxdb.properties  -q influxdb.properties
Metric can be written to InfluxDB, but it resulted error when we tried to run with 2 jmeter servers. It's weird.
WARN o.a.j.v.b.BackendListenerContext: Value for parameter 'influxDBPort' not an integer: 'NONE'.  Using default: '8086'.
java.lang.NumberFormatException: For input string: "NONE"
at java.lang.NumberFormatException.forInputString(Unknown Source) ~[?:?]
at java.lang.Integer.parseInt(Unknown Source) ~[?:?]
at java.lang.Integer.parseInt(Unknown Source) ~[?:?]
at

Finally, my suggestion is to allow jmeter servers to write metric directly to influxDB, instead of send it all to controller.
Thank you

By the way, we tried to run with multiple servers, but in InfluxDB it shown only master node name.

Hi @anna-phuongnguyen,
If you are using cluster (master and slaves) is not possible to allow JMeter servers to write metric directly to influxDB, instead of sending it all to the controller. The plugin inherits the JMeter core implementation.
You need to start the test from each JMeter slave independently manually - > if you need to send metrics directly to influxDB from each slave. In this way, the master node is not using, data for the report will be stored in influxDB.
From another hand, you will not have one file with results like in cluster - just keep in mind.
BR,
Mike


Contribution

What does this PR do?
Add resource(s)
For resources
Description
This pull request adds links to various CTF (Capture The Flag) platforms, enriching the repository's offerings for those interested in practicing and enhancing their skills in cybersecurity.
Why is this valuable (or not)?
These platforms provide a valuable resource for both beginners and experienced professionals, offering free challenges that encourage hands-on learning and skill development in real-world scenarios.
How do we know it's really free?
All platforms included in this pull request are entirely free to access and participate in, with no hidden costs or subscriptions required.
For book lists, is it a book? For course lists, is it a course? etc.
N/A — This pull request focuses solely on CTF platforms, which are interactive resources for skill development.
Checklist:

[x] Read our contributing guidelines.
[x] Search for duplicates.
[x] Include author(s) and platform where appropriate.
[x] Put lists in alphabetical order, correct spacing.
[x] Add needed indications (PDF, access notes, under construction).
[x] Used an informative name for this pull request (branch name: contribution, commit message: "contribution ctf platforms").

Follow-up

Check the status of GitHub Actions and resolve any reported warnings!

sorry for the first submission, I'm not used to using git


[WIP] Adding cross linking to missing cloud providers

aws, gce, azure

This assumes that the kubelet on the node is using the correct cloud provider so that it returns a providerID in the spec. I used it instead of externalID which is deprecated now.

@alongoldboim @simon3z

@miq-bot add_label wip

@dkorn its still wip, but you can review if you want

@zeari please review

Since while parsing you dig into the db to cross link with another provider, its worth to add tests.
You can use FactoryGirl.create(:ems_amazon, ...) to create a corresponding mock-provider for testing and then test your cross link method.

Its a little tedious but it will prevent this feature from breaking down the road if changes are made to those providers

specs look good LGTM :+1:

@miq-bot remove_label wip

@simon3z please review

@miq-bot add_lable wip

@zeari @alongoldboim I refactored it and I need more review now. could you please review? @dkorn @moolitayer  could use your help as well if you feel like it.

@miq-bot remove_label wip

@enoodle give it a nice rebase. :)

@simon3z @abonas please review

I added a test for failure.

@simon3z, @zeari can you review one last time this more final version?

@simon3z , @zeari , @moolitayer I think you all reviewed this but forgot to give LGTM after I fixed your  comments. just saying ;-)

@simon3z , @zeari , @moolitayer I think you all reviewed this but forgot to give LGTM after I fixed your comments. just saying ;-)

Two nit comments on tests:

Usually after clause are on the top, it was hard for me to understand what you are testing until I reached the bottom
Can you use openstruct from the stdlib for your needs?

LGTM :+1: ready for merge cc @chessbyte @blomquisg


feat: bump-up tsa + e2e (CLI)

Description
What this PR does / why we need it:

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged):
This is heading a new PoC branch and ready to merge
Bump-up notation-go and add timestamp related e2e tests
Reference: https://hackmd.io/CR_XKZsMSvyjjxU6fOqdcw?both
Type of change
Please delete options that are not relevant.

[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] Helm Chart Change (any edit/addition/update that is necessary for changes merged to the main branch)
[ ] This change requires a documentation update

How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

[x] e2e: CLI - using valid cert, setting trust policy to always verify tsa signature
[x] e2e: CLI - using exp cert and setting trust policy to verify afterCertExpired
[x] e2e: CLI - verification failure for invalid root tsa cert

Checklist:

[ ] Does the affected code have corresponding tests?
[ ] Are the changes documented, not just with inline documentation, but also with conceptual documentation such as an overview of a new feature, or task-based documentation like a tutorial? Consider if this change should be announced on your project blog.
[ ] Does this introduce breaking changes that would require an announcement or bumping the major version?
[ ] Do all new files have appropriate license header?

Post Merge Requirements

[ ] MAINTAINERS: manually trigger the "Publish Package" workflow after merging any PR that indicates Helm Chart Change

Local test: https://github.com/junczhu/ratify/pull/5


Fix: warning undefined $USER_AGENT

Fix $USER_AGENT visibility to avoid  :
In QuickChart.php line 127:
Warning: Undefined variable $USER_AGENT
Context : php examples/short_url.php

Oops, thanks for catching this!

You're welcome !


Benchmark various implementations of CC2 and ADC(2)

It's quite likely that TDDFT will not be enough, and for our target of small to medium size organic molecules, ADC(2) and CC2 should still be attainable. We should do at least a basic benchmark of various implementations in Turbomole, eT, MRCC and TeraChem (possibly others?). Single core performance is more important than parallel scaling in our case since we're running multiple parallel excited state calculations for different ground state geometries. It would be nice if we could use a program that is freely available.
To decrease the benchmark depence on the HF step, we could always start by reading converged HF wavefunction. In practice of course HF step also matters, but we should be using a WF guess from Franck-Condon geometry. We should also verify that we're getting the same numbers in all codes.

NOTE: Looks like CC2 (and its various variants) in MRCC do not have oscillator strengths implemented. But we should still look at ADC(2) and maybe the double hybrids. From Péter's email:

fast conventional and accelerated ADC(2) up to 100 atoms:
http://real.mtak.hu/78363/1/RedCostADC.pdf
there is also a local correlation version for a few 100 atoms:
https://pubs.acs.org/doi/full/10.1021/acs.jctc.9b00735

double-hybrid TDDFT methods with new spin scaled and range-separated ADC(2) components:
https://pubs.acs.org/doi/full/10.1021/acs.jctc.1c01100

some more benchmarks compared to leading functionals:
https://pubs.acs.org/doi/full/10.1021/acs.jctc.1c01307


Broken links to json-schema references

All links like this:
 http://json-schema.org/latest/json-schema-validation.html#anchor17
need to be updated, they have been moved in the target to this format:
 http://json-schema.org/latest/json-schema-validation.html#rfc.section.5.2

I'm afraid that's not accurate. The JSON Schema folks seem to have replaced the draft 4 with the latest, but I'm not sure they actually have draft 4 published so we can point to it. Will have to check with them.

It seems that they have improved the anchors to be more descriptive than #anchor17, #anchor#21. So I guess the new ones should be the final.
Sometimes that happen even when we take care of getting the links up to date.
If they would give enough time to Tim Berners-Lee, that might never happen. ;-)

The anchors is not the problem - it's not the right spec anymore. As far as I can tell, there's no published draft 4 (haven't looked enough into it) so we can't fix the links easily.

Related: https://github.com/json-schema-org/json-schema-org.github.io/issues/59

Ball is in your court guys https://github.com/json-schema-org/json-schema-org.github.io/issues/59#issuecomment-270329646

As an aside, given how many people and now companies are involved in OAS, it would be great to see some experienced individuals come and help with JSON Schema. Realistically there are 3 or 4 of us doing the work, none with experience of publishing IETF documents or defining internet standards... If OAS is going to be the future of APIs, and a huge core of that is JSON Schema, then the changes we make ought to be the right ones... - Any way this comment can be disseminated to those with experience?

@Relequestual I may be able to be of some assistance.  Want to email me and we can identify a time to chat about what might be needed?  microsoftcom

Thanks @RobDolinMS, I'll hopefully be able to email you later this week or next week. Super busy right now! =s


Make the constraints for template dynamic

Currently they're hardcoded. A better solution might be to make use of python configuration files so this is completely parametrized and dynamic at run time. If we change our requirements and/or EBI does, it will be very simple to modify it, rather than having to do a refactor of the code...

I think we can close this one. @josenavas?

We may want to leave it open and discuss a bit in the future. Right now, if you want to change the requirements, you actually have to change the code in constants.py. The idea was to actually source those values from a config file.
What do you think? It is worth or the system is actually so tied up to those values that is ok to leave in code?


[FEATURE REQUEST] Option [Add chapter title] but for specific novels from library

An option like the one below

I'll just port every normal option over.


Yii2 Performance

Where can i find Yii2 real performance vs other frameworks? I need know Yii2 how many is faster than other frameworks.

Please use forums for questions.
Some performance data: https://github.com/kenjis/php-framework-benchmark#hello-world-benchmark


feat: add zap with custom fields

summary
I use klog implemented by zap, but klog-zap can't input custom params.
e.g. klog can record inputed server_name and server_version ?
expect
package main

import (
    "github.com/cloudwego/kitex/pkg/klog"
    kitexzap "github.com/kitex-contrib/obs-opentelemetry/logging/zap"
)

func main() {
    klog.SetLogger(kitexzap.NewLogger(kitexzap.WithCustomFields("service_name", "kitex", "version": "v1.0.1", "tags": "cloud.k8s")))
    klog.SetLevel(klog.LevelDebug)

    ...
    ...
}

cc @rogerogers

Hello, thank you very much for your PR. I've made a few minor adjustments to facilitate merging.


Revise Architecture for API Testing

Dotwalking
Using stage
Given that I create a GET request to the Bob API using the getlist endpoint( with path parameters (user:23443,bicycleID:2)?)?
And I (set|add|modify) the path parameter user to 123455 //(Need error handling for path parameters not set)
And I (set|add|modify) the path parameters user:123455,bicycleID:2
When I load the json first request
And I (set|add|remove|modify) a header key called (.) with value (.) to the request
And I (set|add|modify) the path parameter user to 123455 //(Need error handling for path parameters not set)
And I (set|add|remove|modify) the path parameters user:123455,bicycleID:2
And I (set|add|remove|modify) the query string parameter name to Dave
And I (set|add|remove|modify) the json object value of foo to bar
And I send the request
Then I I verify the response code equals (\d{3})
And I verify a response was received
And I validate the response( does not)? (has|have|contains?) the text "([^"]*)"
And I verify a (success) response code was received
And I check that the dotwalk path foo.bar.name (does not)? exists?
And I check that the dotwalk path foo.bar.name (is|does not) equal to value
And I check that the dotwalk path foo.bar.name has the data type boolean
bobapi/getlist?name=Dave
Path param example: /service/myresource/user/{user}/bicycles/{bicycleId}
//Directory structure:
BobAPI
BobAPI.java
BobAPI.yml
firstrequest.json
secondrequest.json
//Global.yml File
headers:
name:Bob
Auth:
Type: JWT
Value: dsfawasduy7sdfwfknkhwef3nlasnfhasfsd
//BobAPI.yml File
urls:
default: https://dev.myapi.com/bicycle
prod: https://myapi.com/bicycle
headers:
foo:bar
foobar:foo
endpoints:
getlist:
type: GET
json:
firstrequest:
filepath/
secondrequest:
filepath/
headers:
foo:bob

Variables in json body: https://github.com/taverntesting/tavern/blob/master/example/simple/test_server.tavern.yaml line 86-87, they are loading value, stored from previous call and convert it into double in body


⚠ Bofrost.at has degraded performance

In 3d6172d, Bofrost.at (https://www.bofrost.at) experienced degraded performance:

HTTP code: 200
Response time: 965 ms

Resolved: Bofrost.at performance has improved in 6c038c8.


Account activities tab

Columns:

Hash: in some cases we won’t have any tx-hash, e.g. AENS expiration won’t have any tx-hash, the same for Beneficiary reward
Date
Type
Activity
Data

Type
Activity
Data
Technical considerations

AE
Transferred toReceived fromBeneficiary reward
ak_… + Æ amountak_… + Æ amountÆ amount
how to deal with SH-DEX activities to avoid duplications?

AENS
ClaimedExpiredRevokedReceived fromTransferred to
xyz.chainxyz.chainxyz.chainak_… + xyz.chainak_… + xyz.chain

AEX-9
Token createdTransferred toReceived fromMint receivedBurned
TOKEN_SYMBOLak_… + TOKEN_SYMBOL & amountak_… + TOKEN_SYMBOL & amountTOKEN_SYMBOL & amountTOKEN_SYMBOL & amount
how to deal with SH-DEX activities to avoid duplications?can we distinguish transfers, mints and burns?

AEX-141
Collection createdTransferred toReceived fromMint receivedBurned
COLLECTION_NAMEak_… + COLLECTION_NAME & nft_idak_… + COLLECTION_NAME & nft_idCOLLECTION_NAME & nft_idCOLLECTION_NAME & nft_id
can we distinguish transfers, mints and burns?

SH-DEX(to be checked)
SwappedAdded liquidityRemoved liquidity
TOKEN_SYMBOL & amount ↔ TOKEN_SYMBOL & amountTOKEN_SYMBOL & amount +TOKEN_SYMBOL & amount ↔ POOL_SYMBOL & amountPOOL_SYMBOL ↔ TOKEN_SYMBOL & amount + TOKEN_SYMBOL & amount
see AE and AEX-9 comments, avoid duplicated outputmaybe we need to include that in the type “AEX-9” and cannot have it separately in SH-DEX as type

?
?
?
?

Endpoint: GET /v2/accounts/:id/activities

@lukeromanowicz @michele-franchi I just provide the screenshot here for better readability:

@marc0olo would you be able to provide accounts where the mentioned activities happened?

Looks like we need to simplify Contract-related fields due to insufficient information available in mdw. Here is a mdw issue to track:
https://github.com/aeternity/ae_mdw/issues/1497

Other (non-blocking) related issue that has been reported: https://github.com/aeternity/ae_mdw/issues/1498

the same for Beneficiary reward

the block hash may be used instead. Also, consider showing reward transfers to BRI account.

the block hash may be used instead

if we do that I would prefer to include the block hash in "data" column 😅

Also, consider showing reward transfers to BRI account.

yes, absolutely! but this is only relevant for one specific account IMO (or in the future for another BRI account in case that changes) @michele-franchi

DEX contract: https://github.com/aeternity/dex-contracts-v2#on-mainnet


sp orders fixed

streaming orders with sp orders fixed
tests fixed/added

Coverage increased (+0.5%) to 92.157% when pulling 23409dda478e093af0877185317ba81c6534396f on ordertype_fixes into b432b5d7b954cbbf29862b647b1216088dd3b070 on master.


Hello, can I use it for multi label classification? If so, what should I pay attention to in the process of tag prediction? For multi label classification, sigmoid is generally used as the loss function. In this case, can you change your loss function to sigmoid?

Hello, can I use it for multi label classification? If so, what should I pay attention to in the process of tag prediction? For multi label classification, sigmoid is generally used as the loss function. In this case, can you change your loss function to sigmoid?

We didn't MixMatch in this setting. One could see a multi-label classification loss as multiple binary losses to model the problem in a compatible way with MixMatch. I guess I can't really give more advice than that and experimenting with the code on your data.

Thank you for your reply. I used my own multi classification dataset (not multi label classification) to train mixmatch. The first few rounds of training worked well，after the first few epochs of network learning, the loss began to rise, the precision decreased, and many parameters were adjusted. Could this be due to the label prediction error of unlabeled samples, which led to the worse training effect of the model?

It could be a lot of things, it's hard for me to tell. This repository is mostly to show how to reproduce the results achieved in the paper.


[Keyboard Manager] Add an option in keyboard manager to assign a key to do nothing.

📝 Provide a description of the new feature
What is the expected behavior of the proposed feature?  What is the scenario this would be used?
Can we get an option in keyboard manager to assign a key to do nothing (not disable the key so as other shortcuts of the key work but single press of the key does nothing). Because if I assign the key as undefined every shortcut associated with the key also doesn't work, the only reason I'm still using autohotkey. I have mapped few shortcuts for the arrow and some other keys to work while pressing alt. However, by mistake if I somehow press the alt key alone it takes the focus out of the typing window to the menu. That's why I use autohotkey instead of the power toys. In autohotkey script I can write "Alt::Return" in my script and single press of alt does nothing. So, it would be great if something like this can be done by power toys.
If you'd like to see this feature implemented, add a 👍 reaction to this post.

closing against #2215


Support for 128 to 255 ascii font

Hi, can you add support for ascii fonts with non english characters? Something like Adafruit GFX fonts. Thank you.

Assuming you're talking about this example:
https://github.com/Wren6991/PicoDVI/blob/master/software/apps/terminal/main.c
That code should work fine for an extended font with more than the 95 printable ASCII characters. You'll just have to export your own font, and change the FONT_N_CHARS and FONT_FIRST_ASCII defines (the latter is misnamed and is really the index of the first printable character)


[URGENT] e.postMessage issue with Safari / Mobile Safari 6.1, 7.2, 8.0

Error Output
TypeError: 'undefined' is not a function (evaluating 'e.postMessage(JSON.stringify({type:this._names…

Sentry detection:
bower_components/braintree-web/dist/braintree.js in ./frame-container at line 4:0

Braintree web version: 2.15.4 (latest) - The error existed beforehand as well
We're now seeing this error appear 10-15 p/day, meaning we're probably losing multiple orders a day due to this. We tried debugging on our end, can't find any way to solve this - any ideas?

I have the same issue.
This seems to appear on all iOS versions above 6.0. For some reason the postMessage is undefined and causes a crash. This also appears on all Desktop Safari versions.
Looks like the issue is when the braintree library sends messages between the child iframe (braintree) and the parent frame (website that includes braintree).

@alexloi sorry to hear you are running into these issues. I assume since your log mentioned frame-container you are using a Drop-in integration? Unfortunately, at this point I have not been able to replicate this issue in any of my test apps.
The best way for us to help debug this issue is to take a look at your integration. I would reach out to our support team<EMAIL_ADDRESS>and provide a link to your integration and relevant braintree.setup code.
@mschinis is your issue also with Drop-in? If so, could you pass along your info to support as well?

@kyledetella correct, we're using the drop-in. Will drop you an email now, thanks

Hello @kyledetella, thanks for the swift reply. Yeah, using the drop-in UI. Will reach out to support for help. Thanks!

@alexloi @mschinis we just released version 2.16.1 which includes a fix to address this issue.
Let us know if you run into anything else.

Thanks. I will be monitoring it over the next couple of days and post here if the issue comes up again.


Dapr Actors cannot serialize/deserialize ActorId/ActorReference

Expected Behavior
ActorId and ActorReference work with the serializer and state store by default.
It's very common for actors to exchange their "addresses" and communicate with each other in asynchronous and disconnected ways. Using the primitive types that Dapr Actors provide should work for these usecases
Actual Behavior
The serializer throws an exception:
Exception has occurred: CLR/System.NotSupportedException
Exception thrown: 'System.NotSupportedException' in System.Private.CoreLib.dll: 'Deserialization of reference types without parameterless constructor is not supported. Type 'Dapr.Actors.ActorId''
   at System.Text.Json.ThrowHelper.ThrowNotSupportedException_DeserializeCreateObjectDelegateIsNull(Type invalidType)
   at System.Text.Json.JsonSerializer.HandleStartObject(JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack)
   at System.Text.Json.JsonSerializer.ReadCore(Type returnType, JsonSerializerOptions options, Utf8JsonReader& reader)
   at System.Text.Json.JsonSerializer.Deserialize(String json, Type returnType, JsonSerializerOptions options)
   at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
   at Dapr.Actors.Runtime.DaprStateProvider.<TryLoadStateAsync>d__2`1.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Dapr.Actors.Runtime.ActorStateManager.<TryGetStateAsync>d__7`1.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at MatchMaker.MatchMakerActor.<RequestGameAsync>d__1.MoveNext() in /Users/ryan/github.com/rynowak/rock-paper-actors/src/MatchMaker/MatchMakerActor.cs:line 35

Steps to Reproduce the Problem
Create an actor that stores and reads an ActorReference from the state store.
Saving the reference will work, but reading it out will blow up on ActorId.
Release Note
RELEASE NOTE: FIX Bug in the Actors SDK for dotnet-sdk. Actor Reference and Id can now be stored.

@vinayada1 - assigning myself this one


log4j12: uses version with CVEs only via invoker

snyk finally got me to do this ;) If folks are ok with this, I'll do similar for spring-beans which also shows up as a critical main CVE.

cool. will do similar for spring-beans and also in zipkin-reporter, if we aren't already ..