问:
Not sure why I am getting errors from micrometer influx in integration tests even after disabling metrices
I have a spring boot application and dependency added for io.micrometer.

I started seeing the error messages in integration tests related to not being able to send metrices during the shutdown of the context:

```<code>java.net.UnknownHostException: telegraf.system
    at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567)
    at java.base/java.net.Socket.connect(Socket.java:633)
    at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:178)
    at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:532)
    at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:637)
    at java.base/sun.net.www.http.HttpClient.<init>(HttpClient.java:280)
    at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:385)
    at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:407)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1309)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1057)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1430)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1401)
    at io.micrometer.core.ipc.http.HttpUrlConnectionSender.send(HttpUrlConnectionSender.java:98)
    at io.micrometer.core.ipc.http.HttpSender$Request$Builder.send(HttpSender.java:305)
    at io.micrometer.influx.InfluxMeterRegistry.createDatabaseIfNecessary(InfluxMeterRegistry.java:111)
    at io.micrometer.influx.InfluxMeterRegistry.publish(InfluxMeterRegistry.java:123)
    at io.micrometer.core.instrument.push.PushMeterRegistry.publishSafely(PushMeterRegistry.java:54)
    at io.micrometer.core.instrument.push.PushMeterRegistry.close(PushMeterRegistry.java:96)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.springframework.beans.factory.support.DisposableBeanAdapter.invokeCustomDestroyMethod(DisposableBeanAdapter.java:319)
    at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:253)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:587)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:559)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:1163)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:520)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:1156)
    at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1106)
    at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1075)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.doClose(ServletWebServerApplicationContext.java:174)
    at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1021)
    at org.springframework.boot.SpringApplicationShutdownHook.closeAndWait(SpringApplicationShutdownHook.java:145)
    at java.base/java.lang.Iterable.forEach(Iterable.java:75)
    at org.springframework.boot.SpringApplicationShutdownHook.run(SpringApplicationShutdownHook.java:114)
    at java.base/java.lang.Thread.run(Thread.java:833)
[influx-metrics-publisher] ERROR i.m.influx.InfluxMeterRegistry@createDatabaseIfNecessary:117  - unable to create database 'mydb'
java.net.UnknownHostException: telegraf.system
    at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567)
    at java.base/java.net.Socket.connect(Socket.java:633)
    at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:178)
    at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:532)
    at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:637)
    at java.base/sun.net.www.http.HttpClient.<init>(HttpClient.java:280)
    at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:385)
    at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:407)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1309)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1057)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1430)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1401)
    at io.micrometer.core.ipc.http.HttpUrlConnectionSender.send(HttpUrlConnectionSender.java:98)
    at io.micrometer.core.ipc.http.HttpSender$Request$Builder.send(HttpSender.java:305)
    at io.micrometer.influx.InfluxMeterRegistry.createDatabaseIfNecessary(InfluxMeterRegistry.java:111)
    at io.micrometer.influx.InfluxMeterRegistry.publish(InfluxMeterRegistry.java:123)
    at io.micrometer.core.instrument.push.PushMeterRegistry.publishSafely(PushMeterRegistry.java:54)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    at java.base/java.util.concurrent.FutureTask.runAndReset$$$capture(FutureTask.java:305)
    at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java)
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)
[SpringApplicationShutdownHook] ERROR i.m.influx.InfluxMeterRegistry@publish:161  - failed to send metrics to influx
java.net.UnknownHostException: telegraf.system
    at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567)
    at java.base/java.net.Socket.connect(Socket.java:633)
    at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:178)
    at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:532)
    at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:637)
    at java.base/sun.net.www.http.HttpClient.<init>(HttpClient.java:280)
    at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:385)
    at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:407)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1309)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1057)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1430)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1401)
    at io.micrometer.core.ipc.http.HttpUrlConnectionSender.send(HttpUrlConnectionSender.java:98)
    at io.micrometer.core.ipc.http.HttpSender$Request$Builder.send(HttpSender.java:305)
    at io.micrometer.influx.InfluxMeterRegistry.publish(InfluxMeterRegistry.java:147)
    at io.micrometer.core.instrument.push.PushMeterRegistry.publishSafely(PushMeterRegistry.java:54)
    at io.micrometer.core.instrument.push.PushMeterRegistry.close(PushMeterRegistry.java:96)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.springframework.beans.factory.support.DisposableBeanAdapter.invokeCustomDestroyMethod(DisposableBeanAdapter.java:319)
    at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:253)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:587)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:559)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:1163)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:520)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:1156)
    at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1106)
    at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1075)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.doClose(ServletWebServerApplicationContext.java:174)
    at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1021)
    at org.springframework.boot.SpringApplicationShutdownHook.closeAndWait(SpringApplicationShutdownHook.java:145)
    at java.base/java.lang.Iterable.forEach(Iterable.java:75)
    at org.springframework.boot.SpringApplicationShutdownHook.run(SpringApplicationShutdownHook.java:114)
    at java.base/java.lang.Thread.run(Thread.java:833)
Disconnected from the target VM, address: '127.0.0.1:58220', transport: 'socket'

Process finished with exit code 0
</code>```

I am trying to switch these annoying errors which are everywhere during test case execution.

So, while having @ActiveProfiles("test") on the test cases, I tried using these application properties in application-test.yml to try and switch off metrices.

```<code>server:
  port: 9090

management:
  metrics:
    export:
      influx:
        enabled: false
  endpoint:
    metrics:
      enabled: false

spring:
  mvc:
    pathmatch:
      matching-strategy: ant_path_matcher
  cloud:
    vault:
      enabled: false
    consul:
      enabled: false
  liquibase:
    enabled: false
  metrics:
    influx:
      enabled: false
</code>```

But this doesn't seem to work and I am still getting the error.
What am I missing here ? How can ensure things related to metrices are switched off during test case execution ?

Body:
I have a spring boot application and dependency added for io.micrometer.

I started seeing the error messages in integration tests related to not being able to send metrices during the shutdown of the context:

java.net.UnknownHostException: telegraf.system
    at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567)
    at java.base/java.net.Socket.connect(Socket.java:633)
    at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:178)
    at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:532)
    at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:637)
    at java.base/sun.net.www.http.HttpClient.<init>(HttpClient.java:280)
    at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:385)
    at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:407)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1309)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1057)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1430)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1401)
    at io.micrometer.core.ipc.http.HttpUrlConnectionSender.send(HttpUrlConnectionSender.java:98)
    at io.micrometer.core.ipc.http.HttpSender$Request$Builder.send(HttpSender.java:305)
    at io.micrometer.influx.InfluxMeterRegistry.createDatabaseIfNecessary(InfluxMeterRegistry.java:111)
    at io.micrometer.influx.InfluxMeterRegistry.publish(InfluxMeterRegistry.java:123)
    at io.micrometer.core.instrument.push.PushMeterRegistry.publishSafely(PushMeterRegistry.java:54)
    at io.micrometer.core.instrument.push.PushMeterRegistry.close(PushMeterRegistry.java:96)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.springframework.beans.factory.support.DisposableBeanAdapter.invokeCustomDestroyMethod(DisposableBeanAdapter.java:319)
    at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:253)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:587)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:559)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:1163)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:520)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:1156)
    at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1106)
    at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1075)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.doClose(ServletWebServerApplicationContext.java:174)
    at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1021)
    at org.springframework.boot.SpringApplicationShutdownHook.closeAndWait(SpringApplicationShutdownHook.java:145)
    at java.base/java.lang.Iterable.forEach(Iterable.java:75)
    at org.springframework.boot.SpringApplicationShutdownHook.run(SpringApplicationShutdownHook.java:114)
    at java.base/java.lang.Thread.run(Thread.java:833)
[influx-metrics-publisher] ERROR i.m.influx.InfluxMeterRegistry@createDatabaseIfNecessary:117  - unable to create database 'mydb'
java.net.UnknownHostException: telegraf.system
    at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567)
    at java.base/java.net.Socket.connect(Socket.java:633)
    at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:178)
    at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:532)
    at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:637)
    at java.base/sun.net.www.http.HttpClient.<init>(HttpClient.java:280)
    at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:385)
    at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:407)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1309)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1057)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1430)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1401)
    at io.micrometer.core.ipc.http.HttpUrlConnectionSender.send(HttpUrlConnectionSender.java:98)
    at io.micrometer.core.ipc.http.HttpSender$Request$Builder.send(HttpSender.java:305)
    at io.micrometer.influx.InfluxMeterRegistry.createDatabaseIfNecessary(InfluxMeterRegistry.java:111)
    at io.micrometer.influx.InfluxMeterRegistry.publish(InfluxMeterRegistry.java:123)
    at io.micrometer.core.instrument.push.PushMeterRegistry.publishSafely(PushMeterRegistry.java:54)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    at java.base/java.util.concurrent.FutureTask.runAndReset$$$capture(FutureTask.java:305)
    at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java)
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)
[SpringApplicationShutdownHook] ERROR i.m.influx.InfluxMeterRegistry@publish:161  - failed to send metrics to influx
java.net.UnknownHostException: telegraf.system
    at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567)
    at java.base/java.net.Socket.connect(Socket.java:633)
    at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:178)
    at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:532)
    at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:637)
    at java.base/sun.net.www.http.HttpClient.<init>(HttpClient.java:280)
    at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:385)
    at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:407)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1309)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1057)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1430)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1401)
    at io.micrometer.core.ipc.http.HttpUrlConnectionSender.send(HttpUrlConnectionSender.java:98)
    at io.micrometer.core.ipc.http.HttpSender$Request$Builder.send(HttpSender.java:305)
    at io.micrometer.influx.InfluxMeterRegistry.publish(InfluxMeterRegistry.java:147)
    at io.micrometer.core.instrument.push.PushMeterRegistry.publishSafely(PushMeterRegistry.java:54)
    at io.micrometer.core.instrument.push.PushMeterRegistry.close(PushMeterRegistry.java:96)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.springframework.beans.factory.support.DisposableBeanAdapter.invokeCustomDestroyMethod(DisposableBeanAdapter.java:319)
    at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:253)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:587)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:559)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:1163)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:520)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:1156)
    at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1106)
    at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1075)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.doClose(ServletWebServerApplicationContext.java:174)
    at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1021)
    at org.springframework.boot.SpringApplicationShutdownHook.closeAndWait(SpringApplicationShutdownHook.java:145)
    at java.base/java.lang.Iterable.forEach(Iterable.java:75)
    at org.springframework.boot.SpringApplicationShutdownHook.run(SpringApplicationShutdownHook.java:114)
    at java.base/java.lang.Thread.run(Thread.java:833)
Disconnected from the target VM, address: '127.0.0.1:58220', transport: 'socket'

Process finished with exit code 0

I am trying to switch these annoying errors which are everywhere during test case execution.

So, while having @ActiveProfiles("test") on the test cases, I tried using these application properties in application-test.yml to try and switch off metrices.

server:
  port: 9090

management:
  metrics:
    export:
      influx:
        enabled: false
  endpoint:
    metrics:
      enabled: false

spring:
  mvc:
    pathmatch:
      matching-strategy: ant_path_matcher
  cloud:
    vault:
      enabled: false
    consul:
      enabled: false
  liquibase:
    enabled: false
  metrics:
    influx:
      enabled: false

But this doesn't seem to work and I am still getting the error.
What am I missing here ? How can ensure things related to metrices are switched off during test case execution ?


来源: stackexchange

问:
Attributes does not link with the variation product created by API in woocommerce
I am creating a product variation in woocommerce via rest api and the creations,both for product and variation is going ok but then the variation does not take any attribute.

here is the code for the product creation

```<code>{
  "name": "Premium Quality test3",
  "slug": "premium-quality-19",
  "type": "variable",
  "status": "publish",
  "catalog_visibility": "visible",
  "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
  "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
  "sku": "",
  "price": "21.99",
  "regular_price": "21.99",
  "sale_price": "",
  "manage_stock": "false",
  "categories": [
    {
      "id": 22,
      "name": "Ενέργεια",
      "slug": "ενέργεια"
    }
  ],
  "attributes": [
      {
          "id":"14",
          "name":"χρώμα",
          "position":"0",
          "visible":"true",
          "variation":"true",
          "options":["Πράσινο"]
      }
  ]
}
</code>```

And here is the code for variable creation:

```<code>{

  "sku": "6666666",
  "price": "9.00",
  "regular_price": "9.00",
  "manage_stock": "true",
  "stock_quantity": 1,
  "stock_status": "instock",
  "attributes": [
    {
      "id": 14,
      "name": "Xρώμα",
      "option": "Πράσινο"
    }
  ]
}
</code>```

but still the variation remains without attributes

enter image description here

ContentLicense: CC BY-SA 4.0

Body:
I am creating a product variation in woocommerce via rest api and the creations,both for product and variation is going ok but then the variation does not take any attribute.

here is the code for the product creation

{
  "name": "Premium Quality test3",
  "slug": "premium-quality-19",
  "type": "variable",
  "status": "publish",
  "catalog_visibility": "visible",
  "description": "
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.
\n",
  "short_description": "
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
\n",
  "sku": "",
  "price": "21.99",
  "regular_price": "21.99",
  "sale_price": "",
  "manage_stock": "false",
  "categories": [
    {
      "id": 22,
      "name": "Ενέργεια",
      "slug": "ενέργεια"
    }
  ],
  "attributes": [
      {
          "id":"14",
          "name":"χρώμα",
          "position":"0",
          "visible":"true",
          "variation":"true",
          "options":["Πράσινο"]
      }
  ]
}

And here is the code for variable creation:

{

  "sku": "6666666",
  "price": "9.00",
  "regular_price": "9.00",
  "manage_stock": "true",
  "stock_quantity": 1,
  "stock_status": "instock",
  "attributes": [
    {
      "id": 14,
      "name": "Xρώμα",
      "option": "Πράσινο"
    }
  ]
}

but still the variation remains without attributes

enter image description here


问:
How can I get all enclosed elements from annotation and cast it to its super type?
I am trying to capture all the enum constants inside the @AxesSource element and turn in into a Map<String,IAxis> using annotation processing.

The annotation processing round environment provides me with javax.lang.model.element.Element representing the element annotated with @AxesSource and I can get all the child elements with getEnclosedElements() but I don't know how I can get the enum constant value names like xAxis, yAxis into a String, or cast it to IAxis so I can call on its methods later. Would that be possible? or should I just try to get that information from the enum constants?

@Controller(name = "DriveStick")
@HasDPad
public static class DriveTemp {
  @ButtonsSource
  public enum Button implements Mappable {
    button1(1),
    button2(2),
    button3(3),
    button4(4),
    button5(5),
    button6(6),
    button7(7),
    button8(8),
    button9(9),
    button10(10),
    button11(11),
    button12(12);

    private final int id;

    Button(int id) {
      this.id = id;
    }

    @Override
    public int getID() {
      return id;
    }
  }

  @AxesSource
  @Separate
  public enum Axis implements IAxis {
    xAxis(0),
    yAxis(1, true),
    zAxis(2),
    Slider(3);

    private final int number;
    private final boolean inverted;

    Axis(int number, boolean inverted) {
      this.number = number;
      this.inverted = inverted;
    }

    Axis(int number) {
      this.number = number;
      this.inverted = false;
    }

    @Override
    public boolean isInverted() {
      return inverted;
    }

    @Override
    public int getNumber() {
      return number;
    }
  }
}
```
<p>so far I have</p>
<pre class="lang-java prettyprint-override"><code>
axes =
        element.getEnclosedElements().stream()
            .filter(e -> e.getKind() == ElementKind.ENUM_CONSTANT)
            .collect(
                Collectors.toMap(
                    e -> e.toString(),
                    e -> {
                      if (e instanceof IAxis) {
                        return (IAxis) e;
                      }
                      return null;
                    }));
</code>```

I am unable to simply cast it like that

Body:
I am trying to capture all the enum constants inside the @AxesSource element and turn in into a Map<String,IAxis> using annotation processing.

The annotation processing round environment provides me with javax.lang.model.element.Element representing the element annotated with @AxesSource and I can get all the child elements with getEnclosedElements() but I don't know how I can get the enum constant value names like xAxis, yAxis into a String, or cast it to IAxis so I can call on its methods later. Would that be possible? or should I just try to get that information from the enum constants?

@Controller(name = "DriveStick")
@HasDPad
public static class DriveTemp {
  @ButtonsSource
  public enum Button implements Mappable {
    button1(1),
    button2(2),
    button3(3),
    button4(4),
    button5(5),
    button6(6),
    button7(7),
    button8(8),
    button9(9),
    button10(10),
    button11(11),
    button12(12);

    private final int id;

    Button(int id) {
      this.id = id;
    }

    @Override
    public int getID() {
      return id;
    }
  }

  @AxesSource
  @Separate
  public enum Axis implements IAxis {
    xAxis(0),
    yAxis(1, true),
    zAxis(2),
    Slider(3);

    private final int number;
    private final boolean inverted;

    Axis(int number, boolean inverted) {
      this.number = number;
      this.inverted = inverted;
    }

    Axis(int number) {
      this.number = number;
      this.inverted = false;
    }

    @Override
    public boolean isInverted() {
      return inverted;
    }

    @Override
    public int getNumber() {
      return number;
    }
  }
}

so far I have

axes =
        element.getEnclosedElements().stream()
            .filter(e -> e.getKind() == ElementKind.ENUM_CONSTANT)
            .collect(
                Collectors.toMap(
                    e -> e.toString(),
                    e -> {
                      if (e instanceof IAxis) {
                        return (IAxis) e;
                      }
                      return null;
                    }));

I am unable to simply cast it like that


问:
Error: Undefined constant "STDIN" Laravel Backpack Devtools
I'm using
PHP: 8.08
Laravel: 9.5.1
Backpack: ^5.0
"backpack/permissionmanager": ^6.0

I'm trying to create a Model with the CRUD with Devtools

Simple, just the id

When I save it an error pages show up saying:

Error: Undefined constant "STDIN"

And referencing the file (red color):

App\Http\Middleware\CheckIfAdmin   line 66

The table is created at Mysql

The Migration and the Model php files are created

But it stops (error) when trying to create the CRUD

I have tried using the yellow [Generate] button at /devtools/model but the same happens

How can I solve this?


问:
Active Record: How to select records that have zero has_many relations?
I'm using Rails 3, and I have the following:

```<code>class Artist < ActiveRecord::Base
  has_many :releases
  # more code
end

class Release < ActiveRecord::Base
  belongs_to :artist
  # more codez
end
</code>```

If I want to select all artists that have NO releases, how would I do this without hardcoding SQL?

ContentLicense: CC BY-SA 3.0

Body:
I'm using Rails 3, and I have the following:

class Artist < ActiveRecord::Base
  has_many :releases
  # more code
end

class Release < ActiveRecord::Base
  belongs_to :artist
  # more codez
end

If I want to select all artists that have NO releases, how would I do this without hardcoding SQL?


问:
VS Code jupyter notebook root file
I'm currently facing the problem of not being able to change the notebook file root.  My setup: I cloned a repo via ssh and run the notebooks on a remote jupyter server with VS Code.
My directory structure is something like:

```<code>workingDir/notebook_1.ipynb
workingDir/subDir
workingDir/subDir/notebook_2.ipynb
</code>```

According to my google searches it should be possible to set the notebook file root in the settings with

```<code>"jupyter.notebookFileRoot": "${fileDirName}"
</code>```

But unfortunately this does not help and the notebook still run on the default working directory of the repo.

when I run os.getcwd() in notebook_1.ipynb I expect the output
'workingDir'

and when I run it on notebook_2.ipynb I expect the output
'workingDir/subDir'

However, I get the output 'workingDir' in both notebooks. This is pretty annoying as in jupyter-lab in the browser I'm able to reproduce the expected behaviour, but not in VS Code.
Note: I can also reproduce the expected behaviour when I run the notebooks on my local jupyter server. So the problem seems to be connected with the remote jupyter server.

Title: VS Code jupyter notebook root file

Body:
I'm currently facing the problem of not being able to change the notebook file root.  My setup: I cloned a repo via ssh and run the notebooks on a remote jupyter server with VS Code.
My directory structure is something like:

workingDir/notebook_1.ipynb
workingDir/subDir
workingDir/subDir/notebook_2.ipynb

According to my google searches it should be possible to set the notebook file root in the settings with

"jupyter.notebookFileRoot": "${fileDirName}"

But unfortunately this does not help and the notebook still run on the default working directory of the repo.

when I run os.getcwd() in notebook_1.ipynb I expect the output
'workingDir'

and when I run it on notebook_2.ipynb I expect the output
'workingDir/subDir'

However, I get the output 'workingDir' in both notebooks. This is pretty annoying as in jupyter-lab in the browser I'm able to reproduce the expected behaviour, but not in VS Code.
Note: I can also reproduce the expected behaviour when I run the notebooks on my local jupyter server. So the problem seems to be connected with the remote jupyter server.


问:
Postgres/Psycopg: password authentication failed (with correct user/password)
I'm receiving the following error when connecting to a remote Postgres 13 database server. The user and password are correct.

psycopg.OperationalError: connection failed: FATAL: password authentication failed for user "someuser"

Things I tried:

Using Psycopg2-binary

Using Psycopg3[binary]

The most permissive pg_hba.conf: host all all 0.0.0.0/0 trust

Also tried hostssl and md5 and password options

Setting ssl = off

Removing all "reject" lines from pg_hba.conf

Facts:

User can connect via pgAdmin

User can connect via psql

Same Python code works against a different Postgres server

postgres.conf specifies listen_addresses='*'

postgres.conf is identical to the postgres.conf on the server that connects without problems.

```<code>import psycopg

HOST="<ip here>"
PORT=5432
DB="<dbname here>"
USER="<user here>"
PASS="<pass here>"
with psycopg.connect(host=HOST,port=PORT,dbname=DB,user=USER,password=PASS) as conn:
    with conn.cursor() as cur:
        ....
</code>```

I'm suspecting that perhaps the server that I cannot connect to has a stronger SSL setting, but I'm grasping at straws here. I also suspect both machines are created and controlled with the same puppet scripts, so should be very identical. Clearly the login is not blocked by firewalls, given the return error.

I've also tried adding sslmode='required' and passing a cert file, but that gives me an certificate verify failed errror. Both postgresql.conf have ssl=on.

UPDATE: I've been monitoring the logs, succesful connections show up, but never any authentication fails from Psycopg. Even at the highest debug5 level, nothing shows when the connection is attempted. In addition I've set ssl = off and removed all "reject" lines from pg_hba.conf.

Any ideas? Things I can check or try?

Body:
I'm receiving the following error when connecting to a remote Postgres 13 database server. The user and password are correct.

psycopg.OperationalError: connection failed: FATAL: password authentication failed for user "someuser"

Things I tried:

Using Psycopg2-binary

Using Psycopg3[binary]

The most permissive pg_hba.conf: host all all 0.0.0.0/0 trust

Also tried hostssl and md5 and password options

Setting ssl = off

Removing all "reject" lines from pg_hba.conf

Facts:

User can connect via pgAdmin

User can connect via psql

Same Python code works against a different Postgres server

postgres.conf specifies listen_addresses='*'

postgres.conf is identical to the postgres.conf on the server that connects without problems.

import psycopg

HOST="<ip here>"
PORT=5432
DB="<dbname here>"
USER="<user here>"
PASS="<pass here>"
with psycopg.connect(host=HOST,port=PORT,dbname=DB,user=USER,password=PASS) as conn:
    with conn.cursor() as cur:
        ....

I'm suspecting that perhaps the server that I cannot connect to has a stronger SSL setting, but I'm grasping at straws here. I also suspect both machines are created and controlled with the same puppet scripts, so should be very identical. Clearly the login is not blocked by firewalls, given the return error.

I've also tried adding sslmode='required' and passing a cert file, but that gives me an certificate verify failed errror. Both postgresql.conf have ssl=on.

UPDATE: I've been monitoring the logs, succesful connections show up, but never any authentication fails from Psycopg. Even at the highest debug5 level, nothing shows when the connection is attempted. In addition I've set ssl = off and removed all "reject" lines from pg_hba.conf.

Any ideas? Things I can check or try?


问:
I want to know how to solve this problem on my android studio
```<code>* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:desugarDebugFileDependencies'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.DexFileDependenciesTask$DexFileDependenciesWorkerAction
   > zip END header not found

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

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

BUILD FAILED in 18s
Exception: Gradle task assembleDebug failed with exit code 1
</code>```

I tried to connect my mobile phone(physical device) with android studio. So I want to know why I am seen this codes on my android studio when I try to connect my physical device

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

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:desugarDebugFileDependencies'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.DexFileDependenciesTask$DexFileDependenciesWorkerAction
   > zip END header not found

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

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

BUILD FAILED in 18s
Exception: Gradle task assembleDebug failed with exit code 1

I tried to connect my mobile phone(physical device) with android studio. So I want to know why I am seen this codes on my android studio when I try to connect my physical device


问:
How to reset/restore vscode-pull-request-github extension on my local machine
Not too long ago I found the great VSCode extension vscode-pull-request-github which I love.

Everything worked just fine for a while until one day I somehow killed the connection to the server, I tried to recover from it without any success.

I reinstalled VScode, wiped the repo and the VS settings, but none of it worked.

I deleted on github the app permission, reinstalled it on another machine (Mac), and everything worked well for a while.

After trying to recover the extension on my main Linux machine, things fail apart again, this time on both machines.

I assume there is something else I need to delete, a public key or something else that allow the connection between my local client and github, but I just do not know what it is and where to find it.

Any cleanup procedure which will allow me to reuse the extension again will be well appreciated.


问:
Alexa Custom Skill not triggering my custom intent
Here is a sample code of it

my Intent is this https://imgur.com/a/9nG3MVD

Does anyone have an idea as to why the Alexa Simulator Test doesn't trigger my custom intent?

```<code>const MyCustomHandler = {
    canHandle(handlerInput) {
        return Alexa.getRequestType(handlerInput.requestEnvelope) === 'IntentRequest'
            && Alexa.getIntentName(handlerInput.requestEnvelope) === 'MyCustomIntent';
    },
    handle(handlerInput) {
        let speakOutput = 'Place Call Intent';

        return handlerInput.responseBuilder
            .speak(speakOutput)
            .getResponse();
    }
};

/**
 * This handler acts as the entry point for your skill, routing all request and response
 * payloads to the handlers above. Make sure any new handlers or interceptors you've
 * defined are included below. The order matters - they're processed top to bottom
 * */
exports.handler = Alexa.SkillBuilders.custom()
    .addRequestHandlers(
        LaunchRequestHandler,
        MyCustomHandler,
        HelpIntentHandler,
        CancelAndStopIntentHandler,
        FallbackIntentHandler,
        SessionEndedRequestHandler,
        IntentReflectorHandler,
    ).addErrorHandlers(
        ErrorHandler
    ).lambda();
</code>```

Body:
Here is a sample code of it

my Intent is this https://imgur.com/a/9nG3MVD

Does anyone have an idea as to why the Alexa Simulator Test doesn't trigger my custom intent?

const MyCustomHandler = {
    canHandle(handlerInput) {
        return Alexa.getRequestType(handlerInput.requestEnvelope) === 'IntentRequest'
            && Alexa.getIntentName(handlerInput.requestEnvelope) === 'MyCustomIntent';
    },
    handle(handlerInput) {
        let speakOutput = 'Place Call Intent';

        return handlerInput.responseBuilder
            .speak(speakOutput)
            .getResponse();
    }
};

/**
 * This handler acts as the entry point for your skill, routing all request and response
 * payloads to the handlers above. Make sure any new handlers or interceptors you've
 * defined are included below. The order matters - they're processed top to bottom
 * */
exports.handler = Alexa.SkillBuilders.custom()
    .addRequestHandlers(
        LaunchRequestHandler,
        MyCustomHandler,
        HelpIntentHandler,
        CancelAndStopIntentHandler,
        FallbackIntentHandler,
        SessionEndedRequestHandler,
        IntentReflectorHandler,
    ).addErrorHandlers(
        ErrorHandler
    ).lambda();


问:
How to access all polls that have been sent inside of a group
this might be a newbie question
My goal is to make a bot that sends polls every day.
The polls I would like to send are from a group that me and a couple of friends used to set up manually, but now I would like to automate it without having to type all the previous questions all over again (so we can repost some questions)

What is the way to access these polls for later reuse ? I hope this is doable

Thanks in advance

I have set up the proper environment to send polls, and I tried messing around with the getMessage and getHistory methods but could not do anything fruitful


问:
Export PST from Exchange Online (fully scripted)
I used to have a script which would export a batch of users' mailboxes from exchange on-prem to individual mailbox PST files. We have since moved to exchange online, and this doesn't seem to be an option.

The New-MailboxExportRequest PowerShell command doesn't have an online equivalent, and everything I have been able to google for PowerShell (mostly using compliance center) has at least one manual step - either downloading the PST from compliance center or adding the mailbox in outlook. As I could be doing significant numbers of mailboxes in some batches, I really need a fully scripted option.

Has anyone worked out a fully automated way to export an online mailbox to PST?

I've thought of trying to script it to move the mailbox back to an on-prem exchange box, and then export as normal, but this is inelegant, and I don't know how much longer I'll have the on-prem exchange. It'll do at a pinch, but I'd rather avoid coming back to on-prem.

Anyone with any ideas?

I'm also open to other suggestions, as long as they don't include (often expensive) add-ons. (can it be done through Microsoft's EXO3 APIs directly?)


问:
Config Server URI not detected in Spring Boot Microservice Project
I am working on a microservice project and implementing the Config Server using GitHub.
I created following files on GitHub-

Each file has the same configuration code (the common configuration for microservices) with different names-

```<code>spring:
    application:
        name: Config-default
eureka:
    instance:
        prefer-ip-address: true
    client:
        fetch-registry: true #true by default
        register-with-eureka: true #true by default
        service-url:
            defaultZone: http://localhost:8761/eureka #url of the eureka server, registers with this url
</code>```

I use the @EnableConfigServer annotation for the configuration server.
In the application.yml for the Configuration Server Microservice I add-

```<code>server:
  port: 8089
spring:
  application:
    name: CONFIG-SERVER

  cloud:
    config:
      server:
        git:
          uri: <github repository url>
          clone-on-start: true
</code>```

For the client microservices I added following dependency to pom.xml-

```<code><dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
</dependency>
</code>```

In the application.yml for the clients I add the configuration-

```<code>spring:
    application:
        name: USER-SERVICE #changes the name of application from UNKNOWN to UserService
    config:
        import: optional:configserver:http://localhost:8089
    profiles:
        active: prod
</code>```

Problem- When I try to run my configuration server microservice I get the following error message-

```<code>
***************************
APPLICATION FAILED TO START
***************************

Description:

Invalid config server configuration.

Action:

If you are using the git profile, you need to set a Git URI in your configuration.  If you have set spring.cloud.config.server.bootstrap=true, you need to use a composite configuration.
</code>```

Can somebody please help me find out the problem, why the URL is not detected.

Body:
I am working on a microservice project and implementing the Config Server using GitHub.
I created following files on GitHub-

Each file has the same configuration code (the common configuration for microservices) with different names-

spring:
    application:
        name: Config-default
eureka:
    instance:
        prefer-ip-address: true
    client:
        fetch-registry: true #true by default
        register-with-eureka: true #true by default
        service-url:
            defaultZone: http://localhost:8761/eureka #url of the eureka server, registers with this url

I use the @EnableConfigServer annotation for the configuration server.
In the application.yml for the Configuration Server Microservice I add-

server:
  port: 8089
spring:
  application:
    name: CONFIG-SERVER

  cloud:
    config:
      server:
        git:
          uri: <github repository url>
          clone-on-start: true

For the client microservices I added following dependency to pom.xml-

<dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
</dependency>

In the application.yml for the clients I add the configuration-

spring:
    application:
        name: USER-SERVICE #changes the name of application from UNKNOWN to UserService
    config:
        import: optional:configserver:http://localhost:8089
    profiles:
        active: prod

Problem- When I try to run my configuration server microservice I get the following error message-

***************************
APPLICATION FAILED TO START
***************************

Description:

Invalid config server configuration.

Action:

If you are using the git profile, you need to set a Git URI in your configuration.  If you have set spring.cloud.config.server.bootstrap=true, you need to use a composite configuration.

Can somebody please help me find out the problem, why the URL is not detected.


问:
User' object has no attribute 'make_password'
what is the error with set_password
/base/backends.py in authenticate

```<code>from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend

class CaseInsensitiveModelBackend(ModelBackend):
    def authenticate(self,request,username=None,password=None,**Kwargs):
        UserModel=get_user_model()
        if username is None:
            username=Kwargs.get(UserModel.USERNAME_FIELD)
        try:
            case_insensitive_username_field='{}__iexact'.format(UserModel.USERNAME_FIELD)
            user = UserModel._default_manager.get(**{case_insensitive_username_field:username})
        except UserModel.DoesNotExist:
            UserModel().set_paassword(password)
        else:
            if user.check_password(password) and self.user_can_authenticate(user):
                return user
</code>```

i try to put make_password but not working

Body:
what is the error with set_password
/base/backends.py in authenticate

from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend

class CaseInsensitiveModelBackend(ModelBackend):
    def authenticate(self,request,username=None,password=None,**Kwargs):
        UserModel=get_user_model()
        if username is None:
            username=Kwargs.get(UserModel.USERNAME_FIELD)
        try:
            case_insensitive_username_field='{}__iexact'.format(UserModel.USERNAME_FIELD)
            user = UserModel._default_manager.get(**{case_insensitive_username_field:username})
        except UserModel.DoesNotExist:
            UserModel().set_paassword(password)
        else:
            if user.check_password(password) and self.user_can_authenticate(user):
                return user

i try to put make_password but not working


问:
im trying to make a thread pool code but my for loop only work once
i've tried to use for loop for few time. it work smooth if im using for ... in range() but it always work only once if im using for ... in list

here's the code

```<code>def queue_time(customers, n):
    a = 0
    ab =[]
    if n == 1:
        return sum(customers)
    if n > len(customers):
        return max(customers)

    for x in customers:
        while a<n:
            ab.append(x)
            a += 1
        for c in ab:
            if c == min(ab):
                c = min(ab) + x
    return ab

</code>```

im trying to make a simple code for thread pool but it seems like my code suck but idk where it is(im newbie BTW)

Body:
i've tried to use for loop for few time. it work smooth if im using for ... in range() but it always work only once if im using for ... in list

here's the code

def queue_time(customers, n):
    a = 0
    ab =[]
    if n == 1:
        return sum(customers)
    if n > len(customers):
        return max(customers)

    for x in customers:
        while a<n:
            ab.append(x)
            a += 1
        for c in ab:
            if c == min(ab):
                c = min(ab) + x
    return ab

im trying to make a simple code for thread pool but it seems like my code suck but idk where it is(im newbie BTW)


问:
Getting char * from Qstring gives garbage
I have the following very simple code

```<code>#include <QCoreApplication>

#include <QDebug>
#include <QString>

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    QString b1("Key");
    char *k = b1.toUtf8().data();
    QString b2(argv[1]);
    char *v = b2.toUtf8().data();

    qDebug() << "Key[" << b1.toUtf8().data() << "] value[" << b2.toUtf8().data() << "]";
    qDebug() << "Key[" << k << "] value[" << v << "]";

    return a.exec();
}

</code>```

When I run the executable passing one argument to the command line (for example Ops) I get the following result

```<code>Key[Key] value[Ops]
Key[O] value[en_US.UTF-8]

</code>```

I can't understand why. Could anyone cast a light on this mistery?

Thank you in advance

ulix

Body:
I have the following very simple code

#include <QCoreApplication>

#include <QDebug>
#include <QString>

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    QString b1("Key");
    char *k = b1.toUtf8().data();
    QString b2(argv[1]);
    char *v = b2.toUtf8().data();

    qDebug() << "Key[" << b1.toUtf8().data() << "] value[" << b2.toUtf8().data() << "]";
    qDebug() << "Key[" << k << "] value[" << v << "]";

    return a.exec();
}

When I run the executable passing one argument to the command line (for example Ops) I get the following result

Key[Key] value[Ops]
Key[O] value[en_US.UTF-8]

I can't understand why. Could anyone cast a light on this mistery?

Thank you in advance

ulix


问:
how to write Java CriteriaQuery equivalent to postgresql/sql for aggregate function like sum, avg with over()
I am tring to write a query to get few columns of a table along with total sum of a particular column. I am able to do so using sum() with over().
Example:

```<code>select id , amount, sum(amount) over ()
from orders
where status =0
</code>```

However if I remove over(), I get the following error;

```<code>ERROR:  column "orders.id" must appear in the GROUP BY clause or be used in an aggregate function
LINE 3: select id , amount, sum(amount)
</code>```

The Java code using CriteriaQuery is like;

```<code>CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<Object[]> cq = cb.createQuery(Object[].class);
Root<Orders> root = cq.from(Orders.class);

List<Predicate> predicates = new ArrayList<>();
predicates.add(cb.equal(root.get("status"), 0));

cq.multiselect(root.get("id"), root.get("amount"), cb.sum(root.get("amount"))
.where(cb.and(predicates.toArray(new Predicate[predicates.size()])));

</code>```

I am not able to find anything equivalent to over() to use in multiselect query. and getting same error;
ERROR:  column "orders.id" must appear in the GROUP BY clause or be used in an aggregate function
LINE 3: select id , amount, sum(amount).

Please suggest how to fix this error and write CriteriaQuery with multiselect and aggregate functions.

Body:
I am tring to write a query to get few columns of a table along with total sum of a particular column. I am able to do so using sum() with over().
Example:

select id , amount, sum(amount) over ()
from orders
where status =0

However if I remove over(), I get the following error;

ERROR:  column "orders.id" must appear in the GROUP BY clause or be used in an aggregate function
LINE 3: select id , amount, sum(amount)

The Java code using CriteriaQuery is like;

CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<Object[]> cq = cb.createQuery(Object[].class);
Root<Orders> root = cq.from(Orders.class);

List<Predicate> predicates = new ArrayList<>();
predicates.add(cb.equal(root.get("status"), 0));

cq.multiselect(root.get("id"), root.get("amount"), cb.sum(root.get("amount"))
.where(cb.and(predicates.toArray(new Predicate[predicates.size()])));

I am not able to find anything equivalent to over() to use in multiselect query. and getting same error;
ERROR:  column "orders.id" must appear in the GROUP BY clause or be used in an aggregate function
LINE 3: select id , amount, sum(amount).

Please suggest how to fix this error and write CriteriaQuery with multiselect and aggregate functions.


问:
My PHP, MySQL, PDO code website was able to insert data into database when hosted locally but cannot insert data when on live server
My code worked perfectly when hosted locally for testing but stopped inserting data into database after I hosted the website online. Other parts of the website that insert into database are working fine except the signup for client. The sign up for admins/operators is also working fine. I've been trying to solve this issue for a while now but to no avail.
And also after inserting data into database manually, I can login and also update the profile.
Before I forget, after filling the form and submitting you get the success message.</p>
```<code>        <?php
          if (isset($_POST['signup'])) {
            $f_name = trim($_POST['Fname']);
            $l_name = trim($_POST['Lname']);
            $client_name = $f_name ." ". $l_name;

            $client_phone = trim($_POST['phone']);

            $sec_question = trim($_POST['sec-question']);

            $sec_answer = trim($_POST['sec-answer']);

            $client_email = trim($_POST['email']);

            $sql = "SELECT * FROM clients WHERE client_email = :email";
            $stmt = $pdo->prepare($sql);
            $stmt->execute([
              ':email' => $client_email
            ]);
            $countEmail = $stmt->rowCount();
            if($countEmail != 0) {
                $error_email_exist = "Email already taken!";
            }

              $client_password = trim($_POST['password']);
              $confirm_password = trim($_POST['confirmPassword']);
              if($client_password != $confirm_password) {
                $error = "Please check your password";
              }else {
                $hash_pass = password_hash($client_password, PASSWORD_BCRYPT, ['cost'=>10]);
                $sql1 = "INSERT INTO clients (client_name, client_email, client_password, client_phone, sec_question, sec_answer) VALUES (:name, :email, :password, :phone, :sec_q, :sec_a)";
                $stmt = $pdo->prepare($sql1);
                $stmt->execute([
                  ':name' => $client_name,
                  ':email' => $client_email,
                  ':password' => $hash_pass,
                  ':phone' => $client_phone,
                  ':sec_q' => $sec_question,
                  ':sec_a' => $sec_answer
                ]);
                $success = true;
              }

          }
        ?>
          <div class="col-sm-8 col-12">
            <form action="client-signup.php" method="post">
                <div class="row mt-3">
                    <div class="col-12 mb-2">
                        <h4><strong>SIGN UP</strong></h4>
                    </div>
                    <hr class="d-block d-sm-block">
                    <div class="col-12">
                      <?php
                        if(isset($error_email_exist)) {
                          echo "<p class='alert alert-danger'>{$error_email_exist}</p>";
                        }elseif (isset($error)) {
                          echo "<p class='alert alert-danger'>{$error}</p>";
                        }elseif (isset($success)) {
                          echo "<p class='alert alert-success'>Great! Signup Successful. <a href='client-signin.php'>Sign in now</a>.</p>";
                        }
                      ?>
                    </div>
                    <div class="col-12">
                        <h5><strong>Name</strong></h5>
                    </div>
                    <div class="col-12 input-group mb-4">
                        <input type="text" name="Fname" class="form-control" placeholder="First Names *" required />
                        <input type="text" name="Lname" class="form-control" placeholder="Last Name *" required />
                    </div>
                    <div class="col-12">
                        <h5><strong>Password</strong></h5>
                    </div>
                    <div class="col-12 input-group mb-3">
                        <input type="password" name="password" class="form-control" placeholder="Create New Password *" required />
                        <input type="password" name="confirmPassword" class="form-control" placeholder="Confirm Password *" required />
                    </div>
                    <div class="col-12 col-sm-2 mt-sm-3">
                        <h5><strong>Email</strong></h5>
                    </div>
                    <div class="col-12 col-sm-10 mt-sm-3">
                        <input type="email" name="email" class="form-control" placeholder="Enter Email Address *" required />
                    </div>
                    <div class="col-12 col-sm-2 mt-sm-3 mt-3">
                        <h5><strong>Phone</strong></h5>
                    </div>
                    <div class="col-12 col-sm-10 mt-sm-3">
                        <input type="phone" name="phone" class="form-control col-sm-6" placeholder="Enter Phone Number *" required />
                    </div>
                    <div class="col mt-2">
                        <hr>
                    </div>
                    <div class="col-12 mt-sm-3 mt-3">
                        <h5><strong>Security (For Password Reset)</strong></h5>
                    </div>
                    <div class="col-12 mt-sm-1">
                        <select name="sec-question" id="security" class="form-control">
                            <option value="#">Choose a security question</option>
                            <option value="What is your pet's name?">What is your pet's name?</option>
                            <option value="Which year did you meet your spouse?">Which year did you meet your spouse?</option>
                            <option value="What is your favourite fruit?">What is your favourite fruit?</option>
                            <option value="At what age did you cook your first meal?">At what age did you cook your first meal?</option>
                        </select>
                    </div>
                    <div class="col-12 mt-sm-3 mt-1">
                        <input type="text" name="sec-answer" class="form-control col-sm-6" placeholder="Answer to question *" required />
                    </div>
                    <div class="col mt-2">
                        <hr>
                    </div>
                    <div class="col-12">
                        <input type="checkbox" checked name="TnC" id="Terms" class="checkbox" required /> <span for="Terms"> I accept all <a href="#offcanvasTnC" data-bs-toggle="offcanvas" role="button" aria-controls="offcanvasTnC" class="black-link"><u>Terms and Conditions</u></a> of Bulky Africa.</span>
                    </div>
                </div>
                <div class="row">
                    <div class="col mt-4">
                        <button type="submit" name="signup" class="col-12 btn btn-lg btn-primary">SIGN UP</button>
</code>```

Body:
My code worked perfectly when hosted locally for testing but stopped inserting data into database after I hosted the website online. Other parts of the website that insert into database are working fine except the signup for client. The sign up for admins/operators is also working fine. I've been trying to solve this issue for a while now but to no avail.
And also after inserting data into database manually, I can login and also update the profile.
Before I forget, after filling the form and submitting you get the success message.

        <?php
          if (isset($_POST['signup'])) {
            $f_name = trim($_POST['Fname']);
            $l_name = trim($_POST['Lname']);
            $client_name = $f_name ." ". $l_name;

            $client_phone = trim($_POST['phone']);

            $sec_question = trim($_POST['sec-question']);

            $sec_answer = trim($_POST['sec-answer']);

            $client_email = trim($_POST['email']);

            $sql = "SELECT * FROM clients WHERE client_email = :email";
            $stmt = $pdo->prepare($sql);
            $stmt->execute([
              ':email' => $client_email
            ]);
            $countEmail = $stmt->rowCount();
            if($countEmail != 0) {
                $error_email_exist = "Email already taken!";
            }

              $client_password = trim($_POST['password']);
              $confirm_password = trim($_POST['confirmPassword']);
              if($client_password != $confirm_password) {
                $error = "Please check your password";
              }else {
                $hash_pass = password_hash($client_password, PASSWORD_BCRYPT, ['cost'=>10]);
                $sql1 = "INSERT INTO clients (client_name, client_email, client_password, client_phone, sec_question, sec_answer) VALUES (:name, :email, :password, :phone, :sec_q, :sec_a)";
                $stmt = $pdo->prepare($sql1);
                $stmt->execute([
                  ':name' => $client_name,
                  ':email' => $client_email,
                  ':password' => $hash_pass,
                  ':phone' => $client_phone,
                  ':sec_q' => $sec_question,
                  ':sec_a' => $sec_answer
                ]);
                $success = true;
              }

          }
        ?>

            <form action="client-signup.php" method="post">

SIGN UP

                      <?php
                        if(isset($error_email_exist)) {
                          echo "
{$error_email_exist}
";
                        }elseif (isset($error)) {
                          echo "
{$error}
";
                        }elseif (isset($success)) {
                          echo "
Great! Signup Successful. Sign in now.
";
                        }
                      ?>

Name

                        <input type="text" name="Fname" class="form-control" placeholder="First Names *" required />
                        <input type="text" name="Lname" class="form-control" placeholder="Last Name *" required />

Password

                        <input type="password" name="password" class="form-control" placeholder="Create New Password *" required />
                        <input type="password" name="confirmPassword" class="form-control" placeholder="Confirm Password *" required />

Email

                        <input type="email" name="email" class="form-control" placeholder="Enter Email Address *" required />

Phone

                        <input type="phone" name="phone" class="form-control col-sm-6" placeholder="Enter Phone Number *" required />

Security (For Password Reset)

                        <select name="sec-question" id="security" class="form-control">
                            <option value="#">Choose a security question</option>
                            <option value="What is your pet's name?">What is your pet's name?</option>
                            <option value="Which year did you meet your spouse?">Which year did you meet your spouse?</option>
                            <option value="What is your favourite fruit?">What is your favourite fruit?</option>
                            <option value="At what age did you cook your first meal?">At what age did you cook your first meal?</option>
                        </select>

                        <input type="text" name="sec-answer" class="form-control col-sm-6" placeholder="Answer to question *" required />

                        <input type="checkbox" checked name="TnC" id="Terms" class="checkbox" required />  I accept all Terms and Conditions of Bulky Africa.

                        <button type="submit" name="signup" class="col-12 btn btn-lg btn-primary">SIGN UP</button>


问:
TYPO3 TCA execute hook after delete in backend
I want to manipulate some values and execute a custom function if an object is deleted trought the backend.

ext_localconf.php

```<code>$GLOBALS ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][''] = TES\TesTest\Hooks\TCEmainHook::class;
$GLOBALS ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][''] = TES\TesTest\Hooks\TCEmainHook::class;
</code>```

Additionally, I created the following class in my extension /Classes/Hooks/TCEmainHook.php

```<code>namespace TES\TesTest\Hooks;

use TYPO3\CMS\Core\DataHandling\DataHandler;

class TCEmainHook
{
    public function processCmdmap_deleteAction($table, $id, array $recordToDelete, &$recordWasDeleted, DataHandler $dataHandler)
    {
        var_dump($table);
        var_dump($id);
        die;
    }
}
</code>```

I don't get what I am doing wrong. Does someone have any suggestions?

Body:
I want to manipulate some values and execute a custom function if an object is deleted trought the backend.

ext_localconf.php

$GLOBALS ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][''] = TES\TesTest\Hooks\TCEmainHook::class;
$GLOBALS ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][''] = TES\TesTest\Hooks\TCEmainHook::class;

Additionally, I created the following class in my extension /Classes/Hooks/TCEmainHook.php

namespace TES\TesTest\Hooks;

use TYPO3\CMS\Core\DataHandling\DataHandler;

class TCEmainHook
{
    public function processCmdmap_deleteAction($table, $id, array $recordToDelete, &$recordWasDeleted, DataHandler $dataHandler)
    {
        var_dump($table);
        var_dump($id);
        die;
    }
}

I don't get what I am doing wrong. Does someone have any suggestions?


问:
How to select best kernel_size and max_pool_size in CNN1D
I have data with shape size 1,89.  setup kernel_size = 3 and pool_size = 2 on the conv1d layer. However, the model is not able to predict the peak well. i think the problem is because the kernel_size and pool_size that i set are not suitable for my data. how to determine good kernel_size and pool_size. thank you.

the Data : 0.0, 0.0, 84.0, 81.0, 60.0, 22.0, 0.0, 0.0, 0.0, 0.0, 37.0,
121.0, 116.0, 1.0, 10.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 92.0, 90.0, 74.0, 46.0, 0.0, 0.0, 0.0, 0.0, 28.0, 121.0, 117.0, 90.0, 54.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 47.0, 62.0, 54.0, 57.0, 23.0, 63.0, 26.0, 62.0, 52.0, 138.0, 126.0, 98.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 19.0, 44.0, 74.0, 89.0, 119.0, 77.0, 141.0, 137.0, 119.0, 0.0, 0.0, 0.0, 0.0, 91.0, 115.0, 89.0, 143.0, 146.0, 45.0, 0.0, 0.0, 0.0, 65.0, 89.0, 1.0, 0.0, 0.0, 0.0

Data shape: 15000,89

```<code>model structure :
model = Sequential()

model.add(Conv1D(64,kernel_size=5,strides=1,padding='same',data_format='channels_last',input_shape=(X_train.shape[1],1)))
model.add(Dropout(0.1))
model.add(Activation('relu'))
model.add(MaxPooling1D(pool_size = 4, strides = 1))

model.add(Conv1D(32,kernel_size=5,strides=1,padding='same'))
model.add(Dropout(0.1))
model.add(Activation('relu'))
model.add(MaxPooling1D(pool_size = 4, strides = 1))

model.add(Conv1D(16,kernel_size=5,strides=1,padding='same'))
model.add(Dropout(0.1))
model.add(Activation('relu'))
model.add(MaxPooling1D(pool_size = 4, strides = 1))

model.add(Flatten())
model.add(Dense(64,activation='relu'))
model.add(Dense(32,activation='relu'))
model.add(Dense(16,activation='relu'))
model.add(Dense(1,activation='sigmoid'))
</code>```

Prediction Result:

Body:
I have data with shape size 1,89.  setup kernel_size = 3 and pool_size = 2 on the conv1d layer. However, the model is not able to predict the peak well. i think the problem is because the kernel_size and pool_size that i set are not suitable for my data. how to determine good kernel_size and pool_size. thank you.

the Data : 0.0, 0.0, 84.0, 81.0, 60.0, 22.0, 0.0, 0.0, 0.0, 0.0, 37.0,
121.0, 116.0, 1.0, 10.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 92.0, 90.0, 74.0, 46.0, 0.0, 0.0, 0.0, 0.0, 28.0, 121.0, 117.0, 90.0, 54.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 47.0, 62.0, 54.0, 57.0, 23.0, 63.0, 26.0, 62.0, 52.0, 138.0, 126.0, 98.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 19.0, 44.0, 74.0, 89.0, 119.0, 77.0, 141.0, 137.0, 119.0, 0.0, 0.0, 0.0, 0.0, 91.0, 115.0, 89.0, 143.0, 146.0, 45.0, 0.0, 0.0, 0.0, 65.0, 89.0, 1.0, 0.0, 0.0, 0.0

Data shape: 15000,89

model structure :
model = Sequential()

model.add(Conv1D(64,kernel_size=5,strides=1,padding='same',data_format='channels_last',input_shape=(X_train.shape[1],1)))
model.add(Dropout(0.1))
model.add(Activation('relu'))
model.add(MaxPooling1D(pool_size = 4, strides = 1))

model.add(Conv1D(32,kernel_size=5,strides=1,padding='same'))
model.add(Dropout(0.1))
model.add(Activation('relu'))
model.add(MaxPooling1D(pool_size = 4, strides = 1))

model.add(Conv1D(16,kernel_size=5,strides=1,padding='same'))
model.add(Dropout(0.1))
model.add(Activation('relu'))
model.add(MaxPooling1D(pool_size = 4, strides = 1))

model.add(Flatten())
model.add(Dense(64,activation='relu'))
model.add(Dense(32,activation='relu'))
model.add(Dense(16,activation='relu'))
model.add(Dense(1,activation='sigmoid'))

Prediction Result:


问:
Consider defining a bean of type 'java.lang.String' in your configuration. in spring boot migration project
I am working on the spring boot migration project from spring mvc+webflow to spring boot. During runtime, I am getting the below error.

*************************** APPLICATION FAILED TO START ***************************

Description:

Parameter 1 of constructor in
com.geodan.lgr.support.ExtendedLdapAuthoritiesPopulator required a
bean of type 'java.lang.String' that could not be found.

Action:

Consider defining a bean of type 'java.lang.String' in your
configuration.

Class: ExtendedLdapAuthoritiesPopulator

Constructor:

```<code>public ExtendedLdapAuthoritiesPopulator(ContextSource contextSource,
            String groupSearchBase) {
        super(contextSource, groupSearchBase);
            ldapTemplate = new SpringSecurityLdapTemplate(contextSource);

    }
</code>```

The parameter String groupSearchBase creates this error. How to make Spring not creating bean for inbuilt classes?

Body:
I am working on the spring boot migration project from spring mvc+webflow to spring boot. During runtime, I am getting the below error.

*************************** APPLICATION FAILED TO START ***************************

Description:

Parameter 1 of constructor in
com.geodan.lgr.support.ExtendedLdapAuthoritiesPopulator required a
bean of type 'java.lang.String' that could not be found.

Action:

Consider defining a bean of type 'java.lang.String' in your
configuration.

Class: ExtendedLdapAuthoritiesPopulator

Constructor:

public ExtendedLdapAuthoritiesPopulator(ContextSource contextSource,
            String groupSearchBase) {
        super(contextSource, groupSearchBase);
            ldapTemplate = new SpringSecurityLdapTemplate(contextSource);

    }

The parameter String groupSearchBase creates this error. How to make Spring not creating bean for inbuilt classes?


问:
Android logs report "Could not find a dictionary pack"
Android 4.2.2 Main log reports:

ERROR,BinaryDictionaryGetter,Keyboard Android (AOSP),Could not find a dictionary pack

Package name of keyboard: com.android.inputmethod.latin.
Any ideas how to fix that.