ServerClientId needed for GoogleSignInOptions Web server OAuth #24

Here it is.
Question: Must the comments refer back to a developers.google.com domain or is an android-developers.blogspot.com permissible.
I point to:
http://android-developers.blogspot.com/2016/03/registering-oauth-clients-for-google.html
because it is up to date and has an accurate explanation.
However, weaker alternatives(which make no reference to the fix stated in the blogspot article) under the developers domain.google.com include both:
https://developers.google.com/identity/protocols/OAuth2WebServer
https://developers.google.com/identity/protocols/OAuth2

This looks great!  I made two very minor comments, but LGTM and will merge after that.

Actually, I have to update the README anyway so I can just merge this and handle my own comments.  Thank you!

Published version 0.2.5 with these changes.

That's great. I forgot that the VPN altered the URL, thanks for the review/fix.


user cannot logout

I've tried to logout and it doesn't redirect to login page, see screenshot.

It seems to me that this is related to
https://github.com/Tendrl/api/issues/118
Anyway calling logout should redirect to login page in case of
404 {"errors":{"message":"Not found."}}

etcd-3.1.0-2.el7.x86_64
python-etcd-0.4.3-1.noarch
rubygem-etcd-0.3.0-1.el7.centos.noarch
tendrl-api-1.2.1-04_05_2017_01_51_04.noarch
tendrl-api-doc-1.2.1-04_05_2017_01_51_04.noarch
tendrl-api-httpd-1.2.1-04_05_2017_01_51_04.noarch
tendrl-commons-1.2.2-04_05_2017_04_42_03.noarch
tendrl-dashboard-1.2.1-04_05_2017_11_03_12.noarch
tendrl-node-agent-1.2.2-04_05_2017_00_01_04.noarch
tendrl-performance-monitoring-1.2.2-04_05_2017_13_08_12.noarch

Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

@mkudlej it is fixed on master now.

@anivargi which package version?

@fbalak , This is working on the latest builds. Can you verify and close the issue?

@mkudlej It works as expected. You can close it.
Tested with:
tendrl-commons-1.2.3-04_25_2017_17_15_13.noarch
tendrl-dashboard-1.2.3-04_26_2017_04_11_04.noarch
tendrl-performance-monitoring-1.2.3-04_26_2017_03_02_04.noarch
tendrl-api-1.2.3-04_26_2017_01_51_04.noarch
tendrl-node-agent-1.2.3-04_26_2017_00_01_05.noarch

Closing the issue per @fbalak comments


Getting token to use Monolog with Slack

It is not straight forward to get a token to use monolog with Slack. The expectation is that you write an OAuth client to get the token, but it is possible to get it manually. These are the steps I followed today:
You should already have an account and a channel set up that you want to send error messages to.

Create a new Slack App - https://api.slack.com/applications/new which will give you a client_id and a client_secret which you need for step two. You will need to enter a redirect URI, which can be any page for this purpose.
Got to https://slack.com/oauth/authorize?client_id=[client_id]&scope=chat:write:bot
Authorise App on the page that is returned.
From the URI copy the code that is returned.
Go to https://slack.com/api/oauth.access?client_id=[client_id]&client_secret=[client_secret]&code=[code]
Your token is in the JSON that is displayed.

TO debug errors insert echo fread($this->resource, 1000); at the end of the writeToSocket method of Monolog/Handler/SocketHandler (see https://github.com/Seldaek/monolog/issues/514)

This method doesn't work for me, I just get the following json response from oauth.access:
{
"ok": false,
"error": "invalid_code"
}

Wouldn't it make more sense to just use the incoming webhook functionality? This is far easier to set up than having to do a manual oauth dance..

It worked for me. To bad this handler is not using a simple but effective web-hook, it would be much simpler to configure.

omg.
I don't want to open the page; https://nimbustest.slack.com/oauth/reflow/ and return back after clicking Authorization.
https://slack.com/oauth/authorize?client_id=[client_id]&scope=chat:write:bot
Is it only way to get code?? How can I get code in the server?

I'm working with a test token https://api.slack.com/docs/oauth-test-tokens but a web-hook would be much better and simpler! :)

I also think that this is not about documentation. The Slack handler should use incoming webhooks. They are made for things like that and are quite simpler to configure. The Slack OAuth apps get published and you describe how other users could install them. I'm sure almost all cases for the Monolog Slack handler are about logging something to your team Slack.
We could change the way the Slack handler works in a backward-compatible manner as the tokens for webhooks and OAuth apps are structured differently and webhooks also need the team slug. If we don't want to support both cases, then this should be a BC break and it would be great if that could be decided before 2.0 is out so we could get it in that release if needed.
@Seldaek What do you think?

@hkdobrev I'm also for a change to webhooks and no longer using oauth tokens.

Yeah that sounds good I agree.. The current model sounds a bit crazy for what it does. If you can PR a BC-approach to 1.x I'd be all for it.

@Seldaek Great! I have some free time between 3rd-6th September so I'll be able to open a PR next week 😺

@hkdobrev I can't wait for it - if you need help or any prework just call me.^^
Our current custom SLackHandler depends on the https://github.com/maknz/slack package but it works pretty well:
<?php
namespace App\Libs\Logging;

use Monolog\Handler\AbstractProcessingHandler;
use Monolog\Logger;

class SlackHandler extends AbstractProcessingHandler
{
    public function __construct($level = Logger::WARNING, $bubble = true)
    {
        parent::__construct($level, $bubble);
    }

    protected function write(array $record)
    {
        try {
            \Slack::to(config('slack.channel'))->withIcon(':beetle:')->attach([
                'fallback' => $record['formatted'],
                'color' => 'danger',
                'fields' => [
                    [
                        'title' => 'Server',
                        'value' => array_get($record, 'server', env('APP_ENV', 'cali')),
                        'short' => true
                    ],
                    [
                        'title' => 'Level',
                        'value' => array_get($record, 'level_name', 'WARNING'),
                        'short' => true
                    ],
                    [
                        'title' => 'URL',
                        'value' => array_get($record, 'extra.url'),
                        'short' => true
                    ],
                    [
                        'title' => 'Request-IP',
                        'value' => array_get($record, 'extra.ip'),
                        'short' => true
                    ],
                ],
            ])->send(explode("\n", array_get($record, 'message'))[0]);
        } catch (\Exception $e) {
            // ignore it
        }
    }
}

@Gummibeer Thanks! I don't think I'd use the slack package you've linked though. I don't think it's a good idea to add a new dependency just for that and from what I see it would only work for incoming webhooks. I'd use the existing Monolog handlers infrastructure for sending to the Slack API or to the webhooks endpoint depending on whether you've passed a team name.
Thanks for the input though! It is indeed helpful and I'll try to add some goodies like better attachment support. I'll try to open a PR early to gather feedback.
BTW is your handler open-source so I could look at it in more context?

@hkdobrev It's included in a private project - the context is the laravel framework v5.2 that's why there are some global aliases and functions like array_get(). And I know that this one isn't perfect and not made for public usage - it was a quick way cause we already have this slack package for other messages in use.

Ping everyone here, if you care about easy Slack usage please give https://github.com/Seldaek/monolog/pull/846 a shot and give us feedback over there, that would be much appreciated :)

someone is doing the change to webhooks?
or I could try doing it?

@tzookb I've started doing it over at #846. I just have a couple more changes and some tests. I think I'll push it all by the end of the week :)

awesome @hkdobrev ,
well ping us when you done it, I used a quick hack for now 🗡

Using OAuth is a way to go if you create a Slack app that will later offer the possibility to do some actions on Slack user behalf. That's why there is an association with ClientId and you generate an OAuth token per user. It makes sense if you plan on offering this app for others to use.
Majority of people using Monolog are not interested in that. Oftentimes, teams just want to add logging to Slack for some project the team maintains. It's not on behalf of any team member. That's what Webhooks are for and as others pointed out, the original SlackHandler should have been made that way in the first place.
Sure, if you google "slack monolog integration" you'll find tutorials stating "nah, just create that token and it will work". It will, just think about what happens when the team member that did the integration quits and the user is removed from Slack.
There is a 3rd party handler that uses Webhooks, although I'm not a fan of its "strict OOP" way of configuring it.
BTW. Mentioning that such changes to existing SlackHandler would break BC show that handlers for popular services (HipChat, Slack, NewRelic) shouldn't be a core part of this library. Just my opinion.

Yeah you aren't wrong on that last note @mirfilip - maybe these new handlers should just be published by @hkdobrev and I remove Slack stuff in v2.. For the others unless we have maintainers coming forward it's kinda difficult.

@Seldaek, could you elaborate more on what you mean? Remove everything regarding Slack from Monolog itself in v2?
What I get from @mirfilip's argument is that the Slack API handler should be removed, but I don't see why to remove the webhooks and slackbot ones unless all handlers are moved to a separate repo each.

Well I meant if you are happy to maintain it for example you could publish
it all as one or 3 packages and I remove slack entirely from v2 and
deprecate it in v1 pointing to your repo. Then you can more easily iterate
and break BC etc independently from monologs release cycle.
Let me know :) either that way or I merge and then tag the next 1.x but I
wanna move forward soon with the tag no matter how.

@hkdobrev @Seldaek yeah, my argument was:
It's cumbersome to keep handlers for 3rd party services with core Monolog, as they are subject to 3rd party APIs and thus can change in time.
What I mean by 3rd party API changes is: today Slack supports three types of interaction: with OAuth token as a Slack User, webhook as anyone, slackbot as artificial bot user. Tomorrow, there can be more ways. It's problematic for Monolog to keep up with these changes and release the new version (possibly with BC breaks) just because something has changed in 3rd party apps/services. That's not a problem with well estabilished handlers like php's ErrorLogHandler.
My last suggestion is to keep all related handlers in one repository, e.g. all three ways to log to Slack in one repo.

@Seldaek My suggestion would be to release these handlers as implemented in #846 in 1.x.
I'm happy to maintain them as 3rd party packages for Monolog 2.x if you actually decide to split built-in Monolog loggers into separate packages. If I'm releasing a package tied to another library such as Monolog I'd prefer to be based on the new Monolog 2.x from the start.
@mirfilip I personally prefer 3 separate packages - 2 of which (Slack API handler and Slack Webhooks handler) could depend on another common package for formatting using interfaces if Slack continue to support same formatting for different APIs. Users would choose the one they want in a similar way they choose cache provider when using a PSR-6 cache library with different providers for cache implementation.

@hkdobrev Right. I just suggested the smallest sane fragmentation. What you say seems logic as well.

Closing as the new Slack handlers are merged. https://github.com/Seldaek/monolog/releases/tag/1.22.0

Bot User OAuth Access Token can be found in App features -> OAuth & Permissions -> OAuth Tokens & Redirect URLs

Yes @nikkiselev !
I got the token by following that after setting permissions and installing the app, it shows up here:


ngx_http_lua_upstream with tengine RBTREE performance optimization

Fork the ngx_http_lua_upstream
And optimize performance O(n) queue to O(1) tengine rbtree

@drawing @chobits


Add instance Ready state

shared/api: Add Ready state
lxd: Unset volatile.last_state.ready on daemon init
lxd/instance/drivers: Set volatile.last_state.ready on stop/shutdown
lxd/instance/drivers: Return api.Ready when ready
lxd/devlxd: Add POST /1.0/state endpoint
shared/api: Add DevlxdStatePost
api: Add instance_ready_state
test/deps: Add ready-state subcommand
test: Test instance Ready state using devlxd

https://discuss.linuxcontainers.org/t/lxd-instance-ready-state/14657

Documentation preview available at: https://linuxcontainers.org/lxd/docs/pr.10691/

Added link to design doc for context for future readers.

@monstermunchkin would be good to update https://github.com/lxc/lxc-ci/blob/master/bin/test-lxd-devlxd-vm with these sorts of tests too so we ensure it works for VMs too.

Tests failing:
 go build -tags netgo -a -installsuffix devlxd ../deps/devlxd-client.go

jenkins: test this please

@monstermunchkin also see https://discuss.linuxcontainers.org/t/lxd-instance-ready-state/14657/30?u=tomp

Also tests still flaky.

jenkins: test this please

@monstermunchkin did you want this reviewed btw?

@tomponline did the rebase for @monstermunchkin

thanks will merge after tests run.


Crash when clearing guides in empty scene

Godot version: v3.2.beta.custom_build.129a22cd9
OS/device including version: macOS Catalina 10.15.1
Issue description:
The editor crashes when I click the "Clear Guides" menu item in an empty scene.
Steps to reproduce:

Open an empty scene (without the root node)
Swith to the 2D workspace
In the editor toolbar, open the "View" menu, and click "Clear Guides".
The editor crashes.

Minimal reproduction project: Any project.

The cause is that EditorNode::get_singleton()->get_edited_scene()  returns NULL for an empty scene, making the has_meta function crash.
(The function actually returns the root node of the edited scene instead of the scene itself.)
https://github.com/godotengine/godot/blob/129a22cd905d1163641a56a956a69747e4e3c17a/editor/plugins/canvas_item_editor_plugin.cpp#L4753-L4757
I'd like to make a pull request to fix this. But I have some questions: This case block has a lot of repeated EditorNode::get_singleton()->get_edited_scene() expression. Is there a technical requirement that they are not extracted into a local variable? If extracting into a local varaible is allowed, could I put that modification in the crash-fixing PR, or do that in a separate PR?

I'd like to make a pull request to fix this. But I have some questions: This case block has a lot of repeated EditorNode::get_singleton()->get_edited_scene() expression. Is there a technical requirement that they are not extracted into a local variable? If extracting into a local varaible is allowed, could I put that modification in the crash-fixing PR, or do that in a separate PR?

There's no technical requirement not to do it. We usually don't use a local variable for this when it's 2 or 3 occurrences, but in this case it does make sense to factorize a bit and thus do the null check before check has_meta.


Problem with mont form inversion

Test to illustrate a potential problem with the Bernstein&Yang code to
invert numbers in Montgomery form. The specific parameters shown here
come from intermittent test failures of homomorphic_mul in the
Synedrion signining library (i.e. parameters are generated with an
unseeded CSPRNG).
Run the test with cargo t inversion_v06_vs_v055.
For convenience, after the test follows a commented out version of the
same that passes with crypto-bigint v0.5.5.
To compare with v0.5.5 do the following:

Checkout the old code: git checkout v0.5.5
Run cargo update -p proc-macro2 to work around a recent compiler
incompatibility
Paste the commented out v0.5 test in the test module of
runtime_mod.rs
Run the test with cargo t inversion_v06v_v055
Notice it passes

@dvdplm it looks like this test is making use of internals / private fields. Can you write it entirely in terms of the public API? Otherwise I can't tell if you're miscomputing constants.
It would also be good to generate reference values with e.g. sage, and show your work for that.

Can you write it entirely in terms of the public API?

You mean to instantiate the MontyForm values? Sure, I can try to do that.
I think having known good values would be very good, and I had a look at the Sage docs but couldn't find much info on how to do modular maths with it. I'll try again though.

Can you write it entirely in terms of the public API?

Done.

@dvdplm as an alternative to sage, you could also compare results with num-modular, which is already one of the dev-dependencies

also compare results with num-modular

@tarcieri I added a test using num-modular. It agrees with crypto-bigint v0.5.5.

@tarcieri @fjarri I think I have found another clue that might help us narrow down what is going wrong here. The problem seems to lie in the modulus, in the size of the modulus. In the latest commit (e0da58b) I have added more tests to illustrate how moduli of sizes U2048 and U4096 seem to break on v0.6. Weirdly enough U1024 moduli seem fine. I did not try U8192 yet.
Not sure what the next steps should be but I wanted to leave as much information as possible here.

@dvdplm that's a good data point to know re: specific sized integers being impacted
My best guess would be it's a bug in the bernstein_yang_nlimbs! macro which computes the number of 62-bit limbs needed to represent a given-sized value:
https://github.com/RustCrypto/crypto-bigint/blob/2b81eae18c6dd89927b66f0f9af4413402b6bbea/src/macros.rs#L12-L19
That's used here when writing impls of the PrecomputeInverter trait: https://github.com/RustCrypto/crypto-bigint/blob/2b81eae18c6dd89927b66f0f9af4413402b6bbea/src/uint/macros.rs#L11

I was able to produce a test failure using the existing test suite by modifying the proptests for modular inversion in tests/monty_form.rs to use U2048 instead of U256.
I then made those same tests pass by modifying bernstein_yang_nlimbs to be the following:
 macro_rules! bernstein_yang_nlimbs {
     ($bits:expr) => {
         (($bits / 64) + (($bits / 64) * 2).div_ceil(64) + 2)
     };
 }

That probably isn't the best way to fix this specific problem, but I believe it does demonstrate that there are currently too few 62-bit limbs for a given sized integer, leading to truncation and thus the miscomputed results.
@dvdplm I haven't tested your specific vectors, but perhaps you could try that locally and see if it corrects the issue?

I'm also a little confused why the current calculation for the number of limbs is insufficient, but I'll have to go back through the paper and find where it's defined.
FWIW, it currently computes 34 limbs for a 2048-bit integer, where 34 * 62 = 2108 bits

Aha, so the issue is for a given UNSAT_LIMBS, we can calculate the maximum allowed size of any modulus or input value in bits as:
(UNSAT_LIMBS * 62) - 64

We currently compute 34 limbs for a 2048-bit integer:
(34 * 62) - 64 = 2044

That's 4-bits too small.

That's 4-bits too small.

Awesome sleuthing! I was thiiiiiis close, but you got there first! :)

I'd appreciate it if you could rebase on that and see if it fixed your issues

Yep, will do first thing in the morning.

I'd appreciate it if you could rebase on that and see if it fixed your issues

I have checked that #610 indeed fixes all test failures on this branch. 🎉
To check upstream it would be really good to have a new pre-release  of crypto-bigint, is that possible?

Yes, I can cut another release soon

Released in v0.6.0-rc.0

Going to close this out, but I'd still be curious in getting some of these tests in if you'd like to resubmit just those


Bug: GADMobileAds breaks the Global Setted AccentColor

Implemented GoogleMobileAds with spm to my another Swift package. Calling GADMobileAds.sharedInstance().start() resets the accent color to default one.
To reproduce follow these steps.

Integrate GADMobileAds into another Swift package.
Add that package to iOS App target.
Set AccentColor in Assets.xcassets
Start GoogleMobileAds by following

GADMobileAds.sharedInstance().start()

You will see that the color you set in AccentColor is not working anymore. Commenting out GADMobileAds.sharedInstance().start() fixes the problem.
Env

Xcode 14.3.1
swift-driver version: 1.75.2 Apple Swift version 5.8.1 (swiftlang-<IP_ADDRESS>.5 clang-14<IP_ADDRESS>.100)
Target: arm64-apple-macosx13.0

Can you investigate a solution?

Hi @muhasturk,
This issue doesn't appear to be related to the Swift Package Manager and more so the SDK itself. Can you re-route your issue to the Google Mobile Ads SDK Developer Forum? This will help resolve your issue. When you create your case, please include a minimum reproducible sample to demonstrate your problem.
Thanks


exiting Hello World with code<PHONE_NUMBER>

VSCode Version: 1.48.2
OS Version: Win 10

Steps to Reproduce:

Set up VS code with the C++ and code runner extention
Use this code:

#include
int main()
{
std::cout << "Hello World";
return 0;
}
(Yes it is really only a Hello World)
On my desktop it works, on my laptop it exits with code=3221225477, which is apparently a status_access_violation.
Settings are the same (I synced them), version and complier are the same too.

Does this issue occur when all extensions are disabled?: Yes/No

/question


Repurpose RequestTileContentMemoizer to hold tile generation state instead of tile content

@pmconne would you mind reviewing this?


False positive(?) with no-unsafe-any

Bug Report

TSLint version: 5.4.3
TypeScript version: 2.3.4
Running TSLint via: (pick one) CLI

TypeScript code being linted
// code snippet
function doesTruthinessCheck(it: any): string {
  if(it) {
    return "john";
  }
  return "jane";
}

with tslint.json configuration:
"no-unsafe-any": true,

Actual behavior
Unsafe use of expression of type 'any'.
Expected behavior
I'd expect no error, as just checking the truthiness of an any typed variable doesn't seem unsafe.

I agree that this is a bug. Checking for truthyness or falsyness should be allowed.
#3008 fixes this


Initial implementation of Mecanum class

Implemented as a subclass of HolonomicDrive

[x] Basic drive using wheel speeds
[x] Basic driving using chassis speed and rotation

TODO:

@gcjurgiel Mind letting me know what might be worth adding to the TODO?


bandwhich: 0.7.0 -> 0.8.0

Motivation for this change
https://github.com/imsnif/bandwhich/releases/tag/0.8.0
Things done

[x] 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/)
[x] Determined the impact on package closure size (by running nix path-info -S before and after)

/nix/store/rw6mc8h3d7gy0icfkm2vv0wwhqf50plx-bandwhich-0.7.0	  30.5M
/nix/store/q0p33iyrhvyjmn9fvizii3w7dwjc5miw-bandwhich-0.8.0	  30.5M

[ ] Ensured that relevant documentation is up to date
[x] Fits CONTRIBUTING.md.

This change is

addressed by https://github.com/NixOS/nixpkgs/commit/7ee263e699e


Update kallidus-tutorial.md

@jeevansd - can you review the proposed changes?
IMPORTANT: When the changes are ready for publication, add a #sign-off comment to signal that the PR is ready for the review team to merge.
#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

@thomasclarkkallidus, does Kallidus supports only SP initiated, please confirm?

@thomasclarkkallidus, does Kallidus supports only SP initiated, please confirm?

Hi @v-hgampala, yes, Kallidus only supports SP initiated SSO.

@thomasclarkkallidus, Thanks for the clarification, I was creating a separate PR in private repo for documentation.
Will you please raise an update request in our portal to reflect it into the Azure gallery.
#please-close

@thomasclarkkallidus, can you please share the latest Sign on, Reply and Identifier URL values, these are mandatory to mention for SP initiated?

@thomasclarkkallidus, can you please share the latest Sign on, Reply and Identifier URL values, these are mandatory to mention for SP initiated?

Identifier: https://login.kallidus-suite.com/core/saml
Reply URL: https://login.kallidus-suite.com/core//acs
Sign On URL: https://login.kallidus-suite.com/core//acs

@thomasclarkkallidus, thanks for sharing!!
I'll update the document accordingly.

@thomasclarkkallidus, will you please raise an update request in our portal to reflect it into the Azure gallery, please let us know if you have any questions.

@thomasclarkkallidus, will you please raise an update request in our portal to reflect it into the Azure gallery, please let us know if you have any questions.

Hi @v-hgampala, I will get an update request opened in the portal this week, in the meantime can the Microsoft Learn documentation be updated because our customers are actively using this to assist with the configuration of their SSO?

@thomasclarkkallidus, the document is updated as suggested.

@thomasclarkkallidus, the document is updated as suggested.

@v-hgampala thank you very much for updating the document 🙂


scrolling up the animation is almost invisible

This issue is visible also in the demo,
scrolling down everything is fine,
scrolling up the animation begins only when the element is near the bottom of the view,
so if you do not scroll slowly it seems that no animation occours when scrolling from the bottom to the top of page.
it would be fine to have the option to fire the animation also when scrolling up and the element is fully visible and not when it is half-visible at the bottom of the view.

have you tried using data-aos-anchor-placement option?


Translation improvement and syntax correction

I have corrected some grammar mistakes as well as improven the spanish translation to a more correct version of it.

[x] I have read freeCodeCamp's contribution guidelines.
[x] My pull request has a descriptive title (not a vague title like Update index.md)
[x] My pull request targets the master branch of freeCodeCamp.
[x] None of my changes are plagiarized from another source without proper attribution.
[x] My article does not contain shortened URLs or affiliate links.

If your pull request closes a GitHub issue, replace the XXXXX below with the issue number.
Closes #XXXXX

Thanks!


Deploying my first Julia package

@JuliaRegistrator register branch=main

Registration pull request created: JuliaRegistries/General/56286
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:
git tag -a v0.1.1 -m "<description of version>" a8008ed82e4204684d2b0d80926dfbc1377f6e5c
git push origin v0.1.1

Also, note the warning: This looks like a new registration that registers version 0.1.1.
Ideally, you should register an initial release with 0.0.1, 0.1.0 or 1.0.0 version numbers
This can be safely ignored. However, if you want to fix this you can do so. Call register() again after making the fix. This will update the Pull request.

@JuliaRegistrator register branch=main

Registration pull request updated: JuliaRegistries/General/56286
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:
git tag -a v0.1.1 -m "<description of version>" 8cb30d372bd87cff861cac439eca043fcfad8d75
git push origin v0.1.1

Also, note the warning: This looks like a new registration that registers version 0.1.1.
Ideally, you should register an initial release with 0.0.1, 0.1.0 or 1.0.0 version numbers
This can be safely ignored. However, if you want to fix this you can do so. Call register() again after making the fix. This will update the Pull request.


Interpreter crashing on sliced Array access

When I access an array in sliced form Array[start, length], the interpreter crashes.
Sample command:
a = [0, 1, 2]
a[0, 3] # kaboom!

Exact run output (the interpreter overwrites the second line when crashing):
$ ./goby -i
Goby 0.1.2 😙 😇 🤔
» a = [0, 1, 2]
#» [0, 1, 2]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x7114c5]

goroutine 1 [running]:
github.com/goby-lang/goby/compiler/ast.(*BaseNode).MarkAsExp(0x0)
  /home/saverio/code/go/src/github.com/goby-lang/goby/compiler/ast/ast.go:36 +0x5
github.com/goby-lang/goby/compiler/parser.(*Parser).parseStatement(0xc420114240, 0xfdb598, 0x1)
  /home/saverio/code/go/src/github.com/goby-lang/goby/compiler/parser/statement_parsing.go:34 +0xbd
github.com/goby-lang/goby/compiler/parser.(*Parser).ParseProgram(0xc420114240, 0x7, 0xc420063e40)
  /home/saverio/code/go/src/github.com/goby-lang/goby/compiler/parser/parser.go:176 +0xdf
github.com/goby-lang/goby/igb.StartIgb(0xb1be56, 0x5)
  /home/saverio/code/go/src/github.com/goby-lang/goby/igb/repl.go:160 +0x4d1
main.main()
  /home/saverio/code/go/src/github.com/goby-lang/goby/goby.go:29 +0x954

===============

Your operating system
Ubuntu 16.04 64bit
How did you install Goby
From source
Goby version
93d2e10fecedf5451e517afbcee2b8e275ad5217
The value of $GOBY_ROOT
$HOME/code/go/src/github.com/goby-lang/goby

@saveriomiroddi Can you help fixing this?

@st0012 I need a couple of days to get acquainted with the lexer (or parser) :smile:
I will write back with a positive or negative answer in a couple of days :smile:

@st0012 ok, I had a look at the parser, and definitely manual parsers are not my thing :smile: so I'll pass on this, sorry.

@saveriomiroddi So, would you suggest we use a parser generator? (this is not relevant to this issue)

@st0012 this is an interestring/complex subject. I'm not sure it would be ultimately productive to switch. Wrapping up the pros/cons of the current implementation:

pros

lots of work has been put on it, and it's working, which is fundamental :smile:

cons

I think it requires more maintenance (more bugs, and bugs are more difficult to fix)
it has a high barrier of entry; it's very difficult to make extensions/bugfixes without knowing in details how parsers work

open points

I'm not sure about how programming language frameworks tackle parsing. I originally thought any large project would have a handcrafted parser, but turns out this is not correct; ruby for example uses bison (see introductory article).

I'm unsure. Switching in the short term would be very hard, because it would be a lot of work, and the current implementation works.
I think the best approach is to have a look at how large projects tackle parsing, and then decide. In case parser generators would be the common practice, then definitely a parser generator should be seriously taken into account.
It's crucial to know that a handcrafted parser will cause newcomers to the project to struggle and likely not touch the parsing code (see the Regexp (#390) and Float (#443)), overall making the project less attractive to actively contribute to (IMO). I spent over an hour yesterday on this (#403) bug, and I have a vague idea of what's causing it, but I have no idea at all about how a fix would be, as it's hard to follow parsing logic in general.
For clarity, I had, in the past, experience with parser generators, but it was for SQL, which is a relatively small language.

Another point: since Ruby uses a parser generator, and Goby is very similar, the Ruby grammar definition could (not 100% sure, though) be recycled, making the cost of switching [significantly] lower than starting from scratch.

But do you understand how to write those parser generator's grammar rules? I think understand the Go code's logic is still far more easier than learning how to write the grammar rules.
Using parser generator means contributors needs to learn both Go and how to define a grammar rule, which is like learning a new language. So I think switching to parser generator will lower the entry barrier.

And I personally want to restrict some syntax usage in Goby, and we also won't support some usages like URI("http://example.com"). So copying Ruby's grammar definition won't be a good way for switching to parser generator, we still need to define our grammar rules.

But do you understand how to write those parser generator's grammar rules? I think understand the Go code's logic is still far more easier than learning how to write the grammar rules.

Fair enough, I take the perception of the difficulty of each approach is personal :smile:

@st0012 is this issue still open?
can you give me a heads-up for this- like where to begin debugging it. I can probably look into fixing this issue.

@ishankhare07 I think this issue hasn’t been fixed, but I can’t tell you much now because I’m about to fly home. You should join our slack and ask this in discussion channel and someone would help you https://goby-lang-slackin.herokuapp.com/


Same again, builds are broken

see Issue #296, now in Version 1.38.2. No more checks for .NET Core projects files?

Looks like I introduced a bug with 1.38.2 looking into it ASAP

Looks like I screwed up a merge at the end of PR and lost the #296 changes
I have done a new release 1.39.1 that should correct the issues reported in #323 #322 #302, it is PR #325
Please reopen if I have not fixed the problem
My deepest apologies for such a stupid regression issue, all down to human error. The PR is obviously the part of the process that is not automated as part of  CI/CD pipeline


Add reassuring note after minor upgrade docs

Some users were understandably a little incredulous that the short instructions for minor Citus upgrades are sufficient. Adding a reassuring note.

Actually I do have a question about minor upgrades. Does it the instance upgrade order matter? Should workers be upgraded before the master?

Closing this to reopen against v5.1


FileNotFoundError: [Errno 2] No such file or directory: allure_reports/https://www.googletagmanager.com/gtag/js----

I am using the Allure npm wrapper, which can be found at "https://www.npmjs.com/package/allure-commandline". When I try to use the allure combine command with this package, I encounter a FileNotFoundError. However, if I install Allure using Homebrew, the command works fine.

I have encountered the same problem using this allure-combine python tool.
In the latest version of allure2 its looks like they added a new script for analitycs and this is interfiering with combine.py (Link to tag release)
> Folder to process is Samsung Galaxy S21-allure-results-html

 File "/opt/hostedtoolcache/Python/3.11.3/x64/bin/allure-combine", line 8, in <module>

> Checking for folder contents

  sys.exit(main())

            ^^^^^^

File "/opt/hostedtoolcache/Python/3.11.3/x64/lib/python3.11/site-packages/allure_combine/combine.py", line 302, in main

combine_allure(args.folder.rstrip(sep), args.dest, args.remove_temp_files, args.auto_create_folders, args.ignore_utf8_errors)

File "/opt/hostedtoolcache/Python/3.11.3/x64/lib/python3.11/site-packages/allure_combine/combine.py", line 251, in combine_allure

with open(file_path, "r", encoding="utf8") as ff:

        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

FileNotFoundError: [Errno 2] No such file or directory: 'Samsung Galaxy S21-allure-results-html/https://www.googletagmanager.com/gtag/js?id=G-FVWC4GKEYS'

Thanks for your feedback. Can you upload your allure generated folder so I can check it? It seems, that the problem caused by Google tag manager added to allure html file for some unknown reason, and the fact, that my script cannot handle such urls the right way

I have the same problem. Do you have any news about this?

Hi! I've pushed new version into github, which has  this problem solved. Now struggling to upload package into pypi, so it could be updated easily (have some problems with "This filename has already been used").
After I could upload it, I've let you know.
Now you can use this repo current version of main branch

Good news everyone! I've uploaded version 1.0.10 to pypi, that has this problem solved. Try it out, and if you still have problems with FileNotFoundError, feel free to reopen this issue


Refactoring events to tasks for the new TaskEngine design change.

Refactoring events to tasks for the new TaskEngine design change.
Event->Task
EventHandler->TaskDispatcher
Action->TaskHandler

lgtm


Provide comprehensive mail example

Mail endpoints are primary managed endpoints. The example should show

camel as client connects to a remote smtp endpoint
security configuration for the camel smtp client
how to consume a pop/imap payload directly to camel
mail endpoint security configuration

For details that are not handled at the camel level, we need to provide pointers to the wildfly docs.

Documentation updated in commit https://github.com/wildfly-extras/wildfly-camel-book/commit/56f2d1e38fcfcf3af104f11dc9f89b397c518c13


enhance csghub docker guide

Addressed comments and enhanced csghub docker deployment guide.

@MasonXon Addressed your comments and made some enhancements to the all-in-one guide. Could you pls take a look? Thanks!


Lack of descriptive comments in code

Describe the bug
The code in this repository lacks descriptive comments that explain what each line or section of code does. This can make it difficult for other students to understand and work with the code. It would be helpful to add comments throughout the code to provide clear explanations and improve the overall readability and maintainability of the code.
Example:
int[] inventory = { 200, 450, 700, 175, 250 };
int sum = 0;
int bin = 0;
foreach (int items in inventory)
{
    sum += items;
    bin++;
    Console.WriteLine($"Bin {bin} = {items} items (Running total: {sum})");
}
Console.WriteLine($"We have {sum} items in inventory.");
It is hard to know what each line does!
So here the descripted code and see the different:
 // Create an integer array and initialize it with some values
int[] inventory = { 200, 450, 700, 175, 250 };
// Initialize a variable to hold the sum of all elements in the array
int sum = 0;
 // Initialize a variable to keep track of the bin number
int bin = 0;
// Loop through each element in the array, adding it to the sum and printing out the current bin number, item count, and running total
foreach (int items in inventory)
{
sum += items; // Add the current item count to the sum
bin++; // Increment the bin number
Console.WriteLine($"Bin {bin} = {items} items (Running total: {sum})"); // Print out the current bin number, item count, and running total
}
// Print out the total item count across all bins
Console.WriteLine($"We have {sum} items in inventory.");

🎓 Add a tag to this issue for your current education role: student, Student Ambassador or educator.
@StudentAmbassador

Thanks for submitting this issue. Can you please clarify which repository this issue is in reference to @jaberjaber23?

This problem is present in all codes in all repositories

This problem is present in all codes in all repositories


CI: Pull in dev packages from Ubuntu Kinetic

At present, this installs the following versions:
libaom3 3.4.0-1
libaom-dev 3.4.0-1
libdav1d6 1.0.0-2
libdav1d-dev 1.0.0-2
nasm 2.15.05-1

Codecov Report

Merging #2988 (cedabff) into master (704292f) will decrease coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #2988      +/-   ##
==========================================
- Coverage   86.54%   86.52%   -0.02%
==========================================
  Files          87       87
  Lines       33936    33936
==========================================
- Hits        29369    29363       -6
- Misses       4567     4573       +6

Impacted Files
Coverage Δ

src/cpu_features/x86.rs
39.58% <0.00%> (-2.09%)
:arrow_down:

src/context/mod.rs
91.57% <0.00%> (-1.06%)
:arrow_down:

v_frame/src/plane.rs
88.90% <0.00%> (-0.23%)
:arrow_down:

src/partition.rs
77.58% <0.00%> (-0.16%)
:arrow_down:

src/rdo.rs
85.91% <0.00%> (-0.05%)
:arrow_down:

src/encoder.rs
87.29% <0.00%> (-0.04%)
:arrow_down:

src/context/partition_unit.rs
90.83% <0.00%> (+0.27%)
:arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

This is required for #2961 which bumps dav1d-sys.


Make it easier to look through real-life examples?

Could the list of examples at the end of the README be a table with

community name, linking to repo as it is now the case
workflow file presented as [workflow running blablabla every blablabla](permalink to workflow file)
example log?

I'm asking because that's what I go look for in example repos.

This sounds nice and it would be better aesthetically. Do you want to take on this? :p I think me and @vsoch got enough at our plates atm.

Related: https://github.com/sindresorhus/refined-github/issues/3008


autopep8 doesn't work in WSL2

On WSL 2, Ubuntu 20.04, I create a python environment py39 and install autopep8 using conda, but  after I click Ctrl + Alt + L, the autopep8 cannot format the .py file.
And the Output Meaasge is:
~/anaconda3/envs/py39/bin/python -m autopep8 --diff ~/pl/python/basic/int.py

And I know it should be autopep8 --in-place --aggressive instead of autopep8 --diff, but I don't know how to change the arguments.
I need help to make Ctrl + Alt + L works.

@tgsheng You can use "python.formatting.autopep8Args": ["--aggressive"] in your settings. The reason we use --diff is so that we can generate text edits to the file in a way you can undo or redo. If you want to use --in-place, then you may have to create a separate task and run that task each time you need formatting. But you loose the ability to undo or redo changes.

Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on then we will be happy to re-open this issue to pick up where we left off.


firefox page wait for tests

related to #113

this is based on #294

Conflicted @Meir017

conflicted


Feature/tuya panel outdoor sdk

Description
Please provide a brief summary of the changes. If it is related to an issue, please bring the issue number, like fixes #${number}.
Package

[ ] tuya-panel-animation-sdk
[ ] tuya-panel-api
[ ] tuya-panel-electrician-sdk
[ ] tuya-panel-ipc-sdk
[ ] tuya-panel-lamp-sdk
[ ] tuya-panel-lock-sdk
[ ] tuya-panel-robot-sdk

Type of change
Please select the relevant option.

[ ] 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

index.d.ts 为啥是空的？

@qinglizhang 处理一下 yarn.lock 的冲突

Codecov Report

Merging #58 (dc3aa92) into main (8bdef8e) will decrease coverage by 0.02%.
The diff coverage is 56.52%.

@@            Coverage Diff             @@
##             main      #58      +/-   ##
==========================================
- Coverage   58.71%   58.68%   -0.03%
==========================================
  Files         134      137       +3
  Lines        5171     5240      +69
  Branches     1229     1228       -1
==========================================
+ Hits         3036     3075      +39
- Misses       2123     2163      +40
+ Partials       12        2      -10

Impacted Files
Coverage Δ

...utdoor-sdk/src/components/setting-slider/index.tsx
37.50% <37.50%> (ø)

...outdoor-sdk/src/components/location-text/index.tsx
58.82% <58.82%> (ø)

...dk/src/components/shadow-circle-progress/index.tsx
85.00% <85.00%> (ø)

packages/tuya-panel-api/src/robot/gyroDataApi.ts
9.72% <0.00%> (ø)

packages/tuya-panel-api/src/robot/laserDataApi.ts
8.88% <0.00%> (ø)

...l-gateway-sdk/src/components/setPassword/index.tsx
48.27% <0.00%> (ø)

...-gateway-sdk/src/components/addDeviceTip/index.tsx
42.30% <0.00%> (ø)

...rician-sdk/src/components/curtain/curtain-base.tsx
1.03% <0.00%> (ø)

...cian-sdk/src/components/layout/modal-container.tsx
3.48% <0.00%> (ø)

...sdk/src/components/ele-setting/container/index.tsx
22.80% <0.00%> (ø)

... and 3 more

Continue to review full report at Codecov.

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


Update EOL dates for .NET Framework

See https://dotnet.microsoft.com/download/dotnet-framework

Thank you for the support of the project. This is your first PR, welcome to our community. I have verified your changes on the website and everything is correct.


Clean up API not found code

Looks like this commit has a lot of repeated code.
Should clean it up eventually: https://github.com/samtecspg/articulate/commit/3f7234ae3cdd468064a49935aad2c4250ad94d08

old API


Transport Unload Waypoint Issues

Transport unload for custom faction vehicles with troops inside does not work. The vehicle arrives at the waypoint but the passengers remains inside. Not really that big of an issue since you can manually have the passengers leave the vehicle with the EDIT tab, but it'd be nice to have it working if possible.

Cannot reproduce the issue. Transport unload is working with custom factions.


Postback not working

Hi, I want to use smooch post back.
I try sample following with this post backs button
exports.sendMessage = function (appUserId, params) {
  const params = {
    text: "expect post back",
    role: 'appMaker',
    type: 'text',
    actions: [
      {
        type: 'postback',
        text: 'Postback Button Label',
        payload: 'PAYLOAD_HERE'
      }
    ]
  }
  smooch.appUsers.sendMessage(appUserId, params)
    .then((response) => {
      console.log('Smooch API RESPONSE:\n', response);
    })
    .catch((err) => {
      console.log('Smooch API ERROR:\n', err);
    });
};

When I tapped postback button, a message is shown, but no postback request fired.
(Is it right that endpoint is my app webhook?)
I use facebook messenger and smooch-core-js is version 5.6.0

I had similar issue. It was due to page not subscribed to events. By default it is only messaging you need to explicitly set

Edit Page Subscriptions
Post back -enable


Update generative icon API

Category:  Bugfix
Overview

Dicebear API has been reorganized and previous endpoint only provides the same generic avatar icon

Issue Number

Did not see any open issues for this. I had this problem in my kubernetes cluster and on docker on my local machine.

Code Quality Checklist

[X] All changes are backwards compatible
[X] All lint checks and tests are passing
[X] There are no (new) build warnings or errors

@Lissy93 It would be awesome if this PR could be merged as generative icons are broken.


merge from arlac77/template-arlac77-github,arlac77/template-esm-only

package.json

chore(scripts): add documentation readme ./src/util.mjs --section=API (scripts.docs)
chore(scripts): add documentation lint ./src/util.mjs (scripts.lint)
chore(deps): add ^17.1.0 remove ^17.0.8 (devDependencies.semantic-release)

:tada: This PR is included in version 1.0.1 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


Add vendor support for :placeholder pseudo selector

I'm not even sure if this is possible, but it would be awesome if writing something like this:
.button:placeholder
color gray
gets converted into this:
.button::-webkit-input-placeholder,
.button:-moz-placeholder,
.button::-moz-placeholder,
.button:-ms-input-placeholder {
color: gray;
}

damn straight :) :+1:

It would be possible with something like this.

Great @jmeas thanks :)

Wasn't it fixed with #199?


Fix NPE in HTTPUrlConnBackend in case of empty response

I'm not sure of the exact conditions under which HTTPUrlConnection#getInputStream() can return null, but I added a test for the exact scenario that I encountered: client sends a POST request, server responds with a 401 with no body and no content-type.
Fixed with a simple null check.

Release as 0.0.16, thanks!


Website offers downloading linux package as ZIP but download is gzipped tar

Description
Web page https://dbeaver.io/download offers downloading of zip files, but downloads are actually tar.gz.

Minor issue.
DBeaver Version
na
Operating System
na
Database and driver
No response
Steps to reproduce
No response
Additional context
No response

Duplicate of #21643


System.OverflowException: 'The value is not a number.' for my private key

Using my testnet account, I have my Loopring private key set to "0xff2f95f7f25dd17d160595603d49f9bd0bae765403d5d171fe1db2a3218c91". I've tried using this to generate the EDDSA in both my code and your test console app and in both of them I get the same error. The value of the BigInteger is {-1438421842585994315207244606196451436825259336542374739314611619180213103} and it really doesn't like that. I'm going to reset my private key for security reasons and to see if a new key causes the same issue, but yeah. Sorry to be the barer of bad news.
Error is thrown in Eddsa.cs, here
        private byte[] CalculateNumberOfBytes(BigInteger self)
        {
            BigInteger nBits = (BigInteger)Math.Ceiling(BigInteger.Log(self, 2));

self = {-1438421842585994315207244606196451436825259336542374739314611619180213103}
Math.Ceiling throws: System.OverflowException: 'The value is not a number.'

Fixed in the branch "bugfix" :))


Propose upgrading to Mattermost v5.3.1

Hi @magicknot!
Mattermost v5.3.1 release is officially out.
You can find download links with hash numbers here. Changelog with notes on patch releases is available here.
Thanks!

@magicknot FYI, we just released v5.3.1 so I updated this Issue accordingly ^

Thank you @amyblais. I'm going to cut a release today. Have you got the chance to ask someone to update the Chef Cookbook link in Mattermost's download page?

Hi @magicknot, I made the change but it didn't seem to get transferred to the new download page: https://mattermost.com/download/. I'll ask the marketing team about it.


3D editor sliders resolution

Be careful with the stepping

Fixed. I had to change also smth in the dat.gui.js so that dragMouse diff is bigger (@L 2015)
function onMouseDrag(e) {
                        var diff = prevY - e.clientY;
                        _this.setValue(_this.getValue() + diff * _this.__impliedStep);

                        prevY = e.clientY;
                    }

to
function onMouseDrag(e) {
                        var diff = 100 * (prevY - e.clientY);
                        _this.setValue(_this.getValue() + diff * _this.__impliedStep);

                        prevY = e.clientY;
                    }


Improve permissions notification for groups

We should make the following improvements to the permissions notification for groups:

[ ] The banner should live update when permissions are changed.
[ ] As noted here, the banner should be shown to administrators (always), and anyone who does not have permissions to modify groups. It should not be shown to non-admins when they have the require permissions.

This should be solved by @mechon03 as a follow-up to #24198.

@zulipbot claim

@zulipbot claim

@zulipbot claim

Unassigning myself from this Issue to work on other Issues, since I have already raised a PR and it is under review, will continue working on the PR for any required changes, Thanks.

@zulipbot abandon


Internal keys / non-prompted values

Is your feature request related to a problem? Please describe.
Trying to build a template for Terraform structure, which means a lot of the file tree structure depends on one or more of the inputs. Using a "choice" type here makes a lot more sense from a usability standpoint than using multiple competing boolean keys. For example:
Example copier.yaml
flavor:
  type: str
  choices:
    - Docker
    - Instances
    - Kubernetes
    - None

But that means having to do string comparison if-statements in directory names to create conditional directories. And everywhere else when this value is evaluated. If multiple answers are correct for some conditional directories then that results in even longer if-and statements:
Example filetree
.
├── {% if flavor == 'docker' %}ecs{% endif %}
├── {% if flavor == 'kubernetes' %}eks{% endif %}
├── {% if flavor == 'instance' %}bastion{% endif %}
├── {% if flavor == 'docker' or flavor == 'kubernetes' %}portainer{% endif %}
└── {% if flavor != 'none' %}vpc{% endif %}

This can make the directory names quite long and makes everything poorly readable. It also results in a lot of Jinja repetition across the template.
Describe the solution you'd like
I was hoping to create keys derived from the choice key behind the scenes, e.g. without prompting the user for input. In my scenario these would be booleans, but it could also be useful for concatenating strings or other post-input processing purposes that deduplicates a lot of code from the template files.
Example of how I'd love for this to work for my use case:
Future copier.yaml
flavor:
  type: str
  choices:
    - Docker
    - Instances
    - Kubernetes
    - None

# Internal variables
isContainer:
  type: bool
  value: "{% if flavor == 'docker' or flavor == 'kubernetes' %}true{% else %}false{% endif %}"

isDocker:
  type: bool
  value: "{% if flavor == 'docker' %}true{% else %}false{% endif %}"

isInstance:
  type: bool
  value: "{% if flavor == 'instance' %}true{% else %}false{% endif %}"

isKubernetes:
  type: bool
  value: "{% if flavor == 'kubernetes' %}true{% else %}false{% endif %}"

isLite:
  type: bool
  value: "{% if flavor == 'none' %}true{% else %}false{% endif %}"

Future filetree
.
├── {% if isDocker %}ecs{% endif %}
├── {% if isKubernetes %}eks{% endif %}
├── {% if isInstance %}bastion{% endif %}
├── {% if isContainer %}portainer{% endif %}
└── {% if isLite %}vpc{% endif %}

For this to work the value: key would have to be added and if this key is set then prompting the user for input would always be skipped. Alternatively prompt: false could be used in combination with setting the value using default: similar to what was suggested in https://github.com/copier-org/copier/issues/229 before.
If preferred these "internal variables" could also be moved one layer down under an identifier:
flavor:
  type: str
  choices:
    - Docker
    - Instances
    - Kubernetes
    - None

_derived_keys:
  isContainer:
    type: bool
    value: "{% if flavor == 'docker' or flavor == 'kubernetes' %}true{% else %}false{% endif %}"
  isDocker:
    type: bool
    value: "{% if flavor == 'docker' %}true{% else %}false{% endif %}"
  isInstance:
    type: bool
    value: "{% if flavor == 'instance' %}true{% else %}false{% endif %}"
  isKubernetes:
    type: bool
    value: "{% if flavor == 'kubernetes' %}true{% else %}false{% endif %}"
  isLite:
    type: bool
    value: "{% if flavor == 'none' %}true{% else %}false{% endif %}"

Describe alternatives you've considered
I've tried creating the variable like this, but setting when: false doesn't set the variable at all, resulting in the boolean always resolving to true:
isLite:
  type: bool
  when: false
  default: "{% if flavor == 'none' %}true{% else %}false{% endif %}"

Additional context

It seems to me like you need to template the subdirectory:
_subdirectory: "{{flavor}}"
flavor:
  type: str
  choices:
    - Docker
    - Instances
    - Kubernetes
    - None

Then add one folder per option. Copier will use it as template source.
Would that help?

That would serve only one particular use-case (a single top-level directory to render). Many other nested files/folders could need the same feature, without an option like _subdirectory to work around it.

What about adding a task that removes all dirs except the one you'll use?:
flavor:
  type: str
  choices:
    - Docker
    - Instances
    - Kubernetes
    - None
_tasks:
  - rm -rf {{ "Docker Instances Kubernetes None"|replace(flavor, "") }}

Clever use of replace :smile:
In this particular case the directory names are not the same as the flavor value, so it'd need something more complex, probably a shell script (cross-platform compatibility issues) or a Python script: - {{ _copier_python }} posthook.py" (#612 :heart:).
So yeah, tasks can always be used when the other feature are not enough. But then @verdaatt would still have to repeat {% if flavor == 'docker' or flavor == 'kubernetes' %} over and over again in his templated files. And note that this is a simple condition. It could be way more complex.
Generally, this issue and the older ones mentioned simply show the usefulness of being able to augment the context based on the answers. I know you refused in the past to add such feature, because as you demonstrated, one can always use tasks or macros, etc., so I won't push for it myself, especially since I have my ContextHook extension to do the job :slightly_smiling_face: Seeing that this feature requests pops from time to time, maybe we should dedicate a paragraph in the docs to it, with workarounds, and possibly an example using my ContextHook extension.

Hi @Yajo and @pawamoy. Thanks for your alternative suggestions.
I believe that most of these suggestions won't be a very convenient solution for us though. We need to template folders at several layers of the directory tree, which makes the rm post-task not very practical, even though I agree it was a clever use of replace. It also kind of pollutes the output of your update runs, right?
This also makes templating the subdirectories not really feasible. We'd get lots and lots of repetition to cover all scenarios. All this duplication isn't exactly DRY and doesn't improve code maintainability.
In addition we've also turned a lot of Terraform files into Jinja templates because there are lots of variable output dependencies that also depend on our flavor value. So that would still have these long if-statements.
Looks like the ContextHook extension would do the job I requested. I will look into using this. Totally support the suggestion to add this to the FAQ because as a new user I was unaware of this.
I still believe implementing this feature request would be great for usability. Using the hooks to augment variables feels like a complicated way of doing something that should be extremely easy and part of core functionality. Things that are set in hooks are less transparent to new developers working on the template than stuff that's set in copier.yaml itself. But that's just my two cents and I respect the decision of the people that put in the work to write the code ;-)

Thanks everybody for the interesting and relaxed talk about this subject. 😊
The main problem with this feature is that, although it's true that for file names is a bit cumbersome, it is also true that we'd mostly be adding syntactic sugar. However, inside the files themselves, we already have Jinja doing a great job with macros, imports and includes, so there's no need there.
There could be some key like this:
# copier.yml
_header: |
  {% set isDocker = flavor == 'docker' %}

... and we could prepend that template code to all other templates (filenames or not).
However, that would make file templates less explicit than what they are today, and I kinda prefer explicit over implicit (python zen BTW).
I'd prefer those kind of things to be handled by an extension if really needed.
Another option would be to ask via booleans, but use when to avoid asking if user has chosen already:
# copier.yaml
isDocker:
  type: bool

isKubernetes:
  type: bool
  when: "{{ not isDocker }}"

isInstance:
  type: bool
  when: "{{ not isDocker and not isKubernetes }}"

If you're worried about filename readability, you might find these names more readable: {{ flavor if flavor == 'docker' else '' }}.
Finally, if you really need to make the user choose among templates... then have you considered just doing several templates? So, the user does:
copier copy https://github.com/example/docker-template.git ./docker-dir
copier copy https://github.com/example/k8s-template.git ./kubernetes-dir
...

You can share code between templates using git submodules, and you can include some standard questionary in all of them using sections in copier.yml and including the external section from the submodule.
You can even apply several templates to the same repository:
copier -a .docker.copier-answers.yml https://github.com/example/docker-template.git .
copier -a .k8s.copier-answers.yml https://github.com/example/k8s-template.git .

(Note that the default value for a template's answer file can exist in the template, so you can save the -a part).
Well, I'm just giving you some options. The point is that what you want to achieve is perfectly doable, just you have to deal with that syntax in the file names, but there's really a lot of potential!
I'd really like to pave the way out for newcomers without having to support this extra case, so I'd be glad if you could tell me which of the ideas have been more interesting to you, so we can improve the docs. Actually, if you could open the PR to the docs, that'd be awesome!

Quick update: I tried copier-templates-extensions and used the ContextHook extension to implement this and it works perfectly. Adopted slugify too while I was at it which makes life easier as well!
My context.py for reference for anyone that might stumble upon this ticket while searching for something similar:
# https://github.com/pawamoy/copier-templates-extensions#context-hook-extension
from copier_templates_extensions import ContextHook

class ContextUpdater(ContextHook):
    update = False

    def hook(self, context):
        # Multiple-choice answer conversion to boolean variables
        context["isDocker"]    = context["flavor"] == 'docker'
        context["isK8s"]       = context["flavor"] == 'kubernetes'
        context["isInstances"] = context["flavor"] == 'instances'
        context["isLite"]      = context["flavor"] == 'none'

        context["isNotDocker"]    = context["flavor"] != 'docker'
        context["isNotK8s"]       = context["flavor"] != 'kubernetes'
        context["isNotInstances"] = context["flavor"] != 'instances'
        context["isNotLite"]      = context["flavor"] != 'none'

        # Derived variables
        context["hasContainers"] = (context["flavor"] == 'docker' or context["flavor"] == 'kubernetes')
        context["hasVpc"]        = (context["flavor"] == 'kubernetes' or context["flavor"] == 'instances')

        # Remove variables that should not be used in templating directly
        # del context["flavor"]

I've also gained the new insight that it makes sense for @Yajo to want to prevent scope creep of Copier itself. Perfectly fine for this kind of stuff to live in extensions.
But..... I only found out about copier-templates-extensions through the discussion on this PR. It's not mentioned in the official Copier docs! I didn't know this was possible and available! Which is too bad because it's a great feature!
Can I recommend at the least explaining Copier extendability and referencing copier-templates-extensions in the official Copier docs?
Even better would be to make copier-templates-extensions an official part of the Copier stack and moving it into the copier-org GitHub organization for improved visibility and governance - if @pawamoy agrees to transfer this to the copier-org umbrella of course. This could enable more features being developed as optional extensions out over time.

It's mentioned in the _jinja_extensions option docs (hint), but I agree that it tells nothing of its capabilities 😅 I'll try to add a paragraph to the docs somewhere, to explain this use-case and how this extensions comes in handy. I also don't mind transfering the project to the copier-org, if that's something @Yajo is okay with. I'd still maintain it of course.

Both things sound good to me. 🙂
El mié., 13 abr. 2022 15:26, Timothée Mazzucotelli @.***>
escribió:

It's mentioned in the _jinja_extensions option docs (hint)
https://copier.readthedocs.io/en/latest/configuring/#jinja_extensions,
but I agree that it tells nothing of its capabilities 😅 I'll try to add
a paragraph to the docs somewhere, to explain this use-case and how this
extensions comes in handy. I also don't mind transfering the project to the
copier-org, if that's something @Yajo https://github.com/Yajo is okay
with. I'd still maintain it of course.
—
Reply to this email directly, view it on GitHub
https://github.com/copier-org/copier/issues/629#issuecomment-1098118368,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAHNXDKAADNRWICVF3PZ2CLVE3KSXANCNFSM5R7M2LSA
.
You are receiving this because you were mentioned.Message ID:
@.***>

Oh I didn't see that part! I've read the jinja_extensions section again and as a new user I didn't really understand it and its use case all that well initially. It's a bit brief and indeed misses some example use cases. I considered this a feature for advanced use cases that surely I wouldn't need because this was something basic to me.
Thanks @pawamoy for volunteering to ad that info. I think it would be really insightful to new users to explain how they can extend Copier functionality this way, and how they can use copier-template-extensions to manipulate and enhance data even before Jinja runs.
Also great that you two agree that bringing this under the Copier umbrella makes the product better. Looking forward to the move.
Should I leave this issue open until the docs are updated and maybe copier-template-extensions is moved?

PR sent, let me know what you think @verdaatt @Yajo :slightly_smiling_face:


Why the YOLO-v5 not be released to the project?

The one stage detector YOLO v5 is now released by the author, why didn't you convert it to this project?
There is an official code https://github.com/ultralytics/yolov5

There may be copyright issues and the corresponding paper has not been published yet.

There may be copyright issues and the corresponding paper has not been published yet.

OK～thx


feat: module export for scaffolder action cli template

feat: added support for new backend system in scaffolder actions module
feat: added changeset Signed-off-by: blam<EMAIL_ADDRESS>
Hey, I just made a Pull Request!

:heavy_check_mark: Checklist

[ ] A changeset describing the change and affected packages. (more info)
[ ] Added or updated documentation
[ ] Tests for new functionality and regression tests for bug fixes
[ ] Screenshots attached (for UI changes)
[ ] All your commits have a Signed-off-by line in the message. (more info)

seems to need a test fix


Wall state: The character jumps up sometimes

From Razvan:

if you jump on a wall, say on a wall on the right side for this example, and you release move_right (D) after a few milliseconds, you can see the Player actually jumps up the wall, might have to do with move_and_slide

I can confirm the bug. It happens sometimes, the character hops up before falling back down.

I can't reproduce the bug anymore after merging all PRs from yesterday and doing some refactoring, closing for now


Need better featured images for show case home page

[ ] Hummingbird Library
[ ] Madeon Adventure
[ ] Adsy.me
[ ] Little Alchemy
[ ] Hacker News Reader
[ ] Web Filter
[ ] Merry Pixmas
[ ] Chrome DevSummit
[ ] SVGOMG
[ ] OHH1

@pbakaus any updates on this or ideas of what you want?

I'm a little stuck on this. The 5/3 format (or something) obviously doesn't work terribly well for a mobile screenshot. Open to suggestions.

For now I don't think it's a problem, if more people raise this as an issue we can look at alternatives.


octant-desktop: 0.18.0 -> 0.19.0

Motivation for this change
Bump octant-desktop to 0.19.0
Things done

[X] 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.

Result of nixpkgs-review pr 119118 run on x86_64-linux 1

1 package built:

octant-desktop


Redux style guide not discoverable from React Redux docs

Related to #1001
Potential solutions:

Link to guide in the list of guides in the side navigation pane
Duplicate the content of the style guide to both documentation sites
Migrate the react-redux specific guide only

I assume you meant the Redux style guide, as we don't have one specific to React Redux.
I think migrating over the React-specific stuff is probably the correct approach. Redux still needs to maintain a framework-agnostic stance in its docs, IMHO.

But at the same time, the Redux core docs completely assume you're using React in a lot of places (tutorials, etc).
I'd be okay with mirroring the info, or pointing to it, but I'd kinda like to keep the whole page there as-is.


PyCharm automated install creates an appmap.yml too early

PyCharm 2023.2.1 (Community Edition), MacOS, plugin v.0.50.0
With a fresh PyCharm install, I installed the AppMap plugin from the marketplace, installed AppMap into this freshly-cloned project.
There was no appmap.yml in the project before I ran the installer, but the installer reported the following:
/Users/brikelly/Library/Caches/JetBrains/appland-plugin/appmap/3.96.3/appmap-macos-arm64 install -d /Users/brikelly/code/demos/Flask-Example-Sep-19
Installing AppMap agent for Flask-Example-Sep-19...
? AppMap is about to be installed. Confirm the details below.
  Project type: pip
  Project directory: /Users/brikelly/code/demos/Flask-Example-Sep-19
  Git remote: origin    git@github.com:jainamoswal/Flask-Example.git (fetch)
  Python version: 3.11.4
  Python package directory<EMAIL_ADDRESS>
  Is this correct? (Y/n) ? An appmap.yml configuration file already exists. How should the conflict be resolved? (Use arrow keys)
❯ Use existing
  Overwrite

The appmap.yml file that was auto-generated contained the following content:
appmap_dir: tmp/appmap
language: python
name: Flask-Example-Sep-19
packages:
  - path: modules

The presence of this yml file is used by the installer to determine success, so the "Install AppMap Agent" step went green before I'd finished running the installer.

@brikelly As far as I can tell the CLI installer is creating the file before prompting about the conflict. The JetBrains plugin is only creating appmap.yml for Java projects.
Just executing the CLI on my macOS displayed the message about the conflict, so it seems to create the file on its own.
Please try the following. If it fails, then it's not a problem with the plugin, but with https://github.com/getappmap/appmap-js.
cd /Users/brikelly/code/demos/Flask-Example-Sep-19
rm -f appmap.yml
/Users/brikelly/Library/Caches/JetBrains/appland-plugin/appmap/3.96.3/appmap-macos-arm64 install -d /Users/brikelly/code/demos/Flask-Example-Sep-19

Hi @jansorg, the command line test which you suggested proves that it is a problem with appmap-js, not the IDE plugin. I will open a new issue in that repo.


Error while running : cargo install spl-token-cli

Problem
error: failed to compile spl-token-cli v3.4.0, intermediate artifacts can be found at /tmp/cargo-installUaNXyE.
To reuse those artifacts with a future compilation, set the environment variable CARGO_TARGET_DIR to that path.
Caused by:
failed to download solana-account-decoder v1.18.9
Caused by:
unable to get packages from source
Caused by:
failed to download replaced source registry crates-io
Caused by:
failed to find solana-account-decoder v1.18.9 in path source
Steps
Run: cargo install spl-token-cli
Possible Solution(s)
No response
Notes
No response
Version
cargo 1.77.1 (e52e36006 2024-03-26)
release: 1.77.1
commit-hash: e52e360061cacbbeac79f7f1215a7a90b6f08442
commit-date: 2024-03-26
host: x86_64-unknown-linux-gnu
libgit2: 1.7.2 (sys:0.18.2 vendored)
libcurl: 8.5.0-DEV (sys:0.4.70+curl-8.5.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: Ubuntu 22.04 (jammy) [64-bit]

note: this is an unexpected cargo internal error

The CLI can be installed inside a docker image without the error.

Caused by:
failed to download replaced source registry crates-io

You might have configured source replacement or vendoring somewhere. Check .cargo/config.toml or run cargo +nightly -Zunstable-options config get source --show-origin to find where it is set.
Close as it is likely to be a misconfiguration slipping in. Let us know if it turns out to be a bug in Cargo and we will revisit.


etcd: upgrade go version from 1.21.3 to 1.21.4

To keep etcd projects up to date with the latest patch releases & incorporate the latest security updates.

Please sign DCO

Thanks @serathius. I have fixed the DCO.

Thanks @serathius I have addressed the issue.


🐛 The resolution of the PhotoFile is different than the format photo resolution

What's happening?
When taking a photo the PhotoFile has a different resolution than the format.
Reproduceable Code
let device = useCameraDevice(cameraPosition)
const format = useCameraFormat(device, [{ photoResolution: 'max' }])

useEffect(() => {
    const f =
      format != null
        ? `(${format.photoWidth}x${format.photoHeight} photo /<EMAIL_ADDRESS>video @ ${fps}fps)`
        : undefined
    console.log(`Camera: ${device?.name} | Format: ${f}`)
  }, [device?.name, format, fps])

return
 <ReanimatedCamera
  style={StyleSheet.absoluteFill}
  device={device}
  isActive={isActive}
  ref={camera}
  format={format}
  photo={true}
  video={true}
 />

Relevant log output
Metro:

 LOG  Camera: 1 (FRONT) androidx.camera.camera2 | Format: (3264x2448 photo / 1920x1080@30 video @ 30fps)
 LOG  Media captured! {"isMirrored":true,"path":"/data/user/0/com.mrousavy.camera.example/cache/mrousavy-5497026049884411527.jpg","isRawPhoto":false,"height":1080,"orientation":"portrait","width":1440}
 LOG  Image loaded. Size: 1072x1440

Logcat:

2024-06-27 12:55:12.082 16956-18577 CameraView.takePhoto    com.mrousavy.camera.example          I  Successfully captured 1440 x 1080 photo!

Camera Device
{
  "formats": [],
  "sensorOrientation": "landscape-right",
  "hardwareLevel": "limited",
  "maxZoom": 4,
  "minZoom": 1,
  "maxExposure": 20,
  "supportsLowLightBoost": false,
  "neutralZoom": 1,
  "physicalDevices": [
    "wide-angle-camera"
  ],
  "supportsFocus": true,
  "supportsRawCapture": false,
  "isMultiCam": false,
  "minFocusDistance": 0,
  "minExposure": -20,
  "name": "1 (FRONT) androidx.camera.camera2",
  "hasFlash": false,
  "hasTorch": false,
  "position": "front",
  "id": "1"
}

Device
Samsung Galaxy A53 (Android 14)
VisionCamera Version
4.3.1
Can you reproduce this issue in the VisionCamera Example app?
Yes, I can reproduce the same issue in the Example app here
Additional information

[ ] I am using Expo
[X] I have enabled Frame Processors (react-native-worklets-core)
[X] I have read the Troubleshooting Guide
[X] I agree to follow this project's Code of Conduct
[X] I searched for similar issues in this repository and found none.

Hi!
Thanks for the sponsorship - does this also happen if you disable video?

Hi, thanks for your quick reply. Yes, with only video={false} it still happens. However with video={false} preview={false} the photo does have the same resolution:
 LOG  Media captured! {"isMirrored":true,"path":"/data/user/0/com.mrousavy.camera.example/cache/mrousavy-7410530320673441399.jpg","isRawPhoto":false,"height":2448,"orientation":"portrait","width":3264}

fwiw visionCamera version 4.3.2 with my Galaxy S22 doesn't have this issue. I tried disabling/enabling video and preview, and verified both front and back camera format and photo resolutions match.

Yes good point @JustinHaut, I also tested on a Galaxy A41 and there it does indeed also match.

Okay thanks, good research on preview={false} that is actually quite helpful - I just merged a PR a few days ago that changes the Preview resolution selector to now use the format's video resolution, just like on iOS. (https://github.com/mrousavy/react-native-vision-camera/pull/3026)
This might fix this issue.

@mrousavy I can reproduce it with the example app with video={false} on the following devices (via Android Studio Device Streaming):
Pixel Fold
 LOG  Camera: 0 (BACK) androidx.camera.camera2 | Format: (4000x3000 photo / 3840x2160@60 video @ 60fps)
 LOG  Media captured! {"isMirrored":false,"path":"/data/user/0/com.mrousavy.camera.example/cache/mrousavy-2125636817995574257.jpg","isRawPhoto":false,"height":2160,"orientation":"portrait","width":3840}

Pixel 8 Pro
 LOG  Camera: 0 (BACK) androidx.camera.camera2 | Format: (4000x2000 photo / 3840x2160@60 video @ 60fps)
 LOG  Media captured! {"isMirrored":false,"path":"/data/user/0/com.mrousavy.camera.example/cache/mrousavy-7321524609184097620.jpg","isRawPhoto":false,"height":2160,"orientation":"landscape-right","width":3840}

Pixel 7a
 LOG  Camera: 0 (BACK) androidx.camera.camera2 | Format: (4000x2000 photo / 3840x2160@60 video @ 60fps)
 LOG  Media captured! {"isMirrored":false,"path":"/data/user/0/com.mrousavy.camera.example/cache/mrousavy-2799048483279202367.jpg","isRawPhoto":false,"height":1080,"orientation":"landscape-right","width":1920}

Samsung Galaxy A53
LOG  Camera: 1 (FRONT) androidx.camera.camera2 | Format: (3264x2448 photo / 1920x1080@30 video @ 30fps)
LOG  Media captured! {"isMirrored":true,"path":"/data/user/0/com.mrousavy.camera.example/cache/mrousavy-5497026049884411527.jpg","isRawPhoto":false,"height":1080,"orientation":"portrait","width":1440}

And I cannot reproduce it on these devices:
Samsung Galaxy S23 Ultra
 LOG  Camera: 0 (BACK) androidx.camera.camera2 | Format: (4000x1868 photo / 3840x2160@30 video @ 30fps)
 LOG  Media captured! {"isMirrored":false,"path":"/data/user/0/com.mrousavy.camera.example/cache/mrousavy-9181039376298899107.jpg","isRawPhoto":false,"height":1868,"orientation":"landscape-right","width":4000}
``

SHARP AQUOS sense2 SH-01L

LOG  Camera: 0 (BACK) androidx.camera.camera2 | Format: (864x480 photo / 1920x1080@30 video @ 30fps)
LOG  Media captured! {"isMirrored":false,"path":"/data/user/0/com.mrousavy.camera.example/cache/mrousavy-1548835093455550811.jpg","isRawPhoto":false,"height":480,"orientation":"landscape-right","width":864}

Okay thanks, good research on preview={false} that is actually quite helpful - I just merged a PR a few days ago that changes the Preview resolution selector to now use the format's video resolution, just like on iOS. (#3026)
This might fix this issue.

Good to hear! Let me know if can help in any way once you get to it (like testing or something).

The problem here is that the Formats API on Android is not 100% accurate, which sucks - I know.
On Android, there is no API to figure out which combination of output resolutions is supported. On iOS there is, which is why the format always determines exactly what resolution the photo and video will have.
But on Android, it's always only an estimate, the OS might not be able to support 4k Photo and 4k Video at the same time, only individually.
So in this case, CameraX is smart enough to fall back to a lower resolution, either for photo or for video.
I try to get an accurate list of supported video/photo resolutions here; https://github.com/mrousavy/react-native-vision-camera/blob/9ca6643748c0b39aa0d3e4fd4ebfb9c377adc0c8/package/android/src/main/java/com/mrousavy/camera/core/CameraDeviceDetails.kt#L116-L119
..but again, CameraX might choose a different resolution if it feels like it. I raised this concern with the Google/CameraX team, and after many months they came back to me and said they are going to implement an API that actually gives you accurate resolution (and FPS) combinations - which is what VisionCamera's format API is about.
So we might see this sometime soon, but for now this is all we have on Android unfortunately.

Hey, thanks for your explanation and your time! That's a bummer.... seems kind of stupid for Android to not have such a API, but I don't know too much of the Android camera world so idk 🤷
It does make it really hard to manually select a format, since the format you select can be one that is not compatible thus resulting in the photo resolution (and sometimes aspect ratio) being different than expected. When looking at the Pixel 7a it's a massive difference instead of 4000x2000 photo you get a 1920x1080 photo. So you think you are getting the highest resolution picture while instead you might have a format which actually has a lower photo resolution than maybe a other one where the video resolution is lower (which is compatible). At least if I understand it correctly? 🤔
I was thinking is there a running issue for this in the CameraX issue tracker, maybe we as community could upvote it so that they might prioritize this? Furthermore, I was wondering do you have any advice on how to deal with this? Like should formats with a high resolution and and high video ouput be avoided (because they might be a lie)?
Yet again, thanks for your time.
Cheers,
Dingenis.

Formats with high resolutions should not be avoided, no.
But the useCameraFormat/getAvailableCameraDevices should just be accurate in telling us which video/photo resolution combinations are supported.

Thanks for your reply @mrousavy! Hopefully, the Android team will pick this up somewhere in the near future.
I misunderstood some things on how this works and have since thought about it some more.
So I have one more question, if you would indulge me, I see that the aspect ratio of the preview is set to the format's photo aspect ratio (if using photo={true}) here. Let's say the format is a "invalid" combination thus CameraX falls back on another resolution, then the aspect ratio of the preview should also change to that new aspect ratio. Currently it doesn't, is that because we only know the aspect ratio of the fallback once the user captures a picture?

This has been changed recently and now works exactly like on iOS - preview will try to match the format's video resolution and aspect ratio, with the priority being the aspect ratio.

Hey can you check if release 4.4.0 changed anything?

Hey, thanks again for you effort! I just tested it on my device, and indeed the preview confirms to the format's video resolution and aspect ratio. The issue with the resolution being lower for the ImageCapture then format still happens.
Interestingly, I tried the CameraXBasic sample project (after upgrading it to the latest deps) and there the resolution is high.

The code from the sample project boils down to this:
        val rotation = fragmentCameraBinding.viewFinder.display.rotation

        // CameraProvider
        val cameraProvider = cameraProvider
                ?: throw IllegalStateException("Camera initialization failed.")

        // CameraSelector
        val cameraSelector = CameraSelector.Builder().requireLensFacing(CameraSelector.LENS_FACING_BACK).build()

        // Preview
        val previewResolutionSelector = ResolutionSelector.Builder().setAllowedResolutionMode(ResolutionSelector.PREFER_CAPTURE_RATE_OVER_HIGHER_RESOLUTION).build()
        preview = Preview.Builder()
                .setResolutionSelector(previewResolutionSelector)
                .setTargetRotation(rotation)
                .build()

        // ImageCapture
        val imageCaptureResolutionSelector = ResolutionSelector.Builder().setAllowedResolutionMode(
            ResolutionSelector.PREFER_HIGHER_RESOLUTION_OVER_CAPTURE_RATE
        ).build()

        imageCapture = ImageCapture.Builder()
                .setCaptureMode(ImageCapture.CAPTURE_MODE_MAXIMIZE_QUALITY)
                .setResolutionSelector(imageCaptureResolutionSelector)
                .setTargetRotation(rotation)
                .build()

        // Must unbind the use-cases before rebinding them
        cameraProvider.unbindAll()

        try {
            // A variable number of use-cases can be passed here -
            // camera provides access to CameraControl & CameraInfo
            camera = cameraProvider.bindToLifecycle(
                    this, cameraSelector, imageCapture, preview)

            val previewResolution = preview?.resolutionInfo?.resolution

            if(previewResolution != null)
            {
                Log.i("DingenisCamera", "${previewResolution.width}x${previewResolution.height}")
            }

            val imageCaptureResolution = imageCapture?.resolutionInfo?.resolution

            if(imageCaptureResolution != null)
            {
                Log.i("DingenisCamera", "${imageCaptureResolution.width}x${imageCaptureResolution.height}")
            }

            // Attach the viewfinder's surface provider to preview use case
            preview?.setSurfaceProvider(fragmentCameraBinding.viewFinder.surfaceProvider)
            observeCameraState(camera?.cameraInfo!!)
        } catch (exc: Exception) {
            Log.e(TAG, "Use case binding failed", exc)
        }

Which gives me:

Alright @mrousavy, I think I found the culprit! I was playing around with the configuration of the Preview in the CameraXBasic sample project using Preview.Builder and that's when I noticed when I used setTargetFrameRate with a min of 21 or higher the ImageCapture resolution would change to a low value (1440x1080). Whereas if 20 was used as min (setTargetFrameRate(Range(20, 30))) the higher resolution would be used (4624x3468).
In react-native-vison-camera the format says it has a maxFps of 30, but it seems that is not accurate because when changing the fps camera prop to 20 the format now does work!
 LOG  Camera: 0 (BACK) androidx.camera.camera2 | Format: (4624x3468 photo / 1920x1080@30 video @ 30fps)
 LOG  Media captured! {"isMirrored":false,"path":"/data/user/0/com.mrousavy.camera.example/cache/mrousavy-1755692348160762567.jpg","isRawPhoto":false,"height":3468,"orientation":"portrait","width":4624}

Oh wow interesting, great research!
I'm thinking what a good solution to this would be, maybe I'll just always allow minFps of 20...

Thanks! Good question, well to set it to a min of 20 seems like a simple solution, so i like it 😁😂 . I don't know if there are any other formats which have an even lower maxFps, so that could be a issue.
Another solution could be to change the fps camera prop to a range, in that way the responsibility is with the app maker to select a suitable range. That might be less confusing, since if you set the fps camera prop to 30 but you get 20 one might be confused. That could also just be solved by added some documentation like: "on android the fps is target and is therefore not guaranteed" so I am not sure what is best either.

I can also confirm that lowering the fps also fixes the format on these devices (prob the rest mentioned early too):
Pixel 7a
 LOG  Camera: 0 (BACK) androidx.camera.camera2 | Format: (4624x3472 photo / 3840x2160@60 video @ 30fps)
 LOG  Media captured! {"isMirrored":false,"path":"/data/user/0/com.mrousavy.camera.example/cache/mrousavy-4166822674804579466.jpg","isRawPhoto":false,"height":3472,"orientation":"landscape-right","width":4624}

Pixel Fold
 LOG  Camera: 0 (BACK) androidx.camera.camera2 | Format: (4000x3000 photo / 3840x2160@60 video @ 30fps)
 LOG  Media captured! {"isMirrored":false,"path":"/data/user/0/com.mrousavy.camera.example/cache/mrousavy-128395477126160525.jpg","isRawPhoto":false,"height":3000,"orientation":"portrait","width":4000}

@Dingenis let's do this;

you create an issue in the Google CameraX issue tracker about this, because I believe this is an issue
I create a PR to VisionCamera to lower the min FPS to 20 so it is fixed here

cool?

Created a PR to automatically fix this: https://github.com/mrousavy/react-native-vision-camera/pull/3063

@mrousavy Nice! 🔥
I think this is intended behaviour, looking at the description of setTargetFrameRate it says the following:

Sets the target frame rate range in frames per second for the associated Preview use case.
Device will try to get as close as possible to the target frame rate. This may affect the selected resolutions of the surfaces, resulting in better frame rates at the potential reduction of resolution.
Achieving target frame rate is dependent on device capabilities, as well as other concurrently attached use cases and their target frame rates. Because of this, the frame rate that is ultimately selected is not guaranteed to be a perfect match to the requested target.

The line Device will try to get as close as possible to the target frame rate. This may affect the selected resolutions of the surfaces, resulting in better frame rates at the potential reduction of resolution. does explain this behaviour.
In combination with how react-native-vision-camera determines the max fps here using supportedFrameRateRanges which seems to be not fully accurate. A situation arises where the max FPS is higher than what is supported for that combination and thus the setTargetFrameRate will possibly lower the resolution in order to get closer to the FPS.

Ahh okay - so I think we shouldn't hardcode it to 20 then, but instead use the minFps value here.... wdyt?

Yes, I think that could be nice! I do wonder how that affects the device, for example that high resolution format for my Galaxy A53 has a min fps of 8. Will the device chose to output the highest fps for that resolution if we have a range of [8, 30]? Or will it act "lazy" and chose a lower fps while a higher fps is possible? I mean that sounds insane but it's unclear from the API documentation on how that works.

It seems that it choses the highest value possible (link)

One thing I'm worried about is if devices have multiple overlapping FPS Ranges.
For example, a device could report

[8, 30]
[12, 30]
[30, 60]

I'm not sure if devices do this (could you confirm by logging fps ranges in the native kotlin code for CameraDevice?), but if it does, what would the difference between [8, 30] and [12, 30] be? Should I choose 8 or 12 for min FPS if the user wants 30 FPS?

Sure thing @mrousavy, here you go!
2024-07-11 14:03:25.544  1257-1583  BRAM                    com.mrousavy.camera.example          I  --- START CAMERA: 0 ---
2024-07-11 14:03:25.544  1257-1583  BRAM                    com.mrousavy.camera.example          I  [20, 20]
2024-07-11 14:03:25.544  1257-1583  BRAM                    com.mrousavy.camera.example          I  [24, 24]
2024-07-11 14:03:25.545  1257-1583  BRAM                    com.mrousavy.camera.example          I  [30, 30]
2024-07-11 14:03:25.545  1257-1583  BRAM                    com.mrousavy.camera.example          I  [15, 20]
2024-07-11 14:03:25.545  1257-1583  BRAM                    com.mrousavy.camera.example          I  [10, 30]
2024-07-11 14:03:25.545  1257-1583  BRAM                    com.mrousavy.camera.example          I  [8, 30]
2024-07-11 14:03:25.545  1257-1583  BRAM                    com.mrousavy.camera.example          I  [15, 30]
2024-07-11 14:03:25.545  1257-1583  BRAM                    com.mrousavy.camera.example          I  [15, 15]
2024-07-11 14:03:25.545  1257-1583  BRAM                    com.mrousavy.camera.example          I  --- END CAMERA: 0 ---
2024-07-11 14:03:25.585  1257-1583  BRAM                    com.mrousavy.camera.example          I  --- START CAMERA: 1 ---
2024-07-11 14:03:25.585  1257-1583  BRAM                    com.mrousavy.camera.example          I  [20, 20]
2024-07-11 14:03:25.585  1257-1583  BRAM                    com.mrousavy.camera.example          I  [24, 24]
2024-07-11 14:03:25.585  1257-1583  BRAM                    com.mrousavy.camera.example          I  [30, 30]
2024-07-11 14:03:25.585  1257-1583  BRAM                    com.mrousavy.camera.example          I  [15, 20]
2024-07-11 14:03:25.585  1257-1583  BRAM                    com.mrousavy.camera.example          I  [10, 30]
2024-07-11 14:03:25.585  1257-1583  BRAM                    com.mrousavy.camera.example          I  [8, 30]
2024-07-11 14:03:25.585  1257-1583  BRAM                    com.mrousavy.camera.example          I  [15, 30]
2024-07-11 14:03:25.585  1257-1583  BRAM                    com.mrousavy.camera.example          I  [15, 15]
2024-07-11 14:03:25.585  1257-1583  BRAM                    com.mrousavy.camera.example          I  --- END CAMERA: 1 ---
2024-07-11 14:03:25.617  1257-1583  BRAM                    com.mrousavy.camera.example          I  --- START CAMERA: 2 ---
2024-07-11 14:03:25.617  1257-1583  BRAM                    com.mrousavy.camera.example          I  [20, 20]
2024-07-11 14:03:25.617  1257-1583  BRAM                    com.mrousavy.camera.example          I  [24, 24]
2024-07-11 14:03:25.617  1257-1583  BRAM                    com.mrousavy.camera.example          I  [30, 30]
2024-07-11 14:03:25.617  1257-1583  BRAM                    com.mrousavy.camera.example          I  [15, 20]
2024-07-11 14:03:25.617  1257-1583  BRAM                    com.mrousavy.camera.example          I  [10, 30]
2024-07-11 14:03:25.617  1257-1583  BRAM                    com.mrousavy.camera.example          I  [8, 30]
2024-07-11 14:03:25.617  1257-1583  BRAM                    com.mrousavy.camera.example          I  [15, 30]
2024-07-11 14:03:25.617  1257-1583  BRAM                    com.mrousavy.camera.example          I  [15, 15]
2024-07-11 14:03:25.617  1257-1583  BRAM                    com.mrousavy.camera.example          I  --- END CAMERA: 2 ---
2024-07-11 14:03:25.649  1257-1583  BRAM                    com.mrousavy.camera.example          I  --- START CAMERA: 3 ---
2024-07-11 14:03:25.649  1257-1583  BRAM                    com.mrousavy.camera.example          I  [20, 20]
2024-07-11 14:03:25.649  1257-1583  BRAM                    com.mrousavy.camera.example          I  [24, 24]
2024-07-11 14:03:25.650  1257-1583  BRAM                    com.mrousavy.camera.example          I  [30, 30]
2024-07-11 14:03:25.650  1257-1583  BRAM                    com.mrousavy.camera.example          I  [15, 20]
2024-07-11 14:03:25.650  1257-1583  BRAM                    com.mrousavy.camera.example          I  [10, 30]
2024-07-11 14:03:25.650  1257-1583  BRAM                    com.mrousavy.camera.example          I  [8, 30]
2024-07-11 14:03:25.650  1257-1583  BRAM                    com.mrousavy.camera.example          I  [15, 30]
2024-07-11 14:03:25.650  1257-1583  BRAM                    com.mrousavy.camera.example          I  [15, 15]
2024-07-11 14:03:25.650  1257-1583  BRAM                    com.mrousavy.camera.example          I  --- END CAMERA: 3 ---

From what I can find, is that on Android the camera itself manages it's frame rate internally, so using setTargetFrameRate only gives the camera a target range which acts kinda like a filter (if possible). Outside that it will choose it's own frame rate depending on light conditions and other things, so I think in the case you are describing you would do setTargetFrameRate to [8,30]. Since all formats of the device would qualify for that range, so the camera can choose which one to pick based on other things like quality. Which actually might be better for taking pictures, for example of darker scenes because then the device has the freedom to increase the exposure time or other settings to better adjust.
Say the user really wants 30 fps for like video capture, then I think this is a argument for changing the fps camera prop to a range, if the user really wants 30 fps then they can set a range with that as a min accepting the possibility that the resolution might be lower because of that. Otherwise, the user could set the fps prop to [format.minFps, format.maxFps] giving the camera control over the fps so that it can chose what is best for the other settings like mentioned before.
It would be a lot nicer if each format would have a accurate minFps and maxFps so that one could reliably filter on that and always set the fps range to that, however like you mentioned there is no API on Android to get which combination of settings and outputs are supported so I don't think that can be made.

Awesome thank you so much. Created a PR to use minFps from format: https://github.com/mrousavy/react-native-vision-camera/pull/3073

I now wonder if this is a good idea to always have a low minFps. So now with this change, all existing apps will throttle their frame rates in dark lighting conditions.

So I have two ideas:

Have fps={30} as a prop like now, and then a separate prop like fpsMode="variable" | "fixed", which allows throttling to minFps in variable, and always keeps it constant at fixed.
Have minFps={format.minFps} and maxFps={format.maxFps} as props, and then fps as a prop which just sets both min and max fps props on the JS layer as a wrapper. This is non-breaking, but you can opt into the new API choosing min and max FPS to your likings (probably the one from format)

With option 2 you have full control, with option 1 you cannot select the min FPS - it will always be the minimum from the format. Which might not be a good idea since we don't always want to drop as low as 8, sometimes we just want a smaller range like [20, 30].
I mean yea we can also select a format with that range tbh. But maybe on some devices there are no multiple FPS ranges, only one that says like [1, 30]...

See https://github.com/mrousavy/react-native-vision-camera/pull/3074

Good ideas @mrousavy! 🔥
I think option two is the best option too, giving full control to the user thus enabling them to make the decision and that is non-breaking is a nice bonus! Looking at the PR, I think your latest changes where fps prop can be a number or a tuple is a nice implementation.


Any documentation for mitmproxy dns

Hi
I have used mitmproxy a lot and its great and i have searched every where for any documentation for mitmproxy dns can you please provide some documentation of how to handle dns ?

@mhils Can I take a look at this?


Resource timing

Remove performance analyzer
Add ResourceTiming manager (disabled by default)

I'm working on unit tests and I'll add them before I merge to master.