Submit/stagit gopher

stagit-gopher init at version 0.9.3
Motivation for this change
So I can use stagit-gopher on Nixos
Things done

[ ] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
Built on platform(s)

[X] NixOS
[ ] macOS
[ ] other Linux distributions

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[X] Tested execution of all binary files (usually in ./result/bin/)
[ ] Determined the impact on package closure size (by running nix path-info -S before and after)
[X] Ensured that relevant documentation is up to date
[X] Fits CONTRIBUTING.md.

OK @IvarWithoutBones , So I should fix the formatting in the actual code files, squash the commits and do a separate pull request for the maintainers file?

Yep, except that the maintainer file changes can be in this PR, it should just be in a different commit.

@IvarWithoutBones, Right think I've got it this time. Maintainer and package in in separate commits and I think I've got the formatting sorted this time. Sorry about the slight ineptitude with getting the commits correctly squashed together. Must have taken about three or four resets


add missing keys to private config schema

Refs #4685
@Bhargav-Rao if you have the bandwidth and are willing to do a quick test of this branch with your Drone instance that'd be great! No worries if not though as this should do the trick.

Warnings

:warning:
This PR modified the server but none of its tests. That's okay so long as it's refactoring existing code.

Messages

:book:
:sparkles: Thanks for your contribution to Shields, @calebcartwright!

  Generated by :no_entry_sign: dangerJS against 42781af235d59f129bb6812558c6f9783f49c6d5

Hey @calebcartwright, I can test it tomorrow.
However, I do remember making just that change and it did not seem to work for me. Even though it got rid of that immediate error, I was not able to get it working completely. I was getting an unauthorized error. I also added some logs in this method, and it printed out that the auth header was empty. (It was only after this, that I created the bug report)
I can understand that this might be a different bug. Let me know if I need to open a separate bug report for that, or if the current one will suffice.

This update needs to be made anyway, but i'll update the PR description to not close the original issue.

I can understand that this might be a different bug. Let me know if I need to open a separate bug report for that, or if the current one will suffice.

If you get an error even after this change, feel free to post that on the original issue and we'll figure it out from there 👍

Hey @calebcartwright, sorry for the delayed response. I was a bit held up on other stuff.
I tried it out today with the image shieldsio/shields:next instead of building my own, and drone seemed to be working correctly. You can close the original issue (#4685). as "fixed" now. Thanks for the help!

No worries, thanks for following up and letting us know!


[10.x] Add Lateral Join to Query Builder

This PR adds lateral join methods to the query builder. I have based the methods and tests upon joinSub as the behaviour is somewhat similar.
Lateral joins have been supported in PostgreSQL for a long time (since 9.3), and are also supported in MySQL since 8.0.14.
The lateral joins are a bit similar to a subquery join, as the right-hand table is expressed as a subquery. However the right-hand expression is executed for every row, which opens up for new use cases. It is particularly useful for joining in the top 'N' rows related to the main query. In example:
select * from "users"
join lateral (
    select * from "contacts"
    where "contracts"."user_id" = "users"."id"
    order by "contracts"."value" desc
    limit 5
) as "sub"
    on true

I think we would normally want to keep that translation to "lateral" SQL syntax in the query "grammar" layer.

@taylorotwell Yes, that is probably best.
Since "lateral" is not a join type, and should be placed after the "join" keyword, it might be necessary with an extra property in the JoinClause class. Either a string, or a $lateral boolean.
The "on true" translation should probably also go into the "grammar" layer.

SQL server has Cross Apply And Outer Apply.
CROSS APPLY = lateral join
Outer Apply = left lateral join
Don't think it supports right lateral join
https://www.mssqltips.com/sqlservertip/1958/sql-server-cross-apply-and-outer-apply/

@crissi Postgres and MySQL does not support right lateral join neither (it would make no sense). My mistake. Removing it from the PR now.
I will look into translating it into cross/outer apply for SQL server as well.

I have moved "lateral" and "on true" translation into the grammar layer now, and added support for SQL server. I have tested joinLateral with PostgreSQL 16, MySQL 8 and SQL server 2022 in a samle app.
I am a bit uncertain of two things in the PR:

I added a new boolean $lateral to the JoinClause class (with default false). This feels a bit dirty. Any better suggestions?
I added a joinLateral to the grammar layer, which accepts the current query builder and current join clause. This leads to code duplication for generating $tableAndNestedJoins, but provides more flexaility for each language translation. However it might be better to just pass the compiled $tableAndNestedJoins as a string, instead of the whole join clause?

Just wanna chime in because MariaDB hasn't added support for lateral join yet. And because Laravel considers MySQL and MariaDB as same RDBMS under mysql driver.

Just wanna chime in because MariaDB hasn't added support for lateral join yet. And Laravel considers MySQL and MariaDB as same RDBMS under mysql driver.

I know. MariaDB uses the same translations as MySQL, so it will fail with a syntax error as it is not supported yet. I do believe they are planning on implementing support though.

👍 for this feature. @tpetry and I were just talking about it last week. We can also use lateral joins to improve the performance of some of Laravel's own queries.
Tobias has already implemented lateral joins for PostgreSQL in his laravel-postgresql-enhanced package and I would take inspiration from his code:

I think his method names (joinSubLateral() etc.) are more consistent since lateral joins are a special type of joinSub().
Tobias found a way to implement it without changing the JoinClause class: https://github.com/tpetry/laravel-postgresql-enhanced/blob/master/src/Query/BuilderLateralJoin.php#L20
Can we use the same approach? The new $lateral parameter isn't ideal.
Another feature of Tobias' implementation is that you can add custom join constraints (on a.foo = b.bar instead of only on true): https://github.com/tpetry/laravel-postgresql-enhanced/blob/master/src/Query/BuilderLateralJoin.php#L37

I also think it would be good to have integration tests (under tests/Integration/Database).

@staudenmeir Good tip! I will checkout this package in detail and draw some inspiration from there.

I agree that joinSubLateral etc. are more consistent. I will change the method names.
Tobias' implementation would put the translation to "lateral" SQL syntax back into the query builder, and out of the grammar layer (where @taylorotwell requested it should be). This would make it more difficult to translate to cross apply / outer apply for SQL server in at meaningful way. I agree that the new $lateral parameter isn't ideal, but I have not found another way of passing "lateral" to the grammar (as it is independent of the join $type). Any suggestions on how to solve this are welcome.
I thought of custom join constraints, instead of only on true. I didn't think they would be used, so I decided to drop the extra parameters for the methods. I can add support for this with a default to on true.

@staudenmeir I am looking into custom join constraints (on a.foo = b.bar). SQL servers cross apply / outer apply don't support this, so these constraints will cause an error (or will have to be removed).
I tested lateral joins with custom constraints outside the subquery in Postgres. The results are the same as when I put the constraints inside the subquery. Performance also seems to be about the same.
Are there any use cases where putting the constraints outside the subquery provides an advantage? If not, I am afraid of just adding in unnecessary complexity that can cause confusion.

There's not really any benefit of using a join condition compared to just always using ON true. But I am not sure anymore whether there was a reason for the join condition for the lateral left join. Or whether i just did it that way to fit to the other join methods.
Would be great if you could build the API to be the same as mine (when using the same name) to not break my package. You could e.g. only use the first two params (and always do ON true).

@tpetry I am leaning against dropping the join conditions then, to keep it simple and consistent across different SQL implementations.
We have three choices to not break your current implementation in tpetry/laravel-postgresql-enhanced:

Keep the parameters, but ignore them and always do on true (I would like to avoid that)
Revert to my original method names, so they don't collide (joinLateral and leftJoinLateral)
Merge this against the 11.x branch (instead of 10.x) and do a breaking change

I would suggest these three methods:

crossJoinSubLateral($query, string $as)
leftJoinSubLateral($query, string $as)

They fit to my implementation as I only add some parameters - which I believe are not even usefull. The joinSubLateral implementation of you with type = inner could even be dropped as I doesn't make any things. A lateral join is always used in a cross join behaviour, either by using a cross join (with parameters in the subquery) or by using a join condition.
So it would make the concept more easy by saying that the join target is always a subquery that needs to apply the filters and all results are used - as expected.

@tpetry @staudenmeir I suggest reverting to joinLateral and leftJoinLateral, to keep the methods separate from the laravel-postgresql-enhanced package. That way, users can decide to switch from the package methods to builtin methods.
If I drop the joinSubLateral implementation with $type = 'inner' I will have to duplicate code in leftJoinSubLateral. I don't see a good way to keep joinSubLateral without breaking the package (I would have to add unused parameters), so I would rather rename it.
A lateral join in its simplest form is join lateral (sql subquery here) as "q" on true) (inner join). I think joinLateral reflects this in a simple way. joinSubLateral is a bit more descriptive, but collides with the package.
I would also like to avoid using "cross" in the method names, unless we explicitly include a cross join method. A lateral join is always used in a cross join behaviour, but you would probably write the SQL as join lateral or inner join lateral. I think a separate cross join method will be redundant.

Converting this to draft until the discussion is ironed out. Please mark as ready for review when you're ready for me to take a look.

@Bakke I had another idea for the $lateral parameter: A LateralJoinClause subclass of JoinClause
IMO, that's a better solution and "more OOP". The class would be empty, but compileJoins() can use detect lateral joins.

@staudenmeir I rewrote the code to use a JoinLateralClause class instead now.
@dkulyk I left this change as a separate commit. As a reviewer I thought you could decide if you like this solution better than the bool $lateral approach.

Thanks. Can you please add integration tests? The queries should be tested against actual databases.
Should I create separate LateralJoinTest.php for MySQL, Postgres and SQL server under tests/Integration/Database?

Yes, please.

@staudenmeir I added some simple integration tests now. They are skipped for MySQL < 8.0.14 and MariaDB.

@staudenmeir Great, thanks!
Marking it as ready for review so @taylorotwell can look over it as well

@staudenmeir I made a small change to the integration tests. limit is changed to 2 and assertCount is used to check the number of returned rows. I think it makes more sense to test that limit actually can control the number of returned rows (main query rows X subquery rows).

Thanks!

@Bakke can you send a PR to laravel/docs for this?

@taylorotwell Yes, of course! I will create the PR as soon as possible.


fix: read chunk data only right before sending

This way we are not keeping the whole file in memory which may fail on large files.
Closes #5

This is great thanks a lot @troggy !
This is a breaking change as the MultipartUploadChunk is user facing in some custom handlers, but as stated in the README, this module in its early phase (0.x.x) is subject to breaking changes so I think it's fine.
It makes me think that we definitely need to have some testing on this repo to avoid these kind of situations to go un-noticed.

I added a breaking change label for people to filter out what did change lastly. One on the 1.x.x versions, semver will apply.
I'll merge this now and release right after.


Request sent 'identity' grpc-encoding value with compressed message.

Following the tutorial and talking to a dart server, I get
Request sent 'identity' grpc-encoding value with compressed message.

on Windows 64, Unity Editor Windows 64 and Linux 64.
Does anybody have a workaround?

Using
var cl = new System.IO.Compression.CompressionLevel();

and giving to GrpcChannelOptions
CompressionProviders = new List<ICompressionProvider>() { new GzipCompressionProvider (cl) }

did not make a difference
CompressionProviders = new List<ICompressionProvider>()

also did not make a difference.

It seems issue is on dart side; I will keep this open until issue is solved, then close.

This PR fixes the issue.
https://github.com/grpc/grpc-dart/pull/692


Squash Merge will generate duplicate commit messages

Please see the picture below. Squash Merge will generate two identical commit messages. I think it’s enough to have one of this message. When I use square merge on github, only one commit message will be generated.

@lafriks
Hi,Will you fix this problem soon? I hope that the function of square merge is the same as GitHub, with the title as the commit message, and other information should not be automatically generated

@ZhouJiaZhi we are volunteers and don't get paid for our work on Gitea so we can't guarantee a timeline

This is a duplicate of #12365. There's an open PR #13071 which would use the PR title and description as proposed commit message for a squash merge, instead of an aggregation of the individual commit messages. I think that's a good idea.


chore: Remove bower support

Closes #133
I also changed line 173 (156) to show a correct command to launch enduro after theme installation.

awesome, thank you


Update README.md — edits "vision" section to remove some hype (written by Chat-GPT)

I told ChatGPT to "rewrite the following paragraph but remove the oversold promises and hype language" and here's what I got

Don't see an improvement here.


how to implement logout

Hi
thanks a lot for coming up with this library, just wondering how to implement logout using django-graphql-jwt :)
Cheers

Thanks @Shuliyey :)
the JWT token has an expiration time (issued + JWT_EXPIRATION_DELTA) and will be invalid after that time.
https://github.com/flavors/django-graphql-jwt/wiki/Token-expiration
At the moment, there is no way to invalidate a token from server side before its expiration time.

@Shuliyey save token in frontend (local storage). When user clicks Logout simply remove token from local storage. Is it what you need?

Hello, @mongkok I'm sorry, but what if user logged out and somebody get that token and use it for login. Don't you think that it isn't secured enough?

Hi @pythoneast ,
I agree, expiring the token is not enough, but it is not easy to design a common solution to invalidate a token after a logout or password change.
GetBlimp/django-rest-framework-jwt has very interesting discussions related to this:

https://github.com/GetBlimp/django-rest-framework-jwt/issues/385
https://github.com/GetBlimp/django-rest-framework-jwt/issues/105

@pythoneast JWT is stateless, so it is up to you to write all infrastructure to track logout process, ie:

user logs in -> store generated token in DB;
user sends query -> check token in DB;
user logout -> remove generated token from DB.

Here are some revocation strategies implemented by a similar library devise-jwt. https://github.com/waiting-for-dev/devise-jwt#revocation-strategies . I personally think their JTIMatcher strategy is quite generic, and a similar strategy could be part of this library. I'd be happy to take a stab at a patch if there is interest.

Here is what I am doing atm, in case it is of interest to anyone ends up in this page:
GRAPHQL_JWT = {
    "JWT_PAYLOAD_HANDLER": "path.to.custom.jwt_payload",
    "JWT_DECODE_HANDLER": "path.to.custom.jwt_decode",
}

import binascii
import os
from graphql_jwt.utils import get_user_by_payload
from graphql_jwt.utils import jwt_decode as graphql_jwt_decode
from graphql_jwt.utils import jwt_payload as graphql_jwt_payload
from jwt import MissingRequiredClaimError

class InvalidJwtIdError(InvalidTokenError):
    pass

def generate_jti():
    return binascii.hexlify(os.urandom(32)).decode()

def jwt_payload(user, context=None):
    payload = graphql_jwt_payload(user, context)
    payload["jti"] = user.jti
    return payload

def jwt_decode(token, context=None):
    payload = graphql_jwt_decode(token, context)
    user = get_user_by_payload(payload)
    _validate_jti(payload, user)
    return payload

def _validate_jti(payload, user):
    if not user.is_authenticated:
        return
    if user.jti is None:
        return
    if "jti" not in payload:
        raise MissingRequiredClaimError("jti")
    if payload["jti"] != user.jti:
        raise InvalidJwtIdError("Invalid JWT id")

where I introduced a jti field to the User model as:
def generate_jti():
    return binascii.hexlify(os.urandom(32)).decode()

    jti = models.CharField(
        _("jwt id"),
        max_length=64,
        blank=False,
        null=False,
        editable=False,
        default=generate_jti,
        help_text=_("JWT tokens for the user get revoked when JWT id has regenerated."),
    )

. This way, for a logout mutation, I am regenerating the JTI, effectively revoking access to all JWTs created using the old JTI as:
class LogoutUser(graphene.Mutation):
    id = graphene.ID()

    @classmethod
    def mutate(cls, root, info, **kwargs):
        user = info.context.user
        user.jti = generate_jti()
        print(user.jti)
        user.save()

        return cls(id=user.id)

Hope this is helpful for someone. And definitely let me know if you spot any problems/errors, and/or have suggestions for improvements.

Oh, though I also have my sessions disabled for the graphql endpoint. I am guessing if you still have your sessions enabled, even though the JWT tokens get revoked the logged-in user in the session would stay as is.
In order to disable sessions on graphql I have custom AuthenticationMiddleware, SessionMiddleware, and MessageMiddleware implemented as:
# settings.py

MIDDLEWARE = [
    "django.middleware.cache.UpdateCacheMiddleware",
    "django.middleware.security.SecurityMiddleware",
    "path.to.custom.SessionMiddleware",
    "corsheaders.middleware.CorsMiddleware",
    "django.middleware.common.CommonMiddleware",
    "django.middleware.csrf.CsrfViewMiddleware",
    "path.to.custom.AuthenticationMiddleware",
    "path.to.custom..MessageMiddleware",
    "django.middleware.clickjacking.XFrameOptionsMiddleware",
    "whitenoise.middleware.WhiteNoiseMiddleware",
    "django.middleware.cache.FetchFromCacheMiddleware",
]

# middleware.py

from django.contrib.auth.middleware import (
    AuthenticationMiddleware as DjangoAuthenticationMiddleware,
)
from django.contrib.auth.models import AnonymousUser
from django.contrib.messages.middleware import (
    MessageMiddleware as DjangoMessageMiddleware,
)
from django.contrib.sessions.middleware import (
    SessionMiddleware as DjangoSessionMiddleware,
)

class _GraphqlDisabledMiddlewareMixin:
    @staticmethod
    def is_graphql_request(request):
        return request.path_info.startswith("/graphql")

    def process_request(self, request):
        if self.is_graphql_request(request):
            return
        try:
            return super().process_request(request)
        except AttributeError:
            return

    def process_response(self, request, response):
        if self.is_graphql_request(request):
            return response
        try:
            return super().process_response(request, response)
        except AttributeError:
            return response

class AuthenticationMiddleware(
    _GraphqlDisabledMiddlewareMixin, DjangoAuthenticationMiddleware
):
    def process_request(self, request):
        if self.is_graphql_request(request):
            request.user = AnonymousUser()

        return super().process_request(request)

class SessionMiddleware(_GraphqlDisabledMiddlewareMixin, DjangoSessionMiddleware):
    pass

class MessageMiddleware(_GraphqlDisabledMiddlewareMixin, DjangoMessageMiddleware):
    pass

Here is what I am doing atm, in case it is of interest to anyone ends up in this page:
# settings.py

GRAPHQL_JWT = {
    "JWT_PAYLOAD_HANDLER": "path.to.custom.jwt_payload",
    "JWT_DECODE_HANDLER": "path.to.custom.jwt_decode",
}

# utils.py

import binascii
import os
from graphql_jwt.utils import get_user_by_payload
from graphql_jwt.utils import jwt_decode as graphql_jwt_decode
from graphql_jwt.utils import jwt_payload as graphql_jwt_payload
from jwt import MissingRequiredClaimError

class InvalidJwtIdError(InvalidTokenError):
    pass

def generate_jti():
    return binascii.hexlify(os.urandom(32)).decode()

def jwt_payload(user, context=None):
    payload = graphql_jwt_payload(user, context)
    payload["jti"] = user.jti
    return payload

def jwt_decode(token, context=None):
    payload = graphql_jwt_decode(token, context)
    user = get_user_by_payload(payload)
    _validate_jti(payload, user)
    return payload

def _validate_jti(payload, user):
    if not user.is_authenticated:
        return
    if user.jti is None:
        return
    if "jti" not in payload:
        raise MissingRequiredClaimError("jti")
    if payload["jti"] != user.jti:
        raise InvalidJwtIdError("Invalid JWT id")

where I introduced a jti field to the User model as:
    # User model
    jti = models.CharField(
        _("jwt id"),
        max_length=64,
        blank=False,
        null=False,
        editable=False,
        default=generate_jti,
        help_text=_("JWT tokens for the user get revoked when JWT id has regenerated."),
    )

. This way, for a logout mutation, I am regenerating the JTI, effectively revoking access to all JWTs created using the old JTI as:
# mutations.py

class LogoutUser(graphene.Mutation):
    id = graphene.ID()

    @classmethod
    def mutate(cls, root, info, **kwargs):
        user = info.context.user
        user.jti = generate_jti()
        user.save()
        return cls(id=user.id)

Hope this is helpful for someone. And definitely let me know if you spot any problems/errors, and/or have suggestions for improvements.

Muchas gracias hombre un dios, they are very helpful to me, I work perfectly in my application.

Here is what I am doing atm, in case it is of interest to anyone ends up in this page:
# settings.py

GRAPHQL_JWT = {
    "JWT_PAYLOAD_HANDLER": "path.to.custom.jwt_payload",
    "JWT_DECODE_HANDLER": "path.to.custom.jwt_decode",
}

# utils.py

import binascii
import os
from graphql_jwt.utils import get_user_by_payload
from graphql_jwt.utils import jwt_decode as graphql_jwt_decode
from graphql_jwt.utils import jwt_payload as graphql_jwt_payload
from jwt import MissingRequiredClaimError

class InvalidJwtIdError(InvalidTokenError):
    pass

def generate_jti():
    return binascii.hexlify(os.urandom(32)).decode()

def jwt_payload(user, context=None):
    payload = graphql_jwt_payload(user, context)
    payload["jti"] = user.jti
    return payload

def jwt_decode(token, context=None):
    payload = graphql_jwt_decode(token, context)
    user = get_user_by_payload(payload)
    _validate_jti(payload, user)
    return payload

def _validate_jti(payload, user):
    if not user.is_authenticated:
        return
    if user.jti is None:
        return
    if "jti" not in payload:
        raise MissingRequiredClaimError("jti")
    if payload["jti"] != user.jti:
        raise InvalidJwtIdError("Invalid JWT id")

where I introduced a jti field to the User model as:
    # User model
    jti = models.CharField(
        _("jwt id"),
        max_length=64,
        blank=False,
        null=False,
        editable=False,
        default=generate_jti,
        help_text=_("JWT tokens for the user get revoked when JWT id has regenerated."),
    )

. This way, for a logout mutation, I am regenerating the JTI, effectively revoking access to all JWTs created using the old JTI as:
# mutations.py

class LogoutUser(graphene.Mutation):
    id = graphene.ID()

    @classmethod
    def mutate(cls, root, info, **kwargs):
        user = info.context.user
        user.jti = generate_jti()
        user.save()
        return cls(id=user.id)

Hope this is helpful for someone. And definitely let me know if you spot any problems/errors, and/or have suggestions for improvements.

Where should I create the utils.py file? And should I include it somewhere? Sorry, I'm new to Django. This information would help me complete the implementation.

Here is what I am doing atm, in case it is of interest to anyone ends up in this page:
# settings.py

GRAPHQL_JWT = {
    "JWT_PAYLOAD_HANDLER": "path.to.custom.jwt_payload",
    "JWT_DECODE_HANDLER": "path.to.custom.jwt_decode",
}

# utils.py

import binascii
import os
from graphql_jwt.utils import get_user_by_payload
from graphql_jwt.utils import jwt_decode as graphql_jwt_decode
from graphql_jwt.utils import jwt_payload as graphql_jwt_payload
from jwt import MissingRequiredClaimError

class InvalidJwtIdError(InvalidTokenError):
    pass

def generate_jti():
    return binascii.hexlify(os.urandom(32)).decode()

def jwt_payload(user, context=None):
    payload = graphql_jwt_payload(user, context)
    payload["jti"] = user.jti
    return payload

def jwt_decode(token, context=None):
    payload = graphql_jwt_decode(token, context)
    user = get_user_by_payload(payload)
    _validate_jti(payload, user)
    return payload

def _validate_jti(payload, user):
    if not user.is_authenticated:
        return
    if user.jti is None:
        return
    if "jti" not in payload:
        raise MissingRequiredClaimError("jti")
    if payload["jti"] != user.jti:
        raise InvalidJwtIdError("Invalid JWT id")

where I introduced a jti field to the User model as:
    # User model
    jti = models.CharField(
        _("jwt id"),
        max_length=64,
        blank=False,
        null=False,
        editable=False,
        default=generate_jti,
        help_text=_("JWT tokens for the user get revoked when JWT id has regenerated."),
    )

. This way, for a logout mutation, I am regenerating the JTI, effectively revoking access to all JWTs created using the old JTI as:
# mutations.py

class LogoutUser(graphene.Mutation):
    id = graphene.ID()

    @classmethod
    def mutate(cls, root, info, **kwargs):
        user = info.context.user
        user.jti = generate_jti()
        user.save()
        return cls(id=user.id)

Hope this is helpful for someone. And definitely let me know if you spot any problems/errors, and/or have suggestions for improvements.

Where should I create the utils.py file? And should I include it somewhere? Sorry, I'm new to Django. This information would help me complete the implementation.

Figured it out. I just created a folder in the root folder (same directory as manage.py) called common and added the utils.py file inside it. Had to import InvalidTokenError separately. Then I was able to use from common.utils import ....
My next question is how do you construct this logout mutation? If someone could show the gql syntax, that would be helpful.

Here is what I am doing atm, in case it is of interest to anyone ends up in this page:

Hope this is helpful for someone. And definitely let me know if you spot any problems/errors, and/or have suggestions for improvements.

Hey, I did everything like you've documented here, and I am able to run the mutation logoutUser() from the graphql console in the api, but when I try to make this same mutation from my Angluar Client app, I get the following error in the response:-
{"errors":[{"message":"Django doesn't provide a DB representation for AnonymousUser.","locations":[{"line":2,"column":3}],"path":["logoutUser"]}],"data":{"logoutUser":null}}

Ok, I've finally figured out how to do this securely. The method posted by @cansin didn't work for me. I've had the errors (as posted above) and I realized that there is a much easier way to logout securely and without adjusting the models or anything.
I'm using the Django Graphql Auth. You can see their documentation for installation. The package comes with the optional refresh token. By default the token is set to expire every 5 minutes and you have to refresh the token using the additional refreshToken that you get with login. When you logout, you simply remove the token and the refreshToken from the localStorage and then use the revokeToken method to revoke the refreshToken. That way if someone has the token and the refreshToken from before the logout happened, they only have maximum of 5 minutes to do something with it. And they can't use the refreshToken to get a new token. I think this is secure enough for my use case.

Here is what I am doing atm, in case it is of interest to anyone ends up in this page:

@cansin , this was a superlative post and was exactly what I sought for a server-side Logout mutation. Thanks!
One thing I added was setting the JTI in a custom token_auth resolver. It looks something like this:
class ObtainJSONWebToken(graphql_jwt.JSONWebTokenMutation):
    user = graphene.Field(UserType)

    @classmethod
    def resolve(cls, root, info, **kwargs):
        print(f"*** USER [{info.context.user}] AUTHENTICATED - VIA JWT token_auth ***")

        info.context.user.jti = generate_jti()
        info.context.user.save()

        return cls(user=info.context.user)

what value to be given for "path.to.custom.jwt_payload" and "path.to.custom.jwt_decode"
GRAPHQL_JWT = {
"JWT_PAYLOAD_HANDLER": "path.to.custom.jwt_payload",
"JWT_DECODE_HANDLER": "path.to.custom.jwt_decode",
}

Hello, @mongkok I'm sorry, but what if user logged out and somebody get that token and use it for login. Don't you think that it isn't secured enough?

Exact, that's is what i'm talking about, this library has a very security hole. that behavior has no sense

@pythoneast JWT is stateless, so it is up to you to write all infrastructure to track logout process, ie:
1. user logs in -> store generated token in DB;

2. user sends query -> check token in DB;

3. user logout -> remove generated token from DB.

The problem is, that in Django grapql-jwt, token are not stored and the backend just limit to check if the token arrived is valid checking his expiration date, it doen't have any way of cheking if that token is not valir anymore


I am using flutter image gallery plugin that fetches all the images of gallery but the issue occurs in android and ios is that when I load big image in grid view it does not load it but when I load small image it loads it.

Steps to Reproduce

Run flutter create bug.
Update the files as follows: ...
...

Expected results:
Actual results:

Logs

[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 6.1.7601], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[√] Android Studio (version 3.3)
[√] VS Code, 64-bit edition (version 1.24.1)
[√] Connected device (1 available)

I am stuck in this problem from couple of days so please help me if anyone has any solution.

Hi @ubaidsuhail
Image_gallery is a 3rd party plugin, consider to open the issue in the plugin's repository or use another plugin instead.
Closing, as this isn't an issue with Flutter itself,
if you disagree please write in the comments and I will reopen it
Thank you

No I don't think so it is a plugin issue because plugin show all the images
path .May be the issue is in grid view which can not handle big images
On Monday, March 30, 2020, Vladyslav Bondarenko<EMAIL_ADDRESS>wrote:

Hi @ubaidsuhail https://github.com/ubaidsuhail
Image_gallery https://pub.dev/packages/image_gallery is a 3rd party
plugin, consider to open the issue in the plugin's repository
https://github.com/flutter-devs/image_gallery/issues or use another
plugin instead.
Closing, as this isn't an issue with Flutter itself,
if you disagree please write in the comments and I will reopen it
Thank you
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/flutter/flutter/issues/53481#issuecomment-606037342,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AGN62LLLOYM6ZFX6CUQ4QQTRKCUYPANCNFSM4LVRIKZQ
.

@ubaidsuhail
I tried

with that code
 import 'package:flutter/material.dart';

void main() => runApp(MaterialApp(home: MyApp()));

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: GridView.count(
        crossAxisCount: 3,
        children: <Widget>[
          Image.asset('assets/img3.jpg'),
          Image.network(
              'http://wallpapersquad.net/pics/73-mac-os-sierra-color-splash-purple-wallpaper.jpg')
        ],
      ),
    );
  }
}

It loads the image, although it's 6 MB and 5120 × 2880.
Tried with Android 10 emulator and iOS 13.4 simulator.
Could you provide code sample to reproduce your case without using 3rd party plugin? (together with images, if it's an issue with using from assets but not from network)

I am basically fetching a file from gallery.Image.file is used .There are
lot of images that are fetching and small images are uploading but big
images are not
On Tuesday, March 31, 2020, Vladyslav Bondarenko<EMAIL_ADDRESS>wrote:

@ubaidsuhail https://github.com/ubaidsuhail
I tried
with that code
import 'package:flutter/material.dart';
void main() => runApp(MaterialApp(home: MyApp()));
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@override
Widget build(BuildContext context) {
return Scaffold(

  body: GridView.count(

    crossAxisCount: 3,

    children: <Widget>[

      Image.asset('assets/img3.jpg'),

      Image.network(

          'http://wallpapersquad.net/pics/73-mac-os-sierra-color-splash-purple-wallpaper.jpg')

    ],

  ),

);

}
}
It loads the image
http://wallpapersquad.net/pics/73-mac-os-sierra-color-splash-purple-wallpaper.jpg,
although it's 6 MB and 5120 × 2880.
Tried with Android 10 emulator and iOS 13.4 simulator.
Could you provide code sample to reproduce your case without using 3rd
party plugin? (together with images, if it's an issue with using from
assets but not from network)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/flutter/flutter/issues/53481#issuecomment-606563180,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AGN62LLO3DBTZZIEZ4NUMZLRKHGHHANCNFSM4LVRIKZQ
.


Missing data policy

Before making a final decision, a comparison should be made for sure;
What are the effects of excluding incomplete proxies (those that have missing data for at least 1 country) for a given year?
I expect the effects to be significant and for now I'm leaning towards excluding such proxies, but we should test.

For a sample of 8 cases

I'm closing the issue since we decided to include the results based on both complete and incomplete sets of proxies.


Use the raw response in Reponse classes

First Check

[X] I added a very descriptive title to this issue.
[X] I used the GitHub search to find a similar issue and didn't find it.
[X] I searched the FastAPI documentation, with the integrated search.
[X] I already searched in Google "How to X in FastAPI" and didn't find any information.
[X] I already read and followed all the tutorial in the docs and didn't find an answer.
[X] I already checked if it is not related to FastAPI but to Pydantic.
[X] I already checked if it is not related to FastAPI but to Swagger UI.
[X] I already checked if it is not related to FastAPI but to ReDoc.

Commit to Help

[X] I commit to help with one of those options 👆

Example Code
class CustomEncoder():
    def encode(self, dict_data)
        return dict_data

class PhotonJSONResponse(JSONResponse):
    def __init__(self, content: typing.Any = None, status_code: int = 200, headers: dict = None, media_type: str = None,
                 background: BackgroundTask = None) -> None:
        # Fetch the untouched response in the upper stacks
        current_frame = inspect.currentframe()
        self.raw_response = None
        while current_frame.f_back:
            if 'raw_response' in current_frame.f_locals:
                self.raw_response = current_frame.f_locals['raw_response']
                break
            current_frame = current_frame.f_back

        self._encoder = CustomEncoder()
        super().__init__(content, status_code, headers, media_type, background)

    def render(self, content: Any) -> bytes:
        dict_data = self._encoder.encode(self.raw_response)
        return super().render(dict_data)

Description
I want to access the raw response that hasn't been through the json_encoder inside my response class. This is because I have custom types that are handled in a custom encoder. I have looked through the relevant fastapi code and I can't find a way to override the encoder for all requests either. As you can see in the example code I currently use reflection to fetch the raw_response in the upper stack frame, however this is not very reliable. I also can't seem to do this using an APIRoute implementation because it would require re-implementing the route handler which is messy, maybe it would be more relevant in there though.
Operating System
Windows
Operating System Details
No response
FastAPI Version
0.63.0
Python Version
3.8.12
Additional Context
No response

I think a better option here is to use the json_encoders feature from Pydantic. It allows you to map a field type with a custom function to encode it.
You can see that FastAPI does ensure it applies them in json_encodable function:
https://github.com/tiangolo/fastapi/blob/1ce16c2f40a75a4d97233bf4e331ed563eda47cf/fastapi/encoders.py#L52-L55

Except my types are not instances of BaseModels. For example, namedtuple are expressed as a list in json while I want a dictionary so I don't lose the keys information.

Well, I think you are on a very specific use-case here. My primary advise would be to first have proper Pydantic models counterpart for your internal data types, so you get all the benefits of FastAPI.
If you don't want to go that way, why not return the response object yourself in the endpoint?
from collections import namedtuple

Point = namedtuple('Point', ['x', 'y'])  # Dummy type

class CustomEncoderJSONResponse(JSONResponse):
    def render(self, content: Any) -> bytes:
        encoder = CustomEncoder()
        # At this point, content is still whatever you passed it into
        dict_data = encoder.encode(content)
        return super().render(dict_data)

@app.get("/point")
async def get_point():
    p = Point(x=3, y=2)
    return CustomEncoderJSONResponse(content=p)

First, thanks for the help. I'm not a fan of boxing in general so I don't think I'll go the route of wrapping my tuples into BaseModels. I was kind of liking the idea of simply returning the namedtuple without the overhead of creating a response too. I could make a BaseModel that behaves like a namedtuple by using the internal dict and speicying attributes at runtime but this also feels a bit hacky. I currently have a working implementation of an APIRoute implementation that bypasses the json_encoder based on a parameter. It feels a bit hacky because it goes a bit against the fastapi philosophy but its going to do for now. Thanks again !


Text extractor from image (snippet)

Description of the new feature / enhancement
I commonly find myself opening a new tab in my browser and looking up "image to text", clicking on the first link, and then going through the process of navigating whatever website I saw first. It would be nice to have a local way of copying/pasting text from an image, would also be nice if it could read from clipboard, so I don't have to save anything.
Scenario when this would be used?
Any image with text in it that needs to be copies, PDF documents, etc.
Supporting information
No response

We're currently working on this feature. It will probably ship next week.
/dup #4371


Add diode

The APIs are the same and eventually we'll get reuse with Foliage

Coverage remained the same at 100.0% when pulling 048694c607cd994da0f347b070eeab64a73e171d on add-diode into d3c3c43a99cebdbd72bd62e8d7ef9220cc31f628 on master.


scripting-support: add generate_signed_jwt native js method to script…

…ing env
Currently, it's not possible to generate a signed JWT token to use for authrozation, either through native rust functionality in the ATAC app, or through the JS scripting environment.
This PR generates a new rust-native method (so can be shared for more rust-native JWT features) to generate a signed JWT. It then creates a boa_engine compatible wrapper around that rust method to inject it in to the available scope for the JS scripts users may write.

app restructure causing some nasty merge conflicts. rebuilding on fresh branch


Cannot connect to a remote kernel

Issue Type: Bug
On trying to connect to a remote kernel, the extension says something like this:
Error 08:31:54: Failed to find & set preferred controllers [i [Error]: https://<an ip address>:8888/
	at /home/mike/.vscode-server/extensions/ms-toolsai.jupyter-2022.3.1000901801/out/extension.js:2:368403
	at processTicksAndRejections (node:internal/process/task_queues:96:5)] {
  category: 'jupyterselfcert'
}

Extension version: 2022.3.1000901801
VS Code version: Code 1.66.2 (dfd34e8260c270da74b5c2d86d61aee4b6d56977, 2022-04-11T07:49:20.994Z)
OS version: Darwin x64 21.3.0
Restricted Mode: No
Remote OS version: Linux x64 5.4.0-96-generic

System Info

Item
Value

CPUs
Apple M1 (8 x 24)

GPU Status
2d_canvas: enabledcanvas_oop_rasterization: disabled_offdirect_rendering_display_compositor: disabled_off_okgpu_compositing: enabledmetal: disabled_offmultiple_raster_threads: enabled_onoop_rasterization: enabledopengl: enabled_onrasterization: enabledraw_draw: disabled_off_okskia_renderer: enabled_onvideo_decode: enabledvideo_encode: enabledwebgl: enabledwebgl2: enabled

Load (avg)
2, 2, 2

Memory (System)
16.00GB (0.14GB free)

Process Argv
--crash-reporter-id de7537ee-b7ff-4aa6-9ac1-40d3f0a20bb2

Screen Reader
no

VM
0%

Item
Value

Remote
SSH: seraph

OS
Linux x64 5.4.0-96-generic

CPUs
Intel Xeon Processor (Icelake) (14 x 1999)

Memory (System)
13.66GB (1.09GB free)

VM
0%

A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392:30443607
pythontb:30283811
pythonvspyt551cf:30345471
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
pythondataviewer:30285071
vscod805:30301674
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
pythonvsnew555:30457759
vscscmwlcmt:30465135
cppdebugcf:30475217

The certificate for HTTPS is self-signed.

Verification steps:

Install jupyter into a python environment
Follow the directions here in order to generate a certificate (https://jupyter-notebook.readthedocs.io/en/stable/public_server.html#using-ssl-for-encrypted-communication)
Run jupyter with the following command jupyter notebook --certfile=mycert.pem --keyfile mykey.key --no-browser
It should print a URL with 'https'. Copy this to the clipboard
Start VS code
Pick the URL as your remote server for jupyter (Jupyter: Specify Jupyter server for connections)
Run a notebook

You should get a warning like so:

If you pick yes, you should be able to run a kernel.

Verified. However I did notice that we used to have a functional test for this (I remember writing it eons ago). But that test is commented out and hasn't been replaced. I'm filing an issue to replace it.


2pc: Prepare core functionality.

Local transaction support in TxPool.
TxPreparedPool uses TxConnection instead of DBConn.
Additional tests in sqlparser for 2pc usage pattern.
Prepared pool is not part of txPool. Logic between them
is managed at a higher level. TxConnection remains active
in TxPool while it's tracked in TxPreparedPool.
Added redo log functionality in TwoPC.
TxExecutor for doing transaction work, just like QueryExecutor.
Some tests for TxExecutor. More will be added.

LGTM shaping up nicely.


feat: add option to specify hosted zone ID

For cases where the automatic discovery doesn't work (e.g. when we're creating a certificate for foo.bar.com, and have a zone for bar.com that we can create the challenge records in).

@andrew-d Since this also would affect caddy-dns/route53, could you send a PR to add the new option using Caddyfile? https://github.com/caddy-dns/route53/blob/master/route53.go#L62


New version: CarnegieMellonUniversity.Alice3 version <IP_ADDRESS>

Pull request has been created with komac v2.2.1 :rocket:
Microsoft Reviewers: Open in CodeFlow

Automatic Validation ended with:

2024-06-19T04:39:03.6755107Z ##[error]Manifest Validation Failed
2024-06-19T04:39:08.7414920Z ##[section]Finishing: Validate Manifest

(Automated response - build 886.)


Develop

feat(sage_imap): enhance imap service
- enhance EmailMessage dataclass
- refactor services and more simplification
- remove side effects
- remove docstrs (later will be fix)
- restructure of directory names for better naming
- regenerate stubs
- add uid feature also
- now email message can grab sequence number and uid
- now size of emails is added
- enhance email iterator

Tests are not working. On next commits we will fix tests.


Prevent EmbeddedKafkaBroker exiting the JVM

See https://github.com/spring-projects/spring-kafka/issues/194
See https://github.com/spring-projects/spring-kafka/issues/345
See https://github.com/gradle/gradle/issues/11195
cherry-pick to 2.4.x, 2.3.x, 2.2.x, 1.3.x

Cherry-picked to 2.4.x & 2.3.x.
Back-ported to 2.2.x as https://github.com/spring-projects/spring-kafka/commit/9e5611105903c46058832d1c714d80732bff243e after fixing conflicts. (With subsequent fix: https://github.com/spring-projects/spring-kafka/commit/c43c2dc97d81a9dee5dfe71245c7aaa87187c4b1).
Back-ported to 1.3.x as https://github.com/spring-projects/spring-kafka/commit/c9443ee87e87780882851b73392c54eda7ef23e0 after copying the fix into an appropriate KafkaEmbedded class in this version.


error while compiling last version

Describe your bug here.
when compiling the last version of OS engine i get this error:
source/FunkinLua.hx:346: lines 346-350 : Int should be Bool
source/FunkinLua.hx:346: lines 346-350 : ... For function argument 'f'
how to fix it??
Command Prompt/Terminal logs (if existing)
No response
Are you modding a build from source or with Lua?
Source
What is your build target?
Windows
Did you edit anything in this build? If so, mention or summarize your changes.
no, i just compile first the engine before do my changes

Hey fam, I have a fix that worked for me, basically just uninstall linc_luajit by putting this into your cmd/powershell:
haxelib remove linc_luajit
Then you just need to reinstall it within cmd/powershell:
haxelib git linc_luajit https://github.com/nebulazorua/linc_luajit

thank you, it works perfectly


Use mode='constant' in numpy.pad usage

Description
A couple of changes snuck by that use np.pad without a mode= keyword argument, which is not valid in NumPy 1.16 and earlier. See #645. This adds the missing kwarg in those calls.
Type of change

[x] Bug-fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update

References

How has this been tested?

[ ] example: the test suite for my feature covers cases x, y, and z
[ ] example: all tests pass with my change

Final checklist:

[x] My PR is the minimum possible work for the desired functionality
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[ ] I have added tests that prove my fix is effective or that my feature works

Thanks @jni!  I just encountered this issue with an older numpy install


Return undefined or null if an item was not found

By the way: This is a much needed and amazing library.
I will use it to create openAPI-Specification „on the fly“, by intercepting all requests in an express middleware and turning these into an openAPI document just by using the api.
Unfortunately my code is full of try/catch, since I have to check if a path/operation entry already exists. A simple check for „false“ would greatly improve my code.

Hey,
Sorry that I took so long to answer.
This is a great idea, I plan to add a default parameter to the get method so you can choose what to return if it's not found :)


Autoselect local port for debug port-forward

User Story

As a user, I want to be able to simultaneously debug two components at the same time without manually selecting local ports.

Acceptance criteria

odo should use fixed default port as a default local port
if the default port is not available it should automatically select an available port

notes
Feature request: in https://github.com/openshift/odo/issues/2459
more details in https://github.com/openshift/odo/issues/2459#issuecomment-571548278

from  #2459
/triage ready
/area debug
/priority medium


Force SW update on refresh/boot

According to this Google documentation regarding the SW lifecycle sw updates are checked once every 24 hours. Is there a way to force the update and/or changing the max-age value?

you can tie your SW to a version or git commit to force it to expire. We use our package.json version value for dockyard.com

Thanks @bcardarella! I guess you mean manually triggering navigator.serviceWorker.register right? I can see doing this in different programmatic ways. We currently check for our latest git commit hash to prompt the user to refresh the page, I guess we can substitute refreshing for updating the SW... pretty straightforward 😄
Just wondering how do you handle it in dockyard.com using package.json version? Do you have a code snippet/addon?
Regards!

this addon has those strategies built in: https://github.com/DockYard/ember-service-worker/blob/2b42ecc0f257d59be595268078e78d4f2d9ab60a/lib/index-file.js#L15-L17

@bcardarella awesome! We might consider versionStrategy: 'every-build' as well
Thanks!

:+1:

Cross refference (pls ignore): Handle SW updates correctly - https://github.com/ecaresoft/nimbox/issues/572


404 on Read the docs site

Going to the PCB assembly on read the docs gives a 404 Page not found.

@sethfischer tagging you in case you know how to solve this one. If you don't have time I can try taking a look.

@Achllle I'm happy to take a look. Please allocate to me.


extra_container_definitions cpu reservation

Setting container_cpu in extra_container_definitions variable causes error.
module "datadog_fargate_container_definition" {
  source  = "cloudposse/ecs-container-definition/aws"
  version = "v0.41.0"

  container_name  = "datadog-agent"
  container_image = "datadog/agent:latest"

  container_memory_reservation = 256
  container_cpu                = 10

  essential = true

  secrets = [
    {
      name      = "DD_API_KEY"
      valueFrom = "${local.atlantis_token_prefix}/datadog/api"
    }
  ]

  environment = [
    {
      name  = "ECS_FARGATE"
      value = "true"
    }
  ]
}

module "atlantis" {
  source  = "terraform-aws-modules/atlantis/aws"
  version = "2.26.0"

  name = "atlantis"

  # DNS
  route53_zone_name = "example.com"

  # Atlantis
  atlantis_image              = "${aws_ecr_repository.atlantis.repository_url}:${local.atlantis_version}"
  extra_container_definitions = [module.datadog_fargate_container_definition.json_map_object]
  atlantis_github_user        = "atlantis"
  atlantis_github_user_token  = "${var.atlantis_github_user_token}"

  atlantis_hide_prev_plan_comments = "true"

  ecs_task_cpu    = 512
  ecs_task_memory = 1024

  allow_repo_config = "true"

  custom_environment_variables = [
  ]

  custom_environment_secrets = [
  ]

  tags = {
    Application = "atlantis"
    Env         = "dev"
  }
}

Error: ClientException: The sum of all container 'cpu' values cannot be greater than the value of the task 'cpu'.

Math might be hard here, perhaps atlantis_container_cpu could be separated from ecs_task_cpu to make the containers configurable separately from the fargate size?

I mentioned this in the PR when I added the extra_container_defintions I should have realized that this would be an issue sooner rather than later. I can open up a PR to extend this.


Support Python 3.9

This required some compromises to get it working.

Addresses https://github.com/dmayo3/mocksafe/issues/20

https://test.pypi.org/project/mocksafe/0.4.0a0/


fix: test for root containers on hast to html

Description
Previously on htmlToHast we were always getting the children of the resulting AST and returning them as a root. That would work greatly when the input HTML had multiples elements and no single root HTML element. The problem is when the input HTML would already have a single root element, we would take the children of it anyway, and ignore the element itself. Example:
/*
  Because there are multiple elements without an wrapping container, hast would
  return an AST with the first node being `type: root` and the children being the elements:

  { type: 'root', children: [ { type: 'element', tagName: 'p' }, { type: 'element', tagName: 'p' } ]}

  Only in this scenario should we take the children and the returning AST
*/
htmlToAst(`<p></p>  <p></p>`)

/*
  In this case, because the HTML already has a single root element, hast would return
  that element as the first node, without wrapping it on a `type: root` node

  { type: 'element', tagName: 'p' children: [ { type: 'element', tagName: 'em', ... }, { type: 'element', tagName: 'h3', ... } ]}

  In this scenario, we should return the element itself instead of it's children
*/
htmlToAst(`

    Foo

Bar

`)

How to test

Tests should be green

Development checks

[x] Add changeset according to guidelines (if needed)
[x] Read CONTRIBUTING.md and Component API principles
[x] Make sure that additions and changes on design follow Toptal's BASE design, and it's been already discussed with designers at #-base-core
[x] Annotate all props in component with documentation
[x] Create examples for component
[x] Ensure that deployed demo has expected results and good examples
[x] Ensure the changed/created components have not caused accessibility issues. How to use accessibility plugin in storybook.
[x] Self reviewed
[x] Covered with tests

Breaking change

[-] codemod is created and showcased in the changeset
[-] test alpha package of Picasso in StaffPortal

All development checks should be done and set checked to pass the
GitHub Bot: TODOLess action

PR commands

List of available commands:

@toptal-bot run package:alpha-release - Release alpha version
@toptal-anvil ping reviewers - Ping FX team for review

PR Review Guidelines

When to approve? ✅
You are OK with merging this PR and

You have no extra requests.
You have optional requests.

Add nit: to your comment. (ex. nit: I'd rename this variable from makeCircle to getCircle)

When to request changes? ❌
You are not OK with merging this PR because

Something is broken after the changes.
Acceptance criteria is not reached.
Code is dirty.

When to comment (neither ✅ nor ❌)
You want your comments to be addressed before merging this PR in cases like:

There are leftovers like unnecessary logs, comments, etc.
You have an opinionated comment regarding the code that requires a discussion.
You have questions.

How to handle the comments?

An owner of a comment is the only one who can resolve it.
An owner of a comment must resolve it when it's addressed.
A PR owner must reply with ✅ when a comment is addressed.

@toptal-anvil ping reviewers


Bulk require

Is there any way to require directories , something like https://www.npmjs.com/package/bulkify

http://webpack.github.io/docs/context.html covers some of this, basically you can called require.context('./things', regex).keys() and then require those keys

That seems to be good , thanks

This unfortunately breaks server-side.  For an isomorphic app, is there a way to have require.context work?


Time consumption is not constant during the pend and unpend operation with 0(1) pending queue

Time consumption is not constant during the pend and unpend operation with pending queue
while WAITQ_SCALABLE Configuration enabled.
As per expectation operations should happen in constant time to meet the O(1)
time complexity.
Measurement done with the help of #11650
Steps to reproduce the behavior:
cd tests/kernel/pipe/pipe_api/
mkdir build
cd build
cmake -D BOARD=qemu_x86 -GNinja ../
ninja run
Console Output:
starting test - test_bench
time spent during pending for thread1  444114
time spent during pending for thread2  90650
time spent during pending for thread3  102716
time spent during pending for thread4  34068
time spent during unpend of thread 214068
time spent during unpend of thread 4808
time spent during unpend of thread 50190
time spent during unpend of thread 28642
PASS - test_bench
Additional context
Tried to measure the time while CONFIG_SCHED_MULTIQ is enabled and we get the below values.
time spent during pending for thread1  466
time spent during pending for thread2  415
time spent during pending for thread3  130
time spent during pending for thread4  65
time spent during unpend of thread 1104
time spent during unpend of thread 16
time spent during unpend of thread 16
time spent during unpend of thread 16
PASS - test_bench
Unpend operation is constant while CONFIG_SCHED_MULTIQ is enabled.

@andyross, @andrewboie: FYI.

WAITQ_SCALABLE is O(log2(N)) in the number of threads.  MULTIQ is constant time (but has a very strict limit on the number of priorities).  DUMB is O(N).
The scatter seems very high though, I'll take a look.  Note that some of the MULTIQ numbers seem inapprioriately fast -- I really doubt you can get a thread unpended in 16 cycles even if it's a simple list remove.

OK, took a look at the submitted code, but didn't get a chance to run it.
This isn't really testing anything useful.  When someone says "O(N)"
or "O(1)" or whatever, they're talking about scaling behavior as the
number of objects (suspended/active threads in this case) changes.
This test just tries four threads.  If you want to measure scaling,
you have to do it with dozens to thousands.
Also, it's hitting an inverse scaling problem.  Every time it pends a
thread it removes it from the scheduler run queue but adds it to a
waitq.  So as your scheduler should be getting faster your waitq is
getting slower, and you don't know what you're measuring.
What I'm getting looking at the numbers above:

There's way too much jitter.  These operations should be relatively deterministic (though the rbtree backend of SCALABLE has different code paths and won't be exactly the same every time).

The rbtree numbers seem shockingly high (they should be in the hudreds-to-low-thousands of instructions), and the multiq numbers seem too low in a few cases.

Can you repeat the test on real hardware?  I'm wondering if our newer qemu version is a little bouncy when looking at the TSC (which it tries to slave to real host time via various tricks).


Add reset command

This pull requests adds a new "reset" command, which allows users to reset Vortex's settings, such as Automod & strikes.
The reset command could be used by all the users that have been asking how to reset Vortex's settings in the support channel.

LGTM i think

This pull request is still a work in progress.

You could change this method to public if you want. Might want to wait for a reply of @jagrosh whether caches should be kept.
https://github.com/jagrosh/Vortex/blob/28213bfaae0db819b1841c66d8c82c85f0039d12/src/main/java/com/jagrosh/vortex/database/managers/GuildSettingsDataManager.java#L347


improve commenting in build.yaml, jobs.groovy.j2

Added a lot of documentation about the build.yaml and the jobs.groovy.j2

Thanks, these docs look really helpful. Please feel free to merge after making the suggested changes and the tests all pass.


Postgres error role "postgres" does not exist on running mix ecto.create

I'm a postgres noob and when following the README.md to run this locally on my macbook.
But on running the mix ecto.create command I get below error about a role "postgres" does not exist.
I have installed postgres using brew (and started it using pg_ctl -D /usr/local/var/postgres start as brew suggests after successful install).
14:37:22.569 [error] GenServer #PID<0.516.0> terminating
** (Postgrex.Error) FATAL 28000 (invalid_authorization_specification): role "postgres" does not exist
    (db_connection 1.1.3) lib/db_connection/connection.ex:163: DBConnection.Connection.connect/2
    (connection 1.0.4) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib 3.13.2) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message: nil
State: Postgrex.Protocol
** (Mix) The database for RealWorld.Repo couldn't be created: FATAL 28000 (invalid_authorization_specification): role "postgres" does not exist

I managed to fix this issue by changing the value of the username setting in the copied config/dev.exs file (step 2 of the install. I changed it from postgres to my macos username (which is the default on macOS after install). You should change the password as well (the default password is empty so  set password: "",).
I also noted that the setting in the react-redux version of the front-end is called API_ROOT instead of API_URL as the README.md mentions. This might change between implementations; but maybe you could mention both.
I hope this helps others. As mentioned in #42 the docs could be more helpful :smile:. Would you accept a pull request of your README.md with these fixes this? I'd like to save others this half hour of their live :smile.


Weighting Logic is Wrong?

Hi, thanks for such a great project! Cool!
I have a question regarding Weighting. Let's take your example:

hat_red+10.png
hat_orange+20.png
hat_yellow+20.png
hat_green+40.png
hat_blue.png
Logically, the sum of all weights should be 100%. But in your example, it comes that blue hat will appear 100%, so all other hats have no chance to be chosen. Am I right?

After my test, it still generates other layers except for 100%, which should be a probability every time when generating, when not filling +, then there will be a high probability to appear. Another possibility is that the number of parts generated exceeds the maximum limit so other parts are selected and then continue to be generated according to +

every trait needs a number otherwise they auto split. so if you have 2 that are blank, they will share 50% of the mint. That hat_blue needs +10


how to programmatically close a window

In my application, if a user follows through the procedures, at the end, the code would spawn a JavaFX's stage and close the FXGL window.
How do I close the first window (FXGL window) without terminating the application while it's loading up the second window (a JavaFX stage) ? Currently, I have to manually close the FXGL window by clicking on the close button at the top right hand corner.
If it were done In JavaFX, I can just call firstStage.close() to close the first window and instantiate the second window with secondStage = new Stage().
Appreicate any help!

You could obtain a JavaFX Window / Stage from the game scene (something like):
Stage fxglStage = (Stage) getGameScene().getRoot().getScene().getWindow();

FXGL was designed to be a framework that wraps user code. I understand that you use it as part of a larger framework, hence some things are not trivial.

That works! Thought it would be a lot harder. Thanks!

How do I programmatically trigger the resume/exit menu to pop up in FXGL ?
I used to write my own dialog box in jfoenix but I'd like to switch to calling whatever method that's already built-in in FXGL to make it show up (normaly by hitting ESC).
Also, can that resume/exit menu be styled differently by css, etc. to match whatever theming style I have in mind ?

Currently, it isn't possible to do this directly from outside FXGL. However, you can trick FXGL into thinking that the menu key (ESC by default) was pressed:
Input input = FXGL.getInput();
input.mockKeyPress(KeyCode.ESCAPE);
input.mockKeyRelease(KeyCode.ESCAPE);

Some notes regarding FXGL states.
The input object is from PLAY state and the menu key (e.g. ESC) will respond only if called from PLAY state. When you've called the above, FXGL will enter PAUSED state, which runs in its own loop (each state has its own timer, input, view, loop, etc.).
As for styling, the issue #329 is about that mostly and hasn't been implemented yet.


Is there a way to combine containers?

Similar to merge from Kotena or parent containers in Swinject?

Hi @amccarri
There is no plan to introduce any kind of complex containers hierarchy features cause I simply don't see use cases that can not be solved with named definitions. Would be cool if you share your use case.
What I was thinking of is something very simple like collaborating containers that will be used if type is not registered in the container.

@ilyapuchka

What I was thinking of is something very simple like collaborating containers that will be used if type is not registered in the container.
I think parentInjector here https://github.com/robotlegs/swiftsuspenders/blob/master/src/org/swiftsuspenders/Injector.as is good example of that.


Link 1104 Error

I am working on a project that used libRETS of which boost filesystem is a dependency.I have created a new win32 console application and selected empty project, created a main.cpp file to include librets.h, and installed Boost 1.61 from Nuget, but when building the bare solution I get an error:
Error	LNK1104	cannot open file 'libboost_filesystem-vc140-mt-gd-1_61.lib'
Do I need to download the Boost source distribution and rebuild the library with any additional flags to b2 or can this be easily fixed with a couple settings that may need to be toggled in my project? Thank you help will be appreciated.

Usually, you shouldn't use source libraries. Use precompiled packages instead. In your case, it should be https://www.nuget.org/packages/boost_filesystem-vc140/1.61.0

Thank you for your help that solved my issue
On Jun 20, 2016 9:21 PM, "Sergey Shandar"<EMAIL_ADDRESS>wrote:

Usually, you shouldn't use source libraries. Use precompiled packages
https://github.com/sergey-shandar/getboost/blob/master/releases/1.61.md#precompiled-libraries
instead. In your case, it should be
https://www.nuget.org/packages/boost_filesystem-vc140/1.61.0
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/sergey-shandar/getboost/issues/20#issuecomment-227315806,
or mute the thread
https://github.com/notifications/unsubscribe/AEYjA8tUqkUTcYVefN_LMHODJXM0ZF3uks5qNzykgaJpZM4I5wqg
.


Trigger Agent with Values out of Events from another Agent

I have a Question about the Trigger Agent.
First my Scenario:
I have a RSS Agent that grabs RSS Entries in Events. For this Example from a Trailer Page.
In addition I have a Website Agent wich get Filmtitles I have on a Watchlist in Trakt.tv as Entries.
Now I want to set up a Trigger Agent with the Source of the RSS Agent.
But I want to have checked against my Grabbed Website Agent Events as values.
So it Triggers a Event whenever a certain Title is found in the Trailer Page.
Is this possible?
I hope my Problem it's understandable.
Regards Saboti

I'm going to close this issue.  Please reopen if you want to discuss further.


Handle error null in iam_user_not_allowed_to_create_security_group & iam_user_not_allowed_to_register_application

Describe the bug
A clear and concise description of what the bug is.
Used in CIS controls
  select
      a.id as resource,
      case
        when a.default_user_role_permissions ->> 'allowedToCreateSecurityGroups' = 'false' then 'ok'
        else 'alarm'
      end as status,
      case
        when a.default_user_role_permissions ->> 'allowedToCreateSecurityGroups' = 'false' then a.display_name || ' does not allow user to create security groups.'
        else a.display_name || ' allows user to create security groups.'
      end as reason,
      t.tenant_id
    from
      azure_tenant as t,
      azuread_authorization_policy as a;

Error: null (SQLSTATE HV000)

+----------+--------+--------+-----------+
| resource | status | reason | tenant_id |
+----------+--------+--------+-----------+
+----------+--------+--------+-----------+

Same result for
iam_user_not_allowed_to_register_application
Steampipe version (steampipe -v)
Example: v0.3.0
Plugin version (steampipe plugin list)
Example: v0.5.0
To reproduce
Steps to reproduce the behavior (please include relevant code and/or commands).
Expected behavior
A clear and concise description of what you expected to happen.
Additional context
Add any other context about the problem here.

@rajlearner17 Thanks for raising the issue.
The above query functions smoothly with a premium Azure AD, but it encounters errors when used with a free Azure AD.
Resolving this issue requires addressing it at the plugin level since the error originates from the table itself.

@khushboo9024 could you please raise an issue in the plugin to handle this error?


API addition for translations

Adds a method to check if a translation key has any registered translations.
This allows one to easily handle a missing translation key using a custom fallback.

It's not possible to know serverside whether or not a translation exists - the translatable component supports any key defined in a client resource pack as well.

It's not possible to know serverside whether or not a translation exists - the translatable component supports any key defined in a client resource pack as well.

I was thinking about plugin registered keys that are unlikely to exist on client resource packs. Perhaps, should mention this limitation in the documentation, or change the method name to better reflect that?

I was thinking about plugin registered keys that are unlikely to exist on client resource packs. Perhaps, should mention this limitation in the documentation, or change the method name to better reflect that?


Docs: How-to - Scaling - Superset

From comment:

...double check that we could override both the MySQL database and redis cache for it if it becomes too resource intensive to share with LMS/Studio

Before we can document this, we need to add some variables to tutor-contrib-aspects, and use them to support a separate MySQL db and redis cache:

SUPERSET_DB_ROOT_USERNAME: {{ MYSQL_ROOT_USERNAME }}
SUPERSET_DB_ROOT_PASSWORD: {{ MYSQL_ROOT_PASSWORD }}
SUPERSET_REDIS_HOST: {{ REDIS_HOST }}
SUPERSET_REDIS_PORT: {{ REDIS_PORT }}
SUPERSET_REDIS_PASSWORD: {{ REDIS_PASSWORD }}

can we mark this as closed: https://docs.openedx.org/projects/openedx-aspects/en/latest/technical_documentation/how-tos/production_configuration.html

I think that's enough for now and we can add to it if people have questions. Nothing has come up yet, though.


Only check eventChannel matcher if defined

The eventChannel function was enforcing the matcher function when passed 2 arguments, even though the function supports no matcher in any case.

@secobarbital  I'm merging this as is and will do the change locally (sorry but I'm working on a patch today. Thanks for the contribution!)

Thanks! Sorry for the delay, can only work on this on the weekends ;)


text-editor/highlighting: The highlighting looks weird.

Ignore the code. Just focus on the highlighting.
Info:
Theme = "catpuccin mocha"
Build = nightly

I changed inlay hints background to grayish, upgrade theme and try

I changed inlay hints background to grayish, upgrade theme and try

that looks good!

I changed inlay hints background to grayish, upgrade theme and try

what font are you using? I like it.

what font are you using? I like it.
In this screenshot I am using Berkeley Mono (it is paid font) as I was unable to use Iosevka Custom on Windows, In Mac I use custom Iosevka build https://github.com/ghishadow/ghishadow-font.  I like it.
In this screenshot I am using Berkeley Mono (it is paid font) as I was unable to use Iosevka Custom on Windows, In Mac I use custom Iosevka build https://github.com/ghishadow/ghishadow-font. Another font I like is Martian Mono https://github.com/evilmartians/mono

thanks!!!!


[python3] add features for readline and extensions

as  #39449 without the testing of modules

Thank you!


Require unsafe for receive operations on types with invalid bit patterns, like bool

12/6/2019: May be overzealous to make everything unsafe. Tentatively, we just need to make it unsafe to receive into types with invalid bit patterns, like bool and structs. We could potentially provide a "safe" version with a little overhead to check the output buffer.

Original issue: Mis-matching datatypes when performing communication results in undefined behavior.
Documentation should indicate that the unsafe here need not infect the whole code base. A routine that properly matches its own communications is itself safe. You only get unsafety if another routine incorrectly matches their own sends and receives. Ergo, it is possible to expose a safe interface on top of MPI communications, even if the atoms are unsafe.
See #51 for discussion on this.

Saw this library on HN: https://github.com/Munksgaard/session-types
Still trying to grok Session Types, but the advertising seems to be that they can provide static verification of type-safety guarantees for two communicating processes. Seems relevant.

Apologies for the super long delay. If you are still interested, I think it is not necessary to mark all communication functions unsafe. I do not think that what the MPI Standard calls "erroneous" is necessarily memory unsafe. However, the Equivalence and Buffer traits are already marked unsafe and the absence of type checking of messages has implications on what kind of types Equivalence can safely be implemented for. Namely, all types that have invalid bit patterns cannot safely implement Equivalence.

Yeah, I'll rename this to something like "Require unsafe for receive operations on bool and other types with invalid bit patterns".

This affects #52

Just catching up now on session types: doesn't this mean you have to encode everything that can be sent/received when you create the pair (or group)? That seems exceedingly impractical for most MPI jobs (where the full extent of what can be exchanged is often input-dependent and may not be a finite set).

Just catching up now on session types: doesn't this mean you have to encode everything that can be sent/received when you create the pair (or group)? That seems exceedingly impractical for most MPI jobs (where the full extent of what can be exchanged is often input-dependent and may not be a finite set).

I think so and I basically agree with your assessment, meaning we should provide an API as ergonomic as possible even without usage of such tools.
(I suspect the practicality of using session types largely depends on how well their methods of composition work on MPI communication patterns. In some weird fantasy world, one could probably build up a session type from primitive MPI calls and then match those up (at compile time) when ever a communicator is instantiated.)

Yeah, I can imagine making that composition work for toy problems, but it's hard for me to see it working for real applications, say unstructured meshes and multigrid, where you end up with communication patterns (and dynamically constructed datatypes) that can't be known at compile-time. There are some collective invariants that could perhaps be enforced at compile time -- sounds like interesting research to determine if that composition is possible.


Refs #34597 -- Avoided unnecessary constraints on reused split_exclude.

Addresses a SQL regression introduced by 8593e162c9cb63a6c0b06daf045bc1c21eb4d7c1 that is detailed in ticket-34597.
The SQL diff of this change is
--- test_ticket14511 (queries.tests.ExcludeTests):sqlite:89f10a80d7
+++ test_ticket14511 (queries.tests.ExcludeTests):sqlite:500a2087c2
@@ -161,7 +161,6 @@
                   (SELECT %s AS "a"
                    FROM "queries_employment" U1
                    WHERE (U1."title" IN (%s, %s)
-                          AND U1."id" = ("queries_employment"."id")
-                          AND "queries_employment"."employer_id" = ("queries_company"."id"))
+                          AND U1."id" = ("queries_employment"."id"))
                    LIMIT 1)))
 ORDER BY "queries_company"."name" ASC
--- test_ticket_24605 (queries.tests.TestTicket24605):sqlite:89f10a80d7
+++ test_ticket_24605 (queries.tests.TestTicket24605):sqlite:500a2087c2
@@ -25,7 +25,6 @@
               FROM "Individual" U0
               LEFT OUTER JOIN "RelatedIndividual" U1 ON (U0."id" = U1."related_id")
               WHERE (U1."id" IS NULL
-                     AND U0."id" = ("Individual"."id")
-                     AND "Individual"."id" = ("Individual"."id"))
+                     AND U0."id" = ("Individual"."id"))
               LIMIT 1))
 ORDER BY "Individual"."id" ASC
--- test_ticket_23605 (queries.tests.Ticket23605Tests):sqlite:89f10a80d7
+++ test_ticket_23605 (queries.tests.Ticket23605Tests):sqlite:500a2087c2
@@ -22,7 +22,7 @@
      FROM "queries_ticket23605a" W0
      INNER JOIN "queries_ticket23605b" W1 ON (W0."ticket23605aparent_ptr_id" = W1."modela_fk_id")
      INNER JOIN "queries_ticket23605c" W2 ON (W1."modelc_fk_id" = W2."id")
-     INNER JOIN "queries_ticket23605b" W4 ON (W0."ticket23605aparent_ptr_id" = W4."modela_fk_id")
+     INNER JOIN "queries_ticket23605b" W3 ON (W0."ticket23605aparent_ptr_id" = W3."modela_fk_id")
      WHERE (W1."field_b0" >= (%s / W2."field_c0")
             AND W1."field_b1"
             AND NOT (EXISTS
@@ -35,10 +35,9 @@
                                   WHERE NOT (U0."field_b1"
                                              AND U0."field_b0" >= (%s / U1."field_c0")
                                              AND U0."field_b0" IS NOT NULL))
-                               AND V1."id" = (W1."id")
-                               AND W1."modela_fk_id" = (W0."ticket23605aparent_ptr_id"))
+                               AND V1."id" = (W1."id"))
                         LIMIT 1))
-            AND W4."field_b1"))
+            AND W3."field_b1"))
 SELECT "queries_ticket23605aparent"."id",
        "queries_ticket23605a"."ticket23605aparent_ptr_id"
 FROM "queries_ticket23605a"
@@ -48,7 +47,7 @@
               FROM "queries_ticket23605a" W0
               INNER JOIN "queries_ticket23605b" W1 ON (W0."ticket23605aparent_ptr_id" = W1."modela_fk_id")
               INNER JOIN "queries_ticket23605c" W2 ON (W1."modelc_fk_id" = W2."id")
-              INNER JOIN "queries_ticket23605b" W4 ON (W0."ticket23605aparent_ptr_id" = W4."modela_fk_id")
+              INNER JOIN "queries_ticket23605b" W3 ON (W0."ticket23605aparent_ptr_id" = W3."modela_fk_id")
               WHERE (W1."field_b0" >= (%s / W2."field_c0")
                      AND W1."field_b1"
                      AND NOT (EXISTS
@@ -61,7 +60,6 @@
                                            WHERE NOT (U0."field_b1"
                                                       AND U0."field_b0" >= (%s / U1."field_c0")
                                                       AND U0."field_b0" IS NOT NULL))
-                                        AND V1."id" = (W1."id")
-                                        AND W1."modela_fk_id" = (W0."ticket23605aparent_ptr_id"))
+                                        AND V1."id" = (W1."id"))
                                  LIMIT 1))
-                     AND W4."field_b1")))
+                     AND W3."field_b1")))

Thanks to both of your review so far! I didn't get a change to look at this during the weekend but I should have time this week 🙇

Alright so I break the PR in four commits

The first one addresses a simple comment that was not kept up-to-date
The second one addresses the superflous foo = foo lookups that were being added in the exists clause and were identified by @shangxiao as potentially causing materialization

The SQL diff for these two commits is
--- test_ticket14511 (queries.tests.ExcludeTests):sqlite:89f10a80d7
+++ test_ticket14511 (queries.tests.ExcludeTests):sqlite:500a2087c2
@@ -161,7 +161,6 @@
                   (SELECT %s AS "a"
                    FROM "queries_employment" U1
                    WHERE (U1."title" IN (%s, %s)
-                          AND U1."id" = ("queries_employment"."id")
-                          AND "queries_employment"."employer_id" = ("queries_company"."id"))
+                          AND U1."id" = ("queries_employment"."id"))
                    LIMIT 1)))
 ORDER BY "queries_company"."name" ASC
--- test_ticket_24605 (queries.tests.TestTicket24605):sqlite:89f10a80d7
+++ test_ticket_24605 (queries.tests.TestTicket24605):sqlite:500a2087c2
@@ -25,7 +25,6 @@
               FROM "Individual" U0
               LEFT OUTER JOIN "RelatedIndividual" U1 ON (U0."id" = U1."related_id")
               WHERE (U1."id" IS NULL
-                     AND U0."id" = ("Individual"."id")
-                     AND "Individual"."id" = ("Individual"."id"))
+                     AND U0."id" = ("Individual"."id"))
               LIMIT 1))
 ORDER BY "Individual"."id" ASC
--- test_ticket_23605 (queries.tests.Ticket23605Tests):sqlite:89f10a80d7
+++ test_ticket_23605 (queries.tests.Ticket23605Tests):sqlite:500a2087c2
@@ -22,7 +22,7 @@
      FROM "queries_ticket23605a" W0
      INNER JOIN "queries_ticket23605b" W1 ON (W0."ticket23605aparent_ptr_id" = W1."modela_fk_id")
      INNER JOIN "queries_ticket23605c" W2 ON (W1."modelc_fk_id" = W2."id")
-     INNER JOIN "queries_ticket23605b" W4 ON (W0."ticket23605aparent_ptr_id" = W4."modela_fk_id")
+     INNER JOIN "queries_ticket23605b" W3 ON (W0."ticket23605aparent_ptr_id" = W3."modela_fk_id")
      WHERE (W1."field_b0" >= (%s / W2."field_c0")
             AND W1."field_b1"
             AND NOT (EXISTS
@@ -35,10 +35,9 @@
                                   WHERE NOT (U0."field_b1"
                                              AND U0."field_b0" >= (%s / U1."field_c0")
                                              AND U0."field_b0" IS NOT NULL))
-                               AND V1."id" = (W1."id")
-                               AND W1."modela_fk_id" = (W0."ticket23605aparent_ptr_id"))
+                               AND V1."id" = (W1."id"))
                         LIMIT 1))
-            AND W4."field_b1"))
+            AND W3."field_b1"))
 SELECT "queries_ticket23605aparent"."id",
        "queries_ticket23605a"."ticket23605aparent_ptr_id"
 FROM "queries_ticket23605a"
@@ -48,7 +47,7 @@
               FROM "queries_ticket23605a" W0
               INNER JOIN "queries_ticket23605b" W1 ON (W0."ticket23605aparent_ptr_id" = W1."modela_fk_id")
               INNER JOIN "queries_ticket23605c" W2 ON (W1."modelc_fk_id" = W2."id")
-              INNER JOIN "queries_ticket23605b" W4 ON (W0."ticket23605aparent_ptr_id" = W4."modela_fk_id")
+              INNER JOIN "queries_ticket23605b" W3 ON (W0."ticket23605aparent_ptr_id" = W3."modela_fk_id")
               WHERE (W1."field_b0" >= (%s / W2."field_c0")
                      AND W1."field_b1"
                      AND NOT (EXISTS
@@ -61,7 +60,6 @@
                                            WHERE NOT (U0."field_b1"
                                                       AND U0."field_b0" >= (%s / U1."field_c0")
                                                       AND U0."field_b0" IS NOT NULL))
-                                        AND V1."id" = (W1."id")
-                                        AND W1."modela_fk_id" = (W0."ticket23605aparent_ptr_id"))
+                                        AND V1."id" = (W1."id"))
                                  LIMIT 1))
-                     AND W4."field_b1")))
+                     AND W3."field_b1")))

If necessary I can add extra assertion to existing tests to ensure proper SQL is generated.
As for the third and fourth ones the optimization is not as trivial as I had initially thought. Even if exclude(m2m=None) can be optimized to EXISTS(m2m rows) (which is the reported use case) things get much more complicated when dealing with exclude(m2m_possibly_null_field=None) and the two scenarios are hard to differentiate within the limited scope split_exclude receives. A larger refactor would be needed to get it to work which goes beyond the scope of this ticket until we hear back from the reporter.
If merging 1. and 2. seems acceptable for now I can close this MR and open a new one only containing these two changes to keep the discussion in this PR focused on the two other commits which be relevant in the future.

@charettes Thanks :+1: I pushed the first two commits to #16974 with a small assertion that should help avoid future regressions.

@felixxm thanks, I'll close this PR for now then as there are other areas I'm already focusing on.


Add gas comparison for ERC4626

Added gas comparison for ERC4626 contract implementations by OZ, Solmate and Solady. Results are added to README table in the corresponding section.

#2 @ecivini


Proper Benchmarking for DER and DER++

Hi!
I'm looking to add DER / DER++ results as a baseline in my paper. I'm interested in the setting where only a single pass is done through the dataset (i.e. num_epochs == 1). I was wondering if you had any advice / suggestions regarding hyperparameter selections in this setting ? Specifically alpha and beta and the learning rate. Thanks in advance :)
and great job on the library! I'm usually not a fan; I usually find them too convoluted. This one is super minimal and easy to play with 👌

Also, is there an easy way to disable data augmentations in the pipeline ? I could not find a argument for that

I ended up running a grid search over the following parameters, drawing inspiration from the best arguments reported.
'--alpha': [0.1, 0.2, 0.3, .4, .5],
'--beta': [0.25, 0.5, .75, 1],
'--lr': [0.05, 0.01, 0.1],

I'm interesting in reproducing the method on the setting observed in (Aljundi & al.), i.e. I'm running with arguments --dataset seq-cifar10 --n_epochs 1 --batch_size 10 --minibatch_size 10 and --buffer_size 200, 500, 1000.
I thought it would be good to post my results here, in case someone wanted to benchmark in a similar setting. The winning args for DER++ were
derpp     alpha=0.1  beta=0.50 lr=0.01 M=1000
derpp     alpha=0.4  beta=1.00 lr=0.01 M=500
derpp     alpha=0.4  beta=0.50 lr=0.01 M=200

(chosen by selecting best accuracy averaged over 3 runs, with --validation)
If one of the authors could double validate this or point out flaws in the methodology that would be awesome. This way I can make sure DER results are properly reported.
@JosephKJ @baraldilorenzo @mbosc @angpo

Thanks for getting back! Yea I understand the concerns about separating forgetting from underfitting, which I agree with.  Interesting discussion in the appendix, I had not examined it previously.  For what it's worth, DER++ was able to reach stronger performance under a single epoch (58%,57%,50%) for M=1K,200,100 than what was in the appendix. I'm guessing you guys didn't run another hparam search given that this was not the main setting.
Good luck with the rebuttal!

Actually I think the discrepancy in the results may be due to the batch size more than anything else. Using bs == 10 vs say 32 gives the learner more optimization steps, leading to better performance.

Thanks for the info, we look forward to reading more about it in the final paper!


Add shakespearify extension

Description

Screencast

Checklist

[x] I read the extension guidelines
[x] I read the documentation about publishing
[x] I ran npm run build and tested this distribution build in Raycast
[x] I checked that files in the assets folder are used by the extension itself
[x] I checked that assets used by the README are placed outside of the metadata folder

Hi!
Thank you for your contribution! My name is Milena and I will be reviewing it today.
I could not get your extension to work. Are you sure that the API key you need is from https://exchange.gemini.com/settings/api and not https://ai.google.dev/aistudio ? Using a key from the first is accepted with no check. Submitting a text does nothing and shows no error. Can you please check what is going on?

Hi! Thank you for your contribution! My name is Milena and I will be reviewing it today.
I could not get your extension to work. Are you sure that the API key you need is from https://exchange.gemini.com/settings/api and not https://ai.google.dev/aistudio ? Using a key from the first is accepted with no check. Submitting a text does nothing and shows no error. Can you please check what is going on?

Hi, thanks for pointing out those issues. The wrong link was a massive oversight. I have updated the extension now.
Thanks

Trying it again, I have a few comments:

Your extension cannot work without the API key, so it would make sense to keep it behind an authentication screen before letting the user use the extension. That would make that error screen with only text not needed. One example is this extension: https://www.raycast.com/CofCat/mandarin-chinese-dictionary
What does "Wise History" mean in this context? It is not clear to me what to expect from this command by just looking at its name
Your README doesn't say where to enter the key. Again, something that the first comment would address.

Could you please take a look at my comments and tell me what you think?

Trying it again, I have a few comments:

Your extension cannot work without the API key, so it would make sense to keep it behind an authentication screen before letting the user use the extension. That would make that error screen with only text not needed. One example is this extension: https://www.raycast.com/CofCat/mandarin-chinese-dictionary
What does "Wise History" mean in this context? It is not clear to me what to expect from this command by just looking at its name
Your README doesn't say where to enter the key. Again, something that the first comment would address.

Could you please take a look at my comments and tell me what you think?

Hi, are you referring to this screen as "authentication screen" from the Mandarin Chinese Dictionary extension? Because I already have the preferences screen set up.

I have edited the description for "Wise History" to be a bit more clearer, and although its purpose might not be clear at first glance, but after running the command its pretty easily understandable.
The README file already states "When you first run the extension, you will be asked a few configuration options. This is required to ensure proper functioning of the extension" and then all the config options are explained in detail. The line from README "Enter the API key generated from Google AI studio in the input box" is referring to the above line where it mentioned "you will be asked a few configuration options." So like enter the API key where asked during the setup process.

You still have access to the Wise History command even before the extension is set up, that's what I mean.
Also, how about naming it something that refers back to what the extension does? Maybe "Shakesperian Transformation History" or something like that?

It's because Wise History does not require the API Key for its functioning, I mean it would just show nothing if there's no history, and there would be no history if the user hasn't already used the Shakespearify command (which requires the key). Also, I just liked the name Wise History and it would be kind of unique or different.


Unable to deploy to Google when package version contains dots

--: updating package on Google ...
--: updating app (package) parameters ...
Using existing secret
error: Google - 3 INVALID_ARGUMENT: Resource ID [projects/583229823889/secrets/helix-deploy--pages_4.26.1] is not in a valid format.
error: aborted due to errors during updatePackage

This has implications for helix-universal, too.


Copy crashes MCEdit (Newest version only)

Title says it all, previous version works, but newest one crashes when I copy anything.

Could you please provide what OS you are using, the steps to reproduce this, and either a screenshot of the console window, your entire mcedit.log file, or both.

I didn't look much in to it, needed a quick fix so I didn't take tike to take a screenshot or anything

Could you provide it now, otherwise we will not be able to help you!

mcedit.log http://pastebin.com/ELn9Jedu

This is the MCEdit-Unified issue tracker...
To report an issue concerning MCEdit 2, please see here: https://github.com/mcedit/mcedit2/issues.


look at fetch api instead of superagent

decided that would have to shim fetch api so not really worth looking at


Skip 'Default Backup Compression' for 2005 and under versions

Issue
Check doesn't account for < SQL 2008 not having this as an instance-level option.
Additional information
Suggested modification to skip SQL versions 2005 and under (can open as PR if people agree with the change/approach):
Describe "Default Backup Compression" -Tags DefaultBackupCompression, $filename {
    $defaultbackupcompression = Get-DbcConfigValue policy.backup.defaultbackupcompression
    @(Get-Instance).ForEach{
        Context "Testing Default Backup Compression on $psitem" {
            It "Default Backup Compression is set to $defaultbackupcompression on $psitem" -Skip(Connect-DbaInstance -SqlInstance $psitem | Select-Object -ExpandProperty "Version" | Select-Object -ExpandProperty "Major" -lt 10) {
                (Get-DbaSpConfigure -SqlInstance $psitem -ConfigName "DefaultBackupCompression").ConfiguredValue -eq 1 | Should -Be $defaultbackupcompression -Because "The default backup compression should be set correctly"

@nohwnd - If you have time would you mind looking at
https://github.com/sqlcollaborative/dbachecks/blob/backupcompression/tests/checks/InstanceChecks.Tests.ps1#L33
I am trying to write a test to ensure that a test is skipped when a sql version is below 10.
But when I run the uncommented code I get
[-] Should not run for SQL 2005 and below 680ms
RuntimeException: You did not declare a mock of the b9d10fa6-db0e-49c2-83d1-b14135023c57 Command.
at , C:\Users\mrrob\OneDrive\Documents\GitHub\dbachecks\tests\checks\InstanceChecks.Tests.ps1: line 46
or cannot find command Get-Version if I dont declare it in the test

Hmm - See screenshot - Clean session - import module - run test

and if I declare the function in the test

Okay so the problem is that when you Invoke-Pester inside of Describe the Pester state gets overwritten and so you get an error. I tried replicating with simply executing Invoke-Pester over a non-existing file in a describe, and I get a different error (Mock is not in mock table). So you must me doing something else as well (probably setting up a mock for the same command inside of the test or something.) I don't think there is any good solution for this at the moment, testing the framework inside of the framework is difficult. And we are using sepeare jobs for that, but consuming the results is not ideal, still it's the only way to go unless we externalize the state of Pester.

merged