问:
Chartjs Doughnut data given in seconds needs to show a formatted version on hover
I have an array consisting of 3 integers that I use on Doughnut chart as the data. Those 3 integers represent time in seconds. The labels on each slice on the cart show the integer value on hover, e.g. 144, 1525, 1245 etc. I need it to show a formatted datetime string instead of seconds. Screenshot below shows how it looks now:

And here's how i want it to look like:

The second image looks bad but i guess its understandable.

```<code>new Chart($(this), {
type: 'doughnut',
data: {
    datasets: [{
        data: [2, 143, 17],
        backgroundColor: [
            '#8f8f8f',
            '#d0ff20',
            '#1289ff'
        ]
    }]
},
options: {}});
</code>```

This is the code right now.

Body:
I have an array consisting of 3 integers that I use on Doughnut chart as the data. Those 3 integers represent time in seconds. The labels on each slice on the cart show the integer value on hover, e.g. 144, 1525, 1245 etc. I need it to show a formatted datetime string instead of seconds. Screenshot below shows how it looks now:

And here's how i want it to look like:

The second image looks bad but i guess its understandable.

new Chart($(this), {
type: 'doughnut',
data: {
    datasets: [{
        data: [2, 143, 17],
        backgroundColor: [
            '#8f8f8f',
            '#d0ff20',
            '#1289ff'
        ]
    }]
},
options: {}});

This is the code right now.


来源: stackexchange

问:
Exporting notebook as html with images in SageMaker
When using sagemaker studio, I am attempted to export my notebook with images. The only option from the file>>save_and_export_as that functions is html, however the images created in the notebook are not rendered in the resulting html file. How can I fix this in Sagemaker Studio?

I selected the html option from file>>save_and_export_as and I expected an html file with images (but no images were rendered)

ContentLicense: CC BY-SA 4.0


问:
React Native App Crash After Update Sdk Version 31
My app is closing after changing the sdk version, the build completes successfully but the application closes in the android emulator. In the iOS version everything works perfectly.

PS: While running the build if I leave the app loading in background, the app works perfectly, but if I run the build in foreground it closes.

My dependencies:
`

```<code>dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    //noinspection GradleDynamicVersion
    implementation "com.facebook.react:react-native:+"  // From node_modules

    implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"

    implementation 'com.google.firebase:firebase-analytics'

    implementation platform('com.google.firebase:firebase-bom:31.1.1')

    implementation 'androidx.work:work-runtime:2.7.1'

    debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
        exclude group:'com.facebook.fbjni'
    }

    debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
        exclude group:'com.facebook.flipper'
        exclude group:'com.squareup.okhttp3', module:'okhttp'
    }

    debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
        exclude group:'com.facebook.flipper'
    }

    if (enableHermes) {
        def hermesPath = "../../node_modules/hermes-engine/android/";
        debugImplementation files(hermesPath + "hermes-debug.aar")
        releaseImplementation files(hermesPath + "hermes-release.aar")
    } else {
        implementation jscFlavor
    }
}
</code>```

`

My buildscriipt gradle

```<code>buildscript {
    ext {
        buildToolsVersion = "31.0.0"
        minSdkVersion = 26
        compileSdkVersion = 31
        targetSdkVersion = 30
        ndkVersion = "21.4.7075529"
        kotlinVersion = "1.6.0"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath('com.android.tools.build:gradle:7.3.1')
        classpath 'com.google.gms:google-services:4.3.14'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
</code>```

1-I changed the SDK version from 30 to 31.
2-upgraded gradle from 7.0.2 to 7.4
3-added dependency implementation 'androidx.work:work-runtime:2.7.1

Body:
My app is closing after changing the sdk version, the build completes successfully but the application closes in the android emulator. In the iOS version everything works perfectly.

PS: While running the build if I leave the app loading in background, the app works perfectly, but if I run the build in foreground it closes.

My dependencies:
`

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    //noinspection GradleDynamicVersion
    implementation "com.facebook.react:react-native:+"  // From node_modules

    implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"

    implementation 'com.google.firebase:firebase-analytics'

    implementation platform('com.google.firebase:firebase-bom:31.1.1')

    implementation 'androidx.work:work-runtime:2.7.1'

    debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
        exclude group:'com.facebook.fbjni'
    }

    debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
        exclude group:'com.facebook.flipper'
        exclude group:'com.squareup.okhttp3', module:'okhttp'
    }

    debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
        exclude group:'com.facebook.flipper'
    }

    if (enableHermes) {
        def hermesPath = "../../node_modules/hermes-engine/android/";
        debugImplementation files(hermesPath + "hermes-debug.aar")
        releaseImplementation files(hermesPath + "hermes-release.aar")
    } else {
        implementation jscFlavor
    }
}

`

My buildscriipt gradle

buildscript {
    ext {
        buildToolsVersion = "31.0.0"
        minSdkVersion = 26
        compileSdkVersion = 31
        targetSdkVersion = 30
        ndkVersion = "21.4.7075529"
        kotlinVersion = "1.6.0"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath('com.android.tools.build:gradle:7.3.1')
        classpath 'com.google.gms:google-services:4.3.14'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

1-I changed the SDK version from 30 to 31.
2-upgraded gradle from 7.0.2 to 7.4
3-added dependency implementation 'androidx.work:work-runtime:2.7.1


问:
IntelliJ not saving Archetype on Catalog and not using the actual Archetype
I tried to create a Maven JAVAFX project from archetype like described on:

https://openjfx.io/openjfx-docs/#maven -> JavaFx And Intellij -> Non-Modular with Maven

I followed the instructions, but in this new version of intellij is a bit different but i followed.

But it did not worked and not saved the archetype on the Catalog (When i put the exact path to the default local catalog.

Here is the printscreen of the creation of archetype project on intellij newest version as of 22/12/2022:

I just want to save the archetype on the catalog and to create a project based on this archetype.

Here is the print of the project this archetypes creates, no SRC files and a generic POM:


问:
Notepad++ displays question marks in boxes – unless an Emoji is in line
In an UTF-8 encoded text file in Notepad++ 8.4.7 with the Consolas font on Windows 10, I get built-in replacement characters (question marks in square boxes, but not �) for some characters … unless there’s an emoji somewhere in the same line:

Here, it’s U+2161 (Ⅱ) and U+2249 (≉), being the first characters of lines 1+2/3+4 respectively. Alone on their own, they don’t display correctly, but if there’s an emoji behind them, they show. (It also works with, say, Cuneiform, and some other higher-up characters, but not all.)

Is it a Windows issue? A Notepad++ quirk?

(And can title and tags rephrased for better generality, or does it belong on Super user?)


问:
How can I fix this error message in D365 (Quantity cannot be invoiced because inventory transactions with a status of Received are insufficient
I'm trying to see how to fix this error in D365 when a Project Invoice proposal is trying to Post. There are no inventory for an item that this invoice is coming from. I checked the item model groups and tested different scenarios. A customer returned the items and now I'm trying to take them out of our transactions for the Sales Order from a project.

There is no packing slip or anything that ties to the return nor an RMA issued. Where am I not looking in D365 or have not clicked on to remove this error message from allowing the project invoice to post?


问:
How to make multipage validation for each page input using FormKit(Vue.Js)
I have a created FormKit form in my Vue.Js(v3) and inputs are made on a few pages.
On each page I have navigation button to the next page.
I want to create and validate all inputs on current page, before enable button for the next page.

What is the best way of creating validation for each page and disabling button (with


问:
Visual Studio Qt Build Error: "This application failed to start because no qt platform plugin could be initialized. Available platform plugins are..."
Hi I have a peculiar situation building my Qt program in Visual Studio 2019 using Qt 5.15.2. This is very similar, somewhat more deeply involved, than this issue. When building in Debug mode the program runs perfectly fine.

When running in release mode, originally I got the error: The application failed to start because no qt platform plugin could be initialized. Reinstalling the application may fix this problem.

After trying the things listed below I get the error: This application failed to start because no qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are direct2d (from C:\Qt\5.15.2\msvc2019_64\plugins\platforms), minimal (from C:\Qt\5.15.2\msvc2019_64\plugins\platforms), offscreen (from C:\Qt\5.15.2\msvc2019_64\plugins\platforms), windows (from C:\Qt\5.15.2\msvc2019_64\plugins\platforms), direct2d, minimal, offscreen, windows.

Things I have tried:

Setting QT_PLUGIN_PATH environment variable to
C:\Qt\5.15.2\msvc2019_64\plugins

Setting QT_QPA_PLATFORM_PLUGIN_PATH
environment variable to C:\Qt\5.15.2\msvc2019_64\plugins\platforms

Setting QTDIR environment variable to C:\Qt\5.15.2\msvc2019_64\bin

Addding C:\Qt\5.15.2\msvc2019_64\bin to the PATH environment variable

Copying libEGL.dll and libEGLvs2.dll to the program's directory

Running windeployqt targeting the release executable (this fixed things but I'm interested in fixing
the problem in a more automated way, I shouldn't have to do this
every time I build a program or change dependencies)

Anybody know how to resolve this issue? Thanks!


问:
Openlayers - how to make labels display larger and more legible in hybrid view on map - street, city/town, state
Difficulty viewing street names in satellite view on the openlayers map with mapbox tilelayer.  The font is smaller than it was in the google maps and seems to blend in to the map, making it tough to read.

comparison of satellite view on Google map Vs.
Openlayers/mapbox map

I poked around in Mapbox’s website and found a “satellite streets” option that looks much better than what we’re currently using.  We should see what it would take to move to this version for our satellite basemap.

See “Satellite Streets” here: Mapbox Satellite: global base map & satellite imagery

Interactive demo here:  Mapbox Satellite Streets

Here is my code that I used to setup layers:

```<code>hybridLayer: new TileLayer({
                source: new XYZ({
                    url:
                        "https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v10/tiles/{z}/{x}/{y}?access_token=" +
                        mapBoxAccessKey,
                }),
                visible: false,
            }),

            satelliteLayer: new TileLayer({
                source: new XYZ({
                    url:
                        "https://api.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}.png?access_token=" +
                        mapBoxAccessKey,
                }),
                visible: false,
            }),
</code>```

Body:
Difficulty viewing street names in satellite view on the openlayers map with mapbox tilelayer.  The font is smaller than it was in the google maps and seems to blend in to the map, making it tough to read.

comparison of satellite view on Google map Vs.
Openlayers/mapbox map

I poked around in Mapbox’s website and found a “satellite streets” option that looks much better than what we’re currently using.  We should see what it would take to move to this version for our satellite basemap.

See “Satellite Streets” here: Mapbox Satellite: global base map & satellite imagery

Interactive demo here:  Mapbox Satellite Streets

Here is my code that I used to setup layers:

hybridLayer: new TileLayer({
                source: new XYZ({
                    url:
                        "https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v10/tiles/{z}/{x}/{y}?access_token=" +
                        mapBoxAccessKey,
                }),
                visible: false,
            }),

            satelliteLayer: new TileLayer({
                source: new XYZ({
                    url:
                        "https://api.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}.png?access_token=" +
                        mapBoxAccessKey,
                }),
                visible: false,
            }),


问:
No var directory?
I know this is probably the dumbest question ever, but I just started coding and can't even get past the first lesson. So many things depend on the "var" directory, but I can't find it anywhere and when I type it into my GitBash I keep getting errors that say bash: cd: var: No such file or directory

For example, this is one of my lesson exercises: "Try typing ls -alF /var/. You can do that from any directory. It will always show the contents of the "var" subdirectory of the root directory because you have provided that argument to the list command."

Instead of getting the informational output, I just get bash: cd: var: No such file or directory

I'm sorry if it's a stupid question but I've googled the heck out of it and can't find anything. I do occasionally find something about Linux, but to my knowledge I'm running Windows 11, not Linux.  Is there a reason I don't have this file? And if I don't, what can i substitute so I can continue my lessons? Thank you so much!

Title: No var directory?


问:
Autocad Commande Bar
I'm working on an c# app that does some stuff in AutoCAD and I would like to know  how can I control AutoCAD command bar (Editor Bar Command) "Closed" "opened"

Sorry for my English

Title: Autocad Commande Bar


问:
Open Meta Data not able to create ingestion JSON files on Airflow Folder -dag_generated_configs
I am working on setting up bare metal deployment for OMD (Open Meta Data), luckily able to set up all the components, but facing some issues with the Airflow Ingestion Service. It seems like the OMD-created JSON Files are not getting stored in the Airflow Path (dag_generated_configs/ folder).
Attached is a screenshot of the error.
Please let me know how I can resolve this ingestion issue.

In the Kubernetes deployment method, I can see the below config option
`    config:

```<code>AIRFLOW__OPENMETADATA_AIRFLOW_APIS__DAG_GENERATED_CONFIGS:
"/airflow-dags/dags"`
</code>```

but in bare metal deployment documentation, I can't see this option available. Is this issue to that?

**FYI My Setup - **

OMD Version 0,13.0

I am using  AWS RDS as a meta DB ,

AWS Open Search

OMD backend Application and airflow standalone on the same EC2 server for now

FYI my Airflow configurations in OMD YAML File

`

airflowConfiguration:

```<code>   apiEndpoint: http://<server i.p>:8080
   hostIp: ${AIRFLOW_HOST_IP:-""}
   username: user
   password: pass
   metadataApiEndpoint: ${SERVER_HOST_API_URL:-
   http://localhost:8585/api}
   authProvider: ${AIRFLOW_AUTH_PROVIDER:-"no-auth"} #
   Possible values are "no-auth",     "azure", "google",
   "okta", "auth0", "custom-oidc", "openmetadata"
   authConfig:
     azure:
       clientSecret: ${OM_AUTH_AIRFLOW_AZURE_CLIENT_SECRET:-""}
       authority: ${OM_AUTH_AIRFLOW_AZURE_AUTHORITY_URL:-""}
       scopes: ${OM_AUTH_AIRFLOW_AZURE_SCOPES:-[]}
       clientId: ${OM_AUTH_AIRFLOW_AZURE_CLIENT_ID:-""}`
</code>```

Tried things -
I Tried Creating the Folder - dag_generated_configs into the Airflow home path & then ran the ingestion, but still faced the same.
To make sure that there is no connectivity issue between OMD & Airflow I hosted them on the same Ec2 Server

Expectations -

I want to know why the JSON files are not being created on airflow.

How can provide airflow home path in bare metal deployment, which config to change

Body:
I am working on setting up bare metal deployment for OMD (Open Meta Data), luckily able to set up all the components, but facing some issues with the Airflow Ingestion Service. It seems like the OMD-created JSON Files are not getting stored in the Airflow Path (dag_generated_configs/ folder).
Attached is a screenshot of the error.
Please let me know how I can resolve this ingestion issue.

In the Kubernetes deployment method, I can see the below config option
`    config:

AIRFLOW__OPENMETADATA_AIRFLOW_APIS__DAG_GENERATED_CONFIGS:
"/airflow-dags/dags"`

but in bare metal deployment documentation, I can't see this option available. Is this issue to that?

**FYI My Setup - **

OMD Version 0,13.0

I am using  AWS RDS as a meta DB ,

AWS Open Search

OMD backend Application and airflow standalone on the same EC2 server for now

FYI my Airflow configurations in OMD YAML File

`

airflowConfiguration:

   apiEndpoint: http://<server i.p>:8080
   hostIp: ${AIRFLOW_HOST_IP:-""}
   username: user
   password: pass
   metadataApiEndpoint: ${SERVER_HOST_API_URL:-
   http://localhost:8585/api}
   authProvider: ${AIRFLOW_AUTH_PROVIDER:-"no-auth"} #
   Possible values are "no-auth",     "azure", "google",
   "okta", "auth0", "custom-oidc", "openmetadata"
   authConfig:
     azure:
       clientSecret: ${OM_AUTH_AIRFLOW_AZURE_CLIENT_SECRET:-""}
       authority: ${OM_AUTH_AIRFLOW_AZURE_AUTHORITY_URL:-""}
       scopes: ${OM_AUTH_AIRFLOW_AZURE_SCOPES:-[]}
       clientId: ${OM_AUTH_AIRFLOW_AZURE_CLIENT_ID:-""}`

Tried things -
I Tried Creating the Folder - dag_generated_configs into the Airflow home path & then ran the ingestion, but still faced the same.
To make sure that there is no connectivity issue between OMD & Airflow I hosted them on the same Ec2 Server

Expectations -

I want to know why the JSON files are not being created on airflow.

How can provide airflow home path in bare metal deployment, which config to change


问:
Excel VBA: Change Note Text
I haven't been able to find a way to do this.
I want to update the text in a bunch of cell notes using VBA.

The purpose is to have snippets of instructions to be in these notes that are reused in multiple places within the file. I'd like to change the source instructions then click a button to update all the notes. This is so the user has realtime access to the instructions instead of flipping back and forth.

I see how you can update NoteText using range.NoteText, but that seems to only work if you are targeting a specific cell like B2.

Ideally I would be able to apply an identifier to the Notes like naming some Instruction1 and others Instruction2 and then have the VBA update instructions in all of those.

In the end I may have 20 cell notes per instruction and there are 20 different instruction blocks, so definitely don't want to do this manually.

There is a way to name a note like naming a cell but accessing that name through Range("Instruction1") doesn't look to work. To name a note you create it, click on the note box border, and then type a name in the typical name box in the upper left.

Instead of the note name, I could put a text tag in the note itself like {Instruction1}, that the VBA can pick up on and enter the applicable instruction.
In this case I would need to know how to loop through all the notes which I haven't tried. Perhaps this method would work for that: Looping through comments on an excel workbook in vba with merged cells

Does anyone know of a way to access Notes that are named or has worked out an entire method for what I'm trying to do?

Thanks

Title: Excel VBA: Change Note Text


问:
how to install a ClickOnce application from a server that isn't known at publish time
I have a ClickOnce application that I want to install from whatever web server/domain it's installed on.  There will be more than one, and I won't know in advance what they are.

Usually ClickOnce applications only install from the Installation Folder URL set in the Publish options.  The solution to this seems to be to check "Exclude deployment provider URL" in Publish/Options/Manifests, but I can't get it to work.

When I run the setup.exe from the website it seems to want to try to download the .application file from the download directory:

```<code>PLATFORM VERSION INFO
    Windows             : 10.0.19045.0 (Win32NT)
    Common Language Runtime     : 4.0.30319.42000
    System.Deployment.dll       : 4.8.4270.0 built by: NET48REL1LAST_C
    clr.dll             : 4.8.4515.0 built by: NET48REL1LAST_C
    dfdll.dll           : 4.8.4270.0 built by: NET48REL1LAST_C
    dfshim.dll          : 10.0.19041.30000 (WinBuild.160101.0800)

SOURCES
    Deployment url          : file:///C:/Users/username/Downloads/MyApplication.application

ERROR SUMMARY
    Below is a summary of the errors, details of these errors are listed later in the log.
    * Activation of C:\Users\username\Downloads\MyApplication.application resulted in exception. Following failure messages were detected:
        + Downloading file:///C:/Users/username/Downloads/MyApplication.application did not succeed.
        + Could not find file 'C:\Users\username\Downloads\MyApplication.application'.
        + Could not find file 'C:\Users\username\Downloads\MyApplication.application'.
        + Could not find file 'C:\Users\username\Downloads\MyApplication.application'.

COMPONENT STORE TRANSACTION FAILURE SUMMARY
    No transaction error was detected.

WARNINGS
    There were no warnings during this operation.

OPERATION PROGRESS STATUS
    * [12/22/2022 3:53:35 PM] : Activation of C:\Users\username\Downloads\MyApplication.application has started.

ERROR DETAILS
    Following errors were detected during this operation.
    * [12/22/2022 3:53:35 PM] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
        - Downloading file:///C:/Users/username/Downloads/MyApplication.application did not succeed.
        - Source: System.Deployment
        - Stack trace:
            at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
            at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
            at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState, X509Certificate2 clientCertificate)
            at System.Deployment.Application.DownloadManager.DownloadManifestAsRawFile(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
            at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirectBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
            at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options)
            at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl, Uri& deploymentUri)
            at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
--- End of stack trace from previous location where exception was thrown ---
            at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
            at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
            at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
        --- Inner Exception ---
        System.Net.WebException
        - Could not find file 'C:\Users\username\Downloads\MyApplication.application'.
        - Source: System
        - Stack trace:
            at System.Net.FileWebRequest.EndGetResponse(IAsyncResult asyncResult)
            at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
        --- Inner Exception ---
        System.Net.WebException
        - Could not find file 'C:\Users\username\Downloads\MyApplication.application'.
        - Source: System
        - Stack trace:
            at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)
            at System.Net.FileWebRequest.GetResponseCallback(Object state)
        --- Inner Exception ---
        System.IO.FileNotFoundException
        - Could not find file 'C:\Users\username\Downloads\MyApplication.application'.
        - Source: mscorlib
        - Stack trace:
            at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
            at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
            at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
            at System.Net.FileWebStream..ctor(FileWebRequest request, String path, FileMode mode, FileAccess access, FileShare sharing, Int32 length, Boolean async)
            at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)

COMPONENT STORE TRANSACTION DETAILS
    No transaction information is available.
</code>```

and if I run the .application file from the website it seems to want to try to download the .exe.manifest file from the download directory.

Body:
I have a ClickOnce application that I want to install from whatever web server/domain it's installed on.  There will be more than one, and I won't know in advance what they are.

Usually ClickOnce applications only install from the Installation Folder URL set in the Publish options.  The solution to this seems to be to check "Exclude deployment provider URL" in Publish/Options/Manifests, but I can't get it to work.

When I run the setup.exe from the website it seems to want to try to download the .application file from the download directory:

PLATFORM VERSION INFO
    Windows             : 10.0.19045.0 (Win32NT)
    Common Language Runtime     : 4.0.30319.42000
    System.Deployment.dll       : 4.8.4270.0 built by: NET48REL1LAST_C
    clr.dll             : 4.8.4515.0 built by: NET48REL1LAST_C
    dfdll.dll           : 4.8.4270.0 built by: NET48REL1LAST_C
    dfshim.dll          : 10.0.19041.30000 (WinBuild.160101.0800)

SOURCES
    Deployment url          : file:///C:/Users/username/Downloads/MyApplication.application

ERROR SUMMARY
    Below is a summary of the errors, details of these errors are listed later in the log.
    * Activation of C:\Users\username\Downloads\MyApplication.application resulted in exception. Following failure messages were detected:
        + Downloading file:///C:/Users/username/Downloads/MyApplication.application did not succeed.
        + Could not find file 'C:\Users\username\Downloads\MyApplication.application'.
        + Could not find file 'C:\Users\username\Downloads\MyApplication.application'.
        + Could not find file 'C:\Users\username\Downloads\MyApplication.application'.

COMPONENT STORE TRANSACTION FAILURE SUMMARY
    No transaction error was detected.

WARNINGS
    There were no warnings during this operation.

OPERATION PROGRESS STATUS
    * [12/22/2022 3:53:35 PM] : Activation of C:\Users\username\Downloads\MyApplication.application has started.

ERROR DETAILS
    Following errors were detected during this operation.
    * [12/22/2022 3:53:35 PM] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
        - Downloading file:///C:/Users/username/Downloads/MyApplication.application did not succeed.
        - Source: System.Deployment
        - Stack trace:
            at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
            at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
            at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState, X509Certificate2 clientCertificate)
            at System.Deployment.Application.DownloadManager.DownloadManifestAsRawFile(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
            at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirectBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
            at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options)
            at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl, Uri& deploymentUri)
            at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
--- End of stack trace from previous location where exception was thrown ---
            at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
            at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
            at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
        --- Inner Exception ---
        System.Net.WebException
        - Could not find file 'C:\Users\username\Downloads\MyApplication.application'.
        - Source: System
        - Stack trace:
            at System.Net.FileWebRequest.EndGetResponse(IAsyncResult asyncResult)
            at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
        --- Inner Exception ---
        System.Net.WebException
        - Could not find file 'C:\Users\username\Downloads\MyApplication.application'.
        - Source: System
        - Stack trace:
            at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)
            at System.Net.FileWebRequest.GetResponseCallback(Object state)
        --- Inner Exception ---
        System.IO.FileNotFoundException
        - Could not find file 'C:\Users\username\Downloads\MyApplication.application'.
        - Source: mscorlib
        - Stack trace:
            at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
            at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
            at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
            at System.Net.FileWebStream..ctor(FileWebRequest request, String path, FileMode mode, FileAccess access, FileShare sharing, Int32 length, Boolean async)
            at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)

COMPONENT STORE TRANSACTION DETAILS
    No transaction information is available.

and if I run the .application file from the website it seems to want to try to download the .exe.manifest file from the download directory.


问:
Spring Boot 3.0.0 X-Auth-Token gets deleted
I'm migrating from Spring Boot 2.2.6 to Spring Boot 3.0.0 and I'm having issues with the authentication, with no changes in the configuration...

After authenticating, the redirect is throwing a AccessDenied, which encapsulates as InsufficientAuthenticationException...

```<code>  @Bean
  public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
    http.csrf().disable();
    http.headers().cacheControl().disable();
    http.headers().frameOptions().sameOrigin();
    http.headers().contentTypeOptions().disable();

    AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry registry = http.authorizeHttpRequests();
    addPermissionToRegistry(registry, PUBLIC_URLS);
    addPermissionToRegistry(registry, USER_URLS, UserRole.USER.name());
    addPermissionToRegistry(registry, ADMIN_URLS, UserRole.ADMIN.name());
    registry.anyRequest().authenticated();
    http.formLogin().loginPage(BackendConstants.USER_PUBLIC_URL).permitAll(); //
    http.logout().logoutRequestMatcher(new AntPathRequestMatcher(BackendConstants.LOGOUT_ENDPOINT)).invalidateHttpSession(true)
    .logoutSuccessUrl(BackendConstants.USER_PUBLIC_URL).permitAll(); //

    http.exceptionHandling().accessDeniedHandler(customAccessDeniedHandler())
    .authenticationEntryPoint(new CustomLoginUrlAuthenticationEntryPoint());
    return http.build();
  }
</code>```

Any ideas????

Update 2022-12-23

It is related with the header token being lost.
I'm setting it up with Javascript and the server doesnt get it.
When I use postman and I sent the header manually, the servlet works as expected...

Body:
I'm migrating from Spring Boot 2.2.6 to Spring Boot 3.0.0 and I'm having issues with the authentication, with no changes in the configuration...

After authenticating, the redirect is throwing a AccessDenied, which encapsulates as InsufficientAuthenticationException...

  @Bean
  public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
    http.csrf().disable();
    http.headers().cacheControl().disable();
    http.headers().frameOptions().sameOrigin();
    http.headers().contentTypeOptions().disable();

    AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry registry = http.authorizeHttpRequests();
    addPermissionToRegistry(registry, PUBLIC_URLS);
    addPermissionToRegistry(registry, USER_URLS, UserRole.USER.name());
    addPermissionToRegistry(registry, ADMIN_URLS, UserRole.ADMIN.name());
    registry.anyRequest().authenticated();
    http.formLogin().loginPage(BackendConstants.USER_PUBLIC_URL).permitAll(); //
    http.logout().logoutRequestMatcher(new AntPathRequestMatcher(BackendConstants.LOGOUT_ENDPOINT)).invalidateHttpSession(true)
    .logoutSuccessUrl(BackendConstants.USER_PUBLIC_URL).permitAll(); //

    http.exceptionHandling().accessDeniedHandler(customAccessDeniedHandler())
    .authenticationEntryPoint(new CustomLoginUrlAuthenticationEntryPoint());
    return http.build();
  }

Any ideas????

Update 2022-12-23

It is related with the header token being lost.
I'm setting it up with Javascript and the server doesnt get it.
When I use postman and I sent the header manually, the servlet works as expected...


问:
Conditional JS and CSS files not being loaded on Wordpress pages
We have a Wordpress site that was built for us by consultants and everything was working fine until recently.  We're seeing this page missing both CSS (posts.css) and JS (slick.js) file includes for some reason.

Page in question: https://kmbs.konicaminolta.us/blog/

As you can see, it has some issues.  The page looked correct back in July 2022, as per the wayback machine archive:  https://web.archive.org/web/20220717052205/https://kmbs.konicaminolta.us/blog/

posts.css and slick.js are included on that page from July.  The PHP logic is supposed to check if the page needs those files and automatically place them there:

```<code>fx_assets_add_script(
        [
            'handle'        => 'fx_slick',
            'src'           => $theme_url . '/assets/js/plugins/slick.js',
            'dependencies'  => [ 'jquery', 'fx_choices' ],
            'enqueue'       => is_archive() || is_home() || is_page('promotions') || is_page('press-releases') || is_page('news-insights') || is_page('newsroom')
        ]
    );
</code>```

and

```<code>fx_assets_add_stylesheet(
        [
            'handle'    => 'site-posts',
            'src'       => $theme_url . '/assets/css/posts.css',
            'enqueue'   => ( is_single() || is_page('promotions') || is_home() || is_archive() || is_search() || is_author() || is_page('newsroom') || is_page('press-releases') || is_page('news-insights') || is_page('security-announcements') )
        ]
    );
</code>```

Not sure if the above need: is_page('blog') in the 'enqueue' line, but I tried that and it didn't seem to fix the issue (I cleared WP Rocket cache and CDN cache).  Or do I need to restart the server for that change to take effect?  Of course it could be any number of other things - maybe - such as recent plugin updates, etc.

Any thoughts or suggestions on how to resolve this issue?  (Besides going back to the consultants that built the thing.)  We could add the missing code to a file that does get pulled onto every page, but that defeats the purpose of the conditional / dynamic loading, of course.

As you may have guessed, this is not the only page that's impacted.  If we can find the solution to this though, it may be the solution to the other page issues as well.

Thanks.

Body:
We have a Wordpress site that was built for us by consultants and everything was working fine until recently.  We're seeing this page missing both CSS (posts.css) and JS (slick.js) file includes for some reason.

Page in question: https://kmbs.konicaminolta.us/blog/

As you can see, it has some issues.  The page looked correct back in July 2022, as per the wayback machine archive:  https://web.archive.org/web/20220717052205/https://kmbs.konicaminolta.us/blog/

posts.css and slick.js are included on that page from July.  The PHP logic is supposed to check if the page needs those files and automatically place them there:

fx_assets_add_script(
        [
            'handle'        => 'fx_slick',
            'src'           => $theme_url . '/assets/js/plugins/slick.js',
            'dependencies'  => [ 'jquery', 'fx_choices' ],
            'enqueue'       => is_archive() || is_home() || is_page('promotions') || is_page('press-releases') || is_page('news-insights') || is_page('newsroom')
        ]
    );

and

fx_assets_add_stylesheet(
        [
            'handle'    => 'site-posts',
            'src'       => $theme_url . '/assets/css/posts.css',
            'enqueue'   => ( is_single() || is_page('promotions') || is_home() || is_archive() || is_search() || is_author() || is_page('newsroom') || is_page('press-releases') || is_page('news-insights') || is_page('security-announcements') )
        ]
    );

Not sure if the above need: is_page('blog') in the 'enqueue' line, but I tried that and it didn't seem to fix the issue (I cleared WP Rocket cache and CDN cache).  Or do I need to restart the server for that change to take effect?  Of course it could be any number of other things - maybe - such as recent plugin updates, etc.

Any thoughts or suggestions on how to resolve this issue?  (Besides going back to the consultants that built the thing.)  We could add the missing code to a file that does get pulled onto every page, but that defeats the purpose of the conditional / dynamic loading, of course.

As you may have guessed, this is not the only page that's impacted.  If we can find the solution to this though, it may be the solution to the other page issues as well.

Thanks.


问:
AppFrameworkInfo.plist gets copied twice while building my Flutter app for iOS
Before building, it lives in ios/Flutter. When building, it gets copied to Runner.App/AppFrameworkInfo.plist, which seems expected, and to Runner.App/Frameworks/AppFrameworkInfo.plist. The second copy then prohibits me publishing to App Store as it gives this error:

Invalid Swift Support. The file Runner.app/Frameworks/AppFrameworkInfo.plist doesn't have the correct file type for this location. Ensure you're using the correct file, rebuild your app using the current public (GM)

It seems to be the same error as here: https://developer.apple.com/forums/thread/669948, but this solution does not work for me -- I cannot remove the extra .plist from the built archive.


问:
How to navigate to all invocation of Kotlin invoke() function/operator in IntelliJ IDEA?
I have a class that implements a function:

```<code>interface Foo : (Int) -> String

class FooImpl: Foo {
   override fun invoke(int: Int) String = TODO()
}
</code>```

Usage:

```<code>val foo : Foo = FooImpl()
foo() // <-- from here to FooImpl.invoke()?
</code>```

How to find all usages of this special function invocation in IntelliJ?

Body:
I have a class that implements a function:

interface Foo : (Int) -> String

class FooImpl: Foo {
   override fun invoke(int: Int) String = TODO()
}

Usage:

val foo : Foo = FooImpl()
foo() // <-- from here to FooImpl.invoke()?

How to find all usages of this special function invocation in IntelliJ?


问:
get a list of apps who use accessibility service
I'm working on an old android device that has a hidden accessibility service that closes 3rd party apps, so I went to uninstall this app but I don't know which app it is

so How can I get a list of all packages that request accessibility permission in the manifest
using ADB shell


问:
How to manage a json file when appending new data
i) I have a class User
let's say I got the objects now and I put them in a dictionary and appended them in a json file just like how this code explains

```<code>import json

dic = {
    'name': User.Name,
    'level': User.Level,
    "id": User.ID
}

with open('UserList.json', 'a') as fp:
    json.dump(dic, fp, indent=2)
</code>```

ii) the json file will list the data like this:

```<code>{
  "name": "Moustafa",
  "level": "normal_user",
  "id": "1"
}
</code>```

iii) The problem is when there is another data the json file looks like this:

```<code>{
  "name": "Moustafa",
  "level": "normal_user",
  "id": "1"
}{
  "name": "Moustafa",
  "level": "normal_user",
  "id": "1"
}
</code>```

iv) The braces "{" are overlapping.
I want the json file to look like this:

```<code>[
 {
   "name": "Moustafa",
   "level": "normal_user",
   "id": "1"
 },
 {
  "name": "Moustafa",
  "level": "normal_user",
  "id": "1"
 }
</code>```

v) THE BIG QUESTION IS: is the iii) version of the json file format usable if want to convert the data back to a class object again or do I have to turned it into the iv) version

Body:
i) I have a class User
let's say I got the objects now and I put them in a dictionary and appended them in a json file just like how this code explains

import json

dic = {
    'name': User.Name,
    'level': User.Level,
    "id": User.ID
}

with open('UserList.json', 'a') as fp:
    json.dump(dic, fp, indent=2)

ii) the json file will list the data like this:

{
  "name": "Moustafa",
  "level": "normal_user",
  "id": "1"
}

iii) The problem is when there is another data the json file looks like this:

{
  "name": "Moustafa",
  "level": "normal_user",
  "id": "1"
}{
  "name": "Moustafa",
  "level": "normal_user",
  "id": "1"
}

iv) The braces "{" are overlapping.
I want the json file to look like this:

[
 {
   "name": "Moustafa",
   "level": "normal_user",
   "id": "1"
 },
 {
  "name": "Moustafa",
  "level": "normal_user",
  "id": "1"
 }

v) THE BIG QUESTION IS: is the iii) version of the json file format usable if want to convert the data back to a class object again or do I have to turned it into the iv) version


问:
How to interact with Windows app(Host) using Linux Container?
As I mentioned in the title, I want to start cmd.exe using params (on the host) or a bat file (on the host) or any application, using the Linux container shell. Is this possible without a network connection?

I tried to mount C:\ in to Linux container and i tried to run cmd.exe with start /c params but it did not work.


问:
pandas nested dict to flat dataframe
I have a dict:

```<code>d = {12 : [8,2,3,4]
     15 : [6,1,9,2]}
</code>```

I want to transform it to a flat dataframe:

```<code>df = val  0 1 2 3
     12   8 2 3 4
     15   6 1 9 2
</code>```

How can I do this?

Title: pandas nested dict to flat dataframe

Body:
I have a dict:

d = {12 : [8,2,3,4]
     15 : [6,1,9,2]}

I want to transform it to a flat dataframe:

df = val  0 1 2 3
     12   8 2 3 4
     15   6 1 9 2

How can I do this?


问:
How do I upload .git folder to Github repo
I'm using tool called git-filter-repo (https://github.com/newren/git-filter-repo) to rewrite my git history and remove some large binaries in the .pack file and reduce the overall repo size.
This makes changes to the local repo, and disconnects a clone from a Github repo.

Now I need to upload the changes in the folder .git to Github. Since it's not content and do not appear as uncommitted changes, 1. How can I upload the changes? The instructions page doesn't describe that scenario.

Several instructions on using Github often describe uploading folders or content. 2. Does this apply to the .git folder?


问:
Google Service Account (SA) key for Cloud Storage files too long
I am trying to authenticate with Google Service Account (SA) key that I got from the Google cloud console. It does not contain any spaces.

In  my .env I have

```<code>GOOGLE_APPLICATION_CREDENTIALS='{"type":"service_account","project_id":"xyz"...}'
</code>```

Then the code is

```<code>func GetSignedURL(w io.Writer) error {
    customEndpoint := "https://storage.googleapis.com/upload/storage/v1/b/bucket-name/o"
    ctx := context.Background()
    fmt.Println(len(os.Getenv("GOOGLE_APPLICATION_CREDENTIALS")))//<--2303

    client, err := storage.NewClient(ctx, option.WithEndpoint(customEndpoint))
    if err != nil {
        panic(err.Error())//<--file name too long
    }
    defer client.Close()

    fmt.Fprintf(w, "The request endpoint set for the client is: %v\n", customEndpoint)
    return nil
}
</code>```

The gcloud I'm using is:

```<code>$ gcloud --version
Google Cloud SDK 412.0.0
alpha 2022.12.09
beta 2022.12.09
bq 2.0.83
bundled-python3-unix 3.9.12
core 2022.12.09
gcloud-crc32c 1.0.0
gsutil 5.17
minikube 1.28.0
skaffold 2.0.3
</code>```

I get the error dialing: google: error getting credentials using GOOGLE_APPLICATION_CREDENTIALS environment variable: open {"type": "service_account","project_id":"xyz"...}: file name too long

Any idea of what might be wrong?

Body:
I am trying to authenticate with Google Service Account (SA) key that I got from the Google cloud console. It does not contain any spaces.

In  my .env I have

GOOGLE_APPLICATION_CREDENTIALS='{"type":"service_account","project_id":"xyz"...}'

Then the code is

func GetSignedURL(w io.Writer) error {
    customEndpoint := "https://storage.googleapis.com/upload/storage/v1/b/bucket-name/o"
    ctx := context.Background()
    fmt.Println(len(os.Getenv("GOOGLE_APPLICATION_CREDENTIALS")))//<--2303

    client, err := storage.NewClient(ctx, option.WithEndpoint(customEndpoint))
    if err != nil {
        panic(err.Error())//<--file name too long
    }
    defer client.Close()

    fmt.Fprintf(w, "The request endpoint set for the client is: %v\n", customEndpoint)
    return nil
}

The gcloud I'm using is:

$ gcloud --version
Google Cloud SDK 412.0.0
alpha 2022.12.09
beta 2022.12.09
bq 2.0.83
bundled-python3-unix 3.9.12
core 2022.12.09
gcloud-crc32c 1.0.0
gsutil 5.17
minikube 1.28.0
skaffold 2.0.3

I get the error dialing: google: error getting credentials using GOOGLE_APPLICATION_CREDENTIALS environment variable: open {"type": "service_account","project_id":"xyz"...}: file name too long

Any idea of what might be wrong?


问:
pulumi python set Public Network Access to Disabled for KeyVaults and Container Registry
Trying to set "Public Network Access" to "Disabled" for both keyvault and container registry.

I was able to set it for AppService, CosmosDB etc, but I couldn't find the way to set it for both the service I mention above.

Check the azure portal console and I can see the option there.

Here is a snippet for how I set up the container registry

```<code>
from pulumi.config import Config
from pulumi_azure_native import containerregistry
from resources.resource_group import resourceGroup

# Create Azrure container registry
mainParams = Config().require_object("main-params")

containerRegistry = containerregistry.Registry(
    f"ACRFakename{mainParams['environment']}",
    resource_group_name=resourceGroup.name,
    sku=containerregistry.SkuArgs(name="Premium"),
    admin_user_enabled=True,
)

</code>```

Here is how I set it on Cosmos

```<code>
cosmosdb_account = documentdb.DatabaseAccount(
    "testaccount",
    resource_group_name=resourceGroup.name,
    database_account_offer_type=documentdb.DatabaseAccountOfferType.STANDARD,
    kind=documentdb.DatabaseAccountKind.MONGO_DB,
    locations=[
        documentdb.LocationArgs(
            location_name=resourceGroup.location,
            failover_priority=0,
        )
    ],
    backup_policy=documentdb.ContinuousModeBackupPolicyArgs(type="Continous"),
    consistency_policy=documentdb.ConsistencyPolicyArgs(
        default_consistency_level=documentdb.DefaultConsistencyLevel.SESSION,
    ),
   ** public_network_access="Disabled",**
)
</code>```

Is there another way to set this public network access property ? any help will be appreciated:)

I've try setting the access_policies etc, but it wont change the public network access setting.

I've tried do that on the portal console and it work, but my goal is do that in the IaC so I can avoid manually configuring this when deploying to different environment.

Body:
Trying to set "Public Network Access" to "Disabled" for both keyvault and container registry.

I was able to set it for AppService, CosmosDB etc, but I couldn't find the way to set it for both the service I mention above.

Check the azure portal console and I can see the option there.

Here is a snippet for how I set up the container registry

from pulumi.config import Config
from pulumi_azure_native import containerregistry
from resources.resource_group import resourceGroup

# Create Azrure container registry
mainParams = Config().require_object("main-params")

containerRegistry = containerregistry.Registry(
    f"ACRFakename{mainParams['environment']}",
    resource_group_name=resourceGroup.name,
    sku=containerregistry.SkuArgs(name="Premium"),
    admin_user_enabled=True,
)

Here is how I set it on Cosmos

cosmosdb_account = documentdb.DatabaseAccount(
    "testaccount",
    resource_group_name=resourceGroup.name,
    database_account_offer_type=documentdb.DatabaseAccountOfferType.STANDARD,
    kind=documentdb.DatabaseAccountKind.MONGO_DB,
    locations=[
        documentdb.LocationArgs(
            location_name=resourceGroup.location,
            failover_priority=0,
        )
    ],
    backup_policy=documentdb.ContinuousModeBackupPolicyArgs(type="Continous"),
    consistency_policy=documentdb.ConsistencyPolicyArgs(
        default_consistency_level=documentdb.DefaultConsistencyLevel.SESSION,
    ),
   ** public_network_access="Disabled",**
)

Is there another way to set this public network access property ? any help will be appreciated:)

I've try setting the access_policies etc, but it wont change the public network access setting.

I've tried do that on the portal console and it work, but my goal is do that in the IaC so I can avoid manually configuring this when deploying to different environment.


问:
I am trying to make this table re-sortable using the beautiful DnD library in React
I have a table that is being populated by data from a separate file. I am trying to use the React DnD library to give my table the ability to be sorted by clicking and dragging the individual row.

Here is some of the relevant code.

Function that renders the Row

```<code>const WaitingRow = (props) => {

    const dragref = useRef(null);
    const dropref = useRef(null);

    const [{ handlerId }, drop] = useDrop({
        accept: ItemTypes.ROW,
        collect(monitor) {
            return {
                handlerId: monitor.getHandlerId(),
            }
        },
        hover(item, monitor) {
            console.log(item.index, props.index)
            if (!dropref.current) {
              return
            }
            console.log(item.index, props.index);
            const dragIndex = item.index
            const hoverIndex = props.index
            if (dragIndex === hoverIndex) {
              return
            }
            const hoverBoundingRect = dropref.current?.getBoundingClientRect()
            const hoverMiddleY =
              (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2
            const clientOffset = monitor.getClientOffset()
            const hoverClientY = clientOffset.y - hoverBoundingRect.top
            if (dragIndex < hoverIndex && hoverClientY < hoverMiddleY) {
              return
            }
            if (dragIndex > hoverIndex && hoverClientY > hoverMiddleY) {
              return
            }
            // Time to actually perform the action
            props.moveCard(dragIndex, hoverIndex)
            item.index = hoverIndex
          },
      })

    const [{ isDragging }, drag, preview] = useDrag(
        () => ({
          type: ItemTypes.ROW,
          collect: (monitor) => ({
            isDragging: monitor.isDragging(),
          }),
        }),
        [],
    )
    drop(dropref)
    drag(dragref)
    //drag(drop(ref))
    return (
        <>
        <DragPreviewImage connect={preview} />
        <tr
            key={props.someState.id}
            ref={dropref}
            style={{
                ...RowStyle,
                opacity: isDragging ? 0 : 1,
            }}
            data-handler-id={handlerId}
        >
            <td ref={dragref} id={props.someState.id}><Input type="checkbox"/></td>
            <td>{props.someState.fName} {props.someState.lName}</td>
            <td>{props.someState.type}</td>
            <td>{props.someState.group}</td>
            <td>{props.someState.phone}</td>
            <td>Drag Me</td>
        </tr>
        </>
    );
}

export default WaitingRow;
</code>```

Here is the MainList that renders the table and the rows

```<code>const MainList = (props) => {
    const mainList = props.someState.filter(item => {
        return item.status != 'ondeck';
    });

    const moveRow = (dragIndex, hoverIndex) => {
        const dragRecord = props.someState[dragIndex]
        props.setWaitList(
          update(props.someState, {
            $splice: [
              [dragIndex, 1],
              [hoverIndex, 0, dragRecord],
            ],
          })
        )
    }

    return (
        <Container>
            <h3>In Line</h3>
            <Row>
                <Col>
                <Table size="sm">
                    <thead>
                        <tr>
                            <th width="10%"></th>
                            <th width="20%"></th>
                            <th width="20%"></th>
                            <th width="20%"></th>
                            <th width="20%"></th>
                            <th width="10%"></th>
                        </tr>
                    </thead>
                    <tbody id="MainTableBody" >
                        {mainList.map((person, index) => <WaitingRow key={person.id} id={person.id} index={index} someState={person} moveRow={moveRow}/>)}
                    </tbody>
                </Table>
                </Col>
            </Row>
        </Container>
    );
}

export default MainList;
</code>```

And finally the home function that renders the whole thing

```<code>function Home() {

    const [waitList, setWaitList] = useState(WAITLIST);

    const addToWaitList = (item) => {
        setWaitList([...waitList, item]);
    }

    const removeFromList = (ind) => {
        setWaitList(waitList.filter((item) => item.id !== ind));
    }

    const updateStatusToOnDeck = (ind) => {
        setWaitList(waitList.map((item) => {
            if (item.id === ind) {
              return { ...item, status: "ondeck" };
            }
            return item;
        }));
    }

    return (
        <DndProvider backend={HTML5Backend}>
            <div>
                <Container>
                    <Header addToWaitList={addToWaitList} addNext={updateStatusToOnDeck} waitList={waitList}/>
                    <OnDeck someState={waitList} removeFromList={removeFromList} />
                    <MainList someState={waitList} setWaitList={setWaitList}/>
                </Container>
            </div>
        </DndProvider>
    );
}

export default Home;
</code>```

I tried to remove all the unnecessary code thats not relevant to this problem.

I can get the Row to drag and move around the screen. The spot that the row is coming from goes blank (as desired) and if i let go of the row it goes back to where it was.

It does not register when the row is hovering over a different row. I want it to detect it when the row is hovering above it, and automatically reorder to put the blank placeholder for the row being dragged into its new spot.

When I place the drag reference in the 'tr' on the WaitingRow component, I can get it to drag. But when I move the drag reference to a 'td' so that I can have the 'tr' be the drop reference, it will work until I start to move the row. I get errors saying that properties reading undefined when trying to re-render the rows.

Let me know if there is anything else I can add to make this more helpful. I have been trying to get this for days and I know I am just missing something. Thanks in advance for any help.

I've tried moving the drag and drop references around, and formatting the drag and drop states differently.

Body:
I have a table that is being populated by data from a separate file. I am trying to use the React DnD library to give my table the ability to be sorted by clicking and dragging the individual row.

Here is some of the relevant code.

Function that renders the Row

const WaitingRow = (props) => {

    const dragref = useRef(null);
    const dropref = useRef(null);

    const [{ handlerId }, drop] = useDrop({
        accept: ItemTypes.ROW,
        collect(monitor) {
            return {
                handlerId: monitor.getHandlerId(),
            }
        },
        hover(item, monitor) {
            console.log(item.index, props.index)
            if (!dropref.current) {
              return
            }
            console.log(item.index, props.index);
            const dragIndex = item.index
            const hoverIndex = props.index
            if (dragIndex === hoverIndex) {
              return
            }
            const hoverBoundingRect = dropref.current?.getBoundingClientRect()
            const hoverMiddleY =
              (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2
            const clientOffset = monitor.getClientOffset()
            const hoverClientY = clientOffset.y - hoverBoundingRect.top
            if (dragIndex < hoverIndex && hoverClientY < hoverMiddleY) {
              return
            }
            if (dragIndex > hoverIndex && hoverClientY > hoverMiddleY) {
              return
            }
            // Time to actually perform the action
            props.moveCard(dragIndex, hoverIndex)
            item.index = hoverIndex
          },
      })

    const [{ isDragging }, drag, preview] = useDrag(
        () => ({
          type: ItemTypes.ROW,
          collect: (monitor) => ({
            isDragging: monitor.isDragging(),
          }),
        }),
        [],
    )
    drop(dropref)
    drag(dragref)
    //drag(drop(ref))
    return (
        <>
        <DragPreviewImage connect={preview} />

            <Input type="checkbox"/>
            {props.someState.fName} {props.someState.lName}
            {props.someState.type}
            {props.someState.group}
            {props.someState.phone}
            Drag Me

        </>
    );
}

export default WaitingRow;

Here is the MainList that renders the table and the rows

const MainList = (props) => {
    const mainList = props.someState.filter(item => {
        return item.status != 'ondeck';
    });

    const moveRow = (dragIndex, hoverIndex) => {
        const dragRecord = props.someState[dragIndex]
        props.setWaitList(
          update(props.someState, {
            $splice: [
              [dragIndex, 1],
              [hoverIndex, 0, dragRecord],
            ],
          })
        )
    }

    return (
        <Container>

In Line

            <Row>
                <Col>

                        {mainList.map((person, index) => <WaitingRow key={person.id} id={person.id} index={index} someState={person} moveRow={moveRow}/>)}

                </Col>
            </Row>
        </Container>
    );
}

export default MainList;

And finally the home function that renders the whole thing

function Home() {

    const [waitList, setWaitList] = useState(WAITLIST);

    const addToWaitList = (item) => {
        setWaitList([...waitList, item]);
    }

    const removeFromList = (ind) => {
        setWaitList(waitList.filter((item) => item.id !== ind));
    }

    const updateStatusToOnDeck = (ind) => {
        setWaitList(waitList.map((item) => {
            if (item.id === ind) {
              return { ...item, status: "ondeck" };
            }
            return item;
        }));
    }

    return (
        <DndProvider backend={HTML5Backend}>

                <Container>

                    <OnDeck someState={waitList} removeFromList={removeFromList} />
                    <MainList someState={waitList} setWaitList={setWaitList}/>
                </Container>

        </DndProvider>
    );
}

export default Home;

I tried to remove all the unnecessary code thats not relevant to this problem.

I can get the Row to drag and move around the screen. The spot that the row is coming from goes blank (as desired) and if i let go of the row it goes back to where it was.

It does not register when the row is hovering over a different row. I want it to detect it when the row is hovering above it, and automatically reorder to put the blank placeholder for the row being dragged into its new spot.

When I place the drag reference in the 'tr' on the WaitingRow component, I can get it to drag. But when I move the drag reference to a 'td' so that I can have the 'tr' be the drop reference, it will work until I start to move the row. I get errors saying that properties reading undefined when trying to re-render the rows.

Let me know if there is anything else I can add to make this more helpful. I have been trying to get this for days and I know I am just missing something. Thanks in advance for any help.

I've tried moving the drag and drop references around, and formatting the drag and drop states differently.


问:
ANN for object identification: how to prepare input data for learning (signals with varying length) and what structure to use?
I am trying to artificial neural network as an instrument to identify some specific "peaks" in noised signals and get their coordinates.
I want to use keras for that purpose.

But I don't get how to prepare data for learning, can you suggest some example similar to my task or provide a link for the material?

Currently I have signals that are presented as csv files y_i(x_i) where i stand for the number of point (I am reading each file as a dataframe and converting it to numpy arrays for processing).

For each signal I have a file in csv format where I have x | y values in a row.
Let's say it's called signal1.csv

I have >500k of signals.

An example of a signal is presented on the next figure:

The green lines visualize the actual peak positions (I have separate files for each signal which stand for actual peak positions for each corresponding signal - it's manually evaluated by experts). Let's say signal1_solution.csv - each peak has it's own set of parameters, and one of them is peak position.

I want to learn ANN to find peaks in raw signals.

Supposed approach. The signal will be given to the input of a ANN (two arrays, x & y - with similar number of points inside each, I can also provide additional parameters also for ANN: like average distance between peaks or some known params for that group of signals but I don't think it's necessary from the start).

Is it relatively  large number of inputs? (20000 floats) Maybe it's too much for that purpose and what can be done in this case?

After processing the signal by ANN it must return an array of calculated positions of peaks - and here I don't know the number of outputs, e.g. one signal will have 10 peaks - so the ANN must return 10 floats, and the other will have 110 peaks - so the ANN must return 110 floats. I can probably predict the maximum number of peaks in output just by calculating statistically (e.g. in the current data available for learning it is 170) and it really depends on the range of x of a signal - the wider the range - the larger number of peaks.

Each Signal consists of varying number of points, some can have 100 or 1000 points, 45% has more than 6000 points - up to 100000 points, the grid is nonuniform, so x[i]-x[i-1]<>x[i+1]-x[i].

At the same time each signal has varying number of peaks one signal has 50 peaks, another only 10 peaks - it depends on a distance between separate peaks expressed in x-coordinates.

There are complexed set of rules that are used by experts to estimate positions of peaks. One of them is the use of known statistical distributions of peaks parameters on the observable interval of X (e.g. distance between neighboring peaks). I suppose this information can be extracted during the learning process.

Maybe you can suggest how to prepare the data for learning in this case or label existing?

I had an idea just to label point by point (for each point of a signal I will mark if it belongs to the peak or not). But it's a problem because of the grid (the solution contain coordinate of a peak between some points of a signal and it can be on a relatively large distance to the nearest point in the signal).

UPDATE 1:
As I said - all signals are stored as separate csv-s in  folder.

An example of of one signal is shown in the first figure, here is the corresponding dataframe:

```<code>one_example_signal = pd.read_csv(f, index_col=0)

             E  exp_trans   exp_trans_unc   marked_points
index
4883    20.005036   0.710289    0.057905    0
4882    20.012073   0.780100    0.060669    0
4881    20.019113   0.808801    0.063798    0
4880    20.026157   0.676023    0.053775    0
4879    20.033205   1.006920    0.072483    0
</code>```

The informative columns are: E - it's actually x-coordinate on the plot, exp_trans - it's an y coordinate on the plot and the marked_points - it's a predefined 'point class'. I need to explain the point class column for better understanding.
Full csv can be found here: https://drive.google.com/file/d/11sHeDj6DiKWgQ4cj56Ts4OPChPdAfYA-/view?usp=sharing

I have built a simple labeler that assigns a class to each point of the signal - e.g. points of clearly defined peaks have class 1, points nearest to the real peak left have class 2, points nearest from the right side has class 3.. Points that don't belong to the peak has class 0. They all are marked on the figure with various colors. Vertical lines help to understand where the real peaks are.

For the signal on the fig. statistics is as follows (we have 4884 pairs of points for that specific signal).

```<code>0    4779
2      38
3      37
1      30
</code>```

So 4779 points are labeled as "not peaks", 38 points are labeled as "left boundaries", "right boundaries" - 37, and the closest to the real peaks - 30 points labeled (it's done using predefined model).

The idea was to feed ANN with the signal array: E - 4884 values corresponding to the E-coordinate and 4884 values of exp_trans (9768 points total).
The ANN outputs 4884 values that classifies each point of the input signal - it's a peak or not. If that makes sense :)

Body:
I am trying to artificial neural network as an instrument to identify some specific "peaks" in noised signals and get their coordinates.
I want to use keras for that purpose.

But I don't get how to prepare data for learning, can you suggest some example similar to my task or provide a link for the material?

Currently I have signals that are presented as csv files y_i(x_i) where i stand for the number of point (I am reading each file as a dataframe and converting it to numpy arrays for processing).

For each signal I have a file in csv format where I have x | y values in a row.
Let's say it's called signal1.csv

I have >500k of signals.

An example of a signal is presented on the next figure:

The green lines visualize the actual peak positions (I have separate files for each signal which stand for actual peak positions for each corresponding signal - it's manually evaluated by experts). Let's say signal1_solution.csv - each peak has it's own set of parameters, and one of them is peak position.

I want to learn ANN to find peaks in raw signals.

Supposed approach. The signal will be given to the input of a ANN (two arrays, x & y - with similar number of points inside each, I can also provide additional parameters also for ANN: like average distance between peaks or some known params for that group of signals but I don't think it's necessary from the start).

Is it relatively  large number of inputs? (20000 floats) Maybe it's too much for that purpose and what can be done in this case?

After processing the signal by ANN it must return an array of calculated positions of peaks - and here I don't know the number of outputs, e.g. one signal will have 10 peaks - so the ANN must return 10 floats, and the other will have 110 peaks - so the ANN must return 110 floats. I can probably predict the maximum number of peaks in output just by calculating statistically (e.g. in the current data available for learning it is 170) and it really depends on the range of x of a signal - the wider the range - the larger number of peaks.

Each Signal consists of varying number of points, some can have 100 or 1000 points, 45% has more than 6000 points - up to 100000 points, the grid is nonuniform, so x[i]-x[i-1]<>x[i+1]-x[i].

At the same time each signal has varying number of peaks one signal has 50 peaks, another only 10 peaks - it depends on a distance between separate peaks expressed in x-coordinates.

There are complexed set of rules that are used by experts to estimate positions of peaks. One of them is the use of known statistical distributions of peaks parameters on the observable interval of X (e.g. distance between neighboring peaks). I suppose this information can be extracted during the learning process.

Maybe you can suggest how to prepare the data for learning in this case or label existing?

I had an idea just to label point by point (for each point of a signal I will mark if it belongs to the peak or not). But it's a problem because of the grid (the solution contain coordinate of a peak between some points of a signal and it can be on a relatively large distance to the nearest point in the signal).

UPDATE 1:
As I said - all signals are stored as separate csv-s in  folder.

An example of of one signal is shown in the first figure, here is the corresponding dataframe:

one_example_signal = pd.read_csv(f, index_col=0)

             E  exp_trans   exp_trans_unc   marked_points
index
4883    20.005036   0.710289    0.057905    0
4882    20.012073   0.780100    0.060669    0
4881    20.019113   0.808801    0.063798    0
4880    20.026157   0.676023    0.053775    0
4879    20.033205   1.006920    0.072483    0

The informative columns are: E - it's actually x-coordinate on the plot, exp_trans - it's an y coordinate on the plot and the marked_points - it's a predefined 'point class'. I need to explain the point class column for better understanding.
Full csv can be found here: https://drive.google.com/file/d/11sHeDj6DiKWgQ4cj56Ts4OPChPdAfYA-/view?usp=sharing

I have built a simple labeler that assigns a class to each point of the signal - e.g. points of clearly defined peaks have class 1, points nearest to the real peak left have class 2, points nearest from the right side has class 3.. Points that don't belong to the peak has class 0. They all are marked on the figure with various colors. Vertical lines help to understand where the real peaks are.

For the signal on the fig. statistics is as follows (we have 4884 pairs of points for that specific signal).

0    4779
2      38
3      37
1      30

So 4779 points are labeled as "not peaks", 38 points are labeled as "left boundaries", "right boundaries" - 37, and the closest to the real peaks - 30 points labeled (it's done using predefined model).

The idea was to feed ANN with the signal array: E - 4884 values corresponding to the E-coordinate and 4884 values of exp_trans (9768 points total).
The ANN outputs 4884 values that classifies each point of the input signal - it's a peak or not. If that makes sense :)


问:
Stuck on Pagination with Timber
I'm working with a client on building a site that has chapters with their own distinct news. Each chapter needs a page that queries the overall site's posts with ones tagged for their chapter. I have the query rendering perfectly, but I cannot figure out how/where to paginate without a plugin. See below for my code.

PHP

```<code><?php
/*
Template Name: Chapter Listing
Template Post Type: chapter
*/

use Twig\Markup;

global $post;
$context = Timber::get_context();
$timber_post = Timber::get_post();

$templates = array( 'chapter-listing.twig' );

// Get Pagination State
global $paged;
if (!isset($paged) || !$paged)
    $paged = 1;
$context['paged'] = $paged;

//Retrieve Taxonomy ID of current page
$context['latest'] = get_field('latest_news'); //Taxonomy field in ACF
$context['get_taxonomy_name_by_id']   = get_taxonomy_name_by_id($context['latest']);

//Get Chapter's News using the Taxonomy Query from above
$context['chapter'] = new Timber\PostQuery([
    'post_type' => ['post'],
    'posts_per_page' => 5,
    'tax_query' => array(
        array(
            'taxonomy' => $context['get_taxonomy_name_by_id']->taxonomy,
            'terms' => $context['get_taxonomy_name_by_id']->term_id,
            'field' => 'term_id',
        )
        ),
    'facetwp' => true
]);

//Add keys for metadata that match the component names
foreach ($context['chapter'] as $key => $chapter) {
    $context['chapter'][$key]->heading = get_the_title($chapter->ID);
    $context['chapter'][$key]->desc = get_the_excerpt($chapter->ID);
    $context['chapter'][$key]->imageurl = get_the_post_thumbnail_url($chapter->ID,'full');
    $context['chapter'][$key]->linkurl = get_the_permalink($chapter->ID);
}

Timber::render( $templates, $context );
</code>```

TWIG

```<code>
    {% for card in chapter %}
        {% include 'partial/horizontal-card.twig' %}
    {% endfor %}

    <div class="tool-pagination">
      {% if chapter.pagination.prev %}
        <a href="{{chapter.pagination.prev.link}}" class="prev {{chapter.pagination.prev.link|length ? '' : 'invisible'}}">Prev</a>
      {% endif %}
      <ul class="pages">
        {% for page in chapter.pagination.pages %}
          <li>
            {% if page.link %}
              <a href="{{page.link}}" class="{{page.class}}">{{page.title}}</a>
            {% else %}
              <span class="{{page.class}}">{{page.title}}</span>
            {% endif %}
          </li>
        {% endfor %}
      </ul>
      {% if chapter.pagination.next %}
        <a href="{{chapter.pagination.next.link}}" class="next {{chapter.pagination.next.link|length ? '' : 'invisible'}}">Next</a>
      {% endif %}
    </div>
</code>```

The above pagination snippet within the Twig file is from the default Timber docs and it seemingly works displaying "1 2 next" but next and 2 do not actually load a new page. The hyperlinks for the pagination correctly append "/page/2" to the URL but they just don't go anywhere, clicking them makes the page reload and the page number is not appended to the URL (it doesn't lead to a 404).

Note that I would use an archive/search template but because it's required for the user to select which chapter to display news from, I can't. The page also has to inherit the chapter's sidebar which means it has to be a child to that parent.

Title: Stuck on Pagination with Timber

Body:
I'm working with a client on building a site that has chapters with their own distinct news. Each chapter needs a page that queries the overall site's posts with ones tagged for their chapter. I have the query rendering perfectly, but I cannot figure out how/where to paginate without a plugin. See below for my code.

PHP

<?php
/*
Template Name: Chapter Listing
Template Post Type: chapter
*/

use Twig\Markup;

global $post;
$context = Timber::get_context();
$timber_post = Timber::get_post();

$templates = array( 'chapter-listing.twig' );

// Get Pagination State
global $paged;
if (!isset($paged) || !$paged)
    $paged = 1;
$context['paged'] = $paged;

//Retrieve Taxonomy ID of current page
$context['latest'] = get_field('latest_news'); //Taxonomy field in ACF
$context['get_taxonomy_name_by_id']   = get_taxonomy_name_by_id($context['latest']);

//Get Chapter's News using the Taxonomy Query from above
$context['chapter'] = new Timber\PostQuery([
    'post_type' => ['post'],
    'posts_per_page' => 5,
    'tax_query' => array(
        array(
            'taxonomy' => $context['get_taxonomy_name_by_id']->taxonomy,
            'terms' => $context['get_taxonomy_name_by_id']->term_id,
            'field' => 'term_id',
        )
        ),
    'facetwp' => true
]);

//Add keys for metadata that match the component names
foreach ($context['chapter'] as $key => $chapter) {
    $context['chapter'][$key]->heading = get_the_title($chapter->ID);
    $context['chapter'][$key]->desc = get_the_excerpt($chapter->ID);
    $context['chapter'][$key]->imageurl = get_the_post_thumbnail_url($chapter->ID,'full');
    $context['chapter'][$key]->linkurl = get_the_permalink($chapter->ID);
}

Timber::render( $templates, $context );

TWIG

    {% for card in chapter %}
        {% include 'partial/horizontal-card.twig' %}
    {% endfor %}

      {% if chapter.pagination.prev %}
        Prev
      {% endif %}

        {% for page in chapter.pagination.pages %}

            {% if page.link %}
              {{page.title}}
            {% else %}
              {{page.title}}
            {% endif %}

        {% endfor %}

      {% if chapter.pagination.next %}
        Next
      {% endif %}

The above pagination snippet within the Twig file is from the default Timber docs and it seemingly works displaying "1 2 next" but next and 2 do not actually load a new page. The hyperlinks for the pagination correctly append "/page/2" to the URL but they just don't go anywhere, clicking them makes the page reload and the page number is not appended to the URL (it doesn't lead to a 404).

Note that I would use an archive/search template but because it's required for the user to select which chapter to display news from, I can't. The page also has to inherit the chapter's sidebar which means it has to be a child to that parent.


问:
compile lib's functions with another lib in C
i want to compile a lib with another. For my exemple i have a lib1 with one function func1 and i have a lib2 with one function func2 who use func1 of my lib1.
So i just ar rc my lib1

And i want to compile my lib2's function with my lib1, here is the makefile of my lib2 without clean rules

```<code>SRC =   func2.c

OBJ = $(SRC:.c=.o)

NAME    =   lib2.a

all: $(NAME)

$(OBJ): $(SRC)
    gcc -c -o $@ $< -L./../ -l:lib1.a
$(NAME):    $(OBJ)
    ar rsc $(NAME) $(OBJ) ../lib1.a
    cp $(NAME) -t ../
</code>```

In my code, it's just :

```<code>#include "lib/lib1/lib1.h"
#include "lib/lib2/lib2.h"
int main(void)
{
    func2();
    return (0);
}
</code>```

and i compile like that :
gcc -o exe -L./lib/ -l:lib1.a -L./lib/ -l:lib2.a main.c -Wall -Wextra

so i have the error :
in function func2': func2.c:(.text+0x5): undefined reference to func1'

I want to say that if i add func1(); in my main it work:

```<code>#include "lib/lib1/lib1.h"
#include "lib/lib2/lib2.h"
int main(void)
{
    func1();
    func2();
    return (0);
}
</code>```

I want to know why my first main code doesn't compile please ?
Have a nice day

Body:
i want to compile a lib with another. For my exemple i have a lib1 with one function func1 and i have a lib2 with one function func2 who use func1 of my lib1.
So i just ar rc my lib1

And i want to compile my lib2's function with my lib1, here is the makefile of my lib2 without clean rules

SRC =   func2.c

OBJ = $(SRC:.c=.o)

NAME    =   lib2.a

all: $(NAME)

$(OBJ): $(SRC)
    gcc -c -o $@ $< -L./../ -l:lib1.a
$(NAME):    $(OBJ)
    ar rsc $(NAME) $(OBJ) ../lib1.a
    cp $(NAME) -t ../

In my code, it's just :

#include "lib/lib1/lib1.h"
#include "lib/lib2/lib2.h"
int main(void)
{
    func2();
    return (0);
}

and i compile like that :
gcc -o exe -L./lib/ -l:lib1.a -L./lib/ -l:lib2.a main.c -Wall -Wextra

so i have the error :
in function func2': func2.c:(.text+0x5): undefined reference to func1'

I want to say that if i add func1(); in my main it work:

#include "lib/lib1/lib1.h"
#include "lib/lib2/lib2.h"
int main(void)
{
    func1();
    func2();
    return (0);
}

I want to know why my first main code doesn't compile please ?
Have a nice day


问:
Creating Pre-Authenticated Request in OCI
I've an object storage bucket in OCI and I'm trying to create a Pre-Authenticated Request for an object in that bucket.
It gives me an error - "Metadata must be no more than 3500 bytes when encoded as JSON in UTF-8. (MetadataTooLarge)".
I get the same error when I try to create a PAR for any bucket or object (inside bucket) in a particular compartment.

Where can I find the storage bucket metadata in OCI and how should I fix this error?


问:
Hide div with checkbox value in localstorage
In my project i have a few div's which needs to be hidden when a checkbox is checked.
For clarity: the checkbox is on page 1, the div is on page 2.
I managed to save the checkbox value to the LocalStorage, now i want to hide the div when the checkbox is checked.

HTML of the checkbox:

```<code><input type="checkbox" id="3" class="functiebox" checked>Nieuwbouw</input><br>
</code>```

JS to save the value to LocalStorage:

```<code>                function saveValue(e) {
                var id = e.id;
                var val = e.value;
                localStorage.setItem(id, val);
            }
            function getSavedValue(v) {
                if (!localStorage.getItem(v)) {
                    return "";
                }
                return localStorage.getItem(v);
            }
            let boxes = document.getElementsByClassName('functiebox').length;

            function save() {
                for (let i = 1; i <= boxes; i++) {
                    var checkbox = document.getElementById(String(i));
                    localStorage.setItem("checkbox" + String(i), checkbox.checked);
                }
            }

            //for loading
            for (let i = 1; i <= boxes; i++) {
                if (localStorage.length > 0) {
                    var checked = JSON.parse(localStorage.getItem("checkbox" + String(i)));
                    document.getElementById(String(i)).checked = checked;
                }
            }
            window.addEventListener('change', save);
</code>```

The HTML of the div i want to hide/unhide by checking the checkbox:

```<code><div id="afd_bestaand">
    div that needs to be hidden when checkbox is checked.
</div>
</code>```

I tried a lot of things but couldn't figure out what works.
I hope you can help me out!

Thanks in advance!

Body:
In my project i have a few div's which needs to be hidden when a checkbox is checked.
For clarity: the checkbox is on page 1, the div is on page 2.
I managed to save the checkbox value to the LocalStorage, now i want to hide the div when the checkbox is checked.

HTML of the checkbox:

<input type="checkbox" id="3" class="functiebox" checked>Nieuwbouw</input>

JS to save the value to LocalStorage:

                function saveValue(e) {
                var id = e.id;
                var val = e.value;
                localStorage.setItem(id, val);
            }
            function getSavedValue(v) {
                if (!localStorage.getItem(v)) {
                    return "";
                }
                return localStorage.getItem(v);
            }
            let boxes = document.getElementsByClassName('functiebox').length;

            function save() {
                for (let i = 1; i <= boxes; i++) {
                    var checkbox = document.getElementById(String(i));
                    localStorage.setItem("checkbox" + String(i), checkbox.checked);
                }
            }

            //for loading
            for (let i = 1; i <= boxes; i++) {
                if (localStorage.length > 0) {
                    var checked = JSON.parse(localStorage.getItem("checkbox" + String(i)));
                    document.getElementById(String(i)).checked = checked;
                }
            }
            window.addEventListener('change', save);

The HTML of the div i want to hide/unhide by checking the checkbox:

    div that needs to be hidden when checkbox is checked.

I tried a lot of things but couldn't figure out what works.
I hope you can help me out!

Thanks in advance!


问:
Why does inspecting a web page with selenium get "stuck" in the body?
Good morning everyone. I am scraping a web page, and it turns out that when I click on one of its buttons I get the error "Element click intercepted...is not clickable at point".
But when I go to the page I'm scraping on, and inspect it, the console opens and points directly to the body, which is why it doesn't find the clickable class. When I click on the body to make it drop down, it only allows me to click there.

image of the web on which I do the scraping


问:
Proper way to implement console menu?
Currently I have console menu with structure looking like

```<code>def main_menu():
    options = [option_one, option_two, option_three]
    options[input()]()  #0-2

def option_one():
    #do option1 stuff
    main_menu()

def option_two():
    #do option2 stuff
    main_menu()

def option_three():
    #do option3 stuff
    main_menu()
</code>```

Problem is using this approach makes debugging living hell since I get nested calls to same function with every step making stacktrace longer and longer.
Is there a better way to implement such logic without calling same function (e.g. main_menu()) over and over?

Title: Proper way to implement console menu?

Body:
Currently I have console menu with structure looking like

def main_menu():
    options = [option_one, option_two, option_three]
    options[input()]()  #0-2

def option_one():
    #do option1 stuff
    main_menu()

def option_two():
    #do option2 stuff
    main_menu()

def option_three():
    #do option3 stuff
    main_menu()

Problem is using this approach makes debugging living hell since I get nested calls to same function with every step making stacktrace longer and longer.
Is there a better way to implement such logic without calling same function (e.g. main_menu()) over and over?


问:
discord.app_commands.errors.CommandInvokeError: Command 'test' raised an exception: TypeError: 'method' object is not iterable
im trying to make a command that shows every baned member

my code:

```<code>@client.tree.command()
async def baned(ctx):
    await ctx.response.defer(ephemeral=True)
    bans = ctx.guild.bans
    embed = discord.Embed(
        title="info",
        description=f"that are the banned members at {ctx.guild.name}",
        color=discord.Color.green())

    for baned in bans:
        embed.add_field(
            name=baned.user.name,
            value=f"banned by {baned.user.discriminator.mention}",
            inline=False
        )
    await ctx.send(embed=embed,ephemeral=True)
</code>```

my eror :
discord.app_commands.errors.CommandInvokeError: Command 'test' raised an exception: TypeError: 'method' object is not iterable

Body:
im trying to make a command that shows every baned member

my code:

@client.tree.command()
async def baned(ctx):
    await ctx.response.defer(ephemeral=True)
    bans = ctx.guild.bans
    embed = discord.Embed(
        title="info",
        description=f"that are the banned members at {ctx.guild.name}",
        color=discord.Color.green())

    for baned in bans:
        embed.add_field(
            name=baned.user.name,
            value=f"banned by {baned.user.discriminator.mention}",
            inline=False
        )
    await ctx.send(embed=embed,ephemeral=True)

my eror :
discord.app_commands.errors.CommandInvokeError: Command 'test' raised an exception: TypeError: 'method' object is not iterable


问:
How properly apply composition in Test Automation using Java and POM design pattern?
Could someone please share best practices for applying the composition in UI test automation using Java

If I have multiple Pages that can open a component Modal I could probably implement fields and actions inside of each class:

```<code>class PageA {
  private static final String CHECKBOX_ON_MODAL = "//div[@id='checkbox']"

  public selectCheckBox() {
    //implementation of select method here
  }
}
</code>```
```<code>class PageB {
  private static final String CHECKBOX_ON_MODAL = "//div[@id='checkbox']";

  public selectCheckBox() {
    //implementation of select method here
  }
}
</code>```
```<code>class PageC {
  private static final String CHECKBOX_ON_MODAL = "//div[@id='checkbox']"

  public selectCheckBox() {
    //implementation of select method here
  }
}
</code>```

so now using composition I can create a class of Modal to make this component reusbale across multiple pages:

```<code>class Modal {
  private static final String CHECKBOX_ON_MODAL = "//div[@id='checkbox']";

  public selectCheckBox() {
    //implementation of select method here
  }
}
</code>```

and add it to my pages:

```<code>class PageA {
  private Modal modal;

  public PageA() {
    modal = new Modal();
  }

  public Modal getModal() {
    return modal;
  }
}

class PageB {
  private Modal modal;

  public PageB() {
    modal = new Modal();
  }

  public Modal getModal() {
    return modal;
  }
}

class PageC {
  private Modal modal;

  public PageC() {
    modal = new Modal();
  }

  public Modal getModal() {
    return modal;
  }
}
</code>```

and in my tests use like this:

```<code>public final class TestExample {

@Test
public void test1 () {
PageA pageA = new PageA();
Modal modal = pageA.getModal();

modal.selectCheckBox();
    }

@Test
public void test2 () {
PageB pageB = new PageB();
Modal modal2 = pageB.getModal();

modal2.selectCheckBox();
    }

@Test
public void test3 () {
PageC pageC= new PageC();
Modal modal3 = pageC.getModal();

modal3.selectCheckBox();
    }
}
</code>```

The problem I'm facing is that - when the behaviour/state/visibility of the checkbox i different and depends on the the page from which the modal was opened. For example on Page A the checkbox on the Modal is visible and active, on Page B the checkbox is visible but greyed out, on Page C the checkbox is not even visible etc.

How do I restrict actions to interract with the object at compile time depending on the Page I'm opening the modal?

The answers that I got already are:

Implement the actions to interract with the checkbox in the Page classes - but in this case I'm not sure I'm getting the point of composition.

Create an interface and implement it as a Modal classes for different pages - but in this case I can just create different classes for the modal without an interface, even I can just add fields and actions for the modal and its' objects to the respective Page classes

Pass some checkers as arguments to test methods - kinda makes implementation not clean.

So, I would like to hear what are your thoughs on how to solve this in simple and efficient way.

Thank you

Implement the actions to interract with the checkbox in the Page classes - but in this case I'm not sure I'm getting the point of composition.

Create an interface and implement it as a Modal classes for different pages - but in this case I can just create different classes for the modal without an interface

Pass some checkers as arguments to test methods - kinda makes implementation not clean.

Body:
Could someone please share best practices for applying the composition in UI test automation using Java

If I have multiple Pages that can open a component Modal I could probably implement fields and actions inside of each class:

class PageA {
  private static final String CHECKBOX_ON_MODAL = "//div[@id='checkbox']"

  public selectCheckBox() {
    //implementation of select method here
  }
}

class PageB {
  private static final String CHECKBOX_ON_MODAL = "//div[@id='checkbox']";

  public selectCheckBox() {
    //implementation of select method here
  }
}

class PageC {
  private static final String CHECKBOX_ON_MODAL = "//div[@id='checkbox']"

  public selectCheckBox() {
    //implementation of select method here
  }
}

so now using composition I can create a class of Modal to make this component reusbale across multiple pages:

class Modal {
  private static final String CHECKBOX_ON_MODAL = "//div[@id='checkbox']";

  public selectCheckBox() {
    //implementation of select method here
  }
}

and add it to my pages:

class PageA {
  private Modal modal;

  public PageA() {
    modal = new Modal();
  }

  public Modal getModal() {
    return modal;
  }
}

class PageB {
  private Modal modal;

  public PageB() {
    modal = new Modal();
  }

  public Modal getModal() {
    return modal;
  }
}

class PageC {
  private Modal modal;

  public PageC() {
    modal = new Modal();
  }

  public Modal getModal() {
    return modal;
  }
}

and in my tests use like this:

public final class TestExample {

@Test
public void test1 () {
PageA pageA = new PageA();
Modal modal = pageA.getModal();

modal.selectCheckBox();
    }

@Test
public void test2 () {
PageB pageB = new PageB();
Modal modal2 = pageB.getModal();

modal2.selectCheckBox();
    }

@Test
public void test3 () {
PageC pageC= new PageC();
Modal modal3 = pageC.getModal();

modal3.selectCheckBox();
    }
}

The problem I'm facing is that - when the behaviour/state/visibility of the checkbox i different and depends on the the page from which the modal was opened. For example on Page A the checkbox on the Modal is visible and active, on Page B the checkbox is visible but greyed out, on Page C the checkbox is not even visible etc.

How do I restrict actions to interract with the object at compile time depending on the Page I'm opening the modal?

The answers that I got already are:

Implement the actions to interract with the checkbox in the Page classes - but in this case I'm not sure I'm getting the point of composition.

Create an interface and implement it as a Modal classes for different pages - but in this case I can just create different classes for the modal without an interface, even I can just add fields and actions for the modal and its' objects to the respective Page classes

Pass some checkers as arguments to test methods - kinda makes implementation not clean.

So, I would like to hear what are your thoughs on how to solve this in simple and efficient way.

Thank you

Implement the actions to interract with the checkbox in the Page classes - but in this case I'm not sure I'm getting the point of composition.

Create an interface and implement it as a Modal classes for different pages - but in this case I can just create different classes for the modal without an interface

Pass some checkers as arguments to test methods - kinda makes implementation not clean.


问:
Elasticsearch runtime field has doc['field.subfield'] not returning what is expected
I would like to have a string 'Has Errors' or 'No Errors' based on a count.

To simplify the problem I just want to re-emit the nested field as a top-level field as per the screenshot.

The index has only 1 document, the document that is in the preview.

Why does it show 999 and not 0 in my discover view?

Runtime field configuration screenshot

I tried doc['result.errorCount'].value (which refers to the 0 indexed item of the list), doc['result.errorCoutn'][0], but the size is 0. Clearly it is not 0, as the field has a value, 0.

I tried on the other fields as well.