问:
RStudio on Windows 2012 R2 cannot work without VC++ 2015 but it will not install
I have all updates on my installation of Windows 2012 R2 but for some reason none of the solutions suggested work. I require api-ms-win-crt-runtime-l1-1-0.dll to run RStudio, unfortunately, I have no way to get it running & I tried every solution proposed.

The exact problem is described in Cannot install Visual C++ Redistributable for Visual Studio 2015 (64-bit)

The expected result is VC++ 2015 to be installed & RStudio to run.

Attempts to manually apply those solutions didn't avail:

Log file result from installation of VC++ 2015:

```<code>[10E4:11E4][2023-01-07T02:05:12]i001: Burn v3.10.4.4718, Windows v6.3 (Build 9600: Service Pack 0), path: C:\Windows\Temp\{9F7F6448-26EA-488F-B797-D9C4ED9535A9}\.cr\VC_redist.x64.exe
[10E4:11E4][2023-01-07T02:05:12]i009: Command Line: '-burn.clean.room=C:\Users\Administrator\Desktop\VC_redist.x64.exe -burn.filehandle.attached=308 -burn.filehandle.self=316'
[10E4:11E4][2023-01-07T02:05:12]i000: Setting string variable 'WixBundleOriginalSource' to value 'C:\Users\Administrator\Desktop\VC_redist.x64.exe'
[10E4:11E4][2023-01-07T02:05:12]i000: Setting string variable 'WixBundleOriginalSourceFolder' to value 'C:\Users\Administrator\Desktop\'
[10E4:11E4][2023-01-07T02:05:12]i000: Setting string variable 'WixBundleLog' to value 'C:\Users\ADMINI~1\AppData\Local\Temp\dd_vcredist_amd64_20230107020512.log'
[10E4:11E4][2023-01-07T02:05:12]i000: Setting string variable 'WixBundleName' to value 'Microsoft Visual C++ 2015-2022 Redistributable (x64) - 14.34.31931'
[10E4:11E4][2023-01-07T02:05:12]i000: Setting string variable 'WixBundleManufacturer' to value 'Microsoft Corporation'
[10E4:12B4][2023-01-07T02:05:12]i000: Setting version variable 'WixBundleFileVersion' to value '14.34.31931.0'
[10E4:11E4][2023-01-07T02:05:12]i100: Detect begin, 11 packages
[10E4:11E4][2023-01-07T02:05:12]i000: Setting string variable 'Arm64_Check' to value 'AMD64'
[10E4:11E4][2023-01-07T02:05:12]i000: File search: windows_uCRT_DetectKey, did not find path: C:\Windows\system32\ucrtbase.dll
[10E4:11E4][2023-01-07T02:05:12]i000: File search: windows_uCRT_DetectKeyExists, did not find path: C:\Windows\system32\ucrtbase.dll
[10E4:11E4][2023-01-07T02:05:12]i000: Setting numeric variable 'windows_uCRT_DetectKeyExists' to value 0
[10E4:11E4][2023-01-07T02:05:12]i102: Detected related bundle: {e46eca4f-393b-40df-9f49-076faf788d83}, type: Upgrade, scope: PerMachine, version: 14.0.23026.0, operation: MajorUpgrade
[10E4:11E4][2023-01-07T02:05:12]i052: Condition '(VersionNT = v6.3 AND NOT VersionNT64) AND (windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10240.0)' evaluates to false.
[10E4:11E4][2023-01-07T02:05:12]i052: Condition '(VersionNT = v6.3 AND VersionNT64) AND (windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10240.0)' evaluates to false.
[10E4:11E4][2023-01-07T02:05:12]i052: Condition '(VersionNT = v6.2 AND NOT VersionNT64) AND (windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10240.0)' evaluates to false.
[10E4:11E4][2023-01-07T02:05:12]i052: Condition '(VersionNT = v6.2 AND VersionNT64) AND (windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10240.0)' evaluates to false.
[10E4:11E4][2023-01-07T02:05:12]i052: Condition '(VersionNT = v6.1 AND NOT VersionNT64) AND (windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10240.0)' evaluates to false.
[10E4:11E4][2023-01-07T02:05:12]i052: Condition '(VersionNT = v6.1 AND VersionNT64) AND (windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10240.0)' evaluates to false.
[10E4:11E4][2023-01-07T02:05:12]i052: Condition '(VersionNT = v6.0 AND NOT VersionNT64) AND (windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10240.0)' evaluates to false.
[10E4:11E4][2023-01-07T02:05:12]i052: Condition '(VersionNT = v6.0 AND VersionNT64) AND (windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10240.0)' evaluates to false.
[10E4:11E4][2023-01-07T02:05:12]i103: Detected related package: {0D3E9E15-DE7A-300B-96F1-B4AF12B96488}, scope: PerMachine, version: 14.0.23026.0, language: 0 operation: MajorUpgrade
[10E4:11E4][2023-01-07T02:05:12]i103: Detected related package: {BC958BD2-5DAC-3862-BB1A-C1BE0790438D}, scope: PerMachine, version: 14.0.23026.0, language: 0 operation: MajorUpgrade
[10E4:11E4][2023-01-07T02:05:12]i103: Detected related package: {0D3E9E15-DE7A-300B-96F1-B4AF12B96488}, scope: PerMachine, version: 14.0.23026.0, language: 0 operation: MajorUpgrade
[10E4:11E4][2023-01-07T02:05:12]i103: Detected related package: {BC958BD2-5DAC-3862-BB1A-C1BE0790438D}, scope: PerMachine, version: 14.0.23026.0, language: 0 operation: MajorUpgrade
[10E4:11E4][2023-01-07T02:05:12]i101: Detected package: Windows81_x86, state: Absent, cached: None
[10E4:11E4][2023-01-07T02:05:12]i101: Detected package: Windows81_x64, state: Absent, cached: None
[10E4:11E4][2023-01-07T02:05:12]i101: Detected package: Windows8_x86, state: Absent, cached: None
[10E4:11E4][2023-01-07T02:05:12]i101: Detected package: Windows8_x64, state: Absent, cached: None
[10E4:11E4][2023-01-07T02:05:12]i101: Detected package: Windows7_MSU_x86, state: Absent, cached: None
[10E4:11E4][2023-01-07T02:05:12]i101: Detected package: Windows7_MSU_x64, state: Absent, cached: None
[10E4:11E4][2023-01-07T02:05:12]i101: Detected package: WindowsVista_MSU_x86, state: Absent, cached: None
[10E4:11E4][2023-01-07T02:05:12]i101: Detected package: WindowsVista_MSU_x64, state: Absent, cached: None
[10E4:11E4][2023-01-07T02:05:12]i101: Detected package: vcRuntimeMinimum_x64, state: Absent, cached: None
[10E4:11E4][2023-01-07T02:05:12]i101: Detected package: vcRuntimeAdditional_x64, state: Absent, cached: None
[10E4:11E4][2023-01-07T02:05:12]i101: Detected package: vcRuntime_arm64, state: Absent, cached: None
[10E4:11E4][2023-01-07T02:05:12]i052: Condition 'VersionNT >= v6.1' evaluates to true.
[10E4:11E4][2023-01-07T02:05:12]i199: Detect complete, result: 0x0
[10E4:12B4][2023-01-07T02:05:17]i000: Setting numeric variable 'EulaAcceptCheckbox' to value 1
[10E4:11E4][2023-01-07T02:05:17]i200: Plan begin, 11 packages, action: Install
[10E4:11E4][2023-01-07T02:05:17]i052: Condition 'VersionNT = v6.3 AND NOT VersionNT64' evaluates to false.
[10E4:11E4][2023-01-07T02:05:17]w321: Skipping dependency registration on package with no dependency providers: Windows81_x86
[10E4:11E4][2023-01-07T02:05:17]i052: Condition 'VersionNT = v6.3 AND VersionNT64' evaluates to true.
[10E4:11E4][2023-01-07T02:05:17]w321: Skipping dependency registration on package with no dependency providers: Windows81_x64
[10E4:11E4][2023-01-07T02:05:17]i052: Condition 'VersionNT = v6.2 AND NOT VersionNT64' evaluates to false.
[10E4:11E4][2023-01-07T02:05:17]w321: Skipping dependency registration on package with no dependency providers: Windows8_x86
[10E4:11E4][2023-01-07T02:05:17]i052: Condition 'VersionNT = v6.2 AND VersionNT64' evaluates to false.
[10E4:11E4][2023-01-07T02:05:17]w321: Skipping dependency registration on package with no dependency providers: Windows8_x64
[10E4:11E4][2023-01-07T02:05:17]i052: Condition 'VersionNT = v6.1 AND NOT VersionNT64' evaluates to false.
[10E4:11E4][2023-01-07T02:05:17]w321: Skipping dependency registration on package with no dependency providers: Windows7_MSU_x86
[10E4:11E4][2023-01-07T02:05:17]i052: Condition 'VersionNT = v6.1 AND VersionNT64' evaluates to false.
[10E4:11E4][2023-01-07T02:05:17]w321: Skipping dependency registration on package with no dependency providers: Windows7_MSU_x64
[10E4:11E4][2023-01-07T02:05:17]i052: Condition 'VersionNT = v6.0 AND NOT VersionNT64' evaluates to false.
[10E4:11E4][2023-01-07T02:05:17]w321: Skipping dependency registration on package with no dependency providers: WindowsVista_MSU_x86
[10E4:11E4][2023-01-07T02:05:17]i052: Condition 'VersionNT = v6.0 AND VersionNT64' evaluates to false.
[10E4:11E4][2023-01-07T02:05:17]w321: Skipping dependency registration on package with no dependency providers: WindowsVista_MSU_x64
[10E4:11E4][2023-01-07T02:05:17]i052: Condition '(VersionNT64) AND NOT (Arm64_Check = "ARM64")' evaluates to true.
[10E4:11E4][2023-01-07T02:05:17]i000: Setting string variable 'WixBundleRollbackLog_vcRuntimeMinimum_x64' to value 'C:\Users\ADMINI~1\AppData\Local\Temp\dd_vcredist_amd64_20230107020512_001_vcRuntimeMinimum_x64_rollback.log'
[10E4:11E4][2023-01-07T02:05:17]i000: Setting string variable 'WixBundleLog_vcRuntimeMinimum_x64' to value 'C:\Users\ADMINI~1\AppData\Local\Temp\dd_vcredist_amd64_20230107020512_001_vcRuntimeMinimum_x64.log'
[10E4:11E4][2023-01-07T02:05:17]i052: Condition '(VersionNT64) AND NOT (Arm64_Check = "ARM64")' evaluates to true.
[10E4:11E4][2023-01-07T02:05:17]i000: Setting string variable 'WixBundleRollbackLog_vcRuntimeAdditional_x64' to value 'C:\Users\ADMINI~1\AppData\Local\Temp\dd_vcredist_amd64_20230107020512_002_vcRuntimeAdditional_x64_rollback.log'
[10E4:11E4][2023-01-07T02:05:17]i000: Setting string variable 'WixBundleLog_vcRuntimeAdditional_x64' to value 'C:\Users\ADMINI~1\AppData\Local\Temp\dd_vcredist_amd64_20230107020512_002_vcRuntimeAdditional_x64.log'
[10E4:11E4][2023-01-07T02:05:17]i052: Condition 'Arm64_Check = "ARM64"' evaluates to false.
[10E4:11E4][2023-01-07T02:05:17]i201: Planned package: Windows81_x86, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[10E4:11E4][2023-01-07T02:05:17]i201: Planned package: Windows81_x64, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: No, dependency: None
[10E4:11E4][2023-01-07T02:05:17]i201: Planned package: Windows8_x86, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[10E4:11E4][2023-01-07T02:05:17]i201: Planned package: Windows8_x64, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[10E4:11E4][2023-01-07T02:05:17]i201: Planned package: Windows7_MSU_x86, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[10E4:11E4][2023-01-07T02:05:17]i201: Planned package: Windows7_MSU_x64, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[10E4:11E4][2023-01-07T02:05:17]i201: Planned package: WindowsVista_MSU_x86, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[10E4:11E4][2023-01-07T02:05:17]i201: Planned package: WindowsVista_MSU_x64, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[10E4:11E4][2023-01-07T02:05:17]i201: Planned package: vcRuntimeMinimum_x64, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: No, dependency: Register
[10E4:11E4][2023-01-07T02:05:17]i201: Planned package: vcRuntimeAdditional_x64, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: No, dependency: Register
[10E4:11E4][2023-01-07T02:05:17]i201: Planned package: vcRuntime_arm64, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[10E4:11E4][2023-01-07T02:05:17]i207: Planned related bundle: {e46eca4f-393b-40df-9f49-076faf788d83}, type: Upgrade, default requested: Absent, ba requested: Absent, execute: Uninstall, rollback: Install, dependency: None
[10E4:11E4][2023-01-07T02:05:17]i299: Plan complete, result: 0x0
[10E4:11E4][2023-01-07T02:05:17]i300: Apply begin
[10E4:11E4][2023-01-07T02:05:17]i010: Launching elevated engine process.
[10E4:11E4][2023-01-07T02:05:17]i011: Launched elevated engine process.
[10E4:11E4][2023-01-07T02:05:17]i012: Connected to elevated engine.
[0C20:0EE0][2023-01-07T02:05:17]i358: Pausing automatic updates.
[0C20:0EE0][2023-01-07T02:05:18]i359: Paused automatic updates.
[0C20:0EE0][2023-01-07T02:05:18]i360: Creating a system restore point.
[0C20:0EE0][2023-01-07T02:05:18]i362: System restore disabled, system restore point not created.
[0C20:0EE0][2023-01-07T02:05:18]i370: Session begin, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{d4cecf3b-b68f-4995-8840-52ea0fab646e}, options: 0x7, disable resume: No
[0C20:0EE0][2023-01-07T02:05:18]i000: Caching bundle from: 'C:\Windows\Temp\{24898943-C62B-411E-A84F-E9DEA6A59B2E}\.be\VC_redist.x64.exe' to: 'C:\ProgramData\Package Cache\{d4cecf3b-b68f-4995-8840-52ea0fab646e}\VC_redist.x64.exe'
[0C20:0EE0][2023-01-07T02:05:18]i320: Registering bundle dependency provider: VC,redist.x64,amd64,14.34,bundle, version: 14.34.31931.0
[0C20:0EE0][2023-01-07T02:05:18]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{d4cecf3b-b68f-4995-8840-52ea0fab646e}, resume: Active, restart initiated: No, disable resume: No
[0C20:0A88][2023-01-07T02:05:18]i305: Verified acquired payload: Windows81_x64 at path: C:\ProgramData\Package Cache\.unverified\Windows81_x64, moving to: C:\ProgramData\Package Cache\3ACBF3890FC9C8A6F3D2155ECF106028E5F55164\packages\Patch\x64\Windows8.1-KB2999226-x64.msu.
[0C20:0A88][2023-01-07T02:05:18]i305: Verified acquired payload: vcRuntimeMinimum_x64 at path: C:\ProgramData\Package Cache\.unverified\vcRuntimeMinimum_x64, moving to: C:\ProgramData\Package Cache\{CF4C347D-954E-4543-88D2-EC17F07F466F}v14.34.31931\packages\vcRuntimeMinimum_amd64\vc_runtimeMinimum_x64.msi.
[0C20:0A88][2023-01-07T02:05:18]i305: Verified acquired payload: cab5046A8AB272BF37297BB7928664C9503 at path: C:\ProgramData\Package Cache\.unverified\cab5046A8AB272BF37297BB7928664C9503, moving to: C:\ProgramData\Package Cache\{CF4C347D-954E-4543-88D2-EC17F07F466F}v14.34.31931\packages\vcRuntimeMinimum_amd64\cab1.cab.
[0C20:0A88][2023-01-07T02:05:18]i305: Verified acquired payload: vcRuntimeAdditional_x64 at path: C:\ProgramData\Package Cache\.unverified\vcRuntimeAdditional_x64, moving to: C:\ProgramData\Package Cache\{EAE242B1-0A26-485A-BFEB-0292EE9F03CB}v14.34.31931\packages\vcRuntimeAdditional_amd64\vc_runtimeAdditional_x64.msi.
[0C20:0A88][2023-01-07T02:05:18]i305: Verified acquired payload: cab2C04DDC374BD96EB5C8EB8208F2C7C92 at path: C:\ProgramData\Package Cache\.unverified\cab2C04DDC374BD96EB5C8EB8208F2C7C92, moving to: C:\ProgramData\Package Cache\{EAE242B1-0A26-485A-BFEB-0292EE9F03CB}v14.34.31931\packages\vcRuntimeAdditional_amd64\cab1.cab.
[0C20:0EE0][2023-01-07T02:05:18]i301: Applying execute package: Windows81_x64, action: Install, path: C:\ProgramData\Package Cache\3ACBF3890FC9C8A6F3D2155ECF106028E5F55164\packages\Patch\x64\Windows8.1-KB2999226-x64.msu, arguments: '"C:\Windows\SysNative\wusa.exe" "C:\ProgramData\Package Cache\3ACBF3890FC9C8A6F3D2155ECF106028E5F55164\packages\Patch\x64\Windows8.1-KB2999226-x64.msu" /quiet /norestart'
[0C20:0EE0][2023-01-07T02:07:40]e000: Error 0x80240017: Failed to execute MSU package.
[10E4:11E4][2023-01-07T02:07:40]e000: Error 0x80240017: Failed to configure per-machine MSU package.
[10E4:11E4][2023-01-07T02:07:40]i319: Applied execute package: Windows81_x64, result: 0x80240017, restart: None
[10E4:11E4][2023-01-07T02:07:40]e000: Error 0x80240017: Failed to execute MSU package.
[0C20:0EE0][2023-01-07T02:07:40]i372: Session end, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{d4cecf3b-b68f-4995-8840-52ea0fab646e}, resume: None, restart: None, disable resume: No
[0C20:0EE0][2023-01-07T02:07:40]i330: Removed bundle dependency provider: VC,redist.x64,amd64,14.34,bundle
[0C20:0EE0][2023-01-07T02:07:40]i352: Removing cached bundle: {d4cecf3b-b68f-4995-8840-52ea0fab646e}, from path: C:\ProgramData\Package Cache\{d4cecf3b-b68f-4995-8840-52ea0fab646e}\
[0C20:0EE0][2023-01-07T02:07:40]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{d4cecf3b-b68f-4995-8840-52ea0fab646e}, resume: None, restart initiated: No, disable resume: No
[10E4:11E4][2023-01-07T02:07:41]i399: Apply complete, result: 0x80240017, restart: None, ba requested restart:  No
</code>```

Body:
I have all updates on my installation of Windows 2012 R2 but for some reason none of the solutions suggested work. I require api-ms-win-crt-runtime-l1-1-0.dll to run RStudio, unfortunately, I have no way to get it running & I tried every solution proposed.

The exact problem is described in Cannot install Visual C++ Redistributable for Visual Studio 2015 (64-bit)

The expected result is VC++ 2015 to be installed & RStudio to run.

Attempts to manually apply those solutions didn't avail:

Log file result from installation of VC++ 2015:

[10E4:11E4][2023-01-07T02:05:12]i001: Burn v3.10.4.4718, Windows v6.3 (Build 9600: Service Pack 0), path: C:\Windows\Temp\{9F7F6448-26EA-488F-B797-D9C4ED9535A9}\.cr\VC_redist.x64.exe
[10E4:11E4][2023-01-07T02:05:12]i009: Command Line: '-burn.clean.room=C:\Users\Administrator\Desktop\VC_redist.x64.exe -burn.filehandle.attached=308 -burn.filehandle.self=316'
[10E4:11E4][2023-01-07T02:05:12]i000: Setting string variable 'WixBundleOriginalSource' to value 'C:\Users\Administrator\Desktop\VC_redist.x64.exe'
[10E4:11E4][2023-01-07T02:05:12]i000: Setting string variable 'WixBundleOriginalSourceFolder' to value 'C:\Users\Administrator\Desktop\'
[10E4:11E4][2023-01-07T02:05:12]i000: Setting string variable 'WixBundleLog' to value 'C:\Users\ADMINI~1\AppData\Local\Temp\dd_vcredist_amd64_20230107020512.log'
[10E4:11E4][2023-01-07T02:05:12]i000: Setting string variable 'WixBundleName' to value 'Microsoft Visual C++ 2015-2022 Redistributable (x64) - 14.34.31931'
[10E4:11E4][2023-01-07T02:05:12]i000: Setting string variable 'WixBundleManufacturer' to value 'Microsoft Corporation'
[10E4:12B4][2023-01-07T02:05:12]i000: Setting version variable 'WixBundleFileVersion' to value '14.34.31931.0'
[10E4:11E4][2023-01-07T02:05:12]i100: Detect begin, 11 packages
[10E4:11E4][2023-01-07T02:05:12]i000: Setting string variable 'Arm64_Check' to value 'AMD64'
[10E4:11E4][2023-01-07T02:05:12]i000: File search: windows_uCRT_DetectKey, did not find path: C:\Windows\system32\ucrtbase.dll
[10E4:11E4][2023-01-07T02:05:12]i000: File search: windows_uCRT_DetectKeyExists, did not find path: C:\Windows\system32\ucrtbase.dll
[10E4:11E4][2023-01-07T02:05:12]i000: Setting numeric variable 'windows_uCRT_DetectKeyExists' to value 0
[10E4:11E4][2023-01-07T02:05:12]i102: Detected related bundle: {e46eca4f-393b-40df-9f49-076faf788d83}, type: Upgrade, scope: PerMachine, version: 14.0.23026.0, operation: MajorUpgrade
[10E4:11E4][2023-01-07T02:05:12]i052: Condition '(VersionNT = v6.3 AND NOT VersionNT64) AND (windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10240.0)' evaluates to false.
[10E4:11E4][2023-01-07T02:05:12]i052: Condition '(VersionNT = v6.3 AND VersionNT64) AND (windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10240.0)' evaluates to false.
[10E4:11E4][2023-01-07T02:05:12]i052: Condition '(VersionNT = v6.2 AND NOT VersionNT64) AND (windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10240.0)' evaluates to false.
[10E4:11E4][2023-01-07T02:05:12]i052: Condition '(VersionNT = v6.2 AND VersionNT64) AND (windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10240.0)' evaluates to false.
[10E4:11E4][2023-01-07T02:05:12]i052: Condition '(VersionNT = v6.1 AND NOT VersionNT64) AND (windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10240.0)' evaluates to false.
[10E4:11E4][2023-01-07T02:05:12]i052: Condition '(VersionNT = v6.1 AND VersionNT64) AND (windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10240.0)' evaluates to false.
[10E4:11E4][2023-01-07T02:05:12]i052: Condition '(VersionNT = v6.0 AND NOT VersionNT64) AND (windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10240.0)' evaluates to false.
[10E4:11E4][2023-01-07T02:05:12]i052: Condition '(VersionNT = v6.0 AND VersionNT64) AND (windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10240.0)' evaluates to false.
[10E4:11E4][2023-01-07T02:05:12]i103: Detected related package: {0D3E9E15-DE7A-300B-96F1-B4AF12B96488}, scope: PerMachine, version: 14.0.23026.0, language: 0 operation: MajorUpgrade
[10E4:11E4][2023-01-07T02:05:12]i103: Detected related package: {BC958BD2-5DAC-3862-BB1A-C1BE0790438D}, scope: PerMachine, version: 14.0.23026.0, language: 0 operation: MajorUpgrade
[10E4:11E4][2023-01-07T02:05:12]i103: Detected related package: {0D3E9E15-DE7A-300B-96F1-B4AF12B96488}, scope: PerMachine, version: 14.0.23026.0, language: 0 operation: MajorUpgrade
[10E4:11E4][2023-01-07T02:05:12]i103: Detected related package: {BC958BD2-5DAC-3862-BB1A-C1BE0790438D}, scope: PerMachine, version: 14.0.23026.0, language: 0 operation: MajorUpgrade
[10E4:11E4][2023-01-07T02:05:12]i101: Detected package: Windows81_x86, state: Absent, cached: None
[10E4:11E4][2023-01-07T02:05:12]i101: Detected package: Windows81_x64, state: Absent, cached: None
[10E4:11E4][2023-01-07T02:05:12]i101: Detected package: Windows8_x86, state: Absent, cached: None
[10E4:11E4][2023-01-07T02:05:12]i101: Detected package: Windows8_x64, state: Absent, cached: None
[10E4:11E4][2023-01-07T02:05:12]i101: Detected package: Windows7_MSU_x86, state: Absent, cached: None
[10E4:11E4][2023-01-07T02:05:12]i101: Detected package: Windows7_MSU_x64, state: Absent, cached: None
[10E4:11E4][2023-01-07T02:05:12]i101: Detected package: WindowsVista_MSU_x86, state: Absent, cached: None
[10E4:11E4][2023-01-07T02:05:12]i101: Detected package: WindowsVista_MSU_x64, state: Absent, cached: None
[10E4:11E4][2023-01-07T02:05:12]i101: Detected package: vcRuntimeMinimum_x64, state: Absent, cached: None
[10E4:11E4][2023-01-07T02:05:12]i101: Detected package: vcRuntimeAdditional_x64, state: Absent, cached: None
[10E4:11E4][2023-01-07T02:05:12]i101: Detected package: vcRuntime_arm64, state: Absent, cached: None
[10E4:11E4][2023-01-07T02:05:12]i052: Condition 'VersionNT >= v6.1' evaluates to true.
[10E4:11E4][2023-01-07T02:05:12]i199: Detect complete, result: 0x0
[10E4:12B4][2023-01-07T02:05:17]i000: Setting numeric variable 'EulaAcceptCheckbox' to value 1
[10E4:11E4][2023-01-07T02:05:17]i200: Plan begin, 11 packages, action: Install
[10E4:11E4][2023-01-07T02:05:17]i052: Condition 'VersionNT = v6.3 AND NOT VersionNT64' evaluates to false.
[10E4:11E4][2023-01-07T02:05:17]w321: Skipping dependency registration on package with no dependency providers: Windows81_x86
[10E4:11E4][2023-01-07T02:05:17]i052: Condition 'VersionNT = v6.3 AND VersionNT64' evaluates to true.
[10E4:11E4][2023-01-07T02:05:17]w321: Skipping dependency registration on package with no dependency providers: Windows81_x64
[10E4:11E4][2023-01-07T02:05:17]i052: Condition 'VersionNT = v6.2 AND NOT VersionNT64' evaluates to false.
[10E4:11E4][2023-01-07T02:05:17]w321: Skipping dependency registration on package with no dependency providers: Windows8_x86
[10E4:11E4][2023-01-07T02:05:17]i052: Condition 'VersionNT = v6.2 AND VersionNT64' evaluates to false.
[10E4:11E4][2023-01-07T02:05:17]w321: Skipping dependency registration on package with no dependency providers: Windows8_x64
[10E4:11E4][2023-01-07T02:05:17]i052: Condition 'VersionNT = v6.1 AND NOT VersionNT64' evaluates to false.
[10E4:11E4][2023-01-07T02:05:17]w321: Skipping dependency registration on package with no dependency providers: Windows7_MSU_x86
[10E4:11E4][2023-01-07T02:05:17]i052: Condition 'VersionNT = v6.1 AND VersionNT64' evaluates to false.
[10E4:11E4][2023-01-07T02:05:17]w321: Skipping dependency registration on package with no dependency providers: Windows7_MSU_x64
[10E4:11E4][2023-01-07T02:05:17]i052: Condition 'VersionNT = v6.0 AND NOT VersionNT64' evaluates to false.
[10E4:11E4][2023-01-07T02:05:17]w321: Skipping dependency registration on package with no dependency providers: WindowsVista_MSU_x86
[10E4:11E4][2023-01-07T02:05:17]i052: Condition 'VersionNT = v6.0 AND VersionNT64' evaluates to false.
[10E4:11E4][2023-01-07T02:05:17]w321: Skipping dependency registration on package with no dependency providers: WindowsVista_MSU_x64
[10E4:11E4][2023-01-07T02:05:17]i052: Condition '(VersionNT64) AND NOT (Arm64_Check = "ARM64")' evaluates to true.
[10E4:11E4][2023-01-07T02:05:17]i000: Setting string variable 'WixBundleRollbackLog_vcRuntimeMinimum_x64' to value 'C:\Users\ADMINI~1\AppData\Local\Temp\dd_vcredist_amd64_20230107020512_001_vcRuntimeMinimum_x64_rollback.log'
[10E4:11E4][2023-01-07T02:05:17]i000: Setting string variable 'WixBundleLog_vcRuntimeMinimum_x64' to value 'C:\Users\ADMINI~1\AppData\Local\Temp\dd_vcredist_amd64_20230107020512_001_vcRuntimeMinimum_x64.log'
[10E4:11E4][2023-01-07T02:05:17]i052: Condition '(VersionNT64) AND NOT (Arm64_Check = "ARM64")' evaluates to true.
[10E4:11E4][2023-01-07T02:05:17]i000: Setting string variable 'WixBundleRollbackLog_vcRuntimeAdditional_x64' to value 'C:\Users\ADMINI~1\AppData\Local\Temp\dd_vcredist_amd64_20230107020512_002_vcRuntimeAdditional_x64_rollback.log'
[10E4:11E4][2023-01-07T02:05:17]i000: Setting string variable 'WixBundleLog_vcRuntimeAdditional_x64' to value 'C:\Users\ADMINI~1\AppData\Local\Temp\dd_vcredist_amd64_20230107020512_002_vcRuntimeAdditional_x64.log'
[10E4:11E4][2023-01-07T02:05:17]i052: Condition 'Arm64_Check = "ARM64"' evaluates to false.
[10E4:11E4][2023-01-07T02:05:17]i201: Planned package: Windows81_x86, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[10E4:11E4][2023-01-07T02:05:17]i201: Planned package: Windows81_x64, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: No, dependency: None
[10E4:11E4][2023-01-07T02:05:17]i201: Planned package: Windows8_x86, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[10E4:11E4][2023-01-07T02:05:17]i201: Planned package: Windows8_x64, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[10E4:11E4][2023-01-07T02:05:17]i201: Planned package: Windows7_MSU_x86, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[10E4:11E4][2023-01-07T02:05:17]i201: Planned package: Windows7_MSU_x64, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[10E4:11E4][2023-01-07T02:05:17]i201: Planned package: WindowsVista_MSU_x86, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[10E4:11E4][2023-01-07T02:05:17]i201: Planned package: WindowsVista_MSU_x64, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[10E4:11E4][2023-01-07T02:05:17]i201: Planned package: vcRuntimeMinimum_x64, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: No, dependency: Register
[10E4:11E4][2023-01-07T02:05:17]i201: Planned package: vcRuntimeAdditional_x64, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: No, dependency: Register
[10E4:11E4][2023-01-07T02:05:17]i201: Planned package: vcRuntime_arm64, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[10E4:11E4][2023-01-07T02:05:17]i207: Planned related bundle: {e46eca4f-393b-40df-9f49-076faf788d83}, type: Upgrade, default requested: Absent, ba requested: Absent, execute: Uninstall, rollback: Install, dependency: None
[10E4:11E4][2023-01-07T02:05:17]i299: Plan complete, result: 0x0
[10E4:11E4][2023-01-07T02:05:17]i300: Apply begin
[10E4:11E4][2023-01-07T02:05:17]i010: Launching elevated engine process.
[10E4:11E4][2023-01-07T02:05:17]i011: Launched elevated engine process.
[10E4:11E4][2023-01-07T02:05:17]i012: Connected to elevated engine.
[0C20:0EE0][2023-01-07T02:05:17]i358: Pausing automatic updates.
[0C20:0EE0][2023-01-07T02:05:18]i359: Paused automatic updates.
[0C20:0EE0][2023-01-07T02:05:18]i360: Creating a system restore point.
[0C20:0EE0][2023-01-07T02:05:18]i362: System restore disabled, system restore point not created.
[0C20:0EE0][2023-01-07T02:05:18]i370: Session begin, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{d4cecf3b-b68f-4995-8840-52ea0fab646e}, options: 0x7, disable resume: No
[0C20:0EE0][2023-01-07T02:05:18]i000: Caching bundle from: 'C:\Windows\Temp\{24898943-C62B-411E-A84F-E9DEA6A59B2E}\.be\VC_redist.x64.exe' to: 'C:\ProgramData\Package Cache\{d4cecf3b-b68f-4995-8840-52ea0fab646e}\VC_redist.x64.exe'
[0C20:0EE0][2023-01-07T02:05:18]i320: Registering bundle dependency provider: VC,redist.x64,amd64,14.34,bundle, version: 14.34.31931.0
[0C20:0EE0][2023-01-07T02:05:18]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{d4cecf3b-b68f-4995-8840-52ea0fab646e}, resume: Active, restart initiated: No, disable resume: No
[0C20:0A88][2023-01-07T02:05:18]i305: Verified acquired payload: Windows81_x64 at path: C:\ProgramData\Package Cache\.unverified\Windows81_x64, moving to: C:\ProgramData\Package Cache\3ACBF3890FC9C8A6F3D2155ECF106028E5F55164\packages\Patch\x64\Windows8.1-KB2999226-x64.msu.
[0C20:0A88][2023-01-07T02:05:18]i305: Verified acquired payload: vcRuntimeMinimum_x64 at path: C:\ProgramData\Package Cache\.unverified\vcRuntimeMinimum_x64, moving to: C:\ProgramData\Package Cache\{CF4C347D-954E-4543-88D2-EC17F07F466F}v14.34.31931\packages\vcRuntimeMinimum_amd64\vc_runtimeMinimum_x64.msi.
[0C20:0A88][2023-01-07T02:05:18]i305: Verified acquired payload: cab5046A8AB272BF37297BB7928664C9503 at path: C:\ProgramData\Package Cache\.unverified\cab5046A8AB272BF37297BB7928664C9503, moving to: C:\ProgramData\Package Cache\{CF4C347D-954E-4543-88D2-EC17F07F466F}v14.34.31931\packages\vcRuntimeMinimum_amd64\cab1.cab.
[0C20:0A88][2023-01-07T02:05:18]i305: Verified acquired payload: vcRuntimeAdditional_x64 at path: C:\ProgramData\Package Cache\.unverified\vcRuntimeAdditional_x64, moving to: C:\ProgramData\Package Cache\{EAE242B1-0A26-485A-BFEB-0292EE9F03CB}v14.34.31931\packages\vcRuntimeAdditional_amd64\vc_runtimeAdditional_x64.msi.
[0C20:0A88][2023-01-07T02:05:18]i305: Verified acquired payload: cab2C04DDC374BD96EB5C8EB8208F2C7C92 at path: C:\ProgramData\Package Cache\.unverified\cab2C04DDC374BD96EB5C8EB8208F2C7C92, moving to: C:\ProgramData\Package Cache\{EAE242B1-0A26-485A-BFEB-0292EE9F03CB}v14.34.31931\packages\vcRuntimeAdditional_amd64\cab1.cab.
[0C20:0EE0][2023-01-07T02:05:18]i301: Applying execute package: Windows81_x64, action: Install, path: C:\ProgramData\Package Cache\3ACBF3890FC9C8A6F3D2155ECF106028E5F55164\packages\Patch\x64\Windows8.1-KB2999226-x64.msu, arguments: '"C:\Windows\SysNative\wusa.exe" "C:\ProgramData\Package Cache\3ACBF3890FC9C8A6F3D2155ECF106028E5F55164\packages\Patch\x64\Windows8.1-KB2999226-x64.msu" /quiet /norestart'
[0C20:0EE0][2023-01-07T02:07:40]e000: Error 0x80240017: Failed to execute MSU package.
[10E4:11E4][2023-01-07T02:07:40]e000: Error 0x80240017: Failed to configure per-machine MSU package.
[10E4:11E4][2023-01-07T02:07:40]i319: Applied execute package: Windows81_x64, result: 0x80240017, restart: None
[10E4:11E4][2023-01-07T02:07:40]e000: Error 0x80240017: Failed to execute MSU package.
[0C20:0EE0][2023-01-07T02:07:40]i372: Session end, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{d4cecf3b-b68f-4995-8840-52ea0fab646e}, resume: None, restart: None, disable resume: No
[0C20:0EE0][2023-01-07T02:07:40]i330: Removed bundle dependency provider: VC,redist.x64,amd64,14.34,bundle
[0C20:0EE0][2023-01-07T02:07:40]i352: Removing cached bundle: {d4cecf3b-b68f-4995-8840-52ea0fab646e}, from path: C:\ProgramData\Package Cache\{d4cecf3b-b68f-4995-8840-52ea0fab646e}\
[0C20:0EE0][2023-01-07T02:07:40]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{d4cecf3b-b68f-4995-8840-52ea0fab646e}, resume: None, restart initiated: No, disable resume: No
[10E4:11E4][2023-01-07T02:07:41]i399: Apply complete, result: 0x80240017, restart: None, ba requested restart:  No


来源: stackexchange

问:
Not able to upload a file on GCS using signed URL using kotlin
I have searched enough on the web, but couldn't find the solution yet.

Creating a Signed upload URL with an expiry of 1 hour.

```<code>    val extensionHeaders: MutableMap<String, String> = HashMap()
    extensionHeaders["Content-Type"] = "application/octet-stream"
    val url: URL? = storage?.signUrl(
        blobInfo,
        60,
        TimeUnit.MINUTES,
        Storage.SignUrlOption.httpMethod(HttpMethod.PUT),
        Storage.SignUrlOption.withExtHeaders(extensionHeaders),
        Storage.SignUrlOption.withV4Signature()
    )
</code>```

Trying to upload using the signed URL. As I know, to upload a file using the signed URL we must POST an empty request as shown below.

```<code>curl -v -X 'POST' \
   -H 'content-type: application/octet-stream' \
   -H 'x-goog-resumable:start'  \
   -d '' \
   'https://storage.googleapis.com/path/some_jar_file.jar?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=sa-p.iam.gserviceaccount.com%2F20230107%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20230107T071742Z&X-Goog-Expires=3600&X-Goog-SignedHeaders=content-type%3Bhost&X-Goog-Signature=629e30c352a3c241cbe7b37c0d79dba8804c489ace423c43b55ea7e561e02f745b356eb9d7979e0b183870f8683613725d4f67fe4d8fbffa4529a1c433753918b692d033be7ac2f609992e30793570db08dce5250d78e5bef1e7458f56d7ee88c5f502855766cb68047423691ab30aa7a14c1f396d64a08053040925c4e70f58cec78bfba2b4fda11603aa1ee246c02492ee1f8ffc30c767cab944d0d0ffea8c407142c46f8d8be872e467a047b68c718a21134d6dc19b9415dda74c6728b1e70273737122a3a44110308d880bc3ad30cd18aa2ebe324ff5caaa7987b8339fe8fe63189f5acdc7cd11563f5997a5d89f2b1ba2ed6473134d1661ab8bdd624c89'
</code>```

I am getting below error.

```<code>< HTTP/2 403
< x-guploader-uploadid: ADPycdsLHvii2xdFRxOEJxWwwvRqVW8N6eqrfGFIbQFxASjN3-mAKhLR8t9EAcp66HEQLiEQSiB1fqtBnDeHzQe0yVfkzg
< content-type: application/xml; charset=UTF-8
< content-length: 950
< date: Sat, 07 Jan 2023 07:19:18 GMT
< server: UploadServer
< alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
<
* TLSv1.2 (IN), TLS header, Supplemental data (23):
<?xml version='1.0' encoding='UTF-8'?><Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your Google secret key and signing method.</Message><StringToSign>GOOG4-RSA-SHA256
20230107T071742Z
20230107/auto/storage/goog4_request
746ce8eb1510cb4496849f391a89f924ad83720ac1b3e96a9d743c4b2fbdc818</StringToSign><UnsignedSensitiveHeaders>x-goog-resumable</UnsignedSensitiveHeaders><CanonicalRequest>POST
/path/some_jar_file.jar
X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=sa-p.iam.gserviceaccount.com%2F20230107%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20230107T071742Z&X-Goog-Expires=3600&X-Goog-SignedHeaders=content-type%3Bhost
content-type:application/octet-stream
host:storage.googleapis.com

content-type;host
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* Connection #0 to host storage.googleapis.com left intact
UNSIGNED-PAYLOAD</CanonicalRequest></Error>
</code>```

Please help.

ContentLicense: CC BY-SA 4.0

Body:
I have searched enough on the web, but couldn't find the solution yet.

Creating a Signed upload URL with an expiry of 1 hour.

    val extensionHeaders: MutableMap<String, String> = HashMap()
    extensionHeaders["Content-Type"] = "application/octet-stream"
    val url: URL? = storage?.signUrl(
        blobInfo,
        60,
        TimeUnit.MINUTES,
        Storage.SignUrlOption.httpMethod(HttpMethod.PUT),
        Storage.SignUrlOption.withExtHeaders(extensionHeaders),
        Storage.SignUrlOption.withV4Signature()
    )

Trying to upload using the signed URL. As I know, to upload a file using the signed URL we must POST an empty request as shown below.

curl -v -X 'POST' \
   -H 'content-type: application/octet-stream' \
   -H 'x-goog-resumable:start'  \
   -d '' \
   'https://storage.googleapis.com/path/some_jar_file.jar?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=sa-p.iam.gserviceaccount.com%2F20230107%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20230107T071742Z&X-Goog-Expires=3600&X-Goog-SignedHeaders=content-type%3Bhost&X-Goog-Signature=629e30c352a3c241cbe7b37c0d79dba8804c489ace423c43b55ea7e561e02f745b356eb9d7979e0b183870f8683613725d4f67fe4d8fbffa4529a1c433753918b692d033be7ac2f609992e30793570db08dce5250d78e5bef1e7458f56d7ee88c5f502855766cb68047423691ab30aa7a14c1f396d64a08053040925c4e70f58cec78bfba2b4fda11603aa1ee246c02492ee1f8ffc30c767cab944d0d0ffea8c407142c46f8d8be872e467a047b68c718a21134d6dc19b9415dda74c6728b1e70273737122a3a44110308d880bc3ad30cd18aa2ebe324ff5caaa7987b8339fe8fe63189f5acdc7cd11563f5997a5d89f2b1ba2ed6473134d1661ab8bdd624c89'

I am getting below error.

< HTTP/2 403
< x-guploader-uploadid: ADPycdsLHvii2xdFRxOEJxWwwvRqVW8N6eqrfGFIbQFxASjN3-mAKhLR8t9EAcp66HEQLiEQSiB1fqtBnDeHzQe0yVfkzg
< content-type: application/xml; charset=UTF-8
< content-length: 950
< date: Sat, 07 Jan 2023 07:19:18 GMT
< server: UploadServer
< alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
<
* TLSv1.2 (IN), TLS header, Supplemental data (23):
<?xml version='1.0' encoding='UTF-8'?><Error>SignatureDoesNotMatch<Message>The request signature we calculated does not match the signature you provided. Check your Google secret key and signing method.</Message><StringToSign>GOOG4-RSA-SHA256
20230107T071742Z
20230107/auto/storage/goog4_request
746ce8eb1510cb4496849f391a89f924ad83720ac1b3e96a9d743c4b2fbdc818</StringToSign><UnsignedSensitiveHeaders>x-goog-resumable</UnsignedSensitiveHeaders><CanonicalRequest>POST
/path/some_jar_file.jar
X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=sa-p.iam.gserviceaccount.com%2F20230107%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20230107T071742Z&X-Goog-Expires=3600&X-Goog-SignedHeaders=content-type%3Bhost
content-type:application/octet-stream
host:storage.googleapis.com

content-type;host
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* Connection #0 to host storage.googleapis.com left intact
UNSIGNED-PAYLOAD</CanonicalRequest></Error>

Please help.


问:
How can I trace where logs are being created in AWS after performing some action?
AWS logging is very versatile, for almost any operation done there are logs created.

A problem I encounter is that although these logs are created, sometimes they are created in places I'm not aware of. Is there a way (for example some voodoo api call) that given an api action, retrieves all the logs or all the locations where logs have gone to in the cloud?

For example, if I have bucket notifications active on a bucket then if I put an object in the bucket I want to know that:

Access log is created in X

Access log is created in Y

Putting object is monitored in server Z logs

Notifications are sent to this and that SQS

etc...


问:
Is there a way to ensure that an image/video received from a user was taken using the webcam?
I am building a website that needs the funcitionality of receiving only webcam video/image. Basically, I want to make sure that the user can't bypass that by being able to upload an image, which was not taken using the webcam, directly to the server. Is this possible?

I am looking for methods to implement that but couldn't find any relevant information.


问:
pygame surface.get_at() not returning RGB integers anymore?
I just started playing around with python a bit and tried to do some silly grafix stuff to see how it worked. Now I got stuck with one precise problem: I am trying to read the color value of a pixel from a pygame surface - but I can't. The below code - which I found in several (perhaps outdated) manuals and samples - throws an error I don't understand:

(Line 38 is the one containing the "screen.get_at()" part)

File "/home/mark/devel/python/./test.py", line 38, in
color = screen.get_at((x, y))
TypeError: 'list' object cannot be interpreted as an integer

What I guess from the stuff I found online: pygame.surface changed the type of the return value for get_at() a short while ago. Now it doesn't return four integers for R, G, B and alpha. but it returns a type "color". However, I was unable to find an explanation what this type "color" actually is or how it works, resp. how I get just the RGB values out of it.

A shortened sample of my code which throws the above error is as follows:

```<code>#!/usr/bin/python3

import pygame
from pygame.locals import *

import numpy as np

WIDTH = 1200
HEIGHT = 800

WHITE = (255, 255, 255)

pygame.init()

# Set width and height of the screen
screen = pygame.display.set_mode((WIDTH,HEIGHT))

pygame.display.set_caption("Ant")
pygame.draw.rect(screen, WHITE, (0,0,WIDTH,HEIGHT))

pos = ([0],[0])

# Loop until the user clicks the close button.
done = False
clock = pygame.time.Clock()

# Loop as long as done == False
while not done:

    for event in pygame.event.get():  # User did something
        if event.type == pygame.QUIT or event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE:  # If user wants to exit
            done = True  # Flag that we are done so we exit this loop

    x = pos[0] # horizontal position
    y = pos[1] # vertical position
    color = screen.get_at((x, y))
    print (color)

    pygame.display.flip()

    # This limits the while loop to a max of 60 times per second.
    # Leave this out and we will use all CPU we can.
    clock.tick(600)

# Be IDLE friendly
pygame.quit()
</code>```

I'd really appreciate if someone could give me a hint how to get the RGB (integer) values from this "color" type get_at() returns.

thx,
Mark

Body:
I just started playing around with python a bit and tried to do some silly grafix stuff to see how it worked. Now I got stuck with one precise problem: I am trying to read the color value of a pixel from a pygame surface - but I can't. The below code - which I found in several (perhaps outdated) manuals and samples - throws an error I don't understand:

(Line 38 is the one containing the "screen.get_at()" part)

File "/home/mark/devel/python/./test.py", line 38, in
color = screen.get_at((x, y))
TypeError: 'list' object cannot be interpreted as an integer

What I guess from the stuff I found online: pygame.surface changed the type of the return value for get_at() a short while ago. Now it doesn't return four integers for R, G, B and alpha. but it returns a type "color". However, I was unable to find an explanation what this type "color" actually is or how it works, resp. how I get just the RGB values out of it.

A shortened sample of my code which throws the above error is as follows:

#!/usr/bin/python3

import pygame
from pygame.locals import *

import numpy as np

WIDTH = 1200
HEIGHT = 800

WHITE = (255, 255, 255)

pygame.init()

# Set width and height of the screen
screen = pygame.display.set_mode((WIDTH,HEIGHT))

pygame.display.set_caption("Ant")
pygame.draw.rect(screen, WHITE, (0,0,WIDTH,HEIGHT))

pos = ([0],[0])

# Loop until the user clicks the close button.
done = False
clock = pygame.time.Clock()

# Loop as long as done == False
while not done:

    for event in pygame.event.get():  # User did something
        if event.type == pygame.QUIT or event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE:  # If user wants to exit
            done = True  # Flag that we are done so we exit this loop

    x = pos[0] # horizontal position
    y = pos[1] # vertical position
    color = screen.get_at((x, y))
    print (color)

    pygame.display.flip()

    # This limits the while loop to a max of 60 times per second.
    # Leave this out and we will use all CPU we can.
    clock.tick(600)

# Be IDLE friendly
pygame.quit()

I'd really appreciate if someone could give me a hint how to get the RGB (integer) values from this "color" type get_at() returns.

thx,
Mark


问:
Send email if new values were added from android app to firebase
I am trying to make some code to automaticly send an email to my adress if new values from my application were added to firebase database.
It has to be something like feedback, but google canceled sending emails from android studio applications as an uknown source.
Is there any solution for my problem ?

And sorry for my english ;D

I tried send email from android studio to email address but it didn't work.


问:
Do we need npm package of third party API
I am implementing a signup functionality using mobile OTP authentication in my MERN application.
Few questions I have related to this

Do I need to install npm package of third party who provided the sendOTP API or Can I call third party SendOTP API directly from my code via HTPP.

If both approach can be done, then which one to choose


问:
Why do we write passport.serializeUser(User.serializeUser()); and passport.deserializeUser(User.deserializeUser());?
I just started learning about passport but I'm not getting why do we need to write passport.serializeUser(User.serializeUser()); and passport.deserializeUser(User.deserializeUser());.</p>
```<code>
const userSchema = new mongoose.Schema({
    username: String,
    password: String
});

//using passport-local-mongoose plugin
userSchema.plugin(passportLocalMongoose);

const User = mongoose.model("user", userSchema);

passport.use(User.createStrategy());

passport.serializeUser(User.serializeUser());
passport.deserializeUser(User.deserializeUser());

</code>```

Body:
I just started learning about passport but I'm not getting why do we need to write passport.serializeUser(User.serializeUser()); and passport.deserializeUser(User.deserializeUser());.

const userSchema = new mongoose.Schema({
    username: String,
    password: String
});

//using passport-local-mongoose plugin
userSchema.plugin(passportLocalMongoose);

const User = mongoose.model("user", userSchema);

passport.use(User.createStrategy());

passport.serializeUser(User.serializeUser());
passport.deserializeUser(User.deserializeUser());


问:
Unable to deliver the push notification using parse server
I am looking to integrate getting push notification on my web app and android using parse server

I have configured a firebase project as android and received the appkey and the sender key

Configured the parse server for push as written in documentation

Every doing in my nodejs backend

```<code>var server = new ParseServer({
  databaseURI: '...',
  cloud: '...',
  appId: '...',
  masterKey: '...',
  push:
    android: {
    senderId:'...',
      apiKey: '...'
    }
}
</code>```

also developed functions which for now i am triggering from frontend

```<code>Parse.Cloud.define('sendPush', function(request, response) {

  // var pushQuery = new Parse.Query(Parse.Installation);

 Parse.Push.send({
 where: {"deviceType": "android"},
   data: {
      alert: 'You have a new message from !'
    },
  }, {
     useMasterKey: true,
    success: function() {
      // Push was successful
      response.success('push successful')
    },
    error: function(error) {
      // Handle error
      response.error('push failed')
    }
 });

  });
</code>```

but whenever I am triggering the notification whether from parse dashboard or from cloud function, its showing success but 0 push sent

Also I believe FCM is required for android but for web still confused

first time with push notification and even new to parse

Body:
I am looking to integrate getting push notification on my web app and android using parse server

I have configured a firebase project as android and received the appkey and the sender key

Configured the parse server for push as written in documentation

Every doing in my nodejs backend

var server = new ParseServer({
  databaseURI: '...',
  cloud: '...',
  appId: '...',
  masterKey: '...',
  push:
    android: {
    senderId:'...',
      apiKey: '...'
    }
}

also developed functions which for now i am triggering from frontend

Parse.Cloud.define('sendPush', function(request, response) {

  // var pushQuery = new Parse.Query(Parse.Installation);

 Parse.Push.send({
 where: {"deviceType": "android"},
   data: {
      alert: 'You have a new message from !'
    },
  }, {
     useMasterKey: true,
    success: function() {
      // Push was successful
      response.success('push successful')
    },
    error: function(error) {
      // Handle error
      response.error('push failed')
    }
 });

  });

but whenever I am triggering the notification whether from parse dashboard or from cloud function, its showing success but 0 push sent

Also I believe FCM is required for android but for web still confused

first time with push notification and even new to parse


问:
Show detail Button in table not working(instead pages gets reload) and Not getting all the data properly of the table from mongodb
As I click on the Show detail button I should get an alert/more info of the user but instead of that the page gets reload. Basically on 'show details' button the 'OnClick' function is not getting executed.

Why am I getting no enteries found after clicking on 'show details'

Fetching data from Database and setting it in 'clientTable' variable:

```<code>React.useEffect(()=>{
    window.onload=()=>{
        const datatablesSimple = document.getElementById('datatablesSimple');
        if (datatablesSimple) {
            new DataTable(datatablesSimple);
        }
         const fetchClients = async ()=>{
         const res = await axios.get("/users")
         setClientTable((clientTable)=>{return clientTable=res.data;})
         console.log(clientTable)
        }
        fetchClients()
    }

},[]);
</code>```

Nodejs code for fetching all the Clients

```<code>router.get("/", async(req, res) => {
try{
    const allclients = await User.find();
    res.status(200).json(allclients);
}catch(err){
    res.status(500).json(err);
}
});
</code>```

HTML code of rendering the table in frontend:

```<code>    <tbody>
         {clientTable.map((User, index)=>(<>
          <tr key={index}>
          <td>
             <Link to="/details" state={User}
                   style={{textDecoration:'none',
                   color:'black'}} > {User.username}
             </Link>
          </td>
            <td>{User.email}</td>
            <td>{User.dob}</td>
            <td>{User.city}</td>
            <td>{User.services}</td>
             <td><button onClick={handleRowClick}> show details</button></td>
          </tr>
      </>
     ))}
    </tbody>
</code>```

handleRowClick method implementation:

```<code>const handleRowClick =  (e) => {
    e.preventDefault();
    alert("Hello")
    //setShowPopup(true);
}
</code>```

Body:
As I click on the Show detail button I should get an alert/more info of the user but instead of that the page gets reload. Basically on 'show details' button the 'OnClick' function is not getting executed.

Why am I getting no enteries found after clicking on 'show details'

Fetching data from Database and setting it in 'clientTable' variable:

React.useEffect(()=>{
    window.onload=()=>{
        const datatablesSimple = document.getElementById('datatablesSimple');
        if (datatablesSimple) {
            new DataTable(datatablesSimple);
        }
         const fetchClients = async ()=>{
         const res = await axios.get("/users")
         setClientTable((clientTable)=>{return clientTable=res.data;})
         console.log(clientTable)
        }
        fetchClients()
    }

},[]);

Nodejs code for fetching all the Clients

router.get("/", async(req, res) => {
try{
    const allclients = await User.find();
    res.status(200).json(allclients);
}catch(err){
    res.status(500).json(err);
}
});

HTML code of rendering the table in frontend:

         {clientTable.map((User, index)=>(<>

             <Link to="/details" state={User}
                   style={{textDecoration:'none',
                   color:'black'}} > {User.username}
             </Link>

            {User.email}
            {User.dob}
            {User.city}
            {User.services}
             <button onClick={handleRowClick}> show details</button>

      </>
     ))}

handleRowClick method implementation:

const handleRowClick =  (e) => {
    e.preventDefault();
    alert("Hello")
    //setShowPopup(true);
}


问:
Constractor ServletRegistrationBean (MessageDispatcherServlet,String) is not defined
I write Configuration WSDL Servcie java class and have a method called requestDispatcher that get ApplicationContext and return ServletRegistrationBean.

I try to return ServletRegistrationBean by implementing with the constructor as shown :

```<code>public ServletRegistrationBean(T servlet,
String... urlMappings) .
</code>```

To the T servlet parameter i pass messageDispatcherServlet and i get an error that

"Constractor ServletRegistrationBean (MessageDispatcherServlet,String)
is not defined".

I saw on google exmpales of code that do the same.

I would be glad for any help

This is the method i wrote:

```<code>public class WSDLConfigService {
    @Bean
    public ServletRegistrationBean requestDispatcher (ApplicationContext conext){
    MessageDispatcherServlet msd = new MessageDispatcherServlet();
    msd.setApplicationContext(conext);
    msd.setTransformWsdlLocations(true);
    return new ServletRegistrationBean(msd, "/soap/*");
}
</code>```

Body:
I write Configuration WSDL Servcie java class and have a method called requestDispatcher that get ApplicationContext and return ServletRegistrationBean.

I try to return ServletRegistrationBean by implementing with the constructor as shown :

public ServletRegistrationBean(T servlet,
String... urlMappings) .

To the T servlet parameter i pass messageDispatcherServlet and i get an error that

"Constractor ServletRegistrationBean (MessageDispatcherServlet,String)
is not defined".

I saw on google exmpales of code that do the same.

I would be glad for any help

This is the method i wrote:

public class WSDLConfigService {
    @Bean
    public ServletRegistrationBean requestDispatcher (ApplicationContext conext){
    MessageDispatcherServlet msd = new MessageDispatcherServlet();
    msd.setApplicationContext(conext);
    msd.setTransformWsdlLocations(true);
    return new ServletRegistrationBean(msd, "/soap/*");
}


问:
Is ffmpeg's chromakey filter broken when matching black/white?
I have a file, colors.png. It looks like this:

Let's say I want to make the red square transparent. When I run ffmpeg -i colors.png -filter_complex "[0]chromakey=0xff0000:similarity=0.1:blend=0.0[out]" -map "[out]" colors-rm-red.png (notice I use similarity=0.1 to make this work), I get exactly that:

How about making the blue square transparent? ffmpeg -i colors.png -filter_complex "[0]chromakey=0x0000ff:similarity=0.1:blend=0.0[out]" -map "[out]" colors-rm-blue.png works too!

But what about replacing black? ffmpeg -i colors.png -filter_complex "[0]chromakey=0x000000:similarity=0.1:blend=0.0[out]" -map "[out]" colors-rm-black.png gives me this:

And likewise, replacing white with ffmpeg -i colors.png -filter_complex "[0]chromakey=0xffffff:similarity=0.1:blend=0.0[out]" -map "[out]" colors-rm-white.png gives me the same result:

Why is this? Even if I use similarity=0.01, which according to the docs "matches only the exact key color", this still doesn't work when I'm trying to make black/white transparent. Is ffmpeg broken, or am I misunderstanding the chromakey filter?


问:
Any way to configure project specific Autosave options in WebStorm?
I'm expecting to set different Autosave options for different projects as needed.


问:
Flutter Web Routing Issue
When I open any route in new tab or another blank screen it work perfectly in local host and debug mode
but when i build web and upload this build on any server and try to open this route in new tab also or new screen or hard refresh the same tab i already open and works on it , it give this error

so any one has any solution because i searched many many times and nothing i had to do

I work with go router package to handle routing but nothing work

Title: Flutter Web Routing Issue


问:
How can I combine lists while preserving order within certain groupings?
I am trying combine multiple years of income statments. However, the line items for each income statement vary from year to year. For instance, the 2020 income statement might include:

Revenue from Sales
Revenue from Services
Cost of goods sold
Total Gross Profit
Insurance
Payroll
Total Operating Income
Taxes
Net Income

While the 2021 income statement might include:

Revenue from Sales
Revenue from Consulting
Cost of goods sold
Total Gross Profit
Insurance
Maintaince
Payroll
Total Operating Income
Taxes
Interest
Total Net Income

I want to combine these lists so that the everything that falls above total gross profit will be grouped together, everything that falls between gross profit and operating income grouped together, etc. The individual items must correspond to their total line item. Is there a way to do this in python without loosing the order?

Thanks!

I can concatinate and remove duplicates, but I can't get it to maintain the order.


问:
copy to clipboard for each list
i've got two list black and white numbers in JS Vue
for each one i made a button when i click on it the related numbers of list copy to clipboard
but only my white list copy to clipboard...any idea?</p>
```<code>const copyClipBoard = (isWhite) => {
  let params;
  if (isWhite) params = selectedFiltersWhite.filters;
  else params = selectedFiltersBlack.filters;
  const data = { filter: { filters: params } };
  const token = settings.get("token");
  const baseUrl = import.meta.env.VUE_APP_SERVER;
  axios({
    method: "get",
    url: baseUrl + `api/v1/user/check-blacklist/`,
    params: data,
    headers: { Authorization: "Bearer " + token }
  }).then((res) => {
      const array: any = [];
      res.data.data.items.forEach((el: any) => {
        array.push(el.number);
        navigator.clipboard.writeText(array);
      });
      message.success("copeid");
    }).catch(error => {
      message.error("something went worng");
      console.log(error);
    });
};
</code>```

Title: copy to clipboard for each list

Body:
i've got two list black and white numbers in JS Vue
for each one i made a button when i click on it the related numbers of list copy to clipboard
but only my white list copy to clipboard...any idea?

const copyClipBoard = (isWhite) => {
  let params;
  if (isWhite) params = selectedFiltersWhite.filters;
  else params = selectedFiltersBlack.filters;
  const data = { filter: { filters: params } };
  const token = settings.get("token");
  const baseUrl = import.meta.env.VUE_APP_SERVER;
  axios({
    method: "get",
    url: baseUrl + `api/v1/user/check-blacklist/`,
    params: data,
    headers: { Authorization: "Bearer " + token }
  }).then((res) => {
      const array: any = [];
      res.data.data.items.forEach((el: any) => {
        array.push(el.number);
        navigator.clipboard.writeText(array);
      });
      message.success("copeid");
    }).catch(error => {
      message.error("something went worng");
      console.log(error);
    });
};


问:
Postgresql query in ASP.NET C# using like operator
This code works

```<code>public void select()
{
    string str = "SELECT * FROM gazettes g WHERE g.title LIKE '%"+ hidden_key.Value +"%' OR serial LIKE '%"+ hidden_key.Value +"%'"; /*'%' || @title || '%'*/
    SqlDataSource1.SelectCommand = str;
    GV_Gazette.DataBind();
}
</code>```

but I want it to work in this as well but it returns an empty value. What am I doing wrong?

```<code>public void select()
{
    string str = "SELECT * FROM gazettes g WHERE g.title LIKE @title OR serial LIKE @title";/*'%' || @title || '%'*/
    cmd.CommandText = str;
    cmd.Parameters.AddWithValue("@title", "%" + hidden_key.Value + "%");
    dt = c.PopulateData(cmd);
    SqlDataSource1.SelectCommand = dt.ToString();
    GV_Gazette.DataBind();
}
</code>```

Body:
This code works

public void select()
{
    string str = "SELECT * FROM gazettes g WHERE g.title LIKE '%"+ hidden_key.Value +"%' OR serial LIKE '%"+ hidden_key.Value +"%'"; /*'%' || @title || '%'*/
    SqlDataSource1.SelectCommand = str;
    GV_Gazette.DataBind();
}

but I want it to work in this as well but it returns an empty value. What am I doing wrong?

public void select()
{
    string str = "SELECT * FROM gazettes g WHERE g.title LIKE @title OR serial LIKE @title";/*'%' || @title || '%'*/
    cmd.CommandText = str;
    cmd.Parameters.AddWithValue("@title", "%" + hidden_key.Value + "%");
    dt = c.PopulateData(cmd);
    SqlDataSource1.SelectCommand = dt.ToString();
    GV_Gazette.DataBind();
}


问:
Can't insert graph in a wxPython GUI
I am trying to make a telemetry software for a college project, that's why I'm using wxPython to make a GUI. I'm currently trying to make a function that displays a graph of brake_p and throttle in function of the time after I opened the entry file.
The code looks good to me, however it looks like there is an error inside the module that blocks me from succeeding.

Here is the error I get when I open the entry file :

```<code>> PS C:\Users\Adrie\OneDrive\Bureau\telemetry python>  &
> 'C:\Users\Adrie\AppData\Local\Microsoft\WindowsApps\python3.10.exe'
> 'c:\Users\Adrie\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '54993' '--' 'c:\Users\Adrie\OneDrive\Bureau\telemetry
> python\v0601.py'  Traceback (most recent call last): File
> "c:\Users\Adrie\OneDrive\Bureau\telemetry python\v0601.py", line 105,
> in OnOpen self.OpenData(file) File
> "c:\Users\Adrie\OneDrive\Bureau\telemetry python\v0601.py", line 144,
> in OpenData self.canvas.Draw(self.drawBrakeThrottlePlot) File
> "C:\Users\Adrie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\wx\lib\plot\plotcanvas.py",
> line 1750, in Drawgraphics.logScale = self.logScale AttributeError:
> 'method' object has no attribute 'logScale' PS
> C:\Users\Adrie\OneDrive\Bureau\telemetry python>
</code>```

The error I can't understand is the part in bold caracters,as it is nowhere in my code :
Drawgraphics.logScale = self.logScale
AttributeError: 'method' object has no attribute 'logScale'

I 'd like to add I plan to add a bar marker on the graph that would be either automatically move at real-time, or either movable by the user so the time at the marker would be used to display in other widget data corresponding to the exact instant (like in the matlab simulink graph/scopes), which means I can't store the graph as a bitmap but really as a graph/plot.

I tried to switch to another library to import the plot into the wxFrame but I just can't make it work as they look more complicated to me, so I got back to this method.

Here is the code :

```<code>import wx
import numpy as np
import matplotlib.pyplot as plt
from wx.lib.plot import PlotCanvas, PlotGraphics, PolyLine, PolyMarker
import wxmplot.interactive as wi

# Variables initialization
time, speed, distance, brake_p, throttle, g_x, g_y, g_z, gps_x, gps_y, omega_fl, omega_fr = ([] for i in range(12))
r=1     # Wheel radius, will implement a feature to make it editable by the user later

class MainWindow(wx.Frame):
    def __init__(self, *args, **kw):
        super(MainWindow, self).__init__(*args, **kw)
        # Create a panel and add it to the main window
        panel = wx.Panel(self)
        # Set the panel as the main window's sizer
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(panel, 1, wx.EXPAND)
        self.SetSizer(sizer)
        # Set the window's min size
        self.SetMinSize((1280,720))

        # create a menu bar
        self.makeMenuBar()

        # and a status bar
        self.CreateStatusBar()
        self.SetStatusText("v 0.1")

        # put some text with a larger bold font on it
        st = wx.StaticText(panel, label="Welcome on the EFT's Telemetry software !")
        font = st.GetFont()
        font.PointSize += 10
        font = font.Bold()
        st.SetFont(font)

        # and create a sizer to manage the layout of child widgets
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(st, wx.SizerFlags().Border(wx.TOP|wx.LEFT, 25))
        panel.SetSizer(sizer)

    def makeMenuBar(self):
        # Make a file menu with Hello and Exit items
        fileMenu = wx.Menu()
        # The "\t..." syntax defines an accelerator key that also triggers
        # the same event
        openItem = fileMenu.Append(-1, "&Open...\tCtrl-O",
                "Open a data file")
        fileMenu.AppendSeparator()
        # When using a stock ID we don't need to specify the menu item's
        # label
        exitItem = fileMenu.Append(wx.ID_EXIT)

        # Now a help menu for the about item
        helpMenu = wx.Menu()
        aboutItem = helpMenu.Append(wx.ID_ABOUT)

        # Now a view menu for the view item
        # viewMenu = wx.Menu()
        # aboutItem = helpMenu.Append(wx.ID_VIEW)

        # Make the menu bar and add the two menus to it. The '&' defines
        # that the next letter is the "mnemonic" for the menu item. On the
        # platforms that support it those letters are underlined and can be
        # triggered from the keyboard.

        menuBar = wx.MenuBar()
        menuBar.Append(fileMenu, "&File")
        menuBar.Append(helpMenu, "&Help")
        # menuBar.Append(viewMenu, "&View")

        # Give the menu bar to the frame
        self.SetMenuBar(menuBar)

        # Finally, associate a handler function with the EVT_MENU event for
        # each of the menu items. That means that when that menu item is
        # activated then the associated handler function will be called.
        self.Bind(wx.EVT_MENU, self.OnOpen, openItem)
        self.Bind(wx.EVT_MENU, self.OnExit,  exitItem)
        self.Bind(wx.EVT_MENU, self.OnAbout, aboutItem)

    def OnExit(self, event):
        self.Close(True)

    def OnAbout(self, event):
        wx.MessageBox("This is a simple Telemetry software project.",
                    wx.OK|wx.ICON_INFORMATION)

    def drawBrakeThrottlePlot():
        data1 = PolyLine([time, brake_p], legend='Brake Pressure (%)',  colour='red', width='1')
        data2 = PolyLine([time, throttle], legend='Throttle (%)', colour='green', width='1')
        return PlotGraphics([data1, data2], "Real Time Brake Pressure and Throttle", "Time (ms)", "Relative Value (%)")

    def OnOpen(self, event):
         # Create the file dialog
        with wx.FileDialog(self, "Open Data file", wildcard="text files (*.txt)|*.txt",
                        style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST) as fileDialog:

            if fileDialog.ShowModal() == wx.ID_CANCEL:
                return     # the user changed their mind

            # Proceed loading the file chosen by the user
            pathname = fileDialog.GetPath()
            try:
                with open(pathname, 'r') as file:
                    self.OpenData(file)
            except IOError:
                wx.LogError("Cannot open file '%s'." % pathname)

    def OpenData(self, file):
        data = file.readlines()  # On assigne à L toutes les lignes du fichier
        nb_lignes = len(data)  # On assigne à nb_lignes la longueur de L
        file.close()

        for i in range(nb_lignes):
            data[i] = data[i].strip('\n')
            temp = data[i].split()
            time.append(float(temp[0]))
            speed.append((float(temp[8])+float(temp[9]))*r/2)
            distance.append(speed[i]*1/1000) # Ici 1/1000 correspond à la fréquence d'échantillonage, modifiable en fx du capteur
            brake_p.append(float(temp[1]))
            throttle.append(float(temp[2]))
            g_x.append(float(temp[3]))
            g_y.append(float(temp[4]))
            g_z.append(float(temp[5]))
            gps_x.append(float(temp[6]))
            gps_y.append(float(temp[7]))
            omega_fl.append(float(temp[8]))
            omega_fr.append(float(temp[9]))

        # Remove the text on the panel
        for child in self.GetChildren():
            child.Destroy()

        # create a panel and add it to the main window
        panel = wx.Panel(self)
        self.sizer = wx.BoxSizer(wx.VERTICAL)
        self.sizer.Add(panel, 1, wx.EXPAND)
        self.SetSizer(self.sizer)

        # Create the plot
        self.canvas = PlotCanvas(panel)
        self.canvas.Draw(self.drawBrakeThrottlePlot)
        self.sizer.Add(self.canvas, 1, wx.EXPAND)
        self.sizer.Add(self.createControls(panel), 0, wx.EXPAND)
        self.sizer.Add((-1, 10))
        self.sizer.Add(self.createButtonBar(panel), 0, wx.EXPAND)
        self.SetSizer(self.sizer)
        self.sizer.Fit(self)

    def createControls(self, panel):
        box = wx.StaticBox(panel, -1, 'Data')
        sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
        grid = wx.GridBagSizer(5, 5)

        txt1 = wx.StaticText(panel, -1, 'Time (s)')
        grid.Add(txt1, (1, 0))
        self.tc1 = wx.TextCtrl(panel, -1, '', size=(80, -1))
        grid.Add(self.tc1, (1, 1))
        txt2 = wx.StaticText(panel, -1, 'Speed (km/h)')
        grid.Add(txt2, (2, 0))
        self.tc2 = wx.TextCtrl(panel, -1, '', size=(80, -1))
        grid.Add(self.tc2, (2, 1))
        txt3 = wx.StaticText(panel, -1, 'RPM')
        grid.Add(txt3, (3, 0))
        self.tc3 = wx.TextCtrl(panel, -1, '', size=(80, -1))
        grid.Add(self.tc3, (3, 1))
        txt4 = wx.StaticText(panel, -1, 'Brake pressure')
        grid.Add(txt4, (4, 0))
        self.tc4 = wx.TextCtrl(panel, -1, '', size=(80, -1))
        grid.Add(self.tc4, (4, 1))
        txt5 = wx.StaticText(panel, -1, 'Throttle position')
        grid.Add(txt5, (5, 0))
        self.tc5 = wx.TextCtrl(panel, -1, '', size=(80, -1))
        grid.Add(self.tc5, (5, 1))
        sizer.Add(grid, 0, wx.ALL, 10)
        return sizer

    def createButtonBar(self, panel):
        """
        Create the buttons at the bottom of the panel
        """
        sizer = wx.BoxSizer(wx.HORIZONTAL)
        self.zoomInButton = wx.Button(panel, -1, "Zoom In")
        self.Bind(wx.EVT_BUTTON, self.OnZoomIn, self.zoomInButton)
        sizer.Add(self.zoomInButton, 0, wx.LEFT | wx.RIGHT, 10)
        self.zoomOutButton = wx.Button(panel, -1, "Zoom Out")
        self.Bind(wx.EVT_BUTTON, self.OnZoomOut, self.zoomOutButton)
        sizer.Add(self.zoomOutButton, 0, wx.LEFT | wx.RIGHT, 10)
        self.panLeftButton = wx.Button(panel, -1, "Pan Left")
        self.Bind(wx.EVT_BUTTON, self.OnPanLeft, self.panLeftButton)
        sizer.Add(self.panLeftButton, 0, wx.LEFT | wx.RIGHT, 10)
        self.panRightButton = wx.Button(panel, -1, "Pan Right")
        self.Bind(wx.EVT_BUTTON, self.OnPanRight, self.panRightButton)
        sizer.Add(self.panRightButton, 0, wx.LEFT | wx.RIGHT, 10)
        self.resetButton = wx.Button(panel, -1, "Reset")
        self.Bind(wx.EVT_BUTTON, self.OnReset, self.resetButton)
        sizer.Add(self.resetButton, 0, wx.LEFT | wx.RIGHT, 10)
        self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, self.resetButton)
        return sizer

    def OnZoomIn(self, event):
        self.canvas.Zoom(1.2)
        event.Skip()

    def OnZoomOut(self, event):
        self.canvas.Zoom(1/1.2)
        event.Skip()

    def OnPanLeft(self, event):
        self.canvas.Move(-0.1, 0)
        event.Skip()

    def OnPanRight(self, event):
        self.canvas.Move(0.1, 0)
        event.Skip()

    def OnReset(self, event):
        self.canvas.Reset()
        event.Skip()

    def OnUpdateUI(self, event):
        if self.canvas.CanReset():
            self.resetButton.Enable(True)
        else:
            self.resetButton.Enable(False)

if __name__ == '__main__':
    app = wx.App()
    frame = MainWindow(None, title='Telemetry EFT')
    frame.Show()
    app.MainLoop()
</code>```

And here is a link to the example data file : data file

Title: Can't insert graph in a wxPython GUI

Body:
I am trying to make a telemetry software for a college project, that's why I'm using wxPython to make a GUI. I'm currently trying to make a function that displays a graph of brake_p and throttle in function of the time after I opened the entry file.
The code looks good to me, however it looks like there is an error inside the module that blocks me from succeeding.

Here is the error I get when I open the entry file :

> PS C:\Users\Adrie\OneDrive\Bureau\telemetry python>  &
> 'C:\Users\Adrie\AppData\Local\Microsoft\WindowsApps\python3.10.exe'
> 'c:\Users\Adrie\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '54993' '--' 'c:\Users\Adrie\OneDrive\Bureau\telemetry
> python\v0601.py'  Traceback (most recent call last): File
> "c:\Users\Adrie\OneDrive\Bureau\telemetry python\v0601.py", line 105,
> in OnOpen self.OpenData(file) File
> "c:\Users\Adrie\OneDrive\Bureau\telemetry python\v0601.py", line 144,
> in OpenData self.canvas.Draw(self.drawBrakeThrottlePlot) File
> "C:\Users\Adrie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\wx\lib\plot\plotcanvas.py",
> line 1750, in Drawgraphics.logScale = self.logScale AttributeError:
> 'method' object has no attribute 'logScale' PS
> C:\Users\Adrie\OneDrive\Bureau\telemetry python>

The error I can't understand is the part in bold caracters,as it is nowhere in my code :
Drawgraphics.logScale = self.logScale
AttributeError: 'method' object has no attribute 'logScale'

I 'd like to add I plan to add a bar marker on the graph that would be either automatically move at real-time, or either movable by the user so the time at the marker would be used to display in other widget data corresponding to the exact instant (like in the matlab simulink graph/scopes), which means I can't store the graph as a bitmap but really as a graph/plot.

I tried to switch to another library to import the plot into the wxFrame but I just can't make it work as they look more complicated to me, so I got back to this method.

Here is the code :

import wx
import numpy as np
import matplotlib.pyplot as plt
from wx.lib.plot import PlotCanvas, PlotGraphics, PolyLine, PolyMarker
import wxmplot.interactive as wi

# Variables initialization
time, speed, distance, brake_p, throttle, g_x, g_y, g_z, gps_x, gps_y, omega_fl, omega_fr = ([] for i in range(12))
r=1     # Wheel radius, will implement a feature to make it editable by the user later

class MainWindow(wx.Frame):
    def __init__(self, *args, **kw):
        super(MainWindow, self).__init__(*args, **kw)
        # Create a panel and add it to the main window
        panel = wx.Panel(self)
        # Set the panel as the main window's sizer
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(panel, 1, wx.EXPAND)
        self.SetSizer(sizer)
        # Set the window's min size
        self.SetMinSize((1280,720))

        # create a menu bar
        self.makeMenuBar()

        # and a status bar
        self.CreateStatusBar()
        self.SetStatusText("v 0.1")

        # put some text with a larger bold font on it
        st = wx.StaticText(panel, label="Welcome on the EFT's Telemetry software !")
        font = st.GetFont()
        font.PointSize += 10
        font = font.Bold()
        st.SetFont(font)

        # and create a sizer to manage the layout of child widgets
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(st, wx.SizerFlags().Border(wx.TOP|wx.LEFT, 25))
        panel.SetSizer(sizer)

    def makeMenuBar(self):
        # Make a file menu with Hello and Exit items
        fileMenu = wx.Menu()
        # The "\t..." syntax defines an accelerator key that also triggers
        # the same event
        openItem = fileMenu.Append(-1, "&Open...\tCtrl-O",
                "Open a data file")
        fileMenu.AppendSeparator()
        # When using a stock ID we don't need to specify the menu item's
        # label
        exitItem = fileMenu.Append(wx.ID_EXIT)

        # Now a help menu for the about item
        helpMenu = wx.Menu()
        aboutItem = helpMenu.Append(wx.ID_ABOUT)

        # Now a view menu for the view item
        # viewMenu = wx.Menu()
        # aboutItem = helpMenu.Append(wx.ID_VIEW)

        # Make the menu bar and add the two menus to it. The '&' defines
        # that the next letter is the "mnemonic" for the menu item. On the
        # platforms that support it those letters are underlined and can be
        # triggered from the keyboard.

        menuBar = wx.MenuBar()
        menuBar.Append(fileMenu, "&File")
        menuBar.Append(helpMenu, "&Help")
        # menuBar.Append(viewMenu, "&View")

        # Give the menu bar to the frame
        self.SetMenuBar(menuBar)

        # Finally, associate a handler function with the EVT_MENU event for
        # each of the menu items. That means that when that menu item is
        # activated then the associated handler function will be called.
        self.Bind(wx.EVT_MENU, self.OnOpen, openItem)
        self.Bind(wx.EVT_MENU, self.OnExit,  exitItem)
        self.Bind(wx.EVT_MENU, self.OnAbout, aboutItem)

    def OnExit(self, event):
        self.Close(True)

    def OnAbout(self, event):
        wx.MessageBox("This is a simple Telemetry software project.",
                    wx.OK|wx.ICON_INFORMATION)

    def drawBrakeThrottlePlot():
        data1 = PolyLine([time, brake_p], legend='Brake Pressure (%)',  colour='red', width='1')
        data2 = PolyLine([time, throttle], legend='Throttle (%)', colour='green', width='1')
        return PlotGraphics([data1, data2], "Real Time Brake Pressure and Throttle", "Time (ms)", "Relative Value (%)")

    def OnOpen(self, event):
         # Create the file dialog
        with wx.FileDialog(self, "Open Data file", wildcard="text files (*.txt)|*.txt",
                        style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST) as fileDialog:

            if fileDialog.ShowModal() == wx.ID_CANCEL:
                return     # the user changed their mind

            # Proceed loading the file chosen by the user
            pathname = fileDialog.GetPath()
            try:
                with open(pathname, 'r') as file:
                    self.OpenData(file)
            except IOError:
                wx.LogError("Cannot open file '%s'." % pathname)

    def OpenData(self, file):
        data = file.readlines()  # On assigne à L toutes les lignes du fichier
        nb_lignes = len(data)  # On assigne à nb_lignes la longueur de L
        file.close()

        for i in range(nb_lignes):
            data[i] = data[i].strip('\n')
            temp = data[i].split()
            time.append(float(temp[0]))
            speed.append((float(temp[8])+float(temp[9]))*r/2)
            distance.append(speed[i]*1/1000) # Ici 1/1000 correspond à la fréquence d'échantillonage, modifiable en fx du capteur
            brake_p.append(float(temp[1]))
            throttle.append(float(temp[2]))
            g_x.append(float(temp[3]))
            g_y.append(float(temp[4]))
            g_z.append(float(temp[5]))
            gps_x.append(float(temp[6]))
            gps_y.append(float(temp[7]))
            omega_fl.append(float(temp[8]))
            omega_fr.append(float(temp[9]))

        # Remove the text on the panel
        for child in self.GetChildren():
            child.Destroy()

        # create a panel and add it to the main window
        panel = wx.Panel(self)
        self.sizer = wx.BoxSizer(wx.VERTICAL)
        self.sizer.Add(panel, 1, wx.EXPAND)
        self.SetSizer(self.sizer)

        # Create the plot
        self.canvas = PlotCanvas(panel)
        self.canvas.Draw(self.drawBrakeThrottlePlot)
        self.sizer.Add(self.canvas, 1, wx.EXPAND)
        self.sizer.Add(self.createControls(panel), 0, wx.EXPAND)
        self.sizer.Add((-1, 10))
        self.sizer.Add(self.createButtonBar(panel), 0, wx.EXPAND)
        self.SetSizer(self.sizer)
        self.sizer.Fit(self)

    def createControls(self, panel):
        box = wx.StaticBox(panel, -1, 'Data')
        sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
        grid = wx.GridBagSizer(5, 5)

        txt1 = wx.StaticText(panel, -1, 'Time (s)')
        grid.Add(txt1, (1, 0))
        self.tc1 = wx.TextCtrl(panel, -1, '', size=(80, -1))
        grid.Add(self.tc1, (1, 1))
        txt2 = wx.StaticText(panel, -1, 'Speed (km/h)')
        grid.Add(txt2, (2, 0))
        self.tc2 = wx.TextCtrl(panel, -1, '', size=(80, -1))
        grid.Add(self.tc2, (2, 1))
        txt3 = wx.StaticText(panel, -1, 'RPM')
        grid.Add(txt3, (3, 0))
        self.tc3 = wx.TextCtrl(panel, -1, '', size=(80, -1))
        grid.Add(self.tc3, (3, 1))
        txt4 = wx.StaticText(panel, -1, 'Brake pressure')
        grid.Add(txt4, (4, 0))
        self.tc4 = wx.TextCtrl(panel, -1, '', size=(80, -1))
        grid.Add(self.tc4, (4, 1))
        txt5 = wx.StaticText(panel, -1, 'Throttle position')
        grid.Add(txt5, (5, 0))
        self.tc5 = wx.TextCtrl(panel, -1, '', size=(80, -1))
        grid.Add(self.tc5, (5, 1))
        sizer.Add(grid, 0, wx.ALL, 10)
        return sizer

    def createButtonBar(self, panel):
        """
        Create the buttons at the bottom of the panel
        """
        sizer = wx.BoxSizer(wx.HORIZONTAL)
        self.zoomInButton = wx.Button(panel, -1, "Zoom In")
        self.Bind(wx.EVT_BUTTON, self.OnZoomIn, self.zoomInButton)
        sizer.Add(self.zoomInButton, 0, wx.LEFT | wx.RIGHT, 10)
        self.zoomOutButton = wx.Button(panel, -1, "Zoom Out")
        self.Bind(wx.EVT_BUTTON, self.OnZoomOut, self.zoomOutButton)
        sizer.Add(self.zoomOutButton, 0, wx.LEFT | wx.RIGHT, 10)
        self.panLeftButton = wx.Button(panel, -1, "Pan Left")
        self.Bind(wx.EVT_BUTTON, self.OnPanLeft, self.panLeftButton)
        sizer.Add(self.panLeftButton, 0, wx.LEFT | wx.RIGHT, 10)
        self.panRightButton = wx.Button(panel, -1, "Pan Right")
        self.Bind(wx.EVT_BUTTON, self.OnPanRight, self.panRightButton)
        sizer.Add(self.panRightButton, 0, wx.LEFT | wx.RIGHT, 10)
        self.resetButton = wx.Button(panel, -1, "Reset")
        self.Bind(wx.EVT_BUTTON, self.OnReset, self.resetButton)
        sizer.Add(self.resetButton, 0, wx.LEFT | wx.RIGHT, 10)
        self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, self.resetButton)
        return sizer

    def OnZoomIn(self, event):
        self.canvas.Zoom(1.2)
        event.Skip()

    def OnZoomOut(self, event):
        self.canvas.Zoom(1/1.2)
        event.Skip()

    def OnPanLeft(self, event):
        self.canvas.Move(-0.1, 0)
        event.Skip()

    def OnPanRight(self, event):
        self.canvas.Move(0.1, 0)
        event.Skip()

    def OnReset(self, event):
        self.canvas.Reset()
        event.Skip()

    def OnUpdateUI(self, event):
        if self.canvas.CanReset():
            self.resetButton.Enable(True)
        else:
            self.resetButton.Enable(False)

if __name__ == '__main__':
    app = wx.App()
    frame = MainWindow(None, title='Telemetry EFT')
    frame.Show()
    app.MainLoop()

And here is a link to the example data file : data file


问:
I Want to render component when user scrolled on top in react native giftedchat
I Have an onScroll Event that returns the current value of the current scroll value and I want to render the offer details card when the user scrolled on top of the message. anyone do you have any idea about this in react native ??

```<code>  const [scrolledRecord, setScrolledRecord] = useState(false);
</code>```
```<code>  const prevScroll = 0;
  let currentScroll = 0;
</code>```
```<code>
              listViewProps={{
                scrollEventThrottle: 400,
                onScroll: ({nativeEvent}) => {
                  if (nativeEvent.contentOffset.y) {
                    currentScroll = nativeEvent.contentOffset.y;

                    if (currentScroll < prevScroll) {
                      setScrolledRecord(false);
                      console.log(currentScroll, prevScroll);
                    } else {
                      setScrolledRecord(true);
                    }
                  }
                },
              }}
</code>```
```<code>     {scrolledRecord ? <ChatHeader item={userData} /> : null}
</code>```

Here is current on scrolled values

```<code>56
597.8181762695312
717.8181762695312
981.4545288085938
1250.9090576171875
1509.8182373046875
1736.727294921875
1624.727294921875
1488.727294921875
1361.0909423828125
1210.54541015625
1106.54541015625
842.9091186523438
573.0908813476562
447.2727355957031
182.18182373046875
-6.181818008422852
-6.181818008422852 0
0
</code>```

When the User Scrolled to the top then it returns the large number 123,123000 same as when the user scrolled to the button then it will render 0 sometimes -6

My Logic is not working as per my expectations

Body:
I Have an onScroll Event that returns the current value of the current scroll value and I want to render the offer details card when the user scrolled on top of the message. anyone do you have any idea about this in react native ??

  const [scrolledRecord, setScrolledRecord] = useState(false);

  const prevScroll = 0;
  let currentScroll = 0;

              listViewProps={{
                scrollEventThrottle: 400,
                onScroll: ({nativeEvent}) => {
                  if (nativeEvent.contentOffset.y) {
                    currentScroll = nativeEvent.contentOffset.y;

                    if (currentScroll < prevScroll) {
                      setScrolledRecord(false);
                      console.log(currentScroll, prevScroll);
                    } else {
                      setScrolledRecord(true);
                    }
                  }
                },
              }}

     {scrolledRecord ? <ChatHeader item={userData} /> : null}

Here is current on scrolled values

56
597.8181762695312
717.8181762695312
981.4545288085938
1250.9090576171875
1509.8182373046875
1736.727294921875
1624.727294921875
1488.727294921875
1361.0909423828125
1210.54541015625
1106.54541015625
842.9091186523438
573.0908813476562
447.2727355957031
182.18182373046875
-6.181818008422852
-6.181818008422852 0
0

When the User Scrolled to the top then it returns the large number 123,123000 same as when the user scrolled to the button then it will render 0 sometimes -6

My Logic is not working as per my expectations


问:
Skipping Android Wizard Setup through C# automated testing
I am looking for a way to go through the Google wizard setup for Android,( when setting up a new phone), by creating an automatic test, preferably with C#. I was thinking about Appium, but I am not sure. Any leads ?
I am looking for a solution that won’t need the Debugging mode on. As I will be at the set up screen.
Thank you !</p>


问:
vue2 DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported
I am using vue2 in my project. I have an img tag which i have added crossorigin = "anonymous" to it.
I need to use canvas to print screen from a video in a specific time and show it. After I draw the image when I try to assign canvas.datatourl() to my img tag src, I get the error which you can see in title.

I searched the whole internet. All solutions were to put crossorigin="anonymous" and the problem would be solved. I tried this (as I said inside img tag or the moment before I assign canvas.datatourl() to my img tag src) but I still get this error. This is my img tag:

```
<p>and this is my screen shot function:</p>
<pre class="lang-js prettyprint-override"><code>var video = document.getElementById(videoId);
var w = video.videoWidth;
var h = video.videoHeight;
var canvas2 = document.createElement("canvas");
canvas2.width = w;
canvas2.height = h;
document.getElementById("imgeBeforeMainVideo").crossorigin = "anonymous";
var ctx = canvas2.getContext("2d");
ctx.drawImage(video, 0, 0, canvas2.width, canvas2.height);
let image = canvas2.toDataURL("image/jpeg")
document.getElementById("imgeBeforeMainVideo").src = image;
</code>```

Body:
I am using vue2 in my project. I have an img tag which i have added crossorigin = "anonymous" to it.
I need to use canvas to print screen from a video in a specific time and show it. After I draw the image when I try to assign canvas.datatourl() to my img tag src, I get the error which you can see in title.

I searched the whole internet. All solutions were to put crossorigin="anonymous" and the problem would be solved. I tried this (as I said inside img tag or the moment before I assign canvas.datatourl() to my img tag src) but I still get this error. This is my img tag:

and this is my screen shot function:

var video = document.getElementById(videoId);
var w = video.videoWidth;
var h = video.videoHeight;
var canvas2 = document.createElement("canvas");
canvas2.width = w;
canvas2.height = h;
document.getElementById("imgeBeforeMainVideo").crossorigin = "anonymous";
var ctx = canvas2.getContext("2d");
ctx.drawImage(video, 0, 0, canvas2.width, canvas2.height);
let image = canvas2.toDataURL("image/jpeg")
document.getElementById("imgeBeforeMainVideo").src = image;