问:
Can't uninstall brew Jenkins
Here, I had tried to uninstall as:

```<code>joseluisbz@Joses-MacBook-Pro ms-firmascontratos-neg % brew services stop jenkins-lts
Stopping `jenkins-lts`... (might take a while)
==> Successfully stopped `jenkins-lts` (label: homebrew.mxcl.jenkins-lts)
joseluisbz@Joses-MacBook-Pro ms-firmascontratos-neg % brew uninstall jenkins-lts --force
joseluisbz@Joses-MacBook-Pro ms-firmascontratos-neg % brew cleanup
Warning: Skipping azure-cli: most recent version 2.41.0 not installed
Warning: Skipping libffi: most recent version 3.4.3 not installed
Warning: Skipping python@3.10: most recent version 3.10.8 not installed
Warning: Skipping python@3.9: most recent version 3.9.15 not installed
Warning: Skipping readline: most recent version 8.2.1 not installed
Warning: Skipping sqlite: most recent version 3.39.4 not installed
Warning: Skipping torsocks: most recent version 2.4.0 not installed
Warning: Skipping xz: most recent version 5.2.7 not installed
joseluisbz@Joses-MacBook-Pro ms-firmascontratos-neg % brew info jenkins-lts
==> jenkins-lts: stable 2.361.2 (bottled)
Extendable open-source CI server
https://www.jenkins.io/index.html#stable
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/jenkins-lts.rb
License: MIT
==> Dependencies
Required: openjdk@17 ✔
==> Caveats
Note: When using launchctl the port will be 8080.

To restart jenkins-lts after an upgrade:
  brew services restart jenkins-lts
Or, if you don't want/need a background service you can just run:
  /opt/homebrew/opt/openjdk@17/bin/java -Dmail.smtp.starttls.enable=true -jar /opt/homebrew/opt/jenkins-lts/libexec/jenkins.war --httpListenAddress=127.0.0.1 --httpPort=8080
==> Analytics
install: 5,868 (30 days), 18,646 (90 days), 67,662 (365 days)
install-on-request: 5,871 (30 days), 18,647 (90 days), 67,670 (365 days)
build-error: 0 (30 days)
joseluisbz@Joses-MacBook-Pro ms-firmascontratos-neg %
</code>```

But, When I restarted my macOS... ohhh Again is running

Some clue, in order to remove it (I know deleting folder)?

Title: Can't uninstall brew Jenkins

Body:
Here, I had tried to uninstall as:

joseluisbz@Joses-MacBook-Pro ms-firmascontratos-neg % brew services stop jenkins-lts
Stopping `jenkins-lts`... (might take a while)
==> Successfully stopped `jenkins-lts` (label: homebrew.mxcl.jenkins-lts)
joseluisbz@Joses-MacBook-Pro ms-firmascontratos-neg % brew uninstall jenkins-lts --force
joseluisbz@Joses-MacBook-Pro ms-firmascontratos-neg % brew cleanup
Warning: Skipping azure-cli: most recent version 2.41.0 not installed
Warning: Skipping libffi: most recent version 3.4.3 not installed
Warning: Skipping python@3.10: most recent version 3.10.8 not installed
Warning: Skipping python@3.9: most recent version 3.9.15 not installed
Warning: Skipping readline: most recent version 8.2.1 not installed
Warning: Skipping sqlite: most recent version 3.39.4 not installed
Warning: Skipping torsocks: most recent version 2.4.0 not installed
Warning: Skipping xz: most recent version 5.2.7 not installed
joseluisbz@Joses-MacBook-Pro ms-firmascontratos-neg % brew info jenkins-lts
==> jenkins-lts: stable 2.361.2 (bottled)
Extendable open-source CI server
https://www.jenkins.io/index.html#stable
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/jenkins-lts.rb
License: MIT
==> Dependencies
Required: openjdk@17 ✔
==> Caveats
Note: When using launchctl the port will be 8080.

To restart jenkins-lts after an upgrade:
  brew services restart jenkins-lts
Or, if you don't want/need a background service you can just run:
  /opt/homebrew/opt/openjdk@17/bin/java -Dmail.smtp.starttls.enable=true -jar /opt/homebrew/opt/jenkins-lts/libexec/jenkins.war --httpListenAddress=127.0.0.1 --httpPort=8080
==> Analytics
install: 5,868 (30 days), 18,646 (90 days), 67,662 (365 days)
install-on-request: 5,871 (30 days), 18,647 (90 days), 67,670 (365 days)
build-error: 0 (30 days)
joseluisbz@Joses-MacBook-Pro ms-firmascontratos-neg %

But, When I restarted my macOS... ohhh Again is running

Some clue, in order to remove it (I know deleting folder)?


来源: stackexchange

问:
How to call many Endpoint successively in WSO2 Integration Studio?
I was about implement a workflow of a Job using many calls mediators , each one it works perfect until i put them together so it didn't work and it give me this WARN in my console

```<code>[2022-12-19 16:55:03,026]  INFO {SourceHandler} - Writer null when calling informWriterError
[2022-12-19 16:55:03,027]  WARN {SourceHandler} - STATE_DESCRIPTION = Socket Timeout occurred after accepting the request headers and the request body, INTERNAL_STATE = REQUEST_DONE, DIRECTION = REQUEST, CAUSE_OF_ERROR = Connection between the client and the EI timeouts, HTTP_URL = /NumSequence, HTTP_METHOD = GET, SOCKET_TIMEOUT = 180000, CLIENT_ADDRESS = /127.0.0.1:57800, CONNECTION http-incoming-3 Correlation ID : dd34a03b-a3e6-4f6a-a254-230076b41246
</code>```

this is my code :

The first API execute an SQL Statement of drop

The second API execute an SQL Statement of create

The third API execute an SQL Statement select

The forth API execute an SQL Statement of update

<api context="/NumSequence" name="NumSequence" xmlns="http://ws.apache.org/ns/synapse">
    <resource methods="GET">
        <inSequence>
            <call>
                <endpoint>
                    <http method="get" uri-template="http://ebs-dev:8290/services/RADMINDataService/numseqdrop">
                        <suspendOnFailure>
                            <initialDuration>-1</initialDuration>
                            <progressionFactor>-1</progressionFactor>
                            <maximumDuration>0</maximumDuration>
                        </suspendOnFailure>
                        <markForSuspension>
                            <retriesBeforeSuspension>0</retriesBeforeSuspension>
                        </markForSuspension>
                    </http>
                </endpoint>
            </call>
            <call>
                <endpoint>
                    <http method="get" uri-template="http://ebs-dev:8290/services/RADMINDataService/numseqcreate">
                        <suspendOnFailure>
                            <initialDuration>-1</initialDuration>
                            <progressionFactor>-1</progressionFactor>
                            <maximumDuration>0</maximumDuration>
                        </suspendOnFailure>
                        <markForSuspension>
                            <retriesBeforeSuspension>0</retriesBeforeSuspension>
                        </markForSuspension>
                    </http>
                </endpoint>
            </call>
            <call>
                <endpoint>
                    <http method="get" uri-template="http://ebs-dev:8290/services/CRMDataService/ReadUsername">
                        <suspendOnFailure>
                            <initialDuration>-1</initialDuration>
                            <progressionFactor>-1</progressionFactor>
                            <maximumDuration>0</maximumDuration>
                        </suspendOnFailure>
                        <markForSuspension>
                            <retriesBeforeSuspension>0</retriesBeforeSuspension>
                        </markForSuspension>
                    </http>
                </endpoint>
            </call>
            <iterate expression="//accounts/account">
                <target>
                    <sequence>
                        <payloadFactory media-type="json" template-type="freemarker">
                            <format><![CDATA[{
  "_postaddusername": {
                 "NumSequence":${payload.account.NumSequence},
                 "Prefixe":"${payload.account.Prefixe}"
                 }
}]]></format>
                            <args/>
                        </payloadFactory>
                        <call>
                            <endpoint>
                                <http method="post" uri-template="http://ebs-dev:8290/services/RADMINDataService/AddUsername">
                                    <suspendOnFailure>
                                        <initialDuration>-1</initialDuration>
                                        <progressionFactor>-1</progressionFactor>
                                        <maximumDuration>0</maximumDuration>
                                    </suspendOnFailure>
                                    <markForSuspension>
                                        <retriesBeforeSuspension>0</retriesBeforeSuspension>
                                    </markForSuspension>
                                </http>
                            </endpoint>
                        </call>
                    </sequence>
                </target>
            </iterate>
            <respond/>
        </inSequence>
        <outSequence/>
        <faultSequence/>
    </resource>
</api>```

ContentLicense: CC BY-SA 4.0

Body:
I was about implement a workflow of a Job using many calls mediators , each one it works perfect until i put them together so it didn't work and it give me this WARN in my console

[2022-12-19 16:55:03,026]  INFO {SourceHandler} - Writer null when calling informWriterError
[2022-12-19 16:55:03,027]  WARN {SourceHandler} - STATE_DESCRIPTION = Socket Timeout occurred after accepting the request headers and the request body, INTERNAL_STATE = REQUEST_DONE, DIRECTION = REQUEST, CAUSE_OF_ERROR = Connection between the client and the EI timeouts, HTTP_URL = /NumSequence, HTTP_METHOD = GET, SOCKET_TIMEOUT = 180000, CLIENT_ADDRESS = /127.0.0.1:57800, CONNECTION http-incoming-3 Correlation ID : dd34a03b-a3e6-4f6a-a254-230076b41246

this is my code :

The first API execute an SQL Statement of drop

The second API execute an SQL Statement of create

The third API execute an SQL Statement select

The forth API execute an SQL Statement of update

<api context="/NumSequence" name="NumSequence" xmlns="http://ws.apache.org/ns/synapse">
    <resource methods="GET">
        <inSequence>
            <call>
                <endpoint>
                    <http method="get" uri-template="http://ebs-dev:8290/services/RADMINDataService/numseqdrop">
                        <suspendOnFailure>
                            <initialDuration>-1</initialDuration>
                            <progressionFactor>-1</progressionFactor>
                            <maximumDuration>0</maximumDuration>
                        </suspendOnFailure>
                        <markForSuspension>
                            <retriesBeforeSuspension>0</retriesBeforeSuspension>
                        </markForSuspension>
                    </http>
                </endpoint>
            </call>
            <call>
                <endpoint>
                    <http method="get" uri-template="http://ebs-dev:8290/services/RADMINDataService/numseqcreate">
                        <suspendOnFailure>
                            <initialDuration>-1</initialDuration>
                            <progressionFactor>-1</progressionFactor>
                            <maximumDuration>0</maximumDuration>
                        </suspendOnFailure>
                        <markForSuspension>
                            <retriesBeforeSuspension>0</retriesBeforeSuspension>
                        </markForSuspension>
                    </http>
                </endpoint>
            </call>
            <call>
                <endpoint>
                    <http method="get" uri-template="http://ebs-dev:8290/services/CRMDataService/ReadUsername">
                        <suspendOnFailure>
                            <initialDuration>-1</initialDuration>
                            <progressionFactor>-1</progressionFactor>
                            <maximumDuration>0</maximumDuration>
                        </suspendOnFailure>
                        <markForSuspension>
                            <retriesBeforeSuspension>0</retriesBeforeSuspension>
                        </markForSuspension>
                    </http>
                </endpoint>
            </call>
            <iterate expression="//accounts/account">
                <target>
                    <sequence>
                        <payloadFactory media-type="json" template-type="freemarker">
                            <format><![CDATA[{
  "_postaddusername": {
                 "NumSequence":${payload.account.NumSequence},
                 "Prefixe":"${payload.account.Prefixe}"
                 }
}]]></format>
                            <args/>
                        </payloadFactory>
                        <call>
                            <endpoint>
                                <http method="post" uri-template="http://ebs-dev:8290/services/RADMINDataService/AddUsername">
                                    <suspendOnFailure>
                                        <initialDuration>-1</initialDuration>
                                        <progressionFactor>-1</progressionFactor>
                                        <maximumDuration>0</maximumDuration>
                                    </suspendOnFailure>
                                    <markForSuspension>
                                        <retriesBeforeSuspension>0</retriesBeforeSuspension>
                                    </markForSuspension>
                                </http>
                            </endpoint>
                        </call>
                    </sequence>
                </target>
            </iterate>
            <respond/>
        </inSequence>
        <outSequence/>
        <faultSequence/>
    </resource>
</api>


问:
Github.com read-only API for public content
I am looking for how I can have my website make XHR API calls to Github for my project to display info like # of issues, # open PRs, top contributors, links to latest releases ... etc. It's all public info that you can see going to the public Github website, but i want to be able to pull it and surface/highlight pieces on my project's Web site. Do i just need to make a read-only API token and use that in my code (everyone can see it, but i guess i dont really care if other people see/use it?) .. or if a simpler, no-auth, API Github provides for this sort of info?

I feel like i'm missing something obvious - but my Googling always leads me to more complex use cases.


问:
How to resolve error "number of items to replace is not a multiple of replacement length" with bootstrapping regression
I am trying to use the package ::boot to bootstrap a regression. I am running into the error: "number of items to replace is not a multiple of replacement length". I have read many posts about this error and ruled out: missing observations (NAs) on certain variables and factor variables causing issues. All my variables are either binary (0/1) or continuous (but defined at several decimal places).

I cannot share my data but am posting the code that I am using below. If anyone can suggest what else might be preventing the bootstrapping from running that would be helpful. I can run the code on one sub-sample (country A) but run into this error for country B.

```<code>glm_fun <- function(data, ix) {
  fit <- glm(ave_p ~ isolate + female + age_calculation + biological_children_ever_born + no_educ + literate + reg_inc_bin + employed + sex_money1 + struct_barrier_score + fi_severe  + stigma_pna + stigma_dc + told_anyone_bin + disc_outside_bin + necessity_score + mistrust_score  + conspiracy_score + satisfaction_score + other_meds_besides_art_bin + PCS_12 + MCS_12 + depressbi + smoke_cigarette1,
             data=data[ix, ],
          family = "gaussian")

  summary <- summary(fit)$coefficients
  round(summary, 3)

}

################################ COUNTRY A #################################

bs_out <- boot::boot(ego_alter_analysis_A1, statistic=glm_fun, R=1000)
glm_fun(ego_alter_analysis_A1, ix=rep(TRUE, nrow(ego_alter_analysis_A1)))

################################ COUNTRY B ###########################

bs_out <- boot::boot(ego_alter_analysis_B1, statistic=glm_fun, R=1000)
glm_fun(ego_alter_analysis_B1, ix=rep(TRUE, nrow(ego_alter_analysis_B1)))

</code>```

Body:
I am trying to use the package ::boot to bootstrap a regression. I am running into the error: "number of items to replace is not a multiple of replacement length". I have read many posts about this error and ruled out: missing observations (NAs) on certain variables and factor variables causing issues. All my variables are either binary (0/1) or continuous (but defined at several decimal places).

I cannot share my data but am posting the code that I am using below. If anyone can suggest what else might be preventing the bootstrapping from running that would be helpful. I can run the code on one sub-sample (country A) but run into this error for country B.

glm_fun <- function(data, ix) {
  fit <- glm(ave_p ~ isolate + female + age_calculation + biological_children_ever_born + no_educ + literate + reg_inc_bin + employed + sex_money1 + struct_barrier_score + fi_severe  + stigma_pna + stigma_dc + told_anyone_bin + disc_outside_bin + necessity_score + mistrust_score  + conspiracy_score + satisfaction_score + other_meds_besides_art_bin + PCS_12 + MCS_12 + depressbi + smoke_cigarette1,
             data=data[ix, ],
          family = "gaussian")

  summary <- summary(fit)$coefficients
  round(summary, 3)

}

################################ COUNTRY A #################################

bs_out <- boot::boot(ego_alter_analysis_A1, statistic=glm_fun, R=1000)
glm_fun(ego_alter_analysis_A1, ix=rep(TRUE, nrow(ego_alter_analysis_A1)))

################################ COUNTRY B ###########################

bs_out <- boot::boot(ego_alter_analysis_B1, statistic=glm_fun, R=1000)
glm_fun(ego_alter_analysis_B1, ix=rep(TRUE, nrow(ego_alter_analysis_B1)))


问:
How can I change the URL that points to a File on the FileInput widget in the Django Admin frontend to point to my view
In my Django project, I want the user to be able to upload files, that are only accessible to users from the same company and from users that are staff. The solution I found is, that I upload the Files to a custom FileSystemStorage with a base_url that is not in urls, so files are not accessible over that url, the only way to access them is through my view.

The problem is, that in the Django admin frontend on a FileInput widget, it links to the url which is not accessible. How can I link it to my view?

This is my model:

upload_storage = FileSystemStorage(location='/private/', base_url='/private/')

class Datei(models.Model):
    datei = models.FileField(upload_to='vertraege', storage=upload_storage)
    ...
```
<p>This is my view:</p>
<pre class="lang-py prettyprint-override"><code>@login_required(login_url='/login/')
def serve_file(request, file_id):
    file = Datei.objects.get(id=file_id)
    user = User.objects.get(id=request.user.id)
    if file.firma == user.firma or user.is_staff:
        return FileResponse(file.datei)
    else:
        return HttpResponseForbidden()
</code>```

Body:
In my Django project, I want the user to be able to upload files, that are only accessible to users from the same company and from users that are staff. The solution I found is, that I upload the Files to a custom FileSystemStorage with a base_url that is not in urls, so files are not accessible over that url, the only way to access them is through my view.

The problem is, that in the Django admin frontend on a FileInput widget, it links to the url which is not accessible. How can I link it to my view?

This is my model:

upload_storage = FileSystemStorage(location='/private/', base_url='/private/')

class Datei(models.Model):
    datei = models.FileField(upload_to='vertraege', storage=upload_storage)
    ...

This is my view:

@login_required(login_url='/login/')
def serve_file(request, file_id):
    file = Datei.objects.get(id=file_id)
    user = User.objects.get(id=request.user.id)
    if file.firma == user.firma or user.is_staff:
        return FileResponse(file.datei)
    else:
        return HttpResponseForbidden()


问:
I recevie a Buildozer compile Error when trying to convert my python code to Android APK
after testing my pthon/kivy/cv2 usb cam app and now converting to Android APK app using buildozer, I keep getting the below error:

```<code>shutil.Error: [('/mnt/c/pro/app/.buildozer/applibs', '/mnt/c/pro/app/.buildozer/android/app/_applibs', "[Errno 13] Permission denied: '/mnt/c/pro/app/.buildozer/android/app/_applibs'")]"
</code>```

Can some check to see if they get the same error when compiling the below?

```<code>from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.image import Image
from kivy.clock import Clock
from kivy.graphics.texture import Texture
import kivy
import cv2

kivy.require('1.9.0')

class CamApp(App):

    def build(self):
        # display images from cam in two windows for VR Box CamApp
        self.img1=Image()
        self.img2=Image()
        layout = BoxLayout()
        layout.orientation = 'horizontal'
        layout.add_widget(self.img1)
        layout.add_widget(self.img2)
        #opencv2 stuffs
        self.capture = cv2.VideoCapture(0)
        cv2.namedWindow("CV2 Image")
        Clock.schedule_interval(self.update, 1.0/33.0)
        return layout

    def update(self, dt):
        # display image from cam in two opencv windows for VR Box
        ret, frame = self.capture.read()
        cv2.imshow("CV2 Image", frame)
        # convert it to texture
        buf1 = cv2.flip(frame, 0)
        buf11 = buf1.tostring()
        buf2 = cv2.flip(frame, 0)
        buf22 = buf2.tostring()
        texture1 = Texture.create(size=(frame.shape[1], frame.shape[0]), colorfmt='bgr')
        texture2 = Texture.create(size=(frame.shape[1], frame.shape[0]), colorfmt='bgr')
        #if working on RASPBERRY PI, use colorfmt='rgba' here instead, but stick with "bgr" in blit_buffer.
        texture1.blit_buffer(buf11, colorfmt='bgr', bufferfmt='ubyte')
        texture2.blit_buffer(buf22, colorfmt='bgr', bufferfmt='ubyte')
        # display images from the textures
        self.img1.texture = texture1
        self.img2.texture = texture2

if __name__ == '__main__':
    CamApp().run()
    cv2.destroyAllWindows()
</code>```

when converting my python/kivy code to an Android App using Buildozer. I tried running Buildozer as root...

```<code>sudo buildozer -v android debug
</code>```

...but still get the same error. i even set write permissions for all sub folders using "

```<code>$ chmod -R 0755 /mnt/c/pro/app/
</code>```

i thought this would be the easy part of my project.
Please help.
Thanks in advance.

Body:
after testing my pthon/kivy/cv2 usb cam app and now converting to Android APK app using buildozer, I keep getting the below error:

shutil.Error: [('/mnt/c/pro/app/.buildozer/applibs', '/mnt/c/pro/app/.buildozer/android/app/_applibs', "[Errno 13] Permission denied: '/mnt/c/pro/app/.buildozer/android/app/_applibs'")]"

Can some check to see if they get the same error when compiling the below?

from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.image import Image
from kivy.clock import Clock
from kivy.graphics.texture import Texture
import kivy
import cv2

kivy.require('1.9.0')

class CamApp(App):

    def build(self):
        # display images from cam in two windows for VR Box CamApp
        self.img1=Image()
        self.img2=Image()
        layout = BoxLayout()
        layout.orientation = 'horizontal'
        layout.add_widget(self.img1)
        layout.add_widget(self.img2)
        #opencv2 stuffs
        self.capture = cv2.VideoCapture(0)
        cv2.namedWindow("CV2 Image")
        Clock.schedule_interval(self.update, 1.0/33.0)
        return layout

    def update(self, dt):
        # display image from cam in two opencv windows for VR Box
        ret, frame = self.capture.read()
        cv2.imshow("CV2 Image", frame)
        # convert it to texture
        buf1 = cv2.flip(frame, 0)
        buf11 = buf1.tostring()
        buf2 = cv2.flip(frame, 0)
        buf22 = buf2.tostring()
        texture1 = Texture.create(size=(frame.shape[1], frame.shape[0]), colorfmt='bgr')
        texture2 = Texture.create(size=(frame.shape[1], frame.shape[0]), colorfmt='bgr')
        #if working on RASPBERRY PI, use colorfmt='rgba' here instead, but stick with "bgr" in blit_buffer.
        texture1.blit_buffer(buf11, colorfmt='bgr', bufferfmt='ubyte')
        texture2.blit_buffer(buf22, colorfmt='bgr', bufferfmt='ubyte')
        # display images from the textures
        self.img1.texture = texture1
        self.img2.texture = texture2

if __name__ == '__main__':
    CamApp().run()
    cv2.destroyAllWindows()

when converting my python/kivy code to an Android App using Buildozer. I tried running Buildozer as root...

sudo buildozer -v android debug

...but still get the same error. i even set write permissions for all sub folders using "

$ chmod -R 0755 /mnt/c/pro/app/

i thought this would be the easy part of my project.
Please help.
Thanks in advance.


问:
How to do something different for the first element of a list than for the other elements?
I'm writing a piece of code that is responsible for building a URL:

```<code>for ((index, _) in this.ids.withIndex()) {
    if (index == 0) {
        sb.append("$separator={$separator$index}")
    } else {
        sb.append("&$separator={$separator$index}")
    }
}
</code>```

where: sb is an instance of StringBuilder and ids is a List<String> of some IDs, and separator is a keyword used in API I'm calling.

The output of the function should look like this:

/v1/assets?assets={assets0}&assets={assets1}&assets={assets2}

The code above is working fine, but I wonder if there is a cleaner and more elegant way of solving this problem. In my case, it would be great for my function to append assets={assets0} for the first element in the list of IDs, and append &assets={assetsN} (where N is just the index of the given element) for the rest of elements.

Body:
I'm writing a piece of code that is responsible for building a URL:

for ((index, _) in this.ids.withIndex()) {
    if (index == 0) {
        sb.append("$separator={$separator$index}")
    } else {
        sb.append("&$separator={$separator$index}")
    }
}

where: sb is an instance of StringBuilder and ids is a List<String> of some IDs, and separator is a keyword used in API I'm calling.

The output of the function should look like this:

/v1/assets?assets={assets0}&assets={assets1}&assets={assets2}

The code above is working fine, but I wonder if there is a cleaner and more elegant way of solving this problem. In my case, it would be great for my function to append assets={assets0} for the first element in the list of IDs, and append &assets={assetsN} (where N is just the index of the given element) for the rest of elements.


问:
How can I set the Alert / SnackBar background color property?
```<code>interface SnackbarProps {
    color ?:   "info" | "success" | "warning" | "error" ;
    children?: any;
    message?: string;
    open?: boolean;
    setOpen?: Function;
    bgWhite?: boolean;
    severity ?: any;

    [key: string]: any;
}
const WFSnackbar: React.FC<SnackbarProps> = ({
                        icon,
                        message,
                        color,
                        open,
                        setOpen,
                        severity,
                        bgWhite
                        }) => {
    const [controller] = useMaterialUIController();
    const {darkMode} = controller;

    return (
        <div>
           <Snackbar
                      open={open}
                      onClose={() => {
                          setOpen(false)
                      }}
                      anchorOrigin={{vertical: 'bottom', horizontal: 'right'}}
                      style={{
                          color: '#FFFFFF',
                          zIndex :'9999',
                      }}
            >
            <Alert
                       icon={icon}
                       onClose={() => {
                               setOpen(false)
                       }}
                       severity={color}
                       sx={{
                           backgroundColor: ThemeConstants.ERROR ? "#EF5350" : "#4CAF50",
                           color: '#FFFFFF',
                       }}
                       action={
                               <IconButton>
                                   <CloseIcon
                                   onClick={() => setOpen(false)}
                                   sx={{
                                       paddingBottom: "7px"
                                   }}
                               />
                           </IconButton>
                       }
                >
                {message}
            </Alert>
        </Snackbar>
        </div>

    )
}
</code>```

I don't know how to set the background color conditionally in custamized  and pass the props

I am making this Snack bar component to re-use in different scenarios

How to set the background color conditionally sot that it can be reused in different scenarios.

Body:
interface SnackbarProps {
    color ?:   "info" | "success" | "warning" | "error" ;
    children?: any;
    message?: string;
    open?: boolean;
    setOpen?: Function;
    bgWhite?: boolean;
    severity ?: any;

    [key: string]: any;
}
const WFSnackbar: React.FC<SnackbarProps> = ({
                        icon,
                        message,
                        color,
                        open,
                        setOpen,
                        severity,
                        bgWhite
                        }) => {
    const [controller] = useMaterialUIController();
    const {darkMode} = controller;

    return (

           <Snackbar
                      open={open}
                      onClose={() => {
                          setOpen(false)
                      }}
                      anchorOrigin={{vertical: 'bottom', horizontal: 'right'}}
                      style={{
                          color: '#FFFFFF',
                          zIndex :'9999',
                      }}
            >
            <Alert
                       icon={icon}
                       onClose={() => {
                               setOpen(false)
                       }}
                       severity={color}
                       sx={{
                           backgroundColor: ThemeConstants.ERROR ? "#EF5350" : "#4CAF50",
                           color: '#FFFFFF',
                       }}
                       action={
                               <IconButton>
                                   <CloseIcon
                                   onClick={() => setOpen(false)}
                                   sx={{
                                       paddingBottom: "7px"
                                   }}
                               />
                           </IconButton>
                       }
                >
                {message}
            </Alert>
        </Snackbar>

    )
}

I don't know how to set the background color conditionally in custamized  and pass the props

I am making this Snack bar component to re-use in different scenarios

How to set the background color conditionally sot that it can be reused in different scenarios.


问:
Why use useLayoutEffect in useEvent shim instead of setting the ref in the render function?
Here is a popular useEvent shim:

function useEvent(callback) {
  const ref = useRef(() => {
    throw new Error("Cannot call an event handler while rendering.")
  })
  // Or useInsertionEffect if it's React 18
  useLayoutEffect(() => {
    ref.current = callback
  })
  return useCallback((...args) => ref.current(...args), []);
}

// Usage
function Component(props) {
  const [visible, setVisible] = useState(false)
  // props.onToggle may not be stable
  const onToggle = useEvent(props.onToggle)
  // But our onToggle is stable
  useEffect(() => onToggle(visible), [onToggle, visible])
  // ❌ Throws when used in the render phase
  onToggle(visible)
}
```
<p>Source: https://tkdodo.eu/blog/refs-events-and-escape-hatches (gorgeous article by the way).</p>
<p>What I don't understand is why we need <code>useLayoutEffect</code> here, and why we can't set the <code>ref</code> value directly in the render function?</p>
<pre class="lang-js prettyprint-override"><code>function useEvent(callback?) {
  const ref = useRef(callback)
  ref.current = callback
  return useCallback((...args) => ref.current(...args), [])
}
</code>```

Body:
Here is a popular useEvent shim:

function useEvent(callback) {
  const ref = useRef(() => {
    throw new Error("Cannot call an event handler while rendering.")
  })
  // Or useInsertionEffect if it's React 18
  useLayoutEffect(() => {
    ref.current = callback
  })
  return useCallback((...args) => ref.current(...args), []);
}

// Usage
function Component(props) {
  const [visible, setVisible] = useState(false)
  // props.onToggle may not be stable
  const onToggle = useEvent(props.onToggle)
  // But our onToggle is stable
  useEffect(() => onToggle(visible), [onToggle, visible])
  // ❌ Throws when used in the render phase
  onToggle(visible)
}

Source: https://tkdodo.eu/blog/refs-events-and-escape-hatches (gorgeous article by the way).

What I don't understand is why we need useLayoutEffect here, and why we can't set the ref value directly in the render function?

function useEvent(callback?) {
  const ref = useRef(callback)
  ref.current = callback
  return useCallback((...args) => ref.current(...args), [])
}


问:
VS Code can't finde the path to a library
I did try to get the lib eigen3 work on VS Code.
I installed the eigen3 lib trough homebrew with the command "brew install eigen".

In VS Code i get the error:

```<code>#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/Users/bgn/Arbeitsplatz/slam/slambook2/ch3/useEigen/eigenMatrix.cpp).
cannot open source file "Eigen/Core"
cannot open source file "Eigen/Dense"
</code>```

I did add the location of eigen3 to the includePath, in c_cpp_properties.json.

```<code>{
    "configurations": [
        {
            "name": "Mac",
            "includePath": [
                "${workspaceFolder}/**",
                "/opt/homebrew/include/eigen3"

            ],
            "defines": [],
            "macFrameworkPath": [
                "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
            ],
            "compilerPath": "/usr/bin/clang",
            "cStandard": "c17",
            "cppStandard": "c++17",
            "intelliSenseMode": "macos-clang-arm64"
        }
    ],
    "version": 4
}
</code>```

After that it shows me ton of errors in the code, where obviously no error can be found.
Errors and still it cant finde 'Eigen/Core'.

I tried the same thing on CLion and in macOS terminal with success, eigen is found. So, i don't really understand what the problem of VS Code is.

Anybody an idea?

Thanks

Body:
I did try to get the lib eigen3 work on VS Code.
I installed the eigen3 lib trough homebrew with the command "brew install eigen".

In VS Code i get the error:

#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/Users/bgn/Arbeitsplatz/slam/slambook2/ch3/useEigen/eigenMatrix.cpp).
cannot open source file "Eigen/Core"
cannot open source file "Eigen/Dense"

I did add the location of eigen3 to the includePath, in c_cpp_properties.json.

{
    "configurations": [
        {
            "name": "Mac",
            "includePath": [
                "${workspaceFolder}/**",
                "/opt/homebrew/include/eigen3"

            ],
            "defines": [],
            "macFrameworkPath": [
                "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
            ],
            "compilerPath": "/usr/bin/clang",
            "cStandard": "c17",
            "cppStandard": "c++17",
            "intelliSenseMode": "macos-clang-arm64"
        }
    ],
    "version": 4
}

After that it shows me ton of errors in the code, where obviously no error can be found.
Errors and still it cant finde 'Eigen/Core'.

I tried the same thing on CLion and in macOS terminal with success, eigen is found. So, i don't really understand what the problem of VS Code is.

Anybody an idea?

Thanks


问:
How to color of each individual of cluster based on their value of a df column
I have a dataframe that I took 4 columns out of i.e age, hours worked and I used kmeans to cluster it into 2 clusters and reduce the feature to 2. I have plotted the two features and based the color on the labels like so:

```<code>    plt.scatter(f1, f2, c=kmeans.labels_ )

    plt.show()
</code>```

How would I change the colors to be based on the value of the salary attribute instead of the label. Thank you

Body:
I have a dataframe that I took 4 columns out of i.e age, hours worked and I used kmeans to cluster it into 2 clusters and reduce the feature to 2. I have plotted the two features and based the color on the labels like so:

    plt.scatter(f1, f2, c=kmeans.labels_ )

    plt.show()

How would I change the colors to be based on the value of the salary attribute instead of the label. Thank you


问:
Is Hibernate creating proxy or loading real entity in collections depending on previous queries?
Is this some kind of Hibernate feature? If a proxy object was created and you iterate over other collection that contains it, then return that proxy. But if it was never loaded before, then load actual database representation?

Let's say, that instance of A has some elements in both sets bs and cs and each instance of B has property c set. Somewhere in the code I'm directly accessing cs property.
I noticed that if before accessing cs I iterate over bs elements, then cs contains proxies.
That does not happen, when I iterate over cs right after loading A instance.

It seems that C proxies are created and set when iterating over bs and the same proxy is later present when going through cs.

```<code>class A {
  Set<B> bs;
  Set<C> cs;
}

class B {
  C c;
}

class C {
  ...
}

</code>```

Body:
Is this some kind of Hibernate feature? If a proxy object was created and you iterate over other collection that contains it, then return that proxy. But if it was never loaded before, then load actual database representation?

Let's say, that instance of A has some elements in both sets bs and cs and each instance of B has property c set. Somewhere in the code I'm directly accessing cs property.
I noticed that if before accessing cs I iterate over bs elements, then cs contains proxies.
That does not happen, when I iterate over cs right after loading A instance.

It seems that C proxies are created and set when iterating over bs and the same proxy is later present when going through cs.

class A {
  Set bs;
  Set<C> cs;
}

class B {
  C c;
}

class C {
  ...
}


问:
How to solved the Axios 503 error when call external api
I've deployed my lambda to AWS (NodeJS runtime).

I am using axios to do a post request with formdata to the URL:

```<code>https://autopaypm.com/rate.php
</code>```

In my case:

Locally it works correctly

However, when running my code in the deployed Lambda it returns error 503

Error log of lambda shows the following:

```<code>2022-12-19T15:27:22.607Z    46cb1f4a-48b4-47c5-ab29-fb930e51a397    INFO    AxiosError: Request failed with status code 503
    at settle (/var/task/node_modules/axios/dist/node/axios.cjs:1855:12)
    at IncomingMessage.handleStreamEnd (/var/task/node_modules/axios/dist/node/axios.cjs:2712:11)
    at IncomingMessage.emit (events.js:326:22)
    at endReadableNT (_stream_readable.js:1241:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  code: 'ERR_BAD_RESPONSE',
  config: {
    transitional: {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    },
    adapter: [ 'xhr', 'http' ],
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [ [Function: transformResponse] ],
    timeout: 5000,
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    env: { FormData: [Function], Blob: null },
    validateStatus: [Function: validateStatus],
    headers: AxiosHeaders {
      Accept: 'application/json, text/plain, */*',
      'Content-Type': 'multipart/form-data; boundary=--------------------------059092898205449353940589',
      'Accept-Encoding': 'gzip,deflate,compress',
      'User-Agent': 'axios 1.2.1'
    },
    method: 'post',
    url: 'https://autopaypm.com/rate.php',
    data: FormData {
      _overheadLength: 755,
      _valueLength: 35,
      _valuesToMeasure: [],
      writable: false,
      readable: true,
      dataSize: 0,
      maxDataSize: 2097152,
      pauseStreams: true,
      _released: true,
      _streams: [],
      _currentStream: null,
      _insideLoop: false,
      _pendingNext: false,
      _boundary: '--------------------------059092898205449353940589',
      _events: [Object: null prototype],
      _eventsCount: 3
    }
  },
  request: ClientRequest {
    _events: [Object: null prototype] {
      socket: [Function],
      abort: [Function],
      aborted: [Function],
      connect: [Function],
      error: [Function],
      timeout: [Function],
      prefinish: [Function: requestOnPrefinish]
    },
    _eventsCount: 7,
    _maxListeners: undefined,
    outputData: [],
    outputSize: 0,
    writable: true,
    _last: true,
    chunkedEncoding: true,
    shouldKeepAlive: false,
    _defaultKeepAlive: true,
    useChunkedEncodingByDefault: true,
    sendDate: false,
    _removedConnection: false,
    _removedContLen: false,
    _removedTE: false,
    _contentLength: null,
    _hasBody: true,
    _trailer: '',
    finished: true,
    _headerSent: true,
    socket: TLSSocket {
      _tlsOptions: [Object],
      _secureEstablished: true,
      _securePending: false,
      _newSessionPending: false,
      _controlReleased: true,
      secureConnecting: false,
      _SNICallback: null,
      servername: 'autopaypm.com',
      alpnProtocol: false,
      authorized: true,
      authorizationError: null,
      encrypted: true,
      _events: [Object: null prototype],
      _eventsCount: 10,
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: 'autopaypm.com',
      _readableState: [ReadableState],
      readable: true,
      _maxListeners: undefined,
      _writableState: [WritableState],
      writable: false,
      allowHalfOpen: false,
      _sockname: null,
      _pendingData: null,
      _pendingEncoding: '',
      server: undefined,
      _server: null,
      ssl: [TLSWrap],
      _requestCert: true,
      _rejectUnauthorized: true,
      parser: null,
      _httpMessage: [Circular],
      timeout: 5000,
      [Symbol(res)]: [TLSWrap],
      [Symbol(verified)]: true,
      [Symbol(pendingSession)]: null,
      [Symbol(asyncId)]: 537,
      [Symbol(kHandle)]: [TLSWrap],
      [Symbol(kSetNoDelay)]: false,
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: Timeout {
        _idleTimeout: 5000,
        _idlePrev: [TimersList],
        _idleNext: [TimersList],
        _idleStart: 26956,
        _onTimeout: [Function: bound ],
        _timerArgs: undefined,
        _repeat: null,
        _destroyed: false,
        [Symbol(refed)]: false,
        [Symbol(kHasPrimitive)]: false,
        [Symbol(asyncId)]: 545,
        [Symbol(triggerId)]: 540
      },
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kCapture)]: false,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(connect-options)]: [Object]
    },
    connection: TLSSocket {
      _tlsOptions: [Object],
      _secureEstablished: true,
      _securePending: false,
      _newSessionPending: false,
      _controlReleased: true,
      secureConnecting: false,
      _SNICallback: null,
      servername: 'autopaypm.com',
      alpnProtocol: false,
      authorized: true,
      authorizationError: null,
      encrypted: true,
      _events: [Object: null prototype],
      _eventsCount: 10,
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: 'autopaypm.com',
      _readableState: [ReadableState],
      readable: true,
      _maxListeners: undefined,
      _writableState: [WritableState],
      writable: false,
      allowHalfOpen: false,
      _sockname: null,
      _pendingData: null,
      _pendingEncoding: '',
      server: undefined,
      _server: null,
      ssl: [TLSWrap],
      _requestCert: true,
      _rejectUnauthorized: true,
      parser: null,
      _httpMessage: [Circular],
      timeout: 5000,
      [Symbol(res)]: [TLSWrap],
      [Symbol(verified)]: true,
      [Symbol(pendingSession)]: null,
      [Symbol(asyncId)]: 537,
      [Symbol(kHandle)]: [TLSWrap],
      [Symbol(kSetNoDelay)]: false,
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: Timeout {
        _idleTimeout: 5000,
        _idlePrev: [TimersList],
        _idleNext: [TimersList],
        _idleStart: 26956,
        _onTimeout: [Function: bound ],
        _timerArgs: undefined,
        _repeat: null,
        _destroyed: false,
        [Symbol(refed)]: false,
        [Symbol(kHasPrimitive)]: false,
        [Symbol(asyncId)]: 545,
        [Symbol(triggerId)]: 540
      },
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kCapture)]: false,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(connect-options)]: [Object]
    },
    _header: 'POST /rate.php HTTP/1.1\r\n' +
      'Accept: application/json, text/plain, */*\r\n' +
      'Content-Type: multipart/form-data; boundary=--------------------------059092898205449353940589\r\n' +
      'Accept-Encoding: gzip,deflate,compress\r\n' +
      'User-Agent: axios 1.2.1\r\n' +
      'Host: autopaypm.com\r\n' +
      'Connection: close\r\n' +
      'Transfer-Encoding: chunked\r\n' +
      '\r\n',
    _keepAliveTimeout: 0,
    _onPendingData: [Function: noopPendingOutput],
    agent: Agent {
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      defaultPort: 443,
      protocol: 'https:',
      options: [Object],
      requests: {},
      sockets: [Object],
      freeSockets: {},
      keepAliveMsecs: 1000,
      keepAlive: false,
      maxSockets: Infinity,
      maxFreeSockets: 256,
      maxTotalSockets: Infinity,
      totalSocketCount: 1,
      scheduling: 'fifo',
      maxCachedSessions: 100,
      _sessionCache: [Object],
      [Symbol(kCapture)]: false
    },
    socketPath: undefined,
    method: 'POST',
    insecureHTTPParser: undefined,
    path: '/rate.php',
    _ended: true,
    res: IncomingMessage {
      _readableState: [ReadableState],
      readable: false,
      _events: [Object: null prototype],
      _eventsCount: 4,
      _maxListeners: undefined,
      socket: [TLSSocket],
      connection: [TLSSocket],
      httpVersionMajor: 1,
      httpVersionMinor: 1,
      httpVersion: '1.1',
      complete: true,
      headers: [Object],
      rawHeaders: [Array],
      trailers: {},
      rawTrailers: [],
      aborted: false,
      upgrade: false,
      url: '',
      method: null,
      statusCode: 503,
      statusMessage: 'Service Temporarily Unavailable',
      client: [TLSSocket],
      _consuming: true,
      _dumped: false,
      req: [Circular],
      responseUrl: 'https://autopaypm.com/rate.php',
      redirects: [],
      [Symbol(kCapture)]: false
    },
    aborted: false,
    timeoutCb: null,
    upgradeOrConnect: false,
    parser: null,
    maxHeadersCount: null,
    reusedSocket: false,
    host: 'autopaypm.com',
    protocol: 'https:',
    _redirectable: Writable {
      _writableState: [WritableState],
      writable: true,
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      _options: [Object],
      _ended: true,
      _ending: true,
      _redirectCount: 0,
      _redirects: [],
      _requestBodyLength: 846,
      _requestBodyBuffers: [],
      _onNativeResponse: [Function],
      _currentRequest: [Circular],
      _currentUrl: 'https://autopaypm.com/rate.php',
      _timeout: null,
      [Symbol(kCapture)]: false
    },
    [Symbol(kCapture)]: false,
    [Symbol(kNeedDrain)]: false,
    [Symbol(corked)]: 0,
    [Symbol(kOutHeaders)]: [Object: null prototype] {
      accept: [Array],
      'content-type': [Array],
      'accept-encoding': [Array],
      'user-agent': [Array],
      host: [Array]
    }
  },
  response: {
    status: 503,
    statusText: 'Service Temporarily Unavailable',
    headers: AxiosHeaders {
      date: 'Mon, 19 Dec 2022 15:27:22 GMT',
      'content-type': 'text/html; charset=UTF-8',
      'transfer-encoding': 'chunked',
      connection: 'close',
      'cross-origin-embedder-policy': 'require-corp',
      'cross-origin-opener-policy': 'same-origin',
      'cross-origin-resource-policy': 'same-origin',
      'permissions-policy': 'accelerometer=(),autoplay=(),camera=(),clipboard-read=(),clipboard-write=(),fullscreen=(),geolocation=(),gyroscope=(),hid=(),interest-cohort=(),magnetometer=(),microphone=(),payment=(),publickey-credentials-get=(),screen-wake-lock=(),serial=(),sync-xhr=(),usb=()',
      'referrer-policy': 'same-origin',
      'x-frame-options': 'SAMEORIGIN',
      'cache-control': 'private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0',
      expires: 'Thu, 01 Jan 1970 00:00:01 GMT',
      'server-timing': 'cf-q-config;dur=6.0000020312145e-06',
      'report-to': '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=GIp512epRW9w2zVQIe7I1QuC0oML60qhkbrRUAbf9G0x3HePioEXWk5gcnv7rXloQF4vCPSJSWRaQ9dCCvI59HOKYI9Lo%2BMkcgnpRhkp1rgAk3aeQAdh4dyR7gBokKBD"}],"group":"cf-nel","max_age":604800}',
      nel: '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}',
      vary: 'Accept-Encoding',
      server: 'cloudflare',
      'cf-ray': '77c129763b883095-SEA',
      'alt-svc': 'h3=":443"; ma=86400, h3-29=":443"; ma=86400'
    },
    config: {
      transitional: [Object],
      adapter: [Array],
      transformRequest: [Array],
      transformResponse: [Array],
      timeout: 5000,
      xsrfCookieName: 'XSRF-TOKEN',
      xsrfHeaderName: 'X-XSRF-TOKEN',
      maxContentLength: -1,
      maxBodyLength: -1,
      env: [Object],
      validateStatus: [Function: validateStatus],
      headers: [AxiosHeaders],
      method: 'post',
      url: 'https://autopaypm.com/rate.php',
      data: [FormData]
    },
    request: ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      _last: true,
      chunkedEncoding: true,
      shouldKeepAlive: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: true,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      _contentLength: null,
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      socket: [TLSSocket],
      connection: [TLSSocket],
      _header: 'POST /rate.php HTTP/1.1\r\n' +
        'Accept: application/json, text/plain, */*\r\n' +
        'Content-Type: multipart/form-data; boundary=--------------------------059092898205449353940589\r\n' +
        'Accept-Encoding: gzip,deflate,compress\r\n' +
        'User-Agent: axios 1.2.1\r\n' +
        'Host: autopaypm.com\r\n' +
        'Connection: close\r\n' +
        'Transfer-Encoding: chunked\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: noopPendingOutput],
      agent: [Agent],
      socketPath: undefined,
      method: 'POST',
      insecureHTTPParser: undefined,
      path: '/rate.php',
      _ended: true,
      res: [IncomingMessage],
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: 'autopaypm.com',
      protocol: 'https:',
      _redirectable: [Writable],
      [Symbol(kCapture)]: false,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype]
    },
    data: '<!DOCTYPE html>\n' +
      '<html lang="en-US">\n' +
      '<head>\n' +
      '    <title>Just a moment...</title>\n' +
      '    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\n' +
      '    <meta http-equiv="X-UA-Compatible" content="IE=Edge">\n' +
      '    <meta name="robots" content="noindex,nofollow">\n' +
      '    <meta name="viewport" content="width=device-width,initial-scale=1">\n' +
      '    <link href="/cdn-cgi/styles/challenges.css" rel="stylesheet">\n' +
      '    <meta http-equiv="refresh" content="35">\n' +
      '\n' +
      '</head>\n' +
      '<body class="no-js">\n' +
      '    <div class="main-wrapper" role="main">\n' +
      '    <div class="main-content">\n' +
      '        <h1 class="zone-name-title h1">\n' +
      '            <img class="heading-favicon" src="/favicon.ico"\n' +
      '                 onerror="this.onerror=null;this.parentNode.removeChild(this)">\n' +
      '            autopaypm.com\n' +
      '        </h1>\n' +
      '        <h2 class="h2" id="challenge-running">\n' +
      '            Checking if the site connection is secure\n' +
      '        </h2>\n' +
      '        <noscript>\n' +
      '            <div id="challenge-error-title">\n' +
      '                <div class="h2">\n' +
      '                    <span class="icon-wrapper">\n' +
      '                        <div class="heading-icon warning-icon"></div>\n' +
      '                    </span>\n' +
      '                    <span id="challenge-error-text">\n' +
      '                        Enable JavaScript and cookies to continue\n' +
      '                    </span>\n' +
      '                </div>\n' +
      '            </div>\n' +
      '        </noscript>\n' +
      `        <div id="trk_jschal_js" style="display:none;background-image:url('/cdn-cgi/images/trace/jsch/nojs/transparent.gif?ray=77c129763b883095')"></div>\n` +
      '        <div id="challenge-body-text" class="core-msg spacer">\n' +
      '            autopaypm.com needs to review the security of your connection before proceeding.\n' +
      '        </div>\n' +
      '        <form id="challenge-form" action="/rate.php?__cf_chl_f_tk=t6fpv0vGtE4mAJk9GQLU8TbtWiwHSQFEuG6Gdzm8S1E-1671463642-0-gaNycGzNCf0" method="POST" enctype="application/x-www-form-urlencoded">\n' +
      '            <input type="hidden" name="md" value="rtPyyR93tNOMbqayhVxMKQziEDt8BhzPwKTTe2N6PF4-1671463642-0-AQ9mVpD3FlIMSiyOtauRl7MdIVC1-g6Ol1kP4vVFxGsL43dBjFrBdaKeHrNnqYvajrweVvweo7oKEVpp6LSjUdGSboW84LVcdZfBx0BYOKk__yeRK5447LRnJFR7PGw4A_uS0ckfhIrPPjtZfJOsP9sKnbpnA2K4YR9Wma9rLhgzR2_WBI3IPUzJ0eqVxWxLILMThnYRrOKCGBlN5kTlSlFik445OOpBhqKGyounxeFsWSywmPQl417KkAKuuR3pWeQOOCqbAL7I7xgSWd9ETar59mF0PXh3JquhwwN-YGoJsN6MbQkLo-6XdSuBq_fOdfZdW6yrUEEqQQavmPz5Ge3Ix1cpl5e1f1U4i5ALPp5IatpYlgUX0ZR4vNMLEm_pKExAnh3TCgHoJWzsOoGUrHlJleetQe2NZ3Bgy55XvAMCOQq6YYhCRk7Rj2QVl3fOxHi3scu2_cODUFE2wO2QfHnhZlygxbZH5oubErnrpaZfancl57Vtg1vFfyNi7lPJQENsDSmTGIIxkbd9dbc0xJ9LV-m34m1V85T_ASxymzHe">\n' +
      '            <input type="hidden" name="r" value="Y2B4YUjgtSCNRcY4iKN81fkH6kWzqbwqhunIoz9pSzQ-1671463642-0-AWJ8M9Ef253jR/o5BfhE+RDoi8XunOqdHoFUphzvmdP9PPQhhVD4CxIE22oM9joZJRAE8qJD6KkMAX6nBRFv1UJWL2Utf7g+KbV5WBT2TuWTBFytxAMUuoRcoayJvmyTtPGKibaYhefquQ8I0ROPgJ5Dlz06s03zB+7mHr3Ask6PA6L3dLV2pZUDvFHMDsp/SFoXqUteSrW00VkTK99LG+RpAEO+JWDTjsjSlmyOfYTWXin6aJGa87lSzwXblAhIsCkZiRnaaJFBbFMka37cSlwvWZmd4VrwUqAR4OsNX9zCpO2I+soBMDicn8UgkEE2boou64owd7Yqe8CYRipULr0uHVw3yU2+maQeCDZj9GtK72fYhr1P24QekUIG/XdB21RSTweOBSJocBWKQnr0rIrO/pxWEq9M+Y5gtT5MJYUwKL5co8CafA45QOlWa9LFEf0OQqbqyWTJqHYp6CIJzwFOHgFZnX+M84F2Zdh4Sc6orrbkPwM2gTFzU2Sn9uD4xa754ISbOuX5a+1eaNW2XXkEcFj7MNF0dtRvf2UIwW+JDIfCF2C/pJFm5BkptYQLwC5msukjFQ/7IFIijRbze5L9DuZTAwf5bUOGBm4IlDRpMSVA74nz8uindTOJv5R3eL//OA8rlt2gciTHfhvWJB1pQxe+LUawMTugDzKytWqtxxZ+sGu7+scKxmwBqCwBJGTfosywJ9zdXxl +
      '        </form>\n' +
      '    </div>\n' +
      '</div>\n' +
      '\n' +
      '\n' +
      '\n' +
      '    <div class="footer" role="contentinfo">\n' +
      '        <div class="footer-inner">\n' +
      '            <div class="clearfix diagnostic-wrapper">\n' +
      '                <div class="ray-id">Ray ID: <code>77c129763b883095</code></div>\n' +
      '            </div>\n' +
      '            <div class="text-center">Performance & security by <a rel="noopener noreferrer" href="https://www.cloudflare.com?utm_source=challenge&utm_campaign=j" target="_blank">Cloudflare</a></div>\n' +
      '        </div>\n' +
      '    </div>\n' +
      '</body>\n' +
      '</html>\n'
  }
}

</code>```

`

Do we have any soltution for that? It come from the target site or from the lambda? Thank you so much

Body:
I've deployed my lambda to AWS (NodeJS runtime).

I am using axios to do a post request with formdata to the URL:

https://autopaypm.com/rate.php

In my case:

Locally it works correctly

However, when running my code in the deployed Lambda it returns error 503

Error log of lambda shows the following:

2022-12-19T15:27:22.607Z    46cb1f4a-48b4-47c5-ab29-fb930e51a397    INFO    AxiosError: Request failed with status code 503
    at settle (/var/task/node_modules/axios/dist/node/axios.cjs:1855:12)
    at IncomingMessage.handleStreamEnd (/var/task/node_modules/axios/dist/node/axios.cjs:2712:11)
    at IncomingMessage.emit (events.js:326:22)
    at endReadableNT (_stream_readable.js:1241:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  code: 'ERR_BAD_RESPONSE',
  config: {
    transitional: {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    },
    adapter: [ 'xhr', 'http' ],
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [ [Function: transformResponse] ],
    timeout: 5000,
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    env: { FormData: [Function], Blob: null },
    validateStatus: [Function: validateStatus],
    headers: AxiosHeaders {
      Accept: 'application/json, text/plain, */*',
      'Content-Type': 'multipart/form-data; boundary=--------------------------059092898205449353940589',
      'Accept-Encoding': 'gzip,deflate,compress',
      'User-Agent': 'axios 1.2.1'
    },
    method: 'post',
    url: 'https://autopaypm.com/rate.php',
    data: FormData {
      _overheadLength: 755,
      _valueLength: 35,
      _valuesToMeasure: [],
      writable: false,
      readable: true,
      dataSize: 0,
      maxDataSize: 2097152,
      pauseStreams: true,
      _released: true,
      _streams: [],
      _currentStream: null,
      _insideLoop: false,
      _pendingNext: false,
      _boundary: '--------------------------059092898205449353940589',
      _events: [Object: null prototype],
      _eventsCount: 3
    }
  },
  request: ClientRequest {
    _events: [Object: null prototype] {
      socket: [Function],
      abort: [Function],
      aborted: [Function],
      connect: [Function],
      error: [Function],
      timeout: [Function],
      prefinish: [Function: requestOnPrefinish]
    },
    _eventsCount: 7,
    _maxListeners: undefined,
    outputData: [],
    outputSize: 0,
    writable: true,
    _last: true,
    chunkedEncoding: true,
    shouldKeepAlive: false,
    _defaultKeepAlive: true,
    useChunkedEncodingByDefault: true,
    sendDate: false,
    _removedConnection: false,
    _removedContLen: false,
    _removedTE: false,
    _contentLength: null,
    _hasBody: true,
    _trailer: '',
    finished: true,
    _headerSent: true,
    socket: TLSSocket {
      _tlsOptions: [Object],
      _secureEstablished: true,
      _securePending: false,
      _newSessionPending: false,
      _controlReleased: true,
      secureConnecting: false,
      _SNICallback: null,
      servername: 'autopaypm.com',
      alpnProtocol: false,
      authorized: true,
      authorizationError: null,
      encrypted: true,
      _events: [Object: null prototype],
      _eventsCount: 10,
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: 'autopaypm.com',
      _readableState: [ReadableState],
      readable: true,
      _maxListeners: undefined,
      _writableState: [WritableState],
      writable: false,
      allowHalfOpen: false,
      _sockname: null,
      _pendingData: null,
      _pendingEncoding: '',
      server: undefined,
      _server: null,
      ssl: [TLSWrap],
      _requestCert: true,
      _rejectUnauthorized: true,
      parser: null,
      _httpMessage: [Circular],
      timeout: 5000,
      [Symbol(res)]: [TLSWrap],
      [Symbol(verified)]: true,
      [Symbol(pendingSession)]: null,
      [Symbol(asyncId)]: 537,
      [Symbol(kHandle)]: [TLSWrap],
      [Symbol(kSetNoDelay)]: false,
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: Timeout {
        _idleTimeout: 5000,
        _idlePrev: [TimersList],
        _idleNext: [TimersList],
        _idleStart: 26956,
        _onTimeout: [Function: bound ],
        _timerArgs: undefined,
        _repeat: null,
        _destroyed: false,
        [Symbol(refed)]: false,
        [Symbol(kHasPrimitive)]: false,
        [Symbol(asyncId)]: 545,
        [Symbol(triggerId)]: 540
      },
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kCapture)]: false,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(connect-options)]: [Object]
    },
    connection: TLSSocket {
      _tlsOptions: [Object],
      _secureEstablished: true,
      _securePending: false,
      _newSessionPending: false,
      _controlReleased: true,
      secureConnecting: false,
      _SNICallback: null,
      servername: 'autopaypm.com',
      alpnProtocol: false,
      authorized: true,
      authorizationError: null,
      encrypted: true,
      _events: [Object: null prototype],
      _eventsCount: 10,
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: 'autopaypm.com',
      _readableState: [ReadableState],
      readable: true,
      _maxListeners: undefined,
      _writableState: [WritableState],
      writable: false,
      allowHalfOpen: false,
      _sockname: null,
      _pendingData: null,
      _pendingEncoding: '',
      server: undefined,
      _server: null,
      ssl: [TLSWrap],
      _requestCert: true,
      _rejectUnauthorized: true,
      parser: null,
      _httpMessage: [Circular],
      timeout: 5000,
      [Symbol(res)]: [TLSWrap],
      [Symbol(verified)]: true,
      [Symbol(pendingSession)]: null,
      [Symbol(asyncId)]: 537,
      [Symbol(kHandle)]: [TLSWrap],
      [Symbol(kSetNoDelay)]: false,
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: Timeout {
        _idleTimeout: 5000,
        _idlePrev: [TimersList],
        _idleNext: [TimersList],
        _idleStart: 26956,
        _onTimeout: [Function: bound ],
        _timerArgs: undefined,
        _repeat: null,
        _destroyed: false,
        [Symbol(refed)]: false,
        [Symbol(kHasPrimitive)]: false,
        [Symbol(asyncId)]: 545,
        [Symbol(triggerId)]: 540
      },
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kCapture)]: false,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(connect-options)]: [Object]
    },
    _header: 'POST /rate.php HTTP/1.1\r\n' +
      'Accept: application/json, text/plain, */*\r\n' +
      'Content-Type: multipart/form-data; boundary=--------------------------059092898205449353940589\r\n' +
      'Accept-Encoding: gzip,deflate,compress\r\n' +
      'User-Agent: axios 1.2.1\r\n' +
      'Host: autopaypm.com\r\n' +
      'Connection: close\r\n' +
      'Transfer-Encoding: chunked\r\n' +
      '\r\n',
    _keepAliveTimeout: 0,
    _onPendingData: [Function: noopPendingOutput],
    agent: Agent {
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      defaultPort: 443,
      protocol: 'https:',
      options: [Object],
      requests: {},
      sockets: [Object],
      freeSockets: {},
      keepAliveMsecs: 1000,
      keepAlive: false,
      maxSockets: Infinity,
      maxFreeSockets: 256,
      maxTotalSockets: Infinity,
      totalSocketCount: 1,
      scheduling: 'fifo',
      maxCachedSessions: 100,
      _sessionCache: [Object],
      [Symbol(kCapture)]: false
    },
    socketPath: undefined,
    method: 'POST',
    insecureHTTPParser: undefined,
    path: '/rate.php',
    _ended: true,
    res: IncomingMessage {
      _readableState: [ReadableState],
      readable: false,
      _events: [Object: null prototype],
      _eventsCount: 4,
      _maxListeners: undefined,
      socket: [TLSSocket],
      connection: [TLSSocket],
      httpVersionMajor: 1,
      httpVersionMinor: 1,
      httpVersion: '1.1',
      complete: true,
      headers: [Object],
      rawHeaders: [Array],
      trailers: {},
      rawTrailers: [],
      aborted: false,
      upgrade: false,
      url: '',
      method: null,
      statusCode: 503,
      statusMessage: 'Service Temporarily Unavailable',
      client: [TLSSocket],
      _consuming: true,
      _dumped: false,
      req: [Circular],
      responseUrl: 'https://autopaypm.com/rate.php',
      redirects: [],
      [Symbol(kCapture)]: false
    },
    aborted: false,
    timeoutCb: null,
    upgradeOrConnect: false,
    parser: null,
    maxHeadersCount: null,
    reusedSocket: false,
    host: 'autopaypm.com',
    protocol: 'https:',
    _redirectable: Writable {
      _writableState: [WritableState],
      writable: true,
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      _options: [Object],
      _ended: true,
      _ending: true,
      _redirectCount: 0,
      _redirects: [],
      _requestBodyLength: 846,
      _requestBodyBuffers: [],
      _onNativeResponse: [Function],
      _currentRequest: [Circular],
      _currentUrl: 'https://autopaypm.com/rate.php',
      _timeout: null,
      [Symbol(kCapture)]: false
    },
    [Symbol(kCapture)]: false,
    [Symbol(kNeedDrain)]: false,
    [Symbol(corked)]: 0,
    [Symbol(kOutHeaders)]: [Object: null prototype] {
      accept: [Array],
      'content-type': [Array],
      'accept-encoding': [Array],
      'user-agent': [Array],
      host: [Array]
    }
  },
  response: {
    status: 503,
    statusText: 'Service Temporarily Unavailable',
    headers: AxiosHeaders {
      date: 'Mon, 19 Dec 2022 15:27:22 GMT',
      'content-type': 'text/html; charset=UTF-8',
      'transfer-encoding': 'chunked',
      connection: 'close',
      'cross-origin-embedder-policy': 'require-corp',
      'cross-origin-opener-policy': 'same-origin',
      'cross-origin-resource-policy': 'same-origin',
      'permissions-policy': 'accelerometer=(),autoplay=(),camera=(),clipboard-read=(),clipboard-write=(),fullscreen=(),geolocation=(),gyroscope=(),hid=(),interest-cohort=(),magnetometer=(),microphone=(),payment=(),publickey-credentials-get=(),screen-wake-lock=(),serial=(),sync-xhr=(),usb=()',
      'referrer-policy': 'same-origin',
      'x-frame-options': 'SAMEORIGIN',
      'cache-control': 'private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0',
      expires: 'Thu, 01 Jan 1970 00:00:01 GMT',
      'server-timing': 'cf-q-config;dur=6.0000020312145e-06',
      'report-to': '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=GIp512epRW9w2zVQIe7I1QuC0oML60qhkbrRUAbf9G0x3HePioEXWk5gcnv7rXloQF4vCPSJSWRaQ9dCCvI59HOKYI9Lo%2BMkcgnpRhkp1rgAk3aeQAdh4dyR7gBokKBD"}],"group":"cf-nel","max_age":604800}',
      nel: '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}',
      vary: 'Accept-Encoding',
      server: 'cloudflare',
      'cf-ray': '77c129763b883095-SEA',
      'alt-svc': 'h3=":443"; ma=86400, h3-29=":443"; ma=86400'
    },
    config: {
      transitional: [Object],
      adapter: [Array],
      transformRequest: [Array],
      transformResponse: [Array],
      timeout: 5000,
      xsrfCookieName: 'XSRF-TOKEN',
      xsrfHeaderName: 'X-XSRF-TOKEN',
      maxContentLength: -1,
      maxBodyLength: -1,
      env: [Object],
      validateStatus: [Function: validateStatus],
      headers: [AxiosHeaders],
      method: 'post',
      url: 'https://autopaypm.com/rate.php',
      data: [FormData]
    },
    request: ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      _last: true,
      chunkedEncoding: true,
      shouldKeepAlive: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: true,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      _contentLength: null,
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      socket: [TLSSocket],
      connection: [TLSSocket],
      _header: 'POST /rate.php HTTP/1.1\r\n' +
        'Accept: application/json, text/plain, */*\r\n' +
        'Content-Type: multipart/form-data; boundary=--------------------------059092898205449353940589\r\n' +
        'Accept-Encoding: gzip,deflate,compress\r\n' +
        'User-Agent: axios 1.2.1\r\n' +
        'Host: autopaypm.com\r\n' +
        'Connection: close\r\n' +
        'Transfer-Encoding: chunked\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: noopPendingOutput],
      agent: [Agent],
      socketPath: undefined,
      method: 'POST',
      insecureHTTPParser: undefined,
      path: '/rate.php',
      _ended: true,
      res: [IncomingMessage],
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: 'autopaypm.com',
      protocol: 'https:',
      _redirectable: [Writable],
      [Symbol(kCapture)]: false,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype]
    },
    data: '<!DOCTYPE html>\n' +
      '\n' +
      '\n' +
      '    <title>Just a moment...</title>\n' +
      '    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\n' +
      '    <meta http-equiv="X-UA-Compatible" content="IE=Edge">\n' +
      '    <meta name="robots" content="noindex,nofollow">\n' +
      '    <meta name="viewport" content="width=device-width,initial-scale=1">\n' +
      '    <link href="/cdn-cgi/styles/challenges.css" rel="stylesheet">\n' +
      '    <meta http-equiv="refresh" content="35">\n' +
      '\n' +
      '\n' +
      '\n' +
      '
\n' +
      '
\n' +
      '
\n' +
      '            \n' +
      '            autopaypm.com\n' +
      '
\n' +
      '
\n' +
      '            Checking if the site connection is secure\n' +
      '
\n' +
      '        \n' +
      '
\n' +
      '
\n' +
      '                    \n' +
      '

\n' +
      '                    \n' +
      '                    \n' +
      '                        Enable JavaScript and cookies to continue\n' +
      '                    \n' +
      '
\n' +
      '
\n' +
      '        \n' +
      `        <div id="trk_jschal_js" style="display:none;background-image:url('/cdn-cgi/images/trace/jsch/nojs/transparent.gif?ray=77c129763b883095')"></div>\n` +
      '
\n' +
      '            autopaypm.com needs to review the security of your connection before proceeding.\n' +
      '
\n' +
      '        <form id="challenge-form" action="/rate.php?__cf_chl_f_tk=t6fpv0vGtE4mAJk9GQLU8TbtWiwHSQFEuG6Gdzm8S1E-1671463642-0-gaNycGzNCf0" method="POST" enctype="application/x-www-form-urlencoded">\n' +
      '            <input type="hidden" name="md" value="rtPyyR93tNOMbqayhVxMKQziEDt8BhzPwKTTe2N6PF4-1671463642-0-AQ9mVpD3FlIMSiyOtauRl7MdIVC1-g6Ol1kP4vVFxGsL43dBjFrBdaKeHrNnqYvajrweVvweo7oKEVpp6LSjUdGSboW84LVcdZfBx0BYOKk__yeRK5447LRnJFR7PGw4A_uS0ckfhIrPPjtZfJOsP9sKnbpnA2K4YR9Wma9rLhgzR2_WBI3IPUzJ0eqVxWxLILMThnYRrOKCGBlN5kTlSlFik445OOpBhqKGyounxeFsWSywmPQl417KkAKuuR3pWeQOOCqbAL7I7xgSWd9ETar59mF0PXh3JquhwwN-YGoJsN6MbQkLo-6XdSuBq_fOdfZdW6yrUEEqQQavmPz5Ge3Ix1cpl5e1f1U4i5ALPp5IatpYlgUX0ZR4vNMLEm_pKExAnh3TCgHoJWzsOoGUrHlJleetQe2NZ3Bgy55XvAMCOQq6YYhCRk7Rj2QVl3fOxHi3scu2_cODUFE2wO2QfHnhZlygxbZH5oubErnrpaZfancl57Vtg1vFfyNi7lPJQENsDSmTGIIxkbd9dbc0xJ9LV-m34m1V85T_ASxymzHe">\n' +
      '            <input type="hidden" name="r" value="Y2B4YUjgtSCNRcY4iKN81fkH6kWzqbwqhunIoz9pSzQ-1671463642-0-AWJ8M9Ef253jR/o5BfhE+RDoi8XunOqdHoFUphzvmdP9PPQhhVD4CxIE22oM9joZJRAE8qJD6KkMAX6nBRFv1UJWL2Utf7g+KbV5WBT2TuWTBFytxAMUuoRcoayJvmyTtPGKibaYhefquQ8I0ROPgJ5Dlz06s03zB+7mHr3Ask6PA6L3dLV2pZUDvFHMDsp/SFoXqUteSrW00VkTK99LG+RpAEO+JWDTjsjSlmyOfYTWXin6aJGa87lSzwXblAhIsCkZiRnaaJFBbFMka37cSlwvWZmd4VrwUqAR4OsNX9zCpO2I+soBMDicn8UgkEE2boou64owd7Yqe8CYRipULr0uHVw3yU2+maQeCDZj9GtK72fYhr1P24QekUIG/XdB21RSTweOBSJocBWKQnr0rIrO/pxWEq9M+Y5gtT5MJYUwKL5co8CafA45QOlWa9LFEf0OQqbqyWTJqHYp6CIJzwFOHgFZnX+M84F2Zdh4Sc6orrbkPwM2gTFzU2Sn9uD4xa754ISbOuX5a+1eaNW2XXkEcFj7MNF0dtRvf2UIwW+JDIfCF2C/pJFm5BkptYQLwC5msukjFQ/7IFIijRbze5L9DuZTAwf5bUOGBm4IlDRpMSVA74nz8uindTOJv5R3eL//OA8rlt2gciTHfhvWJB1pQxe+LUawMTugDzKytWqtxxZ+sGu7+scKxmwBqCwBJGTfosywJ9zdXxl +
      '        </form>\n' +
      '
\n' +
      '
\n' +
      '\n' +
      '\n' +
      '\n' +
      '
\n' +
      '
\n' +
      '
\n' +
      '
Ray ID: 77c129763b883095
\n' +
      '
\n' +
      '
Performance & security by Cloudflare
\n' +
      '
\n' +
      '
\n' +
      '\n' +
      '\n'
  }
}

`

Do we have any soltution for that? It come from the target site or from the lambda? Thank you so much


问:
How would you open a new expo app screen on item click?
My code is:

```<code>const getItem = (item) => {
    // Function for click on an item
    alert('Open : ' + item.open + ' Close: ' + item.close + ' Low ' + item.low + ' High: ' + item.high + ' Volume: ' + item.volumes);
  };
</code>```

The code above uses alert to display a box that shows information all coming from an external API which is good. However, I want that information to display on a new screen rather than through an alert box. Is there any code that I can replace alert with to do this?

Body:
My code is:

const getItem = (item) => {
    // Function for click on an item
    alert('Open : ' + item.open + ' Close: ' + item.close + ' Low ' + item.low + ' High: ' + item.high + ' Volume: ' + item.volumes);
  };

The code above uses alert to display a box that shows information all coming from an external API which is good. However, I want that information to display on a new screen rather than through an alert box. Is there any code that I can replace alert with to do this?


问:
How to move 2 Scrollbars Simultaneously using Python Dash Ploty
```<code>from dash import Dash, html, dcc, Input, Output, ctx
import plotly.express as px
from dash import Dash, dash_table
import pandas as pd
from collections import OrderedDict

app = Dash(__name__)

data = OrderedDict(
\[
("Date", \["2015-01-01", "2015-10-24", "2016-05-10", "2017-01-10", "2018-05-10", "2018-08-15"\]),
("Region", \["Montreal", "Toronto", "New York City", "Miami", "San Francisco", "London"\]),
("Temperature", \[1, -20, 3.512, 4, 10423, -441.2\]),
("Humidity", \[10, 20, 30, 40, 50, 60\]),
("Pressure", \[2, 10924, 3912, -10, 3591.2, 15\]),
\]
)

df = pd.DataFrame(
OrderedDict(\[(name, col_data \* 10) for (name, col_data) in data.items()\])
)

app.layout = html.Div(children= \[dash_table.DataTable(
data=df.to_dict('records'),
columns=\[{'id': c, 'name': c} for c in df.columns\],
page_action='none',
style_table={'height': '300px', 'overflowY': 'auto'}
),
html.Br(),
dash_table.DataTable(
data=df.to_dict('records'),
columns=\[{'id': c, 'name': c} for c in df.columns\],
page_action='none',
style_table={'height': '300px', 'overflowY': 'auto'}
)\])

if __name__ == '__main__':
app.run_server(debug=True)
</code>```

This is the sample Code for displaying 2 tables in the web using Python Dash, How can I connect 2 scrollbars i.e movement of one scroll bar should make movement of another scroll bar.

Thank you!

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

Body:
from dash import Dash, html, dcc, Input, Output, ctx
import plotly.express as px
from dash import Dash, dash_table
import pandas as pd
from collections import OrderedDict

app = Dash(__name__)

data = OrderedDict(
\[
("Date", \["2015-01-01", "2015-10-24", "2016-05-10", "2017-01-10", "2018-05-10", "2018-08-15"\]),
("Region", \["Montreal", "Toronto", "New York City", "Miami", "San Francisco", "London"\]),
("Temperature", \[1, -20, 3.512, 4, 10423, -441.2\]),
("Humidity", \[10, 20, 30, 40, 50, 60\]),
("Pressure", \[2, 10924, 3912, -10, 3591.2, 15\]),
\]
)

df = pd.DataFrame(
OrderedDict(\[(name, col_data \* 10) for (name, col_data) in data.items()\])
)

app.layout = html.Div(children= \[dash_table.DataTable(
data=df.to_dict('records'),
columns=\[{'id': c, 'name': c} for c in df.columns\],
page_action='none',
style_table={'height': '300px', 'overflowY': 'auto'}
),
html.Br(),
dash_table.DataTable(
data=df.to_dict('records'),
columns=\[{'id': c, 'name': c} for c in df.columns\],
page_action='none',
style_table={'height': '300px', 'overflowY': 'auto'}
)\])

if __name__ == '__main__':
app.run_server(debug=True)

This is the sample Code for displaying 2 tables in the web using Python Dash, How can I connect 2 scrollbars i.e movement of one scroll bar should make movement of another scroll bar.

Thank you!


问:
How can i Fix my Logic for Powershell Scripting
Basically I have this script running in powershell to offboard users.

However, at one point there is a logic error where the script is picking up user to offboard but it is also picking up another user at the same time.

Let's say - If user A was being offboarded - and his transfer date - offboarding date was all set - and it was in a specific OU

User B - Was in a different OU, but it was also being picked up at the same time

I believe i know where the error is happening in my script and it might be at this area

```<code>Checked for Suspended Users "
                if($uat)
                {
                    $recentsuspended = New-Object -TypeName psobject
                    $recentsuspended | Add-Member -MemberType NoteProperty -Name items -Value 'true'
                }
            if(($recentsuspended.items) -or ($bypassuserstoprocess.primaryEmail))
            {
                $userstoprocess =@()
                $userstoprocess = $recentsuspended.items.events.parameters.value | Get-Unique
                if($bypassuserstoprocess.primaryEmail)
                {
                      ** $userstoprocess += $bypassuserstoprocess.primaryEmail.trim()   *** **Most likely this part *
                }
                Write-Debug "Found $($userstoprocess.count)  Recently Suspended users"
                $userstoprocess = $($userstoprocess | group-object).name

                if($uat)
                {$userstoprocess = $testuser}
             #  $suspendedusers =  $userstoprocess
             #   $suspendeduser

                $nonbypassedusers = @()
                $userstobypass =@()
                $alluserstoprocess =@()
</code>```

how the error looks like is following
Unable to Load user details userA@email.comUserB@email.com System.Net.WebException

when it loads user details it should only load 1 email -

As you can see from top that is what is happening, and I am not sure what to do with my logic

Body:
Basically I have this script running in powershell to offboard users.

However, at one point there is a logic error where the script is picking up user to offboard but it is also picking up another user at the same time.

Let's say - If user A was being offboarded - and his transfer date - offboarding date was all set - and it was in a specific OU

User B - Was in a different OU, but it was also being picked up at the same time

I believe i know where the error is happening in my script and it might be at this area

Checked for Suspended Users "
                if($uat)
                {
                    $recentsuspended = New-Object -TypeName psobject
                    $recentsuspended | Add-Member -MemberType NoteProperty -Name items -Value 'true'
                }
            if(($recentsuspended.items) -or ($bypassuserstoprocess.primaryEmail))
            {
                $userstoprocess =@()
                $userstoprocess = $recentsuspended.items.events.parameters.value | Get-Unique
                if($bypassuserstoprocess.primaryEmail)
                {
                      ** $userstoprocess += $bypassuserstoprocess.primaryEmail.trim()   *** **Most likely this part *
                }
                Write-Debug "Found $($userstoprocess.count)  Recently Suspended users"
                $userstoprocess = $($userstoprocess | group-object).name

                if($uat)
                {$userstoprocess = $testuser}
             #  $suspendedusers =  $userstoprocess
             #   $suspendeduser

                $nonbypassedusers = @()
                $userstobypass =@()
                $alluserstoprocess =@()

how the error looks like is following
Unable to Load user details userA@email.comUserB@email.com System.Net.WebException

when it loads user details it should only load 1 email -

As you can see from top that is what is happening, and I am not sure what to do with my logic


问:
Why doesn't replacing double quotes in arguments work?
I want to have a batch script argument as a string which possibly contains spaces. I need to put it inside double quotes:

```<code>script.bat "hello world"
</code>```

Now, in the script I need modify it. So I need to remove the quotes. In my test, using %a:"=% should work:

```<code>set a="hello world" & echo %a%
"hello world"
set b=%a:"=% & echo %b%
hello world
</code>```

However this doesn't work if the variable is an input argument:

```<code>echo %1%
"hello world"
set b=%1:"=% & echo %b%
"hello world":"=
</code>```

I manage to solve this by using a temp variable:

```<code>echo %1%
"hello world"
set a=%1% & echo %a%
"hello world"
set b=%a:"=% & echo %b%
hello world
</code>```

But I still wonder why you can't directly work with %1%?

Body:
I want to have a batch script argument as a string which possibly contains spaces. I need to put it inside double quotes:

script.bat "hello world"

Now, in the script I need modify it. So I need to remove the quotes. In my test, using %a:"=% should work:

set a="hello world" & echo %a%
"hello world"
set b=%a:"=% & echo %b%
hello world

However this doesn't work if the variable is an input argument:

echo %1%
"hello world"
set b=%1:"=% & echo %b%
"hello world":"=

I manage to solve this by using a temp variable:

echo %1%
"hello world"
set a=%1% & echo %a%
"hello world"
set b=%a:"=% & echo %b%
hello world

But I still wonder why you can't directly work with %1%?


问:
Excel changes a string containing the character E to exponential
I've writen a code in c# to generate from DB table an excel file, however there is a column that has string values some of them are like this: 718E1, and these values excel writes them as exponentials like: 7,18E+03. Can someone help me solve this problem.
Thank you!

I tried :
cellRangC_Prod.EntireColumn.NumberFormat= "@";

However this just writes the cell 718 and it should be 718E1.


问:
Material UI Typography doesn't work in react
I used Material UI Typography component in the react app. Although I imported necessary files it doesn't function and also no errors shown. I am unable to find what's happening in my code.</p>
```<code>import React from "react";
import HomePage from "../pages/home/index.jsx";

function App() { return ( <HomePage /> ); }

export default App
</code>```
```<code>import {Component} from "react";
import React from "react";
import Greeting from "../../components/home/greeting";

class HomePage extends Component {
    constructor(props) {
        super(props);
    }

    render(){
        return(
           <Greeting/>
        )
    }
}

export default HomePage;
</code>```
```<code>import {Component} from "react";
import React from "react";
import Typography from '@mui/material/Typography';

class Greeting extends Component{
    constructor(props) {
        super(props);
    }

    render(){
        return(
            <div>
                <div>
                    <Typography variant="h3" gutterBottom>
                        Hello World!
                    </Typography>
                </div>
                <div></div>
            </div>
        )
    }
}

export default Greeting;
</code>```

Body:
I used Material UI Typography component in the react app. Although I imported necessary files it doesn't function and also no errors shown. I am unable to find what's happening in my code.

import React from "react";
import HomePage from "../pages/home/index.jsx";

function App() { return ( <HomePage /> ); }

export default App

import {Component} from "react";
import React from "react";
import Greeting from "../../components/home/greeting";

class HomePage extends Component {
    constructor(props) {
        super(props);
    }

    render(){
        return(
           <Greeting/>
        )
    }
}

export default HomePage;

import {Component} from "react";
import React from "react";
import Typography from '@mui/material/Typography';

class Greeting extends Component{
    constructor(props) {
        super(props);
    }

    render(){
        return(

                    <Typography variant="h3" gutterBottom>
                        Hello World!
                    </Typography>

        )
    }
}

export default Greeting;


问:
@JsonProeprty ignored on nested object
I have the following configuration bean :

```<code>@Configuration
@ConfigurationProperties(
        prefix = "services.config"
)
@Getter
@RequiredArgsConstructor
public class ServicesConfiguration {
    private final Map<String, ServiceProperties> configs = new HashMap<>();
   ....
}
</code>```

The ServiceProperties class :

```<code>@AllArgsConstructor
@Data
@NoArgsConstructor
public class ServiceProperties{
    private String name;
    @JsonProperty("refresh")
    private ServiceRefreshProperties refreshProperties = new ServiceRefreshProperties();

}
</code>```

The refresh properties class :

```<code>@Data
public class ServiceRefreshProperties {
    private boolean enabled;
    private String scheduler;
}
</code>```

and my yaml look like the following :

```<code>services:
  config:
    serviceA:
      name: "A"
      refresh:
        enabled: true
        scheduler: "aa-sched"
</code>```

When the application starts, the refreshProperties are not loaded and are equal to null. All the other properties (name, and a few others) are loaded successfully.

I tried also :

Adding a dedicated setter for this property which gets an input of map in the function arguments.

Any idea why it doesnt work ?

Title: @JsonProeprty ignored on nested object

Body:
I have the following configuration bean :

@Configuration
@ConfigurationProperties(
        prefix = "services.config"
)
@Getter
@RequiredArgsConstructor
public class ServicesConfiguration {
    private final Map<String, ServiceProperties> configs = new HashMap<>();
   ....
}

The ServiceProperties class :

@AllArgsConstructor
@Data
@NoArgsConstructor
public class ServiceProperties{
    private String name;
    @JsonProperty("refresh")
    private ServiceRefreshProperties refreshProperties = new ServiceRefreshProperties();

}

The refresh properties class :

@Data
public class ServiceRefreshProperties {
    private boolean enabled;
    private String scheduler;
}

and my yaml look like the following :

services:
  config:
    serviceA:
      name: "A"
      refresh:
        enabled: true
        scheduler: "aa-sched"

When the application starts, the refreshProperties are not loaded and are equal to null. All the other properties (name, and a few others) are loaded successfully.

I tried also :

Adding a dedicated setter for this property which gets an input of map in the function arguments.

Any idea why it doesnt work ?


问:
Sum specific keys, for each year, in a hierarchical json with pandas
I have the following json file (containing data from 53 different xlsx files):

```<code>"2020": {
        "Budget GDP": 0.006072840439754585,
        "Budget USD$": 2365925313.360189,
        "Persons Effective": 4282302,
        "Persons Percent of Population": 0.09475005340101046
      },
      "2021": {
        "Budget GDP": null,
        "Budget USD$": null,
        "Persons Effective": null,
        "Persons Percent of Population": null
      }
    },
    {
      "Name": "arg_PTC_FIS_v8.xlsx",
      "Years": [2005, 2006, 2007, 2008, 2009, 2010],
      "2005": {
        "Budget GDP": 0.0008600302697312613,
        "Budget USD$": 172541169.88659993,
        "Persons Effective": 1095520.5,
        "Persons Percent of Population": 0.02816759940257524
      },

</code>```

I would like to sum the total USD$ Budget of all the projects per year.

So far I have tried saving it as a dictionary and using groupby.sum() functions, but it is telling me 'dict has no attribute XXX':

```<code>df = pd.read_json('output.json')
df2 = df.to_dict(orient='list')
df3 = df2.groupby('Year')['Budget USD$'].sum()
</code>```

I am new to python and pandas.

Many thanks

Body:
I have the following json file (containing data from 53 different xlsx files):

"2020": {
        "Budget GDP": 0.006072840439754585,
        "Budget USD$": 2365925313.360189,
        "Persons Effective": 4282302,
        "Persons Percent of Population": 0.09475005340101046
      },
      "2021": {
        "Budget GDP": null,
        "Budget USD$": null,
        "Persons Effective": null,
        "Persons Percent of Population": null
      }
    },
    {
      "Name": "arg_PTC_FIS_v8.xlsx",
      "Years": [2005, 2006, 2007, 2008, 2009, 2010],
      "2005": {
        "Budget GDP": 0.0008600302697312613,
        "Budget USD$": 172541169.88659993,
        "Persons Effective": 1095520.5,
        "Persons Percent of Population": 0.02816759940257524
      },

I would like to sum the total USD$ Budget of all the projects per year.

So far I have tried saving it as a dictionary and using groupby.sum() functions, but it is telling me 'dict has no attribute XXX':

df = pd.read_json('output.json')
df2 = df.to_dict(orient='list')
df3 = df2.groupby('Year')['Budget USD$'].sum()

I am new to python and pandas.

Many thanks


问:
The problem is that when selecting from select it has ware:model, the slider crashes, and when you click on search, it shows 404
When I use livewire The problem is that when selecting from select it has ware:model, the slider crashes, and when you click on search, it shows 404

As shown in the pictures

I tried many times but I don't know why

//my view

```<code>div class="ne-sidebar sidebar-break-lg col-xl-4 col-lg-12 px-0">

            <div class="sidebar-box item-box-light-md">
              <div class="topic-border color-cinnabar mb-30">
                <div class="topic-box-lg color-cinnabar">{{__("translate.Search")}} </div>
              </div>
              <div class="bodyimg">
                <form action="{{route('advancedPost.search')}}" method="post" name="dmarticlesFilter" id="dmarticlesFilter">
                    @csrf
            <div id="dmarticlesfilter_filters">
                <div class="dmarticlesfilter_filters_row">
                <select id="filterCategory634bd4c1cb9b5_0" wire:model="fcategory_id">
                            <option>{{__("translate.choose")}}</option>
                            @foreach($firstcategories as $fcat)
                              <option value="{{$fcat->id}}">{{$fcat->name}}</option>
                            @endforeach
                    </select>

                    <select id="filterCategory634bd4c1cb9b5_1" wire:model="scategory_id">
                            <option>{{__("translate.choose")}}</option>
                            @foreach($secondcategories as $scat)
                              <option value="{{$scat->id}}">{{$scat->name}}</option>
                            @endforeach
                    </select>

                        </div>

                        <div class="dmarticlesfilter_filters_values_l">
                            <input placeholder="Title" type="text" name="filterTitle" value="">

                    <span><input type="submit" class="button" id="button" value="{{__('translate.Search')}}"> </span>
                    <a > {{__("translate.UserGuid")}}</a>
                  </div>
                    </div>

                </form>
                </a>
              </div>
            </div>

</code>```

//my controller

```<code><?php
namespace App\Http\Livewire;
use Livewire\Component;
use App\Models\category;
use App\Models\post;
use App\Models\firstcategory;
use App\Models\secondcategory;
use App\Models\thirdcategory;
use App\Models\fourthcategory;
use DB;
class HomeComponent extends Component
{
    public $fcategory_id;
    public $scategory_id;
    public $tcategory_id;

    public function render()
    {

        /***************************** */
        $firstcategories = firstcategory::all();
        $secondcategories = secondcategory::where('fcategory_id',$this->fcategory_id)->get();
        $thirdcategories = thirdcategory::where('scategory_id',$this->scategory_id)->get();
        $fourthcategories = fourthcategory::where('tcategory_id',$this->tcategory_id)->get();

        return view('livewire.home-component',['fourthcategories'=>$fourthcategories,'thirdcategories'=>$thirdcategories,'secondcategories'=>$secondcategories,'firstcategories'=>$firstcategories])->layout('layouts.base');
    }
}

</code>```

I think the problem is with livewire with wire:model

//the method in  Livewire component that handles the form it get value from the select then search by the the value

```<code>class AdvancedSearchComponent extends Component
{
    public function render(Request $req)
    {
        $posts = post::where('fourCatID',$req->foucategory_id)->get();
        return view('livewire.advanced-search-component',['posts'=>$posts])->layout('layouts.base');
    }
}
</code>```

Body:
When I use livewire The problem is that when selecting from select it has ware:model, the slider crashes, and when you click on search, it shows 404

As shown in the pictures

I tried many times but I don't know why

//my view

div class="ne-sidebar sidebar-break-lg col-xl-4 col-lg-12 px-0">

{{__("translate.Search")}}

                <form action="{{route('advancedPost.search')}}" method="post" name="dmarticlesFilter" id="dmarticlesFilter">
                    @csrf

                <select id="filterCategory634bd4c1cb9b5_0" wire:model="fcategory_id">
                            <option>{{__("translate.choose")}}</option>
                            @foreach($firstcategories as $fcat)
                              <option value="{{$fcat->id}}">{{$fcat->name}}</option>
                            @endforeach
                    </select>

                    <select id="filterCategory634bd4c1cb9b5_1" wire:model="scategory_id">
                            <option>{{__("translate.choose")}}</option>
                            @foreach($secondcategories as $scat)
                              <option value="{{$scat->id}}">{{$scat->name}}</option>
                            @endforeach
                    </select>

                            <input placeholder="Title" type="text" name="filterTitle" value="">

                    <input type="submit" class="button" id="button" value="{{__('translate.Search')}}">
                     {{__("translate.UserGuid")}}

                </form>

//my controller

<?php
namespace App\Http\Livewire;
use Livewire\Component;
use App\Models\category;
use App\Models\post;
use App\Models\firstcategory;
use App\Models\secondcategory;
use App\Models\thirdcategory;
use App\Models\fourthcategory;
use DB;
class HomeComponent extends Component
{
    public $fcategory_id;
    public $scategory_id;
    public $tcategory_id;

    public function render()
    {

        /***************************** */
        $firstcategories = firstcategory::all();
        $secondcategories = secondcategory::where('fcategory_id',$this->fcategory_id)->get();
        $thirdcategories = thirdcategory::where('scategory_id',$this->scategory_id)->get();
        $fourthcategories = fourthcategory::where('tcategory_id',$this->tcategory_id)->get();

        return view('livewire.home-component',['fourthcategories'=>$fourthcategories,'thirdcategories'=>$thirdcategories,'secondcategories'=>$secondcategories,'firstcategories'=>$firstcategories])->layout('layouts.base');
    }
}

I think the problem is with livewire with wire:model

//the method in  Livewire component that handles the form it get value from the select then search by the the value

class AdvancedSearchComponent extends Component
{
    public function render(Request $req)
    {
        $posts = post::where('fourCatID',$req->foucategory_id)->get();
        return view('livewire.advanced-search-component',['posts'=>$posts])->layout('layouts.base');
    }
}


问:
CSS fit background image inside div on fixed height and width without cropping image content and take full width
How to fit background image inside div on fixed height and width without cropping image content and take full width.
Render size of the image is 318px width x 422px height it should contain inside a 290px x 310px container without loosing image content and image should not look stretched.

I have tried background-size: cover; // here it crops image content

background-size: contain // here there is extra white space is created

```<code>  .card {
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
    transition: 0.3s;
    width: 290px;
    height: 542px;
    border-radius: 8px;
    border: 1px solid black;
  }

.bg-img {
    background-image: url("url");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    height: 310px;
    border-radius: 8px 8px 0px 0px;
  }

<div class="card">
      <div class="bg-img" />
</div>
</code>```

JSFiddle example

Body:
How to fit background image inside div on fixed height and width without cropping image content and take full width.
Render size of the image is 318px width x 422px height it should contain inside a 290px x 310px container without loosing image content and image should not look stretched.

I have tried background-size: cover; // here it crops image content

background-size: contain // here there is extra white space is created

  .card {
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
    transition: 0.3s;
    width: 290px;
    height: 542px;
    border-radius: 8px;
    border: 1px solid black;
  }

.bg-img {
    background-image: url("url");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    height: 310px;
    border-radius: 8px 8px 0px 0px;
  }

JSFiddle example