问:
I migrated my flutter app to v2 and i get the following errors
Hi I upgraded my flutter app to v2 and when I try to launch the app on the ios simulator I get these errors. I followed all the steps like updating cocopods, building the app from xcode, running flutter clean and installing the dependencies again but it didn't work. Any fix?</p>
```<code>Failed to build iOS app
Error output from Xcode build:
↳
    objc[31476]: Class RemoteXPCPair is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e300708) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fc238). One of the two will be used. Which one is undefined.
    objc[31476]: Class RemoteXPCShim is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e300780) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fc2b0). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury11XPCEndpoint is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e300e58) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fc920). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury15XPCPeerEndpoint is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e300ef8) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fc9c0). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury19XPCListenerEndpoint is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e300f98) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fca60). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury16XPCObjectEncoder is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e3010a8) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fcb70). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury17_XPCObjectEncoder is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e301150) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fcc18). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury16XPCObjectDecoder is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e301200) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fccc8). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury17_XPCObjectDecoder is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e3012a8) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fcd70). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury14XPCSideChannel is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e3015e8) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fd0b8). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury19RemoteDeviceBrowser is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e301730) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fd208). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury17XPCFileDescriptor is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e3018b0) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fd388). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury12RemoteDevice is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e301b00) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fd5d0). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury13XPCConnection is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e301d20) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fd820). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury19RemoteXPCConnection is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e301ee8) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fd9e0). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury27RemoteXPCListenerConnection is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e302040) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fdb30). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury23RemoteXPCPeerConnection is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e3021e8) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fdcd0). One of the two will be used. Which one is undefined.
     objc[31476]: Class _TtC7Mercury23SystemXPCPeerConnection is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e302d50) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fe830). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury15XPCFileTransfer is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e302fa8) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fea70). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7MercuryP33_2B1830E49151A2D290BADAC81D16B73411_HandlerBox is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e300ae8) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fc618). One of the two will be used. Which one is undefined.
    ** BUILD FAILED **

Xcode's output:
↳
    Writing result bundle at path:
        /var/folders/_5/9gsv46w9015004z68y2t9vrm0000gn/T/flutter_tools.MStc2D/flutter_ios_build_temp_dirxDM7ou/temporary_xcresult_bundle

    /Users/josh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-1.5.0+1/ios/Classes/FlutterLocalNotificationsPlugin.m:17:5: warning: 'UILocalNotification' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNNotificationRequest [-Wdeprecated-declarations]
        UILocalNotification *_launchNotification;
        ^
    In module 'UIKit' imported from /Users/josh/StudioProjects/promise_of_the_day/ios/Pods/Target Support Files/flutter_local_notifications/flutter_local_notifications-prefix.pch:2:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILocalNotification.h:18:12: note: 'UILocalNotification' has been explicitly marked deprecated here
    @interface UILocalNotification : NSObject<NSCopying, NSCoding>
</code>```

Body:
Hi I upgraded my flutter app to v2 and when I try to launch the app on the ios simulator I get these errors. I followed all the steps like updating cocopods, building the app from xcode, running flutter clean and installing the dependencies again but it didn't work. Any fix?

Failed to build iOS app
Error output from Xcode build:
↳
    objc[31476]: Class RemoteXPCPair is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e300708) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fc238). One of the two will be used. Which one is undefined.
    objc[31476]: Class RemoteXPCShim is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e300780) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fc2b0). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury11XPCEndpoint is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e300e58) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fc920). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury15XPCPeerEndpoint is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e300ef8) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fc9c0). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury19XPCListenerEndpoint is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e300f98) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fca60). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury16XPCObjectEncoder is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e3010a8) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fcb70). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury17_XPCObjectEncoder is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e301150) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fcc18). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury16XPCObjectDecoder is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e301200) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fccc8). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury17_XPCObjectDecoder is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e3012a8) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fcd70). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury14XPCSideChannel is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e3015e8) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fd0b8). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury19RemoteDeviceBrowser is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e301730) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fd208). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury17XPCFileDescriptor is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e3018b0) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fd388). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury12RemoteDevice is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e301b00) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fd5d0). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury13XPCConnection is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e301d20) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fd820). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury19RemoteXPCConnection is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e301ee8) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fd9e0). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury27RemoteXPCListenerConnection is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e302040) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fdb30). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury23RemoteXPCPeerConnection is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e3021e8) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fdcd0). One of the two will be used. Which one is undefined.
     objc[31476]: Class _TtC7Mercury23SystemXPCPeerConnection is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e302d50) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fe830). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7Mercury15XPCFileTransfer is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e302fa8) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fea70). One of the two will be used. Which one is undefined.
    objc[31476]: Class _TtC7MercuryP33_2B1830E49151A2D290BADAC81D16B73411_HandlerBox is implemented in both /Library/Developer/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x10e300ae8) and /Library/Apple/System/Library/PrivateFrameworks/Mercury.framework/Versions/A/Mercury (0x1208fc618). One of the two will be used. Which one is undefined.
    ** BUILD FAILED **

Xcode's output:
↳
    Writing result bundle at path:
        /var/folders/_5/9gsv46w9015004z68y2t9vrm0000gn/T/flutter_tools.MStc2D/flutter_ios_build_temp_dirxDM7ou/temporary_xcresult_bundle

    /Users/josh/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-1.5.0+1/ios/Classes/FlutterLocalNotificationsPlugin.m:17:5: warning: 'UILocalNotification' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNNotificationRequest [-Wdeprecated-declarations]
        UILocalNotification *_launchNotification;
        ^
    In module 'UIKit' imported from /Users/josh/StudioProjects/promise_of_the_day/ios/Pods/Target Support Files/flutter_local_notifications/flutter_local_notifications-prefix.pch:2:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILocalNotification.h:18:12: note: 'UILocalNotification' has been explicitly marked deprecated here
    @interface UILocalNotification : NSObject<NSCopying, NSCoding>


来源: stackexchange

问:
Could not resolve legacy-support-core-utils-1.0.0.jar (androidx.legacy:legacy-support-core-utils:1.0.0)
i get this error when i want to build android studio project

mergeDebugJavaResource
Could not resolve legacy-support-core-utils-1.0.0.jar (androidx.legacy:legacy-support-core-utils:1.0.0)

my gradle :

```<code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        maven { url 'https://maven.google.com' }
        mavenCentral()
        maven { url 'https://jitpack.io' }
     }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        maven { url 'https://maven.google.com' }
        mavenCentral()
        maven { url 'https://jitpack.io' }
     }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

</code>```
```<code>plugins {
    id 'com.android.application'
}

android {
    compileSdkVersion 31
    buildToolsVersion "30.0.0"

    defaultConfig {
        applicationId "com.i_e_commerce.Moodlia"
        minSdkVersion 16
        targetSdkVersion 31
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation 'androidx.appcompat:appcompat:1.4.0'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
//    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.intuit.ssp:ssp-android:1.1.0'
    implementation 'androidx.preference:preference:1.1.1'
    implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
//    implementation 'com.kovachcode:timePickerWithSeconds:1.0.1'
    implementation 'io.github.ShawnLin013:number-picker:2.4.13'
    implementation 'com.github.chrisbanes:PhotoView:2.0.0'

    implementation 'com.github.f0ris.sweetalert:library:1.6.2'
    implementation 'androidx.navigation:navigation-fragment:2.3.5'
    implementation 'androidx.navigation:navigation-ui:2.3.5'
}
</code>```

I checked different versions but it didn't solve it, I tried to fix it with VPN but it didn't work

please help me to find out the problem and solve it.

ContentLicense: CC BY-SA 4.0

Body:
i get this error when i want to build android studio project

mergeDebugJavaResource
Could not resolve legacy-support-core-utils-1.0.0.jar (androidx.legacy:legacy-support-core-utils:1.0.0)

my gradle :

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        maven { url 'https://maven.google.com' }
        mavenCentral()
        maven { url 'https://jitpack.io' }
     }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        maven { url 'https://maven.google.com' }
        mavenCentral()
        maven { url 'https://jitpack.io' }
     }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

plugins {
    id 'com.android.application'
}

android {
    compileSdkVersion 31
    buildToolsVersion "30.0.0"

    defaultConfig {
        applicationId "com.i_e_commerce.Moodlia"
        minSdkVersion 16
        targetSdkVersion 31
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation 'androidx.appcompat:appcompat:1.4.0'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
//    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.intuit.ssp:ssp-android:1.1.0'
    implementation 'androidx.preference:preference:1.1.1'
    implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
//    implementation 'com.kovachcode:timePickerWithSeconds:1.0.1'
    implementation 'io.github.ShawnLin013:number-picker:2.4.13'
    implementation 'com.github.chrisbanes:PhotoView:2.0.0'

    implementation 'com.github.f0ris.sweetalert:library:1.6.2'
    implementation 'androidx.navigation:navigation-fragment:2.3.5'
    implementation 'androidx.navigation:navigation-ui:2.3.5'
}

I checked different versions but it didn't solve it, I tried to fix it with VPN but it didn't work

please help me to find out the problem and solve it.


问:
Deployment of a multi-server backend
How would I deploy a nodejs backend that consists of 3 servers running on separate ports on Heroku?

Could it be done without separating them?

Thanks!

Title: Deployment of a multi-server backend


问:
How to write Azure blob metadata within Azure ML pipeline component
The blob container is available as an AML blob datastore within the pipeline component
Here is the relevant YAML for the component

```<code>outputs:
  datapath:
    type: uri_folder
    path: <datastore>
</code>```

I can create a new blob using

```<code>with open(os.path.join(args.datapath, "content.txt"),"w") as f:
        f.write(content)
</code>```

How to update the metadata of this blob after creating it? I am using AML v2, python SDK.

Body:
The blob container is available as an AML blob datastore within the pipeline component
Here is the relevant YAML for the component

outputs:
  datapath:
    type: uri_folder
    path: <datastore>

I can create a new blob using

with open(os.path.join(args.datapath, "content.txt"),"w") as f:
        f.write(content)

How to update the metadata of this blob after creating it? I am using AML v2, python SDK.


问:
Azure Log Analytics B2B solution not seeing X12 functional acknowledgements
I have created a full EDI solution using Azure Logic Apps - handles AS2 for communication and X12 for the transactions.  Everything is working great.  I recently set up Azure Monitor and installed the "Logic Apps B2B" workspace solution - which gives you a nice little dashboard showing message traffic by trading partner and status.

The AS2 side seems to be fully working, including seeing when MDNs are sent back.

However, the X12 side is always showing the X12 message's "ACK" status as pending...as if 997s have not been sent or received.  However, 997s are definitely flowing in and out.  I have doubled checked that the log diagnostic data is set up properly for the logic apps that handle X12, and for the integration account.

Not much content about this comes up in a Google search.

Anyone have experience with this?


问:
React Native Stripe API Error (maestro is only available in iOS 12.0 or newer)
I face an issue during running react native project on xcode version 14.1.

I get an error 'maestro' is only available in iOS 12.0 or newer. I also update target version but getting no success.

Delete node_modules, pod files but getting no success.


问:
How to load data in the collectionview from JSON to Swift by using Alamofire and Kingfisher
I need to get the data from already made JSON file to the Swift. By using MVVM desing I wrote this code in the Repo class

```<code> func loadFoods() {
        AF.request("http://example.com/foods/getAllFoods.php",method: .get).response { response in
            if let data = response.data {
                do{
                    let result = try JSONDecoder().decode(ProductsResponse.self, from: data)
                    if let list = result.foods {
                        self.foodList.onNext(list)
                    }
                }catch{
                    print(error.localizedDescription)
                }
            }
        }
    }

</code>```

Here's the code from View Model class:

```<code>class HomeViewModel {
var foodList = BehaviorSubject <[Foods]>(value: [Foods]())
var frepo = FoodsDaoRepository()

init() {
    loadFoods()
    foodList = frepo.foodList
}

func loadFoods() {
   frepo.loadFoods()
}

func loadPersons(){
    prepo.loadPersons()
}
</code>```

and I wrote this code in the ViewContoller class:

```<code> override func viewDidLoad() {
        super.viewDidLoad()

        searchTextField.delegate = self
        collectionView.delegate = self
        collectionView.dataSource = self

        let _ = viewModel.foodList.subscribe(onNext: { list in
            self.foodsList = list
            DispatchQueue.main.async {
                self.collectionView.reloadData()
            }
        })

override func viewWillAppear(_ animated: Bool) {
        viewModel.loadFoods()
    }
</code>```

Foodlist variable takes the data from Food class:

```<code>class Foods: Codable {

    var id : Int?
    var name : String?
    var image : String?
    var price : Int?
    var category : String?

    init(id: Int?, name: String?, image: String?, price: Int?, category: String?) {
       self.id = id
       self.name = name
       self.image = image
       self.price = price
       self.category = category
   }

}
</code>```

But it didn't help to get the data from JSON to the CollectionView. It just shows empty collection view cells.

Also how can I get an image by using Kingfisher and Alamofire?

I tried to explain the problem and wrote a code to expand my question

Body:
I need to get the data from already made JSON file to the Swift. By using MVVM desing I wrote this code in the Repo class

 func loadFoods() {
        AF.request("http://example.com/foods/getAllFoods.php",method: .get).response { response in
            if let data = response.data {
                do{
                    let result = try JSONDecoder().decode(ProductsResponse.self, from: data)
                    if let list = result.foods {
                        self.foodList.onNext(list)
                    }
                }catch{
                    print(error.localizedDescription)
                }
            }
        }
    }

Here's the code from View Model class:

class HomeViewModel {
var foodList = BehaviorSubject <[Foods]>(value: [Foods]())
var frepo = FoodsDaoRepository()

init() {
    loadFoods()
    foodList = frepo.foodList
}

func loadFoods() {
   frepo.loadFoods()
}

func loadPersons(){
    prepo.loadPersons()
}

and I wrote this code in the ViewContoller class:

 override func viewDidLoad() {
        super.viewDidLoad()

        searchTextField.delegate = self
        collectionView.delegate = self
        collectionView.dataSource = self

        let _ = viewModel.foodList.subscribe(onNext: { list in
            self.foodsList = list
            DispatchQueue.main.async {
                self.collectionView.reloadData()
            }
        })

override func viewWillAppear(_ animated: Bool) {
        viewModel.loadFoods()
    }

Foodlist variable takes the data from Food class:

class Foods: Codable {

    var id : Int?
    var name : String?
    var image : String?
    var price : Int?
    var category : String?

    init(id: Int?, name: String?, image: String?, price: Int?, category: String?) {
       self.id = id
       self.name = name
       self.image = image
       self.price = price
       self.category = category
   }

}

But it didn't help to get the data from JSON to the CollectionView. It just shows empty collection view cells.

Also how can I get an image by using Kingfisher and Alamofire?

I tried to explain the problem and wrote a code to expand my question


问:
How to use formula for Bolds and then do something?
Suppose this is my Excel Online:

```<code>Name    Price    Date             Debt   Pay
A        $        2022/0/12/25     5
A        $        2022/0/12/27     6
</code>```

I want to use this in another cell to check this:

if d:d is bold and name=A and Price=$ or "Dollar", then sum(d:d) - minus(e:e)

I want to create an Excel to write how much I should pay to others and how much they should pay me (for myself use only).

I searched some sites but none of them worked and I got formula error.

I mention that I use Excel Online (I think some formulas are different between Online and Installed version).

Body:
Suppose this is my Excel Online:

Name    Price    Date             Debt   Pay
A        $        2022/0/12/25     5
A        $        2022/0/12/27     6

I want to use this in another cell to check this:

if d:d is bold and name=A and Price=$ or "Dollar", then sum(d:d) - minus(e:e)

I want to create an Excel to write how much I should pay to others and how much they should pay me (for myself use only).

I searched some sites but none of them worked and I got formula error.

I mention that I use Excel Online (I think some formulas are different between Online and Installed version).


问:
I am trying to get informatin from JSON file - Google Chrome Extension
I am trying to develop a google chrome extension. I have to take information from a JSON file which is uploaded by user. But getting the error below. How can I fix this? Thank you.

Uncaught (in promise) SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON

```<code>let selectedFile;

document.getElementById("cust").addEventListener('change',(event)=>{
        selectedFile = event.target.files[0];

} );

document.getElementById("send").addEventListener('click',()=>{
    if(selectedFile){
        const r = fetch(selectedFile);
        r.then(response => response.json())

        }
    }
 );
</code>```

event.target.files[0] type/value is:

```<code>File {name: 'customer.json', lastModified: 1672167660694, lastModifiedDate: Tue Dec 27 2022 22:01:00 GMT+0300 (GMT+03:00), webkitRelativePath: '', size: 2558, …}
</code>```

And here is the JSON file example:

```<code>[
 {
  "First Name": "John",
  "Last Name": "Doe",
  "Email": "test@test.com"

 },
 {
  "First Name": "John2",
  "Last Name": "Doe2",
  "Email": "test2@test.com"
 },
 {
  "First Name": "John3",
  "Last Name": "Doe3",
  "Email": "tes3t@test.com",
 }
 ]
</code>```

This code works when I try to get JSON data from a URL.

Body:
I am trying to develop a google chrome extension. I have to take information from a JSON file which is uploaded by user. But getting the error below. How can I fix this? Thank you.

Uncaught (in promise) SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON

let selectedFile;

document.getElementById("cust").addEventListener('change',(event)=>{
        selectedFile = event.target.files[0];

} );

document.getElementById("send").addEventListener('click',()=>{
    if(selectedFile){
        const r = fetch(selectedFile);
        r.then(response => response.json())

        }
    }
 );

event.target.files[0] type/value is:

File {name: 'customer.json', lastModified: 1672167660694, lastModifiedDate: Tue Dec 27 2022 22:01:00 GMT+0300 (GMT+03:00), webkitRelativePath: '', size: 2558, …}

And here is the JSON file example:

[
 {
  "First Name": "John",
  "Last Name": "Doe",
  "Email": "test@test.com"

 },
 {
  "First Name": "John2",
  "Last Name": "Doe2",
  "Email": "test2@test.com"
 },
 {
  "First Name": "John3",
  "Last Name": "Doe3",
  "Email": "tes3t@test.com",
 }
 ]

This code works when I try to get JSON data from a URL.


问:
What are the implications of installing a Visual Studio "workload" for .NET versus downloading the SDK manually?
I want to build .NET 6 projects on Windows. It seems like creating a new project with dotnet new is the way to do this.

I can get the .NET CLI by downloading the .NET 6 SDK. However, it seems like I'm able to get the same thing by installing a workflow through the Visual Studio installer (.NET desktop development):

What is the difference between these two? Should I only install one, both?

If I only install through VS, I don't have access to the CLI in my path by default, but I assume I'd be able to manually add the right folder if I found it. Is there a better way?

I ask about .NET specifically, but I supposed this question could be generalized to all the other third-party tools VS includes in its installer; Python, Node, Unity, etc. all have their own ways to install, and it's not clear to me what happens when you install something through a "workflow" instead.


问:
selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document
```<code>from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
import time
from selenium.webdriver.common.keys import Keys
import random
from time import sleep
from claves import name,clave
driver = webdriver.Chrome()

def login(driver):
    driver.get('https://www.instagram.com/')
    sleep(1)
    driver.find_element(By.NAME,"username").send_keys(name)
    sleep(0.3)
    driver.find_element(By.NAME,'password').send_keys(clave)
    sleep(0.5)
    driver.find_element(By.XPATH,'//*[@id="loginForm"]/div/div[3]/button').click()
    sleep(2)

login((driver))
sleep(3)
words = ["Test","Hola","Hack"]
url = "https://www.instagram.com/p/tn6sLsLH_UTSf_TvWzhhKPglLHwngGwExoXhI0/"
def comentar(driver,url):
    driver.get(url)
    sleep(2)

    comment_button = driver.find_element(By.CSS_SELECTOR,'[class="x1i0vuye xvbhtw8 x76ihet xwmqs3e x112ta8 xxxdfa6 x5n08af x78zum5 x1iyjqo2 x1qlqyl8 x1d6elog xlk1fp6 x1a2a7pz xexx8yu x4uap5 x18d9i69 xkhd6sd xtt52l0 xnalus7 x1bq4at4 xaqnwrm xs3hnx8"').send_keys(random.choice(words))

    comment_button.send_keys(Keys.ENTER)

    sleep(2)

comentar(driver,url)
</code>```

I am trying to create an instagram bot, but i cannot get the comment textspace in the variable commentbutton, i have tried using the method findelement by Xpath, CSS_selector or by Class but they send me this error or another one

Body:
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
import time
from selenium.webdriver.common.keys import Keys
import random
from time import sleep
from claves import name,clave
driver = webdriver.Chrome()

def login(driver):
    driver.get('https://www.instagram.com/')
    sleep(1)
    driver.find_element(By.NAME,"username").send_keys(name)
    sleep(0.3)
    driver.find_element(By.NAME,'password').send_keys(clave)
    sleep(0.5)
    driver.find_element(By.XPATH,'//*[@id="loginForm"]/div/div[3]/button').click()
    sleep(2)

login((driver))
sleep(3)
words = ["Test","Hola","Hack"]
url = "https://www.instagram.com/p/tn6sLsLH_UTSf_TvWzhhKPglLHwngGwExoXhI0/"
def comentar(driver,url):
    driver.get(url)
    sleep(2)

    comment_button = driver.find_element(By.CSS_SELECTOR,'[class="x1i0vuye xvbhtw8 x76ihet xwmqs3e x112ta8 xxxdfa6 x5n08af x78zum5 x1iyjqo2 x1qlqyl8 x1d6elog xlk1fp6 x1a2a7pz xexx8yu x4uap5 x18d9i69 xkhd6sd xtt52l0 xnalus7 x1bq4at4 xaqnwrm xs3hnx8"').send_keys(random.choice(words))

    comment_button.send_keys(Keys.ENTER)

    sleep(2)

comentar(driver,url)

I am trying to create an instagram bot, but i cannot get the comment textspace in the variable commentbutton, i have tried using the method findelement by Xpath, CSS_selector or by Class but they send me this error or another one


问:
Error HH404: File @openzeppelin/contracts/token/ERC20/exstentions/ERC20Capped.sol
I'm using visual studio code and I'm trying to make my first crypto token so I'm new to all this coding and everything but I'm following a tutorial for a ERC20 token and im stuck on npx hardhat compile because every time i do it i get the error Error HH404:File@openzeppelin/contracts/token/ERC20/exstentions/ERC20Capped.sol
ive look everywhere for a solution and nothing works could someone help please?

the youtube video link is: https://www.youtube.com/watch?v=gc7e90MHvl8

i tried following the youtube video but it didnt go well


问:
Selenium Sending Unwanted Repeated Login Requests to Okta
We are trying to create a simple, automated test using Selenium for our C#.NET Auth service that utilizes IdentityServer. We have a simple UI that redirects to Okta's Login page which, when successful, redirects back to our Auth management screen. For some reason, when doing the automated test, it is able to click our UI's login button, successfully enter the username and password to the Okta Login UI and click Okta's Login Button. But, when the request is being processed, for some reason it is sending multiple requests resulting in the page reloading with a new code_challenge being created for each request. This ends up with a 429 Rate Limit being thrown. If I close the browser before it finishes (I counted over 25 requests before closing it prematurely), my WebDriverWait command is where it throws an exception.

I want to clarify that we're not looking to "get around" the rate limit - we're wanting to fix the multiple requests being sent. Ideally, there should be one login request sent to Okta and (assuming it is successful) be redirected back to our Auth service's UI. This flow works when trying to login manually, it is just the automated test that bugs out.

def userLogin(self):
        """Logs in to dev okta account

        Returns:
            bool:   True == passed
                    False == failed
        """
        # logs into okta delos account

        # Attempts to click log in button
        if not self.elementClick(By.CLASS_NAME, "mud-button-label"):
            return False

        # Attempts to type in log in information and click submit
        if not self.elementType(
            By.ID, "okta-signin-username", "OKTAUSERNAME"
        ):
            return False

        if not self.elementType(
            By.ID, "okta-signin-password", "OKTAPASSWORD", True
        ):
            return False

        # if not self.elementClick(By.ID, "okta-signin-submit"):
        #     return False

        self.driver.get_screenshot_as_file("./screenshot.png")

        self.driver.get_screenshot_as_file("./signin_screenshot.png")
        element = WebDriverWait(self.driver, 30).until(EC.presence_of_element_located((By.ID, "mud-nav-link-text")))
        if (element):
            return True
        else:
            return False

def elementType(self, htmlKeyword, htmlValue, typeStr, enter = False):
        """Types string in element based on html keyword, and value passed in

        Args:
            driver (selenium.webdriver.chrome.webdriver.WebDriver): Object that allows program to interface with browser
            htmlKeyword (str): Saves the value of the html keyword to pass into find_element
            htmlValue (str): saves the string value to identify element
            kbStr (str): string to type in element

        Returns:
            Boolean: True == click was completed
                     False == click failed
        """
        completed = False
        attempts = 0
        while not completed and attempts <= 10:
            try:
                element = self.driver.find_element(htmlKeyword, htmlValue)
                element.send_keys(typeStr)
                if (enter):
                    element.send_keys(Keys.RETURN)
                completed = True
            except NoSuchElementException:
                time.sleep(1)
                attempts += 1
            except StaleElementReferenceException:
                time.sleep(1)
                attempts += 1
            except ElementClickInterceptedException:
                time.sleep(1)
                attempts += 1

        return completed
```


问:
Context.User.Identity.Name changes from one postback to the next
I am running an ASP.Net (C# 4.7.2) application. In the master page code behind, I am capturing the value of Context.User.identity.Name in a ViewState variable. In one call Context.User.identity.Name comes back with my domain and username. In a subsequent call, Context.User.identity.Name is coming back with my last name, first name. Why is it changing from one call to another?

```<code>If (!IsPostBack)
{ Viewstate[myvar] = Context.User.Identity.Name ?? String.Empty; }
else
{ if (string)ViewState[myvar] != (Context.User.Identity.Name ?? String.Empty)
{ throw new Exception("Not the same person");}
</code>```

}

In the some calls, I will get mydomain\myusername from Context.User.identity.Name and then it shifts to Smith, John.

At least within the same session, shouldn't Context.User.identity.Name always come back with the same value? I don't really care which one it comes back with, I just want it to always be the same value.

Body:
I am running an ASP.Net (C# 4.7.2) application. In the master page code behind, I am capturing the value of Context.User.identity.Name in a ViewState variable. In one call Context.User.identity.Name comes back with my domain and username. In a subsequent call, Context.User.identity.Name is coming back with my last name, first name. Why is it changing from one call to another?

If (!IsPostBack)
{ Viewstate[myvar] = Context.User.Identity.Name ?? String.Empty; }
else
{ if (string)ViewState[myvar] != (Context.User.Identity.Name ?? String.Empty)
{ throw new Exception("Not the same person");}

}

In the some calls, I will get mydomain\myusername from Context.User.identity.Name and then it shifts to Smith, John.

At least within the same session, shouldn't Context.User.identity.Name always come back with the same value? I don't really care which one it comes back with, I just want it to always be the same value.


问:
Python: Async function that works in script (__main__) and IPython
I am struggling to wrap my head around how to get a simple class to work in both IPython (I use spyder interactive interpreter, Jupyter notebook etc a lot), as well as a traditional script launched from command line.

At the top of my script, I have:

```<code>import asyncio
import nest_asyncio
nest_asyncio.apply()  # <--- from what I've seen, this is the easiest way to make async work in IPython.

    #Ultimately I'm trying to init this, and run net_position:

class Surfbird_DB():
    def __init__(self):

        # - - - - - - - - - - - - - - - - - -
        # MAIN ATTRIBUTES
        self.views = self._View_Models_Display()
        # - - - - - - - - - - - - - - - - - -

    # - - - - - - - - - - - - -
    #2)  View Model functions / display

    class _View_Models_Display():
        def __init__(self):
            pass

        def __run(self, fx):
            return Surfbird_View_Result(asyncio.run(fx))

        @property
        def net_position(self):
            return self.__run(self.__get_net_position())
</code>```

However, when I run this script, I get the following error in command line.

```<code>RuntimeError: There is no current event loop in thread 'MainThread'.
</code>```

Any help is appreciated!

Body:
I am struggling to wrap my head around how to get a simple class to work in both IPython (I use spyder interactive interpreter, Jupyter notebook etc a lot), as well as a traditional script launched from command line.

At the top of my script, I have:

import asyncio
import nest_asyncio
nest_asyncio.apply()  # <--- from what I've seen, this is the easiest way to make async work in IPython.

    #Ultimately I'm trying to init this, and run net_position:

class Surfbird_DB():
    def __init__(self):

        # - - - - - - - - - - - - - - - - - -
        # MAIN ATTRIBUTES
        self.views = self._View_Models_Display()
        # - - - - - - - - - - - - - - - - - -

    # - - - - - - - - - - - - -
    #2)  View Model functions / display

    class _View_Models_Display():
        def __init__(self):
            pass

        def __run(self, fx):
            return Surfbird_View_Result(asyncio.run(fx))

        @property
        def net_position(self):
            return self.__run(self.__get_net_position())

However, when I run this script, I get the following error in command line.

RuntimeError: There is no current event loop in thread 'MainThread'.

Any help is appreciated!


问:
how to adapt withStyles for mui v5?
If we have a legacy MUI snippet like this:

```<code>import React from 'react';
import { withStyles } from '@material-ui/core/styles';
import Paper from '@material-ui/core/Paper';
import Grid from '@material-ui/core/Grid';
import Hidden from '@material-ui/core/Hidden';
import Typography from '@material-ui/core/Typography';
const styles = theme => ({
root: {
flexGrow: 1
},
paper: {
padding: theme.spacing(2),
textAlign: 'center',
color: theme.palette.text.secondary
}
});
const ColumnDirection = withStyles(styles)(({ classes }) => (
<div className={classes.root}>
<Grid container justify="space-around" spacing={4}>
<Grid item xs={3}>
<Grid container direction="column" spacing={2}>
</code>```

How do we realize the same functionality in mui v5?

Title: how to adapt withStyles for mui v5?

Body:
If we have a legacy MUI snippet like this:

import React from 'react';
import { withStyles } from '@material-ui/core/styles';
import Paper from '@material-ui/core/Paper';
import Grid from '@material-ui/core/Grid';
import Hidden from '@material-ui/core/Hidden';
import Typography from '@material-ui/core/Typography';
const styles = theme => ({
root: {
flexGrow: 1
},
paper: {
padding: theme.spacing(2),
textAlign: 'center',
color: theme.palette.text.secondary
}
});
const ColumnDirection = withStyles(styles)(({ classes }) => (

<Grid container justify="space-around" spacing={4}>
<Grid item xs={3}>
<Grid container direction="column" spacing={2}>

How do we realize the same functionality in mui v5?


问:
"perpendicular" element-wise multiplication of two 2D arrays to a 3D array
I want to multiply two 2D arrays element-wise "vertically" so that the resulting array is 3D:

Illustration

Is this possible without much trouble? Thanks in advance for help.

I googled and the only thing that might be purposeful but seems very laborious to me is numpy.reshape


问:
Setup cross-domain tracking for iframe
I want to attribute the purchase event and other events made inside an iframe to the source from where the user came from (Ads/UTM) on the parent page.

According to Google (Link below: Manual setup Method), if I initialize Google Analytics 4 (ga4) inside the iframe with the same client_id and session_id as the parent page, it will be considered the same user.

However, when I try this, a new user and session are being created even though the cookie values for _ga and ga are the same for both the parent and the iframe. I have confirmed that these cookie values are the same.

https://support.google.com/analytics/answer/10071811?hl=en#zippy=%2Cmanual-setup

Is there something I am missing or doing wrong?

Title: Setup cross-domain tracking for iframe


问:
Timezones management - server/client - struggling to understand
I've been reading a whole day today. I want to understand how to manage time in my webapp. So just a few bits of information to begin with: I have Laravel 9 backend and Vue3 frontend - a monolith app.

On the front end, users can create an entry in the database which contains the start and end date.

Now the problematic thing - so I want to make it so that when a user in one country creates the entry, that user will see their local time but if the user in another timezone sees that entry on the website they will see that shifted accordingly to their timezone.

Now if on the front end I am using new Date () in JS to obtain the date like this Tue Dec 27 2022 19:40:08 GMT+0000 (Greenwich Mean Time) and then send it over to laravel I get something like that in database 2022-12-27 19:40:08.

Here is what I know:

UTC is not a timezone but a time system

new Date() called in my JS app in the browser is giving me the local, time-zoned time

Laravel by default uses UTC

Both dates on the frontend and database in Laravel are the same. How that is if once of them is local time and the other one is UTC?

Can anyone explain exactly how does that work from database/js/laravel point of view? Or at least point me to some good resources?

The way I see that is I need to:

create UTC date in JS on the frontend

send it to the LAravel app which will save it in UTC in my db

display it for the user after formatting it on the frontend with Javascript to use local timezone.

It all seems very confusing to me and so far I just managed to get mostly mean comments for not understanding this.

I am mostly interested in understanding what is the correct flow here and how when I send a date from Javascript to the backend, Laravel knows how to deal with it.

Can anyone explain that?


问:
_id with ObjectId type for mongodb
I have spring boot service with mongodb database

My document class:

@Document(collection = "BOOKS_V2")
data class BookObjectDocument(
    val description: String?,
    val owningCompanyData: OwningCompanyData?
) {
    @Id
    lateinit var id: String

    @Version
    var version: Long? = null
}
```
<p>My <code>repository</code> class:</p>
<pre class="lang-kotlin prettyprint-override"><code>@Repository
interface BookObjectRepository : MongoRepository<BookObjectDocument, String>
</code>```

When I save my object (fun save(document: RealtyObjectMortgageDocument) = repository.save(document)), the _id field is saved in the database with the ObjectId type. Example:

```<code>"_id": {
  "$oid": "633b0a51b63a1819890b7143"
},
</code>```

Why is this happening? What can be done to save it with the string type?

Title: _id with ObjectId type for mongodb

Body:
I have spring boot service with mongodb database

My document class:

@Document(collection = "BOOKS_V2")
data class BookObjectDocument(
    val description: String?,
    val owningCompanyData: OwningCompanyData?
) {
    @Id
    lateinit var id: String

    @Version
    var version: Long? = null
}

My repository class:

@Repository
interface BookObjectRepository : MongoRepository<BookObjectDocument, String>

When I save my object (fun save(document: RealtyObjectMortgageDocument) = repository.save(document)), the _id field is saved in the database with the ObjectId type. Example:

"_id": {
  "$oid": "633b0a51b63a1819890b7143"
},

Why is this happening? What can be done to save it with the string type?


问:
How to extract NULL and empty strings from MySQL into csv using Python with "" for empty string and nothing (not even quotes) for NULL
I am trying to select specific columns from a MySQL table into csv.
This table has integers, varchar, NULL and empty strings.
I want to differentiate between NULL and empty strings in specific way.

For DB row content: ABC, 123,,NULL,2022-12-22

The csv should have: "ABC"|"123"|""||"2022-12-22"

Is there any way to do this using Python without having to do row level operations?

I am trying to use Pandas and csv modules (open for other options as well) but couldn't find a way to represent DB NULL with nothing and empty string with "".

In csv I get either

"ABC"|"123"|""|""|"2022-12-22" #df.to_csv(r'file_name.csv', index=False, sep='|', quoting=csv.QUOTE_ALL, na_rep=None)

OR

"ABC"|123|""|""|"2022-12-22" #df.to_csv(r'file_name.csv', index=False, sep='|', quoting=csv.QUOTE_NONNUMERIC, na_rep=None)

OR

ABC|123|||2022-12-22 #df.to_csv(r'file_name.csv', index=False, sep='|', quoting=csv.QUOTE_MINIMAL, na_rep=None)

My complete code is:

```<code>import mysql.connector
import pandas as pd
import csv

mydb = mysql.connector.connect (
    host = "hostname",
    user = "user_name",
    password = "pwd",
    database = "db_name"
)

sqlquery = pd.read_sql_query('''select * from db_name.table_name''')

df = pd.DataFrame(sqlquery)
df.to_csv(r'file_name.csv', index=False, sep='|', quoting=csv.QUOTE_ALL, na_rep=None)
</code>```

I have checked many SO posts like following but none give the solution I am looking for:

Writing-empty-string-with-quotes-and-null-value-without-quotes-while-writing-to

dont-convert-null-value-to-empty-string-when-exporting-mysql-data-to-csv

writing-a-pandas-dataframe-into-a-csv-file-with-some-empty-rows

Body:
I am trying to select specific columns from a MySQL table into csv.
This table has integers, varchar, NULL and empty strings.
I want to differentiate between NULL and empty strings in specific way.

For DB row content: ABC, 123,,NULL,2022-12-22

The csv should have: "ABC"|"123"|""||"2022-12-22"

Is there any way to do this using Python without having to do row level operations?

I am trying to use Pandas and csv modules (open for other options as well) but couldn't find a way to represent DB NULL with nothing and empty string with "".

In csv I get either

"ABC"|"123"|""|""|"2022-12-22" #df.to_csv(r'file_name.csv', index=False, sep='|', quoting=csv.QUOTE_ALL, na_rep=None)

OR

"ABC"|123|""|""|"2022-12-22" #df.to_csv(r'file_name.csv', index=False, sep='|', quoting=csv.QUOTE_NONNUMERIC, na_rep=None)

OR

ABC|123|||2022-12-22 #df.to_csv(r'file_name.csv', index=False, sep='|', quoting=csv.QUOTE_MINIMAL, na_rep=None)

My complete code is:

import mysql.connector
import pandas as pd
import csv

mydb = mysql.connector.connect (
    host = "hostname",
    user = "user_name",
    password = "pwd",
    database = "db_name"
)

sqlquery = pd.read_sql_query('''select * from db_name.table_name''')

df = pd.DataFrame(sqlquery)
df.to_csv(r'file_name.csv', index=False, sep='|', quoting=csv.QUOTE_ALL, na_rep=None)

I have checked many SO posts like following but none give the solution I am looking for:

Writing-empty-string-with-quotes-and-null-value-without-quotes-while-writing-to

dont-convert-null-value-to-empty-string-when-exporting-mysql-data-to-csv

writing-a-pandas-dataframe-into-a-csv-file-with-some-empty-rows


问:
How to use Hyperband to tune for single or multiple LSTM layers?
The logic is that if one LSTM layer is added then its return sequence must be False, whereas if two LSTM layers are to be added the first one should have return sequence equal to True.

I'm trying to do this by using parent_values but it does not work, so far I have something like this:

```<code>use_two_lstm_layers = hp.Boolean("use_two_lstm_layers")

return_sequences = hp.Choice("return_sequences", ['True', 'False'], parent_values=True)

model.add(keras.layers.Bidirectional(tf.keras.layers.LSTM(units=hp.Int('units', min_value=8, max_value=64, step=8), return_sequences=return_sequences)))
model.add(keras.layers.Dropout(rate=hp.Float('dp', min_value=0.1, max_value=0.8, step=0.1)))

if use_two_lstm_layers:
      model.add(keras.layers.Bidirectional(tf.keras.layers.LSTM(units=hp.Int('units2', min_value=8, max_value=256, step=8))))
      model.add(keras.layers.Dropout(rate=hp.Float('dp2', min_value=0.1, max_value=0.8, step=0.1)))

</code>```

I would expect this to follow the previous logic but it doesn't and I end up with dim issues. What's the solution?

Body:
The logic is that if one LSTM layer is added then its return sequence must be False, whereas if two LSTM layers are to be added the first one should have return sequence equal to True.

I'm trying to do this by using parent_values but it does not work, so far I have something like this:

use_two_lstm_layers = hp.Boolean("use_two_lstm_layers")

return_sequences = hp.Choice("return_sequences", ['True', 'False'], parent_values=True)

model.add(keras.layers.Bidirectional(tf.keras.layers.LSTM(units=hp.Int('units', min_value=8, max_value=64, step=8), return_sequences=return_sequences)))
model.add(keras.layers.Dropout(rate=hp.Float('dp', min_value=0.1, max_value=0.8, step=0.1)))

if use_two_lstm_layers:
      model.add(keras.layers.Bidirectional(tf.keras.layers.LSTM(units=hp.Int('units2', min_value=8, max_value=256, step=8))))
      model.add(keras.layers.Dropout(rate=hp.Float('dp2', min_value=0.1, max_value=0.8, step=0.1)))

I would expect this to follow the previous logic but it doesn't and I end up with dim issues. What's the solution?


问:
Error on applying Matlab activations function on Siamese network
Happy new year

For a sample Siamese network (for instance refer to Matlab example: Train a Siamese Network to Compare Images(https://www.mathworks.com/help/deeplearning/ug/train-a-siamese-network-to-compare-images.html)), I need to compute deep learning network layer activations (refer again to Matlab activations function (https://www.mathworks.com/help/deeplearning/ref/seriesnetwork.activations.html)) for a specific layer. I faced an error and I have no idea to solve it. The code is as below:

**sample code to test Matlab activations function:
**

```<code>inp = 255*rand(105,105,1);
inp = dlarray(inp,"SSCB");
f = activations(net,inp,"maxpool_1");
</code>```

**Matlab error:
**Incorrect number or types of inputs or outputs for function 'activations'.

I tried to apply Matlab activations function on neural network object.
It work fine on pre-trained networks. But It failed on Siamese.

Body:
Happy new year

For a sample Siamese network (for instance refer to Matlab example: Train a Siamese Network to Compare Images(https://www.mathworks.com/help/deeplearning/ug/train-a-siamese-network-to-compare-images.html)), I need to compute deep learning network layer activations (refer again to Matlab activations function (https://www.mathworks.com/help/deeplearning/ref/seriesnetwork.activations.html)) for a specific layer. I faced an error and I have no idea to solve it. The code is as below:

**sample code to test Matlab activations function:
**

inp = 255*rand(105,105,1);
inp = dlarray(inp,"SSCB");
f = activations(net,inp,"maxpool_1");

**Matlab error:
**Incorrect number or types of inputs or outputs for function 'activations'.

I tried to apply Matlab activations function on neural network object.
It work fine on pre-trained networks. But It failed on Siamese.


问:
'int' object is not subscriptable - Python using Pandas
Im working with nested JSON data with Pandas, but i have a problem once i extract the dataframe of the nested data.

The data looks like:

```<code>[{"export_id":"COL-EXP-1894","origin_office":"EXAMPLE","destination_office":"","incoterms":"","shipment_date":"","export_date":"2023-01-01","origin_port":"Buenaventura","destination_port":"New York/New Jersey","bl_number":null,"shipping_line":null,"shipping_mode":null,"vessel_name":null,"voyage_number":null,"reservation_number":null,"container_number":null,"seal_number":null,"eta":null,"etd":null,"export_status":"in_progress","ico_list":\[\]}\]

</code>```

And reading like that all is good, but some data have ico_list like:

```<code>[{"export_id":"COL-EXP-1894","origin_office":"EXAMPLE","destination_office":"","incoterms":"","shipment_date":"","export_date":"2023-01-01","origin_port":"Buenaventura","destination_port":"New York/New Jersey","bl_number":null,"shipping_line":null,"shipping_mode":null,"vessel_name":null,"voyage_number":null,"reservation_number":null,"container_number":null,"seal_number":null,"eta":null,"etd":null,"export_status":"in_progress","ico_list":[{"ico_id":"03-0178-436-23","contract_id":"CI-1046","customer":null,"origin_office":"example","destination_office":"example","incoterm":"CIF","quality":"ML","mark":"example","packaging_type":"Nitrogen-Flushed Vac-Packed Boxes - 35KG","packaging_capacity":35.0,"units":1,"quantity":35.0,"certification":null}]}]
</code>```

And not just one like the example, can be more, so i implemented this:

```<code>if response.status_code == 200:
        data_str = response.text
        try:
            atlas_api_data = json.loads(data_str)
            df_atlas = pd.json_normalize(atlas_api_data)
            #print(df_atlas)
        except:
            print('ErrorOccured While Parsing JSON ATLAS API TO Dataframe')
        df_atlas2 = pd.json_normalize(df_atlas['ico_list'].loc[95])

    for i, row in df_atlas.iterrows():
        export_id = row['export_id']
        origin_office = row['origin_office']
        destination_office = row['destination_office']
        export_date = row['export_date']
        origin_port = row['origin_port']
        destination_port = row['destination_port']
        bl_number = row['bl_number']
        shipping_line = row['shipping_line']
        shipping_mode = row['shipping_mode']
        vessel_name = row['vessel_name']
        voyage_number = row['voyage_number']
        reservation_number = row['reservation_number']
        container_number = row['container_number']
        seal_number = row['seal_number']
        export_status = row['export_status']
        values = [export_id,origin_office,destination_office,export_date,origin_port,destination_port,
            bl_number,shipping_line,shipping_mode,vessel_name,voyage_number,reservation_number,container_number,
            seal_number,export_status]
        data_list.append(values)
        df_atlas2 = pd.json_normalize(df_atlas['ico_list'].loc[i])
        if df_atlas2.empty:
            print('Empty DF')
        else:
            for row_ico, j in df_atlas2.iterrows():
                ico_id = row_ico['ico_id']
                contract_id = row_ico['contract_id']
                customer = row_ico['customer']
                incoterm = row_ico['incoterm']
                quality = row_ico['quality']
                mark = row_ico['mark']
                packaging_type = row_ico['packaging_type']
                packaging_capacity = row_ico['packaging_capacity']
                units = row_ico['units']
                quantity = row_ico['quantity']
                certification = row_ico['certification']
                ico_values = [export_id,ico_id,contract_id,customer,incoterm,quality,mark,packaging_type,packaging_capacity,units,quantity,certification]
                data_ico_list.append(ico_values)
</code>```

In this way i extract only the data that i need, and for the first level worked, but when i go to the second iterrows() it says

```<code>TypeError                                 Traceback (most recent call last)
Cell In [4], line 43
     41 else:
     42     for row_ico, j in df_atlas2.iterrows():
---> 43         ico_id = row_ico['ico_id']
     44         contract_id = row_ico['contract_id']
     45         customer = row_ico['customer']

TypeError: 'int' object is not subscriptable
</code>```

When printing the df_atlas2 it looks normal, like this:
variable: df_atlas2 before goes into iterrrows()

I tried using df_atlas2['ico_id'].astype(str) with all the columns and ico_id = str(row_ico['ico_id']) but still getting the message

If you know how to solve this, hundred thanks!

Body:
Im working with nested JSON data with Pandas, but i have a problem once i extract the dataframe of the nested data.

The data looks like:

[{"export_id":"COL-EXP-1894","origin_office":"EXAMPLE","destination_office":"","incoterms":"","shipment_date":"","export_date":"2023-01-01","origin_port":"Buenaventura","destination_port":"New York/New Jersey","bl_number":null,"shipping_line":null,"shipping_mode":null,"vessel_name":null,"voyage_number":null,"reservation_number":null,"container_number":null,"seal_number":null,"eta":null,"etd":null,"export_status":"in_progress","ico_list":\[\]}\]

And reading like that all is good, but some data have ico_list like:

[{"export_id":"COL-EXP-1894","origin_office":"EXAMPLE","destination_office":"","incoterms":"","shipment_date":"","export_date":"2023-01-01","origin_port":"Buenaventura","destination_port":"New York/New Jersey","bl_number":null,"shipping_line":null,"shipping_mode":null,"vessel_name":null,"voyage_number":null,"reservation_number":null,"container_number":null,"seal_number":null,"eta":null,"etd":null,"export_status":"in_progress","ico_list":[{"ico_id":"03-0178-436-23","contract_id":"CI-1046","customer":null,"origin_office":"example","destination_office":"example","incoterm":"CIF","quality":"ML","mark":"example","packaging_type":"Nitrogen-Flushed Vac-Packed Boxes - 35KG","packaging_capacity":35.0,"units":1,"quantity":35.0,"certification":null}]}]

And not just one like the example, can be more, so i implemented this:

if response.status_code == 200:
        data_str = response.text
        try:
            atlas_api_data = json.loads(data_str)
            df_atlas = pd.json_normalize(atlas_api_data)
            #print(df_atlas)
        except:
            print('ErrorOccured While Parsing JSON ATLAS API TO Dataframe')
        df_atlas2 = pd.json_normalize(df_atlas['ico_list'].loc[95])

    for i, row in df_atlas.iterrows():
        export_id = row['export_id']
        origin_office = row['origin_office']
        destination_office = row['destination_office']
        export_date = row['export_date']
        origin_port = row['origin_port']
        destination_port = row['destination_port']
        bl_number = row['bl_number']
        shipping_line = row['shipping_line']
        shipping_mode = row['shipping_mode']
        vessel_name = row['vessel_name']
        voyage_number = row['voyage_number']
        reservation_number = row['reservation_number']
        container_number = row['container_number']
        seal_number = row['seal_number']
        export_status = row['export_status']
        values = [export_id,origin_office,destination_office,export_date,origin_port,destination_port,
            bl_number,shipping_line,shipping_mode,vessel_name,voyage_number,reservation_number,container_number,
            seal_number,export_status]
        data_list.append(values)
        df_atlas2 = pd.json_normalize(df_atlas['ico_list'].loc[i])
        if df_atlas2.empty:
            print('Empty DF')
        else:
            for row_ico, j in df_atlas2.iterrows():
                ico_id = row_ico['ico_id']
                contract_id = row_ico['contract_id']
                customer = row_ico['customer']
                incoterm = row_ico['incoterm']
                quality = row_ico['quality']
                mark = row_ico['mark']
                packaging_type = row_ico['packaging_type']
                packaging_capacity = row_ico['packaging_capacity']
                units = row_ico['units']
                quantity = row_ico['quantity']
                certification = row_ico['certification']
                ico_values = [export_id,ico_id,contract_id,customer,incoterm,quality,mark,packaging_type,packaging_capacity,units,quantity,certification]
                data_ico_list.append(ico_values)

In this way i extract only the data that i need, and for the first level worked, but when i go to the second iterrows() it says

TypeError                                 Traceback (most recent call last)
Cell In [4], line 43
     41 else:
     42     for row_ico, j in df_atlas2.iterrows():
---> 43         ico_id = row_ico['ico_id']
     44         contract_id = row_ico['contract_id']
     45         customer = row_ico['customer']

TypeError: 'int' object is not subscriptable

When printing the df_atlas2 it looks normal, like this:
variable: df_atlas2 before goes into iterrrows()

I tried using df_atlas2['ico_id'].astype(str) with all the columns and ico_id = str(row_ico['ico_id']) but still getting the message

If you know how to solve this, hundred thanks!


问:
Is pointer to std::unordered_set element's value valid after the container is modified?
std::unordered_set

References and pointers to data stored in the container are only
invalidated by erasing that element, even when the corresponding
iterator is invalidated.

Question> I would like to confirm my understanding on the validity of pointers pointing to data stored in std::unordered_set. Based on my investigation, the pointer(i.e. str_a) is still valid even if the container(i.e. uset) is modified(excluding erasing) later.

Thank you

```<code>#include <iostream>
#include <unordered_set>
#include <memory>
#include <string>

int main()
{
    std::unordered_set<std::unique_ptr<std::string>> uset{};

    // insert first element
    //
    auto [iter_a, inserted_a] = uset.emplace(std::make_unique<std::string>("hello_a"));

    // save the pointer to the first inserted element
    //
    const auto str_a = iter_a->get();
    if (inserted_a)
    {
        std::cout << str_a->c_str() << ": " << str_a->size() << std::endl;
    }

    // insert second element
    //
    auto [iter_b, inserted_b] = uset.emplace(std::make_unique<std::string>("hello_world_b"));
    const auto str_b = iter_b->get();
    if (inserted_b)
    {
        std::cout << str_b->c_str() << ": " << str_b->size() << std::endl;
    }

    // the pointer to first inserted element is still valid after the unordered_set is modified
    //
    std::cout << str_a->c_str() << ": " << str_a->size() << std::endl;

    return 0;
}
</code>```

Output:

```<code>hello_a: 7
hello_world_b: 13
hello_a: 7
</code>```

Body:
std::unordered_set

References and pointers to data stored in the container are only
invalidated by erasing that element, even when the corresponding
iterator is invalidated.

Question> I would like to confirm my understanding on the validity of pointers pointing to data stored in std::unordered_set. Based on my investigation, the pointer(i.e. str_a) is still valid even if the container(i.e. uset) is modified(excluding erasing) later.

Thank you

#include <iostream>
#include <unordered_set>
#include <memory>
#include <string>

int main()
{
    std::unordered_set<std::unique_ptr<std::string>> uset{};

    // insert first element
    //
    auto [iter_a, inserted_a] = uset.emplace(std::make_unique<std::string>("hello_a"));

    // save the pointer to the first inserted element
    //
    const auto str_a = iter_a->get();
    if (inserted_a)
    {
        std::cout << str_a->c_str() << ": " << str_a->size() << std::endl;
    }

    // insert second element
    //
    auto [iter_b, inserted_b] = uset.emplace(std::make_unique<std::string>("hello_world_b"));
    const auto str_b = iter_b->get();
    if (inserted_b)
    {
        std::cout << str_b->c_str() << ": " << str_b->size() << std::endl;
    }

    // the pointer to first inserted element is still valid after the unordered_set is modified
    //
    std::cout << str_a->c_str() << ": " << str_a->size() << std::endl;

    return 0;
}

Output:

hello_a: 7
hello_world_b: 13
hello_a: 7


问:
how would I order my columns to interchange positions depending on screen size using bootstrap 5?
I am trying to change the order of the way my columns are displayed on large, medium and and small screen, its responding well but when it reaches small and below it behaves differently?</p>
```<code>  <div class="row ben-join-margin-util-top" style="margin-top:-1rem;">
            <div class="col-lg-6 order-xs-last order-lg-first join-ben-util">

            </div>
            <div class="col-lg-6 why-benefits-util">

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


问:
onerror in remote script tag: How to get error details?
I have an anonymous remote

```

How can my Fail() function get a helpful error message like "connection refused", "subresource integrity check failed", etc. (depending on the situation), in order to display something helpful on the page?

Body:
I have an anonymous remote

How can my Fail() function get a helpful error message like "connection refused", "subresource integrity check failed", etc. (depending on the situation), in order to display something helpful on the page?


问:
SWIG python MacOS issue
I'm using MacOS on M1 Pro Macbook and I want to build a minimalistic-example SWIG binding to python.

I have a C++ file:

```<code>// mymodule.cpp
int square(int x){
    return x*x;
}
</code>```

interface file

```<code>//mymodule.i
%module mymodule

%{
extern int square(int x);
%}
extern int square(int x);
</code>```

Then I call:

```<code>swig -c++ -python -o mymodule_wrap.cpp mymodule.i
gcc -c mymodule.cpp mymodule_wrap.cpp -I/Users/XXX/opt/anaconda3/include/python3.9 -fPIC
gcc -shared mymodule.o mymodule_wrap.o -o _mymodule.so
</code>```

and the third line gives me:

```<code>ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
</code>```

What should I change to make it work?

Title: SWIG python MacOS issue

Body:
I'm using MacOS on M1 Pro Macbook and I want to build a minimalistic-example SWIG binding to python.

I have a C++ file:

// mymodule.cpp
int square(int x){
    return x*x;
}

interface file

//mymodule.i
%module mymodule

%{
extern int square(int x);
%}
extern int square(int x);

Then I call:

swig -c++ -python -o mymodule_wrap.cpp mymodule.i
gcc -c mymodule.cpp mymodule_wrap.cpp -I/Users/XXX/opt/anaconda3/include/python3.9 -fPIC
gcc -shared mymodule.o mymodule_wrap.o -o _mymodule.so

and the third line gives me:

ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

What should I change to make it work?


问:
Twig template_from_string() inside macro
If template_from_string is inside {% macro ... %} string is not parsed.
Example of may code:

example.yaml

items:
    item1: item1
    item2: |
        {{ AI }} lorem ipsum dolor sit amet...
```
<p>php function</p>
<pre class="lang-php prettyprint-override"><code>function AI() {
    return 'AI<span class="ai-tm">™</span>';
}
</code>```

Timber function.php

 // Global $context
 $context['AI'] = AI();
```
<p>Twig</p>
```{# If outside macro, template_from_string parses ok #}
```dump(include(template_from_string(items.item2)))```

{% macro example_macro(items) %}
   {# items is php array parsed from yaml file
and passed as parameter to macro #}
  {% for item in items %}

{{ include(template_from_string(item)) }}

  {% endfor %}
{% endmacro %}
```
<p>Results:</p>
```{# Notices that {{ AI }} isn't parsed #}

lorem ipsum dolor sit amet...

```

Body:
If template_from_string is inside {% macro ... %} string is not parsed.
Example of may code:

example.yaml

items:
    item1: item1
    item2: |
        {{ AI }} lorem ipsum dolor sit amet...

php function

function AI() {
    return 'AI™';
}

Timber function.php

 // Global $context
 $context['AI'] = AI();

Twig

{# If outside macro, template_from_string parses ok #}

dump(include(template_from_string(items.item2)))

{% macro example_macro(items) %}
   {# items is php array parsed from yaml file
and passed as parameter to macro #}
  {% for item in items %}

{{ include(template_from_string(item)) }}

  {% endfor %}
{% endmacro %}

Results:

{# Notices that {{ AI }} isn't parsed #}

lorem ipsum dolor sit amet...


问:
Text disappears when using Node JS through Git Bash
Basic functionality seems to work fine when using Git Bash on Windows, but as soon as I type 'node', hit enter, and begin typing, the text begins to disappear as soon as the CLI recommends an autofill option. For example: I begin to type the characters '.h' and it tries to guess that I intend to type '.help'. As soon as I hit [tab] or continue typing, the characters become invisible and if I hit [backspace], the entire line becomes invisible. Afterwards, everything I type in while in the Node environment is invisible. It still seems like commands that I blindly type execute, but the output is also invisible. Hitting Ctrl-C twice exits the Node environment and Git Bash goes back to working just fine.

Does anyone know how to fix this problem and allow text to be visible when using Node JS through Git Bash?

I've tried uninstalling and reinstalling both Git for Windows and Node JS, but neither option has fixed the problem.


问:
Why does Python code that creates an image (like with matplotlib) run when saving?
If I write a piece of code that, for example, creates a graph with matplotlib, it seems to run whenever I save the file, and the image pops up. This is something that I do not want.

I use VScode as my code editor for python. When the code below is saved, or I save anything while this file is open, the result of this pops up on my screen, which I do not understand why.

```<code>import PySimpleGUI as sg

sg.Window(title="Hello World", layout=[[]], margins = (100, 50)).read()
</code>```

Body:
If I write a piece of code that, for example, creates a graph with matplotlib, it seems to run whenever I save the file, and the image pops up. This is something that I do not want.

I use VScode as my code editor for python. When the code below is saved, or I save anything while this file is open, the result of this pops up on my screen, which I do not understand why.

import PySimpleGUI as sg

sg.Window(title="Hello World", layout=[[]], margins = (100, 50)).read()


问:
Handle the collision of sprites in Cocos Creator
I’m trying to handle the collision of two sprites, i added BoxCollider2D to the sprites.
One sprite can jump (changing the y coordinate through animation), named "character ", the other is a static object, named “key”.
When I overlay one sprite on another, the handler works correctly, but if I put the “key” higher, so that the "character " can reach it from the jump, then nothing works.

code for the "character "

```<code>start () {
this.collider = this.node.getComponent(BoxCollider2D);
if( this.collider ) {
this.collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this);
}
}
onBeginContact( selfCollider: BoxCollider2D, otherCollider: BoxCollider2D, contact: IPhysics2DContact | null ) {
if( otherCollider.name == “key” ){
otherCollider.node.getComponent(“key”).destroyKey();
this.score++;
this.scoreLabel.string = "Score: " + this.score;
}
}
</code>```

code for the “key”

```<code>destroyKey(){
console.log(“handle”);
}
</code>```

Body:
I’m trying to handle the collision of two sprites, i added BoxCollider2D to the sprites.
One sprite can jump (changing the y coordinate through animation), named "character ", the other is a static object, named “key”.
When I overlay one sprite on another, the handler works correctly, but if I put the “key” higher, so that the "character " can reach it from the jump, then nothing works.

code for the "character "

start () {
this.collider = this.node.getComponent(BoxCollider2D);
if( this.collider ) {
this.collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this);
}
}
onBeginContact( selfCollider: BoxCollider2D, otherCollider: BoxCollider2D, contact: IPhysics2DContact | null ) {
if( otherCollider.name == “key” ){
otherCollider.node.getComponent(“key”).destroyKey();
this.score++;
this.scoreLabel.string = "Score: " + this.score;
}
}

code for the “key”

destroyKey(){
console.log(“handle”);
}


问:
SQL: If two rows have the same value A delete the row with the lowest value B
Let's say I have the following table, where some rows have a duplicate some_date value (like the first three ones in this case) while having different total values.

```<code>| some_date        | total    |
| ---------------- | -------- |
| 2020-02-09 00:00 | 1.98132  |
| 2020-02-09 00:00 | 11.95332 |
| 2020-02-09 00:00 | 16.95012 |
| 2020-02-16 00:00 | 17.38212 |
</code>```

What I'm trying to do is to delete rows with a duplicate some_date value, while keeping the row with the highest total value. In the above table, only the third and fourth row should remain, for example.

How can this be done in SQL?

Body:
Let's say I have the following table, where some rows have a duplicate some_date value (like the first three ones in this case) while having different total values.

| some_date        | total    |
| ---------------- | -------- |
| 2020-02-09 00:00 | 1.98132  |
| 2020-02-09 00:00 | 11.95332 |
| 2020-02-09 00:00 | 16.95012 |
| 2020-02-16 00:00 | 17.38212 |

What I'm trying to do is to delete rows with a duplicate some_date value, while keeping the row with the highest total value. In the above table, only the third and fourth row should remain, for example.

How can this be done in SQL?


问:
How to include query params in a redirect uri without using state parameter?
Is it possible to allow query parameters in redirect uri's without using a state parameter?

I have a react application that can only be used after being logged in, some pages modify the URL to contain IDs of particular items the user wants to view later, these URLs can be bookmarked. The problem Im having is that when opening bookmarked URL's the query parameters do not get included.

For example when opening the following URL - https://URL/APP/ui/items?ids=%5B%224%22%5D only https://URL/APP/ui/items would show, the query parameters with the ID's would be missing.

In my react code, I'm using react-router-dom hook useSearchParams() to set the ids dynamically, in Azure I have my redirect uri to accept anything with the use of a wild card as seen below

{ "url": "https://URL/APP/ui/*", "type": "Spa"},

Is there anything in Azure or React that I can set/configure to make sure these query parameters don't disappear?

Any help would be appreciated.


问:
Webpack breaks code with anonymous function when and webpack duplicating function calls
I am having a big fight with my dear friend Webpack today. I have tried this code on a non-webpacked script page to know it works. Now that I have added my code to webpack it's displaying strange behavior.

It is looping the function call of listmodule over & over until it fills the page with the content that the function brings up.

The code outright breaks during the first call of displayRadioValue. Specifically as it's going through ele.length. The chrome dev tools window suddenly switches at that point to an anonymous function that wasn't hardcoded by me (by webpack I assume) and continues on a divergent line of anonymous function calls but never finishes the resetModule code that called displayRadioValue in the first place.

Here is my webpack config

```<code>    `const path = require('path');
    const HTMLWebpackPlugin = require('html-webpack-plugin')

    module.exports = {
      entry: {
        index:  './src/index.js',
        modules: './src/modules.js',
        utility: './src/utility.js',
      },
      plugins: [
        new HTMLWebpackPlugin({
          title: 'toDoList',
          template: 'dist\\index.html'
        }),
      ],
      devtool: 'inline-source-map',
      mode: "development",
      output: {
        filename: '[name].js',
        path: path.resolve(__dirname, 'dist'),
        clean: true,
      },
      optimization: {
        runtimeChunk: 'single',
      },
      module: {
        rules: [
          {
            test: /\.css$/i,
            use: ['style-loader', 'css-loader'],
          },
          {
            test: /\.(png|svg|jpg|jpeg|gif)$/i,
            type: 'asset/resource',
          },
        ],
      },
     };`
</code>```

Here is my package.json

```<code>  {
      "name": "odintodo",
      "version": "1.0.0",
      "description": "",
      "main": "index.js",
      "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1",
        "build": "webpack"
      },
      "keywords": [],
      "author": "",
      "license": "ISC",
      "devDependencies": {
        "css-loader": "^6.7.3",
        "html-webpack-plugin": "^5.5.0",
        "style-loader": "^3.3.1",
        "webpack": "^5.75.0",
        "webpack-cli": "^5.0.0"
      }
    }
</code>```

Lastly here is the file that's causing the issue so far. I can post the other two js files if needed for context.

```<code>import { Task } from './index.js'
import { displayRadioValue } from './utility.js'
import { ToDoList } from './index.js'
import { saveToLocalStorage } from './utility.js'
import { updateMainscreen } from './utility.js'
import { updateSubscreen } from './utility.js'
import { updateSidebar } from './utility.js'
import './styles.css'
const newListButton = document.getElementById("newL")
const schedule = []
const mover = document.getElementById("mover")
const display = document.getElementById("display")
export const listModule = () => {
    mover.remove(newListButton)
    var newLocal =`<form class="entryForm" action="#" method="post">
        <h4>Create A tasklist</h4>
        <label for="title">List title:</label>
        <input type="text" id="listName" name="List Title" placeholder="Insert Tasklist title here"><br>
        <button id="submitList">Submit List</button>
        </form>`
    display.innerHTML += newLocal
    var submitListButton = document.getElementById("submitList")
    submitListButton.addEventListener("click", function() {
        taskModule()
    })
return {listModule}
}
export const taskModule = () => {
    var listName = document.getElementById("listName").value
    display.innerHTML = " "
    var newLocal = `<form class="entryForm" action="#" method="post">
            <h2>Create a task</h2>
            <label for="Task Name">Task Name</label>
            <input type="text" id="taskName" name="task Name" placeholder="Insert Task Name Here"><br>
            <label for="taskDescription">Task description</label>
            <input type="text" id="description" name="taskDescription" placeholder="task description here"><br>
            <label for="dueDate">Due date</label>
            <input type="text" id="dueDate" name="dueDate" placeholder="Insert due date here"><br>
            <label for="priority">Priorty:</label><br>
            <input type="radio" id="priority" name="priority" value="High" ><label for="priority">High</label>
            <input type="radio" id="priority" name="priority" value="Medium"><label for="priority">Medium</label>
            <input type="radio" id="priority" name="priority" value="Low"><label for="priority">Low</label>
            <button id="submitTask">Submit</button>
            </form>`
    display.innerHTML += newLocal
    var submitTaskButton = document.getElementById("submitTask")
    submitTaskButton.addEventListener("click", function() {
        resetModule(listName)
    })

    return {listName}, {taskModule}
}
const resetModule = (listName) => {
    let priority = displayRadioValue()
    var title = document.getElementById("taskName").value
    var description = document.getElementById("description").value
    var dueDate = document.getElementById("dueDate").value
    display.innerHTML = " "
    let newTask  = new Task(title, description, dueDate, priority)
    saveToLocalStorage(listName, newTask)
    var activeList = null
    for (const list of schedule) {
        if (list.listName === listName) {
            activeList = list
        }
    }
    // If a ToDoList with the same name was not found, create a new one
    if (activeList === null) {
        activeList = new ToDoList(listName)
        saveToLocalStorage(listName, list)
        schedule.push(activeList)
    }
    activeList.addTask(newTask)
    mover.appendChild(newListButton)
    updateSidebar(newTask, activeList)
    updateMainscreen(activeList, newTask)
    updateSubscreen(newTask)
    return {resetModule}, {schedule}
}
</code>```

Body:
I am having a big fight with my dear friend Webpack today. I have tried this code on a non-webpacked script page to know it works. Now that I have added my code to webpack it's displaying strange behavior.

It is looping the function call of listmodule over & over until it fills the page with the content that the function brings up.

The code outright breaks during the first call of displayRadioValue. Specifically as it's going through ele.length. The chrome dev tools window suddenly switches at that point to an anonymous function that wasn't hardcoded by me (by webpack I assume) and continues on a divergent line of anonymous function calls but never finishes the resetModule code that called displayRadioValue in the first place.

Here is my webpack config

    `const path = require('path');
    const HTMLWebpackPlugin = require('html-webpack-plugin')

    module.exports = {
      entry: {
        index:  './src/index.js',
        modules: './src/modules.js',
        utility: './src/utility.js',
      },
      plugins: [
        new HTMLWebpackPlugin({
          title: 'toDoList',
          template: 'dist\\index.html'
        }),
      ],
      devtool: 'inline-source-map',
      mode: "development",
      output: {
        filename: '[name].js',
        path: path.resolve(__dirname, 'dist'),
        clean: true,
      },
      optimization: {
        runtimeChunk: 'single',
      },
      module: {
        rules: [
          {
            test: /\.css$/i,
            use: ['style-loader', 'css-loader'],
          },
          {
            test: /\.(png|svg|jpg|jpeg|gif)$/i,
            type: 'asset/resource',
          },
        ],
      },
     };`

Here is my package.json

  {
      "name": "odintodo",
      "version": "1.0.0",
      "description": "",
      "main": "index.js",
      "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1",
        "build": "webpack"
      },
      "keywords": [],
      "author": "",
      "license": "ISC",
      "devDependencies": {
        "css-loader": "^6.7.3",
        "html-webpack-plugin": "^5.5.0",
        "style-loader": "^3.3.1",
        "webpack": "^5.75.0",
        "webpack-cli": "^5.0.0"
      }
    }

Lastly here is the file that's causing the issue so far. I can post the other two js files if needed for context.

import { Task } from './index.js'
import { displayRadioValue } from './utility.js'
import { ToDoList } from './index.js'
import { saveToLocalStorage } from './utility.js'
import { updateMainscreen } from './utility.js'
import { updateSubscreen } from './utility.js'
import { updateSidebar } from './utility.js'
import './styles.css'
const newListButton = document.getElementById("newL")
const schedule = []
const mover = document.getElementById("mover")
const display = document.getElementById("display")
export const listModule = () => {
    mover.remove(newListButton)
    var newLocal =`<form class="entryForm" action="#" method="post">

Create A tasklist

        List title:
        <input type="text" id="listName" name="List Title" placeholder="Insert Tasklist title here">

        <button id="submitList">Submit List</button>
        </form>`
    display.innerHTML += newLocal
    var submitListButton = document.getElementById("submitList")
    submitListButton.addEventListener("click", function() {
        taskModule()
    })
return {listModule}
}
export const taskModule = () => {
    var listName = document.getElementById("listName").value
    display.innerHTML = " "
    var newLocal = `<form class="entryForm" action="#" method="post">

Create a task

            Task Name
            <input type="text" id="taskName" name="task Name" placeholder="Insert Task Name Here">

            Task description
            <input type="text" id="description" name="taskDescription" placeholder="task description here">

            Due date
            <input type="text" id="dueDate" name="dueDate" placeholder="Insert due date here">

            Priorty:

            <input type="radio" id="priority" name="priority" value="High" >High
            <input type="radio" id="priority" name="priority" value="Medium">Medium
            <input type="radio" id="priority" name="priority" value="Low">Low
            <button id="submitTask">Submit</button>
            </form>`
    display.innerHTML += newLocal
    var submitTaskButton = document.getElementById("submitTask")
    submitTaskButton.addEventListener("click", function() {
        resetModule(listName)
    })

    return {listName}, {taskModule}
}
const resetModule = (listName) => {
    let priority = displayRadioValue()
    var title = document.getElementById("taskName").value
    var description = document.getElementById("description").value
    var dueDate = document.getElementById("dueDate").value
    display.innerHTML = " "
    let newTask  = new Task(title, description, dueDate, priority)
    saveToLocalStorage(listName, newTask)
    var activeList = null
    for (const list of schedule) {
        if (list.listName === listName) {
            activeList = list
        }
    }
    // If a ToDoList with the same name was not found, create a new one
    if (activeList === null) {
        activeList = new ToDoList(listName)
        saveToLocalStorage(listName, list)
        schedule.push(activeList)
    }
    activeList.addTask(newTask)
    mover.appendChild(newListButton)
    updateSidebar(newTask, activeList)
    updateMainscreen(activeList, newTask)
    updateSubscreen(newTask)
    return {resetModule}, {schedule}
}


问:
fill chart from csv file
I have csv file with data:

```<code>1,1671790171,75
0,1671790182,11
1,1671790193,11
0,1671790212,19
1,1671790239,27
0,1671790248,97
1,1671790342,94
0,1671790361,19
1,1671790368,79
0,1671790408,40
1,1671790417,90
0,1671790432,15
</code>```

I need create application to show chart where first data is "work" or "not work", second data is linuxtimestamp data and time, third data is the number of seconds the process took.

I wrote something like this:

```<code>    // Use OpenFileDialog to allow the user to select a CSV file
    var openFileDialog = new OpenFileDialog
    {
        Filter = "CSV files (*.csv)|*.csv"
    };

    if (openFileDialog.ShowDialog() == DialogResult.OK)
    {
        // Clear the chart
        chart1.Series.Clear();

        // Read the CSV file
        using (var reader = new StreamReader(openFileDialog.FileName))
        {
            while (!reader.EndOfStream)
            {
                var line = reader.ReadLine();
                var values = line.Split(',');

                // Parse the values
                var working = values[0] == "1";
                var timestamp = long.Parse(values[1]);
                var duration = int.Parse(values[2]);

                // Convert the Unix timestamp to a DateTime
                var date = DateTimeOffset.FromUnixTimeSeconds(timestamp).UtcDateTime;

                // Create a new series in the chart
                var series = new System.Windows.Forms.DataVisualization.Charting.Series
                {
                    Name = date.ToString("dd-MM-yyyy HH:mm:ss"),
                    Color = working ? Color.Red : Color.Green,
                    BorderColor = Color.Black,
                    ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Bar,
                    IsXValueIndexed = false,
                    XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.DateTime
                };
                series.Points.AddXY(date, duration);
                chart1.Series.Add(series);
            }
        }

        // Set the bar width for all series
        foreach (var series in chart1.Series)
        {
            foreach (var point in series.Points)
            {
                // point.Width = 20;
                point.BorderWidth = 0;
            }
        }
</code>```

However, I need help with replacing so that on line X there are all occurrences (i.e. each line) with preferably a vertical entry of the date of occurrence, and on line Y there is time of operation (i.e. the last data from each line)

Title: fill chart from csv file

Body:
I have csv file with data:

1,1671790171,75
0,1671790182,11
1,1671790193,11
0,1671790212,19
1,1671790239,27
0,1671790248,97
1,1671790342,94
0,1671790361,19
1,1671790368,79
0,1671790408,40
1,1671790417,90
0,1671790432,15

I need create application to show chart where first data is "work" or "not work", second data is linuxtimestamp data and time, third data is the number of seconds the process took.

I wrote something like this:

    // Use OpenFileDialog to allow the user to select a CSV file
    var openFileDialog = new OpenFileDialog
    {
        Filter = "CSV files (*.csv)|*.csv"
    };

    if (openFileDialog.ShowDialog() == DialogResult.OK)
    {
        // Clear the chart
        chart1.Series.Clear();

        // Read the CSV file
        using (var reader = new StreamReader(openFileDialog.FileName))
        {
            while (!reader.EndOfStream)
            {
                var line = reader.ReadLine();
                var values = line.Split(',');

                // Parse the values
                var working = values[0] == "1";
                var timestamp = long.Parse(values[1]);
                var duration = int.Parse(values[2]);

                // Convert the Unix timestamp to a DateTime
                var date = DateTimeOffset.FromUnixTimeSeconds(timestamp).UtcDateTime;

                // Create a new series in the chart
                var series = new System.Windows.Forms.DataVisualization.Charting.Series
                {
                    Name = date.ToString("dd-MM-yyyy HH:mm:ss"),
                    Color = working ? Color.Red : Color.Green,
                    BorderColor = Color.Black,
                    ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Bar,
                    IsXValueIndexed = false,
                    XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.DateTime
                };
                series.Points.AddXY(date, duration);
                chart1.Series.Add(series);
            }
        }

        // Set the bar width for all series
        foreach (var series in chart1.Series)
        {
            foreach (var point in series.Points)
            {
                // point.Width = 20;
                point.BorderWidth = 0;
            }
        }

However, I need help with replacing so that on line X there are all occurrences (i.e. each line) with preferably a vertical entry of the date of occurrence, and on line Y there is time of operation (i.e. the last data from each line)