问:
Ansible - How to overcome winrm.exceptions.WinRMTransportError: Bad HTTP response returned from server. Code 400
Trying to overcome error message:

```<code>winrm.exceptions.WinRMTransportError: Bad HTTP response returned from server.
Code 400 error message was failed
</code>```

I have a laptop that run Docker with Jenkins container in it.

The Jenkins container has an Ansible service.

The Jenkins pipeline is running against VMs in a VCenter server in the organization.

All the VMs are Windows 10 or Windows Server 2016 and Up

(Should I have run it inside the Jenkins container? Or in the deployed VMs?)

My pipeline start with:

PLAY [revert vmware vcenter lab]

PLAY [copy files to lab]

The other plabooks are responsible to install the files and configure the system

The group_var > all.yml file include the following winRM details:

ansible_user: bob
ansible_password: sponge
ansible_connection: winrm
ansible_port: 5985
ansible_winrm_scheme: http
ansible_winrm_server_cert_validation: ignore
ansible_winrm_kerberos_delegation: false
ansible_winrm_transport: ntlm
ansible_winrm_read_timeout_sec: 70
ansible_winrm_operation_timeout_sec: 60
```
<p>First <em>revert</em> playbook is passed,<br /></p>
```PLAY RECAP *********************************************************************
vm1: ok=4    changed=2    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
vm2: ok=4    changed=2    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
vm3: ok=4    changed=2    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
```
<p>The <em>copy</em> playbook is failed <br /></p>
```PLAY [copy files to lab] ***************************************************

TASK [tfs : Download TFS build Server.msi"] ************************************
An exception occurred during task execution. To see the full traceback, use -vvv.
The error was: winrm.exceptions.WinRMTransportError: Bad HTTP response returned from server. Code 400
fatal: [vm1]: FAILED! => {"msg": "Unexpected failure during module execution.", "stdout": ""}
An exception occurred during task execution. To see the full traceback, use -vvv.
The error was: winrm.exceptions.WinRMTransportError: Bad HTTP response returned from server. Code 400
fatal: [vm2]: FAILED! => {"msg": "Unexpected failure during module execution.", "stdout": ""}
changed: [vm3]

TASK [tfs : Download TFS build Config.zip"] ************************************
skipping: [vm3]

TASK [tfs : Download TFS build file2.msi] *****************************
changed: [vm3]

TASK [tfs : Download TFS build file3.msi] ******************************
skipping: [vm3]

TASK [tfs : Download TFS build file1.msi] *******************
skipping: [vm3]

TASK [tfs : Unzip Config.zip file] *********************************************
skipping: [vm3]

PLAY RECAP *********************************************************************
vm3: ok=2    changed=2    unreachable=0    failed=0    skipped=4    rescued=0    ignored=0
vm1: ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
vm2: ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

FATAL: command execution failed
hudson.AbortException: Ansible playbook execution failed
    at org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:262)
    at org.jenkinsci.plugins.ansible.workflow.AnsiblePlaybookStep$AnsiblePlaybookExecution.run(AnsiblePlaybookStep.java:430)
    at org.jenkinsci.plugins.ansible.workflow.AnsiblePlaybookStep$AnsiblePlaybookExecution.run(AnsiblePlaybookStep.java:351)
    at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
    at hudson.security.ACL.impersonate2(ACL.java:451)
    at hudson.security.ACL.impersonate(ACL.java:463)
    at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)

Ansible playbook execution failed

PLAY RECAP *********************************************************************
vm1: ok=2    changed=2    unreachable=0    failed=0    skipped=4    rescued=0    ignored=0
vm2: ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
vm3: ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
```
<p>And times that the copy playbook log shows failures at the begning of the playbook, like that:</p>
```PLAY [copy files to lab] ***************************************************

[WARNING]: ERROR DURING WINRM SEND INPUT - attempting to recover:
WinRMTransportError Bad HTTP response returned from server. Code 400

...

Checking the Lab's machines shows that not all the files were copied to the machines.
If I restart the copy stage - it solves the problem but not the root of the problem.

```
<p>The <code>retries</code> option in the copy task is not activated when error code 400 is occur, and the task is marked as completed. Here is one of the copy task that I'm using:</p>
<pre class="lang-yaml prettyprint-override"><code>- name: Download TFS build Server.msi"
  ansible.windows.win_powershell:
    script: |
      $definitionName = "{{ tfs_version }}-Server-CI"
      $buildQuality = "{{ tfs_quality }}"
      $type = "msi"
      $teamProject = "Product"
      $path = "C:\files\Server.msi"
      $username = '{{ tfs_user }}'
      $password = '{{ tfs_password }}'
      $securePassword = ConvertTo-SecureString $password -Force -AsPlainText
      $credentials = New-Object System.Management.Automation.PSCredential($username, $securePassword)
      $uncBuildServer = "\\fl2.corp.com"

      $definitions = Invoke-RestMethod "http://almtfs.com:8080/tfs/DefaultCollection/$($teamProject)/_apis/build/definitions?api-version=2.0-preview" -Method Get -Credential $credentials
      $definitionId = $definitions.value | Where-Object {$_.name -eq $definitionName} | Select-Object -ExpandProperty id

      $builds = Invoke-RestMethod "http://almtfs.com:8080/tfs/DefaultCollection/$($teamProject)/_apis/build/builds?Definitions=$($definitionId)&api-version=2.0-preview" -Method Get -Credential $credentials
      $buildsCount = $builds.count
      $msiFiles = $null
      $i = 0

      NET USE $uncBuildServer $password /USER:$username

      do
      {
        if ($definitionName -eq "Trunk-Server-CI")
        {
            $build = $builds.Value | Where-Object {($_.status -eq 'completed') -and ($_.result -eq 'succeeded')} | Sort-Object -Property queueTime -Descending | Select-Object -Skip $i | Select-Object -First 1
        }
        elseif ($definitionName -ne "Trunk-Server-CI" -and $buildQuality -eq "latestGreen")
        {
            $build = $builds.Value | Where-Object {($_.status -eq 'completed') -and ($_.result -eq 'succeeded')} | Sort-Object -Property queueTime -Descending | Select-Object -Skip $i | Select-Object -First 1
        }
        elseif ($definitionName -ne "Trunk-Server-CI" -and $buildQuality -eq "Hotfix")
        {
            $build = $builds.Value | Where-Object {($_.status -eq 'completed') -and ($_.result -eq 'succeeded') -and ($_.quality -eq 'Hotfix')} | Sort-Object -Property queueTime -Descending | Select-Object -Skip $i | Select-Object -First 1
        }
        elseif ($definitionName -ne "Trunk-Server-CI" -and $buildQuality -eq "Released")
        {
            $build = $builds.Value | Where-Object {($_.status -eq 'completed') -and ($_.result -eq 'succeeded') -and ($_.quality -eq 'Released')} | Sort-Object -Property queueTime -Descending | Select-Object -Skip $i | Select-Object -First 1
        }
        elseif ($definitionName -ne "Trunk-Server-CI" -and $buildQuality -eq "Internal")
        {
            $build = $builds.Value | Where-Object {($_.status -eq 'completed') -and ($_.result -eq 'succeeded') -and ($_.quality -eq 'Internal')} | Sort-Object -Property queueTime -Descending | Select-Object -Skip $i | Select-Object -First 1
        }
        else
        {
            $build = $builds.Value | Where-Object {($_.status -eq 'completed') -and ($_.result -eq 'succeeded')} | Sort-Object -Property queueTime -Descending | Select-Object -Skip $i | Select-Object -First 1
        }

          $dropFolder = @(
              "\\fl2.corp..com\sw\prod\drop\$($definitionName)\$($build.buildNumber)"
              "\\fl2.corp..com\sw\$($teamProject)\drop\$($definitionName)\$($build.buildNumber)"
          ) | Where-Object {Test-Path $_}

          $msiFiles = Get-ChildItem -Filter 'Server.msi' -Recurse -Path "$dropFolder\Install\Wix" | Where-Object {($_.FullName -like "*x64*") -or ($_.FullName -like 'Win64*')} | Select-Object -ExpandProperty FullName -Verbose

          If ($msiFiles -eq $null)
          {
              Write-Host "TFS-Build Drop Folder: $($dropFolder) is missing Install folder"
              Write-Host "Skipping to the next green build"

              $i++
          }
          elseif ($i -eq $buildsCount)
          {
              Write-Host "last green build file was not found in tfs build server"
          }
          else
          {
              Write-Host "last green build file was found"
              Write-Host "TFS-Build Drop Folder: $($dropFolder)"
          }
      }
      while (($msiFiles -eq $null) -or ($i -eq $buildsCount))

      $serverMsi = $msiFiles

      if (-NOT (Test-Path "$env:HOMEDRIVE\files\"))
      {
          mkdir "$env:HOMEDRIVE\files\" -Force
      }

      Copy-Item -Path $serverMsi -Destination "$env:HOMEDRIVE\files\" -Force -Verbose

      NET USE * /delete /y

      Test-Path $path -PathType Leaf

  when: "'center' in group_names"
  become: true
  become_method: runas
  vars:
    ansible_become_user: "{{ ansible_user }}"
    ansible_become_password: "{{ ansible_password }}"
  register: results
  retries: 5
  delay: 30
  until: results is not failed
</code>```

a. Why do I get error code 400 and how can I solve\overcome it?

b. If I can't solve error code 400, how can I 'retry' the task till it succeed?

01/01/2023 - Update: I ran the following scripts on my lab's machines:
ConfigureRemotingForAnsible.ps1 winRMbatch.bat - I see less error code 400 now. But, the the ansible retry mechanism isn't activated. You can see below that the task was failed at the beggining

```<code>TASK [tfs : Download TFS build file1.msi] *******************

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: winrm.exceptions.WinRMTransportError: Bad HTTP response returned from server. Code 400

fatal: [vm1]: FAILED! => {"msg": "Unexpected failure during module execution.", "stdout": ""}
</code>```

Body:
Trying to overcome error message:

winrm.exceptions.WinRMTransportError: Bad HTTP response returned from server.
Code 400 error message was failed

I have a laptop that run Docker with Jenkins container in it.

The Jenkins container has an Ansible service.

The Jenkins pipeline is running against VMs in a VCenter server in the organization.

All the VMs are Windows 10 or Windows Server 2016 and Up

(Should I have run it inside the Jenkins container? Or in the deployed VMs?)

My pipeline start with:

PLAY [revert vmware vcenter lab]

PLAY [copy files to lab]

The other plabooks are responsible to install the files and configure the system

The group_var > all.yml file include the following winRM details:

ansible_user: bob
ansible_password: sponge
ansible_connection: winrm
ansible_port: 5985
ansible_winrm_scheme: http
ansible_winrm_server_cert_validation: ignore
ansible_winrm_kerberos_delegation: false
ansible_winrm_transport: ntlm
ansible_winrm_read_timeout_sec: 70
ansible_winrm_operation_timeout_sec: 60

First revert playbook is passed,

PLAY RECAP *********************************************************************
vm1: ok=4    changed=2    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
vm2: ok=4    changed=2    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
vm3: ok=4    changed=2    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

The copy playbook is failed

PLAY [copy files to lab] ***************************************************

TASK [tfs : Download TFS build Server.msi"] ************************************
An exception occurred during task execution. To see the full traceback, use -vvv.
The error was: winrm.exceptions.WinRMTransportError: Bad HTTP response returned from server. Code 400
fatal: [vm1]: FAILED! => {"msg": "Unexpected failure during module execution.", "stdout": ""}
An exception occurred during task execution. To see the full traceback, use -vvv.
The error was: winrm.exceptions.WinRMTransportError: Bad HTTP response returned from server. Code 400
fatal: [vm2]: FAILED! => {"msg": "Unexpected failure during module execution.", "stdout": ""}
changed: [vm3]

TASK [tfs : Download TFS build Config.zip"] ************************************
skipping: [vm3]

TASK [tfs : Download TFS build file2.msi] *****************************
changed: [vm3]

TASK [tfs : Download TFS build file3.msi] ******************************
skipping: [vm3]

TASK [tfs : Download TFS build file1.msi] *******************
skipping: [vm3]

TASK [tfs : Unzip Config.zip file] *********************************************
skipping: [vm3]

PLAY RECAP *********************************************************************
vm3: ok=2    changed=2    unreachable=0    failed=0    skipped=4    rescued=0    ignored=0
vm1: ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
vm2: ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

FATAL: command execution failed
hudson.AbortException: Ansible playbook execution failed
    at org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:262)
    at org.jenkinsci.plugins.ansible.workflow.AnsiblePlaybookStep$AnsiblePlaybookExecution.run(AnsiblePlaybookStep.java:430)
    at org.jenkinsci.plugins.ansible.workflow.AnsiblePlaybookStep$AnsiblePlaybookExecution.run(AnsiblePlaybookStep.java:351)
    at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
    at hudson.security.ACL.impersonate2(ACL.java:451)
    at hudson.security.ACL.impersonate(ACL.java:463)
    at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)

Ansible playbook execution failed

PLAY RECAP *********************************************************************
vm1: ok=2    changed=2    unreachable=0    failed=0    skipped=4    rescued=0    ignored=0
vm2: ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
vm3: ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

And times that the copy playbook log shows failures at the begning of the playbook, like that:

PLAY [copy files to lab] ***************************************************

[WARNING]: ERROR DURING WINRM SEND INPUT - attempting to recover:
WinRMTransportError Bad HTTP response returned from server. Code 400

...

Checking the Lab's machines shows that not all the files were copied to the machines.
If I restart the copy stage - it solves the problem but not the root of the problem.

The retries option in the copy task is not activated when error code 400 is occur, and the task is marked as completed. Here is one of the copy task that I'm using:

- name: Download TFS build Server.msi"
  ansible.windows.win_powershell:
    script: |
      $definitionName = "{{ tfs_version }}-Server-CI"
      $buildQuality = "{{ tfs_quality }}"
      $type = "msi"
      $teamProject = "Product"
      $path = "C:\files\Server.msi"
      $username = '{{ tfs_user }}'
      $password = '{{ tfs_password }}'
      $securePassword = ConvertTo-SecureString $password -Force -AsPlainText
      $credentials = New-Object System.Management.Automation.PSCredential($username, $securePassword)
      $uncBuildServer = "\\fl2.corp.com"

      $definitions = Invoke-RestMethod "http://almtfs.com:8080/tfs/DefaultCollection/$($teamProject)/_apis/build/definitions?api-version=2.0-preview" -Method Get -Credential $credentials
      $definitionId = $definitions.value | Where-Object {$_.name -eq $definitionName} | Select-Object -ExpandProperty id

      $builds = Invoke-RestMethod "http://almtfs.com:8080/tfs/DefaultCollection/$($teamProject)/_apis/build/builds?Definitions=$($definitionId)&api-version=2.0-preview" -Method Get -Credential $credentials
      $buildsCount = $builds.count
      $msiFiles = $null
      $i = 0

      NET USE $uncBuildServer $password /USER:$username

      do
      {
        if ($definitionName -eq "Trunk-Server-CI")
        {
            $build = $builds.Value | Where-Object {($_.status -eq 'completed') -and ($_.result -eq 'succeeded')} | Sort-Object -Property queueTime -Descending | Select-Object -Skip $i | Select-Object -First 1
        }
        elseif ($definitionName -ne "Trunk-Server-CI" -and $buildQuality -eq "latestGreen")
        {
            $build = $builds.Value | Where-Object {($_.status -eq 'completed') -and ($_.result -eq 'succeeded')} | Sort-Object -Property queueTime -Descending | Select-Object -Skip $i | Select-Object -First 1
        }
        elseif ($definitionName -ne "Trunk-Server-CI" -and $buildQuality -eq "Hotfix")
        {
            $build = $builds.Value | Where-Object {($_.status -eq 'completed') -and ($_.result -eq 'succeeded') -and ($_.quality -eq 'Hotfix')} | Sort-Object -Property queueTime -Descending | Select-Object -Skip $i | Select-Object -First 1
        }
        elseif ($definitionName -ne "Trunk-Server-CI" -and $buildQuality -eq "Released")
        {
            $build = $builds.Value | Where-Object {($_.status -eq 'completed') -and ($_.result -eq 'succeeded') -and ($_.quality -eq 'Released')} | Sort-Object -Property queueTime -Descending | Select-Object -Skip $i | Select-Object -First 1
        }
        elseif ($definitionName -ne "Trunk-Server-CI" -and $buildQuality -eq "Internal")
        {
            $build = $builds.Value | Where-Object {($_.status -eq 'completed') -and ($_.result -eq 'succeeded') -and ($_.quality -eq 'Internal')} | Sort-Object -Property queueTime -Descending | Select-Object -Skip $i | Select-Object -First 1
        }
        else
        {
            $build = $builds.Value | Where-Object {($_.status -eq 'completed') -and ($_.result -eq 'succeeded')} | Sort-Object -Property queueTime -Descending | Select-Object -Skip $i | Select-Object -First 1
        }

          $dropFolder = @(
              "\\fl2.corp..com\sw\prod\drop\$($definitionName)\$($build.buildNumber)"
              "\\fl2.corp..com\sw\$($teamProject)\drop\$($definitionName)\$($build.buildNumber)"
          ) | Where-Object {Test-Path $_}

          $msiFiles = Get-ChildItem -Filter 'Server.msi' -Recurse -Path "$dropFolder\Install\Wix" | Where-Object {($_.FullName -like "*x64*") -or ($_.FullName -like 'Win64*')} | Select-Object -ExpandProperty FullName -Verbose

          If ($msiFiles -eq $null)
          {
              Write-Host "TFS-Build Drop Folder: $($dropFolder) is missing Install folder"
              Write-Host "Skipping to the next green build"

              $i++
          }
          elseif ($i -eq $buildsCount)
          {
              Write-Host "last green build file was not found in tfs build server"
          }
          else
          {
              Write-Host "last green build file was found"
              Write-Host "TFS-Build Drop Folder: $($dropFolder)"
          }
      }
      while (($msiFiles -eq $null) -or ($i -eq $buildsCount))

      $serverMsi = $msiFiles

      if (-NOT (Test-Path "$env:HOMEDRIVE\files\"))
      {
          mkdir "$env:HOMEDRIVE\files\" -Force
      }

      Copy-Item -Path $serverMsi -Destination "$env:HOMEDRIVE\files\" -Force -Verbose

      NET USE * /delete /y

      Test-Path $path -PathType Leaf

  when: "'center' in group_names"
  become: true
  become_method: runas
  vars:
    ansible_become_user: "{{ ansible_user }}"
    ansible_become_password: "{{ ansible_password }}"
  register: results
  retries: 5
  delay: 30
  until: results is not failed

a. Why do I get error code 400 and how can I solve\overcome it?

b. If I can't solve error code 400, how can I 'retry' the task till it succeed?

01/01/2023 - Update: I ran the following scripts on my lab's machines:
ConfigureRemotingForAnsible.ps1 winRMbatch.bat - I see less error code 400 now. But, the the ansible retry mechanism isn't activated. You can see below that the task was failed at the beggining

TASK [tfs : Download TFS build file1.msi] *******************

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: winrm.exceptions.WinRMTransportError: Bad HTTP response returned from server. Code 400

fatal: [vm1]: FAILED! => {"msg": "Unexpected failure during module execution.", "stdout": ""}


来源: stackexchange

问:
detectron2 visualize feature map
I wonder how to get visualize feature maps in detectron2.
I use the model:COCO-PanopticSegmentation/panoptic_fpn_R_50_1x.yaml

this is my code.

```<code>images = cv2.imread("C:\\Users\\mkjeong\\Desktop\\gump.jpg")
cfg = get_cfg()
model = build_model(cfg)

# Set model to evaluation mode
model.eval()
cfg.MODEL.DEVICE = "cpu" # cpu 모드로 사용하기

 # panoptic segmentation
cfg.merge_from_file(model_zoo.get_config_file("COCO-PanopticSegmentation/panoptic_fpn_R_50_1x.yaml"))
cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("COCO-PanopticSegmentation/panoptic_fpn_R_50_1x.yaml")

cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.5  # set threshold for this model

predictor= DefaultPredictor(cfg)

#outputs = predictor(im)
outputs, segmentInfo = predictor(images)["panoptic_seg"]

# panoptic segmentation 에서는 불가능
#print(outputs["instances"].pred_classes)
#print(outputs["instances"].pred_boxes)

v = Visualizer(images[:, :, ::-1], MetadataCatalog.get(cfg.DATASETS.TRAIN[0]), scale=1.2)
#out = v.draw_instance_predictions(outputs["instances"].to("cpu"))
out = v.draw_panoptic_seg_predictions(outputs.to("cpu"), segmentInfo)

cv2.imshow('Results', out.get_image()[:, :, ::-1])
cv2.waitKey(0)
cv2.destroyAllWindows()
</code>```

ContentLicense: CC BY-SA 4.0

Title: detectron2 visualize feature map

Body:
I wonder how to get visualize feature maps in detectron2.
I use the model:COCO-PanopticSegmentation/panoptic_fpn_R_50_1x.yaml

this is my code.

images = cv2.imread("C:\\Users\\mkjeong\\Desktop\\gump.jpg")
cfg = get_cfg()
model = build_model(cfg)

# Set model to evaluation mode
model.eval()
cfg.MODEL.DEVICE = "cpu" # cpu 모드로 사용하기

 # panoptic segmentation
cfg.merge_from_file(model_zoo.get_config_file("COCO-PanopticSegmentation/panoptic_fpn_R_50_1x.yaml"))
cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("COCO-PanopticSegmentation/panoptic_fpn_R_50_1x.yaml")

cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.5  # set threshold for this model

predictor= DefaultPredictor(cfg)

#outputs = predictor(im)
outputs, segmentInfo = predictor(images)["panoptic_seg"]

# panoptic segmentation 에서는 불가능
#print(outputs["instances"].pred_classes)
#print(outputs["instances"].pred_boxes)

v = Visualizer(images[:, :, ::-1], MetadataCatalog.get(cfg.DATASETS.TRAIN[0]), scale=1.2)
#out = v.draw_instance_predictions(outputs["instances"].to("cpu"))
out = v.draw_panoptic_seg_predictions(outputs.to("cpu"), segmentInfo)

cv2.imshow('Results', out.get_image()[:, :, ::-1])
cv2.waitKey(0)
cv2.destroyAllWindows()


问:
Session Start event not raised on first request using CAC authentication
Our flow of requests has some logic on the Seesion_Start event (asp.net), but when we are using CAC authentication this event is not raised on the first request.

Can I force it or validate that is CAC authentication, so I can skip validation for the first request?


问:
Supabase Subscribe to realtime db with RLS Policy SELECT target role authenticated is not working
When I tried subscribe to realtime db with disabled RLS, it's all working fine. I can see the logs displaying when I created new messages. But when I enable the RLS target role 'authenticated', USING expression value is 'true'. Then the realtime subscription is not working anymore.

```<code>          supabase
        .channel(`public:messages:team_id=eq.${this.profileDetail.sb_id}`)
        .on('postgres_changes', { event: 'INSERT', schema: 'public', table: 'messages', filter: `team_id=eq.${this.profileDetail.sb_id}` }, payload => {
          console.log('Change received!', payload)
        })
        .subscribe()
</code>```

I also make sure the user I'm using is authenticated. Not sure what I did wrong here.

Body:
When I tried subscribe to realtime db with disabled RLS, it's all working fine. I can see the logs displaying when I created new messages. But when I enable the RLS target role 'authenticated', USING expression value is 'true'. Then the realtime subscription is not working anymore.

          supabase
        .channel(`public:messages:team_id=eq.${this.profileDetail.sb_id}`)
        .on('postgres_changes', { event: 'INSERT', schema: 'public', table: 'messages', filter: `team_id=eq.${this.profileDetail.sb_id}` }, payload => {
          console.log('Change received!', payload)
        })
        .subscribe()

I also make sure the user I'm using is authenticated. Not sure what I did wrong here.


问:
Use dataframe row values as input for an API request
I have dataFrame as df2 like this:

nazar
Column B

hello
Cell 2

Cell 3
Cell 4

How can I put row['nazar'] instead of payload = u""hello""?

```<code>url =  baseUrl + "SentimentAnalyzer/SentimentClassifier2" # output:  0:Negative  1:Neutral  2:Positive
results =[]
for index, row in df2.head(2).iterrows():
    payload = (row['nazar'])
    results.append(callApi(url, payload, tokenKey))
print(results)
</code>```

in line 4?

Body:
I have dataFrame as df2 like this:

nazar
Column B

hello
Cell 2

Cell 3
Cell 4

How can I put row['nazar'] instead of payload = u""hello""?

url =  baseUrl + "SentimentAnalyzer/SentimentClassifier2" # output:  0:Negative  1:Neutral  2:Positive
results =[]
for index, row in df2.head(2).iterrows():
    payload = (row['nazar'])
    results.append(callApi(url, payload, tokenKey))
print(results)

in line 4?


问:
How to create below generic class in java and how to access that class?
Below one is the kotlin code. I just want same thing in java how can i do that

```<code>sealed class NetworkResult<T>(val data: T? = null, val message: String? = null) {
    class Success<T>(data: T) : NetworkResult<T>(data)
    class Error<T>(message: String?, data: T? = null) : NetworkResult<T>(data, message)
    class Loading<T> : NetworkResult<T>()
}
</code>```

I tried with the below one but was not able to access the inner class. Try to access this NetworkResult.Success(response.body()) but getting error 'Method call expected'

```<code>class NetworkResult <T>{
    private String message;
    private T data;
    public NetworkResult(T data,String message) {
        this.data=data;
        this.message=message;
    }
    public NetworkResult(T data) {
        this.data=data;
    }

    public NetworkResult() {
    }

    class Success<T> extends NetworkResult<T>{
        public Success(T data) {
            super(data);
        }
    }
    class Error<T> extends NetworkResult<T>{

        public Error(T data, String message) {
            super(data, message);
        }
    }

    class Loading<T> extends NetworkResult<T>{

    }
}

</code>```

Body:
Below one is the kotlin code. I just want same thing in java how can i do that

sealed class NetworkResult<T>(val data: T? = null, val message: String? = null) {
    class Success<T>(data: T) : NetworkResult<T>(data)
    class Error<T>(message: String?, data: T? = null) : NetworkResult<T>(data, message)
    class Loading<T> : NetworkResult<T>()
}

I tried with the below one but was not able to access the inner class. Try to access this NetworkResult.Success(response.body()) but getting error 'Method call expected'

class NetworkResult <T>{
    private String message;
    private T data;
    public NetworkResult(T data,String message) {
        this.data=data;
        this.message=message;
    }
    public NetworkResult(T data) {
        this.data=data;
    }

    public NetworkResult() {
    }

    class Success<T> extends NetworkResult<T>{
        public Success(T data) {
            super(data);
        }
    }
    class Error<T> extends NetworkResult<T>{

        public Error(T data, String message) {
            super(data, message);
        }
    }

    class Loading<T> extends NetworkResult<T>{

    }
}


问:
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
I am trying to run the react native app. But While using npx react-native run-android I am getting the below error.

```<code>FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not find any matches for com.facebook.react:hermes-engine:+ as no versions of com.facebook.react:hermes-engine are available.
     Required by:
         project :app

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not find any matches for com.facebook.react:hermes-engine:+ as no versions of com.facebook.react:hermes-engine are available.
     Required by:
         project :app
</code>```

I tried deleting the node_modules and then doing yarn. And also tried ./gradle clean but none of them worked.

Also I checked my Android SDK root via echo $ANDROID_SDK_ROOT. And It is properly configured and all the paths are configured. But while doing npx react-native info. I am getting

```<code>System:
    OS: macOS 13.1
    CPU: (8) arm64 Apple M1
    Memory: 104.72 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.11.0 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.19.2 - /opt/homebrew/bin/npm
    Watchman: 2022.12.26.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK: Not Found
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.3 AI-213.7172.25.2113.9123335
    Xcode: /undefined - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.17 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2
    react-native: 0.66.4 => 0.66.4
</code>```

How could I resolve this issue?

Body:
I am trying to run the react native app. But While using npx react-native run-android I am getting the below error.

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not find any matches for com.facebook.react:hermes-engine:+ as no versions of com.facebook.react:hermes-engine are available.
     Required by:
         project :app

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not find any matches for com.facebook.react:hermes-engine:+ as no versions of com.facebook.react:hermes-engine are available.
     Required by:
         project :app

I tried deleting the node_modules and then doing yarn. And also tried ./gradle clean but none of them worked.

Also I checked my Android SDK root via echo $ANDROID_SDK_ROOT. And It is properly configured and all the paths are configured. But while doing npx react-native info. I am getting

System:
    OS: macOS 13.1
    CPU: (8) arm64 Apple M1
    Memory: 104.72 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.11.0 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.19.2 - /opt/homebrew/bin/npm
    Watchman: 2022.12.26.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK: Not Found
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.3 AI-213.7172.25.2113.9123335
    Xcode: /undefined - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.17 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2
    react-native: 0.66.4 => 0.66.4

How could I resolve this issue?


问:
Problem connecting to CCI ('connectionFactory' or 'cciTemplate' is required)
I work on a Java Spring application, and all the configuration is being done in javaConfig.

I have a bean defined:

```<code>@Bean(name = "xxAppFacadeComun")
    public XXAppFacade getXXAppFacade() {
        return XXAppLibFactory.getInstance().getXXAppFacade();
    }
</code>```

That Bean is from a library that I am developing "XXAppLib", its configuration class is:

```<code>@Configuration
@ComponentScan({
    "paq.xxapplib.core.facades.impl",
    "paq.xxapplib.core.daos.impl",
    "paq.xxapplib.core.config",
    "paq.xxapplib.core.daos.cics"})
public class XxxAppConfig {

    private static final Logger LOGGER = LoggerFactory.getLogger(XxxAppConfig.class);

    @Bean(name = "xxapplib_XXAppECI")
    public JndiObjectFactoryBean eciXXApp() {
        LOGGER.info("xxapplib_XXAppECI");
        org.springframework.jndi.JndiObjectFactoryBean factory = new JndiObjectFactoryBean();
        factory.setJndiName("eis/XXAppECI");
        factory.setResourceRef(true);
        return factory;
    }

    @Bean(name="xxapplib_aaaaaComunDao")
    @DependsOn(value = "xxapplib_XXAppECI")
    public AaaaaComunDao aaaaaComunDaoXXApp(@Qualifier("xxapplib_XXAppECI") ConnectionFactory  factory) {
        LOGGER.info("xxapplib_aaaaaComunDao");

        AaaaaComunDaoImpl aaaaaComunDao = new AaaaaComunDaoImpl();
        aaaaaComunDao.setConnectionFactory(factory);

        return aaaaaComunDao;
    }

}
</code>```

The factory's statement:

```<code>public class XXAppLibFactory extends BaseFactory {
    private static final Logger LOGGER = LoggerFactory.getLogger(XXAppLibFactory.class);

    private static final XXAppLibFactory FACTORIA_APP = new XXAppLibFactory();

    private XXAppFacade xxAppFacade;

    private XXAppLibFactory() {

        try {
            loadApplicationConfig((Class) XxxAppConfig.class);
        } catch (Exception e) {
            LOGGER.error("Ha ocurrido un error al cargar el applicationConfig:" + e.getMessage());
        }
    }

    @Override
    protected void initServices(BeanFactory beanFactory) {
        this.xxAppFacade = (XXAppFacade)beanFactory.getBean(XXAppFacade.class);
    }

    public XXAppFacade getXXAppFacade() {
        return this.xxAppFacade;
    }

    public static XXAppLibFactory getInstance() {
        return FACTORIA_APP;
    }

}
</code>```

and the DaoImpl:

```<code>public class AaaaaComunDaoImpl extends CciDaoSupport implements AaaaaComunDao {

    private static final Logger LOGGER = LoggerFactory.getLogger(AaaaaComunDaoImpl.class);

    final String RUTINA_AAAA = "AAAA";
    final String RUTINA_MMMM = "MMMM";
    final String RUTINA_CCCC = "CCCC";
    final String ACCION_FINALIZAR = "F";

    public AaaaaComunDaoImpl() {
        super();
    }

    [... methods]
}
</code>```

There is a moment when you try to execute the following method:

```<code>private ApplicationContext doCreate(GenericApplicationContext dependenciesApplicationContext) {
    AnnotationConfigApplicationContext annotationApplicationContext = new AnnotationConfigApplicationContext();
    annotationApplicationContext.setParent(dependenciesApplicationContext);
    annotationApplicationContext.register(this.javaconfigClasses);
    annotationApplicationContext.refresh();

    return annotationApplicationContext;
  }
</code>```

and when trying to perform "annotationApplicationContext.register(this.javaconfigClasses);"

That's when the error occurs:

Ha ocurrido un error al cargar el applicationConfig:Error creating
bean with name 'aaaaaComunDao' defined in URL
[wsjar:file:[...]/AaaaaComunDaoImpl.class]: Invocation of init method
failed; nested exception is java.lang.IllegalArgumentException:
'connectionFactory' or 'cciTemplate' is required

By debugging on

```<code>@Bean(name="xxapplib_aaaaaComunDao")
    @DependsOn(value = "xxapplib_XXAppECI")
    public AaaaaComunDao aaaaaComunDaoXXApp(@Qualifier("xxapplib_XXAppECI") ConnectionFactory  factory) {
        LOGGER.info("xxapplib_aaaaaComunDao");

        AaaaaComunDaoImpl aaaaaComunDao = new AaaaaComunDaoImpl();
        aaaaaComunDao.setConnectionFactory(factory);

        return aaaaaComunDao;
    }
</code>```

I see that "aaaaaaaComunDao" is correctly informed and has the cciTemplate defined.

Body:
I work on a Java Spring application, and all the configuration is being done in javaConfig.

I have a bean defined:

@Bean(name = "xxAppFacadeComun")
    public XXAppFacade getXXAppFacade() {
        return XXAppLibFactory.getInstance().getXXAppFacade();
    }

That Bean is from a library that I am developing "XXAppLib", its configuration class is:

@Configuration
@ComponentScan({
    "paq.xxapplib.core.facades.impl",
    "paq.xxapplib.core.daos.impl",
    "paq.xxapplib.core.config",
    "paq.xxapplib.core.daos.cics"})
public class XxxAppConfig {

    private static final Logger LOGGER = LoggerFactory.getLogger(XxxAppConfig.class);

    @Bean(name = "xxapplib_XXAppECI")
    public JndiObjectFactoryBean eciXXApp() {
        LOGGER.info("xxapplib_XXAppECI");
        org.springframework.jndi.JndiObjectFactoryBean factory = new JndiObjectFactoryBean();
        factory.setJndiName("eis/XXAppECI");
        factory.setResourceRef(true);
        return factory;
    }

    @Bean(name="xxapplib_aaaaaComunDao")
    @DependsOn(value = "xxapplib_XXAppECI")
    public AaaaaComunDao aaaaaComunDaoXXApp(@Qualifier("xxapplib_XXAppECI") ConnectionFactory  factory) {
        LOGGER.info("xxapplib_aaaaaComunDao");

        AaaaaComunDaoImpl aaaaaComunDao = new AaaaaComunDaoImpl();
        aaaaaComunDao.setConnectionFactory(factory);

        return aaaaaComunDao;
    }

}

The factory's statement:

public class XXAppLibFactory extends BaseFactory {
    private static final Logger LOGGER = LoggerFactory.getLogger(XXAppLibFactory.class);

    private static final XXAppLibFactory FACTORIA_APP = new XXAppLibFactory();

    private XXAppFacade xxAppFacade;

    private XXAppLibFactory() {

        try {
            loadApplicationConfig((Class) XxxAppConfig.class);
        } catch (Exception e) {
            LOGGER.error("Ha ocurrido un error al cargar el applicationConfig:" + e.getMessage());
        }
    }

    @Override
    protected void initServices(BeanFactory beanFactory) {
        this.xxAppFacade = (XXAppFacade)beanFactory.getBean(XXAppFacade.class);
    }

    public XXAppFacade getXXAppFacade() {
        return this.xxAppFacade;
    }

    public static XXAppLibFactory getInstance() {
        return FACTORIA_APP;
    }

}

and the DaoImpl:

public class AaaaaComunDaoImpl extends CciDaoSupport implements AaaaaComunDao {

    private static final Logger LOGGER = LoggerFactory.getLogger(AaaaaComunDaoImpl.class);

    final String RUTINA_AAAA = "AAAA";
    final String RUTINA_MMMM = "MMMM";
    final String RUTINA_CCCC = "CCCC";
    final String ACCION_FINALIZAR = "F";

    public AaaaaComunDaoImpl() {
        super();
    }

    [... methods]
}

There is a moment when you try to execute the following method:

private ApplicationContext doCreate(GenericApplicationContext dependenciesApplicationContext) {
    AnnotationConfigApplicationContext annotationApplicationContext = new AnnotationConfigApplicationContext();
    annotationApplicationContext.setParent(dependenciesApplicationContext);
    annotationApplicationContext.register(this.javaconfigClasses);
    annotationApplicationContext.refresh();

    return annotationApplicationContext;
  }

and when trying to perform "annotationApplicationContext.register(this.javaconfigClasses);"

That's when the error occurs:

Ha ocurrido un error al cargar el applicationConfig:Error creating
bean with name 'aaaaaComunDao' defined in URL
[wsjar:file:[...]/AaaaaComunDaoImpl.class]: Invocation of init method
failed; nested exception is java.lang.IllegalArgumentException:
'connectionFactory' or 'cciTemplate' is required

By debugging on

@Bean(name="xxapplib_aaaaaComunDao")
    @DependsOn(value = "xxapplib_XXAppECI")
    public AaaaaComunDao aaaaaComunDaoXXApp(@Qualifier("xxapplib_XXAppECI") ConnectionFactory  factory) {
        LOGGER.info("xxapplib_aaaaaComunDao");

        AaaaaComunDaoImpl aaaaaComunDao = new AaaaaComunDaoImpl();
        aaaaaComunDao.setConnectionFactory(factory);

        return aaaaaComunDao;
    }

I see that "aaaaaaaComunDao" is correctly informed and has the cciTemplate defined.


问:
How do I make a screen.blit(a,b,c) stay permanently after a button is clicked
My code is for a game that requires the user to select a character in a pregame screen and then this value is globalised so that a player sprite can be created which uses this value to determine the image to use in another screen. This image is also displayed on the screen for the user to see in the pregame screen. But after the button for the character is clicked the display character only displays for a split second, how do I make it so that its stays on the screen.</p>
```<code>    choice = [redboy_left, capboy_left, girl_left]
    display =[newredboy_left, newcapboy_left, newgirl_left]

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            sys.exit()
        if event.type == pygame.MOUSEBUTTONDOWN:
            if oneplayer_back.checkForInput(ONEPLAYER_MOUSE_POS):
                mixer.music.play()
                main_menu()
            if redboyleft_button.checkForInput(ONEPLAYER_MOUSE_POS):
                mixer.music.play()
                player1_choice = choice[0]
                display_character = display[0]
                print("RED")
                screen.blit(display_character,(900,200))
            if capboyleft_button.checkForInput(ONEPLAYER_MOUSE_POS):
                mixer.music.play()
                player1_choice = choice[1]
                display_character = display[1]
                print("CAP")
                screen.blit(display_character,(900,200))
            if girlleft_button.checkForInput(ONEPLAYER_MOUSE_POS):
                mixer.music.play()
                player1_choice = choice[2]
                display_character = display[2]
                print("GIRL")
                screen.blit(display_character,(900,200))
            if play_button.checkForInput(ONEPLAYER_MOUSE_POS):
                mixer.music.play()
                one_player()

            global selected_character1
            selected_character1 = player1_choice

    pygame.display.update()
</code>```

Body:
My code is for a game that requires the user to select a character in a pregame screen and then this value is globalised so that a player sprite can be created which uses this value to determine the image to use in another screen. This image is also displayed on the screen for the user to see in the pregame screen. But after the button for the character is clicked the display character only displays for a split second, how do I make it so that its stays on the screen.

    choice = [redboy_left, capboy_left, girl_left]
    display =[newredboy_left, newcapboy_left, newgirl_left]

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            sys.exit()
        if event.type == pygame.MOUSEBUTTONDOWN:
            if oneplayer_back.checkForInput(ONEPLAYER_MOUSE_POS):
                mixer.music.play()
                main_menu()
            if redboyleft_button.checkForInput(ONEPLAYER_MOUSE_POS):
                mixer.music.play()
                player1_choice = choice[0]
                display_character = display[0]
                print("RED")
                screen.blit(display_character,(900,200))
            if capboyleft_button.checkForInput(ONEPLAYER_MOUSE_POS):
                mixer.music.play()
                player1_choice = choice[1]
                display_character = display[1]
                print("CAP")
                screen.blit(display_character,(900,200))
            if girlleft_button.checkForInput(ONEPLAYER_MOUSE_POS):
                mixer.music.play()
                player1_choice = choice[2]
                display_character = display[2]
                print("GIRL")
                screen.blit(display_character,(900,200))
            if play_button.checkForInput(ONEPLAYER_MOUSE_POS):
                mixer.music.play()
                one_player()

            global selected_character1
            selected_character1 = player1_choice

    pygame.display.update()


问:
Python Binance API get minute klinedata
CAN ANYONE HELP

I am using python binance api
I want to know how can add minute in 3rd and 4th argument like

What i try:

```<code>klines = client.get_historical_klines("ETHBTC", Client.KLINE_INTERVAL_30MINUTE, "01/01/2022", "02/02/2022")
</code>```

what i expecting:

```<code>kline = client.get_historical_Klines('BTCUSDT',Client.KLINE_INTERVAL_1MINUTE,'01/01/2022 00:00','01/01/2022 00:05
</code>```

using this getting value error

```<code>ValueError: unconverted data remains: :00
</code>```

Title: Python Binance API get minute klinedata

Body:
CAN ANYONE HELP

I am using python binance api
I want to know how can add minute in 3rd and 4th argument like

What i try:

klines = client.get_historical_klines("ETHBTC", Client.KLINE_INTERVAL_30MINUTE, "01/01/2022", "02/02/2022")

what i expecting:

kline = client.get_historical_Klines('BTCUSDT',Client.KLINE_INTERVAL_1MINUTE,'01/01/2022 00:00','01/01/2022 00:05

using this getting value error

ValueError: unconverted data remains: :00


问:
Goal.Seek with dynamic goal and third decimal equal to 0
I´m new programming macros in Excel.
I want to do a Goal.Seek macro that set the third decimal equal to 0 of the dynamic goal
The goal is the price that I have to upload to our ERP(SAP), and the system doesn´t accept numbers with the third decimal other than cero

How can I program that?

```<code>Sub Macro1()

    Dim I As Integer
    For I = 12 To 270

    Range("AC" & I).Select
    Application.CutCopyMode = False
    Application.CutCopyMode = False
    Application.CutCopyMode = False
    Range("AC" & I).GoalSeek Goal:=Range("AE" & I), ChangingCell:=Range("L" & I)
    Next
End Sub
</code>```

Body:
I´m new programming macros in Excel.
I want to do a Goal.Seek macro that set the third decimal equal to 0 of the dynamic goal
The goal is the price that I have to upload to our ERP(SAP), and the system doesn´t accept numbers with the third decimal other than cero

How can I program that?

Sub Macro1()

    Dim I As Integer
    For I = 12 To 270

    Range("AC" & I).Select
    Application.CutCopyMode = False
    Application.CutCopyMode = False
    Application.CutCopyMode = False
    Range("AC" & I).GoalSeek Goal:=Range("AE" & I), ChangingCell:=Range("L" & I)
    Next
End Sub


问:
When converting .py to .exe all files not working
I want to convert a python code in to exe there are 7 python files of a application when I convert using auto py to exe 1st file converted in to exe but when I want to jump to other page i am exited from the application why? I used os module for multiple jumps to other files.
Please anybody help

Please anybody help.note i am also used pyinstaller and do the method but nothing happens similarly it exit from application


问:
How to make autorun in C# when registry doesnt work
I can see the app in registers but it wont startup.

```<code>RegistryKey rkApp = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); // Add the value in the registry so that the application runs at startup
rkApp.SetValue("WindowsSelfRepairTool", System.Reflection.Assembly.GetEntryAssembly().Location);
</code>```

This is the code I copied from internet, it gets my application to registers because I can see it "On startup" in task manager as well as in the registry editor. But for some reason, when I restart the computer the app wont start.
Also I tried this code in Console App and added code Process.Launch("..") to launch the WPF one. Console starts successfuly but it doesnt run the WPF.. Any help?

Body:
I can see the app in registers but it wont startup.

RegistryKey rkApp = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); // Add the value in the registry so that the application runs at startup
rkApp.SetValue("WindowsSelfRepairTool", System.Reflection.Assembly.GetEntryAssembly().Location);

This is the code I copied from internet, it gets my application to registers because I can see it "On startup" in task manager as well as in the registry editor. But for some reason, when I restart the computer the app wont start.
Also I tried this code in Console App and added code Process.Launch("..") to launch the WPF one. Console starts successfuly but it doesnt run the WPF.. Any help?


问:
Run Java and Python codes in external terminal of VSCode using Code Runner
How do i run Java and Python code in external terminal using Code Runner?I

have tried different settings in JSON but nothing worked.Can someone help?
Note--I am using Windows


问:
Selenium Web driver, python: Test passes in local but fails in GitHub CI due to AssertionError
I´ve faced a problem that my one test passes in local but not in CI.
I have a progress bar with: positions 0%, 50%, 100% of starting a server, status of starting the server - "Server requested", "Spawning server...", "Server ready at" and status log.
I rewrote this case in few times but the result is the same - I got AssertionError, it cannot be catch one of values in CI.
I have no so big experience in Selenium and I´m stuck in which way I need to move to fix such problem. I´d appreciate if anyone helps me!!!

```<code> while '/spawn-pending/' in browser.current_url or is_displayed(
            browser, SpawningPageLocators.PROGRESS_BAR
        ):
            # checking text messages that the server is starting to up
            texts = browser.find_elements(*SpawningPageLocators.TEXT_SERVER)
            texts_list = []
            for text in texts:
                text.text
                texts_list.append(text.text)
            assert str(texts_list[0]) == SpawningPageLocators.TEXT_SERVER_STARTING
            assert str(texts_list[1]) == SpawningPageLocators.TEXT_SERVER_REDIRECT
            # checking progress of the servers starting (messages, % progress and events log))
            logs_list = []
            try:
                progress_bar = browser.find_element(*SpawningPageLocators.PROGRESS_BAR)
                progress = browser.find_elements(*SpawningPageLocators.PROGRESS_MESSAGE)
                logs = browser.find_elements(*SpawningPageLocators.PROGRESS_LOG)
                for status_message in progress:
                    progress_messages = status_message.text
                    percent = (
                        progress_bar.get_attribute('style')
                        .split(';')[0]
                        .split(':')[1]
                        .strip()
                    )
                    for i in range(len(logs)):
                        progress_log = logs[i].text
                        logs_list.append(progress_log)
                    if progress_messages == "":
                        assert percent == "0%"
                        assert int(len(logs_list)) == 0
                    if progress_messages == "Server requested":
                        assert percent == "0%"
                        assert int(len(logs_list)) == 1
>                       assert str(logs_list[0]) == "Server requested"
E                       AssertionError: assert '' == 'Server requested'
E                         - Server requested
</code>```

After rewrote it to

```<code> while '/spawn-pending/' in browser.current_url:
            progress_message = browser.find_element(
                *SpawningPageLocators.PROGRESS_MESSAGE
            ).text
            # checking text messages that the server is starting to up
            texts = browser.find_elements(*SpawningPageLocators.TEXT_SERVER)
            texts_list = []
            for text in texts:
                text.text
                texts_list.append(text.text)
            assert str(texts_list[0]) == SpawningPageLocators.TEXT_SERVER_STARTING
            assert str(texts_list[1]) == SpawningPageLocators.TEXT_SERVER_REDIRECT
            # checking progress of the servers starting (messages, % progress and events log))
            logs_list = []
            try:
                progress_bar = browser.find_element(*SpawningPageLocators.PROGRESS_BAR)
                progress = browser.find_element(*SpawningPageLocators.PROGRESS_MESSAGE)
                logs = browser.find_elements(*SpawningPageLocators.PROGRESS_LOG)
                percent = (
                    progress_bar.get_attribute('style').split(';')[0].split(':')[1].strip()
                )
                for log in logs:
                    # only include non-empty log messages
                    # avoid partially-created elements
                    if log.text:
                        logs_list.append(log.text)
            except (NoSuchElementException, StaleElementReferenceException):
                break

            expected_messages = [
                "Server requested",
                "Spawning server...",
                f"Server ready at {app.base_url}user/{user.name}/",
            ]

            if progress_message:
                assert progress_message in expected_messages
            if logs_list:
                # race condition: progress_message _should_
                # be the last log message, but it _may_ be the next one
                assert progress_message

            if len(logs_list) < 2:
>               assert percent == "0%"
</code>```

Got : AssertionError: assert '50%' == '0%' on the line "assert percent == "0%"

Body:
I´ve faced a problem that my one test passes in local but not in CI.
I have a progress bar with: positions 0%, 50%, 100% of starting a server, status of starting the server - "Server requested", "Spawning server...", "Server ready at" and status log.
I rewrote this case in few times but the result is the same - I got AssertionError, it cannot be catch one of values in CI.
I have no so big experience in Selenium and I´m stuck in which way I need to move to fix such problem. I´d appreciate if anyone helps me!!!

 while '/spawn-pending/' in browser.current_url or is_displayed(
            browser, SpawningPageLocators.PROGRESS_BAR
        ):
            # checking text messages that the server is starting to up
            texts = browser.find_elements(*SpawningPageLocators.TEXT_SERVER)
            texts_list = []
            for text in texts:
                text.text
                texts_list.append(text.text)
            assert str(texts_list[0]) == SpawningPageLocators.TEXT_SERVER_STARTING
            assert str(texts_list[1]) == SpawningPageLocators.TEXT_SERVER_REDIRECT
            # checking progress of the servers starting (messages, % progress and events log))
            logs_list = []
            try:
                progress_bar = browser.find_element(*SpawningPageLocators.PROGRESS_BAR)
                progress = browser.find_elements(*SpawningPageLocators.PROGRESS_MESSAGE)
                logs = browser.find_elements(*SpawningPageLocators.PROGRESS_LOG)
                for status_message in progress:
                    progress_messages = status_message.text
                    percent = (
                        progress_bar.get_attribute('style')
                        .split(';')[0]
                        .split(':')[1]
                        .strip()
                    )
                    for i in range(len(logs)):
                        progress_log = logs[i].text
                        logs_list.append(progress_log)
                    if progress_messages == "":
                        assert percent == "0%"
                        assert int(len(logs_list)) == 0
                    if progress_messages == "Server requested":
                        assert percent == "0%"
                        assert int(len(logs_list)) == 1
>                       assert str(logs_list[0]) == "Server requested"
E                       AssertionError: assert '' == 'Server requested'
E                         - Server requested

After rewrote it to

 while '/spawn-pending/' in browser.current_url:
            progress_message = browser.find_element(
                *SpawningPageLocators.PROGRESS_MESSAGE
            ).text
            # checking text messages that the server is starting to up
            texts = browser.find_elements(*SpawningPageLocators.TEXT_SERVER)
            texts_list = []
            for text in texts:
                text.text
                texts_list.append(text.text)
            assert str(texts_list[0]) == SpawningPageLocators.TEXT_SERVER_STARTING
            assert str(texts_list[1]) == SpawningPageLocators.TEXT_SERVER_REDIRECT
            # checking progress of the servers starting (messages, % progress and events log))
            logs_list = []
            try:
                progress_bar = browser.find_element(*SpawningPageLocators.PROGRESS_BAR)
                progress = browser.find_element(*SpawningPageLocators.PROGRESS_MESSAGE)
                logs = browser.find_elements(*SpawningPageLocators.PROGRESS_LOG)
                percent = (
                    progress_bar.get_attribute('style').split(';')[0].split(':')[1].strip()
                )
                for log in logs:
                    # only include non-empty log messages
                    # avoid partially-created elements
                    if log.text:
                        logs_list.append(log.text)
            except (NoSuchElementException, StaleElementReferenceException):
                break

            expected_messages = [
                "Server requested",
                "Spawning server...",
                f"Server ready at {app.base_url}user/{user.name}/",
            ]

            if progress_message:
                assert progress_message in expected_messages
            if logs_list:
                # race condition: progress_message _should_
                # be the last log message, but it _may_ be the next one
                assert progress_message

            if len(logs_list) < 2:
>               assert percent == "0%"

Got : AssertionError: assert '50%' == '0%' on the line "assert percent == "0%"


问:
In Face Detection process, is it possible to form/generate an image of person whose faces got matched either self/ matching with some other face model
System requirement:

face_recognition version: face_recognition-1.2.3

Python version: 3.9

Operating System: Linux distro, actually docker image : python:3.9-buster

Description:

I have trained many people's face and stored their face-model with 128 nd array through pickle.dump
My detection is also working well, no issue with it.

When a person's face is recognized, I return the name of the person's even if I am getting multiple face found issues, but now I want to return the image of person's face to whomever it matches with.

I want to convert matched person's image from stored face-model.

Please guide me through the steps to make conversion of face-model to image, any dlib-lib reference, or other library would be a great help.

I am expecting to convert matched person's image from stored face-model.
I read the dlib lib functions but could not figure out the result, please guide.


问:
Touch screen double tap problem with kivy
On TextInput, on focus, starts vkeyboard(with my json file).
On touch some letter(on touchscreen), it double writing(1->11).
If i press on letter with mouse or physical keyboard, all ok.

At the beginning, i think that is touch screen problem, but it works well on another apps at device


问:
Modal isn't displaying details
I am trying to get my modal to display details of announcement that has been created. I am using .net core. I have added my details method in my controller and added breakpoints to it and notice that i'm not even hitting my method. I'm new to software development and I'm not sure where I'm going wrong.

I have an announcement model and ViewModel which displays a list of Announcements -> public IEnumerable Announcements {get; set;}.

My button to trigger the modal:

```<code> // View Popup
        $('.btn-view').click(function () {
            var announcementId = $(this).attr("data-id");

            console.log('announcementId:' + announcementId);

            viewAnnouncement(announcementId);
        });
</code>```

JS to view details:

```<code> // Announcement Details

    function viewAnnouncement(announcementId) {
        try {
            console.log('viewAnnouncement(' + announcementId + ')');

            var url = applicationBaseUrl + '/Admin/Announcements/Details' + announcementId;
            console.log('url: ' + url);

            var label = 'Announcement Details';
            var method = "GET";
            var jsonPayload = null;
            var showPostButton = false;
            var postButtonFunction = null;

            AjaxModal(url, label, jsonPayload, method, showPostButton, postButtonFunction);

        }
        catch (err) {
            alert(err.message);
        }
    };
</code>```

Method in my controller:

```<code> [HttpGet]
        public async Task<IActionResult> Details(int? id)
        {
            try
            {
                if (id == null)
                {
                    return NotFound();
                }

                Announcements announcement = _manager.Get((int)id);

                if (announcement == null)
                {
                    return NotFound();
                }

                return PartialView(announcement);

            }
            catch (Exception exc)
            {
                Console.WriteLine(exc.Message);
                return View("Error", GetError(exc));
            }
        }
</code>```

Title: Modal isn't displaying details

Body:
I am trying to get my modal to display details of announcement that has been created. I am using .net core. I have added my details method in my controller and added breakpoints to it and notice that i'm not even hitting my method. I'm new to software development and I'm not sure where I'm going wrong.

I have an announcement model and ViewModel which displays a list of Announcements -> public IEnumerable Announcements {get; set;}.

My button to trigger the modal:

 // View Popup
        $('.btn-view').click(function () {
            var announcementId = $(this).attr("data-id");

            console.log('announcementId:' + announcementId);

            viewAnnouncement(announcementId);
        });

JS to view details:

 // Announcement Details

    function viewAnnouncement(announcementId) {
        try {
            console.log('viewAnnouncement(' + announcementId + ')');

            var url = applicationBaseUrl + '/Admin/Announcements/Details' + announcementId;
            console.log('url: ' + url);

            var label = 'Announcement Details';
            var method = "GET";
            var jsonPayload = null;
            var showPostButton = false;
            var postButtonFunction = null;

            AjaxModal(url, label, jsonPayload, method, showPostButton, postButtonFunction);

        }
        catch (err) {
            alert(err.message);
        }
    };

Method in my controller:

 [HttpGet]
        public async Task<IActionResult> Details(int? id)
        {
            try
            {
                if (id == null)
                {
                    return NotFound();
                }

                Announcements announcement = _manager.Get((int)id);

                if (announcement == null)
                {
                    return NotFound();
                }

                return PartialView(announcement);

            }
            catch (Exception exc)
            {
                Console.WriteLine(exc.Message);
                return View("Error", GetError(exc));
            }
        }


问:
hydrated bloc clear function not update UI
hi everyone how are you ,
i am usaing bloc and hydrated bloc
but when click clear function the UI not update
i am using this source code : https://pub.dev/packages/hydrated_bloc/example</p>


问:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured
```<code>***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class

Action:

Consider the following:
    If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
    If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
</code>```

I have tried using
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
in application properties but still it didn't work.
And even in have tried using
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class }) or
@EnableAutoConfiguration (exclude = {DataSourceAutoConfiguration.class })
then im not gettin any error but the table is getting created in the database.

pom.xml

```<code><dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>
```

Application properties
````
spring.datasource.url=jdbc:mysql://localhost:3306/emp
spring.datasource.username=root1
spring.datasource.password=root@123
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto = create
````

```
package net.codejava;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;

@SpringBootApplication

public class SpringBootRegistrationLoginApplication2 {

    public static void main(String[] args) {
        SpringApplication.run(SpringBootRegistrationLoginApplication2.class, args);

    }`your text`

}
```

```

Body:
***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class

Action:

Consider the following:
    If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
    If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

I have tried using
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
in application properties but still it didn't work.
And even in have tried using
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class }) or
@EnableAutoConfiguration (exclude = {DataSourceAutoConfiguration.class })
then im not gettin any error but the table is getting created in the database.

pom.xml

<dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>
```

Application properties
````
spring.datasource.url=jdbc:mysql://localhost:3306/emp
spring.datasource.username=root1
spring.datasource.password=root@123
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto = create
````

```
package net.codejava;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;

@SpringBootApplication

public class SpringBootRegistrationLoginApplication2 {

    public static void main(String[] args) {
        SpringApplication.run(SpringBootRegistrationLoginApplication2.class, args);

    }`your text`

}
```


问:
How I can store phone numbers using addressbook component ? FMX
I tried like this. First and Last names are added but phone number is not (Delphi 11, FMX)</p>
```<code>procedure TForm1.ActionAddContactExecute(Sender: TObject);
var
  Contact: TAddressBookContact;
  Phones: TContactPhones;
  eMails: TContactEmails;
  Photo: TBitmapSurface;
begin
  Contact := AddressBook1.CreateContact(FDefaultSource);
  try
    try
      Contact.FirstName := edtFirstName.Text;
      Contact.LastName := edtLastName.Text;

      Phones := TContactPhones.Create;
      try
        Phones.AddPhone(TContactPhone.TLabelKind.Mobile, '767867679678');
        Contact.Phones := Phones;
      finally
        Phones.Free;
      end;

      if not Image1.Bitmap.Size.IsZero then
      begin
        Photo := TBitmapSurface.Create;
        try
          Photo.Assign(Image1.Bitmap);
          Contact.Photo := Photo;
          Image1.Bitmap.SetSize(0, 0);
        finally
          Photo.Free;
        end;
      end;
      // Add the work mail
      eMails := TContactEmails.Create;
      try
        eMails.AddEmail(TContactEmail.TLabelKind.Work, edtWorkMail.Text);
        Contact.eMails := eMails;
      finally
        eMails.Free;
      end;
      // Save a newly created contact to Address Book
      AddressBook1.SaveContact(Contact);

    except
      on E: EAddressBookException do
        ShowMessage('Cannot create the contact.' + E.Message);
    end;

    // Add the contact to the selected group, if any
    try
      if InRange(ComboBox1.ItemIndex, 0, FGroups.Count - 1) then
        AddressBook1.AddContactIntoGroup
          (FGroups.Items[ComboBox1.ItemIndex], Contact);
    except
      on E: EAddressBookException do
        ShowMessage('Cannot add the newly created contact to group.' + E.Message);
    end;

    ListViewContacts.BeginUpdate;
    try
      AddListViewItem(Contact);
    finally
      ListViewContacts.EndUpdate;
    end;
    TabControl1.ActiveTab := TabItemContacts;
  finally
    Contact.Free;
  end;
  // Clear the Add Contact Form
  ClearAddContactForm;
end;
</code>```

Body:
I tried like this. First and Last names are added but phone number is not (Delphi 11, FMX)

procedure TForm1.ActionAddContactExecute(Sender: TObject);
var
  Contact: TAddressBookContact;
  Phones: TContactPhones;
  eMails: TContactEmails;
  Photo: TBitmapSurface;
begin
  Contact := AddressBook1.CreateContact(FDefaultSource);
  try
    try
      Contact.FirstName := edtFirstName.Text;
      Contact.LastName := edtLastName.Text;

      Phones := TContactPhones.Create;
      try
        Phones.AddPhone(TContactPhone.TLabelKind.Mobile, '767867679678');
        Contact.Phones := Phones;
      finally
        Phones.Free;
      end;

      if not Image1.Bitmap.Size.IsZero then
      begin
        Photo := TBitmapSurface.Create;
        try
          Photo.Assign(Image1.Bitmap);
          Contact.Photo := Photo;
          Image1.Bitmap.SetSize(0, 0);
        finally
          Photo.Free;
        end;
      end;
      // Add the work mail
      eMails := TContactEmails.Create;
      try
        eMails.AddEmail(TContactEmail.TLabelKind.Work, edtWorkMail.Text);
        Contact.eMails := eMails;
      finally
        eMails.Free;
      end;
      // Save a newly created contact to Address Book
      AddressBook1.SaveContact(Contact);

    except
      on E: EAddressBookException do
        ShowMessage('Cannot create the contact.' + E.Message);
    end;

    // Add the contact to the selected group, if any
    try
      if InRange(ComboBox1.ItemIndex, 0, FGroups.Count - 1) then
        AddressBook1.AddContactIntoGroup
          (FGroups.Items[ComboBox1.ItemIndex], Contact);
    except
      on E: EAddressBookException do
        ShowMessage('Cannot add the newly created contact to group.' + E.Message);
    end;

    ListViewContacts.BeginUpdate;
    try
      AddListViewItem(Contact);
    finally
      ListViewContacts.EndUpdate;
    end;
    TabControl1.ActiveTab := TabItemContacts;
  finally
    Contact.Free;
  end;
  // Clear the Add Contact Form
  ClearAddContactForm;
end;


问:
onDidContentSizeChange of Monaco Editor is triggered too often with React
I'm trying to use onDidContentSizeChange of Monaco Editor. Here is the code (CodeSandbox: https://codesandbox.io/s/romantic-pike-8kikk9?file=/src/App.js):

```<code>import React, { useRef } from "react";

import Editor from "@monaco-editor/react";

export default function App() {
  const editorRef = useRef(null);

  function handleEditorDidMount(editor, monaco) {
    editorRef.current = editor;
    console.log("inside handleEditorDidMount");
    editorRef.current.onDidContentSizeChange(() => {
      console.log(
        "inside onDidContentSizeChange",
        editorRef.current.getContentHeight()
      );
    });
  }

  return (
    <Editor
      height="90vh"
      defaultLanguage="javascript"
      wordWrap="on"
      onMount={handleEditorDidMount}
    />
  );
}
</code>```

However, the console shows that the event is triggered too often whenever we type on the editor (sometimes 2 emits for 1 type). Does anyone know what's the reason?

Edit 1: the following code in https://microsoft.github.io/monaco-editor/playground.html does not have this problem.

```<code>const width = 300;
const container = document.getElementById('container');
container.style.border = '1px solid #f00';
const editor = monaco.editor.create(container, {
    value: "",
    language: "javascript",
    wordWrap: 'on'
});

editor.onDidContentSizeChange(() => {
    console.log(
    "inside onDidContentSizeChange",
    editor.getContentHeight()
)});
</code>```

Edit 2: updateOptions({ wordWrap: "on" }) solves the problem, I don't know why setting wordWrap as props does not work. https://codesandbox.io/s/admiring-dew-hdxfel?file=/src/App.js

```<code>
import Editor from "@monaco-editor/react";

export default function App() {
  const editorRef = useRef(null);

  function handleEditorDidMount(editor, monaco) {
    editorRef.current = editor;
    console.log("inside handleEditorDidMount");
    editorRef.current.onDidContentSizeChange(() => {
      console.log(
        "inside onDidContentSizeChange",
        editorRef.current.getContentHeight()
      );
    });
    editorRef.current.updateOptions({ wordWrap: "on" });
  }

  return (
    <Editor
      height="90vh"
      defaultLanguage="javascript"
      onMount={handleEditorDidMount}
    />
  );
}
</code>```

Body:
I'm trying to use onDidContentSizeChange of Monaco Editor. Here is the code (CodeSandbox: https://codesandbox.io/s/romantic-pike-8kikk9?file=/src/App.js):

import React, { useRef } from "react";

import Editor from "@monaco-editor/react";

export default function App() {
  const editorRef = useRef(null);

  function handleEditorDidMount(editor, monaco) {
    editorRef.current = editor;
    console.log("inside handleEditorDidMount");
    editorRef.current.onDidContentSizeChange(() => {
      console.log(
        "inside onDidContentSizeChange",
        editorRef.current.getContentHeight()
      );
    });
  }

  return (
    <Editor
      height="90vh"
      defaultLanguage="javascript"
      wordWrap="on"
      onMount={handleEditorDidMount}
    />
  );
}

However, the console shows that the event is triggered too often whenever we type on the editor (sometimes 2 emits for 1 type). Does anyone know what's the reason?

Edit 1: the following code in https://microsoft.github.io/monaco-editor/playground.html does not have this problem.

const width = 300;
const container = document.getElementById('container');
container.style.border = '1px solid #f00';
const editor = monaco.editor.create(container, {
    value: "",
    language: "javascript",
    wordWrap: 'on'
});

editor.onDidContentSizeChange(() => {
    console.log(
    "inside onDidContentSizeChange",
    editor.getContentHeight()
)});

Edit 2: updateOptions({ wordWrap: "on" }) solves the problem, I don't know why setting wordWrap as props does not work. https://codesandbox.io/s/admiring-dew-hdxfel?file=/src/App.js

import Editor from "@monaco-editor/react";

export default function App() {
  const editorRef = useRef(null);

  function handleEditorDidMount(editor, monaco) {
    editorRef.current = editor;
    console.log("inside handleEditorDidMount");
    editorRef.current.onDidContentSizeChange(() => {
      console.log(
        "inside onDidContentSizeChange",
        editorRef.current.getContentHeight()
      );
    });
    editorRef.current.updateOptions({ wordWrap: "on" });
  }

  return (
    <Editor
      height="90vh"
      defaultLanguage="javascript"
      onMount={handleEditorDidMount}
    />
  );
}


问:
Get all column values from database and display in another class in Java using Netbeans
I'm pretty new to Java, but I need help with this. I'm trying to display information from a class method in another class, but I'm only able to display it in the console in the same class.

Here's my code.

```<code>public class Test {

    /**
     * @param args the command line arguments
     */

    private static String a;

    public static String testMethod()
        {
            database.createConnection();
            String query = "SELECT sname from allsale";
            try {
                database.stmt = database.conn.createStatement();
                ResultSet rs = database.stmt.executeQuery(query);
                while(rs.next()) {
                    a = rs.getString(1);
                }
            }
            catch (Exception e)
            {
                JOptionPane.showMessageDialog(null, e.toString());
            }
            return a;
     }

    public static void main(String[] args) {
        String st = testMethod();
        System.out.println(st);
    }

}
</code>```

The code only displays the last value in the database table in the same class or another class. But if I include the System.out.println(a) in the while loop, it prints all the column values plus the last value in the console. How do I return the entire output of the while loop so I can display the values in another class.

Body:
I'm pretty new to Java, but I need help with this. I'm trying to display information from a class method in another class, but I'm only able to display it in the console in the same class.

Here's my code.

public class Test {

    /**
     * @param args the command line arguments
     */

    private static String a;

    public static String testMethod()
        {
            database.createConnection();
            String query = "SELECT sname from allsale";
            try {
                database.stmt = database.conn.createStatement();
                ResultSet rs = database.stmt.executeQuery(query);
                while(rs.next()) {
                    a = rs.getString(1);
                }
            }
            catch (Exception e)
            {
                JOptionPane.showMessageDialog(null, e.toString());
            }
            return a;
     }

    public static void main(String[] args) {
        String st = testMethod();
        System.out.println(st);
    }

}

The code only displays the last value in the database table in the same class or another class. But if I include the System.out.println(a) in the while loop, it prints all the column values plus the last value in the console. How do I return the entire output of the while loop so I can display the values in another class.


问:
Saving fetch response to variable?
First time working with API's, I have added the code of my fetch call below.

I wish to grab the data from the json file to then use within JS / Vue.js to populate data (price, age, size, make,  etc) for a listings page.

I have managed to get the data in to show in the console however when trying to save this to a variable after then .then I don't manage to do this correctly and unsure as to where I have gone wrong?

`

```<code>fetch("./example.json")
    .then(response => {
     return response.json();
})
   .then(data => {
   console.log(data);
})
    .catch(error => {
    console.log(error);
});

</code>```

`

The above code brings the json data in to my console.

My end point is to use the data from the json file to populate listing info for each objects data within the array in the json file.

Thank you

Title: Saving fetch response to variable?

Body:
First time working with API's, I have added the code of my fetch call below.

I wish to grab the data from the json file to then use within JS / Vue.js to populate data (price, age, size, make,  etc) for a listings page.

I have managed to get the data in to show in the console however when trying to save this to a variable after then .then I don't manage to do this correctly and unsure as to where I have gone wrong?

`

fetch("./example.json")
    .then(response => {
     return response.json();
})
   .then(data => {
   console.log(data);
})
    .catch(error => {
    console.log(error);
});

`

The above code brings the json data in to my console.

My end point is to use the data from the json file to populate listing info for each objects data within the array in the json file.

Thank you


问:
Change the tick frequency on the x axis using a for loop
I have some code for changing the frequency of labels which works but I can't figure out how to put it into a loop - I have a lot of labels and ideally would like to get rid of every second one.

ax = plt.gca()
xticks = ax.xaxis.get_major_ticks()
xticks[2].set_visible(False)
xticks[4].set_visible(False)
```
<p>I'm sure this will show how completely I don't understand this: tried handing x to xticks</p>
<pre class="lang-py prettyprint-override"><code>x = 1
xticks[x].set_visible(False)
x += 2
</code>```

My labels aren't dates.

Body:
I have some code for changing the frequency of labels which works but I can't figure out how to put it into a loop - I have a lot of labels and ideally would like to get rid of every second one.

ax = plt.gca()
xticks = ax.xaxis.get_major_ticks()
xticks[2].set_visible(False)
xticks[4].set_visible(False)

I'm sure this will show how completely I don't understand this: tried handing x to xticks

x = 1
xticks[x].set_visible(False)
x += 2

My labels aren't dates.


问:
GIT svn clone - not enough memory for initialization update-ref error
I have a problem during performing git svn clone command:

```<code>git svn clone --trunk="path to specific folder in svn repo" --no-metadata --authors-file=users.txt "path to svn repo" /c/tmpRepo
</code>```

Command is working fine by some minutes and then suddenly I am receiving below error:

```<code>
fatal: not enough memory for initializationupdate-ref -m r43274 refs/remotes/origin/trunk c330a7854ebb5f70a729f82c9e301c7ef07b6038: command returned error: 128
</code>```

I tried to clean up my disk space but it didn't help. Does anyone had similar issue?

Body:
I have a problem during performing git svn clone command:

git svn clone --trunk="path to specific folder in svn repo" --no-metadata --authors-file=users.txt "path to svn repo" /c/tmpRepo

Command is working fine by some minutes and then suddenly I am receiving below error:

fatal: not enough memory for initializationupdate-ref -m r43274 refs/remotes/origin/trunk c330a7854ebb5f70a729f82c9e301c7ef07b6038: command returned error: 128

I tried to clean up my disk space but it didn't help. Does anyone had similar issue?


问:
SystemError: ＜built-in function compile＞ returned NULL without setting an error
When i was using pycharm to process yolov5 codes,i got this wrong,here was my details about my question.

```<code>Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: <built-in function compile> returned NULL without setting an error
</code>```

I tried to decrease the batch_size from 16 to 4.

Body:
When i was using pycharm to process yolov5 codes,i got this wrong,here was my details about my question.

Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: <built-in function compile> returned NULL without setting an error

I tried to decrease the batch_size from 16 to 4.


问:
errno: 150 "Foreign key constraint is incorrectly formed" in django
I already have an existing database and I want to use django to do all the operations except create table with the existing table.

So I added managed = False  under class Meta for all the Models I created.

The database connection is established as follows:

```<code>DATABASES = {
  'default': {
    'ENGINE': 'django.db.backends.mysql',
    'NAME': 'site_db',
    'USER': 'root',
    'HOST': '10.10.11.11',
    'PORT': '3306',
    'OPTIONS': {
        'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
    },
   }
  }
</code>```

When I run python manage.py makemigrations command, Its working fine. But when I run python manage.py migrate im getting the following error:

```<code>  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/core/management/commands/migrate.py", line 349, in handle
    post_migrate_state = executor.migrate(
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/db/migrations/executor.py", line 135, in migrate
    state = self._migrate_all_forwards(
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards
    state = self.apply_migration(
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/db/migrations/executor.py", line 249, in apply_migration
    with self.connection.schema_editor(
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/db/backends/base/schema.py", line 164, in __exit__
    self.execute(sql)
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/db/backends/base/schema.py", line 199, in execute
    cursor.execute(sql, params)
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/db/backends/utils.py", line 103, in execute
    return super().execute(sql, params)
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/db/backends/utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/db/backends/mysql/base.py", line 75, in execute
    return self.cursor.execute(query, args)
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/pymysql/cursors.py", line 148, in execute
    result = self._query(query)
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/pymysql/cursors.py", line 310, in _query
    conn.query(q)
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/pymysql/connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/pymysql/connections.py", line 775, in _read_query_result
    result.read()
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/pymysql/connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/pymysql/connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
django.db.utils.OperationalError: (1005, 'Can\'t create table `site_db`.`django_admin_log` (errno: 150 "Foreign key constraint is incorrectly formed")')
</code>```

Some of the django tables like django_migrations, django_content_type and django_admin_log are being created in the database.

How can I solve this? Need your insight on this one.
Thanks for your time.

Body:
I already have an existing database and I want to use django to do all the operations except create table with the existing table.

So I added managed = False  under class Meta for all the Models I created.

The database connection is established as follows:

DATABASES = {
  'default': {
    'ENGINE': 'django.db.backends.mysql',
    'NAME': 'site_db',
    'USER': 'root',
    'HOST': '10.10.11.11',
    'PORT': '3306',
    'OPTIONS': {
        'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
    },
   }
  }

When I run python manage.py makemigrations command, Its working fine. But when I run python manage.py migrate im getting the following error:

  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/core/management/commands/migrate.py", line 349, in handle
    post_migrate_state = executor.migrate(
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/db/migrations/executor.py", line 135, in migrate
    state = self._migrate_all_forwards(
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards
    state = self.apply_migration(
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/db/migrations/executor.py", line 249, in apply_migration
    with self.connection.schema_editor(
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/db/backends/base/schema.py", line 164, in __exit__
    self.execute(sql)
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/db/backends/base/schema.py", line 199, in execute
    cursor.execute(sql, params)
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/db/backends/utils.py", line 103, in execute
    return super().execute(sql, params)
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/db/backends/utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/django/db/backends/mysql/base.py", line 75, in execute
    return self.cursor.execute(query, args)
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/pymysql/cursors.py", line 148, in execute
    result = self._query(query)
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/pymysql/cursors.py", line 310, in _query
    conn.query(q)
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/pymysql/connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/pymysql/connections.py", line 775, in _read_query_result
    result.read()
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/pymysql/connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/pymysql/connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/home/s30python-02/anaconda3/envs/test/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
django.db.utils.OperationalError: (1005, 'Can\'t create table `site_db`.`django_admin_log` (errno: 150 "Foreign key constraint is incorrectly formed")')

Some of the django tables like django_migrations, django_content_type and django_admin_log are being created in the database.

How can I solve this? Need your insight on this one.
Thanks for your time.