问:
Redis Reactive Streams Subscriber Thread Hangs
Am trying to use Spring Boot Redis Reactive Stream to subscribe to the stream as a listener.When the data is inserted into the stream listener will pass to client using GRPC stream. I have pointer which is just redis value to keep track of last record which was delivered to the client.The thread is getting blocked randomly when i set pointer to redis and getting timeout.
Mainly am using this pointer if client re-connects after sometime I wanted to deliver data which was last sent and till current data  template.opsForValue().set(pointerKey, msg.getId().toString()) .block(Duration.ofSeconds(5)); this place thread is getting blocked

Please let me know is anything wrong in the below code. If posted 10 record to the stream I got the error after receiving 5 record.

Code

```<code> public void subscribe(){

    String channelId = this.streamRequest.getTopic();
    String identifier = this.streamRequest.getIdentifier();
    boolean isNew = this.streamRequest.getNew();
    String pointerKey = channelId + "_" + identifier + "_pointer";

    StreamOffset<String> stringStreamOffset = StreamOffset.fromStart(channelId);

    if(isNew){
      // If client want to read data from the start
      // Removed the pointer
      template.opsForValue().delete(pointerKey).block();
    } else {
      String id = template.opsForValue().get(pointerKey).block();
      stringStreamOffset = id != null ? StreamOffset.create(channelId, ReadOffset.from(id)) : StreamOffset.fromStart(channelId);
    }

    logger.info("[SC] subscribed {}", this.streamRequest);
    Flux<ObjectRecord<String, String>> receiver = this.streamReceive.receive(stringStreamOffset);
    disposable = receiver.subscribe(msg -> {

      logger.info("Processing message {}", msg.getValue());
      String value = msg.getValue();
      StreamResponse streamResponse = StreamResponse.newBuilder().setData(value).build();

      try{
        logger.info("[SC] posting data to the grpc client topic {}", this.streamRequest);
        this.responseObserver.onNext(streamResponse);
        logger.info("[SC] Successfully posted data to the grpc client {}", this.streamRequest);

        logger.info("[SC] Updating pointer {}", pointerKey);
        template.opsForValue().set(pointerKey, msg.getId().toString())
            .block(Duration.ofSeconds(5));
        logger.info("[SC] pointer update completed {}", pointerKey);

      }catch (Exception ex){
        logger.error("Error:{}", ex.getMessage());
        this.responseObserver.onError(ex.getCause());
        close();
      }
    });
  }
</code>```

Error:

```<code>Name: lettuce-nioEventLoop-4-1
State: TIMED_WAITING on java.util.concurrent.CountDownLatch$Sync@3c9ebf7a
Total blocked: 2  Total waited: 60

Stack trace:
java.base@17.0.2/jdk.internal.misc.Unsafe.park(Native Method)
java.base@17.0.2/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:252)
java.base@17.0.2/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:717)
java.base@17.0.2/java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1074)
java.base@17.0.2/java.util.concurrent.CountDownLatch.await(CountDownLatch.java:276)
app//reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:121)
app//reactor.core.publisher.Mono.block(Mono.java:1731)
app//ai.jiffy.message.publisher.ws.StreamConnection.setPointer(StreamConnection.java:68)
app//ai.jiffy.message.publisher.ws.StreamConnection.lambda$new$0(StreamConnection.java:54)
app//ai.jiffy.message.publisher.ws.StreamConnection$$Lambda$1318/0x0000000801553610.accept(Unknown Source)
app//reactor.core.publisher.LambdaSubscriber.onNext(LambdaSubscriber.java:160)
app//reactor.core.publisher.FluxCreate$BufferAsyncSink.drain(FluxCreate.java:793)
app//reactor.core.publisher.FluxCreate$BufferAsyncSink.next(FluxCreate.java:718)
app//reactor.core.publisher.FluxCreate$SerializedFluxSink.next(FluxCreate.java:154)
app//org.springframework.data.redis.stream.DefaultStreamReceiver$StreamSubscription.onStreamMessage(DefaultStreamReceiver.java:398)
app//org.springframework.data.redis.stream.DefaultStreamReceiver$StreamSubscription.access$300(DefaultStreamReceiver.java:210)
app//org.springframework.data.redis.stream.DefaultStreamReceiver$StreamSubscription$1.onNext(DefaultStreamReceiver.java:360)
app//org.springframework.data.redis.stream.DefaultStreamReceiver$StreamSubscription$1.onNext(DefaultStreamReceiver.java:351)
app//reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
app//reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:120)
app//reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
app//reactor.core.publisher.FluxUsingWhen$UsingWhenSubscriber.onNext(FluxUsingWhen.java:345)
app//reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onNext(MonoFlatMapMany.java:250)
app//reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
app//reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onNext(MonoFlatMapMany.java:250)
app//reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:120)
app//io.lettuce.core.RedisPublisher$ImmediateSubscriber.onNext(RedisPublisher.java:886)
app//io.lettuce.core.RedisPublisher$RedisSubscription.onNext(RedisPublisher.java:291)
app//io.lettuce.core.output.StreamingOutput$Subscriber.onNext(StreamingOutput.java:64)
app//io.lettuce.core.output.StreamReadOutput.complete(StreamReadOutput.java:110)
app//io.lettuce.core.protocol.RedisStateMachine.doDecode(RedisStateMachine.java:343)
app//io.lettuce.core.protocol.RedisStateMachine.decode(RedisStateMachine.java:295)
app//io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:841)
app//io.lettuce.core.protocol.CommandHandler.decode0(CommandHandler.java:792)
app//io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:766)
app//io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:658)
app//io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:598)
app//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
app//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
app//io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
app//io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
app//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
app//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
app//io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
app//io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
app//io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722)
app//io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658)
app//io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584)
app//io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496)
app//io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
app//io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
app//io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
java.base@17.0.2/java.lang.Thread.run(Thread.java:833)
Name: lettuce-nioEventLoop-4-1
State: TIMED_WAITING on java.util.concurrent.CountDownLatch$Sync@3c9ebf7a
Total blocked: 2  Total waited: 60

Stack trace:
java.base@17.0.2/jdk.internal.misc.Unsafe.park(Native Method)
java.base@17.0.2/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:252)
java.base@17.0.2/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:717)
java.base@17.0.2/java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1074)
java.base@17.0.2/java.util.concurrent.CountDownLatch.await(CountDownLatch.java:276)
app//reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:121)
app//reactor.core.publisher.Mono.block(Mono.java:1731)
app//ai.jiffy.message.publisher.ws.StreamConnection.setPointer(StreamConnection.java:68)
app//ai.jiffy.message.publisher.ws.StreamConnection.lambda$new$0(StreamConnection.java:54)
app//ai.jiffy.message.publisher.ws.StreamConnection$$Lambda$1318/0x0000000801553610.accept(Unknown Source)
app//reactor.core.publisher.LambdaSubscriber.onNext(LambdaSubscriber.java:160)
app//reactor.core.publisher.FluxCreate$BufferAsyncSink.drain(FluxCreate.java:793)
app//reactor.core.publisher.FluxCreate$BufferAsyncSink.next(FluxCreate.java:718)
app//reactor.core.publisher.FluxCreate$SerializedFluxSink.next(FluxCreate.java:154)
app//org.springframework.data.redis.stream.DefaultStreamReceiver$StreamSubscription.onStreamMessage(DefaultStreamReceiver.java:398)
app//org.springframework.data.redis.stream.DefaultStreamReceiver$StreamSubscription.access$300(DefaultStreamReceiver.java:210)
app//org.springframework.data.redis.stream.DefaultStreamReceiver$StreamSubscription$1.onNext(DefaultStreamReceiver.java:360)
app//org.springframework.data.redis.stream.DefaultStreamReceiver$StreamSubscription$1.onNext(DefaultStreamReceiver.java:351)
app//reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
app//reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:120)
app//reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
app//reactor.core.publisher.FluxUsingWhen$UsingWhenSubscriber.onNext(FluxUsingWhen.java:345)
app//reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onNext(MonoFlatMapMany.java:250)
app//reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
app//reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onNext(MonoFlatMapMany.java:250)
app//reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:120)
app//io.lettuce.core.RedisPublisher$ImmediateSubscriber.onNext(RedisPublisher.java:886)
app//io.lettuce.core.RedisPublisher$RedisSubscription.onNext(RedisPublisher.java:291)
app//io.lettuce.core.output.StreamingOutput$Subscriber.onNext(StreamingOutput.java:64)
app//io.lettuce.core.output.StreamReadOutput.complete(StreamReadOutput.java:110)
app//io.lettuce.core.protocol.RedisStateMachine.doDecode(RedisStateMachine.java:343)
app//io.lettuce.core.protocol.RedisStateMachine.decode(RedisStateMachine.java:295)
app//io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:841)
app//io.lettuce.core.protocol.CommandHandler.decode0(CommandHandler.java:792)
app//io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:766)
app//io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:658)
app//io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:598)
app//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
app//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
app//io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
app//io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
app//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
app//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
app//io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
app//io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
app//io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722)
app//io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658)
app//io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584)
app//io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496)
app//io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
app//io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
app//io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
java.base@17.0.2/java.lang.Thread.run(Thread.java:833)

</code>```

Thanks in advance.

Body:
Am trying to use Spring Boot Redis Reactive Stream to subscribe to the stream as a listener.When the data is inserted into the stream listener will pass to client using GRPC stream. I have pointer which is just redis value to keep track of last record which was delivered to the client.The thread is getting blocked randomly when i set pointer to redis and getting timeout.
Mainly am using this pointer if client re-connects after sometime I wanted to deliver data which was last sent and till current data  template.opsForValue().set(pointerKey, msg.getId().toString()) .block(Duration.ofSeconds(5)); this place thread is getting blocked

Please let me know is anything wrong in the below code. If posted 10 record to the stream I got the error after receiving 5 record.

Code

 public void subscribe(){

    String channelId = this.streamRequest.getTopic();
    String identifier = this.streamRequest.getIdentifier();
    boolean isNew = this.streamRequest.getNew();
    String pointerKey = channelId + "_" + identifier + "_pointer";

    StreamOffset<String> stringStreamOffset = StreamOffset.fromStart(channelId);

    if(isNew){
      // If client want to read data from the start
      // Removed the pointer
      template.opsForValue().delete(pointerKey).block();
    } else {
      String id = template.opsForValue().get(pointerKey).block();
      stringStreamOffset = id != null ? StreamOffset.create(channelId, ReadOffset.from(id)) : StreamOffset.fromStart(channelId);
    }

    logger.info("[SC] subscribed {}", this.streamRequest);
    Flux<ObjectRecord<String, String>> receiver = this.streamReceive.receive(stringStreamOffset);
    disposable = receiver.subscribe(msg -> {

      logger.info("Processing message {}", msg.getValue());
      String value = msg.getValue();
      StreamResponse streamResponse = StreamResponse.newBuilder().setData(value).build();

      try{
        logger.info("[SC] posting data to the grpc client topic {}", this.streamRequest);
        this.responseObserver.onNext(streamResponse);
        logger.info("[SC] Successfully posted data to the grpc client {}", this.streamRequest);

        logger.info("[SC] Updating pointer {}", pointerKey);
        template.opsForValue().set(pointerKey, msg.getId().toString())
            .block(Duration.ofSeconds(5));
        logger.info("[SC] pointer update completed {}", pointerKey);

      }catch (Exception ex){
        logger.error("Error:{}", ex.getMessage());
        this.responseObserver.onError(ex.getCause());
        close();
      }
    });
  }

Error:

Name: lettuce-nioEventLoop-4-1
State: TIMED_WAITING on java.util.concurrent.CountDownLatch$Sync@3c9ebf7a
Total blocked: 2  Total waited: 60

Stack trace:
java.base@17.0.2/jdk.internal.misc.Unsafe.park(Native Method)
java.base@17.0.2/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:252)
java.base@17.0.2/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:717)
java.base@17.0.2/java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1074)
java.base@17.0.2/java.util.concurrent.CountDownLatch.await(CountDownLatch.java:276)
app//reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:121)
app//reactor.core.publisher.Mono.block(Mono.java:1731)
app//ai.jiffy.message.publisher.ws.StreamConnection.setPointer(StreamConnection.java:68)
app//ai.jiffy.message.publisher.ws.StreamConnection.lambda$new$0(StreamConnection.java:54)
app//ai.jiffy.message.publisher.ws.StreamConnection$$Lambda$1318/0x0000000801553610.accept(Unknown Source)
app//reactor.core.publisher.LambdaSubscriber.onNext(LambdaSubscriber.java:160)
app//reactor.core.publisher.FluxCreate$BufferAsyncSink.drain(FluxCreate.java:793)
app//reactor.core.publisher.FluxCreate$BufferAsyncSink.next(FluxCreate.java:718)
app//reactor.core.publisher.FluxCreate$SerializedFluxSink.next(FluxCreate.java:154)
app//org.springframework.data.redis.stream.DefaultStreamReceiver$StreamSubscription.onStreamMessage(DefaultStreamReceiver.java:398)
app//org.springframework.data.redis.stream.DefaultStreamReceiver$StreamSubscription.access$300(DefaultStreamReceiver.java:210)
app//org.springframework.data.redis.stream.DefaultStreamReceiver$StreamSubscription$1.onNext(DefaultStreamReceiver.java:360)
app//org.springframework.data.redis.stream.DefaultStreamReceiver$StreamSubscription$1.onNext(DefaultStreamReceiver.java:351)
app//reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
app//reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:120)
app//reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
app//reactor.core.publisher.FluxUsingWhen$UsingWhenSubscriber.onNext(FluxUsingWhen.java:345)
app//reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onNext(MonoFlatMapMany.java:250)
app//reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
app//reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onNext(MonoFlatMapMany.java:250)
app//reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:120)
app//io.lettuce.core.RedisPublisher$ImmediateSubscriber.onNext(RedisPublisher.java:886)
app//io.lettuce.core.RedisPublisher$RedisSubscription.onNext(RedisPublisher.java:291)
app//io.lettuce.core.output.StreamingOutput$Subscriber.onNext(StreamingOutput.java:64)
app//io.lettuce.core.output.StreamReadOutput.complete(StreamReadOutput.java:110)
app//io.lettuce.core.protocol.RedisStateMachine.doDecode(RedisStateMachine.java:343)
app//io.lettuce.core.protocol.RedisStateMachine.decode(RedisStateMachine.java:295)
app//io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:841)
app//io.lettuce.core.protocol.CommandHandler.decode0(CommandHandler.java:792)
app//io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:766)
app//io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:658)
app//io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:598)
app//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
app//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
app//io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
app//io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
app//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
app//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
app//io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
app//io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
app//io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722)
app//io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658)
app//io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584)
app//io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496)
app//io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
app//io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
app//io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
java.base@17.0.2/java.lang.Thread.run(Thread.java:833)
Name: lettuce-nioEventLoop-4-1
State: TIMED_WAITING on java.util.concurrent.CountDownLatch$Sync@3c9ebf7a
Total blocked: 2  Total waited: 60

Stack trace:
java.base@17.0.2/jdk.internal.misc.Unsafe.park(Native Method)
java.base@17.0.2/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:252)
java.base@17.0.2/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:717)
java.base@17.0.2/java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1074)
java.base@17.0.2/java.util.concurrent.CountDownLatch.await(CountDownLatch.java:276)
app//reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:121)
app//reactor.core.publisher.Mono.block(Mono.java:1731)
app//ai.jiffy.message.publisher.ws.StreamConnection.setPointer(StreamConnection.java:68)
app//ai.jiffy.message.publisher.ws.StreamConnection.lambda$new$0(StreamConnection.java:54)
app//ai.jiffy.message.publisher.ws.StreamConnection$$Lambda$1318/0x0000000801553610.accept(Unknown Source)
app//reactor.core.publisher.LambdaSubscriber.onNext(LambdaSubscriber.java:160)
app//reactor.core.publisher.FluxCreate$BufferAsyncSink.drain(FluxCreate.java:793)
app//reactor.core.publisher.FluxCreate$BufferAsyncSink.next(FluxCreate.java:718)
app//reactor.core.publisher.FluxCreate$SerializedFluxSink.next(FluxCreate.java:154)
app//org.springframework.data.redis.stream.DefaultStreamReceiver$StreamSubscription.onStreamMessage(DefaultStreamReceiver.java:398)
app//org.springframework.data.redis.stream.DefaultStreamReceiver$StreamSubscription.access$300(DefaultStreamReceiver.java:210)
app//org.springframework.data.redis.stream.DefaultStreamReceiver$StreamSubscription$1.onNext(DefaultStreamReceiver.java:360)
app//org.springframework.data.redis.stream.DefaultStreamReceiver$StreamSubscription$1.onNext(DefaultStreamReceiver.java:351)
app//reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
app//reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:120)
app//reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
app//reactor.core.publisher.FluxUsingWhen$UsingWhenSubscriber.onNext(FluxUsingWhen.java:345)
app//reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onNext(MonoFlatMapMany.java:250)
app//reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
app//reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onNext(MonoFlatMapMany.java:250)
app//reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:120)
app//io.lettuce.core.RedisPublisher$ImmediateSubscriber.onNext(RedisPublisher.java:886)
app//io.lettuce.core.RedisPublisher$RedisSubscription.onNext(RedisPublisher.java:291)
app//io.lettuce.core.output.StreamingOutput$Subscriber.onNext(StreamingOutput.java:64)
app//io.lettuce.core.output.StreamReadOutput.complete(StreamReadOutput.java:110)
app//io.lettuce.core.protocol.RedisStateMachine.doDecode(RedisStateMachine.java:343)
app//io.lettuce.core.protocol.RedisStateMachine.decode(RedisStateMachine.java:295)
app//io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:841)
app//io.lettuce.core.protocol.CommandHandler.decode0(CommandHandler.java:792)
app//io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:766)
app//io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:658)
app//io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:598)
app//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
app//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
app//io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
app//io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
app//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
app//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
app//io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
app//io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
app//io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722)
app//io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658)
app//io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584)
app//io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496)
app//io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
app//io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
app//io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
java.base@17.0.2/java.lang.Thread.run(Thread.java:833)

Thanks in advance.


来源: stackexchange

问:
Centos7.3 connect mysql with odbc, error message:Invalid connection parameters(HY000)
here is error info:
2022-12-31 15:13:57.433 (   0.010s) [main thread     ]             loguru.cpp:770   INFO| Logging to 'application.log', mode: 'a', verbosity: 9 2022-12-31 15:13:57.446 (   0.023s) [main thread     ]           otl_header.h:389    ERR| open connection : [Driver={MySQL ODBC 8.0 ANSI Driver};Server=xxx.xxx.xxx.xxx;Port=3306;Database=dbname;User=xx;Password=xxxx;Option=3;] 失败,  error message: [unixODBC][MySQL][ODBC 8.0(w) Driver]Invalid connection parameters   状态码(code): HY000  执行语句(SQL):

Application runs on Centos 7.3. I have installed unixODBC, mysql-connector-odbc (8.0.31)

At the very begining, error message shows that: Can't find ODBC driver(IM002). I tried to create /etc/odbc.ini and edit it, and error message shows: Invalid connection parameters(HY000).Connect string references to connectionstrings.com

I'm wondering if odbc connection exist security problem, and on some cases it is necessary to disable odbc. Because on an other Windows platform, error message also shows that can't find Driver, even thought DSN was configured.

I cannot figure out the problem that ANSI Driver references to 'libmyodbc8a.so', but applcation seems to try to connect with 'libmyodbc8w.so' according to error message.

Did anyone have met these issues, please give me some advises, thanks a lot.

ContentLicense: CC BY-SA 4.0


问:
Searching for multiple associated values in Sheets and adding their "values" using =SUM
I'm looking to consolidate my sales into 1 cell on google sheets, ive already added a multiselect dropdown script to make it easier for users to select multiple options from the drop down. Now im looking to calculate all the associated prices with each other and put them into a sales total. Previously when they were separated i used VLOOKUP (See Below)

```<code>=SUM(VLOOKUP(E4,'Price Sheet'!A:B,2,false) * D4,VLOOKUP(G4,'Price Sheet'!A:B,2,false) * F4,VLOOKUP(I4,'Price Sheet'!A:B,2,false) * H4,VLOOKUP(K4,'Price Sheet'!A:B,2,false) * J4)
</code>```

How would i go about, Searching for matches within the cell and then adding their respective "Sale Value" together to be put into the sales total cell

I could be explaining this poorly so ive linked my sheets to give a visual to my potentially terrible explanation of what im looking for

https://docs.google.com/spreadsheets/d/15FkYzumFZUXCG_6WxN_OT9GjqQCLvY4H6AX8_fd-bN8/edit?usp=sharing (New Sheet)

https://docs.google.com/spreadsheets/d/1hM8um3B53tAsMgveso8FrMIiqN67-3t7eWjTD5-gMBs/edit?usp=sharing (Old Sheet)

I have attempted to work with MATCH, CHOOSE, VLOOKUP. Ive attempted to look for tutorials on how this may be done but i get mainly how to output multiple cells into 1 cell using helper cells which im open to just not on the main "sales Sheet"

Body:
I'm looking to consolidate my sales into 1 cell on google sheets, ive already added a multiselect dropdown script to make it easier for users to select multiple options from the drop down. Now im looking to calculate all the associated prices with each other and put them into a sales total. Previously when they were separated i used VLOOKUP (See Below)

=SUM(VLOOKUP(E4,'Price Sheet'!A:B,2,false) * D4,VLOOKUP(G4,'Price Sheet'!A:B,2,false) * F4,VLOOKUP(I4,'Price Sheet'!A:B,2,false) * H4,VLOOKUP(K4,'Price Sheet'!A:B,2,false) * J4)

How would i go about, Searching for matches within the cell and then adding their respective "Sale Value" together to be put into the sales total cell

I could be explaining this poorly so ive linked my sheets to give a visual to my potentially terrible explanation of what im looking for

https://docs.google.com/spreadsheets/d/15FkYzumFZUXCG_6WxN_OT9GjqQCLvY4H6AX8_fd-bN8/edit?usp=sharing (New Sheet)

https://docs.google.com/spreadsheets/d/1hM8um3B53tAsMgveso8FrMIiqN67-3t7eWjTD5-gMBs/edit?usp=sharing (Old Sheet)

I have attempted to work with MATCH, CHOOSE, VLOOKUP. Ive attempted to look for tutorials on how this may be done but i get mainly how to output multiple cells into 1 cell using helper cells which im open to just not on the main "sales Sheet"


问:
react-icons/fa icons not showing up in ReactNavbar
I am trying to import some icons from react-icons package and use it in the ReactNavbar but the icon is not showing up.

Please help me to get the icon show up!!

```<code>import React from 'react'
import {ReactNavbar} from "overlay-navbar"
import logo from "../../images/logo.png"
import {FaUserAlt} from "react-icons/fa"
const Header = () => {
    return <ReactNavbar
        navColor1='white'
        navColor2="hsl(219,48%,8%)"
        burgerColor="hsl(250,100%,75%)"
        burgerColorHover="hsl(250,100%,75%)"
        logo={logo}
        logoWidth="250px"
        logoColorHover="hsl(250,100%,75%)"
        nav2justifyContent="space-around"
        nav3justifyContent="space-around"
        link1Text="Home"
        link2Text="About"
        link3Text="Projects"
        link4Text="Contact"
        link1Url="/"
        link2Url="/about"
        link3Url="/projects"
        link4Url="/contact"
        link1ColorHover="white"
        link1Color="HSL(250,100%,75%)"
        link1Size="1.5rem"
        link1Padding="3vmax"
        profileIcon={true}
        profileIconElement={<FaUserAlt/>}
    />
}

export default Header
</code>```

Body:
I am trying to import some icons from react-icons package and use it in the ReactNavbar but the icon is not showing up.

Please help me to get the icon show up!!

import React from 'react'
import {ReactNavbar} from "overlay-navbar"
import logo from "../../images/logo.png"
import {FaUserAlt} from "react-icons/fa"
const Header = () => {
    return <ReactNavbar
        navColor1='white'
        navColor2="hsl(219,48%,8%)"
        burgerColor="hsl(250,100%,75%)"
        burgerColorHover="hsl(250,100%,75%)"
        logo={logo}
        logoWidth="250px"
        logoColorHover="hsl(250,100%,75%)"
        nav2justifyContent="space-around"
        nav3justifyContent="space-around"
        link1Text="Home"
        link2Text="About"
        link3Text="Projects"
        link4Text="Contact"
        link1Url="/"
        link2Url="/about"
        link3Url="/projects"
        link4Url="/contact"
        link1ColorHover="white"
        link1Color="HSL(250,100%,75%)"
        link1Size="1.5rem"
        link1Padding="3vmax"
        profileIcon={true}
        profileIconElement={<FaUserAlt/>}
    />
}

export default Header


问:
How to trigger drag enter event in framer-motion div element using drag props?
How do I get the onDragEnter event to work in framer-motion? I made a component draggable using drag props of framer-motion and I am trying to see if the component is dragged in the dropzone area but it's not triggering the drag enter event. I can't figure out what I am missing. My final goal is to drag an element from one box to another and update the state for it.

Here is codesandbox link showing the issue
https://codesandbox.io/s/modern-water-sewn32?file=/src/App.tsx

Any guidance or reference is appreciated. Thanks

I tried using the HTML draggable props and naturally it works and trigger the dragEnter event but I am loosing the fluid movement in doing so and also its a inbuilt thing not something framer-motion is doing so props like whileDrag doesn't work with that.


问:
SwiftUI: How to open a new window with URL Schemes and pass an FetchedResult?
following this really good tutorial (https://crystalminds.medium.com/programmatically-open-a-new-window-in-swiftui-on-macos-ventura-13-804ab6de20a9) I'd like to pass an FetchedResult to the new window.

What I did so far:

Created a NavigationSplitView that displays all my FetchedResults from my Table "Klienten" following the Apple Documentation for NavigationSplitView.

```<code>NavigationSplitView {
    List(klienten, selection: $selectedClient) { klient in
        Text("\(klient.nachname ?? "kein Name"), \(klient.vorname ?? "kein Name")").tag(klient)
    }
    .navigationTitle("Clients")
    .toolbar {
        ToolbarItem {
            Button {
                if let url = URL(string: "justcare://klient=\(selectedClient)") {
                    NSWorkspace.shared.open(url)
                }
            } label: {
                Label("Edit Item", systemImage: "pencil")
            }
            .disabled(selectedClient != nil ? false : true)
        }
    }
    .searchable(text: $filter)

} detail: {
    if selectedClient != nil {
        ItemDetailView(klient: selectedClient!)
    }
}
.navigationSplitViewStyle(.prominentDetail)
</code>```

Created a new URL Type named "justcare"

Created a new View for editing

```<code>
struct EditClientView: View {
    @ObservedObject var klient: Klienten

    var body: some View {
        Text(klient!.nachname ?? "Kein Nachname")
    }
}
</code>```

Created a new Scene

```<code>        WindowGroup {
            EditClientView(klient: nil)
                .environment(\.managedObjectContext, persistenceController.container.viewContext)
        }
        .handlesExternalEvents(matching: ["justcare"])
</code>```

And here's my problem: At line 2 I can't pass nil to parameter klient. In my EditClientView I can't make the ObservedObject optional.
Additionally the line URL(string: "justcare://klient=\(selectedClient)") causes problems, because selectedClient is, of course, not a String. :-)

How can I pass the selected Klienten Object in order to edit it?

Thanks for advice.

Edit:

In German, there's a idiom like "From behind through the chest into the eye". Don't know, if this is the proper way, but I set the variable in my App-Struct and binded it through to my View.

```<code>struct justCare_2App: App {
    let persistenceController = PersistenceController.shared

    @State private var selectedKlient: Klienten?

    var body: some Scene {
        WindowGroup {
            ContentView(selectedClient: $selectedKlient)
                .environment(\.managedObjectContext, persistenceController.container.viewContext)
        }
        WindowGroup {
            EditClientView(klient: $selectedKlient)
                .environment(\.managedObjectContext, persistenceController.container.viewContext)
        }
        .handlesExternalEvents(matching: ["justcare"])
    }
}
</code>```

And in my ContentView:

```<code>struct ContentView: View {
    @Environment(\.managedObjectContext) private var moc
    @Binding var selectedClient: Klienten?

    @State var filter: String = ""

    init(selectedClient: Binding<Klienten?>) {
        _selectedClient = selectedClient
    }
[...]
}
</code>```

Is there a more comfortable or accurate way? Or can it be done this way?

Body:
following this really good tutorial (https://crystalminds.medium.com/programmatically-open-a-new-window-in-swiftui-on-macos-ventura-13-804ab6de20a9) I'd like to pass an FetchedResult to the new window.

What I did so far:

Created a NavigationSplitView that displays all my FetchedResults from my Table "Klienten" following the Apple Documentation for NavigationSplitView.

NavigationSplitView {
    List(klienten, selection: $selectedClient) { klient in
        Text("\(klient.nachname ?? "kein Name"), \(klient.vorname ?? "kein Name")").tag(klient)
    }
    .navigationTitle("Clients")
    .toolbar {
        ToolbarItem {
            Button {
                if let url = URL(string: "justcare://klient=\(selectedClient)") {
                    NSWorkspace.shared.open(url)
                }
            } label: {
                Label("Edit Item", systemImage: "pencil")
            }
            .disabled(selectedClient != nil ? false : true)
        }
    }
    .searchable(text: $filter)

} detail: {
    if selectedClient != nil {
        ItemDetailView(klient: selectedClient!)
    }
}
.navigationSplitViewStyle(.prominentDetail)

Created a new URL Type named "justcare"

Created a new View for editing

struct EditClientView: View {
    @ObservedObject var klient: Klienten

    var body: some View {
        Text(klient!.nachname ?? "Kein Nachname")
    }
}

Created a new Scene

        WindowGroup {
            EditClientView(klient: nil)
                .environment(\.managedObjectContext, persistenceController.container.viewContext)
        }
        .handlesExternalEvents(matching: ["justcare"])

And here's my problem: At line 2 I can't pass nil to parameter klient. In my EditClientView I can't make the ObservedObject optional.
Additionally the line URL(string: "justcare://klient=\(selectedClient)") causes problems, because selectedClient is, of course, not a String. :-)

How can I pass the selected Klienten Object in order to edit it?

Thanks for advice.

Edit:

In German, there's a idiom like "From behind through the chest into the eye". Don't know, if this is the proper way, but I set the variable in my App-Struct and binded it through to my View.

struct justCare_2App: App {
    let persistenceController = PersistenceController.shared

    @State private var selectedKlient: Klienten?

    var body: some Scene {
        WindowGroup {
            ContentView(selectedClient: $selectedKlient)
                .environment(\.managedObjectContext, persistenceController.container.viewContext)
        }
        WindowGroup {
            EditClientView(klient: $selectedKlient)
                .environment(\.managedObjectContext, persistenceController.container.viewContext)
        }
        .handlesExternalEvents(matching: ["justcare"])
    }
}

And in my ContentView:

struct ContentView: View {
    @Environment(\.managedObjectContext) private var moc
    @Binding var selectedClient: Klienten?

    @State var filter: String = ""

    init(selectedClient: Binding<Klienten?>) {
        _selectedClient = selectedClient
    }
[...]
}

Is there a more comfortable or accurate way? Or can it be done this way?


问:
Kafka Connect on CFK: Discrepancies between Connect Rest api and Connect CR by CFK
I installed confluent using CFK (Confluent for Kubernetes) way of deployment, setup went fine, using the vanilla yaml file for the entire components (zookeeper, kafka, connect, ksql, control-center, schema-registry).

I tried to use kind: Connector to configure my sqlserver source connector, connector created succesfully.

The problem came when I tried to list the connector via the below curl request (after port-forwarding to the pod)
curl localhost:8083/connectors | jq .

I got nothing registered, however when I ran the below command:

kubectl confluent connector list

it shows that I have a registered connectors as below, I assume both are 2 faces for the same coin.

```<code>NAME                          STATUS  TASKS-READY  TASKS-FAILED  AGE
bq-sink-conn                            0             9h
mssql-source-conn                       0             9h
</code>```

My question is, why is this discrepancy?, or I am missing something

also after a week of searching and looking on the internet, I can't find enough resources with example on how to use CFK and specifically Connectors CR.

Thanks,

Body:
I installed confluent using CFK (Confluent for Kubernetes) way of deployment, setup went fine, using the vanilla yaml file for the entire components (zookeeper, kafka, connect, ksql, control-center, schema-registry).

I tried to use kind: Connector to configure my sqlserver source connector, connector created succesfully.

The problem came when I tried to list the connector via the below curl request (after port-forwarding to the pod)
curl localhost:8083/connectors | jq .

I got nothing registered, however when I ran the below command:

kubectl confluent connector list

it shows that I have a registered connectors as below, I assume both are 2 faces for the same coin.

NAME                          STATUS  TASKS-READY  TASKS-FAILED  AGE
bq-sink-conn                            0             9h
mssql-source-conn                       0             9h

My question is, why is this discrepancy?, or I am missing something

also after a week of searching and looking on the internet, I can't find enough resources with example on how to use CFK and specifically Connectors CR.

Thanks,


问:
how to assign freemarker <#list> to javascript variable and use the variable values in dropdown
I have a list of employee names in a freemarker <#list>

```<code><#assign listEmployee = EntityQuery.use(delegator).select("UserId").from("Users").queryList()>

</code>```

I was able to fetch the employee names from FTL into javascript, but if the emp name has two strings, like first name and last name, then it is throwing error: unexpected identifier, because there is a space between first name and last name.

```<code><script>
var arr=[<#list listEmployee as emp>${emp.UserId},</#list>]
</script>
</code>```

the output has to be like this
[Nicole Hill,Steven Burke,Henry French DDS,Andrew Mann,Dr. Nicole Thomas,Kendra Rivera,Evelyn Austin,Valerie Carter,Michael Wolfe,Gavin Jordan]
output image

how shall I resolve this?

Body:
I have a list of employee names in a freemarker <#list>

<#assign listEmployee = EntityQuery.use(delegator).select("UserId").from("Users").queryList()>

I was able to fetch the employee names from FTL into javascript, but if the emp name has two strings, like first name and last name, then it is throwing error: unexpected identifier, because there is a space between first name and last name.

the output has to be like this
[Nicole Hill,Steven Burke,Henry French DDS,Andrew Mann,Dr. Nicole Thomas,Kendra Rivera,Evelyn Austin,Valerie Carter,Michael Wolfe,Gavin Jordan]
output image

how shall I resolve this?


问:
Flutter clean and build fail to complete

Steps to Reproduce

I'm not sure there is an exact way to reproduce this issue as it seems  to happen at random instances when building or running the project on a physical device.
I hope this is the right place to post this.
Here is an outline of how it occurs.

I have looked at issue #36763 and its not resolving the issue.

You run a project on an ADB connected device. The app will successfully build and/or  run on the devices.

Step 1 will randomly get stuck on assembling the project. This will not complete even if you wait for hours(tried it)

Ordinarily when you have a problem you will go for flutter clean . if you try this it gets also stuck for hours with no completion.

Upon inspecting this you find a file in your assembled assets with a number like "8043e5b2" but no extension.  This might be an svg, png , or jpeg image which was stripped off the extension and renamed, I found  out by looking inside the file or copying it outside of build and adding the extension.  This file will not rename, delete or be modified on any application on windows and yes that includes the IDEs.

The only solution that I found to delete this was to boot into safe mode with CMD and delete it from there.

If you pick to go with step 5 you are going to build the app successfully for a couple of times and then it happens again. The you have to go to safe boot to delete the build again.

Version info

$ flutter doctor -v

```<code>[√] Flutter (Channel stable, 3.3.10, on Microsoft Windows [Version 10.0.19045.2364], locale en-UK)
    • Flutter version 3.3.10 on channel stable at C:\Flutter\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 135454af32 (2 weeks ago), 2022-12-15 07:36:55 -0800
    • Engine revision 3316dd8728
    • Dart version 2.18.6
    • DevTools version 2.15.0

Checking Android licenses is taking an unexpectedly long time...[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at C:\Usname\AppData\Local\Android\sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\xxxxx\Chrome\Application\chrome.exe

[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2021.3)
    • Android Studio at C:\xxx\Android\Android Studio1
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[√] VS Code (version 1.74.2)
    • VS Code at C:\mypathtoinstallation\Microsoft VS Code
    • Flutter extension version 3.56.0

[√] Connected device (4 available)
    •X683 (mobile) • 192.168.xx.xx:xxxx • android-arm64  • Android
    • Windows (desktop)     • windows             • windows-x64    • Microsoft Windows [Version 10.0.19045.2364]
    • Chrome (web)          • chrome              • web-javascript • Google Chrome 108.0.5359.125
    • Edge (web)            • edge                • web-javascript • Microsoft Edge 108.0.1462.54

[√] HTTP Host Availability
    • All required HTTP hosts are available
</code>```

Body:
Steps to Reproduce

I'm not sure there is an exact way to reproduce this issue as it seems  to happen at random instances when building or running the project on a physical device.
I hope this is the right place to post this.
Here is an outline of how it occurs.

I have looked at issue #36763 and its not resolving the issue.

You run a project on an ADB connected device. The app will successfully build and/or  run on the devices.

Step 1 will randomly get stuck on assembling the project. This will not complete even if you wait for hours(tried it)

Ordinarily when you have a problem you will go for flutter clean . if you try this it gets also stuck for hours with no completion.

Upon inspecting this you find a file in your assembled assets with a number like "8043e5b2" but no extension.  This might be an svg, png , or jpeg image which was stripped off the extension and renamed, I found  out by looking inside the file or copying it outside of build and adding the extension.  This file will not rename, delete or be modified on any application on windows and yes that includes the IDEs.

The only solution that I found to delete this was to boot into safe mode with CMD and delete it from there.

If you pick to go with step 5 you are going to build the app successfully for a couple of times and then it happens again. The you have to go to safe boot to delete the build again.

Version info

$ flutter doctor -v

[√] Flutter (Channel stable, 3.3.10, on Microsoft Windows [Version 10.0.19045.2364], locale en-UK)
    • Flutter version 3.3.10 on channel stable at C:\Flutter\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 135454af32 (2 weeks ago), 2022-12-15 07:36:55 -0800
    • Engine revision 3316dd8728
    • Dart version 2.18.6
    • DevTools version 2.15.0

Checking Android licenses is taking an unexpectedly long time...[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at C:\Usname\AppData\Local\Android\sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\xxxxx\Chrome\Application\chrome.exe

[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2021.3)
    • Android Studio at C:\xxx\Android\Android Studio1
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[√] VS Code (version 1.74.2)
    • VS Code at C:\mypathtoinstallation\Microsoft VS Code
    • Flutter extension version 3.56.0

[√] Connected device (4 available)
    •X683 (mobile) • 192.168.xx.xx:xxxx • android-arm64  • Android
    • Windows (desktop)     • windows             • windows-x64    • Microsoft Windows [Version 10.0.19045.2364]
    • Chrome (web)          • chrome              • web-javascript • Google Chrome 108.0.5359.125
    • Edge (web)            • edge                • web-javascript • Microsoft Edge 108.0.1462.54

[√] HTTP Host Availability
    • All required HTTP hosts are available


问:
Uncaught TypeError: Cannot destructure property 'name' of 'response.profileObj' as it is undefined
I am using @react-oauth/google package.
Login.js

import React from 'react';
import { GoogleOAuthProvider } from '@react-oauth/google';import { useNavigate } from 'react-router-dom';
import shareVideo from '../assets/share.mp4';
import logo from '../assets/logowhite.png';
import { GoogleLogin } from '@react-oauth/google';
import { client } from '../client';

const Login = () => {
  const navigate = useNavigate();

  const responseGoogle=(response) => {
    localStorage.setItem('user', JSON.stringify(response.profileObj))

    const {name, googleId, imageUrl} = response.profileObj;
    const doc = {
      _id: googleId,
      _type: 'user',
      image: imageUrl,
      userName: name,
    }
    client.createIfNotExists(doc)
      .then(() =>{
        navigate('/', {replace:true})
      })
  }
  return (

        <video src={shareVideo}
        type="video/mp4"
        loop
        muted
        autoPlay
        className='w-full h-full object-cover'
        />

                <GoogleOAuthProvider
                   clientId={process.env.REACT_APP_GOOGLE_API_TOKEN}
                >
                  <GoogleLogin
                    onSuccess= {responseGoogle}
                    onError={() => {
                      console.log('Login Failed');
                    }}
                    cookiePolicy="single_host_origin"
                  />;
                </GoogleOAuthProvider>

  );
}

export default Login;
```
<p>I got console error:-Cannot destructure property 'name' of 'response.profileObj' as it is undefined.
I want to route to homepage but its not working.
<img src="https://i.stack.imgur.com/hT2VI.png" alt="enter image description here" /></p>
<p>i tried to use gapi</p>
<pre class="lang-js prettyprint-override"><code>import React from 'react';
import { GoogleOAuthProvider } from '@react-oauth/google';import { useNavigate } from 'react-router-dom';
import shareVideo from '../assets/share.mp4';
import logo from '../assets/logowhite.png';
import { GoogleLogin } from '@react-oauth/google';
import { client } from '../client';
import { gapi } from "gapi-script";

const Login = () => {
  const navigate = useNavigate();
  const clientId={process.env.REACT_APP_GOOGLE_API_TOKEN}
  const initClient = () => {
    gapi.client.init({
      clientId: clientId,
      scope: "",
    });
  };
  gapi.load("client:auth2", initClient);
  const responseGoogle=(response) => {
    localStorage.setItem('user', JSON.stringify(response.profileObj))

    const {name, googleId, imageUrl} = response.profileObj;
    const doc = {
      _id: googleId,
      _type: 'user',
      image: imageUrl,
      userName: name,
    }
    client.createIfNotExists(doc)
      .then(() =>{
        navigate('/', {replace:true})
      })
  }
  return (
    <div className='flex justify-start items-center flex-col h-screen'>
      <div className='relative w-full h-full'>
        <video src={shareVideo}
        type="video/mp4"
        loop
        muted
        autoPlay
        className='w-full h-full object-cover'
        />
        <div className='absolute flex flex-col justify-center items-center top-0 right-0 left-0 bottom-0 bg-blackOverlay'>
            <div className='p-5'>
              <img src={logo} width="130px" alt="logo" />
            </div>
            <div className='shadow-2x1'>
                <GoogleOAuthProvider
                   clientId={process.env.REACT_APP_GOOGLE_API_TOKEN}
                >
                  <GoogleLogin
                    onSuccess= {responseGoogle}
                    onError={() => {
                      console.log('Login Failed');
                    }}
                  />;
                </GoogleOAuthProvider>
            </div>
        </div>
      </div>
    </div>
  );
}

export default Login;

</code>```

got console error Forced reflow while executing JavaScript.
I don't know how to solve this problem.

Body:
I am using @react-oauth/google package.
Login.js

import React from 'react';
import { GoogleOAuthProvider } from '@react-oauth/google';import { useNavigate } from 'react-router-dom';
import shareVideo from '../assets/share.mp4';
import logo from '../assets/logowhite.png';
import { GoogleLogin } from '@react-oauth/google';
import { client } from '../client';

const Login = () => {
  const navigate = useNavigate();

  const responseGoogle=(response) => {
    localStorage.setItem('user', JSON.stringify(response.profileObj))

    const {name, googleId, imageUrl} = response.profileObj;
    const doc = {
      _id: googleId,
      _type: 'user',
      image: imageUrl,
      userName: name,
    }
    client.createIfNotExists(doc)
      .then(() =>{
        navigate('/', {replace:true})
      })
  }
  return (

        <video src={shareVideo}
        type="video/mp4"
        loop
        muted
        autoPlay
        className='w-full h-full object-cover'
        />

                <GoogleOAuthProvider
                   clientId={process.env.REACT_APP_GOOGLE_API_TOKEN}
                >
                  <GoogleLogin
                    onSuccess= {responseGoogle}
                    onError={() => {
                      console.log('Login Failed');
                    }}
                    cookiePolicy="single_host_origin"
                  />;
                </GoogleOAuthProvider>

  );
}

export default Login;

I got console error:-Cannot destructure property 'name' of 'response.profileObj' as it is undefined.
I want to route to homepage but its not working.

i tried to use gapi

import React from 'react';
import { GoogleOAuthProvider } from '@react-oauth/google';import { useNavigate } from 'react-router-dom';
import shareVideo from '../assets/share.mp4';
import logo from '../assets/logowhite.png';
import { GoogleLogin } from '@react-oauth/google';
import { client } from '../client';
import { gapi } from "gapi-script";

const Login = () => {
  const navigate = useNavigate();
  const clientId={process.env.REACT_APP_GOOGLE_API_TOKEN}
  const initClient = () => {
    gapi.client.init({
      clientId: clientId,
      scope: "",
    });
  };
  gapi.load("client:auth2", initClient);
  const responseGoogle=(response) => {
    localStorage.setItem('user', JSON.stringify(response.profileObj))

    const {name, googleId, imageUrl} = response.profileObj;
    const doc = {
      _id: googleId,
      _type: 'user',
      image: imageUrl,
      userName: name,
    }
    client.createIfNotExists(doc)
      .then(() =>{
        navigate('/', {replace:true})
      })
  }
  return (

        <video src={shareVideo}
        type="video/mp4"
        loop
        muted
        autoPlay
        className='w-full h-full object-cover'
        />

                <GoogleOAuthProvider
                   clientId={process.env.REACT_APP_GOOGLE_API_TOKEN}
                >
                  <GoogleLogin
                    onSuccess= {responseGoogle}
                    onError={() => {
                      console.log('Login Failed');
                    }}
                  />;
                </GoogleOAuthProvider>

  );
}

export default Login;

got console error Forced reflow while executing JavaScript.
I don't know how to solve this problem.


问:
How to create custom retry logic for aiobotocore?
I'm trying to upload a lot of files to S3. This cannot be done with the standard AWS CLI because of the translation required between file names on disk and object names in S3.  Indeed may of the objects don't exist at all on disk.

I keep getting an error:

```<code>botocore.exceptions.ClientError: An error occurred (SlowDown) when calling the PutObject operation (reached max retries: 0): Please reduce your request rate
</code>```

It doesn't seem to make a difference wether I use boto3 / botocore / aioboto3 / aiobotocore.  I've tried various configurations of retry logic as described here.  Nothing seems to fix the problem.  That includes all three retry modes and retry counts ranging everything from 0 to 50.

I could add custom retry logic to every method that calls the client but that's going to be a lot of work and feels like the wrong approach.

Is it possible to customize the retry logic used by boto3 or aiobotocore?

Body:
I'm trying to upload a lot of files to S3. This cannot be done with the standard AWS CLI because of the translation required between file names on disk and object names in S3.  Indeed may of the objects don't exist at all on disk.

I keep getting an error:

botocore.exceptions.ClientError: An error occurred (SlowDown) when calling the PutObject operation (reached max retries: 0): Please reduce your request rate

It doesn't seem to make a difference wether I use boto3 / botocore / aioboto3 / aiobotocore.  I've tried various configurations of retry logic as described here.  Nothing seems to fix the problem.  That includes all three retry modes and retry counts ranging everything from 0 to 50.

I could add custom retry logic to every method that calls the client but that's going to be a lot of work and feels like the wrong approach.

Is it possible to customize the retry logic used by boto3 or aiobotocore?


问:
Cloud run cold start spring boot issue
I have login API developed in spring boot and deployed on cloud run with min instance 1. But for some request it is taking 20s to process which is not desirable. When I checked logs, I found that application is starting again and it is taking time and most of request are processed within 100ms .Please suggest where Im going wrong.

I found that it was a cold start problem so kept min instance to 1. But still for some request it is taking  more time than expected.

Title: Cloud run cold start spring boot issue


问:
ImportError: cannot import name 'weather_api_key' from 'config'
I am trying to import an API key from a python file and I get this error:

ImportError                               Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_27940\425884591.py in
9
10 # Import the OpenWeatherMap's API key
---> 11 from config import weather_api_key

ImportError: cannot import name 'weather_api_key' from 'config' (C:\Users\mjrm_\anaconda3\envs\PythonData\lib\site-packages\config_init_.py)

```<code>
I have done many fixes that I found but I keep getting this error.

I tried changing the py file name and also attempted verifiy loading different packages into my environment, I feel like the error fix is simple but I cannot figure this out
</code>```

Body:
I am trying to import an API key from a python file and I get this error:

ImportError                               Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_27940\425884591.py in
9
10 # Import the OpenWeatherMap's API key
---> 11 from config import weather_api_key

ImportError: cannot import name 'weather_api_key' from 'config' (C:\Users\mjrm_\anaconda3\envs\PythonData\lib\site-packages\config_init_.py)

I have done many fixes that I found but I keep getting this error.

I tried changing the py file name and also attempted verifiy loading different packages into my environment, I feel like the error fix is simple but I cannot figure this out


问:
django: modelChoiceField form not working in template
I am confronted for the first time to a situation where I want the user to select model column values based on some constraint. The goal is to have the user select something and then output the result below the form on the same page.

I am not sure what I am doing wrong but submiting the form output:

```<code>Select a valid choice. That choice is not one of the available choices.
</code>```

Here is what I have been able to do:
forms.py

```<code>class SelectBuildingForm(forms.Form):
    filename = forms.ModelChoiceField(queryset=Building.objects.none())

    def __init__(self, *args, **kwargs):
        us = args[1] or None
        forms.Form.__init__(self, *args, **kwargs)
        self.fields['filename'].queryset = Building.objects.filter(project=us).values_list('filename',flat=True)
</code>```

views.py

```<code>@login_required
@owner_required
def FileSelectionView(request,pk):
    form = SelectBuildingForm(request.POST or None, pk)
    # if form.is_valid():
    #     filename = form.cleaned_data('filename')
    #     print(filename)
    #     return redirect('comparator_test')

    return render(request,'files_selection.html', {'form':form})
</code>```

and template

```<code>    <div class="mt-5 md:col-span-2 md:mt-0">

      <form method="POST"  id="my-form">
        {% csrf_token %}
        {{ form.as_p }}
        <button type="submit" value="Select">GOOOO</button>
      </form>
      {% if form.is_valid %}
    {% for choice in form.cleaned_data.choices %}
       <p>{{ choice }}</p>
    {% endfor %}
{% endif %}
    </div>
</code>```

I have tried a couple options to validate the selection but none of them work. Can a pair of fresh eyes see where I am messing up?

Body:
I am confronted for the first time to a situation where I want the user to select model column values based on some constraint. The goal is to have the user select something and then output the result below the form on the same page.

I am not sure what I am doing wrong but submiting the form output:

Select a valid choice. That choice is not one of the available choices.

Here is what I have been able to do:
forms.py

class SelectBuildingForm(forms.Form):
    filename = forms.ModelChoiceField(queryset=Building.objects.none())

    def __init__(self, *args, **kwargs):
        us = args[1] or None
        forms.Form.__init__(self, *args, **kwargs)
        self.fields['filename'].queryset = Building.objects.filter(project=us).values_list('filename',flat=True)

views.py

@login_required
@owner_required
def FileSelectionView(request,pk):
    form = SelectBuildingForm(request.POST or None, pk)
    # if form.is_valid():
    #     filename = form.cleaned_data('filename')
    #     print(filename)
    #     return redirect('comparator_test')

    return render(request,'files_selection.html', {'form':form})

and template

      <form method="POST"  id="my-form">
        {% csrf_token %}
        {{ form.as_p }}
        <button type="submit" value="Select">GOOOO</button>
      </form>
      {% if form.is_valid %}
    {% for choice in form.cleaned_data.choices %}

{{ choice }}

    {% endfor %}
{% endif %}

I have tried a couple options to validate the selection but none of them work. Can a pair of fresh eyes see where I am messing up?


问:
unable to store the data from from tweet api V2 to mongodb
currently I'm doing my project on tweet feed analysis using Tweet API v2 and storing it in mongodb.
I need to fetch data from tweet API v2 and store it in mongodb, i took tweepylistener class which is for API V1.1 and replaced StreamingClient, but that class doesn't save collection to the mongodb database

i had seen many references and tutorial, nothing works for Twitter API V2, so help me with the solution of class to store the collection from twitter API V2 to mongodb DataBase

here is my code..

```<code>class TweepyListener(tweepy.StreamingClient) :
    def on_tweet(self, tweet):
        print(tweet.id)
        try :
            tweet_collection. insert_one( tweet ._json)
        except :
            pass
    def on_error(self, tweet_code) :
        if status_code == 420:
            return False

my_stream = TweepyListener("Bearer Token Here")
my_stream.sample()
</code>```

I tried taking the tweetlistener class for API V1.1 and change it for V2 and checked but it doesn't work

Body:
currently I'm doing my project on tweet feed analysis using Tweet API v2 and storing it in mongodb.
I need to fetch data from tweet API v2 and store it in mongodb, i took tweepylistener class which is for API V1.1 and replaced StreamingClient, but that class doesn't save collection to the mongodb database

i had seen many references and tutorial, nothing works for Twitter API V2, so help me with the solution of class to store the collection from twitter API V2 to mongodb DataBase

here is my code..

class TweepyListener(tweepy.StreamingClient) :
    def on_tweet(self, tweet):
        print(tweet.id)
        try :
            tweet_collection. insert_one( tweet ._json)
        except :
            pass
    def on_error(self, tweet_code) :
        if status_code == 420:
            return False

my_stream = TweepyListener("Bearer Token Here")
my_stream.sample()

I tried taking the tweetlistener class for API V1.1 and change it for V2 and checked but it doesn't work


问:
Fluent-ffmpeg Invalid data found when processing input error only when the second request is received
I am using Node.js for backend to use ffmpeg. To use ffmpeg, I adopted fluent-ffmpeg. This is working perfectly except for one problem. That is when I send video from client side SPA(single page application) to the server-side for the "second" time, node application crashes.

What I did is saving the received video in the backend folder, which is made in the process, and taking a snapshot of the video.
This code actually works everytime after restarting the server, but once I used this route and try another time, the error message "Invalid data found when processing input video ./received/${receivedName}" comes up.

```<code>app.post("/convert", fileUpload({ createParentPath: true }), async function (req, res) {
    makeDir(receivedVideoDirectory);
    const receivedName = Object.keys(req.files)[0];
    const directoryName = receivedName.substring(0, receivedName.indexOf("."));

    const receivedFile = req.files[receivedName];
    transcodedSegFolder = `./public/transcoded/${dirName}`;
    console.log("transcoded segment file folder is here", transcodedSegFolder);
    makeDir(transcodedSegFolder);

    fs.open(`./received/${receivedName}`, 'w', (err, fd) => {
        if (err) throw err;
        fs.writeFile(fd, receivedFile["data"], function (err) {
            if (err) {
                return console.log("Err in write file ", err);
            }
            console.log("The file was saved!", receivedName);
            fs.close(fd, (err) => {
                if (err) throw err;
            });
        });
    });

    ffmpeg(`./received/${receivedName}`)
        .takeScreenshots(
            {
                count: 1,
                timemarks: ['00:00:01.000'],
                folder: './public/thumbnails',
                filename: dirName
            }).on('error', function(err) {
                console.log('screenshot error happened: ' + err.message);
              }).on('end', function(err) {
                console.log('Screenshot process finished: ');
              });
</code>```

Probably some program keeps working, but I cannot find it. Any help is appreciated. Thank you.

Body:
I am using Node.js for backend to use ffmpeg. To use ffmpeg, I adopted fluent-ffmpeg. This is working perfectly except for one problem. That is when I send video from client side SPA(single page application) to the server-side for the "second" time, node application crashes.

What I did is saving the received video in the backend folder, which is made in the process, and taking a snapshot of the video.
This code actually works everytime after restarting the server, but once I used this route and try another time, the error message "Invalid data found when processing input video ./received/${receivedName}" comes up.

app.post("/convert", fileUpload({ createParentPath: true }), async function (req, res) {
    makeDir(receivedVideoDirectory);
    const receivedName = Object.keys(req.files)[0];
    const directoryName = receivedName.substring(0, receivedName.indexOf("."));

    const receivedFile = req.files[receivedName];
    transcodedSegFolder = `./public/transcoded/${dirName}`;
    console.log("transcoded segment file folder is here", transcodedSegFolder);
    makeDir(transcodedSegFolder);

    fs.open(`./received/${receivedName}`, 'w', (err, fd) => {
        if (err) throw err;
        fs.writeFile(fd, receivedFile["data"], function (err) {
            if (err) {
                return console.log("Err in write file ", err);
            }
            console.log("The file was saved!", receivedName);
            fs.close(fd, (err) => {
                if (err) throw err;
            });
        });
    });

    ffmpeg(`./received/${receivedName}`)
        .takeScreenshots(
            {
                count: 1,
                timemarks: ['00:00:01.000'],
                folder: './public/thumbnails',
                filename: dirName
            }).on('error', function(err) {
                console.log('screenshot error happened: ' + err.message);
              }).on('end', function(err) {
                console.log('Screenshot process finished: ');
              });

Probably some program keeps working, but I cannot find it. Any help is appreciated. Thank you.


问:
Create a timeline events similar to oneview calendar in Flutter
Can you please help me make a timeline exactly like the one in the OneView Calendar application?

I want to use VSCode, Flutter and Dart for this.

I want it to be a single timeline calendar and to be able to zoom with 2 fingers to go until the hours are displayed, and if you zoom out to go until the years are displayed. I want to enter by events, for example: from the date of, to the date of.

I am attaching some image from the OneView Calendar application.

Any help is welcome. At least I know where to start, which library to use.

Thank you !

At the moment I installed VSCode, SDK Dart and SDK Flutter and I did a test with an emulator to see that everything works correctly.


问:
Codeigniter - how to integrate third-party library installed via composer
I try integrate external php inpost library:
https://github.com/imper86/php-inpost-api

I run composer install:

```<code> - Installing symfony/polyfill-php73 (v1.27.0): Extracting archive
  - Installing symfony/options-resolver (v5.4.11): Extracting archive
  - Installing psr/cache (1.0.1): Extracting archive
  - Installing php-http/client-common (2.6.0): Extracting archive
  - Installing imper86/php-http-cache-plugin (2.0.0): Extracting archive
  - Installing imper86/http-client-builder (v2.0.0): Extracting archive
  - Installing imper86/php-inpost-api (v1.1.9): Extracting archive
</code>```

Now all this files I have in public_html/vendor folder.

structure image

I fallow to this example guide:

```<code>https://www.wdb24.com/how-to-integrate-faker-as-a-third-party-into-codeigniter/
</code>```

But for me looks like I have dirrfrent this files structure. Example when I rename folder src and call:

```<code>include APPPATH.'/third_party/imper86/autoload.php';
</code>```

but in imper86 I have 3 extra folders with containst src folder like http-client-builder php-http-cache-plugin and php-inpost-api

Also as is shown in log from composer installation, this library require also symfony psr and php-http

and now im not sure how to now copy this folders to correct structure to working together everything.

Body:
I try integrate external php inpost library:
https://github.com/imper86/php-inpost-api

I run composer install:

 - Installing symfony/polyfill-php73 (v1.27.0): Extracting archive
  - Installing symfony/options-resolver (v5.4.11): Extracting archive
  - Installing psr/cache (1.0.1): Extracting archive
  - Installing php-http/client-common (2.6.0): Extracting archive
  - Installing imper86/php-http-cache-plugin (2.0.0): Extracting archive
  - Installing imper86/http-client-builder (v2.0.0): Extracting archive
  - Installing imper86/php-inpost-api (v1.1.9): Extracting archive

Now all this files I have in public_html/vendor folder.

structure image

I fallow to this example guide:

https://www.wdb24.com/how-to-integrate-faker-as-a-third-party-into-codeigniter/

But for me looks like I have dirrfrent this files structure. Example when I rename folder src and call:

include APPPATH.'/third_party/imper86/autoload.php';

but in imper86 I have 3 extra folders with containst src folder like http-client-builder php-http-cache-plugin and php-inpost-api

Also as is shown in log from composer installation, this library require also symfony psr and php-http

and now im not sure how to now copy this folders to correct structure to working together everything.


问:
Dropdown property setting for a Comboboxcol in datagridview in vb.net
I am facing a problem in VB.Net Winforms Application.  I am using VS 2019.
The problem is the combobox column in Datagridview is not dropping down to show the list.
mDT and mDT1 are DataTables
ShowData is the name of the Datagridview
The properties in the designer for Show Data is shown below ( partially )

I tried various suggestions given in MSDN as well as here but am not successful.  Might be because those might be old or are implemented differently in VS 2019.

```<code>The properties in the designer for Show Data is shown below ( partially )
 [DGV Properties](https://i.stack.imgur.com/h60oO.jpg)

The Code
        Dim mRow As DataRow
        mDT = gDT_Structures.Copy()

        mDT1 = New DataTable
        mDT1.Columns.Add("PFID")
        mDT1.AcceptChanges()
        mRow = mDT1.NewRow()
        mRow("PFID") = "PFID01"
        mDT1.Rows.Add(mRow)
        mDT1.AcceptChanges()
        mRow = mDT1.NewRow()
        mRow("PFID") = "PFID02"
        mDT1.Rows.Add(mRow)
        mDT1.AcceptChanges()

        ShowData.Visible = True
        ShowData.DataSource = mDT
        '//Combobox column.
        Dim ComboBoxcol = New DataGridViewComboBoxColumn()
        ComboBoxcol.DataSource = mDT1
        ComboBoxcol.Name = "PFID"
        ComboBoxcol.ValueMember = "PFID"
        ComboBoxcol.DisplayMember = "PFID"

        ShowData.Columns.Add(ComboBoxcol)

        For i = 0 To ShowData.Columns.Count() - 1
            ShowData.Columns(i).ReadOnly = False
        Next
        ShowData.Select()
        ShowData.Show()

The results View
 [DGV Result](https://i.stack.imgur.com/l1Wi1.jpg)

Request guidance.
Thanks in Advance.

</code>```

Body:
I am facing a problem in VB.Net Winforms Application.  I am using VS 2019.
The problem is the combobox column in Datagridview is not dropping down to show the list.
mDT and mDT1 are DataTables
ShowData is the name of the Datagridview
The properties in the designer for Show Data is shown below ( partially )

I tried various suggestions given in MSDN as well as here but am not successful.  Might be because those might be old or are implemented differently in VS 2019.

The properties in the designer for Show Data is shown below ( partially )
 [DGV Properties](https://i.stack.imgur.com/h60oO.jpg)

The Code
        Dim mRow As DataRow
        mDT = gDT_Structures.Copy()

        mDT1 = New DataTable
        mDT1.Columns.Add("PFID")
        mDT1.AcceptChanges()
        mRow = mDT1.NewRow()
        mRow("PFID") = "PFID01"
        mDT1.Rows.Add(mRow)
        mDT1.AcceptChanges()
        mRow = mDT1.NewRow()
        mRow("PFID") = "PFID02"
        mDT1.Rows.Add(mRow)
        mDT1.AcceptChanges()

        ShowData.Visible = True
        ShowData.DataSource = mDT
        '//Combobox column.
        Dim ComboBoxcol = New DataGridViewComboBoxColumn()
        ComboBoxcol.DataSource = mDT1
        ComboBoxcol.Name = "PFID"
        ComboBoxcol.ValueMember = "PFID"
        ComboBoxcol.DisplayMember = "PFID"

        ShowData.Columns.Add(ComboBoxcol)

        For i = 0 To ShowData.Columns.Count() - 1
            ShowData.Columns(i).ReadOnly = False
        Next
        ShowData.Select()
        ShowData.Show()

The results View
 [DGV Result](https://i.stack.imgur.com/l1Wi1.jpg)

Request guidance.
Thanks in Advance.


问:
How to draw a leaflet polyline with relative length to another leaflet polyline
I try to create a leaflet polyline on top of another polyline. The first polyline is a simple one between two coordinates. Its 500 miles long. The second one should have the exact same path, but a configurable length, e.g. 100 miles, 237 miles, etc. Second line should be drawn with same path, just shorter.

If second polyline get coordinates:
polyline2.coord1 = [polyline1.coord1.lat, polyline1.coord1.lng]
polyline2.coord2 = [(polyline1.coord1.lat + polyline1.coord2.lat) / 2, (polyline1.coord1.lng + polyline1.coord2.lng) / 2]

Second polyline is perfectly on top of first polyline. But the length is always 50%, in example case, 250 miles. Because the above calculation gets the exact point in the middle.

How do I get points/coords between polyline1.coord1 & polyline1.coord2, e.g. 100 miles from coord1?
So what I need to calculate is the 2nd coordinate set of polyline2. And I am out of ideas to go beyond the exact middle point solution. Some help would be appreciated much.


问:
result.rows undefined in passport.js using google Oauth20
I was trying to implement a third party login in using the passport.js strategy Oauth20. It looks like that everything works correctly besides from the fact that when trying to insert my user in the database the result of the rows returns as undefined even though I can see the profile being added to the database.

See my passport.js below:

```<code>passport.use(new GoogleStrategy({
    clientID: "261273528668-u49b84sr0r8qjerk414jpk1u0odsveoh.apps.googleusercontent.com",
    clientSecret: "************************",
    callbackURL: "http://localhost:5000/auth/google/callback",
    passReqToCallback: true
}, (request, accessToken, refreshToken, profile, done) => {
    customer_email = profile.emails[0].value;
    console.log(customer_email);
    pool.query(`select * from customers where email='${customer_email}'`, (err, result) => {

        if (err) { throw err }

        // If the customer is in the database
        if (result.rows.length > 0) {

            const customer = result.rows[0];
            return done(null, customer)
        }
        // If the customer is not in the database
        else {
            const email = profile.emails[0].value;
            console.log(profile.name)
            const customer_name = (profile.name.givenName) ? profile.name.givenName : '';
            const address = '';
            const customer_password = '';
            /// Fix the entries in the database and set credentials for fetch request in cart
            let query = `insert into customers (customer_name,address,email,customer_password)  values ('${customer_name}','${address}','${email}','${customer_password}')`;
            // console.log(query);
            pool.query(query, (err, result) => {
                if (err) {
                    return done(null, false);
                } else {
                    console.log('In passport, printing the result of the query', result);
                    const customer = result.rows[0];
                    console.log(customer);
                    return done(null, customer)
                }

            });

        }
    });
</code>```

Any suggestions/help would be greatly appreciated.

Body:
I was trying to implement a third party login in using the passport.js strategy Oauth20. It looks like that everything works correctly besides from the fact that when trying to insert my user in the database the result of the rows returns as undefined even though I can see the profile being added to the database.

See my passport.js below:

passport.use(new GoogleStrategy({
    clientID: "261273528668-u49b84sr0r8qjerk414jpk1u0odsveoh.apps.googleusercontent.com",
    clientSecret: "************************",
    callbackURL: "http://localhost:5000/auth/google/callback",
    passReqToCallback: true
}, (request, accessToken, refreshToken, profile, done) => {
    customer_email = profile.emails[0].value;
    console.log(customer_email);
    pool.query(`select * from customers where email='${customer_email}'`, (err, result) => {

        if (err) { throw err }

        // If the customer is in the database
        if (result.rows.length > 0) {

            const customer = result.rows[0];
            return done(null, customer)
        }
        // If the customer is not in the database
        else {
            const email = profile.emails[0].value;
            console.log(profile.name)
            const customer_name = (profile.name.givenName) ? profile.name.givenName : '';
            const address = '';
            const customer_password = '';
            /// Fix the entries in the database and set credentials for fetch request in cart
            let query = `insert into customers (customer_name,address,email,customer_password)  values ('${customer_name}','${address}','${email}','${customer_password}')`;
            // console.log(query);
            pool.query(query, (err, result) => {
                if (err) {
                    return done(null, false);
                } else {
                    console.log('In passport, printing the result of the query', result);
                    const customer = result.rows[0];
                    console.log(customer);
                    return done(null, customer)
                }

            });

        }
    });

Any suggestions/help would be greatly appreciated.


问:
I want to execute a procedure in spring boot application using MYBATIS as ORM Framework
So I call the procedure using @Select Annotation in my mapper Interface

```<code>@Select("EXEC Procedure_tg '#{Br}','#{Pr}'")
 String getdummyData(@Param("Br") String Br,@Param("pr") String Pr);
</code>```

Will this work or not .If not then how can I call proc

Body:
So I call the procedure using @Select Annotation in my mapper Interface

@Select("EXEC Procedure_tg '#{Br}','#{Pr}'")
 String getdummyData(@Param("Br") String Br,@Param("pr") String Pr);

Will this work or not .If not then how can I call proc


问:
Hook woocommerce_checkout_order_processed not firing and change status in custom plugin
I have tried changing my_status in my_cart_custom_table table in my custom plugin.

So I'm trying to create a plugin to send messages when a customer leaves their item in the cart. When this is done, my_status will be "1" in my_cart_custom_table

As long as the value in my_status is "1", messages will continue to be sent to customer phone number.

However when the customer continues their abandoned cart by placing an order (Pay Now in Checkout Page), my_status should change to "2".

But I have no more idea what's wrong with my code.

What I want is to change the value of my_status from 1 to 2, when the customer places an order (presses the "Pay Now" button) on the checkout page.

Here's my code :

```<code>private function define_public_hooks() {

  $this->loader->add_action( 'woocommerce_checkout_order_processed', $plugin_public,'my_change_order_status_place_order' , 999, 4);
}

public function my_change_order_status_place_order($order_id, $posted_data, $order){

        global $wpdb;
        $check = true;
        $table_name = $wpdb->prefix . 'my_cart_custom_table';
        if (is_a($order, 'WC_Order_Refund')) {
            $check = false;
        }

        if ($check) {
            $billing_phone  = $order->get_billing_phone();
            $customernumber = preg_replace('/[^0-9]/', '', $billing_phone);
            $country_code = $order->get_billing_country();
        $check_abandoned_entry_sql = $wpdb->prepare("SELECT id, my_customer_id FROM $table_name WHERE my_customer_mobile_no LIKE '$customernumber' AND my_status IN (0,1)");

            $matching_results = $wpdb->get_results($check_abandoned_entry_sql);

            if (is_array($matching_results) && COUNT($matching_results) > 0) {
                foreach ($matching_results as $result) {
                    $customer_id = $result->my_customer_id;
                    $wpdb->update($table_name, array("my_status" => 2), array('my_customer_id' => $customer_id));
                }
            }
        }

    }
</code>```

It does not change the value "1" in my_status to "2" when the customer places an order on the checkout page.

Anyone who answers or can help me find the problem here would greatly appreciate your help.

Thanks

I have also tried to follow some of the discussions here:

Hook woocommerce_checkout_order_processed order items issue
Any idea why woocommerce_checkout_order_processed not firing when user is not logged in?
Grab order details in hook woocommerce_checkout_order_processed
WooCommerce: Checkout order processed hook fire issue

Body:
I have tried changing my_status in my_cart_custom_table table in my custom plugin.

So I'm trying to create a plugin to send messages when a customer leaves their item in the cart. When this is done, my_status will be "1" in my_cart_custom_table

As long as the value in my_status is "1", messages will continue to be sent to customer phone number.

However when the customer continues their abandoned cart by placing an order (Pay Now in Checkout Page), my_status should change to "2".

But I have no more idea what's wrong with my code.

What I want is to change the value of my_status from 1 to 2, when the customer places an order (presses the "Pay Now" button) on the checkout page.

Here's my code :

private function define_public_hooks() {

  $this->loader->add_action( 'woocommerce_checkout_order_processed', $plugin_public,'my_change_order_status_place_order' , 999, 4);
}

public function my_change_order_status_place_order($order_id, $posted_data, $order){

        global $wpdb;
        $check = true;
        $table_name = $wpdb->prefix . 'my_cart_custom_table';
        if (is_a($order, 'WC_Order_Refund')) {
            $check = false;
        }

        if ($check) {
            $billing_phone  = $order->get_billing_phone();
            $customernumber = preg_replace('/[^0-9]/', '', $billing_phone);
            $country_code = $order->get_billing_country();
        $check_abandoned_entry_sql = $wpdb->prepare("SELECT id, my_customer_id FROM $table_name WHERE my_customer_mobile_no LIKE '$customernumber' AND my_status IN (0,1)");

            $matching_results = $wpdb->get_results($check_abandoned_entry_sql);

            if (is_array($matching_results) && COUNT($matching_results) > 0) {
                foreach ($matching_results as $result) {
                    $customer_id = $result->my_customer_id;
                    $wpdb->update($table_name, array("my_status" => 2), array('my_customer_id' => $customer_id));
                }
            }
        }

    }

It does not change the value "1" in my_status to "2" when the customer places an order on the checkout page.

Anyone who answers or can help me find the problem here would greatly appreciate your help.

Thanks

I have also tried to follow some of the discussions here:

Hook woocommerce_checkout_order_processed order items issue
Any idea why woocommerce_checkout_order_processed not firing when user is not logged in?
Grab order details in hook woocommerce_checkout_order_processed
WooCommerce: Checkout order processed hook fire issue


问:
Need to export all users in active directory with specific memberof details
I need to export all users in active directory with specific memberof details. For example i need to export all the users details from active directory with specific memberof details like group starts like RDS. Rest of the groups i dont want to export in csv file.

```<code>get-aduser -filter * -Properties name,memberof |select name, @{n=’MemberOf’; e= { ( $_.memberof | % { (Get-ADObject $_).Name }) -join “,” }} | export-csv D:\users.csv -nti
</code>```

Current Output

Body:
I need to export all users in active directory with specific memberof details. For example i need to export all the users details from active directory with specific memberof details like group starts like RDS. Rest of the groups i dont want to export in csv file.

get-aduser -filter * -Properties name,memberof |select name, @{n=’MemberOf’; e= { ( $_.memberof | % { (Get-ADObject $_).Name }) -join “,” }} | export-csv D:\users.csv -nti

Current Output


问:
How can i replace PowerMockito.whenNew(obj.class).thenReturn() with a function of a Mockk library?
I want to remove PowerMockito from poject and replace it to Mockk library

Example:

```<code>`class One {

    fun doSomething(){
        val two: Two = Two()
        two.f()
    }
}

class Two {

    fun f(){}
}
</code>```

If i use PowerMockito, it looks like

```<code>@Test
`fun test {
    val two = PowerMockito.mock(Two::class.java)

    PowerMockito.whenNew(Two::class.java).thenReturn(two)

    val one = One()
    one.doSomething()

    PowerMockito.verify(two).f()
}`
</code>```
```<code></code>```

Body:
I want to remove PowerMockito from poject and replace it to Mockk library

Example:

`class One {

    fun doSomething(){
        val two: Two = Two()
        two.f()
    }
}

class Two {

    fun f(){}
}

If i use PowerMockito, it looks like

@Test
`fun test {
    val two = PowerMockito.mock(Two::class.java)

    PowerMockito.whenNew(Two::class.java).thenReturn(two)

    val one = One()
    one.doSomething()

    PowerMockito.verify(two).f()
}`


问:
base set-up rails 7 stimulus javascript controller
Context: pinning the leaflet library and running a script within a view. Assuming rendering this example, the page would have a script block with data drawn from instance variables

```<code><script>
    const map = L.map('map').setView([<%= @lat %>, <%= @lon %>], <%= @zoom %>);
[...]
</script>
</code>```

the rails documentation states that the basic building block is as follows which was set for assets/javascript/controllers/map_controller.js

```<code>import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
  // …
   static targets = ["map-holder"]

}
</code>```

the view has a div target
 but renders only css instructions. The emptiness ought to be explained by the console error

```<code>Failed to register controller: map (controllers/map_controller) ReferenceError: Controller is not defined
</code>```

however this points to a line eagerLoadControllersFrom("controllers", application) which is auto-magically generated by rails somehow.

My understanding is scattered, particularly after examining libraries and their varying syntax.

The only implementation that works is to bluntly bypass stimulus

```<code><script src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js" integrity="sha256-WBkoXOwTeyKclOHuWtc+i2uENFpDZ9YPdf5Hf+D7ewM=" crossorigin=""></script>
<div id="map" style="min-height: 400px; max-width: 80%;"></div>
<script>

    const map = L.map('map').setView([<%= lat %>, <%= lon %>], <%= zoom %>);
    const tiles = L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
        maxZoom: 19,
        attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
    }).addTo(map);
[...]
</code>```

Thus, after pinning the library, confirmed by header

```<code><script type="importmap" data-turbo-track="reload">{
  "imports": {   "leaflet": "https://ga.jspm.io/npm:leaflet@1.9.3/dist/leaflet-src.js",
</code>```

this script is possibly now twice on the page.

How can the initial goal be achieved with proper initialisation of the stimulus controller, and obviously not calling the script source from within the view ?

Body:
Context: pinning the leaflet library and running a script within a view. Assuming rendering this example, the page would have a script block with data drawn from instance variables

the rails documentation states that the basic building block is as follows which was set for assets/javascript/controllers/map_controller.js

import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
  // …
   static targets = ["map-holder"]

}

the view has a div target
 but renders only css instructions. The emptiness ought to be explained by the console error

Failed to register controller: map (controllers/map_controller) ReferenceError: Controller is not defined

however this points to a line eagerLoadControllersFrom("controllers", application) which is auto-magically generated by rails somehow.

My understanding is scattered, particularly after examining libraries and their varying syntax.

The only implementation that works is to bluntly bypass stimulus


问:
How do I set LD_LIBRARY_PATH using gradle?
I want to use a library with a C++ project and I need to set the LD_LIBRARY_PATH to get it to compile and execute fine. The code compilation is done using gradle. I am trying to set the LD_LIBRARY_PATH in build.gradle as below but it doesn't seem to work:

```<code>task exportLDLibPath() {
    exec {
        environment 'LD_LIBRARY_PATH', '/path/to/lib'
    }
    project.check.dependsOn it
}
</code>```

What am I missing here? I need to path to be set so that the unit tests can run.

Body:
I want to use a library with a C++ project and I need to set the LD_LIBRARY_PATH to get it to compile and execute fine. The code compilation is done using gradle. I am trying to set the LD_LIBRARY_PATH in build.gradle as below but it doesn't seem to work:

task exportLDLibPath() {
    exec {
        environment 'LD_LIBRARY_PATH', '/path/to/lib'
    }
    project.check.dependsOn it
}

What am I missing here? I need to path to be set so that the unit tests can run.