问:
JAX-RS resource in Tomcat not getting called
I'm learning Java. I ran a simple maven Jersey project on Tomcat with IntelliJ, the results are:

http://localhost:8080/demorest_war/
-> renders the index.jsp

http://localhost:8080/demorest_war/webresources/myresource
-> reports: HTTP Status 404 – Not Found

the basic resource code and configuration are:

```<code>src/main/webapp/index.jsp
--------------------------
<html>
<body>
<h2>Jersey RESTful Web Application!</h2>
<p><a href="webresources/myresource">Jersey resource</a>
<p>Visit the <a href="http://jersey.java.net">Project Jersey website</a>
for more information on Jersey!
</body>
</html>

src/main/java/com/telusko/MyResource.java
-------------------------------------------
package com.telusko;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;

@Path("/myresource")
public class MyResource {
    @GET
    @Produces("text/plain")
    public String getIt() {
        return "Hi there!";
    }
}

src/main/webapp/WEB-INF/web.xml
----------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <servlet>
        <servlet-name>Jersey Web Application</servlet-name>
        <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
        <init-param>
            <param-name>com.sun.jersey.config.property.packages</param-name>
            <param-value>com.telusko</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Jersey Web Application</servlet-name>
        <url-pattern>/webresources/*</url-pattern>
    </servlet-mapping>
</web-app>
</code>```

There was no errors or exceptions on the console during the build or processing the requests.

could anyone help identify what might be the cause?
also, where is the "demorest_war" part of the URL is configured?

Body:
I'm learning Java. I ran a simple maven Jersey project on Tomcat with IntelliJ, the results are:

http://localhost:8080/demorest_war/
-> renders the index.jsp

http://localhost:8080/demorest_war/webresources/myresource
-> reports: HTTP Status 404 – Not Found

the basic resource code and configuration are:

src/main/webapp/index.jsp
--------------------------

Jersey RESTful Web Application!

Jersey resource

Visit the Project Jersey website
for more information on Jersey!

src/main/java/com/telusko/MyResource.java
-------------------------------------------
package com.telusko;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;

@Path("/myresource")
public class MyResource {
    @GET
    @Produces("text/plain")
    public String getIt() {
        return "Hi there!";
    }
}

src/main/webapp/WEB-INF/web.xml
----------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <servlet>
        <servlet-name>Jersey Web Application</servlet-name>
        <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
        <init-param>
            <param-name>com.sun.jersey.config.property.packages</param-name>
            <param-value>com.telusko</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Jersey Web Application</servlet-name>
        <url-pattern>/webresources/*</url-pattern>
    </servlet-mapping>
</web-app>

There was no errors or exceptions on the console during the build or processing the requests.

could anyone help identify what might be the cause?
also, where is the "demorest_war" part of the URL is configured?


来源: stackexchange

问:
certificate that works with curl but not with logstash
The curl test works:

```<code>curl -X POST -d'["a", "b"]' https://asite.net/logs/json --header 'Content-Type: application/json' \
--cacert ... \
--cert ... \
--key ...
</code>```

But the same cert (caret, cert, and key) does not work in logstash version 6.8.23. A "hello world" reproducer configuration file is:

```<code>input {
  stdin { }
}
output {
        http {
            url => "https://asite.net/logs/json"
            http_method => "post"
            automatic_retries => 2147483647
            retry_non_idempotent => true
            keepalive => "true"
            request_timeout => 240
            connect_timeout => 180
            socket_timeout => 200
            content_type => "application/json"
            client_cert => "..."
            client_key => "..."
            cacert => "..."
            pool_max => 200
            pool_max_per_route => 100
        }
}
</code>```

The error message is copied below. I was told that it is because the logstash could not pass the concatenated (chained) cert while curl can, but I am using a decently latest version of logstash (6.8.23, the latest version in Ubuntu 20.04), and it should perform this basic function.

Is there a way to verify if logstash does send the chained certificate? What does the error InvalidKeySpecException mean? The key and cert does match or it would not pass the curl test.

```<code>[ERROR] 2022-12-15 16:40:54.315 [[main]>worker1] http - [HTTP Output Failure] Could not fetch URL {:url=>"https://asite.net/logs/json", :method=>:post, :message=>"java.security.InvalidKeyException: IOException : null", :class=>"Java::JavaSecuritySpec::InvalidKeySpecException", :will_retry=>false, :backtrace=>["sun.security.rsa.RSAKeyFactory.engineGeneratePrivate(sun/security/rsa/RSAKeyFactory.java:252)", "java.security.KeyFactory.generatePrivate(java/security/KeyFactory.java:372)", "java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)", "org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:425)", "org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:292)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.manticore_minus_0_dot_7_dot_0_minus_java.lib.manticore.client.setup_key_store(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/manticore-0.7.0-java/lib/manticore/client.rb:682)", "org.jruby.RubyArray.each(org/jruby/RubyArray.java:1792)", "org.jruby.RubyArray$INVOKER$i$0$0$each.call(org/jruby/RubyArray$INVOKER$i$0$0$each.gen)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.manticore_minus_0_dot_7_dot_0_minus_java.lib.manticore.client.setup_key_store(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/manticore-0.7.0-java/lib/manticore/client.rb:677)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.manticore_minus_0_dot_7_dot_0_minus_java.lib.manticore.client.RUBY$method$setup_key_store$0$__VARARGS__(usr/share/logstash/vendor/bundle/jruby/$2_dot_5_dot_0/gems/manticore_minus_0_dot_7_dot_0_minus_java/lib/manticore//usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/manticore-0.7.0-java/lib/manticore/client.rb)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.manticore_minus_0_dot_7_dot_0_minus_java.lib.manticore.client.ssl_socket_factory_from_options(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/manticore-0.7.0-java/lib/manticore/client.rb:623)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.manticore_minus_0_dot_7_dot_0_minus_java.lib.manticore.client.RUBY$method$ssl_socket_factory_from_options$0$__VARARGS__(usr/share/logstash/vendor/bundle/jruby/$2_dot_5_dot_0/gems/manticore_minus_0_dot_7_dot_0_minus_java/lib/manticore//usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/manticore-0.7.0-java/lib/manticore/client.rb)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.manticore_minus_0_dot_7_dot_0_minus_java.lib.manticore.client.pool_builder(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/manticore-0.7.0-java/lib/manticore/client.rb:398)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.manticore_minus_0_dot_7_dot_0_minus_java.lib.manticore.client.RUBY$method$pool_builder$0$__VARARGS__(usr/share/logstash/vendor/bundle/jruby/$2_dot_5_dot_0/gems/manticore_minus_0_dot_7_dot_0_minus_java/lib/manticore//usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/manticore-0.7.0-java/lib/manticore/client.rb)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.manticore_minus_0_dot_7_dot_0_minus_java.lib.manticore.client.pool(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/manticore-0.7.0-java/lib/manticore/client.rb:406)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.manticore_minus_0_dot_7_dot_0_minus_java.lib.manticore.client.initialize(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/manticore-0.7.0-java/lib/manticore/client.rb:209)", "org.jruby.RubyClass.newInstance(org/jruby/RubyClass.java:915)", "org.jruby.RubyClass$INVOKER$i$newInstance.call(org/jruby/RubyClass$INVOKER$i$newInstance.gen)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_mixin_minus_http_client_minus_6_dot_0_dot_1.lib.logstash.plugin_mixins.http_client.make_client(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-mixin-http_client-6.0.1/lib/logstash/plugin_mixins/http_client.rb:180)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_mixin_minus_http_client_minus_6_dot_0_dot_1.lib.logstash.plugin_mixins.http_client.RUBY$method$make_client$0$__VARARGS__(usr/share/logstash/vendor/bundle/jruby/$2_dot_5_dot_0/gems/logstash_minus_mixin_minus_http_client_minus_6_dot_0_dot_1/lib/logstash/plugin_mixins//usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-mixin-http_client-6.0.1/lib/logstash/plugin_mixins/http_client.rb)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_mixin_minus_http_client_minus_6_dot_0_dot_1.lib.logstash.plugin_mixins.http_client.client(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-mixin-http_client-6.0.1/lib/logstash/plugin_mixins/http_client.rb:185)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_mixin_minus_http_client_minus_6_dot_0_dot_1.lib.logstash.plugin_mixins.http_client.RUBY$method$client$0$__VARARGS__(usr/share/logstash/vendor/bundle/jruby/$2_dot_5_dot_0/gems/logstash_minus_mixin_minus_http_client_minus_6_dot_0_dot_1/lib/logstash/plugin_mixins//usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-mixin-http_client-6.0.1/lib/logstash/plugin_mixins/http_client.rb)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_output_minus_http_minus_5_dot_2_dot_5.lib.logstash.outputs.http.send_event(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-http-5.2.5/lib/logstash/outputs/http.rb:239)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_output_minus_http_minus_5_dot_2_dot_5.lib.logstash.outputs.http.RUBY$method$send_event$0$__VARARGS__(usr/share/logstash/vendor/bundle/jruby/$2_dot_5_dot_0/gems/logstash_minus_output_minus_http_minus_5_dot_2_dot_5/lib/logstash/outputs//usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-http-5.2.5/lib/logstash/outputs/http.rb)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_output_minus_http_minus_5_dot_2_dot_5.lib.logstash.outputs.http.send_events(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-http-5.2.5/lib/logstash/outputs/http.rb:175)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_output_minus_http_minus_5_dot_2_dot_5.lib.logstash.outputs.http.RUBY$method$send_events$0$__VARARGS__(usr/share/logstash/vendor/bundle/jruby/$2_dot_5_dot_0/gems/logstash_minus_output_minus_http_minus_5_dot_2_dot_5/lib/logstash/outputs//usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-http-5.2.5/lib/logstash/outputs/http.rb)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_output_minus_http_minus_5_dot_2_dot_5.lib.logstash.outputs.http.multi_receive(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-http-5.2.5/lib/logstash/outputs/http.rb:124)", "org.logstash.config.ir.compiler.OutputStrategyExt$AbstractOutputStrategyExt.invokeOutput(org/logstash/config/ir/compiler/OutputStrategyExt.java:128)", "org.logstash.config.ir.compiler.OutputStrategyExt$SimpleAbstractOutputStrategyExt.doOutput(org/logstash/config/ir/compiler/OutputStrategyExt.java:250)", "org.logstash.config.ir.compiler.OutputStrategyExt$SharedOutputStrategyExt.output(org/logstash/config/ir/compiler/OutputStrategyExt.java:283)", "org.logstash.config.ir.compiler.OutputStrategyExt$AbstractOutputStrategyExt.multi_receive(org/logstash/config/ir/compiler/OutputStrategyExt.java:118)", "org.logstash.config.ir.compiler.OutputDelegatorExt.doOutput(org/logstash/config/ir/compiler/OutputDelegatorExt.java:78)", "org.logstash.config.ir.compiler.AbstractOutputDelegatorExt.multi_receive(org/logstash/config/ir/compiler/AbstractOutputDelegatorExt.java:101)", "org.logstash.config.ir.compiler.AbstractOutputDelegatorExt$INVOKER$i$1$0$multiReceive.call(org/logstash/config/ir/compiler/AbstractOutputDelegatorExt$INVOKER$i$1$0$multiReceive.gen)", "usr.share.logstash.logstash_minus_core.lib.logstash.pipeline.output_batch(/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:390)", "org.jruby.RubyHash$12.visit(org/jruby/RubyHash.java:1438)", "org.jruby.RubyHash$12.visit(org/jruby/RubyHash.java:1435)", "org.jruby.RubyHash.visitLimited(org/jruby/RubyHash.java:690)", "org.jruby.RubyHash.visitAll(org/jruby/RubyHash.java:675)", "org.jruby.RubyHash.iteratorVisitAll(org/jruby/RubyHash.java:1395)", "org.jruby.RubyHash.each_pairCommon(org/jruby/RubyHash.java:1430)", "org.jruby.RubyHash.each(org/jruby/RubyHash.java:1419)", "org.jruby.RubyHash$INVOKER$i$0$0$each.call(org/jruby/RubyHash$INVOKER$i$0$0$each.gen)", "usr.share.logstash.logstash_minus_core.lib.logstash.pipeline.output_batch(/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:389)", "usr.share.logstash.logstash_minus_core.lib.logstash.pipeline.RUBY$method$output_batch$0$__VARARGS__(usr/share/logstash/logstash_minus_core/lib/logstash//usr/share/logstash/logstash-core/lib/logstash/pipeline.rb)", "usr.share.logstash.logstash_minus_core.lib.logstash.pipeline.worker_loop(/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:341)", "usr.share.logstash.logstash_minus_core.lib.logstash.pipeline.RUBY$method$worker_loop$0$__VARARGS__(usr/share/logstash/logstash_minus_core/lib/logstash//usr/share/logstash/logstash-core/lib/logstash/pipeline.rb)", "usr.share.logstash.logstash_minus_core.lib.logstash.pipeline.start_workers(/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:304)", "org.jruby.RubyProc.call(org/jruby/RubyProc.java:295)", "org.jruby.RubyProc.call(org/jruby/RubyProc.java:274)", "org.jruby.RubyProc.call(org/jruby/RubyProc.java:270)", "java.lang.Thread.run(java/lang/Thread.java:750)"], :headers=>{"Content-Type"=>"application/json"}, :body=>"{\"message\":\"hello world\",\"host\":\"...\",\"@timestamp\":\"2022-12-15T16:40:53.282Z\",\"@version\":\"1\"}"}
</code>```

ContentLicense: CC BY-SA 4.0

Body:
The curl test works:

curl -X POST -d'["a", "b"]' https://asite.net/logs/json --header 'Content-Type: application/json' \
--cacert ... \
--cert ... \
--key ...

But the same cert (caret, cert, and key) does not work in logstash version 6.8.23. A "hello world" reproducer configuration file is:

input {
  stdin { }
}
output {
        http {
            url => "https://asite.net/logs/json"
            http_method => "post"
            automatic_retries => 2147483647
            retry_non_idempotent => true
            keepalive => "true"
            request_timeout => 240
            connect_timeout => 180
            socket_timeout => 200
            content_type => "application/json"
            client_cert => "..."
            client_key => "..."
            cacert => "..."
            pool_max => 200
            pool_max_per_route => 100
        }
}

The error message is copied below. I was told that it is because the logstash could not pass the concatenated (chained) cert while curl can, but I am using a decently latest version of logstash (6.8.23, the latest version in Ubuntu 20.04), and it should perform this basic function.

Is there a way to verify if logstash does send the chained certificate? What does the error InvalidKeySpecException mean? The key and cert does match or it would not pass the curl test.

[ERROR] 2022-12-15 16:40:54.315 [[main]>worker1] http - [HTTP Output Failure] Could not fetch URL {:url=>"https://asite.net/logs/json", :method=>:post, :message=>"java.security.InvalidKeyException: IOException : null", :class=>"Java::JavaSecuritySpec::InvalidKeySpecException", :will_retry=>false, :backtrace=>["sun.security.rsa.RSAKeyFactory.engineGeneratePrivate(sun/security/rsa/RSAKeyFactory.java:252)", "java.security.KeyFactory.generatePrivate(java/security/KeyFactory.java:372)", "java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)", "org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:425)", "org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:292)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.manticore_minus_0_dot_7_dot_0_minus_java.lib.manticore.client.setup_key_store(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/manticore-0.7.0-java/lib/manticore/client.rb:682)", "org.jruby.RubyArray.each(org/jruby/RubyArray.java:1792)", "org.jruby.RubyArray$INVOKER$i$0$0$each.call(org/jruby/RubyArray$INVOKER$i$0$0$each.gen)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.manticore_minus_0_dot_7_dot_0_minus_java.lib.manticore.client.setup_key_store(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/manticore-0.7.0-java/lib/manticore/client.rb:677)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.manticore_minus_0_dot_7_dot_0_minus_java.lib.manticore.client.RUBY$method$setup_key_store$0$__VARARGS__(usr/share/logstash/vendor/bundle/jruby/$2_dot_5_dot_0/gems/manticore_minus_0_dot_7_dot_0_minus_java/lib/manticore//usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/manticore-0.7.0-java/lib/manticore/client.rb)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.manticore_minus_0_dot_7_dot_0_minus_java.lib.manticore.client.ssl_socket_factory_from_options(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/manticore-0.7.0-java/lib/manticore/client.rb:623)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.manticore_minus_0_dot_7_dot_0_minus_java.lib.manticore.client.RUBY$method$ssl_socket_factory_from_options$0$__VARARGS__(usr/share/logstash/vendor/bundle/jruby/$2_dot_5_dot_0/gems/manticore_minus_0_dot_7_dot_0_minus_java/lib/manticore//usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/manticore-0.7.0-java/lib/manticore/client.rb)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.manticore_minus_0_dot_7_dot_0_minus_java.lib.manticore.client.pool_builder(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/manticore-0.7.0-java/lib/manticore/client.rb:398)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.manticore_minus_0_dot_7_dot_0_minus_java.lib.manticore.client.RUBY$method$pool_builder$0$__VARARGS__(usr/share/logstash/vendor/bundle/jruby/$2_dot_5_dot_0/gems/manticore_minus_0_dot_7_dot_0_minus_java/lib/manticore//usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/manticore-0.7.0-java/lib/manticore/client.rb)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.manticore_minus_0_dot_7_dot_0_minus_java.lib.manticore.client.pool(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/manticore-0.7.0-java/lib/manticore/client.rb:406)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.manticore_minus_0_dot_7_dot_0_minus_java.lib.manticore.client.initialize(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/manticore-0.7.0-java/lib/manticore/client.rb:209)", "org.jruby.RubyClass.newInstance(org/jruby/RubyClass.java:915)", "org.jruby.RubyClass$INVOKER$i$newInstance.call(org/jruby/RubyClass$INVOKER$i$newInstance.gen)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_mixin_minus_http_client_minus_6_dot_0_dot_1.lib.logstash.plugin_mixins.http_client.make_client(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-mixin-http_client-6.0.1/lib/logstash/plugin_mixins/http_client.rb:180)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_mixin_minus_http_client_minus_6_dot_0_dot_1.lib.logstash.plugin_mixins.http_client.RUBY$method$make_client$0$__VARARGS__(usr/share/logstash/vendor/bundle/jruby/$2_dot_5_dot_0/gems/logstash_minus_mixin_minus_http_client_minus_6_dot_0_dot_1/lib/logstash/plugin_mixins//usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-mixin-http_client-6.0.1/lib/logstash/plugin_mixins/http_client.rb)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_mixin_minus_http_client_minus_6_dot_0_dot_1.lib.logstash.plugin_mixins.http_client.client(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-mixin-http_client-6.0.1/lib/logstash/plugin_mixins/http_client.rb:185)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_mixin_minus_http_client_minus_6_dot_0_dot_1.lib.logstash.plugin_mixins.http_client.RUBY$method$client$0$__VARARGS__(usr/share/logstash/vendor/bundle/jruby/$2_dot_5_dot_0/gems/logstash_minus_mixin_minus_http_client_minus_6_dot_0_dot_1/lib/logstash/plugin_mixins//usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-mixin-http_client-6.0.1/lib/logstash/plugin_mixins/http_client.rb)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_output_minus_http_minus_5_dot_2_dot_5.lib.logstash.outputs.http.send_event(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-http-5.2.5/lib/logstash/outputs/http.rb:239)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_output_minus_http_minus_5_dot_2_dot_5.lib.logstash.outputs.http.RUBY$method$send_event$0$__VARARGS__(usr/share/logstash/vendor/bundle/jruby/$2_dot_5_dot_0/gems/logstash_minus_output_minus_http_minus_5_dot_2_dot_5/lib/logstash/outputs//usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-http-5.2.5/lib/logstash/outputs/http.rb)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_output_minus_http_minus_5_dot_2_dot_5.lib.logstash.outputs.http.send_events(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-http-5.2.5/lib/logstash/outputs/http.rb:175)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_output_minus_http_minus_5_dot_2_dot_5.lib.logstash.outputs.http.RUBY$method$send_events$0$__VARARGS__(usr/share/logstash/vendor/bundle/jruby/$2_dot_5_dot_0/gems/logstash_minus_output_minus_http_minus_5_dot_2_dot_5/lib/logstash/outputs//usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-http-5.2.5/lib/logstash/outputs/http.rb)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_output_minus_http_minus_5_dot_2_dot_5.lib.logstash.outputs.http.multi_receive(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-http-5.2.5/lib/logstash/outputs/http.rb:124)", "org.logstash.config.ir.compiler.OutputStrategyExt$AbstractOutputStrategyExt.invokeOutput(org/logstash/config/ir/compiler/OutputStrategyExt.java:128)", "org.logstash.config.ir.compiler.OutputStrategyExt$SimpleAbstractOutputStrategyExt.doOutput(org/logstash/config/ir/compiler/OutputStrategyExt.java:250)", "org.logstash.config.ir.compiler.OutputStrategyExt$SharedOutputStrategyExt.output(org/logstash/config/ir/compiler/OutputStrategyExt.java:283)", "org.logstash.config.ir.compiler.OutputStrategyExt$AbstractOutputStrategyExt.multi_receive(org/logstash/config/ir/compiler/OutputStrategyExt.java:118)", "org.logstash.config.ir.compiler.OutputDelegatorExt.doOutput(org/logstash/config/ir/compiler/OutputDelegatorExt.java:78)", "org.logstash.config.ir.compiler.AbstractOutputDelegatorExt.multi_receive(org/logstash/config/ir/compiler/AbstractOutputDelegatorExt.java:101)", "org.logstash.config.ir.compiler.AbstractOutputDelegatorExt$INVOKER$i$1$0$multiReceive.call(org/logstash/config/ir/compiler/AbstractOutputDelegatorExt$INVOKER$i$1$0$multiReceive.gen)", "usr.share.logstash.logstash_minus_core.lib.logstash.pipeline.output_batch(/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:390)", "org.jruby.RubyHash$12.visit(org/jruby/RubyHash.java:1438)", "org.jruby.RubyHash$12.visit(org/jruby/RubyHash.java:1435)", "org.jruby.RubyHash.visitLimited(org/jruby/RubyHash.java:690)", "org.jruby.RubyHash.visitAll(org/jruby/RubyHash.java:675)", "org.jruby.RubyHash.iteratorVisitAll(org/jruby/RubyHash.java:1395)", "org.jruby.RubyHash.each_pairCommon(org/jruby/RubyHash.java:1430)", "org.jruby.RubyHash.each(org/jruby/RubyHash.java:1419)", "org.jruby.RubyHash$INVOKER$i$0$0$each.call(org/jruby/RubyHash$INVOKER$i$0$0$each.gen)", "usr.share.logstash.logstash_minus_core.lib.logstash.pipeline.output_batch(/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:389)", "usr.share.logstash.logstash_minus_core.lib.logstash.pipeline.RUBY$method$output_batch$0$__VARARGS__(usr/share/logstash/logstash_minus_core/lib/logstash//usr/share/logstash/logstash-core/lib/logstash/pipeline.rb)", "usr.share.logstash.logstash_minus_core.lib.logstash.pipeline.worker_loop(/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:341)", "usr.share.logstash.logstash_minus_core.lib.logstash.pipeline.RUBY$method$worker_loop$0$__VARARGS__(usr/share/logstash/logstash_minus_core/lib/logstash//usr/share/logstash/logstash-core/lib/logstash/pipeline.rb)", "usr.share.logstash.logstash_minus_core.lib.logstash.pipeline.start_workers(/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:304)", "org.jruby.RubyProc.call(org/jruby/RubyProc.java:295)", "org.jruby.RubyProc.call(org/jruby/RubyProc.java:274)", "org.jruby.RubyProc.call(org/jruby/RubyProc.java:270)", "java.lang.Thread.run(java/lang/Thread.java:750)"], :headers=>{"Content-Type"=>"application/json"}, :body=>"{\"message\":\"hello world\",\"host\":\"...\",\"@timestamp\":\"2022-12-15T16:40:53.282Z\",\"@version\":\"1\"}"}


问:
Android studio maven and google mirror problem
I have problem with apache archiva mirror on Android studio

I create self-host maven mirror with apache archiva

First, I created  remote repository for google and Gradle plugin and maven
Seccoend I created local repository for google and Gradle plugin and maven
Third, I created  proxy connector

but when I use the mirror address, I get this error

```<code>Build file 'C:\Users\Administrator\Desktop\myapp\build.gradle' line: 7

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

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

* Exception is:
org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'com.android.application', version: '7.1.1', apply: false] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'com.android.application:com.android.application.gradle.plugin:7.1.1')
  Searched in the following repositories:
    maven(https://my-mirror.com/)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolveToFoundResult(DefaultPluginRequestApplicator.java:221)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.lambda$resolvePluginRequests$3(DefaultPluginRequestApplicator.java:147)
    at org.gradle.util.internal.CollectionUtils.collect(CollectionUtils.java:207)
    at org.gradle.util.internal.CollectionUtils.collect(CollectionUtils.java:201)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolvePluginRequests(DefaultPluginRequestApplicator.java:145)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugins(DefaultPluginRequestApplicator.java:88)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:117)
    at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:65)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
    at org.gradle.configuration.BuildOperationScriptPlugin.lambda$apply$0(BuildOperationScriptPlugin.java:62)
    at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:44)
    at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:62)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$applyToMutableState$0(DefaultProjectStateRegistry.java:366)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:393)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.applyToMutableState(DefaultProjectStateRegistry.java:365)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:42)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
    at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:35)
    at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.lambda$run$0(LifecycleProjectEvaluator.java:100)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$applyToMutableState$0(DefaultProjectStateRegistry.java:366)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$withProjectLock$3(DefaultProjectStateRegistry.java:426)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:211)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withProjectLock(DefaultProjectStateRegistry.java:426)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:407)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.applyToMutableState(DefaultProjectStateRegistry.java:365)
    at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.run(LifecycleProjectEvaluator.java:91)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:63)
    at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:751)
    at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:151)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.ensureConfigured(DefaultProjectStateRegistry.java:339)
    at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:41)
    at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:55)
    at org.gradle.configuration.DefaultProjectsPreparer.prepareProjects(DefaultProjectsPreparer.java:48)
    at org.gradle.configuration.BuildTreePreparingProjectsPreparer.prepareProjects(BuildTreePreparingProjectsPreparer.java:64)
    at org.gradle.configuration.BuildOperationFiringProjectsPreparer$ConfigureBuild.run(BuildOperationFiringProjectsPreparer.java:52)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
    at org.gradle.configuration.BuildOperationFiringProjectsPreparer.prepareProjects(BuildOperationFiringProjectsPreparer.java:40)
    at org.gradle.initialization.VintageBuildModelController.lambda$prepareProjects$1(VintageBuildModelController.java:93)
    at org.gradle.internal.build.StateTransitionController.lambda$doTransition$1(StateTransitionController.java:222)
    at org.gradle.internal.build.StateTransitionController.doTransition(StateTransitionController.java:243)
    at org.gradle.internal.build.StateTransitionController.doTransition(StateTransitionController.java:221)
    at org.gradle.internal.build.StateTransitionController.transitionIfNotPreviously(StateTransitionController.java:190)
    at org.gradle.initialization.VintageBuildModelController.prepareProjects(VintageBuildModelController.java:93)
    at org.gradle.initialization.VintageBuildModelController.doBuildStages(VintageBuildModelController.java:77)
    at org.gradle.initialization.VintageBuildModelController.getConfiguredModel(VintageBuildModelController.java:58)
    at org.gradle.internal.build.StateTransitionController.notInStateIgnoreOtherThreads(StateTransitionController.java:89)
    at org.gradle.internal.build.DefaultBuildLifecycleController.getConfiguredBuild(DefaultBuildLifecycleController.java:98)
    at org.gradle.internal.build.AbstractBuildState.ensureProjectsConfigured(AbstractBuildState.java:65)
    at org.gradle.internal.buildtree.DefaultBuildTreeModelCreator$DefaultBuildToolingModelController.locateBuilderForTarget(DefaultBuildTreeModelCreator.java:90)
    at org.gradle.internal.buildtree.DefaultBuildTreeModelCreator$DefaultBuildToolingModelController.locateBuilderForDefaultTarget(DefaultBuildTreeModelCreator.java:82)
    at org.gradle.tooling.internal.provider.runner.DefaultBuildController$DefaultTargetModel.locate(DefaultBuildController.java:239)
    at org.gradle.tooling.internal.provider.runner.DefaultBuildController.getToolingModelBuilder(DefaultBuildController.java:184)
    at org.gradle.tooling.internal.provider.runner.DefaultBuildController.getModel(DefaultBuildController.java:98)
    at org.gradle.tooling.internal.consumer.connection.ParameterAwareBuildControllerAdapter.getModel(ParameterAwareBuildControllerAdapter.java:39)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.getModel(UnparameterizedBuildController.java:113)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.getModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.findModel(UnparameterizedBuildController.java:97)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.findModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.findModel(UnparameterizedBuildController.java:81)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.findModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.findModel(UnparameterizedBuildController.java:66)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.findModel(NestedActionAwareBuildControllerAdapter.java:31)

</code>```

Body:
I have problem with apache archiva mirror on Android studio

I create self-host maven mirror with apache archiva

First, I created  remote repository for google and Gradle plugin and maven
Seccoend I created local repository for google and Gradle plugin and maven
Third, I created  proxy connector

but when I use the mirror address, I get this error

Build file 'C:\Users\Administrator\Desktop\myapp\build.gradle' line: 7

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

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

* Exception is:
org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'com.android.application', version: '7.1.1', apply: false] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'com.android.application:com.android.application.gradle.plugin:7.1.1')
  Searched in the following repositories:
    maven(https://my-mirror.com/)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolveToFoundResult(DefaultPluginRequestApplicator.java:221)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.lambda$resolvePluginRequests$3(DefaultPluginRequestApplicator.java:147)
    at org.gradle.util.internal.CollectionUtils.collect(CollectionUtils.java:207)
    at org.gradle.util.internal.CollectionUtils.collect(CollectionUtils.java:201)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolvePluginRequests(DefaultPluginRequestApplicator.java:145)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugins(DefaultPluginRequestApplicator.java:88)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:117)
    at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:65)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
    at org.gradle.configuration.BuildOperationScriptPlugin.lambda$apply$0(BuildOperationScriptPlugin.java:62)
    at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:44)
    at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:62)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$applyToMutableState$0(DefaultProjectStateRegistry.java:366)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:393)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.applyToMutableState(DefaultProjectStateRegistry.java:365)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:42)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
    at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:35)
    at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.lambda$run$0(LifecycleProjectEvaluator.java:100)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$applyToMutableState$0(DefaultProjectStateRegistry.java:366)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$withProjectLock$3(DefaultProjectStateRegistry.java:426)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:211)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withProjectLock(DefaultProjectStateRegistry.java:426)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:407)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.applyToMutableState(DefaultProjectStateRegistry.java:365)
    at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.run(LifecycleProjectEvaluator.java:91)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:63)
    at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:751)
    at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:151)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.ensureConfigured(DefaultProjectStateRegistry.java:339)
    at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:41)
    at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:55)
    at org.gradle.configuration.DefaultProjectsPreparer.prepareProjects(DefaultProjectsPreparer.java:48)
    at org.gradle.configuration.BuildTreePreparingProjectsPreparer.prepareProjects(BuildTreePreparingProjectsPreparer.java:64)
    at org.gradle.configuration.BuildOperationFiringProjectsPreparer$ConfigureBuild.run(BuildOperationFiringProjectsPreparer.java:52)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
    at org.gradle.configuration.BuildOperationFiringProjectsPreparer.prepareProjects(BuildOperationFiringProjectsPreparer.java:40)
    at org.gradle.initialization.VintageBuildModelController.lambda$prepareProjects$1(VintageBuildModelController.java:93)
    at org.gradle.internal.build.StateTransitionController.lambda$doTransition$1(StateTransitionController.java:222)
    at org.gradle.internal.build.StateTransitionController.doTransition(StateTransitionController.java:243)
    at org.gradle.internal.build.StateTransitionController.doTransition(StateTransitionController.java:221)
    at org.gradle.internal.build.StateTransitionController.transitionIfNotPreviously(StateTransitionController.java:190)
    at org.gradle.initialization.VintageBuildModelController.prepareProjects(VintageBuildModelController.java:93)
    at org.gradle.initialization.VintageBuildModelController.doBuildStages(VintageBuildModelController.java:77)
    at org.gradle.initialization.VintageBuildModelController.getConfiguredModel(VintageBuildModelController.java:58)
    at org.gradle.internal.build.StateTransitionController.notInStateIgnoreOtherThreads(StateTransitionController.java:89)
    at org.gradle.internal.build.DefaultBuildLifecycleController.getConfiguredBuild(DefaultBuildLifecycleController.java:98)
    at org.gradle.internal.build.AbstractBuildState.ensureProjectsConfigured(AbstractBuildState.java:65)
    at org.gradle.internal.buildtree.DefaultBuildTreeModelCreator$DefaultBuildToolingModelController.locateBuilderForTarget(DefaultBuildTreeModelCreator.java:90)
    at org.gradle.internal.buildtree.DefaultBuildTreeModelCreator$DefaultBuildToolingModelController.locateBuilderForDefaultTarget(DefaultBuildTreeModelCreator.java:82)
    at org.gradle.tooling.internal.provider.runner.DefaultBuildController$DefaultTargetModel.locate(DefaultBuildController.java:239)
    at org.gradle.tooling.internal.provider.runner.DefaultBuildController.getToolingModelBuilder(DefaultBuildController.java:184)
    at org.gradle.tooling.internal.provider.runner.DefaultBuildController.getModel(DefaultBuildController.java:98)
    at org.gradle.tooling.internal.consumer.connection.ParameterAwareBuildControllerAdapter.getModel(ParameterAwareBuildControllerAdapter.java:39)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.getModel(UnparameterizedBuildController.java:113)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.getModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.findModel(UnparameterizedBuildController.java:97)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.findModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.findModel(UnparameterizedBuildController.java:81)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.findModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.findModel(UnparameterizedBuildController.java:66)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.findModel(NestedActionAwareBuildControllerAdapter.java:31)


问:
how to check if a specific folder exists in filedialog.askdirectory()
I have a problem where I can't check if a specific folder exists in the filedialog path I want. I have tried a lot of solutions but none of them worked.

from tkinter import *
import os
from tkinter import filedialog

def Browse():
    find = filedialog.askdirectory()
    folder.set(find)
    if find:
        os.path.isdir("Form Folder")
        print("Yess")
    else:
        print("cancelled")

form1 = Tk()
form1.title = "Check file"

folder = StringVar()

button = Button(form1, text="browse", command=Browse)
button.pack()

form1.mainloop()
```


问:
Should we use DiffUtils over notifyDataSetChanged all the time, or there is case where notifyDataSetChanged perform better?
Recently, as our app data grows, we encounter ANR during diff computation by using DiffUtils.

We solve the issue by

Optimizing areContentsTheSame computation, by redefining equals definition of 2 objects.

Place DiffUtil.calculateDiff execution in the user thread.

I know DiffUtils will be extremely handy, compared to notifyDataSetChanged, especially in the following case

There are total 100 items, and 10 items will be visible on RecycleView

If we are using notifyDataSetChanged, all 10 items will be redrawn

If we compute DiffUtil.calculateDiff 100 items, only affected & visible items will be redrawn

This assumes (3) is faster than (2)

But, I was pondering, what if the following case?

There are total 100000 items, and 10 items will be visible on RecycleView

If we are using notifyDataSetChanged, all 10 items will be redrawn

If we compute DiffUtil.calculateDiff 100000 items, only affected & visible items will be redrawn

Is it possible, that DiffUtil.calculateDiff will cost more than redrawing all visible items on RecyclerView?

I was wondering, instead of going all-in into DiffUtils, should we

```<code>if number of items > N {
    notifyDataSetChanged
} else {
    DiffUtils
}
</code>```

Should we use DiffUtils over notifyDataSetChanged all the time, or there is case where notifyDataSetChanged perform better?

If that is so, how can we decide when to use DiffUtils, and when to use notifyDataSetChanged?

Body:
Recently, as our app data grows, we encounter ANR during diff computation by using DiffUtils.

We solve the issue by

Optimizing areContentsTheSame computation, by redefining equals definition of 2 objects.

Place DiffUtil.calculateDiff execution in the user thread.

I know DiffUtils will be extremely handy, compared to notifyDataSetChanged, especially in the following case

There are total 100 items, and 10 items will be visible on RecycleView

If we are using notifyDataSetChanged, all 10 items will be redrawn

If we compute DiffUtil.calculateDiff 100 items, only affected & visible items will be redrawn

This assumes (3) is faster than (2)

But, I was pondering, what if the following case?

There are total 100000 items, and 10 items will be visible on RecycleView

If we are using notifyDataSetChanged, all 10 items will be redrawn

If we compute DiffUtil.calculateDiff 100000 items, only affected & visible items will be redrawn

Is it possible, that DiffUtil.calculateDiff will cost more than redrawing all visible items on RecyclerView?

I was wondering, instead of going all-in into DiffUtils, should we

if number of items > N {
    notifyDataSetChanged
} else {
    DiffUtils
}

Should we use DiffUtils over notifyDataSetChanged all the time, or there is case where notifyDataSetChanged perform better?

If that is so, how can we decide when to use DiffUtils, and when to use notifyDataSetChanged?


问:
Does the origin image has to rescale to [-1,1] in diffusion model
Does the origin image has to rescale to [-1,1] in diffusion model setting? Is there any progress to mitigate this restriction?

Except some explaination or Paper reference


问:
Audio doesn't load on Safari
My audio doesn't load on Safari. This happens on iOS and MacOS. I have tested many different file formats (mp3, mp4, wav, webm), but it still doesn't work. It works on every other browser (Firefox, Chromium, Epiphany), but not Safari.</p>
```<code><audio id="musicPlayer" controls>
            <source src="{{ audiourl }}" type="audio/m4a">
            <source src="{{ audiourl }}" type="audio/mp4">
            <source src="{{ audiourl }}" type="audio/mp3">
            Your browser does not support the audio element.
        </audio>
</code>```

Title: Audio doesn't load on Safari

Body:
My audio doesn't load on Safari. This happens on iOS and MacOS. I have tested many different file formats (mp3, mp4, wav, webm), but it still doesn't work. It works on every other browser (Firefox, Chromium, Epiphany), but not Safari.

<audio id="musicPlayer" controls>
            <source src="{{ audiourl }}" type="audio/m4a">
            <source src="{{ audiourl }}" type="audio/mp4">
            <source src="{{ audiourl }}" type="audio/mp3">
            Your browser does not support the audio element.
        </audio>


问:
what should i do in order to make updater work?
```<code>    def main():

                  #Updater = Updater(key.api_key, use_context=True)
                 #dp = Updater.dispatcher

                #dp.add_handler(CommandHandler("start", start_Command))

                 #dp.add_handler(MessageHandler(filters.text,handle_message))

                 #dp.add_error_handler(error)

                 #Updater.start_polling()
                 #Updater.idle

main()

#but it says
</code>```

Traceback:

File "c:\Users\21fin\Desktop\Python Learning\folder\main.py", line 20, in main
Updater = Updater(key.api_key,use_context=True)

```<code>      UnboundLocalError: cannot access local variable 'Updater' where it is not associated with a value
</code>```
```<code></code>```

The bot to run just fine as i wrote a clean code

Body:
    def main():

                  #Updater = Updater(key.api_key, use_context=True)
                 #dp = Updater.dispatcher

                #dp.add_handler(CommandHandler("start", start_Command))

                 #dp.add_handler(MessageHandler(filters.text,handle_message))

                 #dp.add_error_handler(error)

                 #Updater.start_polling()
                 #Updater.idle

main()

#but it says

Traceback:

File "c:\Users\21fin\Desktop\Python Learning\folder\main.py", line 20, in main
Updater = Updater(key.api_key,use_context=True)

      UnboundLocalError: cannot access local variable 'Updater' where it is not associated with a value

The bot to run just fine as i wrote a clean code


问:
import db file from assets using drift/moor in flutter
I have sqlite db file and I want to import it to flutter desktop app project using drift database, i succeeded to make it work in sqflite library but I couldn't make it work in windows I don't know why so I decided to use dirft instead but it's just won't work I am new to flutter and programming in general.

her is my code for importing db file from assets that works in sqflite

```<code>import 'dart:typed_data';
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:path/path.dart';
import 'package:sqflite/sqflite.dart';
import 'package:sqflite_common/sqlite_api.dart';
import 'package:sqflite_common_ffi/sqflite_ffi.dart';

class DatabaseHelper{

    initialDb()async {
    var databasesPath= await databaseFactoryFfi.getDatabasesPath();
    var path = join(databasesPath, "main_table.db");
    var exists= await databaseFactoryFfi.databaseExists(path);
    if(!exists){
      print("create new copy form assets");
      try {
        await Directory(dirname(path)).create(recursive: true);
      } catch (_) {}
      ByteData data = await rootBundle.load(join('assets','main_table_data_table.db'));
      List<int> bytes = data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes);
      await File(path).writeAsBytes(bytes, flush: true);
    } else {
      print("Opening existing database");
    }
    var db= await databaseFactoryFfi.openDatabase(path);

  }

}
</code>```

below is the code in drift that does not work.

```<code>
import 'package:drift/backends.dart';
import 'package:drift/drift.dart';
import 'dart:io';

import 'package:drift/native.dart';
import 'package:flutter/services.dart';
import 'package:path_provider/path_provider.dart';
import 'package:path/path.dart' as p;

part 'database_model.g.dart';

class MyDatabase extends _$MyDatabase {

  MyDatabase() : super(_openConnection());

  @override
  int get schemaVersion => 1;
}

LazyDatabase _openConnection() {
  return LazyDatabase(() async {

    final dbFolder = await getApplicationDocumentsDirectory();
    final file = File(p.join(dbFolder.path, 'main_table.db'));

    if (!await file.exists()) {
      final data =
          await rootBundle.load(p.join('assets', 'main_table_data_table.db'));
      final buffer = data.buffer;
      await file.writeAsBytes(
          buffer.asUint8List(data.offsetInBytes, data.lengthInBytes));
    }
    return NativeDatabase.createInBackground(file);
  });
}
</code>```

trying to import database file from assets using flutter and make query for search to show all records in that file

Body:
I have sqlite db file and I want to import it to flutter desktop app project using drift database, i succeeded to make it work in sqflite library but I couldn't make it work in windows I don't know why so I decided to use dirft instead but it's just won't work I am new to flutter and programming in general.

her is my code for importing db file from assets that works in sqflite

import 'dart:typed_data';
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:path/path.dart';
import 'package:sqflite/sqflite.dart';
import 'package:sqflite_common/sqlite_api.dart';
import 'package:sqflite_common_ffi/sqflite_ffi.dart';

class DatabaseHelper{

    initialDb()async {
    var databasesPath= await databaseFactoryFfi.getDatabasesPath();
    var path = join(databasesPath, "main_table.db");
    var exists= await databaseFactoryFfi.databaseExists(path);
    if(!exists){
      print("create new copy form assets");
      try {
        await Directory(dirname(path)).create(recursive: true);
      } catch (_) {}
      ByteData data = await rootBundle.load(join('assets','main_table_data_table.db'));
      List<int> bytes = data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes);
      await File(path).writeAsBytes(bytes, flush: true);
    } else {
      print("Opening existing database");
    }
    var db= await databaseFactoryFfi.openDatabase(path);

  }

}

below is the code in drift that does not work.

import 'package:drift/backends.dart';
import 'package:drift/drift.dart';
import 'dart:io';

import 'package:drift/native.dart';
import 'package:flutter/services.dart';
import 'package:path_provider/path_provider.dart';
import 'package:path/path.dart' as p;

part 'database_model.g.dart';

class MyDatabase extends _$MyDatabase {

  MyDatabase() : super(_openConnection());

  @override
  int get schemaVersion => 1;
}

LazyDatabase _openConnection() {
  return LazyDatabase(() async {

    final dbFolder = await getApplicationDocumentsDirectory();
    final file = File(p.join(dbFolder.path, 'main_table.db'));

    if (!await file.exists()) {
      final data =
          await rootBundle.load(p.join('assets', 'main_table_data_table.db'));
      final buffer = data.buffer;
      await file.writeAsBytes(
          buffer.asUint8List(data.offsetInBytes, data.lengthInBytes));
    }
    return NativeDatabase.createInBackground(file);
  });
}

trying to import database file from assets using flutter and make query for search to show all records in that file


问:
Why is my Chrome Extension page not receiving replies that I can see were sent by the background script?
I have a page which sends a message to the background script. The content of the message is nothing much, just an array of information it wants to receive in return.

chrome.runtime.sendMessage(initRequest, Init);

function Init(message){
    console.log(message);
    console.log(chrome.runtime.lastError);

    if (message.init == false)
    ...
```
<p>My background.js takes that and processes it.</p>
<pre class="lang-js prettyprint-override"><code>chrome.runtime.onMessage.addListener(
  async (message, sender, Reply) => {
    //  Stuff happens here...
    console.log(response);
    Reply(response);
  }
);
</code>```

My log shows that everything is being processed as required to come out of the other end. Right after I get the response exported to the console, my page runs Init() and that's where I lose track of what's going on.

undefined

{message: 'The message port closed before a response was received.'}

Error handling response: TypeError: Cannot read properties of undefined (reading 'init') at Init

This was an external page that I realised should just get rolled into the main extension. It used to work. I tossed in some console.log(...) lines to see if I could follow the execution, but I'm stumped; the code running in the background needs time to run (it queries a server) and Init() waits until the moment it finishes, so I feel like the issue is with Init() not being given the response data, but I can't work out why...

Body:
I have a page which sends a message to the background script. The content of the message is nothing much, just an array of information it wants to receive in return.

chrome.runtime.sendMessage(initRequest, Init);

function Init(message){
    console.log(message);
    console.log(chrome.runtime.lastError);

    if (message.init == false)
    ...

My background.js takes that and processes it.

chrome.runtime.onMessage.addListener(
  async (message, sender, Reply) => {
    //  Stuff happens here...
    console.log(response);
    Reply(response);
  }
);

My log shows that everything is being processed as required to come out of the other end. Right after I get the response exported to the console, my page runs Init() and that's where I lose track of what's going on.

undefined

{message: 'The message port closed before a response was received.'}

Error handling response: TypeError: Cannot read properties of undefined (reading 'init') at Init

This was an external page that I realised should just get rolled into the main extension. It used to work. I tossed in some console.log(...) lines to see if I could follow the execution, but I'm stumped; the code running in the background needs time to run (it queries a server) and Init() waits until the moment it finishes, so I feel like the issue is with Init() not being given the response data, but I can't work out why...


问:
Can't export to .p12 apple developer account
I'm trying to make a .pkpass file using this guide

However I can't export inside of my dev account the .p12 pass. I tried to trouble shoot it using this other guide

But I don't have these options inside of my account
screenshot 1
screenshot 2

I tried every single step of the guides to no avail. For those with an apple dev account, are you presenting the same issues? Do you believe that perhaps the guides are outdated?

I would really appreciate any light on this matter.


问:
Displaying Woocommerce Price in the 'My Account' table
I am trying to include the price of the product (listing package) in the table on the 'My Account' page generated by Woocommerce (my-packages.php). I am using the WC Paid Listing plugin, I have created a listing package manually from WP admin and added a product to my account. The table normally displays 'Package Name', 'Remaining', 'Listing Duration' and 'Featured?'. I've added a 5th Column and added the following code however it's showing the price as £0.00 which is incorrect, any help much appricated!</p>
```<code><td>

<?php $price = get_post_meta( get_the_ID(), '_price', true ); ?>
<p><?php echo wc_price( $price ); ?></p></td>
</code>```

Body:
I am trying to include the price of the product (listing package) in the table on the 'My Account' page generated by Woocommerce (my-packages.php). I am using the WC Paid Listing plugin, I have created a listing package manually from WP admin and added a product to my account. The table normally displays 'Package Name', 'Remaining', 'Listing Duration' and 'Featured?'. I've added a 5th Column and added the following code however it's showing the price as £0.00 which is incorrect, any help much appricated!

<?php $price = get_post_meta( get_the_ID(), '_price', true ); ?>

<?php echo wc_price( $price ); ?>


问:
How do I see the output of a Run Command action invoked by AWS EventBridge?
I've set up an EventBridge rule that targets the AWS-RunShellScript Systems Manager document in order to run some commands on an EC2 instance.

How can I collect or view the output of the shell script/commands that execute on the EC2 instance? It seems to be possible to specify where the output should go when running a Systems Manager command directly via the Console or API (e.g., using CloudWatch), but I cannot find a way to do the same when it's triggered by EventBridge!

Here is the Terraform I've used to define the target:

resource "aws_instance" "this" {
  // ...
}

resource "aws_s3_bucket" "this" {
  // ...
}

resource "aws_cloudwatch_event_rule" "this" {
  // ...
}

resource "aws_cloudwatch_event_target" "this" {
  rule     = aws_cloudwatch_event_rule.deployments.name
  arn      = "arn:aws:ssm:${data.aws_region.current.name}::document/AWS-RunShellScript"
  role_arn = // ...

  run_command_targets {
    key    = "InstanceIds"
    values = [aws_instance.this.id]
  }

  input_transformer {
    input_paths = {
      "bucketName" = "$.detail.bucket.name"
      "objectKey"  = "$.detail.object.key"
    }

    input_template = jsonencode({
      //
      // >>>>>> How do I see the output of these commands? <<<<<<
      //
      "commands" = [
        "echo <bucketName>",
        "echo <objectKey>"
      ]
      "workingDirectory" = ["/var/foo"]
      "executionTimeout" = ["300"]
    })
  }
}
```


问:
The second 'for' loop not working in nested loop
I would like to run each model 10 times at each level of introduced standard deviation (for a total of 21 'levels'), each time with different generated normal distributions. However, the models are only being run once at each level of standard deviation. The output I am looking for is a total of 10 p-values and 10 AIC values at each level of standard deviation.

I apologize in advance if this is trivial; I've been trying to figure out this code for several days now and looked around in other previously asked questions that had this similar problem so that I did not have to post this, but I am still unable to figure it out. I would greatly appreciate any insight on this.

```<code>output=list()
for (k in 1:21) {
  N<-100
  M<- 2000
  SD1<- 500
  SD2<- k*10-10
  aicM1 = c()
  aicM2 = c()
  aicM3 = c()
  pM1 = c()
  pM2 = c()
  pM3 = c()
  pM4 = c()
  Slope<-3
  Slope1<-0
  Intercept<-0
  for (i in 1:10) {
    # Old data
      Area<-rnorm(N, M, SD1)
      Prec<-rnorm(N, M, SD1)
      SR<-Intercept+ Slope*Area + Slope1*Prec + rnorm(N,0,SD2)
      old<-as.data.frame(cbind(Area, Prec, SR))
      # New data
      Area1 = rnorm(N, M, SD1)
      Prec1 = rnorm(N, M, SD1)
      SR1<-Intercept+ Slope1*Area + Prec1 + rnorm(N,0,SD2)
      new<-as.data.frame(cbind(Area1, Prec1, SR1))
      # Linear models
      M1<-lm(old$SR~old$Area)
      M2<-lm(old$SR~old$Prec)
      M3<-lm(old$SR~old$Area + old$Prec)
      M4<-lm(old$SR~1)
      # p-values
      pM1 <- c({fstat <- summary(M1)$fstatistic
      pf(fstat[1], fstat[2], fstat[3], lower.tail=FALSE)})
      pM2 <- c({fstat <- summary(M2)$fstatistic
      pf(fstat[1], fstat[2], fstat[3], lower.tail=FALSE)})
      pM3 <- c({fstat <- summary(M3)$fstatistic
      pf(fstat[1], fstat[2], fstat[3], lower.tail=FALSE)})
      pM4 <- c(coef(summary(M4))[, "Pr(>|t|)"])
      # AIC Values
      aicM1 = c(AIC(M1))
      aicM2 = c(AIC(M2))
      aicM3 = c(AIC(M3))
  }
    # the eight rows to put the values in
    uwyz<-cbind(aicM1, aicM2, aicM3, pM1, pM2, pM3, pM4, 10*k-10)
    mean(uwyz[,1])
    mean(uwyz[,2])
    mean(uwyz[,3])
    mean(uwyz[,4])
    mean(uwyz[,5])
    mean(uwyz[,6])
    mean(uwyz[,7])
    mean(uwyz[,8])

  output[[k]]<-uwyz
}

outfinal= as.data.frame(do.call(rbind, output))
outfinalSumm<-outfinal %>%
  group_by(V8) %>%
  summarize(FinalpM1 = (pM1), FinalpM2 = (pM2), FinalpM3 = (pM3), FinalpM4 = (pM4), FinalaicM1 = (aicM1), FinalaicM2 = (aicM2), FinalaicM3 = (aicM3))

outfinalSumm2<-as.matrix(outfinalSumm)
FinalData <- as.data.frame(outfinalSumm)
</code>```

Body:
I would like to run each model 10 times at each level of introduced standard deviation (for a total of 21 'levels'), each time with different generated normal distributions. However, the models are only being run once at each level of standard deviation. The output I am looking for is a total of 10 p-values and 10 AIC values at each level of standard deviation.

I apologize in advance if this is trivial; I've been trying to figure out this code for several days now and looked around in other previously asked questions that had this similar problem so that I did not have to post this, but I am still unable to figure it out. I would greatly appreciate any insight on this.

output=list()
for (k in 1:21) {
  N<-100
  M<- 2000
  SD1<- 500
  SD2<- k*10-10
  aicM1 = c()
  aicM2 = c()
  aicM3 = c()
  pM1 = c()
  pM2 = c()
  pM3 = c()
  pM4 = c()
  Slope<-3
  Slope1<-0
  Intercept<-0
  for (i in 1:10) {
    # Old data
      Area<-rnorm(N, M, SD1)
      Prec<-rnorm(N, M, SD1)
      SR<-Intercept+ Slope*Area + Slope1*Prec + rnorm(N,0,SD2)
      old<-as.data.frame(cbind(Area, Prec, SR))
      # New data
      Area1 = rnorm(N, M, SD1)
      Prec1 = rnorm(N, M, SD1)
      SR1<-Intercept+ Slope1*Area + Prec1 + rnorm(N,0,SD2)
      new<-as.data.frame(cbind(Area1, Prec1, SR1))
      # Linear models
      M1<-lm(old$SR~old$Area)
      M2<-lm(old$SR~old$Prec)
      M3<-lm(old$SR~old$Area + old$Prec)
      M4<-lm(old$SR~1)
      # p-values
      pM1 <- c({fstat <- summary(M1)$fstatistic
      pf(fstat[1], fstat[2], fstat[3], lower.tail=FALSE)})
      pM2 <- c({fstat <- summary(M2)$fstatistic
      pf(fstat[1], fstat[2], fstat[3], lower.tail=FALSE)})
      pM3 <- c({fstat <- summary(M3)$fstatistic
      pf(fstat[1], fstat[2], fstat[3], lower.tail=FALSE)})
      pM4 <- c(coef(summary(M4))[, "Pr(>|t|)"])
      # AIC Values
      aicM1 = c(AIC(M1))
      aicM2 = c(AIC(M2))
      aicM3 = c(AIC(M3))
  }
    # the eight rows to put the values in
    uwyz<-cbind(aicM1, aicM2, aicM3, pM1, pM2, pM3, pM4, 10*k-10)
    mean(uwyz[,1])
    mean(uwyz[,2])
    mean(uwyz[,3])
    mean(uwyz[,4])
    mean(uwyz[,5])
    mean(uwyz[,6])
    mean(uwyz[,7])
    mean(uwyz[,8])

  output[[k]]<-uwyz
}

outfinal= as.data.frame(do.call(rbind, output))
outfinalSumm<-outfinal %>%
  group_by(V8) %>%
  summarize(FinalpM1 = (pM1), FinalpM2 = (pM2), FinalpM3 = (pM3), FinalpM4 = (pM4), FinalaicM1 = (aicM1), FinalaicM2 = (aicM2), FinalaicM3 = (aicM3))

outfinalSumm2<-as.matrix(outfinalSumm)
FinalData <- as.data.frame(outfinalSumm)


问:
Laravel getting unexpected in query in has many in debugger
I have a table books and books has many images. So 2 tables are

books

book_images

In Book model I have written below function for hasMany relation with book_images

```<code>public function bookImages()
{
    return $this->hasMany(BookImage::class);
}
</code>```

In book model I have written another mathod call getBooks

```<code>public function getBooks(int $id = null, array $queryString = [])
{
    $query = $this::where(['books.is_deleted' => false]);

    $query = $query->with("bookImages","author","category")
        ->withCount(['favourites'])
    ;

    return $query;
}
</code>```

This getBooks method I have called from controller like below

```<code>return view('pages.top_page',[
    'books' => (new Book)->getBooks()->orderBy('created_at','DESC')->get()->take(5),
]);
</code>```

In debugger it looks an in query is running for all books example in database table there has 400 books but logically there should only 5. Is it debugger problem ? Or problem in my query ?

Body:
I have a table books and books has many images. So 2 tables are

books

book_images

In Book model I have written below function for hasMany relation with book_images

public function bookImages()
{
    return $this->hasMany(BookImage::class);
}

In book model I have written another mathod call getBooks

public function getBooks(int $id = null, array $queryString = [])
{
    $query = $this::where(['books.is_deleted' => false]);

    $query = $query->with("bookImages","author","category")
        ->withCount(['favourites'])
    ;

    return $query;
}

This getBooks method I have called from controller like below

return view('pages.top_page',[
    'books' => (new Book)->getBooks()->orderBy('created_at','DESC')->get()->take(5),
]);

In debugger it looks an in query is running for all books example in database table there has 400 books but logically there should only 5. Is it debugger problem ? Or problem in my query ?


问:
How to set data for nested object's fields in drools decision table
I want to set data for nested object in drools decision table. I have a Java model class SalesMobilityApiModel in which I have a nested object of type AddressProofModel. The AddressProofModel class has few fields, such as String documentCategory, String documentType, etc.

Now I want to set values for the fields of the nested object, for example:

```<code>addressProofModel.setDocumentCategory("category1")
</code>```

based on condition of one of the input parameter 'profile' in the parent SalesMobilityApiModel object.

I using Drools decision tables and can't figure out how to do this.

I have tried multiple things to set values for the fields inside the nested class 'AddressProofModel', but every time faced some exception.

How can I update the fields in the child object?

Body:
I want to set data for nested object in drools decision table. I have a Java model class SalesMobilityApiModel in which I have a nested object of type AddressProofModel. The AddressProofModel class has few fields, such as String documentCategory, String documentType, etc.

Now I want to set values for the fields of the nested object, for example:

addressProofModel.setDocumentCategory("category1")

based on condition of one of the input parameter 'profile' in the parent SalesMobilityApiModel object.

I using Drools decision tables and can't figure out how to do this.

I have tried multiple things to set values for the fields inside the nested class 'AddressProofModel', but every time faced some exception.

How can I update the fields in the child object?


问:
Why was "yarn install X" renamed to "yarn add X"?
When I run yarn install SOME_PACKAGE_X it says:

```<code>error `install` has been replaced with `add` to add new dependencies. Run "yarn add fourtytwo" instead.
</code>```

Other package managers use install as a      keyword to install a package. For example npm, Debian's apt and so on. Even the classic docs for yarn 1.x add  talked     about installing packages instead of adding them.

I see that yarn install serves the purpose to install all dependencies. From what I see, it would have been better to rename the "install all" command instead.

In the current way, I see only drawbacks: The naming seems inconsistent. I cannot alias npm to yarn, although they share most other commands.

This confuses me. When I read about yarn in the past, it was stated, they often  do things differently, but do so for a reason.

Could someone explain the rationale in this case?

Body:
When I run yarn install SOME_PACKAGE_X it says:

error `install` has been replaced with `add` to add new dependencies. Run "yarn add fourtytwo" instead.

Other package managers use install as a      keyword to install a package. For example npm, Debian's apt and so on. Even the classic docs for yarn 1.x add  talked     about installing packages instead of adding them.

I see that yarn install serves the purpose to install all dependencies. From what I see, it would have been better to rename the "install all" command instead.

In the current way, I see only drawbacks: The naming seems inconsistent. I cannot alias npm to yarn, although they share most other commands.

This confuses me. When I read about yarn in the past, it was stated, they often  do things differently, but do so for a reason.

Could someone explain the rationale in this case?


问:
Bootstrap datepicker disable dates from list
Need help with "datesForDisable". I have list with dates (YYYY-DD-MM).
Where should i add "datesForDisable" parameter? Tried different ways without success.
I´m using year-calendar library with bootstrap datepicker.
noConflict() is added because of wordpress jQuery errors.</p>
```<code>var datepicker = $.fn.datepicker.noConflict();
        $.fn.bootstrapDP = datepicker;

    function editEvent(event) {
        $('#event-modal input[name="event-start-date"]').bootstrapDP('update', event ? event.startDate : '',);
        $('#event-modal input[name="event-end-date"]').bootstrapDP('update', event ? event.endDate : '');
        $('#event-modal').modal();
    }
</code>```

Body:
Need help with "datesForDisable". I have list with dates (YYYY-DD-MM).
Where should i add "datesForDisable" parameter? Tried different ways without success.
I´m using year-calendar library with bootstrap datepicker.
noConflict() is added because of wordpress jQuery errors.

var datepicker = $.fn.datepicker.noConflict();
        $.fn.bootstrapDP = datepicker;

    function editEvent(event) {
        $('#event-modal input[name="event-start-date"]').bootstrapDP('update', event ? event.startDate : '',);
        $('#event-modal input[name="event-end-date"]').bootstrapDP('update', event ? event.endDate : '');
        $('#event-modal').modal();
    }


问:
Docker container started with docker compose can't access the port exposed by another container
I want the golang program to access the database.
However it seems to be no connection between the golang program and the sql database. Thus phpmyadmin works correctly.
How can i let golang service connect to the port 3306 ?
Docker compose
`

```<code>version: '3.1'

services:
  db:
    image: mariadb:10.3
    restart: always
    ports:
    - "3306:3306"

    command: --init-file /data/application/init.sql
    volumes:
        - ./init.sql:/data/application/init.sql
    environment:
      MYSQL_ROOT_PASSWORD: toor

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    environment:
      PMA_PORT: 3306
      PMA_HOST: db
      PMA_USER: root
      PMA_PASSWORD: toor
    ports:
    - "8080:80"
    restart: always
    depends_on:
    - db

  golang:
      restart: always
      build:
        context: servers
        dockerfile: Dockerfile
      ports:
      - 10000:10000
      depends_on:
      - db

</code>```

`
Golang container

panic: dial tcp 127.0.0.1:3306: connect: connection refused api-golang-1      |

I try to create a network, it didn't work as expected

Body:
I want the golang program to access the database.
However it seems to be no connection between the golang program and the sql database. Thus phpmyadmin works correctly.
How can i let golang service connect to the port 3306 ?
Docker compose
`

version: '3.1'

services:
  db:
    image: mariadb:10.3
    restart: always
    ports:
    - "3306:3306"

    command: --init-file /data/application/init.sql
    volumes:
        - ./init.sql:/data/application/init.sql
    environment:
      MYSQL_ROOT_PASSWORD: toor

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    environment:
      PMA_PORT: 3306
      PMA_HOST: db
      PMA_USER: root
      PMA_PASSWORD: toor
    ports:
    - "8080:80"
    restart: always
    depends_on:
    - db

  golang:
      restart: always
      build:
        context: servers
        dockerfile: Dockerfile
      ports:
      - 10000:10000
      depends_on:
      - db

`
Golang container

panic: dial tcp 127.0.0.1:3306: connect: connection refused api-golang-1      |

I try to create a network, it didn't work as expected


问:
how to store data in model which contain foreign key in Django
models.py

```<code>class event_details(models.Model):
    e_id = models.AutoField(primary_key= True)
</code>```
```<code>class participants(models.Model):
    p_id = models.AutoField(primary_key= True)
    p_name = models.CharField(max_length=30)

    def __str__(self):
        return str(self.p_id)
</code>```
```<code>class event(models.Model):
    e_id = models.ForeignKey(event_details,on_delete = models.CASCADE, related_name = 'event_id')
    p_id = models.ForeignKey(participants, on_delete=models.CASCADE, related_name = 'pp_id')
</code>```

view.py

```<code>def add_user(request):
    if request.method == 'POST':
        name =request.POST.get('name')

        reg = participants(
            e_id = 1,
            p_name = name,
        )
        reg.save()

    return render(request,'web/Registration.html')
</code>```

Try to Store Participate name But Error that "participants.e_id" must be a "event_details" instance.
can help me to solve it by store data in participants model

Body:
models.py

class event_details(models.Model):
    e_id = models.AutoField(primary_key= True)

class participants(models.Model):
    p_id = models.AutoField(primary_key= True)
    p_name = models.CharField(max_length=30)

    def __str__(self):
        return str(self.p_id)

class event(models.Model):
    e_id = models.ForeignKey(event_details,on_delete = models.CASCADE, related_name = 'event_id')
    p_id = models.ForeignKey(participants, on_delete=models.CASCADE, related_name = 'pp_id')

view.py

def add_user(request):
    if request.method == 'POST':
        name =request.POST.get('name')

        reg = participants(
            e_id = 1,
            p_name = name,
        )
        reg.save()

    return render(request,'web/Registration.html')

Try to Store Participate name But Error that "participants.e_id" must be a "event_details" instance.
can help me to solve it by store data in participants model


问:
User with correct credentials not login in django
views.py

url.py

login.html

After login it should redirect to the Home page ,I got some solution and I tried that but it's not working for me


问:
How do I trigger a local notifications at future time and then every min after that time until stopped

Aim

I'm looking to establish if it's still posible to trigger an Swift local notifications at a destingated time (say every day at 15:00) and then every min after that time until it's stopped.

Why I think it could be done

I know this could be done in the past as I have an reminder app I use daily "Alarmed" that does exactly this! It allows you to set up to 64 alarms (the current limit for scheduled local notifications) all to go off at once. Then if you force kill the app and wait all 64 notifications go off. If you then ignore them they keep going off every min forever (or for longer than 2 hours)! Exactly what I want for my own app...

I've also tested that app (Alarmed) with no access to location tracking and as I said fully force closed so it's not using any re-scheduling tricks...

Issue

I can not find a way to do it with the UNMutableNotificationContent API. Setting the trigger type to "UNCalendarNotificationTrigger". e.g.: let trigger = UNCalendarNotificationTrigger(dateMatching: DateComponents(year: 2022, month: 1, hour: 10, minute: 25), repeats: true) does trigger at the specified day/time but doesn't repeate every minuite after that time if ignored/missed and let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 60, repeats: true) does repeate every min until stopped but starts repeating straight away (which seems like a pointless feature to me)!

I guess what I'm trying to do is combine the two!
Having the Calendar one to set the initial time the first notification goes off and then the Time Interval one continues the notifications from then on every min... but that seems to not be not posible.

Question

Does anyone have any ideas what API's (ether current or say 7 years old when the app was last updated) that allows this? Even if it's not posible with the current API it's more a curiosity thing now as I've spend days trying to work out how to do it!


问:
Why there is different versions of openCV packages on Anaconda website? Which one should I install?

Why there is different versions of openCV packages? Which one should I install?


问:
SQL Query for all chat conversations for userID with all names and profiles images
I am building an in app Chat, I've figured out the DB tables on how to store the chat messages, having only private chat. Now I am trying to come up with a good SQL Query for showing all conversations for user with a certain ID alongside with user's name and profile picture. It seems like I need to use multiple different WHERE clauses for different columns I want to get returned. How do I achieve the wanted result?

My tables are:

I so far have something like this:

```<code>SELECT
    chat_message.from_user_id,
    chat_message. `message_text`,
    chat_message.sent_datetime,
    chat_conversation.is_read,
    chat_conversation.id AS conversation_id,
    user_profile.`name`
FROM
    chat_conversation
    LEFT JOIN chat_message ON chat_conversation.id = chat_message.conversation_id
    LEFT JOIN chat_participant ON chat_conversation.id = chat_participant.conversation_id
    LEFT JOIN user_profile ON chat_participant.user_id = user_profile.user_id
WHERE
    chat_participant.user_id = UUID_TO_BIN("62C340CE262B4DE49E2A99B3B3126BB6")
AND chat_message.id in(
    SELECT
        max(chat_message.id)
        FROM chat_message
    GROUP BY
        conversation_id)
</code>```

But with this query, I will always get only my own Name and My own profile picture.

Body:
I am building an in app Chat, I've figured out the DB tables on how to store the chat messages, having only private chat. Now I am trying to come up with a good SQL Query for showing all conversations for user with a certain ID alongside with user's name and profile picture. It seems like I need to use multiple different WHERE clauses for different columns I want to get returned. How do I achieve the wanted result?

My tables are:

I so far have something like this:

SELECT
    chat_message.from_user_id,
    chat_message. `message_text`,
    chat_message.sent_datetime,
    chat_conversation.is_read,
    chat_conversation.id AS conversation_id,
    user_profile.`name`
FROM
    chat_conversation
    LEFT JOIN chat_message ON chat_conversation.id = chat_message.conversation_id
    LEFT JOIN chat_participant ON chat_conversation.id = chat_participant.conversation_id
    LEFT JOIN user_profile ON chat_participant.user_id = user_profile.user_id
WHERE
    chat_participant.user_id = UUID_TO_BIN("62C340CE262B4DE49E2A99B3B3126BB6")
AND chat_message.id in(
    SELECT
        max(chat_message.id)
        FROM chat_message
    GROUP BY
        conversation_id)

But with this query, I will always get only my own Name and My own profile picture.


问:
increase the speed of a postgres docker container
I need to import a large csv file into postges using copy.

I find that the processing time is a bit long. So I look at docker stats:

```<code>CONTAINER ID   NAME                 CPU %     MEM USAGE / LIMIT     MEM %     NET I/O           BLOCK I/O         PIDS
682795abfc17   postgres   28.83%    1.034GiB / 15.63GiB   6.62%     23.7kB / 17.7kB   15.5GB / 14.4GB   11
</code>```

I want it to be able to use more ram than 1Gib so I put this but no improvement:

```<code> database:
    container_name: postgres_container
    image: postgis/postgis:14-3.3
    cpus: 4
</code>```

how to make the container use more ram?
thank you

Body:
I need to import a large csv file into postges using copy.

I find that the processing time is a bit long. So I look at docker stats:

CONTAINER ID   NAME                 CPU %     MEM USAGE / LIMIT     MEM %     NET I/O           BLOCK I/O         PIDS
682795abfc17   postgres   28.83%    1.034GiB / 15.63GiB   6.62%     23.7kB / 17.7kB   15.5GB / 14.4GB   11

I want it to be able to use more ram than 1Gib so I put this but no improvement:

 database:
    container_name: postgres_container
    image: postgis/postgis:14-3.3
    cpus: 4

how to make the container use more ram?
thank you


问:
Remove placeholder attribute in search bar and update the text
The problem

I have a search bar with placeholder text and it should be removing the placeholder, before then adding new text to the search bar.

What works

The search bar initially displays placeholder text and does remove it.

The code I have is below:

//On result of operation this removes the placeholder text in the search bar
$(document).ready(function(){
  $(':input').removeAttr('placeholder');
});```
<pre class="snippet-code-css lang-css prettyprint-override"><code>.custom-search {
    position: relative;
    margin-bottom: 2.5%;
}

.buttons .custom-search-input {
    width: 30%;
    padding-right: 15px !important;
    box-sizing: border-box;
    font-size: 2vh;
}

.custom-search-button {
    position: absolute;
    right: 0px;
    top: 0px;
    bottom: 0px;
    line-height: 1 !important;
    z-index: 4;
}

            </code>```

  <input type="text" value="" class="form-control custom-search-input" placeholder="Search here">
    <button class="btn btn-primary custom-search-botton" type="submit">Search</button>

                    ```
</div>
</div>
</p>
<p>However, when I add the following, I expect it to remove the placeholder and then replace the empty text in the search bar with 'you have searched', but it instead replaces the entire search bar with the text and the search bar no longer appears...</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function(){
  $(':input').removeAttr('placeholder');
  $("#search-bar").text('You have searched');
});</code>```

What I've tried

This other jquery script only replaces the placeholder, and again the text isn't added.

$(document).ready(function(){
  $(':input').removeAttr('placeholder');
  $("#search-bar").val('You have searched');
});```
</div>
</div>
</p>
<p>This JS script gives the same issue as the first jquery script, it completely removes the search bar and only displays the text...</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>document.getElementById("search-bar").innerText = "You have searched";</code>```

Just to reiterate, I'm not trying to replace the placeholder. I need to remove the placeholder and add text to the search bar...

Thanks in advance

Body:
The problem

I have a search bar with placeholder text and it should be removing the placeholder, before then adding new text to the search bar.

What works

The search bar initially displays placeholder text and does remove it.

The code I have is below:

//On result of operation this removes the placeholder text in the search bar
$(document).ready(function(){
  $(':input').removeAttr('placeholder');
});

.custom-search {
    position: relative;
    margin-bottom: 2.5%;
}

.buttons .custom-search-input {
    width: 30%;
    padding-right: 15px !important;
    box-sizing: border-box;
    font-size: 2vh;
}

.custom-search-button {
    position: absolute;
    right: 0px;
    top: 0px;
    bottom: 0px;
    line-height: 1 !important;
    z-index: 4;
}

  <input type="text" value="" class="form-control custom-search-input" placeholder="Search here">
    <button class="btn btn-primary custom-search-botton" type="submit">Search</button>

However, when I add the following, I expect it to remove the placeholder and then replace the empty text in the search bar with 'you have searched', but it instead replaces the entire search bar with the text and the search bar no longer appears...

$(document).ready(function(){
  $(':input').removeAttr('placeholder');
  $("#search-bar").text('You have searched');
});

What I've tried

This other jquery script only replaces the placeholder, and again the text isn't added.

$(document).ready(function(){
  $(':input').removeAttr('placeholder');
  $("#search-bar").val('You have searched');
});

This JS script gives the same issue as the first jquery script, it completely removes the search bar and only displays the text...

document.getElementById("search-bar").innerText = "You have searched";

Just to reiterate, I'm not trying to replace the placeholder. I need to remove the placeholder and add text to the search bar...

Thanks in advance


问:
Add z value in curve level with matplotlib
I'm trying to plot curve levels with matplotlib, and everything works fine, but I want to show the value of z for every level, how can I add that?

This is my code:

```<code>import numpy as np
import matplotlib.pyplot as plt

x = np.linspace(-3,3,500)
y = np.linspace(-3,3,500)
X,Y = np.meshgrid(x,y)

Z = X**2+Y**2

fig = plt.figure(figsize=(5,5))
ax = fig.add_subplot(111,aspect='equal')
ax.contour(X,Y,Z,levels=[0,1,4,9])

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

I've tried to look in the documentation, but nothing works.

Body:
I'm trying to plot curve levels with matplotlib, and everything works fine, but I want to show the value of z for every level, how can I add that?

This is my code:

import numpy as np
import matplotlib.pyplot as plt

x = np.linspace(-3,3,500)
y = np.linspace(-3,3,500)
X,Y = np.meshgrid(x,y)

Z = X**2+Y**2

fig = plt.figure(figsize=(5,5))
ax = fig.add_subplot(111,aspect='equal')
ax.contour(X,Y,Z,levels=[0,1,4,9])

plt.show()

I've tried to look in the documentation, but nothing works.