JSON (de)serialization

Closes #32
This one works without extra boilerplate code (some tests included) and I kinda like the solution, but still ...
To get things done I reimplemented a part of source code (see innerParse function in std/json/static.zig, the part with the .Struct case body). Since few internal non-public was needed i just copied it (eww).
Zig is on its early stages and standard library often changes - and that's why I partly don't like this PR because there might be lots or refactors (for example, standard token parser might change)
Feel free to judge it)

Thanks again for everything. I'll do my best to check it out ASAP.

Just saying that i haven't forgotten this, just trying to find some time to do it.

Started reviewing it.
All unions are handled by std.json internally, see here and here - it just worked out of the box, made some tests to prove it.
About using "leaky" versions of std.json (de)serialization functions - the only reason I chose them is because I didn't get it to work with non-leaky alternatives) I just remember than some tests blamed about memory leaks (std.testing.allocator is able to catch leaks) and some code didn't even compile, don't remember why tbh. I can try to explore it again with a fresh look.
And thanks for feedback, even the late one)

T his is great. I'll have some fun with it and might even add some suggestions before approving it, but overall i'm positive this will be merged soon. Thanks again for your work.

LUL i just switched to a non-leaky function for JSON decoding and everything works :)
There are no memory leaks or compile errors that I've encountered before.

@librolibro I added a few commits directly, i'll let you look at them and tell me if they're ok for you. According to the json spec for protobuf bytes types are supposed to be base64 encoded.
We did not have a specific information for bytes, we had a shortcut to handle it just like strings. These last commits do not change the zig-facing interface of using ManagedStrings for bytes fields, but add the information needed in the _desc_table so that json encoding/decoding know when to do the the base64 soup.
I'll look tomorrow into the Map type, because i'm pretty sure we are not correct with the spec too (we handle it as a list of entries).

Everything looks clean at the first glance, good job at that! (@embedFile usage was nice, didn't know about it :))
Another thing that comes to my mind is the ability to not add fields into JSON string if their value is equal to default - e.g. Python's implementation of google.protobuf.json_format.MessageToJson comes with including_default_value_fields argument which if False by default. While specs say that

A proto3 JSON implementation MAY provide the following options

and it's not a strict requirement it may be worth implementing this and since the message field iteration was already made in this code and not in std.json depths it shouldn't be that hard to do.

I took the liberty to rebase after #51 was merged, there was a small conflict.

We need to set ourselves some clear goals for this PR.
Required TODO

[ ] In json parsing/writing, Map fields should be written/read as json objects. Making it an actual map on the zig side will be another subject (#52)
[ ] Use proto field name instead of lowerCamelCase name: according to the spec, we should convert field names to lowerCamelCase when writing, and accept lowerCamelCase and actual name when parsing.

@librolibro if you start any of these subjects, tell me so we avoid doing it twice.
Worth analyzing in separate issues (that will be created after the merge of this PR)

[ ] Check support for mapping of types defined by google (Timestamp, Duration...)
[ ] Pass options to the parser

[ ] to ignore unknown fields
[ ] to always emits fields without presence

[ ] Pass options to the writer

[ ] to support writing actual name and not the camelCase name
[ ] to support emitting enum values instead of names

I would try to implement field renaming to camelCase. The problem is json.ParseOptions is the only argument passes to innerParse internal function and I can't pass any additional options to my jsonParse methods. I can make field renaming as default since specs require it but without the alternative (which would be no case conversion at all) atm. If I understand correctly deserializer should handle both cases anyway (what if message contains two fields like test_field and testField? Is this a collision?)
I would also make default fields ignoring because it's logic will be in the same part of code.
P.S. About float handling - this std.json test suite covers a lot of edge cases and also not-a-numbers and infinities. I also saw usage of std.fmt.parse_float in std.json source code

I would try to implement field renaming to camelCase. The problem is json.ParseOptions is the only argument passes to innerParse internal function and I can't pass any additional options to my jsonParse methods. I can make field renaming as default since specs require it but without the alternative (which would be no case conversion at all) atm. If I understand correctly deserializer should handle both cases anyway (what if message contains two fields like test_field and testField? Is this a collision?)
I would also make default fields ignoring because it's logic will be in the same part of code.
P.S. About float handling - this std.json test suite covers a lot of edge cases and also not-a-numbers and infinities. I also saw usage of std.fmt.parse_float in std.json source code

For now, focus on accepting both camelCase and exact field names when parsing, and writing in camelCase. We will deal with optional behaviors later, but these are not optional.
Thanks for your investment ! Do not force yourself to do it, remember that you have no obligations here.

I just realized that your code (and also parts of Zig standard library) follows Zig style guide and mine is not :) Your base64 encoding/decoding snippets (despite following preferred style guide) looks foreign being surrounded my by code - I'll refactor that tomorrow, I'm too lazy atm.
Also i would write more tests: deserializing camelCase, snake_case and mixed strings, handling all kinds of .Optional's etc. I like how you put JSON string into separate file and then extracted it with embedFile call. This project structure comes to my mind:
zig-protobuf/
  generated/
  json_data/
    test1/
      struct_definition.zig (import generated message instance from it)
      camel_case.json
      snake_case.json
      mixed_case.json

The more I look into the code the less I like it tbh because in order to just change union's tag name I need to "copy" (and slightly modify) a part of code from std.json and there's lots of undocumented methods which might change (maybe even before 0.14.0 version bump) - but for now it's working which might be more important.

I understand why the last workflow failed (my new FieldNameCollision error is out of the expected set) but I can't reproduce it on my 0.13.0 version of the compiler. I know little about the error system in Zig - if I understand correctly now I need to pass error union to jsonParse function.
Or maybe it's better to remove this error "throwing" - I still don't how this situations should be handled:
syntax "proto3";

message BadMessageForSure {
    float field_with_collision = 1;
    float fieldWithCollision = 2;
}

It's PITA when it comes to JSON (de)serialization. Is it valid by protobuf after all? Maybe it's better to throw panic in such cases?

I made NaN/Infinity (de)serialization support but in order to make it i need to make 4 changes (encoding/decoding for single/repeated fields) - since you made .Bytes support only for single fields it means that "repeated bytes" fields are not supported ATM. I'll look into it.
Also the thing to check is the ability to parse integers/floats of any kinds not only from numeric JSON data types but also from strings (e.g. 1 and "1" should be interpreted equal when parsing int32 field), spec says:

Either numbers or strings are accepted. Exponent notation is also accepted.

So the more tests the better for sure (maybe it will work out of the box, who knows).

With the current PR HEAD I get:
/home/user/.cache/zig/p/1220403b861068d46215af6e338e5acd5eefcbabec7f4b2518042c3ec0bc5dae6646/src/protobuf.zig:1472:54: error: no member named 'bytes' in '[32]u8'
            const innerAllocator = jws.nesting_stack.bytes.allocator;
                                                     ^~~~~
referenced by:
    write__anon_7032: /usr/lib/zig/std/json/stringify.zig:506:51
    stringify__anon_6045: /usr/lib/zig/std/json/stringify.zig:52:17
    remaining reference traces hidden; use '-freference-trace' to see all reference traces

looking at the zig json/stringify.zig source, it looks as though nesting_stack can be different things depending on compile mode:

        nesting_stack: switch (safety_checks) {
            .checked_to_arbitrary_depth => BitStack,
            .checked_to_fixed_depth => |fixed_buffer_size| [(fixed_buffer_size + 7) >> 3]u8,
            .assumed_correct => void,
        },
        ```

It seems as though the allocator is just used for the camel case functionality; but that only needs to work at compile time.
So you should be able to swap to a comptime implementation:
```zig

fn to_camel_case(comptime not_camel_cased_string: []const u8) []const u8 {
    comptime var underscore_count: usize = 0;
    inline for (not_camel_cased_string) |byte| {
        if (byte == '_') underscore_count += 1;
    }
    if (underscore_count == 0 or underscore_count == not_camel_cased_string.len) {
        // You better not touch fields like "_____________" (or should we?)
        return not_camel_cased_string;
    }

    var capitalize_next_letter = false;
    var camel_cased_string: [not_camel_cased_string.len - underscore_count]u8 = undefined;

    var i: usize = 0;
    for (not_camel_cased_string) |char| {
        if (char == '_') {
            capitalize_next_letter = i > 0;
        } else if (capitalize_next_letter) {
            camel_cased_string[i] = std.ascii.toUpper(char);
            capitalize_next_letter = false;
            i += 1;
        } else {
            camel_cased_string[i] = char;
            i += 1;
        }
    }

    if (std.ascii.isUpper(camel_cased_string[0])) {
        camel_cased_string[0] = std.ascii.toLower(camel_cased_string[0]);
    }

    return &camel_cased_string;
}

From there it is a quick cleanup, aside from the base64 encoding, which needs to drop down to writing to the json stream directly rather than allocating a temporary.

It seems as though the allocator is just used for the camel case functionality; but that only needs to work at compile time.
So you should be able to swap to a comptime implementation:

Excellent remark, we have everything needed to know this at compile time indeed.

From there it is a quick cleanup, aside from the base64 encoding, which needs to drop down to writing to the json stream directly rather than allocating a temporary.

I'm gonna check if there are ways to do that, but i'm not sure i have access to the slices in the json encoding api.
In the end, it's not dramatic if this stays as is, if you're already working with json encoding/decoding you're probably not too worried about a pair of temporary allocations.

I wanted to commit camelCase making in comptime but It'll be awkward if you're making the same)

I'm gonna check if there are ways to do that, but i'm not sure i have access to the slices in the json encoding api. In the end, it's not dramatic if this stays as is, if you're already working with json encoding/decoding you're probably not too worried about a pair of temporary allocations.
Edit: nevermind, found a way in 1c8ab07 . That require rewriting some of the code inside the json writer, we might have to make a request to make some methods public in the std.

In theory you don't need to: a base64 encoder should be able to work on (multiples of) 3-byte pieces.
So e.g. do:
  const str = value.getSlice();
  try jws.valueStart();
  try jws.stream.writeByte('\"');
  var temp_out: [5]u8;
  var i=0;
  while (i < str.len) : (i+=3) {
    const s = base64.standard.Encoder.encode(&temp_out, str[i..i+3]);
    try jws.stream.writeAll(s);
  }
  try jws.stream.writeByte('\"');
  jws.valueDone();

I'm gonna check if there are ways to do that, but i'm not sure i have access to the slices in the json encoding api. In the end, it's not dramatic if this stays as is, if you're already working with json encoding/decoding you're probably not too worried about a pair of temporary allocations.
Edit: nevermind, found a way in 1c8ab07 . That require rewriting some of the code inside the json writer, we might have to make a request to make some methods public in the std.

In theory you don't need to: a base64 encoder should be able to work on (multiples of) 3-byte pieces.  I managed to make it in one pass, that should be good enough.

repeated bytes, oneof=NaN, +/-inf fails as expected (NaN in arrays and oneof=.Bytes would probably fail as well), I'll make some changes to support these, for now there are failing tests to not cover this problem

P.P.S. Is there a way to disable workflow runs temporarily? I certainly know that tests will fail because I wrote them to fail :) Or maybe I shouldn't push until I won't make it good

It's actually me that's starting them manually sometimes, just tell me when you feel they should run.

For now it looks like all (supported ATM) types are processed as expected. I think the current JSON code base is messy IMO - especially in case of function naming. I think it's better to refactor all JSON code according to your code style and not to Zig's one (snake_case for functions instead of camelCase etc.) to avoid more refactor for now. Maybe it's time to move JSON code to separate file because there's a lot of things copied from std.json + things implemented by use (400+ lines of code).
Also more tests ... For things like deserializing integer/float from JSON string (whether it's single, repeated of inside of oneof) etc.

Please run another workflow for this PR. I want to check if tests will pass now of Windows (there were strange fails, it was probably about different line endings, but I'm not 100% sure)

Looks like it's not fixed yet.  Thank you for all your work already.

Now .gitattributes work as expected (for some reason leading ./ was the problem and I missed it). If Windows build failures are about line endings it might fix the problem now :)
$ git check-attr --all -- tests/json_data/fixed_sizes/camelCase_1.json
tests/json_data/fixed_sizes/camelCase_1.json: text: set
tests/json_data/fixed_sizes/camelCase_1.json: eol: lf

Last major thing wasn't made yet is Always emit fields without presence described here + tests for cases when not all fields are present in the input JSON string (I think there's MessageMixins.init call missed and these tests would fail).
For now I don't know how to vary parser's behavior (omit default fields or not, serialize using camelCase or snake_case etc.), there's no able to pass extra state into std.json inner functions and hence into our custom jsonParse/jsonStringify implementations. I have couple "possibly good" ideas how to make it, I would try these after default fields workaround, maybe in the weekend.

This will be good enough for a good "basic" json encoding/decoding. I'll create issues for everything mentionned in https://github.com/Arwalk/zig-protobuf/pull/49#issuecomment-2249600720 So we can do bit by bit everything right.
Thanks a lot for your involvment !

@librolibro the following issues have been created, so PR can be done to target one subject at a time:

#59
#60
#61
#62

I was on the way to push some commits :) Earlier I thought that Github PR's can be reopened with merge up-to-date master with fork's branch, and then do it again for next issue (does Github allows this?)... But separate issues/PRs might be a cleaner solution.

Woops sorry! I'd really prefer if we split it up, it will be cleaner to handle.


Trying to update avatar

Hello mate, when I tried to update the avatar, I got this error:
SQLSTATE[22021]: Character not in repertoire: 7 ERROR: invalid byte sequence for encoding "UTF8": 0x89 (SQL: update "user_profile" set "avatar" = �PNG  IHDR�� .....
My database encoding is UTF8 and database.php is configured as pgsql and the same encoding.

The DB field has the right type?


How do I use this library to control PTZ?

Trying to work out how I send PTZ commands to a Dahua camera

You may refer to the sample code in src/OnvifClient/Program.cs and check if PTZ is available and then call the PTZ related extension methods on client. The PTZ methods can prototypes can be found in src/SharpOnvifClient.PTZ/Connected Services/OnvifPTZ/Reference.cs.

I suppose something like this might work:
#region PTZ

public async Task AbsoluteMoveAsync(string profileToken, float pan, float tilt, float zoom, float panSpeed = 1, float tiltSpeed = 1, float zoomSpeed = 1)
{
    string ptzURL = await GetServiceUriAsync(OnvifServices.PTZ).ConfigureAwait(false);
    using (var ptzClient = new PTZClient(
        OnvifBindingFactory.CreateBinding(),
        new System.ServiceModel.EndpointAddress(ptzURL)))
    {
        SetAuthentication(ptzClient.Endpoint, _auth);
        await ptzClient.AbsoluteMoveAsync(
            profileToken,
            new PTZVector()
            {
                PanTilt = new PTZ.Vector2D() { x = pan, y = tilt },
                Zoom = new PTZ.Vector1D() { x = zoom }
            },
            new PTZ.PTZSpeed()
            {
                PanTilt = new PTZ.Vector2D() { x = panSpeed, y = tiltSpeed },
                Zoom = new PTZ.Vector1D() { x = zoomSpeed }
            }).ConfigureAwait(false);
    }
}

public async Task RelativeMoveAsync(string profileToken, float pan, float tilt, float zoom, float panSpeed = 1, float tiltSpeed = 1, float zoomSpeed = 1)
{
    string ptzURL = await GetServiceUriAsync(OnvifServices.PTZ).ConfigureAwait(false);
    using (var ptzClient = new PTZClient(
        OnvifBindingFactory.CreateBinding(),
        new System.ServiceModel.EndpointAddress(ptzURL)))
    {
        SetAuthentication(ptzClient.Endpoint, _auth);
        await ptzClient.RelativeMoveAsync(
            profileToken,
            new PTZVector()
            {
                PanTilt = new PTZ.Vector2D() { x = pan, y = tilt },
                Zoom = new PTZ.Vector1D() { x = zoom }
            },
            new PTZ.PTZSpeed()
            {
                PanTilt = new PTZ.Vector2D() { x = panSpeed, y = tiltSpeed },
                Zoom = new PTZ.Vector1D() { x = zoomSpeed }
            }).ConfigureAwait(false);
    }
}

#endregion PTZ

Please let me know if it works for you.


GitHub (or any Git) integration: log post with any (major?) PR

As a "hacker", I don't want to spend time on documenting my project (on Dribdat) to have more time for the fun part and achieving my set goal.
So, it would be great if a (major?) PR on a linked repository would automatically trigger a log post on the project page on Dribdat.
I know there's some GitHub integration so maybe this is already possible and I just don't know it.

Currently only Git commits - not Pull Reviews or Issues - are linked to the Log.
Typically a Pull Request is followed by a Git Merge, so you would see this appear in the log.
It's an interesting idea, the only issue I see is that it would require us to dig into the API a lot more than we are now.


Call specific Page model methods

Steps to reproduce:

Create a model subclass that extends Wagtail's Page model. Redefine save() and clean() methods.
Use CSV import to create or update instances of the new model.

Expected:

The save(), clean() or any other overriden method in the subclass are called.

Got:

Only methods defined in Wagtail's Page model are called.

After debugging this is not an issue, the specific subclass methods are already being called. The bug was in the client's code.


Fix flaky server shutdown mechanism

What?

Define cancel_thread based on terminate_thread (win) and detach_thread (linux)
Use cancel_thread for server shutdown
Impl XcpReset to reset XCP status when server is shutdown

Why?

Calling join_thread will shutdown server, but also crashes the program
Calling join_thread/terminate_thread/detach_thread after XcpTlShutdown also crashes the program
Using terminat_thread and detach_thread mechanism will shutdown the server only passively. But so long as the server receives a msg from a master, it can then shutdown normally
If XCP session status is not reset after shutdown, then it will act flaky when reinitialized

Hello,
Thanks.
Do you have an idea, what the root cause for your crashes was ?
There seems to be another problem:
XcpEthServerShutdown()  calls XcpTlShutdown(), which should be XcpEthTlShutdown(). Right ?
I was unsure what the optimal solution - graceful or forceful thread shutdown - should be.
Windows strongly recommends graceful thread termination, as better programming style ,to avoid resource leaks in general.
Seems the reinitialization use case has never been stressed. Of course this should work, but what exactly is your use case why you do reinitialization.

I did some more testing on the 2 solutions after fixing XcpEthTlShutdown():
'''
#ifdef XCP_SERVER_FORCEFULL_TERMINATION
// Forcefull termination
if (gXcpServer.isInit) {
DBG_PRINT3("Disconnect, cancel threads and shutdown XCP!\n");
XcpDisconnect();
cancel_thread(gXcpServer.ReceiveThreadHandle);
cancel_thread(gXcpServer.TransmitThreadHandle);
XcpEthTlShutdown();
gXcpServer.isInit = FALSE;
socketCleanup();
XcpReset();
}
#else
// Gracefull termination
if (gXcpServer.isInit) {
XcpDisconnect();
gXcpServer.ReceiveThreadRunning = FALSE;
gXcpServer.TransmitThreadRunning = FALSE;
XcpEthTlShutdown();
join_thread(gXcpServer.ReceiveThreadHandle);
join_thread(gXcpServer.TransmitThreadHandle);
gXcpServer.isInit = FALSE;
socketCleanup();
XcpReset();
}
#endif
'''
I am not lucky with the forcefull alternative, as it seems to start a race between cancel_thread and shutting down the socket, which leads to graceful termination via recvfrom. Did not check TCP yet.

Pushed changes to master v6.3
Added OPTION_SERVER_FORCEFULL_TERMINATION


pry snippet

Sorry for the newbie question
can you add pry snippet?
It should add
require IEx; IEx.pry

Is it still needed? Since elixir 1.14 dbg() is the preferred way of initiating a pry session

I think no, sorry


Add new management command axes_reset_ip_username

What does this PR do?
This PR adds a new management command axes_reset_ip_username that just... does what its name says!
Before submitting

[x] Did you make sure to update the documentation with your changes?
[x] Did you write any new necessary tests?

https://github.com/jazzband/django-axes/actions/runs/6981036981/job/19064759864?pr=1138#step:7:127

Thanks @aleksihakli I had totally missed this test!


add command to copy bundle referenced images to registry where bundle already resides

Describe the problem/challenge you have

i use dockerhub registry
i create bundle in my dockerhub account (that references images from all over the internet)
i dont want to "copy" my bundle to a different location just to ensure that referenced images are copied into my docherhub account

Describe the solution you'd like
currently one would have to do the following:

imgpkg push -b docker.io/dkalinin/foo:v1.0.0 -f my-bundle/
imgpkg copy -b docker.io/dkalinin/foo:v1.0.0 --to-repo docker.io/dkalinin/foo:v1.0.0-copied (not sure if i can just use same tag?)

this seems a bit repetitive. proposed steps:

imgpkg push -b docker.io/dkalinin/foo:v1.0.0 -f my-bundle/
imgpkg copy -b docker.io/dkalinin/foo:v1.0.0 --to-same-bundle (or may be a better name for the flag)

i think having an explicit flag like --to-same-bundle is good to avoid confusion of now specifying anything for other from-to pairs.
Anything else you would like to add:
this "promotes" the use case for ensuring i have all materials for the bundle in my registry to first class.
this might be also useful to "repair" bundle in your registry if some references images got deleted.

I wonder if it makes more sense to have it as a flag on push, so user could just do something like:
imgpkg push -b docker.io/... -f my-bundle --with-relocate

i was thinking about that, but id would prefer to keep push and copy distinct. seems like a good boundary to have.

In this case, I tend to agree with @ewrenn8. Feels more natural that the operation you want to do when pushing your bundle is to concentrate the layers from a particular bundle under the same repository.
Also thinking about copy in itself not sure if the operation is the one we want to relocate the full bundle underneath a repository. Maybe we want a new operation called concentrate or centralize or condense not sure.
@cppforlife Did you come across a use case for this feature?

Did you come across a use case for this feature?

described in "Describe the problem/challenge you have". wanna ensure that that my app doesnt depend on images outside of my registry so they dont break production if they disappear.

Feels more natural that the operation you want to do when pushing your bundle

possibly. though this might be useful after you pushed a bundle as well as a distinct step. eg what if you "forgot" to push with that flag. including a flag on push is a convenience feature, but we need to make sure we have "core" feature that's available standalone.

Maybe we want a new operation called concentrate or centralize or condense not sure.

i was thinking it's part of copy command because that's what happens when we copy bundle to a different registry. it just happens that in this case we are "copying" to the same location.
i think

My thought is that the flag makes sense for both the push and copy commands and should be consistent for both. Maybe --with-images? And the flag would only work with pushing/copying a bundle. I would think push would be the more common use case though.
At the very least, I think we should accept the issue and discuss the UX further.

--with-relocation

one note, we tried to avoid word relocation because we arent relocating anything (this is how we ended with "copy" word as a command).

Comment from slack discussion on this issue:

(side note: now that we are also having dicsussions around copy config, im more convince that this should be a variation of copy command to avoid having to put all kinds of copy flags on push command)

This makes sense to me, since you are technically copying your config from your local directory to a repository along with the associated images.


[docs] Brand new docs !

Here is a PR that aims at improving Asteroid's documentation. There are still lots of things to do and things I didn't find out how to do yet.

Couldn't use automodule on asteroid.data without members
Couldn't have anchor point in the index when using automodule (I'd like to have all elements listed in the sidebar)
@mhu-coder @jonashaag Any idea how to do that? It would be great !

Left to document

Filterbanks more
Losses more
Models from scratch
Utils
Asteroid CLI
Probably a tutorial on asteroid's complex number format
Community stuff, how to contribute, troubleshooting etc..

Also, probably move consistency somewhere else??

* Couldn't use automodule on `asteroid.data` without members

What do you mean with that?

I tried to generate the documentation and found that I was missing the sphinx extensions m2r2, nbsphinx used by docs/source/conf.py. Would it be sensible to add them to requirements.txt?
About the autodoc directive, have you tried with the :imported-members: added to data.rst?

Thanks for the answer.
Yes, I can add the extensions to the docs requirements.
I think I tried and didn't work either, I'll try again tomorrow !
About the :, if you add a space after it quite fast, it doesn't show up :joy:
But I like emojis so I won't complain :star_struck:

Correction, both extensions are in the docs/requirements.txt which is the one to build the docs.

I think I tried and didn't work either, I'll try again tomorrow !

Weird, it works on my end 😕 . When you try again, can you reload the page with Ctrl + Shift + R, which bypasses the cache? Otherwise, you may visualize an outdated html document.

Correction, both extensions are in the docs/requirements.txt which is the one to build the docs.

Thanks for the clarification. I completely missed the file as I was expecting all the requirements to be in a single requirements.txt (habits 🙄...)

Couldn't have anchor point in the index when using automodule (I'd like to have all elements listed in the sidebar)

Does this stackoverflow thread describe what you want to achieve? Sounds like it's a work in progress in Sphinx 😖.

Then, I'm happier with the current version that has the indices in the sidebar.
Thanks for looking into it !

Alright, I'm happy with the current version. It's not perfect but way better than before, let's merge it and we'll iterate on it after.
Ping @michelolzam

I think it's really good!
Would be even better with a link in the README or repo description :-)

Once we are happy with the docs, I'll link to it, thanks!
Le mer. 12 août 2020 à 16:11, Jonas Haag<EMAIL_ADDRESS>a
écrit :

I think it's really good!
Would be even better with a link in the README or repo description so that
people will find it in the first place :-)
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/mpariente/asteroid/pull/192#issuecomment-672895146,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AEND2HEYXNNAO4T7SWEVK5LSAKPJNANCNFSM4P2YRZVQ
.


Pages show in two languages while only one language is chosen

The pages of my website are shown in both languages although only one language is chosen, pls can sb help ?

Need more information on this.  How do you have your languages setup from the languages: section of user/config/system.yaml?
Also, what do your 2 translated pages look like?
lastly, what do you mean 'show in two languages...' ? both are shown on the page one after another?


Differentiate throwing and non-throwing XML parsers

When parsing XML with BonMot, you can use either throwing or non-throwing variants. Describe the differences, and explain where you would use one or the other.

Closed by https://github.com/Raizlabs/BonMot/pull/242


Fixed Craftopia Config

Set the ConfigFormat to use quotes around all settings. I believe this was causing games with spaces in the name to be non-joinable. The strange part is you could set it back to having a space and it would work going forward.
Also set the ExitMethod to String and quit. The user must type yes following since there is no option to do two input commands to quit a server. CtrlC doesn't work in AMP on Windows for this game. And CtrlC doesn't work for this game on the Linux Terminal. OS_CLOSE ended in a kill.
Removed the config file and used the start/wait/stop update stages instead.

Putting this as a comment so it's very clear what's going on with this one:
I believe that this game's dedicated server is the cause of the timeout issue. It is still in an early beta stage at this point. I have tried to recreate the problem and no matter what, I cannot now. After the first initial connection to any server it works from then on. The ini file is intended to not have quotes in this case given the examples at the top. There are other settings I've put in the GUI but do not seem to function in the server yet, things like "No Food", "No Death", etc. have no impact.  Please contact the developer to have them fix their game.


README.md

Hi @japopeBAS !
As you can see from the above, we've updated the ReadMe for the repo (currently as a to-be-merged branch) - would you be happy to have a quick read and confirm you're happy with our phrasings?
Thanks so much!

Apologies for being so slow, I was away over Easter. Looks good to me, especially "Let's Collaborate"

Lovely thanks James and all!


SNYK-JS-INFLIGHT-6095116

Dear MJML maintainers,
https://security.snyk.io/vuln/SNYK-JS-INFLIGHT-6095116
<EMAIL_ADDRESS>in mjml-cli uses glob@7. Although you've updated glob to v10, our Snyk scanner still detects it as vulnerable.
Could we please bump js-beautify to 1.14.11?
Thank you!

I'll update it next week

+1

@iRyusa Hi any updates about it?

Wanted to push a new version for this, but this should be fixed in 5.x branch for now as js-beautify is entirely removed from the project.


VBT vs brownian path slowdown

While implementing some weak solver schemes, I noticed that when I used the VBT as opposed to the UBP (unsafe brownian path) it was substantially (like ~5 mins vs ~10 seconds) slower. Using an UBP is fine in this case for us (since its a fixed step solver, and we aren't differentiating through the equation), but in the future is not ideal. Below is a MVC, but in summary:

This is not the real solver, I ripped out most of everything just to make the code smaller
These numbers seem a bit small/microbenchmark-y but I have verified them on some larger problems as well, I am just using this small problem for speed and demonstration.
 Specifically, if I comment that out, I see a decrease in speed from ~11s to 3s. But in UBP it only goes from like 1.1s to 0.8s (so it isn't just the elimination of a matmul making that whole speed gap).
The surprising thing is not that VBT is slower (I figured it would come with some overhead), but that it seems to scale as well. Specifically, if I decrease dt, it's not just some constant overhead but seems to increase. Maybe this is expected, but even for small problems with large dts this becomes prohibitive (see the original 5 min vs 10 seconds).

All of this is a bit surprising since I just call the diffusion control once. Is there a way of using VBT's or integrating them into new solvers that avoids this slowdown, or am I just making some mistake in my usage of the VBT?
Here is the full code:
import jax
from jax import numpy as jnp
import diffrax
from typing import ClassVar

_NORMAL_ONESIX_QUANTILE = -0.9674215661017014

def calc_threepoint_random(x):
    return jnp.where(
        jnp.abs(x) > -_NORMAL_ONESIX_QUANTILE,
        jnp.where(x < _NORMAL_ONESIX_QUANTILE, -1.0, 1.0),
        0.0,
    )

def calc_twopoint_random(x):
    return jnp.where(x > 0, 1.0, -1.0)

class Solver(diffrax.AbstractSolver):

    term_structure: ClassVar = diffrax.AbstractTerm
    interpolation_cls: ClassVar = diffrax.LocalLinearInterpolation

    def func(self, terms, t0, y0, args):
        return terms.vf(t0, y0, args)

    def init(self, terms, t0, t1, y0, args):
        return None

    def step(self, terms, t0, t1, y0, args, solver_state, made_jump):
        drift = terms.terms[0]
        diffusion = terms.terms[1]
        cont = diffusion.contr(t0, t1)
        dt = t1 - t0
        dW_scaled = cont["dW"] / jnp.sqrt(dt)
        sq3dt = jnp.sqrt(3 * dt)
        _dW = sq3dt * calc_threepoint_random(dW_scaled)
        dZ_scaled = cont["dZ"]
        _dZ = calc_twopoint_random(dZ_scaled)
        xi = jnp.sqrt(dt) * _dZ[0]
        chi1 = (_dW**2 / xi - xi) / 2
        k1 = drift.vf(t0, y0, args)
        g1 = diffusion.vf(t0, y0, args)
        H02 = y0 + k1 * dt + g1 @ _dW
        k2 = drift.vf(t0, H02, args)
        H03 = y0 + k2 * dt + k1 * dt + g1 @ _dW
        k3 = drift.vf(t0, H03, args)
        u = y0 + k1 * dt + k2 * dt + k3 * dt
        u += g1 @ (_dW + chi1)
        dense_info = dict(y0=y0, y1=u)

        return u, None, dense_info, None, diffrax.RESULTS.successful

def drift(t, X, args):
    y1, y2 = X
    dy1 = -273 / 512 * y1
    dy2 = -1 // 160 * y1 - (-785 // 512 + jnp.sqrt(2) / 8) * y2
    return jnp.array([dy1, dy2])

def diffusion(t, X, args):
    y1, y2 = X
    g11 = 1 / 4 * y1
    g12 = 1 / 16 * y1
    g21 = (1 - 2 * jnp.sqrt(2)) / 4 * y1
    g22 = 1 // 10 * y1 + 1 // 16 * y2

    return jnp.array([[g11, g12], [g21, g22]])

t0, t1 = 0.0, 3.0
y0 = jnp.array([1.0, 1.0])

def solve_wrapper(dt, num_samples, use_tree):
    keys = jax.random.split(jax.random.key(42), num_samples)
    solver = Solver()
    saveat = diffrax.SaveAt(t1=True)

    def solve(key):
        if not use_tree:
            tree = diffrax.UnsafeBrownianPath(
                shape={
                    "dW": jax.ShapeDtypeStruct((2,), dtype=jnp.float64),
                    "dZ": jax.ShapeDtypeStruct((2,), dtype=jnp.float64),
                },
                key=key,
            )
            terms = diffrax.MultiTerm(
                diffrax.ODETerm(drift), diffrax.ControlTerm(diffusion, tree)
            )
            return diffrax.diffeqsolve(
                terms,
                solver,
                t0,
                t1,
                dt0=dt,
                y0=y0,
                saveat=saveat,
                adjoint=diffrax.DirectAdjoint(),
            )
        else:
            tree = diffrax.VirtualBrownianTree(
                t0,
                t1,
                tol=dt / 2,
                shape={
                    "dW": jax.ShapeDtypeStruct((2,), dtype=jnp.float64),
                    "dZ": jax.ShapeDtypeStruct((2,), dtype=jnp.float64),
                },
                key=key,
            )
            terms = diffrax.MultiTerm(
                diffrax.ODETerm(drift), diffrax.ControlTerm(diffusion, tree)
            )
            return diffrax.diffeqsolve(
                terms, solver, t0, t1, dt0=dt, y0=y0, saveat=saveat
            )
            # , adjoint=diffrax.DirectAdjoint()) this is 2x slower

    return jax.jit(jax.vmap(solve))(keys).ys.squeeze(axis=1)

%%timeit
_ = solve_wrapper(1.0, 20 * 100_000, True).block_until_ready()

yields 9.37 s ± 281 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) for VBT and 1.03 s ± 8.17 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) for UBP.

Maybe this isn't even solver specific, I just noticed using Heun instead, with dt = 0.1, VBT takes 27s but UBP takes3s , so maybe the real question is twofold: is there anyway to make VBT faster, and if not, is there any way to program around VBT so we can making adaptive stepping solvers, or differentiable solvers, assuming we can give maintain one of the three pillars of the UBP requirements?

So VBT is sensitive to the tolerance used: increasing this increases the computational cost.
Other than that I think there is performance being left on the table with it:

on every sample is goes through its entire while loop again, despite the fact that most of those iterations are probably identical to the last sample.
across two adjacent steps [t0, t1], [t1, t2], then we end up evaluating vbt(t1) - vbt(t0) followed by vbt(t2) - vbt(t1) -- so that we actually evaluate vbt(t1) twice! This doubles the computational work.

These are things that I think will require some careful thought to fix, so they've never made it far enough up my to-do list. (What I really want is to an LRU cache on the evalutions of the loop body.) FWIW I did benchmark all of this when I first wrote all of this, and found that whilst there was a slowdown, it wasn't as dramatic as you're seeing here. It might be that you're in a case this is particularly pronounced, or something might have sneakily regressed without me noticing...
(Semi-relatedly we also have this benchmark: https://github.com/patrick-kidger/diffrax/blob/main/benchmarks/brownian_tree_times.py)
Another thing I'd love to see an implementation of some time is the Brownian Interval from this paper, but again that's fairly fiddly in JAX's model of computation. (Not impossible though I think.)

When I compare the old to the new VBT, I didn't see a pronounced slowdown, so it doesn't seem like regression (although I am generally supportive of speed regression tests). But one thing I did notice, if if I make the (new) VBT over an array, rather than a pytree, e.g.
              # shape=jax.ShapeDtypeStruct((4,), dtype=jnp.float64),
              shape={
                  "dW": jax.ShapeDtypeStruct((2,), dtype=jnp.float64),
                  "dZ": jax.ShapeDtypeStruct((2,), dtype=jnp.float64),
              },

and just parse the array and convert to dict in solver
if not isinstance(cont, dict):
     cont = {"dW": cont[:2], "dZ": cont[2:]}

this is >2x faster than if I just have the VBT over a dictionary (from 11s to 4s). Maybe this is expected since the tree is iterated over (https://github.com/patrick-kidger/diffrax/blob/main/diffrax/_brownian/tree.py#L323) and tree maps happen sequentially (I assume?). If this is the case, is there a reason not to just flatten? I could just be misreading it.
I'm starting to have a lurking suspicion we will end up implementing a brownian path object, then diff check it against VBT to understand it better lol.
I think we can definitely squeeze more performance from the VBT (and we can add those to the list of things to implement), it just feels like the slowdown shouldn't be this much even with a slightly suboptimal VBT.

Another thing I'd love to see an implementation of some time is the Brownian Interval from this paper, but again that's fairly fiddly in JAX's model of computation. (Not impossible though I think.)

Was there ever an implementation in something like torchsde?

I think the iteration over tree leaves is indeed a mistake performance-wise. FWIW in principle JAX should be able to parallelize each call, but in practice it seems that it is not doing that...
I think you're right, the better approach would be to have a single loop that acts over a PyTree.
I'll tag @andyElking on this issue too.

Was there ever an implementation in something like torchsde?

Yup. torchsde is where I wrote the original canonical Brownian Interval implementation.
(In practice the implementation is really rather complicated, and has a couple of footguns of its own!)

I completely agree. In fact I've been eyeing that split by PyTree for a while now and am intending to refactor it soonish. In addition I am intending to add a LRU cache to _evaluate, but that can be a separate edit since it also requires changes to diffeqsolve.

FWIW in principle JAX should be able to parallelize each call, but in practice it seems that it is not doing that...

Yea, it's weird since the path is (probably) parallelizing it over the same pytree (https://github.com/patrick-kidger/diffrax/blob/main/diffrax/_brownian/path.py#L126). Not sure why the inner map of VBT isn't.

(In practice the implementation is really rather complicated, and has a couple of footguns of its own!)

Is the reason for implementing the VBT over the BI just less foot guns? Or easier in jax?

Primarily just that it's easier in JAX. The BI algorithm involves dynamically creating a tree, so to do that in JAX you'd have to preallocate a buffer and then use that to store pointers (indices) into itself.


chore(dist): add version & license banner to dist files

Resolves #366

Coverage remained the same at 100.0% when pulling 6aaad4cd1f2da678b66d34dffbb6435efed9f36c on thgreasi:add-banner into 5b525e80ae3505a541d369bbe9ac9761f7327be3 on angular-ui:master.


CASMINST-6700: retry cray-nls upgrade

Description
cray-nls upgrade sometimes fails during pipeline run. This PR adds retries for up to 20 minutes to maximize its success rate.

Checklist

[ ] If I added any command snippets, the steps they belong to follow the prompt conventions (see example).
[ ] If I added a new directory, I also updated .github/CODEOWNERS with the corresponding team in Cray-HPE.
[x] My commits or Pull-Request Title contain my JIRA information, or I do not have a JIRA.

/backport release/1.6


[Bug]: Cohere tool calling with regular LLM call later results in BadRequestError: status_code: 400

Describe the bug
Getting an error as under when using Cohere with tool use.
BadRequestError                           Traceback (most recent call last)
[<ipython-input-20-914b6f98f052>](https://localhost:8080/#) in <cell line: 1>()
----> 1 chat_result = human.initiate_chat(
      2     manager,
      3     message="""First add 1 and 60. Then multiply answer by 2"""
      4 )

12 frames
[/usr/local/lib/python3.10/dist-packages/autogen/agentchat/conversable_agent.py](https://localhost:8080/#) in initiate_chat(self, recipient, clear_history, silent, cache, max_turns, summary_method, summary_args, message, **kwargs)
   1017             else:
   1018                 msg2send = self.generate_init_message(message, **kwargs)
-> 1019             self.send(msg2send, recipient, silent=silent)
   1020         summary = self._summarize_chat(
   1021             summary_method,

[/usr/local/lib/python3.10/dist-packages/autogen/agentchat/conversable_agent.py](https://localhost:8080/#) in send(self, message, recipient, request_reply, silent)
    654         valid = self._append_oai_message(message, "assistant", recipient)
    655         if valid:
--> 656             recipient.receive(message, self, request_reply, silent)
    657         else:
    658             raise ValueError(

[/usr/local/lib/python3.10/dist-packages/autogen/agentchat/conversable_agent.py](https://localhost:8080/#) in receive(self, message, sender, request_reply, silent)
    817         if request_reply is False or request_reply is None and self.reply_at_receive[sender] is False:
    818             return
--> 819         reply = self.generate_reply(messages=self.chat_messages[sender], sender=sender)
    820         if reply is not None:
    821             self.send(reply, sender, silent=silent)

[/usr/local/lib/python3.10/dist-packages/autogen/agentchat/conversable_agent.py](https://localhost:8080/#) in generate_reply(self, messages, sender, **kwargs)
   1971                 continue
   1972             if self._match_trigger(reply_func_tuple["trigger"], sender):
-> 1973                 final, reply = reply_func(self, messages=messages, sender=sender, config=reply_func_tuple["config"])
   1974                 if logging_enabled():
   1975                     log_event(

[/usr/local/lib/python3.10/dist-packages/autogen/agentchat/groupchat.py](https://localhost:8080/#) in run_chat(self, messages, sender, config)
   1050                     iostream.print(colored(f"\nNext speaker: {speaker.name}\n", "green"), flush=True)
   1051                 # let the speaker speak
-> 1052                 reply = speaker.generate_reply(sender=self)
   1053             except KeyboardInterrupt:
   1054                 # let the admin agent speak if interrupted

[/usr/local/lib/python3.10/dist-packages/autogen/agentchat/conversable_agent.py](https://localhost:8080/#) in generate_reply(self, messages, sender, **kwargs)
   1971                 continue
   1972             if self._match_trigger(reply_func_tuple["trigger"], sender):
-> 1973                 final, reply = reply_func(self, messages=messages, sender=sender, config=reply_func_tuple["config"])
   1974                 if logging_enabled():
   1975                     log_event(

[/usr/local/lib/python3.10/dist-packages/autogen/agentchat/conversable_agent.py](https://localhost:8080/#) in generate_oai_reply(self, messages, sender, config)
   1339         if messages is None:
   1340             messages = self._oai_messages[sender]
-> 1341         extracted_response = self._generate_oai_reply_from_client(
   1342             client, self._oai_system_message + messages, self.client_cache
   1343         )

[/usr/local/lib/python3.10/dist-packages/autogen/agentchat/conversable_agent.py](https://localhost:8080/#) in _generate_oai_reply_from_client(self, llm_client, messages, cache)
   1358
   1359         # TODO: #1143 handle token limit exceeded error
-> 1360         response = llm_client.create(
   1361             context=messages[-1].pop("context", None), messages=all_messages, cache=cache, agent=self
   1362         )

[/usr/local/lib/python3.10/dist-packages/autogen/oai/client.py](https://localhost:8080/#) in create(self, **config)
    730             try:
    731                 request_ts = get_current_ts()
--> 732                 response = client.create(params)
    733             except APITimeoutError as err:
    734                 logger.debug(f"config {i} timed out", exc_info=True)

[/usr/local/lib/python3.10/dist-packages/autogen/oai/cohere.py](https://localhost:8080/#) in create(self, params)
    175                     response = client.chat_stream(**cohere_params)
    176                 else:
--> 177                     response = client.chat(**cohere_params)
    178             except CohereRateLimitError as e:
    179                 raise RuntimeError(f"Cohere exception occurred: {e}")

[/usr/local/lib/python3.10/dist-packages/cohere/client.py](https://localhost:8080/#) in _wrapped(*args, **kwargs)
    101                 "To suppress this warning, set `log_warning_experimental_features=False` when initializing the client."
    102             )
--> 103         return func(*args, **kwargs)
    104
    105     async def _async_wrapped(*args, **kwargs):

[/usr/local/lib/python3.10/dist-packages/cohere/client.py](https://localhost:8080/#) in _wrapped(*args, **kwargs)
     33     def _wrapped(*args: typing.Any, **kwargs: typing.Any) -> typing.Any:
     34         check_fn(*args, **kwargs)
---> 35         return method(*args, **kwargs)
     36
     37     async def _async_wrapped(*args: typing.Any, **kwargs: typing.Any) -> typing.Any:

[/usr/local/lib/python3.10/dist-packages/cohere/base_client.py](https://localhost:8080/#) in chat(self, message, model, preamble, chat_history, conversation_id, prompt_truncation, connectors, search_queries_only, documents, citation_quality, temperature, max_tokens, max_input_tokens, k, p, seed, stop_sequences, frequency_penalty, presence_penalty, raw_prompting, return_prompt, tools, tool_results, force_single_step, response_format, request_options)
    853             return typing.cast(NonStreamedChatResponse, construct_type(type_=NonStreamedChatResponse, object_=_response.json()))  # type: ignore
    854         if _response.status_code == 400:
--> 855             raise BadRequestError(
    856                 typing.cast(typing.Any, construct_type(type_=typing.Any, object_=_response.json()))  # type: ignore
    857             )

BadRequestError: status_code: 400, body: {'message': 'invalid request: all elements in history must have a message.'}

Steps to reproduce

Run conversation between agents for few cycles.
Inbetween have a tool call.
Before calling a normal LLM call, ensure that chat history has a tool call, but it is not the latest one.
It creates above mentioned error.

Model Used
Cohere command-r-plus
Expected Behavior
Code should handle such situations without running into the error.
Screenshots and logs

Additional Information
No response

Code which reproduces error for me:
original_task = """take a 3. multiply it by 764557. add -567 to answer."""

def addition(a: int, b: int) -> int:
  """Tool to add two integer numbers a and b"""
  return a + b

def subtraction(a: int, b: int) -> int:
  """Tool to subtract integer number b from integer number a"""
  return a - b

def multiplication(a: int, b: int) -> int:
  """Tool to multiply two integer numbers a and b"""
  return a * b

def division(a: int, b: int) -> int:
  """Tool to divide integer numbers a by b"""
  return a / b

class MyConversableAgent(ConversableAgent):
  def get_human_input(self, prompt):
    # Custom method to get human input
    print("I am here")
    print(groupchat.messages[-1])
    user_input = input()  # This could be replaced with a more sophisticated input method
    return user_input

human = MyConversableAgent(
    name="Human",
    system_message="A human user",
    human_input_mode="TERMINATE",
    llm_config=False,
    default_auto_reply="Continue please"
)

class DebugConversableAgent(ConversableAgent):
  def get_human_input(self, prompt):
    user_input = input(prompt)
    return user_input

llm = DebugConversableAgent(
    name="LLM_Generic",
    system_message="A generic large language model with tools. If multiple tool calls are required, then return only first one as response. Do not mention subsequent ones.",
    human_input_mode="NEVER",
    llm_config={"config_list": config_list}
)

llm.register_for_llm(name="addition", description=addition.__doc__)(addition)
llm.register_for_llm(name="subtraction", description=subtraction.__doc__)(subtraction)
llm.register_for_llm(name="multiplication", description=multiplication.__doc__)(multiplication)
llm.register_for_llm(name="division", description=division.__doc__)(division)

llm2 = ConversableAgent(
    name="LLM_Prompt_for_human",
    system_message="Refer to messages recevied and convert it into a prompt or information message for human user. Based on the messages ask for additional information that human has to provide or give him information. If the original task is complete, send message as TERMINATE. original task is " + original_task,
    human_input_mode="NEVER",
    llm_config={"config_list": config_list}
)

executor = ConversableAgent(
    name="Tool Executor",
    system_message="This class is used to execute tools passed to it",
    human_input_mode="NEVER",
    llm_config={"config_list": config_list}
)

executor.register_for_execution(name="addition")(addition)
executor.register_for_execution(name="subtraction")(subtraction)
executor.register_for_execution(name="multiplication")(multiplication)
executor.register_for_execution(name="division")(division)

groupchat = autogen.GroupChat(agents=[human, llm, executor, llm2], messages=[], max_round=20, speaker_selection_method=custom_speaker_selection_func)
manager = autogen.GroupChatManager(groupchat=groupchat, llm_config=False)

from autogen import Agent
def custom_speaker_selection_func(last_speaker, groupchat):
  """Define a customized speaker selection function.
  A recommended way is to define a transition for each speaker in the groupchat.

  Parameters:
      - last_speaker: Agent
          The last speaker in the group chat.
      - groupchat: GroupChat
          The GroupChat object
  Return:
      Return one of the following:
      1. an `Agent` class it must be one of the agents in the group chat.
      2. a string from ['auto' 'manual' 'random' 'round_robin'] to select a default method to use.
      3. None which indicates the chat should be terminated.
  """
  messages = groupchat.messages

  if "TERMINATE" in messages[-1]['content']:
    print("%%%%%%%%%%%%%%%% Calling TERMINATE")
    return None

  if last_speaker is llm:
    if "tool_calls" in messages[-1]:
      print("%%%%%%%%%%%%%%%% Calling executor")
      return executor
    else:
      print("%%%%%%%%%%%%%%%% Calling LLM2")
      return llm2
  if last_speaker is human:
    print("%%%%%%%%%%%%%%%% Calling LLM")
    return llm
  if last_speaker is executor:
    print("%%%%%%%%%%%%%%%% Calling LLM2")
    return llm2
  if last_speaker is llm2:
    print("%%%%%%%%%%%%%%%% Calling Human")
    return human
  return None

chat_result = human.initiate_chat(
    manager,
    message=original_task
)

Thanks @jaygdesai, your #3271 PR fixes this bug :).


Update to 1.1.0

Updated all three nuspec files and the install package's links + checksums. Let me know if I missed anything.

Thanks!
I'll only adjust the package release notes a bit (my intention is for them to be scoped to each software version, i.e. each software version increase results in an "initial package" for that version). Other than that, looks good to go.
Oh, but next time, please avoid mixing reformatting with other changes in the same commit.

Sorry about that. I'll keep them in separate commits in the future.
Speaking of which, I have some files prepped for the sdk packages, would you mind if I PR'd them?
On Tue, Nov 29, 2016 at 1:49 PM -0800, "Jakub Berezanski"<EMAIL_ADDRESS>wrote:
Merged #2.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

The SDK packages in this repo are currently 0-byte stubs; we haven't finished porting them from @Riezebosch's repo yet. The plan was to: 1) rename the existing dotnetcore-sdk package to dotnetcore-sdk.install, 2) make dotnetcore-sdk a meta-package (similar to dotnetcore-runtime) and, finally, 3) add the dotnetcore-sdk.portable package. I've been meaning to do it for months now, but never could find the time.
If you only mean to update the SDK to 1.1.0, I suggest you submit the PR here. But, if you would like to help with the above plan, that would be great!

FYI, the reformatting broke markdown rendering of release notes - I had to revert it.

Can I fix the commit from this PR or should I open a new one?

I've already fixed it. The packages are now live on chocolatey.org, pending moderation.
Thanks for your PR, it gave me enough motivation to update other dotnetcore packages as well :)

@jberezanski Feel free to include the dotnetcore-sdk package in this repo. It just makes more sense.


Wishlist: Add curl binary to docker images

A lot of packages use curl to fetch their dependencies. For example with the default cross images I can't compile exonum_libsodium-sys due to error:
thread 'main' panicked at 'Failed to run curl command: No such file or directory (os error 2)', /cargo/registry/src/github.com-1ecc6299db9ec823/exonum_libsodium-sys-0.0.23/build.rs:88:17

Feel free to add it.


-segment_numbers option

Hello!
I want to ask about -segment_numbers option.
If i put this option when i tokenize, can i check it in my output file?
This is my command,
th tools/tokenize.lua -case_feature true -segment_case true -segment_numbers true -joiner_annotate true  < input_test_en.txt > test.tok
and the output is like below.
the￨C convention￨L in￨L 1912￨N led￨L to￨L a￨L split￨L republican￨C party￨C ￭.￨N
I expected 1912 segmented like 1 9 1 2 but there is no change…
Please help me.
Thank you.

hi @qutie75 - yes this is a known issue. -segment_numbers only works with -mode aggressive (so you can use that for the moment) - we will fix that (or block use of the option in non-aggressive mode because it is more in the spirit of "aggressive" than "conversative" tokenization.


Add a way to ignore workspaces

When one does  --manifest-path ./Cargo.toml it should treat that path (if its relative) as a single crate and not traverse to find the workspace (the parent Cargo.toml).

Added in 25a8f03d6118f3c62f0eca94d497c67223cd4681


Error while trying to install

Download<EMAIL_ADDRESS>error: TS2345 [ERROR]: Argument of type '{ type: string; }' is not assignable to parameter of type 'string'.
    await Deno.symlink(originSrcFilePath, dest, {

    at https://deno.land/std@v0.52.0/fs/copy.ts:117:49

TS2345 [ERROR]: Argument of type '{ type: string; }' is not assignable to parameter of type 'string'.
    Deno.symlinkSync(originSrcFilePath, dest, {

    at https://deno.land/std@v0.52.0/fs/copy.ts:141:47

TS2345 [ERROR]: Argument of type '{ type: string; }' is not assignable to parameter of type 'string'.
    await Deno.symlink(src, dest, {

    at https://deno.land/std@v0.52.0/fs/ensure_symlink.ts:33:35

TS2345 [ERROR]: Argument of type '{ type: string; }' is not assignable to parameter of type 'string'.
    Deno.symlinkSync(src, dest, {

    at https://deno.land/std@v0.52.0/fs/ensure_symlink.ts:65:33

Found 4 errors.

Thanks for reporting this error.
Can I have more informations about your environment, like OS and Deno version ?
If you use Deno 1.0.0 you have two solutions:

Install Drun v1.0.0 (deno install --allow-read --allow-run --unstable<EMAIL_ADDRESS>and execute it with drun [OPTIONS]  instead of drun watch [OPTIONS]
Upgrade your Deno version to Deno v1.0.1 with deno upgrade

Hi there,
Thank You
It worked with the commands you mentioned
deno install --allow-read --allow-run --unstable<EMAIL_ADDRESS>instead of
``deno install --allow-read --allow-run --unstable<EMAIL_ADDRESS>my deno version is 1.0.0
Thank You

Yes it was because of the Deno version v1.0.0 not compatible with Drun v1.1.0, glad to know it works now :smile:


npm run watch failed

After git clone and run npm run watch, I don't know why, need help
λ npm run watch

><EMAIL_ADDRESS>watch C:\Project\x5-driver\build\hook\appium-android-driver
> gulp

[16:25:38] Using gulpfile C:\Project\x5-driver\build\hook\appium-android-driver\gulpfile.js
[16:25:38] Starting 'watch'...
[16:25:38] Finished 'watch' after 5.33 ms
[16:25:38] Starting 'default'...
[16:25:38] Finished 'default' after 5.42 μs
Error: spawn C:\Project\x5-driver\build\hook\appium-android-driver\node_modules\.bin\gulp ENOENT
    at exports._errnoException (util.js:855:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
    at onErrorNT (internal/child_process.js:344:16)
    at nextTickCallbackWith2Args (node.js:455:9)
    at process._tickCallback (node.js:369:17)
    at Function.Module.runMain (module.js:432:11)
    at startup (node.js:141:18)
    at node.js:980:3

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Software\\nodejs\\node.exe" "C:\\Users\\tianyuzou\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "watch"
npm ERR! node v5.3.0
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR<EMAIL_ADDRESS>watch: `gulp`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the<EMAIL_ADDRESS>watch script 'gulp'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the appium-android-driver package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     gulp
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs appium-android-driver
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls appium-android-driver
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Project\x5-driver\build\hook\appium-android-driver\npm-debug.log

install gulp and gulp-cli globally.
npm install -g gulp gulp-cli
Should fix it.
@jlipps We should add a note about these dependencies to a development doc.

https://github.com/appium/appium/commit/86e3685083e2b22f46ec4ef0d53eacb579d4e5fc


Implement Show Own Text Messages

Currently we don't see when we send our own messages

Currently shows user always as uid 0, this will be fixed in #14


Shortcut: ops_load_trajectory

We've talked about adding this before. It's basically an OPS wrapper on MDTraj's load method. After MDTraj loads the file, we convert the MDTraj trajectory to an OPS trajectory.
I've locally tested with Gromacs file including a .gro for the top keyword, and it works. At some point, we'll want to add formal unit tests on that.
(I got tired of every analysis-based example starting with what was basically this little one-line function.)
Would like to put this in 0.9.2, so please review soon.

Passes tests. Reviewing this should really take no more than a minute or two (it's 2 new lines of code, plus smoke tests for those two lines.)

Lgtm.


Get your own roadmap backend server

Hey there 👋,
I made a back-end server with Swift Vapor so everyone can have their own server to use Roadmap.
The server includes the API to call and the database that persists changes made through the API.
I already use it to track user's votes on my server.
The deployment process has been documented so you can quickly start your own server (for free). If you find any unprecise information in the README, please feel free to tell me.
👉 You can check the source code here, too: https://github.com/valentin-mille/RoadmapBackend

@valentin-mille thank you so much! I've pinned your issue to make it more clear. Feel free to open a PR with a paragraph of copy inside the readme of our project. I believe it could help many!

Thank you @AvdLee for pinning the issue. I hope it will help and develop the Roadmap usage.
What do you mean by a "paragraph of copy"?
I understand it as a small paragraph introducing RoadmapBackend, is that right?

Thanks for creating this @valentin-mille. I’ve tested it and it works flawlessly.
And, thanks @AvdLee @jordibruin @hiddevdploeg for the awesome library.

What do you mean by a "paragraph of copy"?

Basically installation instructions to use your backend server 👌


Error occurred when executing DownloadAndLoadKolorsModel:

Error occurred when executing DownloadAndLoadKolorsModel:
Cannot load from F:\ComfyUI-aki-v1.3\models\diffusers\Kolors because the following keys are missing:
encoder_hid_proj.bias, encoder_hid_proj.weight.
Please make sure to pass low_cpu_mem_usage=False and device_map=None if you want to randomly initialize those weights or else make sure your checkpoint file is correct.
File "F:\ComfyUI-aki-v1.3\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "F:\ComfyUI-aki-v1.3\execution.py", line 81, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "F:\ComfyUI-aki-v1.3\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "F:\ComfyUI-aki-v1.3\custom_nodes\ComfyUI-KwaiKolorsWrapper\nodes.py", line 80, in loadmodel
unet = UNet2DConditionModel.from_pretrained(model_path, subfolder= 'unet', variant="fp16", revision=None, low_cpu_mem_usage=True).to(dtype).eval()
File "F:\ComfyUI-aki-v1.3\python\lib\site-packages\huggingface_hub\utils_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
File "F:\ComfyUI-aki-v1.3\python\lib\site-packages\diffusers\models\modeling_utils.py", line 750, in from_pretrained
raise ValueError(

Error occurred when executing DownloadAndLoadKolorsModel:
Cannot load from F:\ComfyUI-aki-v1.3\models\diffusers\Kolors because the following keys are missing: encoder_hid_proj.bias, encoder_hid_proj.weight. Please make sure to pass low_cpu_mem_usage=False and device_map=None if you want to randomly initialize those weights or else make sure your checkpoint file is correct.
File "F:\ComfyUI-aki-v1.3\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "F:\ComfyUI-aki-v1.3\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "F:\ComfyUI-aki-v1.3\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "F:\ComfyUI-aki-v1.3\custom_nodes\ComfyUI-KwaiKolorsWrapper\nodes.py", line 80, in loadmodel unet = UNet2DConditionModel.from_pretrained(model_path, subfolder= 'unet', variant="fp16", revision=None, low_cpu_mem_usage=True).to(dtype).eval() File "F:\ComfyUI-aki-v1.3\python\lib\site-packages\huggingface_hub\utils_validators.py", line 114, in _inner_fn return fn(*args, **kwargs) File "F:\ComfyUI-aki-v1.3\python\lib\site-packages\diffusers\models\modeling_utils.py", line 750, in from_pretrained raise ValueError(

这个问题解决了吗，我碰到同样的困扰


Add help text blurbs on home page

Help text for blurbs on alice.zooniverse.org
Final text in this Google Doc

Are the image files changing from that doc? If not, I can download and use the images on that Google doc.


repo sync

This is an automated pull request to sync changes between the public and private repos.
:robot: This pull request should be merged (not squashed) to preserve continuity across repos, so please let a bot do the merging!

Will traduz
Em seg., 22 de mar. de 2021 às 15:16, Octomerger Bot <
@.***> escreveu:

This is an automated pull request to sync changes between the public and
private repos.
🤖 This pull request should be merged (not squashed) to preserve
continuity across repos, so please let a bot do the merging!
You can view, comment on, or merge this pull request online at:
https://github.com/github/docs/pull/4728
Commit Summary

repo sync
Add release note for ghe-config-apply time out with Failure waiting for nomad jobs to apply (#18338)

File Changes

M data/release-notes/3-0/2.yml
https://github.com/github/docs/pull/4728/files#diff-848024e9b5eb735facac6f845c085cf7f2d213d03347cf55f8ede097fb0475b1
(1)

Patch Links:

https://github.com/github/docs/pull/4728.patch
https://github.com/github/docs/pull/4728.diff

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/github/docs/pull/4728, or unsubscribe
https://github.com/notifications/unsubscribe-auth/ATCJZSXUYGLQUXECLARRVOTTE6CORANCNFSM4ZTUGM6Q
.

03004222235
On Mon, 22 Mar 2021, 11:18 pm luismedicina23, @.***>
wrote:

Will traduz
Em seg., 22 de mar. de 2021 às 15:16, Octomerger Bot <
@.***> escreveu:

This is an automated pull request to sync changes between the public and
private repos.
🤖 This pull request should be merged (not squashed) to preserve
continuity across repos, so please let a bot do the merging!
You can view, comment on, or merge this pull request online at:
https://github.com/github/docs/pull/4728
Commit Summary

repo sync
Add release note for ghe-config-apply time out with Failure waiting for nomad jobs to apply (#18338)

File Changes

M data/release-notes/3-0/2.yml
<
https://github.com/github/docs/pull/4728/files#diff-848024e9b5eb735facac6f845c085cf7f2d213d03347cf55f8ede097fb0475b1

(1)
Patch Links:

https://github.com/github/docs/pull/4728.patch
https://github.com/github/docs/pull/4728.diff

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/github/docs/pull/4728, or unsubscribe
<
https://github.com/notifications/unsubscribe-auth/ATCJZSXUYGLQUXECLARRVOTTE6CORANCNFSM4ZTUGM6Q
.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/github/docs/pull/4728#issuecomment-804287099, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/ARDXTVYG536AWAE4Q2YISBLTE6CXNANCNFSM4ZTUGM6Q
.


Enhancement: Bang whitespace rules should consider !global flag

The Space Before Bang and Space After Bang rules consider both the !important and !default flag but should also consider the !global flag too.
This is currently blocked by the Gonzales-pe dependency.

Confirmed as parsing correctly in gonzales 3.2.1

So, we just need to update package.json:
"gonzales-pe": "^3.2.1",

Unfortunately if you do that it will break a lot of other features in sass-lint as it stands. gonzales-pe 3.2.1 includes some breaking features and also some regressions over its previous versions which is why we haven't updated yet.. Once it updates to a stable version with regards to our needs we'll be moving up.

Can we list the road blockers from the upstream below:

https://github.com/tonyganch/gonzales-pe/issues/134

What else?

Sorry this issue is specifically for the global flag errors they wont be listed here. The blockers are opened as issues on the gonzales-pe repository if not specified here. Once the issues we know about are resolved we'll then start running our tests again with the new build.

This is fixed in sass-lint 1.6.0


Caching index.html with changed update strategy

I may be missing something simple here, but I cannot figure out how to force an update of index.html when using a cache strategy of changed. The HTML file always falls into the moved category. I have the index.html entry located in main as stated in the documentation. Is there something special that needs to be done to force that file to be updated?

Hmm.. I don't think there is a solution at a moment if index.html isn't part of your webpack build. offline-plugin uses build hash of each file to determine if it was changed. So if some internal file used, plugin cannot determine if it was updated or not, therefore it goes to moved.
But I guess it's also kind-of a bug, because if I don't have a hash for a file, then I should always mark it a changed (at least this was planned). I'll what is going on there.
Also there was a plan for alwaysRevalidate property, but unfortunately it wasn't implemented for v3.

Okay, from the code it seems everything is right: if asset isn't in hash map, then it's changed, not moved.
Can you provide a bit more info? Your offline-plugin config and SW output will be super useful.

@NekR - I should have posted the config originally, my bad. Additionally, the index.html file is part of my webpack build. As you can see below, the hash in hashesMap for my HTML pages doesn't change between app builds.
config:
// Pages
new HtmlWebpackPlugin({
  template: paths.client('index.html'),
  hash: false,
  filename: 'index.html',
  inject: 'body',
  chunks: ['app', 'vendor'],
  minify: {
    collapseWhitespace: true
  }
}),
new HtmlWebpackPlugin({
  template: paths.client('styleguide.html'),
  hash: false,
  filename: 'styleguide.html',
  inject: 'body',
  chunks: ['styleguide', 'vendor'],
  minify: {
    collapseWhitespace: true
  }
})

// Offline Plugin
new OfflinePlugin({
  excludes: ['**/*.map'],
  safeToUseOptionalCaches: true,
  updateStrategy: 'changed',
  caches: {
    main: ['index.html', 'app*.js', 'styleguide.html', 'styleguide*.js', 'vendor*.js'],
    additional: ['*.chunk.js']
  },
  ServiceWorker: {
    events: true
  }
})

Initial output:
[SW]: Install event
sw.js:483 [SW]: Cached assets: main
sw.js:486 Asset: http://localhost:4000/
sw.js:486 Asset: http://localhost:4000/app.76410cbedf1e56614353.js
sw.js:486 Asset: http://localhost:4000/styleguide.html
sw.js:486 Asset: http://localhost:4000/styleguide.6568743c1e1f3ae6603e.js
sw.js:486 Asset: http://localhost:4000/vendor.7b9cd2d34532a6c44991.js
sw.js:120 [SW]: Activate event
styleguide.6568743….js:347 Service worker is installed!
styleguide.6568743….js:348 Application is now ready for offline use.

Initial SW hash:
var __wpo = {
  "assets": {
    "main": [
      "./",
      "./app.76410cbedf1e56614353.js",
      "./styleguide.html",
      "./styleguide.6568743c1e1f3ae6603e.js",
      "./vendor.7b9cd2d34532a6c44991.js"
    ],
    "additional": [],
    "optional": []
  },
  "hashesMap": {
    "76410cbedf1e56614353a8fa1ee77a68": "./app.76410cbedf1e56614353.js",
    "6568743c1e1f3ae6603e214e34e8b868": "./styleguide.6568743c1e1f3ae6603e.js",
    "7b9cd2d34532a6c44991c62b7df7e13d": "./vendor.7b9cd2d34532a6c44991.js",
    "886830bd4d6b0d9ffa8042b493b16a7b": "./",
    "d5b0cb64d74627b923c977bbfadf981d": "./styleguide.html"
  },
  "strategy": "changed",
  "version": "7/6/2016, 8:06:50 AM",
  "name": "webpack-offline",
  "relativePaths": true
};

New app output:
[SW]: Install event
sw.js:483 [SW]: Changed assets: main
sw.js:486 Asset: http://localhost:4000/styleguide.f8680a20c484bb0984f7.js
sw.js:486 Asset: http://localhost:4000/vendor.9daf38d23e4c600d79a0.js
sw.js:483 [SW]: Moved assets: main
sw.js:486 Asset: ["http://localhost:4000/app.76410cbedf1e56614353.js", "http://localhost:4000/app.76410cbedf1e56614353.js"]
sw.js:486 Asset: ["http://localhost:4000/", "http://localhost:4000/"]
sw.js:486 Asset: ["http://localhost:4000/styleguide.html", "http://localhost:4000/styleguide.html"]
styleguide.6568743….js:351 New version of application available, applying update now.
sw.js:120 [SW]: Activate event
sw.js:256 [SW]: Delete cache: webpack-offline:7/6/2016, 8:06:50 AM
styleguide.6568743….js:358 Application update succeeded!

New app SW hash:
var __wpo = {
  "assets": {
    "main": [
      "./",
      "./app.76410cbedf1e56614353.js",
      "./styleguide.html",
      "./styleguide.f8680a20c484bb0984f7.js",
      "./vendor.9daf38d23e4c600d79a0.js"
    ],
    "additional": [],
    "optional": []
  },
  "hashesMap": {
    "76410cbedf1e56614353a8fa1ee77a68": "./app.76410cbedf1e56614353.js",
    "f8680a20c484bb0984f78c30128b5443": "./styleguide.f8680a20c484bb0984f7.js",
    "9daf38d23e4c600d79a02fee7b1e8b8e": "./vendor.9daf38d23e4c600d79a0.js",
    "886830bd4d6b0d9ffa8042b493b16a7b": "./",
    "d5b0cb64d74627b923c977bbfadf981d": "./styleguide.html"
  },
  "strategy": "changed",
  "version": "7/6/2016, 8:07:47 AM",
  "name": "webpack-offline",
  "relativePaths": true
};

@green-arrow hmm.. seems like problem could be in HtmlWebpackPlugin, but I'm not sure though. Some time ago, in its source code, I saw that it computed hash before template is evaluated, e.g. the hash is computed from bytes of template itself.
@jantimon can you help us here with figuring out what is going on? If it's better, I can file an issue on HtmlWebpackPlugin repo.

I think I'm right, template is execute after compilation: https://github.com/ampedandwired/html-webpack-plugin/blob/8fbbf69e503ce637c7ac92601afea02caff8ebcb/index.js#L135
Of course, I can have a special case and run hash computation of .html files on my own, but this is bad that hash doesn't include dynamic content anyway.

Yeah, I think doing a special hash computation on your own is more of a bandaid. Is the correct thing to file an issue with HtmlWebpackPlugin then?

@green-arrow Let's wait a bit if @jantimon can answer here. If not, I'll file an issue there.

@green-arrow as a temporal solution, you can try to add all .html files to excludes and then manually add them to externals and caches. The magic here is that excludes runs first before anything is computed   /used by plugin, so this could work, but I am not sure 100%.
I am from a phone now, so unfortunately cannot show full example of it.

@NekR - no worries, I'm not in any kind of a rush. We only have a couple files that are cached, so when the app updates, all the files should be revalidated anyway, so I'm just using the all strategy. Eventually we will need more fine-grained control via changed, which is why I opened the issue :)

What can I do to support this?

@jantimon Okay, let me explain how I extract hashes. It's basically this method: https://github.com/NekR/offline-plugin/blob/master/src/index.js#L383
The idea is to run on compilation.chunks first and if chunk already has a hash, then use it. If chunk doesn't have a hash, it just generated it later from assets's source: https://github.com/NekR/offline-plugin/blob/master/src/index.js#L376
I'm not particularly sure how HtmlWebpackPlugin works right now, but as far as I get from source code you do child compilation and use its hash for caching and only after that you are executing templates/plugins. It seems very reasonable since you probably don't want to cache plugins/templates results.
Right now I see only 2 solution here:

I ignore HtmlWebpackPlugin generated entries in chunks array and just compute their cache from compilation.assets
HtmlWebpackPlugin somehow makes its entries have correct hash, e.g. based on final asset output bytes

I understand that option "2" probably means massive rewrite, therefore I'm completely fine with option "1".
Under question is the meaning of compilation.chunks[*].hash in a webpack world: is it supposed to mean final chunk's output hash? If not, why and what should have final chunk?
I would be good to ask sokra itself about it, but he doesn't tend to ask in such discussions, so I guess that we have to decide on our own.

Webpack has so many hashes so I don't know what you mean by final hash.
I don't know if I understood correctly what you need but you can read and modify all assets which will be injected into the page using the html-webpack-plugin-alter-asset-tags event:
function YourPlugin() {

}

YourPlugin.prototype.apply = function apply(compiler) {

  function filterTag(tag) {
    // Maybe this part won't be necessary for you
    return tag.tagName === 'link' && tag.rel === 'stylesheet';
  }

  function processTag(tag) {
    console.log(tag);
  }

  compiler.plugin('compilation', function compilationPlugin(compilation) {
    compilation.plugin('html-webpack-plugin-alter-asset-tags', function supportHtmlWebpack(pluginArgs, callback) {
      pluginArgs.head.filter(filterTag).forEach(processTag);
      pluginArgs.body.filter(filterTag).forEach(processTag);
      callback(null);
    });
  });
};

module.exports = YourPlugin;

Final hash of a file is the hash of bytes you output, i.e. of this: https://github.com/ampedandwired/html-webpack-plugin/blob/e493064c34df9a118a0dd307f862ac69fca2fd8c/index.js#L174
It's final because you don't do modifications to content of that file after it.

I don't know if I understood correctly what you need but you can read and modify all assets which will be injected into the page using the html-webpack-plugin-alter-asset-tags event:

I already have access to compilation.assets as any other plugin so I definitely don't need this.
Okay, I think I'll just start calculating hash of HtmlWebpackPlugin  generated files on my own and ignore its chunks.

@green-arrow Hi, can you try now if it works for you (install from master)?

@NekR - Sorry for the delayed response, had a pretty busy weekend. I just tried with master and it is correctly changing the html pages between app builds now 😄

Great! I'll publish it on npm now :-)

Thanks @NekR and @jantimon!


Editor: issues with generating pattern shape from stops

Observed behavior (please include a screenshot if possible)
The piece of the editor that auto-generates shape geometries from pattern stops is not constructing them properly. See below screenshot. The endpoints of the green segments should be located exactly at the stop locations after clicking the From Stops button in the pattern editor.

Expected behavior
See above description.
Steps to reproduce the problem

Load gtfs.zip into editor:
Open route 5, pattern 1 (33 stops). Click From Stops. View disjointed segments from the stop locations.

Any special notes on configuration used
N/A
Version of datatools-ui and datatools-server if applicable (exact commit hash or branch name)
latest dev

:tada: This issue has been resolved in version 4.1.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


Cant create or import worlds

Cant create or import worlds
if i  do /mvc hg1 normal
it says creating
FAILED

Log in console? Sorry for late response.

Closed due to lack of response from initiator.


[PY] Support all Teams activity handlers

Scenario
JS / C# has feature to support all activity handlers. Here's related feature for JS: https://github.com/microsoft/teams-ai/issues/194. Python might need to do the same thing. Creating this issue to discuss.
Solution
Support all activity handlers like JS / C#.
Additional Context
No response

Moving to triaged as this has been discussed in last week's scrum


Unable to assign a dynamic schema type

Describe the bug
Consider the following factory
import {
	defineI18nMiddleware,
	detectLocaleFromAcceptLanguageHeader
} from '@intlify/hono';

export function createI18nMiddleware<TSchema extends Record<string, string>>(
	schema: TSchema,
	translations: Record<string, TSchema> = {},
) {
	return defineI18nMiddleware<{ message: TSchema }>({
		locale: detectLocaleFromAcceptLanguageHeader,
		messages: { ...translations, en: schema },
		                                               // ^^ <-- TS error
	});
}

The TS error
Type 'TSchema' is not assignable to type 'TSchema extends LocaleMessage<string> ? TSchema : LocaleMessage<string>'.
  Type 'Record<string, string>' is not assignable to type 'TSchema extends LocaleMessage<string> ? TSchema : LocaleMessage<string>'

Not sure if it's me doing something wrong here.
Reproduction

System Info
-

Used Package Manager
other (if you use other package manager, please describe at the Additional context)
Additional context
bun v1.0.12
Validations

[X] Follow our Code of Conduct
[X] Read the Contributing Guide.
[X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
[X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
[X] The provided reproduction is a minimal reproducible of the bug.

welcome contribution :)


Cleanup producer and consumer stopped children

Submitted for your approval: we have a need for dynamically managing a large number of topics and thus producers and consumers that may or may not require being restarted. Even when topic producers and consumers are not expected to be restarted, this should prevent a significant number of worker process entries from quickly expanding the size of the managing ETS table.
This should have no impact on workers if they are not stopped by the associated stop function.

thanks for the PR.
please fix the line too long errors (see travis).

Pull Request Test Coverage Report for Build 1129

11 of 18 (61.11%)  changed or added relevant lines in 5 files are covered.
4 unchanged lines in 2 files lost coverage.
Overall coverage decreased (-0.1%) to 79.786%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

src/brod_consumer.erl
3
4
75.0%

src/brod_client.erl
4
6
66.67%

src/brod_consumers_sup.erl
0
2
0.0%

src/brod_producers_sup.erl
0
2
0.0%

Files with Coverage Reduction
New Missed Lines
%

src/brod_group_coordinator.erl
1
88.79%

src/brod_consumer.erl
3
75.66%

Totals

Change from base Build 1124:
-0.1%

Covered Lines:
2088

Relevant Lines:
2617

💛  - Coveralls

approved.
Please update changelog.md in the 3.8.0 section (will tag it later after, have some more PRs to merge)
Added kc team to review.

squash merged. thank you for your contribution @jeffgrunewald

squash merged. thank you for your contribution @jeffgrunewald

My pleasure and thank you!


Failed to load model

After generating the model with v2.1-768px I can't use it in the NMKD Stable Diffusion GUI app. When loading the model I get the error:
Failed to load model
The model appears to be incompatible.
Someone knows to that can it be?
Thanks!

Just looked through NMKDs github and it doesn't support 2.x models yet with no ETA atm.

Thank you!! I must be blind, I read the NMKD repo and didn't see it, I'll have to be aware in case they update!
Thank you very much again!

All good! I think it isn't actually stated in the README I had to go into closed issues and type 2.1 haha


Hugo academic blogdown build fails after adding a publication content item: execute of template failed (…) error calling index: index of untyped nil

I am building from scratch the Hugo-powered (version v0.78.2) website with wowchemy/starter-academic (today's most recent is ea20142) theme with the use of R blogdown (version 0.21). I put it up by running blogdown::new_site(theme = "wowchemy/starter-academic"). I have successfully edited number of content dirs, including content/post and content/talk. I then started working at content/publication:

I removed all but content/publication/_index.md
I typed blogdown::new_content(path = 'publication/foo.md', kind = 'publication')

After executing the command above, the page no longer renders, with the following error:
Rebuild failed:

Failed to render pages: render of "page" failed: "/Users/marta/Dropbox/my_personal_website/themes/github.com/wowchemy/wowchemy-hugo-modules/wowchemy/layouts/publication/single.html:14:47": execute of template failed: template: publication/single.html:14:47: executing "main" at <index .Params.publication_types 0>: error calling index: index of untyped nil
12
13
14
15
16
    {{ end }}

    {{ if and (.Params.publication_types) (ne (index .Params.publication_types 0) "0") }}

Hugo Static Site Generator v0.78.2/extended darwin/amd64 BuildDate: unknown.

Please kindly help troubleshoot this.

Users have reported that Blogdown does not yet fully support recent Hugo versions. In this case, it sounds as though Blogdown might not be utilising the publication template from https://github.com/wowchemy/wowchemy-hugo-modules/blob/master/wowchemy/archetypes/publication/index.md .
If you stop Hugo, add the front matter from the template and re-run Hugo, it might workaround the issue.

Hi @gcushen I think this helped! After that I also saw some error complaining about /content/home/gallery/index.md, and I just trashed the whole ``/content/home/galleryfolder I have no need for, and it renders correctly (mentioning as I have not seen this error before working withcontent/publication`, despite it seems not related to me 😳 ) Thanks a lot for your work!

Glad to hear it's working!
After modifying files (especially in /content/home/ folder) whilst Hugo Server is running, Hugo Server often requires restarting, which may explain why you saw unrelated errors.


search wikicommons by sha1

Came up with conversation with @Daniel-Mietchen
On uploading an image to Media Commons, hashes are calculated and used in the media commons ecosystem.

feature is used by Media uploading to prevent duplicates.

Searching images in wikidata with available checksum
SELECT ?item ?image ?checksum ?method WHERE {
  ?item p:P4092 ?checksum;
        wdt:P18|wdt:P117 ?image .
  ?checksum pq:P459 wd:Q13414952 .
}
LIMIT 10

search by specific checksum
SELECT ?item ?image ?checksum ?method WHERE {
  ?item wdt:P4092 ?checksum;
        wdt:P18|wdt:P117 ?image .
  ?item wdt:P4092 "2bef4f65032f34d70957bb123560fddb63e5686c" .
}
LIMIT 10

@Daniel-Mietchen any idea how how to do structured searched on wiki mediacommons statements ?
For some reason the hash://sha1/8a0c61a0ac8bc4adaecb0a39d63f8817cee3c789 did not yield any hits, despite the structured data I added to the media commons object https://commons.wikimedia.org/wiki/File:Agapostemon_texanus_killed_by_Peucetia_viridans_-_iNaturalist_56389401.jpg .

Here's an example of a SPARQL query with structured checksum constraints -
SELECT ?item ?referenceURL WHERE {
  ?item p:P4092 ?checksum .
  ?checksum ps:P4092 "2bef4f65032f34d70957bb123560fddb63e5686c" .
  OPTIONAL {
    ?checksum prov:wasDerivedFrom ?refnode.
    ?refnode pr:P854 ?referenceURL .
  }
}
LIMIT 10

And, not that, for this specific example, the related referenceUrl value is a pointer to a meta-data file that documented the sha1 hash for a specific file, not the file itself.

Looks like https://github.com/OpenRefine/OpenRefine/issues/4472#issuecomment-1117714088 @multichill contains a method to search wikimedia commons by their sha1 hash.

Ask the API for any files with the hash, for example https://commons.wikimedia.org/w/api.php?action=query&list=allimages&aisha1=b12eb7f6b43a3cc1eefc54db90ec5ae1504c3f17

with
curl "https://commons.wikimedia.org/w/api.php?action=query&aisha1=b12eb7f6b43a3cc1eefc54db90ec5ae1504c3f17&list=allimages&format=json"\
 | jq.

yielding:
{
  "batchcomplete": "",
  "query": {
    "allimages": [
      {
        "name": "Johann_Adam_Klein_-_Cossacks_Eat_a_Meal_in_the_Field_(1819),_Thorvaldsens_Museum_E721,6.jpg",
        "timestamp": "2022-05-03T19:38:38Z",
        "url": "https://upload.wikimedia.org/wikipedia/commons/c/ce/Johann_Adam_Klein_-_Cossacks_Eat_a_Meal_in_the_Field_%281819%29%2C_Thorvaldsens_Museum_E721%2C6.jpg",
        "descriptionurl": "https://commons.wikimedia.org/wiki/File:Johann_Adam_Klein_-_Cossacks_Eat_a_Meal_in_the_Field_(1819),_Thorvaldsens_Museum_E721,6.jpg",
        "descriptionshorturl": "https://commons.wikimedia.org/w/index.php?curid=117655456",
        "ns": 6,
        "title": "File:Johann Adam Klein - Cossacks Eat a Meal in the Field (1819), Thorvaldsens Museum E721,6.jpg"
      }
    ]
  }
}

`

with recent change, content in WikiMedia commons can now be retrieved by sha1 using Preston via e.g.,:
preston cat\
 --remote https://wikimedia.org\
 hash://sha1/b12eb7f6b43a3cc1eefc54db90ec5ae1504c3f17\
> some.jpg

producing attached image:

and, the original example was retrieved via:
preston cat\
 --remote https://wikimedia.org\
 hash://sha1/8a0c61a0ac8bc4adaecb0a39d63f8817cee3c789\
 > iNaturalist_56389401.jpg

with retrieved image attached

Now also available via https://linker.bio/hash://sha1/8a0c61a0ac8bc4adaecb0a39d63f8817cee3c789

and also, running on wikimedia servers,
https://beehind.toolforge.org/hash://sha1/8a0c61a0ac8bc4adaecb0a39d63f8817cee3c789
and attached screenshot

fyi @cboettig @mbjones this issue contains a method to integrate with sha1's from the WikiMedia Commons. I believe these contain all images on wikipedia and associated projects.


Update tutorials regarding explicit release phases

Remove explicit release phase from tutorials. Discuss when it is appropriate to do explicit and analytic releases.

Closed by #81.


URL links in nostr notes are lower-cased by primal leading to 404 errors

Describe the bug
A clear and concise description of what the bug is.
Steps to reproduce
Steps to reproduce the behavior.
Expected behavior
A clear and concise description of what you expected to happen.
Environment

Details that you think may affect.

Additional context
Add any other context about the problem here.

reproduce: hover over the URL and see the url has been lower-cased
expected: not lower-cased
example: npub17u5dneh8qjp43ecfxr6u5e9sjamsmxyuekrg2nlxrrk6nj9rsyrqywt4tp
os: ubuntu desktop
bug occurs with primal in both brave and firefox browsers
does NOT occur in iris.to nostr client

This should now be fixed. URLs in links now respect the case of the link as user wrote it.


Feature: Upload Avatar

Feature list:

User can change their avatar in 'Profile' view

User's meta-panel -> Edit profile -> Upload photo -> Crop photo  -> Save

Click avatar on a message open a UserCard, containing brief info (Not yet dynamically linked to message creator)

Outdated PR
Check PR #15


Fixes: @definitelytyped/eslint-plugin@0.1,17 isn't supported by any available resolver.

Issue # (if available)
When installing NPM packages through PNPM or other monorepo solutions the package.json errors with:
 ERR_PNPM_SPEC_NOT_SUPPORTED_BY_ANY_RESOLVER  @definitelytyped/eslint-plugin@0.1,17 isn't supported by any available resolver.

Description of changes
This fixes the package.json so that it has the correct version as the one installed has a , instead of a . for a version number.
Checklist

[❌] Created unit tests in tests/unit and/or in Rust for my feature if needed
[❌] Ran make fix to format JS and apply Clippy auto fixes
[❌] Made sure my code didn't add any additional warnings: make check
[❌] Added relevant type info in types/ directory
[❌] Updated documentation if needed (API.md/README.md/Other)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Yeah I saw that, my bad. The problem is that actuality respecting this eslint rule generates a bunch of errors in the current codebase.


invoke terraform directly instead of terragrunt

I would like to use terraform directly if possible. With this layer on top it is possible for someone to just invoke terraform directly instead of using terragrunt.
Is it possible to make terragrunt a terraform plugin or possibly a data source such that I can put 1 line into a terraform file that will ensure that terragrunt is installed for terraform plan to be able to be run successfully?

Hi @gregwebs!
In our blog post introducing terragrunt, under the section Why not just submit Pull Requests to Terraform?, we give the specific reasons why we wrote a separate tool versus submitting a few Pull Requests to update Terraform directly. But we also clarify that while our short-term goal with Terragrunt is to get community feedback and empower our own clients, our ultimate goal is to see this functionality implemented directly in Terraform.

It sounds like you are saying the way you want to achieve this is by merging the code into terraform. I have a feeling that may be a long way out from happening right now, but I am definitely supportive of that. I may take a stab at trying to create a data source that does locking when I get a little more concerned about locking.

Some of the Terragrunt features are also features of Terraform Enterprise,
locking in particular. Thus you may find some  opposition to getting them
included in Terraform.
On Aug 10, 2016 11:35 PM, "Greg Weber"<EMAIL_ADDRESS>wrote:
It sounds like you are saying the way you want to achieve this is by
merging the code into terraform. I have a feeling that may be a long way
out from happening right now, but I am definitely supportive of that. I may
take a stab at trying to create a data source that does locking when I get
a little more concerned about locking.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/gruntwork-io/terragrunt/issues/22#issuecomment-239072518,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAlG-aZKCDocdLpi4v7PskgwYvk3iwtSks5qeqaugaJpZM4Jhx1X
.

As an alternative lower-tech approach, how about letting terragrunt learn the location of my terraform binary from a terragrunt-specific environment variable?  That way I don't have to put terraform on my PATH, which means if I accidentally type terraform instead of terragrunt it won't do anything.

@dmrzzz That's a great idea. It could be done via a command-line flag, env var, or a setting in the .terragrunt:
terraform = {
  path = "/foo/bar/terraform"
}

I'd happily accept a PR for that!

PR submitted (hopefully)!  This is my first-ever Go code and my first-ever github pull request, so I apologize for any newbie mistakes.
I chose env var / command-line flag as opposed to a .terragrunt setting because the value is specific to your local workstation and shouldn't be checked into source control.

@dmrzzz PR worked just fine. Nice work and thank you for contributing :)

I chose env var / command-line flag as opposed to a .terragrunt setting because the value is specific to your local workstation and shouldn't be checked into source control.

Ah, yea, you're right.

#76 Allows you to specify the path to Terraform via an env var or command-line option.


Add iconColor to ServiceMenuItemTO

new database update needed to add icon_color to service_menu_item
iconColor != null --> use this color when generating the icon
iconColor == null --> just like it is now: use color defined by the branding, or fallback to the defaults based on the colorScheme

Already implemented


use new class_loader header names

related to ros/class_loader#80

@wjwwood @dirk-thomas ready for review (CI in https://github.com/ros/class_loader/pull/80#issuecomment-365709261)


Urgent: Remove breaking createJSModules override

Parallel change to that required in react-native-auth0: https://github.com/auth0/react-native-auth0/pull/70

Not sure how to read the Travis log - it's quitting b/c the log got too massive, but I don't see errors or exceptions.

It would be great, if this is merged ASAP

+1

With the function still in there, if anyone upgrades react-native-lock then they'll still have a working build.  The function is trivial to leave in, so I'd probably do that.

Is anything happening with this? I'm trying to upgrade to 0.47.0 and hitting the issue described.

@jeaye You may have to just fork and make the change, then point package.json at the custom version.  It's pretty easy.
Auth0 has given up on this module which really sucks as we're forced onto web-based authentication within the app.  Looking at alternate options.  I wouldn't hold out hope that this pull request will ever be merged.

@lukecwilliams I can do that. Thanks for the heads up!