问:
PeerJS Peer.on('call') with Socket.io not Triggering
I'm trying to create a video call app using Socket.io, PeerJS, Node, Express and Angular.

The issue is that, while I can connect my own video just fine, I can't see the other user's video. In fact, the Peer.on('call') code doesn't seem to trigger at all.

I think there might also be an issue with my index.js code, because the console.log()s I've added to that file never appear either and I get the following error message:

Failed to load resource: the server responded with a status of 404
(Not Found)

My code looks like this:

```<code>// --- index.js:

const express = require("express");
const app = express();
const PORT = 3000;
const path = require('path');
app.set('src', path.join(__dirname, '../src'));

const server = require('http').Server(app)
const io = require('socket.io')(server)

io.on('connection',(socket)=>{
    console.log('backend video test 1') // THIS NEVER TRIGGERS
    socket.on('join-room',(roomId,userId)=>{
        //join the room
        console.log('backend video test 2') // THIS NEVER TRIGGERS
        socket.join(roomId)
        socket.to(roomId).broadcast.emit('user-connected',userId)

        //leave room
        socket.on('disconnect',()=>{
            console.log('backend video test 3') // THIS NEVER TRIGGERS
            socket.to(roomId).broadcast.emit('user-diconncected',userId)
        })
    })
})

app.listen(PORT, console.log(`Your app is running on port ${PORT}`))
</code>```
```<code>// --- component ts file:

import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Socket } from 'ngx-socket-io';
import { Peer } from "peerjs";

interface VideoElement{
  muted:boolean;
  srcObject:MediaStream;
  userId:string;
}

@Component({
  selector: 'app-video-call-v2',
  templateUrl: './video-call-v2.component.html',
  styleUrls: ['./video-call-v2.component.css']
})
export class VideoCallV2Component implements OnInit {

  currentUserId:string='testUser'+Math.floor(Math.random()*1000);
  videos:VideoElement[]=[];

  constructor(
    private route: ActivatedRoute,
    private socket: Socket,
  ) {}

  ngOnInit() {
    console.log(`Init Peer with id ${this.currentUserId}`) // this works fine.

    //------------------------------------
    // --- Access user video and audio ---
    //------------------------------------

    navigator.mediaDevices.getUserMedia({
      audio:true,
      video:true
    }).catch((err)=>{
      console.log('user media error: ',err);
      return null
    }).then((stream:any)=>{

      const myPeer = new Peer(this.currentUserId,{
        host:'/',
        port:3001,
      });
      console.log('myPeer =');
      console.log(myPeer) // this works fine.

      myPeer.on('open',(userId: any)=>{
        console.log('test2') // this works fine.
         console.log(userId) // this works fine.
        this.socket.emit('join-room','lessonvideo2',userId)
      });

      if (stream){
        this.addMyVideo(stream);
        console.log(stream) // this works fine.
      } else{
        console.log('no stream found')
      }

      //-------------------------------
      // --- Receieve incoming call ---
      //-------------------------------

      myPeer.on('call',call=>{
        console.log(`receiving call from... ${call}`); // THIS NEVER TRIGGERS!
        call.answer(stream)

        call.on('stream',(otherUserVideoStream: MediaStream)=>{
          console.log('receiving other user stream ' + otherUserVideoStream); // THIS NEVER RUNS
          this.addOtherUserVideo(call.metadata.userId,otherUserVideoStream);
        });

        call.on('error',(err:any)=>{
          console.log(err)
        })
      });

      //------------------------------
      // --- Connecting other user ---
      //------------------------------

      this.socket.on('user-connected',(userId:string)=>{
        console.log('receiving user-connected event', 'Calling ' + userId);  // THIS NEVER RUNS

        setTimeout(()=>{ // Allow some time for new peers to connect
          console.log("test3") // THIS NEVER RUNS
          const call = myPeer.call(userId,stream,{
            metadata:{userId:this.currentUserId},
          });
          call.on('stream',(otherUserVideoStream: MediaStream) =>{
            console.log('receiving other stream after...') // THIS NEVER RUNS
            this.addOtherUserVideo(userId,otherUserVideoStream)
          });

          call.on('close',()=>{
            this.videos=this.videos.filter((video)=>video.userId!==userId);
          });
        },10000);
      });
    });

    //------------------------------
    // --- Disconnect other user ---
    //------------------------------

    this.socket.on('user-disconnected',(userId:string)=>{
      console.log('receiving user-doscconected event from '+ userId) // THIS NEVER RUNS
      this.videos = this.videos.filter((video)=>video.userId!==userId);
    })
  }

  addMyVideo(stream:MediaStream){
    console.log('added') // This works fine
    this.videos.push({
      muted:true,
      srcObject:stream,
      userId:this.currentUserId,
    });
  }

  addOtherUserVideo(userId:string, stream:MediaStream){
    console.log('second video added')
    const alreadyExisting = this.videos.some(video => video.userId === userId)
    if (alreadyExisting){
      console.log(this.videos, userId);
      return;
    }
    this.videos.push({
      muted:false,
      srcObject:stream,
      userId,
    })
  }

  onLoadedMetadata(event:Event){
    (event.target as HTMLVideoElement).play()
  }

}
</code>```

I've also put the following script into the body of my index.html document:

  ```
</div>
</div>
</p>
<p>I'm importing Socket.Io into my app.module.ts file like this:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>    import{SocketIoModule} from 'ngx-socket-io';

    //...
    //...

    imports: [
     SocketIoModule.forRoot({
        url:'http://localhost:3001',options: {}
      })
     ]</code>```

I'm running my peerjs port with the following command:

peerjs --port 3001

My backend is running on port 3000 and my frontend on 4200, and they're working just fine.

NOTE: I've seen many other Stack Overflow posts on this topic, like these ones, but I've tried everything mentioned and none of them have worked for me:

peer.on('calll') is never being called

Peerjs call.on "stream" event isn't firing but peer.on "call" is

Body:
I'm trying to create a video call app using Socket.io, PeerJS, Node, Express and Angular.

The issue is that, while I can connect my own video just fine, I can't see the other user's video. In fact, the Peer.on('call') code doesn't seem to trigger at all.

I think there might also be an issue with my index.js code, because the console.log()s I've added to that file never appear either and I get the following error message:

Failed to load resource: the server responded with a status of 404
(Not Found)

My code looks like this:

// --- index.js:

const express = require("express");
const app = express();
const PORT = 3000;
const path = require('path');
app.set('src', path.join(__dirname, '../src'));

const server = require('http').Server(app)
const io = require('socket.io')(server)

io.on('connection',(socket)=>{
    console.log('backend video test 1') // THIS NEVER TRIGGERS
    socket.on('join-room',(roomId,userId)=>{
        //join the room
        console.log('backend video test 2') // THIS NEVER TRIGGERS
        socket.join(roomId)
        socket.to(roomId).broadcast.emit('user-connected',userId)

        //leave room
        socket.on('disconnect',()=>{
            console.log('backend video test 3') // THIS NEVER TRIGGERS
            socket.to(roomId).broadcast.emit('user-diconncected',userId)
        })
    })
})

app.listen(PORT, console.log(`Your app is running on port ${PORT}`))

// --- component ts file:

import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Socket } from 'ngx-socket-io';
import { Peer } from "peerjs";

interface VideoElement{
  muted:boolean;
  srcObject:MediaStream;
  userId:string;
}

@Component({
  selector: 'app-video-call-v2',
  templateUrl: './video-call-v2.component.html',
  styleUrls: ['./video-call-v2.component.css']
})
export class VideoCallV2Component implements OnInit {

  currentUserId:string='testUser'+Math.floor(Math.random()*1000);
  videos:VideoElement[]=[];

  constructor(
    private route: ActivatedRoute,
    private socket: Socket,
  ) {}

  ngOnInit() {
    console.log(`Init Peer with id ${this.currentUserId}`) // this works fine.

    //------------------------------------
    // --- Access user video and audio ---
    //------------------------------------

    navigator.mediaDevices.getUserMedia({
      audio:true,
      video:true
    }).catch((err)=>{
      console.log('user media error: ',err);
      return null
    }).then((stream:any)=>{

      const myPeer = new Peer(this.currentUserId,{
        host:'/',
        port:3001,
      });
      console.log('myPeer =');
      console.log(myPeer) // this works fine.

      myPeer.on('open',(userId: any)=>{
        console.log('test2') // this works fine.
         console.log(userId) // this works fine.
        this.socket.emit('join-room','lessonvideo2',userId)
      });

      if (stream){
        this.addMyVideo(stream);
        console.log(stream) // this works fine.
      } else{
        console.log('no stream found')
      }

      //-------------------------------
      // --- Receieve incoming call ---
      //-------------------------------

      myPeer.on('call',call=>{
        console.log(`receiving call from... ${call}`); // THIS NEVER TRIGGERS!
        call.answer(stream)

        call.on('stream',(otherUserVideoStream: MediaStream)=>{
          console.log('receiving other user stream ' + otherUserVideoStream); // THIS NEVER RUNS
          this.addOtherUserVideo(call.metadata.userId,otherUserVideoStream);
        });

        call.on('error',(err:any)=>{
          console.log(err)
        })
      });

      //------------------------------
      // --- Connecting other user ---
      //------------------------------

      this.socket.on('user-connected',(userId:string)=>{
        console.log('receiving user-connected event', 'Calling ' + userId);  // THIS NEVER RUNS

        setTimeout(()=>{ // Allow some time for new peers to connect
          console.log("test3") // THIS NEVER RUNS
          const call = myPeer.call(userId,stream,{
            metadata:{userId:this.currentUserId},
          });
          call.on('stream',(otherUserVideoStream: MediaStream) =>{
            console.log('receiving other stream after...') // THIS NEVER RUNS
            this.addOtherUserVideo(userId,otherUserVideoStream)
          });

          call.on('close',()=>{
            this.videos=this.videos.filter((video)=>video.userId!==userId);
          });
        },10000);
      });
    });

    //------------------------------
    // --- Disconnect other user ---
    //------------------------------

    this.socket.on('user-disconnected',(userId:string)=>{
      console.log('receiving user-doscconected event from '+ userId) // THIS NEVER RUNS
      this.videos = this.videos.filter((video)=>video.userId!==userId);
    })
  }

  addMyVideo(stream:MediaStream){
    console.log('added') // This works fine
    this.videos.push({
      muted:true,
      srcObject:stream,
      userId:this.currentUserId,
    });
  }

  addOtherUserVideo(userId:string, stream:MediaStream){
    console.log('second video added')
    const alreadyExisting = this.videos.some(video => video.userId === userId)
    if (alreadyExisting){
      console.log(this.videos, userId);
      return;
    }
    this.videos.push({
      muted:false,
      srcObject:stream,
      userId,
    })
  }

  onLoadedMetadata(event:Event){
    (event.target as HTMLVideoElement).play()
  }

}

I've also put the following script into the body of my index.html document:

I'm importing Socket.Io into my app.module.ts file like this:

    import{SocketIoModule} from 'ngx-socket-io';

    //...
    //...

    imports: [
     SocketIoModule.forRoot({
        url:'http://localhost:3001',options: {}
      })
     ]

I'm running my peerjs port with the following command:

peerjs --port 3001

My backend is running on port 3000 and my frontend on 4200, and they're working just fine.

NOTE: I've seen many other Stack Overflow posts on this topic, like these ones, but I've tried everything mentioned and none of them have worked for me:

peer.on('calll') is never being called

Peerjs call.on "stream" event isn't firing but peer.on "call" is


来源: stackexchange

问:
Ktor stops responding when using JWTs
We are using ktor 2.1.0 version and have configured multiple JWK providers.
Our application have 3 endpoints, one is health check without authorization.

When one of the JWK providers starts responding very slow, our application endpoints stops responding (event that without authorization health check) and waits while first request for the slow JWK provider will be finished.

It's look like what all Ktor stops responding during bearer token validation.

Can it be some configuration issue? Or it is a bug in Ktor?

We upgraded jwks-rsa to the 0.21.2 version. This one gives us ability to set the timeouts, but with these timeouts we cover the problem, but not solving.

ContentLicense: CC BY-SA 4.0

Title: Ktor stops responding when using JWTs


问:
OpenAI completion got an unexpected keyword argument 'recursive'
I'm trying to create a python telegram bot which will generate text with openai. but when i'm trying to put openai function into code - it says "OpenAIObject.to_dict() got an unexpected keyword argument 'recursive'"

`

```<code>ONE = openai.Completion.create(engine="text-davinci-002",
    prompt="say hi to user",
    temperature=0.7,
    max_tokens=20,)
TWO = 'Skip'

async def start(update: Update, context: ContextTypes.DEFAULT_TYPE) -> int:

    keyboard = [
        [
            InlineKeyboardButton("Generate", callback_data=ONE),
            InlineKeyboardButton("Skip", callback_data=TWO),
        ]
    ]
    reply_markup = InlineKeyboardMarkup(keyboard)

    await update.message.reply_text("Select an action", reply_markup=reply_markup)

async def button(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:

    query = update.callback_query
    await query.answer()
    await query.edit_message_text(text=f"Selected option: {query.data}")

app = ApplicationBuilder().token("5666054268:AAEioS6Vd1q7_Nu-AvBVnHS4UoXUtnwramg").build()

app.add_handler(CommandHandler('start', start))
app.add_handler(CallbackQueryHandler(button))

app.run_polling()
</code>```

`

Body:
I'm trying to create a python telegram bot which will generate text with openai. but when i'm trying to put openai function into code - it says "OpenAIObject.to_dict() got an unexpected keyword argument 'recursive'"

`

ONE = openai.Completion.create(engine="text-davinci-002",
    prompt="say hi to user",
    temperature=0.7,
    max_tokens=20,)
TWO = 'Skip'

async def start(update: Update, context: ContextTypes.DEFAULT_TYPE) -> int:

    keyboard = [
        [
            InlineKeyboardButton("Generate", callback_data=ONE),
            InlineKeyboardButton("Skip", callback_data=TWO),
        ]
    ]
    reply_markup = InlineKeyboardMarkup(keyboard)

    await update.message.reply_text("Select an action", reply_markup=reply_markup)

async def button(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:

    query = update.callback_query
    await query.answer()
    await query.edit_message_text(text=f"Selected option: {query.data}")

app = ApplicationBuilder().token("5666054268:AAEioS6Vd1q7_Nu-AvBVnHS4UoXUtnwramg").build()

app.add_handler(CommandHandler('start', start))
app.add_handler(CallbackQueryHandler(button))

app.run_polling()

`


问:
Match case against data type makes "remaining patterns unreachable"
Why is

```<code>match type('a'):
    case list:
        print('a list')
    case str:
        print('a string')
</code>```

wrong with giving an error "SyntaxError: name capture 'list' makes remaining patterns unreachable"

while type('a')==str is true?

Body:
Why is

match type('a'):
    case list:
        print('a list')
    case str:
        print('a string')

wrong with giving an error "SyntaxError: name capture 'list' makes remaining patterns unreachable"

while type('a')==str is true?


问:
How to setup CI for helm chart with multiple services

Context

I'm developing an application with the following services

Frontend

IAM

Backend

Database

Each service has it own repository contains the source code and the Dockerfile to build the image.

Currently I've created one helm chart that includes all those services. The values.yaml file looks like this;

```<code>frontend:
  image:
    repository:  "myimage"
    tag: "1.0.0"

iam:
  image:
    repository:  "myimage"
    tag: "1.0.3"

backend:
  image:
    repository:  "myimage"
    tag: "1.0.1"

database:
  image:
    repository:  "myimage"
    tag: "2.0.0"
</code>```

Question

I'm now looking into the options I have to create a CI process for all of this...

I feel like im lost in the possibilities. Every guide i read on the internet has an example for a helm chart containing only 1 service. But my chart has several and they depend on each-other.  Based on the guides I feel like I need to create one umbrella chart with subcharts for every service. So every service should get it's own chart.

My question now is; how do you setup a proper CI (and CD) for all of this?

Below is the flow that I've came up with (probably not correct). I'd like to automate as much as possible.

```<code>// frontend repo | feature branch
* Trigger: open pull request (and commit to that pr)
- Lint
- Unit tests
- Code quality checks
- Build new image (tag = commit sha)
- Push image to registry
- Checkout frontend-chart repo
- Commit the new image tag to a feature branch in frontend-chart repo
- Open PR in frontend-chart repo (if no already opened)
- Wait until build succeeded for chart-frontend repo (feature branch)
- Merge to master

// chart-frontend repo | feature branch
* Trigger: open pr
- Deploy frontend chart
- Deploy all 3 other services. Install latest packaged charts.
- Run e2e tests
- Merge to master

// frontend repo | master branch
* Trigger: commit
- retag image to latest
- push image
- Trigger chart-frontend repo

// chart-frontend repo | master branch
* Trigger: build triggered by frontend repo master branch
- determine new chartversion
- helm package with new chartversion
- Add git tag
- push to chartmuseum
- checkout umbrella chart repo
- commit change, to use new chart version for frontend-chart on,  to feature branch.
- Open PR on umbrella repo to merge feature branch to master

// umbrella-chart repo | feature branch
* Trigger: open PR
- Deploy the chart
- Run e2e tests
- Merge to master

// umbrella-chart repo | master branch
* Trigger: merged pr/commit
- Determine new chart version
- package chart with new chart version
- publish chart
- Add git tag
- trigger deployment to acc

// env repo | acc branch
* Trigger: build triggered by umbrella-chart with parameters
- deploy newest dyet chart
- import data from production
- run e2e tests
- merge to production

// env repo | production branch
* Trigger: merged pr/commit
- deploy newest dyet chart
- run e2e tests
- (on failure: rollback)
</code>```

Body:
Context

I'm developing an application with the following services

Frontend

IAM

Backend

Database

Each service has it own repository contains the source code and the Dockerfile to build the image.

Currently I've created one helm chart that includes all those services. The values.yaml file looks like this;

frontend:
  image:
    repository:  "myimage"
    tag: "1.0.0"

iam:
  image:
    repository:  "myimage"
    tag: "1.0.3"

backend:
  image:
    repository:  "myimage"
    tag: "1.0.1"

database:
  image:
    repository:  "myimage"
    tag: "2.0.0"

Question

I'm now looking into the options I have to create a CI process for all of this...

I feel like im lost in the possibilities. Every guide i read on the internet has an example for a helm chart containing only 1 service. But my chart has several and they depend on each-other.  Based on the guides I feel like I need to create one umbrella chart with subcharts for every service. So every service should get it's own chart.

My question now is; how do you setup a proper CI (and CD) for all of this?

Below is the flow that I've came up with (probably not correct). I'd like to automate as much as possible.

// frontend repo | feature branch
* Trigger: open pull request (and commit to that pr)
- Lint
- Unit tests
- Code quality checks
- Build new image (tag = commit sha)
- Push image to registry
- Checkout frontend-chart repo
- Commit the new image tag to a feature branch in frontend-chart repo
- Open PR in frontend-chart repo (if no already opened)
- Wait until build succeeded for chart-frontend repo (feature branch)
- Merge to master

// chart-frontend repo | feature branch
* Trigger: open pr
- Deploy frontend chart
- Deploy all 3 other services. Install latest packaged charts.
- Run e2e tests
- Merge to master

// frontend repo | master branch
* Trigger: commit
- retag image to latest
- push image
- Trigger chart-frontend repo

// chart-frontend repo | master branch
* Trigger: build triggered by frontend repo master branch
- determine new chartversion
- helm package with new chartversion
- Add git tag
- push to chartmuseum
- checkout umbrella chart repo
- commit change, to use new chart version for frontend-chart on,  to feature branch.
- Open PR on umbrella repo to merge feature branch to master

// umbrella-chart repo | feature branch
* Trigger: open PR
- Deploy the chart
- Run e2e tests
- Merge to master

// umbrella-chart repo | master branch
* Trigger: merged pr/commit
- Determine new chart version
- package chart with new chart version
- publish chart
- Add git tag
- trigger deployment to acc

// env repo | acc branch
* Trigger: build triggered by umbrella-chart with parameters
- deploy newest dyet chart
- import data from production
- run e2e tests
- merge to production

// env repo | production branch
* Trigger: merged pr/commit
- deploy newest dyet chart
- run e2e tests
- (on failure: rollback)


问:
How can i move the data into Tab Screens in react native
I need to move data:

```<code>  navigation.navigate('Statistics', {wordsInText})

</code>```

But the screen swaps into Statistic screen. How can i prohibit it?
Like only move data, withot swapping the screen

Body:
I need to move data:

  navigation.navigate('Statistics', {wordsInText})

But the screen swaps into Statistic screen. How can i prohibit it?
Like only move data, withot swapping the screen


问:
javascript error: Cannot read properties of undefined (reading 'defaultView') on clicking of Tab
Hello All respected Sir & Mam

I am stucked in a problem & need your help ( Image & attached below)

Test Scenario

I am using NodeJs Webdriver IO & using it I need to click on Submit a sample Tab  Error below

[0-0] Error in "2: When I select "Submit a sample" tab"
javascript error: javascript error: Cannot read properties of undefined (reading 'defaultView')

Feature File

```<code> Scenario: Create a Web Order.
 When I select "Submit a sample" tab
</code>```

Js Code

```<code> When("I select {string} tab", async (arg1) => {
 var x = '(//*[contains(text(),"' + arg1 + '")])';
 console.log(x);
 await $(x).click();
 });
</code>```

Your help would be very much appreciated !!`

Body:
Hello All respected Sir & Mam

I am stucked in a problem & need your help ( Image & attached below)

Test Scenario

I am using NodeJs Webdriver IO & using it I need to click on Submit a sample Tab  Error below

[0-0] Error in "2: When I select "Submit a sample" tab"
javascript error: javascript error: Cannot read properties of undefined (reading 'defaultView')

Feature File

 Scenario: Create a Web Order.
 When I select "Submit a sample" tab

Js Code

 When("I select {string} tab", async (arg1) => {
 var x = '(//*[contains(text(),"' + arg1 + '")])';
 console.log(x);
 await $(x).click();
 });

Your help would be very much appreciated !!`


问:
UIDatePicker compact style shows blurred background and wrong layout for iOS 14.8
I am using a custom view to show datePicker. For the versions below iOS 13.4, I add wheel-style datePicker as a subview to this view and for higher versions, I add compact-style datePicker.

var datePicker: UIDatePicker?

override func configureView() {
    super.configureView()
    if #available(iOS 13.4, *) {
        self.showCompactDatePicker()
    } else {
        self.showWheelDatePicker()
    }
}

@available(iOS 13.4, *)
func showCompactDatePicker() {
    self.datePicker = UIDatePicker()
    datePicker?.preferredDatePickerStyle = .compact
    datePicker?.datePickerMode = self.datePickerMode
    datePicker?.tintColor = .weirdGreen
    datePicker?.addTarget(self, action: #selector(dateSelected(datePicker:)), for: .valueChanged)
    self.updateUI()
    self.addSubview(datePicker!)
    datePicker?.frame = self.bounds
}
```

To explain what my problem is, the code works perfectly both for below iOS 13.4 and vice versa. But I noticed it shows buggy on iOS 14.8 iPhone 8 device.

These photos are taken on iOS 16.1 iPhone 13. It also works right on iOS 15.3 iPhone 8 Plus.

Right case-1

Right case-2

And these photos are to display buggy cases. (Left aligned and with blurred bg.)

Buggy case-1

Buggy case-2

I searched for the problem but didn't even find a clue. Why am I facing this?

I tried setting datePicker.contentHorizontalAlignment to .right but didn't work. I don't have any idea about blurred bg.

EDIT: I tried the case on iOS 14.5 iPhone 8 and iOS 14.5 iPhone SE (2nd gen) and iOS 14.5 iPhone 12 devices, but the problem continues there. On the other hand, iOS 16.1 iPhone SE (3rd gen) device works fine.

The problem must be related to the iOS version.

Body:
I am using a custom view to show datePicker. For the versions below iOS 13.4, I add wheel-style datePicker as a subview to this view and for higher versions, I add compact-style datePicker.

var datePicker: UIDatePicker?

override func configureView() {
    super.configureView()
    if #available(iOS 13.4, *) {
        self.showCompactDatePicker()
    } else {
        self.showWheelDatePicker()
    }
}

@available(iOS 13.4, *)
func showCompactDatePicker() {
    self.datePicker = UIDatePicker()
    datePicker?.preferredDatePickerStyle = .compact
    datePicker?.datePickerMode = self.datePickerMode
    datePicker?.tintColor = .weirdGreen
    datePicker?.addTarget(self, action: #selector(dateSelected(datePicker:)), for: .valueChanged)
    self.updateUI()
    self.addSubview(datePicker!)
    datePicker?.frame = self.bounds
}

To explain what my problem is, the code works perfectly both for below iOS 13.4 and vice versa. But I noticed it shows buggy on iOS 14.8 iPhone 8 device.

These photos are taken on iOS 16.1 iPhone 13. It also works right on iOS 15.3 iPhone 8 Plus.

Right case-1

Right case-2

And these photos are to display buggy cases. (Left aligned and with blurred bg.)

Buggy case-1

Buggy case-2

I searched for the problem but didn't even find a clue. Why am I facing this?

I tried setting datePicker.contentHorizontalAlignment to .right but didn't work. I don't have any idea about blurred bg.

EDIT: I tried the case on iOS 14.5 iPhone 8 and iOS 14.5 iPhone SE (2nd gen) and iOS 14.5 iPhone 12 devices, but the problem continues there. On the other hand, iOS 16.1 iPhone SE (3rd gen) device works fine.

The problem must be related to the iOS version.


问:
How I run my react-native project(Failed to install the app. Make sure you have the Android development environment set up:
I trying to run my react-native anroid project. I use android 12 (S). And sdk verison 31.0.0. But i cant run my project.

My error :

```<code>PS C:\Users\omer2\OneDrive\Masaüstü\BosBirProje> npm run android

> BosBirProje@0.0.1 android
> react-native run-android

info JS server already running.
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
:ReactNative:Unexpected empty result of running '[node, C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\@react-n
ative-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\@react-native-community\cli\build\b
in.js, config]' command failed.

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\omer2\OneDrive\Masa�st�\BosBirProje\node_modules\@react-native-community\cli-platform-android\native_modu
les.gradle' line: 413

* What went wrong:
A problem occurred evaluating script.
> node:internal/modules/cjs/loader:998  throw err;  ^Error: Cannot find module 'C:\Users\omer2\OneDrive\MasaÃ¼stÃ¼\BosBirP
roje\node_modules\@react-native-community\cli\build\bin.js'    at Module._resolveFilename (node:internal/modules/cjs/loade
r:995:15)    at Module._load (node:internal/modules/cjs/loader:841:27)    at Function.executeUserEntryPoint [as runMain] (
node:internal/modules/run_main:81:12)    at node:internal/main/run_main_module:23:47 {  code: 'MODULE_NOT_FOUND',  require
Stack: []}Node.js v18.12.1

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

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

BU�LD FAILED in 6s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/do
cs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
:ReactNative:Unexpected empty result of running '[node, C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\@react-n
ative-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\@react-native-community\cli\build\b
in.js, config]' command failed.

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\omer2\OneDrive\Masa�st�\BosBirProje\node_modules\@react-native-community\cli-platform-android\native_modu
les.gradle' line: 413

* What went wrong:
A problem occurred evaluating script.
> node:internal/modules/cjs/loader:998  throw err;  ^Error: Cannot find module 'C:\Users\omer2\OneDrive\MasaÃ¼stÃ¼\BosBirP
roje\node_modules\@react-native-community\cli\build\bin.js'    at Module._resolveFilename (node:internal/modules/cjs/loade
r:995:15)    at Module._load (node:internal/modules/cjs/loader:841:27)    at Function.executeUserEntryPoint [as runMain] (
node:internal/modules/run_main:81:12)    at node:internal/main/run_main_module:23:47 {  code: 'MODULE_NOT_FOUND',  require
Stack: []}Node.js v18.12.1

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

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

BU�LD FAILED in 6s

    at makeError (C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\execa\index.js:174:9)
    at C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\execa\index.js:278:16
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async runOnAllDevices (C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\react-native\node_modules\@react-n
ative-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
    at async Command.handleAction (C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\@react-native-community\cli\b
uild\index.js:108:9)
info Run CLI with --verbose flag for more details.
</code>```

I trying to react-native doctor and my react-native doctor output:

```<code>PS C:\Users\omer2\OneDrive\Masaüstü\BosBirProje> npx @react-native-community/cli doctor
Common
 ✓ Node.js
 ✓ npm

Android
 ✓ JDK
 ✓ Android Studio - Required for building and installing your app on Android
 ✖ Android SDK - Required for building and installing your app on Android
   - Versions found: N/A
   - Version supported: 31.0.0
 ✓ ANDROID_HOME

Errors:   1
Warnings: 0

Attempting to fix 1 issue...

Android
 ✔ Android SDK configured. You might need to restart your PC for all changes to take effect.
</code>```

I reboot my pc as suggested and do npm run android. And my new output:

```<code>PS C:\Users\omer2\OneDrive\Masaüstü\BosBirProje> npm run android

> BosBirProje@0.0.1 android
> react-native run-android

info JS server already running.
info Installing the app...
:ReactNative:Unexpected empty result of running '[node, C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\@react-n
ative-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\@react-native-community\cli\build\b
in.js, config]' command failed.

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\omer2\OneDrive\Masa�st�\BosBirProje\node_modules\@react-native-community\cli-platform-android\native_modu
les.gradle' line: 413

* What went wrong:
A problem occurred evaluating script.
> node:internal/modules/cjs/loader:998  throw err;  ^Error: Cannot find module 'C:\Users\omer2\OneDrive\MasaÃ¼stÃ¼\BosBirP
roje\node_modules\@react-native-community\cli\build\bin.js'    at Module._resolveFilename (node:internal/modules/cjs/loade
r:995:15)    at Module._load (node:internal/modules/cjs/loader:841:27)    at Function.executeUserEntryPoint [as runMain] (
node:internal/modules/run_main:81:12)    at node:internal/main/run_main_module:23:47 {  code: 'MODULE_NOT_FOUND',  require
Stack: []}Node.js v18.12.1

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

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

BU�LD FAILED in 6s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/do
cs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
:ReactNative:Unexpected empty result of running '[node, C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\@react-n
ative-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\@react-native-community\cli\build\b
in.js, config]' command failed.

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\omer2\OneDrive\Masa�st�\BosBirProje\node_modules\@react-native-community\cli-platform-android\native_modu
les.gradle' line: 413

* What went wrong:
A problem occurred evaluating script.
> node:internal/modules/cjs/loader:998  throw err;  ^Error: Cannot find module 'C:\Users\omer2\OneDrive\MasaÃ¼stÃ¼\BosBirP
roje\node_modules\@react-native-community\cli\build\bin.js'    at Module._resolveFilename (node:internal/modules/cjs/loade
r:995:15)    at Module._load (node:internal/modules/cjs/loader:841:27)    at Function.executeUserEntryPoint [as runMain] (
node:internal/modules/run_main:81:12)    at node:internal/main/run_main_module:23:47 {  code: 'MODULE_NOT_FOUND',  require
Stack: []}Node.js v18.12.1

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

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

BU�LD FAILED in 6s

    at makeError (C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\execa\index.js:174:9)
    at C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\execa\index.js:278:16
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async runOnAllDevices (C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\react-native\node_modules\@react-n
ative-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
    at async Command.handleAction (C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\@react-native-community\cli\b
uild\index.js:108:9)
info Run CLI with --verbose flag for more details.
</code>```

1-) Finally I added the local.properties file to this location "C:\Users\omer2\OneDrive\Desktop\BosBirProject\android".
2-) I added the following commands in the gradle.properties file:

```<code>newArchEnabled=false
android.useAndroidX=true
android.enableJetifier=true
</code>```

3-) I updated and reinstalled all npm packages

4-) I also tried to :

```<code>npm uninstall -g react-native-cli

npm install -g react-native-cli

npm install -g react-native
</code>```

5-) I can't run the project even though I did all these, what would you recommend to me?

Body:
I trying to run my react-native anroid project. I use android 12 (S). And sdk verison 31.0.0. But i cant run my project.

My error :

PS C:\Users\omer2\OneDrive\Masaüstü\BosBirProje> npm run android

> BosBirProje@0.0.1 android
> react-native run-android

info JS server already running.
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
:ReactNative:Unexpected empty result of running '[node, C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\@react-n
ative-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\@react-native-community\cli\build\b
in.js, config]' command failed.

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\omer2\OneDrive\Masa�st�\BosBirProje\node_modules\@react-native-community\cli-platform-android\native_modu
les.gradle' line: 413

* What went wrong:
A problem occurred evaluating script.
> node:internal/modules/cjs/loader:998  throw err;  ^Error: Cannot find module 'C:\Users\omer2\OneDrive\MasaÃ¼stÃ¼\BosBirP
roje\node_modules\@react-native-community\cli\build\bin.js'    at Module._resolveFilename (node:internal/modules/cjs/loade
r:995:15)    at Module._load (node:internal/modules/cjs/loader:841:27)    at Function.executeUserEntryPoint [as runMain] (
node:internal/modules/run_main:81:12)    at node:internal/main/run_main_module:23:47 {  code: 'MODULE_NOT_FOUND',  require
Stack: []}Node.js v18.12.1

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

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

BU�LD FAILED in 6s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/do
cs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
:ReactNative:Unexpected empty result of running '[node, C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\@react-n
ative-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\@react-native-community\cli\build\b
in.js, config]' command failed.

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\omer2\OneDrive\Masa�st�\BosBirProje\node_modules\@react-native-community\cli-platform-android\native_modu
les.gradle' line: 413

* What went wrong:
A problem occurred evaluating script.
> node:internal/modules/cjs/loader:998  throw err;  ^Error: Cannot find module 'C:\Users\omer2\OneDrive\MasaÃ¼stÃ¼\BosBirP
roje\node_modules\@react-native-community\cli\build\bin.js'    at Module._resolveFilename (node:internal/modules/cjs/loade
r:995:15)    at Module._load (node:internal/modules/cjs/loader:841:27)    at Function.executeUserEntryPoint [as runMain] (
node:internal/modules/run_main:81:12)    at node:internal/main/run_main_module:23:47 {  code: 'MODULE_NOT_FOUND',  require
Stack: []}Node.js v18.12.1

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

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

BU�LD FAILED in 6s

    at makeError (C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\execa\index.js:174:9)
    at C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\execa\index.js:278:16
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async runOnAllDevices (C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\react-native\node_modules\@react-n
ative-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
    at async Command.handleAction (C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\@react-native-community\cli\b
uild\index.js:108:9)
info Run CLI with --verbose flag for more details.

I trying to react-native doctor and my react-native doctor output:

PS C:\Users\omer2\OneDrive\Masaüstü\BosBirProje> npx @react-native-community/cli doctor
Common
 ✓ Node.js
 ✓ npm

Android
 ✓ JDK
 ✓ Android Studio - Required for building and installing your app on Android
 ✖ Android SDK - Required for building and installing your app on Android
   - Versions found: N/A
   - Version supported: 31.0.0
 ✓ ANDROID_HOME

Errors:   1
Warnings: 0

Attempting to fix 1 issue...

Android
 ✔ Android SDK configured. You might need to restart your PC for all changes to take effect.

I reboot my pc as suggested and do npm run android. And my new output:

PS C:\Users\omer2\OneDrive\Masaüstü\BosBirProje> npm run android

> BosBirProje@0.0.1 android
> react-native run-android

info JS server already running.
info Installing the app...
:ReactNative:Unexpected empty result of running '[node, C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\@react-n
ative-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\@react-native-community\cli\build\b
in.js, config]' command failed.

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\omer2\OneDrive\Masa�st�\BosBirProje\node_modules\@react-native-community\cli-platform-android\native_modu
les.gradle' line: 413

* What went wrong:
A problem occurred evaluating script.
> node:internal/modules/cjs/loader:998  throw err;  ^Error: Cannot find module 'C:\Users\omer2\OneDrive\MasaÃ¼stÃ¼\BosBirP
roje\node_modules\@react-native-community\cli\build\bin.js'    at Module._resolveFilename (node:internal/modules/cjs/loade
r:995:15)    at Module._load (node:internal/modules/cjs/loader:841:27)    at Function.executeUserEntryPoint [as runMain] (
node:internal/modules/run_main:81:12)    at node:internal/main/run_main_module:23:47 {  code: 'MODULE_NOT_FOUND',  require
Stack: []}Node.js v18.12.1

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

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

BU�LD FAILED in 6s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/do
cs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
:ReactNative:Unexpected empty result of running '[node, C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\@react-n
ative-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\@react-native-community\cli\build\b
in.js, config]' command failed.

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\omer2\OneDrive\Masa�st�\BosBirProje\node_modules\@react-native-community\cli-platform-android\native_modu
les.gradle' line: 413

* What went wrong:
A problem occurred evaluating script.
> node:internal/modules/cjs/loader:998  throw err;  ^Error: Cannot find module 'C:\Users\omer2\OneDrive\MasaÃ¼stÃ¼\BosBirP
roje\node_modules\@react-native-community\cli\build\bin.js'    at Module._resolveFilename (node:internal/modules/cjs/loade
r:995:15)    at Module._load (node:internal/modules/cjs/loader:841:27)    at Function.executeUserEntryPoint [as runMain] (
node:internal/modules/run_main:81:12)    at node:internal/main/run_main_module:23:47 {  code: 'MODULE_NOT_FOUND',  require
Stack: []}Node.js v18.12.1

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

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

BU�LD FAILED in 6s

    at makeError (C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\execa\index.js:174:9)
    at C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\execa\index.js:278:16
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async runOnAllDevices (C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\react-native\node_modules\@react-n
ative-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
    at async Command.handleAction (C:\Users\omer2\OneDrive\Masaüstü\BosBirProje\node_modules\@react-native-community\cli\b
uild\index.js:108:9)
info Run CLI with --verbose flag for more details.

1-) Finally I added the local.properties file to this location "C:\Users\omer2\OneDrive\Desktop\BosBirProject\android".
2-) I added the following commands in the gradle.properties file:

newArchEnabled=false
android.useAndroidX=true
android.enableJetifier=true

3-) I updated and reinstalled all npm packages

4-) I also tried to :

npm uninstall -g react-native-cli

npm install -g react-native-cli

npm install -g react-native

5-) I can't run the project even though I did all these, what would you recommend to me?


问:
set a php session using jquery ajax
I need to set a php session using jquery ajax

in the code below everything works - but seems - the session is not created

what is wrong, pls ?

music.php

```<code>session_start();
if(isset($_SESSION['ad'])){echo $_SESSION['ad'];}  // nothing is echoed

include('music_pro.php');
</code>```

music.js

```<code>var str = 'lorem';
$.post('music_pro.php', {fn: 'admin_prompt', args: [str]}, function(data){
    console.log(data);  // ok
    if(data == 'ok'){location.href = location.href;}
});
</code>```

music_pro.php

```<code>if(isset($_POST['fn'], $_POST['args'])){
    $fn = $_POST['fn']; $args = $_POST['args'];
    $fn(...$args);
}

function admin_prompt($str){
    if($str == 'lorem'){
        $_SESSION['ad'] = 1;  // seems this line doesn't work
        echo 'ok';
    }
}
</code>```

Title: set a php session using jquery ajax

Body:
I need to set a php session using jquery ajax

in the code below everything works - but seems - the session is not created

what is wrong, pls ?

music.php

session_start();
if(isset($_SESSION['ad'])){echo $_SESSION['ad'];}  // nothing is echoed

include('music_pro.php');

music.js

var str = 'lorem';
$.post('music_pro.php', {fn: 'admin_prompt', args: [str]}, function(data){
    console.log(data);  // ok
    if(data == 'ok'){location.href = location.href;}
});

music_pro.php

if(isset($_POST['fn'], $_POST['args'])){
    $fn = $_POST['fn']; $args = $_POST['args'];
    $fn(...$args);
}

function admin_prompt($str){
    if($str == 'lorem'){
        $_SESSION['ad'] = 1;  // seems this line doesn't work
        echo 'ok';
    }
}


问:
Crash :com.apple.network.connections EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000036
Since the release of iOS16.1.0 and iOS16.1.1, I have received reports from iOS16.1.0 and iOS16.1.1 users about the crash problem. Later, I discovered that this problem occurred only iOS16.1.0 and later. This problem does not occur to all users ，I have tried several methods (such as using different versions of xcode build App), but still not solved...

Here are the crash track caught by firebase：
Crash :com.apple.network.connections EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000036

```<code>Crashed: com.apple.network.connections
0  libxpc.dylib                   0x16020 _xpc_dictionary_insert + 96
1  Network                        0x908504 nw_path_snapshot_agents + 292
2  Network                        0x907960 nw_path_snapshot_path + 192
3  Network                        0x9257b8 nw_path_necp_update_evaluator + 756
4  Network                        0x924aa4 nw_path_necp_check_for_updates + 1268
5  libdispatch.dylib              0x3fdc _dispatch_client_callout + 20
6  libdispatch.dylib              0x746c _dispatch_continuation_pop + 504
7  libdispatch.dylib              0x1aa58 _dispatch_source_invoke + 1588
8  libdispatch.dylib              0xd4f8 _dispatch_workloop_invoke + 1780
9  libdispatch.dylib              0x16e10 _dispatch_workloop_worker_thread + 652
10 libsystem_pthread.dylib        0xdf8 _pthread_wqthread + 288
11 libsystem_pthread.dylib        0xb98 start_wqthread + 8

com.apple.main-thread
0  libsystem_kernel.dylib         0xb48 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x13008 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x13248 mach_msg_overwrite + 388
3  libsystem_kernel.dylib         0x108c mach_msg + 24
4  CoreFoundation                 0x7aaf0 __CFRunLoopServiceMachPort + 160
5  CoreFoundation                 0x7bd34 __CFRunLoopRun + 1232
6  CoreFoundation                 0x80ed4 CFRunLoopRunSpecific + 612
7  GraphicsServices               0x1368 GSEventRunModal + 164
8  UIKitCore                      0x3a23d0 -[UIApplication _run] + 888
9  UIKitCore                      0x3a2034 UIApplicationMain + 340
10 xxxxxx                         0x44ea24 main + 14 (main.m:14)
11 ???                            0x1d6e8c960 (缺少)

other thread ......
</code>```

Body:
Since the release of iOS16.1.0 and iOS16.1.1, I have received reports from iOS16.1.0 and iOS16.1.1 users about the crash problem. Later, I discovered that this problem occurred only iOS16.1.0 and later. This problem does not occur to all users ，I have tried several methods (such as using different versions of xcode build App), but still not solved...

Here are the crash track caught by firebase：
Crash :com.apple.network.connections EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000036

Crashed: com.apple.network.connections
0  libxpc.dylib                   0x16020 _xpc_dictionary_insert + 96
1  Network                        0x908504 nw_path_snapshot_agents + 292
2  Network                        0x907960 nw_path_snapshot_path + 192
3  Network                        0x9257b8 nw_path_necp_update_evaluator + 756
4  Network                        0x924aa4 nw_path_necp_check_for_updates + 1268
5  libdispatch.dylib              0x3fdc _dispatch_client_callout + 20
6  libdispatch.dylib              0x746c _dispatch_continuation_pop + 504
7  libdispatch.dylib              0x1aa58 _dispatch_source_invoke + 1588
8  libdispatch.dylib              0xd4f8 _dispatch_workloop_invoke + 1780
9  libdispatch.dylib              0x16e10 _dispatch_workloop_worker_thread + 652
10 libsystem_pthread.dylib        0xdf8 _pthread_wqthread + 288
11 libsystem_pthread.dylib        0xb98 start_wqthread + 8

com.apple.main-thread
0  libsystem_kernel.dylib         0xb48 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x13008 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x13248 mach_msg_overwrite + 388
3  libsystem_kernel.dylib         0x108c mach_msg + 24
4  CoreFoundation                 0x7aaf0 __CFRunLoopServiceMachPort + 160
5  CoreFoundation                 0x7bd34 __CFRunLoopRun + 1232
6  CoreFoundation                 0x80ed4 CFRunLoopRunSpecific + 612
7  GraphicsServices               0x1368 GSEventRunModal + 164
8  UIKitCore                      0x3a23d0 -[UIApplication _run] + 888
9  UIKitCore                      0x3a2034 UIApplicationMain + 340
10 xxxxxx                         0x44ea24 main + 14 (main.m:14)
11 ???                            0x1d6e8c960 (缺少)

other thread ......


问:
2 way communication between external app and MS Teams
Problem statement: As a user I want to be able to share information quickly to MS teams from external web application.
For e.g. I am on an application and found some news that might be useful for the team so, I click on share and MS graph apis gets called that lists my teams and channels and I can select a channel to which I wish to share.
And I want this to be 2-way communication i.e. someone from my team can share something from MS Teams with be me that will be visible to me on the web application.

Now as a developer I wish to integrate MS Teams to my webapp such that when a user shares a news to teams, that message is posted by a bot on the teams channel.
And if someone @mentions the bot and provides some text then the bot sends that text to the external web app.

I am aware that this functionality can be achieved even without using a bot by creating webhooks.
But this approach is not viable for me as a outgoing webhook is created at a team level and not on app level according to documentation. So multiple teams will have multiple outgoing webhooks.

I believe this is possible by using bots or message extensions but I can't find a resource that tells how to build this and MS documentation is not very clear to me.


Body:
/* Create a view called emp_sal on the emp table by selecting the following fields in the order of highest salary to the lowest salary.

emp_no, first_name, last_name, salary */

CREATE TABLE  emp  (
   emp_no  int(11) NOT NULL,
   birth_date  date NOT NULL,
   first_name  varchar(14) NOT NULL,
   last_name  varchar(16) NOT NULL,
   gender  enum('M','F') NOT NULL,
   hire_date  date NOT NULL,
   salary  float(8,2) DEFAULT 7850.00
) ;

INSERT INTO  emp  VALUES
(10001,'1953-09-02','Georgi','Facello','M','2020-02-23',7850.00),
(10002,'1964-06-02','Bezalel','Simmel','F','2020-02-23',1756.50),
(10003,'1959-12-03','Parto','Bamford','M','2020-02-23',7850.00),
(10004,'1954-05-01','Chirstian','Koblick','M','2020-04-15',3475.00),
(10005,'1955-01-21','Kyoichi','Maliniak','M','2019-12-27',1756.50),
(10006,'1953-04-20','Anneke','Preusig','F','2020-02-23',7850.00),
(10007,'1957-05-23','Tzvetan','Zielinski','F','2020-02-23',7850.00),
(10008,'1958-02-19','Saniya','Kalloufi','M','1994-09-15',6759.00),
(10009,'1952-04-19','Sumant','Peac','F','2020-02-23',7850.00),
(10010,'1963-06-01','Duangkaew','Piveteau','F','2019-12-27',1375.00),
(10011,'1953-11-07','Mary','Sluis','F','1990-01-22',6759.00),
(10012,'1960-10-04','Patricio','Bridgland','M','1992-12-18',3475.00),
(10013,'1963-06-07','Eberhardt','Terkki','M','2020-02-23',7850.00),
(10014,'1956-02-12','Berni','Genin','M','2020-02-23',1756.50),
(10015,'1959-08-19','Guoxiang','Nooteboom','M','2019-12-27',1375.00),
(10016,'1961-05-02','Kazuhito','Cappelletti','M','1995-01-27',3475.00),
(10017,'1958-07-06','Cristinel','Bouloucos','F','1993-08-03',6759.00),
(10018,'1954-06-19','Kazuhide','Peha','F','2020-02-23',7850.00),
(10019,'1953-01-23','Lillian','Haddadi','M','1999-04-30',7850.00),
(10020,'1952-12-24','Mayuko','Warwick','M','1991-01-26',4300.00),
(10021,'1960-02-20','Ramzi','Erde','M','2020-02-23',7850.00),
(10022,'1952-07-08','Shahaf','Famili','M','1995-08-22',7850.00),
(10023,'1953-09-29','Bojan','Montemayor','F','2020-02-23',1756.50),
(10024,'1958-09-05','Suzette','Pettey','F','1997-05-19',3475.00),
(10025,'1958-10-31','Prasadram','Heyers','M','2019-12-27',1375.00),
(10026,'1953-04-03','Yongqiao','Berztiss','M','1995-03-20',6759.00);

SELECT * FROM (
  SELECT
    emp_no,
    first_name,
    last_name,
   salary,
    RANK() OVER (PARTITION BY emp_no ORDER BY salary DESC) AS emp_sal
  FROM Emp
  INNER JOIN Dept ON first_name = last_name
)
WHERE DeptSalRank = 1


问:
Embedded Kafka test cases not considered in test case execution
I have added EmbeddedKafka for testing purpose and introduced 3 more Kafka test cases. Total 8 test cases.

When I am running test cases from intellij all test cases are running as expected (all green) 8/8

While executing maven install or test command Kafka based test cases not considered as consumer stopped so just 5(non-kafka bases) test cases executing.

Code and logs added in below link

https://github.com/kasramp/spring-kafka-test/issues/2

Could you please assist on this ?


问:
elasticsearch error while sorting and paginatioon
I am using the Java API for ElasticSeach and I realized it was not applying correctly the sorting and pagination. My logic is working but because I am currently retrieving all the indexed documents, then applying the ordering logic and then the pagination (but manually). This is an issue because resource consumption will be high as there is a lot of demand.
My question is: There any way to let the API knw I want to order first and then apply pagination logic (this part I have seen how but well its not applied correctly)...

I am trying to use the Java API for elasticsearch to apply correctly the sorting and filtering... I  am expecting to use the API and not applying all by my own.


问:
How to resolve this error? Use of uninitialized value $val1 in printf at sham.pl line 112
This is my script. Please suggest how to avoid the error. This script worked fine while using other files.

`if (($line1 =~ /^[#@]/) || ($line2 =~ /^[#@]/)) {
# do nothing, it's a comment - probably not necessary after above cleanup
} else {
my @data1 = split(" ", $line1);
my @data2 = split(" ", $line2);

```<code>    my $time = $data1[0];
    my $val1 = $data1[$d1];
    my $val2 = $data2[$d2];

    printf OUT "%8.3f\t%f\t%f\n", $time, $val1, $val2;
}
</code>```

}

close(OUT);

exit;

```<code>

I have not tried anything since I am new to perl and have less knowledge about it.
</code>```

Body:
This is my script. Please suggest how to avoid the error. This script worked fine while using other files.

`if (($line1 =~ /^[#@]/) || ($line2 =~ /^[#@]/)) {
# do nothing, it's a comment - probably not necessary after above cleanup
} else {
my @data1 = split(" ", $line1);
my @data2 = split(" ", $line2);

    my $time = $data1[0];
    my $val1 = $data1[$d1];
    my $val2 = $data2[$d2];

    printf OUT "%8.3f\t%f\t%f\n", $time, $val1, $val2;
}

}

close(OUT);

exit;

I have not tried anything since I am new to perl and have less knowledge about it.


问:
feching data dynamically using getServerSideProps in next js but error: Cannot read properties of null (reading 'useContext')
I'm trying to fetch data dynamically according to user choice, here I'm using getServerSide props inside pages/newsPages/[category].tsx

error pointing towards this:

```<code>TypeError: Cannot read properties of null (reading 'useContext')

  46   export async function getServerSideProps(context: any) {
> 47 |  const router = useRouter();
     |                         ^
</code>```
```<code>import { useRouter } from 'next/router'
import React, { useState } from 'react'
import Feeds from '../../components/Feeds'
import Header from '../../components/Header'

export default function category({ newsCategory }:any) {
  const [date, setDate] = useState(new Date())
  return (
    <div className='bg-gray-100'>
      <Header />
      <main className='mx-5 my-5'>
       <div className='bg-white'>
         <div className='flex justify-between p-4'>
          <h1 className='text-sm font-bold md:text-2xl'>Wellcome to clone BBC.com</h1>
          <h1 className='text-sm font-bold md:text-2xl'>{date.toDateString()}</h1>
         </div>
          {newsCategory.articles.slice(0, 1).map((article:any )=> (
            <a key={article.url} href={article.url}
            className="relative">
            <img  className='w-full' src={article.urlToImage ? article.urlToImage: "./ALT.jpg"} alt="" />
            <h1
             className='text-white absolute bottom-[40%] left-[5%]
             lg:text-2xl text-xl'>{article.title}</h1>
             <p  className='text-white absolute bottom-[30%] left-[5%] line-clamp-1'>{article.description}</p>
          </a>
          ))}
          <div className='grid grid-flow-row-dense md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4'>{/*grid start*/}
                {newsCategory.articles.slice(1, newsCategory.articles.length).map((article: any) => (
                  <Feeds
                   url={article.url}
                   className=""
                   key={article.url}
                   urlToImage={article.urlToImage}
                   title={article.title}
                   description={article.description}
                  />
                ))}
          </div>
       </div>
      </main>
    </div>
  )
}

export async function getServerSideProps(context: any) {
    const router = useRouter();
    const { category } = router.query

   const newsCategory = await fetch(`https://newsapi.org/v2/top-headlines?country=us&category=${category}&apiKey=${process.env.API_KEY}`)
   .then(res => res.json())

  return {
    props: {
      newsCategory,
    }
  }
}
</code>```

pages/index.tsx

```<code>import Head from 'next/head'
import Header from '../components/Header';
import NewsFeed from '../components/NewsFeed';

export default function Home({ news }: any) {
  return (
    <div className='bg-gray-100 '>
      <Head>
        <title>Create Next App</title>
        <meta name="description" content="Generated by create next app" />
        <link rel="icon" href="/favicon.ico" />
      </Head>

      <Header />
      <main className='mx-5 my-5'>
        <NewsFeed news={news} key={news.article}/>
      </main>
    </div>
  )
}

export async function getServerSideProps(context: any) {

  const news = await fetch("https://newsapi.org/v2/top-headlines?country=us&category=business&apiKey=")
   .then(res=>res.json());

  return {
    props: {
      news,
    }
  }
}
</code>```

header.tsx

pushing to the newspages

```<code>
    <p className='hidden hover:text-blue-500 sm:inline-flex'
               onClick={()=> router.push("/")}>Home</p>
              <p className='hidden hover:text-blue-500 sm:inline-flex'
               onClick={()=> router.push("/newsPages/general")}>News</p>
              <p className='hidden hover:text-blue-500 sm:inline-flex'
               onClick={()=> router.push("/newsPages/sports")}>Sport</p>
              <p className='hidden hover:text-blue-500 sm:inline-flex'
               onClick={()=> router.push("/newsPages/entertainment")}>Reel</p>
              <p className='hidden hover:text-blue-500 sm:hidden lg:inline-flex'
               onClick={()=> router.push("/newsPages/health")}>Worklife</p>
              <p className='hidden hover:text-blue-500 sm:hidden lg:inline-flex'
               onClick={()=> router.push("/newsPages/science")}>Science</p>
              <p className='hidden hover:text-blue-500 sm:hidden lg:inline-flex'
               onClick={()=> router.push("/newsPages/future")}>Future</p>
</code>```

what I did wrong here, can I use getServerSideProps in multiple files inside the pages folder?  why here this error occurs,

Body:
I'm trying to fetch data dynamically according to user choice, here I'm using getServerSide props inside pages/newsPages/[category].tsx

error pointing towards this:

TypeError: Cannot read properties of null (reading 'useContext')

  46   export async function getServerSideProps(context: any) {
> 47 |  const router = useRouter();
     |                         ^

import { useRouter } from 'next/router'
import React, { useState } from 'react'
import Feeds from '../../components/Feeds'
import Header from '../../components/Header'

export default function category({ newsCategory }:any) {
  const [date, setDate] = useState(new Date())
  return (

Wellcome to clone BBC.com

{date.toDateString()}

          {newsCategory.articles.slice(0, 1).map((article:any )=> (

{article.title}

{article.description}

          ))}

{/*grid start*/}
                {newsCategory.articles.slice(1, newsCategory.articles.length).map((article: any) => (
                  <Feeds
                   url={article.url}
                   className=""
                   key={article.url}
                   urlToImage={article.urlToImage}
                   title={article.title}
                   description={article.description}
                  />
                ))}

  )
}

export async function getServerSideProps(context: any) {
    const router = useRouter();
    const { category } = router.query

   const newsCategory = await fetch(`https://newsapi.org/v2/top-headlines?country=us&category=${category}&apiKey=${process.env.API_KEY}`)
   .then(res => res.json())

  return {
    props: {
      newsCategory,
    }
  }
}

pages/index.tsx

import Head from 'next/head'
import Header from '../components/Header';
import NewsFeed from '../components/NewsFeed';

export default function Home({ news }: any) {
  return (

        <title>Create Next App</title>
        <meta name="description" content="Generated by create next app" />
        <link rel="icon" href="/favicon.ico" />

        <NewsFeed news={news} key={news.article}/>

  )
}

export async function getServerSideProps(context: any) {

  const news = await fetch("https://newsapi.org/v2/top-headlines?country=us&category=business&apiKey=")
   .then(res=>res.json());

  return {
    props: {
      news,
    }
  }
}

header.tsx

pushing to the newspages

 router.push("/")}>Home

 router.push("/newsPages/general")}>News

 router.push("/newsPages/sports")}>Sport

 router.push("/newsPages/entertainment")}>Reel

 router.push("/newsPages/health")}>Worklife

 router.push("/newsPages/science")}>Science

 router.push("/newsPages/future")}>Future

what I did wrong here, can I use getServerSideProps in multiple files inside the pages folder?  why here this error occurs,


问:
mptt not linking children and parent - Django
I'm having an issue that I seriously can't wrap my head around.
I am using Django MPTT models and evrerything seems to be working fine (i.e. I can run the migrations and insert data in the database), but for some reason the

TreeForeignKey

table and the

TreeManyToManyField

table are not linking in the database.

Here are the models in question...

```<code>from mptt.models import MPTTModel, TreeForeignKey, TreeManyToManyField

class Category(MPTTModel):

    name = models.CharField(
        max_length=100,
        verbose_name=_('category name'),
        help_text=_('format: required, max=100'),
        )

    slug = models.SlugField(
        max_length=150,
        verbose_name=_('category safe URL'),
        help_text=_('format: required, letters, numbers, underscore or hyphons'),
        )

    is_active = models.BooleanField(default=True)

    parent = TreeForeignKey(
        'self',
        on_delete=models.PROTECT,
        related_name='children',
        null=True,
        blank=True,
        )

    class MPTTMeta:
        order_insertion_by = ['name']

    class Meta:
        verbose_name=_('product category')
        verbose_name_plural=_('product categories')

    def __str__(self):
        return self.name

class Product(models.Model):

    web_id = models.CharField(
        unique=True,
        max_length=50,
        verbose_name=_('product website ID'),
    )
    slug = models.SlugField(
        max_length=255,
        verbose_name=_('product safe URL'),
        help_text=_('format: required, letters, numbers, underscore or hyphons'),
    )
    name = models.CharField(max_length=150)
    description = models.TextField(help_text='Required')

    category = TreeManyToManyField(Category)

    is_active = models.BooleanField(
        default=False,
        verbose_name=_('product visibility'),
    )
    created_at = models.DateTimeField(
        editable=False,
        auto_now_add=True,
        help_text=_('format: Y-m-d H:M:S'),
        )
    updated_at = models.DateTimeField(auto_now=True, help_text=_('format: Y-m-d H:M:S'))

    def __str__(self):
        return self.name
</code>```

I'm following the documentation verbatum, and really I have no idea why this is not working...

If anyone has any idea please let me know

Body:
I'm having an issue that I seriously can't wrap my head around.
I am using Django MPTT models and evrerything seems to be working fine (i.e. I can run the migrations and insert data in the database), but for some reason the

TreeForeignKey

table and the

TreeManyToManyField

table are not linking in the database.

Here are the models in question...

from mptt.models import MPTTModel, TreeForeignKey, TreeManyToManyField

class Category(MPTTModel):

    name = models.CharField(
        max_length=100,
        verbose_name=_('category name'),
        help_text=_('format: required, max=100'),
        )

    slug = models.SlugField(
        max_length=150,
        verbose_name=_('category safe URL'),
        help_text=_('format: required, letters, numbers, underscore or hyphons'),
        )

    is_active = models.BooleanField(default=True)

    parent = TreeForeignKey(
        'self',
        on_delete=models.PROTECT,
        related_name='children',
        null=True,
        blank=True,
        )

    class MPTTMeta:
        order_insertion_by = ['name']

    class Meta:
        verbose_name=_('product category')
        verbose_name_plural=_('product categories')

    def __str__(self):
        return self.name

class Product(models.Model):

    web_id = models.CharField(
        unique=True,
        max_length=50,
        verbose_name=_('product website ID'),
    )
    slug = models.SlugField(
        max_length=255,
        verbose_name=_('product safe URL'),
        help_text=_('format: required, letters, numbers, underscore or hyphons'),
    )
    name = models.CharField(max_length=150)
    description = models.TextField(help_text='Required')

    category = TreeManyToManyField(Category)

    is_active = models.BooleanField(
        default=False,
        verbose_name=_('product visibility'),
    )
    created_at = models.DateTimeField(
        editable=False,
        auto_now_add=True,
        help_text=_('format: Y-m-d H:M:S'),
        )
    updated_at = models.DateTimeField(auto_now=True, help_text=_('format: Y-m-d H:M:S'))

    def __str__(self):
        return self.name

I'm following the documentation verbatum, and really I have no idea why this is not working...

If anyone has any idea please let me know


问:
Create a default Description Template in Perforce
What are the steps and commands to create a default Description Template in Perforce on client side not server. For example, the description should look like this whenever user creates a new changelist.

Row1 :
Row2 :
Row3 :

Row4 :

I think we can use form-out. what are the steps and commands involved? There are no proper articles on net. If here we can get solution it will be really helpful.


问:
in ggplot2 how not show values in the x and y axis in graph
my code below but it show the value on the x and y axis but this not ı want

```<code>cervix <- data.frame(1:10,1:10)

ggplot(data =cervix)+
  geom_point(mapping = aes(x= cervix , y=cervix ))+
  ggtitle("cervix bla bla ")+ xlab("genes ") + ylab("other genes")
</code>```

I want take scatter point graph but no take values in the x and y axis instead of this ı will add the value of the each point.

Body:
my code below but it show the value on the x and y axis but this not ı want

cervix <- data.frame(1:10,1:10)

ggplot(data =cervix)+
  geom_point(mapping = aes(x= cervix , y=cervix ))+
  ggtitle("cervix bla bla ")+ xlab("genes ") + ylab("other genes")

I want take scatter point graph but no take values in the x and y axis instead of this ı will add the value of the each point.


问:
force the capitalization of the name when registering a customer
How to force the customer's name in uppercase when registering, as well as the first letter of his first name in uppercase. example: "DUPONT Martine"
For it to be validated in the database as such, and to have impeccable label printing...
(to prevent the client from registering all in lowercase)

Force the registration of the name in all capitals and the first name just with the first letter in capitals example "DUPONT Martine"

prestashop 1.7.8.6


问:
Make a deep json file to a flaten dataframe in R
From this json file : https://www.itftennis.com/tennis/api/PlayerApi/GetPlayerActivity?circuitCode=WCT&matchTypeCode=S&playerId=800305047&skip=180&surfaceCode=&take=50&year=all

which has a very deep structure (lists within lists within lists....)

I want to transform it in a flatten dataframe which can be opened on Excel for example.

I read this json file in r :

```<code>library(jsonlite)
json_data = jsonlite::fromJSON(txt = "https://www.itftennis.com/tennis/api/PlayerApi/GetPlayerActivity?circuitCode=WCT&matchTypeCode=S&playerId=800305047&skip=180&surfaceCode=&take=50&year=all")
json_data2 = json_data[[1]]
</code>```

I need to transform "json_data2" in an unique dataframe which gathers all the information.

I am interested in a solution in r but also in python

Body:
From this json file : https://www.itftennis.com/tennis/api/PlayerApi/GetPlayerActivity?circuitCode=WCT&matchTypeCode=S&playerId=800305047&skip=180&surfaceCode=&take=50&year=all

which has a very deep structure (lists within lists within lists....)

I want to transform it in a flatten dataframe which can be opened on Excel for example.

I read this json file in r :

library(jsonlite)
json_data = jsonlite::fromJSON(txt = "https://www.itftennis.com/tennis/api/PlayerApi/GetPlayerActivity?circuitCode=WCT&matchTypeCode=S&playerId=800305047&skip=180&surfaceCode=&take=50&year=all")
json_data2 = json_data[[1]]

I need to transform "json_data2" in an unique dataframe which gathers all the information.

I am interested in a solution in r but also in python


问:
API documentation in Swagger after unpublishing and publishing again
What happens to my API documentation in Swagger when:

I upload a new version of the API before I publish it?

After I publish, I then unpublish to make changes and publish again?

Is the documentation retained?

Thanks in advance.


问:
VBA Collection.Add not working after first population
I have a class:

```<code>Public store As String
Public group As String
Public code As Long
Public name As String
Public format As Long
Public minQuantity As Long
</code>```

And simple function:

```<code>Private Function addToCollection(ByVal source As Collection, ByRef dest As Collection)
    Dim pos As position
    For Each pos In source
        dest.Add pos
    Next pos
End Function
</code>```

Function addToCollection invokes in this piece of code:

```<code>Public Function getPositions(ByRef stores As Collection, ByVal groupName As String, ByVal matrixArray As Variant) As Collection
    Dim result As New Collection
    Dim groupCol As Integer, formatCol As Integer
    groupCol = getColByName(groupName)
    formatCol = getColByName(matrix)

    Dim filteredByGroupAndFormat As Collection
    Dim item As store
    For Each item In stores
        Set filteredByGroupAndFormat = getPositionsByGroupAndFormat(matrixArray, item.format, formatCol, groupCol, item.name, item.group)

        Call addToCollection(filteredByGroupAndFormat, result)
    Next item

    Set getPositions = result
End Function
</code>```

for the first time it works and new positions are adding to the dest collection, but for the second invocation, the collection is not changing and method .Add simply doesn't work. Does anyone familiar with the problem?

I expect that dest collection will populate with new positions each time the function calls

Body:
I have a class:

Public store As String
Public group As String
Public code As Long
Public name As String
Public format As Long
Public minQuantity As Long

And simple function:

Private Function addToCollection(ByVal source As Collection, ByRef dest As Collection)
    Dim pos As position
    For Each pos In source
        dest.Add pos
    Next pos
End Function

Function addToCollection invokes in this piece of code:

Public Function getPositions(ByRef stores As Collection, ByVal groupName As String, ByVal matrixArray As Variant) As Collection
    Dim result As New Collection
    Dim groupCol As Integer, formatCol As Integer
    groupCol = getColByName(groupName)
    formatCol = getColByName(matrix)

    Dim filteredByGroupAndFormat As Collection
    Dim item As store
    For Each item In stores
        Set filteredByGroupAndFormat = getPositionsByGroupAndFormat(matrixArray, item.format, formatCol, groupCol, item.name, item.group)

        Call addToCollection(filteredByGroupAndFormat, result)
    Next item

    Set getPositions = result
End Function

for the first time it works and new positions are adding to the dest collection, but for the second invocation, the collection is not changing and method .Add simply doesn't work. Does anyone familiar with the problem?

I expect that dest collection will populate with new positions each time the function calls


问:
How to test a TTY reader program in Rust
I am building a TUI in which one of the blocks should display a log that would be reading from a TTY. But I have not a device to do this so I want to emulate a device that sends "hello world" or whatever so that I can test my log receiver.

My simplified code would be this:

```<code>use std::{io::Read, thread::sleep, time::Duration};
use crossterm::{
    event::{EnableMouseCapture},
    execute,
    terminal::{ EnterAlternateScreen},
};
use std::{io::{self}};
use tui::{backend::CrosstermBackend, Terminal, widgets::{Block, Borders, Paragraph}, layout::{Constraint, Direction, Alignment, Layout}};
use serialport::TTYPort;

fn main() {

    let mut stdout = io::stdout();
    execute!(stdout, EnterAlternateScreen, EnableMouseCapture).unwrap();
    let backend = CrosstermBackend::new(stdout);
    let mut terminal = Terminal::new(backend).unwrap();
    let mut tty= TTYPort::open(&serialport::new("/dev/pts/1", 115200)).unwrap();
    let mut buffer = String::new();
    let mut already_printed = false;
    loop {
        terminal.draw(|f| {
            let mut buffer = buffer.clone();

            if tty.read_to_string(&mut buffer).is_ok() || already_printed{
                already_printed=true;
                let size = f.size();
                let lay = Layout::default().direction(Direction::Vertical).constraints([Constraint::Percentage(50)].as_ref()).split(size);
                let block = Paragraph::new(buffer).alignment(Alignment::Center).block(Block::default().borders(Borders::all()));
                f.render_widget(block, lay[0]);

            } else {
                let size = f.size();
                let lay = Layout::default().direction(Direction::Vertical).constraints([Constraint::Percentage(50)].as_ref()).split(size);
                let block = Paragraph::new("No data received!").alignment(Alignment::Center).block(Block::default().borders(Borders::all()));
                f.render_widget(block, lay[0]);
            }

        }).unwrap();
        sleep(Duration::from_secs(1));
    }
}
</code>```

I have tried with pyserial, using a linux terminal and with socat, but I dont know how to make it work.
If I use socat PTY (socat pty,link=$HOME/dev/ttyV0,waitslave tcp:remoteip:remoteport)for example which path should I put in line     let mut tty= TTYPort::open(&serialport::new("/dev/pts/1", 115200)).unwrap();? I tried with /dev/ttyV0 but it just returns a IO error "No such file or directory"  .  In order to simplify what I am asking for is for a way to test this TTY reader code.

Body:
I am building a TUI in which one of the blocks should display a log that would be reading from a TTY. But I have not a device to do this so I want to emulate a device that sends "hello world" or whatever so that I can test my log receiver.

My simplified code would be this:

use std::{io::Read, thread::sleep, time::Duration};
use crossterm::{
    event::{EnableMouseCapture},
    execute,
    terminal::{ EnterAlternateScreen},
};
use std::{io::{self}};
use tui::{backend::CrosstermBackend, Terminal, widgets::{Block, Borders, Paragraph}, layout::{Constraint, Direction, Alignment, Layout}};
use serialport::TTYPort;

fn main() {

    let mut stdout = io::stdout();
    execute!(stdout, EnterAlternateScreen, EnableMouseCapture).unwrap();
    let backend = CrosstermBackend::new(stdout);
    let mut terminal = Terminal::new(backend).unwrap();
    let mut tty= TTYPort::open(&serialport::new("/dev/pts/1", 115200)).unwrap();
    let mut buffer = String::new();
    let mut already_printed = false;
    loop {
        terminal.draw(|f| {
            let mut buffer = buffer.clone();

            if tty.read_to_string(&mut buffer).is_ok() || already_printed{
                already_printed=true;
                let size = f.size();
                let lay = Layout::default().direction(Direction::Vertical).constraints([Constraint::Percentage(50)].as_ref()).split(size);
                let block = Paragraph::new(buffer).alignment(Alignment::Center).block(Block::default().borders(Borders::all()));
                f.render_widget(block, lay[0]);

            } else {
                let size = f.size();
                let lay = Layout::default().direction(Direction::Vertical).constraints([Constraint::Percentage(50)].as_ref()).split(size);
                let block = Paragraph::new("No data received!").alignment(Alignment::Center).block(Block::default().borders(Borders::all()));
                f.render_widget(block, lay[0]);
            }

        }).unwrap();
        sleep(Duration::from_secs(1));
    }
}

I have tried with pyserial, using a linux terminal and with socat, but I dont know how to make it work.
If I use socat PTY (socat pty,link=$HOME/dev/ttyV0,waitslave tcp:remoteip:remoteport)for example which path should I put in line     let mut tty= TTYPort::open(&serialport::new("/dev/pts/1", 115200)).unwrap();? I tried with /dev/ttyV0 but it just returns a IO error "No such file or directory"  .  In order to simplify what I am asking for is for a way to test this TTY reader code.


问:
ASP Identity role is not saved into the database However the Identity user is saved
result = await roleManager.CreateAsync(new IdentityRole(roleName));

I tried

```<code>context.SaveChanges();
</code>```

after adding a role but the server message given duplicated role inserted.???!!!

Body:
result = await roleManager.CreateAsync(new IdentityRole(roleName));

I tried

context.SaveChanges();

after adding a role but the server message given duplicated role inserted.???!!!


问:
Is this the right function to confirm 2 block added ahead of the current block?
```<code>async function waitTransction(blockNumber, transactionHash) {
    await web3.eth.getBlockNumber()
      .then((nextblock) => {
        if (nextblock >= blockNumber + 2) {
          return;
        }
        waitTransction(blockNumber)
      }).catch(() => {
        console.log("No new block added")
      })

    let current = await web3.eth.getBlock("latest");
    if (current.number - blockNumber >= 2) {
      if (blockNumber != null) {
        console.log("blockNumber_mined");
        setLoading(false)
        return;
      } else {
        console.log(
          "Transaction with hash: " +
          transactionHash +
          " ended up in an uncle block."
        )
        setLoading(false)
        return;
      }
    }
  }
</code>```

Working on a dapp. After the transaction on Ethereum blockchain. wanted to confirm the transaction.
Is this the right function to confirm 2 block added ahead of the current block?

Body:
async function waitTransction(blockNumber, transactionHash) {
    await web3.eth.getBlockNumber()
      .then((nextblock) => {
        if (nextblock >= blockNumber + 2) {
          return;
        }
        waitTransction(blockNumber)
      }).catch(() => {
        console.log("No new block added")
      })

    let current = await web3.eth.getBlock("latest");
    if (current.number - blockNumber >= 2) {
      if (blockNumber != null) {
        console.log("blockNumber_mined");
        setLoading(false)
        return;
      } else {
        console.log(
          "Transaction with hash: " +
          transactionHash +
          " ended up in an uncle block."
        )
        setLoading(false)
        return;
      }
    }
  }

Working on a dapp. After the transaction on Ethereum blockchain. wanted to confirm the transaction.
Is this the right function to confirm 2 block added ahead of the current block?


问:
Opensearch in omnibox not working in browsers
EDIT: It actually works on Chromium but not any other browser

I wanted to allow people to search resources on my website by simply pressing TAB in the URL Bar.

I found about Opensearch, so I went and created at the root  of my website this file :

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
    <ShortName>Lolarchiver search</ShortName>
    <Description>Lol Username Search: Find any league of legends player username history and logs</Description>
    <Url type="text/html" method="get" template="https://lolarchiver.com/search?name={searchTerms}&region=EUW&ref=opensearch"/>
    <Image width="16" height="16" type="image/x-icon"> https://lolarchiver.com/image/favicon-16x16.png </Image>
    <InputEncoding>UTF-8</InputEncoding>
</OpenSearchDescription>
```
<p>Then on the html page I added :</p>
<pre class="lang-html prettyprint-override"><code>    <link rel="search" type="application/opensearchdescription+xml" title="Lolarchiver search" href="/opensearch.xml" />
</code>```

I restarted my browser, refreshed the pages, tried on different browsers, but it doesn't work.
I tried a lot of different configurations(like the xml code above) as I read different tutorials, none worked. All had the same result : Nothing happening

I tried to go on the Specification page of Opensearch, as I see it being linked in a lot of places, https://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document , it's 404.

I also tried to take configuration files of websites that have it working, like u.gg, but it doesn't work either.

I'm out of ideas so I ask here maybe someone can help me, thank you

Body:
EDIT: It actually works on Chromium but not any other browser

I wanted to allow people to search resources on my website by simply pressing TAB in the URL Bar.

I found about Opensearch, so I went and created at the root  of my website this file :

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
    <ShortName>Lolarchiver search</ShortName>
    <Description>Lol Username Search: Find any league of legends player username history and logs</Description>
    <Url type="text/html" method="get" template="https://lolarchiver.com/search?name={searchTerms}&region=EUW&ref=opensearch"/>
    <Image width="16" height="16" type="image/x-icon"> https://lolarchiver.com/image/favicon-16x16.png </Image>
    <InputEncoding>UTF-8</InputEncoding>
</OpenSearchDescription>

Then on the html page I added :

    <link rel="search" type="application/opensearchdescription+xml" title="Lolarchiver search" href="/opensearch.xml" />

I restarted my browser, refreshed the pages, tried on different browsers, but it doesn't work.
I tried a lot of different configurations(like the xml code above) as I read different tutorials, none worked. All had the same result : Nothing happening

I tried to go on the Specification page of Opensearch, as I see it being linked in a lot of places, https://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document , it's 404.

I also tried to take configuration files of websites that have it working, like u.gg, but it doesn't work either.

I'm out of ideas so I ask here maybe someone can help me, thank you


问:
Why is the migration not being added?
When trying to add a migration, I get the error "Unable to create an object of type 'AppDataContext'. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728"

DbContext code:

```<code>using Microsoft.EntityFrameworkCore;

namespace ProductionAccountingData
{
    public class AppDataContext:DbContext
    {
        public AppDataContext(DbContextOptions<AppDataContext> options) :
            base(options) {
            try //noble crutch! (ﾉ◕ヮ◕)ﾉ*:･ﾟ✧
            {
                Database.EnsureCreated();
            }
            catch(Exception ex) { };
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.UseSerialColumns();
        }
        public DbSet<Employee> Employees { get; set; } = null!;
        public DbSet<Work> Works { get; set; } = null!;
    }
}
</code>```

Code for adding context in the main project file:

```<code>var builder = WebApplication.CreateBuilder(args);

// Add services to the container.
builder.Services.AddControllersWithViews();

string? connection = builder.Configuration.GetConnectionString("DepartmentDb");

builder.Services.AddDbContext<AppDataContext>(options => options.UseNpgsql(connection));

var app = builder.Build();
</code>```

Connection string from settings:

```<code>
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "\*",
"ConnectionStrings": {
"DepartmentDb": "Server=localhost;Database=departmentdb;port=5432;User Id=postgres;Password=122331"
}
}

</code>```

I don’t understand what can cause an error. Can you tell me what the problem is?(I have two projects in my solution, one is responsible for the data, the other for my web application)

Title: Why is the migration not being added?

Body:
When trying to add a migration, I get the error "Unable to create an object of type 'AppDataContext'. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728"

DbContext code:

using Microsoft.EntityFrameworkCore;

namespace ProductionAccountingData
{
    public class AppDataContext:DbContext
    {
        public AppDataContext(DbContextOptions<AppDataContext> options) :
            base(options) {
            try //noble crutch! (ﾉ◕ヮ◕)ﾉ*:･ﾟ✧
            {
                Database.EnsureCreated();
            }
            catch(Exception ex) { };
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.UseSerialColumns();
        }
        public DbSet<Employee> Employees { get; set; } = null!;
        public DbSet<Work> Works { get; set; } = null!;
    }
}

Code for adding context in the main project file:

var builder = WebApplication.CreateBuilder(args);

// Add services to the container.
builder.Services.AddControllersWithViews();

string? connection = builder.Configuration.GetConnectionString("DepartmentDb");

builder.Services.AddDbContext<AppDataContext>(options => options.UseNpgsql(connection));

var app = builder.Build();

Connection string from settings:

{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "\*",
"ConnectionStrings": {
"DepartmentDb": "Server=localhost;Database=departmentdb;port=5432;User Id=postgres;Password=122331"
}
}

I don’t understand what can cause an error. Can you tell me what the problem is?(I have two projects in my solution, one is responsible for the data, the other for my web application)


问:
Text near textinput in kivy
I'm trying to write a text and a textinput to the left of the screen, but text goes to the left, while textinput goes to the right. I want them close. I made several tests by inserting float or boxlayouts but during resizing the textinput is moved. I would like something like this:

```<code>age []
</code>```

But i have something like this (without dots):

```<code>Age...........................................[]
</code>```

This is my code:

```<code>        BoxLayout:
        orientation: "vertical"
        size_hint: 1,1
        BoxLayout:
            size_hint: .3,1
            Label:
                text: "Age"
                font_size: dp(20)
                text_size: self.size
                color: 0,0,0,1
                size_hint: .8,1
                halign: "left"
                valign: "middle"
            TextInput:
                id: age
                size_hint: None,.6
                font_size: dp(20)
                width: self.font_size*3
                input_filter: "int"
                multiline: False
                pos_hint: {"x":0, "center_y":0.5}
</code>```

Title: Text near textinput in kivy

Body:
I'm trying to write a text and a textinput to the left of the screen, but text goes to the left, while textinput goes to the right. I want them close. I made several tests by inserting float or boxlayouts but during resizing the textinput is moved. I would like something like this:

age []

But i have something like this (without dots):

Age...........................................[]

This is my code:

        BoxLayout:
        orientation: "vertical"
        size_hint: 1,1
        BoxLayout:
            size_hint: .3,1
            Label:
                text: "Age"
                font_size: dp(20)
                text_size: self.size
                color: 0,0,0,1
                size_hint: .8,1
                halign: "left"
                valign: "middle"
            TextInput:
                id: age
                size_hint: None,.6
                font_size: dp(20)
                width: self.font_size*3
                input_filter: "int"
                multiline: False
                pos_hint: {"x":0, "center_y":0.5}


问:
Telegram login hash check is failed in python
I'm trying to implement Telegram login to my site (https://core.telegram.org/widgets/login), and got stuck with hash checking problem - they just do not match.

The same function worked before, but now it's not, probably after i switched to python 3.11 (maybe that's why it's not working)

Here is my check function (sha256 is from hashlib):

```<code>def check_hash(body):
    secret_key = sha256(os.environ.get("TG_TOKEN", "").encode()).digest()
    hash_string = body.pop("hash")
    data_string = [f"{key}={value}" for key, value in body.items()]
    data_string = "\n".join(sorted(data_string))
    return hmac.new(secret_key, data_string.encode(), sha256).hexdigest() == hash_string
</code>```

I also tried to use ready-made solution from github, but it failed too.

Body:
I'm trying to implement Telegram login to my site (https://core.telegram.org/widgets/login), and got stuck with hash checking problem - they just do not match.

The same function worked before, but now it's not, probably after i switched to python 3.11 (maybe that's why it's not working)

Here is my check function (sha256 is from hashlib):

def check_hash(body):
    secret_key = sha256(os.environ.get("TG_TOKEN", "").encode()).digest()
    hash_string = body.pop("hash")
    data_string = [f"{key}={value}" for key, value in body.items()]
    data_string = "\n".join(sorted(data_string))
    return hmac.new(secret_key, data_string.encode(), sha256).hexdigest() == hash_string

I also tried to use ready-made solution from github, but it failed too.


问:
Grafana - Interval for getting values from a specific time
I need to display values in a graph in Grafana iteratively starting from a specific time. For example, you want to display data for the time interval 08:00AM - 08:00PM (with a difference of 12 hours).
To calculate the values for the interval, the delta function is used. But at the moment, days are displayed starting from 00:00.

I tried to start drawing the data at 08:00PM but at midnight the graph was redrawn again. How can I adjust this 8 hours shift to draw values?
Query options


问:
How can I do a ManyToOne Annotation in JPA with joinColum from a class who have a primaryKey pair association target error
Hello everyone i have this error when i launch my application :

An association that targets entity from entity 'has 1 '@JoinColumn's but the primary key has 2 columns.

My problem is to create a ManyToOne association for my Reservation class who is a Chambre object.

This my first question on stackOverflow be indulgent please :) and teach me the good practice

Here this my ChambrePrimaryKey pair class : `

```<code>public class ChambrePKId {

    @OneToOne(
    cascade = CascadeType.ALL,
    fetch = FetchType.EAGER)
    @JoinColumn(name ="id_nom_hotel")
    private Hotel hotel;

    @GeneratedValue (strategy = GenerationType.IDENTITY)
    @Column(name = "id_chambre")
    private int  idChambre;

}
</code>```

Here my @ID from the class Chambre

```<code>@Entity
@Table(name = "chambre")
@IdClass(ChambrePKId.class)
public class Chambre {

    @Id
    private int  idChambre;
        //...
`
    @Id
    private Hotel hotel;

</code>```

Here my reservation ManyToOne association

```<code>    @ManyToOne(targetEntity = Chambre.class, fetch = FetchType.EAGER, cascade = CascadeType.ALL)
    @JoinColumns({
    @JoinColumn(name = "idChambre"),
    @JoinColumn(name = "hotel")
    })
    private Chambre chambre;
</code>```

`
In fact in my table Reservation i don't have a column id_nom_hotel is it necessarily ?

I have try to add MappedId with only chamber in my manyToOne association but it failed,
i've try also to not references the second joinColumn but it failed also.

Thanks you for your time :D

Body:
Hello everyone i have this error when i launch my application :

An association that targets entity from entity 'has 1 '@JoinColumn's but the primary key has 2 columns.

My problem is to create a ManyToOne association for my Reservation class who is a Chambre object.

This my first question on stackOverflow be indulgent please :) and teach me the good practice

Here this my ChambrePrimaryKey pair class : `

public class ChambrePKId {

    @OneToOne(
    cascade = CascadeType.ALL,
    fetch = FetchType.EAGER)
    @JoinColumn(name ="id_nom_hotel")
    private Hotel hotel;

    @GeneratedValue (strategy = GenerationType.IDENTITY)
    @Column(name = "id_chambre")
    private int  idChambre;

}

Here my @ID from the class Chambre

@Entity
@Table(name = "chambre")
@IdClass(ChambrePKId.class)
public class Chambre {

    @Id
    private int  idChambre;
        //...
`
    @Id
    private Hotel hotel;

Here my reservation ManyToOne association

    @ManyToOne(targetEntity = Chambre.class, fetch = FetchType.EAGER, cascade = CascadeType.ALL)
    @JoinColumns({
    @JoinColumn(name = "idChambre"),
    @JoinColumn(name = "hotel")
    })
    private Chambre chambre;

`
In fact in my table Reservation i don't have a column id_nom_hotel is it necessarily ?

I have try to add MappedId with only chamber in my manyToOne association but it failed,
i've try also to not references the second joinColumn but it failed also.

Thanks you for your time :D