问:
Why run_app() in {golem} starts the shiny app?
The run_app() function in {golem} returns an object of class shiny.appobj, as far as I understand, since this is what is returned by with_golem_options() with the default parameter print=FALSE, inside run_app(). How does this object get "printed", i.e. the app executed?

I do not see any difference in calling with_golem_options() with print=FALSE or print=TRUE. In both cases, the shiny app starts normally.


来源: stackexchange

问:
Using Batik Swing component to react on mouse actions
I followed the tutorial on Batic swing components web site
but could not figure out how to register and interact with the svgCanvas object.

My needs:

Show a SVG drawing (works)

Show info when mouse over an object (works by default). But I don't know how to show my own information. Ideally I would get a callback with the object name and could return what to show.

Get a call with the object name as parameter when the user clicks on an SVG element

Is there an example how to do that?

I understood that I need to register an interaction handler. But got stuck with

```<code>List interactors = svgCanvas.getInteractors();
</code>```

How to register a new interactor that reacts on mouse down and returns the SVG element the user clicked on? How must the interactor look like?

ContentLicense: CC BY-SA 4.0

Body:
I followed the tutorial on Batic swing components web site
but could not figure out how to register and interact with the svgCanvas object.

My needs:

Show a SVG drawing (works)

Show info when mouse over an object (works by default). But I don't know how to show my own information. Ideally I would get a callback with the object name and could return what to show.

Get a call with the object name as parameter when the user clicks on an SVG element

Is there an example how to do that?

I understood that I need to register an interaction handler. But got stuck with

List interactors = svgCanvas.getInteractors();

How to register a new interactor that reacts on mouse down and returns the SVG element the user clicked on? How must the interactor look like?


问:
Access kubernetes-dashboard using ingess ( 404 Not Found )
I'm relatively new to k8s and was following an tutorial to get familiar with it. There was a example on exposing kubernetes-dashboard via ingress and I tried to try it.

Configured kubernetes-dashboard by running following. As per its documentation.
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.6.1/aio/deploy/recommended.yaml

But different from the tutorial kubernetes-dashboard was exposed via port 443

```<code>service/dashboard-metrics-scraper   ClusterIP   10.108.119.138   <none>        8000/TCP   50m
service/kubernetes-dashboard        ClusterIP   10.100.58.17     <none>        443/TCP    50m
</code>```

So I changed the ingress configuration yaml accordingly.

```<code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
  name: ingress-dashboard
  namespace: kubernetes-dashboard
spec:
  rules:
  - host: k8s-dashboard.com
    http:
      paths:
      - pathType: Prefix
        path: /
        backend:
          service:
            name: kubernetes-dashboard
            port:
              number: 443
</code>```

Then I describe the ingress and get the ip and added an entry in /etc/hosts for it

```<code>kubectl describe ingress ingress-dashboard -n kubernetes-dashboard
Name:             ingress-dashboard
Labels:           <none>
Namespace:        kubernetes-dashboard
Address:          192.168.49.2
Ingress Class:    <none>
Default backend:  <default>
Rules:
  Host               Path  Backends
  ----               ----  --------
  k8s-dashboard.com
                     /   kubernetes-dashboard:443 (172.17.0.6:8443)
Annotations:         kubernetes.io/ingress.class: nginx
                     nginx.ingress.kubernetes.io/backend-protocol: HTTPS
Events:
  Type    Reason  Age                From                      Message
  ----    ------  ----               ----                      -------
  Normal  Sync    24m (x2 over 25m)  nginx-ingress-controller  Scheduled for sync
</code>```

/etc/hosts change

```<code>192.168.49.2    k8s-dashbaord.com
</code>```

When tried to access k8s-dashbaord.com. I get a 404 Not Found from nginx. So it seems like ingress is running but it cannot reach the service.

The ip mapped to ingress rule seems to be wrong though. (172.17.0.6:8443). Because that is not the ip of the service.

What am I doing wrong here?

P.S

If I just to a proxy ( kubectl proxy ) and access dashboard it works fine.

Body:
I'm relatively new to k8s and was following an tutorial to get familiar with it. There was a example on exposing kubernetes-dashboard via ingress and I tried to try it.

Configured kubernetes-dashboard by running following. As per its documentation.
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.6.1/aio/deploy/recommended.yaml

But different from the tutorial kubernetes-dashboard was exposed via port 443

service/dashboard-metrics-scraper   ClusterIP   10.108.119.138   <none>        8000/TCP   50m
service/kubernetes-dashboard        ClusterIP   10.100.58.17     <none>        443/TCP    50m

So I changed the ingress configuration yaml accordingly.

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
  name: ingress-dashboard
  namespace: kubernetes-dashboard
spec:
  rules:
  - host: k8s-dashboard.com
    http:
      paths:
      - pathType: Prefix
        path: /
        backend:
          service:
            name: kubernetes-dashboard
            port:
              number: 443

Then I describe the ingress and get the ip and added an entry in /etc/hosts for it

kubectl describe ingress ingress-dashboard -n kubernetes-dashboard
Name:             ingress-dashboard
Labels:           <none>
Namespace:        kubernetes-dashboard
Address:          192.168.49.2
Ingress Class:    <none>
Default backend:  <default>
Rules:
  Host               Path  Backends
  ----               ----  --------
  k8s-dashboard.com
                     /   kubernetes-dashboard:443 (172.17.0.6:8443)
Annotations:         kubernetes.io/ingress.class: nginx
                     nginx.ingress.kubernetes.io/backend-protocol: HTTPS
Events:
  Type    Reason  Age                From                      Message
  ----    ------  ----               ----                      -------
  Normal  Sync    24m (x2 over 25m)  nginx-ingress-controller  Scheduled for sync

/etc/hosts change

192.168.49.2    k8s-dashbaord.com

When tried to access k8s-dashbaord.com. I get a 404 Not Found from nginx. So it seems like ingress is running but it cannot reach the service.

The ip mapped to ingress rule seems to be wrong though. (172.17.0.6:8443). Because that is not the ip of the service.

What am I doing wrong here?

P.S

If I just to a proxy ( kubectl proxy ) and access dashboard it works fine.


问:
Apache superset fails to build on Mac m1 chip
I'm trying to build apache superset on MacOS Monterey with M1 chip.
Using this link https://superset.apache.org/docs/installation/installing-superset-from-scratch/ I tried to build superset in local and build fails at running command pip install apache-superset

Here is the terminal output.

```<code>     clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -Werror=implicit-function-declaration -arch arm64 -DNPY_NO_DEPRECATED_API=0 -I./pandas/_libs -Ipandas/_libs/src/klib -I/private/var/folders/90/lt6mj6m14t9cxxh8d9vp8z8c0000gq/T/pip-build-env-v3ffq4z2/overlay/lib/python3.9/site-packages/numpy/core/include -I/Users/vkancharla/projects/workfusion-superset/superset/apache-superset/venv/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -c pandas/_libs/algos.c -o build/temp.macosx-10.9-universal2-cpython-39/pandas/_libs/algos.o -Wno-error=unreachable-code
      pandas/_libs/algos.c:45:10: fatal error: 'Python.h' file not found
      #include "Python.h"
               ^~~~~~~~~~
      1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pandas
  Building wheel for python-geohash (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [25 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.9-universal2-cpython-39
      copying geohash.py -> build/lib.macosx-10.9-universal2-cpython-39
      copying quadtree.py -> build/lib.macosx-10.9-universal2-cpython-39
      copying jpgrid.py -> build/lib.macosx-10.9-universal2-cpython-39
      copying jpiarea.py -> build/lib.macosx-10.9-universal2-cpython-39
      running build_ext
      building '_geohash' extension
      creating build/temp.macosx-10.9-universal2-cpython-39
      creating build/temp.macosx-10.9-universal2-cpython-39/src
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -Werror=implicit-function-declaration -arch arm64 -DPYTHON_MODULE=1 -I/Users/vkancharla/projects/workfusion-superset/superset/apache-superset/venv/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -c src/geohash.cpp -o build/temp.macosx-10.9-universal2-cpython-39/src/geohash.o
      src/geohash.cpp:14:9: warning: '__STDC_CONSTANT_MACROS' macro redefined [-Wmacro-redefined]
      #define __STDC_CONSTANT_MACROS 1
              ^
      /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/stdint.h:120:12: note: previous definition is here
      #   define __STDC_CONSTANT_MACROS
                 ^
      src/geohash.cpp:538:10: fatal error: 'Python.h' file not found
      #include <Python.h>
               ^~~~~~~~~~
      1 warning and 1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for python-geohash
  Running setup.py clean for python-geohash
Failed to build pandas python-geohash
ERROR: Could not build wheels for pandas, which is required to install pyproject.toml-based projects
</code>```

Body:
I'm trying to build apache superset on MacOS Monterey with M1 chip.
Using this link https://superset.apache.org/docs/installation/installing-superset-from-scratch/ I tried to build superset in local and build fails at running command pip install apache-superset

Here is the terminal output.

     clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -Werror=implicit-function-declaration -arch arm64 -DNPY_NO_DEPRECATED_API=0 -I./pandas/_libs -Ipandas/_libs/src/klib -I/private/var/folders/90/lt6mj6m14t9cxxh8d9vp8z8c0000gq/T/pip-build-env-v3ffq4z2/overlay/lib/python3.9/site-packages/numpy/core/include -I/Users/vkancharla/projects/workfusion-superset/superset/apache-superset/venv/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -c pandas/_libs/algos.c -o build/temp.macosx-10.9-universal2-cpython-39/pandas/_libs/algos.o -Wno-error=unreachable-code
      pandas/_libs/algos.c:45:10: fatal error: 'Python.h' file not found
      #include "Python.h"
               ^~~~~~~~~~
      1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pandas
  Building wheel for python-geohash (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [25 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.9-universal2-cpython-39
      copying geohash.py -> build/lib.macosx-10.9-universal2-cpython-39
      copying quadtree.py -> build/lib.macosx-10.9-universal2-cpython-39
      copying jpgrid.py -> build/lib.macosx-10.9-universal2-cpython-39
      copying jpiarea.py -> build/lib.macosx-10.9-universal2-cpython-39
      running build_ext
      building '_geohash' extension
      creating build/temp.macosx-10.9-universal2-cpython-39
      creating build/temp.macosx-10.9-universal2-cpython-39/src
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -Werror=implicit-function-declaration -arch arm64 -DPYTHON_MODULE=1 -I/Users/vkancharla/projects/workfusion-superset/superset/apache-superset/venv/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -c src/geohash.cpp -o build/temp.macosx-10.9-universal2-cpython-39/src/geohash.o
      src/geohash.cpp:14:9: warning: '__STDC_CONSTANT_MACROS' macro redefined [-Wmacro-redefined]
      #define __STDC_CONSTANT_MACROS 1
              ^
      /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/stdint.h:120:12: note: previous definition is here
      #   define __STDC_CONSTANT_MACROS
                 ^
      src/geohash.cpp:538:10: fatal error: 'Python.h' file not found
      #include <Python.h>
               ^~~~~~~~~~
      1 warning and 1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for python-geohash
  Running setup.py clean for python-geohash
Failed to build pandas python-geohash
ERROR: Could not build wheels for pandas, which is required to install pyproject.toml-based projects


问:
Required rule for group of checkboxed
Shared answer https://stackoverflow.com/a/71804470/20847211

**How can i use required rule for group of checkboxes in this code **

```<code>import React, { useState } from 'react'
import { useForm } from 'react-hook-form'

export default function App() {
  const {
    register,
    handleSubmit,
    formState: { errors },
  } = useForm({
    defaultValues: { months: ['January'] },
  })

  const onSubmit = (data: any) => console.log(data)
  console.log(errors)

  return (
    <div className='mx-auto justify-center p-32 flex'>
      <form onSubmit={handleSubmit(onSubmit)}>
        <div className='p-2'>
          <label htmlFor=''>January</label>
          <input
            type='checkbox'
            value='January'
            placeholder='January'
            {...register('months')}
            className='mx-3'
          />
        </div>
        <div className='p-2'>
          <label htmlFor=''>February</label>
          <input
            type='checkbox'
            value='February'
            placeholder='February'
            {...register('months')}
            className='mx-3'
          />
        </div>

</code>```

I tried to place required to fields, but it'nt working

Title: Required rule for group of checkboxed

Body:
Shared answer https://stackoverflow.com/a/71804470/20847211

**How can i use required rule for group of checkboxes in this code **

import React, { useState } from 'react'
import { useForm } from 'react-hook-form'

export default function App() {
  const {
    register,
    handleSubmit,
    formState: { errors },
  } = useForm({
    defaultValues: { months: ['January'] },
  })

  const onSubmit = (data: any) => console.log(data)
  console.log(errors)

  return (

      <form onSubmit={handleSubmit(onSubmit)}>

          January
          <input
            type='checkbox'
            value='January'
            placeholder='January'
            {...register('months')}
            className='mx-3'
          />

          February
          <input
            type='checkbox'
            value='February'
            placeholder='February'
            {...register('months')}
            className='mx-3'
          />

I tried to place required to fields, but it'nt working


问:
How do I call a code image to use in HTML?
I'm using this code to create a QR code (C#):

```<code>string text = "QRCode test";
            QRCodeGenerator qr = new QRCodeGenerator();
            QRCodeData data = qr.CreateQrCode(text, QRCodeGenerator.ECCLevel.Q);
            QRCode code = new QRCode(data);

            Image img = code.GetGraphic(5);
</code>```

Then I'm trying to insert it into an HTML like this (HTML):

```<code><img src='{img}'>
</code>```

I don't know how to do for the image to get to the code because from what I know the "src" only goes to the device or the internet.

Body:
I'm using this code to create a QR code (C#):

string text = "QRCode test";
            QRCodeGenerator qr = new QRCodeGenerator();
            QRCodeData data = qr.CreateQrCode(text, QRCodeGenerator.ECCLevel.Q);
            QRCode code = new QRCode(data);

            Image img = code.GetGraphic(5);

Then I'm trying to insert it into an HTML like this (HTML):

I don't know how to do for the image to get to the code because from what I know the "src" only goes to the device or the internet.


问:
Stopwatch restarts each time a new component is added. ReactJS
Brief obligatory 'Im new and completely lost, please take pity'.

I have this react component which iterates through the openOrders array, and invokes the SingleOpenOrder for each order. The SingleOpenOrder component displays some details and starts a stopwatch for the time when the order was placed.

My issue is that each times a new order is added, all the timers get reset. I know there is probably a simple solution, but for the life of me I cant figure it out.

I played around a lot and learned a good bit about state, rerenders etc; but at this stage I am going in circles and thus getting nowhere.Please help.
PS i stripped out the code which I dont think is nescessary.

```<code>import React, from "react";
import { menuContext } from "./MenuContext";
import SingleOpenOrder from "./SingleOpenOrder";

export default function OpenOrders() {
  const { openOrders } = useContext(menuContext);

  return (
    <div>
      {openOrders &&
        openOrders.map((order) => {
          return <SingleOpenOrder key={order.orderId} order={order} />;
        })}
    </div>
  );
}

</code>```
```<code>
import { useStopwatch } from "react-timer-hook";
import React, { useContext } from "react";

function Stopwatch() {

//useStopwatch - npm package react-timer-hook
  const { seconds, minutes } = useStopwatch({ autoStart: true });

  return (
    <div >
      {minutes}:{seconds}
    </div>
  );
}

export default function SingleOpenOrder({ order }: { order: OrderDetails }) {
  return (
    <div>
      <Stopwatch />
      <div>
        {order.orderItemDetails.map((item) => {
            return (
              <div  key={item.itemId}>
                {item.name}
              </div>
            )
        })}
      </div>
    </div>
  );
}

</code>```

I experimented with useRef in an attempt to persist state between renders.

useEffect to only start the stopwatch when the component mounts.

React.memo to try and memoize the component.

The useStopwatch hook takes an 'offsetTimestamp' Date object.

I tried creating a useref with the time the order was placed, and subtracting the current time, to offset the stopwatch start time.

Following on from Rango's comment, I have spent all day experimenting with and editing my code. I believe Rango is on to something, in that the array is being mutated somehow, which is causing the problem.

I useImmer for state in menuContext

```<code>  const [openOrders, setOpenOrders] = useImmer([] as OrderDetails[]);
</code>```

And update with a new order like this

```<code> // Add the order to an array of open Orders
 setOpenOrders((cur) => [orderDetails, ...cur]);
</code>```

I think this should be ok?

This is my first real bug. I have been trying to fix it for a few days and I think im slowly losing my mind. Does that mean im a coder yet?

https://github.com/Fishamble/kitchenpos
The full code is here if anyone would be kind enough to have a look. Thanks.

Body:
Brief obligatory 'Im new and completely lost, please take pity'.

I have this react component which iterates through the openOrders array, and invokes the SingleOpenOrder for each order. The SingleOpenOrder component displays some details and starts a stopwatch for the time when the order was placed.

My issue is that each times a new order is added, all the timers get reset. I know there is probably a simple solution, but for the life of me I cant figure it out.

I played around a lot and learned a good bit about state, rerenders etc; but at this stage I am going in circles and thus getting nowhere.Please help.
PS i stripped out the code which I dont think is nescessary.

import React, from "react";
import { menuContext } from "./MenuContext";
import SingleOpenOrder from "./SingleOpenOrder";

export default function OpenOrders() {
  const { openOrders } = useContext(menuContext);

  return (

      {openOrders &&
        openOrders.map((order) => {
          return <SingleOpenOrder key={order.orderId} order={order} />;
        })}

  );
}

import { useStopwatch } from "react-timer-hook";
import React, { useContext } from "react";

function Stopwatch() {

//useStopwatch - npm package react-timer-hook
  const { seconds, minutes } = useStopwatch({ autoStart: true });

  return (

      {minutes}:{seconds}

  );
}

export default function SingleOpenOrder({ order }: { order: OrderDetails }) {
  return (

      <Stopwatch />

        {order.orderItemDetails.map((item) => {
            return (

                {item.name}

            )
        })}

  );
}

I experimented with useRef in an attempt to persist state between renders.

useEffect to only start the stopwatch when the component mounts.

React.memo to try and memoize the component.

The useStopwatch hook takes an 'offsetTimestamp' Date object.

I tried creating a useref with the time the order was placed, and subtracting the current time, to offset the stopwatch start time.

Following on from Rango's comment, I have spent all day experimenting with and editing my code. I believe Rango is on to something, in that the array is being mutated somehow, which is causing the problem.

I useImmer for state in menuContext

  const [openOrders, setOpenOrders] = useImmer([] as OrderDetails[]);

And update with a new order like this

 // Add the order to an array of open Orders
 setOpenOrders((cur) => [orderDetails, ...cur]);

I think this should be ok?

This is my first real bug. I have been trying to fix it for a few days and I think im slowly losing my mind. Does that mean im a coder yet?

https://github.com/Fishamble/kitchenpos
The full code is here if anyone would be kind enough to have a look. Thanks.


问:
Is it feasible to use mongodb realm in react native with redux toolkit ? any tutorial available for the same

is there any documentation or any tutorial which shows uses of both realm and redux toolkits?
Will the application size goes long with this ?


问:
Passing functions inside $$eval or $eval func., Puppeter.js
For example, I have a list of selectors:

```<code>const rowId = 4;
const mainNestedRowSelector = (selector: string) => `[id*=":cTT_${selector}"] .ui-treetable-toggler-custom`
const GRAY_BACKGROUND = 'bgGreyAggregated';
const rowSelector = (selector: string) => `[id*=":cTT_${selector}"]`;
const wagonSelector =(selector: string)=> `[id="tabForm:dispositionTabPanel:correlations:cTT_${selector}"]`;
</code>```

How can I pass the into this $$eval func?

Body:
For example, I have a list of selectors:

const rowId = 4;
const mainNestedRowSelector = (selector: string) => `[id*=":cTT_${selector}"] .ui-treetable-toggler-custom`
const GRAY_BACKGROUND = 'bgGreyAggregated';
const rowSelector = (selector: string) => `[id*=":cTT_${selector}"]`;
const wagonSelector =(selector: string)=> `[id="tabForm:dispositionTabPanel:correlations:cTT_${selector}"]`;

How can I pass the into this $$eval func?


问:
The OAuth prompt doesn't go away after the permission is given to the bot
The OAuth prompt doesn't go away after the permission is given to the bot. This prompt keeps showing even after the user has given the permissions.

Prompt message

And when clicked on continue this error comes up .

Error after clicking continue in prompt

Please help me out.

Once the permissions are given the prompt should go away but it is not going in this case.


问:
Webdriver Selenium not loading new page after click()
I´m using selenium to scrape a webpage and it finds the elements on the main page, but when I use the click() function, the driver never finds the elements on the new page. I used beautifulSoup to see if it´s getting the html, but the html is always from the main. (When I see the driver window it shows that the page is opened).

```<code>html = driver.execute_script('return document.documentElement.outerHTML')
soup = bs.BeautifulSoup(html, 'html.parser')
print(soup.prettify)
</code>```

I´ve used webDriverWait() to see if it´s not loading but even after 60 seconds it never does,

```<code>element = WebDriverWait(driver, 60).until(EC.presence_of_element_located((By.ID, "ddlProducto")))
</code>```

also execute_script() to check if by clicking the button using javascript loads the page, but it returns None when I print a variable saving the new page.

```<code>selectProducto = driver.execute_script("return document.getElementById('ddlProducto');")
print(selectProducto)
</code>```

Also used chwd = driver.window_handles and driver.switch_to_window(chwd[1]) but it says that the index is out of range.

```<code>chwd = driver.window_handles
driver.switch_to.window(chwd[1])
</code>```

Body:
I´m using selenium to scrape a webpage and it finds the elements on the main page, but when I use the click() function, the driver never finds the elements on the new page. I used beautifulSoup to see if it´s getting the html, but the html is always from the main. (When I see the driver window it shows that the page is opened).

html = driver.execute_script('return document.documentElement.outerHTML')
soup = bs.BeautifulSoup(html, 'html.parser')
print(soup.prettify)

I´ve used webDriverWait() to see if it´s not loading but even after 60 seconds it never does,

element = WebDriverWait(driver, 60).until(EC.presence_of_element_located((By.ID, "ddlProducto")))

also execute_script() to check if by clicking the button using javascript loads the page, but it returns None when I print a variable saving the new page.

selectProducto = driver.execute_script("return document.getElementById('ddlProducto');")
print(selectProducto)

Also used chwd = driver.window_handles and driver.switch_to_window(chwd[1]) but it says that the index is out of range.

chwd = driver.window_handles
driver.switch_to.window(chwd[1])


问:
Anaconda environment not showing in Anaconda Navigator
I was running something in Spyder overnight, only to wake up and see that it had crashed.  I'd been having a few issues with this code, so I didn't think much of it and just tried to close and reopen Spyder (after not being able to restart the kernel).

When I tried to do that, Spyder was unable to open, so I went into Mac time machine and copied a previous version of the conda environment to replace it in the env path.

After doing this, the environment no longer shows in Anaconda Navigator.  When I create a new environment in the terminal, Navigator will pick it up but not the existing environment.  What's also odd is that Navigator shows the other environments in the same location and also shows a miniforge3 environment, even though running conda env list does not include this.  Anaconda Navigator is installed in /opt/anaconda3 but miniforge3 is installed separately.

I'm not sure what's standard and what's not in terms of having both anaconda3 and miniforge3 installed.  I had a lot of difficulty in installing everything on M1 Mac, so I might have done it in a non-standard way, but it worked until now.

Ultimately, I just need Anaconda Navigator to detect an existing environment.  I can launch Spyder through the terminal by activating the environment, but I want it to show up in Anaconda Navigator.


问:
Datatable export button not showing
I am working with a student management system. Where I have filtered the data using datatable. But the export button (pdf, copy, excel) of the datatable is not working properly. All other datatable options are working correctly.</p>
```<code>       <script>
    $(document).ready(function(){
        var dataTable = $('#example').DataTable({
            'processing': true,
            'serverSide': true,
            'serverMethod': 'post',
            'ajax': {
                'url':'log_filter.php',
                'data': function(data){
                    // Read values
                    var username = $('#searchByAgent').val();
                    var intake_name = $('#searchByIntake').val();
                    var tm = $('#searchByUniversity').val();
                    var status = $('#searchByStatus').val();
                    var name = $('#searchByName').val();
                    var fullname = $('#searchByCounsellor').val();

                    // Append to data
                    data.searchByAgent = username;
                    data.searchByIntake = intake_name;
                    data.searchByUniversity = tm;
                    data.searchByStatus = status;
                    data.searchByName = name;
                    data.searchByCounsellor = fullname;
                }
            },

            'columns': [
                { data: 'status' },
                { data: 'startdate' },
                { data: 'enddate' },
                { data: 'tm' },
                { data: 'dtm' },
                { data: 'date' },
                { data: 'course_id' }

            ],

            dom: 'Bfrtip',
            buttons: [
           'copyHtml5', 'excelHtml5', 'pdfHtml5', 'csvHtml5'
            ]
        });
    });
    </script>
</code>```

Title: Datatable export button not showing


问:
Issue in Google Cloud Function on Parsing HTML from a URL using pandas and requests
I am trying to use the pandas and requests packages to parse HTML from a URL in a Google Cloud Function, but I am encountering an issue. I have installed and imported the required packages in my code, but when I try to run the function, it fails with an error. I have checked the logs, but there are no error messages. Can anyone help me troubleshoot this issue and get my code working in a Google Cloud Function?

python Code used

```<code>import pandas as pd
import requests
def data_collection(collect):
    url = "http://www.indianspices.com/indianspices/marketing/price/domestic/daily-price-small.html?page=1"
    response = requests.get(url)
    df = pd.read_html(response.content)[1]
    return "passed"
</code>```

python Text
requests==2.28.1
pandas==1.5.2

Error showing as

Error: function terminated. Recommended action: inspect logs for termination reason. Additional troubleshooting documentation can be found at https://cloud.google.com/functions/docs/troubleshooting#logging Details:
500 Internal Server Error: The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

Can anyone help me troubleshoot this issue and get my code working in a Google Cloud Function

Body:
I am trying to use the pandas and requests packages to parse HTML from a URL in a Google Cloud Function, but I am encountering an issue. I have installed and imported the required packages in my code, but when I try to run the function, it fails with an error. I have checked the logs, but there are no error messages. Can anyone help me troubleshoot this issue and get my code working in a Google Cloud Function?

python Code used

import pandas as pd
import requests
def data_collection(collect):
    url = "http://www.indianspices.com/indianspices/marketing/price/domestic/daily-price-small.html?page=1"
    response = requests.get(url)
    df = pd.read_html(response.content)[1]
    return "passed"

python Text
requests==2.28.1
pandas==1.5.2

Error showing as

Error: function terminated. Recommended action: inspect logs for termination reason. Additional troubleshooting documentation can be found at https://cloud.google.com/functions/docs/troubleshooting#logging Details:
500 Internal Server Error: The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

Can anyone help me troubleshoot this issue and get my code working in a Google Cloud Function


问:
Why does Django app through an error when run in a Docker container
Am building a Django microfrontend App using in docker. When i run the dev server with

```<code>python manage.py runserver
```, the app spins up at
```
<p>http://127.0.0.1:8000/</p>
```but after configuration with Dockerfile and docker-compose.yml, as
**Dockerfile**

```
```FROM python:3.9
ENV PYTHONUNBUFFERED 1
WORKDIR /app
COPY requirements.txt /app/requirements.txt
RUN pip install -r requirements.txt
COPY . /app

CMD python manage.py runserver 8.8.0.0:8000

```
```
**docker-compose.yml**

```
```version: '3.8'
services:
  backend:
   build:
    context: .
    dockerfile: Dockerfile
   ports:
    - 8000:8000
   volumes:
    - .:/app
   depends_on:
    - db

  db:
    image: mysql:5.7.22
    restart: always
    environment:
      MYSQL_DATABASE: admin
      MYSQL_USER: root
      MYSQL_ROOT_PASSWORD: root
    volumes:
      - .dbdata:/var/lib/mysql
    ports:
      - 33066:3306

```
```
```
<p>docker-compose up</p>
```throughs the error;

```
<p>Django version 3.1.3, using settings 'admin.settings'
backend_1  | Starting development server at http://8.8.0.0:8000/
backend_1  | Quit the server with CONTROL-C.
backend_1  | Error: That IP address can't be assigned to.
admin_backend_1 exited with code 1</p>
```what am I doing  wrong, thanks

tried to change the server port at

```
```CMD python manage.py runserver 8.8.0.0:8000

```
```to

```
```but after configuration with Dockerfile and docker-compose.yml, as
**Dockerfile**

```0
```but after configuration with Dockerfile and docker-compose.yml, as
**Dockerfile**

```1

Body:
Am building a Django microfrontend App using in docker. When i run the dev server with

python manage.py runserver
```, the app spins up at

http://127.0.0.1:8000/

but after configuration with Dockerfile and docker-compose.yml, as
**Dockerfile**

FROM python:3.9
ENV PYTHONUNBUFFERED 1
WORKDIR /app
COPY requirements.txt /app/requirements.txt
RUN pip install -r requirements.txt
COPY . /app

CMD python manage.py runserver 8.8.0.0:8000

**docker-compose.yml**

version: '3.8'
services:
  backend:
   build:
    context: .
    dockerfile: Dockerfile
   ports:
    - 8000:8000
   volumes:
    - .:/app
   depends_on:
    - db

  db:
    image: mysql:5.7.22
    restart: always
    environment:
      MYSQL_DATABASE: admin
      MYSQL_USER: root
      MYSQL_ROOT_PASSWORD: root
    volumes:
      - .dbdata:/var/lib/mysql
    ports:
      - 33066:3306

docker-compose up

throughs the error;

Django version 3.1.3, using settings 'admin.settings'
backend_1  | Starting development server at http://8.8.0.0:8000/
backend_1  | Quit the server with CONTROL-C.
backend_1  | Error: That IP address can't be assigned to.
admin_backend_1 exited with code 1

what am I doing  wrong, thanks

tried to change the server port at

CMD python manage.py runserver 8.8.0.0:8000

to

CMD python manage.py runserver 0.0.0.0:8000

expecting to host using my host machine IP address, but all in vain


问:
Sendgrid: The Requester's IP Address is not whitelisted
We are using SendGrid to send emails in our CodeIgniter project. We have whitelisted our Server's IP and it's working fine.

Problem Statement:

Now we have implemented AWS Auto Scaling due to which it attach new server during run time and the IP of new server doesn’t match with the mentioned IP and it start giving mentioned error.

Is there any way that instead of IP we can register our domain on sendgrid?


问:
QtableWidget Signal And Slot Structure
I have a app gui taht contains a table widget. I made it with QTdesigner. I want to take doubleclicked signal for specified columns. But I don't know how I will use signals and slots. I am trying to like below codes. But I couldn't handle signal logic.</p>
```<code>ui.tableWidget.connect(ui.tableWidget, SIGNAL(cellClicked(0,0)), this, SLOT(show_photo_(0,0)));
#ui.tableWidget.cellDoubleClicked.emit(0,1)
#ui.tableWidget.cellDoubleClicked.connect(show_photo_)
</code>```

Title: QtableWidget Signal And Slot Structure

Body:
I have a app gui taht contains a table widget. I made it with QTdesigner. I want to take doubleclicked signal for specified columns. But I don't know how I will use signals and slots. I am trying to like below codes. But I couldn't handle signal logic.

ui.tableWidget.connect(ui.tableWidget, SIGNAL(cellClicked(0,0)), this, SLOT(show_photo_(0,0)));
#ui.tableWidget.cellDoubleClicked.emit(0,1)
#ui.tableWidget.cellDoubleClicked.connect(show_photo_)


问:
How to serve javascript, css and image files (referred by index.html) using istio for Angular based applications
I am trying to expose Angular based UI application using Istio Gateway, in the angular application the static resources are placed in a sub path (eg : demo/assets) , but in the index.html of the angular application the base href path is given as , due to this getting a 404 error as the .js and css files are not available in root conext.

In istio is there any option available to modify the path in index.html from "/" to "demo/assets".
so that the static resources can be loaded properly from the sub path
Please help..

I tried providing re-write option of virtual service to /demo/assets, but on network tab in browser could see still the static resources  ( JavaScript, css) are being still looke on the root conetxt where its not available leading to 404 error.


问:
$data[] = $row array give undefined in php
I used an array to print the data in several dynamically generated drop-down lists, but the result is very disappointing and does not bring the expected values from the database in the drop-down lists that I generate when needed, noting that the first drop-down list, which is outside the dynamic generation context, works well and brings the expected data, but the problem is Any new list generated dynamically, the values will only appear with the word "undefined" Any solution will be greatly appreciated...

here problem as GIF amage
php code:
`

```<code><td class="td"><select class="form-control select_acount" name="account[]"required>
                            <option value="">--الحساب--</option>
                            <?php
                            $query = "select * from sah7atmain_acouts WHERE company like '".$multi."'";
                            $result = mysqli_query($con,$query);
                            $data = array();
                            if($result)
                            {
                              while($row = mysqli_fetch_assoc($result)){
                              $data[] = $row;
                            ?>
                            <?php echo '<option value="'.$row['acount_mounte'].'">'.$row['acount_name'].'</option>'?>;
                            <?php
                            }
                            } else{
                            }
                            ?>
                            </select>
                          </td>
</code>```

jquery dynamic genaration code:

```<code>var data = '<?php echo $data; ?>';
      var product_dd = "";
          product_dd += '<select class="form-control select_acount" name="account[]"required>';
          product_dd += '<option value="">--الحساب--</option>';
      if(data.length > 0){
        for(let i = 0; i < data.length; i ++) {
          product_dd += `<option value="${data[i]['acount_mounte']}">${data[i]['acount_name']}</option>`;
        }
      }
         product_dd += "</select>";

      var i = 0;
      $("#add-btn").click(function() {
        ++i;

        $("#dynamicAddRemove").append('<tr><td class="td">'+product_dd+'</td> <td class="td"><input type="number" name="debtor[' + i + ']" id="fname"class="form-control debtor arabicNumbers" onkeydown="return event.keyCode !== 69" required></td> <td class="td"><input type="number" name="creditor[' + i + ']" id="james" class="form-control creditor arabicNumbers" onkeydown="return event.keyCode !== 69" required></td> <td class="td"><input type="text"  name="description[' + i + ']" class="form-control"  required></td> <td> <input type="text" name="mount[' + i + ']" class="form-control mount"   required> </td><button type="button" name="add" class="btn btn-danger remove-tr"><i class="fas fa-trash-alt"></i></button></td></tr>');
      });
      $(document).on('click', '.remove-tr', function() {
        $(this).parents('tr').remove();
      });
</code>```

`

Body:
I used an array to print the data in several dynamically generated drop-down lists, but the result is very disappointing and does not bring the expected values from the database in the drop-down lists that I generate when needed, noting that the first drop-down list, which is outside the dynamic generation context, works well and brings the expected data, but the problem is Any new list generated dynamically, the values will only appear with the word "undefined" Any solution will be greatly appreciated...

here problem as GIF amage
php code:
`

<select class="form-control select_acount" name="account[]"required>
                            <option value="">--الحساب--</option>
                            <?php
                            $query = "select * from sah7atmain_acouts WHERE company like '".$multi."'";
                            $result = mysqli_query($con,$query);
                            $data = array();
                            if($result)
                            {
                              while($row = mysqli_fetch_assoc($result)){
                              $data[] = $row;
                            ?>
                            <?php echo '<option value="'.$row['acount_mounte'].'">'.$row['acount_name'].'</option>'?>;
                            <?php
                            }
                            } else{
                            }
                            ?>
                            </select>

jquery dynamic genaration code:

var data = '<?php echo $data; ?>';
      var product_dd = "";
          product_dd += '<select class="form-control select_acount" name="account[]"required>';
          product_dd += '<option value="">--الحساب--</option>';
      if(data.length > 0){
        for(let i = 0; i < data.length; i ++) {
          product_dd += `<option value="${data[i]['acount_mounte']}">${data[i]['acount_name']}</option>`;
        }
      }
         product_dd += "</select>";

      var i = 0;
      $("#add-btn").click(function() {
        ++i;

        $("#dynamicAddRemove").append('
'+product_dd+'	 <input type="number" name="debtor[' + i + ']" id="fname"class="form-control debtor arabicNumbers" onkeydown="return event.keyCode !== 69" required>	 <input type="number" name="creditor[' + i + ']" id="james" class="form-control creditor arabicNumbers" onkeydown="return event.keyCode !== 69" required>	 <input type="text"  name="description[' + i + ']" class="form-control"  required>	  <input type="text" name="mount[' + i + ']" class="form-control mount"   required> 	<button type="button" name="add" class="btn btn-danger remove-tr"></button>
');
      });
      $(document).on('click', '.remove-tr', function() {
        $(this).parents('tr').remove();
      });

`


问:
Gradle installation error : Plugin [id: 'com.android.application', version: '7.3.1', apply: false] was not found in any of the following sources
I've installed Android.Studio.2021.3.1.17.x64 and then i installed Sdk from mega with no error but when i wanted to create a new project in java, android studio automatically started to download gradle and it returned this error:

Plugin [id: 'com.android.application', version: '7.3.1', apply: false] was not found in any of the following sources

also the build.gradle file (project level) is:

```<code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
    id 'com.android.application' version '7.3.1' apply false
    id 'com.android.library' version '7.3.1' apply false
}
</code>```

i used vpn and tried gradle in offline mode but it did'nt solve the problem.

Creating a new android project, in gradle installation

Body:
I've installed Android.Studio.2021.3.1.17.x64 and then i installed Sdk from mega with no error but when i wanted to create a new project in java, android studio automatically started to download gradle and it returned this error:

Plugin [id: 'com.android.application', version: '7.3.1', apply: false] was not found in any of the following sources

also the build.gradle file (project level) is:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
    id 'com.android.application' version '7.3.1' apply false
    id 'com.android.library' version '7.3.1' apply false
}

i used vpn and tried gradle in offline mode but it did'nt solve the problem.

Creating a new android project, in gradle installation


问:
integration of google ads in an expandable list view adapter (BaseExpandableView)
how do I add google ads in an expandable list view adapter (BaseExpandableView) ?

what i have done  -> added the addview in the xml layout of parentView (issue - working but not expanding).

what i want as fully working approach -> independent addview as a parent which i can interchange with even no. of positions .

here is the code ->

```<code>class RecordExpandableListAdapterCllRcc(
val mContext: Context,
private val viewModelCllRcc: RecordHistoryViewModelCllRcc,
private val lifecycleOwnerCllRcc: LifecycleOwner): BaseExpandableListAdapter() {

var recordsListCllRccCllRcc: MutableList<RecordCllRcc> = mutableListOf()
    set(valueCllRcc) {
        field = valueCllRcc
        notifyDataSetChanged()
    }

override fun getGroupCount(): Int {
    return recordsListCllRccCllRcc.size
}

override fun getChildrenCount(groupPositionCllRcc: Int): Int = 1

override fun getGroup(groupPositionCllRcc: Int): RecordCllRcc {
    return recordsListCllRccCllRcc[groupPositionCllRcc]
}

override fun getChild(groupPositionCllRcc: Int, childPositionCllRcc: Int): RecordCllRcc =
    recordsListCllRccCllRcc[groupPositionCllRcc]

override fun getGroupId(groupPositionCllRcc: Int): Long = groupPositionCllRcc.toLong()

override fun getChildId(groupPositionCllRcc: Int, childPositionCllRcc: Int): Long {

    return childPositionCllRcc.toLong()
}
override fun hasStableIds(): Boolean {
    return true
}

override fun getGroupView(
    groupPositionCllRcc: Int,
    isExpandedCllRcc: Boolean,
    convertViewCllRcc: View?,
    parent: ViewGroup?
): View {

    val bindingCllRcc: ListItemRecordCllRccBinding = if (convertViewCllRcc == null) {

        DataBindingUtil.inflate(
            LayoutInflater.from(parent!!.context),
            R.layout.list_item_record_cll_rcc,
            parent,
            false
        )

    } else {

        DataBindingUtil.getBinding(convertViewCllRcc)!!
    }

    bindRecordCllRcc(bindingCllRcc, groupPositionCllRcc)

    return bindingCllRcc.root
}

private fun bindRecordCllRcc(
    bindingCllRcc: ListItemRecordCllRccBinding,
    groupPositionCllRcc: Int
) {

    bindingCllRcc.record = getGroup(groupPositionCllRcc)

    if (groupPositionCllRcc%4 ==3 ){
        bindingCllRcc.nativeAd.visibility = VISIBLE

        val adLoader = AdLoader.Builder(mContext, mContext.getString(R.string.native_ad_id))
            .forNativeAd { ad : NativeAd ->
                bindingCllRcc.templateID.setNativeAd(ad)
            }
            .withAdListener(object : AdListener() {
                override fun onAdFailedToLoad(adError: LoadAdError) {
                    Log.e("",adError.message)
                    // Handle the failure by logging, altering the UI, and so on.
                }

                override fun onAdLoaded() {
                    Log.e("","add loaded")
                    super.onAdLoaded()
                }
            })
            .withNativeAdOptions(NativeAdOptions.Builder()
                // Methods in the NativeAdOptions.Builder class can be
                // used here to specify individual options settings.
                .build())
            .build()
        adLoader.loadAd(AdRequest.Builder().build())

    }

    when (groupPositionCllRcc){
        0->bindingCllRcc.isFirstOrLastItem = true
        else -> bindingCllRcc.isFirstOrLastItem = false
    }

}

override fun onGroupCollapsed(groupPositionCllRcc: Int) {
    super.onGroupCollapsed(groupPositionCllRcc) //        pos = groupPosition
}

override fun getChildView(
    groupPositionCllRcc: Int,
    childPositionCllRcc: Int,
    isLastChildCllRcc: Boolean,
    convertViewCllRcc: View?,
    parent: ViewGroup
): View {
    val bindingCllRcc: ListItemExpandedRecordBinding = if (convertViewCllRcc == null) {
        DataBindingUtil.inflate(
            LayoutInflater.from(parent.context),
            R.layout.list_item_expanded_record,
            parent,
            false
        )
    } else {
        DataBindingUtil.getBinding(convertViewCllRcc)!!
    }
    Log.e("position"," $groupPositionCllRcc $childPositionCllRcc")
    bindExpandedViewCllRcc(bindingCllRcc, groupPositionCllRcc, childPositionCllRcc)

    return bindingCllRcc.root
}

private fun bindExpandedViewCllRcc(
    binding: ListItemExpandedRecordBinding,
    groupPositionCllRcc: Int,
    childPositionCllRcc: Int
) {
    try {

        val recordCllRcc = getChild(groupPositionCllRcc, childPositionCllRcc)
        val fileCllRcc = Environment.getExternalStorageDirectory()
            .toString() + "/Call/" + recordCllRcc.nameCllRcc

        binding.viewModel = viewModelCllRcc
        if (viewModelCllRcc.currentRecordCllRcc.value?.nameCllRcc != recordCllRcc.nameCllRcc) {
            binding.record = recordCllRcc
            viewModelCllRcc.currentRecordCllRcc.value = recordCllRcc
        }

        binding.wave.setRawDataCllRcc(File(fileCllRcc).readBytes()) { }
        binding.wave.onProgressListenerCllRcc = object : CustomProgressListenerCllRcc() {
            override fun onProgressChanged(progress: Float, byUser: Boolean) {
                if (byUser) {
                    viewModelCllRcc.seekToCllRcc(progress, recordCllRcc)
                }
            }
        }
        viewModelCllRcc.currentPositionCllRcc.observe(lifecycleOwnerCllRcc) {
            binding.redLineSeekBar.translationX = (binding.wave.width * it.toFloat()) / 101.5f
        }
        viewModelCllRcc.isPlayingCllRcc.observe(lifecycleOwnerCllRcc) {
            binding.isPlaying = it
        }
    } catch (eCllRcc: Exception) {
        eCllRcc.printStackTrace()
    }
}
override fun isChildSelectable(p0CllRcc: Int, p1CllRcc: Int):
Boolean = false
 }
</code>```

Body:
how do I add google ads in an expandable list view adapter (BaseExpandableView) ?

what i have done  -> added the addview in the xml layout of parentView (issue - working but not expanding).

what i want as fully working approach -> independent addview as a parent which i can interchange with even no. of positions .

here is the code ->

class RecordExpandableListAdapterCllRcc(
val mContext: Context,
private val viewModelCllRcc: RecordHistoryViewModelCllRcc,
private val lifecycleOwnerCllRcc: LifecycleOwner): BaseExpandableListAdapter() {

var recordsListCllRccCllRcc: MutableList<RecordCllRcc> = mutableListOf()
    set(valueCllRcc) {
        field = valueCllRcc
        notifyDataSetChanged()
    }

override fun getGroupCount(): Int {
    return recordsListCllRccCllRcc.size
}

override fun getChildrenCount(groupPositionCllRcc: Int): Int = 1

override fun getGroup(groupPositionCllRcc: Int): RecordCllRcc {
    return recordsListCllRccCllRcc[groupPositionCllRcc]
}

override fun getChild(groupPositionCllRcc: Int, childPositionCllRcc: Int): RecordCllRcc =
    recordsListCllRccCllRcc[groupPositionCllRcc]

override fun getGroupId(groupPositionCllRcc: Int): Long = groupPositionCllRcc.toLong()

override fun getChildId(groupPositionCllRcc: Int, childPositionCllRcc: Int): Long {

    return childPositionCllRcc.toLong()
}
override fun hasStableIds(): Boolean {
    return true
}

override fun getGroupView(
    groupPositionCllRcc: Int,
    isExpandedCllRcc: Boolean,
    convertViewCllRcc: View?,
    parent: ViewGroup?
): View {

    val bindingCllRcc: ListItemRecordCllRccBinding = if (convertViewCllRcc == null) {

        DataBindingUtil.inflate(
            LayoutInflater.from(parent!!.context),
            R.layout.list_item_record_cll_rcc,
            parent,
            false
        )

    } else {

        DataBindingUtil.getBinding(convertViewCllRcc)!!
    }

    bindRecordCllRcc(bindingCllRcc, groupPositionCllRcc)

    return bindingCllRcc.root
}

private fun bindRecordCllRcc(
    bindingCllRcc: ListItemRecordCllRccBinding,
    groupPositionCllRcc: Int
) {

    bindingCllRcc.record = getGroup(groupPositionCllRcc)

    if (groupPositionCllRcc%4 ==3 ){
        bindingCllRcc.nativeAd.visibility = VISIBLE

        val adLoader = AdLoader.Builder(mContext, mContext.getString(R.string.native_ad_id))
            .forNativeAd { ad : NativeAd ->
                bindingCllRcc.templateID.setNativeAd(ad)
            }
            .withAdListener(object : AdListener() {
                override fun onAdFailedToLoad(adError: LoadAdError) {
                    Log.e("",adError.message)
                    // Handle the failure by logging, altering the UI, and so on.
                }

                override fun onAdLoaded() {
                    Log.e("","add loaded")
                    super.onAdLoaded()
                }
            })
            .withNativeAdOptions(NativeAdOptions.Builder()
                // Methods in the NativeAdOptions.Builder class can be
                // used here to specify individual options settings.
                .build())
            .build()
        adLoader.loadAd(AdRequest.Builder().build())

    }

    when (groupPositionCllRcc){
        0->bindingCllRcc.isFirstOrLastItem = true
        else -> bindingCllRcc.isFirstOrLastItem = false
    }

}

override fun onGroupCollapsed(groupPositionCllRcc: Int) {
    super.onGroupCollapsed(groupPositionCllRcc) //        pos = groupPosition
}

override fun getChildView(
    groupPositionCllRcc: Int,
    childPositionCllRcc: Int,
    isLastChildCllRcc: Boolean,
    convertViewCllRcc: View?,
    parent: ViewGroup
): View {
    val bindingCllRcc: ListItemExpandedRecordBinding = if (convertViewCllRcc == null) {
        DataBindingUtil.inflate(
            LayoutInflater.from(parent.context),
            R.layout.list_item_expanded_record,
            parent,
            false
        )
    } else {
        DataBindingUtil.getBinding(convertViewCllRcc)!!
    }
    Log.e("position"," $groupPositionCllRcc $childPositionCllRcc")
    bindExpandedViewCllRcc(bindingCllRcc, groupPositionCllRcc, childPositionCllRcc)

    return bindingCllRcc.root
}

private fun bindExpandedViewCllRcc(
    binding: ListItemExpandedRecordBinding,
    groupPositionCllRcc: Int,
    childPositionCllRcc: Int
) {
    try {

        val recordCllRcc = getChild(groupPositionCllRcc, childPositionCllRcc)
        val fileCllRcc = Environment.getExternalStorageDirectory()
            .toString() + "/Call/" + recordCllRcc.nameCllRcc

        binding.viewModel = viewModelCllRcc
        if (viewModelCllRcc.currentRecordCllRcc.value?.nameCllRcc != recordCllRcc.nameCllRcc) {
            binding.record = recordCllRcc
            viewModelCllRcc.currentRecordCllRcc.value = recordCllRcc
        }

        binding.wave.setRawDataCllRcc(File(fileCllRcc).readBytes()) { }
        binding.wave.onProgressListenerCllRcc = object : CustomProgressListenerCllRcc() {
            override fun onProgressChanged(progress: Float, byUser: Boolean) {
                if (byUser) {
                    viewModelCllRcc.seekToCllRcc(progress, recordCllRcc)
                }
            }
        }
        viewModelCllRcc.currentPositionCllRcc.observe(lifecycleOwnerCllRcc) {
            binding.redLineSeekBar.translationX = (binding.wave.width * it.toFloat()) / 101.5f
        }
        viewModelCllRcc.isPlayingCllRcc.observe(lifecycleOwnerCllRcc) {
            binding.isPlaying = it
        }
    } catch (eCllRcc: Exception) {
        eCllRcc.printStackTrace()
    }
}
override fun isChildSelectable(p0CllRcc: Int, p1CllRcc: Int):
Boolean = false
 }


问:
How to Show not reduntant element of js object with EJS in a Node js application with mongoose and express
I am developing a node js application linked to a mongodb database. I am using express and mongoose in order to adapt a model-view-controller design.

In the view.ejs, I want to make it show a set of linked html boxes grouped by the platform elemento of a Javascript Object and I cannot do it.

I tried to use the forEach function. The lines of the view.ejs file are the following:

```<code>      <% node.forEach(function(node){ %>
      <div class="box">
        <form method="GET" action="/node/<%= node._id%>">
            <button style="font-size:24px"><%=node.platform%><i class="fa"></i></button>
          </form>
      </div>
      <% }) %>
</code>```

But with that script of course I iterate over all the node objects and the node.platform is redoundant and shows one button for each json object. What I want to achieve is to iterate and group by node.platform in order to show a different platform in each link button.

How could I change my code to add this feature and also to show the boxes one next to each other and not on different rows?

This is the Schema.js of the collection in Mongo.

```<code>var NodeSchema = mongoose.Schema({
    name: {
        type: String,
        required: true
    },
    ip: {
        type: Array,
        required: true
    },
    user: {
        type: String,
        required: true
    },
    operating_system: {
        type: String,
        required: true
    },
    virtual: {
        type: Boolean,
        default: false,
        required: true
    },
    physical_host: {
        type: String,
        required: true
    },
    platform: {
        type: String,
        required: true
    },
    role: {
        type: String,
        required: false
    },
    notes: {
        type: String,
        required: false
    }
});

NodeSchema.index({'$platform': 'text'});

const Node = mongoose.model("Node", NodeSchema);
module.exports = Node;

</code>```

This is the route.js:

```<code>router.get('/node/:nodeId', async (req, res, next) => {
    let node = await nodeController.read(req.params.nodeId).catch(e => next(e));
    res.render('show_node', {node: node});
});
</code>```

Body:
I am developing a node js application linked to a mongodb database. I am using express and mongoose in order to adapt a model-view-controller design.

In the view.ejs, I want to make it show a set of linked html boxes grouped by the platform elemento of a Javascript Object and I cannot do it.

I tried to use the forEach function. The lines of the view.ejs file are the following:

      <% node.forEach(function(node){ %>

        <form method="GET" action="/node/<%= node._id%>">
            <button style="font-size:24px"><%=node.platform%></button>
          </form>

      <% }) %>

But with that script of course I iterate over all the node objects and the node.platform is redoundant and shows one button for each json object. What I want to achieve is to iterate and group by node.platform in order to show a different platform in each link button.

How could I change my code to add this feature and also to show the boxes one next to each other and not on different rows?

This is the Schema.js of the collection in Mongo.

var NodeSchema = mongoose.Schema({
    name: {
        type: String,
        required: true
    },
    ip: {
        type: Array,
        required: true
    },
    user: {
        type: String,
        required: true
    },
    operating_system: {
        type: String,
        required: true
    },
    virtual: {
        type: Boolean,
        default: false,
        required: true
    },
    physical_host: {
        type: String,
        required: true
    },
    platform: {
        type: String,
        required: true
    },
    role: {
        type: String,
        required: false
    },
    notes: {
        type: String,
        required: false
    }
});

NodeSchema.index({'$platform': 'text'});

const Node = mongoose.model("Node", NodeSchema);
module.exports = Node;

This is the route.js:

router.get('/node/:nodeId', async (req, res, next) => {
    let node = await nodeController.read(req.params.nodeId).catch(e => next(e));
    res.render('show_node', {node: node});
});


问:
<canvas> is displaying as empty on inspector, but works fine on page
I'm trying to export a screenshot of the canvas with toDataURL method.
Unfortunately it results empty, even tho the render works fine.
I'm using Vue, with a threejs wrapper called troisjs.

Why is that so? Can I fix this or is this ultra-complicated?

I was noticing also that if I set style display: contents on the canvas I can see on the inspector that the  is greyed out, but at the same time I can see a preview of what it is rendering while the canvas on the page disappears.

I would really need to find a way to save a screenshot in-app for the content I'm displaying.
Thanks.

This screenshot is from a similar app made with react-tree-fiber, and as you can see it's displaying some content on the canvas.

EDIT: I realized after some hours of research that render() MUST be called again before the toDataURL in order to get a content filled image.


问:
How to make brew services use user/501 instead of gui/501 with launchctl?
I have this strange problem with launchctl not working when using gui/501 instead of user/501, details are here: launchctl bootstrap gui/501 shows "bad ownership/permissions" (but user/501 works)

I would actually prefer if brew services started my services even if I'm not logged in by passing user/501 instead of gui/501 to launchctl.

It seems my desired behaviour used to be the default, but this was changed as it doesn't work with certain services: https://github.com/Homebrew/homebrew-services/issues/527

Is there any way to achieve my desired user/501 behaviour in the latest version?


问:
<router-outlet> selector/tag customization
This question is purely for customization.

I am creating projects in Angular and want to keep it fun. I want to dabble in customization. I want to change the selector for Router Outlet from <router-outlet> to something like <dump-here> or any random words.

I have tried to go to the Router package and change from there, it did change the selector, as in <dump-here> was not giving any compilation errors but it was not showing any output after changing routes.

PS: I know about multiple outlets and that's not what I am trying. Having an outlet name is not what I want, rather change the tag itself to something custom.

This is the line of code I changed in index.ts.

```<code>static ɵdir: i0.ɵɵDirectiveDeclaration<RouterOutlet, "router-outlet", ["outlet"], {}, { "activateEvents": "activate"; "deactivateEvents": "deactivate"; "attachEvents": "attach"; "detachEvents": "detach"; }, never, never, true>;
</code>```

Body:
This question is purely for customization.

I am creating projects in Angular and want to keep it fun. I want to dabble in customization. I want to change the selector for Router Outlet from <router-outlet> to something like <dump-here> or any random words.

I have tried to go to the Router package and change from there, it did change the selector, as in <dump-here> was not giving any compilation errors but it was not showing any output after changing routes.

PS: I know about multiple outlets and that's not what I am trying. Having an outlet name is not what I want, rather change the tag itself to something custom.

This is the line of code I changed in index.ts.

static ɵdir: i0.ɵɵDirectiveDeclaration<RouterOutlet, "router-outlet", ["outlet"], {}, { "activateEvents": "activate"; "deactivateEvents": "deactivate"; "attachEvents": "attach"; "detachEvents": "detach"; }, never, never, true>;


问:
AWS EventBridge handle UpdateThingShadow event
Is it possible for AWS EventBridge to track UpdateThingShadow type of event and create a rule for those? How might an event pattern for such an update look like, and is the AWS service that we listen to AWS IOT Core, AWS CloudTrail or AWS CloudWatch?

The use case is that I do not want to expose the Device shadow directly, but have a table that reflects the state. Updating the table would trigger a custom EventBridge event that updates the table, while updating the DeviceShadow directly should trigger an AWS event that can hopefully be caught in the default AWS EventBridge. The question is what service triggers the event I might want to catch, and what EventPattern would that be.

Based on the IOT Core documentation, there is no mention of device shadow update events being triggered by the IOT Core service.
There is though, mention of monitoring UpdateThingShadow in CloudWatch. Does that mean that my EventBridge should listen to events coming in from Cloudwatch of type UpdateThingShadow?


问:
Retrieving FMU co-simulation results when using Master in PyFMI
I am trying to co-simulate two Matlab-Simulink FMUs using the Master from PyFMI:

```<code>from pyfmi import Master
    """ Loading FMUs, establishing connection between models, defining Master simulator and simulation options """
    dummy_model = load_fmu('dummy.fmu', log_level = 4)
    batt_model = load_fmu('battery.fmu', log_level = 4)

    models = [dummy_model, batt_model]
    connection = [(dummy_model, 'P_to_batt_fmu', batt_model, 'P_to_batt_fmu')]

    mastersim = Master(models, connection)
    opts = mastersim.simulate_options()
    opts['step_size'] = 1000
    opts['result_handling'] = 'memory'

    """ Simulating """
    res = mastersim.simulate(final_time = 1000, options = opts)
</code>```

Everything until here runs as expected. The problem comes when trying to retrieve the results from res, since I cannot call the names of the output variables in my Simulink models. These have names like 'Ibatt', 'SoC' or 'Qbatt' (see image below), and I would expect them to be the keys of res.
Output variable names in Simulink

But they aren't. In fact, res appears to be a python dictionary with very strange keys and values, and until now I have been unable to make heads or tails of it:

```<code>{0: <pyfmi.common.algorithm_drivers.AssimuloSimResult object at 0x000002B3AC3CCF10>,
 <pyfmi.fmi.FMUModelCS2 object at 0x000002B3AB8BC800>: <pyfmi.common.algorithm_drivers.AssimuloSimResult object at 0x000002B3AC3CCF10>,
 1: <pyfmi.common.algorithm_drivers.AssimuloSimResult object at 0x000002B3AC3CE1A0>,
 <pyfmi.fmi.FMUModelCS2 object at 0x000002B3AB889670>: <pyfmi.common.algorithm_drivers.AssimuloSimResult object at 0x000002B3AC3CE1A0>}
</code>```

As I said before, I would expect res to be a dictionary with very straightforward keys, which is what happens when simulating just one of the FMUs:

```<code>
batt_model = load_fmu('battery.fmu', log_level = 4)

opts = batt_model.simulate_options()

opts['ncp'] = 1000

res = batt_model.simulate(final_time=1000, options = opts)
</code>```

If I run the code above, then res.keys() are just the names of my Simulink output variables.

My questions are:
How can I find my variables in res when using Master?
How can I work with them in an easy way?

So far I have been able to work with a results.txt file by stating opts['result_handling'] = 'file', however I would much prefer storing and working with the results in 'memory'

Body:
I am trying to co-simulate two Matlab-Simulink FMUs using the Master from PyFMI:

from pyfmi import Master
    """ Loading FMUs, establishing connection between models, defining Master simulator and simulation options """
    dummy_model = load_fmu('dummy.fmu', log_level = 4)
    batt_model = load_fmu('battery.fmu', log_level = 4)

    models = [dummy_model, batt_model]
    connection = [(dummy_model, 'P_to_batt_fmu', batt_model, 'P_to_batt_fmu')]

    mastersim = Master(models, connection)
    opts = mastersim.simulate_options()
    opts['step_size'] = 1000
    opts['result_handling'] = 'memory'

    """ Simulating """
    res = mastersim.simulate(final_time = 1000, options = opts)

Everything until here runs as expected. The problem comes when trying to retrieve the results from res, since I cannot call the names of the output variables in my Simulink models. These have names like 'Ibatt', 'SoC' or 'Qbatt' (see image below), and I would expect them to be the keys of res.
Output variable names in Simulink

But they aren't. In fact, res appears to be a python dictionary with very strange keys and values, and until now I have been unable to make heads or tails of it:

{0: <pyfmi.common.algorithm_drivers.AssimuloSimResult object at 0x000002B3AC3CCF10>,
 <pyfmi.fmi.FMUModelCS2 object at 0x000002B3AB8BC800>: <pyfmi.common.algorithm_drivers.AssimuloSimResult object at 0x000002B3AC3CCF10>,
 1: <pyfmi.common.algorithm_drivers.AssimuloSimResult object at 0x000002B3AC3CE1A0>,
 <pyfmi.fmi.FMUModelCS2 object at 0x000002B3AB889670>: <pyfmi.common.algorithm_drivers.AssimuloSimResult object at 0x000002B3AC3CE1A0>}

As I said before, I would expect res to be a dictionary with very straightforward keys, which is what happens when simulating just one of the FMUs:

batt_model = load_fmu('battery.fmu', log_level = 4)

opts = batt_model.simulate_options()

opts['ncp'] = 1000

res = batt_model.simulate(final_time=1000, options = opts)

If I run the code above, then res.keys() are just the names of my Simulink output variables.

My questions are:
How can I find my variables in res when using Master?
How can I work with them in an easy way?

So far I have been able to work with a results.txt file by stating opts['result_handling'] = 'file', however I would much prefer storing and working with the results in 'memory'


问:
Discord.JS List item values of ModelType are required
I'm making a message content logging for my own server bot to logs all the message will be sent inside the server including embeds and pictures and gif but pics and gif when sending those (directly not by link) using upload files on discord it prompt this error:

DiscordAPIError[50035]: Invalid Form Body
embeds[0][LIST_ITEM_VALUE_REQUIRED]: List item values of ModelType are required

I'm using discord.js v14

This is my code

```<code>const Discord = require('discord.js');
const { WebhookClient } = require('discord.js');
const client = require('../index');
const wbc = new WebhookClient({
    id: "",
    token: "",
});

module.exports = {
    name: 'messageCreate',
    async execute(message) {
        // if (message.channel.id === "999954713887907870") {
        if (message.channel.id === "1003856060647477298") return;
        let content = message.content ? message.content : { embeds: [message.embeds[0]] };

        wbc.send(content)
    }
    // }
}
</code>```

If you want to see the whole error message you can click here.

Body:
I'm making a message content logging for my own server bot to logs all the message will be sent inside the server including embeds and pictures and gif but pics and gif when sending those (directly not by link) using upload files on discord it prompt this error:

DiscordAPIError[50035]: Invalid Form Body
embeds[0][LIST_ITEM_VALUE_REQUIRED]: List item values of ModelType are required

I'm using discord.js v14

This is my code

const Discord = require('discord.js');
const { WebhookClient } = require('discord.js');
const client = require('../index');
const wbc = new WebhookClient({
    id: "",
    token: "",
});

module.exports = {
    name: 'messageCreate',
    async execute(message) {
        // if (message.channel.id === "999954713887907870") {
        if (message.channel.id === "1003856060647477298") return;
        let content = message.content ? message.content : { embeds: [message.embeds[0]] };

        wbc.send(content)
    }
    // }
}

If you want to see the whole error message you can click here.


问:
Springdoc - override autogenerated Schema for EntityModel
I'm working on a Spring Boot application (in Java), currently on the backend part and I'm trying to prepare the OpenAPI spec using Springdoc.

I have this one issue that I wanted to clarify what data is returned by an endpoint returning EntityModel<> object. By default (excluding the Schema of my model) the example JSON generated by Springdoc looks like this:

```<code>{
  "id": 0,
  "name": "Spaghetti Bolognese",
  "description": "Traditional Italian recipe for Bolognese sauce",
  "source": "My grandma",
  "_links": {
    "additionalProp1": {
      "href": "string",
      "hreflang": "string",
      "title": "string",
      "type": "string",
      "deprecation": "string",
      "profile": "string",
      "name": "string",
      "templated": true
    },
    "additionalProp2": {
      "href": "string",
      "hreflang": "string",
      "title": "string",
      "type": "string",
      "deprecation": "string",
      "profile": "string",
      "name": "string",
      "templated": true
    },
    "additionalProp3": {
      "href": "string",
      "hreflang": "string",
      "title": "string",
      "type": "string",
      "deprecation": "string",
      "profile": "string",
      "name": "string",
      "templated": true
    }
  }
}
</code>```

And the thing that I want to change is the _links node as I know exactly what links are returned and that I only provide the href property for them so the rest is just cluttering the example. I would like for the _links node to look something like that:

```<code>"_links": {
    "self": {
        "href": "http://example.com/recipes/{id}"
    },
    "recipes": {
        "href": "http://example.com/recipes"
    },
    "ingredients": {
        "href": "http://example.com/recipes/{id}/ingredients"
    }
}
</code>```

Do you know how I can achieve that?

Only way I came up with is to create my own RecipeResponse class that would return the Recipe model and links that I want it to return but I think that sort of kills the purpose of using Spring Boot

Body:
I'm working on a Spring Boot application (in Java), currently on the backend part and I'm trying to prepare the OpenAPI spec using Springdoc.

I have this one issue that I wanted to clarify what data is returned by an endpoint returning EntityModel<> object. By default (excluding the Schema of my model) the example JSON generated by Springdoc looks like this:

{
  "id": 0,
  "name": "Spaghetti Bolognese",
  "description": "Traditional Italian recipe for Bolognese sauce",
  "source": "My grandma",
  "_links": {
    "additionalProp1": {
      "href": "string",
      "hreflang": "string",
      "title": "string",
      "type": "string",
      "deprecation": "string",
      "profile": "string",
      "name": "string",
      "templated": true
    },
    "additionalProp2": {
      "href": "string",
      "hreflang": "string",
      "title": "string",
      "type": "string",
      "deprecation": "string",
      "profile": "string",
      "name": "string",
      "templated": true
    },
    "additionalProp3": {
      "href": "string",
      "hreflang": "string",
      "title": "string",
      "type": "string",
      "deprecation": "string",
      "profile": "string",
      "name": "string",
      "templated": true
    }
  }
}

And the thing that I want to change is the _links node as I know exactly what links are returned and that I only provide the href property for them so the rest is just cluttering the example. I would like for the _links node to look something like that:

"_links": {
    "self": {
        "href": "http://example.com/recipes/{id}"
    },
    "recipes": {
        "href": "http://example.com/recipes"
    },
    "ingredients": {
        "href": "http://example.com/recipes/{id}/ingredients"
    }
}

Do you know how I can achieve that?

Only way I came up with is to create my own RecipeResponse class that would return the Recipe model and links that I want it to return but I think that sort of kills the purpose of using Spring Boot


问:
Matching two DataFrames with FuzzyWuzzy Score and replace values
I want to harmonise suppliers who have different spellings, see in Supplier_Name. I already changed some things and now I am at the point Refined.

This is the Situation

I want to change the values in Refined with the best matches in Supplier_Name_Grouped by using a Fuzz Razio.

I've used an example on the internet and now I am at this point:

```<code>SMG1 = list(df["Refined"])
RF1 = list(df.Supplier_Name_Grouped.unique())

def match_names(name, list_names, min_score=0):
    max_score = -1
    max_name = ''
    for x in list_names:
        score = fuzz.ratio(name, x)
        if (score > min_score) & (score > max_score):
            max_name = x
            max_score = score
    return (max_name, max_score)

names = []

for x in SMG1:
    match = match_names(x, RF1, 05)
    if match[1] >= 75:
        name = ('('+str(x), str(match[0])+')')
        names.append(name)

names
</code>```

This Code compares my refined Suppliers to see if they are matching with one of the harmonized suppliers. The output is a List:

This works quite well

I want to replace now the values in my data frame (like in Excel) in the column (Redefined) with these matches.

Body:
I want to harmonise suppliers who have different spellings, see in Supplier_Name. I already changed some things and now I am at the point Refined.

This is the Situation

I want to change the values in Refined with the best matches in Supplier_Name_Grouped by using a Fuzz Razio.

I've used an example on the internet and now I am at this point:

SMG1 = list(df["Refined"])
RF1 = list(df.Supplier_Name_Grouped.unique())

def match_names(name, list_names, min_score=0):
    max_score = -1
    max_name = ''
    for x in list_names:
        score = fuzz.ratio(name, x)
        if (score > min_score) & (score > max_score):
            max_name = x
            max_score = score
    return (max_name, max_score)

names = []

for x in SMG1:
    match = match_names(x, RF1, 05)
    if match[1] >= 75:
        name = ('('+str(x), str(match[0])+')')
        names.append(name)

names

This Code compares my refined Suppliers to see if they are matching with one of the harmonized suppliers. The output is a List:

This works quite well

I want to replace now the values in my data frame (like in Excel) in the column (Redefined) with these matches.


问:
proxy.config.json won't work after I run command ng-build. (Angular V15)
Here is my proxy.config.json file
`

```<code>{
"/apiservices/\*":{
"target":"https://partners.api.skyscanner.net",
"secure":false,
"changeOrigin":true
}
}
</code>```

`

Here is my angular.config.json file inclusion

`

```<code>"serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "proxyConfig": "proxy.config.json"
          },
</code>```

`

Here is my services.component.ts file methods

`

```<code>import { Injectable } from '@angular/core';
import {HttpClient, HttpHeaders} from '@angular/common/http';

@Injectable({
  providedIn: 'root'
})
export class ServicesComponent {
  constructor(private http: HttpClient) {}
  header= new HttpHeaders({
    'x-api-key':'prtl6749387986743898559646983194',
  });

  fetchLocale(){
    return this.http.get('/apiservices/v3/culture/locales', {headers: this.header})
  }

  fetchCurencies(){
    return this.http.get('/apiservices/v3/culture/currencies', {headers: this.header})
  }
  fetchMarkets(){
    return this.http.get('/apiservices/v3/culture/markets/en-GB', {headers: this.header})
  }
}
</code>```

`

This Code is Working fine on 'ng serve' but won't work after I Build my code, Can anybody tell me What I have to do.

Body:
Here is my proxy.config.json file
`

{
"/apiservices/\*":{
"target":"https://partners.api.skyscanner.net",
"secure":false,
"changeOrigin":true
}
}

`

Here is my angular.config.json file inclusion

`

"serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "proxyConfig": "proxy.config.json"
          },

`

Here is my services.component.ts file methods

`

import { Injectable } from '@angular/core';
import {HttpClient, HttpHeaders} from '@angular/common/http';

@Injectable({
  providedIn: 'root'
})
export class ServicesComponent {
  constructor(private http: HttpClient) {}
  header= new HttpHeaders({
    'x-api-key':'prtl6749387986743898559646983194',
  });

  fetchLocale(){
    return this.http.get('/apiservices/v3/culture/locales', {headers: this.header})
  }

  fetchCurencies(){
    return this.http.get('/apiservices/v3/culture/currencies', {headers: this.header})
  }
  fetchMarkets(){
    return this.http.get('/apiservices/v3/culture/markets/en-GB', {headers: this.header})
  }
}

`

This Code is Working fine on 'ng serve' but won't work after I Build my code, Can anybody tell me What I have to do.


问:
Wordpress stop multiple form submission
I am making a simple form with a submit button inside of it. In order to do this I used a shortcode which returns the form. I would like to prevent the user from submitting the form multiple times. However, the answers I have found tend to rely on disabling the button using javascript in some way. If I understand correctly this has two problems.

If the user stops the page, the button will be permanently disabled.

The client code can be changed manually by the user to send multiple requests even if the button is disabled.

I was wondering if there is some way to handle this on the server side in php?

The main problem I am having is that the shortcode needs to return something. It is possible to store a unique code using a nonce, the database or other methods to uniquely identify the submission. However, I can't find a way to cancel execution before the shortcode starts.

Also, when I was trying things I found that if I sleep the function so I can spam the submit button, only the final shortcode submission is returned. So I can't simply return a working copy of the form either.

It seems this would be a standard problem, so am I missing something?

Title: Wordpress stop multiple form submission


问:
Is it possible to split up a GitHub workflow such that each step has a separate badge?
I am relatively new to GitHub workflows and testing. I am working in a private GitHub repository with a dozen colleagues. We want to avoid using services like CircleCI for the time being and see how much we can do with just the integrated GitHub actions, since we are unsure about the kind of access a third party service would be getting to the repo.

Currently, we have two workflows (each one tests the same code for a separate Python environment) that get triggered on push or pull request in the master branch.

The steps of the workflow are as follows (the full workflow yml file is given at the bottom):

Install Anaconda

Create the conda environment (installing dependencies)

Patch libraries

Build a 3rd party library

Run python unit tests

It would be amazing to know immediately which part of the code failed given some new pull requests. Right now, every aspect of the codebase gets tested by a single python file run_tests.py. I was thinking of splitting up this file and creating a workflow per aspect I want to test separately, but then I would have to create a whole new environment, patch the libraries and build the 3rd party library every time I want to conduct a single test. These tests already take quite some time.

My question is now: is there any way to avoid doing that? Is there a way to build everything on the Linux server and re-use that, so that they don't need to be rebuilt every test? Is there a way to display a badge per python test that fails/succeeds, so that we can give more information than just "everything passed" or "everything failed". Is such a thing better suited for a service like CircleCI (or other recommendations are also welcome)?

Here is the full yml file for the workflow for the Python 3 environment. The Python2 one is identical except for the anaconda environment steps.

```<code>
name: (Python 3) install and test

# Controls when the workflow will run
on:
  # Triggers the workflow on push or pull request events but only for the master branch
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash -l {0}

    # Steps represent a sequence of tasks that will be executed as part of the job
steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2

      # Install Anaconda3 and update conda package manager
      - name: Install Anaconda3
        run: |
          wget https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh --quiet
          bash Anaconda3-2020.11-Linux-x86_64.sh -b -p ~/conda3-env-py3
          source ~/conda3-env-py3/bin/activate
          conda info
      # Updating the root environment. Install dependencies (YAML)
      # NOTE: The environment file (yaml) is in the 'etc' folder
      - name: Install ISF dependencies
        run: |
          source ~/conda3-env-py3/bin/activate
          conda-env create --name isf-py3 --file etc/env-py3.yml --quiet
          source activate env-py3
          conda list

      # Patch Dask library
      - name: Patch dask library
        run: |
          echo "Patching dask library."
          source ~/conda3-env-py3/bin/activate
          source activate env-py3
          cd installer
          python patch_dask_linux64.py
          conda list
      # Install pandas-msgpack
      - name: Install pandas-msgpack
        run: |
          echo "Installing pandas-msgpack"
          git clone https://github.com/abast/pandas-msgpack.git
          # Applying patch to pandas-msgpack (generating files using newer Cython)
          git -C pandas-msgpack apply ../installer/pandas_msgpack.patch
          source ~/conda3-env-py3/bin/activate
          source activate env-py3
          cd pandas-msgpack; python setup.py install
          pip list --format=freeze | grep pandas
      # Compile neuron mechanisms
      - name: Compile neuron mechanisms
        run: |
          echo "Compiling neuron mechanisms"
          source ~/conda3-env-py3/bin/activate
          source activate env-py3
          pushd .
          cd mechanisms/channels_py3; nrnivmodl
          popd
          cd mechanisms/netcon_py3; nrnivmodl

      # Run tests
      - name: Testing
        run: |
          source ~/conda3-env-py3/bin/activate
          source activate env-py3
          export PYTHONPATH="$(pwd)"
          dask-scheduler --port=38786 --dashboard-address=38787 &
          dask-worker localhost:38786 --nthreads 1 --nprocs 4 --memory-limit=100e15 &
          python run_tests.py
</code>```

Many thanks in advance

Tried:
Building everything in a single github workflow, testing everything in the same workflow.

Expected:
Gaining information on specific steps that failed or worked. Displaying this information as a badge on the readme page.

Actual result:
Only the overall success status can be displayed as badge. Only the success status of "running all tests" is available.

Body:
I am relatively new to GitHub workflows and testing. I am working in a private GitHub repository with a dozen colleagues. We want to avoid using services like CircleCI for the time being and see how much we can do with just the integrated GitHub actions, since we are unsure about the kind of access a third party service would be getting to the repo.

Currently, we have two workflows (each one tests the same code for a separate Python environment) that get triggered on push or pull request in the master branch.

The steps of the workflow are as follows (the full workflow yml file is given at the bottom):

Install Anaconda

Create the conda environment (installing dependencies)

Patch libraries

Build a 3rd party library

Run python unit tests

It would be amazing to know immediately which part of the code failed given some new pull requests. Right now, every aspect of the codebase gets tested by a single python file run_tests.py. I was thinking of splitting up this file and creating a workflow per aspect I want to test separately, but then I would have to create a whole new environment, patch the libraries and build the 3rd party library every time I want to conduct a single test. These tests already take quite some time.

My question is now: is there any way to avoid doing that? Is there a way to build everything on the Linux server and re-use that, so that they don't need to be rebuilt every test? Is there a way to display a badge per python test that fails/succeeds, so that we can give more information than just "everything passed" or "everything failed". Is such a thing better suited for a service like CircleCI (or other recommendations are also welcome)?

Here is the full yml file for the workflow for the Python 3 environment. The Python2 one is identical except for the anaconda environment steps.

name: (Python 3) install and test

# Controls when the workflow will run
on:
  # Triggers the workflow on push or pull request events but only for the master branch
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash -l {0}

    # Steps represent a sequence of tasks that will be executed as part of the job
steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2

      # Install Anaconda3 and update conda package manager
      - name: Install Anaconda3
        run: |
          wget https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh --quiet
          bash Anaconda3-2020.11-Linux-x86_64.sh -b -p ~/conda3-env-py3
          source ~/conda3-env-py3/bin/activate
          conda info
      # Updating the root environment. Install dependencies (YAML)
      # NOTE: The environment file (yaml) is in the 'etc' folder
      - name: Install ISF dependencies
        run: |
          source ~/conda3-env-py3/bin/activate
          conda-env create --name isf-py3 --file etc/env-py3.yml --quiet
          source activate env-py3
          conda list

      # Patch Dask library
      - name: Patch dask library
        run: |
          echo "Patching dask library."
          source ~/conda3-env-py3/bin/activate
          source activate env-py3
          cd installer
          python patch_dask_linux64.py
          conda list
      # Install pandas-msgpack
      - name: Install pandas-msgpack
        run: |
          echo "Installing pandas-msgpack"
          git clone https://github.com/abast/pandas-msgpack.git
          # Applying patch to pandas-msgpack (generating files using newer Cython)
          git -C pandas-msgpack apply ../installer/pandas_msgpack.patch
          source ~/conda3-env-py3/bin/activate
          source activate env-py3
          cd pandas-msgpack; python setup.py install
          pip list --format=freeze | grep pandas
      # Compile neuron mechanisms
      - name: Compile neuron mechanisms
        run: |
          echo "Compiling neuron mechanisms"
          source ~/conda3-env-py3/bin/activate
          source activate env-py3
          pushd .
          cd mechanisms/channels_py3; nrnivmodl
          popd
          cd mechanisms/netcon_py3; nrnivmodl

      # Run tests
      - name: Testing
        run: |
          source ~/conda3-env-py3/bin/activate
          source activate env-py3
          export PYTHONPATH="$(pwd)"
          dask-scheduler --port=38786 --dashboard-address=38787 &
          dask-worker localhost:38786 --nthreads 1 --nprocs 4 --memory-limit=100e15 &
          python run_tests.py

Many thanks in advance

Tried:
Building everything in a single github workflow, testing everything in the same workflow.

Expected:
Gaining information on specific steps that failed or worked. Displaying this information as a badge on the readme page.

Actual result:
Only the overall success status can be displayed as badge. Only the success status of "running all tests" is available.


问:
How does list comprehension rewrite a new list "behind scenes"?
So, in this example I understand how does it work:

```<code># Create a list of numbers
user_entries = ["10", "19.1", "20"]

# Create an empty list to store the float numbers
float_numbers = []

# Iterate over the elements in the list
for number in user_entries:
  # Convert the element to float type and append it to the float_numbers list
  float_numbers.append(float(number))

# Calculate the sum of the numbers in the float_numbers list
print(sum(float_numbers))
</code>```

But next code works same way, but I don't really understand how does it rewrite "behind scenes". In debugging I cannot see the movement of the second code.

```<code>user_entries = ['10', '19.1', '20']
user_entries = [float(item) for item in user_entries]
print(sum(user_entries))
</code>```

Body:
So, in this example I understand how does it work:

# Create a list of numbers
user_entries = ["10", "19.1", "20"]

# Create an empty list to store the float numbers
float_numbers = []

# Iterate over the elements in the list
for number in user_entries:
  # Convert the element to float type and append it to the float_numbers list
  float_numbers.append(float(number))

# Calculate the sum of the numbers in the float_numbers list
print(sum(float_numbers))

But next code works same way, but I don't really understand how does it rewrite "behind scenes". In debugging I cannot see the movement of the second code.

user_entries = ['10', '19.1', '20']
user_entries = [float(item) for item in user_entries]
print(sum(user_entries))


问:
DevExpress WinUIMessageBox Button Localization Not Changed
When I add language support to the buttons in the WinUIMessageBox and change the language at runtime, the language of the buttons does not change.

```<code>public class CustomDxMessageBoxLocalizer: DXMessageBoxLocalizer {
    protected override void PopulateStringTable()
    {
        this.AddString(DXMessageBoxStringId.Cancel, Localization.GetValue("CCancel"));
        this.AddString(DXMessageBoxStringId.Ok,  Localization.GetValue("Ok"));
        this.AddString(DXMessageBoxStringId.Yes, Localization.GetValue("Yes"));
        this.AddString(DXMessageBoxStringId.No, Localization.GetValue("No"));
    }
}
</code>```
```<code>WinUIMessageBox.Show(Window.GetWindow(ActiveDesktopWorkPlace.RootWindow)
                    Localization.GetValue("ApplicationCloseCommandQuestion"), "XXXXX",
                    MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes,
                    MessageBoxOptions.None, FloatingMode.Window);
</code>```

When the language is changed at runtime, I expected the language of the text of the buttons to change as well. But the text of the buttons did not change.

Body:
When I add language support to the buttons in the WinUIMessageBox and change the language at runtime, the language of the buttons does not change.

public class CustomDxMessageBoxLocalizer: DXMessageBoxLocalizer {
    protected override void PopulateStringTable()
    {
        this.AddString(DXMessageBoxStringId.Cancel, Localization.GetValue("CCancel"));
        this.AddString(DXMessageBoxStringId.Ok,  Localization.GetValue("Ok"));
        this.AddString(DXMessageBoxStringId.Yes, Localization.GetValue("Yes"));
        this.AddString(DXMessageBoxStringId.No, Localization.GetValue("No"));
    }
}

WinUIMessageBox.Show(Window.GetWindow(ActiveDesktopWorkPlace.RootWindow)
                    Localization.GetValue("ApplicationCloseCommandQuestion"), "XXXXX",
                    MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes,
                    MessageBoxOptions.None, FloatingMode.Window);

When the language is changed at runtime, I expected the language of the text of the buttons to change as well. But the text of the buttons did not change.


问:
Using NTwain - TransferError event is not raised for Paperjam and other errors in source
We have built a custom application using NTwain to scan documents. When testing the application, we see that when an error is encountered on device side, like a paper jam, error handler event (TransferError) is raised for some scanners but it is not raised for some other scanners. Seeing this problem especially when using Canon model number, DR-G1130 and associated driver.

Driver UI has been disabled by setting ShowUI and CAP_INDICATORS to false in source's capabilities. We have looked at SourceDisabled event but it does not have any information regarding whether there was an error on device or not.
Please share if there is any setting or workaround recommended to overcome this.