问:
Unable to run react native IOS application on device due to codesign errors
I have a react native application (that I deploy with expo). I am trying to run on ios.

I had a app under a different account  under the build identifier com.bcc.quickpass. There, the build was working fine. I transferred the app along with the build identifier to my current account.

I then tried to run the app under my current account account using automated signing. The app builds but the following comes up:

Here is the XCode Log:

```<code>Could not launch “QuickPass”
Domain: IDEDebugSessionErrorDomain
Code: 3
Failure Reason: The operation couldn’t be completed. Unable to launch com.bcc.quickpass because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user.
User Info: {
    DVTErrorCreationDateKey = "2022-12-06 06:01:22 +0000";
    DVTRadarComponentKey = 855031;
    IDERunOperationFailingWorker = DBGLLDBLauncher;
    RawUnderlyingErrorMessage = "The operation couldn\U2019t be completed. Unable to launch com.bcc.quickpass because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user.";
}
--

Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : {
    "device_model" = "iPhone10,1";
    "device_osBuild" = "14.6 (18F72)";
    "device_platform" = "com.apple.platform.iphoneos";
    "launchSession_schemeCommand" = Run;
    "launchSession_state" = 1;
    "launchSession_targetArch" = arm64;
    "operation_duration_ms" = 32442;
    "operation_errorCode" = 3;
    "operation_errorDomain" = IDEDebugSessionErrorDomain;
    "operation_errorWorker" = DBGLLDBLauncher;
    "operation_name" = IDEiPhoneRunOperationWorkerGroup;
    "param_consoleMode" = 0;
    "param_debugger_attachToExtensions" = 0;
    "param_debugger_attachToXPC" = 1;
    "param_debugger_type" = 5;
    "param_destination_isProxy" = 0;
    "param_destination_platform" = "com.apple.platform.iphoneos";
    "param_diag_MainThreadChecker_stopOnIssue" = 0;
    "param_diag_MallocStackLogging_enableDuringAttach" = 0;
    "param_diag_MallocStackLogging_enableForXPC" = 1;
    "param_diag_allowLocationSimulation" = 1;
    "param_diag_gpu_frameCapture_enable" = 0;
    "param_diag_gpu_shaderValidation_enable" = 0;
    "param_diag_gpu_validation_enable" = 0;
    "param_diag_memoryGraphOnResourceException" = 0;
    "param_diag_queueDebugging_enable" = 1;
    "param_diag_runtimeProfile_generate" = 0;
    "param_diag_sanitizer_asan_enable" = 0;
    "param_diag_sanitizer_tsan_enable" = 0;
    "param_diag_sanitizer_tsan_stopOnIssue" = 0;
    "param_diag_sanitizer_ubsan_stopOnIssue" = 0;
    "param_diag_showNonLocalizedStrings" = 0;
    "param_diag_viewDebugging_enabled" = 1;
    "param_diag_viewDebugging_insertDylibOnLaunch" = 1;
    "param_install_style" = 0;
    "param_launcher_UID" = 2;
    "param_launcher_allowDeviceSensorReplayData" = 0;
    "param_launcher_kind" = 0;
    "param_launcher_style" = 0;
    "param_launcher_substyle" = 0;
    "param_runnable_appExtensionHostRunMode" = 0;
    "param_runnable_productType" = "com.apple.product-type.application";
    "param_runnable_swiftVersion" = "5.5.2";
    "param_runnable_type" = 2;
    "param_testing_launchedForTesting" = 0;
    "param_testing_suppressSimulatorApp" = 0;
    "param_testing_usingCLI" = 0;
    "sdk_canonicalName" = "iphoneos15.2";
    "sdk_osVersion" = "15.2";
    "sdk_variant" = iphoneos;
}
--

System Information

macOS Version 11.4 (Build 20F71)
Xcode 13.2.1 (19586) (Build 13C100)
Timestamp: 2022-12-06T12:01:22+06:00
</code>```

I also tried to build the app using expo. But codesign error occurs.

```<code>SQTCs-Mac-mini:ekyc-native-app sqtc$ expo run:ios --device 68f18c4f36c2943dff92345ae21bc58887477c55
...
...
CodeSign /Users/sqtc/Library/Developer/Xcode/DerivedData/QuickPass-faybjdvqxbotkeajwmmcoupclnpg/Build/Products/Debug-iphoneos/QuickPass.app (in target 'QuickPass' from project 'QuickPass')
    cd /Users/sqtc/Desktop/ekyc-native-app/ios
    export CODESIGN_ALLOCATE\=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate

    Signing Identity:     "Apple Development: Samidhya Sarker (66DM5N2A46)"
    Provisioning Profile: "iOS Team Provisioning Profile: com.bcc.quickpass"
                          (50d1bff7-a77b-4ecb-88d2-a0b7620625c6)

    /usr/bin/codesign --force --sign BF6FCB75B17E29CD93717001359BB14881C0ED50 --entitlements /Users/sqtc/Library/Developer/Xcode/DerivedData/QuickPass-faybjdvqxbotkeajwmmcoupclnpg/Build/Intermediates.noindex/QuickPass.build/Debug-iphoneos/QuickPass.build/QuickPass.app.xcent --timestamp\=none --generate-entitlement-der /Users/sqtc/Library/Developer/Xcode/DerivedData/QuickPass-faybjdvqxbotkeajwmmcoupclnpg/Build/Products/Debug-iphoneos/QuickPass.app
/Users/sqtc/Library/Developer/Xcode/DerivedData/QuickPass-faybjdvqxbotkeajwmmcoupclnpg/Build/Products/Debug-iphoneos/QuickPass.app: errSecInternalComponent
Command CodeSign failed with a nonzero exit code

** BUILD FAILED **

The following build commands failed:
        CodeSign /Users/sqtc/Library/Developer/Xcode/DerivedData/QuickPass-faybjdvqxbotkeajwmmcoupclnpg/Build/Products/Debug-iphoneos/QuickPass.app (in target 'QuickPass' from project 'QuickPass')
(1 failure)
Build logs written to /Users/sqtc/Desktop/ekyc-native-app/.expo/xcodebuild.log
</code>```

react-native also gives the same errors:

```<code>SQTCs-Mac-mini:ekyc-native-app sqtc$ npx react-native run-ios --device "SQTC’s iPhone"
^C
SQTCs-Mac-mini:ekyc-native-app sqtc$ npx react-native run-ios --device "SQTCs iPhone"
info Found Xcode workspace "QuickPass.xcworkspace"
info Building (using "xcodebuild -workspace QuickPass.xcworkspace -configuration Debug -scheme QuickPass -destination id=68f18c4f36c2943dff92345ae21bc58887477c55")
▸ Running script 'Create Symlinks to Header Folders'
▸ Running script 'Create Symlinks to Header Folders'
▸ Running script '[CP-User] Generate Specs'
▸ Copying /Users/sqtc/Desktop/ekyc-native-app/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h
▸ Compiling FBReactNativeSpec-generated.mm
▸ Running script '[CP-User] Generate app.manifest for expo-updates'
▸ Running script '[CP-User] Generate app.config for prebuilt Constants.manifest'
▸ Running script 'Create Symlinks to Header Folders'
▸ Compiling RCTVibration.mm
▸ Compiling RCTSettingsManager.mm
▸ Compiling RCTNetworking.mm
▸ Compiling RCTLinkingManager.mm
▸ Compiling RCTImageStoreManager.mm
▸ Compiling RCTFileReaderModule.mm
▸ Compiling RCTNativeAnimatedTurboModule.mm
▸ Compiling RCTAccessibilityManager.mm
▸ Compiling RCTBlobManager.mm
▸ Compiling RCTImageLoader.mm
▸ Compiling RCTImageEditingManager.mm
▸ Compiling RCTNativeAnimatedModule.mm
▸ Compiling RCTWebSocketModule.mm
▸ Compiling RCTTiming.mm
▸ Compiling RCTStatusBarManager.mm
▸ Compiling RCTSourceCode.mm
▸ Compiling RCTRedBox.mm
▸ Compiling RCTPlatform.mm
▸ Compiling RCTLogBox.mm
▸ Compiling RCTKeyboardObserver.mm
▸ Compiling RCTI18nManager.mm
▸ Compiling RCTExceptionsManager.mm
▸ Compiling RCTDeviceInfo.mm
▸ Compiling RCTDevSplitBundleLoader.mm
▸ Compiling RCTDevSettings.mm
▸ Compiling RCTDevMenu.mm
▸ Compiling RCTDevLoadingView.mm
▸ Compiling RCTClipboard.mm
▸ Compiling RCTAsyncLocalStorage.mm
▸ Compiling RCTAppearance.mm
▸ Compiling RCTAppState.mm
▸ Compiling RCTAlertManager.mm
▸ Compiling RCTActionSheetManager.mm
▸ Running script 'Start Packager'
▸ Linking QuickPass
⚠  ld: method '+UIDatePickerMode:' in category from /Users/sqtc/Library/Developer/Xcode/DerivedData/QuickPass-faybjdvqxbotkeajwmmcoupclnpg/Build/Products/Debug-iphoneos/React-Core/React.framework/React(RCTDatePickerManager.o) conflicts with same method from another category
▸ Running script 'Bundle React Native code and images'
    the transform cache was reset.
▸ Processing Info.plist
▸ Running script '[CP] Copy Pods Resources'
▸ Running script '[CP-User] [RNFB] Core Configuration'
      A firebase.json file was not found, whilst this file is optional it is recommended to include it to configure firebase services in React Native Firebase.
▸ Generating 'QuickPass.app.dSYM'
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening QuickPass.xcworkspace.
info Run CLI with --verbose flag for more details.
</code>```

I then tried to create new signing profiles. Created new CSRs in my device and uploaded them to developer.apple.com and created new development certificates. But the same error occurs.

My device informations:

Development machine: macOS Big Sur (11.4)

XCode: 13.2.1 (13C100)

Device: iOS 14.1

Body:
I have a react native application (that I deploy with expo). I am trying to run on ios.

I had a app under a different account  under the build identifier com.bcc.quickpass. There, the build was working fine. I transferred the app along with the build identifier to my current account.

I then tried to run the app under my current account account using automated signing. The app builds but the following comes up:

Here is the XCode Log:

Could not launch “QuickPass”
Domain: IDEDebugSessionErrorDomain
Code: 3
Failure Reason: The operation couldn’t be completed. Unable to launch com.bcc.quickpass because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user.
User Info: {
    DVTErrorCreationDateKey = "2022-12-06 06:01:22 +0000";
    DVTRadarComponentKey = 855031;
    IDERunOperationFailingWorker = DBGLLDBLauncher;
    RawUnderlyingErrorMessage = "The operation couldn\U2019t be completed. Unable to launch com.bcc.quickpass because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user.";
}
--

Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : {
    "device_model" = "iPhone10,1";
    "device_osBuild" = "14.6 (18F72)";
    "device_platform" = "com.apple.platform.iphoneos";
    "launchSession_schemeCommand" = Run;
    "launchSession_state" = 1;
    "launchSession_targetArch" = arm64;
    "operation_duration_ms" = 32442;
    "operation_errorCode" = 3;
    "operation_errorDomain" = IDEDebugSessionErrorDomain;
    "operation_errorWorker" = DBGLLDBLauncher;
    "operation_name" = IDEiPhoneRunOperationWorkerGroup;
    "param_consoleMode" = 0;
    "param_debugger_attachToExtensions" = 0;
    "param_debugger_attachToXPC" = 1;
    "param_debugger_type" = 5;
    "param_destination_isProxy" = 0;
    "param_destination_platform" = "com.apple.platform.iphoneos";
    "param_diag_MainThreadChecker_stopOnIssue" = 0;
    "param_diag_MallocStackLogging_enableDuringAttach" = 0;
    "param_diag_MallocStackLogging_enableForXPC" = 1;
    "param_diag_allowLocationSimulation" = 1;
    "param_diag_gpu_frameCapture_enable" = 0;
    "param_diag_gpu_shaderValidation_enable" = 0;
    "param_diag_gpu_validation_enable" = 0;
    "param_diag_memoryGraphOnResourceException" = 0;
    "param_diag_queueDebugging_enable" = 1;
    "param_diag_runtimeProfile_generate" = 0;
    "param_diag_sanitizer_asan_enable" = 0;
    "param_diag_sanitizer_tsan_enable" = 0;
    "param_diag_sanitizer_tsan_stopOnIssue" = 0;
    "param_diag_sanitizer_ubsan_stopOnIssue" = 0;
    "param_diag_showNonLocalizedStrings" = 0;
    "param_diag_viewDebugging_enabled" = 1;
    "param_diag_viewDebugging_insertDylibOnLaunch" = 1;
    "param_install_style" = 0;
    "param_launcher_UID" = 2;
    "param_launcher_allowDeviceSensorReplayData" = 0;
    "param_launcher_kind" = 0;
    "param_launcher_style" = 0;
    "param_launcher_substyle" = 0;
    "param_runnable_appExtensionHostRunMode" = 0;
    "param_runnable_productType" = "com.apple.product-type.application";
    "param_runnable_swiftVersion" = "5.5.2";
    "param_runnable_type" = 2;
    "param_testing_launchedForTesting" = 0;
    "param_testing_suppressSimulatorApp" = 0;
    "param_testing_usingCLI" = 0;
    "sdk_canonicalName" = "iphoneos15.2";
    "sdk_osVersion" = "15.2";
    "sdk_variant" = iphoneos;
}
--

System Information

macOS Version 11.4 (Build 20F71)
Xcode 13.2.1 (19586) (Build 13C100)
Timestamp: 2022-12-06T12:01:22+06:00

I also tried to build the app using expo. But codesign error occurs.

SQTCs-Mac-mini:ekyc-native-app sqtc$ expo run:ios --device 68f18c4f36c2943dff92345ae21bc58887477c55
...
...
CodeSign /Users/sqtc/Library/Developer/Xcode/DerivedData/QuickPass-faybjdvqxbotkeajwmmcoupclnpg/Build/Products/Debug-iphoneos/QuickPass.app (in target 'QuickPass' from project 'QuickPass')
    cd /Users/sqtc/Desktop/ekyc-native-app/ios
    export CODESIGN_ALLOCATE\=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate

    Signing Identity:     "Apple Development: Samidhya Sarker (66DM5N2A46)"
    Provisioning Profile: "iOS Team Provisioning Profile: com.bcc.quickpass"
                          (50d1bff7-a77b-4ecb-88d2-a0b7620625c6)

    /usr/bin/codesign --force --sign BF6FCB75B17E29CD93717001359BB14881C0ED50 --entitlements /Users/sqtc/Library/Developer/Xcode/DerivedData/QuickPass-faybjdvqxbotkeajwmmcoupclnpg/Build/Intermediates.noindex/QuickPass.build/Debug-iphoneos/QuickPass.build/QuickPass.app.xcent --timestamp\=none --generate-entitlement-der /Users/sqtc/Library/Developer/Xcode/DerivedData/QuickPass-faybjdvqxbotkeajwmmcoupclnpg/Build/Products/Debug-iphoneos/QuickPass.app
/Users/sqtc/Library/Developer/Xcode/DerivedData/QuickPass-faybjdvqxbotkeajwmmcoupclnpg/Build/Products/Debug-iphoneos/QuickPass.app: errSecInternalComponent
Command CodeSign failed with a nonzero exit code

** BUILD FAILED **

The following build commands failed:
        CodeSign /Users/sqtc/Library/Developer/Xcode/DerivedData/QuickPass-faybjdvqxbotkeajwmmcoupclnpg/Build/Products/Debug-iphoneos/QuickPass.app (in target 'QuickPass' from project 'QuickPass')
(1 failure)
Build logs written to /Users/sqtc/Desktop/ekyc-native-app/.expo/xcodebuild.log

react-native also gives the same errors:

SQTCs-Mac-mini:ekyc-native-app sqtc$ npx react-native run-ios --device "SQTC’s iPhone"
^C
SQTCs-Mac-mini:ekyc-native-app sqtc$ npx react-native run-ios --device "SQTCs iPhone"
info Found Xcode workspace "QuickPass.xcworkspace"
info Building (using "xcodebuild -workspace QuickPass.xcworkspace -configuration Debug -scheme QuickPass -destination id=68f18c4f36c2943dff92345ae21bc58887477c55")
▸ Running script 'Create Symlinks to Header Folders'
▸ Running script 'Create Symlinks to Header Folders'
▸ Running script '[CP-User] Generate Specs'
▸ Copying /Users/sqtc/Desktop/ekyc-native-app/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h
▸ Compiling FBReactNativeSpec-generated.mm
▸ Running script '[CP-User] Generate app.manifest for expo-updates'
▸ Running script '[CP-User] Generate app.config for prebuilt Constants.manifest'
▸ Running script 'Create Symlinks to Header Folders'
▸ Compiling RCTVibration.mm
▸ Compiling RCTSettingsManager.mm
▸ Compiling RCTNetworking.mm
▸ Compiling RCTLinkingManager.mm
▸ Compiling RCTImageStoreManager.mm
▸ Compiling RCTFileReaderModule.mm
▸ Compiling RCTNativeAnimatedTurboModule.mm
▸ Compiling RCTAccessibilityManager.mm
▸ Compiling RCTBlobManager.mm
▸ Compiling RCTImageLoader.mm
▸ Compiling RCTImageEditingManager.mm
▸ Compiling RCTNativeAnimatedModule.mm
▸ Compiling RCTWebSocketModule.mm
▸ Compiling RCTTiming.mm
▸ Compiling RCTStatusBarManager.mm
▸ Compiling RCTSourceCode.mm
▸ Compiling RCTRedBox.mm
▸ Compiling RCTPlatform.mm
▸ Compiling RCTLogBox.mm
▸ Compiling RCTKeyboardObserver.mm
▸ Compiling RCTI18nManager.mm
▸ Compiling RCTExceptionsManager.mm
▸ Compiling RCTDeviceInfo.mm
▸ Compiling RCTDevSplitBundleLoader.mm
▸ Compiling RCTDevSettings.mm
▸ Compiling RCTDevMenu.mm
▸ Compiling RCTDevLoadingView.mm
▸ Compiling RCTClipboard.mm
▸ Compiling RCTAsyncLocalStorage.mm
▸ Compiling RCTAppearance.mm
▸ Compiling RCTAppState.mm
▸ Compiling RCTAlertManager.mm
▸ Compiling RCTActionSheetManager.mm
▸ Running script 'Start Packager'
▸ Linking QuickPass
⚠  ld: method '+UIDatePickerMode:' in category from /Users/sqtc/Library/Developer/Xcode/DerivedData/QuickPass-faybjdvqxbotkeajwmmcoupclnpg/Build/Products/Debug-iphoneos/React-Core/React.framework/React(RCTDatePickerManager.o) conflicts with same method from another category
▸ Running script 'Bundle React Native code and images'
    the transform cache was reset.
▸ Processing Info.plist
▸ Running script '[CP] Copy Pods Resources'
▸ Running script '[CP-User] [RNFB] Core Configuration'
      A firebase.json file was not found, whilst this file is optional it is recommended to include it to configure firebase services in React Native Firebase.
▸ Generating 'QuickPass.app.dSYM'
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening QuickPass.xcworkspace.
info Run CLI with --verbose flag for more details.

I then tried to create new signing profiles. Created new CSRs in my device and uploaded them to developer.apple.com and created new development certificates. But the same error occurs.

My device informations:

Development machine: macOS Big Sur (11.4)

XCode: 13.2.1 (13C100)

Device: iOS 14.1


来源: stackexchange

问:
k8s service FQDN resolution in oauth2-proxy container provides resolved pod IPs as well as "No answer" - why?
We have oauth2-proxy to protect our GUI application.
nslookup command on oauth2-proxy container does get 2 Addresses returned in the response and it still shows "No answer"

I see this behavior in only oauth2-proxy container. Another container in same pod works doesn't give the "No answer"

The service FQDN address I am looking up for is headless service in another namespace, which resolves to POD IPs.

/etc/resolv.conf on both containers looks same.

Does anyone know why there is error as well address responses?

Expecting nslookup to give either address response or error. Not both..

echo $? after nslookup execution gives 0

ContentLicense: CC BY-SA 4.0


问:
(How) can I use job on a different pipeline?
Gitlab CI/CD

I want to run a job for the Merge Request that needs jar artefacts built during a job run in another pipelines (for commits).
I don't want to build them again because if takes too much time then the job will fail.

Can I do that?

I checked the

```<code>needs:
    - project:
</code>```

But that's only with Premium licences.

Body:
Gitlab CI/CD

I want to run a job for the Merge Request that needs jar artefacts built during a job run in another pipelines (for commits).
I don't want to build them again because if takes too much time then the job will fail.

Can I do that?

I checked the

needs:
    - project:

But that's only with Premium licences.


问:
Does the incoming codec or audio-video sync matter when encoding from Xvfb using FFMPEG?
How I'm capturing:

I'm using Xvfb on Linux, to capture a video and audio from an app that is also running on Linux. I'm using -f x11grab when capturing that video headlessly from Xvfb's frambuffer using FFMPEG, and encoding it using a few other parameters like -c:v libx264 -pix_fmt yuv420p.

The questions:

Since I'm reading from Xvfb framebuffer:

Would it matter that the app uses SVC to encode the video, and I'm using H.264?

Would it matter if I use a different framerate than the app is using?

Would it matter if I use a different pix_fmt than what the app is using?

Reason for asking:

As shown in the image (blue is the app, red is FFMPEG, green is Xvfb);

The CPU percentage consumed by FFMPEG shoots up when the app's CPU percentage shoots up. I've also encountered audio being ahead of video for some participants, but I'm unable to figure out whether it's due to network lag or due to FFMPEG's encoding.

Also, the aim is to reduce CPU consumption, so I was looking to see if I could do FFMPEG encoding in the same format as the app.


问:
split column in multiple columns in sql view
I have created a view for the Leco results and it is attached here as ‘Leco Teble’ excel file. I would like to have same view in database with ‘expanded table’ column based on the sample ID’s as given in the expanded table. Would you please arrange with one of your team member to create a script to expand the table in the same view. Last column in the table “Shift” should be picked up based on the time with the sample ID. 6am to 6pm is day shift.


问:
How to resolve promise in render
In my code, I need to call a function that gives the API response data. am getting the result in promise. how to resolve it in the render method. The function this.metaDataFetch(); called in render.</p>
```<code>
class Layout extends Component {

metaDataFetch = async  function (context) {

    let metaContentData = await getMetaContent(parameter);
      let metacontent = {};
      let data = metaContentData.data;

      if(data && data.length){
          await data.map((element) => {
              let elements = element.attribute;
              metacontent[elements] = element.values || null
          })
      }

  return  metacontent;

}

  render() {

    let data =  this.metaDataFetch();
    console.log("data is <pending>" , data)
    return (
      <>

        <Header pageProps={pageProps} match={this.props.match}/>
         <Footer/>
         </>
    );

}
}
export default Layout;
</code>```

Title: How to resolve promise in render

Body:
In my code, I need to call a function that gives the API response data. am getting the result in promise. how to resolve it in the render method. The function this.metaDataFetch(); called in render.

class Layout extends Component {

metaDataFetch = async  function (context) {

    let metaContentData = await getMetaContent(parameter);
      let metacontent = {};
      let data = metaContentData.data;

      if(data && data.length){
          await data.map((element) => {
              let elements = element.attribute;
              metacontent[elements] = element.values || null
          })
      }

  return  metacontent;

}

  render() {

    let data =  this.metaDataFetch();
    console.log("data is <pending>" , data)
    return (
      <>

         </>
    );

}
}
export default Layout;


问:
How to Implement a sorting function to a CollectionView in MAUI
I'm trying to develop a CollectionView with a sorting function to help the user to find the record easily through lot of records. And I want to Implement this without any UI libraries. For an example my data set have date set and I want to sort the data set according to a given condition</p>
```<code><CollectionView VerticalOptions="FillAndExpand"
                        IsGrouped="True"
                        ItemsSource="{Binding Employees}">

            <CollectionView.ItemTemplate>
                <DataTemplate x:DataType="models:LeaveHistoryModel">
                    <Label Text="{Binding  FromDate}" />

                </DataTemplate>
            </CollectionView.ItemTemplate>
</CollectionView>
</code>```

Body:
I'm trying to develop a CollectionView with a sorting function to help the user to find the record easily through lot of records. And I want to Implement this without any UI libraries. For an example my data set have date set and I want to sort the data set according to a given condition

<CollectionView VerticalOptions="FillAndExpand"
                        IsGrouped="True"
                        ItemsSource="{Binding Employees}">

            <CollectionView.ItemTemplate>
                <DataTemplate x:DataType="models:LeaveHistoryModel">

                </DataTemplate>
            </CollectionView.ItemTemplate>
</CollectionView>


问:
Click on button and fill elements inside a Table using Selenium Python
I have html table that both include button and fill form as follows

```<code><table class="configTbl" cellspacing="0">
    <tbody>
        <tr>
            <td><span id="_0" class="login_input_text">Username</span> :</td>
            <td>
                <input type="text" name="un" value="admin" class="configF1" id="txtUserName" size="20" maxlength="31" autocomplete="off">
            </td>
            <td> </td>
        </tr>
        <tr>
            <td><span id="_0" class="login_input_text">Password</span> :</td>
            <td>
                <input type="password" name="pw" id="txtLoginPwd" class="configF1" maxlength="64" autocomplete="off">
                <input type="hidden" name="rd" value="/uir/dwrhome.htm">
                <input type="hidden" name="rd2" value="/uir/loginpage.htm">
                <input type="hidden" name="Nrd" value="1">
                <input type="hidden" name="Nlmb">
            </td>
            <td> </td>
        </tr>
        <tr>
            <td colspan="3" class="submitBg_new">
                <input value="Login" id="_0" class="submit" onmouseover="this.className = 'submitHover'" onmouseout="this.className = 'submit'" title="Login" type="submit">
            </td>
        </tr>
    </tbody>
</table>
</code>```

the main issue is filling the forms and click button I have used following codes for filling password

```<code>password = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.ID,"txtLoginPwd")))
password = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="txtLoginPwd"]')))
password = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.NAME, 'pw')))
password = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, '//*[@name="pw"]')))
</code>```

and even filling forms in table

```<code>password = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((\
By.XPATH,"//form[@class='configTbl']/tbody/tr[2]/td[2]/input[1]")))
</code>```

or

```<code>password = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, \
###"//td[@class='user_type' and text()='real']//following-sibling::td[2]//button[contains(., 'Delete')]")))
#'//table[@class="configTbl"]/tbody/tr[2]/td[2]/a[@id="txtLoginPwd"]')))
'//table[@class="tableTest"]/tbody/tr[2]/td[2]/descendant::a[@id="txtLoginPwd"]')))
</code>```

but it has not been working for me.I get timeout error

TimeoutException: Message:
Stacktrace:
Backtrace:

in addition, clicking on login button has been difficult for me what should i do?

Body:
I have html table that both include button and fill form as follows

            Username :

                <input type="text" name="un" value="admin" class="configF1" id="txtUserName" size="20" maxlength="31" autocomplete="off">

            Password :

                <input type="password" name="pw" id="txtLoginPwd" class="configF1" maxlength="64" autocomplete="off">
                <input type="hidden" name="rd" value="/uir/dwrhome.htm">
                <input type="hidden" name="rd2" value="/uir/loginpage.htm">
                <input type="hidden" name="Nrd" value="1">
                <input type="hidden" name="Nlmb">

                <input value="Login" id="_0" class="submit" onmouseover="this.className = 'submitHover'" onmouseout="this.className = 'submit'" title="Login" type="submit">

the main issue is filling the forms and click button I have used following codes for filling password

password = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.ID,"txtLoginPwd")))
password = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="txtLoginPwd"]')))
password = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.NAME, 'pw')))
password = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, '//*[@name="pw"]')))

and even filling forms in table

password = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((\
By.XPATH,"//form[@class='configTbl']/tbody/tr[2]/td[2]/input[1]")))

or

password = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, \
###"//td[@class='user_type' and text()='real']//following-sibling::td[2]//button[contains(., 'Delete')]")))
#'//table[@class="configTbl"]/tbody/tr[2]/td[2]/a[@id="txtLoginPwd"]')))
'//table[@class="tableTest"]/tbody/tr[2]/td[2]/descendant::a[@id="txtLoginPwd"]')))

but it has not been working for me.I get timeout error

TimeoutException: Message:
Stacktrace:
Backtrace:

in addition, clicking on login button has been difficult for me what should i do?


问:
script mediator get from payload
I used script mediator to make multi where condition ,i have a method get the script is correct when i get from query parama as below :

```<code>    <script language="js"><![CDATA[var queryString = "WHERE ";
var AND =" AND ";
var id = mc.getProperty('query.param.id');
var age = mc.getProperty('query.param.age');
var note = mc.getProperty('query.param.note');
queryString += (id)? " id=" + id+" " + AND : " ";
queryString += (age)? " age=" + age+" " + AND : " ";
queryString += (note)? " note=" + note+" " + AND : "";
queryString =queryString.toString();
var n = queryString.lastIndexOf(AND);
mc.setProperty('queryString',queryString.slice(0, n));]]></script>
            <property expression="get-property('queryString')" name="uri.var.queryString" scope="default" type="STRING"/>
            <call>
                <endpoint>
                    <http method="get" uri-template="http://ITMTNF3RRJSJ:8290/services/studenttest/readstudent?filtreQuery={uri.var.queryString}">
</code>```

But now i have a method put with multi where i tried get from payload json then i used the iterate mediator to do the update according to the list of objects but it doesnt't work

here is my code:

```<code> <resource methods="PUT" uri-template="modif">
        <inSequence>
            <property expression="json-eval($)" name="JSONPayload" scope="default" type="STRING"/>
            <script language="js"><![CDATA[var queryString = "WHERE ";
var AND =" AND ";
  var pl_string = mc.getProperty("JSONPayload");
                    var newPayload="{\"event\": " + pl_string + "}";

queryString += (id)?  " id=" + id+" " + AND : " ";
queryString += (age)?" age=" + age+" " + AND : " ";
queryString += (note)? " note=" + note+" " + AND : "";
queryString =queryString.toString();
var n = queryString.lastIndexOf(AND);
 mc.setPayloadJSON(newPayload);]]></script>
            <property expression="get-property('queryString')" name="uri.var.queryString" scope="default" type="STRING"/>
            <log level="custom">
                <property expression="get-property('JSONPayload')" name="msgg"/>
            </log>
            <call>
                <endpoint>
                    <http method="get" uri-template="http://ITMTNF3RRJSJ:8290/services/studenttest/readstudent?filtreQuery={uri.var.queryString}">
                        <suspendOnFailure>
                            <initialDuration>-1</initialDuration>
                            <progressionFactor>-1</progressionFactor>
                            <maximumDuration>0</maximumDuration>
                        </suspendOnFailure>
                        <markForSuspension>
                            <retriesBeforeSuspension>0</retriesBeforeSuspension>
                        </markForSuspension>
                    </http>
                </endpoint>
            </call>
            <iterate expression="//etuidants/etudiant">
                <target>
                    <sequence>
                        <payloadFactory media-type="json">
                            <format>{
  "_putmodifstudent": {
                 "id":${payload.etudiant.id},
                 "nom":"${payload.etudiant.nom}",
                 "prenom":"${payload.etudiant.prenom}",
                 "age":"${payload.etudiant.age}",
                 "note":"${payloadetudiant.note}",
                 }
}</format>
                            <args/>
                        </payloadFactory>
                        <call>
                            <endpoint>
                                <http method="put" statistics="enable" trace="enable" uri-template="http://ITMTNF3RRJSJ:8290/services/studenttest/modifstudent">

</code>```

Title: script mediator get from payload

Body:
I used script mediator to make multi where condition ,i have a method get the script is correct when i get from query parama as below :

            <property expression="get-property('queryString')" name="uri.var.queryString" scope="default" type="STRING"/>
            <call>
                <endpoint>
                    <http method="get" uri-template="http://ITMTNF3RRJSJ:8290/services/studenttest/readstudent?filtreQuery={uri.var.queryString}">

But now i have a method put with multi where i tried get from payload json then i used the iterate mediator to do the update according to the list of objects but it doesnt't work

here is my code:

 <resource methods="PUT" uri-template="modif">
        <inSequence>
            <property expression="json-eval($)" name="JSONPayload" scope="default" type="STRING"/>

            <property expression="get-property('queryString')" name="uri.var.queryString" scope="default" type="STRING"/>
            <log level="custom">
                <property expression="get-property('JSONPayload')" name="msgg"/>
            </log>
            <call>
                <endpoint>
                    <http method="get" uri-template="http://ITMTNF3RRJSJ:8290/services/studenttest/readstudent?filtreQuery={uri.var.queryString}">
                        <suspendOnFailure>
                            <initialDuration>-1</initialDuration>
                            <progressionFactor>-1</progressionFactor>
                            <maximumDuration>0</maximumDuration>
                        </suspendOnFailure>
                        <markForSuspension>
                            <retriesBeforeSuspension>0</retriesBeforeSuspension>
                        </markForSuspension>
                    </http>
                </endpoint>
            </call>
            <iterate expression="//etuidants/etudiant">
                <target>
                    <sequence>
                        <payloadFactory media-type="json">
                            <format>{
  "_putmodifstudent": {
                 "id":${payload.etudiant.id},
                 "nom":"${payload.etudiant.nom}",
                 "prenom":"${payload.etudiant.prenom}",
                 "age":"${payload.etudiant.age}",
                 "note":"${payloadetudiant.note}",
                 }
}</format>
                            <args/>
                        </payloadFactory>
                        <call>
                            <endpoint>
                                <http method="put" statistics="enable" trace="enable" uri-template="http://ITMTNF3RRJSJ:8290/services/studenttest/modifstudent">


问:
Adding point to Here Maps Linestring causes error
With the JavaScript API to add the first set of coordinates (coordinates array index 0) in the geojson in the gist below, using the method described in the docs:

```<code>latLngObjectArray.forEach((point) => {
  linestring.pushPoint(point);
});
</code>```

Where latLngObjectArray is the coordinates mapped to objects with a lat and a lng property, I’m seeing an error that just states:

```<code>InvalidArgumentError: H.geo.LineString#pushPoint (Argument  -2.3558893700623083,51.80723944683314)
</code>```

The entry it fails on is a valid lat/lng, as far as I can tell, and the error doesn’t give me anything more to go on. What’s going on here?

This is the data:
https://gist.github.com/rcoundon/55c67ef04c19c00f853a54f889c09c3c

Further to this, if I use a H.data.geojson.Reader to parse the geojson directly, this can be added to the map without issue. So I’m curious why the linestring method doesn’t work. This is easily reproducible using:

```<code>const shape = JSON.parse(`...`) // the data I shared in the gist

const latLngObjectArray = shape.geometry.coordinates[0].reduce(
  (prev, curr) => {
    const { [1]: lat, [0]: lng } = curr;
    return [...prev, { lat, lng }];
  },
  [],
);

const linestring = new H.geo.LineString();

latLngObjectArray.forEach((point) => {
  linestring.pushPoint(point);
});
</code>```

Body:
With the JavaScript API to add the first set of coordinates (coordinates array index 0) in the geojson in the gist below, using the method described in the docs:

latLngObjectArray.forEach((point) => {
  linestring.pushPoint(point);
});

Where latLngObjectArray is the coordinates mapped to objects with a lat and a lng property, I’m seeing an error that just states:

InvalidArgumentError: H.geo.LineString#pushPoint (Argument  -2.3558893700623083,51.80723944683314)

The entry it fails on is a valid lat/lng, as far as I can tell, and the error doesn’t give me anything more to go on. What’s going on here?

This is the data:
https://gist.github.com/rcoundon/55c67ef04c19c00f853a54f889c09c3c

Further to this, if I use a H.data.geojson.Reader to parse the geojson directly, this can be added to the map without issue. So I’m curious why the linestring method doesn’t work. This is easily reproducible using:

const shape = JSON.parse(`...`) // the data I shared in the gist

const latLngObjectArray = shape.geometry.coordinates[0].reduce(
  (prev, curr) => {
    const { [1]: lat, [0]: lng } = curr;
    return [...prev, { lat, lng }];
  },
  [],
);

const linestring = new H.geo.LineString();

latLngObjectArray.forEach((point) => {
  linestring.pushPoint(point);
});


问:
how to set autofocus in tsx after it reach its maxLength?
Basically I want to create OTP input field but I don't have the idea to create autofocus after it reach its maxLength

this is my input field

```<code><View
style={{
flexDirection: "row",
alignItems: "center",
justifyContent: "space-between",
marginTop: 50,
width: 50
}}
>

    <components.InputField
    placeholder=""
    containerStyle={{ marginLeft: 5 }}
    icon={<svg.CheckSvg />}
    keyboardType={"numeric"}
    maxLength={1}
    />
    <components.InputField
    placeholder=""
    containerStyle={{ marginLeft: 5 }}
    icon={<svg.CheckSvg />}
    keyboardType={"numeric"}
    maxLength={1}
    />
    <components.InputField
    placeholder=""
    containerStyle={{ marginLeft: 5 }}
    icon={<svg.CheckSvg />}
    keyboardType={"numeric"}
    maxLength={1}
    />
    <components.InputField
    placeholder=""
    containerStyle={{ marginLeft: 5 }}
    icon={<svg.CheckSvg />}
    keyboardType={"numeric"}
    maxLength={1}
    />
    <components.InputField
    placeholder=""
    containerStyle={{ marginLeft: 5 }}
    icon={<svg.CheckSvg />}
    keyboardType={"numeric"}
    maxLength={1}
    />
    <components.InputField
    placeholder=""
    containerStyle={{ marginLeft: 5 }}
    icon={<svg.CheckSvg />}
    keyboardType={"numeric"}
    maxLength={1}
    />

</View>
</code>```

and here is my component input field

```<code>
import { View, TextInput, TouchableOpacity } from "react-native";
import React, { useState } from "react";

import { theme } from "../constants";

export type Props = {
    placeholder: string;
    secureTextEntry?: boolean;
    icon?: any;
    keyboardType?: "default" | "email-address" | "numeric" | "phone-pad";
    containerStyle?: any;
    maxLength?: number;

};

const InputField: React.FC<Props> = ({
    placeholder,
    containerStyle,
    secureTextEntry,
    keyboardType,
    maxLength,

}) => {
    const [isFocused, setIsFocused] = useState(0);

    return (
        <View
            style={{
                height: 50,
                width: "100%",
                backgroundColor: theme.COLORS.white,
                paddingHorizontal: 20,
                borderRadius: 10,
                borderWidth: 1,
                borderColor: isFocused
                    ? theme.COLORS.mainDark
                    : theme.COLORS.transparent,
                flexDirection: "row",
                alignItems: "center",
                ...containerStyle,

            }}
        >

            <TextInput
                placeholder={placeholder}
                style={{
                    flex: 1,
                    height: "100%",
                    width: "100%",
                    flexDirection: "row",
                    justifyContent: "space-between",
                    fontSize: 14,
                    lineHeight: 16 * 1,
                    ...theme.FONTS.Mulish_400Regular,

                }}
                secureTextEntry={secureTextEntry}
                placeholderTextColor={"#868698"}
                keyboardType={keyboardType}
                numberOfLines={1}
                onFocus={() => setIsFocused(1)}
                onBlur={() => setIsFocused(0)}
                maxLength={1}

            />

        </View>
    );
};

export default InputField;
</code>```

should I use the TextInput inside the component and used the onFocus={() => setIsFocused(1)}
or is there other way?

Thanks in advance for your help:)

Body:
Basically I want to create OTP input field but I don't have the idea to create autofocus after it reach its maxLength

this is my input field

<View
style={{
flexDirection: "row",
alignItems: "center",
justifyContent: "space-between",
marginTop: 50,
width: 50
}}
>

    <components.InputField
    placeholder=""
    containerStyle={{ marginLeft: 5 }}
    icon={<svg.CheckSvg />}
    keyboardType={"numeric"}
    maxLength={1}
    />
    <components.InputField
    placeholder=""
    containerStyle={{ marginLeft: 5 }}
    icon={<svg.CheckSvg />}
    keyboardType={"numeric"}
    maxLength={1}
    />
    <components.InputField
    placeholder=""
    containerStyle={{ marginLeft: 5 }}
    icon={<svg.CheckSvg />}
    keyboardType={"numeric"}
    maxLength={1}
    />
    <components.InputField
    placeholder=""
    containerStyle={{ marginLeft: 5 }}
    icon={<svg.CheckSvg />}
    keyboardType={"numeric"}
    maxLength={1}
    />
    <components.InputField
    placeholder=""
    containerStyle={{ marginLeft: 5 }}
    icon={<svg.CheckSvg />}
    keyboardType={"numeric"}
    maxLength={1}
    />
    <components.InputField
    placeholder=""
    containerStyle={{ marginLeft: 5 }}
    icon={<svg.CheckSvg />}
    keyboardType={"numeric"}
    maxLength={1}
    />

</View>

and here is my component input field

import { View, TextInput, TouchableOpacity } from "react-native";
import React, { useState } from "react";

import { theme } from "../constants";

export type Props = {
    placeholder: string;
    secureTextEntry?: boolean;
    icon?: any;
    keyboardType?: "default" | "email-address" | "numeric" | "phone-pad";
    containerStyle?: any;
    maxLength?: number;

};

const InputField: React.FC<Props> = ({
    placeholder,
    containerStyle,
    secureTextEntry,
    keyboardType,
    maxLength,

}) => {
    const [isFocused, setIsFocused] = useState(0);

    return (
        <View
            style={{
                height: 50,
                width: "100%",
                backgroundColor: theme.COLORS.white,
                paddingHorizontal: 20,
                borderRadius: 10,
                borderWidth: 1,
                borderColor: isFocused
                    ? theme.COLORS.mainDark
                    : theme.COLORS.transparent,
                flexDirection: "row",
                alignItems: "center",
                ...containerStyle,

            }}
        >

            <TextInput
                placeholder={placeholder}
                style={{
                    flex: 1,
                    height: "100%",
                    width: "100%",
                    flexDirection: "row",
                    justifyContent: "space-between",
                    fontSize: 14,
                    lineHeight: 16 * 1,
                    ...theme.FONTS.Mulish_400Regular,

                }}
                secureTextEntry={secureTextEntry}
                placeholderTextColor={"#868698"}
                keyboardType={keyboardType}
                numberOfLines={1}
                onFocus={() => setIsFocused(1)}
                onBlur={() => setIsFocused(0)}
                maxLength={1}

            />

        </View>
    );
};

export default InputField;

should I use the TextInput inside the component and used the onFocus={() => setIsFocused(1)}
or is there other way?

Thanks in advance for your help:)


问:
How do i save multiple selected checkbox using jQuery , Ajax & MVC
here is my HTML Code

```<code><table id="example" class="display select" width="100%" cellspacing="0">

    <thead>
        <tr>
            <th><input type="checkbox" name="select_all" value="1" id="example-select-all" /></th>
            <th>EmpID</th>
            <th>Employes Name</th>
            <th>Basic Salary</th>

            <th>Tax</th>
            <th>Total Allowance</th>
            <th>Total Deductions</th>
            <th>Gross Salary</th>
            <th>Taxable Income</th>
            <th>Net Salary</th>
        </tr>
    </thead>
</table>

</code>```

```</p>
```
**here is my script **

Body:
here is my HTML Code

            <input type="checkbox" name="select_all" value="1" id="example-select-all" />
            EmpID
            Employes Name
            Basic Salary

            Tax
            Total Allowance
            Total Deductions
            Gross Salary
            Taxable Income
            Net Salary

```

**here is my script **


问:
How to have a reusable scroll like UITableView or UICollectionView in SwiftUI that support all scroll APIs and also indexPathForItem(at:)?
My Goal:
I want to have a reusable scroll like UiTableview in SwiftUI to load views that are not in the same Height sizes also want to control the scroll. Something like Instagram Explore view. Basically, the data source will grow as user scroll more. So I can benefit from the following:

Item Reusability

Scroll To a point

Get the index or id of an item at CGPoint

ScrollToItem

Creating snapping to a point based on Drags and Deceleration

Memory-optimized

My minimum target for this project is iOS 15.

ScrollView:

I tried ScrollView with ScrollViewReader, but even if I use the LazyVStack it will not perform well in case of memory,LazyVStack will create a view when it is needed but after that, it will stay in memory. Also, I can not scroll to a CGPoint, just to the predefined Id.

I can not use .content.offset because then the ScrollViewReader stops working. Also, by using .content, the ScrolView loads all the data at once in memory. I can not get the benefits of controlling its offset.

ScrollView with lazyVGrid doesn't perform well when I want to control the scrollView; it causes so many jumps and unwanted lags and also the same issue that I can not control so much on Scroll and drags. apple suggests this combination for loading a long list, but again you can not control it because it is based on ScrollView.

Adding Drag gesture as .simultaneousGesture to scrollView to get drags is only possible if I set the minimumDistance = 0.0, which means ScrollView will not scroll anymore. so I can not have the combination of scroll and accessing the velocity of user drags.

List:

The list is good in memory and reusability, although you will have the same issues regarding the scroll. But it has another big disadvantage. ScrollViewReader is not well supported for List. it causes crashes in the app., there are a lot of threads in apple forums and StackOverflow that mention this problem.
StackOverFlow thread. apple thread.

I have been working to solve this issue for 2 weeks, but all of them lead me to the point that SwiftUi is not powerful enough for large projects to create an enterprise app that works smoothly and reliably.

So is there any good solution to using SwiftUI for these problems?


问:
How to check if a wav file is mono or stereo in js?
I made a player that shows waveform images using the wavesurfer plugin. I also made a function to mute the volume for each channel by splitting the channels of the wav file. However, in the first place, I did not think of the case where wav files are not stereo. If the wav file is not stereo, I do not want to split the channels of the wav file, and I want to hide the mute function for each channel. (Since it doesn't work in the first place, even if there is, it seems like the user will say "Something doesn't work?") Is there any way to implement this with js?
Even if I google it, only a way to divide the audio by channel comes up, but there is no way to determine whether the wav file is stereo or mono in the first place. help...

By googling, I searched for a way to determine whether a wav file is stereo or mono with js.


问:
How to solve failed to create shim error?
Using docker I am trying to run few rails commands. While running docker-compose run web rake db:create db:migrate db:seed getting Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "./docker-entrypoint_dev.sh": stat ./docker-entrypoint_dev.sh: no such file or directory: unknown

Docker Info is,

```<code> Context:    default
 Debug Mode: false

Server:
 Containers: 13
  Running: 1
  Paused: 0
  Stopped: 12
 Images: 79
 Server Version: 20.10.7
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version:
 runc version:
 init version:
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.14.0-1054-oem
 Operating System: Ubuntu 20.04.2 LTS (fossa-kakuna X63)
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 15.38GiB
 Name: nichesolv-Latitude-3420
 ID: PJ2E:4C3L:FJ3F:C3T7:7ZE4:4YCN:GDY6:WIMV:QIIN:N6HI:P25R:HNJ2
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
</code>```

In docker-entrypoint_dev.sh,

```<code>export RAILS_ENV=development
bundle install
cd frontend
npm install
cd ..
npm install
npm audit fix
foreman start -f Procfile.dev
</code>```

Body:
Using docker I am trying to run few rails commands. While running docker-compose run web rake db:create db:migrate db:seed getting Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "./docker-entrypoint_dev.sh": stat ./docker-entrypoint_dev.sh: no such file or directory: unknown

Docker Info is,

 Context:    default
 Debug Mode: false

Server:
 Containers: 13
  Running: 1
  Paused: 0
  Stopped: 12
 Images: 79
 Server Version: 20.10.7
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version:
 runc version:
 init version:
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.14.0-1054-oem
 Operating System: Ubuntu 20.04.2 LTS (fossa-kakuna X63)
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 15.38GiB
 Name: nichesolv-Latitude-3420
 ID: PJ2E:4C3L:FJ3F:C3T7:7ZE4:4YCN:GDY6:WIMV:QIIN:N6HI:P25R:HNJ2
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

In docker-entrypoint_dev.sh,

export RAILS_ENV=development
bundle install
cd frontend
npm install
cd ..
npm install
npm audit fix
foreman start -f Procfile.dev


问:
How do you stop ReadOnly columns from disappearing when editing/updating a GridView in ASP.Net?
I'm trying to create a GridView to display the contents of a table on my database. I want the user to be able to edit only one of the columns, so I set every other one to read only. When I test this, I can only edit the one column, like intended, but after updating, the other columns become null and post to the database. I don't know how to stop this from happening. Here is my code for the GridView. It is bound with one of Visual Studio's SQLDataSources.

I tried to create several events including RowEditing, RowUpdated, and RowUpdating, but with no luck. Nothing would stop the non-edited fields from getting replaced with NULL.

```<code>        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" GridLines="None"  Align="center" Height="138px" Width="548px" BorderColor="#6600FF" BorderStyle="Ridge" HorizontalAlign="Center" DataKeyNames="Id" DataSourceID="SqlDataSource1" >
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <Columns>
                <asp:CommandField ShowEditButton="True" />
                <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" ReadOnly="True" SortExpression="Id" Visible="False" />
                <asp:BoundField DataField="PhoneName" HeaderText="PhoneName" SortExpression="PhoneName" ReadOnly="True" />
                <asp:BoundField DataField="Amount" HeaderText="Amount" SortExpression="Amount" />
                <asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" ReadOnly="True" />
                <asp:BoundField DataField="TotalPrice" HeaderText="TotalPrice" SortExpression="TotalPrice" ReadOnly="True" />
            </Columns>
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#E9E7E2" />
            <SortedAscendingHeaderStyle BackColor="#506C8C" />
            <SortedDescendingCellStyle BackColor="#FFFDF8" />
            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
        </asp:GridView>
</code>```

Edit: I found a working solution by changing the SQLDataSource's Update Query String to set the unchangeable categories to their original values and leaving the one changeable field to a parameter. I'll post the code for that here.

```<code> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="*connection string here*" ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM [Cart]" DeleteCommand="DELETE FROM [Cart] WHERE [Id] = @original_Id" InsertCommand="INSERT INTO [Cart] ([PhoneName], [Amount], [Price], [TotalPrice]) VALUES (@PhoneName, @Amount, @Price, @TotalPrice)" OldValuesParameterFormatString="original_{0}" UpdateCommand="UPDATE [Cart] SET [PhoneName] = PhoneName, [Amount] = @Amount, [Price] = Price, [TotalPrice] = TotalPrice WHERE [Id] = @original_Id" DataSourceMode="DataReader">
            <DeleteParameters>
                <asp:Parameter Name="original_Id" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="PhoneName" Type="String" />
                <asp:Parameter Name="Amount" Type="Int32" />
                <asp:Parameter Name="Price" Type="String" />
                <asp:Parameter Name="TotalPrice" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="PhoneName" Type="String" />
                <asp:Parameter Name="Amount" Type="Int32" />
                <asp:Parameter Name="Price" Type="String" />
                <asp:Parameter Name="TotalPrice" Type="String" />
                <asp:Parameter Name="original_Id" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
</code>```

Body:
I'm trying to create a GridView to display the contents of a table on my database. I want the user to be able to edit only one of the columns, so I set every other one to read only. When I test this, I can only edit the one column, like intended, but after updating, the other columns become null and post to the database. I don't know how to stop this from happening. Here is my code for the GridView. It is bound with one of Visual Studio's SQLDataSources.

I tried to create several events including RowEditing, RowUpdated, and RowUpdating, but with no luck. Nothing would stop the non-edited fields from getting replaced with NULL.

        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" GridLines="None"  Align="center" Height="138px" Width="548px" BorderColor="#6600FF" BorderStyle="Ridge" HorizontalAlign="Center" DataKeyNames="Id" DataSourceID="SqlDataSource1" >
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <Columns>
                <asp:CommandField ShowEditButton="True" />
                <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" ReadOnly="True" SortExpression="Id" Visible="False" />
                <asp:BoundField DataField="PhoneName" HeaderText="PhoneName" SortExpression="PhoneName" ReadOnly="True" />
                <asp:BoundField DataField="Amount" HeaderText="Amount" SortExpression="Amount" />
                <asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" ReadOnly="True" />
                <asp:BoundField DataField="TotalPrice" HeaderText="TotalPrice" SortExpression="TotalPrice" ReadOnly="True" />
            </Columns>
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#E9E7E2" />
            <SortedAscendingHeaderStyle BackColor="#506C8C" />
            <SortedDescendingCellStyle BackColor="#FFFDF8" />
            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
        </asp:GridView>

Edit: I found a working solution by changing the SQLDataSource's Update Query String to set the unchangeable categories to their original values and leaving the one changeable field to a parameter. I'll post the code for that here.

 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="*connection string here*" ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM [Cart]" DeleteCommand="DELETE FROM [Cart] WHERE [Id] = @original_Id" InsertCommand="INSERT INTO [Cart] ([PhoneName], [Amount], [Price], [TotalPrice]) VALUES (@PhoneName, @Amount, @Price, @TotalPrice)" OldValuesParameterFormatString="original_{0}" UpdateCommand="UPDATE [Cart] SET [PhoneName] = PhoneName, [Amount] = @Amount, [Price] = Price, [TotalPrice] = TotalPrice WHERE [Id] = @original_Id" DataSourceMode="DataReader">
            <DeleteParameters>
                <asp:Parameter Name="original_Id" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="PhoneName" Type="String" />
                <asp:Parameter Name="Amount" Type="Int32" />
                <asp:Parameter Name="Price" Type="String" />
                <asp:Parameter Name="TotalPrice" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="PhoneName" Type="String" />
                <asp:Parameter Name="Amount" Type="Int32" />
                <asp:Parameter Name="Price" Type="String" />
                <asp:Parameter Name="TotalPrice" Type="String" />
                <asp:Parameter Name="original_Id" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>


问:
How to launch api and frontend parallel in gitlab for e2e tests
I want to run Playwright tests on GitLab.
For this I must to run frontend and api, because tests needed it and I can't understand how to do this.

job in .gitlab-ci:

```<code>all_test_in_one:
  stage: all_test
  image: mcr.microsoft.com/playwright:v1.28.0-focal
  services:
    - name: postgres:latest
      alias: postgres
  interruptible: true
  variables:
    NX_DATABASE_HOST: postgres
    NX_DATABASE_USERNAME: $POSTGRES_USER
    NX_DATABASE_PASSWORD: $POSTGRES_PASSWORD
    NX_TEST_DATABASE_NAME: $POSTGRES_DB
    NX_DATABASE_PORT: 5432
  script:
    - yarn install --cache-folder .yarn-cache
    - yarn nx run-many --all --target=lint
    - yarn nx run-many --all --target=test
    - npx nx serve frontend
    - npx nx serve api
    - npx nx e2e frontend-e2e
  only:
    - main
    - pushes
</code>```

In gitlab after frontend run - nothing happens.
Just:
webpack compiled successfully (b083f640d01806f6)
No issues found.
and then:
*ERROR: Job failed: execution took longer than 1h0m0s seconds *

Maybe I must use the value parallel: 2, but maybe its not what I need...

Body:
I want to run Playwright tests on GitLab.
For this I must to run frontend and api, because tests needed it and I can't understand how to do this.

job in .gitlab-ci:

all_test_in_one:
  stage: all_test
  image: mcr.microsoft.com/playwright:v1.28.0-focal
  services:
    - name: postgres:latest
      alias: postgres
  interruptible: true
  variables:
    NX_DATABASE_HOST: postgres
    NX_DATABASE_USERNAME: $POSTGRES_USER
    NX_DATABASE_PASSWORD: $POSTGRES_PASSWORD
    NX_TEST_DATABASE_NAME: $POSTGRES_DB
    NX_DATABASE_PORT: 5432
  script:
    - yarn install --cache-folder .yarn-cache
    - yarn nx run-many --all --target=lint
    - yarn nx run-many --all --target=test
    - npx nx serve frontend
    - npx nx serve api
    - npx nx e2e frontend-e2e
  only:
    - main
    - pushes

In gitlab after frontend run - nothing happens.
Just:
webpack compiled successfully (b083f640d01806f6)
No issues found.
and then:
*ERROR: Job failed: execution took longer than 1h0m0s seconds *

Maybe I must use the value parallel: 2, but maybe its not what I need...


问:
BuildKit: RUN mount secret not mounted, but no error message?
This is a MWE where I try to expose a file called abc within RUN as a secret:

Dockerfile:

```<code># syntax = docker/dockerfile:1.3
FROM alpine:latest
RUN --mount=type=secret,id=aaa,target=/tmp/aaa ls -l /tmp/aaa
</code>```

Then I run echo 123 > aaa (that's the file that will be exposed) and docker build (or DOCKER_BUILDKIT=1 docker build if that is not the default), but the secret is not to be found. I will be grateful for some help with this (I am running the latest Docker release 20.10.21):

```<code>[+] Building 3.1s (10/10) FINISHED
 => [internal] load build definition from Dockerfile                                                                                0.0s
 => => transferring dockerfile: 157B                                                                                0.0s
 => [internal] load .dockerignore                                                                                0.0s
 => => transferring context: 2B                                                                                0.0s
 => resolve image config for docker.io/docker/dockerfile:1.3                                                                                0.5s
 => CACHED docker-image://docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2                  0.0s
 => [internal] load build definition from Dockerfile                                                                                0.0s
 => [internal] load .dockerignore                                                                                0.0s
 => [internal] load metadata for docker.io/library/alpine:latest                                                                                1.5s
 => [auth] library/alpine:pull token for registry-1.docker.io                                                                                0.0s
 => [stage-0 1/2] FROM docker.io/library/alpine:latest@sha256:8914eb54f968791faf6a8638949e480fef81e697984fba772b3976835194c6d4                     0.5s
 => => resolve docker.io/library/alpine:latest@sha256:8914eb54f968791faf6a8638949e480fef81e697984fba772b3976835194c6d4                             0.0s
 => => sha256:8914eb54f968791faf6a8638949e480fef81e697984fba772b3976835194c6d4 1.64kB / 1.64kB                                                     0.0s
 => => sha256:c0d488a800e4127c334ad20d61d7bc21b4097540327217dfab52262adc02380c 528B / 528B                                                         0.0s
 => => sha256:49176f190c7e9cdb51ac85ab6c6d5e4512352218190cd69b08e6fd803ffbf3da 1.47kB / 1.47kB                                                     0.0s
 => => sha256:c158987b05517b6f2c5913f3acef1f2182a32345a304fe357e3ace5fadcad715 3.37MB / 3.37MB                                                     0.3s
 => => extracting sha256:c158987b05517b6f2c5913f3acef1f2182a32345a304fe357e3ace5fadcad715                                                          0.1s
 => ERROR [stage-0 2/2] RUN --mount=type=secret,id=aaa,target=/tmp/aaa ls -l /tmp/aaa                                                              0.4s
------
 > [stage-0 2/2] RUN --mount=type=secret,id=aaa,target=/tmp/aaa ls -l /tmp/aaa:
#10 0.314 ls: /tmp/aaa: No such file or directory
------
executor failed running [/bin/sh -c ls -l /tmp/aaa]: exit code: 1
</code>```

Body:
This is a MWE where I try to expose a file called abc within RUN as a secret:

Dockerfile:

# syntax = docker/dockerfile:1.3
FROM alpine:latest
RUN --mount=type=secret,id=aaa,target=/tmp/aaa ls -l /tmp/aaa

Then I run echo 123 > aaa (that's the file that will be exposed) and docker build (or DOCKER_BUILDKIT=1 docker build if that is not the default), but the secret is not to be found. I will be grateful for some help with this (I am running the latest Docker release 20.10.21):

[+] Building 3.1s (10/10) FINISHED
 => [internal] load build definition from Dockerfile                                                                                0.0s
 => => transferring dockerfile: 157B                                                                                0.0s
 => [internal] load .dockerignore                                                                                0.0s
 => => transferring context: 2B                                                                                0.0s
 => resolve image config for docker.io/docker/dockerfile:1.3                                                                                0.5s
 => CACHED docker-image://docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2                  0.0s
 => [internal] load build definition from Dockerfile                                                                                0.0s
 => [internal] load .dockerignore                                                                                0.0s
 => [internal] load metadata for docker.io/library/alpine:latest                                                                                1.5s
 => [auth] library/alpine:pull token for registry-1.docker.io                                                                                0.0s
 => [stage-0 1/2] FROM docker.io/library/alpine:latest@sha256:8914eb54f968791faf6a8638949e480fef81e697984fba772b3976835194c6d4                     0.5s
 => => resolve docker.io/library/alpine:latest@sha256:8914eb54f968791faf6a8638949e480fef81e697984fba772b3976835194c6d4                             0.0s
 => => sha256:8914eb54f968791faf6a8638949e480fef81e697984fba772b3976835194c6d4 1.64kB / 1.64kB                                                     0.0s
 => => sha256:c0d488a800e4127c334ad20d61d7bc21b4097540327217dfab52262adc02380c 528B / 528B                                                         0.0s
 => => sha256:49176f190c7e9cdb51ac85ab6c6d5e4512352218190cd69b08e6fd803ffbf3da 1.47kB / 1.47kB                                                     0.0s
 => => sha256:c158987b05517b6f2c5913f3acef1f2182a32345a304fe357e3ace5fadcad715 3.37MB / 3.37MB                                                     0.3s
 => => extracting sha256:c158987b05517b6f2c5913f3acef1f2182a32345a304fe357e3ace5fadcad715                                                          0.1s
 => ERROR [stage-0 2/2] RUN --mount=type=secret,id=aaa,target=/tmp/aaa ls -l /tmp/aaa                                                              0.4s
------
 > [stage-0 2/2] RUN --mount=type=secret,id=aaa,target=/tmp/aaa ls -l /tmp/aaa:
#10 0.314 ls: /tmp/aaa: No such file or directory
------
executor failed running [/bin/sh -c ls -l /tmp/aaa]: exit code: 1


问:
Web3py Throws Transaction underpriced Error
i am trying to use the web3py library to deploy and interact with a smart contract on the BNB Smart Chain Testnet.
However, upon running the code attached, i get the Transaction Underprice error. Need help in this regard.

`
``
w3 = Web3(Web3.HTTPProvider('https://data-seed-prebsc-2-s1.binance.org:8545'))
w3.middleware_onion.inject(geth_poa_middleware, layer=0)

acct = Account.create()

compiled_sol = compile_source(
'''
pragma solidity >0.5.0;

```<code> contract Greeter {
    string public greeting;

    constructor() public {
       greeting = 'Hello';
    }

     function setGreeting(string memory _greeting) public {
               greeting = _greeting;
    }

    function greet() view public returns (string memory) {
         return greeting;
    }
}
 ''',
output_values=['abi', 'bin']
</code>```

)

contract_id, contract_interface = compiled_sol.popitem()

bytecode = contract_interface['bin']

abi = contract_interface['abi']

w3.middleware_onion.add(construct_sign_and_send_raw_middleware(acct))
w3.eth.set_gas_price_strategy(fast_gas_price_strategy)

w3.middleware_onion.add(middleware.time_based_cache_middleware)

w3.eth.default_account = acct.address

Greeter = w3.eth.contract(abi=abi, bytecode=bytecode)

tx_hash = Greeter.constructor().transact({'gas': 20000, 'from': acct.address, 'chainId': 97})

tx_receipt = w3.eth.wait_for_transaction_receipt(tx_hash)

```<code>`
</code>```

Body:
i am trying to use the web3py library to deploy and interact with a smart contract on the BNB Smart Chain Testnet.
However, upon running the code attached, i get the Transaction Underprice error. Need help in this regard.

`
``
w3 = Web3(Web3.HTTPProvider('https://data-seed-prebsc-2-s1.binance.org:8545'))
w3.middleware_onion.inject(geth_poa_middleware, layer=0)

acct = Account.create()

compiled_sol = compile_source(
'''
pragma solidity >0.5.0;

 contract Greeter {
    string public greeting;

    constructor() public {
       greeting = 'Hello';
    }

     function setGreeting(string memory _greeting) public {
               greeting = _greeting;
    }

    function greet() view public returns (string memory) {
         return greeting;
    }
}
 ''',
output_values=['abi', 'bin']

)

contract_id, contract_interface = compiled_sol.popitem()

bytecode = contract_interface['bin']

abi = contract_interface['abi']

w3.middleware_onion.add(construct_sign_and_send_raw_middleware(acct))
w3.eth.set_gas_price_strategy(fast_gas_price_strategy)

w3.middleware_onion.add(middleware.time_based_cache_middleware)

w3.eth.default_account = acct.address

Greeter = w3.eth.contract(abi=abi, bytecode=bytecode)

tx_hash = Greeter.constructor().transact({'gas': 20000, 'from': acct.address, 'chainId': 97})

tx_receipt = w3.eth.wait_for_transaction_receipt(tx_hash)

`


问:
Metamask browser is dead after connect wallet on android device
I develop dApp with ReactJS and Web3Js

const onClickMetamask: MouseEventHandler = async () => {
    if (window.ethereum) {
      if (isMobile && isMetamaskBrowser) {
        const res = await connectMetamask();
        setWalletAddress(res.address);
        ModalOff();
        window.location.replace('');
      } else if (isMobile && !isMetamaskBrowser) {
        window.open(process.env.REACT_APP_METAMASK_DEEP_LINK);
        ModalOff();
      } else if (!isMobile) {
        const res = await connectMetamask();
        setWalletAddress(res.address);
        ModalOff();
      }
    } else {
      if (isMobile && !isMetamaskBrowser) {
        alert('!window.ethereum & isMobile & !isMetamaskBrowser');
        window.open(process.env.REACT_APP_METAMASK_DEEP_LINK);
        ModalOff();
      } else if (!isMobile) {
        window.open('https://metamask.io/download/');
        ModalOff();
      }
    }
  };
```

After connect metamask in metamask in app browser using android device(galaxy s9+, s20)

My metamask browser is dead.

I refresh the browser in metamask browser. It works fine and connecting wallet is success !

Above error does not shown on IOS and desktop.

I want to debug metamask browser. I failed.

Is there anyway fix this solution ?

I tried

window.location.reload

useNavigate to navigate('/')

location.href = location.href
after connect wallet.

Body:
I develop dApp with ReactJS and Web3Js

const onClickMetamask: MouseEventHandler = async () => {
    if (window.ethereum) {
      if (isMobile && isMetamaskBrowser) {
        const res = await connectMetamask();
        setWalletAddress(res.address);
        ModalOff();
        window.location.replace('');
      } else if (isMobile && !isMetamaskBrowser) {
        window.open(process.env.REACT_APP_METAMASK_DEEP_LINK);
        ModalOff();
      } else if (!isMobile) {
        const res = await connectMetamask();
        setWalletAddress(res.address);
        ModalOff();
      }
    } else {
      if (isMobile && !isMetamaskBrowser) {
        alert('!window.ethereum & isMobile & !isMetamaskBrowser');
        window.open(process.env.REACT_APP_METAMASK_DEEP_LINK);
        ModalOff();
      } else if (!isMobile) {
        window.open('https://metamask.io/download/');
        ModalOff();
      }
    }
  };

After connect metamask in metamask in app browser using android device(galaxy s9+, s20)

My metamask browser is dead.

I refresh the browser in metamask browser. It works fine and connecting wallet is success !

Above error does not shown on IOS and desktop.

I want to debug metamask browser. I failed.

Is there anyway fix this solution ?

I tried

window.location.reload

useNavigate to navigate('/')

location.href = location.href
after connect wallet.


问:
Is is possible to convert byte array to base-n string without use of arbitrary-precision arithmetic?
I want a function that takes an array of m bytes interpreted as an m digit base-256 number and converts it to a string representation of a base-n number. I've looked around for implementation of this and they all appear to require the use of an arbitrary-precision arithmetic type.

Example in TypeScript:

function encode(array: Uint8Array, alphabet: string): string {
    const length = BigInt(alphabet.length)
    let n = array.reduce((acc, x, n) => acc + BigInt(x) * (1n << BigInt(n * 8)), 0n)
    if (n === 0n) return alphabet[0]
    let result = ""
    while (n > 0n) {
        result = alphabet[Number(n % length)] + result
        n = n / length
    }
    return result
}
```

Is there a way to convert this to use only fixed width integers (e.g. 32-bit) without re-implementing BigInt?

Body:
I want a function that takes an array of m bytes interpreted as an m digit base-256 number and converts it to a string representation of a base-n number. I've looked around for implementation of this and they all appear to require the use of an arbitrary-precision arithmetic type.

Example in TypeScript:

function encode(array: Uint8Array, alphabet: string): string {
    const length = BigInt(alphabet.length)
    let n = array.reduce((acc, x, n) => acc + BigInt(x) * (1n << BigInt(n * 8)), 0n)
    if (n === 0n) return alphabet[0]
    let result = ""
    while (n > 0n) {
        result = alphabet[Number(n % length)] + result
        n = n / length
    }
    return result
}

Is there a way to convert this to use only fixed width integers (e.g. 32-bit) without re-implementing BigInt?


问:
C program to find last three digits of a^b
So, for small numbers my code does work, but it doesn't work for big numbers, for instance 100^10. So someone could help me finding my mistakes, or point out some clues for me to fix my code.</p>
```<code>#include <stdio.h>
int main ( )
{
    int n , exp ,  i;
    char a[1000];
    long long int value = 1 ;
    scanf ( "%d %d" , & n , & exp ) ;
    while ( exp --> 0 )
    {
        value *= n ;
    }

    if (value>999)
    {
    for (i=2; i>=0; i--)
    {
        a[i]=value%10;
        value = value/10;
      }

        printf ("The last 3 numbers is %d%d%d.\n",a[0],a[1],a[2]);

}
    else
    printf ("The last 3 numbers is %d.\n", value);
    return 0;
}
</code>```

Body:
So, for small numbers my code does work, but it doesn't work for big numbers, for instance 100^10. So someone could help me finding my mistakes, or point out some clues for me to fix my code.

#include <stdio.h>
int main ( )
{
    int n , exp ,  i;
    char a[1000];
    long long int value = 1 ;
    scanf ( "%d %d" , & n , & exp ) ;
    while ( exp --> 0 )
    {
        value *= n ;
    }

    if (value>999)
    {
    for (i=2; i>=0; i--)
    {
        a[i]=value%10;
        value = value/10;
      }

        printf ("The last 3 numbers is %d%d%d.\n",a[0],a[1],a[2]);

}
    else
    printf ("The last 3 numbers is %d.\n", value);
    return 0;
}


问:
LibVLC/LibvlcSharp/Windows RTSP -- Is There A Way To Tell if a Camera has hung?
Using LibVLC/LibVLCSharp in Windows (Winforms) and using RTSP occasionally a camera will hang. Whatever the cause it is worth disposing of the MediaPlayer, creating a new one and trying again. This usually works.

However, it is difficult to tell if the libraries have a way of telling when a hang has taken place. Presumably it should be relatively easy for the library to tell that new frames have stopped coming in or if a socket has died.  If there is an event that tells me this I can't determine that from the documentation.

These kind of events are random, and they may occur only after several hours (or days).  Therefore experimentation is difficult.

Tried subscribing to pretty much every reasonable event and looked to see if one is hit. Nothing relevant appeared to be happening.


问:
Python get hex as non-string
Python's hex or bin functions return strings. Is there a comparable functionality which returns numbers instead of strings, i.e. instead of hex(2) => '0x2' to get hex(2) => 0x2?

Title: Python get hex as non-string


问:
Mock few lines of a function for Unit Tests
I have this below function for which I would like to write unit tests.

```<code>def fetch_latest_topics(request):
    username = request.META['username']
    try:
        client = create_discourse_connection(username)
        response = client.latest_topics()
        topic_list = response['topic_list']['topics']
        filtered_topics_data = []
        for topic in topic_list:
            filtered_topics_data.append(
                {
                    "title": topic["title"],
                    "created_at": topic["created_at"],
                    "topic_id": topic["id"]
                }
            )
    except Exception as e:
        return sendResponse(formatErrorResponse(badreq_err, str(e)))
    return sendResponse({"post_replies": filtered_topics_data})
</code>```

I want to mock below lines

```<code>        client = create_discourse_connection(username)
        response = client.latest_topics()
</code>```

Basically In these lines, I will create a connection with external server and fetch some response. I don't want to do this in unit test (Since this is a library it will be tested beforehand and it's not my code responsibility to test this). I just have to pass a mock response json and validate the response formatting and keys in my unit test.

I explored mock library for mocking functions but this is more of a library and it's method call rather than a plain function. It will be a great help if someone can show me the direction to test this.
Thank you for giving time to this question.

Body:
I have this below function for which I would like to write unit tests.

def fetch_latest_topics(request):
    username = request.META['username']
    try:
        client = create_discourse_connection(username)
        response = client.latest_topics()
        topic_list = response['topic_list']['topics']
        filtered_topics_data = []
        for topic in topic_list:
            filtered_topics_data.append(
                {
                    "title": topic["title"],
                    "created_at": topic["created_at"],
                    "topic_id": topic["id"]
                }
            )
    except Exception as e:
        return sendResponse(formatErrorResponse(badreq_err, str(e)))
    return sendResponse({"post_replies": filtered_topics_data})

I want to mock below lines

        client = create_discourse_connection(username)
        response = client.latest_topics()

Basically In these lines, I will create a connection with external server and fetch some response. I don't want to do this in unit test (Since this is a library it will be tested beforehand and it's not my code responsibility to test this). I just have to pass a mock response json and validate the response formatting and keys in my unit test.

I explored mock library for mocking functions but this is more of a library and it's method call rather than a plain function. It will be a great help if someone can show me the direction to test this.
Thank you for giving time to this question.


问:
Investigate why package.json is displayed under /package.json
I'm sorry if I don't provide any relevant code here but I need help where to investigate why package.json is displayed in development and production under http/https://[SITE]/package.json.

It's a simple react app and we use webpack.

Hopefully someone can tell me where to look!

See image:


问:
Woocommerce how to use hook on_new_order and start function when order status processing?
add_action('woocommerce_new_order', 'call_order_to_tsm', 2 );

function call_order_to_tsm($order_id)
{
$order = new WC_Order($order_id);

```<code>$first_name = $order->get_billing_first_name();
$last_name = $order->get_billing_last_name();
$phone = $order->get_billing_phone();
$email = $order->get_billing_email();
$city = $order->get_billing_city();
$address = $order->get_billing_address_1();
$price = $order->get_total();
$items = $order->get_items();
$status = $order->get_status();

$payment_date = $order->get_date_paid();
$temp2 = date_create($payment_date);
$datePayment = date_format($temp2, "Y/m/d H:i:s");

$order_date = $order->get_date_created();;
$temp = date_create($order_date);
$date = date_format($temp, "Y/m/d H:i:s");

$products = [];

foreach ($items as $index => $item) {
    $product = [];
    $product_name = $item->get_name();
    $product_quantity = $item->get_quantity();
    $product['produktas'] = $product_name;
    $product['kiekis'] = $product_quantity;
    $products[] = $product;
}

$json = json_encode($products, JSON_UNESCAPED_UNICODE);

$message =
    'Užsakymo data: ' . $date . "\n" .
    'Vardas: ' . $first_name . "\n" .
    'Pavardė: ' . $last_name . "\n" .
    'Miestas: ' . $city . "\n" .
    'Adresas: ' . $address . "\n" .
    'Prekės: ' . $json ."\n" .
    'Kaina: ' . $price . "\n" .
    'Apmokejimo data: ' . $datePayment . "\n" .
    'Statusas: ' . $status;

$TotalOrders = [
    'email' => $email,
    'phone' => $phone,
    'objectname' => 'web_testas',
    'msg' => $message
];

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => 'www.url.com',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => $TotalOrders,
    CURLOPT_HTTPHEADER => array(
        'HTTP_X_REQUESTED_WITH: XMLHttpRequest'
    ),
));

curl_exec($curl);
curl_close($curl);
</code>```

}

I Am trying to send every new order after payment to other system.

How to combine new_order hook and order_processing? Prevent pending or canceled orders

Body:
add_action('woocommerce_new_order', 'call_order_to_tsm', 2 );

function call_order_to_tsm($order_id)
{
$order = new WC_Order($order_id);

$first_name = $order->get_billing_first_name();
$last_name = $order->get_billing_last_name();
$phone = $order->get_billing_phone();
$email = $order->get_billing_email();
$city = $order->get_billing_city();
$address = $order->get_billing_address_1();
$price = $order->get_total();
$items = $order->get_items();
$status = $order->get_status();

$payment_date = $order->get_date_paid();
$temp2 = date_create($payment_date);
$datePayment = date_format($temp2, "Y/m/d H:i:s");

$order_date = $order->get_date_created();;
$temp = date_create($order_date);
$date = date_format($temp, "Y/m/d H:i:s");

$products = [];

foreach ($items as $index => $item) {
    $product = [];
    $product_name = $item->get_name();
    $product_quantity = $item->get_quantity();
    $product['produktas'] = $product_name;
    $product['kiekis'] = $product_quantity;
    $products[] = $product;
}

$json = json_encode($products, JSON_UNESCAPED_UNICODE);

$message =
    'Užsakymo data: ' . $date . "\n" .
    'Vardas: ' . $first_name . "\n" .
    'Pavardė: ' . $last_name . "\n" .
    'Miestas: ' . $city . "\n" .
    'Adresas: ' . $address . "\n" .
    'Prekės: ' . $json ."\n" .
    'Kaina: ' . $price . "\n" .
    'Apmokejimo data: ' . $datePayment . "\n" .
    'Statusas: ' . $status;

$TotalOrders = [
    'email' => $email,
    'phone' => $phone,
    'objectname' => 'web_testas',
    'msg' => $message
];

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => 'www.url.com',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => $TotalOrders,
    CURLOPT_HTTPHEADER => array(
        'HTTP_X_REQUESTED_WITH: XMLHttpRequest'
    ),
));

curl_exec($curl);
curl_close($curl);

}

I Am trying to send every new order after payment to other system.

How to combine new_order hook and order_processing? Prevent pending or canceled orders


问:
ngx-pagination auto break line when too much pages
I want all page button in one line like below:

When too much pages the button will break line like below:

I want all page button in one line even i have many pages. I think there must have something wrong since I have using Bootstrap 5. But I can't find any solution after 3 hours search on google.

This is my code:


问:
Why do I get illegal character U+FFFDerror when using import (in JS)?
When I use import and export in my program, I find the error illegal character U+FFFDerror, does anyone know why?

I have two js files named main.js and modal.js and I export the gamePoint variable from the modal.js file to the main.js file.

I export variable like this in modal.js

```<code>const usernames = document.querySelectorAll('.get-username-modal input[type="text"]');
const savePlayerUsernameBtn = document.querySelector('.save-username');
const modal = document.querySelector('.get-username-modal');
//exported variable
export const gamePoint = document.querySelector('#limitPoint');
</code>```

and import the variable in main.js like this

```<code>import gamePoint from "./modal.js";
</code>```

and i get Uncaught SyntaxError: illegal character U+FFFD in firefox

Body:
When I use import and export in my program, I find the error illegal character U+FFFDerror, does anyone know why?

I have two js files named main.js and modal.js and I export the gamePoint variable from the modal.js file to the main.js file.

I export variable like this in modal.js

const usernames = document.querySelectorAll('.get-username-modal input[type="text"]');
const savePlayerUsernameBtn = document.querySelector('.save-username');
const modal = document.querySelector('.get-username-modal');
//exported variable
export const gamePoint = document.querySelector('#limitPoint');

and import the variable in main.js like this

import gamePoint from "./modal.js";

and i get Uncaught SyntaxError: illegal character U+FFFD in firefox


问:
remove amp: from callback url
request:

$success_urlt = $this->successUrl($request);
$success_url = urldecode($success_urlt);
$data = array(
    'amount' => $amount ,
    'api' => $api,
    'id' => $idorder,
    'name' => $user->first_name .' '.$user->last_name,
    'email' => $user->email,
    'app_name' => env('APP_NAME'),
    'app_logo' => $logo,
    'payment_title' => $title,
    'currency_code' => $currencycode,
    'success_url' => $success_url,
);

return view('frontend.payments.paywithMoyasar', compact('data'));
```
<p>enter image description here</p>
<p>As you can see in the picture, the inquiry is a correct callback link to the payment company</p>
<p><strong>response:</strong></p>
<p>After the success of the payment, it will be returned to the link, but it contains <strong>&amp%3B</strong></p>
```https://newrviga.local/user/complete-order?amount=408&amp%3Bcode=undefined&amp%3Bpayment_type=moyasar&id=1ac42c5a-974f-4a9d-8e81-cdb64aa580e5&message=Succeeded%21%20%28Test%20Environment%29&status=paid&trx_id=hjoBEPkhSPhxKjvNtHQrJ
```
<p>$request->all()</p>
<p>enter image description here</p>
<p>as you see in above image</p>
```if ($request->payment_type == 'moyasar'){}
```

return null

is there any way to remove amp; from request

i do  urldecode() with callbacl link But it seems that the problem is in the payment company

Title: remove amp: from callback url

Body:
request:

$success_urlt = $this->successUrl($request);
$success_url = urldecode($success_urlt);
$data = array(
    'amount' => $amount ,
    'api' => $api,
    'id' => $idorder,
    'name' => $user->first_name .' '.$user->last_name,
    'email' => $user->email,
    'app_name' => env('APP_NAME'),
    'app_logo' => $logo,
    'payment_title' => $title,
    'currency_code' => $currencycode,
    'success_url' => $success_url,
);

return view('frontend.payments.paywithMoyasar', compact('data'));

enter image description here

As you can see in the picture, the inquiry is a correct callback link to the payment company

response:

After the success of the payment, it will be returned to the link, but it contains &amp%3B

https://newrviga.local/user/complete-order?amount=408&amp%3Bcode=undefined&amp%3Bpayment_type=moyasar&id=1ac42c5a-974f-4a9d-8e81-cdb64aa580e5&message=Succeeded%21%20%28Test%20Environment%29&status=paid&trx_id=hjoBEPkhSPhxKjvNtHQrJ

$request->all()

enter image description here

as you see in above image

if ($request->payment_type == 'moyasar'){}

return null

is there any way to remove amp; from request

i do  urldecode() with callbacl link But it seems that the problem is in the payment company


问:
VS Code launch.json, debug with input user
Suppose I have in working directory hundreds exe file, I would like to debug one of them.

I do not want that launch.json will have hundreds objects for each exe file.

Is there a way, to have one object, and when start debug, I will choose which file I would like to debug?

I have tried extension "VSCode Prompt Debug" but it seems it does not work

In VSCode there is inputs, how can I use regex

for example:

```<code>{
  "version": "0.2.0",
  "configurations": [{
        "type": "node",
        "request": "launch",
        "name": "Launch Program",
        "program": "${workspaceFolder}/${input:pickProgram}"
  }],
  "inputs": [{
      "id": "pickProgram",
      "description": "Select client or server",
      "type": "pickString",
      "options": ["*.exe"]
  }]}
</code>```

Thanks

Body:
Suppose I have in working directory hundreds exe file, I would like to debug one of them.

I do not want that launch.json will have hundreds objects for each exe file.

Is there a way, to have one object, and when start debug, I will choose which file I would like to debug?

I have tried extension "VSCode Prompt Debug" but it seems it does not work

In VSCode there is inputs, how can I use regex

for example:

{
  "version": "0.2.0",
  "configurations": [{
        "type": "node",
        "request": "launch",
        "name": "Launch Program",
        "program": "${workspaceFolder}/${input:pickProgram}"
  }],
  "inputs": [{
      "id": "pickProgram",
      "description": "Select client or server",
      "type": "pickString",
      "options": ["*.exe"]
  }]}

Thanks