问:
OpenLayers in .KML format does not import a Document nested within another Document
I'm trying to .readFeatures from data constant (string | ArrayBuffer with .KML document loaded):

```<code>import { GeoJSON, KML } from "ol/format"
const features = new KML().readFeatures(data)
</code>```

The .KML file is in the following format:

```<code><Document>
    <Folder>
        <Folder>
            <name>Folder 1_1</name>
            <Placemark>
                ...
                <MultiGeometry>
                    ...
                    <coordinates>
                        -76.13931494546615,0.5098076233873724,0 ....
                    </coordinates>
                    ...
                </MultiGeometry>
            </Placemark>
        </Folder>
        <Document>
            <Folder>
                <Placemark>
                    ...
                    <MultiGeometry>
                        ...
                        <coordinates>
                            -73.13931494546615,0.4098076233873724,0 ....
                        </coordinates>
                        ...
                    </MultiGeometry>
                </Placemark>
            </Folder>
        </Document>
    </Folder>
</Document>
</code>```

Minimal reproduction below:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
    <name>doc.kmz</name>
    <Folder>
        <name>Folder 1</name>
        <Folder>
            <name>Folder 1_1</name>
            <Placemark>
                <name>placemark</name>
                <MultiGeometry>
                    <Polygon>
                        <outerBoundaryIs>
                            <LinearRing>
                                <coordinates>
                                    -76.13931494546615,0.5098076233873724,0 -76.13948797228086,0.5098248339431898,0 -76.13970109785714,0.509846033020921,0 -76.14017852589552,0.5098935215986679,0 -76.1402398678092,0.5098996231243277,0 -76.14114967611076,0.5099901194195925,0 -76.14142354839053,0.5100173607753257,0 -76.14127921729398,0.5096660421602583,0 -76.14017458441678,0.4935474403519166,0 -76.13879866449498,0.4935094821599098,0 -76.13828709140428,0.4934815592724979,0 -76.13831824588161,0.4939003445305357,0 -76.13831570725239,0.4969795801424135,0 -76.13831543344389,0.49731568978584,0 -76.1383114959657,0.5020482617948276,0 -76.13831122188797,0.5023819299569766,0 -76.13830918234731,0.5051102840456122,0 -76.13830629912317,0.5089577188327856,0 -76.13830600014406,0.5093560467242843,0 -76.13830591743167,0.5095947368962785,0 -76.13835582010736,0.509599700596221,0 -76.13931494546615,0.5098076233873724,0
                                </coordinates>
                            </LinearRing>
                        </outerBoundaryIs>
                    </Polygon>
                </MultiGeometry>
            </Placemark>
        </Folder>
        <Document xsi:schemaLocation="http://www.opengis.net/kml/2.2 http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd http://www.google.com/kml/ext/2.2 http://code.google.com/apis/kml/schema/kml22gx.xsd">
            <name>document in document</name>
            <Folder>
                <name>folder in document in document</name>
                <Placemark>
                    <name>placemark</name>
                    <MultiGeometry>
                        <Polygon>
                            <outerBoundaryIs>
                                <LinearRing>
                                    <coordinates>
                                        -76.15223270000983,0.5108874000001952,0 -76.15350619910207,0.5179229068300566,0 -76.15580284800927,0.517914136423441,0 -76.15566561864864,0.517026194586018,0 -76.15474773361127,0.5110870929524085,0 -76.15467104860501,0.5110850396223622,0 -76.15464890000979,0.5109514000001196,0 -76.15223270000983,0.5108874000001952,0
                                    </coordinates>
                                </LinearRing>
                            </outerBoundaryIs>
                        </Polygon>
                    </MultiGeometry>
                </Placemark>
            </Folder>
        </Document>
    </Folder>
</Document>
</kml>```
</div>
</div>
</p>
<p><strong>Result</strong></p>
```features == [Features] // -76.13931494546615,0.5098076233873724,0 ....
```
<p>There is only one element, so <strong>the nested document is ignored</strong>.</p>
<p><strong>Expected result</strong></p>
```features == [Features, Features] // two elements
```

Reference

I tried to import the same .kml file with the kmlviewer.nsspot.net tool and both features were imported:

Question

Is it possible with OpenLayers to get the same result as in reference? Is this .KML file valid?

Body:
I'm trying to .readFeatures from data constant (string | ArrayBuffer with .KML document loaded):

import { GeoJSON, KML } from "ol/format"
const features = new KML().readFeatures(data)

The .KML file is in the following format:

<Document>
    <Folder>
        <Folder>
            <name>Folder 1_1</name>
            <Placemark>
                ...
                <MultiGeometry>
                    ...
                    <coordinates>
                        -76.13931494546615,0.5098076233873724,0 ....
                    </coordinates>
                    ...
                </MultiGeometry>
            </Placemark>
        </Folder>
        <Document>
            <Folder>
                <Placemark>
                    ...
                    <MultiGeometry>
                        ...
                        <coordinates>
                            -73.13931494546615,0.4098076233873724,0 ....
                        </coordinates>
                        ...
                    </MultiGeometry>
                </Placemark>
            </Folder>
        </Document>
    </Folder>
</Document>

Minimal reproduction below:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
    <name>doc.kmz</name>
    <Folder>
        <name>Folder 1</name>
        <Folder>
            <name>Folder 1_1</name>
            <Placemark>
                <name>placemark</name>
                <MultiGeometry>
                    <Polygon>
                        <outerBoundaryIs>
                            <LinearRing>
                                <coordinates>
                                    -76.13931494546615,0.5098076233873724,0 -76.13948797228086,0.5098248339431898,0 -76.13970109785714,0.509846033020921,0 -76.14017852589552,0.5098935215986679,0 -76.1402398678092,0.5098996231243277,0 -76.14114967611076,0.5099901194195925,0 -76.14142354839053,0.5100173607753257,0 -76.14127921729398,0.5096660421602583,0 -76.14017458441678,0.4935474403519166,0 -76.13879866449498,0.4935094821599098,0 -76.13828709140428,0.4934815592724979,0 -76.13831824588161,0.4939003445305357,0 -76.13831570725239,0.4969795801424135,0 -76.13831543344389,0.49731568978584,0 -76.1383114959657,0.5020482617948276,0 -76.13831122188797,0.5023819299569766,0 -76.13830918234731,0.5051102840456122,0 -76.13830629912317,0.5089577188327856,0 -76.13830600014406,0.5093560467242843,0 -76.13830591743167,0.5095947368962785,0 -76.13835582010736,0.509599700596221,0 -76.13931494546615,0.5098076233873724,0
                                </coordinates>
                            </LinearRing>
                        </outerBoundaryIs>
                    </Polygon>
                </MultiGeometry>
            </Placemark>
        </Folder>
        <Document xsi:schemaLocation="http://www.opengis.net/kml/2.2 http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd http://www.google.com/kml/ext/2.2 http://code.google.com/apis/kml/schema/kml22gx.xsd">
            <name>document in document</name>
            <Folder>
                <name>folder in document in document</name>
                <Placemark>
                    <name>placemark</name>
                    <MultiGeometry>
                        <Polygon>
                            <outerBoundaryIs>
                                <LinearRing>
                                    <coordinates>
                                        -76.15223270000983,0.5108874000001952,0 -76.15350619910207,0.5179229068300566,0 -76.15580284800927,0.517914136423441,0 -76.15566561864864,0.517026194586018,0 -76.15474773361127,0.5110870929524085,0 -76.15467104860501,0.5110850396223622,0 -76.15464890000979,0.5109514000001196,0 -76.15223270000983,0.5108874000001952,0
                                    </coordinates>
                                </LinearRing>
                            </outerBoundaryIs>
                        </Polygon>
                    </MultiGeometry>
                </Placemark>
            </Folder>
        </Document>
    </Folder>
</Document>
</kml>

Result

features == [Features] // -76.13931494546615,0.5098076233873724,0 ....

There is only one element, so the nested document is ignored.

Expected result

features == [Features, Features] // two elements

Reference

I tried to import the same .kml file with the kmlviewer.nsspot.net tool and both features were imported:

Question

Is it possible with OpenLayers to get the same result as in reference? Is this .KML file valid?


来源: stackexchange

问:
Quasar, Q-select in Q-dialog

step 1: Open select

step 2: Scroll content in dialog

method updateMenuPosition() did not help

image

codepen

```<code><div id="q-app">
  <div class="q-pa-md q-gutter-sm">
    <q-btn label="Alert" color="primary" @click="alert = true"></q-btn>

    <q-dialog v-model="alert">
      <q-card>
        <q-card-section>
          <div class="text-h6">Alert</div>
        </q-card-section>

        <q-card-section>
          <q-select filled v-model="model" :options="options" label="Standard" style="width: 200px;" />
        </q-card-section>

        <q-card-actions align="right">
          <q-btn flat label="OK" color="primary" v-close-popup></q-btn>
        </q-card-actions>
      </q-card>
    </q-dialog>
  </div>
</div>
</code>```

ContentLicense: CC BY-SA 4.0

Title: Quasar, Q-select in Q-dialog

Body:
step 1: Open select

step 2: Scroll content in dialog

method updateMenuPosition() did not help

image

codepen

    <q-btn label="Alert" color="primary" @click="alert = true"></q-btn>

    <q-dialog v-model="alert">
      <q-card>
        <q-card-section>

Alert

        </q-card-section>

        <q-card-section>
          <q-select filled v-model="model" :options="options" label="Standard" style="width: 200px;" />
        </q-card-section>

        <q-card-actions align="right">
          <q-btn flat label="OK" color="primary" v-close-popup></q-btn>
        </q-card-actions>
      </q-card>
    </q-dialog>


问:
Angular Material 15 nested menu with dynamic data
i just updated my project from Angular v13 to v15.
While using v13 i created a nested menu with dynamic data from an API. I mostly followed this guide and it worked.
Now after the update I got the issue, that the text inside the mat-list-item is hoverable and only that part is clickable. I didn't change any code and it worked pre v15.
It seems like mat-list-item is not working right inside ng-template.

Screenshot: Hover and click only working over the text "id"


问:
Find all ternary operators in PhpStorm project
I'm moving my project from PHP 7 to PHP 8. Due to left-associative ternary operator deprecate in PHP 8 I need to do some refactoring.

So, is there an easy way to find all ternary operator in PhpStorm project? Or any other IDE?


问:
How to solve SMTP connection problem in CodeIgniter?
I have a mail function. And when I start the service it send e-mail from my array. My array include 60 mail. When start the service it send 10-15 mail and after got error like this.

from: The following SMTP error was encountered:

Unable to send data: QUIT
quit:

The following SMTP error was encountered:

Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
User-Agent: CodeIgniter

```<code>function sendMail($to,$cc="",$subject,$message,$title="",$attach="",$from="")
{
    $CI = & get_instance();
    $CI->load->library("email");

    $CI->email->clear(TRUE);
    $CI->email->set_newline("\r\n");
    if($title==""){
        $title="q Group";
    }

    if($from=="") {
        $from="q@q.com.tr";
    }
    $CI->email->from($from, $title);
    if($cc<>"")
        $CI->email->cc($cc);
    $CI->email->subject($subject);

    $CI->email->message($message);
    if($attach<>"")
    {
        $CI->email->attach($attach);
    }
    $mailList = explode(",",$to);
    $sendMailList = "";
    foreach ($mailList as $key=>$item) {
        if (filter_var($item, FILTER_VALIDATE_EMAIL)) {
            $sendMailList .=$item.",";
        }
        else{
            MailLogModel::setLog($item,$subject,0,"Mail Adresi Hatalı");
            if(count($mailList)==1)
                return ["status"=>false,"message"=>"Mail Adresi Hatalı"];
        }
    }
    $sendMail = substr($sendMailList,0,-1);
    $CI->email->to($sendMail);
    if (!  $CI->email->send()){
        MailLogModel::setLog($sendMail,$subject,0,html_entity_decode(imap_utf8($CI->email->print_debugger('headers','subject'))));
        return ["status"=>false,"message"=>$CI->email->print_debugger(array('headers'))];
    }
    else{
        MailLogModel::setLog($sendMail,$subject,1);
        return ["status"=>true];
    }
}
</code>```

My config file is here:

```<code>$config['protocol']  = "smtp";
$config['SMTPAuth']    = true;
$config['smtp_host'] = "mail.MYSERVICE.com.tr";
$config['smtp_user'] = "";
$config['smtp_pass'] = "";
$config['smtp_port'] = "25";
$config['charset'] = "utf-8";
$config['mailtype']    = "html";
$config['newline'] = "\r\n";
$config['crlf'] = "\r\n";
$config['smtp_timeout']    = 5;
</code>```

How can I solve this problem?

Body:
I have a mail function. And when I start the service it send e-mail from my array. My array include 60 mail. When start the service it send 10-15 mail and after got error like this.

from: The following SMTP error was encountered:

Unable to send data: QUIT
quit:

The following SMTP error was encountered:

Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
User-Agent: CodeIgniter

function sendMail($to,$cc="",$subject,$message,$title="",$attach="",$from="")
{
    $CI = & get_instance();
    $CI->load->library("email");

    $CI->email->clear(TRUE);
    $CI->email->set_newline("\r\n");
    if($title==""){
        $title="q Group";
    }

    if($from=="") {
        $from="q@q.com.tr";
    }
    $CI->email->from($from, $title);
    if($cc<>"")
        $CI->email->cc($cc);
    $CI->email->subject($subject);

    $CI->email->message($message);
    if($attach<>"")
    {
        $CI->email->attach($attach);
    }
    $mailList = explode(",",$to);
    $sendMailList = "";
    foreach ($mailList as $key=>$item) {
        if (filter_var($item, FILTER_VALIDATE_EMAIL)) {
            $sendMailList .=$item.",";
        }
        else{
            MailLogModel::setLog($item,$subject,0,"Mail Adresi Hatalı");
            if(count($mailList)==1)
                return ["status"=>false,"message"=>"Mail Adresi Hatalı"];
        }
    }
    $sendMail = substr($sendMailList,0,-1);
    $CI->email->to($sendMail);
    if (!  $CI->email->send()){
        MailLogModel::setLog($sendMail,$subject,0,html_entity_decode(imap_utf8($CI->email->print_debugger('headers','subject'))));
        return ["status"=>false,"message"=>$CI->email->print_debugger(array('headers'))];
    }
    else{
        MailLogModel::setLog($sendMail,$subject,1);
        return ["status"=>true];
    }
}

My config file is here:

$config['protocol']  = "smtp";
$config['SMTPAuth']    = true;
$config['smtp_host'] = "mail.MYSERVICE.com.tr";
$config['smtp_user'] = "";
$config['smtp_pass'] = "";
$config['smtp_port'] = "25";
$config['charset'] = "utf-8";
$config['mailtype']    = "html";
$config['newline'] = "\r\n";
$config['crlf'] = "\r\n";
$config['smtp_timeout']    = 5;

How can I solve this problem?


问:
can you run a R flexdashboard instance from python
is it possible to run a flexdashboard/shiny app (produced in R, either .R or .Rmd), while being called from a python program.

I have not been able to find anything on google


问:
MY WordPress gives 403 error when i update plugin or edit page
I have logged in wordpress website into admin side when try to click on elementor settting ot other page edit it gives 403 error while i am logged in.

we have checked all the plugins and .htaccess file as well everything was normal.

Whenever I am login to admin side via wp-admin and try to customized website i should be able to customize though it encounters 403 err.


问:
The child process exception is not visible when BrokenProcessPool is raised
I have the following code:

```<code>import asyncio
from concurrent.futures import ProcessPoolExecutor

PROCESS_POOL_EXECUTOR = ProcessPoolExecutor(max_workers=2)

def run_in_process(blocking_task, *args) -> Awaitable:
    event_loop = asyncio.get_event_loop()
    return event_loop.run_in_executor(PROCESS_POOL_EXECUTOR, blocking_task, *args)
</code>```

It has been working fine until I added an additional volume and mounted it in an EC2 instance. After I did that, it is raising the following exception:

```<code>  File "/proc/self/fd/3/repo/utils/asyncio.py", line 63, in run_in_process
    return event_loop.run_in_executor(PROCESS_POOL_EXECUTOR, blocking_task, *args)
  File "/conda/lib/python3.8/asyncio/base_events.py", line 783, in run_in_executor
    executor.submit(func, *args), loop=self)
  File "/conda/lib/python3.8/concurrent/futures/process.py", line 629, in submit
    raise BrokenProcessPool(self._broken)
concurrent.futures.process.BrokenProcessPool: A child process terminated abruptly, the process pool is not usable anymore
</code>```

There is nothing except this log. If I understood correctly, this means that the worker raised some exception and that's why the child process terminated. But I don't see that child process exception. That's why I have no idea what is going wrong.

It is probably related to that additional volume and mounting because it works without that new volume. I just don't know what exactly is going wrong.

I tried to run the code in ipython and it worked just fine there too.

I understand that this is a bad question that is not reproducible but maybe someone has seen this before and has some idea.

Body:
I have the following code:

import asyncio
from concurrent.futures import ProcessPoolExecutor

PROCESS_POOL_EXECUTOR = ProcessPoolExecutor(max_workers=2)

def run_in_process(blocking_task, *args) -> Awaitable:
    event_loop = asyncio.get_event_loop()
    return event_loop.run_in_executor(PROCESS_POOL_EXECUTOR, blocking_task, *args)

It has been working fine until I added an additional volume and mounted it in an EC2 instance. After I did that, it is raising the following exception:

  File "/proc/self/fd/3/repo/utils/asyncio.py", line 63, in run_in_process
    return event_loop.run_in_executor(PROCESS_POOL_EXECUTOR, blocking_task, *args)
  File "/conda/lib/python3.8/asyncio/base_events.py", line 783, in run_in_executor
    executor.submit(func, *args), loop=self)
  File "/conda/lib/python3.8/concurrent/futures/process.py", line 629, in submit
    raise BrokenProcessPool(self._broken)
concurrent.futures.process.BrokenProcessPool: A child process terminated abruptly, the process pool is not usable anymore

There is nothing except this log. If I understood correctly, this means that the worker raised some exception and that's why the child process terminated. But I don't see that child process exception. That's why I have no idea what is going wrong.

It is probably related to that additional volume and mounting because it works without that new volume. I just don't know what exactly is going wrong.

I tried to run the code in ipython and it worked just fine there too.

I understand that this is a bad question that is not reproducible but maybe someone has seen this before and has some idea.


问:
problem consuming service with JAX-WS, wlsd:import and # URL
i'm trying to consume a SOAP Service in Java 11.
I've created my classes using com.sun.xml.ws:jaxws-maven-plugin:2.3.2, that's my pom.xml

```<code><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>it.m2sc</groupId>
    <artifactId>poc-ws-consumer-j11</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <properties>
        <maven.compiler.release>11</maven.compiler.release>
        <maven.compiler.target>11</maven.compiler.target>
        <maven.compiler.source>11</maven.compiler.source>
    </properties>
    <dependencies>
        <dependency>
            <groupId>jakarta.xml.ws</groupId>
            <artifactId>jakarta.xml.ws-api</artifactId>
            <version>3.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.ws</groupId>
            <artifactId>jaxws-ri</artifactId>
            <version>2.3.1</version>
            <type>pom</type>
        </dependency>
    </dependencies>
    <build>
        ...
    </build>
</project>
</code>```

when I try to start my test program i got some warning like

```<code>WARNING: Using deprecated META-INF/services mechanism with non-standard property: javax.xml.soap.MetaFactory. Property javax.xml.soap.SAAJMetaFactory should be used instead.
</code>```

and an error

```<code>SEVERE: WSP1005: Failed to find policy referenced by URI "http://int-vwe1c01.m2sc.local:8080/EngageOneWS/DeliveryService?wsdl#WSPolicy".
</code>```

in DeliveryService.wsdl i found the import of WSPolcy

```<code><wsdl:import location="http://int-vwe1c01.m2sc.local:8080/EngageOneWS/DeliveryService?wsdl=ws-policy.xml" namespace="http://pb.com/EngageOne/ws/WSPolicy"/>
</code>```

and references

```<code><wsdl:binding name="DeliveryServiceSOAP" type="DeliveryService">
<wsp:PolicyReference URI="#WSPolicy"/>
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
...
</wsdl:binding>
</code>```

I tried to import ws-policy.xml as separate wsdl using

```<code><configuration>
   <wsdlUrls>
      <wsdlUrl>http://int-vwe1c01.m2sc.local:8080/EngageOneWS/DeliveryService?wsdl</wsdlUrl>
      <wsdlUrl>http://int-vwe1c01.m2sc.local:8080/EngageOneWS/DeliveryService?wsdl=ws-policy.xml</wsdlUrl>
   </wsdlUrls>
   <quiet>true</quiet>
</configuration>
</code>```

but it wont work.
I made a try switching library, using Apache CXF 3.5.4 and it's works fine so I thins JAX-WS not handle URL starting with "#" correctly. It`s a major switch to go with CXF, I prefere to stay with JAX-WS.

Someon can help me pls ?

Body:
i'm trying to consume a SOAP Service in Java 11.
I've created my classes using com.sun.xml.ws:jaxws-maven-plugin:2.3.2, that's my pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>it.m2sc</groupId>
    <artifactId>poc-ws-consumer-j11</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <properties>
        <maven.compiler.release>11</maven.compiler.release>
        <maven.compiler.target>11</maven.compiler.target>
        <maven.compiler.source>11</maven.compiler.source>
    </properties>
    <dependencies>
        <dependency>
            <groupId>jakarta.xml.ws</groupId>
            <artifactId>jakarta.xml.ws-api</artifactId>
            <version>3.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.ws</groupId>
            <artifactId>jaxws-ri</artifactId>
            <version>2.3.1</version>
            <type>pom</type>
        </dependency>
    </dependencies>
    <build>
        ...
    </build>
</project>

when I try to start my test program i got some warning like

WARNING: Using deprecated META-INF/services mechanism with non-standard property: javax.xml.soap.MetaFactory. Property javax.xml.soap.SAAJMetaFactory should be used instead.

and an error

SEVERE: WSP1005: Failed to find policy referenced by URI "http://int-vwe1c01.m2sc.local:8080/EngageOneWS/DeliveryService?wsdl#WSPolicy".

in DeliveryService.wsdl i found the import of WSPolcy

<wsdl:import location="http://int-vwe1c01.m2sc.local:8080/EngageOneWS/DeliveryService?wsdl=ws-policy.xml" namespace="http://pb.com/EngageOne/ws/WSPolicy"/>

and references

<wsdl:binding name="DeliveryServiceSOAP" type="DeliveryService">
<wsp:PolicyReference URI="#WSPolicy"/>
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
...
</wsdl:binding>

I tried to import ws-policy.xml as separate wsdl using

<configuration>
   <wsdlUrls>
      <wsdlUrl>http://int-vwe1c01.m2sc.local:8080/EngageOneWS/DeliveryService?wsdl</wsdlUrl>
      <wsdlUrl>http://int-vwe1c01.m2sc.local:8080/EngageOneWS/DeliveryService?wsdl=ws-policy.xml</wsdlUrl>
   </wsdlUrls>
   <quiet>true</quiet>
</configuration>

but it wont work.
I made a try switching library, using Apache CXF 3.5.4 and it's works fine so I thins JAX-WS not handle URL starting with "#" correctly. It`s a major switch to go with CXF, I prefere to stay with JAX-WS.

Someon can help me pls ?


问:
Android JDK 11 upgrade: package name coming as Android instead of actual package name
When I migrated my app from JDK 1.8 to 11, I am getting apk package name as 'Android'
Gradle used: 7.5

aapt output. When i revert my changes, package name is coming as application id which is correct.

```<code>package: name='android' versionCode='8' versionName='2.2'
sdkVersion:'8'
targetSdkVersion:'8'
uses-permission: name='android.intent.category.MASTER_CLEAR.permission.C2D_MESSAGE'
application-label:'Android System'
application-label-ar:'Android System'
application-label-ar-EG:'Android System'
application-label-ar-IL:'Android System'
application-label-bg-BG:'Android System'
application-label-ca-ES:'Android System'
application-label-cs:'Systém Android'
application-label-cs-CZ:'Systém Android'
application-label-da:'Android-system'
application-label-da-DK:'Android-system'
application-label-de:'Android System'
application-label-de-AT:'Android System'
application-label-de-CH:'Android System'
application-label-de-DE:'Android System'
application-label-de-LI:'Android System'
application-label-el:'Σύστημα Android'
application-label-el-GR:'Σύστημα Android'
application-label-en:'Android System'
application-label-en-AU:'Android System'
application-label-en-CA:'Android System'
application-label-en-GB:'Android System'
application-label-en-IE:'Android System'
application-label-en-IN:'Android System'
application-label-en-NZ:'Android System'
application-label-en-SG:'Android System'
application-label-en-US:'Android System'
application-label-en-ZA:'Android System'
application-label-es:'Sistema Android'
application-label-es-ES:'Sistema Android'
application-label-es-US:'Sistema Androide'
application-label-fi:'Android System'
application-label-fi-FI:'Android System'
application-label-fr:'Système Android'
application-label-fr-BE:'Système Android'
application-label-fr-CA:'Système Android'
application-label-fr-CH:'Système Android'
application-label-fr-FR:'Système Android'
application-label-he-IL:'Android System'
application-label-hi-IN:'Android System'
application-label-hr-HR:'Android System'
application-label-hu:'Android System'
application-label-hu-HU:'Android System'
application-label-id-ID:'Android System'
application-label-it:'Sistema Android'
application-label-it-CH:'Sistema Android'
application-label-it-IT:'Sistema Android'
application-label-iw:'Android System'
application-label-ja:'Androidシステム'
application-label-ja-JP:'Androidシステム'
application-label-ko:'Android 시스템'
application-label-ko-KR:'Android 시스템'
application-label-lt-LT:'Android System'
application-label-lv-LV:'Android System'
application-label-nb:'Android-system'
application-label-nb-NO:'Android-system'
application-label-nl:'Android-systeem'
application-label-nl-BE:'Android-systeem'
application-label-nl-NL:'Android-systeem'
application-label-pl:'System Android'
application-label-pl-PL:'System Android'
application-label-pt:'Sistema Android'
application-label-pt-BR:'Sistema Android'
application-label-pt-PT:'Sistema Android'
application-label-ro-RO:'Android System'
application-label-ru:'Система Android'
application-label-ru-RU:'Система Android'
application-label-sk-SK:'Android System'
application-label-sl-SI:'Android System'
application-label-sr-RS:'Android System'
application-label-sv:'Android-system'
application-label-sv-SE:'Android-system'
application-label-th:'Android System'
application-label-th-TH:'Android System'
application-label-tl-PH:'Android System'
application-label-tr:'Android Sistemi'
application-label-tr-TR:'Android Sistemi'
application-label-uk-UA:'Android System'
application-label-vi-VN:'Android System'
application-label-zh-CN:'Android 系统'
application-label-zh-TW:'Android 系統'
application-icon-160:'res/drawable-mdpi/ic_launcher_android.png'
application-icon-65535:'res/drawable-mdpi/ic_launcher_android.png'
application: label='Android System' icon='res/drawable-mdpi/ic_launcher_android.png'
feature-group: label=''
  uses-feature: name='android.hardware.faketouch'
  uses-implied-feature: name='android.hardware.faketouch' reason='default feature for all apps'
other-activities
other-receivers
other-services
supports-screens: 'small' 'normal' 'large'
supports-any-density: 'true'
locales: '--_--' 'ar' 'ar-EG' 'ar-IL' 'bg-BG' 'ca-ES' 'cs' 'cs-CZ' 'da' 'da-DK' 'de' 'de-AT' 'de-CH' 'de-DE' 'de-LI' 'el' 'el-GR' 'en' 'en-AU' 'en-CA' 'en-GB' 'en-IE' 'en-IN' 'en-NZ' 'en-SG' 'en-US' 'en-ZA' 'es' 'es-ES' 'es-US' 'fi' 'fi-FI' 'fr' 'fr-BE' 'fr-CA' 'fr-CH' 'fr-FR' 'he-IL' 'hi-IN' 'hr-HR' 'hu' 'hu-HU' 'id-ID' 'it' 'it-CH' 'it-IT' 'iw' 'ja' 'ja-JP' 'ko' 'ko-KR' 'lt-LT' 'lv-LV' 'nb' 'nb-NO' 'nl' 'nl-BE' 'nl-NL' 'pl' 'pl-PL' 'pt' 'pt-BR' 'pt-PT' 'ro-RO' 'ru' 'ru-RU' 'sk-SK' 'sl-SI' 'sr-RS' 'sv' 'sv-SE' 'th' 'th-TH' 'tl-PH' 'tr' 'tr-TR' 'uk-UA' 'vi-VN' 'zh-CN' 'zh-TW'
densities: '160' '65535'
native-code: 'arm64-v8a' 'armeabi' 'armeabi-v7a' 'x86' 'x86_64'
</code>```

app build Gradle

```<code>apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.google.gms.google-services'

repositories {
    mavenCentral()
}

android {
    compileSdkVersion 33
    namespace "com.test.android"
    buildToolsVersion '30.0.3'

    dexOptions {
        javaMaxHeapSize "4g"
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE'
    }

    defaultConfig {
        multiDexEnabled true
        minSdkVersion 19
        targetSdkVersion 33
        vectorDrawables.useSupportLibrary = true
        def today = new Date()
        versionCode = versionCodeDate()

        javaCompileOptions {
            annotationProcessorOptions {
                arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
            }
        }
    }

    buildTypes {
        debug {
            debuggable true
            applicationIdSuffix = ".beta"
            ext.enableCrashlytics = false
            manifestPlaceholders = [usesCleartextTraffic:"true"]
        }
        release {
            minifyEnabled true
            shrinkResources true
            zipAlignEnabled true
            debuggable false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), "proguard-rules.pro"
            manifestPlaceholders = [usesCleartextTraffic:"false"]
        }
    }

    flavorDimensions "dim1"

    productFlavors {
        oneapp {
            applicationId "com.testinc.test"
            dimension "dim1"

        }
    }

    sourceSets {
        oneapp {
            java.srcDirs = ['src/main/java', 'src/testwork/java']
            res.srcDirs = ['src/main/res', 'src/testwork/res']
            assets.srcDirs = ['src/main/assets', 'src/testwork/assets']
            manifest.srcFile "src/testwork/AndroidManifest.xml"
        }
    }

    configurations {
        all {
            exclude module: 'httpclient'
            exclude module: 'commons-logging'
            exclude module: 'opengl-api'
            exclude module: 'xmlParserAPIs'
            exclude module: 'json'
            exclude module: 'xpp3'
        }
    }

    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }
}

def static versionCodeDate() {
    return new Date().format("yyMMddHHmm").substring(1).toInteger()
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    androidTestImplementation('androidx.test.espresso:espresso-core:3.5.0', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation('com.google.android:flexbox:0.2.5', {
        exclude group: 'com.google.android'
    })
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.path:android-priority-jobqueue:1.1.2'
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'androidx.appcompat:appcompat:1.5.1'
    implementation 'androidx.legacy:legacy-support-v13:1.0.0'
    implementation 'com.google.android.material:material:1.7.0'

    implementation 'de.mindpipe.android:android-logging-log4j:1.0.3'
    implementation 'log4j:log4j:1.2.17'
    implementation 'com.aurelhubert:ahbottomnavigation:2.0.1'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.room:room-runtime:2.4.3'
    annotationProcessor 'androidx.room:room-compiler:2.4.3'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
    annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.5.1'

    implementation 'com.google.android.gms:play-services-vision:20.1.3'
    implementation 'com.google.android.gms:play-services-location:21.0.1'
    implementation 'com.google.android.gms:play-services-safetynet:18.0.1'
    implementation 'com.google.firebase:firebase-core:21.1.1'
    implementation 'com.google.firebase:firebase-config:21.2.0'
    implementation 'com.google.firebase:firebase-messaging:23.1.0'
    implementation 'com.google.firebase:firebase-crashlytics:18.3.2'
    implementation 'com.google.firebase:firebase-analytics'

    implementation 'com.squareup.okio:okio:1.15.0'
    implementation 'com.squareup.okhttp:okhttp:2.7.5'
    implementation 'com.squareup.okhttp:okhttp-urlconnection:2.7.5'
    implementation 'com.squareup.retrofit:retrofit:1.9.0'
    implementation 'com.google.code.gson:gson:2.8.9'
    implementation 'com.commonsware.cwac:saferoom:0.4.2'
    implementation 'com.github.bumptech.glide:glide:4.8.0'
    implementation 'de.hdodenhof:circleimageview:2.1.0'
    implementation 'info.hoang8f:android-segmented:1.0.6'
    implementation 'commons-io:commons-io:2.6'
    implementation 'com.commit451:PhotoView:1.2.4'
    implementation 'com.isseiaoki:simplecropview:1.0.13'
    implementation 'org.greenrobot:eventbus:3.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

    // Replace bundled strings dynamically
    implementation 'dev.b3nedikt.restring:restring:5.2.2'
    // Intercept view inflation
    implementation 'dev.b3nedikt.viewpump:viewpump:4.0.10'
    // Allows to update the text of views at runtime without recreating the activity
    implementation 'dev.b3nedikt.reword:reword:4.0.2'

    // Tink encyption
    implementation 'com.google.crypto.tink:tink-android:1.7.0'
    implementation 'com.google.protobuf:protobuf-lite:3.0.1'
    implementation 'com.scottyab:rootbeer-lib:0.1.0'

}
</code>```

Project Build Gradle

```<code>buildscript {
    ext.kotlin_version = '1.7.20'
    repositories {
        google()
        maven {
            url 'https://dl.google.com/dl/android/maven2'
        }
        gradlePluginPortal()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.3.1'
        classpath 'com.google.gms:google-services:4.3.14'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

</code>```

Android manifest 1

```<code><?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.USE_FINGERPRINT" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.WRITE_CALENDAR" />
    <uses-permission android:name="android.permission.READ_CALENDAR" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

    <uses-feature  android:name="android.hardware.camera" android:required="false" />
    <uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
    <uses-feature android:name="android.hardware.location.gps" android:required="false"/>

    <supports-screens
        android:anyDensity="true"
        android:largeScreens="true"
        android:normalScreens="true"
        android:resizeable="true"
        android:smallScreens="true"
        android:xlargeScreens="true" />

    <application
        android:name="com.test.android.testApp"
        tools:replace="icon, label"
        android:allowBackup="false"
        android:hardwareAccelerated="true"
        android:usesCleartextTraffic="${usesCleartextTraffic}"
        android:icon="@drawable/ic_launcher_v4"
        android:exported="true"
        android:roundIcon="@drawable/ic_launcher_v4_rounded"
        android:label="${appName}"
        android:largeHeap="true"
        android:theme="@style/ThemeWhite"
        android:requestLegacyExternalStorage="true">
    </application>

</manifest>
</code>```

Android manifest 2

```<code><?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.CAMERA"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.USE_FINGERPRINT" />

    <uses-feature  android:name="android.hardware.camera" android:required="false" />
    <uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
    <uses-feature android:name="android.hardware.camera.flash" android:required="false"/>
    <uses-feature android:name="android.hardware.location.gps" android:required="false"/>

    <application>
    </application>

</manifest>
</code>```

upgrading to android 11 is not working in my project. Tried changing gradle still did't worked.
Should be able to export apk for JDK 11.

Body:
When I migrated my app from JDK 1.8 to 11, I am getting apk package name as 'Android'
Gradle used: 7.5

aapt output. When i revert my changes, package name is coming as application id which is correct.

package: name='android' versionCode='8' versionName='2.2'
sdkVersion:'8'
targetSdkVersion:'8'
uses-permission: name='android.intent.category.MASTER_CLEAR.permission.C2D_MESSAGE'
application-label:'Android System'
application-label-ar:'Android System'
application-label-ar-EG:'Android System'
application-label-ar-IL:'Android System'
application-label-bg-BG:'Android System'
application-label-ca-ES:'Android System'
application-label-cs:'Systém Android'
application-label-cs-CZ:'Systém Android'
application-label-da:'Android-system'
application-label-da-DK:'Android-system'
application-label-de:'Android System'
application-label-de-AT:'Android System'
application-label-de-CH:'Android System'
application-label-de-DE:'Android System'
application-label-de-LI:'Android System'
application-label-el:'Σύστημα Android'
application-label-el-GR:'Σύστημα Android'
application-label-en:'Android System'
application-label-en-AU:'Android System'
application-label-en-CA:'Android System'
application-label-en-GB:'Android System'
application-label-en-IE:'Android System'
application-label-en-IN:'Android System'
application-label-en-NZ:'Android System'
application-label-en-SG:'Android System'
application-label-en-US:'Android System'
application-label-en-ZA:'Android System'
application-label-es:'Sistema Android'
application-label-es-ES:'Sistema Android'
application-label-es-US:'Sistema Androide'
application-label-fi:'Android System'
application-label-fi-FI:'Android System'
application-label-fr:'Système Android'
application-label-fr-BE:'Système Android'
application-label-fr-CA:'Système Android'
application-label-fr-CH:'Système Android'
application-label-fr-FR:'Système Android'
application-label-he-IL:'Android System'
application-label-hi-IN:'Android System'
application-label-hr-HR:'Android System'
application-label-hu:'Android System'
application-label-hu-HU:'Android System'
application-label-id-ID:'Android System'
application-label-it:'Sistema Android'
application-label-it-CH:'Sistema Android'
application-label-it-IT:'Sistema Android'
application-label-iw:'Android System'
application-label-ja:'Androidシステム'
application-label-ja-JP:'Androidシステム'
application-label-ko:'Android 시스템'
application-label-ko-KR:'Android 시스템'
application-label-lt-LT:'Android System'
application-label-lv-LV:'Android System'
application-label-nb:'Android-system'
application-label-nb-NO:'Android-system'
application-label-nl:'Android-systeem'
application-label-nl-BE:'Android-systeem'
application-label-nl-NL:'Android-systeem'
application-label-pl:'System Android'
application-label-pl-PL:'System Android'
application-label-pt:'Sistema Android'
application-label-pt-BR:'Sistema Android'
application-label-pt-PT:'Sistema Android'
application-label-ro-RO:'Android System'
application-label-ru:'Система Android'
application-label-ru-RU:'Система Android'
application-label-sk-SK:'Android System'
application-label-sl-SI:'Android System'
application-label-sr-RS:'Android System'
application-label-sv:'Android-system'
application-label-sv-SE:'Android-system'
application-label-th:'Android System'
application-label-th-TH:'Android System'
application-label-tl-PH:'Android System'
application-label-tr:'Android Sistemi'
application-label-tr-TR:'Android Sistemi'
application-label-uk-UA:'Android System'
application-label-vi-VN:'Android System'
application-label-zh-CN:'Android 系统'
application-label-zh-TW:'Android 系統'
application-icon-160:'res/drawable-mdpi/ic_launcher_android.png'
application-icon-65535:'res/drawable-mdpi/ic_launcher_android.png'
application: label='Android System' icon='res/drawable-mdpi/ic_launcher_android.png'
feature-group: label=''
  uses-feature: name='android.hardware.faketouch'
  uses-implied-feature: name='android.hardware.faketouch' reason='default feature for all apps'
other-activities
other-receivers
other-services
supports-screens: 'small' 'normal' 'large'
supports-any-density: 'true'
locales: '--_--' 'ar' 'ar-EG' 'ar-IL' 'bg-BG' 'ca-ES' 'cs' 'cs-CZ' 'da' 'da-DK' 'de' 'de-AT' 'de-CH' 'de-DE' 'de-LI' 'el' 'el-GR' 'en' 'en-AU' 'en-CA' 'en-GB' 'en-IE' 'en-IN' 'en-NZ' 'en-SG' 'en-US' 'en-ZA' 'es' 'es-ES' 'es-US' 'fi' 'fi-FI' 'fr' 'fr-BE' 'fr-CA' 'fr-CH' 'fr-FR' 'he-IL' 'hi-IN' 'hr-HR' 'hu' 'hu-HU' 'id-ID' 'it' 'it-CH' 'it-IT' 'iw' 'ja' 'ja-JP' 'ko' 'ko-KR' 'lt-LT' 'lv-LV' 'nb' 'nb-NO' 'nl' 'nl-BE' 'nl-NL' 'pl' 'pl-PL' 'pt' 'pt-BR' 'pt-PT' 'ro-RO' 'ru' 'ru-RU' 'sk-SK' 'sl-SI' 'sr-RS' 'sv' 'sv-SE' 'th' 'th-TH' 'tl-PH' 'tr' 'tr-TR' 'uk-UA' 'vi-VN' 'zh-CN' 'zh-TW'
densities: '160' '65535'
native-code: 'arm64-v8a' 'armeabi' 'armeabi-v7a' 'x86' 'x86_64'

app build Gradle

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.google.gms.google-services'

repositories {
    mavenCentral()
}

android {
    compileSdkVersion 33
    namespace "com.test.android"
    buildToolsVersion '30.0.3'

    dexOptions {
        javaMaxHeapSize "4g"
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE'
    }

    defaultConfig {
        multiDexEnabled true
        minSdkVersion 19
        targetSdkVersion 33
        vectorDrawables.useSupportLibrary = true
        def today = new Date()
        versionCode = versionCodeDate()

        javaCompileOptions {
            annotationProcessorOptions {
                arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
            }
        }
    }

    buildTypes {
        debug {
            debuggable true
            applicationIdSuffix = ".beta"
            ext.enableCrashlytics = false
            manifestPlaceholders = [usesCleartextTraffic:"true"]
        }
        release {
            minifyEnabled true
            shrinkResources true
            zipAlignEnabled true
            debuggable false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), "proguard-rules.pro"
            manifestPlaceholders = [usesCleartextTraffic:"false"]
        }
    }

    flavorDimensions "dim1"

    productFlavors {
        oneapp {
            applicationId "com.testinc.test"
            dimension "dim1"

        }
    }

    sourceSets {
        oneapp {
            java.srcDirs = ['src/main/java', 'src/testwork/java']
            res.srcDirs = ['src/main/res', 'src/testwork/res']
            assets.srcDirs = ['src/main/assets', 'src/testwork/assets']
            manifest.srcFile "src/testwork/AndroidManifest.xml"
        }
    }

    configurations {
        all {
            exclude module: 'httpclient'
            exclude module: 'commons-logging'
            exclude module: 'opengl-api'
            exclude module: 'xmlParserAPIs'
            exclude module: 'json'
            exclude module: 'xpp3'
        }
    }

    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }
}

def static versionCodeDate() {
    return new Date().format("yyMMddHHmm").substring(1).toInteger()
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    androidTestImplementation('androidx.test.espresso:espresso-core:3.5.0', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation('com.google.android:flexbox:0.2.5', {
        exclude group: 'com.google.android'
    })
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.path:android-priority-jobqueue:1.1.2'
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'androidx.appcompat:appcompat:1.5.1'
    implementation 'androidx.legacy:legacy-support-v13:1.0.0'
    implementation 'com.google.android.material:material:1.7.0'

    implementation 'de.mindpipe.android:android-logging-log4j:1.0.3'
    implementation 'log4j:log4j:1.2.17'
    implementation 'com.aurelhubert:ahbottomnavigation:2.0.1'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.room:room-runtime:2.4.3'
    annotationProcessor 'androidx.room:room-compiler:2.4.3'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
    annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.5.1'

    implementation 'com.google.android.gms:play-services-vision:20.1.3'
    implementation 'com.google.android.gms:play-services-location:21.0.1'
    implementation 'com.google.android.gms:play-services-safetynet:18.0.1'
    implementation 'com.google.firebase:firebase-core:21.1.1'
    implementation 'com.google.firebase:firebase-config:21.2.0'
    implementation 'com.google.firebase:firebase-messaging:23.1.0'
    implementation 'com.google.firebase:firebase-crashlytics:18.3.2'
    implementation 'com.google.firebase:firebase-analytics'

    implementation 'com.squareup.okio:okio:1.15.0'
    implementation 'com.squareup.okhttp:okhttp:2.7.5'
    implementation 'com.squareup.okhttp:okhttp-urlconnection:2.7.5'
    implementation 'com.squareup.retrofit:retrofit:1.9.0'
    implementation 'com.google.code.gson:gson:2.8.9'
    implementation 'com.commonsware.cwac:saferoom:0.4.2'
    implementation 'com.github.bumptech.glide:glide:4.8.0'
    implementation 'de.hdodenhof:circleimageview:2.1.0'
    implementation 'info.hoang8f:android-segmented:1.0.6'
    implementation 'commons-io:commons-io:2.6'
    implementation 'com.commit451:PhotoView:1.2.4'
    implementation 'com.isseiaoki:simplecropview:1.0.13'
    implementation 'org.greenrobot:eventbus:3.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

    // Replace bundled strings dynamically
    implementation 'dev.b3nedikt.restring:restring:5.2.2'
    // Intercept view inflation
    implementation 'dev.b3nedikt.viewpump:viewpump:4.0.10'
    // Allows to update the text of views at runtime without recreating the activity
    implementation 'dev.b3nedikt.reword:reword:4.0.2'

    // Tink encyption
    implementation 'com.google.crypto.tink:tink-android:1.7.0'
    implementation 'com.google.protobuf:protobuf-lite:3.0.1'
    implementation 'com.scottyab:rootbeer-lib:0.1.0'

}

Project Build Gradle

buildscript {
    ext.kotlin_version = '1.7.20'
    repositories {
        google()
        maven {
            url 'https://dl.google.com/dl/android/maven2'
        }
        gradlePluginPortal()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.3.1'
        classpath 'com.google.gms:google-services:4.3.14'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

Android manifest 1

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.USE_FINGERPRINT" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.WRITE_CALENDAR" />
    <uses-permission android:name="android.permission.READ_CALENDAR" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

    <uses-feature  android:name="android.hardware.camera" android:required="false" />
    <uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
    <uses-feature android:name="android.hardware.location.gps" android:required="false"/>

    <supports-screens
        android:anyDensity="true"
        android:largeScreens="true"
        android:normalScreens="true"
        android:resizeable="true"
        android:smallScreens="true"
        android:xlargeScreens="true" />

    <application
        android:name="com.test.android.testApp"
        tools:replace="icon, label"
        android:allowBackup="false"
        android:hardwareAccelerated="true"
        android:usesCleartextTraffic="${usesCleartextTraffic}"
        android:icon="@drawable/ic_launcher_v4"
        android:exported="true"
        android:roundIcon="@drawable/ic_launcher_v4_rounded"
        android:label="${appName}"
        android:largeHeap="true"
        android:theme="@style/ThemeWhite"
        android:requestLegacyExternalStorage="true">
    </application>

</manifest>

Android manifest 2

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.CAMERA"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.USE_FINGERPRINT" />

    <uses-feature  android:name="android.hardware.camera" android:required="false" />
    <uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
    <uses-feature android:name="android.hardware.camera.flash" android:required="false"/>
    <uses-feature android:name="android.hardware.location.gps" android:required="false"/>

    <application>
    </application>

</manifest>

upgrading to android 11 is not working in my project. Tried changing gradle still did't worked.
Should be able to export apk for JDK 11.


问:
How can i get access to the Contacts API?
I am a developer tasked with an investigation about the LinkedIn APIs. More specifically, I need to be able to get information on a user's connections and I think that the Contacts API would be a good match, since it retrieves a logged-in user's connections and I currently have no means to access the Connections API. The problem is I do not know how to get access to it, as it is not clear enough in the documentation I have read thus far.

I have checked the API documentation and several posts in Stack Overflow about the topic, but I have not been able to find the answer I have been looking for. I have also read through other resources, such as the API Terms of Use and many other forum posts, but with the same result.

On the API documentation, all it says is that "The use of this API is restricted to those developers approved by LinkedIn and subject to applicable data restrictions in their agreements.", however I do not understand where I should apply for approval, as the Contacts API does not seem to be under any of the options I can apply to. Is it possible to apply for it at all?

Thanks in advance


问:
Spring boot only matches "/" when using custom filter
I have a spring boot service that behaves not as expected. I wrote a custom auth filter and if I include it in my security config, it breaks the URI.

Its a very basic filter that doesn't do much, except reading the basic token and compares it to the stored token (restProperties)

```<code>public class BasicFilter extends AbstractAuthenticationProcessingFilter {
    private static final Logger log = LoggerFactory.getLogger(BasicFilter.class);
    private static String BASIC_PREFIX = "Basic ";
    private final RestProperties restProperties;
    private final String API_USER = "api_user";

    public BasicFilter(RequestMatcher requiresAuthenticationRequestMatcher, AuthenticationManager authenticationManager, RestProperties restProperties) {
        super(requiresAuthenticationRequestMatcher, authenticationManager);
        this.restProperties = restProperties;
    }

    public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException {
        String authorization = request.getHeader("Authorization");
        if (authorization == null) {
            log.warn("basic token not present");
            throw new AuthenticationCredentialsNotFoundException("");
        } else if (!authorization.startsWith(BASIC_PREFIX)) {
            log.error("Basic token malformed" + authorization);
            throw new BadCredentialsException("");
        } else if (!this.restProperties.getAuthorization().equals(authorization)) {
            log.error("basic token does not equal the properties basic token");
            throw new BadCredentialsException("");
        } else {
            log.info("user authenticated via basic authentication");
            return new PreAuthenticatedAuthenticationToken("api_user", (Object)null, Collections.singletonList(new SimpleGrantedAuthority(Role.API_INTERN.getRole())));
        }
    }
}
</code>```

My security config looks like that:

```<code>@Configuration
@EnableWebSecurity
@Slf4j
public class SecurityConfig extends WebSecurityConfigurerAdapter {

    @Autowired
    private RestProperties restProperties;

    @Override
    protected void configure( final HttpSecurity http ) throws Exception {
        final BasicFilter basicFilter = new BasicFilter(
                RouteMatchHelper.combination( RouteMatchHelper.orRoutes( "/api/**" ), RouteMatchHelper.orRoutes( "/actuator/health" ) ),
                authenticationManager(), restProperties );
        // @formatter:off
        http.csrf().disable()
                .antMatcher( "/**" )
                .addFilterBefore( basicFilter, AnonymousAuthenticationFilter.class )
                .addFilterBefore( new StatelessCSRFFilter(), BasicFilter.class )
                .securityContext()
                .securityContextRepository( new NullSecurityContextRepository() ).and().sessionManagement()
                .sessionCreationPolicy( SessionCreationPolicy.STATELESS ).and()
                .authorizeRequests()
                .antMatchers( "/actuator/health" ).access("permitAll")
                .antMatchers( "/api/**" ).access("permitAll")
                .antMatchers( "/**" ).access( "denyAll" ).and().cors();
        // @formatter:on
    }

}

</code>```

Now when I call the route /api/user/login it will fail with a 404. But the controller exists.

```<code>@RestController
@RequestMapping( "/api/user/login" )
@RequiredArgsConstructor( onConstructor = @__( @Autowired ) )
public class AuthController {

    private final AuthService authService;

    @GetMapping
    public User authenticate( @RequestParam String username, @RequestParam String password ) {
        return authService.authenticate( username, password );
    }

}
</code>```

I'm also using an AccessLoggingInterceptor. The interceptor reads the HttpServletRequest URI and logs it. It only logs /. (I've compressed the RequestLogger for readability).

```<code>package de.moovin.interceptor;

@Slf4j
public class RequestLoggingInterceptor extends HandlerInterceptorAdapter {

    @Override
    public void postHandle( final HttpServletRequest request, final HttpServletResponse response, final Object handler,
            final ModelAndView modelAndView ) throws Exception {

    }

    @Override
    public void afterCompletion( final HttpServletRequest request, final HttpServletResponse response, final Object handler,
            final Exception ex ) throws Exception {
        final long startTime = ( Long ) request.getAttribute( "startTime" );
        long runTime = System.currentTimeMillis() - startTime;
        StringBuilder builder = new StringBuilder( 350 );
        builder.append( "Path::" );
        builder.append( extractPath( request ) );
        builder.append( " - Method::" );
        builder.append( request.getMethod() );
        builder.append( " - Status::" );
        builder.append( response.getStatus() );
        builder.append( printErrorCodeIfNeeded( response ) );
        builder.append( " - User::" );
        builder.append( getClientId() );
        builder.append( " - Time::" );
        builder.append( runTime );
        builder.append( " - DONE" );
        log.info( builder.toString() );
        if ( ex != null ) {
            log.error( "Error by Exception ", ex );
        }
    }

    private String extractPath( final HttpServletRequest request ) {
        final String path = request.getRequestURI().toString();
        return path.substring( path.indexOf( "/", 1 ) );
    }

}

</code>```
```<code>public class RouteMatchHelper {

    private RouteMatchHelper() {

    }

    /**
     * Avoid manual Build of Routes
     *
     * @param routes routes that should be or'd
     *
     * @return Requestmatcher that or's all routes
     */
    public static RequestMatcher orRoutes( String... routes ) {
        List<RequestMatcher> paths = Arrays.stream( routes ).map( AntPathRequestMatcher::new ).collect( Collectors.toList() );
        return new OrRequestMatcher( paths );
    }

    public static RequestMatcher combination( RequestMatcher allowedRoutes, RequestMatcher disallowedRoutes ) {
        return new AndRequestMatcher( Arrays.asList( allowedRoutes, new NegatedRequestMatcher( disallowedRoutes ) ) );
    }

}
</code>```

Body:
I have a spring boot service that behaves not as expected. I wrote a custom auth filter and if I include it in my security config, it breaks the URI.

Its a very basic filter that doesn't do much, except reading the basic token and compares it to the stored token (restProperties)

public class BasicFilter extends AbstractAuthenticationProcessingFilter {
    private static final Logger log = LoggerFactory.getLogger(BasicFilter.class);
    private static String BASIC_PREFIX = "Basic ";
    private final RestProperties restProperties;
    private final String API_USER = "api_user";

    public BasicFilter(RequestMatcher requiresAuthenticationRequestMatcher, AuthenticationManager authenticationManager, RestProperties restProperties) {
        super(requiresAuthenticationRequestMatcher, authenticationManager);
        this.restProperties = restProperties;
    }

    public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException {
        String authorization = request.getHeader("Authorization");
        if (authorization == null) {
            log.warn("basic token not present");
            throw new AuthenticationCredentialsNotFoundException("");
        } else if (!authorization.startsWith(BASIC_PREFIX)) {
            log.error("Basic token malformed" + authorization);
            throw new BadCredentialsException("");
        } else if (!this.restProperties.getAuthorization().equals(authorization)) {
            log.error("basic token does not equal the properties basic token");
            throw new BadCredentialsException("");
        } else {
            log.info("user authenticated via basic authentication");
            return new PreAuthenticatedAuthenticationToken("api_user", (Object)null, Collections.singletonList(new SimpleGrantedAuthority(Role.API_INTERN.getRole())));
        }
    }
}

My security config looks like that:

@Configuration
@EnableWebSecurity
@Slf4j
public class SecurityConfig extends WebSecurityConfigurerAdapter {

    @Autowired
    private RestProperties restProperties;

    @Override
    protected void configure( final HttpSecurity http ) throws Exception {
        final BasicFilter basicFilter = new BasicFilter(
                RouteMatchHelper.combination( RouteMatchHelper.orRoutes( "/api/**" ), RouteMatchHelper.orRoutes( "/actuator/health" ) ),
                authenticationManager(), restProperties );
        // @formatter:off
        http.csrf().disable()
                .antMatcher( "/**" )
                .addFilterBefore( basicFilter, AnonymousAuthenticationFilter.class )
                .addFilterBefore( new StatelessCSRFFilter(), BasicFilter.class )
                .securityContext()
                .securityContextRepository( new NullSecurityContextRepository() ).and().sessionManagement()
                .sessionCreationPolicy( SessionCreationPolicy.STATELESS ).and()
                .authorizeRequests()
                .antMatchers( "/actuator/health" ).access("permitAll")
                .antMatchers( "/api/**" ).access("permitAll")
                .antMatchers( "/**" ).access( "denyAll" ).and().cors();
        // @formatter:on
    }

}

Now when I call the route /api/user/login it will fail with a 404. But the controller exists.

@RestController
@RequestMapping( "/api/user/login" )
@RequiredArgsConstructor( onConstructor = @__( @Autowired ) )
public class AuthController {

    private final AuthService authService;

    @GetMapping
    public User authenticate( @RequestParam String username, @RequestParam String password ) {
        return authService.authenticate( username, password );
    }

}

I'm also using an AccessLoggingInterceptor. The interceptor reads the HttpServletRequest URI and logs it. It only logs /. (I've compressed the RequestLogger for readability).

package de.moovin.interceptor;

@Slf4j
public class RequestLoggingInterceptor extends HandlerInterceptorAdapter {

    @Override
    public void postHandle( final HttpServletRequest request, final HttpServletResponse response, final Object handler,
            final ModelAndView modelAndView ) throws Exception {

    }

    @Override
    public void afterCompletion( final HttpServletRequest request, final HttpServletResponse response, final Object handler,
            final Exception ex ) throws Exception {
        final long startTime = ( Long ) request.getAttribute( "startTime" );
        long runTime = System.currentTimeMillis() - startTime;
        StringBuilder builder = new StringBuilder( 350 );
        builder.append( "Path::" );
        builder.append( extractPath( request ) );
        builder.append( " - Method::" );
        builder.append( request.getMethod() );
        builder.append( " - Status::" );
        builder.append( response.getStatus() );
        builder.append( printErrorCodeIfNeeded( response ) );
        builder.append( " - User::" );
        builder.append( getClientId() );
        builder.append( " - Time::" );
        builder.append( runTime );
        builder.append( " - DONE" );
        log.info( builder.toString() );
        if ( ex != null ) {
            log.error( "Error by Exception ", ex );
        }
    }

    private String extractPath( final HttpServletRequest request ) {
        final String path = request.getRequestURI().toString();
        return path.substring( path.indexOf( "/", 1 ) );
    }

}

public class RouteMatchHelper {

    private RouteMatchHelper() {

    }

    /**
     * Avoid manual Build of Routes
     *
     * @param routes routes that should be or'd
     *
     * @return Requestmatcher that or's all routes
     */
    public static RequestMatcher orRoutes( String... routes ) {
        List<RequestMatcher> paths = Arrays.stream( routes ).map( AntPathRequestMatcher::new ).collect( Collectors.toList() );
        return new OrRequestMatcher( paths );
    }

    public static RequestMatcher combination( RequestMatcher allowedRoutes, RequestMatcher disallowedRoutes ) {
        return new AndRequestMatcher( Arrays.asList( allowedRoutes, new NegatedRequestMatcher( disallowedRoutes ) ) );
    }

}


Title: How to add a total column that sums up values from dynamic columns

Body:
I have the following DataFrame

        party  2022 - 45  2022 - 46  2022 - 48  2022 - 49  2022 - 50  2022 - 51  2022 - 52  2023 - 01  2023 - 02  2023 - 06  2023 - 10 scheduled_total  ledger_balance
0      V00011       0.00        0.0    1917.50    6894.00    5743.50    3826.00    3826.00       0.00       0.00       0.00       0.00             NaN       -37145.00
1      V00020    7327.22        0.0       0.00    5652.00    5652.00    5652.00       0.00       0.00       0.00       0.00       0.00             NaN       -45863.01
2      V00117       0.00        0.0    2265.50    3776.00       0.00       0.00       0.00       0.00       0.00       0.00       0.00             NaN        -8589.50
3      V00144   23986.55        0.0       0.00   11629.63   11629.63   11629.63   11629.63   11629.63       0.00       0.00       0.00             NaN      -276629.91
4      V00153       0.00        0.0    1794.00       0.00       0.00       0.00       0.00       0.00       0.00       0.00       0.00             NaN        -8769.00
5      V00198       0.00     2655.0    2655.00    2655.00    2655.00    2655.00       0.00       0.00       0.00       0.00       0.00             NaN       -10620.00
6      V00229   11868.53        0.0    7327.75   14837.50   14837.50   14837.50       0.00       0.00       0.00       0.00       0.00             NaN      -103789.08
7      V00235       0.00        0.0    9600.00    9600.00       0.00       0.00       0.00       0.00       0.00       0.00       0.00             NaN       -43200.00
8      V00241       0.00        0.0    5575.50    5575.50       0.00       0.00       0.00       0.00       0.00       0.00       0.00             NaN       -11151.00
9      V00261       0.00        0.0    6208.50   17201.75   11502.25    5630.50     763.50       0.00       0.00       0.00       0.00             NaN       -34131.22
10     V00319       0.00        0.0       0.00   13865.00       0.00       0.00       0.00       0.00       0.00       0.00       0.00             NaN       -27731.00
11     V00325       0.00        0.0       0.00       0.00     850.00       0.00       0.00       0.00       0.00       0.00       0.00             NaN        -3568.00
12     V00345       0.00        0.0       0.00    5000.25       0.00       0.00       0.00       0.00    5000.25    5000.25    5000.25             NaN       -20001.00
total     NaN   43182.30     2655.0   37343.75   96686.63   52869.88   44230.63   16219.13   11629.63    5000.25    5000.25    5000.25             NaN      -631187.72

The columns after party, till scheduled_total are dynamic columns created using pivot. It represents "year - week". I want to get total of each row in "scheduled_total". Any help?

Here is the code used to generate the above output:

    pr = frappe.db.get_list("Payment Request",filters={"docstatus":1,"status":"Initiated","party_type":"Supplier"},fields=["name", "transaction_date", "payment_request_type", "party", "supplier_name", "reference_name", "grand_total", "status"])
    df = pd.DataFrame.from_records(pr)
    df['transaction_date'] = pd.to_datetime(df['transaction_date'])

    df["week"] = df['transaction_date'].dt.year.astype(str) + " - " + df['transaction_date'].dt.week.map("{:02}".format).astype(str)
    df = df.groupby(["party", "week", "supplier_name"],as_index=False)["grand_total"].sum()

    df = df.sort_values(by=['week'],ascending=True)
    df = df.pivot(index=["party","supplier_name"], columns='week', values='grand_total').reset_index().rename_axis(None, axis=1).fillna(0)

    df["scheduled_total"] = df.agg("sum", axis=0)

    df["ledger_balance"] = df.apply(lambda x: get_balance_on(party_type="Supplier",party=x['party']), axis=1)
    df.loc['total'] = df.sum(numeric_only=True)

    print(df.to_string())

    df.to_excel("/home/frappe/frappe-bench/apps/zarnik/zarnik/ap_automation/report/payment_request_summary/payment_request_summary.xlsx")

    column_names = df.columns.values
    print(column_names)

I have tried the following,

df["scheduled_total"] = df.agg("sum", axis=0)

This returns NaN.


问:
GitLab CI - Restart service on remote host
I have a GitLab pipeline that deploy a site and need to restart fpm service.

    stages:
      - deploy

    Deploy:
      image: gotechnies/alpine-ssh
      stage: deploy
      before_script:
        - eval $(ssh-agent -s)
        - ssh-add <(echo "$SSH_PRIVATE_KEY")
        - mkdir -p ~/.ssh
        - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
      script:
        # other steps
        - ssh forge@$SERVER_IP -o "SendEnv=FORGE_PHP_FPM" -o "SendEnv=FORGE_SUDO_PWD" 'bash -O extglob -c "(flock -w 10 9 || exit 1\n  echo 'Restarting FPM...'; echo "$FORGE_SUDO_PWD" | sudo -S service $FORGE_PHP_FPM reload) 9>/tmp/fpmlock"'
    variables:
        FORGE_PHP_FPM: php8.1-fpm
        FORGE_SUDO_PWD: $PRODUCTION_SUDO_PWD
    only:
        - master
```
<p><code>$PRODUCTION_SUDO_PWD</code> is added on gitlab variables and marked as <em>protected</em>.<br />
My problem is with this line:</p>
<pre class="lang-bash prettyprint-override"><code>    - ssh forge@$SERVER_IP -o "SendEnv=FORGE_PHP_FPM" -o "SendEnv=FORGE_SUDO_PWD" 'bash -O extglob -c "(flock -w 10 9 || exit 1\n  echo 'Restarting FPM...'; echo "$FORGE_SUDO_PWD" | sudo -S service $FORGE_PHP_FPM reload) 9>/tmp/fpmlock"'
</code>```

I want to restart php8.1-fpm service but each time I run the pipeline I get:

```<code>[sudo] password for forge: Sorry, try again.
[sudo] password for forge:
sudo: no password was provided
sudo: 1 incorrect password attempt
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit code 1
</code>```

As far as I know the SendEnv should pass the value of the variable and if I remove the bash command and just add echo $FORGE_SUDO_PWD it print the value.

What am I missing?

Body:
I have a GitLab pipeline that deploy a site and need to restart fpm service.

    stages:
      - deploy

    Deploy:
      image: gotechnies/alpine-ssh
      stage: deploy
      before_script:
        - eval $(ssh-agent -s)
        - ssh-add <(echo "$SSH_PRIVATE_KEY")
        - mkdir -p ~/.ssh
        - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
      script:
        # other steps
        - ssh forge@$SERVER_IP -o "SendEnv=FORGE_PHP_FPM" -o "SendEnv=FORGE_SUDO_PWD" 'bash -O extglob -c "(flock -w 10 9 || exit 1\n  echo 'Restarting FPM...'; echo "$FORGE_SUDO_PWD" | sudo -S service $FORGE_PHP_FPM reload) 9>/tmp/fpmlock"'
    variables:
        FORGE_PHP_FPM: php8.1-fpm
        FORGE_SUDO_PWD: $PRODUCTION_SUDO_PWD
    only:
        - master

$PRODUCTION_SUDO_PWD is added on gitlab variables and marked as protected.

My problem is with this line:

    - ssh forge@$SERVER_IP -o "SendEnv=FORGE_PHP_FPM" -o "SendEnv=FORGE_SUDO_PWD" 'bash -O extglob -c "(flock -w 10 9 || exit 1\n  echo 'Restarting FPM...'; echo "$FORGE_SUDO_PWD" | sudo -S service $FORGE_PHP_FPM reload) 9>/tmp/fpmlock"'

I want to restart php8.1-fpm service but each time I run the pipeline I get:

[sudo] password for forge: Sorry, try again.
[sudo] password for forge:
sudo: no password was provided
sudo: 1 incorrect password attempt
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit code 1

As far as I know the SendEnv should pass the value of the variable and if I remove the bash command and just add echo $FORGE_SUDO_PWD it print the value.

What am I missing?


问:
Pdfjs cant extract language other than English properly
I'm trying to extract texts and images from some pdf files of bengali language with same structure using pdf.js. But the problem is pdf.js can't output bengali properly.
Most of the characters are shown as black square with question mark inside.
Also the signs used as vowels in bengali aren’t positioned properly.
For example [মোঃ রাজু মিয়া] outputs as [ �মাঃ রাজু িময়া]. As I'm extracting images and that part is working properly. It would be nice if i can also do the text part in pdf.js with custom font or something.

My sample code:

```<code><script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.9.359/pdf.min.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.9.359/pdf.worker.min.js"></script>

 <input type="file" id="file-pdf" accept=".pdf">

<script>

const onLoadFile = async event => {

  try {

    // turn array buffer into typed array

    const typedArray = new Uint8Array(event.target.result);

    const loadingPdfDocument = pdfjsLib.getDocument(typedArray);

    const pdfDocumentInstance = await loadingPdfDocument.promise;

    const totalNumPages = pdfDocumentInstance.numPages;

    let pn = 1

let page = await pdfDocumentInstance.getPage(pn)

let textContent = await page.getTextContent()

                var textItems = textContent.items;

console.log(textItems)

  } catch (error) {

    console.log(error);

  }

};

document.getElementById('file-pdf').addEventListener('change', event => {

  const file = event.target.files[0];

  if (file.type !== 'application/pdf') {

    alert(`File ${file.name} is not a PDF file type`);

    return;

  }

  const fileReader = new FileReader();

  fileReader.onload = onLoadFile;

  fileReader.readAsArrayBuffer(file);

});

</script>
</code>```

Body:
I'm trying to extract texts and images from some pdf files of bengali language with same structure using pdf.js. But the problem is pdf.js can't output bengali properly.
Most of the characters are shown as black square with question mark inside.
Also the signs used as vowels in bengali aren’t positioned properly.
For example [মোঃ রাজু মিয়া] outputs as [ �মাঃ রাজু িময়া]. As I'm extracting images and that part is working properly. It would be nice if i can also do the text part in pdf.js with custom font or something.

My sample code:

 <input type="file" id="file-pdf" accept=".pdf">


问:
How to get a pod_name/container_id by its ip address on the host without using kubectl?
I would like find a way to inspect the container by eth0 ip of the pod.

What I tried:

target="1.1.1.1"
for container in $(docker ps -q); do
ip=$(docker exec -it $container sh -c 'ip -4 addr show eth0' | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | xargs)
if [[ $ip = "$target" ]]
then
echo $container
fi
done
```

It works. But I wonder if there is other ways to make it without using kubectl

Body:
I would like find a way to inspect the container by eth0 ip of the pod.

What I tried:

target="1.1.1.1"
for container in $(docker ps -q); do
ip=$(docker exec -it $container sh -c 'ip -4 addr show eth0' | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | xargs)
if [[ $ip = "$target" ]]
then
echo $container
fi
done

It works. But I wonder if there is other ways to make it without using kubectl


问:
Bitbucket Build Status of Pull Request showing failed builds
after each build, I am getting the build status from Jenkins, but when I open in bitbucket Pull Request page it shows failed status in the row. How to change the setting to show the recent build status?

Same issue - Bitbucket Build Status of Pull Request showing failed builds, instead of latest build status

please help.


问:
get whole page css with styles
I want to build something like this but I have problem with building iframes.

when I pass them html via srcdoc= that also needs styling, so I am able to pass my CDN link but that is not good solution, because it fetches that link in every render new iframe.

I wanted to get all CSS classes with all style rules to pass it in  but it still looks ugly. What do I need?

HTML markup

```<code><div class="relative z-10" aria-labelledby="modal-title" role="dialog" aria-modal="true">
  <div class="fixed inset-0 bg-gray-200 opacity-75"></div>
  <div class="fixed inset-0 z-10 overflow-y-auto">
    <div class="flex items-center justify-center h-full w-full">
      <div class="bg-white p-5 px-10 rounded-[1rem] max-w-xs">
        <div class="text-center">
          <h5 class="font-bold text-xl my-2 text-gray-700">
            Exit
          </h5>
          <p class="text-sm font-normal text-gray-500">
            Click the "confirm" button to close the window without saving
          </p>
        </div>
        <div class="grid grid-cols-2 gap-2 text-center mt-3">
          <div class="col-span-1">
            <button class="w-full p-2 bg-gray-100 font-bold text-sm rounded-md text-gray-400">Cancel</button>
          </div>
          <div class="col-span-1">
            <button class="w-full p-2 bg-blue-600 font-bold text-sm rounded-md text-gray-100">Confirm</button>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
</code>```

JS Methods

Get style rules from css class

```<code>function getStyle(className) {
    var cssText = "";
    var classes = document.styleSheets[0].rules || document.styleSheets[0].cssRules;
    for (var x = 0; x < classes.length; x++) {
        if (classes[x].selectorText == className) {
            cssText += classes[x].cssText || classes[x].style.cssText;
        }
    }
    return cssText;
}
</code>```

Get All class that is used on page

```<code>[].concat(...[...document.querySelectorAll('*')].map(e=>[...e.classList])).filter((d,i,a)=>a.indexOf(d)==i).sort().map(i=> getStyle('.'+i)).join(' ');
</code>```

I have This
enter image description here

I do This
enter image description here

I get This
enter image description here

I think I need to get tag classes but that is not enough, my JS code needs some update.

Title: get whole page css with styles

Body:
I want to build something like this but I have problem with building iframes.

when I pass them html via srcdoc= that also needs styling, so I am able to pass my CDN link but that is not good solution, because it fetches that link in every render new iframe.

I wanted to get all CSS classes with all style rules to pass it in  but it still looks ugly. What do I need?

HTML markup

            Exit

            Click the "confirm" button to close the window without saving

            <button class="w-full p-2 bg-gray-100 font-bold text-sm rounded-md text-gray-400">Cancel</button>

            <button class="w-full p-2 bg-blue-600 font-bold text-sm rounded-md text-gray-100">Confirm</button>

JS Methods

Get style rules from css class

function getStyle(className) {
    var cssText = "";
    var classes = document.styleSheets[0].rules || document.styleSheets[0].cssRules;
    for (var x = 0; x < classes.length; x++) {
        if (classes[x].selectorText == className) {
            cssText += classes[x].cssText || classes[x].style.cssText;
        }
    }
    return cssText;
}

Get All class that is used on page

[].concat(...[...document.querySelectorAll('*')].map(e=>[...e.classList])).filter((d,i,a)=>a.indexOf(d)==i).sort().map(i=> getStyle('.'+i)).join(' ');

I have This
enter image description here

I do This
enter image description here

I get This
enter image description here

I think I need to get tag classes but that is not enough, my JS code needs some update.


问:
Tkinter function adding an image
I'm making a simple app that adds a watermark to an image. I wanted to display the image after the user selects which picture to work with. I made it using a function, the user selects a filepath and then tkinter adds a canvas with the picture. The problem is that the picture doesn't show up, the canvas is created but there's nothing inside it.

What's more confusing is that if I cut the part below out of the function and paste it before window.mainloop(), the picture will load correctly.

```<code>canvas = Canvas(width=230, height=230, highlightthickness=0)
preview_img = PhotoImage(file="something.png")
canvas.create_image(115, 115, image=preview_img)
canvas.grid(column=0, row=2)
</code>```

Full code:

```<code>

import PIL
from tkinter import \*
from tkinter import filedialog
import PIL.Image as Image
import PIL.ImageDraw as ImageDraw
import PIL.ImageFont as ImageFont

filepath = ""

def openFile():
    global filepath
    filepath = filedialog.askopenfilename(initialdir="%HOMEPATH%/Desktop")
    print(filepath)
    canvas = Canvas(width=230, height=230, highlightthickness=0)
    preview_img = PhotoImage(file=filepath)
    canvas.create_image(115, 115, image=preview_img)
    canvas.grid(column=0, row=2)

def add_watermark():
\# image = Image.open("Image_created_with_a_mobile_phone.png").convert("RGBA")
image = Image.open(filepath).convert("RGBA")
txt = Image.new('RGBA', image.size, (255, 255, 255, 0))

    font = ImageFont.truetype("Trajan Pro Regular.ttf", int(image.size[1] / 30))
    d = ImageDraw.Draw(txt)

    for i in range(1, int(font.size / 10)):
        for j in range(1, int(font.size / 5)):
            d.text((i * 400 - 200, j * 200 - 100), "2022", fill=(255, 255, 255, 155), font=font)

    combined = Image.alpha_composite(image, txt)

    combined.save("hello_world.png")

window = Tk()

window.title("Watermark adder")
window.config(padx=60, pady=30)
window.minsize(400,300)

button_open = Button(anchor="center", text="Open",command=openFile)
button_open.grid(column=0, row=0, sticky="NSEW")
button_add_watermark = Button(text="Add watermark",command=add_watermark)
button_add_watermark.grid(column=0, row=1, pady=(30,0))

window.grid_columnconfigure(0, weight=1)
window.grid_rowconfigure(0, weight=1)

window.mainloop()

</code>```

I checked if the filepath functionality works and it does

Title: Tkinter function adding an image

Body:
I'm making a simple app that adds a watermark to an image. I wanted to display the image after the user selects which picture to work with. I made it using a function, the user selects a filepath and then tkinter adds a canvas with the picture. The problem is that the picture doesn't show up, the canvas is created but there's nothing inside it.

What's more confusing is that if I cut the part below out of the function and paste it before window.mainloop(), the picture will load correctly.

canvas = Canvas(width=230, height=230, highlightthickness=0)
preview_img = PhotoImage(file="something.png")
canvas.create_image(115, 115, image=preview_img)
canvas.grid(column=0, row=2)

Full code:

import PIL
from tkinter import \*
from tkinter import filedialog
import PIL.Image as Image
import PIL.ImageDraw as ImageDraw
import PIL.ImageFont as ImageFont

filepath = ""

def openFile():
    global filepath
    filepath = filedialog.askopenfilename(initialdir="%HOMEPATH%/Desktop")
    print(filepath)
    canvas = Canvas(width=230, height=230, highlightthickness=0)
    preview_img = PhotoImage(file=filepath)
    canvas.create_image(115, 115, image=preview_img)
    canvas.grid(column=0, row=2)

def add_watermark():
\# image = Image.open("Image_created_with_a_mobile_phone.png").convert("RGBA")
image = Image.open(filepath).convert("RGBA")
txt = Image.new('RGBA', image.size, (255, 255, 255, 0))

    font = ImageFont.truetype("Trajan Pro Regular.ttf", int(image.size[1] / 30))
    d = ImageDraw.Draw(txt)

    for i in range(1, int(font.size / 10)):
        for j in range(1, int(font.size / 5)):
            d.text((i * 400 - 200, j * 200 - 100), "2022", fill=(255, 255, 255, 155), font=font)

    combined = Image.alpha_composite(image, txt)

    combined.save("hello_world.png")

window = Tk()

window.title("Watermark adder")
window.config(padx=60, pady=30)
window.minsize(400,300)

button_open = Button(anchor="center", text="Open",command=openFile)
button_open.grid(column=0, row=0, sticky="NSEW")
button_add_watermark = Button(text="Add watermark",command=add_watermark)
button_add_watermark.grid(column=0, row=1, pady=(30,0))

window.grid_columnconfigure(0, weight=1)
window.grid_rowconfigure(0, weight=1)

window.mainloop()

I checked if the filepath functionality works and it does


问:
How to display a recurrence meeting for all recurrence days
enter image description hereI want to display a recurrence meeting in a list using a SQL.
Table: Events
Attributes: EventId, EventName, EventStart datetime, Event End datetime, EventType

Expected Output

```<code>Event: Daily scrum
Date: 3rd Dec 2022, 10am

Event: Daily scrum
Date: 4th Dec 2022, 10am

Event: Daily scrum
Date: 5th Dec 2022, 10am

Event: Daily scrum
Date: 6th Dec 2022, 10am

Event: Daily scrum
Date: 7th Dec 2022, 10am
</code>```

can someone help me to achieve this in SQL?

Body:
enter image description hereI want to display a recurrence meeting in a list using a SQL.
Table: Events
Attributes: EventId, EventName, EventStart datetime, Event End datetime, EventType

Expected Output

Event: Daily scrum
Date: 3rd Dec 2022, 10am

Event: Daily scrum
Date: 4th Dec 2022, 10am

Event: Daily scrum
Date: 5th Dec 2022, 10am

Event: Daily scrum
Date: 6th Dec 2022, 10am

Event: Daily scrum
Date: 7th Dec 2022, 10am

can someone help me to achieve this in SQL?