问:
JSON create template file with $[Name] of the JProperty if it only exists once and $[DistinctParentname+Name] if the name exists multiple times
for creating template XML and JSON I wrote a tool to automate the process.
For XML it was easy but for JSON i struggle to find a working solution.

Thats a part from a example file i get

```<code>{
    "receiver": {
        "address": {
            "receivername": "testreceiver",
            "companyName": "Test-Receiver1",
            "addressId": 1234,
            "addressLine1": "Test address 1",
            "addressLine2": "Test address 1.2"
        }
    },
    "delivery": {
        "address": {
            "deliveryname": "testdelivery",
            "companyName": "Test-Delivery1",
            "addressId": 4321,
            "addressLine1": "Test address delivery 1",
            "addressLine2": "Test address delivery 1.2",
            "addressLine3": null
        }
    }
}
</code>```

I want the tool to make it like this

```<code>    {
    "receiver": {
        "address": {
            "receivername": "$[receivername]",
            "companyName": "$[receivercompanyName]",
            "addressId": $[receiveraddressId],
            "addressLine1": "$[receiveraddressLine1]",
            "addressLine2": "$[receiveraddressLine2]"
        }
    },
    "delivery": {
        "address": {
            "deliveryname": "$[deliveryname]",
            "companyName": "$[receivercompanyName]",
            "addressId": $[receiveraddressId],
            "addressLine1": "$[receiveraddressLine1]",
            "addressLine2": "$[receiveraddressLine2]",
            "addressLine3": "$[receivercaddressLine3]"
        }
    }
}
</code>```

i tried iterating through every line using regex to replace the value but then i have no way to get the deviating parent node of the specific line. When using something like the following i can get the parent name but struggle to create the JSON syntax tree in the output text.

```<code>        Dim j As JObject = JObject.Parse(Input)
        For Each item As JProperty In j.Properties
            Dim itemObjects As JToken = item.Value
            For Each i As JObject In itemObjects
                For Each p In i
                    Debug.Print(p.Key.ToString & " = " & p.Value.ToString)
                Next
            Next
        Next
</code>```

Iam currently out of ideas and don´t want to go through multiple 200+ lines JSONS and do this manually.

Would appreciate a bit of help.

Body:
for creating template XML and JSON I wrote a tool to automate the process.
For XML it was easy but for JSON i struggle to find a working solution.

Thats a part from a example file i get

{
    "receiver": {
        "address": {
            "receivername": "testreceiver",
            "companyName": "Test-Receiver1",
            "addressId": 1234,
            "addressLine1": "Test address 1",
            "addressLine2": "Test address 1.2"
        }
    },
    "delivery": {
        "address": {
            "deliveryname": "testdelivery",
            "companyName": "Test-Delivery1",
            "addressId": 4321,
            "addressLine1": "Test address delivery 1",
            "addressLine2": "Test address delivery 1.2",
            "addressLine3": null
        }
    }
}

I want the tool to make it like this

    {
    "receiver": {
        "address": {
            "receivername": "$[receivername]",
            "companyName": "$[receivercompanyName]",
            "addressId": $[receiveraddressId],
            "addressLine1": "$[receiveraddressLine1]",
            "addressLine2": "$[receiveraddressLine2]"
        }
    },
    "delivery": {
        "address": {
            "deliveryname": "$[deliveryname]",
            "companyName": "$[receivercompanyName]",
            "addressId": $[receiveraddressId],
            "addressLine1": "$[receiveraddressLine1]",
            "addressLine2": "$[receiveraddressLine2]",
            "addressLine3": "$[receivercaddressLine3]"
        }
    }
}

i tried iterating through every line using regex to replace the value but then i have no way to get the deviating parent node of the specific line. When using something like the following i can get the parent name but struggle to create the JSON syntax tree in the output text.

        Dim j As JObject = JObject.Parse(Input)
        For Each item As JProperty In j.Properties
            Dim itemObjects As JToken = item.Value
            For Each i As JObject In itemObjects
                For Each p In i
                    Debug.Print(p.Key.ToString & " = " & p.Value.ToString)
                Next
            Next
        Next

Iam currently out of ideas and don´t want to go through multiple 200+ lines JSONS and do this manually.

Would appreciate a bit of help.


来源: stackexchange

问:
Optmizing 2 loops in sequence
I'm trying to collect data of Investment Funds in a API, there's a list of Fund Codes and a List of days in format that I want.

I create a routine in a For by day, and after a For by fund. But to complete all data frame, this take me 30 minutes.

I would like to know how to optmize it

Here's the part of code:

dataPosicao_list is a list of days, and fundo_id_list is a list o funds by ID that API recognize

```<code>df_geral = pd.DataFrame()
df_day = pd.DataFrame()

for day in dataPosicao_list:
        #df_day = pd.DataFrame()
        for fundo_id in fundo_id_list:
                try:
                        url_api = f'https://modal-pp.totvs.amplis.com.br/amplisapi/ws/v2/rendavariavel/avista/movimentos/carteira/{fundo_id}/data/{day}?pagina=0&tamanhoPagina=100'

                        session_api = requests.Session()
                        response = session_api.get(url_api, verify=False)
                        payload_api = ''
                        headers_api = {'Content-Type': 'application/json',
                        'charset': 'UTF-8',
                        'Authorization': token }
                        posicoes_api = session_api.request('GET', url_api, headers = headers_api, data = payload_api)
                        posicoes = json.loads(posicoes_api.text)
                        df_total = pd.DataFrame()
                        for linha in posicoes['conteudo']:
                                try:
                                        bolsa = linha['bolsa']['codigo']
                                except:
                                        bolsa = "None"
                                try:
                                        ativo = linha['ativo']['codigo']
                                except:
                                        ativo = "None"
                                try:
                                        bolsa_internacional = linha['bolsa']['bolsaInternacional']
                                except:
                                        bolsa_internacional = "None"
                                try:
                                        localidade = linha['bolsa']['localidade']['codigo']
                                except:
                                        localidade = "None"
                                try:
                                        moeda = linha['bolsa']['moeda']['internationalCode']
                                except:
                                        moeda = "None"
                                try:
                                        fundo = linha['carteira']['administrador']['codigoB3']
                                except:
                                        fundo = "None"
                                try:
                                        Fundo_ou_Clube = linha['carteira']['administrador']['administradorClubeInvestimento']
                                except:
                                        Fundo_ou_Clube = "None"
                                try:
                                        carteira = linha['carteira']['administrador']['codigo']
                                except:
                                        carteira = "None"
                                try:
                                        class_fundo = linha['carteira']['classificacaoFundo']['classificacao']
                                except:
                                        class_fundo = "None"
                                try:
                                        cota_fidic = linha['carteira']['classificacaoFundo']['tipoCotaFIDC']
                                except:
                                        cota_fidic = "None"
                                try:
                                        mov_cetip = linha['carteira']['codAtivoMnemonicoCetip']
                                except:
                                        mov_cetip = "None"
                                try:
                                        controlador = linha['carteira']['controlador']['codigo']
                                except:
                                        controlador = linha['carteira']['controlador']
                                try:
                                        custodiante = linha['carteira']['custodiante']['nome']
                                except:
                                        custodiante = "None"
                                try:
                                        data = linha['data']
                                except:
                                        data = "None"
                                try:
                                        nome_fundo = fundo_id
                                except:
                                        nome_fundo = "None"
                                try:
                                        taxa_performance = linha['carteira']['taxaPerformance']
                                except:
                                        taxa_performance = "None"
                                try:
                                        mercado = linha['mercado']['descricao']
                                except:
                                        mercado = "None"
                                try:
                                        calculo_corretagem_emulamentos = linha['corretagem']['calculaCorretagemEmolumentos']
                                except:
                                        calculo_corretagem_emulamento = "None"
                                try:
                                        porcentagemDevolucaoCorretagemCorretora = linha['corretagem']['porcentagemDevolucaoCorretagemCorretora']
                                except:
                                        porcentagemDevolucaoCorretagemCorretora = "None"
                                try:
                                        modalidade = linha['modalidadeMovimento']['descricao']
                                except:
                                        modalidade = "None"
                                try:
                                        preco = linha['preco']
                                except:
                                        preco = "None"
                                try:
                                        quantidade = linha['quantidade']
                                except:
                                        quantidade = "None"
                                try:
                                        valor_bruto = linha['valorBruto']
                                except:
                                        valor_bruto = "None"
                                try:
                                        id = linha['id']
                                except:
                                        id = 'None'
                                serie = {'id' : id, 'controlador': controlador,'taxa_performance': taxa_performance, 'nome_fundo': nome_fundo, 'modalidade':modalidade, 'mercado': mercado, 'preco': preco, 'quantidade':quantidade, 'valor_bruto': valor_bruto, 'cota_fidic': cota_fidic,'porcentagemDevolucaoCorretagemCorretora': porcentagemDevolucaoCorretagemCorretora, 'calculo_corretagem_emulamentos': calculo_corretagem_emulamentos, 'data': data,  'custodiante':custodiante, 'controlador': controlador, 'mov_cetip': mov_cetip, 'bolsa': bolsa, 'ativo' : ativo, 'bolsa_internacional': bolsa_internacional, 'localidade': localidade , 'moeda': moeda, 'fundo': fundo, 'Fundo_ou_Clube': Fundo_ou_Clube, 'carteira': carteira, ' class_fundo':  class_fundo }
                                serie = pd.Series(serie)
                                df_total = df_total.append(serie, ignore_index=True)
                                #df_geral = df_geral.append(df_total, ignore_index=True)
                                df_day = df_day.append(df_total, ignore_index=True)
                except:
                        continue
        df_geral = df_geral.append(df_day, ignore_index=True)

df_geral = df_geral.drop_duplicates(subset=['id'])
df_geral.head()

print(df_geral)
</code>```

ContentLicense: CC BY-SA 4.0

Title: Optmizing 2 loops in sequence

Body:
I'm trying to collect data of Investment Funds in a API, there's a list of Fund Codes and a List of days in format that I want.

I create a routine in a For by day, and after a For by fund. But to complete all data frame, this take me 30 minutes.

I would like to know how to optmize it

Here's the part of code:

dataPosicao_list is a list of days, and fundo_id_list is a list o funds by ID that API recognize

df_geral = pd.DataFrame()
df_day = pd.DataFrame()

for day in dataPosicao_list:
        #df_day = pd.DataFrame()
        for fundo_id in fundo_id_list:
                try:
                        url_api = f'https://modal-pp.totvs.amplis.com.br/amplisapi/ws/v2/rendavariavel/avista/movimentos/carteira/{fundo_id}/data/{day}?pagina=0&tamanhoPagina=100'

                        session_api = requests.Session()
                        response = session_api.get(url_api, verify=False)
                        payload_api = ''
                        headers_api = {'Content-Type': 'application/json',
                        'charset': 'UTF-8',
                        'Authorization': token }
                        posicoes_api = session_api.request('GET', url_api, headers = headers_api, data = payload_api)
                        posicoes = json.loads(posicoes_api.text)
                        df_total = pd.DataFrame()
                        for linha in posicoes['conteudo']:
                                try:
                                        bolsa = linha['bolsa']['codigo']
                                except:
                                        bolsa = "None"
                                try:
                                        ativo = linha['ativo']['codigo']
                                except:
                                        ativo = "None"
                                try:
                                        bolsa_internacional = linha['bolsa']['bolsaInternacional']
                                except:
                                        bolsa_internacional = "None"
                                try:
                                        localidade = linha['bolsa']['localidade']['codigo']
                                except:
                                        localidade = "None"
                                try:
                                        moeda = linha['bolsa']['moeda']['internationalCode']
                                except:
                                        moeda = "None"
                                try:
                                        fundo = linha['carteira']['administrador']['codigoB3']
                                except:
                                        fundo = "None"
                                try:
                                        Fundo_ou_Clube = linha['carteira']['administrador']['administradorClubeInvestimento']
                                except:
                                        Fundo_ou_Clube = "None"
                                try:
                                        carteira = linha['carteira']['administrador']['codigo']
                                except:
                                        carteira = "None"
                                try:
                                        class_fundo = linha['carteira']['classificacaoFundo']['classificacao']
                                except:
                                        class_fundo = "None"
                                try:
                                        cota_fidic = linha['carteira']['classificacaoFundo']['tipoCotaFIDC']
                                except:
                                        cota_fidic = "None"
                                try:
                                        mov_cetip = linha['carteira']['codAtivoMnemonicoCetip']
                                except:
                                        mov_cetip = "None"
                                try:
                                        controlador = linha['carteira']['controlador']['codigo']
                                except:
                                        controlador = linha['carteira']['controlador']
                                try:
                                        custodiante = linha['carteira']['custodiante']['nome']
                                except:
                                        custodiante = "None"
                                try:
                                        data = linha['data']
                                except:
                                        data = "None"
                                try:
                                        nome_fundo = fundo_id
                                except:
                                        nome_fundo = "None"
                                try:
                                        taxa_performance = linha['carteira']['taxaPerformance']
                                except:
                                        taxa_performance = "None"
                                try:
                                        mercado = linha['mercado']['descricao']
                                except:
                                        mercado = "None"
                                try:
                                        calculo_corretagem_emulamentos = linha['corretagem']['calculaCorretagemEmolumentos']
                                except:
                                        calculo_corretagem_emulamento = "None"
                                try:
                                        porcentagemDevolucaoCorretagemCorretora = linha['corretagem']['porcentagemDevolucaoCorretagemCorretora']
                                except:
                                        porcentagemDevolucaoCorretagemCorretora = "None"
                                try:
                                        modalidade = linha['modalidadeMovimento']['descricao']
                                except:
                                        modalidade = "None"
                                try:
                                        preco = linha['preco']
                                except:
                                        preco = "None"
                                try:
                                        quantidade = linha['quantidade']
                                except:
                                        quantidade = "None"
                                try:
                                        valor_bruto = linha['valorBruto']
                                except:
                                        valor_bruto = "None"
                                try:
                                        id = linha['id']
                                except:
                                        id = 'None'
                                serie = {'id' : id, 'controlador': controlador,'taxa_performance': taxa_performance, 'nome_fundo': nome_fundo, 'modalidade':modalidade, 'mercado': mercado, 'preco': preco, 'quantidade':quantidade, 'valor_bruto': valor_bruto, 'cota_fidic': cota_fidic,'porcentagemDevolucaoCorretagemCorretora': porcentagemDevolucaoCorretagemCorretora, 'calculo_corretagem_emulamentos': calculo_corretagem_emulamentos, 'data': data,  'custodiante':custodiante, 'controlador': controlador, 'mov_cetip': mov_cetip, 'bolsa': bolsa, 'ativo' : ativo, 'bolsa_internacional': bolsa_internacional, 'localidade': localidade , 'moeda': moeda, 'fundo': fundo, 'Fundo_ou_Clube': Fundo_ou_Clube, 'carteira': carteira, ' class_fundo':  class_fundo }
                                serie = pd.Series(serie)
                                df_total = df_total.append(serie, ignore_index=True)
                                #df_geral = df_geral.append(df_total, ignore_index=True)
                                df_day = df_day.append(df_total, ignore_index=True)
                except:
                        continue
        df_geral = df_geral.append(df_day, ignore_index=True)

df_geral = df_geral.drop_duplicates(subset=['id'])
df_geral.head()

print(df_geral)


问:
pod not found error, while using the rsync cmd to copy the results from ocp pod to jenkins workspace
I am running some automated tests using RBF, but sometimes when the test runner is complete and am trying to copy the test result from OCP to local using Rsync (using Jenkins job), it shows that the pod is not found, but test cases were run on the same pod, after restarting the pod this error is resolved, but after some time again this error comes. Can anyone tell me what is the root cause of this error and the solution for this?

tried to start rollout the pod, but this does not fix the problem permantely, after some run the error comes again


问:
Gradle is giving S3 Access Denied error while reaching object in build stage
Although I have access to my bucket with the profile that I use, (because I can download the file from terminal) when I want to reach it in build.gradle, I'm getting S3 Access Denied error. Interesting thing is, with AWS Toolkit and from the terminal, I can display my bucket with that profile without a problem. My IAM user has AmazonS3FullAccess policy. To make sure, I also added another policy which you can see below. Bucket public access is disabled. (Also I tried with public access but still getting error in gradle build). My goal is to use QA-Base project in the bucket as a dependency in my project. Kindly request your help.

```<code>$aws s3 cp s3://maven.egeiper/org/egeiper/qaBase/QA-Base/1.0.7/QA-Base-1.0.7.pom . --profile egeiper

download: s3://maven.egeiper/org/egeiper/qaBase/QA-Base/1.0.7/QA-Base-1.0.7.pom to ./QA-Base-1.0.7.pom

Error in terminal with command "gradle build"
> A problem occurred configuring root project 'QA-Base'.
 Could not resolve all files for configuration ':classpath'.
   Could not resolve org.egeiper.qaBase:QA-Base:1.0.7.
     Required by:
         project :
      Could not resolve org.egeiper.qaBase:QA-Base:1.0.7.
         > Could not get resource 's3://maven.egeiper/org/egeiper/qaBase/QA-Base/1.0.7/QA-Base-1.0.7.pom'.
            > Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: N2RS6X0XMFFQ34XR; S3 Extended Request ID: XqYfJ09KVk7Z/LUmF6kdegaGkPgYXKCy+bukM9NHSWJSYmNrfIh2A/qEmpQLQfh7DuhE2mpl/iJaLxlvPtcjqg==; Proxy: null)
</code>```

My bucket via AWS Toolkit

My credentials file in .aws/credentials

Config file in .aws/config

```<code>[profile egeiper]
region = eu-central-1
output = json
</code>```

My policy

```<code>{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:ListBucket"
            ],
            "Resource": [
                "arn:aws:s3:::maven.egeiper"
            ]
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:GetObject",
                "s3:DeleteObject"
            ],
            "Resource": [
                "arn:aws:s3:::maven.egeiper/*"
            ]
        }
    ]
}
</code>```

build.gradle

```<code>buildscript {
    repositories {
        mavenCentral()
        maven {
            url "s3://maven.egeiper"
            authentication {
                awsIm(AwsImAuthentication)
            }
        }
    }
    dependencies {
        classpath 'com.github.ksoichiro:gradle-console-reporter:0.6.3'
        classpath 'org.egeiper.qaBase:QA-Base:1.0.7'
    }
}
plugins {
    id 'java'
    id "com.github.spotbugs" version "5.0.13"
    id 'pmd'
    id 'checkstyle'
    id 'maven-publish'
}

group 'org.egeiper.qaBase'
version '1.0.7'
repositories {
    mavenCentral()
    maven {
        url "s3://maven.egeiper"
        authentication {
            awsIm(AwsImAuthentication)
        }
    }
}

java {
    sourceCompatibility JavaVersion.VERSION_11
    targetCompatibility JavaVersion.VERSION_11
}

dependencies {
    implementation 'org.seleniumhq.selenium:selenium-java:4.7.2'
    implementation 'org.testng:testng:7.4.0'
    implementation 'io.qameta.allure:allure-testng:2.19.0'
    implementation 'io.rest-assured:rest-assured:5.3.0'
    implementation 'org.awaitility:awaitility:4.2.0'
    compileOnly 'org.projectlombok:lombok:1.18.24'
    annotationProcessor 'org.projectlombok:lombok:1.18.24'
    implementation 'org.aeonbits.owner:owner:1.0.12'
    implementation 'org.seleniumhq.selenium:selenium-chrome-driver:4.7.2'
    implementation 'org.seleniumhq.selenium:selenium-firefox-driver:4.7.2'
}

pmd {
    consoleOutput = true
    toolVersion = "6.21.0"
    rulesMinimumPriority = 5
    ruleSetConfig = rootProject.resources.text.fromFile("config/pmdRules.xml")
    ruleSets = []
}

checkstyle {
    toolVersion = "8.23"
    configFile = rootProject.file('config/checkstyle.xml')
}

publishing {
    repositories {
        maven {
            url "s3://maven.egeiper"
            authentication {
                awsIm(AwsImAuthentication)
            }
        }
    }
    publications {
        mavenJava(MavenPublication) {
            from components.java
        }
    }

}

test {
    useTestNG()
    maxParallelForks = Runtime.runtime.availableProcessors()
}
</code>```

Body:
Although I have access to my bucket with the profile that I use, (because I can download the file from terminal) when I want to reach it in build.gradle, I'm getting S3 Access Denied error. Interesting thing is, with AWS Toolkit and from the terminal, I can display my bucket with that profile without a problem. My IAM user has AmazonS3FullAccess policy. To make sure, I also added another policy which you can see below. Bucket public access is disabled. (Also I tried with public access but still getting error in gradle build). My goal is to use QA-Base project in the bucket as a dependency in my project. Kindly request your help.

$aws s3 cp s3://maven.egeiper/org/egeiper/qaBase/QA-Base/1.0.7/QA-Base-1.0.7.pom . --profile egeiper

download: s3://maven.egeiper/org/egeiper/qaBase/QA-Base/1.0.7/QA-Base-1.0.7.pom to ./QA-Base-1.0.7.pom

Error in terminal with command "gradle build"
> A problem occurred configuring root project 'QA-Base'.
 Could not resolve all files for configuration ':classpath'.
   Could not resolve org.egeiper.qaBase:QA-Base:1.0.7.
     Required by:
         project :
      Could not resolve org.egeiper.qaBase:QA-Base:1.0.7.
         > Could not get resource 's3://maven.egeiper/org/egeiper/qaBase/QA-Base/1.0.7/QA-Base-1.0.7.pom'.
            > Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: N2RS6X0XMFFQ34XR; S3 Extended Request ID: XqYfJ09KVk7Z/LUmF6kdegaGkPgYXKCy+bukM9NHSWJSYmNrfIh2A/qEmpQLQfh7DuhE2mpl/iJaLxlvPtcjqg==; Proxy: null)

My bucket via AWS Toolkit

My credentials file in .aws/credentials

Config file in .aws/config

[profile egeiper]
region = eu-central-1
output = json

My policy

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:ListBucket"
            ],
            "Resource": [
                "arn:aws:s3:::maven.egeiper"
            ]
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:GetObject",
                "s3:DeleteObject"
            ],
            "Resource": [
                "arn:aws:s3:::maven.egeiper/*"
            ]
        }
    ]
}

build.gradle

buildscript {
    repositories {
        mavenCentral()
        maven {
            url "s3://maven.egeiper"
            authentication {
                awsIm(AwsImAuthentication)
            }
        }
    }
    dependencies {
        classpath 'com.github.ksoichiro:gradle-console-reporter:0.6.3'
        classpath 'org.egeiper.qaBase:QA-Base:1.0.7'
    }
}
plugins {
    id 'java'
    id "com.github.spotbugs" version "5.0.13"
    id 'pmd'
    id 'checkstyle'
    id 'maven-publish'
}

group 'org.egeiper.qaBase'
version '1.0.7'
repositories {
    mavenCentral()
    maven {
        url "s3://maven.egeiper"
        authentication {
            awsIm(AwsImAuthentication)
        }
    }
}

java {
    sourceCompatibility JavaVersion.VERSION_11
    targetCompatibility JavaVersion.VERSION_11
}

dependencies {
    implementation 'org.seleniumhq.selenium:selenium-java:4.7.2'
    implementation 'org.testng:testng:7.4.0'
    implementation 'io.qameta.allure:allure-testng:2.19.0'
    implementation 'io.rest-assured:rest-assured:5.3.0'
    implementation 'org.awaitility:awaitility:4.2.0'
    compileOnly 'org.projectlombok:lombok:1.18.24'
    annotationProcessor 'org.projectlombok:lombok:1.18.24'
    implementation 'org.aeonbits.owner:owner:1.0.12'
    implementation 'org.seleniumhq.selenium:selenium-chrome-driver:4.7.2'
    implementation 'org.seleniumhq.selenium:selenium-firefox-driver:4.7.2'
}

pmd {
    consoleOutput = true
    toolVersion = "6.21.0"
    rulesMinimumPriority = 5
    ruleSetConfig = rootProject.resources.text.fromFile("config/pmdRules.xml")
    ruleSets = []
}

checkstyle {
    toolVersion = "8.23"
    configFile = rootProject.file('config/checkstyle.xml')
}

publishing {
    repositories {
        maven {
            url "s3://maven.egeiper"
            authentication {
                awsIm(AwsImAuthentication)
            }
        }
    }
    publications {
        mavenJava(MavenPublication) {
            from components.java
        }
    }

}

test {
    useTestNG()
    maxParallelForks = Runtime.runtime.availableProcessors()
}


问:
Is there a way to end styleformat on Enter in TinyMCE
Working with a indirect implementation of style_formats through Optimizely. What I want to achieve is a way of getting the chosen style to be ended on a line-break (Enter). This works by default on headers, but not when added own formats.

I've read through the documentation: https://www.tiny.cloud/docs/configure/content-formatting/ with no result (as far as I can understand) but guess its possible due to the natural behaviour of headers.

Anyone with experience on this issue?


问:
how to block the light to the tilemap Wall using Unity2d URP
I use the Tilemap collider2d, tilemap Renderer and composite Collider2d
and top down view

I use the flashlight

The light goes through the wall. What should I do?
and adding component shadowscaster2D or composite shadowsCaster2D, it works weird


问:
Flutter video_360 - AndroidView Height getting cropped?
https://pub.dev/packages/video_360
https://github.com/kilroy80/flutter_video_360

I am using this package to play 360 videos in a Flutter app, and it uses Exoplayer for Android with AndroidView for the widget.

The problem is, the way this package is built is that if I set a SizedBox to the Video360View, it chops off a portion of the height when I set the MediaQuery screen height.

Instead of resizing the video, the video view is instead resized and no matter what I try I cannot get the full height of the video.

Is there any modification I can make to the package or do some Flutter workarounds to see the whole widget? (I tried the controller's height property, that didn't work either)

UPDATE: I set the Clip to none in AndroidView, and now I know it's the actual implementation that is not taking the full height of the video...

This only happens in landscape.


问:
How to display a calculated value and a table when a button is clicked?
I'm tyring to display a "result table"(showing the area value and calculated time) only after a user inputs both width and height value and presse the button.

What I attempted was display input values on a sheet so the inputs are correctly passed to the function setParam().

My problems are

How to display a table only after a button is pressed.

How to set a calculated are value returned from a function to the web application.

<!DOCTYPE html>

    <base target="_top">

            Area

            width
            <input id="width" type="number" ></input>

            height
            <input id="height" type="number"></input>

      <input type="button" onclick="calculateArea()" id="" value="Calcuate This!">

```
```let width = 0;
let height = 0;
let area = 0;
let time = 0;

function doGet() {
  return HtmlService.createTemplateFromFile("index").evaluate();
}

function setParam(width, height) {
  this.width = width;
  this.height = height;

  var ss = SpreadsheetApp.openByUrl("https://docs.google.com/spreadsheets/d/xxxx/edit#gid=0");
  var ws = ss.getSheetByName("sheet1");

  ws.getRange(1,1).setValue(width);
  ws.getRange(2,1).setValue(height);
}

function getArea() {
  area = width * height;
  return area;
}

function getTime() {
  return time;
}
```

Body:
I'm tyring to display a "result table"(showing the area value and calculated time) only after a user inputs both width and height value and presse the button.

What I attempted was display input values on a sheet so the inputs are correctly passed to the function setParam().

My problems are

How to display a table only after a button is pressed.

How to set a calculated are value returned from a function to the web application.

<!DOCTYPE html>

    <base target="_top">

            Area

            width
            <input id="width" type="number" ></input>

            height
            <input id="height" type="number"></input>

      <input type="button" onclick="calculateArea()" id="" value="Calcuate This!">

let width = 0;
let height = 0;
let area = 0;
let time = 0;

function doGet() {
  return HtmlService.createTemplateFromFile("index").evaluate();
}

function setParam(width, height) {
  this.width = width;
  this.height = height;

  var ss = SpreadsheetApp.openByUrl("https://docs.google.com/spreadsheets/d/xxxx/edit#gid=0");
  var ws = ss.getSheetByName("sheet1");

  ws.getRange(1,1).setValue(width);
  ws.getRange(2,1).setValue(height);
}

function getArea() {
  area = width * height;
  return area;
}

function getTime() {
  return time;
}


问:
List all files/modules imported but nothing else in Python?
I'm working with some code that's been handed off to me by someone else. I need to reuse some parts of the project, but not all. I'm basically adding a Flask server that hosts a single function from all the project.

I'm packaging it into a docker image, and I want to keep it as lightweight as possible. For this, I'm planning to only include the files that are actually use/referenced from my entry point of a Flask server written in the "server.py" file.

Is there a way to get a list of files that are referenced/imported via my entry point into the code? I'm thinking something along the lines of pipreqs, except I'm not looking for pip modules, but rather files in my folder.

For example, my "server.py" imports a local module called "feature_extraction" that then imports another local module called "preprocessing" and so on. BUT starting from my server, the module "train_model" is never imported. I'd like to keep only the files that are necessary (~"feature_extraction" and "preprocessing"), and not use any of the other files in the project (~"train_model").

Is there a module that supports this? If not, how would I go about it programmatically? Doing this by hand would take a long time.


问:
How to break line in vue-multiselect on options
Actually my main problem is about putting breakline inside options in javascript. I've problem with to break line on options when using multiselect with Vue.js.

Multiselect looks like this:

<multiselect v-model="form4.user_id"
    :options="users"
    :searchable="true"
    :preselect-first="true"
    :loading="is_loading_customers"
    :internal-search="false"
    :custom-label="with_customer_custom_label"
    @search-change="get_customers_data"
    track-by="id"
    selected-label=""
    select-label=""
    deselect-label=""
    placeholder="Ad, soyad, TC veya telefon numarası ile aratın..."
    id="folder-status-select">
</multiselect>
```
<p>My <code>with_customer_custom_label</code> function:</p>
<pre class="lang-js prettyprint-override"><code>const with_customer_custom_label = ({ customer_detail }) => {
    return `
        TC: ${customer_detail.tc_identity_number} |
        Ad Soyad: ${customer_detail.fullname} |
        Telefon: ${customer_detail.phone}
    `;
};
</code>```

Options (users):

const users = ref([]);
// and then...
const get_customers_data = (query) => {
    if (query.length > 2) {
        is_loading_customers.value = true;
        var axios_params = new URLSearchParams();
        axios_params.append('query', query);
        store.state.ax_req_auth.get('/search-customers', {
            params: axios_params,
        }).then(response => {
            users.value = response.data;
            is_loading_customers.value = false;
        }).catch(error => {
            console.log(error);
            is_loading_customers.value = false;
        });
    }
};
```
<p><code>response.data</code> return example:</p>
<pre class="lang-json prettyprint-override"><code>{
    "id": "9832a4c7-38cb-4422-a8f3-18f024f31653",
    "username": "customer",
    "email": "customer@ferisoft.com",
    "user_type": "4",
    "status": "1",
    "email_verified": "1",
    "email_verified_at": "2023-01-11T10:26:43.000000Z",
    "created_at": "2023-01-11T10:26:43.000000Z",
    "updated_at": "2023-01-11T10:26:43.000000Z",
    "customer_detail": {
        "id": "9832a4c7-c4fe-4f4c-98b9-ab55c9e40265",
        "user_id": "9832a4c7-38cb-4422-a8f3-18f024f31653",
        "name": "Semih",
        "surname": "ŞAHİN",
        "tc_identity_number": "99999999990",
        "phone": "05555555555",
        "date_of_birth": "2023-01-11 10:26:43",
        "profession": "0",
        "salary": 22500,
        "premium": 4000,
        "start_date_of_work": "2023-01-11 10:26:43",
        "close_to_customer_name": "Ferkan",
        "close_to_customer_surname": "AKYAZICI",
        "close_to_customer_tc_identity_number": "98989999992",
        "close_to_customer_phone": "05527516134",
        "email_address": "semih@ferisoft.com",
        "profile_picture": null,
        "notes": "Krediye şu şu şu sebeplerden dolayı ihtiyacım var, şu şu şu banka geçmişim var.",
        "created_at": "2023-01-11T10:26:43.000000Z",
        "updated_at": "2023-01-11T10:26:43.000000Z",
        "fullname": "Semih ŞAHİN"
    }
}
</code>```

I want to embed with break line the option element to multiselect in the with_customer_custom_label function.

I already tried these:

return `
    TC: ${customer_detail.tc_identity_number}\n
    Ad Soyad: ${customer_detail.fullname}\n
    Telefon: ${customer_detail.phone}
`;
```
<p>or</p>
<pre class="lang-js prettyprint-override"><code>return `
    TC: ${customer_detail.tc_identity_number}` + "\n" + `
    Ad Soyad: ${customer_detail.fullname}` + "\n" + `
    Telefon: ${customer_detail.phone}
`;
</code>```

But they always appear side by side. How can I show one under the other or with break line?

Body:
Actually my main problem is about putting breakline inside options in javascript. I've problem with to break line on options when using multiselect with Vue.js.

Multiselect looks like this:

<multiselect v-model="form4.user_id"
    :options="users"
    :searchable="true"
    :preselect-first="true"
    :loading="is_loading_customers"
    :internal-search="false"
    :custom-label="with_customer_custom_label"
    @search-change="get_customers_data"
    track-by="id"
    selected-label=""
    select-label=""
    deselect-label=""
    placeholder="Ad, soyad, TC veya telefon numarası ile aratın..."
    id="folder-status-select">
</multiselect>

My with_customer_custom_label function:

const with_customer_custom_label = ({ customer_detail }) => {
    return `
        TC: ${customer_detail.tc_identity_number} |
        Ad Soyad: ${customer_detail.fullname} |
        Telefon: ${customer_detail.phone}
    `;
};

Options (users):

const users = ref([]);
// and then...
const get_customers_data = (query) => {
    if (query.length > 2) {
        is_loading_customers.value = true;
        var axios_params = new URLSearchParams();
        axios_params.append('query', query);
        store.state.ax_req_auth.get('/search-customers', {
            params: axios_params,
        }).then(response => {
            users.value = response.data;
            is_loading_customers.value = false;
        }).catch(error => {
            console.log(error);
            is_loading_customers.value = false;
        });
    }
};

response.data return example:

{
    "id": "9832a4c7-38cb-4422-a8f3-18f024f31653",
    "username": "customer",
    "email": "customer@ferisoft.com",
    "user_type": "4",
    "status": "1",
    "email_verified": "1",
    "email_verified_at": "2023-01-11T10:26:43.000000Z",
    "created_at": "2023-01-11T10:26:43.000000Z",
    "updated_at": "2023-01-11T10:26:43.000000Z",
    "customer_detail": {
        "id": "9832a4c7-c4fe-4f4c-98b9-ab55c9e40265",
        "user_id": "9832a4c7-38cb-4422-a8f3-18f024f31653",
        "name": "Semih",
        "surname": "ŞAHİN",
        "tc_identity_number": "99999999990",
        "phone": "05555555555",
        "date_of_birth": "2023-01-11 10:26:43",
        "profession": "0",
        "salary": 22500,
        "premium": 4000,
        "start_date_of_work": "2023-01-11 10:26:43",
        "close_to_customer_name": "Ferkan",
        "close_to_customer_surname": "AKYAZICI",
        "close_to_customer_tc_identity_number": "98989999992",
        "close_to_customer_phone": "05527516134",
        "email_address": "semih@ferisoft.com",
        "profile_picture": null,
        "notes": "Krediye şu şu şu sebeplerden dolayı ihtiyacım var, şu şu şu banka geçmişim var.",
        "created_at": "2023-01-11T10:26:43.000000Z",
        "updated_at": "2023-01-11T10:26:43.000000Z",
        "fullname": "Semih ŞAHİN"
    }
}

I want to embed with break line the option element to multiselect in the with_customer_custom_label function.

I already tried these:

return `
    TC: ${customer_detail.tc_identity_number}\n
    Ad Soyad: ${customer_detail.fullname}\n
    Telefon: ${customer_detail.phone}
`;

or

return `
    TC: ${customer_detail.tc_identity_number}` + "\n" + `
    Ad Soyad: ${customer_detail.fullname}` + "\n" + `
    Telefon: ${customer_detail.phone}
`;

But they always appear side by side. How can I show one under the other or with break line?


问:
How to reset the clip geometry in .NET MAUI and change the clip value based on the Flow direction Right to left?
How to reset the clip geometry in .NET MAUI and change the clip value based on the Flow direction Right to left?

protected override void OnDraw(ICanvas canvas, RectF dirtyRect)
{
  base.OnDraw(canvas, dirtyRect);
  this.Clip = new RoundRectangleGeometry(5, dirtyRect);
}
```

I have set the clip to null based on the RightToLeft flow direction But it does not works properly.
How to reset the clip dynamically,

Body:
How to reset the clip geometry in .NET MAUI and change the clip value based on the Flow direction Right to left?

protected override void OnDraw(ICanvas canvas, RectF dirtyRect)
{
  base.OnDraw(canvas, dirtyRect);
  this.Clip = new RoundRectangleGeometry(5, dirtyRect);
}

I have set the clip to null based on the RightToLeft flow direction But it does not works properly.
How to reset the clip dynamically,


问:
Using Interia / Vue.js within XAMPP
After following the Laravel bootcamp that creates a small project called chirps, which works perfectly while using artisan on windows, when I try to access via apache in XAMPP, the inertia uris as defined below are not recognized in the browser

```<code>Route::get('/', function () {
    return Inertia::render('Welcome', [
        'canLogin' => Route::has('login'),
        'canRegister' => Route::has('register'),
        'laravelVersion' => Application::VERSION,
        'phpVersion' => PHP_VERSION,
    ]);
});
</code>```

This is config in my xampp/apache/conf/extras/httpd-vhosts.conf file.

```<code><VirtualHost *:80>
    DocumentRoot "{path}/public"
    ServerName {projectName}.local
    ServerAlias {projectName}.local
    <Directory {path}/public>
        AllowOverride none
        Require all granted
    </Directory>
</VirtualHost>

</code>```

The app.blade.php file is loaded as expected but as soon as you try to go to login / register it does not recognise them when running via apache, but work fine when running under artisan. Anyone got any ideas?

Title: Using Interia / Vue.js within XAMPP

Body:
After following the Laravel bootcamp that creates a small project called chirps, which works perfectly while using artisan on windows, when I try to access via apache in XAMPP, the inertia uris as defined below are not recognized in the browser

Route::get('/', function () {
    return Inertia::render('Welcome', [
        'canLogin' => Route::has('login'),
        'canRegister' => Route::has('register'),
        'laravelVersion' => Application::VERSION,
        'phpVersion' => PHP_VERSION,
    ]);
});

This is config in my xampp/apache/conf/extras/httpd-vhosts.conf file.

<VirtualHost *:80>
    DocumentRoot "{path}/public"
    ServerName {projectName}.local
    ServerAlias {projectName}.local
    <Directory {path}/public>
        AllowOverride none
        Require all granted
    </Directory>
</VirtualHost>

The app.blade.php file is loaded as expected but as soon as you try to go to login / register it does not recognise them when running via apache, but work fine when running under artisan. Anyone got any ideas?


问:
Media Queries not functioning as expected when uploaded on live server
I made a Netflix clone and I was working on making it responsive. It was working fine and giving the desired output in VS Code but then I uploaded it to a live website to check if it is working then, but the responsiveness was no longer working as expected.

Below is the media queries code >>>>

```<code>@media screen and (max-width:768px) {
   .logobtn img{
        height: 30px;
   }
   img.dropdown{
    height: 10px;
    width: 15px;
   }
   .btn:nth-child(1){
    margin-right: 10px;
   }
   .content{
    /* padding: 0px; */
    width: 330px;
    margin-left: -20px;
   }
   .content h1{
    font-size: 30px;
    line-height: 37px;
    padding: 0;
   }
   .content h3{
    padding: 0;
    width: 375px;
    font-size: 24px;
   }
   .form{
    flex-direction: column;
    position: relative;
    height: 40px;

   }
   .email{
    margin-left: -155px;
    /* margin-right: -100px; */
    padding-right: 0px;
   }
   .submit{
    position: absolute;top: 50px;
    /* border-radius: 10px; */
   }
   .row{
    flex-direction: column;
   }

}
</code>```

Body:
I made a Netflix clone and I was working on making it responsive. It was working fine and giving the desired output in VS Code but then I uploaded it to a live website to check if it is working then, but the responsiveness was no longer working as expected.

Below is the media queries code >>>>

@media screen and (max-width:768px) {
   .logobtn img{
        height: 30px;
   }
   img.dropdown{
    height: 10px;
    width: 15px;
   }
   .btn:nth-child(1){
    margin-right: 10px;
   }
   .content{
    /* padding: 0px; */
    width: 330px;
    margin-left: -20px;
   }
   .content h1{
    font-size: 30px;
    line-height: 37px;
    padding: 0;
   }
   .content h3{
    padding: 0;
    width: 375px;
    font-size: 24px;
   }
   .form{
    flex-direction: column;
    position: relative;
    height: 40px;

   }
   .email{
    margin-left: -155px;
    /* margin-right: -100px; */
    padding-right: 0px;
   }
   .submit{
    position: absolute;top: 50px;
    /* border-radius: 10px; */
   }
   .row{
    flex-direction: column;
   }

}


问:
Spring Boot 3.0 ClassLoader problem when using setStatusCode on ServerHttpResponse
Hi i was try to migrate from spring boot 2.7.X to spring boot 3.0.X

I find really weird application behaviour. In one class i do sth like this

```<code>public class ExampleFilter implements WebFilter {

    @Override
    @NonNull
    public Mono<Void> filter(ServerWebExchange exchange, @NonNull WebFilterChain chain) {
        var response = exchange.getResponse();
        response.setStatusCode(HttpStatus.METHOD_NOT_ALLOWED);
        return chain.filter(exchange);

    }
}
</code>```

From spring 6.0 application stop building when this setStatusCode method is in class.

exception look like this

```<code>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'allowedMethodsFilter': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [tmp.AllowedMethodsFilter] from ClassLoader [org.springframework.boot.loader.LaunchedURLClassLoader@7eda2dbb]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:289)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1302)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1219)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
    at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:64)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:745)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:420)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
    at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:164)
    at tmp.ExampleApp.main(ExampleApp.java:21)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
Caused by: java.lang.IllegalStateException: Failed to introspect Class [tmp.AllowedMethodsFilter] from ClassLoader [org.springframework.boot.loader.LaunchedURLClassLoader@7eda2dbb]
    at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:485)
    at org.springframework.util.ReflectionUtils.doWithLocalMethods(ReflectionUtils.java:321)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:267)
    ... 25 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/springframework/http/HttpStatusCode
    at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
    at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3402)
    at java.base/java.lang.Class.getDeclaredMethods(Class.java:2504)
    at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:467)
    ... 27 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.http.HttpStatusCode
    at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587)
    at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:151)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
    ... 31 common frames omitted

</code>```

It seems that every place that was using set/get response (ServerHttpResponse) stop working

Body:
Hi i was try to migrate from spring boot 2.7.X to spring boot 3.0.X

I find really weird application behaviour. In one class i do sth like this

public class ExampleFilter implements WebFilter {

    @Override
    @NonNull
    public Mono<Void> filter(ServerWebExchange exchange, @NonNull WebFilterChain chain) {
        var response = exchange.getResponse();
        response.setStatusCode(HttpStatus.METHOD_NOT_ALLOWED);
        return chain.filter(exchange);

    }
}

From spring 6.0 application stop building when this setStatusCode method is in class.

exception look like this

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'allowedMethodsFilter': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [tmp.AllowedMethodsFilter] from ClassLoader [org.springframework.boot.loader.LaunchedURLClassLoader@7eda2dbb]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:289)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1302)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1219)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
    at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:64)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:745)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:420)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
    at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:164)
    at tmp.ExampleApp.main(ExampleApp.java:21)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
Caused by: java.lang.IllegalStateException: Failed to introspect Class [tmp.AllowedMethodsFilter] from ClassLoader [org.springframework.boot.loader.LaunchedURLClassLoader@7eda2dbb]
    at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:485)
    at org.springframework.util.ReflectionUtils.doWithLocalMethods(ReflectionUtils.java:321)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:267)
    ... 25 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/springframework/http/HttpStatusCode
    at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
    at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3402)
    at java.base/java.lang.Class.getDeclaredMethods(Class.java:2504)
    at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:467)
    ... 27 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.http.HttpStatusCode
    at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587)
    at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:151)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
    ... 31 common frames omitted

It seems that every place that was using set/get response (ServerHttpResponse) stop working


问:
Unable to Send Custom headers for zap-api-scan.py, headers are declared in options.prop
Unable to send Custom headers for zap-api-scan.py, headers are declared in options.prop

I want to use zap to scan a rest API endpoint which requires Authorization & X-api-key header.

To specify the header, I have configured these in options.prop file.

But when I run
docker run -v $(pwd):/zap/wrk/:rw -t owasp/zap2docker-weekly zap-api-scan.py -t <API URL> -f openapi -z "-configfile /zap/wrk/options.prop"

I feel prop file is not getting picked. I get 401 error, as my Authorization token is not picked up.

Below is how my options.prop file looks

```<code>replacer.full_list(0).description=Authorization
 replacer.full_list(0).enabled=true replacer.full_list(0).matchtype=REQ_HEADER
 replacer.full_list(0).matchstr=Authorization
 replacer.full_list(0).regex=false
 replacer.full_list(0).replacement=<Token>
 replacer.full_list(1).description=x-api-key
 replacer.full_list(1).enabled=true
 replacer.full_list(1).matchtype=REQ_HEADER
 replacer.full_list(1).matchstr=x-api-key
 replacer.full_list(1).regex=false
 replacer.full_list(1).replacement=<Value>
</code>```

Body:
Unable to send Custom headers for zap-api-scan.py, headers are declared in options.prop

I want to use zap to scan a rest API endpoint which requires Authorization & X-api-key header.

To specify the header, I have configured these in options.prop file.

But when I run
docker run -v $(pwd):/zap/wrk/:rw -t owasp/zap2docker-weekly zap-api-scan.py -t <API URL> -f openapi -z "-configfile /zap/wrk/options.prop"

I feel prop file is not getting picked. I get 401 error, as my Authorization token is not picked up.

Below is how my options.prop file looks

replacer.full_list(0).description=Authorization
 replacer.full_list(0).enabled=true replacer.full_list(0).matchtype=REQ_HEADER
 replacer.full_list(0).matchstr=Authorization
 replacer.full_list(0).regex=false
 replacer.full_list(0).replacement=<Token>
 replacer.full_list(1).description=x-api-key
 replacer.full_list(1).enabled=true
 replacer.full_list(1).matchtype=REQ_HEADER
 replacer.full_list(1).matchstr=x-api-key
 replacer.full_list(1).regex=false
 replacer.full_list(1).replacement=<Value>


问:
How to use custom fonts in gocv library
I want to add a text on an given co-ordinates of an image using the gocv library (also the text should expand from the co-ordinates; not from left to right).

Using the below command I was able to achieve both requirements. How can I load a custom .ttf font file and do the same thing ?

```<code>import (
    "fmt"
    "image"
    "image/color"
    "os"

    "github.com/gofiber/fiber/v2"
    "gocv.io/x/gocv"
)

func GeneralRoutes(gen fiber.Router) {
    gen.Get("/image", func(c *fiber.Ctx) error {
        imageFile := "path/input.png"
        outputFile := "path/output.jpg"

        img := gocv.IMRead(imageFile, gocv.IMReadColor)
        if img.Empty() {
            fmt.Printf("Error opening image: %s\n", imageFile)
            os.Exit(1)
        }

        // Create a font type and scale
        font := gocv.FontHersheyPlain
        scale := 5.5
        thickness := 5

        // Define the text to be added, position, font type and color
        text := "Hello World"

        textSize := gocv.GetTextSize(text, font, scale, thickness)

        textPos := img.Point{X: 1170 - textSize.X/2, Y: 663 - textSize.Y/2}

        gocv.PutText(&img, text, textPos, font, scale, color.RGBA{0, 0, 0, 0}, thickness)

        // Save the output image
        gocv.IMWrite(outputFile, img)

        return c.SendFile(outputFile)
    })
}
</code>```

Title: How to use custom fonts in gocv library

Body:
I want to add a text on an given co-ordinates of an image using the gocv library (also the text should expand from the co-ordinates; not from left to right).

Using the below command I was able to achieve both requirements. How can I load a custom .ttf font file and do the same thing ?

import (
    "fmt"
    "image"
    "image/color"
    "os"

    "github.com/gofiber/fiber/v2"
    "gocv.io/x/gocv"
)

func GeneralRoutes(gen fiber.Router) {
    gen.Get("/image", func(c *fiber.Ctx) error {
        imageFile := "path/input.png"
        outputFile := "path/output.jpg"

        img := gocv.IMRead(imageFile, gocv.IMReadColor)
        if img.Empty() {
            fmt.Printf("Error opening image: %s\n", imageFile)
            os.Exit(1)
        }

        // Create a font type and scale
        font := gocv.FontHersheyPlain
        scale := 5.5
        thickness := 5

        // Define the text to be added, position, font type and color
        text := "Hello World"

        textSize := gocv.GetTextSize(text, font, scale, thickness)

        textPos := img.Point{X: 1170 - textSize.X/2, Y: 663 - textSize.Y/2}

        gocv.PutText(&img, text, textPos, font, scale, color.RGBA{0, 0, 0, 0}, thickness)

        // Save the output image
        gocv.IMWrite(outputFile, img)

        return c.SendFile(outputFile)
    })
}


问:
Exception: Failed to send email: no recipient sendEmail @ EmailSender.gs:29
PLEASE HELP!! I am getting this error on my code upon RUNNING

enter image description here

Hello everyone please help me remove the error code I am getting

```<code>function sendEmail() {

var ss = SpreadsheetApp.getActiveSpreadsheet()

var sheet1 = ss.getSheetByName('Recipients');

var sheet2 = ss.getSheetByName('Content');

var subject = sheet2.getRange(2,1).getValue();

var n = sheet1.getLastRow();

for (var i = 2; i < n+1 ; i++ ) {

var email = sheet1.getRange(i,2).getValue();

var name=sheet1.getRange(i,1).getValue();

var MerchantAcquired=sheet1.getRange(i,3).getValue();

var message = sheet2.getRange(2,2).getValue();

var options = {
     cc: sheet1.getRange(i,4).getValue(),
}
message = message.replace("<name>",name).replace("<merchant>",MerchantAcquired);

MailApp.sendEmail (email, subject, message, options);

SpreadsheetApp.getUi().alert('Successfully Sent');

}
}
</code>```

I tried to lessen the {} but it doesn't work.

Body:
PLEASE HELP!! I am getting this error on my code upon RUNNING

enter image description here

Hello everyone please help me remove the error code I am getting

function sendEmail() {

var ss = SpreadsheetApp.getActiveSpreadsheet()

var sheet1 = ss.getSheetByName('Recipients');

var sheet2 = ss.getSheetByName('Content');

var subject = sheet2.getRange(2,1).getValue();

var n = sheet1.getLastRow();

for (var i = 2; i < n+1 ; i++ ) {

var email = sheet1.getRange(i,2).getValue();

var name=sheet1.getRange(i,1).getValue();

var MerchantAcquired=sheet1.getRange(i,3).getValue();

var message = sheet2.getRange(2,2).getValue();

var options = {
     cc: sheet1.getRange(i,4).getValue(),
}
message = message.replace("<name>",name).replace("<merchant>",MerchantAcquired);

MailApp.sendEmail (email, subject, message, options);

SpreadsheetApp.getUi().alert('Successfully Sent');

}
}

I tried to lessen the {} but it doesn't work.


问:
Eureka server communication not working on production
We are using Eureka for microservice communication of our project on localhost it is working properly but on production it is giving error Unknown host exception. If anyone knows solution for this?

Tried using discovery client and rest template.


问:
How do I resolve a 403 for accessing Sheets API via Python
I am trying to build a script on my local machine using Python that will download a Google sheet from my account using a short lived federated identity token. I have seen documentation that speaks about differences between doing this depends on context, so starting on a MacOS running Monterey and VScode, and later to HA (Minikube, k9s, etc. and then cloud).

I have enabled the Sheets API via the browser for the current project, obtained a client ID and secret, and have the cli installed. I ran a gcloud auth application-default login. I am currently seeing a 403 and potentially insufficient scopes. Older posts here speaks of clobbering/modifying the .credentials and starting with a proper scope. I know a lot has changed with variable length tokens, scope and all since 2019...

Also I looked here on recommendation from Workspaces support, and seem to be in a pickle, pardon the pun;) Is it still a pickle I'm going to deal with here?

Here is my current code:

"""
BEFORE RUNNING:
---------------
1. If not already done, enable the Google Sheets API
   and check the quota for your project at
   https://console.developers.google.com/apis/api/sheets
2. Install the Python client library for Google APIs by running
   `pip install --upgrade google-api-python-client`
"""
from pprint import pprint

from googleapiclient import discovery

# TODO: Change placeholder below to generate authentication credentials. See
# https://developers.google.com/sheets/quickstart/python#step_3_set_up_the_sample
#
# Authorize using one of the following scopes:
#     'https://www.googleapis.com/auth/drive'
#     'https://www.googleapis.com/auth/drive.file'
#     'https://www.googleapis.com/auth/drive.readonly'
#     'https://www.googleapis.com/auth/spreadsheets'
#     'https://www.googleapis.com/auth/spreadsheets.readonly'
credentials = None

service = discovery.build('sheets', 'v4', credentials=credentials)

# The ID of the spreadsheet to retrieve data from.
spreadsheet_id = ''  # TODO: Update placeholder value.

# The A1 notation of the values to retrieve.
range_ = 'A1:Y1'  # TODO: Update placeholder value.

# How values should be represented in the output.
# The default render option is ValueRenderOption.FORMATTED_VALUE.
value_render_option = ''  # TODO: Update placeholder value.

# How dates, times, and durations should be represented in the output.
# This is ignored if value_render_option is
# FORMATTED_VALUE.
# The default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER].
date_time_render_option = ''  # TODO: Update placeholder value.

# request = service.spreadsheets().values().get(spreadsheetId=spreadsheet_id, range=range_, valueRenderOption=value_render_option, dateTimeRenderOption=date_time_render_option)
# response = request.execute()

# errors here from above

request = service.spreadsheets().values().get(spreadsheetId=spreadsheet_id, range=range_)
response = request.execute()

# TODO: Change code below to process the `response` dict:
pprint(response)

```
<p>and the latest error:</p>
```raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://sheets.googleapis.com/v4/spreadsheets/1234567long_spreadsheet_id/values/A1%3AY1?alt=json returned "Request had insufficient authentication scopes.". Details: "[{'@type': 'type.googleapis.com/google.rpc.ErrorInfo', 'reason': 'ACCESS_TOKEN_SCOPE_INSUFFICIENT', 'domain': 'googleapis.com', 'metadata': {'service': 'sheets.googleapis.com', 'method': 'google.apps.sheets.v4.SpreadsheetsService.GetValues'}}]"
```

If someone could point me in a good direction- either detailed current documentation as it relates to python (I may have to back up and punt with Apps Script or something for the time being and POC), or nudge me with some pseudocode in the way I need to properly authenticate to get my credential file working with a short lived token (IMHO better for the time being than having a small business trying to manage keys on GCP) and possibly for a refresh after it's stale, it would be greatly appreciated. Thanks in advance.

Body:
I am trying to build a script on my local machine using Python that will download a Google sheet from my account using a short lived federated identity token. I have seen documentation that speaks about differences between doing this depends on context, so starting on a MacOS running Monterey and VScode, and later to HA (Minikube, k9s, etc. and then cloud).

I have enabled the Sheets API via the browser for the current project, obtained a client ID and secret, and have the cli installed. I ran a gcloud auth application-default login. I am currently seeing a 403 and potentially insufficient scopes. Older posts here speaks of clobbering/modifying the .credentials and starting with a proper scope. I know a lot has changed with variable length tokens, scope and all since 2019...

Also I looked here on recommendation from Workspaces support, and seem to be in a pickle, pardon the pun;) Is it still a pickle I'm going to deal with here?

Here is my current code:

"""
BEFORE RUNNING:
---------------
1. If not already done, enable the Google Sheets API
   and check the quota for your project at
   https://console.developers.google.com/apis/api/sheets
2. Install the Python client library for Google APIs by running
   `pip install --upgrade google-api-python-client`
"""
from pprint import pprint

from googleapiclient import discovery

# TODO: Change placeholder below to generate authentication credentials. See
# https://developers.google.com/sheets/quickstart/python#step_3_set_up_the_sample
#
# Authorize using one of the following scopes:
#     'https://www.googleapis.com/auth/drive'
#     'https://www.googleapis.com/auth/drive.file'
#     'https://www.googleapis.com/auth/drive.readonly'
#     'https://www.googleapis.com/auth/spreadsheets'
#     'https://www.googleapis.com/auth/spreadsheets.readonly'
credentials = None

service = discovery.build('sheets', 'v4', credentials=credentials)

# The ID of the spreadsheet to retrieve data from.
spreadsheet_id = ''  # TODO: Update placeholder value.

# The A1 notation of the values to retrieve.
range_ = 'A1:Y1'  # TODO: Update placeholder value.

# How values should be represented in the output.
# The default render option is ValueRenderOption.FORMATTED_VALUE.
value_render_option = ''  # TODO: Update placeholder value.

# How dates, times, and durations should be represented in the output.
# This is ignored if value_render_option is
# FORMATTED_VALUE.
# The default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER].
date_time_render_option = ''  # TODO: Update placeholder value.

# request = service.spreadsheets().values().get(spreadsheetId=spreadsheet_id, range=range_, valueRenderOption=value_render_option, dateTimeRenderOption=date_time_render_option)
# response = request.execute()

# errors here from above

request = service.spreadsheets().values().get(spreadsheetId=spreadsheet_id, range=range_)
response = request.execute()

# TODO: Change code below to process the `response` dict:
pprint(response)

and the latest error:

raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://sheets.googleapis.com/v4/spreadsheets/1234567long_spreadsheet_id/values/A1%3AY1?alt=json returned "Request had insufficient authentication scopes.". Details: "[{'@type': 'type.googleapis.com/google.rpc.ErrorInfo', 'reason': 'ACCESS_TOKEN_SCOPE_INSUFFICIENT', 'domain': 'googleapis.com', 'metadata': {'service': 'sheets.googleapis.com', 'method': 'google.apps.sheets.v4.SpreadsheetsService.GetValues'}}]"

If someone could point me in a good direction- either detailed current documentation as it relates to python (I may have to back up and punt with Apps Script or something for the time being and POC), or nudge me with some pseudocode in the way I need to properly authenticate to get my credential file working with a short lived token (IMHO better for the time being than having a small business trying to manage keys on GCP) and possibly for a refresh after it's stale, it would be greatly appreciated. Thanks in advance.


问:
Error when AppKernel('prod', false); mode
```<code>SYMFONY_VERSION = 3.4.26
PHP_VERSION = 7.1.33
COMPOSER_VERSION = 2.2.18
DEBIAN_VERSION = 10 Buster
</code>```

I tried AppKernel('prod', true); and it works well.

Then when I tried AppKernel('prod', false); my app works, I can connect to it using my db easy'p easy and next I got the skeleton of my app, without any data and some errors:

```<code>{ "@timestamp":"2023-01-11T13:29:56.300Z", "req":{ "remoteAddress":"172.21.0.1","method":"GET","url":"/var/www/supportASR/web/app.php","referer":"http://localhost:8080/login","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36" }, "res":{ "statusCode":"200","contentLength":3811,"responseTime":25286 }, "message":"172.21.0.1 - - [11/Jan/2023:13:29:56 +0000] GET /incident HTTP/1.1 200 3811 http://localhost:8080/login Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36" }
[2023-01-11 13:29:56] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /js/f4ae7b3.js" (from "http://localhost:8080/incident")" at /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php line 139 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /js/f4ae7b3.js\" (from \"http://localhost:8080/incident\") at /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php:139, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0):  at /var/www/supportASR/var/cache/prod/appProdProjectContainerUrlMatcher.php:631)"} []
[2023-01-11 13:29:56] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /js/dfafd09.js" (from "http://localhost:8080/incident")" at /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php line 139 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /js/dfafd09.js\" (from \"http://localhost:8080/incident\") at /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php:139, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0):  at /var/www/supportASR/var/cache/prod/appProdProjectContainerUrlMatcher.php:631)"} []
[2023-01-11 13:29:56] request.CRITICAL: Exception thrown when handling an exception (Twig_Error_Loader: Unable to find template "base.html.twig" (looked into: /var/www/supportASR/app/Resources/views, /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form) in "@Twig/Exception/error404.html.twig" at line 1. at /var/www/supportASR/vendor/twig/twig/lib/Twig/Loader/Filesystem.php line 232) {"exception":"[object] (Twig_Error_Loader(code: 0): Unable to find template \"base.html.twig\" (looked into: /var/www/supportASR/app/Resources/views, /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form) in \"@Twig/Exception/error404.html.twig\" at line 1. at /var/www/supportASR/vendor/twig/twig/lib/Twig/Loader/Filesystem.php:232)"} []
[2023-01-11 13:29:56] request.CRITICAL: Exception thrown when handling an exception (Twig_Error_Loader: Unable to find template "base.html.twig" (looked into: /var/www/supportASR/app/Resources/views, /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form) in "@Twig/Exception/error404.html.twig" at line 1. at /var/www/supportASR/vendor/twig/twig/lib/Twig/Loader/Filesystem.php line 232) {"exception":"[object] (Twig_Error_Loader(code: 0): Unable to find template \"base.html.twig\" (looked into: /var/www/supportASR/app/Resources/views, /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form) in \"@Twig/Exception/error404.html.twig\" at line 1. at /var/www/supportASR/vendor/twig/twig/lib/Twig/Loader/Filesystem.php:232)"} []
[2023-01-11 13:29:56] request.CRITICAL: Uncaught PHP Exception Twig_Error_Loader: "Unable to find template "base.html.twig" (looked into: /var/www/supportASR/app/Resources/views, /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form) in "@Twig/Exception/error404.html.twig" at line 1." at /var/www/supportASR/vendor/twig/twig/lib/Twig/Loader/Filesystem.php line 232 {"exception":"[object] (Twig_Error_Loader(code: 0): Unable to find template \"base.html.twig\" (looked into: /var/www/supportASR/app/Resources/views, /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form) in \"@Twig/Exception/error404.html.twig\" at line 1. at /var/www/supportASR/vendor/twig/twig/lib/Twig/Loader/Filesystem.php:232, Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /js/f4ae7b3.js\" (from \"http://localhost:8080/incident\") at /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php:139, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0):  at /var/www/supportASR/var/cache/prod/appProdProjectContainerUrlMatcher.php:631)"} []
[2023-01-11 13:29:56] request.CRITICAL: Uncaught PHP Exception Twig_Error_Loader: "Unable to find template "base.html.twig" (looked into: /var/www/supportASR/app/Resources/views, /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form) in "@Twig/Exception/error404.html.twig" at line 1." at /var/www/supportASR/vendor/twig/twig/lib/Twig/Loader/Filesystem.php line 232 {"exception":"[object] (Twig_Error_Loader(code: 0): Unable to find template \"base.html.twig\" (looked into: /var/www/supportASR/app/Resources/views, /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form) in \"@Twig/Exception/error404.html.twig\" at line 1. at /var/www/supportASR/vendor/twig/twig/lib/Twig/Loader/Filesystem.php:232, Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /js/dfafd09.js\" (from \"http://localhost:8080/incident\") at /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php:139, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0):  at /var/www/supportASR/var/cache/prod/appProdProjectContainerUrlMatcher.php:631)"} []
{ "@timestamp":"2023-01-11T13:29:56.341Z", "req":{ "remoteAddress":"172.21.0.1","method":"GET","url":"/var/www/supportASR/web/app.php","referer":"http://localhost:8080/incident","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36" }, "res":{ "statusCode":"500","contentLength":742,"responseTime":6748 }, "message":"172.21.0.1 - - [11/Jan/2023:13:29:56 +0000] GET /js/f4ae7b3.js HTTP/1.1 500 742 http://localhost:8080/incident Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36" }
{ "@timestamp":"2023-01-11T13:29:56.342Z", "req":{ "remoteAddress":"172.21.0.1","method":"GET","url":"/var/www/supportASR/web/app.php","referer":"http://localhost:8080/incident","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36" }, "res":{ "statusCode":"500","contentLength":742,"responseTime":5711 }, "message":"172.21.0.1 - - [11/Jan/2023:13:29:56 +0000] GET /js/dfafd09.js HTTP/1.1 500 742 http://localhost:8080/incident Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36" }
</code>```

I tried changing a lots of config files (app/config/config.yml,parameters.yml ..), I can't remember all, but it still doesn't do anything.
I also tried to clear my var/cache, var/sessions, vendor.

For some context : I want to create a Dockerfile that make an old symfony app working, but I don't know a lot about symfony

Body:
SYMFONY_VERSION = 3.4.26
PHP_VERSION = 7.1.33
COMPOSER_VERSION = 2.2.18
DEBIAN_VERSION = 10 Buster

I tried AppKernel('prod', true); and it works well.

Then when I tried AppKernel('prod', false); my app works, I can connect to it using my db easy'p easy and next I got the skeleton of my app, without any data and some errors:

{ "@timestamp":"2023-01-11T13:29:56.300Z", "req":{ "remoteAddress":"172.21.0.1","method":"GET","url":"/var/www/supportASR/web/app.php","referer":"http://localhost:8080/login","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36" }, "res":{ "statusCode":"200","contentLength":3811,"responseTime":25286 }, "message":"172.21.0.1 - - [11/Jan/2023:13:29:56 +0000] GET /incident HTTP/1.1 200 3811 http://localhost:8080/login Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36" }
[2023-01-11 13:29:56] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /js/f4ae7b3.js" (from "http://localhost:8080/incident")" at /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php line 139 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /js/f4ae7b3.js\" (from \"http://localhost:8080/incident\") at /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php:139, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0):  at /var/www/supportASR/var/cache/prod/appProdProjectContainerUrlMatcher.php:631)"} []
[2023-01-11 13:29:56] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /js/dfafd09.js" (from "http://localhost:8080/incident")" at /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php line 139 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /js/dfafd09.js\" (from \"http://localhost:8080/incident\") at /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php:139, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0):  at /var/www/supportASR/var/cache/prod/appProdProjectContainerUrlMatcher.php:631)"} []
[2023-01-11 13:29:56] request.CRITICAL: Exception thrown when handling an exception (Twig_Error_Loader: Unable to find template "base.html.twig" (looked into: /var/www/supportASR/app/Resources/views, /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form) in "@Twig/Exception/error404.html.twig" at line 1. at /var/www/supportASR/vendor/twig/twig/lib/Twig/Loader/Filesystem.php line 232) {"exception":"[object] (Twig_Error_Loader(code: 0): Unable to find template \"base.html.twig\" (looked into: /var/www/supportASR/app/Resources/views, /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form) in \"@Twig/Exception/error404.html.twig\" at line 1. at /var/www/supportASR/vendor/twig/twig/lib/Twig/Loader/Filesystem.php:232)"} []
[2023-01-11 13:29:56] request.CRITICAL: Exception thrown when handling an exception (Twig_Error_Loader: Unable to find template "base.html.twig" (looked into: /var/www/supportASR/app/Resources/views, /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form) in "@Twig/Exception/error404.html.twig" at line 1. at /var/www/supportASR/vendor/twig/twig/lib/Twig/Loader/Filesystem.php line 232) {"exception":"[object] (Twig_Error_Loader(code: 0): Unable to find template \"base.html.twig\" (looked into: /var/www/supportASR/app/Resources/views, /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form) in \"@Twig/Exception/error404.html.twig\" at line 1. at /var/www/supportASR/vendor/twig/twig/lib/Twig/Loader/Filesystem.php:232)"} []
[2023-01-11 13:29:56] request.CRITICAL: Uncaught PHP Exception Twig_Error_Loader: "Unable to find template "base.html.twig" (looked into: /var/www/supportASR/app/Resources/views, /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form) in "@Twig/Exception/error404.html.twig" at line 1." at /var/www/supportASR/vendor/twig/twig/lib/Twig/Loader/Filesystem.php line 232 {"exception":"[object] (Twig_Error_Loader(code: 0): Unable to find template \"base.html.twig\" (looked into: /var/www/supportASR/app/Resources/views, /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form) in \"@Twig/Exception/error404.html.twig\" at line 1. at /var/www/supportASR/vendor/twig/twig/lib/Twig/Loader/Filesystem.php:232, Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /js/f4ae7b3.js\" (from \"http://localhost:8080/incident\") at /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php:139, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0):  at /var/www/supportASR/var/cache/prod/appProdProjectContainerUrlMatcher.php:631)"} []
[2023-01-11 13:29:56] request.CRITICAL: Uncaught PHP Exception Twig_Error_Loader: "Unable to find template "base.html.twig" (looked into: /var/www/supportASR/app/Resources/views, /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form) in "@Twig/Exception/error404.html.twig" at line 1." at /var/www/supportASR/vendor/twig/twig/lib/Twig/Loader/Filesystem.php line 232 {"exception":"[object] (Twig_Error_Loader(code: 0): Unable to find template \"base.html.twig\" (looked into: /var/www/supportASR/app/Resources/views, /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form) in \"@Twig/Exception/error404.html.twig\" at line 1. at /var/www/supportASR/vendor/twig/twig/lib/Twig/Loader/Filesystem.php:232, Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /js/dfafd09.js\" (from \"http://localhost:8080/incident\") at /var/www/supportASR/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php:139, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0):  at /var/www/supportASR/var/cache/prod/appProdProjectContainerUrlMatcher.php:631)"} []
{ "@timestamp":"2023-01-11T13:29:56.341Z", "req":{ "remoteAddress":"172.21.0.1","method":"GET","url":"/var/www/supportASR/web/app.php","referer":"http://localhost:8080/incident","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36" }, "res":{ "statusCode":"500","contentLength":742,"responseTime":6748 }, "message":"172.21.0.1 - - [11/Jan/2023:13:29:56 +0000] GET /js/f4ae7b3.js HTTP/1.1 500 742 http://localhost:8080/incident Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36" }
{ "@timestamp":"2023-01-11T13:29:56.342Z", "req":{ "remoteAddress":"172.21.0.1","method":"GET","url":"/var/www/supportASR/web/app.php","referer":"http://localhost:8080/incident","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36" }, "res":{ "statusCode":"500","contentLength":742,"responseTime":5711 }, "message":"172.21.0.1 - - [11/Jan/2023:13:29:56 +0000] GET /js/dfafd09.js HTTP/1.1 500 742 http://localhost:8080/incident Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36" }

I tried changing a lots of config files (app/config/config.yml,parameters.yml ..), I can't remember all, but it still doesn't do anything.
I also tried to clear my var/cache, var/sessions, vendor.

For some context : I want to create a Dockerfile that make an old symfony app working, but I don't know a lot about symfony


问:
WPF DateTimePicker Control for .Net 3.5
Im developing an application in Vb.Net 3.5 under WPF.I need to implement the date picker in it.How can i get that control in WPF.How can i implement in XAML. It says that DatetimePicker and Calendar are not supported.

I tried installing - Syncfusion.SfGrid.WPF nugget but again it can't because it is not supported. Does anyone know what to do.
And apperantly we can't add any nugget package to the program. Thank you!

Title: WPF DateTimePicker Control for .Net 3.5


问:
Cannot create the Kubevirt VM with the pod IP and an internet connection inside
What happened:
I am trying to create the Kubevirt VM with pod IP on the NIC inside. I was trying to use the masquerade network type but it is hiding the pod IP behind the NAT (10.0.2.2). Also, I was trying to use the bridge network type. It created a VM with the needed pod IP inside the VM, but the VM could not connect to the internet. I found that the bridge network type does not allow us to connect to the internet (https://github.com/kubevirt/kubevirt/issues/8520#issuecomment-1261012480).

What you expected to happen:
I expected that my Kubevirt VM will be able to use pod IP inside and will have an internet connection (at least I can ping 8.8.8.8).

How to reproduce it (as minimally and precisely as possible):

Install the Kubevirt operator and its add-ons.

```<code>export VERSION=$(curl -s https://api.github.com/repos/kubevirt/kubevirt/releases | grep tag_name | grep -v -- '-rc' | sort -r | head -1 | awk -F': ' '{print $2}' | sed 's/,//' | xargs)
echo $VERSION
kubectl create -f https://github.com/kubevirt/kubevirt/releases/download/${VERSION}/kubevirt-operator.yaml
=kubectl create -f https://github.com/kubevirt/kubevirt/releases/download/${VERSION}/kubevirt-cr.yaml
=export TAG=$(curl -s -w %{redirect_url} https://github.com/kubevirt/containerized-data-importer/releases/latest)
=export VERSION=$(echo ${TAG##*/})
=kubectl create -f https://github.com/kubevirt/containerized-data-importer/releases/download/$VERSION/cdi-operator.yaml
=kubectl create -f https://github.com/kubevirt/containerized-data-importer/releases/download/$VERSION/cdi-cr.yaml
=kubectl -n kubevirt patch kubevirt kubevirt --type=merge --patch '{"spec":{"configuration":{"developerConfiguration":{"useEmulation":true}}}}'
</code>```

Apply the VM manifest below.

Environment:

KubeVirt version (use virtctl version): v0.59.0-alpha.0
Kubernetes version (use kubectl version):

```<code>Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.7", GitCommit:"1dd5338295409edcfff11505e7bb246f0d325d15", GitTreeState:"clean", BuildDate:"2021-01-13T13:23:52Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"23+", GitVersion:"v1.23.13-eks-fb459a0", GitCommit:"55bd5d5cb7d32bc35e4e050f536181196fb8c6f7", GitTreeState:"clean", BuildDate:"2022-10-24T20:35:40Z", GoVersion:"go1.17.13", Compiler:"gc", Platform:"linux/amd64"}
</code>```

VM or VMI specifications:

```<code>apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
  name: test
spec:
  running: false
  template:
    metadata:
      labels:
        kubevirt.io/domain: test
    spec:
      domain:
        devices:
          disks:
            - name: dvdisk
              bootOrder: 1
              disk:
                bus: sata
            - name: datadisk
              bootOrder: 2
              disk:
                bus: sata
          interfaces:
            - name: default
              masquerade: {} (or bridge: {})
        resources:
          requests:
            cpu: 2
            memory: 4Gi
      networks:
        - name: default
          pod: {}
      volumes:
        - name: dvdisk
          persistentVolumeClaim:
            claimName: debian-test-1
        - name: datadisk
          persistentVolumeClaim:
            claimName: debian-test-2
        - cloudInitNoCloud:
            userData: |-
              #cloud-config
              user: user
              password: dadsaqrqwr
              chpasswd: { expire: False }
          name: cloudinitdisk
</code>```

Cloud provider or hardware configuration: AWS EKS

OS (e.g. from /etc/os-release): Debian 11 (bullseye)

Kernel (e.g. uname -a): Debian 5.19.46-4 (2021-08-03) x86_64 GNU/Linux

Install tools: N/A

Others: N/A

What should I do to make it works?
Will be grateful for the help!

Regards,
Dan

Body:
What happened:
I am trying to create the Kubevirt VM with pod IP on the NIC inside. I was trying to use the masquerade network type but it is hiding the pod IP behind the NAT (10.0.2.2). Also, I was trying to use the bridge network type. It created a VM with the needed pod IP inside the VM, but the VM could not connect to the internet. I found that the bridge network type does not allow us to connect to the internet (https://github.com/kubevirt/kubevirt/issues/8520#issuecomment-1261012480).

What you expected to happen:
I expected that my Kubevirt VM will be able to use pod IP inside and will have an internet connection (at least I can ping 8.8.8.8).

How to reproduce it (as minimally and precisely as possible):

Install the Kubevirt operator and its add-ons.

export VERSION=$(curl -s https://api.github.com/repos/kubevirt/kubevirt/releases | grep tag_name | grep -v -- '-rc' | sort -r | head -1 | awk -F': ' '{print $2}' | sed 's/,//' | xargs)
echo $VERSION
kubectl create -f https://github.com/kubevirt/kubevirt/releases/download/${VERSION}/kubevirt-operator.yaml
=kubectl create -f https://github.com/kubevirt/kubevirt/releases/download/${VERSION}/kubevirt-cr.yaml
=export TAG=$(curl -s -w %{redirect_url} https://github.com/kubevirt/containerized-data-importer/releases/latest)
=export VERSION=$(echo ${TAG##*/})
=kubectl create -f https://github.com/kubevirt/containerized-data-importer/releases/download/$VERSION/cdi-operator.yaml
=kubectl create -f https://github.com/kubevirt/containerized-data-importer/releases/download/$VERSION/cdi-cr.yaml
=kubectl -n kubevirt patch kubevirt kubevirt --type=merge --patch '{"spec":{"configuration":{"developerConfiguration":{"useEmulation":true}}}}'

Apply the VM manifest below.

Environment:

KubeVirt version (use virtctl version): v0.59.0-alpha.0
Kubernetes version (use kubectl version):

Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.7", GitCommit:"1dd5338295409edcfff11505e7bb246f0d325d15", GitTreeState:"clean", BuildDate:"2021-01-13T13:23:52Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"23+", GitVersion:"v1.23.13-eks-fb459a0", GitCommit:"55bd5d5cb7d32bc35e4e050f536181196fb8c6f7", GitTreeState:"clean", BuildDate:"2022-10-24T20:35:40Z", GoVersion:"go1.17.13", Compiler:"gc", Platform:"linux/amd64"}

VM or VMI specifications:

apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
  name: test
spec:
  running: false
  template:
    metadata:
      labels:
        kubevirt.io/domain: test
    spec:
      domain:
        devices:
          disks:
            - name: dvdisk
              bootOrder: 1
              disk:
                bus: sata
            - name: datadisk
              bootOrder: 2
              disk:
                bus: sata
          interfaces:
            - name: default
              masquerade: {} (or bridge: {})
        resources:
          requests:
            cpu: 2
            memory: 4Gi
      networks:
        - name: default
          pod: {}
      volumes:
        - name: dvdisk
          persistentVolumeClaim:
            claimName: debian-test-1
        - name: datadisk
          persistentVolumeClaim:
            claimName: debian-test-2
        - cloudInitNoCloud:
            userData: |-
              #cloud-config
              user: user
              password: dadsaqrqwr
              chpasswd: { expire: False }
          name: cloudinitdisk

Cloud provider or hardware configuration: AWS EKS

OS (e.g. from /etc/os-release): Debian 11 (bullseye)

Kernel (e.g. uname -a): Debian 5.19.46-4 (2021-08-03) x86_64 GNU/Linux

Install tools: N/A

Others: N/A

What should I do to make it works?
Will be grateful for the help!

Regards,
Dan


问:
How to generate RSA-PSS key in .NET Framework 4.8?
I get just signature padding with pss. But i need RSA-PSS key algorithm. How can i get it?
i use new KeyGenerationParameters(SecureRandom.GetInstance("SHA256PRNG"), sizeInBits) for generation.

UPD: I sign certificate by this key, and i have just rsa encryption in public data. How i can get rsapss in this field?