问:
kotlin compiler not able to compile expression for( i in 0..n)
I am getting a build failed with following exception, not able to understand what is wrong in following code. can anybody help me with this. Its builds well when i run on my laptop, but fails in my CI pipeline in azure devOps.

```<code>2022-12-14T07:21:42.4290976Z > Task :app:compileDebugKotlin FAILED
2022-12-14T07:21:42.4291871Z e: org.jetbrains.kotlin.util.KotlinFrontEndException: Exception while analyzing expression at (3102,29) in /home/vsts/work/1/s/app/src/main/java/com/bfl/superapp/hybrid/HWWebChromeClient.kt
2022-12-14T07:21:42.4292480Z
2022-12-14T07:21:42.4292887Z Attachments:
2022-12-14T07:21:42.4293323Z expression.kt
2022-12-14T07:21:42.4293754Z for (i in 0..sizeDetails){
2022-12-14T07:21:42.4294274Z                             if(cart_details.get(i).appId.equals(appId)){
2022-12-14T07:21:42.4294825Z                                 appidfound = true
2022-12-14T07:21:42.4295294Z                                 cartDetailsNew.appId = appId
2022-12-14T07:21:42.4295914Z                                 cartDetailsNew.resumeFlag = cart_details.get(i).resumeFlag
2022-12-14T07:21:42.4296523Z                                 cartDetailsNew.mobileNo = cart_details.get(i).mobileNo
2022-12-14T07:21:42.4297114Z                                 cartDetailsNew.prod = cart_details.get(i).prod
2022-12-14T07:21:42.4297703Z                                 cartDetailsNew.prodProps = cart_details.get(i).prodProps
2022-12-14T07:21:42.4298282Z                                 cartDetailsNew.channel = cart_details.get(i).channel
2022-12-14T07:21:42.4298864Z                                 if(cms_cartData != null && cms_cartData.size > 0) {
2022-12-14T07:21:42.4299684Z                                     val sizeData = cms_cartData.size - 1
2022-12-14T07:21:42.4300215Z                                     for (k in 0..sizeData) {
2022-12-14T07:21:42.4300763Z                                         if (cart_details.get(i).prod == cms_cartData.get(k).prodcode) {
2022-12-14T07:21:42.4301336Z                                             cartDetailsNew.appLink =
2022-12-14T07:21:42.4301882Z                                                 cms_cartData.get(k).in_app_link.toString()
2022-12-14T07:21:42.4302394Z                                             cartDetailsNew.img =
2022-12-14T07:21:42.4302931Z                                                 cms_cartData.get(k).imagelink.toString()
2022-12-14T07:21:42.4303448Z                                             cartDetailsNew.prodDesc =
2022-12-14T07:21:42.4303992Z                                                 cms_cartData.get(k).proddesc.toString()
2022-12-14T07:21:42.4339094Z                                         }
2022-12-14T07:21:42.4339718Z                                     }
2022-12-14T07:21:42.4340431Z                                 }
2022-12-14T07:21:42.4340863Z                                 break
2022-12-14T07:21:42.4341290Z                             }
2022-12-14T07:21:42.4341560Z
2022-12-14T07:21:42.4341959Z                             }
2022-12-14T07:21:42.4342663Z    at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.logOrThrowException(ExpressionTypingVisitorDispatcher.java:253)
2022-12-14T07:21:42.4343675Z    at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.lambda$getTypeInfo$0(ExpressionTypingVisitorDispatcher.java:224)
2022-12-14T07:21:42.4344545Z    at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:101)
2022-12-14T07:21:42.4345373Z    at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:164)
2022-12-14T07:21:42.4346363Z    at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:147)
2022-12-14T07:21:42.4347441Z    at org.jetbrains.kotlin.types.expressions.ExpressionTypingServices.getTypeOfLastExpressionInBlock(ExpressionTypingServices.java:406)
2022-12-14T07:21:42.4348430Z    at org.jetbrains.kotlin.types.expressions.ExpressionTypingServices.getBlockReturnedTypeWithWritableScope(ExpressionTypingServices.java:327)
</code>```

When I try to build same code on my laptop it works, it fails intermittently only on DeoOps pipeline.

Here is the pipeliye yml code

trigger:

develop

name: $(Build.DefinitionName)_$(Date:yyyyMMdd)BuildNo$(Rev:_rr)

jobs:

job: Build_Application_binary
pool:
vmImage: 'ubuntu-latest'
displayName: 'Build native Android App'
steps:

template: pipelinesteps/copy_pwa_dist.yml

template: pipelinesteps/gradle_build.yml

template: pipelinesteps/download_keystore_file.yml

template: pipelinesteps/sign_aab_file.yml

template: pipelinesteps/copy_files_to_artifactory.yml

job: Publish_to_AppCenter
pool:
vmImage: 'ubuntu-latest'
displayName: 'Publish to AppCenter'
dependsOn: Build_Application_binary
condition: succeeded()
steps:

template: pipelinesteps/publish_to_appcenter.yml

and here is the Gradle Task pipeline which is failing

steps:

template: maven_authentication.yml

task: Gradle@2
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
MAVEN_FEED_USER_NAME: 'AzureDevOps'
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx6144m'
publishJUnitResults: false
testResultsFiles: '**/TEST-*.xml'
tasks: 'app:bundleDebug'
mavenAuthenticateFeed: true

Body:
I am getting a build failed with following exception, not able to understand what is wrong in following code. can anybody help me with this. Its builds well when i run on my laptop, but fails in my CI pipeline in azure devOps.

2022-12-14T07:21:42.4290976Z > Task :app:compileDebugKotlin FAILED
2022-12-14T07:21:42.4291871Z e: org.jetbrains.kotlin.util.KotlinFrontEndException: Exception while analyzing expression at (3102,29) in /home/vsts/work/1/s/app/src/main/java/com/bfl/superapp/hybrid/HWWebChromeClient.kt
2022-12-14T07:21:42.4292480Z
2022-12-14T07:21:42.4292887Z Attachments:
2022-12-14T07:21:42.4293323Z expression.kt
2022-12-14T07:21:42.4293754Z for (i in 0..sizeDetails){
2022-12-14T07:21:42.4294274Z                             if(cart_details.get(i).appId.equals(appId)){
2022-12-14T07:21:42.4294825Z                                 appidfound = true
2022-12-14T07:21:42.4295294Z                                 cartDetailsNew.appId = appId
2022-12-14T07:21:42.4295914Z                                 cartDetailsNew.resumeFlag = cart_details.get(i).resumeFlag
2022-12-14T07:21:42.4296523Z                                 cartDetailsNew.mobileNo = cart_details.get(i).mobileNo
2022-12-14T07:21:42.4297114Z                                 cartDetailsNew.prod = cart_details.get(i).prod
2022-12-14T07:21:42.4297703Z                                 cartDetailsNew.prodProps = cart_details.get(i).prodProps
2022-12-14T07:21:42.4298282Z                                 cartDetailsNew.channel = cart_details.get(i).channel
2022-12-14T07:21:42.4298864Z                                 if(cms_cartData != null && cms_cartData.size > 0) {
2022-12-14T07:21:42.4299684Z                                     val sizeData = cms_cartData.size - 1
2022-12-14T07:21:42.4300215Z                                     for (k in 0..sizeData) {
2022-12-14T07:21:42.4300763Z                                         if (cart_details.get(i).prod == cms_cartData.get(k).prodcode) {
2022-12-14T07:21:42.4301336Z                                             cartDetailsNew.appLink =
2022-12-14T07:21:42.4301882Z                                                 cms_cartData.get(k).in_app_link.toString()
2022-12-14T07:21:42.4302394Z                                             cartDetailsNew.img =
2022-12-14T07:21:42.4302931Z                                                 cms_cartData.get(k).imagelink.toString()
2022-12-14T07:21:42.4303448Z                                             cartDetailsNew.prodDesc =
2022-12-14T07:21:42.4303992Z                                                 cms_cartData.get(k).proddesc.toString()
2022-12-14T07:21:42.4339094Z                                         }
2022-12-14T07:21:42.4339718Z                                     }
2022-12-14T07:21:42.4340431Z                                 }
2022-12-14T07:21:42.4340863Z                                 break
2022-12-14T07:21:42.4341290Z                             }
2022-12-14T07:21:42.4341560Z
2022-12-14T07:21:42.4341959Z                             }
2022-12-14T07:21:42.4342663Z    at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.logOrThrowException(ExpressionTypingVisitorDispatcher.java:253)
2022-12-14T07:21:42.4343675Z    at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.lambda$getTypeInfo$0(ExpressionTypingVisitorDispatcher.java:224)
2022-12-14T07:21:42.4344545Z    at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:101)
2022-12-14T07:21:42.4345373Z    at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:164)
2022-12-14T07:21:42.4346363Z    at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:147)
2022-12-14T07:21:42.4347441Z    at org.jetbrains.kotlin.types.expressions.ExpressionTypingServices.getTypeOfLastExpressionInBlock(ExpressionTypingServices.java:406)
2022-12-14T07:21:42.4348430Z    at org.jetbrains.kotlin.types.expressions.ExpressionTypingServices.getBlockReturnedTypeWithWritableScope(ExpressionTypingServices.java:327)

When I try to build same code on my laptop it works, it fails intermittently only on DeoOps pipeline.

Here is the pipeliye yml code

trigger:

develop

name: $(Build.DefinitionName)_$(Date:yyyyMMdd)BuildNo$(Rev:_rr)

jobs:

job: Build_Application_binary
pool:
vmImage: 'ubuntu-latest'
displayName: 'Build native Android App'
steps:

template: pipelinesteps/copy_pwa_dist.yml

template: pipelinesteps/gradle_build.yml

template: pipelinesteps/download_keystore_file.yml

template: pipelinesteps/sign_aab_file.yml

template: pipelinesteps/copy_files_to_artifactory.yml

job: Publish_to_AppCenter
pool:
vmImage: 'ubuntu-latest'
displayName: 'Publish to AppCenter'
dependsOn: Build_Application_binary
condition: succeeded()
steps:

template: pipelinesteps/publish_to_appcenter.yml

and here is the Gradle Task pipeline which is failing

steps:

template: maven_authentication.yml

task: Gradle@2
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
MAVEN_FEED_USER_NAME: 'AzureDevOps'
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx6144m'
publishJUnitResults: false
testResultsFiles: '**/TEST-*.xml'
tasks: 'app:bundleDebug'
mavenAuthenticateFeed: true


来源: stackexchange

问:
Merge (2+) Multi Index Pandas DFs on common Indexes (with some DFs missing a few Indexes) - Efficiently
We need to merge multiple pandas multi-index Dataframes.

The catch is that, some have fewer indexes than the others. The same value needs to be broadcast for all cases of missing indexes (as shown in the screenshot)

Since the frames will be huge (upto 10M rows)  with upto 8 index levels, and some to be merged will have only 2-3 of those, I need it to be efficient. I was wondering what's a good way to accomplish this.

DF1

index1
index2
index3
val1

11
21
31
100

32
101

12
22
33
102

34
103

DF2

index1
index2
val2

11
21
200

12
22
300

DF1 merge DF2

index1
index2
index3
val1
val2

11
21
31
100
200

32
101
200

12
22
33
102
300

34
103
300

I've tried using traditional pd.merge, pd.join, pd.concat, but they're quite slow for my data, taking several minutes for larger frames. Since this needs to be repeated frequently, I can't afford this time. They should be sorted in the same way, so I don't need to sort by index.

ContentLicense: CC BY-SA 4.0


问:
How to find a point on the epiline?
I have 2 pics, and the points, points1 and points2, on both the images. Points 2 are corresponding points of points1. But they are not in order, for example the first value in the points1 is not the corresponding point of the first point in points2. I have found the Epilines of points1 on the image 2. Right now I want to match the corresponding points2 to points1. This can be done if I search for the point on the Epiline. How do I proceed?</p>

Title: How to find a point on the epiline?


问:
405 (Method Not Allowed) in live Shared hosting - Laravel and Vue3 with Vite
So, this is my first post on stack, if I missed something please let me know.

So I have project that's working well on localhost Dev but when i uploaded to the server the API given 405 method not allowed.

I have a login form:

```<code><form @submit.prevent="login" method="POST">
          <input type="hidden" name="_token" :value="form.csrf">
          <p><input type="email" name="login" placeholder="Username or Email" v-model="form.email"></p>
          <p><input type="password" placeholder="Please Enter Password" v-model="form.password"></p>
          <p class="remember_me">
          </p>
          <p class="submit"><input type="submit" value="Login"></p>
        </form>
</code>```

The form has some inputs, a textarea and a file input. Those are my routes:

```<code>Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
});

Route::controller(AuthController::class)->group(function(){
    Route::post('/login', 'login');
});
</code>```

When I submit the form I get the The GET method is not supported for this route. Supported methods: POST. error.

Here is my Route list :

enter image description here

after everything possible things updating still on same error.

enter image description here

In Chrome network tab showing this

enter image description here

Maybe you guys have any idea what is happening here and point me in the right direction.

Thanks!

Body:
So, this is my first post on stack, if I missed something please let me know.

So I have project that's working well on localhost Dev but when i uploaded to the server the API given 405 method not allowed.

I have a login form:

<form @submit.prevent="login" method="POST">
          <input type="hidden" name="_token" :value="form.csrf">

<input type="email" name="login" placeholder="Username or Email" v-model="form.email">

<input type="password" placeholder="Please Enter Password" v-model="form.password">

<input type="submit" value="Login">

        </form>

The form has some inputs, a textarea and a file input. Those are my routes:

Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
});

Route::controller(AuthController::class)->group(function(){
    Route::post('/login', 'login');
});

When I submit the form I get the The GET method is not supported for this route. Supported methods: POST. error.

Here is my Route list :

enter image description here

after everything possible things updating still on same error.

enter image description here

In Chrome network tab showing this

enter image description here

Maybe you guys have any idea what is happening here and point me in the right direction.

Thanks!


问:
Why I am receiving TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) error in API?
What is implemented ?
I have created a API using express which has functionality to send the payload to the registered web hook URL. I hosted the API on the Linux server and used Nginx as reverse proxy.

Problem Error

Error: connect ECONNREFUSED 127.0.0.1:443\n    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16)

I have noticed that the error occurs when the payload is sent over the locally tunneled URL (eg. Ngrok).

Used Version
Axios: 0.27.2
Node.js: 16.18.1

```<code>axios.post(webhookURL, payload).catch((error) => console.error(`Error --> ${error.response?.data?.error || error.stack || error.message}`))
</code>```

Body:
What is implemented ?
I have created a API using express which has functionality to send the payload to the registered web hook URL. I hosted the API on the Linux server and used Nginx as reverse proxy.

Problem Error

Error: connect ECONNREFUSED 127.0.0.1:443\n    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16)

I have noticed that the error occurs when the payload is sent over the locally tunneled URL (eg. Ngrok).

Used Version
Axios: 0.27.2
Node.js: 16.18.1

axios.post(webhookURL, payload).catch((error) => console.error(`Error --> ${error.response?.data?.error || error.stack || error.message}`))


问:
Setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (6000,)
I'm trying to give fch1 to pywt.cwt for creating coefficients but when I give that this comes with a value error as a question

```<code>samplingFreq = 100
dataPeriod = 60  # sec
numSamples = samplingFreq * dataPeriod * 3
print(numSamples)
readDataFromFile = open('input.ecg', 'rb')
datatype = np.dtype('B')
filedata = np.fromfile(readDataFromFile, datatype)
# print(filedata)
p = list(filedata)
ecgarr = np.array(p)
totSamples = len(ecgarr)
numRows = int(totSamples / numSamples)
curateData = [[0] * numSamples for i in range(numRows)]
totEntries = int(numSamples / 3)
fch1 = [[0] * 1 for i in range(totEntries)]

# Divide the total samples in sets of 'numSamples'
xcntr = 0
for x in range(0, totSamples, numSamples):
    ycntr = 0
    for y in range(x, (x + numSamples), 1):
        curateData[xcntr][ycntr] = ecgarr[y]
        ycntr = ycntr + 1

    xcntr = xcntr + 1

## Convert curateData into a channels

cntr = 0
for x in range(0, numRows, 1):
    cntr = 0
    for y in range(1, int(numSamples / 3), 1):
        #print(y)
        fch1[cntr] = curateData[x][3 * (y - 1)]
        # Do CWT
        coef, freq = pywt.cwt(fch1, np.arange(1, 129), 'morl')
        print(coef)
</code>```

I'm not able to find out why I'm getting the error.

coef, freq = pywt.cwt(fch1, np.arange(1, 129), 'morl')

On the above line of code, I'm getting error.
Any Help would be so appreciable.
Thank you

Body:
I'm trying to give fch1 to pywt.cwt for creating coefficients but when I give that this comes with a value error as a question

samplingFreq = 100
dataPeriod = 60  # sec
numSamples = samplingFreq * dataPeriod * 3
print(numSamples)
readDataFromFile = open('input.ecg', 'rb')
datatype = np.dtype('B')
filedata = np.fromfile(readDataFromFile, datatype)
# print(filedata)
p = list(filedata)
ecgarr = np.array(p)
totSamples = len(ecgarr)
numRows = int(totSamples / numSamples)
curateData = [[0] * numSamples for i in range(numRows)]
totEntries = int(numSamples / 3)
fch1 = [[0] * 1 for i in range(totEntries)]

# Divide the total samples in sets of 'numSamples'
xcntr = 0
for x in range(0, totSamples, numSamples):
    ycntr = 0
    for y in range(x, (x + numSamples), 1):
        curateData[xcntr][ycntr] = ecgarr[y]
        ycntr = ycntr + 1

    xcntr = xcntr + 1

## Convert curateData into a channels

cntr = 0
for x in range(0, numRows, 1):
    cntr = 0
    for y in range(1, int(numSamples / 3), 1):
        #print(y)
        fch1[cntr] = curateData[x][3 * (y - 1)]
        # Do CWT
        coef, freq = pywt.cwt(fch1, np.arange(1, 129), 'morl')
        print(coef)

I'm not able to find out why I'm getting the error.

coef, freq = pywt.cwt(fch1, np.arange(1, 129), 'morl')

On the above line of code, I'm getting error.
Any Help would be so appreciable.
Thank you


问:
AWS RabbitMQ and Django Rest Framw: socket.gaierror: [Errno -2] Name or service not known
I am trying to connect to an AWS rabbitmq service using pika but I am unable to connect

```<code>import pika

params = pika.URLParameters("amqps://{uname}:{paswd}@<endpoint>")

connection = pika.BlockingConnection(params)

channel = connection.channel()

def publish():
    channel.basic_publish(exchange='', routing_key='bid_group', body='hello')
</code>```

The error is form connection = pika.BlockingConnection(params)

```<code>Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/rohan/Development/crm/lib/python3.10/site-packages/pika/adapters/blocking_connection.py", line 360, in __init__
    self._impl = self._create_connection(parameters, _impl_class)
  File "/home/rohan/Development/crm/lib/python3.10/site-packages/pika/adapters/blocking_connection.py", line 451, in _create_connection
    raise self._reap_last_connection_workflow_error(error)
  File "/home/rohan/Development/crm/lib/python3.10/site-packages/pika/adapters/utils/selector_ioloop_adapter.py", line 565, in _resolve
    result = socket.getaddrinfo(self._host, self._port, self._family,
  File "/usr/lib/python3.10/socket.py", line 955, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

</code>```

I was following the link to set this up. I tried AWS official docs
and it gives the same response

Body:
I am trying to connect to an AWS rabbitmq service using pika but I am unable to connect

import pika

params = pika.URLParameters("amqps://{uname}:{paswd}@<endpoint>")

connection = pika.BlockingConnection(params)

channel = connection.channel()

def publish():
    channel.basic_publish(exchange='', routing_key='bid_group', body='hello')

The error is form connection = pika.BlockingConnection(params)

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/rohan/Development/crm/lib/python3.10/site-packages/pika/adapters/blocking_connection.py", line 360, in __init__
    self._impl = self._create_connection(parameters, _impl_class)
  File "/home/rohan/Development/crm/lib/python3.10/site-packages/pika/adapters/blocking_connection.py", line 451, in _create_connection
    raise self._reap_last_connection_workflow_error(error)
  File "/home/rohan/Development/crm/lib/python3.10/site-packages/pika/adapters/utils/selector_ioloop_adapter.py", line 565, in _resolve
    result = socket.getaddrinfo(self._host, self._port, self._family,
  File "/usr/lib/python3.10/socket.py", line 955, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

I was following the link to set this up. I tried AWS official docs
and it gives the same response


问:
RSA encryption is giving different values on different .Net framworks
RSA algorithm is producing different output value on different .NET framework. The encrypted password with .NET 3.5 framework has "==" at end but with .NET 4.6.2 the encrypted password has only one "=" at end.

Password = "abc123"
output generate on .NET 3.5

vsJJq67cZaS89DMI1BtPDxiWrnNZykqAgJTLUv4un/Zs1acZbaQ8P/kiahC2ZXEsT+d/2JtYxlDiUr63gaR4QGPEAowBadiE7FfThBVeRyNU6O5vc/ptW+wenp3K9ScMy9ZLyPCp9Sp6zoLxFohBKk/RK0mW9YHH/KgEoQsVVeDLFjnWm/svZynCHJjPmG1uaBSP5B4+SStkZNJidhIm7sv0vf9Inb0N1gl4xlq8GtXEgWuQS5SwS+oa4yJNMr9zGPnpagVAXJZbVKFA04xRmU7O7Szl4Cska4oXpVJyhDL304UbvH3Q/2FYmnZ7gLcmbxIqcmr/4jfDs/MixLYrBQ==

Password = "abc123"
output generate on .NET 4.6.2

AF2oLOsFQJnMEC3B7iJ5HPBAtWfoTDUXAK8FcOIv2vjc7G0VTUo3qOtF2bBrbpcABhUY5+IifZHOIgWQB1umGcGCsPs3i2pYLrP3c1uhCycE9GNvn9VywUZPD4XsnZrJcPuuV9QS5nDgf6/xIX5PVdAFuFLEceL+yEr19dhi6o+kBGx88boKDPMBQB+r3zJSK1fBZ6p3zvOmUTjxZ4RAxOiyLHdM7MineeyYCsmkd5x7O6BKc37tLSgQWVSUcpT25ib8T1/F794zP8IV2LHw7fZA8QRF7WftLHsPZl2HJegfclKEyOjIVqZe8Qup9dhmSBxM5Jb1U1nGlTDapYe3+C0=

Scenario: I am sending the encrypted password to third party for verification but the they failed to decrypte the encrypted password generated by .NET 4.6.2 framework, but they are getting password after decryption of encrypted password generated by .NET 3.5 framework.

My code for encryption is

```<code>        public string Encryption(string strText)
        {
            var testData = Encoding.UTF8.GetBytes(strText);
            RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
            rsa.FromXmlString(publicKey.ToString());
            var encryptedData = rsa.Encrypt(testData, false);
            return Convert.ToBase64String(encryptedData);
        }
</code>```

My Approach to cater this issue right now

I am writing the encrypted password generated by .NET 3.5 framework into file and read the output from the file in .NET 4.6.2 framework.

My approach looks not right solution because when the customers load will increase for password verification the CPU usage will be very high that will affect the system performance.

Please guide me how to cater this problem with right approach or my approach is right ?

Body:
RSA algorithm is producing different output value on different .NET framework. The encrypted password with .NET 3.5 framework has "==" at end but with .NET 4.6.2 the encrypted password has only one "=" at end.

Password = "abc123"
output generate on .NET 3.5

vsJJq67cZaS89DMI1BtPDxiWrnNZykqAgJTLUv4un/Zs1acZbaQ8P/kiahC2ZXEsT+d/2JtYxlDiUr63gaR4QGPEAowBadiE7FfThBVeRyNU6O5vc/ptW+wenp3K9ScMy9ZLyPCp9Sp6zoLxFohBKk/RK0mW9YHH/KgEoQsVVeDLFjnWm/svZynCHJjPmG1uaBSP5B4+SStkZNJidhIm7sv0vf9Inb0N1gl4xlq8GtXEgWuQS5SwS+oa4yJNMr9zGPnpagVAXJZbVKFA04xRmU7O7Szl4Cska4oXpVJyhDL304UbvH3Q/2FYmnZ7gLcmbxIqcmr/4jfDs/MixLYrBQ==

Password = "abc123"
output generate on .NET 4.6.2

AF2oLOsFQJnMEC3B7iJ5HPBAtWfoTDUXAK8FcOIv2vjc7G0VTUo3qOtF2bBrbpcABhUY5+IifZHOIgWQB1umGcGCsPs3i2pYLrP3c1uhCycE9GNvn9VywUZPD4XsnZrJcPuuV9QS5nDgf6/xIX5PVdAFuFLEceL+yEr19dhi6o+kBGx88boKDPMBQB+r3zJSK1fBZ6p3zvOmUTjxZ4RAxOiyLHdM7MineeyYCsmkd5x7O6BKc37tLSgQWVSUcpT25ib8T1/F794zP8IV2LHw7fZA8QRF7WftLHsPZl2HJegfclKEyOjIVqZe8Qup9dhmSBxM5Jb1U1nGlTDapYe3+C0=

Scenario: I am sending the encrypted password to third party for verification but the they failed to decrypte the encrypted password generated by .NET 4.6.2 framework, but they are getting password after decryption of encrypted password generated by .NET 3.5 framework.

My code for encryption is

        public string Encryption(string strText)
        {
            var testData = Encoding.UTF8.GetBytes(strText);
            RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
            rsa.FromXmlString(publicKey.ToString());
            var encryptedData = rsa.Encrypt(testData, false);
            return Convert.ToBase64String(encryptedData);
        }

My Approach to cater this issue right now

I am writing the encrypted password generated by .NET 3.5 framework into file and read the output from the file in .NET 4.6.2 framework.

My approach looks not right solution because when the customers load will increase for password verification the CPU usage will be very high that will affect the system performance.

Please guide me how to cater this problem with right approach or my approach is right ?


问:
What is the difference between Dask Delayed and Future?
I’m working on a parallelization task which requires low level customization.

I think I understand both Delayed and Future concepts, but I have a hard time deciding which one to use in which situation.

Which is more appropriate when? (Or how to efficiently use both together).

Thank you,


问:
MySQL: I need to know if articles that have been stored in a compartment, were withdrawn within 1 week after storing
I have the following table called operation (there are more columns, but these are the relevant ones):

```<code>idOperation articleNumber articleLabel   userIdentifier userName dateTime            actionName   quantity
----------- ------------- -------------- -------------- -------- ------------------- ----------   --------
1           Article_01    Articletext_01 00001          Max      2022-12-09 07:22:28 Store        1
2           Article_02    Articletext_02 00002          John     2022-12-09 07:22:50 Store        1
3           Article_01    Articletext_01 00003          Jane     2022-12-11 09:31:47 Withdraw     1
</code>```

Article_01 is stored on 2022-12-09 and withdrawn on 2022-12-11, so everything is fine.

Article_02 is stored on 2022-12-09 and not withdrawn within 1 week, so i want to know.

I want to compare two different rows with the same articleNumber, if there is a store and a withdraw operation within 1 week of each other.

I don't have any idea how to start my command.

```<code>SELECT idOperation, articleNumber, articleLabel, userIdentifier, userName, dateTime, actionName, quantity
FROM operation
WHERE actionName IN ("Store", "Withdraw");
</code>```

Any help is appreciated. Thank you.

Body:
I have the following table called operation (there are more columns, but these are the relevant ones):

idOperation articleNumber articleLabel   userIdentifier userName dateTime            actionName   quantity
----------- ------------- -------------- -------------- -------- ------------------- ----------   --------
1           Article_01    Articletext_01 00001          Max      2022-12-09 07:22:28 Store        1
2           Article_02    Articletext_02 00002          John     2022-12-09 07:22:50 Store        1
3           Article_01    Articletext_01 00003          Jane     2022-12-11 09:31:47 Withdraw     1

Article_01 is stored on 2022-12-09 and withdrawn on 2022-12-11, so everything is fine.

Article_02 is stored on 2022-12-09 and not withdrawn within 1 week, so i want to know.

I want to compare two different rows with the same articleNumber, if there is a store and a withdraw operation within 1 week of each other.

I don't have any idea how to start my command.

SELECT idOperation, articleNumber, articleLabel, userIdentifier, userName, dateTime, actionName, quantity
FROM operation
WHERE actionName IN ("Store", "Withdraw");

Any help is appreciated. Thank you.


问:
Leave-class of Vue transition on <slot/> not working
I have a default-layout component of which the transition works, but only half of it. The transition consists of two parts, one enter and one leave transition. Problem is that it only shows the enter transition. When a new slot component is rendered, the transition starts at opacity: 100% and transitions to 0%. The leave transition that is supposed to go from opacity: 0% to 100% first, is not shown at all.

Here's default-layout.vue:

```<code><template>
  <div class="bg-slate-900">
    <c-header/>
    <transition
      mode="out-in"
      appear-from-class="opacity-0"
      leave-to-class="opacity-0"
      appear-active-class="transition duration-1000"
      leave-active-class="transition duration-1000" appear>
      <slot/>
    </transition>
  </div>
</template>
</code>```

This is how default-layout is placed in for example the index.vue component:

```<code><template>
  <default-layout>

    // ...

  </default-layout>
</template>
</code>```

First I had no appear property on the transition, which prevented it entirely from working. After reading Transition not working for slots in vue 3 I've added the appear prop which made half of the transition work at least.

How would I make the leave part of the transition work as well?

Body:
I have a default-layout component of which the transition works, but only half of it. The transition consists of two parts, one enter and one leave transition. Problem is that it only shows the enter transition. When a new slot component is rendered, the transition starts at opacity: 100% and transitions to 0%. The leave transition that is supposed to go from opacity: 0% to 100% first, is not shown at all.

Here's default-layout.vue:

<template>

    <c-header/>
    <transition
      mode="out-in"
      appear-from-class="opacity-0"
      leave-to-class="opacity-0"
      appear-active-class="transition duration-1000"
      leave-active-class="transition duration-1000" appear>
      <slot/>
    </transition>

</template>

This is how default-layout is placed in for example the index.vue component:

<template>
  <default-layout>

    // ...

  </default-layout>
</template>

First I had no appear property on the transition, which prevented it entirely from working. After reading Transition not working for slots in vue 3 I've added the appear prop which made half of the transition work at least.

How would I make the leave part of the transition work as well?


问:
How to Hide the button and show its content in Angular?
I need to show the contents which is in button. When we click the Button, it disappears and the content should be shown. Please help me to do this.

component.html *

```<code> <div *ngIf="previous == true">
          <div class="btn btn-light">
            <div>
              <div>
                <input type="button" value="View more" id="yesradio" name="content"
                  (click)="onItemChange($any($event.target).value)">
                <label for="yesradio">
                  Yes
                </label>
              </div>
            </div>
          </div>
        </div>
</code>```

component.ts *

```<code>import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'Demo-3';
  name = 'Angular Toggle Show Hide';

  public questions: any = {};
  public fbNumber = 0;
  public questionObject: any;
  previous: boolean = true;
  yesOption: boolean = false;
  noOption: boolean = false;
  previousTwo: boolean = true;

  showBlock=false;

  constructor() { }
  onItemChange(value) {
    console.log(value);
    this.previous = false;
    if (value == 1) {
      this.yesOption = true;
    }
  }
</code>```

Body:
I need to show the contents which is in button. When we click the Button, it disappears and the content should be shown. Please help me to do this.

component.html *

                <input type="button" value="View more" id="yesradio" name="content"
                  (click)="onItemChange($any($event.target).value)">

                  Yes

component.ts *

import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'Demo-3';
  name = 'Angular Toggle Show Hide';

  public questions: any = {};
  public fbNumber = 0;
  public questionObject: any;
  previous: boolean = true;
  yesOption: boolean = false;
  noOption: boolean = false;
  previousTwo: boolean = true;

  showBlock=false;

  constructor() { }
  onItemChange(value) {
    console.log(value);
    this.previous = false;
    if (value == 1) {
      this.yesOption = true;
    }
  }


问:
flutter convert get value string to double google map
I want to convert a value from String to double for fetching data in google map but it says The instance member 'lat','lag' can't be accessed in an initializer.

```<code>String lat = '${searchitems[0].address![widget.index].latitude}';
double latitude = double.parse(lat);

 String lng = '${searchitems[0].address![widget.index].longitude}';
 double longitude = double.parse(lng);

 static const LatLng centerMap =
  LatLng(lat, lng);  <<<<<<<< I want to get the value to put here.
</code>```

This is code textformfield where i will pull to googlemap get value from longitude page

```<code>TextFormField(
            initialValue:
                '${searchitems[0].address![widget.index].longitude}'
                    .replaceAll(badNull[0], ''),
            decoration: InputDecoration(
              labelText: 'longitude',
              labelStyle:
                  TextStyle(fontFamily: 'supermarket', fontSize: 16),
              isDense: true,
            ),
          ),
</code>```

Body:
I want to convert a value from String to double for fetching data in google map but it says The instance member 'lat','lag' can't be accessed in an initializer.

String lat = '${searchitems[0].address![widget.index].latitude}';
double latitude = double.parse(lat);

 String lng = '${searchitems[0].address![widget.index].longitude}';
 double longitude = double.parse(lng);

 static const LatLng centerMap =
  LatLng(lat, lng);  <<<<<<<< I want to get the value to put here.

This is code textformfield where i will pull to googlemap get value from longitude page

TextFormField(
            initialValue:
                '${searchitems[0].address![widget.index].longitude}'
                    .replaceAll(badNull[0], ''),
            decoration: InputDecoration(
              labelText: 'longitude',
              labelStyle:
                  TextStyle(fontFamily: 'supermarket', fontSize: 16),
              isDense: true,
            ),
          ),


问:
"ffi-napi@npm:4.0.3 couldn't be built successfully (exit code 1)"
I was trying to install a project (https://github.com/junta/tradingview-alert-connector.git). When I yarn it, it failed with errors. Then, I try to rerun it and the result is the same.
I’m using node.js v18.12.1. and yarn 3.3.0

```<code>➤ YN0000: ┌ Resolution step
➤ YN0002: │ tradingview-alert-connector@workspace:. doesn't provide big.js (pb6e7e), requested by @perp/sdk-curie
➤ YN0060: │ tradingview-alert-connector@workspace:. provides ethers (p9fa99) with version 5.7.2, which doesn't satisfy what @perp/sdk-curie requests
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 0s 730ms
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 1s 792ms
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0007: │ ffi-napi@npm:4.0.3 must be built because it never has been before or the last one failed
➤ YN0009: │ ffi-napi@npm:4.0.3 couldn't be built successfully (exit code 1, logs can be found here: C:\Users\User\AppData\Local\Temp\xfs-9d9591b9\build.log)
➤ YN0000: └ Completed in 13s 594ms
➤ YN0000: Failed with errors in 16s 363ms
</code>```

Here is the build log for C:\Users\User\AppData\Local\Temp\xfs-9d9591b9\build.log

```<code># This file contains the result of Yarn building a package (ffi-napi@npm:4.0.3)
# Script name: install

gyp info it worked if it ends with ok
gyp info using node-gyp@9.3.0
gyp info using node@18.12.1 | win32 | x64
gyp info find Python using Python version 3.10.9 found at "C:\Users\User\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe"
gyp info find VS using VS2022 (17.4.33205.214) found at:
gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
gyp info find VS run with --verbose for detailed information
gyp info spawn C:\Users\User\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe
gyp info spawn args [
gyp info spawn args   'C:\\Users\\User\\Downloads\\tradingview-alert-connector-main\\tradingview-alert-connector-main\\.yarn\\unplugged\\node-gyp-npm-9.3.0-21c41a4dfd\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\User\\Downloads\\tradingview-alert-connector-main\\tradingview-alert-connector-main\\.yarn\\unplugged\\ffi-napi-npm-4.0.3-fb70453a70\\node_modules\\ffi-napi\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\User\\Downloads\\tradingview-alert-connector-main\\tradingview-alert-connector-main\\.yarn\\unplugged\\node-gyp-npm-9.3.0-21c41a4dfd\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\User\\AppData\\Local\\node-gyp\\Cache\\18.12.1\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\User\\AppData\\Local\\node-gyp\\Cache\\18.12.1',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\User\\Downloads\\tradingview-alert-connector-main\\tradingview-alert-connector-main\\.yarn\\unplugged\\node-gyp-npm-9.3.0-21c41a4dfd\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\User\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\18.12.1\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\User\\Downloads\\tradingview-alert-connector-main\\tradingview-alert-connector-main\\.yarn\\unplugged\\ffi-napi-npm-4.0.3-fb70453a70\\node_modules\\ffi-napi',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\Users\\User\\Downloads\\tradingview-alert-connector-main\\tradingview-alert-connector-main\\.yarn\\unplugged\\ffi-napi-npm-4.0.3-fb70453a70\\node_modules\\ffi-napi\\build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
Traceback (most recent call last):
  File "C:\Users\User\Downloads\tradingview-alert-connector-main\tradingview-alert-connector-main\.yarn\unplugged\node-gyp-npm-9.3.0-21c41a4dfd\node_modules\node-gyp\gyp\gyp_main.py", line 45, in <module>
    sys.exit(gyp.script_main())
  File "C:\Users\User\Downloads\tradingview-alert-connector-main\tradingview-alert-connector-main\.yarn\unplugged\node-gyp-npm-9.3.0-21c41a4dfd\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 686, in script_main
    return main(sys.argv[1:])
  File "C:\Users\User\Downloads\tradingview-alert-connector-main\tradingview-alert-connector-main\.yarn\unplugged\node-gyp-npm-9.3.0-21c41a4dfd\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 678, in main
    return gyp_main(args)
  File "C:\Users\User\Downloads\tradingview-alert-connector-main\tradingview-alert-connector-main\.yarn\unplugged\node-gyp-npm-9.3.0-21c41a4dfd\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 663, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "C:\Users\User\Downloads\tradingview-alert-connector-main\tradingview-alert-connector-main\.yarn\unplugged\node-gyp-npm-9.3.0-21c41a4dfd\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 2143, in GenerateOutput
    _GenerateProject(project, options, msvs_version, generator_flags, spec)
  File "C:\Users\User\Downloads\tradingview-alert-connector-main\tradingview-alert-connector-main\.yarn\unplugged\node-gyp-npm-9.3.0-21c41a4dfd\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 1030, in _GenerateProject
    return _GenerateMSBuildProject(project, options, version, generator_flags, spec)
  File "C:\Users\User\Downloads\tradingview-alert-connector-main\tradingview-alert-connector-main\.yarn\unplugged\node-gyp-npm-9.3.0-21c41a4dfd\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 3735, in _GenerateMSBuildProject
    _GenerateMSBuildFiltersFile(
  File "C:\Users\User\Downloads\tradingview-alert-connector-main\tradingview-alert-connector-main\.yarn\unplugged\node-gyp-npm-9.3.0-21c41a4dfd\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 2222, in _GenerateMSBuildFiltersFile
    easy_xml.WriteXmlIfChanged(content, filters_path, pretty=True, win32=True)
  File "C:\Users\User\Downloads\tradingview-alert-connector-main\tradingview-alert-connector-main\.yarn\unplugged\node-gyp-npm-9.3.0-21c41a4dfd\node_modules\node-gyp\gyp\pylib\gyp\easy_xml.py", line 137, in WriteXmlIfChanged
    with open(path, "wb") as file:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\User\\Downloads\\tradingview-alert-connector-main\\tradingview-alert-connector-main\\.yarn\\unplugged\\ffi-napi-npm-4.0.3-fb70453a70\\node_modules\\ffi-napi\\build\\..\\..\\..\\node-addon-api-npm-3.2.1-a29528f81d\\node_modules\\node-addon-api\\nothing.vcxproj.filters'
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\User\Downloads\tradingview-alert-connector-main\tradingview-alert-connector-main\.yarn\unplugged\node-gyp-npm-9.3.0-21c41a4dfd\node_modules\node-gyp\lib\configure.js:325:16)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Windows_NT 10.0.19044
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\User\\Downloads\\tradingview-alert-connector-main\\tradingview-alert-connector-main\\.yarn\\unplugged\\node-gyp-npm-9.3.0-21c41a4dfd\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\User\Downloads\tradingview-alert-connector-main\tradingview-alert-connector-main\.yarn\unplugged\ffi-napi-npm-4.0.3-fb70453a70\node_modules\ffi-napi
gyp ERR! node -v v18.12.1
gyp ERR! node-gyp -v v9.3.0
gyp ERR! not ok
</code>```

I would really appreciate it if anyone could give me some advice.

Body:
I was trying to install a project (https://github.com/junta/tradingview-alert-connector.git). When I yarn it, it failed with errors. Then, I try to rerun it and the result is the same.
I’m using node.js v18.12.1. and yarn 3.3.0

➤ YN0000: ┌ Resolution step
➤ YN0002: │ tradingview-alert-connector@workspace:. doesn't provide big.js (pb6e7e), requested by @perp/sdk-curie
➤ YN0060: │ tradingview-alert-connector@workspace:. provides ethers (p9fa99) with version 5.7.2, which doesn't satisfy what @perp/sdk-curie requests
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 0s 730ms
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 1s 792ms
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0007: │ ffi-napi@npm:4.0.3 must be built because it never has been before or the last one failed
➤ YN0009: │ ffi-napi@npm:4.0.3 couldn't be built successfully (exit code 1, logs can be found here: C:\Users\User\AppData\Local\Temp\xfs-9d9591b9\build.log)
➤ YN0000: └ Completed in 13s 594ms
➤ YN0000: Failed with errors in 16s 363ms

Here is the build log for C:\Users\User\AppData\Local\Temp\xfs-9d9591b9\build.log

# This file contains the result of Yarn building a package (ffi-napi@npm:4.0.3)
# Script name: install

gyp info it worked if it ends with ok
gyp info using node-gyp@9.3.0
gyp info using node@18.12.1 | win32 | x64
gyp info find Python using Python version 3.10.9 found at "C:\Users\User\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe"
gyp info find VS using VS2022 (17.4.33205.214) found at:
gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
gyp info find VS run with --verbose for detailed information
gyp info spawn C:\Users\User\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe
gyp info spawn args [
gyp info spawn args   'C:\\Users\\User\\Downloads\\tradingview-alert-connector-main\\tradingview-alert-connector-main\\.yarn\\unplugged\\node-gyp-npm-9.3.0-21c41a4dfd\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\User\\Downloads\\tradingview-alert-connector-main\\tradingview-alert-connector-main\\.yarn\\unplugged\\ffi-napi-npm-4.0.3-fb70453a70\\node_modules\\ffi-napi\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\User\\Downloads\\tradingview-alert-connector-main\\tradingview-alert-connector-main\\.yarn\\unplugged\\node-gyp-npm-9.3.0-21c41a4dfd\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\User\\AppData\\Local\\node-gyp\\Cache\\18.12.1\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\User\\AppData\\Local\\node-gyp\\Cache\\18.12.1',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\User\\Downloads\\tradingview-alert-connector-main\\tradingview-alert-connector-main\\.yarn\\unplugged\\node-gyp-npm-9.3.0-21c41a4dfd\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\User\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\18.12.1\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\User\\Downloads\\tradingview-alert-connector-main\\tradingview-alert-connector-main\\.yarn\\unplugged\\ffi-napi-npm-4.0.3-fb70453a70\\node_modules\\ffi-napi',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\Users\\User\\Downloads\\tradingview-alert-connector-main\\tradingview-alert-connector-main\\.yarn\\unplugged\\ffi-napi-npm-4.0.3-fb70453a70\\node_modules\\ffi-napi\\build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
Traceback (most recent call last):
  File "C:\Users\User\Downloads\tradingview-alert-connector-main\tradingview-alert-connector-main\.yarn\unplugged\node-gyp-npm-9.3.0-21c41a4dfd\node_modules\node-gyp\gyp\gyp_main.py", line 45, in <module>
    sys.exit(gyp.script_main())
  File "C:\Users\User\Downloads\tradingview-alert-connector-main\tradingview-alert-connector-main\.yarn\unplugged\node-gyp-npm-9.3.0-21c41a4dfd\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 686, in script_main
    return main(sys.argv[1:])
  File "C:\Users\User\Downloads\tradingview-alert-connector-main\tradingview-alert-connector-main\.yarn\unplugged\node-gyp-npm-9.3.0-21c41a4dfd\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 678, in main
    return gyp_main(args)
  File "C:\Users\User\Downloads\tradingview-alert-connector-main\tradingview-alert-connector-main\.yarn\unplugged\node-gyp-npm-9.3.0-21c41a4dfd\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 663, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "C:\Users\User\Downloads\tradingview-alert-connector-main\tradingview-alert-connector-main\.yarn\unplugged\node-gyp-npm-9.3.0-21c41a4dfd\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 2143, in GenerateOutput
    _GenerateProject(project, options, msvs_version, generator_flags, spec)
  File "C:\Users\User\Downloads\tradingview-alert-connector-main\tradingview-alert-connector-main\.yarn\unplugged\node-gyp-npm-9.3.0-21c41a4dfd\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 1030, in _GenerateProject
    return _GenerateMSBuildProject(project, options, version, generator_flags, spec)
  File "C:\Users\User\Downloads\tradingview-alert-connector-main\tradingview-alert-connector-main\.yarn\unplugged\node-gyp-npm-9.3.0-21c41a4dfd\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 3735, in _GenerateMSBuildProject
    _GenerateMSBuildFiltersFile(
  File "C:\Users\User\Downloads\tradingview-alert-connector-main\tradingview-alert-connector-main\.yarn\unplugged\node-gyp-npm-9.3.0-21c41a4dfd\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 2222, in _GenerateMSBuildFiltersFile
    easy_xml.WriteXmlIfChanged(content, filters_path, pretty=True, win32=True)
  File "C:\Users\User\Downloads\tradingview-alert-connector-main\tradingview-alert-connector-main\.yarn\unplugged\node-gyp-npm-9.3.0-21c41a4dfd\node_modules\node-gyp\gyp\pylib\gyp\easy_xml.py", line 137, in WriteXmlIfChanged
    with open(path, "wb") as file:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\User\\Downloads\\tradingview-alert-connector-main\\tradingview-alert-connector-main\\.yarn\\unplugged\\ffi-napi-npm-4.0.3-fb70453a70\\node_modules\\ffi-napi\\build\\..\\..\\..\\node-addon-api-npm-3.2.1-a29528f81d\\node_modules\\node-addon-api\\nothing.vcxproj.filters'
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\User\Downloads\tradingview-alert-connector-main\tradingview-alert-connector-main\.yarn\unplugged\node-gyp-npm-9.3.0-21c41a4dfd\node_modules\node-gyp\lib\configure.js:325:16)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Windows_NT 10.0.19044
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\User\\Downloads\\tradingview-alert-connector-main\\tradingview-alert-connector-main\\.yarn\\unplugged\\node-gyp-npm-9.3.0-21c41a4dfd\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\User\Downloads\tradingview-alert-connector-main\tradingview-alert-connector-main\.yarn\unplugged\ffi-napi-npm-4.0.3-fb70453a70\node_modules\ffi-napi
gyp ERR! node -v v18.12.1
gyp ERR! node-gyp -v v9.3.0
gyp ERR! not ok

I would really appreciate it if anyone could give me some advice.


问:
Codeigniter RestFull Api Call Show Error on Postman
Its Baseurl of api call http://localhost/data_model/users/login when i run this in postman or browser its show me the error. My all links after data_model like data_model/a or data_model/b that are created in folders show me same error.

Error: {"status":false,"message":"Invalid Request","data":[],"auth_code":"100100"}

`

```<code>public function login() {
        $input = $this->validate_login();

        $user = $this->Users_model->login($input);
        if ($user) {
            if ($user['status'] == 1)
                return_data(false, 'Your Account Disabled', json_decode("{}"));
            else if ($user['status'] == 1)
                return_data(false, 'Account Deleted', json_decode("{}"));
            else {
                return_data(true, 'User authentication successful.', $user);
            }
        }
        return_data(false, 'Authentication Failed', json_decode("{}"));
    }
</code>```

`

```<code>defined('BASEPATH') OR exit('No direct script access allowed');
use Restserver\Libraries\REST_Controller;

require APPPATH . 'libraries/REST_Controller.php';

require APPPATH . 'libraries/Format.php';
</code>```

Body:
Its Baseurl of api call http://localhost/data_model/users/login when i run this in postman or browser its show me the error. My all links after data_model like data_model/a or data_model/b that are created in folders show me same error.

Error: {"status":false,"message":"Invalid Request","data":[],"auth_code":"100100"}

`

public function login() {
        $input = $this->validate_login();

        $user = $this->Users_model->login($input);
        if ($user) {
            if ($user['status'] == 1)
                return_data(false, 'Your Account Disabled', json_decode("{}"));
            else if ($user['status'] == 1)
                return_data(false, 'Account Deleted', json_decode("{}"));
            else {
                return_data(true, 'User authentication successful.', $user);
            }
        }
        return_data(false, 'Authentication Failed', json_decode("{}"));
    }

`

defined('BASEPATH') OR exit('No direct script access allowed');
use Restserver\Libraries\REST_Controller;

require APPPATH . 'libraries/REST_Controller.php';

require APPPATH . 'libraries/Format.php';


问:
How to set ACK timeout on MQTT Eclipse paho java?
I was wondering how to set ACK timeout, since on the MqttConnectOptions library doesn't have the set ACK timeout but only timeout from the client to the broker by general. I need to set ACK timeout so that i could customize the time between the client and broker when sending a particular message

I tried searching online and exploring MqttConnectOptions library but I had a dead end since there are not a lot of people discussing the ACK timeout for Mqtt message. Also im using Mqtt Eclipse paho java library 3.1 and Synchronized client. Im also using qos 2 for the message.


问:
How to share large video file (2.2 GB) between Windows and Mac
I recorded (using Xbox Game Bar) a video on a Windows 10 machine, and I would like to edit it on my Mac. At the moment I am saving the file as .mp4 and sharing it using OneDrive.

When I open it on OSX using Quick Time (bottom image), the video looks corrupted. If I open it with VLC (top image), I have a green border. Do you have any solution to recommend?


问:
Aiomysql (2003, "Can't connect to MySQL server on '127.0.0.1'")
I have a python script that spawns processes with the concurrent.futures package, and all these processes send INSERT queries to my database hosted on the same machine (I connect to it by using 127.0.0.1)

Every time it works for a few hours, then those queries start returning : (2003, "Can't connect to MySQL server on '127.0.0.1'")

Upon failure my program tries to send a new query 2 seconds later.(They will all fail too)

The database is not down because I can still send requests to it on MySQL Workbench, that systemctl status indicates it's active, and that I even restarted mysql and mariadb through systemctl restart (while the script was failing to send queries) and it still wouldn't work.

But, if I simply killed all the processes my script made, and started the script again, everything work.

I have no idea where to even begin to search, I tried to look on google and in this forum but it's never the same as my issue and I'm kind of lost here

Thank you for your help

Below is the code responsible for sending requests, and handling failures. I know it doesn't look great.

    async def request_wrapper(query_type, request, dict=False, retry=0, charset='', collation=None, db='twitch_chat'):
        try:
            conn = await Connect(db)
            if query_type == 'INSERT' and len(charset) > 0:
                try:
                    await conn.set_charset_collation(charset=charset)
                except Exception as e:
                    print(e,"[#994]")
            cursor = await conn.cursor()
            await cursor.execute('SET NAMES utf8mb4')
            await cursor.execute("SET CHARACTER SET utf8mb4")
            await cursor.execute("SET character_set_connection=utf8mb4")
            await cursor.execute(request)
            if query_type == "SELECT":
                result = await cursor.fetchall()
                await cursor.close()
                conn.close()
                return result
            await cursor.close()
            conn.close()
        except Exception as e:
            try:
                if e[0] == 1062:
                    return
            except:
                print("======================")
                print(e, "#00.5")
                print("======================")
                return
            if retry < 3:
                print("======================")
                print(f"({datetime.datetime.now().strftime('%H:%M')}) [MYSQL ERROR]", request)
                print(e)
                print("RETRY IN 2 SECONDS.")
                print("======================")
                sleep(2)
                await request_wrapper(query_type, request, dict, retry+1, charset, collation)
                try:
                    conn.close()
                except Exception as e:
                    print(e, "#993")

    async def Connect(db):
        try:
            conn = await aiomysql.connect(
                host = credentials.host,
                db = db,
                user = credentials.user,
                password = credentials.password,
                autocommit=True
            )
        except Exception as err:
            print(f"({datetime.datetime.now().strftime('%H:%M')})",err, "\n Retrying in 2 seconds", "#992")
            sleep(2)
            return await Connect(db)
        return conn
```

The script log file indicate it passes through where you'll see "#992" in the code(in the Connect function in the exception handler)

Body:
I have a python script that spawns processes with the concurrent.futures package, and all these processes send INSERT queries to my database hosted on the same machine (I connect to it by using 127.0.0.1)

Every time it works for a few hours, then those queries start returning : (2003, "Can't connect to MySQL server on '127.0.0.1'")

Upon failure my program tries to send a new query 2 seconds later.(They will all fail too)

The database is not down because I can still send requests to it on MySQL Workbench, that systemctl status indicates it's active, and that I even restarted mysql and mariadb through systemctl restart (while the script was failing to send queries) and it still wouldn't work.

But, if I simply killed all the processes my script made, and started the script again, everything work.

I have no idea where to even begin to search, I tried to look on google and in this forum but it's never the same as my issue and I'm kind of lost here

Thank you for your help

Below is the code responsible for sending requests, and handling failures. I know it doesn't look great.

    async def request_wrapper(query_type, request, dict=False, retry=0, charset='', collation=None, db='twitch_chat'):
        try:
            conn = await Connect(db)
            if query_type == 'INSERT' and len(charset) > 0:
                try:
                    await conn.set_charset_collation(charset=charset)
                except Exception as e:
                    print(e,"[#994]")
            cursor = await conn.cursor()
            await cursor.execute('SET NAMES utf8mb4')
            await cursor.execute("SET CHARACTER SET utf8mb4")
            await cursor.execute("SET character_set_connection=utf8mb4")
            await cursor.execute(request)
            if query_type == "SELECT":
                result = await cursor.fetchall()
                await cursor.close()
                conn.close()
                return result
            await cursor.close()
            conn.close()
        except Exception as e:
            try:
                if e[0] == 1062:
                    return
            except:
                print("======================")
                print(e, "#00.5")
                print("======================")
                return
            if retry < 3:
                print("======================")
                print(f"({datetime.datetime.now().strftime('%H:%M')}) [MYSQL ERROR]", request)
                print(e)
                print("RETRY IN 2 SECONDS.")
                print("======================")
                sleep(2)
                await request_wrapper(query_type, request, dict, retry+1, charset, collation)
                try:
                    conn.close()
                except Exception as e:
                    print(e, "#993")

    async def Connect(db):
        try:
            conn = await aiomysql.connect(
                host = credentials.host,
                db = db,
                user = credentials.user,
                password = credentials.password,
                autocommit=True
            )
        except Exception as err:
            print(f"({datetime.datetime.now().strftime('%H:%M')})",err, "\n Retrying in 2 seconds", "#992")
            sleep(2)
            return await Connect(db)
        return conn

The script log file indicate it passes through where you'll see "#992" in the code(in the Connect function in the exception handler)


问:
How to check if a Rectangle resides within a Bitmap
I am trying to create a function which says whether a Rectangle(int x, int y, int width, int height) resides within a Bitmap image. Here x or y can be >= 0

```<code>public bool RectangleIsinBitmap(Rectangle rec)
{
    Bitmap bitmap = new Bitmap(500, 500);
    if(//rec resides in bitmapImg )
        return true;
    else
        return false;
}
</code>```

Any ideas or thoughts are much appreciated.

Body:
I am trying to create a function which says whether a Rectangle(int x, int y, int width, int height) resides within a Bitmap image. Here x or y can be >= 0

public bool RectangleIsinBitmap(Rectangle rec)
{
    Bitmap bitmap = new Bitmap(500, 500);
    if(//rec resides in bitmapImg )
        return true;
    else
        return false;
}

Any ideas or thoughts are much appreciated.


问:
Kubernetes: EKS Cluster : name: idle daemonset
I am seeing a daemonset present in our "Kube-system" namespace  of EKS Cluster with the name as "idle".

Can anyone please specify its use case and whether deleting it will cause any issues in my cluster?

```<code>apiVersion: apps/v1
kind: DaemonSet
metadata:
  annotations:
    deprecated.daemonset.template.generation: "1"
  creationTimestamp: "2022-12-16T04:54:08Z"
  generation: 1
  labels:
    k8s-app: idle
  name: idle
  namespace: kube-system
</code>```

Body:
I am seeing a daemonset present in our "Kube-system" namespace  of EKS Cluster with the name as "idle".

Can anyone please specify its use case and whether deleting it will cause any issues in my cluster?

apiVersion: apps/v1
kind: DaemonSet
metadata:
  annotations:
    deprecated.daemonset.template.generation: "1"
  creationTimestamp: "2022-12-16T04:54:08Z"
  generation: 1
  labels:
    k8s-app: idle
  name: idle
  namespace: kube-system


问:
jenkins pipeline step to run a command in second container when first container generates a file
Team,

my goal is to write from container that is spin using jenkinspipeline to the host file.

I have a use case where I am performing a test of code in one container main and this generates a file in volume mounted emptydir on both the containers as you will see the pod spec and then I want to run a scan on the code with that generated file as a parameter such that scan posts results to server with the code coverage results.
The unit-tests.sh creates a file myfile under /coverage-data path in main from where scan container is to read.

I have two concerns
1 - my pipeline is failing with below syntax error.
2 - I did not test my logic yet due to 1 error above but am I on right track? like checking the condition COVERAGE_FILE which is set by container main if it generates file and writes on share emptydir?

```<code>org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Only one agent type is allowed per agent section
       agent {
       ^

: No agent type specified. Must be one of [any, kubernetes, label, none]
       agent {
       ^
2 errors

</code>```

ex: main container to run code coverage then in sonar-scan container pipeline runs a command to scan

jenkinsfile

```<code>
pipeline {
    agent {
        label 'label-coverage-cli'
        docker {
            args '-v /:/hosts-root/'
        }
    }

    environment {
        COVERAGE_FILE = fileExists '/coverage-data/myfile'
    }

    stages {
        stage('Code Coverage Tests') {
            steps {
                container('main') {
                        sh '''
                        unit-tests.sh
                        '''.stripIndent()
                }
            }
        }
        stage('Code Coverage Scan') {
            when { expression { COVERAGE_FILE == 'true' } }
            steps {
                container('sonar-scan') {
                        sh '''
                        src/ui/scripts/ci/scan.sh
                        '''.stripIndent()
                }
            }
        }
    }
}
</code>```

pod template for jenkins

```<code>apiVersion: v1
kind: Pod
spec:
  imagePullSecrets:
    - name: artifactory-build-project
  volumes:
    - name: shared-data
      emptyDir: {}
  containers:
    - name: main
      image: registry/tci-sonar-scanner:latest
      resources:
        requests:
          memory: 32Gi
          cpu: 18
        limits:
          memory: 48Gi
          cpu: 24
      volumeMounts:
      - name: shared-data
        mountPath: /coverage-data
      command:
        - /sbin/tini
      args:
        - --
        - sleep
        - infinity
    - name: sonar-scanner
      image: registry/sonarqube-scanner:4.7.0.2747
      resources:
        requests:
          memory: 12Gi
          cpu: 8
        limits:
          memory: 18Gi
          cpu: 12
      volumeMounts:
      - name: shared-data
        mountPath: /coverage-data
      securityContext:
        privileged: true
      command:
        - tail
      args:
      - "-f"
      - "/dev/null"
</code>```

Body:
Team,

my goal is to write from container that is spin using jenkinspipeline to the host file.

I have a use case where I am performing a test of code in one container main and this generates a file in volume mounted emptydir on both the containers as you will see the pod spec and then I want to run a scan on the code with that generated file as a parameter such that scan posts results to server with the code coverage results.
The unit-tests.sh creates a file myfile under /coverage-data path in main from where scan container is to read.

I have two concerns
1 - my pipeline is failing with below syntax error.
2 - I did not test my logic yet due to 1 error above but am I on right track? like checking the condition COVERAGE_FILE which is set by container main if it generates file and writes on share emptydir?

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Only one agent type is allowed per agent section
       agent {
       ^

: No agent type specified. Must be one of [any, kubernetes, label, none]
       agent {
       ^
2 errors

ex: main container to run code coverage then in sonar-scan container pipeline runs a command to scan

jenkinsfile

pipeline {
    agent {
        label 'label-coverage-cli'
        docker {
            args '-v /:/hosts-root/'
        }
    }

    environment {
        COVERAGE_FILE = fileExists '/coverage-data/myfile'
    }

    stages {
        stage('Code Coverage Tests') {
            steps {
                container('main') {
                        sh '''
                        unit-tests.sh
                        '''.stripIndent()
                }
            }
        }
        stage('Code Coverage Scan') {
            when { expression { COVERAGE_FILE == 'true' } }
            steps {
                container('sonar-scan') {
                        sh '''
                        src/ui/scripts/ci/scan.sh
                        '''.stripIndent()
                }
            }
        }
    }
}

pod template for jenkins

apiVersion: v1
kind: Pod
spec:
  imagePullSecrets:
    - name: artifactory-build-project
  volumes:
    - name: shared-data
      emptyDir: {}
  containers:
    - name: main
      image: registry/tci-sonar-scanner:latest
      resources:
        requests:
          memory: 32Gi
          cpu: 18
        limits:
          memory: 48Gi
          cpu: 24
      volumeMounts:
      - name: shared-data
        mountPath: /coverage-data
      command:
        - /sbin/tini
      args:
        - --
        - sleep
        - infinity
    - name: sonar-scanner
      image: registry/sonarqube-scanner:4.7.0.2747
      resources:
        requests:
          memory: 12Gi
          cpu: 8
        limits:
          memory: 18Gi
          cpu: 12
      volumeMounts:
      - name: shared-data
        mountPath: /coverage-data
      securityContext:
        privileged: true
      command:
        - tail
      args:
      - "-f"
      - "/dev/null"


问:
How to Display Different Mock Requests for particular stories in Storybook 6.4 Angular13,Same APIs are displaying in Mock Request Tab for all stories
Issue in Below Mock Request Tab attached as image all 5 mock service are display. Which should not when I have added serviceMock1 in story1.parameter for Story1 then its should display only 2 service but its displaying all 5 service including serviceMock1 + serviceMock2.

NOTE -: If you refresh the page from story1 then its will display only 2 service after that once I navigate to story2 then it will start displaying all 5 service in Mock Request Tab.

Please check attached image below

Story1 Mock Service
Story1.stories.ts

```<code>import { moduleMetadata, Story, Meta } from '@storybook/angular';
import { CommonModule } from '@angular/common';
import withMock from 'storybook-addon-mock';
import { serviceMock1 } from 'shared/mocks/service1.mock';

export default {
  title: 'Components/Story1',
  component: Story1Component,
  parameters: {
    docs: {
      iframeHeight: 300
    }
  },
  decorators: [
    withMock,
    moduleMetadata({
      declarations: [],
      imports: [
        CommonModule,
        BrowserModule,
        ReactiveFormsModule,
        FormsModule,
        BrowserAnimationsModule,
        HttpClientModule,
      ]
    })
  ]
} as Meta;

const Template: Story<Story1Component> = (args: Story1Component) => ({
  template: '<story1-component></story1-component>',
  props: {
    ...args
  }
});

export const Story1 = Template.bind({});

Story1.parameters = serviceMock1; // 2 mock service available
Story1 .args = {
  label: 'Some Text'
};

</code>```

Story2 Mock Service
Story2.stories.ts

```<code>import { moduleMetadata, Story, Meta } from '@storybook/angular';
import { CommonModule } from '@angular/common';
import withMock from 'storybook-addon-mock';
import { serviceMock2 } from 'shared/mocks/service2.mock';

export default {
  title: 'Layout/Story2',
  component: Story2Component,
  parameters: {
    docs: {
      iframeHeight: 300
    }
  },
  decorators: [
    withMock,
    moduleMetadata({
      declarations: [],
      imports: [
        CommonModule,
        BrowserModule,
        ReactiveFormsModule,
        FormsModule,
        BrowserAnimationsModule,
        HttpClientModule,
      ]
    })
  ]
} as Meta;

const Template: Story<Story2Component> = (args: Story2Component) => ({
  template: '<story2-component></story2-component>',
  props: {
    ...args
  }
});

export const Story2 = Template.bind({});

Story2.parameters = serviceMock2; // 3 mock service available
Story2 .args = {
  label: 'Some Text2'
};
</code>```

Tried -: I have tried ,Earlier all mock service are in single file with different export const object like below code, then I have created separate two files for both stories but still getting same issue.

```<code>single file serviceMock.mock.ts
export const serviceMock1 = {}
export const serviceMock2 = {}
</code>```

Expectation -: I want to know how to display particular service for all different stories and it should load/display only particular mock service OR Please suggest any other way to add mock service.

Body:
Issue in Below Mock Request Tab attached as image all 5 mock service are display. Which should not when I have added serviceMock1 in story1.parameter for Story1 then its should display only 2 service but its displaying all 5 service including serviceMock1 + serviceMock2.

NOTE -: If you refresh the page from story1 then its will display only 2 service after that once I navigate to story2 then it will start displaying all 5 service in Mock Request Tab.

Please check attached image below

Story1 Mock Service
Story1.stories.ts

import { moduleMetadata, Story, Meta } from '@storybook/angular';
import { CommonModule } from '@angular/common';
import withMock from 'storybook-addon-mock';
import { serviceMock1 } from 'shared/mocks/service1.mock';

export default {
  title: 'Components/Story1',
  component: Story1Component,
  parameters: {
    docs: {
      iframeHeight: 300
    }
  },
  decorators: [
    withMock,
    moduleMetadata({
      declarations: [],
      imports: [
        CommonModule,
        BrowserModule,
        ReactiveFormsModule,
        FormsModule,
        BrowserAnimationsModule,
        HttpClientModule,
      ]
    })
  ]
} as Meta;

const Template: Story<Story1Component> = (args: Story1Component) => ({
  template: '<story1-component></story1-component>',
  props: {
    ...args
  }
});

export const Story1 = Template.bind({});

Story1.parameters = serviceMock1; // 2 mock service available
Story1 .args = {
  label: 'Some Text'
};

Story2 Mock Service
Story2.stories.ts

import { moduleMetadata, Story, Meta } from '@storybook/angular';
import { CommonModule } from '@angular/common';
import withMock from 'storybook-addon-mock';
import { serviceMock2 } from 'shared/mocks/service2.mock';

export default {
  title: 'Layout/Story2',
  component: Story2Component,
  parameters: {
    docs: {
      iframeHeight: 300
    }
  },
  decorators: [
    withMock,
    moduleMetadata({
      declarations: [],
      imports: [
        CommonModule,
        BrowserModule,
        ReactiveFormsModule,
        FormsModule,
        BrowserAnimationsModule,
        HttpClientModule,
      ]
    })
  ]
} as Meta;

const Template: Story<Story2Component> = (args: Story2Component) => ({
  template: '<story2-component></story2-component>',
  props: {
    ...args
  }
});

export const Story2 = Template.bind({});

Story2.parameters = serviceMock2; // 3 mock service available
Story2 .args = {
  label: 'Some Text2'
};

Tried -: I have tried ,Earlier all mock service are in single file with different export const object like below code, then I have created separate two files for both stories but still getting same issue.

single file serviceMock.mock.ts
export const serviceMock1 = {}
export const serviceMock2 = {}

Expectation -: I want to know how to display particular service for all different stories and it should load/display only particular mock service OR Please suggest any other way to add mock service.


问:
How to convert excel to pdf with python
i'm trying to convert multiple excel file to python in for loop, the issue is that it throw error,
it actually was working one month ago idk what changed ?

```<code>o = win32com.client.Dispatch("Excel.Application")
o.Visible = False
wb_path = r'//Envoi stat tech/fichiers/'+i+'.xlsx'
wb = o.Workbooks.Open(wb_path)
ws_index_list = [1] #say you want to print these sheets
path_to_pdf = r'//Envoi stat tech/fichierspdf/'+i+'.pdf'
#print_area = 'A1:H50'
for index in ws_index_list:

    ws = wb.Worksheets[index - 1]

    ws.PageSetup.Zoom = False

    ws.PageSetup.FitToPagesTall = 1

    ws.PageSetup.FitToPagesWide = 1
    if index==1:
        ws.PageSetup.PrintArea = 'A1:F50'
    else:
        ws.PageSetup.PrintArea = 'A1:F50'
wb.WorkSheets(ws_index_list).Select()
wb.ActiveSheet.ExportAsFixedFormat(0, path_to_pdf)
wb.Close(True)
</code>```

The error :

```<code> File "\\Envoi stat tech\testta.py", line 364, in <module>
    ws = wb.Worksheets[index - 1]

 return self._get_good_object_(self._oleobj_.Invoke(*(170, LCID, 2, 1, key)), "Item", None)
pywintypes.com_error: (-2147352567, 'Une exception s’est produite.', (0, None, None, None, 0, -2147352565), None)
</code>```

Title: How to convert excel to pdf with python

Body:
i'm trying to convert multiple excel file to python in for loop, the issue is that it throw error,
it actually was working one month ago idk what changed ?

o = win32com.client.Dispatch("Excel.Application")
o.Visible = False
wb_path = r'//Envoi stat tech/fichiers/'+i+'.xlsx'
wb = o.Workbooks.Open(wb_path)
ws_index_list = [1] #say you want to print these sheets
path_to_pdf = r'//Envoi stat tech/fichierspdf/'+i+'.pdf'
#print_area = 'A1:H50'
for index in ws_index_list:

    ws = wb.Worksheets[index - 1]

    ws.PageSetup.Zoom = False

    ws.PageSetup.FitToPagesTall = 1

    ws.PageSetup.FitToPagesWide = 1
    if index==1:
        ws.PageSetup.PrintArea = 'A1:F50'
    else:
        ws.PageSetup.PrintArea = 'A1:F50'
wb.WorkSheets(ws_index_list).Select()
wb.ActiveSheet.ExportAsFixedFormat(0, path_to_pdf)
wb.Close(True)

The error :

 File "\\Envoi stat tech\testta.py", line 364, in <module>
    ws = wb.Worksheets[index - 1]

 return self._get_good_object_(self._oleobj_.Invoke(*(170, LCID, 2, 1, key)), "Item", None)
pywintypes.com_error: (-2147352567, 'Une exception s’est produite.', (0, None, None, None, 0, -2147352565), None)


问:
Get week of the month from date in Golang
I want get the current week number of the month from date

I have used isoWeek()

```<code>func (t Time) ISOWeek() (year, week int)
</code>```

but it's return week number of the year, and also I have used another approach like this

```<code>now := time.Now()
beginningOfTheMonth := time.Date(now.Year(), now.Month(), 1, 1, 1, 1, 1, time.UTC)
_, thisWeek := now.ISOWeek()
_, beginningWeek := beginningOfTheMonth.ISOWeek()

fmt.Printf(" %d week in the month", (1 + thisWeek - beginningWeek))
</code>```

and it returns "3" when the date is 16 Dec 2022.

Is there any package or solution for this?

Body:
I want get the current week number of the month from date

I have used isoWeek()

func (t Time) ISOWeek() (year, week int)

but it's return week number of the year, and also I have used another approach like this

now := time.Now()
beginningOfTheMonth := time.Date(now.Year(), now.Month(), 1, 1, 1, 1, 1, time.UTC)
_, thisWeek := now.ISOWeek()
_, beginningWeek := beginningOfTheMonth.ISOWeek()

fmt.Printf(" %d week in the month", (1 + thisWeek - beginningWeek))

and it returns "3" when the date is 16 Dec 2022.

Is there any package or solution for this?


问:
Generating 3D array with custom/tilted super-gaussian structure in Python
I am stuck with a particular problem regarding the initialization of an 3D array in Python and I hope you can help me out. First, here is some context. I am currently implementing a function that should return a 3D array. The array represents the refractive index distribution of a glass specimen, so n(x,y,z). The glass specimen should be modified in such a way that the refractive index will be slightly altered along a given path. The path is arbitrary and up to the input of the user. The profile of the modification should be super-gaussian with modification radius Tcr1 and refractive indices n1 (unmodified), n2 (modified) and exponent s like:

```<code>def create_n_super_gaussian(X, Y, n1, n2, Tcr1, s):
        return n1 + (n2-n1)*np.exp(-np.log(2)*((2*X/Tcr1)**2+(2*(Y/2.0)/Tcr1)**2)**s)
</code>```

If the path is a straight line, this would be pretty simple to implement:

```<code>import numpy as np

def create_n_super_gaussian(X, Y, n1, n2, Tcr1, s):
        return n1 + (n2-n1)*np.exp(-np.log(2)*((2*X/Tcr1)**2+(2*Y/Tcr1)**2)**s)

xPoints, yPoints, zPoints = 100, 100, 100 #Points of grid
xWindow, yWindow, zWindow = 0.1, 0.1, 0.1 #Length of specimen

dx = xWindow/xPoints #Res in x
dy = yWindow/yPoints #Res in y
dz = zWindow/zPoints #Res in z

vx = np.linspace(-(xPoints-1)/2.0, (xPoints-1)/2.0, xPoints)*dx
vy = np.linspace(-(yPoints-1)/2.0, (yPoints-1)/2.0, yPoints)*dy
X, Y = np.meshgrid(vx, vy)

n1 = 1.0 #Unmodified refractive index
n2 = 2.0 #Modified refractive index

Tcr1 = 0.01 #Width of the modification
s = 4 #Super-gaussian exponent

nxy = np.zeros((xPoints, yPoints, zPoints))

for ind in range(0, len(nxy[0,0,:])):
    nxy[:,:,ind] = create_n_super_gaussian(X, Y, n1, n2, Tcr1, s)
</code>```

I hope you get the idea. My problem arises when the path of the modification is arbitrary, e.g. given by a function or some input data.

I tried in introduce an x and y offset to the super-gaussian function:

```<code>def create_n_super_gaussian(X, Y, x_off, y_off, n1, n2, Tcr1, s):
        return n1 + (n2-n1)*np.exp(-np.log(2)*((2*(X-x_off)/Tcr1)**2+(2*(Y-y_off)/Tcr1)**2)**s)

</code>```

But this approach still produces the wrong outcome because the super-gaussian profile should be perpendicular to the orientation of the path and not aligned to the coordinate system. My next approach would be to align the super-gaussian profile to the coordinate system but "stretch" it in each direction depending to the angle between the path and the coordinate system. However, I am not sure if that is fair to do. Any comments on that?

Input and help is highly appreciated. Thanks for reading and best regards,

Phillip

Body:
I am stuck with a particular problem regarding the initialization of an 3D array in Python and I hope you can help me out. First, here is some context. I am currently implementing a function that should return a 3D array. The array represents the refractive index distribution of a glass specimen, so n(x,y,z). The glass specimen should be modified in such a way that the refractive index will be slightly altered along a given path. The path is arbitrary and up to the input of the user. The profile of the modification should be super-gaussian with modification radius Tcr1 and refractive indices n1 (unmodified), n2 (modified) and exponent s like:

def create_n_super_gaussian(X, Y, n1, n2, Tcr1, s):
        return n1 + (n2-n1)*np.exp(-np.log(2)*((2*X/Tcr1)**2+(2*(Y/2.0)/Tcr1)**2)**s)

If the path is a straight line, this would be pretty simple to implement:

import numpy as np

def create_n_super_gaussian(X, Y, n1, n2, Tcr1, s):
        return n1 + (n2-n1)*np.exp(-np.log(2)*((2*X/Tcr1)**2+(2*Y/Tcr1)**2)**s)

xPoints, yPoints, zPoints = 100, 100, 100 #Points of grid
xWindow, yWindow, zWindow = 0.1, 0.1, 0.1 #Length of specimen

dx = xWindow/xPoints #Res in x
dy = yWindow/yPoints #Res in y
dz = zWindow/zPoints #Res in z

vx = np.linspace(-(xPoints-1)/2.0, (xPoints-1)/2.0, xPoints)*dx
vy = np.linspace(-(yPoints-1)/2.0, (yPoints-1)/2.0, yPoints)*dy
X, Y = np.meshgrid(vx, vy)

n1 = 1.0 #Unmodified refractive index
n2 = 2.0 #Modified refractive index

Tcr1 = 0.01 #Width of the modification
s = 4 #Super-gaussian exponent

nxy = np.zeros((xPoints, yPoints, zPoints))

for ind in range(0, len(nxy[0,0,:])):
    nxy[:,:,ind] = create_n_super_gaussian(X, Y, n1, n2, Tcr1, s)

I hope you get the idea. My problem arises when the path of the modification is arbitrary, e.g. given by a function or some input data.

I tried in introduce an x and y offset to the super-gaussian function:

def create_n_super_gaussian(X, Y, x_off, y_off, n1, n2, Tcr1, s):
        return n1 + (n2-n1)*np.exp(-np.log(2)*((2*(X-x_off)/Tcr1)**2+(2*(Y-y_off)/Tcr1)**2)**s)

But this approach still produces the wrong outcome because the super-gaussian profile should be perpendicular to the orientation of the path and not aligned to the coordinate system. My next approach would be to align the super-gaussian profile to the coordinate system but "stretch" it in each direction depending to the angle between the path and the coordinate system. However, I am not sure if that is fair to do. Any comments on that?

Input and help is highly appreciated. Thanks for reading and best regards,

Phillip


问:
Problem with logstash in sync postgres to elasticsearch
I have schema: postgres -> elasticsearch -> kibana
Need to sync data from postgres to elasticsearch.

Earlier on testing server I used pgsync, but my devops don't want to reconfigure the option.
Lib need enable logical decoding by setting wal_level = logical on PG server.

Now I try configure LOGSTASH in docker in gitlab pipeline.
The container started up and everything seems to be connected, but the data is not synchronized.

That I send in env file (logstash.yml) from pipeline

```<code>http.host="0.0.0.0"
xpack.monitoring.elasticsearch.hosts=["http://elasticserver:9200"]
xpack.monitoring.enabled=true
xpack.monitoring.elasticsearch.username="logstash_system"
xpack.monitoring.elasticsearch.password="logstash_pass"
LS_JAVA_OPTS=-Xmx512m -Xms512m
config.support_escapes=true
</code>```

That in ~/config$ cat logstash.yml after pipeline complite

```<code>config.support_escapes: true
http.host: 0.0.0.0
xpack.monitoring.elasticsearch.hosts:
- http://elasticserver:9200
xpack.monitoring.elasticsearch.password: logstash_pass
xpack.monitoring.elasticsearch.username: logstash_system
xpack.monitoring.enabled: true
</code>```

Here what I got in pipeline$ cat logstash.conf

```<code>input {
    jdbc {
         jdbc_connection_string => "jdbc:postgresql://server:5432/database"
         jdbc_user => "db_user"
         jdbc_password => "db_pass"
         jdbc_driver_class => "org.postgresql.Driver"
         statement => "SELECT * from public.pdf_store"
     }
}

output {
  elasticsearch {
        hosts => ["http://elasticserver:9200"]
        index => "test_index"
        document_id => "%{id}"
        user => "elastic"
        password => "elastic_pass"
    }
}
</code>```

What in logs after container start

```<code>[INFO ][logstash.agent           ] Successfully started Logstash API endpoint {:port=>9600, :ssl_enabled=>false}
[INFO ][logstash.javapipeline    ][main] Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>2, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50, "pipeline.max_inflight"=>250, "pipeline.sources"=>["/usr/share/logstash/pipeline/logstash.conf"], :thread=>"#<Thread:0x2cee4126 run>"}
[INFO ][logstash.javapipeline    ][.monitoring-logstash] Starting pipeline {:pipeline_id=>".monitoring-logstash", "pipeline.workers"=>1, "pipeline.batch.size"=>2, "pipeline.batch.delay"=>50, "pipeline.max_inflight"=>2, "pipeline.sources"=>["monitoring pipeline"], :thread=>"#<Thread:0x69b2349e run>"}
[INFO ][org.logstash.beats.Server][main][0710cad...7229d04aa] Starting server on port: 5044

[INFO ][org.logstash.beats.BeatsHandler][main][0710cad67...ca8cf87229d04aa] [local: <local_container_ip>:5044, remote: <outer_pg_server_ip>:52946] Handling exception: io.netty.handler.codec.DecoderException: org.logstash.beats.InvalidFrameProtocolException: Invalid version of beats protocol: 71 (caused by: org.logstash.beats.InvalidFrameProtocolException: Invalid version of beats protocol: 71)
[2022-12-15T18:10:44,963][WARN ][io.netty.channel.DefaultChannelPipeline][main][0710cad...a8cf87229d04aa] An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
io.netty.handler.codec.DecoderException: org.logstash.beats.InvalidFrameProtocolException: Invalid version of beats protocol: 71
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:477) ~[netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276) ~[netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:61) ~[netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:370) ~[netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:66) ~[netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) [netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-all-4.1.65.Final.jar:4.1.65.Final]
        at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: org.logstash.beats.InvalidFrameProtocolException: Invalid version of beats protocol: 71
        at org.logstash.beats.Protocol.version(Protocol.java:22) ~[logstash-input-beats-6.4.1.jar:?]
        at org.logstash.beats.BeatsParser.decode(BeatsParser.java:62) ~[logstash-input-beats-6.4.1.jar:?]
        at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:507) ~[netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:446) ~[netty-all-4.1.65.Final.jar:4.1.65.Final]
        ... 9 more
</code>```

QUESTIONS

First question, why LS_JAVA_OPTS parametr do not passing in config?
After container builded CPU about 2-5% but after container restart I got 100% CPU

Second question, why logstash not working? :)

Body:
I have schema: postgres -> elasticsearch -> kibana
Need to sync data from postgres to elasticsearch.

Earlier on testing server I used pgsync, but my devops don't want to reconfigure the option.
Lib need enable logical decoding by setting wal_level = logical on PG server.

Now I try configure LOGSTASH in docker in gitlab pipeline.
The container started up and everything seems to be connected, but the data is not synchronized.

That I send in env file (logstash.yml) from pipeline

http.host="0.0.0.0"
xpack.monitoring.elasticsearch.hosts=["http://elasticserver:9200"]
xpack.monitoring.enabled=true
xpack.monitoring.elasticsearch.username="logstash_system"
xpack.monitoring.elasticsearch.password="logstash_pass"
LS_JAVA_OPTS=-Xmx512m -Xms512m
config.support_escapes=true

That in ~/config$ cat logstash.yml after pipeline complite

config.support_escapes: true
http.host: 0.0.0.0
xpack.monitoring.elasticsearch.hosts:
- http://elasticserver:9200
xpack.monitoring.elasticsearch.password: logstash_pass
xpack.monitoring.elasticsearch.username: logstash_system
xpack.monitoring.enabled: true

Here what I got in pipeline$ cat logstash.conf

input {
    jdbc {
         jdbc_connection_string => "jdbc:postgresql://server:5432/database"
         jdbc_user => "db_user"
         jdbc_password => "db_pass"
         jdbc_driver_class => "org.postgresql.Driver"
         statement => "SELECT * from public.pdf_store"
     }
}

output {
  elasticsearch {
        hosts => ["http://elasticserver:9200"]
        index => "test_index"
        document_id => "%{id}"
        user => "elastic"
        password => "elastic_pass"
    }
}

What in logs after container start

[INFO ][logstash.agent           ] Successfully started Logstash API endpoint {:port=>9600, :ssl_enabled=>false}
[INFO ][logstash.javapipeline    ][main] Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>2, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50, "pipeline.max_inflight"=>250, "pipeline.sources"=>["/usr/share/logstash/pipeline/logstash.conf"], :thread=>"#<Thread:0x2cee4126 run>"}
[INFO ][logstash.javapipeline    ][.monitoring-logstash] Starting pipeline {:pipeline_id=>".monitoring-logstash", "pipeline.workers"=>1, "pipeline.batch.size"=>2, "pipeline.batch.delay"=>50, "pipeline.max_inflight"=>2, "pipeline.sources"=>["monitoring pipeline"], :thread=>"#<Thread:0x69b2349e run>"}
[INFO ][org.logstash.beats.Server][main][0710cad...7229d04aa] Starting server on port: 5044

[INFO ][org.logstash.beats.BeatsHandler][main][0710cad67...ca8cf87229d04aa] [local: <local_container_ip>:5044, remote: <outer_pg_server_ip>:52946] Handling exception: io.netty.handler.codec.DecoderException: org.logstash.beats.InvalidFrameProtocolException: Invalid version of beats protocol: 71 (caused by: org.logstash.beats.InvalidFrameProtocolException: Invalid version of beats protocol: 71)
[2022-12-15T18:10:44,963][WARN ][io.netty.channel.DefaultChannelPipeline][main][0710cad...a8cf87229d04aa] An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
io.netty.handler.codec.DecoderException: org.logstash.beats.InvalidFrameProtocolException: Invalid version of beats protocol: 71
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:477) ~[netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276) ~[netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:61) ~[netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:370) ~[netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:66) ~[netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) [netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-all-4.1.65.Final.jar:4.1.65.Final]
        at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: org.logstash.beats.InvalidFrameProtocolException: Invalid version of beats protocol: 71
        at org.logstash.beats.Protocol.version(Protocol.java:22) ~[logstash-input-beats-6.4.1.jar:?]
        at org.logstash.beats.BeatsParser.decode(BeatsParser.java:62) ~[logstash-input-beats-6.4.1.jar:?]
        at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:507) ~[netty-all-4.1.65.Final.jar:4.1.65.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:446) ~[netty-all-4.1.65.Final.jar:4.1.65.Final]
        ... 9 more

QUESTIONS

First question, why LS_JAVA_OPTS parametr do not passing in config?
After container builded CPU about 2-5% but after container restart I got 100% CPU

Second question, why logstash not working? :)


问:
vue-cli build fails with compile errors
My Vue 2.6.11 app is failing to build with 4 TypeScript-related errors that I am not sure how to remedy.

package.json
vue: 2.6.11
typescript: 2.9.10

**Here is what the console looks like:
**enter image description here

Any help is much appreciated.

Title: vue-cli build fails with compile errors


问:
Flashing Jetson TX2 but NVIDIA SDK Manager cannot avoid fail
I was trying

jetpack 3.3.4 , ubuntu 18.04

jetpack 4.5.1 , ubuntu 18.04

jetpack 4.6.1 , ubuntu 18.04

jetpack 4.6.2 , ubuntu 18.04

jetpack 4.6.3 , ubuntu 18.04

I studied that this process is easily fail so I thought using different version jetpack to try, well , those are fail too, I have no idea how to move on. Therefore, asking in here

this is the SDKM_logs_JetPack_4.5.1

I put the online share zip file link here https://www.transfernow.net/dl/202212165hJEIyxY

please take a look, and if get any suggestion just let me know


问:
Ada2012 & GNAT: compile library under a namespace
Can I compile a library adding a namespace at compile time using GNAT?
I have to link to a legacy library that don't use a root package and child packages, so it's very annoying having hundred of options when I have to include something.

The other option I have is to write a Python script to add the root package to all files to reduce the problem.


问:
How to transfer a string from C to Swift in Swift 5.x
It seems that in the latest version of Swift (I show 5.7.1), this no longer works

```<code>    public var description: String {
      return String(cString: UnsafeRawPointer([self.s]).assumingMemoryBound(to: CChar.self))
    }
</code>```

In debug, I can confirm that s in self.s is populated, however, an empty string is returned for description. This used to work in Xcode a few versions back, so I am perplexed why it is different now. What am I missing?

Perhaps I need to allocate some size to the String?

Body:
It seems that in the latest version of Swift (I show 5.7.1), this no longer works

    public var description: String {
      return String(cString: UnsafeRawPointer([self.s]).assumingMemoryBound(to: CChar.self))
    }

In debug, I can confirm that s in self.s is populated, however, an empty string is returned for description. This used to work in Xcode a few versions back, so I am perplexed why it is different now. What am I missing?

Perhaps I need to allocate some size to the String?