Inconsistent API for tensor and PIL image for CenterCrop

🐛 Bug
CenterCrop transform crops image center. However, when crop size is smaller than image size(in any dimension), the results are different for PIL.Image input and tensor input.
For PIL.Image, it does padding, while for tensor, the results are completely wrong, due to incorrect crop location computation(negative position values computed).
To Reproduce
Steps to reproduce the behavior:
import torch
import torchvision.transforms as transforms
import torchvision.transforms.functional as TF

pil_x = TF.to_pil_image(torch.randn(3, 24, 24))
transforms.CenterCrop(50)(pil_x).size  # PIL image size is 50x50

tensor_x = torch.randn(3, 24, 24)
transforms.CenterCrop(50)(tensor_x).shape  # Tensor shape is torch.Size([3, 12, 12])

Expected behavior
Mainly, API should be consistent for both inputs or there should be two different methods for PIL & Tensor input(which is IMO less appealing).
Side note - docs should be updated for what happens when crop_size is greater than image size. This condition, I believe is missing in documentation of other crop methods as well.
Environment
Collecting environment information...
PyTorch version: 1.7.0
Is debug build: True
CUDA used to build PyTorch: 10.2
ROCM used to build PyTorch: N/A

OS: Ubuntu 18.04.5 LTS (x86_64)
GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Clang version: Could not collect
CMake version: version 3.10.2

Python version: 3.8 (64-bit runtime)
Is CUDA available: True
CUDA runtime version: Could not collect
GPU models and configuration: GPU 0: Quadro T2000
Nvidia driver version: 450.102.04
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] numpy==1.19.2
[pip3] torch==1.7.0
[pip3] torchaudio==0.7.0a0+ac17b64
[pip3] torchvision==0.8.1
[conda] blas                      1.0                         mkl
[conda] cudatoolkit               10.2.89              hfd86e86_1
[conda] mkl                       2020.2                      256
[conda] mkl-service               2.3.0            py38he904b0f_0
[conda] mkl_fft                   1.2.0            py38h23d657b_0
[conda] mkl_random                1.1.1            py38h0573a6f_0
[conda] numpy                     1.19.2           py38h54aff64_0
[conda] numpy-base                1.19.2           py38hfa32c7d_0
[conda] pytorch                   1.7.0           py3.8_cuda10.2.89_cudnn7.6.5_0    pytorch
[conda] torchaudio                0.7.0                      py38    pytorch
[conda] torchvision               0.8.1                py38_cu102    pytorch

cc @vfdev-5

Just when I though I missed one spot... #3295

Just when I though I missed one spot... #3295

P.S. A lot of the functionality needed is similar to RandomCrop, which provides flexibility of padding, so would be a good idea to consider integration of those options to CenterCrop, since beside the offset computation, rest cropping part would be same.
Applying RandomCrop on both PIL image and tensor image shows same content(but with different offset).
transforms.RandomCrop(50, pad_if_needed=True)(pil_x).show()
transforms.ToPILImage()((transforms.RandomCrop(50, pad_if_needed=True)(tensor_x))).show()

P.S. A lot of the functionality needed is similar to RandomCrop, which provides flexibility of padding, so would be a good idea to consider integration of those options to CenterCrop, since beside the offset computation, rest cropping part would be same.
Applying RandomCrop on both PIL image and tensor image shows same content(but with different offset).
transforms.RandomCrop(50, pad_if_needed=True)(pil_x).show()
transforms.ToPILImage()((transforms.RandomCrop(50, pad_if_needed=True)(tensor_x))).show()

One last thing: I can work on its PR. Let me know if its alright by you.

One last thing: I can work on its PR. Let me know if its alright by you.

One last thing: I can work on its PR. Let me know if its alright by you.

That sounds great! Let's wait for the green light from a member.

One last thing: I can work on its PR. Let me know if its alright by you.

That sounds great! Let's wait for the green light from a member.

@saurabheights Thanks for reporting and for making the issue reproducible. That's definitely a bug. We are happy to accept a PR that solves the problem.
Concerning the proposal of extending the functionality and adjusting the API, I think this should be discussed on a separate issue because we need to assess the backward compatibility.
@vfdev-5 Any thoughts on this?

@saurabheights Thanks for reporting and for making the issue reproducible. That's definitely a bug. We are happy to accept a PR that solves the problem.
Concerning the proposal of extending the functionality and adjusting the API, I think this should be discussed on a separate issue because we need to assess the backward compatibility.
@vfdev-5 Any thoughts on this?

Fun bug with PIL and Tensors. I think it would make sense to raise an issue saying that we can not crop to a larger size.
import torch
import torchvision.transforms as transforms
import torchvision.transforms.functional as TF
import numpy as np

pil_x = TF.to_pil_image(127 * torch.ones(3, 100, 100))
print(transforms.CenterCrop(150)(pil_x).size)  # PIL image size is 50x50
print(np.asarray(pil_x).shape)

tensor_x = torch.randn(3, 100, 100)
print(transforms.CenterCrop(150)(tensor_x).shape)
> (150, 150)
> (100, 100, 3)
> torch.Size([3, 24, 24])

Fun bug with PIL and Tensors. I think it would make sense to raise an issue saying that we can not crop to a larger size.
import torch
import torchvision.transforms as transforms
import torchvision.transforms.functional as TF
import numpy as np

pil_x = TF.to_pil_image(127 * torch.ones(3, 100, 100))
print(transforms.CenterCrop(150)(pil_x).size)  # PIL image size is 50x50
print(np.asarray(pil_x).shape)

tensor_x = torch.randn(3, 100, 100)
print(transforms.CenterCrop(150)(tensor_x).shape)
> (150, 150)
> (100, 100, 3)
> torch.Size([3, 24, 24])

@vfdev-5 You mentioned:-

print(transforms.CenterCrop(150)(pil_x).size)  # PIL image size is 50x50

Did you mean 150x150 here?
PIL seems to give correct output so far, so raising error will cause backward incompatibility. Will that be fine?

@vfdev-5 You mentioned:-

print(transforms.CenterCrop(150)(pil_x).size)  # PIL image size is 50x50

Did you mean 150x150 here?
PIL seems to give correct output so far, so raising error will cause backward incompatibility. Will that be fine?

@vfdev-5 You mentioned:-

print(transforms.CenterCrop(150)(pil_x).size)  # PIL image size is 50x50

Did you mean "150x150" here?

I mean, something like
# x = PIL_image or tensor
with pytest.raises(ValueError, match=r"Crop size should be smaller than input size"):
    transforms.CenterCrop(150)(x)

PIL seems to give correct output so far, so raising error will cause backward incompatibility. Will that be fine?

No, PIL is incorrect also as data is still 100x100.

@vfdev-5 You mentioned:-

print(transforms.CenterCrop(150)(pil_x).size)  # PIL image size is 50x50

Did you mean "150x150" here?

I mean, something like
# x = PIL_image or tensor
with pytest.raises(ValueError, match=r"Crop size should be smaller than input size"):
    transforms.CenterCrop(150)(x)

PIL seems to give correct output so far, so raising error will cause backward incompatibility. Will that be fine?

No, PIL is incorrect also as data is still 100x100.

@vfdev-5 First, I am really sorry if I am mistaken/confused and would really appreciate for your time and explaination here.

No, PIL is incorrect also as data is still 100x100. I mean it didn't pad the image.

There is padding happening to output and not to the input to CenterCrop method, which is expected, the input should not be changed. I say should after glossing over various transform, and I didnt see any inplace ops to modify input.
The first image I1 shows a sample image from PASCAL and CenterCrop output with cropsize larger than image size. It does the padding to output.

The second image I2 shows that even when cropsize is smaller than imagesize, input image to CenterCrop method is not modified. I only ran this test to see if my assumption was correct regarding transform not changing input.

@vfdev-5 First, I am really sorry if I am mistaken/confused and would really appreciate for your time and explaination here.

No, PIL is incorrect also as data is still 100x100. I mean it didn't pad the image.

There is padding happening to output and not to the input to CenterCrop method, which is expected, the input should not be changed. I say should after glossing over various transform, and I didnt see any inplace ops to modify input.
The first image I1 shows a sample image from PASCAL and CenterCrop output with cropsize larger than image size. It does the padding to output.

The second image I2 shows that even when cropsize is smaller than imagesize, input image to CenterCrop method is not modified. I only ran this test to see if my assumption was correct regarding transform not changing input.

First, I am really sorry if I am mistaken/confused and would really appreciate for your time and explaination here.

@saurabheights No worries, I also appreciate your time spending on this issue and checking things ! Thanks a lot !
It is very interesting example and this is not what I got in my tests. Let me recheck. Meanwhile, what is the version of PIL you have ?

First, I am really sorry if I am mistaken/confused and would really appreciate for your time and explaination here.

@saurabheights No worries, I also appreciate your time spending on this issue and checking things ! Thanks a lot !
It is very interesting example and this is not what I got in my tests. Let me recheck. Meanwhile, what is the version of PIL you have ?

No worries and thank you for pad_symmetric, it would work fine here.
Tested on PIL version '6.2.1'(found this is too old, so retested on newer versions :D) and '7.2.0'. And yep, there was padding in both.
Regarding ETA - I will hopefully make changes in 3/4 days(its only few hour work but working first time on vision lib, so might get delayed in setup by a little).

No worries and thank you for pad_symmetric, it would work fine here.
Tested on PIL version '6.2.1'(found this is too old, so retested on newer versions :D) and '7.2.0'. And yep, there was padding in both.
Regarding ETA - I will hopefully make changes in 3/4 days(its only few hour work but working first time on vision lib, so might get delayed in setup by a little).

Sounds good! Please, take a look at our contributing guide which may help you with the dev setup etc. A draft PR is also good such that we can iterate over the implementation if needed and do not hesitate to ask questions here for details.

Sounds good! Please, take a look at our contributing guide which may help you with the dev setup etc. A draft PR is also good such that we can iterate over the implementation if needed and do not hesitate to ask questions here for details.

I have finished the changes here:- https://github.com/pytorch/vision/compare/master...saurabheights:bugfix/center-cropsize-greater-imgsize
I have conda env, with pytorch-nightly installed. I built torchvision from source code.
Now, I have tested transforms, but when running full test suite, I face quite a few errors, some related to C++ ops, etc. Pytest summary(added pic as it will be much easily readable):-

AFAIK, none of any failed test is related to my changes. Shall I make the PR or fix these issues first?

I have finished the changes here:- https://github.com/pytorch/vision/compare/master...saurabheights:bugfix/center-cropsize-greater-imgsize
I have conda env, with pytorch-nightly installed. I built torchvision from source code.
Now, I have tested transforms, but when running full test suite, I face quite a few errors, some related to C++ ops, etc. Pytest summary(added pic as it will be much easily readable):-

AFAIK, none of any failed test is related to my changes. Shall I make the PR or fix these issues first?

@saurabheights The errors you get on the screenshot seem to be related to your development environment, not to your changes. You can try fixing these so that you can contribute easier on the future but if you don't have the time to fix this locally you just confirm that unit-tests that are relevant to your changes pass and send a PR. Our CI will run all the tests anyway, so we will be able to see if anything breaks.

Thanks.
had to install cuda lib and provide CUDA_HOME variable to setup.py. Still had 6 errors, but they were related to GPU going out of mem on bigger networks. I will go ahead and submit PR.
============================================================================================= short test summary info =============================================================================================
FAILED test_models.py::ModelTester::test_fasterrcnn_mobilenet_v3_large_320_fpn_cuda - RuntimeError: CUDA error: CUBLAS_STATUS_EXECUTION_FAILED when calling `cublasGemmEx( handle, opa, opb, m, n, k, &falpha, a...
FAILED test_models.py::ModelTester::test_fasterrcnn_mobilenet_v3_large_fpn_cuda - RuntimeError: CUDA error: CUBLAS_STATUS_EXECUTION_FAILED when calling `cublasGemmEx( handle, opa, opb, m, n, k, &falpha, a, CU...
FAILED test_models.py::ModelTester::test_fasterrcnn_resnet50_fpn_cuda - RuntimeError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 3.82 GiB total capacity; 2.49 GiB already allocated; 20.19 MiB fre...
FAILED test_models.py::ModelTester::test_fasterrcnn_switch_devices - RuntimeError: CUDA out of memory. Tried to allocate 2.00 MiB (GPU 0; 3.82 GiB total capacity; 2.52 GiB already allocated; 6.12 MiB free; 2....
FAILED test_models.py::ModelTester::test_keypointrcnn_resnet50_fpn_cuda - RuntimeError: CUDA out of memory. Tried to allocate 2.00 MiB (GPU 0; 3.82 GiB total capacity; 2.52 GiB already allocated; 6.12 MiB fre...
FAILED test_models.py::ModelTester::test_maskrcnn_resnet50_fpn_cuda - RuntimeError: CUDA error: CUBLAS_STATUS_EXECUTION_FAILED when calling `cublasGemmEx( handle, opa, opb, m, n, k, &falpha, a, CUDA_R_16F, ld...
============================================================================ 6 failed, 1 passed, 559 deselected, 4 warnings in 13.26s =============================================================================


add raw json sqs envelope mapper for incoming messages

In order to process native events published by AWS services (e.g. Amazon Textract) an simple implemenatation of the ISqsEnvelopeMapper can be configured that replaces the DefaultSqsEnvelopeMapper.

Hey, this looks fine so far, but could you add an end to end test?

I tried to use the send_and_receive test as a blueprint but I could not make the tracking features work. can you give me a hint what i'm doing wrong?

@webseb Finally getting this in today. I'll work on the tests and link the update when it exists. Thanks for taking this on, and sorry it took so long to get in!

@webseb The actual functionality is working just fine. I found & fixed at least one issue in the message tracking for the test harness where part of the tracking only happened during deserialization, which you're doing directly in the mapper. Still something else in the test harness not tracking quite right

awesome! thank you very much :-)


chore: add dynamic shapes section in the resnet tutorial

Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Type of change
Please delete options that are not relevant and/or add your own.

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

Checklist:

[ ] My code follows the style guidelines of this project (You can use the linters)
[ ] I have performed a self-review of my own code
[ ] I have commented my code, particularly in hard-to-understand areas and hacks
[ ] I have made corresponding changes to the documentation
[ ] I have added tests to verify my fix or my feature
[ ] New and existing unit tests pass locally with my changes
[ ] I have added the relevant labels to my PR in so that relevant reviewers are notified

@peri044 point this at main

Closing this in favor of https://github.com/pytorch/TensorRT/pull/2904


Issue with k8s.io/docs/tutorials/kubernetes-basics/

This is a Bug Report

Problem:
Proposed Solution:
Page to Update:
https://kubernetes.io/...

Hello, can you provide more details? Thank you!

/assign @thecrudge

/triage needs-information


Add canary deployment demo Hem chart

Codecov Report

Merging #41 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master      #41   +/-   ##
=======================================
  Coverage   56.75%   56.75%
=======================================
  Files           9        9
  Lines        1302     1302
=======================================
  Hits          739      739
  Misses        436      436
  Partials      127      127

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 05ca266...7105794. Read the comment docs.


Error with parameterized Int! argument using reason-apollo-client

I'm not 100% sure this is an issue with the graphql-ppx, there is some chance it is an issue with reason-apollo-client.
I'll just give you the steps to reproduce the error. I won't try explain it more than that, because I'm pretty clueless what it could be. (I have hosted the gql backend on my own server for convenience - http://<IP_ADDRESS>:8000/subgraphs/name/wildcards/integration-spike/graphql - ping me if it doesn't work for any reason)
git clone -b js/gql-ppx-issue git@github.com:wildcards-world/graph-integration-test-spike.git
cd graphql-connection-utils
yarn
yarn re:build
yarn test # This passes!
yarn test2 # This fails!

You'll notice that yarn test runs mocha src/Test.bs.js and yarn test2 runs mocha src/Test2.bs.js.
This is the diff between those two files, Test.re on the left Test2.re on the right (notice they are identical, but in Test2.re I have commented out some code). Everything compiles.

Tldr: the code in green on the right causes a runtime failure.
Thanks for all the work you've put into this PPX! Massive respect to you :)

False alarm - it is an error with thegraph.com . Thank for your patience

https://github.com/graphprotocol/graph-node/issues/1460 - this is the issue


eepromdd: retry reads on I2C arbitration lost errors

These "arbitration lost only" errors seem to be intermittent and in
many cases works to retry them when reading SPDs.  Helps to avoid
deconfiguring a bunch of memory unnecessarily.

This change is

It seems like any errors of this sort would indicate a hardware fail of some kind.  I'm not sure how much I like the idea of ignoring problems.  Perhaps the bus is being run at an unsupported speed or something?

I believe we did run the bus at a different speed on rhesus. However, even if this was due to a hardware failure, it would be hit after the second retry has occurred and the error is present again. Is it your experience that a single error of this kind without further error is an issue?

It seems like any errors of this sort would indicate a hardware fail of some kind.

We had a batch of DIMMs that had SPDs which were slightly flaky.  Decreasing the frequency from 400->100KHz helped but doing that in addition to adding these retries made it a 100% "fix" :)

Merged under https://github.com/open-power/hostboot/commit/34d58dead0cad42868fd06353c109244880a5fa4


Add best-effort single packet send

Add function to attempt to send single packet.
Does not block until sent like other sendSingle function.
Does not guarantee successful transmission.

thanks!


Change SigFlags into an enum.

Addresses #459.
This is a breaking change.
Should SigFlags be renamed to something more sensible?

The PR looks good.
I agree that the name should be different. I cannot think of a good naming convention that would work for all enumerations (e.g. SigEnum just does not tell us anything). Therefore, I would propose to go with SigHow.
In addition, could you please add an entry to CHANGELOG.md describing the breaking change.

I was thinking of something like SigmaskHow since this enum only applies to to the pthread_sigmask and the sigmask (unimplemented in nix) calls but not the rest of the signal functions. In contrast, SigSet applies to both sigaction and sigmask, so it deserves to be labelled generically as Sig. Another possibility is to just use Request as the standard way to specify how-like values in the library like with PtraceRequest, which is actually enumerated in C libc [1], but using How might be advantageous in that it reflects the argument names in libc. Thoughts?
I'm probably making way too much of a fuss about naming though ;)
I'll hold off on the CHANGELOG changes until we figure this out I guess.
[1] http://man7.org/linux/man-pages/man2/ptrace.2.html

I went ahead and pushed a rename to SigmaskHow and an entry in CHANGELOG.md.

@homu r+

:pushpin: Commit e19f142 has been approved by fiveop

:hourglass: Testing commit e19f142 with merge 8cda34d...

:sunny: Test successful - status

:sunny: Test successful - status


Styling of core elements

Project Requirements:

You can use the styles of your choice (colors, fonts, backgrounds, etc.), but try to follow the general layout.
Concentrate on the general layout, rather than the details.
You can use plain CSS or a CSS framework (like Bootstrap) if you prefer.

@abruzy Thank you for your recommendation, it's been added. :D


fix job failed and spec.BackoffLimit logic

What type of PR is this?
/kind bug
What this PR does / why we need it:
Fixes #245
Special notes for your reviewer:

/lgtm

/approve


openssl cmp support with keys inside the tpm using tpm handles to send IR

Hi,
https://github.com/tpm2-software/tpm2-openssl/blob/master/test/ec_genpkey_store_load.c
I'm using above link as the reference for testing the cmp using openssl cmp commands.
Do we have any example for sending IR using the keys present in the tpm handle like handle:0x81010002?pass with authentication .
For example,
I'm trying to create client key and certificate, signed by the root CA from the above example link,

openssl req -provider-path /usr/lib64/ossl-packages/ -provider tpm2 -provider default -propquery '?provider=tpm2' -x509 -key handle:0x81010002?pass -passin pass:Aw2WLz9bHAideywh -sha256 -nodes -config /config/csr.cnf  -keyout test-ca-key.pem -out test-ca-cert.pem
openssl req -provider-path /usr/lib64/ossl-packages/ -provider tpm2 -provider default -propquery '?provider=tpm2' -x509 -sha256 -nodes -config /config/csr.cnf -CAkey handle:0x81010002?pass -passin pass:Aw2WLz9bHAideywh -CA test-ca-cert.pem -key test-server-key.pem -out test-server-cert.pem

These quoted commands are working, but the below command is failing
failed command:
openssl req -provider-path /usr/lib64/ossl-packages/ -provider tpm2 -provider default -propquery '?provider=tpm2' -x509 -sha256 -nodes -config /config/csr.cnf  -CAkey handle:0x81010002?pass -passin pass:Aw2WLz9bHAideywh -CA test-ca-cert.pem -keyout test-client-key.pem -out test-client-cert.pem
And it throws error,
PROVIDER INIT
DIGEST SHA1 GET_PARAMS [ blocksize size xof algid-absent ]
DIGEST SHA256 GET_PARAMS [ blocksize size xof algid-absent ]
DIGEST SHA384 GET_PARAMS [ blocksize size xof algid-absent ]
RSA GEN INIT rsa 3
RSA GEN_SET_PARAMS [ bits ]
RAND NEW
RAND GET_CTX_PARAMS [ state ]
Warning: generating random key material may take a long time
if the system has a poor entropy source
RSA GEN 2048 bits
RSA GEN parent: primary 0x40000001
WARNING:esys:src/tss2-esys/api/Esys_CreatePrimary.c:400:Esys_CreatePrimary_Finish() Received TPM Error
ERROR:esys:src/tss2-esys/api/Esys_CreatePrimary.c:135:Esys_CreatePrimary() Esys Finish ErrorCode (0x000009a2)
RSA FREE
req: Error generating RSA key
4061B942C67F0000:error:40000002:tpm2:tpm2_build_primary:authorization failure:src/tpm2-provider-pkey.c:316:
RAND FREE
Can you help us here by sharing the reference incase if the keys are stored in the tpm for using them during cmp IR.
Is there such support provided?

I enabled the default and tpm2 provider via the OSSL configuration file. You should also be able to use the providers by appending the following to the command below: -provider default -provider tpm2
Here is a config I used that worked for me. You need to change your values accordingly and create a new private key first.
#workflow.cnf:
[ra]
server = cmp-endpoint.example:443

[imprint]
cmd = ir

#your endpoint path:
path = .well-known/cmp/initialization/ldevidgenericcert/default

own_trusted = store/trusted/vendor/vendor_root_ca.crt, store/trusted/vendor/vendor_intermediate_ca.crt
cert = store/own/idevid/my_device.crt
key = handle:0x81010002
#keypass = pass:xxxx

tls_cert = $cert
tls_key = $key
#tls_keypass = $keypass

# all certs to trust the domain go in here:
trusted = store/trusted/domain/ldevid-chain.pem
# all certs to trust the cmp server go in here:
tls_trusted = store/trusted/infrastructure/infrastructure_root_ca.cer, store/trusted/infrastructure/infrastructure_intermediate_ca.cer

# assume you have generated a new key first:
newkey = handle:0x81010003
#newkeypass = $keypass

reqexts = empty
policies = empty
certout = store/own/ldevid_generic/my_device.pem
cacertsout = store/trusted/domain/ldevid_generic_ca_chain.pem

[empty]

Run it with:
openssl cmp -config workflow.cnf -section ra,imprint

Hi @Tyrrx , Thanks for the reply.

I'm running this command for IR by using the client authentication option as extracerts and it is failing due to,
CMP error: missing trust anchor
CMP error: error validating protection

openssl cmp -provider-path /usr/lib64/ossl-packages/ -provider tpm2 -provider default -propquery '?provider=tpm2,tpm2.digest!=yes' -cmd ir -server <IP_ADDRESS>:8081/pkix/ -recipient "/C=IN/O=CI/CN=SubCA" -key handle:0x81010002?pass -keypass pass:ynM67sdZjEJesWk6 -cert vendorcert.pem -extracerts rootCA.pem,factory.pem -newkey handle:0x81010004?pass -newkeypass pass:ynM67sdZjEJesWk6  -subject "/C=IN/O=CI/CN=SubEE" -certout test-my-cert1.pem -cacertsout test-my-ca1.pem -verbosity 8
cmp_main:apps/cmp.c:2833:CMP info: using section(s) 'cmp' of OpenSSL configuration file '/etc/pki/tls/openssl.cnf'
cmp_main:apps/cmp.c:2842:CMP info: no [cmp] section found in config file '/etc/pki/tls/openssl.cnf'; will thus use just [default] and unnamed section if present
PROVIDER INIT
DIGEST SHA1 GET_PARAMS [ blocksize size xof algid-absent ]
DIGEST SHA256 GET_PARAMS [ blocksize size xof algid-absent ]
DIGEST SHA384 GET_PARAMS [ blocksize size xof algid-absent ]
STORE/OBJECT OPEN handle:0x81010002?pass
STORE/OBJECT SET_PARAMS [ properties ]
STORE/OBJECT SET_PARAMS [ expect ]
STORE/OBJECT LOAD
STORE/OBJECT LOAD pkey
STORE/OBJECT LOAD found RSA
RSA LOAD
RSA GET_PARAMS [ bits security-bits max-size ]
RSA HAS 1
STORE/OBJECT CLOSE
setup_protection_ctx:apps/cmp.c:1448:CMP warning: will not authenticate server due to missing -secret, -trusted, or -srvcert
DER DECODER DECODE
CMP DEBUG: trying to build chain for own CMP signer cert
CMP DEBUG: success building chain for own CMP signer cert
DER DECODER DECODE
DER DECODER DECODE
STORE/OBJECT OPEN handle:0x81010004?pass
STORE/OBJECT SET_PARAMS [ properties ]
STORE/OBJECT SET_PARAMS [ expect ]
STORE/OBJECT LOAD
STORE/OBJECT LOAD pkey
STORE/OBJECT LOAD found RSA
RSA LOAD
RSA GET_PARAMS [ bits security-bits max-size ]
RSA HAS 1
STORE/OBJECT CLOSE
setup_client_ctx:apps/cmp.c:2009:CMP info: will contact http://<IP_ADDRESS>:8081/pkix/
RAND NEW
RAND NEW
RAND GET_CTX_PARAMS [ max_request ]
RAND GENERATE
CMP DEBUG: Starting new transaction with ID=9C:18:57:FA:6D:06:21:8B:19:C2:7F:93:D7:05:93:33
RAND GET_CTX_PARAMS [ max_request ]
RAND GENERATE
ENCODER tss PrivateKeyInfo/der DOES_SELECTION 0x86
ENCODER tss PrivateKeyInfo/der DOES_SELECTION 0x86
ENCODER tss PrivateKeyInfo/der DOES_SELECTION 0x86
ENCODER tss PrivateKeyInfo/der DOES_SELECTION 0x86
ENCODER tss PrivateKeyInfo/pem DOES_SELECTION 0x86
ENCODER tss PrivateKeyInfo/pem DOES_SELECTION 0x86
ENCODER tss PrivateKeyInfo/pem DOES_SELECTION 0x86
ENCODER tss PrivateKeyInfo/pem DOES_SELECTION 0x86
ENCODER rsa pkcs1/der DOES_SELECTION 0x86
ENCODER rsa pkcs1/pem DOES_SELECTION 0x86
ENCODER rsa SubjectPublicKeyInfo/der DOES_SELECTION 0x86
ENCODER rsa SubjectPublicKeyInfo/pem DOES_SELECTION 0x86
ENCODER rsa SubjectPublicKeyInfo/der ENCODE 0x86
RSA GET_PARAMS [ default-digest mandatory-digest ]
SIGN DIGEST_INIT rsa MD=SHA2-256
SIGN GET_CTX_PARAMS [ algorithm-id ]
SIGN DIGEST_SIGN estimate
SIGN DIGEST_SIGN
RSA HAS 2
RSA NEW
RSA IMPORT [ n e ]
RSA MATCH 0x6
SIGN DIGEST_INIT rsa MD=SHA256
SIGN GET_CTX_PARAMS [ algorithm-id ]
SIGN DIGEST_SIGN estimate
SIGN DIGEST_SIGN
CMP info: sending IR
CMP DEBUG: connecting to CMP server <IP_ADDRESS>:8081
CMP DEBUG: finished reading response from CMP server
CMP info: received IP
DIGEST NEW
DIGEST INIT
DIGEST UPDATE
DIGEST FINAL
DIGEST FREE
DIGEST NEW
DIGEST INIT
DIGEST UPDATE
DIGEST FINAL
DIGEST FREE
DIGEST NEW
DIGEST INIT
DIGEST UPDATE
DIGEST FINAL
DIGEST FREE
CMP DEBUG: validating CMP message
CMP info: no trust store nor pinned server cert available for verifying signature-based CMP message protection
CMP error: missing trust anchor
CMP error: error validating protection
CMP DEBUG: disconnected from CMP server
RSA FREE
RSA FREE
RSA FREE
RAND FREE
RAND FREE
PROVIDER TEARDOWN

But using the client authentication option as -secret and -ref  it is writing out the cert and cacert.
openssl cmp -provider-path /usr/lib64/ossl-packages/ -provider tpm2 -provider default -propquery '?provider=tpm2,tpm2.digest!=yes' -cmd ir -server <IP_ADDRESS>:8081/pkix/ -recipient "/C=IN/O=CI/CN=SubCA" -key handle:0x81010002?pass -keypass pass:ynM67sdZjEJesWk6 -cert vendorcert.pem -ref 1234 -secret pass:AB-CD3E-FgHI-JkLM -newkey handle:0x81010004?pass -newkeypass pass:ynM67sdZjEJesWk6  -subject "/C=IN/O=CI/CN=SubEE" -certout test-my-cert1.pem -cacertsout test-my-ca1.pem -verbosity 8

Can you help us here what needs to be done when extracerts option is used for client authentication?
Is there any way i can achieve it using the extracerts option?

Hi,
How to use the extracerts output as a trust anchor to validate the IR request? Is that possible?


Getting an error from Ionic Angular

Hi,
Trying to use the module from Ionic over Angular, I'm getting an error as in the link below.
Any ideas?
Cheers.
https://cdn-enterprise.discourse.org/ionicframework/uploads/default/original/3X/0/c/0c47de6f934ffce6fdb8b9f738e0a4cd87fe68b0.png

Same issue when trying to import into React app. Works perfectly well if trying in node environment. Is it meant to work in browser at all?

Try my "fork" at https://www.npmjs.com/package/google-translate-api-without-node -- I've been successfully using this in a webpacked browser app without issues, uses jQuery for requests.
Ironically enough though, it started producing an error a little while back, maybe a few months ago. Perhaps I need to sync up with the main repo again?

Thanks deniiislysenko.
Tried it and now I get -

XMLHttpRequest cannot load https://translate.google.com/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access.

Tried from Chrome as well as from Cordova on IPad.
Any idea?

Same issue here - since translate.google.com does not send CORS header, it won't work from any other domain.

I am using it in a chrome extension and I think there is a way to avoid
CORS issues with that. Not sure about your use case.
On Fri, Aug 25, 2017, 11:56 Andrey Gruniov<EMAIL_ADDRESS>wrote:

Same issue here - since translate.google.com does not send CORS header,
it won't work from any other domain.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/matheuss/google-translate-api/issues/32#issuecomment-325008657,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AE4I_5APt-9VJTUaemfeQIp8RCGQnRvvks5sbxj6gaJpZM4O6Xyu
.

Not sure. I tried it a while ago with no success. As a quick workaround, I'm going to use this module in a small express app and serve the result to front end.

If you install the CORS Chrome extension, it will work.
When deployed to mobile using cordova, it won't.
On Sat, Aug 26, 2017 at 2:43 AM, Andrey Gruniov<EMAIL_ADDRESS>wrote:

Not sure. I tried it a while ago with no success. As a quick workaround,
I'm going to use this module in a small express app and serve the result to
front end.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/matheuss/google-translate-api/issues/32#issuecomment-325017959,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AdIKCyAN8KN6-8qtS0erUjVe1h5t6uA9ks5sbyPFgaJpZM4O6Xyu
.

I created a simple server with express using google-translate-api, so make a deploy on heroku, wedeploy, etc and solve the problem with prototype and cors. Here the project: https://github.com/brenopolanski/server-google-translate-api

I want to implement it in my Ionic(v1) app. How can I manage to do that? any sample codes? or is it a normal http request?..


Option request: align case alternatives like single-line arguments

From @acjay on July 15, 2015 19:9
For code that looks like:
(option1, option2) match {
  case (Some(Object(_, "property value")), _) |
    (None, None)                                       => 5
  case (None, Some(Object(_, "other property value"))) => 6
  case _                                               => 7
}

It gets rewritten to:
(option1, option2) match {
  case (Some(Object(_, "property value")), _) |
    (None, None) => 5
  case (None, Some(Object(_, "other property value"))) => 6
  case _                                               => 7
}

It would be nice to have the option to have case statements with multi-line LHS to still have their RHS aligned
Copied from original issue: daniel-trinh/scalariform#71

Duplicate of #70 (or at least same principle, align arrows of multline case statements)


Feature request:  Ignore duplicates

If a tag coming back from the results already exists, it should not add a duplicate entry

Hi @risadams this latest release should get rid of duplicates tags being added to a document

Hi @risadams this latest release should get rid of duplicates tags being added to a document

thank you very much!


[Installation] Gate FastAPI version for Python 3.8

Upgrading FastAPI and Pydantic fails to solve #8212 for Python 3.8 users. To avoid this, this PR updates the dependencies to use an older version of FastAPI for Python 3.8.
FIX #8450

Would it makes sense to drop 3.8, since it is approaching EOL?
https://devguide.python.org/versions/
This would make maintaining a lot easier afaict

We have plans to drop it when pytorch does so. See also https://github.com/pytorch/pytorch/issues/120718


[client-api-schema] PushMessage Behavior

Problem description :confused:
The PushMessage return value is currently defined as:
type PushMessageReturn = {
    success: boolean;
}

Currently, this reflects the browser wallet implementations, where the return value indicates whether or not the message was properly saved. In the server-wallet, by contrast, PushMessage will return a MultipleChannelResult defined as:
type MultipleChannelResult = Promise<{ outbox: Outgoing[]; channelResults: ChannelResult[] }>;

Describe the solution you'd like :rocket:
The behavior from the PushMessage rpc method should be environment agnostic. I'm not sure the best way to include the outbox information from the server-wallet, but it seems the general pattern should be to return something more similar to the MultipleChannelResult instead of the current boolean value.
It's possible that the browser wallets could also easily incorporate the outbox field, but if not i think the best route is to return an object of the type:
type PushMessageReturn = {
    channelResults: ChannelResult[];
}

Describe alternatives you've considered
None
Additional context
Summary
Pros

Consistent rpc interface across wallet environments
Easily interpretable results
Can be extended depending on the wallet interface

Cons

Likely not optimized for the environment
outbox field does not easily map between environments

Curious what @tomclose and @andrewgordstewart think about the browser wallet adopting the server-wallet's push message signature


[HOW-TO] camera stuck waiting for image

Please only ask one question per issue!
Describe what it is that you want to accomplish
I use the camera in a python function to capture QRCODES.
first time the function is called, it works fine and when I close the Loop I use:
picam.stop()
picam.close()
But when I call again the function in the same script, the camera starts but stay stuck when trying to get array from it:
im = camera.capture_array()
stuck forever until I CTRL+C where it tells me that the error is:
File "/home/pi/camera.py", line 271, in
im = camera.capture_array()
File "/usr/local/lib/python3.9/dist-packages/picamera2/picamera2.py", line 1188, in capture_array
return self.execute_or_dispatch(partial(self.capture_array, name), wait, signal_function)
File "/usr/local/lib/python3.9/dist-packages/picamera2/picamera2.py", line 1043, in _execute_or_dispatch
return self.wait()
File "/usr/local/lib/python3.9/dist-packages/picamera2/picamera2.py", line 995, in wait
result = self._future.result()
File "/usr/lib/python3.9/concurrent/futures/_base.py", line 435, in result
self._condition.wait(timeout)
File "/usr/lib/python3.9/threading.py", line 312, in wait
waiter.acquire()
Do you know or someone has got this issue already before?
Describe alternatives you've considered
Tried to setup special settings back the the camera but seems that nothing is changing here
Additional context
Add any other context or screenshots about the request here.

Hi, could you perhaps include a small self-contained test case that demonstrates the problem? That would help to understand exactly what you're doing. Thanks!

this is the message from the camera after 30 min waiting:
[1:01:24.095017947] [11149]  INFO Camera camera.cpp:1029 configuring streams: (0) 640x480-XBGR8888
[1:01:24.096330720] [11146]  INFO RPI raspberrypi.cpp:763 Sensor: /base/soc/i2c0mux/i2c@1/arducam_64mp@1a - Selected sensor format: 1280x720-SBGGR10_1X10 - Selected unicam format: 1280x720-pBAA
[1:03:46.600185911] [11146]  WARN V4L2 v4l2_videodevice.cpp:1967 /dev/video0[35:cap]: Dequeue timer of 142044000.00us has expired!
[1:03:46.600385482] [11146] ERROR RPI raspberrypi.cpp:1895 Unicam has timed out!
[1:03:46.600417704] [11146] ERROR RPI raspberrypi.cpp:1896 Please check that your camera sensor connector is attached securely.
[1:03:46.600440444] [11146] ERROR RPI raspberrypi.cpp:1897 Alternatively, try another cable and/or sensor.
maybe camera.close() is not freeing the bus of the camera. Any idea how to do that ?
Thank you

Hi, thanks for the update. Is there any way you can simplify it that so that it just contains the camera code? I don't have pygame installed, and it would be easier if the script has no dependencies on the barcodes or anything else. Thanks!
In the absence of that, the obvious things to check for would be the script stopping the camera (and asking for another frame), or possibly camera lock-ups caused by long cables (I would consider 0.5m to be "long").

Hi
Without pygame:
from pyzbar import pyzbar
from picamera2 import Picamera2, CameraConfiguration, Preview
import re
camera = Picamera2()
video_config = camera.create_video_configuration({"size": (640, 480)})
camera.start()
refocus = 0
while loop:
im = camera.capture_array()
gray = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY)
frame = gray
barcodes = pyzbar.decode(frame)
for barcode in barcodes:
x, y , w, h = barcode.rect
barcode_info = barcode.data.decode('utf-8')
cv2.rectangle(frame, (x, y),(x+w, y+h), (0, 255, 0), 2)
font = cv2.FONT_HERSHEY_DUPLEX
cv2.putText(frame, barcode_info, (x + 6, y - 6), font, 2.0, (255, 255, 255), 1)
s = barcode_info
substring = re.search(r'.?.com/(.)?utm.*', s)
if substring.group(1) in taglist:
print("already in list")
else:
											taglist.append(substring.group(1))

											loop = False
											camera.stop()
											camera.close()

			refocus = refocus + 1
			if refocus == 80:
							refocus = 0
							camera.set_controls({"AfTrigger": 0})

Thanks for the new version. Would you be able to fix the formatting so that I can copy and paste it, please? Thank you.

Hi:
This is a straight run program to test it and reproduce exactly the problem I am having:
testcamera.txt
"""
sudo apt install -y python3-kms++
sudo apt install -y python3-pyqt5 python3-prctl libatlas-base-dev ffmpeg
sudo pip3 install numpy --upgrade
sudo pip3 install picamera2==0.3.2
pip install pyzbar
pip install regex
pip install opencv-python
"""

from pyzbar import pyzbar
from picamera2 import Picamera2, CameraConfiguration, Preview
import re
import cv2

taglist = []
choice = "y"
camera = Picamera2()
video_config = camera.create_video_configuration({"size": (640, 480)})
camera.start()

while choice == "y":
  loop = True
  refocus = 0

  choice = input("one more scan? (y/n): ")

  while loop:
    im = camera.capture_array()
    frame = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY)
    barcodes = pyzbar.decode(frame)
    print(frame)
    for barcode in barcodes:
      x, y , w, h = barcode.rect
      barcode_info = barcode.data.decode('utf-8')
      cv2.rectangle(frame, (x, y),(x+w, y+h), (0, 255, 0), 2)
      font = cv2.FONT_HERSHEY_DUPLEX
      cv2.putText(frame, barcode_info, (x + 6, y - 6), font, 2.0, (255, 255, 255), 1)
      s = barcode_info
      substring = re.search(r'.*?\.com/(.*)\?utm.*', s)
      if substring.group(1) in taglist:
        print("already in list")
      else:
        taglist.append(substring.group(1))
        loop = False
        camera.stop()
        camera.close()
        print(substring.group(1))
    refocus = refocus + 1
    if refocus == 80:
      refocus = 0
      camera.set_controls({"AfTrigger": 0})

thank you

Hi, thanks for posting the new version. I went through the code and deleted everything that was not related to the camera. I replaced the while choice == "y": by for i in range(2): just to make it go round the loop twice. Anyway, I ended up with this:
from picamera2 import Picamera2

camera = Picamera2()
camera.start()

for i in range(2):
    im = camera.capture_array()
    camera.stop()
    camera.close()

Could you confirm that this looks equivalent in terms of the precise calls being made to the camera system? Thanks!

Hi
Yes it does look similar.
On another level, I found a topic on stack overflow that mentioned that once the camera is closed, you need to open a new instance but it was not stable. (in my case once the camera is closed it doesn't want to open new instances as camera bus is busy ...)
I have corrected my code by not closing the camera.Just changing the configuration depending on settings required and using camera.start() and camera.stop() I manage to make it work (for my use)
camera.close() has to be used only if you hope to create a new camera instance later on in your code. But even for this I found it buggy sometimes.

Generally speaking I wouldn't be recreating and closing the Picamera2 object if you can help it, nor would I be re-configuring the camera every time as that only de- and re-allocates a ton of memory that carries slight risks of failure depending on whatever else the system is doing. Similarly, maybe you don't even need to stop and re-start the camera every time (it's actually quite slow) - but that's up to you and your application of course!
If you do want to shutdown and restart the camera system the with idiom is often quite nice, so I'd consider something like (taking my simplified example)
from picamera2 import Picamera2

with Picamera2() as camera:
    camera.start()
    for i in range(2):
        im = camera.capture_array()
        # lots more code...

Also I wanted to mention that you created a configuration but never actually applied it. You probably wanted a camera.configure(video_config) after video_config = ....
Lastly, if you have cases that are not working properly and can create nice simple examples like I have done, then please post them. Thanks!

Thank you so much for your Help David, I will apply your method and leave the camera open all along the system. It is a first time for me using Picamera, I worked with webcam before most of the time.
Thank you so much

Hi, we have done some work in this area though it's not available in Picamera2 yet. However I will look into it when I have some time though I have a number of other things ahead of this in the queue.
Having said that, I should add that I'm very nervous about this sort of approach. If there is a problem with signal integrity, then all I can say is that "all bets are off". Almost anything could happen. A camera lock-up is just one (probably a typical) symptom. But the lock-ups might be "recoverable", or they might not be, or you might get a mixture.  I'll see what I can do, but you're in a much better situation if you don't have random camera failures.

Hello,
I am having the same issue now when trying to capture and image with capture_array() getting stuck and freezing up my app
Thanks

Is the system reporting camera timeouts? What kind of camera are you using, and what kind of Pi? How long is your ribbon cable? Please can you include any console error messages that you are seeing. It's also helpful if you can include code for the most minimal example that demonstrates the problem if you can - I would usually expect this to be half a dozen to a dozen lines of code, or thereabouts. Thank you.

Hi @davidplowman, no, the system is not reporting any timeouts. The program freezes and,  similar to the original post, I have to use a keyboard interrupt to get the same waiter.acquire() error.
For context, I have established a simple pyqt5 app showing a live Arducam preview. One the app, I have a toggle that when checked is supposed to capture_array() from the camera and begin edge detection of the capture array. When the code gets to capturing the array, it freezes up. I have tried to close the camera and create a new camera instance before imaging, I have also tried to switch over to cv.VideoCapture but comes back with a blank image
List of equipment and packages

Waveshare CM4-ID-BaseB
raspberry pi bullseye 64bit
Arducam IMX477
Python 3.9
OpenCV-Headless v3.6.8
pyqt5 v5.15.12
Picamera2

`class class1(QWidget):
# Imports the image from Picamera Preview
def __init__(self):
    super().__init__()

def theThing(self):

    # Capture an image array for circle detection
    img = picamera.capture_array("main")

   #rest of code for OpenCV to use.

def do_something_toggled(self, checked):
if checked:
        # Run the theThing from class1
        class1.theThing(self)

    else:
        # rest of code `

Hi, the first things I would do are:

Does libcamera-hello work correctly? This is the very first thing to check.
Does this simple Picamera2 app work correctly?
Does this simple Picamera2 Qt app work correectly?
Have you read section 8.5 of the manual? It wasn't clear to me whether you were using non-blocking calls correctly.

Hi @davidplowman , thanks for your quick response. I have tried all 3 test codes, and they all work on my end. Additionally, I have gone through the documentation of PiCamera and tried to implement the signal_function.connect solve that was posted here. by using:
img= capture.array('main, signal_function = qpicamera2.signal_done)`
This did get me past this line of code, as I added a print statement afterward to doublecheck, but I am unsure if this took an actual image since I am getting an AttributeError: 'Job' object has no attribute 'shape' when the image is supposed to be passed into the openCV edge detection function as shown below.
        # Capture an image array for circle detection
        img = picam2a.capture_array("main", signal_function = qpicamera2a.signal_done)
       print('array taken')

        # Extract the dimensions of the image (height, width, and channels)
        height, width, channels = img.shape **<---- THIS IS WHERE THE ERROR IS RAISE**

        # Resize image for analysis
        imgReSize = cv.resize(img, (2028, 1520))

I'm afraid I'm struggling a bit to understand what code you're actually running. If you were able to create a minimal example - preferably no more than a dozen or so lines of code - that demonstrates the problem, that would be helpful.
The only thing I would add is that when you can capture_array asynchronously, you don't get back an image immediately. You have to wait for control to be returned to you through the Qt event loop, or wait for the result. As I say, it depends rather what your code is trying to do... Thanks!

Hi @davidplowman,
I have adapted your Picamera2 Qt app example to show my issue. The code is below
Let me know if you have further questions
`from PyQt5 import QtCore
from PyQt5.QtWidgets import (QApplication, QHBoxLayout, QLabel, QPushButton,
QVBoxLayout, QWidget)
from picamera2 import Picamera2
from picamera2.previews.qt import QGlPicamera2
def post_callback(request):
label.setText(''.join(f"{k}: {v}\n" for k, v in request.get_metadata().items()))
picam2 = Picamera2()
picam2.post_callback = post_callback
picam2.configure(picam2.create_preview_configuration(main={"size": (800, 600)}))
app = QApplication([])
def on_button_clicked():
button.setEnabled(False)
# Capture an image array for openCV
picam2.capture_array("main", signal_function=qpicamera2.signal_done)
print('picam2a captured array')

# Extract the dims for openCV
height, width, channels = img.shape  # Attribution error raised: Job object has no attribute 'shape'

def capture_done(job):
picam2.wait(job)
button.setEnabled(True)
qpicamera2 = QGlPicamera2(picam2, width=800, height=600, keep_ar=False)
button = QPushButton("Click to capture JPEG")
label = QLabel()
window = QWidget()
qpicamera2.done_signal.connect(capture_done)
button.clicked.connect(on_button_clicked)
label.setFixedWidth(400)
label.setAlignment(QtCore.Qt.AlignTop)
layout_h = QHBoxLayout()
layout_v = QVBoxLayout()
layout_v.addWidget(label)
layout_v.addWidget(button)
layout_h.addWidget(qpicamera2, 80)
layout_h.addLayout(layout_v, 20)
window.setWindowTitle("Qt Picamera2 App")
window.resize(1200, 600)
window.setLayout(layout_h)
picam2.start()
window.show()
app.exec()`

Hi, thanks for posting the code.
I would guess that this:
def on_button_clicked():
    button.setEnabled(False)

    # Capture an image array for openCV
    picam2.capture_array("main", signal_function=qpicamera2.signal_done)
    print(' Captured array') # A check to make sure the capture array happened

    # Extract the dims for openCV
    height, width, channels = img.shape  # Attribution error raised: Job object has no attribute 'shape'

def capture_done(job):
    picam2.wait(job)
    button.setEnabled(True)

needs to look like this:
def on_button_clicked():
    button.setEnabled(False)

    # Capture an image array for openCV
    picam2.capture_array("main", signal_function=qpicamera2.signal_done)

def capture_done(job):
    img = picam2.wait(job)
    print(' Captured array') # A check to make sure the capture array happened

    # Extract the dims for openCV
    height, width, channels = img.shape  # Attribution error raised: Job object has no attribute 'shape'

    button.setEnabled(True)

The reason is that once capture_array returns, the capture hasn't (necessarily) happened yet. You
have to wait until control is returned to you in the function that you have connected to the Qt signal.

Hi @davidplowman , this worked, but only in this format. When implemented in a class, I recieve a NameError: name 'job' is not defined. Have you seen this before?

I'm afraid it's difficult for me to understand what "when implemented in a class" means, can you be more precise? Usually, it is helpful if a minimal (that is, as small as possible) code example can be submitted that demonstrates the problem.

Thanks for the code.
To make it work I found I had to move self.setup_ui() to just below the line self.qpicamera2 = .... Once I'd done this, it seemed to work as expected. Are you able to try that?


An unexpected token ""UNIQUE"" was found against DB2 11.5 in identity > db2.sql

Suggested Labels
Affected/ IS 5.10.0 M8 Snapshot
Type/ Bug
Priority/ High
Severity / Major
Steps to Reproduce
Source the following DB2 script against DB2 11.5
/dbscripts/identity/db2.sql
Observation
"SQL Error [42601]: An unexpected token ""UNIQUE"" was found following ""ENANT_ID, NAME)
    "".  Expected tokens may include:  "","".. SQLCODE=-104, SQLSTATE=42601, DRIVER=4.25.13
SQL Error [42601]: An unexpected token ""UNIQUE"" was found following ""ENANT_ID, NAME)
    "".  Expected tokens may include:  "","".. SQLCODE=-104, SQLSTATE=42601, DRIVER=4.25.13
  An unexpected token ""UNIQUE"" was found following ""ENANT_ID, NAME)
    "".  Expected tokens may include:  "","".. SQLCODE=-104, SQLSTATE=42601, DRIVER=4.25.13
  An unexpected token ""UNIQUE"" was found following ""ENANT_ID, NAME)
    "".  Expected tokens may include:  "","".. SQLCODE=-104, SQLSTATE=42601, DRIVER=4.25.13
"

Related Script section for the above issue is as below
CREATE TABLE IDP (
			ID INTEGER NOT NULL,
			TENANT_ID INTEGER NOT NULL,
			NAME VARCHAR(254) NOT NULL,
			IS_ENABLED CHAR(1) NOT NULL DEFAULT '1',
			IS_PRIMARY CHAR(1) NOT NULL DEFAULT '0',
			HOME_REALM_ID VARCHAR(254),
			IMAGE BLOB,
			CERTIFICATE BLOB,
			ALIAS VARCHAR(254),
			INBOUND_PROV_ENABLED CHAR (1) NOT NULL DEFAULT '0',
			INBOUND_PROV_USER_STORE_ID VARCHAR(254),
 			USER_CLAIM_URI VARCHAR(254),
 			ROLE_CLAIM_URI VARCHAR(254),
 			DESCRIPTION VARCHAR (1024),
 			DEFAULT_AUTHENTICATOR_NAME VARCHAR(254),
 			DEFAULT_PRO_CONNECTOR_NAME VARCHAR(254),
 			PROVISIONING_ROLE VARCHAR(128),
 			IS_FEDERATION_HUB CHAR(1) NOT NULL DEFAULT '0',
 			IS_LOCAL_CLAIM_DIALECT CHAR(1) NOT NULL DEFAULT '0',
 			DISPLAY_NAME VARCHAR(254),
 			IMAGE_URL VARCHAR(1024),
 			UUID CHAR(36) NOT NULL,
 			PRIMARY KEY (ID),
 			UNIQUE (TENANT_ID, NAME)
 			UNIQUE (UUID))
;

Fixed with https://github.com/wso2/carbon-identity-framework/pull/2597


Wishlist new component

Fixes Issue

Changes proposed
Implemented Wishlist component and functionality.

Check List (Check all the applicable boxes)

[x] My code follows the code style of this project.
[ ] My change requires changes to the documentation.
[ ] I have updated the documentation accordingly.
[x] All new and existing tests passed.

Good work ! It can be merged after these UI improvements.

On the product card, Remove the plus icon by commenting it and place your heart icon instead in the first row.
In the Wishlist Drawer instead of Close X add a cross icon on the right top.
Also, see if you can close it on click to somewhere outside the drawer.

@nandakumarbm26  Will you be able to complete this in the next few days ?


Razor .cshtml - html syntax highlighting breaks after a question mark ? inside an html element within a code context

VSCode Version: 1.36.0
OS Version: Windows 10 Pro (Windows_NT x64 10.0.17134)

Steps to Reproduce:

Open Visual Studio.
Open / Create an .cshtml file.
Create an code context with an e.g. an if statement.
Place an HTML element with a question mark in the code context e.g.:

@if( true )
{

		Create new account |
		Forgot password?

}

All code highlighting breaks after the question mark.

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

Only breaks inside a code context (no matter of the nesting depth).

Probably the highlighter incorrectly assumes it's the start of a short if statement.

Moved to owning repo.


specialdm review update closes #158

Closes #158

Hello @barnett11 - with regards to your updates for my QC comments, these all look great, thank you!
However, we are still failing 4 of the checks above, even after I have merged with devel. This suggests that these checks must be failing due to your updates but I am struggling to see which of these updates could have caused this.
To address the "Code Style" failures, these can be easily fixed in the console by running styler::style_file("R/special_dm_cut.R"). The other 3 checks seem to be failing because the vignettes are failing to run. I am not entirely sure which of your updates are causing this issue so if you can't work this out either, perhaps we can look into this together in tomorrow's catch up?

Thanks @reesnj - that is now resolved


Try pushing to coveralls after success

Changes Unknown when pulling 8178a36f1af068959f59622c62f433883ff02930 on jansav:coveralls-integration into ** on Houston-Inc:v1.0.0-beta**.


[BUG] Summarize the issue in a few words here

Running the following command:
%load -s {response} -f csv -p OVERSUBSCRIBE --run
in the notebook: https://aws-neptune-neptunenotebook.notebook.eu-west-2.sagemaker.aws/notebooks/Neptune/04-Machine-Learning/Neptune-ML-00-Getting-Started-with-Neptune-ML-Gremlin.ipynb
produces the error:
UsageError: option -f not recognized ( allowed: "yns:r:" )

Hi @richardtiffin, thank you for the bug report!
I was not able to reproduce this bug with a notebook created via the NeptuneML quick-start CloudFormation template in our public documentation:

Could you also provide the Python version of your environment, as well as the version of graph-notebook being used? These can be found by running the below commands in your notebook:

Closing due to 30 days of inactivity. Please do re-open if you have more information about reproducing the issue.


Ashenafi : Behavior, Strategy, Implementation, 3 Chapters

my fork of the exercises repo

Chapter 1 : practice writing tests and analyzing solutions
Learning Objectives

[x] 🥚 Analyzing Functions: You can analyze a function written at or near your level. This includes:

[x] Behavior: How would you document the function, what test cases does it pass, and how might you use it in a program
[x] Strategy: Roughly, how could you translate this solution to pseudo-code.
[x] Implementation: What language features were used, and what are some alternate language features that could be used

[ ] 🥚 Testing Existing Functions: You can write unit tests for a working function using the describe/it/expect().toEqual() syntax. This includes grouping test cases into logical test suites.

[x] 🥚 Function Design: You can explain the function-design process and can successfully apply it to write 2+ solutions matching the behavior of a given function (assuming the behavior is at your level). The solutions do not need to implement different strategies, consider edge cases, or check for invalid arguments.

[x] 🥚 Generating Documentation: You can write a correct JSDoc for your functions and use a provided script to generate markdown documentation in a separate file.

[ ] 🐣 Declarative Programming: You can explain how Declarative Programming is different from Imperative programming, and can tell which paradigm is used in a program. You can also use built-in JS methods to write Declarative solutions to simple coding challenges.

[x] 🐣 Array Strategies: You can determine which of the primary array strategies (map, filter, reduce, every, some) are helpful for a specific problem at your level.

[x] 🐣 Higher-Order Functions in Array Methods: You can explain how a higher order function works, and write a callback for use in the primary array methods (for a problem at your level).

[ ] 🐣 Prototype Delegation: You can inspect a JS value in the browser's debugger/console and explain how to find which methods are available for that value.

[ ] 🐣 Nested Data: Given a nested data structure containing arrays, objects and primitive values, you can 1) access a given value 2) update a given entry 3) filter the data

[ ] 🐣 Test-Driven Development: You can write basic unit tests for a problem you understand without having a solution to validate your tests. You can use your tests as a guide to develop a solution. You do not need to consider edge cases or invalid arguments.

[ ] 🐣 Fuzz Testing: You can interpret random test cases for a challenge to guide your development of a solution.

[ ] 🐣 Testing Side-Effects: You can write a suite of unit tests to ensure that; 1) a function does not modify it's reference-type arguments, 2) the function returns a new array/object.

[ ] 🐣 ECMAScript Modules: You can use export const functionName = () => {}; and import { functionName } from './file-name.js' syntax to separate unit tests from the function definition.

[ ] 🐣 Continuous Integration: You can check CI scripts locally to ensure your code will pass CI checks when it is pushed, and can read CI results when conducting a code review.

[ ] 🐣 Code Review: You can use a provided checklist and passing/failing CI checks to review a classmate's function (given the solution is at your level).

[ ] 🐥 Code Coverage: You can explain what code coverage is, why it's important, and can write unit tests for a code challenge with 100% coverage.

[ ] 🐥 Testing Edge Cases: You can identify and write unit tests for tricky edge cases.

[ ] 🐔 Writing Guards: You can write guards for your function parameters that enforce the function's documented parameter types.

[ ] 🐔 Testing Guards: You can use expect(() => ).toThrow() to unit-test your guards' error type and message.

Websites and videos I found useful for studying JS

w3schools
SoloLearn
CodeAcademy
Learn javascript
Youtube video for complete beginners

Chapter 1
Check-In
I Need Help With:

nothing so far

What went well?

Studying arrays and array methods , functions

What went less well?

There is a lot of stuff to be studied and covered. I am studying for some time every day to cover the topics.

Lessons Learned

Study some everyday to cover all the necessary topics.
Keep practicing and solve as many problems as possible.

Sunday Prep Work

Reading suggested study materials

Chapter 3
Check-In
I Need Help With:

What went well?

Understanding best practices of coding and how to use automated tools to check code quality.

What went less well?

Lessons Learned

Code formatting , checking for linting ,unit testing are some of the tools for code best practices and code quality checks.

Sunday Prep Work
Reading on separation  of concerns and event driven programming


Fixed spelling mistakes in the docs

Fixed spelling mistakes in the documentation

Cherry-picked to v9.1.x branch.


php api doesn't have such annotation as TestCaseID

Hi guys,
Please add such Annotation type to allure-php-adapter-api(not php unit adapter) as java api has
ru.yandex.qatools.allure.annotations.TestCaseId

I can just add respective annotation class (pull requests are welcome too). Don't know whether we need any other logic in the API.

I think there is one more place in Yandex\Allure\Adapter\Annotation\AnnotationManager method processAnnotations() something like this
elseif ($annotation instanceof Issues) {
foreach ($annotation->getTestCaseIDs() as $ids) {
$this->labels[] = Model\Label::testCaseID($ids);
}
but for TastCaseID
and so in Yandex\Allure\Adapter\Model\Label new method
Model\Label::testCaseID()
for Yandex\Allure\Adapter\Model\LabelType const ISSUE = 'testCaseId';

I'm able to use test ID labels in current version (1.2.1), so this issue can be probably safely closed.


Support additional NCPs such as Ethernet and Wi-Fi

It would be ideal to have future support for additional NCPs like Ethernet and WI-Fi. On the Ethernet side, MII could be analgous to the Thread spec in that the definition could extend core. WIZnet is a popular vendor of Ethernet controllers that could be used for prototyping, though I don't know the current status of IPv6 in their IP stack. Wi-Fi is a bit more precarious as I am not aware of standard protocols. Most vendors support AT-based commands over serial/SDIO or some proprietary (and often poorly designed) thing.

Well, Ethernet and Wi-Fi are both layer-2, whereas Spinel is (currently) firmly rooted in layer-3. I'm wary of going in the direction of trying to make Spinel some sort of universal network peripheral abstraction layer.
I could see there being some sort of mesh-based firmware for an 802.11 SoC chip kinda like Thread, except using 802.11 frames instead of 802.15.4 frames. That would fit pretty well, actually.
In terms of getting buy-in at the IETF, keeping things strictly scoped to layer 3 seems like the most likely path to success (and, admittedly, the least amount of required work on my part. ;)).

Got it, makes sense to me! Thanks for the explanation :)


Team banner looks bad in team page

Team banner looks bad in team page

team banner updated the UI Page. Please review


[client] client crashes when merge all my attacking troops to my defensive army

I can't manage to repro but I'll make sure that it doesn't crash at least


Adding config endpoints on admin servers for scaler, interceptor and operator

Adding endpoints to fetch configuration from interceptor, scaler and operator
Checklist

[x] From #279: TestRunAdminServerDeploymentsEndpoint
[x] interceptor
[x] scaler
[x] operator
[x] tests
[x] Commits are signed with Developer Certificate of Origin (DCO)
[x] Any necessary documentation is added, such as:

developing.md
README.md
The docs/ directory
The docs repo

Fixes #278

@ajanth97 this is now ready for review. can you please take a look?

Expected to conflict with https://github.com/kedacore/http-add-on/pull/279. I'll take care of resolving conflicts as necessary


Template for variable for task or workflow id

Right now we use {task} for task_id in task_template, and {workflow_id} for workflow ID for workflow_template. These IDs are usually used for job name.
However, although this works all right if the variables are used in different templates, it does not work for submit_cmd, as in the example for task spooler where the ID should be specified from command line.
        submit_cmd: ts -L {workflow_id} sh {job_file}

In this case an template-neutral ID should be used for submit_cmd because submit_cmd, as defined, cannot be used for task submission.

How about calling both job_id and let the context decide if it is task_id or workflow_id?
We might have backwards compatibility issue ... but it wouldn't bother me.

job_id is currently used for
        status_cmd: ts -s {job_id}
        kill_cmd: ts -r {job_id}

but these two commands are not used at all right now for sos-pbs.

Hmm is it true that a good solution here is to use one variable name to refer to both type of ID's? How about just job then?

Or job_name as it is used for such purpose anyway. It is also easy to keep backward compatibility (allow both job_name and task )

Use job_name now.


Add support for creating multiple host initiators wwpn

Adding host initiator ability: create new host-initiator with  multiple wwpn for FC port
before:

after:

links
https://github.com/ManageIQ/manageiq-ui-classic/pull/7858

@miq-bot add_label morphy/yes?

Backported to morphy in commit 00d4bc7aee7f21894fbed2aaa1ab3663dcdd4053.
commit 00d4bc7aee7f21894fbed2aaa1ab3663dcdd4053
Author: Adam Grare<EMAIL_ADDRESS>Date:   Mon Sep 27 13:52:46 2021 -0400

    Merge pull request #81 from Autosde/add_support_for_creating_multiple_host_initiators_wwpn

    Add support for creating multiple host initiators wwpn

    (cherry picked from commit 2933e5e7fb5928fd4b7db85402eee858170714f0)


Paragraph with text not found in table?

I try to use the text from a table with the following code and the attached docx-example -
When i search for  as in the below code everything works fine and the paragraph is outputed.
But when i instead search for  so instead with the line
if "<D1>" in paragraph.text:
i can´t find anything?
Why i can´t read the valus of the third columnn where the "D"-values are in it?
from docx import Document
import os, sys

if __name__ == '__main__':
  path = os.path.abspath(os.path.dirname(sys.argv[0]))
  fn = os.path.join(path, "exmpl.docx")
  doc = Document(fn)

  t = doc.tables
  for idxT,table in enumerate(doc.tables):
    print(f"IdxTable: {idxT}")
    for idxR, row in enumerate(table.rows):
      print(f"IdxRow: {idxR}")
      for idxC, cell in enumerate(row.cells):
        print(f"IdxCell: {idxC}")
        for idxP, paragraph in enumerate(cell.paragraphs):
          if "<C1>" in paragraph.text:
            print(paragraph.text)
            input("Press!")

exmpl.docx

Why don't you check the runs?
try iterating runs using iter function like this:
for rum_elem in paragraph._p.iterchildren(tag="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}r")

or use iterdescendants to get run if it's not direct children to a paragraph

Hello - thanks for your response - i think with that it really works
from docx import Document
import os, sys

if __name__ == '__main__':
  path = os.path.abspath(os.path.dirname(sys.argv[0]))
  fn = os.path.join(path, "exmpl.docx")
  # fn = os.path.join(path, "OLDtempl.docx")
  doc = Document(fn)

  t = doc.tables
  for idxT,table in enumerate(doc.tables):
    for idxR, row in enumerate(table.rows):
      for idxC, cell in enumerate(row.cells):
        for idxP, paragraph in enumerate(cell.paragraphs):
          if "<C16>" in paragraph.text:
            print(f"Found <C> in {paragraph.text}")
          if "<D17>" in paragraph.text:
            print(f"Found <D> in {paragraph.text}")
          for rumElem in paragraph._p.iterchildren(tag="{http://schemas.openxmlformats.org/wordprocessingml/2006/main}r"):
            if "<C16>" in rumElem.text:
              print(f"Found <C> in {paragraph.text}")
            if "<D17>" in rumElem.text:
              print(f"Found <D> in {paragraph.text}")

D17 is found "normaly" in the paragraph.text
and C16 is found (for whatever reason) in the rumElem.text


[test][IRGen] Split out objc-interop specific part in abitypes.swift (take 2)

Reland https://github.com/apple/swift/pull/69015 by unsupporting x86_64-unknown-windows-msvc

@swift-ci Please smoke test


Intellisense keep suggest "Add StyleCop settings file to the project"

Copied from https://developercommunity.visualstudio.com/content/problem/335377/intellisense-keep-suggest-add-stylecop-settings-fi.html

Intellisense keep suggest "Add StyleCop settings file to the project" even when Directory.Build.props already link stylecop.json seetting to the project directory.
I'm using Code Analysis (Microsoft.CodeAnalysis.FxCopAnalyzers) and StyleCop (StyleCop.Analyzers) both, but this seems cause by CodeAnalysis.My project config as:1. Micorsoft.CodeAnalysis.FxCopAnalyzers in the Directory.Build.props file, not in csproj file.2. Additional file: StyleCopConfig.json in the Directory.Build.props, and set link as StyleCop.json.I can see Directory.Build.props mirror a StyleCop.json file in my web project directory, but things as describe - keep suggest "Add StyleCop settings file to the project"..Then I fount out: If I rename StyleCopConfig.json file to StyleCop.json, and remove "LINK" property from the Directory.Build.props > AdditionalFiles setting, then it wound happen anymore!Or, if I add "Microsoft.CodeAnalysis.FxCopAnalyzers" PackageReference in the csproj file, there won't have the same issue. (With StyleCopConfig.json "LINK" as "StyleCop.json" file)I think there might be a bug there? Maybe the PackageReference in the Directory.Build.props, ignored AdditionalFiles' LINK property?

It sounds like the <Link> metadata simply isn't used by Roslyn, so the file name is appearing to the analyzers as StyleCopConfig.json. Renaming the source configuration file to stylecop.json should resolve the issue.


Iframe resizes influences XML parsing?!

I have the problem, that IE 11 is parsing XML wrong (when there is a hyphen).
See also my stackoverflow post:
http://stackoverflow.com/questions/37655982/internet-explorer-xml-parsing-wrong-at-hypens-and-cant-make-repro-example?noredirect=1#comment62791409_37655982
The XML parsing is happening inside of the iframe.
Now as soon as I disable the iframe resizer, the XML parsing works properly.
Any idea how this strange effect could be caused?

Wow, that's a new one on me.
IE11 seems to have updated recently and broken a few things. Going to try and take a look later this week hopefully when I have some spare time. Not sure I know where to start with this one though.
Do you have a simple test case?

good idea :-)

FYI
Somebody reproduced that IE bug
https://github.com/talee/mutationobserver-breaks-characterdata
http://stackoverflow.com/a/39156496/288568


How do you include an img source in a cell?

I have tried it using    cellTemplate: VGridVueTemplate(thumbnail).  However VGridVueTemplate does not seem to be a part of vue3-datagrid.
Or I can manually create the element
name: 'url',
 prop: 'url',
 cellTemplate: (createElement, props) => {
   return createElement('img', {
   }, props.model[props.prop]);

but the source image url is equal to the current prop.  How do I set the img src to equal the url value?

This doesn't seem like a Vue3 Data grid issue. You can probably just create the element and specify the images src.
let image = createElement("img"); img.src = yourSouce; return img;

Thanks, I will give it a try.


0.70.6 breaks setTimeout and setInterval

Description
0.70.5 works fine, but 0.70.6 and 0.70.8 fail with a slew of messages like these:
WARN  Tried to call timer with ID 101 but no such timer exists.
 WARN  Tried to call timer with ID 100 but no such timer exists.
 WARN  Possible Unhandled Promise Rejection (id: 0):
Error: Unable to activate keep awake
Error: Unable to activate keep awake
    at construct (native)
    at apply (native)
    at _construct (http://<IP_ADDRESS>:19000/index.bundle?platform=android&dev=true&minify=false&app=devclient.myapp.mobile&modulesOnly=false&runModule=true:19313:28)
    at Wrapper (http://<IP_ADDRESS>:19000/index.bundle?platform=android&dev=true&minify=false&app=devclient.myapp.mobile&modulesOnly=false&runModule=true:19275:25)
    at construct (native)
    at _createSuperInternal (http://<IP_ADDRESS>:19000/index.bundle?platform=android&dev=true&minify=false&app=devclient.myapp.mobile&modulesOnly=false&runModule=true:97907:326)
    at call (native)
    at CodedError (http://<IP_ADDRESS>:19000/index.bundle?platform=android&dev=true&minify=false&app=devclient.myapp.mobile&modulesOnly=false&runModule=true:97915:26)
 WARN  Possible Unhandled Promise Rejection (id: 1):
Error: Unable to activate keep awake
Error: Unable to activate keep awake
    at construct (native)
    at apply (native)
    at _construct (http://<IP_ADDRESS>:19000/index.bundle?platform=android&dev=true&minify=false&app=devclient.myapp.mobile&modulesOnly=false&runModule=true:19313:28)
    at Wrapper (http://<IP_ADDRESS>:19000/index.bundle?platform=android&dev=true&minify=false&app=devclient.myapp.mobile&modulesOnly=false&runModule=true:19275:25)
    at construct (native)
    at _createSuperInternal (http://<IP_ADDRESS>:19000/index.bundle?platform=android&dev=true&minify=false&app=devclient.myapp.mobile&modulesOnly=false&runModule=true:97907:326)
    at call (native)
    at CodedError (http://<IP_ADDRESS>:19000/index.bundle?platform=android&dev=true&minify=false&app=devclient.myapp.mobile&modulesOnly=false&runModule=true:97915:26)
 WARN  Possible Unhandled Promise Rejection (id: 2):
Error: Unable to activate keep awake
Error: Unable to activate keep awake
    at construct (native)
    at apply (native)
    at _construct (http://<IP_ADDRESS>:19000/index.bundle?platform=android&dev=true&minify=false&app=devclient.myapp.mobile&modulesOnly=false&runModule=true:19313:28)
    at Wrapper (http://<IP_ADDRESS>:19000/index.bundle?platform=android&dev=true&minify=false&app=devclient.myapp.mobile&modulesOnly=false&runModule=true:19275:25)
    at construct (native)
    at _createSuperInternal (http://<IP_ADDRESS>:19000/index.bundle?platform=android&dev=true&minify=false&app=devclient.myapp.mobile&modulesOnly=false&runModule=true:97907:326)
    at call (native)
    at CodedError (http://<IP_ADDRESS>:19000/index.bundle?platform=android&dev=true&minify=false&app=devclient.myapp.mobile&modulesOnly=false&runModule=true:97915:26)
 WARN  Tried to call timer with ID 140 but no such timer exists.

React Native Version
0.70.6
Output of npx react-native info
System:
    OS: Linux 5.19 Ubuntu 22.10 22.10 (Kinetic Kudu)
    CPU: (4) x64 AMD Ryzen 7 5800X 8-Core Processor
    Memory: 5.25 GB / 19.51 GB
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 16.18.0 - ~/.nvm/versions/node/v16.18.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.18.0/bin/yarn
    npm: 8.19.2 - ~/.nvm/versions/node/v16.18.0/bin/npm
    Watchman: 4.9.0 - /usr/bin/watchman
  SDKs:
    Android SDK:
      API Levels: 31, 32, 33
      Build Tools: 30.0.3, 31.0.0, 33.0.0
      System Images: android-31 | Google APIs Intel x86_64 Atom, android-31 | Google Play Intel x86 Atom_64
      Android NDK: Not Found
  IDEs:
    Android Studio: Not Found
  Languages:
    Java: Not Found
  npmPackages:
    @react-native-community/cli: Not Found
    react: Not Found
    react-native: 0.70.6 => 0.70.6
  npmGlobalPackages:
    *react-native*: Not Found

Steps to reproduce
Simply use a setTimeout or setInterval with a log statement inside of it. You will note that the log statement does not occur and the timers will throws those warnings. Any code relying on timers will, of course, break.
I'm was quite convinced it's related to this change, but pinning the version of promise did not resolve the issue: https://github.com/facebook/react-native/commit/475310dbbaec8048411edefc6cdddab330df7966
Tested in Android emulator.
Snack, code example, screenshot, or link to a repository
None yet, just spent my entire day trying to trace the source of this issue.

You are on a supported minor version, but it looks like there's a newer patch available. Please upgrade to the highest patch for your minor or latest and verify if the issue persists

Yes, it does persist with 0.70.8 - identical issue.

0.71.6 is good though.

I can't reproduce this with a minimal example on 0.70.8 (android):

const App: () => Node = () => {
  const [a, setA] = React.useState('Waiting');
  const [b, setB] = React.useState(0);

  React.useEffect(() => {
    setTimeout(() => setA('Worked'), 0);
    const ref = setInterval(() => setB(n => n + 1), 1000);
    return () => clearInterval(ref);
  }, []);

  const isDarkMode = useColorScheme() === 'dark';

  const backgroundStyle = {
    backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
  };

  return (
    <SafeAreaView style={backgroundStyle}>
      <StatusBar
        barStyle={isDarkMode ? 'light-content' : 'dark-content'}
        backgroundColor={backgroundStyle.backgroundColor}
      />
      <ScrollView
        contentInsetAdjustmentBehavior="automatic"
        style={backgroundStyle}>

        <View
          style={{
            backgroundColor: isDarkMode ? Colors.black : Colors.white,
          }}>

Using a setTimeout: {a}

Starting at 0, updating to {b}

        </View>
      </ScrollView>
    </SafeAreaView>
  );
};

Can you please provide a minimal example that reproduces this?

I won't have time to provide a repro since 0.71.x works - nor would I know how to repro this - but it's definitely something I experienced with 0.70.8.
I suspect someone else will come along soon enough with the same issue, but hopefully 0.71.x will work for them too.

I came across a new issue which could be an edge-case remnant of this problem in 0.71.x - just speculation. https://github.com/redux-saga/redux-saga/issues/2377
@blakef any thoughts?


Flickr auth redirects to Locker page in OAuth popup

Instead of closing the window and redirecting back in the parent.

Also, it doesn't successfully auth. This may be a sandbox-only issue.


Quick Form Update Removes Fields That Aren't Filled Out

I have some hidden fields that are filled in by the system after the user submit the form (e.g. ID field, URL slug field).
When the user uses the {{> quickForm type="update" }} form, any fields that aren't filled in get removed.  How can I prevent this from happening?
I've tried using a formToDoc hook, but it doesn't seem to fire.  I've also tried using docToForm before loading the form even though those fields aren't visible.

For future Googlers, the docs refer to autoForm on this page, but setArrayItems=true works for quickForm as well.


Check out Android

Binding seems broken (haven't investigated thoroughly)

Since we support browser now (lol) perhaps a peek there too. Seems like the keyboard-case stuff likely applies on browser as well.

@JujuAdams binding look OK to you ?

Shall check...

Gamepad input via Chrome worked well with everything doing what it should. I did notice an issue with the gamepad description showing the wrong thing but I strongly suspect that's upstream (and it's probably an edge case regardless). Keyboard input in Chrome is a mixed bag - arrow keys return gamepad buttons only, numpad enter doesn't work, we don't get F keys but we do get transport controls (177 = rewind, 179 = pause/play, 178 = fast forward). Alphabetics are upper case regardless of modification with shift
Keyboard input on native is acceptable I think. My Apple Magic Keyboard labels weren't matching what a native app was returning but I think that's two ecosystems not lining up rather than a deeper issue. As noted elsewhere, alphabetics are lower case unless modified with shift (at which point they return the upper case letter). I managed to stick a tilde key though I think that was GM fuckup rather than us
Gamepad input via Android native is... just barely acceptable I think. After a fix (https://github.com/JujuAdams/Input/commit/9793b6517012f8a175373a4445663e302d7051bd) rebinding works and we're able to operate mostly normally. The big issue for Android is that we aren't getting GUIDs back that fit the typical SDL2 pattern and our SDL database is a little thin on the ground for these alternate GUIDs, we're getting some alternate value (I think you explained what that value was to me a while ago but I've forgotten). As a result, we cannot retrieve controller type or reliably apply mappings to fix issues as we do on other platforms. I'll push my PS4 GUID + remappings to the SDL2 database (here and upstream) but we're out on a fragile limb here I feel

Excellent notes ty, lots for me to run with!

Added a few (89) of my own maps to fatten out the the mapping DB a bit.
Some of the problems you encountered around PS4 and Switch controllers are due to foetal drivers and associated keymaps in the kernel version you're on, which are make things look worse than they are... it's not GREAT but it's serviceable I think.

I think you explained what that value was to me a while ago but I've forgotten

The Android legacy GUID strings are a weird CRC on device info including name that I've not been able to exactly figure out, but they do work. Newer stuff (Bluetooth etc) use the more familiar Linux format.
I've got a (sloppy) APK for generating maps, feel free to hmu if you want that for mapping anything easier on your end.

Yeah I'm fine with running with the current gamepad implementation on Android but I suspect we'll be dealing with edge case bugs for a while. I'm jsut irritated that we're being forced down a legacy path when GM clearly has access to the newer stuff >:(
Do you think any further keyboard/gamepad work is necessary on Android at this point? Should we expand the block list for keys?

perhaps if ) and tilde are reproducibly sticking for you, otherwise good for now i think

k, shall do some focused testing tonight

Found the issue: releasing shift before releasing the other key (e.g. 0 for )) causes the modified key to stick. This is repeatable with at least all number row symbols and all alphabetics. Not 100% sure how to handle this, should we clear everything when shift is released?

Switch Joycons definitely don't give us raw SL/SR buttons, with or without GM's native mapping

should we clear everything when shift is released?
probably :-x hopefully io_clear will do the trick. thanks for figuring this one out, i’ll dig into it.

has the blacklist fixed the kb-gamepad problem? got any data for for me?

can you make detailed notes of the guid + description of joycons and procon as well as the output each axis and button produces after using gamepad_mapping_remove? (note: it’s gonna be really messy).

Can you share the version of Android OS you’re on?

Thanks !!

Notes for gamepad mapping:

Confirm mapping correctly applied from YYG-db
Confirm mapping correct applied when auto-assigned (not in db, guess-map assigned based on ? keymaps maybe? by runtime)
Confirm custom remapping correctly applied (when our DB overrides a YYG-db map)
Confirm purely custom remapping applied (no YYG-map, using our map)

hopefully io_clear will do the trick

Can't even get that far: we can't detect vk_shift at all.

Yes, blacklist is filtering out the keyboard based on "keyboard" being in the device description

Android 11, kernel 4.14.113-21663430

None of the devices I have are already in the SDL2 db, but I can confirm that building my own remappings works and that GM's native remapping seems fine for PS4 and XB1 by default with these exceptions:

PS4 gp_select is on the Guide button
XB1 gp_select is on the Guide button... which also acts as a shortcut to go back to the home screen. The actual two-boxes select button does nothing under GM's native mapping

If you thought that I couldn't connect my XB1 pad to Android, you were correct. The wind changed direction today so Bluetooth decided to let the devices pair.

JoyCons blacklisted: https://gist.github.com/offalynne/07f78774e3d9ff00fc79200951ac1883/revisions#diff-d21944d284a477942c05fefd219e9ba7ae7be71830a49fc4939839ad07fd41da, issue for later #142

I can confirm that building my own remappings works and that GM's native remapping seems fine for PS4 and XB1 by default with these exceptions [...]

manual suggests this was done deliberately, so should be working right 🤦

confirmed gamepad mapping scenarios are working as intended using 8BitDo SN30 Pro+ and Xbox One Wireless controller: https://github.com/JujuAdams/Input/issues/132#issuecomment-895506771
except:

Confirm mapping correctly applied when auto-assigned (not in db, guess-map assigned based on ? keymaps maybe? by runtime)

confirmed cross-platform issue #144
otherwise Android all good !


[RFC] Base and second ROMs

This is an RFC for an initial implementation of the Darjeeling base and second ROMs.
This PR depends on 2 pending PRs:

https://github.com/lowRISC/opentitan/pull/20342 for generating a chip_info section for both ROMs.
https://github.com/lowRISC/opentitan/pull/20343 for generating the example OTP patch

I tried to split this PR in logical and independent blocks that can be reviewed separately:

The base and second ROM split (patches 2 and 3). This splits the current ROM into two pieces: base and second stage ROMs. The base ROM does a minimal set of initialization sequences (IP blocks, epmp, etc) and then jumps to the second stage ROM.
Second stage ROM patching (patches 5 and 6). We add a ROM patching library, based on the spec changes proposed at https://github.com/lowRISC/opentitan-integrated/pull/524, and then search and apply any second stage ROM patch from the base ROM.
img_rma_patch OTP image addition (patch 7), mostly for testing the ROM patching flow end to end.
Some tests had to be disabled for building with Darjeeling (patch 4).

[!NOTE]
The second ROM included in this PR does not boot all the way through. It is based on the current single ROM opentitan-integrated code and stops when trying to get a ROM extension image from flash. We will be fixing the second stage ROM code and have it reach the external flash controller with follow-up PRs

[!NOTE]
This PR has been tested with the opentitan-integrated QEMU model

This PR is incomplete, but ready to take initial reviews and feedback. This is our TODO list:

[ ] ROM patch unit testing
[ ] ROM patch signature verification

There are few things that should be changed with the ROM patching I think to make the code more robust. I didn't check in details the rest of the ROM since it comes from the opentitan and I don't think I am expert enough to catch subtle bugs there.
I have a question: if I understand correctly, the size of patch RAM code is determined by the first patch table entry?

The first patch table entry describes where the whole patch code region should be loaded, and the size of the entire patch code region to be loaded is defined in the patch header.
The patch code region contains all code regions to be remapped and each one of them is describe by a patch table entry. Each patch table entry describes the size of the remapping for that region, and that can be at most 32 bytes. For longer sequences, the remapped code must jump to another address that is also included in the patch code region itself.

But then it can only be very short. On the other hand, the documentation says that the patch RAM can be a few kbytes large. Am I missing something here?

For larger regions, we remap a short sequence that's basically a trampoline to a longer sequence that's then not remapped but ends up returning back to unpatched code in ROM. This longer sequence must also be included in the OTP patch region, which is why we're loading the whole patch region for the latest patchset.
See example 2 in the following doc: https://github.com/sameo/opentitan/blob/topic/rom-patch-gen/hw/ip/rv_core_ibex/doc/boot-rom-patching.md#rom-patching-examples

All comments on this PR have been addressed and a more complete (with e2e tests) PR is at https://github.com/lowRISC/opentitan/pull/20848.
I'm closing this one to avoid further confusions, and also because it's not worth maintaining 2 PRs, one being a superset of the other.


Ruby 2.5 support

This is a nicely done plugin! I actually wrote my own far simpler version before finding it, but I'd rather use yours. However, the codebase I'm trying to tag is using Ruby 2.5 (yes yes I know-- I'm tagging these tests so I can slowly update this massive codebase off of such ancient things).
This gem is not compatible with Ruby 2.5. Would you be open to PRs that made it so? I of course understand if that's just too old for you to care about.

Decided to go for it-- only one small tweak, after all. See #16.

Let's go with it! No reason to not do it if can help you, we have all been in this situation. 😄


make cask standalone

I've been using cask and it am really pleased with it.
It seems to me that there is little dependence between brew and cask. Is there a reason why cask depends on brew (i.e. we cant use cask without first installing brew)?
Currently I've been using alias cask="brew cask" to do all my cask related operations, but it would be a lot better if cask was just a separate package manager (and it just so happens that you can install cask through brew).
Personally I've been using both cask and brew formulas, so its not that I mind having brew installed, it just seems a weird dependency. (seems a bit like having to do brew vim file every time I want to use vim to edit a file.)

@rolandwalker if I understand correctly, are we pretty close to being independent nowadays?
I'd like to figure out what's left tying us down - I think it might be nice to "graduate" to just being Cask.

As a verb, yes, we now can stand alone.  You should be able to run /usr/local/bin/brew-cask, and I think that someone could alias it to cask.
But, we are still entirely integrated with the Homebrew ecosystem, because (still true, as above) we don't handle pulling down new Casks.
At a project level, Homebrew has made interop stronger – they are starting to automatically find and install Casks for command starting with brew, and to install Casks for brew dependencies (as we install Formulae as Cask dependencies.)
So we have two sorta-opposite trends running, which seems like it makes no sense.  Yet both trends so far have brought benefits.
Another thing to consider is that Homebrew has a new way to propagate subcommands.  If we move our command to the cmd directory (and impose a little discipline on core development), users could receive core ugrades via simple brew update, and we could throw away the recommended update command:
$ brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup

Thanks for the status update! I don't foresee us ever going that far away from homebrew; my primary concern is about branding clarity. I also think it would be nice for cask to work on its own, but that's less important to me.
Here's a probably-confusing food metaphor, 'cause I'm sorta hungry:

homebrew and cask will always go together like peanut butter and jelly, but right now "jelly" is mostly known as "that fruity peanut butter sweetener". but jelly has a lot going for it on its own - maybe you could even use jelly in a non-PB&J-sandwich context! but at least we can start thinking of jelly as jelly, yakno?

Let me know if that made any sense and I'll go get a snack. ;)

Oh, branding!  Our branding is a muddle at best.  Clarity would be welcome.
If we started calling ourselves "Cask", some things would definitely become more clear, others less so (cf #8575).  Homebrew was smart to call the project by one name, and the recipes by another.
In favor of the project name "Cask": many people already use it.


user documentation does not explain "before" and "after" target modifiers

https://www.cursorless.org/docs/#modifiers does not explain "before" and "after" target modifiers (I am guessing they are target modifiers).

Fwiw something rough is fine, as we'll need to rework it as part of #803  / #1440


Feature/if 2 setup front end

react+ts+vite project setup:

vite created project with react+ts.
added essential packages: axios, react-hook-form, react-query, zustand, husky, prettier, tailwindcss...
configed prettier into eslint, tailwindCSS config file, husky+lint-staged pre-commit check
add initial test, initial router
create project structure

LGTM.


Lab: Simple Monitoring with Cloudwatch

Create an EC2 instance
t2.micro
ensure its set to the default VPC and has a public IP
Optionally enable detailed monitoring
Connect to the instance and install Extras package and stress
Install stress (commands listed in code sample below)
Create an alarm based on the CPU Utilisation of the created instance
Threshold greater than 15%
Run stress 'stress -c 2'
Wait for alarm to .. alarm
use ctrl + c to cancel stress
Wait for alarm to return to ..ok
Delete the alarm
Delete the instance

# install stress
sudo yum install epel stress  -y

Fixed by 6e3ed303


Support for Intellij Fleet

Hey there, are any plans to add support for Intellij Fleet?

Fleet doesn't provide the functionalities needed for our LSP to work, it seems: https://plugins.jetbrains.com/docs/intellij/plugin-compatibility.html#modules-specific-to-functionality
If you know how to enable them, feel free to send a PR


Publish to PyPI with GH Action

Added publish.yaml action which builds, tests and publishes wheels + source for all supported python versions for linux and macos
Had to remove the usage of @classmethod, @property and @abstractmethod when used together (removed the property decorator) since py3.8 failed to understand it correctly
Removed all uses of list, dict, tuple instead of typing.List, etc. as type hints for py3.8
Had to make the build_manylinux script build for a single version, added build_manylinux_all which builds all of them
Added all supported python versions to tests workflow
Added manual confirmation step before publishing to pypi:

TODO:

[ ] add prod pypi token to pypi environment's secrets in the repo's settings
[ ] change test-pypi to pypi environment in publish step
[ ] change branches: to release in publish action
[ ] roll version back to 0.1.0

LGTM again, thank you for the changes :)


Fix/mirror wss

(!) For uploading to Hathora, this is what you're going to want to use to support reverse proxy endpoints

Major Webgl Limitations
I noticed that - only in webgl - polling just suddenly stops (such as creating a new Lobby).
Upon further research, it turns out that this is a webgl limitation for Tasks/async/await: Webgl runs on a single thread and takes turns for "async" tasks. Sometimes these can get "lost" or otherwise desync'd.
In our case, I'm able to repro it every time in our SDK demo. Anything that polls (unless you wait long enough for the Lobby to already be created) more than once will get "lost" in webgl builds.
Continuing
We should still merge this, as it still has wonderful progress towards webgl and other docs/fixes/improvements, but this wouldn't be a 100% webgl support feature -- but progress towards it.


[bug] Added opcache compile scripts to application

@gordalina Any chance to get this PR merged both to master and 3.x branch (for projects still running on PHP 5.5/5.6)? Thanks!

Released on v4.1.0


[ldd-img_surface] camera_model_serial_number

Add a new field to img_surface:Instrument_Information :
camera_model_serial_number: string, card 0-1
Specifies the manufacturer's serial number for the camera for which the camera model was derived. This should match instrument_serial_number in most cases; generally speaking a mismatch should only occur during testing/development.

closed per branch  v1200
https://github.com/pds-data-dictionaries/ldd-img_surface/tree/v1200
pull a release next. Auto-build makes a release but need to build with GEOM. Thus might need to run lddtool locally and release. see related: #77

@thareUSGS I downloaded version 1200 and this item isn't there....?
But then again the LDD shows it was last modified 7 days ago so that doesn't make sense...?

okay I found it in the 1200 branch... but it didn't get delivered to master?