问:
FATAL exception building a native image with Kafka streams
I am trying to create a native image with a simple Kafka stream and since a while ago, I got an ugly WARN exception and later on a FATAL exception.

I tested out in a Quarkus 2.13, 2.14 and 2.15 with the same output.

The FATAL exception stops the compiling process and aborts the build sequence.

I'd appreciate any comment.

Cheers

```    20:05:16,775 WARN  [org.apa.kaf.str.int.met.ClientMetrics] Error while loading kafka-streams-version.properties: java.lang.NullPointerException: inStream parameter is null
        at java.base/java.util.Objects.requireNonNull(Objects.java:233)
        at java.base/java.util.Properties.load(Properties.java:407)
        at org.apache.kafka.streams.internals.metrics.ClientMetrics.<clinit>(ClientMetrics.java:53)
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1155)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.ensureClassInitialized(ClassInitializationSupport.java:172)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ProvenSafeClassInitializationSupport.computeInitKindAndMaybeInitializeClass(ProvenSafeClassInitializationSupport.java:344)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ProvenSafeClassInitializationSupport.computeInitKindAndMaybeInitializeClass(ProvenSafeClassInitializationSupport.java:75)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.shouldInitializeAtRuntime(ClassInitializationSupport.java:148)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.SVMHost.isInitialized(SVMHost.java:297)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisType.isInitialized(AnalysisType.java:882)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.maybeEagerlyInitialize(BytecodeParser.java:4304)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeStatic(BytecodeParser.java:1658)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeStatic(BytecodeParser.java:1651)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5288)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3385)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.handleBytecodeBlock(BytecodeParser.java:3345)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3190)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1138)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:1030)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:97)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase.run(SharedGraphBuilderPhase.java:84)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:446)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.AnalysisParsedGraph.parseBytecode(AnalysisParsedGraph.java:135)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsed(AnalysisMethod.java:685)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysisGraphDecoder.lookupEncodedGraph(InlineBeforeAnalysis.java:180)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.doInline(PEGraphDecoder.java:1162)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.tryInline(PEGraphDecoder.java:1145)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.trySimplifyInvoke(PEGraphDecoder.java:1003)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.handleInvoke(PEGraphDecoder.java:957)
        at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.GraphDecoder.processNextNode(GraphDecoder.java:817)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysisGraphDecoder.processNextNode(InlineBeforeAnalysis.java:240)
        at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.GraphDecoder.decode(GraphDecoder.java:548)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.decode(PEGraphDecoder.java:833)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysis.decodeGraph(InlineBeforeAnalysis.java:98)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:179)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:349)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:93)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureFlowsGraphCreated(MethodTypeFlow.java:83)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.getOrCreateMethodFlowsGraph(MethodTypeFlow.java:65)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.typestate.DefaultSpecialInvokeTypeFlow.onObservedUpdate(DefaultSpecialInvokeTypeFlow.java:61)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.TypeFlow.update(TypeFlow.java:562)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.PointsToAnalysis$1.run(PointsToAnalysis.java:488)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:193)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:177)
        at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

[2/7] Performing analysis...  [*]                                                                       (69.4s @ 1.08GB)
  10,902 (86.72%) of 12,571 classes reachable
  15,935 (61.59%) of 25,872 fields reachable
  53,386 (56.93%) of 93,767 methods reachable
     388 classes,   112 fields, and 1,887 methods registered for reflection

Fatal error: com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing io.netty.util.internal.logging.InternalLoggerFactory.newDefaultFactory(java.lang.String)
Parsing context:
   at io.netty.util.internal.logging.InternalLoggerFactory.newDefaultFactory(InternalLoggerFactory.java:42)
   at io.netty.util.internal.logging.InternalLoggerFactory.getDefaultFactory(InternalLoggerFactory.java:111)
   at io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:134)
   at io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:127)
   at io.netty.buffer.ByteBufUtil.<clinit>(ByteBufUtil.java:59)

        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.AnalysisError.parsingError(AnalysisError.java:153)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:104)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureFlowsGraphCreated(MethodTypeFlow.java:83)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.getOrCreateMethodFlowsGraph(MethodTypeFlow.java:65)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.typestate.DefaultStaticInvokeTypeFlow.update(DefaultStaticInvokeTypeFlow.java:64)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.PointsToAnalysis$1.run(PointsToAnalysis.java:488)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:193)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:177)
        at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: org.graalvm.compiler.java.BytecodeParser$BytecodeParserError: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: io.netty.util.internal.logging.Log4J2Logger. This error is reported at image build time because class io.netty.util.internal.logging.Log4J2LoggerFactory is registered for linking at image build time by command line
        at parsing io.netty.util.internal.logging.Log4J2LoggerFactory.newInstance(Log4J2LoggerFactory.java:33)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.throwParserError(BytecodeParser.java:2518)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.throwParserError(SharedGraphBuilderPhase.java:110)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3393)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.handleBytecodeBlock(BytecodeParser.java:3345)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3190)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1138)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:1030)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:97)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase.run(SharedGraphBuilderPhase.java:84)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:446)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.AnalysisParsedGraph.parseBytecode(AnalysisParsedGraph.java:135)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsed(AnalysisMethod.java:685)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysisGraphDecoder.lookupEncodedGraph(InlineBeforeAnalysis.java:180)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.doInline(PEGraphDecoder.java:1162)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.tryInline(PEGraphDecoder.java:1145)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.trySimplifyInvoke(PEGraphDecoder.java:1003)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.handleInvoke(PEGraphDecoder.java:957)
        at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.GraphDecoder.processNextNode(GraphDecoder.java:817)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysisGraphDecoder.processNextNode(InlineBeforeAnalysis.java:240)
        at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.GraphDecoder.decode(GraphDecoder.java:548)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.decode(PEGraphDecoder.java:833)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysis.decodeGraph(InlineBeforeAnalysis.java:98)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:179)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:349)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:93)
        ... 12 more
Caused by: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: io.netty.util.internal.logging.Log4J2Logger. This error is reported at image build time because class io.netty.util.internal.logging.Log4J2LoggerFactory is registered for linking at image build time by command line
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.reportUnresolvedElement(SharedGraphBuilderPhase.java:333)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.handleUnresolvedType(SharedGraphBuilderPhase.java:288)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.handleUnresolvedNewInstance(SharedGraphBuilderPhase.java:204)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genNewInstance(BytecodeParser.java:4501)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genNewInstance(BytecodeParser.java:4494)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5291)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3385)------------------------------------------------------------------------------------------------------------------------

Fatal error: com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing io.netty.util.internal.logging.InternalLoggerFactory.newDefaultFactory(java.lang.String)
Parsing context:
   at io.netty.util.internal.logging.InternalLoggerFactory.newDefaultFactory(InternalLoggerFactory.java:42)
   at io.netty.util.internal.logging.InternalLoggerFactory.getDefaultFactory(InternalLoggerFactory.java:111)
   at io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:134)
   at io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:127)
   at io.netty.buffer.ByteBufUtil.<clinit>(ByteBufUtil.java:59)

        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.AnalysisError.parsingError(AnalysisError.java:153)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:104)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureFlowsGraphCreated(MethodTypeFlow.java:83)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.getOrCreateMethodFlowsGraph(MethodTypeFlow.java:65)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.typestate.DefaultStaticInvokeTypeFlow.update(DefaultStaticInvokeTypeFlow.java:64)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.PointsToAnalysis$1.run(PointsToAnalysis.java:488)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:193)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:177)
        at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: org.graalvm.compiler.java.BytecodeParser$BytecodeParserError: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: io.netty.util.internal.logging.Log4J2Logger. This error is reported at image build time because class io.netty.util.internal.logging.Log4J2LoggerFactory is registered for linking at image build time by command line
        at parsing io.netty.util.internal.logging.Log4J2LoggerFactory.newInstance(Log4J2LoggerFactory.java:33)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.throwParserError(BytecodeParser.java:2518)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.throwParserError(SharedGraphBuilderPhase.java:110)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3393)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.handleBytecodeBlock(BytecodeParser.java:3345)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3190)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1138)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:1030)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:97)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase.run(SharedGraphBuilderPhase.java:84)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:446)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.AnalysisParsedGraph.parseBytecode(AnalysisParsedGraph.java:135)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsed(AnalysisMethod.java:685)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysisGraphDecoder.lookupEncodedGraph(InlineBeforeAnalysis.java:180)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.doInline(PEGraphDecoder.java:1162)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.tryInline(PEGraphDecoder.java:1145)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.trySimplifyInvoke(PEGraphDecoder.java:1003)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.handleInvoke(PEGraphDecoder.java:957)
        at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.GraphDecoder.processNextNode(GraphDecoder.java:817)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysisGraphDecoder.processNextNode(InlineBeforeAnalysis.java:240)
        at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.GraphDecoder.decode(GraphDecoder.java:548)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.decode(PEGraphDecoder.java:833)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysis.decodeGraph(InlineBeforeAnalysis.java:98)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:179)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:349)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:93)
        ... 12 more
Caused by: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: io.netty.util.internal.logging.Log4J2Logger. This error is reported at image build time because class io.netty.util.internal.logging.Log4J2LoggerFactory is registered for linking at image build time by command line
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.reportUnresolvedElement(SharedGraphBuilderPhase.java:333)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.handleUnresolvedType(SharedGraphBuilderPhase.java:288)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.handleUnresolvedNewInstance(SharedGraphBuilderPhase.java:204)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genNewInstance(BytecodeParser.java:4501)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genNewInstance(BytecodeParser.java:4494)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5291)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3385)------------------------------------------------------------------------------------------------------------------------
```

Body:
I am trying to create a native image with a simple Kafka stream and since a while ago, I got an ugly WARN exception and later on a FATAL exception.

I tested out in a Quarkus 2.13, 2.14 and 2.15 with the same output.

The FATAL exception stops the compiling process and aborts the build sequence.

I'd appreciate any comment.

Cheers

    20:05:16,775 WARN  [org.apa.kaf.str.int.met.ClientMetrics] Error while loading kafka-streams-version.properties: java.lang.NullPointerException: inStream parameter is null
        at java.base/java.util.Objects.requireNonNull(Objects.java:233)
        at java.base/java.util.Properties.load(Properties.java:407)
        at org.apache.kafka.streams.internals.metrics.ClientMetrics.<clinit>(ClientMetrics.java:53)
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1155)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.ensureClassInitialized(ClassInitializationSupport.java:172)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ProvenSafeClassInitializationSupport.computeInitKindAndMaybeInitializeClass(ProvenSafeClassInitializationSupport.java:344)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ProvenSafeClassInitializationSupport.computeInitKindAndMaybeInitializeClass(ProvenSafeClassInitializationSupport.java:75)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.shouldInitializeAtRuntime(ClassInitializationSupport.java:148)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.SVMHost.isInitialized(SVMHost.java:297)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisType.isInitialized(AnalysisType.java:882)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.maybeEagerlyInitialize(BytecodeParser.java:4304)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeStatic(BytecodeParser.java:1658)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeStatic(BytecodeParser.java:1651)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5288)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3385)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.handleBytecodeBlock(BytecodeParser.java:3345)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3190)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1138)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:1030)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:97)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase.run(SharedGraphBuilderPhase.java:84)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:446)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.AnalysisParsedGraph.parseBytecode(AnalysisParsedGraph.java:135)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsed(AnalysisMethod.java:685)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysisGraphDecoder.lookupEncodedGraph(InlineBeforeAnalysis.java:180)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.doInline(PEGraphDecoder.java:1162)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.tryInline(PEGraphDecoder.java:1145)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.trySimplifyInvoke(PEGraphDecoder.java:1003)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.handleInvoke(PEGraphDecoder.java:957)
        at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.GraphDecoder.processNextNode(GraphDecoder.java:817)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysisGraphDecoder.processNextNode(InlineBeforeAnalysis.java:240)
        at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.GraphDecoder.decode(GraphDecoder.java:548)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.decode(PEGraphDecoder.java:833)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysis.decodeGraph(InlineBeforeAnalysis.java:98)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:179)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:349)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:93)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureFlowsGraphCreated(MethodTypeFlow.java:83)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.getOrCreateMethodFlowsGraph(MethodTypeFlow.java:65)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.typestate.DefaultSpecialInvokeTypeFlow.onObservedUpdate(DefaultSpecialInvokeTypeFlow.java:61)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.TypeFlow.update(TypeFlow.java:562)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.PointsToAnalysis$1.run(PointsToAnalysis.java:488)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:193)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:177)
        at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

[2/7] Performing analysis...  [*]                                                                       (69.4s @ 1.08GB)
  10,902 (86.72%) of 12,571 classes reachable
  15,935 (61.59%) of 25,872 fields reachable
  53,386 (56.93%) of 93,767 methods reachable
     388 classes,   112 fields, and 1,887 methods registered for reflection

Fatal error: com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing io.netty.util.internal.logging.InternalLoggerFactory.newDefaultFactory(java.lang.String)
Parsing context:
   at io.netty.util.internal.logging.InternalLoggerFactory.newDefaultFactory(InternalLoggerFactory.java:42)
   at io.netty.util.internal.logging.InternalLoggerFactory.getDefaultFactory(InternalLoggerFactory.java:111)
   at io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:134)
   at io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:127)
   at io.netty.buffer.ByteBufUtil.<clinit>(ByteBufUtil.java:59)

        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.AnalysisError.parsingError(AnalysisError.java:153)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:104)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureFlowsGraphCreated(MethodTypeFlow.java:83)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.getOrCreateMethodFlowsGraph(MethodTypeFlow.java:65)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.typestate.DefaultStaticInvokeTypeFlow.update(DefaultStaticInvokeTypeFlow.java:64)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.PointsToAnalysis$1.run(PointsToAnalysis.java:488)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:193)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:177)
        at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: org.graalvm.compiler.java.BytecodeParser$BytecodeParserError: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: io.netty.util.internal.logging.Log4J2Logger. This error is reported at image build time because class io.netty.util.internal.logging.Log4J2LoggerFactory is registered for linking at image build time by command line
        at parsing io.netty.util.internal.logging.Log4J2LoggerFactory.newInstance(Log4J2LoggerFactory.java:33)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.throwParserError(BytecodeParser.java:2518)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.throwParserError(SharedGraphBuilderPhase.java:110)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3393)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.handleBytecodeBlock(BytecodeParser.java:3345)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3190)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1138)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:1030)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:97)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase.run(SharedGraphBuilderPhase.java:84)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:446)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.AnalysisParsedGraph.parseBytecode(AnalysisParsedGraph.java:135)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsed(AnalysisMethod.java:685)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysisGraphDecoder.lookupEncodedGraph(InlineBeforeAnalysis.java:180)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.doInline(PEGraphDecoder.java:1162)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.tryInline(PEGraphDecoder.java:1145)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.trySimplifyInvoke(PEGraphDecoder.java:1003)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.handleInvoke(PEGraphDecoder.java:957)
        at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.GraphDecoder.processNextNode(GraphDecoder.java:817)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysisGraphDecoder.processNextNode(InlineBeforeAnalysis.java:240)
        at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.GraphDecoder.decode(GraphDecoder.java:548)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.decode(PEGraphDecoder.java:833)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysis.decodeGraph(InlineBeforeAnalysis.java:98)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:179)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:349)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:93)
        ... 12 more
Caused by: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: io.netty.util.internal.logging.Log4J2Logger. This error is reported at image build time because class io.netty.util.internal.logging.Log4J2LoggerFactory is registered for linking at image build time by command line
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.reportUnresolvedElement(SharedGraphBuilderPhase.java:333)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.handleUnresolvedType(SharedGraphBuilderPhase.java:288)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.handleUnresolvedNewInstance(SharedGraphBuilderPhase.java:204)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genNewInstance(BytecodeParser.java:4501)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genNewInstance(BytecodeParser.java:4494)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5291)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3385)------------------------------------------------------------------------------------------------------------------------

Fatal error: com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing io.netty.util.internal.logging.InternalLoggerFactory.newDefaultFactory(java.lang.String)
Parsing context:
   at io.netty.util.internal.logging.InternalLoggerFactory.newDefaultFactory(InternalLoggerFactory.java:42)
   at io.netty.util.internal.logging.InternalLoggerFactory.getDefaultFactory(InternalLoggerFactory.java:111)
   at io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:134)
   at io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:127)
   at io.netty.buffer.ByteBufUtil.<clinit>(ByteBufUtil.java:59)

        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.AnalysisError.parsingError(AnalysisError.java:153)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:104)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureFlowsGraphCreated(MethodTypeFlow.java:83)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.getOrCreateMethodFlowsGraph(MethodTypeFlow.java:65)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.typestate.DefaultStaticInvokeTypeFlow.update(DefaultStaticInvokeTypeFlow.java:64)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.PointsToAnalysis$1.run(PointsToAnalysis.java:488)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:193)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:177)
        at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: org.graalvm.compiler.java.BytecodeParser$BytecodeParserError: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: io.netty.util.internal.logging.Log4J2Logger. This error is reported at image build time because class io.netty.util.internal.logging.Log4J2LoggerFactory is registered for linking at image build time by command line
        at parsing io.netty.util.internal.logging.Log4J2LoggerFactory.newInstance(Log4J2LoggerFactory.java:33)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.throwParserError(BytecodeParser.java:2518)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.throwParserError(SharedGraphBuilderPhase.java:110)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3393)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.handleBytecodeBlock(BytecodeParser.java:3345)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3190)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1138)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:1030)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:97)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase.run(SharedGraphBuilderPhase.java:84)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:446)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.AnalysisParsedGraph.parseBytecode(AnalysisParsedGraph.java:135)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsed(AnalysisMethod.java:685)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysisGraphDecoder.lookupEncodedGraph(InlineBeforeAnalysis.java:180)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.doInline(PEGraphDecoder.java:1162)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.tryInline(PEGraphDecoder.java:1145)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.trySimplifyInvoke(PEGraphDecoder.java:1003)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.handleInvoke(PEGraphDecoder.java:957)
        at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.GraphDecoder.processNextNode(GraphDecoder.java:817)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysisGraphDecoder.processNextNode(InlineBeforeAnalysis.java:240)
        at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.GraphDecoder.decode(GraphDecoder.java:548)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.decode(PEGraphDecoder.java:833)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysis.decodeGraph(InlineBeforeAnalysis.java:98)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:179)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:349)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:93)
        ... 12 more
Caused by: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: io.netty.util.internal.logging.Log4J2Logger. This error is reported at image build time because class io.netty.util.internal.logging.Log4J2LoggerFactory is registered for linking at image build time by command line
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.reportUnresolvedElement(SharedGraphBuilderPhase.java:333)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.handleUnresolvedType(SharedGraphBuilderPhase.java:288)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.handleUnresolvedNewInstance(SharedGraphBuilderPhase.java:204)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genNewInstance(BytecodeParser.java:4501)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genNewInstance(BytecodeParser.java:4494)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5291)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3385)------------------------------------------------------------------------------------------------------------------------


来源: stackexchange

问:
Getting timeout on trying to create new react project
I am trying to create a new react project, I tried using both npm and yarn but I am getting a server timeout error in both cases. I also tried reinstalling node but that didn't help. I also tried resetting registry but even that didn't help. This is my error:

```<code>Trace:
  Error: https://registry.npmjs.org/create-react-app: ETIMEDOUT
      at Timeout._onTimeout (/usr/share/yarn/lib/cli.js:141550:19)
      at listOnTimeout (node:internal/timers:559:17)
      at processTimers (node:internal/timers:502:7)
</code>```

How should I solve this?

ContentLicense: CC BY-SA 4.0

Body:
I am trying to create a new react project, I tried using both npm and yarn but I am getting a server timeout error in both cases. I also tried reinstalling node but that didn't help. I also tried resetting registry but even that didn't help. This is my error:

Trace:
  Error: https://registry.npmjs.org/create-react-app: ETIMEDOUT
      at Timeout._onTimeout (/usr/share/yarn/lib/cli.js:141550:19)
      at listOnTimeout (node:internal/timers:559:17)
      at processTimers (node:internal/timers:502:7)

How should I solve this?


问:
How can I avoid the following race condition using condition variables?
I have a recipe of several steps where each steps may or may not control a motor. For this, I created a thread that sends a command to the motor. I used to join that thread, as each steps needed to complete before going to the next one, but recently, I have a task of implementing a "Go to next step". The problem is that I cannot simply stop the motor upon clicking that button. The motor should only stop if the next step contains another movement. If that next step didn't move the motor, we wouldn't want to stop the motor.

For this, I created two variables, one that is set to true if the motor thread finished his movement, another that is set to true if a signal to go to the next step is received :

```<code>#include <condition_variable>
#include <iostream>
#include <mutex>
#include <thread>

std::mutex m;
std::condition_variable cv;
bool signalReceived = false;
bool threadFinished = false;

void moveMotor() {
    // If current step moves motor, stop any ongoing movement
    // ...
    // If current step moves motor, move the motor
    // ...

    // Set the threadFinished flag to true when the thread finishes
    std::lock_guard<std::mutex> lock(m);
    threadFinished = true;
    signalReceived = false;
    cv.notify_one();
}

void signalHandler() {
    std::lock_guard<std::mutex> lock(m);
    signalReceived = true;
    cv.notify_one();
}

int main() {
    while (true) {
        std::thread motorThread(moveMotor);
        motorThread.detach();

        std::unique_lock<std::mutex> lock(m);
        cv.wait(lock, [] { return threadFinished || signalReceived; });

        if (threadFinished) {
            std::cout << "The motor thread has finished." << std::endl;
        }
        if (signalReceived) {
            std::cout << "A signal was received." << std::endl;
        }

        // Reset the flags for the next iteration
        threadFinished = false;
        signalReceived = false;
    }

    return 0;
}
</code>```

I unfortunately have an issue with the above code. Let's have the following example :

In the first iteration (first step for example), a signal is emitted, and therefor, the main continues on to the second iteration .

In the second iteration , upon detaching the second thread, the first iteration thread finally finishes, setting the threadFinished variable to true. The second iteration will continue as if the second thread finished, which is not what I want.

How can I fix this?

Body:
I have a recipe of several steps where each steps may or may not control a motor. For this, I created a thread that sends a command to the motor. I used to join that thread, as each steps needed to complete before going to the next one, but recently, I have a task of implementing a "Go to next step". The problem is that I cannot simply stop the motor upon clicking that button. The motor should only stop if the next step contains another movement. If that next step didn't move the motor, we wouldn't want to stop the motor.

For this, I created two variables, one that is set to true if the motor thread finished his movement, another that is set to true if a signal to go to the next step is received :

#include <condition_variable>
#include <iostream>
#include <mutex>
#include <thread>

std::mutex m;
std::condition_variable cv;
bool signalReceived = false;
bool threadFinished = false;

void moveMotor() {
    // If current step moves motor, stop any ongoing movement
    // ...
    // If current step moves motor, move the motor
    // ...

    // Set the threadFinished flag to true when the thread finishes
    std::lock_guard<std::mutex> lock(m);
    threadFinished = true;
    signalReceived = false;
    cv.notify_one();
}

void signalHandler() {
    std::lock_guard<std::mutex> lock(m);
    signalReceived = true;
    cv.notify_one();
}

int main() {
    while (true) {
        std::thread motorThread(moveMotor);
        motorThread.detach();

        std::unique_lock<std::mutex> lock(m);
        cv.wait(lock, [] { return threadFinished || signalReceived; });

        if (threadFinished) {
            std::cout << "The motor thread has finished." << std::endl;
        }
        if (signalReceived) {
            std::cout << "A signal was received." << std::endl;
        }

        // Reset the flags for the next iteration
        threadFinished = false;
        signalReceived = false;
    }

    return 0;
}

I unfortunately have an issue with the above code. Let's have the following example :

In the first iteration (first step for example), a signal is emitted, and therefor, the main continues on to the second iteration .

In the second iteration , upon detaching the second thread, the first iteration thread finally finishes, setting the threadFinished variable to true. The second iteration will continue as if the second thread finished, which is not what I want.

How can I fix this?


问:
Apache block requests to non-existent CMS
I review my Apache access logs every so often.

I always see requests to CMS services that I don't use (e.g. WordPress). Logically, the requests are from bots and bad actors since users can't navigate to these pages (due to the CMS not being used or installed). While my website is not vulnerable to any of the vulnerabilities the bots try to use, it gets really annoying to have a single bot request pages every second for 5 minutes searching for vulnerabilities.

I've installed mod_evasive though that is for DoS protection. Is there a way to simply blacklist any IPs that request URLs from CMSs like WordPress?

Ideally, I would also like to change the log entry for requests by blacklisted IPs by adding a custom bit of text (e.g. (BANNED) at the end of the first line), though I can do without.

My current log format is %t %h to %V \"%r\" %>s %BB \"%{Referer}i\"\n\"%{User-Agent}i\"\n


问:
Custom Redirect to Page With URL Parameters Using Elementor
I'm trying to redirect to another page with url parameters using Elementor form redirect action.

```<code>add_action( 'elementor_pro/forms/new_record', function( $record, $ajax_handler ) {

        //make sure its our form
    $form_name = $record->get_form_settings( 'form_name' );

    // Replace MY_FORM_NAME with the name you gave your form
    if ( 'test_form' !== $form_name ) {
        return;
    }

    $raw_fields = $record->get( 'fields' );
    $fields = [];
    foreach ( $raw_fields as $id => $field ) {
        $fields[ $id ] = $field['value'];
    }

  global $wpdb, $post;

// Get Current Url Slug
 $post_slug = $post->post_name;

//redirect URL to be setup

$redirect_url = '/test2/'.$post_slug.'?f_name='.$fields['f_name'];

//add to record the redirect URL
$redirect_to = $record->replace_setting_shortcodes( $redirect_url );

// Set redirect action to handler
$handler->add_response_data( 'redirect_url', $redirect_to );

}, 10, 2);
</code>```

It when trying to submit the form it shows an error message of "error" and in the debug log it shows "PHP Fatal error:  Uncaught Error: Call to a member function add_response_data() on null"

I tried this code

```<code>add_action( 'elementor_pro/forms/new_record', function( $record, $ajax_handler ) {

        //make sure its our form
    $form_name = $record->get_form_settings( 'form_name' );

    // Replace MY_FORM_NAME with the name you gave your form
    if ( 'test_form' !== $form_name ) {
        return;
    }

    $raw_fields = $record->get( 'fields' );
    $fields = [];
    foreach ( $raw_fields as $id => $field ) {
        $fields[ $id ] = $field['value'];
    }

  global $wpdb, $post;

// Get Current Url Slug
 $post_slug = $post->post_name;

//redirect URL to be setup

$redirect_url = '/test2/'.$post_slug.'?f_name='.$fields['f_name'];

//add to record the redirect URL
$redirect_to = $record->replace_setting_shortcodes( $redirect_url );

// Set redirect action to handler
$handler->add_response_data( 'redirect_url', $redirect_to );

}, 10, 2);
</code>```

And I was expecting after the submission of the form to be redirected to http://example.com/test2/post-slug?f_name=test

Body:
I'm trying to redirect to another page with url parameters using Elementor form redirect action.

add_action( 'elementor_pro/forms/new_record', function( $record, $ajax_handler ) {

        //make sure its our form
    $form_name = $record->get_form_settings( 'form_name' );

    // Replace MY_FORM_NAME with the name you gave your form
    if ( 'test_form' !== $form_name ) {
        return;
    }

    $raw_fields = $record->get( 'fields' );
    $fields = [];
    foreach ( $raw_fields as $id => $field ) {
        $fields[ $id ] = $field['value'];
    }

  global $wpdb, $post;

// Get Current Url Slug
 $post_slug = $post->post_name;

//redirect URL to be setup

$redirect_url = '/test2/'.$post_slug.'?f_name='.$fields['f_name'];

//add to record the redirect URL
$redirect_to = $record->replace_setting_shortcodes( $redirect_url );

// Set redirect action to handler
$handler->add_response_data( 'redirect_url', $redirect_to );

}, 10, 2);

It when trying to submit the form it shows an error message of "error" and in the debug log it shows "PHP Fatal error:  Uncaught Error: Call to a member function add_response_data() on null"

I tried this code

add_action( 'elementor_pro/forms/new_record', function( $record, $ajax_handler ) {

        //make sure its our form
    $form_name = $record->get_form_settings( 'form_name' );

    // Replace MY_FORM_NAME with the name you gave your form
    if ( 'test_form' !== $form_name ) {
        return;
    }

    $raw_fields = $record->get( 'fields' );
    $fields = [];
    foreach ( $raw_fields as $id => $field ) {
        $fields[ $id ] = $field['value'];
    }

  global $wpdb, $post;

// Get Current Url Slug
 $post_slug = $post->post_name;

//redirect URL to be setup

$redirect_url = '/test2/'.$post_slug.'?f_name='.$fields['f_name'];

//add to record the redirect URL
$redirect_to = $record->replace_setting_shortcodes( $redirect_url );

// Set redirect action to handler
$handler->add_response_data( 'redirect_url', $redirect_to );

}, 10, 2);

And I was expecting after the submission of the form to be redirected to http://example.com/test2/post-slug?f_name=test


问:
Logging metrics for go grpc server
This is kindof an extension of my previous question Reuse log client in interceptor for Golang grpc server method.

Basically I have a grpc server (written in Go) that exposes three APIs:

SubmitJob

CancelJob

GetJobStatus

I am using Datadog to log metrics, so in each API, I have code like:

```<code>func (s *myServer) submitJob(ctx context.Context, request *submitJobRequest) (*submitJobResponse, error) {
    s.dd_client.LogRequestCount("SubmitJob")
    start_time := time.Now()
    defer s.dd_client.LogRequestDuration("SubmitJob", time.Since(start_time))

    sth, err:= someFunc1()
    if err != nil {
        s.dd_client.LogErrorCount("SubmitJob")
        return nil, err
    }

    resp, err:= someFunc2(sth)
    if err != nil {
        s.dd_client.LogErrorCount("SubmitJob")
        return nil, err
    }

    return resp, nil
}
</code>```

This approach works but have several problems:

The LogRequestCount and LogRequestDuration is duplicated among all APIs

I am calling LogErrorCount in every places where errors are returned, which seems ugly

I learned that interceptor might help with logging, so I wrote an interceptor like

```<code>func (s *myServer) UnaryInterceptor(ctx context.Context,
    request interface{},
    info *grpc.UnaryServerInfo,
    handler grpc.UnaryHandler,
) (interface{}, error) {
    // Get method name e.g. SubmitJob, CancelJob, GetJobStatus
    tmp := strings.Split(info.FullMethod, "/")
    method := tmp[len(tmp)-1]

    s.dd_client.LogRequestCount(method)

    start_time := time.Now()
    resp, err := handler(ctx, request)
    server.dd_client.LogRequestDuration(method)

    if err != nil {
    s.dd_client.LogErrorCount(method)
    }

    return response, err
}
</code>```

And set it in main() function:

```<code>server := grpc.NewServer(grpc.UnaryInterceptor(my_server.UnaryInterceptor))
</code>```

This works for me, but I noticed two problems:

Here the interceptor takes myServer as a receiver, is this a good practice? I am doing this coz I want to reuse the Datadog client (dd_client) created within myServer. Other options would be create the Datadog client singleton which used by both interceptor and myServer, or create a interceptor struct and create a separate Datadog client there.

The interceptor could only handle logging for generic metrics e.g. request count, duration. But there could be metrics specific for each API, which means I still need to have logging related code in each API implementation. Then the question is, should I still use interceptor? Coz now the logging related code are splitted into two places (API implementation and interceptor).

Title: Logging metrics for go grpc server

Body:
This is kindof an extension of my previous question Reuse log client in interceptor for Golang grpc server method.

Basically I have a grpc server (written in Go) that exposes three APIs:

SubmitJob

CancelJob

GetJobStatus

I am using Datadog to log metrics, so in each API, I have code like:

func (s *myServer) submitJob(ctx context.Context, request *submitJobRequest) (*submitJobResponse, error) {
    s.dd_client.LogRequestCount("SubmitJob")
    start_time := time.Now()
    defer s.dd_client.LogRequestDuration("SubmitJob", time.Since(start_time))

    sth, err:= someFunc1()
    if err != nil {
        s.dd_client.LogErrorCount("SubmitJob")
        return nil, err
    }

    resp, err:= someFunc2(sth)
    if err != nil {
        s.dd_client.LogErrorCount("SubmitJob")
        return nil, err
    }

    return resp, nil
}

This approach works but have several problems:

The LogRequestCount and LogRequestDuration is duplicated among all APIs

I am calling LogErrorCount in every places where errors are returned, which seems ugly

I learned that interceptor might help with logging, so I wrote an interceptor like

func (s *myServer) UnaryInterceptor(ctx context.Context,
    request interface{},
    info *grpc.UnaryServerInfo,
    handler grpc.UnaryHandler,
) (interface{}, error) {
    // Get method name e.g. SubmitJob, CancelJob, GetJobStatus
    tmp := strings.Split(info.FullMethod, "/")
    method := tmp[len(tmp)-1]

    s.dd_client.LogRequestCount(method)

    start_time := time.Now()
    resp, err := handler(ctx, request)
    server.dd_client.LogRequestDuration(method)

    if err != nil {
    s.dd_client.LogErrorCount(method)
    }

    return response, err
}

And set it in main() function:

server := grpc.NewServer(grpc.UnaryInterceptor(my_server.UnaryInterceptor))

This works for me, but I noticed two problems:

Here the interceptor takes myServer as a receiver, is this a good practice? I am doing this coz I want to reuse the Datadog client (dd_client) created within myServer. Other options would be create the Datadog client singleton which used by both interceptor and myServer, or create a interceptor struct and create a separate Datadog client there.

The interceptor could only handle logging for generic metrics e.g. request count, duration. But there could be metrics specific for each API, which means I still need to have logging related code in each API implementation. Then the question is, should I still use interceptor? Coz now the logging related code are splitted into two places (API implementation and interceptor).


问:
How to embed TradingView Trade Idea in Next.js/React
How to embed this kind of chart in next.js?

https://www.tradingview.com/chart/TRXUSDT/PUz8xQst-Tron-TRX-price-at-the-start-of-a-strong-trend-move/


问:
java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/asynclayoutinflater/view/AsyncLayoutInflater; android studio
This error is thrown when I try to run my automotive application in android studio.

It also gives the following error:

```<code>Caused by: java.lang.ClassNotFoundException: Didn't find class
"androidx.asynclayoutinflater.view.AsyncLayoutInflater" on path:
DexPathList[[zip file "/data/app/com.example.mycarapplication-lVN5UU1ZLpkjCRu9JNCF9w==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.mycarapplication-lVN5UU1ZLpkjCRu9JNCF9w==/lib/x86_64, /system/lib64]]
</code>```

How can I solve this error?

My build.gradle file (app level) is:

```<code>plugins {
    id 'com.android.application'
}

android {
    compileSdk 32

    defaultConfig {
        applicationId "com.example.mycarapplication"
        minSdk 29
        targetSdk 32
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {

    implementation 'com.android.car.ui:car-ui-lib:2.3.0'
    //implementation 'androidx.core:core:1.5.0-alpha04'

    implementation 'androidx.appcompat:appcompat:1.5.1'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.4'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
}
</code>```

My build.gradle file (project level) is:

```<code>plugins {
    id 'com.android.application' version '7.2.1' apply false
    id 'com.android.library' version '7.2.1' apply false
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
</code>```

And my gradle.properties is:

```<code>org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
android.useAndroidX=true
android.nonTransitiveRClass=true
</code>```

Body:
This error is thrown when I try to run my automotive application in android studio.

It also gives the following error:

Caused by: java.lang.ClassNotFoundException: Didn't find class
"androidx.asynclayoutinflater.view.AsyncLayoutInflater" on path:
DexPathList[[zip file "/data/app/com.example.mycarapplication-lVN5UU1ZLpkjCRu9JNCF9w==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.mycarapplication-lVN5UU1ZLpkjCRu9JNCF9w==/lib/x86_64, /system/lib64]]

How can I solve this error?

My build.gradle file (app level) is:

plugins {
    id 'com.android.application'
}

android {
    compileSdk 32

    defaultConfig {
        applicationId "com.example.mycarapplication"
        minSdk 29
        targetSdk 32
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {

    implementation 'com.android.car.ui:car-ui-lib:2.3.0'
    //implementation 'androidx.core:core:1.5.0-alpha04'

    implementation 'androidx.appcompat:appcompat:1.5.1'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.4'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
}

My build.gradle file (project level) is:

plugins {
    id 'com.android.application' version '7.2.1' apply false
    id 'com.android.library' version '7.2.1' apply false
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

And my gradle.properties is:

org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
android.useAndroidX=true
android.nonTransitiveRClass=true


问:
Reading value from HC SR04 in LM016L
I'm programming STM32F103C6, and I'm using Keil Microvision with Proteus Professional 8, I have problem with reading value from HC SR04 Ultrasonic sensor in LCD(LM016L), the code is below

```<code>#define TRIG_PIN GPIO_PIN_9
#define TRIG_PORT GPIOA
#define ECHO_PIN GPIO_PIN_8
#define ECHO_PORT GPIOA
uint32_t pMillis;
uint32_t Value1 = 0;
uint32_t Value2 = 0;
uint16_t Distance  = 0;  // cm
uint16_t temp  = 50;
/* USER CODE END PV */

  /* USER CODE BEGIN 2 */
  HAL_TIM_Base_Start(&htim1);
  HAL_GPIO_WritePin(TRIG_PORT, TRIG_PIN, GPIO_PIN_RESET);  // pull the TRIG pin low
  /* USER CODE END 2 */
    lcd_init();
  char buffer[24];
  while (1)
  {
    HAL_GPIO_WritePin(TRIG_PORT, TRIG_PIN, GPIO_PIN_SET);  // pull the TRIG pin HIGH
    __HAL_TIM_SET_COUNTER(&htim1, 0);
    while (__HAL_TIM_GET_COUNTER (&htim1) < 10);  // wait for 10 us
    HAL_GPIO_WritePin(TRIG_PORT, TRIG_PIN, GPIO_PIN_RESET);  // pull the TRIG pin low

    pMillis = HAL_GetTick(); // used this to avoid infinite while loop  (for timeout)
    // wait for the echo pin to go high
    while (!(HAL_GPIO_ReadPin (ECHO_PORT, ECHO_PIN)) && pMillis + 10 >  HAL_GetTick());
    Value1 = __HAL_TIM_GET_COUNTER (&htim1);

    pMillis = HAL_GetTick(); // used this to avoid infinite while loop (for timeout)
    // wait for the echo pin to go low
    while ((HAL_GPIO_ReadPin (ECHO_PORT, ECHO_PIN)) && pMillis + 50 > HAL_GetTick());
    Value2 = __HAL_TIM_GET_COUNTER (&htim1);

    Distance = (Value2-Value1)* 0.034/2;

        sprintf(buffer, "%u\n", Distance);
lcd_puts(0,0, (int8_t*)(buffer));
        HAL_Delay(50);
  }
}
</code>```

I think I got some value 10* -300, does anyone has idea how to read it or another code

Title: Reading value from HC SR04 in LM016L

Body:
I'm programming STM32F103C6, and I'm using Keil Microvision with Proteus Professional 8, I have problem with reading value from HC SR04 Ultrasonic sensor in LCD(LM016L), the code is below

#define TRIG_PIN GPIO_PIN_9
#define TRIG_PORT GPIOA
#define ECHO_PIN GPIO_PIN_8
#define ECHO_PORT GPIOA
uint32_t pMillis;
uint32_t Value1 = 0;
uint32_t Value2 = 0;
uint16_t Distance  = 0;  // cm
uint16_t temp  = 50;
/* USER CODE END PV */

  /* USER CODE BEGIN 2 */
  HAL_TIM_Base_Start(&htim1);
  HAL_GPIO_WritePin(TRIG_PORT, TRIG_PIN, GPIO_PIN_RESET);  // pull the TRIG pin low
  /* USER CODE END 2 */
    lcd_init();
  char buffer[24];
  while (1)
  {
    HAL_GPIO_WritePin(TRIG_PORT, TRIG_PIN, GPIO_PIN_SET);  // pull the TRIG pin HIGH
    __HAL_TIM_SET_COUNTER(&htim1, 0);
    while (__HAL_TIM_GET_COUNTER (&htim1) < 10);  // wait for 10 us
    HAL_GPIO_WritePin(TRIG_PORT, TRIG_PIN, GPIO_PIN_RESET);  // pull the TRIG pin low

    pMillis = HAL_GetTick(); // used this to avoid infinite while loop  (for timeout)
    // wait for the echo pin to go high
    while (!(HAL_GPIO_ReadPin (ECHO_PORT, ECHO_PIN)) && pMillis + 10 >  HAL_GetTick());
    Value1 = __HAL_TIM_GET_COUNTER (&htim1);

    pMillis = HAL_GetTick(); // used this to avoid infinite while loop (for timeout)
    // wait for the echo pin to go low
    while ((HAL_GPIO_ReadPin (ECHO_PORT, ECHO_PIN)) && pMillis + 50 > HAL_GetTick());
    Value2 = __HAL_TIM_GET_COUNTER (&htim1);

    Distance = (Value2-Value1)* 0.034/2;

        sprintf(buffer, "%u\n", Distance);
lcd_puts(0,0, (int8_t*)(buffer));
        HAL_Delay(50);
  }
}

I think I got some value 10* -300, does anyone has idea how to read it or another code


问:
Run an NPM script inside every package in an NX project's library
I'm using NX to manage a React design system mono-repo. I want to create my components within an NX Library and am currently looking into creating a Node package which will run the CSS for each component through PostCSS to get it production ready.

I've tested my PostCSS Node package in isolation and I know it's doing what I need it to to the files, however I'm having trouble working out how to configure the NX repo to run an NPM script in each component's package.json. A component such as my Button component has a package.json like so:

{
  "name": "css-components-button",
  "version": "0.1.0",
  "main": "index.js",
  "license": "MIT",
  "scripts": {
    "prepack": "tools-postcss 'lib/**/*.css' dist/"
  },
  "dependencies": {
    "tools-postcss": "file:.yalc/tools-postcss"
  }
}```
</div>
</div>
</p>
<p>In the CSS Components Library the <code>project.json</code> file looks like this:</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>{
  "name": "css-components",
  "sourceRoot": "libs/css-components/src",
  "projectType": "library",
  "tags": [],
  "targets": {
    "lint": {
      "executor": "@nrwl/linter:eslint",
      "outputs": ["{options.outputFile}"],
      "options": {
        "lintFilePatterns": ["libs/css-components/**/*.{ts,tsx,js,jsx}"]
      }
    },
    "build": {
      "executor": "@nrwl/rollup:rollup",
      "outputs": ["{options.outputPath}"],
      "options": {
        "outputPath": "dist/libs/css-components",
        "tsConfig": "libs/css-components/tsconfig.lib.json",
        "project": "libs/css-components/package.json",
        "entryFile": "libs/css-components/src/index.ts",
        "external": ["react/jsx-runtime"],
        "rollupConfig": "@nrwl/react/plugins/bundle-rollup",
        "compiler": "babel",
        "assets": [
          {
            "glob": "libs/css-components/README.md",
            "input": ".",
            "output": "."
          }
        ]
      }
    },
    "test": {
      "executor": "@nrwl/jest:jest",
      "outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
      "options": {
        "jestConfig": "libs/css-components/jest.config.ts",
        "passWithNoTests": true
      }
    },
    "prepack": {
      "executor": "@nrwl/workspace:run-script",
      "options": {
        "script": "prepack"
      }
    }
  }
}</code>```

In particular I've added a "prepack" custom target which I'm trying to use to run a "prepack" NPM script in each component's package.json. Currently when I run nx run css-components:prepack in the Terminal I get **error Command "prepack" not found.**

Would really appreciate some help with this. Any ideas?

Body:
I'm using NX to manage a React design system mono-repo. I want to create my components within an NX Library and am currently looking into creating a Node package which will run the CSS for each component through PostCSS to get it production ready.

I've tested my PostCSS Node package in isolation and I know it's doing what I need it to to the files, however I'm having trouble working out how to configure the NX repo to run an NPM script in each component's package.json. A component such as my Button component has a package.json like so:

{
  "name": "css-components-button",
  "version": "0.1.0",
  "main": "index.js",
  "license": "MIT",
  "scripts": {
    "prepack": "tools-postcss 'lib/**/*.css' dist/"
  },
  "dependencies": {
    "tools-postcss": "file:.yalc/tools-postcss"
  }
}

In the CSS Components Library the project.json file looks like this:

{
  "name": "css-components",
  "sourceRoot": "libs/css-components/src",
  "projectType": "library",
  "tags": [],
  "targets": {
    "lint": {
      "executor": "@nrwl/linter:eslint",
      "outputs": ["{options.outputFile}"],
      "options": {
        "lintFilePatterns": ["libs/css-components/**/*.{ts,tsx,js,jsx}"]
      }
    },
    "build": {
      "executor": "@nrwl/rollup:rollup",
      "outputs": ["{options.outputPath}"],
      "options": {
        "outputPath": "dist/libs/css-components",
        "tsConfig": "libs/css-components/tsconfig.lib.json",
        "project": "libs/css-components/package.json",
        "entryFile": "libs/css-components/src/index.ts",
        "external": ["react/jsx-runtime"],
        "rollupConfig": "@nrwl/react/plugins/bundle-rollup",
        "compiler": "babel",
        "assets": [
          {
            "glob": "libs/css-components/README.md",
            "input": ".",
            "output": "."
          }
        ]
      }
    },
    "test": {
      "executor": "@nrwl/jest:jest",
      "outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
      "options": {
        "jestConfig": "libs/css-components/jest.config.ts",
        "passWithNoTests": true
      }
    },
    "prepack": {
      "executor": "@nrwl/workspace:run-script",
      "options": {
        "script": "prepack"
      }
    }
  }
}

In particular I've added a "prepack" custom target which I'm trying to use to run a "prepack" NPM script in each component's package.json. Currently when I run nx run css-components:prepack in the Terminal I get **error Command "prepack" not found.**

Would really appreciate some help with this. Any ideas?


问:
The current way to 'export default' using decorators in NextJS
I have a NextJS app that I'm upgrading to the latest version to take advantage of SWC (compared to older versions that used Babel).

As it turns out NextJS's implementation isn't exactly the same since Babel was supporting the legacy decorator proposal. The comments from NextJS team haven't been helpful either, so I turn to StackOverflow as I can't seem to get the right syntax:

// Old Code
@connect( mapStateToProps, { followUser, unfollowUser } )
export default class FollowCTA extends Component {
}
```
<p>According to the latest decorator proposal, "Class decorators come after export and default"</p>
<pre class="lang-js prettyprint-override"><code>// New Code as per docs
export default
@connect( mapStateToProps, { followUser, unfollowUser } )
class FollowCTA extends Component {
}
</code>```

The above code however throws the following error where that component was being used:

```<code>Unhandled Runtime Error
ReferenceError: FollowCTA is not defined
</code>```

What is the right way to continue using decorators in NextJS?

Body:
I have a NextJS app that I'm upgrading to the latest version to take advantage of SWC (compared to older versions that used Babel).

As it turns out NextJS's implementation isn't exactly the same since Babel was supporting the legacy decorator proposal. The comments from NextJS team haven't been helpful either, so I turn to StackOverflow as I can't seem to get the right syntax:

// Old Code
@connect( mapStateToProps, { followUser, unfollowUser } )
export default class FollowCTA extends Component {
}

According to the latest decorator proposal, "Class decorators come after export and default"

// New Code as per docs
export default
@connect( mapStateToProps, { followUser, unfollowUser } )
class FollowCTA extends Component {
}

The above code however throws the following error where that component was being used:

Unhandled Runtime Error
ReferenceError: FollowCTA is not defined

What is the right way to continue using decorators in NextJS?


问:
How to find the functions in a source file for an added library to Python
I have recently installed Python and MetaTrader5 library, and I am trying to further understand how this library connects to the MetaTrader terminal and handles my requests. I am pretty new to programming in general and do not have much experience with viewing source code for external libraries.

As an example, there is a function mt5.account_info() that I would like to locate in the library source code yet all I have in my files is the __ init__ that contains only 4 functions that are not even listed when I run print(dir(mt5)). How do I go about finding the code for these functions that the MetaTrader5 library uses?

My overall goal is to be able to use the ObjectGetDouble function that isn't part of the Python integration and I am trying to see if I can add this function myself or if I need to do it in the MQL editor and export the data that way.

I have tried looking through the source code in the installed library folders but have not found the resources. I am not familliar with C++ so I haven't been able to write any MQL5 code in order to extract the ObjectGetDouble information.


问:
WPF - How to bind a UserControl to a nested property in data model?
I have a data model (not really a view model; it does not directly contain dependency properties, and I want to keep it that way), which structurally looks something like this:

public class Foo
{
    public Bar Data { get; set; }
    // other properties
}

public class Bar
{
    public string Text { get; set; }
    // other properties
}
```
<p>And a custom <code>UserControl</code> that looks somewhat like this:</p>
<pre class="lang-xml prettyprint-override"><code><MyUserControl ...>
    <Grid>
        <TextBox Text="{Binding ???}">
    </Grid>
</MyUserControl>
</code>```

The code-behind of the user control contains a reference to an instance of Foo.

How would I go about binding the Text value of the TextBox inside the MyUserControl to the Data.Text property of the Foo object referenced in the control?

Note:

I would like to avoid declaring a bunch of DPs inside the MyUserControl class as Foo references multiple other types, which respectively contain properties with the same name. So to stay consistent in naming the DPs, I would have to prefix every single one with something showing the nested property they belong to.

So far, I have tried attaching DependencyPropertys to my data model using a helper class with static Get/Set methods as follows:

using DP = System.Windows.DependencyProperty;

static class PropertyProvider
{

    public static readonly DP TextProperty = DP.RegisterAttached (
        "Text",
        typeof (string),
        typeof (Bar),
        new UIPropertyMetadata ("")
    );
    public static string GetText (DependencyObject obj) => (string)obj.GetValue (TextProperty);
    public static void SetText (DependencyObject obj, string value) => obj.SetValue (TextProperty, value);

}
```

This results in an XAML Binding Failure and also - after some reasearch - seems to be the wrong approach; I understood it thus far, DPs are supposed to be attached to the control instead instead of the data/view model.

That however leaves me questioning how the data from the control is supposed to be written to/read from the context object, if the DP were attached to the control.

Another thing I attempted, was to simply set the Foo instance as the MyUserControl's DataContext, and declaring the binding like this: Text="{Binding Data.Text}", which seemed to work here.

This also resulted in an XAML Binding Failure, because "Text property not found on object of type Foo".

Body:
I have a data model (not really a view model; it does not directly contain dependency properties, and I want to keep it that way), which structurally looks something like this:

public class Foo
{
    public Bar Data { get; set; }
    // other properties
}

public class Bar
{
    public string Text { get; set; }
    // other properties
}

And a custom UserControl that looks somewhat like this:

<MyUserControl ...>
    <Grid>
        <TextBox Text="{Binding ???}">
    </Grid>
</MyUserControl>

The code-behind of the user control contains a reference to an instance of Foo.

How would I go about binding the Text value of the TextBox inside the MyUserControl to the Data.Text property of the Foo object referenced in the control?

Note:

I would like to avoid declaring a bunch of DPs inside the MyUserControl class as Foo references multiple other types, which respectively contain properties with the same name. So to stay consistent in naming the DPs, I would have to prefix every single one with something showing the nested property they belong to.

So far, I have tried attaching DependencyPropertys to my data model using a helper class with static Get/Set methods as follows:

using DP = System.Windows.DependencyProperty;

static class PropertyProvider
{

    public static readonly DP TextProperty = DP.RegisterAttached (
        "Text",
        typeof (string),
        typeof (Bar),
        new UIPropertyMetadata ("")
    );
    public static string GetText (DependencyObject obj) => (string)obj.GetValue (TextProperty);
    public static void SetText (DependencyObject obj, string value) => obj.SetValue (TextProperty, value);

}

This results in an XAML Binding Failure and also - after some reasearch - seems to be the wrong approach; I understood it thus far, DPs are supposed to be attached to the control instead instead of the data/view model.

That however leaves me questioning how the data from the control is supposed to be written to/read from the context object, if the DP were attached to the control.

Another thing I attempted, was to simply set the Foo instance as the MyUserControl's DataContext, and declaring the binding like this: Text="{Binding Data.Text}", which seemed to work here.

This also resulted in an XAML Binding Failure, because "Text property not found on object of type Foo".


问:
How to properly get a custom layer on gpu in Julia Flux?
As mentioned, I want to get GPU support for a custom layer. Here is the build-net part of my code:

```<code># MyDense
struct MyDense
    d1
    d2
end
MyDense(p::Pair) = MyDense(Dense(p), Dense(p))
(m::MyDense)(x) = m.d1(x) + m.d2(x)
# multiple-dispatch for gpu function on the custom layer
Flux.gpu(layer::MyDense) = MyDense(Flux.gpu(layer.d1), Flux.gpu(layer.d2))

# Define our model, a multi-layer perceptron with one hidden layer of size 3:
model = Chain(
    Dense(2 => 3, tanh),   # activation function inside layer
    BatchNorm(3),
    MyDense(3 => 2),
    softmax) |> gpu        # move model to GPU, if available
</code>```

Reminded by @eliassno's answer in this question, I wrote a new dispatch of Flux.gpu function for my custom layer. However, it still didn't work and gave me the error:

```<code>ERROR: ArgumentError: cannot take the CPU address of a CUDA.CuArray{Float32, 2, CUDA.Mem.DeviceBuffer}
Stacktrace:
  [1] unsafe_convert(#unused#::Type{Ptr{Float32}}, x::CUDA.CuArray{Float32, 2, CUDA.Mem.DeviceBuffer})
    @ CUDA C:\Users\Herr LU\.julia\packages\CUDA\DfvRa\src\array.jl:319
  [2] gemm!(transA::Char, transB::Char, alpha::Float32, A::Matrix{Float32}, B::CUDA.CuArray{Float32, 2, CUDA.Mem.DeviceBuffer}, beta::Float32, C::CUDA.CuArray{Float32, 2, CUDA.Mem.DeviceBuffer})
    @ LinearAlgebra.BLAS C:\Users\Herr LU\AppData\Local\Programs\Julia-1.8.2\share\julia\stdlib\v1.8\LinearAlgebra\src\blas.jl:1514
  [3] gemm_wrapper!(C::CUDA.CuArray{Float32, 2, CUDA.Mem.DeviceBuffer}, tA::Char, tB::Char, A::Matrix{Float32}, B::CUDA.CuArray{Float32, 2, CUDA.Mem.DeviceBuffer}, _add::LinearAlgebra.MulAddMul{true, true, Bool, Bool})
    @ LinearAlgebra C:\Users\Herr LU\AppData\Local\Programs\Julia-1.8.2\share\julia\stdlib\v1.8\LinearAlgebra\src\matmul.jl:674
  [4] mul!
    @ C:\Users\Herr LU\AppData\Local\Programs\Julia-1.8.2\share\julia\stdlib\v1.8\LinearAlgebra\src\matmul.jl:161 [inlined]
  [5] mul!
    @ C:\Users\Herr LU\AppData\Local\Programs\Julia-1.8.2\share\julia\stdlib\v1.8\LinearAlgebra\src\matmul.jl:276 [inlined]
  [6] *
    @ C:\Users\Herr LU\AppData\Local\Programs\Julia-1.8.2\share\julia\stdlib\v1.8\LinearAlgebra\src\matmul.jl:148 [inlined]
  [7] (::Dense{typeof(identity), Matrix{Float32}, Vector{Float32}})(x::CUDA.CuArray{Float32, 2, CUDA.Mem.DeviceBuffer})
    @ Flux C:\Users\Herr LU\.julia\packages\Flux\ZdbJr\src\layers\basic.jl:172
  [8] (::MyDense)(x::CUDA.CuArray{Float32, 2, CUDA.Mem.DeviceBuffer})
    @ Main e:\Master Thesis\lu_jizhou\Learning\FluxTrial.jl:14
  [9] macro expansion
    @ C:\Users\Herr LU\.julia\packages\Flux\ZdbJr\src\layers\basic.jl:53 [inlined]
 [10] _applychain(layers::Tuple{Dense{typeof(tanh), CUDA.CuArray{Float32, 2, CUDA.Mem.DeviceBuffer}, CUDA.CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}}, BatchNorm{typeof(identity), CUDA.CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}, Float32, CUDA.CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}}, MyDense, typeof(softmax)}, x::CUDA.CuArray{Float32, 2, CUDA.Mem.DeviceBuffer})
    @ Flux C:\Users\Herr LU\.julia\packages\Flux\ZdbJr\src\layers\basic.jl:53
 [11] (::Chain{Tuple{Dense{typeof(tanh), CUDA.CuArray{Float32, 2, CUDA.Mem.DeviceBuffer}, CUDA.CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}}, BatchNorm{typeof(identity), CUDA.CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}, Float32, CUDA.CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}}, MyDense, typeof(softmax)}})(x::CUDA.CuArray{Float32, 2, CUDA.Mem.DeviceBuffer})
    @ Flux C:\Users\Herr LU\.julia\packages\Flux\ZdbJr\src\layers\basic.jl:51
 [12] top-level scope
    @ e:\Master Thesis\lu_jizhou\Learning\FluxTrial.jl:25
</code>```

How can I solve the issue?

Body:
As mentioned, I want to get GPU support for a custom layer. Here is the build-net part of my code:

# MyDense
struct MyDense
    d1
    d2
end
MyDense(p::Pair) = MyDense(Dense(p), Dense(p))
(m::MyDense)(x) = m.d1(x) + m.d2(x)
# multiple-dispatch for gpu function on the custom layer
Flux.gpu(layer::MyDense) = MyDense(Flux.gpu(layer.d1), Flux.gpu(layer.d2))

# Define our model, a multi-layer perceptron with one hidden layer of size 3:
model = Chain(
    Dense(2 => 3, tanh),   # activation function inside layer
    BatchNorm(3),
    MyDense(3 => 2),
    softmax) |> gpu        # move model to GPU, if available

Reminded by @eliassno's answer in this question, I wrote a new dispatch of Flux.gpu function for my custom layer. However, it still didn't work and gave me the error:

ERROR: ArgumentError: cannot take the CPU address of a CUDA.CuArray{Float32, 2, CUDA.Mem.DeviceBuffer}
Stacktrace:
  [1] unsafe_convert(#unused#::Type{Ptr{Float32}}, x::CUDA.CuArray{Float32, 2, CUDA.Mem.DeviceBuffer})
    @ CUDA C:\Users\Herr LU\.julia\packages\CUDA\DfvRa\src\array.jl:319
  [2] gemm!(transA::Char, transB::Char, alpha::Float32, A::Matrix{Float32}, B::CUDA.CuArray{Float32, 2, CUDA.Mem.DeviceBuffer}, beta::Float32, C::CUDA.CuArray{Float32, 2, CUDA.Mem.DeviceBuffer})
    @ LinearAlgebra.BLAS C:\Users\Herr LU\AppData\Local\Programs\Julia-1.8.2\share\julia\stdlib\v1.8\LinearAlgebra\src\blas.jl:1514
  [3] gemm_wrapper!(C::CUDA.CuArray{Float32, 2, CUDA.Mem.DeviceBuffer}, tA::Char, tB::Char, A::Matrix{Float32}, B::CUDA.CuArray{Float32, 2, CUDA.Mem.DeviceBuffer}, _add::LinearAlgebra.MulAddMul{true, true, Bool, Bool})
    @ LinearAlgebra C:\Users\Herr LU\AppData\Local\Programs\Julia-1.8.2\share\julia\stdlib\v1.8\LinearAlgebra\src\matmul.jl:674
  [4] mul!
    @ C:\Users\Herr LU\AppData\Local\Programs\Julia-1.8.2\share\julia\stdlib\v1.8\LinearAlgebra\src\matmul.jl:161 [inlined]
  [5] mul!
    @ C:\Users\Herr LU\AppData\Local\Programs\Julia-1.8.2\share\julia\stdlib\v1.8\LinearAlgebra\src\matmul.jl:276 [inlined]
  [6] *
    @ C:\Users\Herr LU\AppData\Local\Programs\Julia-1.8.2\share\julia\stdlib\v1.8\LinearAlgebra\src\matmul.jl:148 [inlined]
  [7] (::Dense{typeof(identity), Matrix{Float32}, Vector{Float32}})(x::CUDA.CuArray{Float32, 2, CUDA.Mem.DeviceBuffer})
    @ Flux C:\Users\Herr LU\.julia\packages\Flux\ZdbJr\src\layers\basic.jl:172
  [8] (::MyDense)(x::CUDA.CuArray{Float32, 2, CUDA.Mem.DeviceBuffer})
    @ Main e:\Master Thesis\lu_jizhou\Learning\FluxTrial.jl:14
  [9] macro expansion
    @ C:\Users\Herr LU\.julia\packages\Flux\ZdbJr\src\layers\basic.jl:53 [inlined]
 [10] _applychain(layers::Tuple{Dense{typeof(tanh), CUDA.CuArray{Float32, 2, CUDA.Mem.DeviceBuffer}, CUDA.CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}}, BatchNorm{typeof(identity), CUDA.CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}, Float32, CUDA.CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}}, MyDense, typeof(softmax)}, x::CUDA.CuArray{Float32, 2, CUDA.Mem.DeviceBuffer})
    @ Flux C:\Users\Herr LU\.julia\packages\Flux\ZdbJr\src\layers\basic.jl:53
 [11] (::Chain{Tuple{Dense{typeof(tanh), CUDA.CuArray{Float32, 2, CUDA.Mem.DeviceBuffer}, CUDA.CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}}, BatchNorm{typeof(identity), CUDA.CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}, Float32, CUDA.CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}}, MyDense, typeof(softmax)}})(x::CUDA.CuArray{Float32, 2, CUDA.Mem.DeviceBuffer})
    @ Flux C:\Users\Herr LU\.julia\packages\Flux\ZdbJr\src\layers\basic.jl:51
 [12] top-level scope
    @ e:\Master Thesis\lu_jizhou\Learning\FluxTrial.jl:25

How can I solve the issue?


问:
Failed with error: ‘packages could not be loaded’
Executing the script below is generating an error that did not occur before.

Here's my code:

```<code>Pacotes <- c("MethComp","qqplotr","imputeTS","multiway","prettydoc","moments",
             "mclust","ggQC","stats","ffp","RVAideMemoire","forecast","AID",
             "ggplot2","nortest","rmarkdown","gt","MASS","plotly","ggpubr",
             "readxl","calibrate","mixtools","knitr","kableExtra","modeest",
             "dplyr","cluster","factoextra","FactoMineR","DT","cartography",
             "data.table","devtools","univOutl","multimode","mixR",
             "refineR","KernSmooth")

if(sum(as.numeric(!Pacotes %in% installed.packages())) != 0){
  instalador <- Pacotes[!Pacotes %in% installed.packages()]
  for(i in 1:length(instalador)) {
    install.packages(instalador, dependencies = TRUE)
    break()}
  sapply(Pacotes, require, character = TRUE)
  } else {
    sapply(Pacotes, require, character = TRUE)
  }
</code>```

Failed with error:  'package ‘ggplot2’ could not be loaded'

Failed with error:  'package ‘ggplot2’ could not be loaded'

Failed with error:  'package ‘ggplot2’ could not be loaded'

Failed with error:  'package ‘ggplot2’ could not be loaded'

Failed with error:  'package ‘usethis’ could not be loaded'

Failed with error:  'package ‘ggplot2’ could not be loaded'

Can anybody help me? Why is this error occurring?

The error started to occur after installing the latest version of R and RStudio on my notebook that has the Windows 10 Pro operating system.

Body:
Executing the script below is generating an error that did not occur before.

Here's my code:

Pacotes <- c("MethComp","qqplotr","imputeTS","multiway","prettydoc","moments",
             "mclust","ggQC","stats","ffp","RVAideMemoire","forecast","AID",
             "ggplot2","nortest","rmarkdown","gt","MASS","plotly","ggpubr",
             "readxl","calibrate","mixtools","knitr","kableExtra","modeest",
             "dplyr","cluster","factoextra","FactoMineR","DT","cartography",
             "data.table","devtools","univOutl","multimode","mixR",
             "refineR","KernSmooth")

if(sum(as.numeric(!Pacotes %in% installed.packages())) != 0){
  instalador <- Pacotes[!Pacotes %in% installed.packages()]
  for(i in 1:length(instalador)) {
    install.packages(instalador, dependencies = TRUE)
    break()}
  sapply(Pacotes, require, character = TRUE)
  } else {
    sapply(Pacotes, require, character = TRUE)
  }

Failed with error:  'package ‘ggplot2’ could not be loaded'

Failed with error:  'package ‘ggplot2’ could not be loaded'

Failed with error:  'package ‘ggplot2’ could not be loaded'

Failed with error:  'package ‘ggplot2’ could not be loaded'

Failed with error:  'package ‘usethis’ could not be loaded'

Failed with error:  'package ‘ggplot2’ could not be loaded'

Can anybody help me? Why is this error occurring?

The error started to occur after installing the latest version of R and RStudio on my notebook that has the Windows 10 Pro operating system.


问:
Runge Kutta Fourth Order for system of dif equations
I was trying to solve a system of 2 differential equations using python script, but it seems I'm doing something wrong.

I have 2 equations:

```<code>dx/dt = ax - bxy
dy/dt = -cx + dxy
</code>```

The integration interval is [15; 45].
a, b, c, d coefficients are given as well.

The code I`m using to calculate this is below:

```<code>def get_next_v(_v_i: float, _q: List[float]) -> float:
    assert len(_q) == 4
    _q_s = _q[0] + 2 * _q[1] + 2 * _q[2] + _q[3]
    return _v_i + ((1 / 6) * _q_s)

def get_qi_seq(_h: float, _t_i: float, _x_i: float, _y_i: float,
               _a: float, _b: float, _c: float, _d: float) -> Tuple[List[float], List[float]]:

    # x' = ax - bxy
    # y` = -cy + dxy

    _k_1 = _h * x(_x_i, _y_i, _a, _b)
    _q_1 = _h * y(_x_i, _y_i, _c, _d)

    _k_2 = _h * x(_x_i + _h / 2, _y_i + _k_1 / 2, _a, _b)
    _q_2 = _h * y(_x_i + _h / 2, _y_i + _q_1 / 2, _c, _d)

    _k_3 = _h * x(_x_i + _h / 2, _y_i + _k_2 / 2, _a, _b)
    _q_3 = _h * y(_x_i + _h / 2, _y_i + _q_2 / 2, _c, _d)

    _k_4 = _h * x(_x_i + _h, _y_i + _k_3, _a, _b)
    _q_4 = _h * y(_x_i + _h, _y_i + _q_3, _c, _d)

    return [_k_1, _k_2, _k_3, _k_4], [_q_1, _q_2, _q_3, _q_4]

def x(_x_i: float, _y_i: float, _a: float, _b: float) -> float:
    return (_x_i * _a) - (_b * _x_i * _y_i)

def y(_x_i: float, _y_i: float, _c: float, _d: float) -> float:
    return (- (_y_i * _c)) + (_d * _x_i * _y_i)

def get_x_y_vals(_t0: float, _T: float, _x0: float, _y0: float, _h: float,
                 _a: float, _b: float, _c: float, _d: float) -> List[List[float]]:

    _t = _t0
    _xi = _x0
    _yi = _y0

    _res = [[_t, _xi, _yi]]
    while _t < _T:

        _ki, _qi = get_qi_seq(_h, _t, _xi, _yi, _a, _b, _c, _d)

        _xi = get_next_v(_xi, _ki)
        _yi = get_next_v(_xi, _qi)
        _t += _h
        _res.append([_t, _xi, _yi])

    return _res

def main():
    # # a = 1.75
    # # b = 2.15
    # # c = 1.35
    # # d = 0.82
    # # interval = [14, 44]
    # # e = 10 ** -3
    #
    a = 1.77
    b = 2.17
    c = 1.38
    d = 0.89
    x0 = 3.39
    y0 = 2.13
    interval = [15, 45]
    e = 10 ** -3

    vals = get_x_y_vals(interval[0],
                        interval[1],
                        x0,
                        y0,
                        0.1,
                        a, b, c, d)

    print(get_h(e))
    print(vals)

    t_range = [_item[0] for _item in vals]
    x_range = [_item[1] for _item in vals]
    y_range = [_item[2] for _item in vals]

    plt.plot(t_range, x_range)
    plt.plot(t_range, y_range)
    # plt.plot(x_range, y_range)
    plt.show()
</code>```

The problem is, that the example from the book I`m trying to replicate has an absolutely different plot.

Example plot:

My result:

What am I doing wrong and how can I fix this?

Body:
I was trying to solve a system of 2 differential equations using python script, but it seems I'm doing something wrong.

I have 2 equations:

dx/dt = ax - bxy
dy/dt = -cx + dxy

The integration interval is [15; 45].
a, b, c, d coefficients are given as well.

The code I`m using to calculate this is below:

def get_next_v(_v_i: float, _q: List[float]) -> float:
    assert len(_q) == 4
    _q_s = _q[0] + 2 * _q[1] + 2 * _q[2] + _q[3]
    return _v_i + ((1 / 6) * _q_s)

def get_qi_seq(_h: float, _t_i: float, _x_i: float, _y_i: float,
               _a: float, _b: float, _c: float, _d: float) -> Tuple[List[float], List[float]]:

    # x' = ax - bxy
    # y` = -cy + dxy

    _k_1 = _h * x(_x_i, _y_i, _a, _b)
    _q_1 = _h * y(_x_i, _y_i, _c, _d)

    _k_2 = _h * x(_x_i + _h / 2, _y_i + _k_1 / 2, _a, _b)
    _q_2 = _h * y(_x_i + _h / 2, _y_i + _q_1 / 2, _c, _d)

    _k_3 = _h * x(_x_i + _h / 2, _y_i + _k_2 / 2, _a, _b)
    _q_3 = _h * y(_x_i + _h / 2, _y_i + _q_2 / 2, _c, _d)

    _k_4 = _h * x(_x_i + _h, _y_i + _k_3, _a, _b)
    _q_4 = _h * y(_x_i + _h, _y_i + _q_3, _c, _d)

    return [_k_1, _k_2, _k_3, _k_4], [_q_1, _q_2, _q_3, _q_4]

def x(_x_i: float, _y_i: float, _a: float, _b: float) -> float:
    return (_x_i * _a) - (_b * _x_i * _y_i)

def y(_x_i: float, _y_i: float, _c: float, _d: float) -> float:
    return (- (_y_i * _c)) + (_d * _x_i * _y_i)

def get_x_y_vals(_t0: float, _T: float, _x0: float, _y0: float, _h: float,
                 _a: float, _b: float, _c: float, _d: float) -> List[List[float]]:

    _t = _t0
    _xi = _x0
    _yi = _y0

    _res = [[_t, _xi, _yi]]
    while _t < _T:

        _ki, _qi = get_qi_seq(_h, _t, _xi, _yi, _a, _b, _c, _d)

        _xi = get_next_v(_xi, _ki)
        _yi = get_next_v(_xi, _qi)
        _t += _h
        _res.append([_t, _xi, _yi])

    return _res

def main():
    # # a = 1.75
    # # b = 2.15
    # # c = 1.35
    # # d = 0.82
    # # interval = [14, 44]
    # # e = 10 ** -3
    #
    a = 1.77
    b = 2.17
    c = 1.38
    d = 0.89
    x0 = 3.39
    y0 = 2.13
    interval = [15, 45]
    e = 10 ** -3

    vals = get_x_y_vals(interval[0],
                        interval[1],
                        x0,
                        y0,
                        0.1,
                        a, b, c, d)

    print(get_h(e))
    print(vals)

    t_range = [_item[0] for _item in vals]
    x_range = [_item[1] for _item in vals]
    y_range = [_item[2] for _item in vals]

    plt.plot(t_range, x_range)
    plt.plot(t_range, y_range)
    # plt.plot(x_range, y_range)
    plt.show()

The problem is, that the example from the book I`m trying to replicate has an absolutely different plot.

Example plot:

My result:

What am I doing wrong and how can I fix this?