问:
CMakelist Shared file(.so) linking failure
I have a requirement to link  c project (which includes prebuilt.so file) to flutter (Android).

Everything is compiling and linking OK, i.e. the project is building successfully,and it creating .so file in app data directory and also i can able to see prebuilt .so file in data directory.

But while calling generated .so file from dart getting below error

Error:

```<code>Unhandled Exception: Invalid argument(s): Failed to load dynamic library 'libproject_test.so': dlopen failed: library "../../../../../../abc/c/lib/x86_64/libfoo.so" not found:
needed by /data/app/~~E_RgTYnWY_n0rO3CPrDIcQ==/com.example.c_test-QMxh40AMbU33cxiYyUxgQQ==/lib/x86_64/libproject_test.so in namespace classloader-namespace
</code>```

below is the my CMakeLists.txt

```<code>add_library( project_test
        # Sets the library as a shared library.
        SHARED
        # Provides a relative path to your source file(s).
        ${ALL_FILES} )

add_library(libfoo SHARED IMPORTED)
set_target_properties(libfooPROPERTIES
        IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../../abc/c/lib/${ANDROID_ABI}/libfoo.so"
        )

target_link_libraries(project_test
       libfoo
)
</code>```

Body:
I have a requirement to link  c project (which includes prebuilt.so file) to flutter (Android).

Everything is compiling and linking OK, i.e. the project is building successfully,and it creating .so file in app data directory and also i can able to see prebuilt .so file in data directory.

But while calling generated .so file from dart getting below error

Error:

Unhandled Exception: Invalid argument(s): Failed to load dynamic library 'libproject_test.so': dlopen failed: library "../../../../../../abc/c/lib/x86_64/libfoo.so" not found:
needed by /data/app/~~E_RgTYnWY_n0rO3CPrDIcQ==/com.example.c_test-QMxh40AMbU33cxiYyUxgQQ==/lib/x86_64/libproject_test.so in namespace classloader-namespace

below is the my CMakeLists.txt

add_library( project_test
        # Sets the library as a shared library.
        SHARED
        # Provides a relative path to your source file(s).
        ${ALL_FILES} )

add_library(libfoo SHARED IMPORTED)
set_target_properties(libfooPROPERTIES
        IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../../abc/c/lib/${ANDROID_ABI}/libfoo.so"
        )

target_link_libraries(project_test
       libfoo
)


来源: stackexchange

问:
Apache Camel 3.8.0 Not Reading Files From XML-DSL Routes
I just have written one application using Java 11 (open-jdk 11.0.2), Spring framework 5.3.23, And Apache Camel 3.8.0; which is supposed to read an incoming file and do process it.
For this I have written XML-DSL which defines the routes in it. I'm sharing part of it. The problem is the camel is not reading the file at all and no camelLock file is being created on incoming file. Can anyone help me in this issue to resolve this ?

XML-DSL : actionRoutes.xml -`

```<code><beans  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
   http://camel.apache.org/schema/spring https://camel.apache.org/schema/spring/camel-spring-3.8.0.xsd">

<!-- Only the routeContext is here -->
<routeContext id="actionRoutes" xmlns="http://camel.apache.org/schema/spring">

    <!-- INWARD/OUTWARD RETURN route defined - Set 01 -->
    <route id="route14">
        <from uri="file:E:\\ICICI\\reports?delete=true&filter=#checkBankStatus" />
        <log message="INWARD / OUTWARD RETURN PROCESS : [${body}]" />

        <doTry>
            <process ref="inwardProcessorICI" />
            <doCatch>
                <!-- catch multiple exceptions -->
                <exception>java.io.IOException</exception>
                <exception>java.lang.IllegalStateException</exception>
                <exception>java.lang.Exception</exception>
            </doCatch>
        </doTry>
    </route>
</code>```

`

The pom.xml has enlisted the required dependencies for Spring framework 5.3.23 and Apache camel 3.8.0 -

```<code><!-- https://mvnrepository.com/artifact/org.apache.camel/camel-core -->
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-core</artifactId>
        <version>3.8.0</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.apache.camel/camel-core-osgi -->
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-core-osgi</artifactId>
        <version>3.1.0</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.apache.camel/camel-ftp -->
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-ftp</artifactId>
        <version>3.8.0</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.apache.camel/camel-http -->
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-http</artifactId>
        <version>3.8.0</version>
        <scope>test</scope>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.apache.camel/camel-jpa -->
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-jpa</artifactId>
        <version>3.8.0</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.apache.camel/camel-servlet -->
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-servlet</artifactId>
        <version>3.8.0</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.apache.camel/camel-spring -->
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-spring</artifactId>
        <version>3.8.0</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.apache.camel/camel-spring-integration -->
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-spring-integration</artifactId>
        <version>3.8.0</version>
    </dependency>
</code>```

Thanks in advance.

Jayanta Pramanik

ContentLicense: CC BY-SA 4.0

Body:
I just have written one application using Java 11 (open-jdk 11.0.2), Spring framework 5.3.23, And Apache Camel 3.8.0; which is supposed to read an incoming file and do process it.
For this I have written XML-DSL which defines the routes in it. I'm sharing part of it. The problem is the camel is not reading the file at all and no camelLock file is being created on incoming file. Can anyone help me in this issue to resolve this ?

XML-DSL : actionRoutes.xml -`

<beans  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
   http://camel.apache.org/schema/spring https://camel.apache.org/schema/spring/camel-spring-3.8.0.xsd">

<routeContext id="actionRoutes" xmlns="http://camel.apache.org/schema/spring">

    <route id="route14">
        <from uri="file:E:\\ICICI\\reports?delete=true&filter=#checkBankStatus" />
        <log message="INWARD / OUTWARD RETURN PROCESS : [${body}]" />

        <doTry>
            <process ref="inwardProcessorICI" />
            <doCatch>

                <exception>java.io.IOException</exception>
                <exception>java.lang.IllegalStateException</exception>
                <exception>java.lang.Exception</exception>
            </doCatch>
        </doTry>
    </route>

`

The pom.xml has enlisted the required dependencies for Spring framework 5.3.23 and Apache camel 3.8.0 -

    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-core</artifactId>
        <version>3.8.0</version>
    </dependency>

    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-core-osgi</artifactId>
        <version>3.1.0</version>
    </dependency>

    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-ftp</artifactId>
        <version>3.8.0</version>
    </dependency>

    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-http</artifactId>
        <version>3.8.0</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-jpa</artifactId>
        <version>3.8.0</version>
    </dependency>

    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-servlet</artifactId>
        <version>3.8.0</version>
    </dependency>

    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-spring</artifactId>
        <version>3.8.0</version>
    </dependency>

    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-spring-integration</artifactId>
        <version>3.8.0</version>
    </dependency>

Thanks in advance.

Jayanta Pramanik


问:
How to create Contact record using existing Account record id I have tried but the code is not working properly?
I want to create contact record using existing account Id in Aura lightning table ? and I want save a row separately in on submit button it perform bulk insert ?

the component look like this

Component Code:-

```<code> <aura:component controller="AddDelRowDynamic"
  implements="force:appHostable,flexipage:availableForAllPageTypes,
  flexipage:availableForRecordHome,
  force:hasRecordId,forceCommunity:availableFo
  rAllPageTypes,force:lightningQuickAction" access="global" >

 <!--Aura Attribute Start-->
  <aura:attribute name="contactList" type="Contact[]"/>
  <aura:attribute name="showTableFlag" type="boolean"
  default="false"></aura:attribute>
  <aura:attribute name="account" type="Account"/>
  <aura:attribute name="recordId" type="Id"/>
   <!--Aura Attribute End-->
  <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

     <lightning:card>
     <div class="slds-m-around--xx-large">
      <h1 class="slds-page-header__title">Add Row
        <lightning:buttonIcon
                              iconName="utility:add"
                              size="large"
                              variant="bare"
                              alternativeText="Add"
                              onclick="{!c.addRowController}"/>
    </h1>

    <!--Table Start-->
    <aura:if isTrue="{!v.showTableFlag}">
        <div class="container-fluid">
            <table class="slds-table slds-table_bordered slds-table_cell-buffer">
                <thead>
                    <tr class="slds-text-title_caps">
                        <th scope="col">
                            <div class="slds-truncate">Sr. No</div>
                        </th>
                        <th scope="col">
                            <div class="slds-truncate" title="First Name">First Name</div>
                        </th>
                        <th scope="col">
                            <div class="slds-truncate" title="Last Name">Last Name</div>
                        </th>
                        <th scope="col">
                            <div class="slds-truncate" title="Account Name">Account Name</div>
                        </th>
                        <th scope="col">
                            <div class="slds-truncate" title="Action">Action</div>
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <aura:iteration items="{!v.contactList}" var="objCon" indexVar="index">
                        <tr>
                            <td>
                                {!index + 1}
                            </td>
                            <td>
                                <lightning:input name="FirstName" type="text" maxlength="50" value="{!objCon.FirstName}" />
                            </td>
                            <td>
                                <lightning:input name="LastName" required="true" type="text" maxlength="50" value="{!objCon.LastName}" />
                            </td>
                            <td>
                                <lightning:input name="Account Name"  label="Account Name" value="{!v.account.Name}" disabled="true"/>

                            </td>
                            <td>
                                <a onclick="{!c.deleteRecordController}" data-record="{!index}">
                                    <lightning:icon
                                                    iconName="utility:delete"
                                                    size="small"
                                                    alternativeText="Delete"/>
                                    <span class="slds-assistive-text">Delete</span>
                                </a>
                            </td>
                        </tr>
                    </aura:iteration>
                </tbody>
            </table>
            <div class="slds-align_absolute-center slds-p-top_small">
                <lightning:button
                                  variant="brand"
                                  label="Submit"
                                  title="Brand action"
                                  onclick="{!c.saveContactsController}" />
            </div>
        </div>
    </aura:if>
    <!--Table End-->

    </div>
   </lightning:card>
   </aura:component>
</code>```

Controller Code:-

```<code> ({
   addRowController : function(component, event, helper) {
   //get the contact List from component
   var contactList = component.get("v.contactList");
   //Add New Contact Record
   contactList.push({
     'sobjectType': 'Contact',
     'Name': '',
    'Phone': '',
    'Fax': '',
    'Website ': '',

   });
  component.set("v.contactList", contactList);
  component.set("v.showTableFlag", true);
  },

 deleteRecordController : function(component, event, helper) {
  //Get the contact list
  var contactList = component.get("v.contactList");
  //Get the target object
  var selectedItem = event.currentTarget;
  //Get the selected item index
  var index = selectedItem.dataset.record;
  //Remove single record from contact list
  contactList.splice(index, 1);
  //Set modified contact list
  component.set("v.contactList", contactList);
  },
  doInit : function(component, event, helper){

  var accid = component.get("v.recordId");
  component.set("v.contact.AccountId",component.get("v.recordId"));
  var action = component.get('c.getAccount');
  action.setParams({
    acid : component.get("v.recordId")
  });
  action.setCallback(this, function(response){
    if (response.getState() === "SUCCESS"){
        console.log('Received
    Data'+JSON.stringify(response.getReturnValue()));
         component.set("v.account",response.getReturnValue());
     }else{
        console.log('Something went wrong');
       }
     });
   $A.enqueueAction(action);

  },
  saveContactsController : function(component, event, helper) {
  if (helper.validateContactRecords(component, event)) {
    //Call Apex method and pass contact list as a parameters
    var action = component.get("c.insertCon");
    action.setParams({"newcon": component.get("v.contactList")});
    action.setCallback(this, function(response) {
        //get response status
        var state = response.getState();
        alert(state);
        if (state === "SUCCESS") {
            alert('y')
            var contactid=response.getReturnValue().Id;
            alert("contact created.Id:"+contactid)
            var navEvt = $A.get("e.force:navigateToSObject");
            navEvt.setParams({
                "recordId": contactid,
                "slideDevName": "related"
            });
            navEvt.fire();
            component.set("v.contactList", []);
            alert('Contacts saved successfully');
            component.set("v.showTableFlag", true);
            }
        });
        $A.enqueueAction(action);
      }
   }
 })
</code>```

Helper Code:-

```<code>   ({
    validateContactRecords: function(component, event) {
    //Validate all contact records
    var isValid = true;
    var contactList = component.get("v.contactList");
   for (var i = 0; i < contactList.length; i++) {
    if (contactList[i].LastName == '') {
        isValid = false;
        alert('Contact LastName cannot be blank on '+(i + 1)+'
      row number');
      }
   }
   return isValid;
   },
 })
</code>```

Apec Class:-

```<code>  public class AddDelRowDynamic {

  @AuraEnabled
  public static void saveAccountList(List<Account> accList){
  insert accList;
 }
 @AuraEnabled
public static contact insertCon(Contact newcon)
{
  insert newcon;
  return newcon;
 }
 @AuraEnabled
 public static Account getAccount(string acid)
{
Account acc = [select id,name from Account where Id =:acid];
return acc;
 }
 }
</code>```

I want to create contact record using existing account Id in Aura lightning table ? and I want save a row separately in on submit button it perform bulk insert ?

Body:
I want to create contact record using existing account Id in Aura lightning table ? and I want save a row separately in on submit button it perform bulk insert ?

the component look like this

Component Code:-

 <aura:component controller="AddDelRowDynamic"
  implements="force:appHostable,flexipage:availableForAllPageTypes,
  flexipage:availableForRecordHome,
  force:hasRecordId,forceCommunity:availableFo
  rAllPageTypes,force:lightningQuickAction" access="global" >

  <aura:attribute name="contactList" type="Contact[]"/>
  <aura:attribute name="showTableFlag" type="boolean"
  default="false"></aura:attribute>
  <aura:attribute name="account" type="Account"/>
  <aura:attribute name="recordId" type="Id"/>

  <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

     <lightning:card>

Add Row
        <lightning:buttonIcon
                              iconName="utility:add"
                              size="large"
                              variant="bare"
                              alternativeText="Add"
                              onclick="{!c.addRowController}"/>

    <aura:if isTrue="{!v.showTableFlag}">

Sr. No

First Name

Last Name

Account Name

Action

                    <aura:iteration items="{!v.contactList}" var="objCon" indexVar="index">

                                {!index + 1}

                                <lightning:input name="FirstName" type="text" maxlength="50" value="{!objCon.FirstName}" />

                                <lightning:input name="LastName" required="true" type="text" maxlength="50" value="{!objCon.LastName}" />

                                <lightning:input name="Account Name"  label="Account Name" value="{!v.account.Name}" disabled="true"/>

                                    <lightning:icon
                                                    iconName="utility:delete"
                                                    size="small"
                                                    alternativeText="Delete"/>
                                    Delete

                    </aura:iteration>

                <lightning:button
                                  variant="brand"
                                  label="Submit"
                                  title="Brand action"
                                  onclick="{!c.saveContactsController}" />

    </aura:if>

   </lightning:card>
   </aura:component>

Controller Code:-

 ({
   addRowController : function(component, event, helper) {
   //get the contact List from component
   var contactList = component.get("v.contactList");
   //Add New Contact Record
   contactList.push({
     'sobjectType': 'Contact',
     'Name': '',
    'Phone': '',
    'Fax': '',
    'Website ': '',

   });
  component.set("v.contactList", contactList);
  component.set("v.showTableFlag", true);
  },

 deleteRecordController : function(component, event, helper) {
  //Get the contact list
  var contactList = component.get("v.contactList");
  //Get the target object
  var selectedItem = event.currentTarget;
  //Get the selected item index
  var index = selectedItem.dataset.record;
  //Remove single record from contact list
  contactList.splice(index, 1);
  //Set modified contact list
  component.set("v.contactList", contactList);
  },
  doInit : function(component, event, helper){

  var accid = component.get("v.recordId");
  component.set("v.contact.AccountId",component.get("v.recordId"));
  var action = component.get('c.getAccount');
  action.setParams({
    acid : component.get("v.recordId")
  });
  action.setCallback(this, function(response){
    if (response.getState() === "SUCCESS"){
        console.log('Received
    Data'+JSON.stringify(response.getReturnValue()));
         component.set("v.account",response.getReturnValue());
     }else{
        console.log('Something went wrong');
       }
     });
   $A.enqueueAction(action);

  },
  saveContactsController : function(component, event, helper) {
  if (helper.validateContactRecords(component, event)) {
    //Call Apex method and pass contact list as a parameters
    var action = component.get("c.insertCon");
    action.setParams({"newcon": component.get("v.contactList")});
    action.setCallback(this, function(response) {
        //get response status
        var state = response.getState();
        alert(state);
        if (state === "SUCCESS") {
            alert('y')
            var contactid=response.getReturnValue().Id;
            alert("contact created.Id:"+contactid)
            var navEvt = $A.get("e.force:navigateToSObject");
            navEvt.setParams({
                "recordId": contactid,
                "slideDevName": "related"
            });
            navEvt.fire();
            component.set("v.contactList", []);
            alert('Contacts saved successfully');
            component.set("v.showTableFlag", true);
            }
        });
        $A.enqueueAction(action);
      }
   }
 })

Helper Code:-

   ({
    validateContactRecords: function(component, event) {
    //Validate all contact records
    var isValid = true;
    var contactList = component.get("v.contactList");
   for (var i = 0; i < contactList.length; i++) {
    if (contactList[i].LastName == '') {
        isValid = false;
        alert('Contact LastName cannot be blank on '+(i + 1)+'
      row number');
      }
   }
   return isValid;
   },
 })

Apec Class:-

  public class AddDelRowDynamic {

  @AuraEnabled
  public static void saveAccountList(List<Account> accList){
  insert accList;
 }
 @AuraEnabled
public static contact insertCon(Contact newcon)
{
  insert newcon;
  return newcon;
 }
 @AuraEnabled
 public static Account getAccount(string acid)
{
Account acc = [select id,name from Account where Id =:acid];
return acc;
 }
 }

I want to create contact record using existing account Id in Aura lightning table ? and I want save a row separately in on submit button it perform bulk insert ?


问:
Can I use setContent from compose in all activities
I faced with problem when i can use setContent in second Activity

```<code>@Composable
fun BuildContent() {
    val context = LocalContext.current

Button(onClick = {
                val intent = Intent(context, CheatActivity::class.java)
                context.startActivity(intent)
            }) {
                Text(text = "Cheat!")
            }
</code>```

SecondActivity

```<code>class CheatActivity : AppCompatActivity() {
    private var answerIsTrue = false
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
            setContent { /*TODO */ }
    }
}
</code>```

Body:
I faced with problem when i can use setContent in second Activity

@Composable
fun BuildContent() {
    val context = LocalContext.current

Button(onClick = {
                val intent = Intent(context, CheatActivity::class.java)
                context.startActivity(intent)
            }) {
                Text(text = "Cheat!")
            }

SecondActivity

class CheatActivity : AppCompatActivity() {
    private var answerIsTrue = false
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
            setContent { /*TODO */ }
    }
}


问:
Download multiple files from FTP server with VBA/Macros in Excel
trying to download multiple files from a FTP server. Currently I can download one file from the FTP server but I struggle to modify the code to my needs.

I have the following code:

```<code> Option Explicit

 Private Declare PtrSafe Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, _
 ByVal szURL As String, _
 ByVal szFileName As String, _
 ByVal dwReserved As Long, _
 ByVal lpfnCB As Long) As Long

 Private Declare PtrSafe Function DoFileDownload Lib "shdocvw.dll" (ByVal lpszFile As String) As Long

 Public Sub test1a() 'ohne Dialog

 Call URLDownloadToFile(0, "ftp://UserName:Passwort@ftp.abc.de/Week_202251/1_REPORT.ABC_20.12.22.07.32_202251.csv", _
 "C:/Users/xyz/Downloads/1_REPORT.ABC_20.12.22.07.32_202251.csv", 0, 0)

 End Sub
</code>```

The issue, I am facing is that the filename changes every week since it has a timestamp. The filename structure is:

1_REPORT.ABC_TimeStamp

2_REPORT.ABC_TimeStamp

3_REPORT.ABC_TimeStamp

4_REPORT.ABC_TimeStamp

5_REPORT.ABC_TimeStamp

Also, the folder where the files are located changes on a weekly basis: Week_202250, Week_202251, and so on. How can I change the code to get all five files with from the changing folder name?

I already tried to use:

```<code>Call URLDownloadToFile(0, "ftp://UserName:Passwort@ftp.abc.de/Week_202251/1_REPORT.ABC*.csv", .........
</code>```

This did not work.

I am looking for a solution where the folder name is calculated by the current week number and the macro downloads all files from this folder.

Thanks for your help!

Body:
trying to download multiple files from a FTP server. Currently I can download one file from the FTP server but I struggle to modify the code to my needs.

I have the following code:

 Option Explicit

 Private Declare PtrSafe Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, _
 ByVal szURL As String, _
 ByVal szFileName As String, _
 ByVal dwReserved As Long, _
 ByVal lpfnCB As Long) As Long

 Private Declare PtrSafe Function DoFileDownload Lib "shdocvw.dll" (ByVal lpszFile As String) As Long

 Public Sub test1a() 'ohne Dialog

 Call URLDownloadToFile(0, "ftp://UserName:Passwort@ftp.abc.de/Week_202251/1_REPORT.ABC_20.12.22.07.32_202251.csv", _
 "C:/Users/xyz/Downloads/1_REPORT.ABC_20.12.22.07.32_202251.csv", 0, 0)

 End Sub

The issue, I am facing is that the filename changes every week since it has a timestamp. The filename structure is:

1_REPORT.ABC_TimeStamp

2_REPORT.ABC_TimeStamp

3_REPORT.ABC_TimeStamp

4_REPORT.ABC_TimeStamp

5_REPORT.ABC_TimeStamp

Also, the folder where the files are located changes on a weekly basis: Week_202250, Week_202251, and so on. How can I change the code to get all five files with from the changing folder name?

I already tried to use:

Call URLDownloadToFile(0, "ftp://UserName:Passwort@ftp.abc.de/Week_202251/1_REPORT.ABC*.csv", .........

This did not work.

I am looking for a solution where the folder name is calculated by the current week number and the macro downloads all files from this folder.

Thanks for your help!


问:
how to attach "fetchpriority" html attribute to images that are included using css?
I have some images that are being defined under css files.
I'm trying to implement "fetchpriority" tag attribute in html to load images faster.
Is there a way that allows to include fetchpriority to those images in css files without mentioning their respective paths in html using  tags.

css:

```<code>.someCls{
        background-image : url("/path/to/image");
       }
</code>```

I dont want to include image with fetchpriority like this:

```<code><link rel="preload" fetchpriority="high" as="image" href="path/to/image">
</code>```

Body:
I have some images that are being defined under css files.
I'm trying to implement "fetchpriority" tag attribute in html to load images faster.
Is there a way that allows to include fetchpriority to those images in css files without mentioning their respective paths in html using  tags.

css:

.someCls{
        background-image : url("/path/to/image");
       }

I dont want to include image with fetchpriority like this:

<link rel="preload" fetchpriority="high" as="image" href="path/to/image">


问:
How can I update primeNg version in my Project?
I want to update my project from primNg 9 to the latest version. I used the primeNg theme designer for my various themes. I already found the migration guide but there were many classes changed/deleted. When I try to adapt the new class names to my project, there are more than 1000000 changes and I have no overview anymore. Also, what can I do to replace the deleted classes?

Is there any way besides manually adjusting each change?

looking forward for answers. Kind regards.


问:
getting error for .py script for quora bookmarks downloader
I am trying to execute a python script made by noahluddy from github in 2019 for downloading quora bookmarked answers .OP link - https://github.com/abhishekjshukla/Quora-Bookmark-Downloader/commit/76b4179b9b3600fd47855b4574624a6345c104e8
here is the file :

```<code>import getopt
import http
import importlib
import os
import sys
import time

import pdfkit
import urllib

from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException
from termcolor import colored
from urllib.request import urlopen
</code>```
```<code># Constants.
QUORA_BOOKMARKS_URL = 'https://www.quora.com/bookmarks'
LOGIN_PAGE_WAIT_TIME = 10
BOOMARKS_LOAD_WAIT_TIME = 15
ANSWERS_DIRECTORY = 'answers'
FAILED_FILE = os.getcwd() + '/failed.txt'
OMISSION_STRING = '...'
MAX_FILENAME_LEN = 255 - len('.pdf')

auto_login = False

def usage():
    print(
        colored('Usage: python quorab.py [--auto-login <credentials_file>]', 'yellow'))

try:
    opts, args = getopt.getopt(sys.argv[1:], 'h', ['auto-login='])
except getopt.GetoptError as opt_err:
    print(colored(opt_err, 'red'))
    usage()
    sys.exit(1)
for opt, arg in opts:
    if opt == '-h':
        usage()
        sys.exit()
    elif opt == '--auto-login':
        try:
            credentials_module_name = arg
            # With this, users can pass both .py files and just the name of the module.
            # Useful for auto-complete in bash prompt.
            if credentials_module_name.endswith('.py'):
                credentials_module_name = credentials_module_name.replace(
                    '.py', '')
            credentials = importlib.import_module(credentials_module_name)
            try:
                email = credentials.email
                password = credentials.password
                auto_login = True
            except AttributeError as attr_err:
                print(colored(attr_err, 'red'))
                print(
                    colored('Please see the README for credentials file format.', 'yellow'))
                sys.exit(3)
        except ModuleNotFoundError as mod_err:
            print(colored(mod_err, 'red'))
            sys.exit(2)

if not auto_login:
    # I know it's a little strange to print this info here and not as an else statement below.
    # However, there's a good reason it's here: Chrome will open on the next command (webdriver.Chrome())
    # and the user's computer will likely auto-focus to Chrome and away from the terminal, and we want
    # the user to see this info first.
    print(colored('Auto-login not enabled. Please manually login.', 'yellow'))

# chromedriver needs to be added to $PATH. Can be done by adding it to /usr/local/bin/ on a Mac.
driver = webdriver.Chrome()

# This will automatically redirect to login page. However, it will redirect back to the Bookmarks page after login.
driver.get(QUORA_BOOKMARKS_URL)

if auto_login:
    try:
        WebDriverWait(driver, LOGIN_PAGE_WAIT_TIME).until(
            EC.presence_of_element_located((By.CSS_SELECTOR, '[id$=_submit_button]')))
        print(colored('Attempting auto-login...', 'cyan'))

        # It seems that Quora obfuscates and/or hashes id and class names upon each page load, so that is why we use these CSS selectors and list indeces.
        # If Quora ever changes the DOM structure or id/class names of its login page, this could break.
        driver.find_elements_by_css_selector(
            '[id$=_email]')[2].send_keys(email)
        driver.find_elements_by_css_selector(
            '[id$=_password]')[1].send_keys(password)
        driver.find_element_by_css_selector(
            '[id$=_submit_button]').click()
    except TimeoutException:
        print(
            'Loading of login page took too much time. Try increasing LOGIN_PAGE_WAIT_TIME.')
    except:
        print('Auto-login failed. Please try logging in manually.')

# Wait for login until we're on the Bookmarks Page.
while driver.current_url != QUORA_BOOKMARKS_URL:
    pass

print(colored('Successfully logged in.', 'green'))
print(colored('Now auto-scrolling bookmarks page...', 'green'))

# We now load (i.e. scroll) the page until all answers are displayed.
old_num_of_answers = len(
    driver.find_elements_by_class_name('answer_permalink'))
curr_num_of_answers = old_num_of_answers
old_time = time.time()
while True:
    driver.execute_script('window.scrollTo(0, document.body.scrollHeight);')
    if time.time() > old_time + BOOMARKS_LOAD_WAIT_TIME:
        curr_num_of_answers = len(
            driver.find_elements_by_class_name('answer_permalink'))
        if curr_num_of_answers == old_num_of_answers:
            break
        else:
            old_time = time.time()
            old_num_of_answers = curr_num_of_answers

all_ans_elements = driver.find_elements_by_class_name('answer_permalink')
print(colored(str(len(all_ans_elements)) + ' answers found.', 'cyan'))

# Set up answers directory.
if not os.path.exists(ANSWERS_DIRECTORY):
    os.makedirs(ANSWERS_DIRECTORY)
    print(colored('Created ' + ANSWERS_DIRECTORY + ' directory. ', 'cyan'), end='')
else:
    print(colored(ANSWERS_DIRECTORY + ' directory found. ', 'cyan'), end='')
os.chdir(ANSWERS_DIRECTORY)
print(colored('Putting PDFs there.', 'cyan'))

options = {
    'page-size': 'Letter',
    'dpi': 450,
    'javascript-delay': 10000,
    'quiet': ''
}

for web_element in all_ans_elements:
    ans_url = web_element.get_attribute('href')
    url_read_clean = False
    num_incomplete_reads, num_http_error = 0, 0
    while (not url_read_clean) and num_incomplete_reads < 5 and num_http_error < 5:
        try:
            conn = urlopen(ans_url)
            soup = BeautifulSoup(conn.read(), 'html.parser')
            url_read_clean = True
        except http.client.IncompleteRead:
            print(colored('IncompleteRead. Trying again.', 'yellow'))
            num_incomplete_reads += 1
        except urllib.error.HTTPError:
            print(colored('HTTPError. Trying again.', 'yellow'))
            num_http_error += 1
        finally:
            if num_incomplete_reads == 5:
                print(colored('Failed \"' + ans_url +
                              '\" due to IncompleteRead. Now moving on.', 'red'))
            if num_http_error == 5:
                print(colored('Failed \"' + ans_url +
                              '\" due to HTTPError. Now moving on.', 'red'))
    title = soup.find('a', class_='question_link').text
    raw_author_text = soup.find('div', class_='feed_item_answer_user').text
    # This strips away whitespace and the author 'credentials' line.
    author = raw_author_text.strip().split(',')[0]
    author_string = ' (' + author + ')'
    unsafe_title_and_author = title + author_string

    # '/' and '%' can't go into filenames.
    title_and_author = unsafe_title_and_author.replace(
        '/', ' or ').replace('%', ' percent')

    # Filenames must be <= 255 characters.
    if len(title_and_author) > 255:
        # Note: I'm assuming that author names (just names, not credentials lines) wont have '/' or '%'. If that changes, this could break. Easy fix is just to reduce MAX_FILENAME_LEN by 10.
        # We need len(trimmed_title) + len(carry_on_string) + len(author_string) = MAX_FILENAME_LEN
        # Therefore, len(trimmed_title) = MAX_FILENAME_LEN - len(carry_on_string) - len(author_string)
        trimmed_title = title_and_author[:MAX_FILENAME_LEN -
                                         len(OMISSION_STRING) -
                                         len(author_string)]
        title_and_author = trimmed_title + OMISSION_STRING + author_string
        print('Trimming filename to conform to length standards: ',
              unsafe_title_and_author)

    new_filename = title_and_author + '.pdf'

    # Starting at 1 and immediately incrementing to 2 because we want count to match up with 'javascript-delay'.
    # This is so we can eaily and intuitively incrememnt 'javascript-delay' if page load takes too much time.
    count = 1
    while count <= 6:
        try:
            # Note to Mac users: You may need to move EPPEX Plug-In to Disabled Plug-Ins.
            # i.e. run this in your command prompt (without the quotation marks): "sudo mv EPPEX\ Plugin.plugin Disabled\ Plug-Ins/"

            # This is so the script can be run multiple times in a row (without having to recreate the same files), after the user has added more bookmarks.
            if os.path.isfile(new_filename):
                print(colored('File already exists :)', 'cyan'))
            else:
                pdfkit.from_url(ans_url, new_filename, options=options)
                print(colored('Succeeded: ' + title_and_author, 'green'))
            break
        except OSError as error:
            # It seems this error is caused by the page taking too long to load. In response, we increase allotted 'load time' (javascript-delay) and make another attempt, up to five times.
            count += 1
            if count >= 6:
                print(colored('Failed \"' + title_and_author +
                              '\" after ' + str(count) + ' tries. Now moving on.', 'red'))
                print(colored(str(error), 'red'))
                # Log failures.
                with open(FAILED_FILE, 'a') as failed:
                    failed.write(title_and_author + '\n')
                break
            else:
                # Here we increase page wait time by 10 seconds.
                options['javascript-delay'] = count * 10000
        except Exception as e:
            print(colored('Failed ' + title_and_author +
                          ' because of unknown error.', 'red'))
            print(colored('Type of Error: ' + str(type(e)), 'red'))
            print(colored(str(e), 'red'))
            # Log failures.
            with open(FAILED_FILE, 'a') as failed:
                failed.write(title_and_author + '\n')
            break
    # Reset javascript-delay to 10 seconds for the next loop iteration.
    options['javascript-delay'] = 10000

print('PDF Downloads Completed!')

driver.quit()
</code>```

I am using pycharm and have installed all the dependencies.

**I am facing the error as "

```<code>File "C:\Users\welcome\PycharmProjects\pythonProject7\main.py", line 111, in <module>
    driver.find_elements('answer_permalink'))
  File "C:\Users\welcome\PycharmProjects\pythonProject7\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 1005, in find_elements
    return self.execute(Command.FIND_ELEMENTS, {
  File "C:\Users\welcome\PycharmProjects\pythonProject7\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\welcome\PycharmProjects\pythonProject7\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: invalid locator
</code>```

I tried with both the new and  older version of selenium which is 3.141.0  but getting same error . I do not have that much expertise in python yet to debug or rewrite the code completely

Body:
I am trying to execute a python script made by noahluddy from github in 2019 for downloading quora bookmarked answers .OP link - https://github.com/abhishekjshukla/Quora-Bookmark-Downloader/commit/76b4179b9b3600fd47855b4574624a6345c104e8
here is the file :

import getopt
import http
import importlib
import os
import sys
import time

import pdfkit
import urllib

from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException
from termcolor import colored
from urllib.request import urlopen

# Constants.
QUORA_BOOKMARKS_URL = 'https://www.quora.com/bookmarks'
LOGIN_PAGE_WAIT_TIME = 10
BOOMARKS_LOAD_WAIT_TIME = 15
ANSWERS_DIRECTORY = 'answers'
FAILED_FILE = os.getcwd() + '/failed.txt'
OMISSION_STRING = '...'
MAX_FILENAME_LEN = 255 - len('.pdf')

auto_login = False

def usage():
    print(
        colored('Usage: python quorab.py [--auto-login <credentials_file>]', 'yellow'))

try:
    opts, args = getopt.getopt(sys.argv[1:], 'h', ['auto-login='])
except getopt.GetoptError as opt_err:
    print(colored(opt_err, 'red'))
    usage()
    sys.exit(1)
for opt, arg in opts:
    if opt == '-h':
        usage()
        sys.exit()
    elif opt == '--auto-login':
        try:
            credentials_module_name = arg
            # With this, users can pass both .py files and just the name of the module.
            # Useful for auto-complete in bash prompt.
            if credentials_module_name.endswith('.py'):
                credentials_module_name = credentials_module_name.replace(
                    '.py', '')
            credentials = importlib.import_module(credentials_module_name)
            try:
                email = credentials.email
                password = credentials.password
                auto_login = True
            except AttributeError as attr_err:
                print(colored(attr_err, 'red'))
                print(
                    colored('Please see the README for credentials file format.', 'yellow'))
                sys.exit(3)
        except ModuleNotFoundError as mod_err:
            print(colored(mod_err, 'red'))
            sys.exit(2)

if not auto_login:
    # I know it's a little strange to print this info here and not as an else statement below.
    # However, there's a good reason it's here: Chrome will open on the next command (webdriver.Chrome())
    # and the user's computer will likely auto-focus to Chrome and away from the terminal, and we want
    # the user to see this info first.
    print(colored('Auto-login not enabled. Please manually login.', 'yellow'))

# chromedriver needs to be added to $PATH. Can be done by adding it to /usr/local/bin/ on a Mac.
driver = webdriver.Chrome()

# This will automatically redirect to login page. However, it will redirect back to the Bookmarks page after login.
driver.get(QUORA_BOOKMARKS_URL)

if auto_login:
    try:
        WebDriverWait(driver, LOGIN_PAGE_WAIT_TIME).until(
            EC.presence_of_element_located((By.CSS_SELECTOR, '[id$=_submit_button]')))
        print(colored('Attempting auto-login...', 'cyan'))

        # It seems that Quora obfuscates and/or hashes id and class names upon each page load, so that is why we use these CSS selectors and list indeces.
        # If Quora ever changes the DOM structure or id/class names of its login page, this could break.
        driver.find_elements_by_css_selector(
            '[id$=_email]')[2].send_keys(email)
        driver.find_elements_by_css_selector(
            '[id$=_password]')[1].send_keys(password)
        driver.find_element_by_css_selector(
            '[id$=_submit_button]').click()
    except TimeoutException:
        print(
            'Loading of login page took too much time. Try increasing LOGIN_PAGE_WAIT_TIME.')
    except:
        print('Auto-login failed. Please try logging in manually.')

# Wait for login until we're on the Bookmarks Page.
while driver.current_url != QUORA_BOOKMARKS_URL:
    pass

print(colored('Successfully logged in.', 'green'))
print(colored('Now auto-scrolling bookmarks page...', 'green'))

# We now load (i.e. scroll) the page until all answers are displayed.
old_num_of_answers = len(
    driver.find_elements_by_class_name('answer_permalink'))
curr_num_of_answers = old_num_of_answers
old_time = time.time()
while True:
    driver.execute_script('window.scrollTo(0, document.body.scrollHeight);')
    if time.time() > old_time + BOOMARKS_LOAD_WAIT_TIME:
        curr_num_of_answers = len(
            driver.find_elements_by_class_name('answer_permalink'))
        if curr_num_of_answers == old_num_of_answers:
            break
        else:
            old_time = time.time()
            old_num_of_answers = curr_num_of_answers

all_ans_elements = driver.find_elements_by_class_name('answer_permalink')
print(colored(str(len(all_ans_elements)) + ' answers found.', 'cyan'))

# Set up answers directory.
if not os.path.exists(ANSWERS_DIRECTORY):
    os.makedirs(ANSWERS_DIRECTORY)
    print(colored('Created ' + ANSWERS_DIRECTORY + ' directory. ', 'cyan'), end='')
else:
    print(colored(ANSWERS_DIRECTORY + ' directory found. ', 'cyan'), end='')
os.chdir(ANSWERS_DIRECTORY)
print(colored('Putting PDFs there.', 'cyan'))

options = {
    'page-size': 'Letter',
    'dpi': 450,
    'javascript-delay': 10000,
    'quiet': ''
}

for web_element in all_ans_elements:
    ans_url = web_element.get_attribute('href')
    url_read_clean = False
    num_incomplete_reads, num_http_error = 0, 0
    while (not url_read_clean) and num_incomplete_reads < 5 and num_http_error < 5:
        try:
            conn = urlopen(ans_url)
            soup = BeautifulSoup(conn.read(), 'html.parser')
            url_read_clean = True
        except http.client.IncompleteRead:
            print(colored('IncompleteRead. Trying again.', 'yellow'))
            num_incomplete_reads += 1
        except urllib.error.HTTPError:
            print(colored('HTTPError. Trying again.', 'yellow'))
            num_http_error += 1
        finally:
            if num_incomplete_reads == 5:
                print(colored('Failed \"' + ans_url +
                              '\" due to IncompleteRead. Now moving on.', 'red'))
            if num_http_error == 5:
                print(colored('Failed \"' + ans_url +
                              '\" due to HTTPError. Now moving on.', 'red'))
    title = soup.find('a', class_='question_link').text
    raw_author_text = soup.find('div', class_='feed_item_answer_user').text
    # This strips away whitespace and the author 'credentials' line.
    author = raw_author_text.strip().split(',')[0]
    author_string = ' (' + author + ')'
    unsafe_title_and_author = title + author_string

    # '/' and '%' can't go into filenames.
    title_and_author = unsafe_title_and_author.replace(
        '/', ' or ').replace('%', ' percent')

    # Filenames must be <= 255 characters.
    if len(title_and_author) > 255:
        # Note: I'm assuming that author names (just names, not credentials lines) wont have '/' or '%'. If that changes, this could break. Easy fix is just to reduce MAX_FILENAME_LEN by 10.
        # We need len(trimmed_title) + len(carry_on_string) + len(author_string) = MAX_FILENAME_LEN
        # Therefore, len(trimmed_title) = MAX_FILENAME_LEN - len(carry_on_string) - len(author_string)
        trimmed_title = title_and_author[:MAX_FILENAME_LEN -
                                         len(OMISSION_STRING) -
                                         len(author_string)]
        title_and_author = trimmed_title + OMISSION_STRING + author_string
        print('Trimming filename to conform to length standards: ',
              unsafe_title_and_author)

    new_filename = title_and_author + '.pdf'

    # Starting at 1 and immediately incrementing to 2 because we want count to match up with 'javascript-delay'.
    # This is so we can eaily and intuitively incrememnt 'javascript-delay' if page load takes too much time.
    count = 1
    while count <= 6:
        try:
            # Note to Mac users: You may need to move EPPEX Plug-In to Disabled Plug-Ins.
            # i.e. run this in your command prompt (without the quotation marks): "sudo mv EPPEX\ Plugin.plugin Disabled\ Plug-Ins/"

            # This is so the script can be run multiple times in a row (without having to recreate the same files), after the user has added more bookmarks.
            if os.path.isfile(new_filename):
                print(colored('File already exists :)', 'cyan'))
            else:
                pdfkit.from_url(ans_url, new_filename, options=options)
                print(colored('Succeeded: ' + title_and_author, 'green'))
            break
        except OSError as error:
            # It seems this error is caused by the page taking too long to load. In response, we increase allotted 'load time' (javascript-delay) and make another attempt, up to five times.
            count += 1
            if count >= 6:
                print(colored('Failed \"' + title_and_author +
                              '\" after ' + str(count) + ' tries. Now moving on.', 'red'))
                print(colored(str(error), 'red'))
                # Log failures.
                with open(FAILED_FILE, 'a') as failed:
                    failed.write(title_and_author + '\n')
                break
            else:
                # Here we increase page wait time by 10 seconds.
                options['javascript-delay'] = count * 10000
        except Exception as e:
            print(colored('Failed ' + title_and_author +
                          ' because of unknown error.', 'red'))
            print(colored('Type of Error: ' + str(type(e)), 'red'))
            print(colored(str(e), 'red'))
            # Log failures.
            with open(FAILED_FILE, 'a') as failed:
                failed.write(title_and_author + '\n')
            break
    # Reset javascript-delay to 10 seconds for the next loop iteration.
    options['javascript-delay'] = 10000

print('PDF Downloads Completed!')

driver.quit()

I am using pycharm and have installed all the dependencies.

**I am facing the error as "

File "C:\Users\welcome\PycharmProjects\pythonProject7\main.py", line 111, in <module>
    driver.find_elements('answer_permalink'))
  File "C:\Users\welcome\PycharmProjects\pythonProject7\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 1005, in find_elements
    return self.execute(Command.FIND_ELEMENTS, {
  File "C:\Users\welcome\PycharmProjects\pythonProject7\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\welcome\PycharmProjects\pythonProject7\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: invalid locator

I tried with both the new and  older version of selenium which is 3.141.0  but getting same error . I do not have that much expertise in python yet to debug or rewrite the code completely


问:
Ignore unknown properties with swagger-codegen-maven-plugin 3.x
I am using swagger-codegen-maven-plugin to generate swagger code from yaml.

```<code><plugin>
                <groupId>io.swagger.codegen.v3</groupId>
                <artifactId>swagger-codegen-maven-plugin</artifactId>
                <version>3.0.36</version>
</code>```

The server keeps on adding new properties, which have not been added to client side yaml.

Client fails with the error

```<code>Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "keyCode" ....
    at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:61)
    at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:1127)
    at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:2023)
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1700)
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1678)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:319)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:176)
    at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:313)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:176)
</code>```

I want to add
@JsonIgnoreProperties(ignoreUnknown = true)
to generated swagger class, so that any new fields on server side, do not break client.

How can the generated swagger code have the @JsonIgnoreProperties(ignoreUnknown = true) ?

I have tried different options including the one at https://github.com/OpenAPITools/openapi-generator/issues/3438.

I also see solutions such as Annotation needed from swagger codegen. But these solutions are with 2.x jar and I am trying 3.x jar of swagger-codegen-maven-plugin

Body:
I am using swagger-codegen-maven-plugin to generate swagger code from yaml.

<plugin>
                <groupId>io.swagger.codegen.v3</groupId>
                <artifactId>swagger-codegen-maven-plugin</artifactId>
                <version>3.0.36</version>

The server keeps on adding new properties, which have not been added to client side yaml.

Client fails with the error

Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "keyCode" ....
    at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:61)
    at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:1127)
    at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:2023)
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1700)
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1678)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:319)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:176)
    at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:313)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:176)

I want to add
@JsonIgnoreProperties(ignoreUnknown = true)
to generated swagger class, so that any new fields on server side, do not break client.

How can the generated swagger code have the @JsonIgnoreProperties(ignoreUnknown = true) ?

I have tried different options including the one at https://github.com/OpenAPITools/openapi-generator/issues/3438.

I also see solutions such as Annotation needed from swagger codegen. But these solutions are with 2.x jar and I am trying 3.x jar of swagger-codegen-maven-plugin


问:
Sharing to Stories Instagram not loading the image with sticker in Story composer
I am trying to post an image with a sticker to Instagram from my Flutter app. I use the method channel to write the functionality in android. That is not working correctly, It is opening Instagram and close suddenly.

```<code>package com.example.tapstory;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import androidx.annotation.NonNull;
import java.io.FileNotFoundException;
import io.flutter.Log;
import io.flutter.embedding.android.FlutterActivity;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugins.GeneratedPluginRegistrant;

public class MainActivity extends FlutterActivity {
    private static final String INSTA_CHANNEL = "instaChannel";
//  private static final String MEDIA_TYPE_JPEG = "jpg";

    public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
        GeneratedPluginRegistrant.registerWith(flutterEngine);

        new MethodChannel(flutterEngine.getDartExecutor().getBinaryMessenger(), INSTA_CHANNEL).setMethodCallHandler((call, result) -> {

            if (call.method.equals("openCamera")) {
                openInsta();
            }
        });

    }

    public void openInsta() {
        Intent intent = getPackageManager().getLaunchIntentForPackage("com.instagram.android");
        if (intent != null) {
            Intent shareIntent = new Intent("com.instagram.share.ADD_TO_STORY");
            shareIntent.setAction(Intent.ACTION_SEND);
            shareIntent.setPackage("com.instagram.android");

            // Attach your App ID to the intent
            String sourceApplication = "5XXXXXXXXXXXXXXXXX5"; // This is your application's FB ID
            shareIntent.putExtra("source_application", sourceApplication);

            Uri backgroundAssetUri = Uri.parse("https://www.pngarts.com/files/11/Glitter-Gold-Sparkle-PNG-Free-Download.png");
            shareIntent.setDataAndType(backgroundAssetUri, "image/png");

            // Attach your sticker to the intent from a URI
            Uri stickerAssetUri = Uri.parse("https://pngimg.com/uploads/lamborghini/lamborghini_PNG10686.png");
            shareIntent.putExtra("interactive_asset_uri", stickerAssetUri);
            // Grant URI permissions for the image
            shareIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);

            shareIntent.setType("image/png");

            // Instantiate an activity
            Activity activity = getActivity();

            // Grant URI permissions for the sticker
            activity.grantUriPermission("com.instagram.android", stickerAssetUri, Intent.FLAG_GRANT_READ_URI_PERMISSION);

            //startActivity(shareIntent);
            // Verify that the activity resolves the intent and start it
            if (activity.getPackageManager().resolveActivity(shareIntent, 0) != null) {
                activity.startActivityForResult(shareIntent, 0);
            }

        } else {
            // bring user to the market to download the app.
            // or let them choose an app?
            intent = new Intent(Intent.ACTION_VIEW);
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            intent.setData(Uri.parse("market://details?id=" + "com.instagram.android"));
            startActivity(intent);
        }
    }

}
</code>```

This code is opening the Instagram options to share stories, Like this

But after choosing any option from this, open Instagram, and closing happens. If I select stories no messages appear, just close Instagram. If I choose Feed it will open Instagram and toast "Unable to load image" and if I choose chats, it will toast like "Unsupported file type"

This is the console

```<code>I/ViewRootImpl@67ebae4[MainActivity]( 3903): ViewPostIme pointer 0
I/ViewRootImpl@67ebae4[MainActivity]( 3903): ViewPostIme pointer 1
I/ViewRootImpl@67ebae4[MainActivity]( 3903): MSG_WINDOW_FOCUS_CHANGED 0 1
I/SurfaceControl( 3903): nativeRelease nativeObject s[537139976128]
I/SurfaceControl( 3903): nativeRelease nativeObject e[537139976128]
I/SurfaceControl( 3903): nativeRelease nativeObject s[537139976032]
I/SurfaceControl( 3903): nativeRelease nativeObject e[537139976032]
I/SurfaceControl( 3903): nativeRelease nativeObject s[537139975936]
I/SurfaceControl( 3903): nativeRelease nativeObject e[537139975936]
I/ViewRootImpl@67ebae4[MainActivity]( 3903): MSG_RESIZED_REPORT: frame=(0,0,1080,2340) ci=(0,83,0,126) vi=(0,0,0,126) or=1
I/ViewRootImpl@67ebae4[MainActivity]( 3903): [DP] dp(1) 1 android.view.ViewRootImpl.reportNextDraw:10957 android.view.ViewRootImpl.access$1200:256 android.view.ViewRootImpl$ViewRootHandler.handleMessage:6101
I/SurfaceControl( 3903): nativeRelease nativeObject s[539317707328]
I/SurfaceControl( 3903): nativeRelease nativeObject e[539317707328]
I/SurfaceControl( 3903): assignNativeObject: nativeObject = 0 Surface(name=null)/@0xc89db7b / android.view.SurfaceControl.readFromParcel:1117 android.view.IWindowSession$Stub$Proxy.relayout:1820 android.view.ViewRootImpl.relayoutWindow:9005 android.view.ViewRootImpl.performTraversals:3360 android.view.ViewRootImpl.doTraversal:2618 android.view.ViewRootImpl$TraversalRunnable.run:9971 android.view.Choreographer$CallbackRecord.run:1010 android.view.Choreographer.doCallbacks:809 android.view.Choreographer.doFrame:744 android.view.Choreographer$FrameDisplayEventReceiver.run:995
I/SurfaceControl( 3903): nativeRelease nativeObject s[539570151424]
I/SurfaceControl( 3903): nativeRelease nativeObject e[539570151424]
I/ViewRootImpl@67ebae4[MainActivity]( 3903): Relayout returned: old=(0,0,1080,2340) new=(0,0,1080,2340) req=(1080,2340)0 dur=16 res=0x1 s={true 537373880320} ch=false fn=3
I/ViewRootImpl@67ebae4[MainActivity]( 3903): [DP] pd() Asnyc report
W/libEGL  ( 3903): EGLNativeWindowType 0x7d1dfab010 disconnect failed
I/ViewRootImpl@67ebae4[MainActivity]( 3903): [DP] pdf(0) 1 android.view.ViewRootImpl.lambda$performDraw$1$ViewRootImpl:4668 android.view.-$$Lambda$ViewRootImpl$DJd0VUYJgsebcnSohO6h8zc_ONI.run:6 android.os.Handler.handleCallback:938
I/ViewRootImpl@67ebae4[MainActivity]( 3903): [DP] rdf()
D/InputTransport( 3903): Input channel destroyed: 'ClientS', fd=97
I/SurfaceControl( 3903): nativeRelease nativeObject s[539317707328]
I/SurfaceControl( 3903): nativeRelease nativeObject e[539317707328]
I/ViewRootImpl@67ebae4[MainActivity]( 3903): stopped(false) old=false
I/SurfaceControl( 3903): nativeRelease nativeObject s[537139975936]
I/SurfaceControl( 3903): nativeRelease nativeObject e[537139975936]
I/SurfaceControl( 3903): assignNativeObject: nativeObject = 0 Surface(name=null)/@0xc89db7b / android.view.SurfaceControl.readFromParcel:1117 android.view.IWindowSession$Stub$Proxy.relayout:1820 android.view.ViewRootImpl.relayoutWindow:9005 android.view.ViewRootImpl.performTraversals:3360 android.view.ViewRootImpl.doTraversal:2618 android.view.ViewRootImpl$TraversalRunnable.run:9971 android.view.Choreographer$CallbackRecord.run:1010 android.view.Choreographer.doCallbacks:809 android.view.Choreographer.doFrame:744 android.view.Choreographer$FrameDisplayEventReceiver.run:995
I/ViewRootImpl@67ebae4[MainActivity]( 3903): Relayout returned: old=(0,0,1080,2340) new=(0,0,1080,2340) req=(1080,2340)0 dur=6 res=0x1 s={true 537373880320} ch=false fn=4
I/ViewRootImpl@67ebae4[MainActivity]( 3903): updateBoundsLayer: shouldReparent = false t = android.view.SurfaceControl$Transaction@ab7d74f sc = Surface(name=Bounds for - com.example.tapstory/com.example.tapstory.MainActivity@0)/@0x9faeedc frame = 4
I/SurfaceControl( 3903): nativeRelease nativeObject s[539570151424]
I/SurfaceControl( 3903): nativeRelease nativeObject e[539570151424]
I/SurfaceControl( 3903): nativeRelease nativeObject s[537139975936]
I/SurfaceControl( 3903): nativeRelease nativeObject e[537139975936]
I/ViewRootImpl@67ebae4[MainActivity]( 3903): MSG_WINDOW_FOCUS_CHANGED 1 1
D/InputMethodManager( 3903): prepareNavigationBarInfo() DecorView@b66a338[MainActivity]
D/InputMethodManager( 3903): getNavigationBarColor() -16711423
D/InputMethodManager( 3903): prepareNavigationBarInfo() DecorView@b66a338[MainActivity]
D/InputMethodManager( 3903): getNavigationBarColor() -16711423
V/InputMethodManager( 3903): Starting input: tba=com.example.tapstory ic=null mNaviBarColor -16711423 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
D/InputMethodManager( 3903): startInputInner - Id : 0
I/InputMethodManager( 3903): startInputInner - mService.startInputOrWindowGainedFocus
D/InputTransport( 3903): Input channel constructed: 'ClientS', fd=97
I/SurfaceControl( 3903): nativeRelease nativeObject s[539570154016]
I/SurfaceControl( 3903): nativeRelease nativeObject e[539570154016]
I/SurfaceControl( 3903): nativeRelease nativeObject s[537139976224]
I/SurfaceControl( 3903): nativeRelease nativeObject e[537139976224]
I/SurfaceControl( 3903): nativeRelease nativeObject s[537139976032]
I/SurfaceControl( 3903): nativeRelease nativeObject e[537139976032]
</code>```

I am followed this

https://developers.facebook.com/docs/instagram/sharing-to-stories

Body:
I am trying to post an image with a sticker to Instagram from my Flutter app. I use the method channel to write the functionality in android. That is not working correctly, It is opening Instagram and close suddenly.

package com.example.tapstory;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import androidx.annotation.NonNull;
import java.io.FileNotFoundException;
import io.flutter.Log;
import io.flutter.embedding.android.FlutterActivity;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugins.GeneratedPluginRegistrant;

public class MainActivity extends FlutterActivity {
    private static final String INSTA_CHANNEL = "instaChannel";
//  private static final String MEDIA_TYPE_JPEG = "jpg";

    public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
        GeneratedPluginRegistrant.registerWith(flutterEngine);

        new MethodChannel(flutterEngine.getDartExecutor().getBinaryMessenger(), INSTA_CHANNEL).setMethodCallHandler((call, result) -> {

            if (call.method.equals("openCamera")) {
                openInsta();
            }
        });

    }

    public void openInsta() {
        Intent intent = getPackageManager().getLaunchIntentForPackage("com.instagram.android");
        if (intent != null) {
            Intent shareIntent = new Intent("com.instagram.share.ADD_TO_STORY");
            shareIntent.setAction(Intent.ACTION_SEND);
            shareIntent.setPackage("com.instagram.android");

            // Attach your App ID to the intent
            String sourceApplication = "5XXXXXXXXXXXXXXXXX5"; // This is your application's FB ID
            shareIntent.putExtra("source_application", sourceApplication);

            Uri backgroundAssetUri = Uri.parse("https://www.pngarts.com/files/11/Glitter-Gold-Sparkle-PNG-Free-Download.png");
            shareIntent.setDataAndType(backgroundAssetUri, "image/png");

            // Attach your sticker to the intent from a URI
            Uri stickerAssetUri = Uri.parse("https://pngimg.com/uploads/lamborghini/lamborghini_PNG10686.png");
            shareIntent.putExtra("interactive_asset_uri", stickerAssetUri);
            // Grant URI permissions for the image
            shareIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);

            shareIntent.setType("image/png");

            // Instantiate an activity
            Activity activity = getActivity();

            // Grant URI permissions for the sticker
            activity.grantUriPermission("com.instagram.android", stickerAssetUri, Intent.FLAG_GRANT_READ_URI_PERMISSION);

            //startActivity(shareIntent);
            // Verify that the activity resolves the intent and start it
            if (activity.getPackageManager().resolveActivity(shareIntent, 0) != null) {
                activity.startActivityForResult(shareIntent, 0);
            }

        } else {
            // bring user to the market to download the app.
            // or let them choose an app?
            intent = new Intent(Intent.ACTION_VIEW);
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            intent.setData(Uri.parse("market://details?id=" + "com.instagram.android"));
            startActivity(intent);
        }
    }

}

This code is opening the Instagram options to share stories, Like this

But after choosing any option from this, open Instagram, and closing happens. If I select stories no messages appear, just close Instagram. If I choose Feed it will open Instagram and toast "Unable to load image" and if I choose chats, it will toast like "Unsupported file type"

This is the console

I/ViewRootImpl@67ebae4[MainActivity]( 3903): ViewPostIme pointer 0
I/ViewRootImpl@67ebae4[MainActivity]( 3903): ViewPostIme pointer 1
I/ViewRootImpl@67ebae4[MainActivity]( 3903): MSG_WINDOW_FOCUS_CHANGED 0 1
I/SurfaceControl( 3903): nativeRelease nativeObject s[537139976128]
I/SurfaceControl( 3903): nativeRelease nativeObject e[537139976128]
I/SurfaceControl( 3903): nativeRelease nativeObject s[537139976032]
I/SurfaceControl( 3903): nativeRelease nativeObject e[537139976032]
I/SurfaceControl( 3903): nativeRelease nativeObject s[537139975936]
I/SurfaceControl( 3903): nativeRelease nativeObject e[537139975936]
I/ViewRootImpl@67ebae4[MainActivity]( 3903): MSG_RESIZED_REPORT: frame=(0,0,1080,2340) ci=(0,83,0,126) vi=(0,0,0,126) or=1
I/ViewRootImpl@67ebae4[MainActivity]( 3903): [DP] dp(1) 1 android.view.ViewRootImpl.reportNextDraw:10957 android.view.ViewRootImpl.access$1200:256 android.view.ViewRootImpl$ViewRootHandler.handleMessage:6101
I/SurfaceControl( 3903): nativeRelease nativeObject s[539317707328]
I/SurfaceControl( 3903): nativeRelease nativeObject e[539317707328]
I/SurfaceControl( 3903): assignNativeObject: nativeObject = 0 Surface(name=null)/@0xc89db7b / android.view.SurfaceControl.readFromParcel:1117 android.view.IWindowSession$Stub$Proxy.relayout:1820 android.view.ViewRootImpl.relayoutWindow:9005 android.view.ViewRootImpl.performTraversals:3360 android.view.ViewRootImpl.doTraversal:2618 android.view.ViewRootImpl$TraversalRunnable.run:9971 android.view.Choreographer$CallbackRecord.run:1010 android.view.Choreographer.doCallbacks:809 android.view.Choreographer.doFrame:744 android.view.Choreographer$FrameDisplayEventReceiver.run:995
I/SurfaceControl( 3903): nativeRelease nativeObject s[539570151424]
I/SurfaceControl( 3903): nativeRelease nativeObject e[539570151424]
I/ViewRootImpl@67ebae4[MainActivity]( 3903): Relayout returned: old=(0,0,1080,2340) new=(0,0,1080,2340) req=(1080,2340)0 dur=16 res=0x1 s={true 537373880320} ch=false fn=3
I/ViewRootImpl@67ebae4[MainActivity]( 3903): [DP] pd() Asnyc report
W/libEGL  ( 3903): EGLNativeWindowType 0x7d1dfab010 disconnect failed
I/ViewRootImpl@67ebae4[MainActivity]( 3903): [DP] pdf(0) 1 android.view.ViewRootImpl.lambda$performDraw$1$ViewRootImpl:4668 android.view.-$$Lambda$ViewRootImpl$DJd0VUYJgsebcnSohO6h8zc_ONI.run:6 android.os.Handler.handleCallback:938
I/ViewRootImpl@67ebae4[MainActivity]( 3903): [DP] rdf()
D/InputTransport( 3903): Input channel destroyed: 'ClientS', fd=97
I/SurfaceControl( 3903): nativeRelease nativeObject s[539317707328]
I/SurfaceControl( 3903): nativeRelease nativeObject e[539317707328]
I/ViewRootImpl@67ebae4[MainActivity]( 3903): stopped(false) old=false
I/SurfaceControl( 3903): nativeRelease nativeObject s[537139975936]
I/SurfaceControl( 3903): nativeRelease nativeObject e[537139975936]
I/SurfaceControl( 3903): assignNativeObject: nativeObject = 0 Surface(name=null)/@0xc89db7b / android.view.SurfaceControl.readFromParcel:1117 android.view.IWindowSession$Stub$Proxy.relayout:1820 android.view.ViewRootImpl.relayoutWindow:9005 android.view.ViewRootImpl.performTraversals:3360 android.view.ViewRootImpl.doTraversal:2618 android.view.ViewRootImpl$TraversalRunnable.run:9971 android.view.Choreographer$CallbackRecord.run:1010 android.view.Choreographer.doCallbacks:809 android.view.Choreographer.doFrame:744 android.view.Choreographer$FrameDisplayEventReceiver.run:995
I/ViewRootImpl@67ebae4[MainActivity]( 3903): Relayout returned: old=(0,0,1080,2340) new=(0,0,1080,2340) req=(1080,2340)0 dur=6 res=0x1 s={true 537373880320} ch=false fn=4
I/ViewRootImpl@67ebae4[MainActivity]( 3903): updateBoundsLayer: shouldReparent = false t = android.view.SurfaceControl$Transaction@ab7d74f sc = Surface(name=Bounds for - com.example.tapstory/com.example.tapstory.MainActivity@0)/@0x9faeedc frame = 4
I/SurfaceControl( 3903): nativeRelease nativeObject s[539570151424]
I/SurfaceControl( 3903): nativeRelease nativeObject e[539570151424]
I/SurfaceControl( 3903): nativeRelease nativeObject s[537139975936]
I/SurfaceControl( 3903): nativeRelease nativeObject e[537139975936]
I/ViewRootImpl@67ebae4[MainActivity]( 3903): MSG_WINDOW_FOCUS_CHANGED 1 1
D/InputMethodManager( 3903): prepareNavigationBarInfo() DecorView@b66a338[MainActivity]
D/InputMethodManager( 3903): getNavigationBarColor() -16711423
D/InputMethodManager( 3903): prepareNavigationBarInfo() DecorView@b66a338[MainActivity]
D/InputMethodManager( 3903): getNavigationBarColor() -16711423
V/InputMethodManager( 3903): Starting input: tba=com.example.tapstory ic=null mNaviBarColor -16711423 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
D/InputMethodManager( 3903): startInputInner - Id : 0
I/InputMethodManager( 3903): startInputInner - mService.startInputOrWindowGainedFocus
D/InputTransport( 3903): Input channel constructed: 'ClientS', fd=97
I/SurfaceControl( 3903): nativeRelease nativeObject s[539570154016]
I/SurfaceControl( 3903): nativeRelease nativeObject e[539570154016]
I/SurfaceControl( 3903): nativeRelease nativeObject s[537139976224]
I/SurfaceControl( 3903): nativeRelease nativeObject e[537139976224]
I/SurfaceControl( 3903): nativeRelease nativeObject s[537139976032]
I/SurfaceControl( 3903): nativeRelease nativeObject e[537139976032]

I am followed this

https://developers.facebook.com/docs/instagram/sharing-to-stories


问:
Send the id of an a as parameter of a function and get the data back
I would like to be able to display the data of a given property after clicking on a link with the property name

code.gs

```<code>const getAPropertyExpensesAndIncomes = (propertyName) => {
  try {
    let propertyExpensesAndIncomes = [];
    const sheet = getSs(jamPropertyManagementSpreadsheetId).getSheetByName(propertyName);
    const sheetValues = sheet.getRange(2, 1, sheet.getLastRow(), sheet.getLastColumn()).getValues();

    for (let data of sheetValues) {
      if (data[0] !== '') {
        data[0] = `${data[0]}`;
        data[1] = formatDate(data[1]);
        propertyExpensesAndIncomes.push(data);
      };
    };

    return propertyExpensesAndIncomes;
  } catch (error) {
    Logger.log(`getAPropertyExpensesAndIncomesError: ${error.message}`);
    return `getAPropertyExpensesAndIncomesError: ${error.message}`;
  };
};
</code>```

if i do

```<code>Logger.log(getAPropertyExpensesAndIncomes("property1"));
</code>```

I receive the data in this format

[[1671582334438, 9/26/2001, property1, , 1.0, , tenant2, Advertising_1, ], [1671582331656, 9/26/2001, property1, , 1.0, , tenant2, Advertising_1, ], [1671582025986, 12/2/2022, property1, , 12.0, , , Taxes, ], [1671582012964, 12/2/2022, property1, , 12.0, , , Water, ], [1671582008829, 12/2/2022, property1, , 12.0, , , Water, ], [1671582002259, 12/2/2022, property1, , 12.0, , , Water, ], [1671202613302, 10/30/2000, property1, , , 154.0, tenant1, Additional Income, ], [1671202466061, 2/27/2022, property1, , , 1000.0, tenant1, Additional Income, ], [1671202327684, 10/29/2022, property1, , 150.0, , tenant1, Auto & Travel, ], [1671182673398, 10/29/2022, property1, , , 5000.0, , Additional Income, ], [1671146919809, 12/31/2022, property1, , 2500.0, , tenant1, Capital Improvement, ], [1671119777866, 12/30/2021, property1, , 150.0, , tenant1, Maintence, ], [1671110246797, 12/30/2022, property1, , 150.0, , tenant2, Advertising, ]]

```<code>script.html

const links = document.querySelectorAll("a");

links.forEach(link => {
  link.addEventListener("click", event => {
    const propertyName = event.target.id;
    const expensesAndIncomes = google.script.run.getAPropertyExpensesAndIncomes(propertyName);

    // Update the propertytable with the new expenses and incomes
    let propertytable = expensesAndIncomes.map(d =>
      "<tr>" +
      "<td>" + d[1] + "</td>" +
      "<td>" + d[2] + "</td>" +
      "<td>" + d[3] + "</td>" +
      "<td>" + d[4] + "</td>" +
      "<td>" + d[5] + "</td>" +
      "<td>" + d[6] + "</td>" +
      "<td>" + d[7] + "</td>" +
      "<th scope='row'><button class='btn btn-info' id='edit-button'><i class='fa-solid fa-pen'></i></button></th>" +
      "</tr>"
    ).join("");

    const tableContainer = document.querySelector("#table_container");
    tableContainer.innerHTML = propertytable;

  });
});
</code>```

html link exemple

```<code><a target="_top" id="property1" href="https://script.google.com/macros/s/AKfycbzg8NFI0mK_jofGqQaowOB1f9BXVpWJFt5diXDC_NKB/dev?page=property">property1 </a>
</code>```

but when I click I get an error
html,

```<code>Uncaught TypeError: can't access property "map", expensesAndIncomes is undefined
    <anonymous> https://n-33hlthex56porphnaxxqvym4yduvethq2tp4lai-0lu-script.googleusercontent.com/userCodeAppPanel:1110
    EventListener.handleEvent* https://n-33hlthex56porphnaxxqvym4yduvethq2tp4lai-0lu-script.googleusercontent.com/userCodeAppPanel:1105
    <anonymous> https://n-33hlthex56porphnaxxqvym4yduvethq2tp4lai-0lu-script.googleusercontent.com/userCodeAppPanel:1104
userCodeAppPanel:1110:25

Uncaught NetworkError: Échec de la connexion dû à HTTP 0
</code>```

Body:
I would like to be able to display the data of a given property after clicking on a link with the property name

code.gs

const getAPropertyExpensesAndIncomes = (propertyName) => {
  try {
    let propertyExpensesAndIncomes = [];
    const sheet = getSs(jamPropertyManagementSpreadsheetId).getSheetByName(propertyName);
    const sheetValues = sheet.getRange(2, 1, sheet.getLastRow(), sheet.getLastColumn()).getValues();

    for (let data of sheetValues) {
      if (data[0] !== '') {
        data[0] = `${data[0]}`;
        data[1] = formatDate(data[1]);
        propertyExpensesAndIncomes.push(data);
      };
    };

    return propertyExpensesAndIncomes;
  } catch (error) {
    Logger.log(`getAPropertyExpensesAndIncomesError: ${error.message}`);
    return `getAPropertyExpensesAndIncomesError: ${error.message}`;
  };
};

if i do

Logger.log(getAPropertyExpensesAndIncomes("property1"));

I receive the data in this format

[[1671582334438, 9/26/2001, property1, , 1.0, , tenant2, Advertising_1, ], [1671582331656, 9/26/2001, property1, , 1.0, , tenant2, Advertising_1, ], [1671582025986, 12/2/2022, property1, , 12.0, , , Taxes, ], [1671582012964, 12/2/2022, property1, , 12.0, , , Water, ], [1671582008829, 12/2/2022, property1, , 12.0, , , Water, ], [1671582002259, 12/2/2022, property1, , 12.0, , , Water, ], [1671202613302, 10/30/2000, property1, , , 154.0, tenant1, Additional Income, ], [1671202466061, 2/27/2022, property1, , , 1000.0, tenant1, Additional Income, ], [1671202327684, 10/29/2022, property1, , 150.0, , tenant1, Auto & Travel, ], [1671182673398, 10/29/2022, property1, , , 5000.0, , Additional Income, ], [1671146919809, 12/31/2022, property1, , 2500.0, , tenant1, Capital Improvement, ], [1671119777866, 12/30/2021, property1, , 150.0, , tenant1, Maintence, ], [1671110246797, 12/30/2022, property1, , 150.0, , tenant2, Advertising, ]]

script.html

const links = document.querySelectorAll("a");

links.forEach(link => {
  link.addEventListener("click", event => {
    const propertyName = event.target.id;
    const expensesAndIncomes = google.script.run.getAPropertyExpensesAndIncomes(propertyName);

    // Update the propertytable with the new expenses and incomes
    let propertytable = expensesAndIncomes.map(d =>
      "
" +
      "" + d[1] + "	" +
      "" + d[2] + "	" +
      "" + d[3] + "	" +
      "" + d[4] + "	" +
      "" + d[5] + "	" +
      "" + d[6] + "	" +
      "" + d[7] + "	" +
      "<button class='btn btn-info' id='edit-button'></button>	" +
      "
"
    ).join("");

    const tableContainer = document.querySelector("#table_container");
    tableContainer.innerHTML = propertytable;

  });
});

html link exemple

property1

but when I click I get an error
html,

Uncaught TypeError: can't access property "map", expensesAndIncomes is undefined
    <anonymous> https://n-33hlthex56porphnaxxqvym4yduvethq2tp4lai-0lu-script.googleusercontent.com/userCodeAppPanel:1110
    EventListener.handleEvent* https://n-33hlthex56porphnaxxqvym4yduvethq2tp4lai-0lu-script.googleusercontent.com/userCodeAppPanel:1105
    <anonymous> https://n-33hlthex56porphnaxxqvym4yduvethq2tp4lai-0lu-script.googleusercontent.com/userCodeAppPanel:1104
userCodeAppPanel:1110:25

Uncaught NetworkError: Échec de la connexion dû à HTTP 0


问:
Kafka error: could not find or load main class kafka.admin.topiccommand
I'm on Windows 11 and downloaded and unzipped the files into my chosen directory but getting the following error when trying to run a describe command:

could not find or load main class kafka.admin.Topiccommand

Command trying to run:

kafka-topics --describe --zookeeper SERVER_NAME --topic TOPIC_NAME

Am I missing something? I am running these commands from the /bin directory.

I am trying to create Topic by
kafka-topics.sh but I can't create topic in cmd terminal.


问:
How to keep user logged in with firebase 7.17.1 and react?
I want to show the user the LOG OUT button if he is logged into the account, but I am using firebase 7.17.1 and all the ways I found do not work</p>


问:
How can I find out at https://www.montan.info/verkuendzettel/ where the content comes from at
?
How can  I find out at https://www.montan.info/verkuendzettel/ where the content comes from at  ?

Checking Chome -> DevTools -> network, search, source, ...

Title: How can I find out at https://www.montan.info/verkuendzettel/ where the content comes from at <div id=pfarrbriefe>?


问:
Firebase security rules bans everyone instead of users in the banned collection
I am building a chat app in react js using firebase , everything was fine till I tried to implement the banning system. I configured the firebase security rules but It did not really went as expected. The auth rules are working but when it comes to ban the users from the banned collection , it doesnt work , it doesnt give read or write permission to anyone even if it is a non-banned user here are the rules:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if request.auth != null && request.resource.data.uid == request.auth.uid && !exists(/databases/$(database)/documents/banned/$(request.auth.uid));
    }
  }
}
```

I expected to ban all the users that are in the banned firestore collection

Body:
I am building a chat app in react js using firebase , everything was fine till I tried to implement the banning system. I configured the firebase security rules but It did not really went as expected. The auth rules are working but when it comes to ban the users from the banned collection , it doesnt work , it doesnt give read or write permission to anyone even if it is a non-banned user here are the rules:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if request.auth != null && request.resource.data.uid == request.auth.uid && !exists(/databases/$(database)/documents/banned/$(request.auth.uid));
    }
  }
}

I expected to ban all the users that are in the banned firestore collection


问:
Loading 50 dynamic Angular Components in *NgFor takes long time to initialize (15 secs)
I am loading 50 angular components in a ngFor loop

formItemList is a array and has 50 angular components

```<code><mat-expansion-panel expanded="true" *ngFor="let item of formItemList; let i = index" id="{{item.id}}"
                class="pad-top-sm, expansion-panel">
                <mat-expansion-panel-header id="{{'mat-header' + i}}">
                    <div>
                        <a id="{{'mat-help' + i}}" href="{{ item.help }}" class="inline" title="help"
                            target="_blank">
                            <s-icon name="help-circle" class="relative active small margin-right-xs">
                            </s-icon>
                        </a>
                        <h3 id="{{'mat-expansion-label' + i}}" class="inline">{{ item.label }}</h3>
                    </div>
                </mat-expansion-panel-header>
                <ng-container app-add-component [component]="item.component"></ng-container>
            </mat-expansion-panel>
</code>```
```<code>static formItemList: FormItem[] = [
    {
      id: "testId",
      label: "testId",
      help: "https://google.com",
      component: FormComponent
    }];  // has 50 such objects
</code>```

Form Component has no server calls and UI html is an empty html table.

app-add-component is a directive that creates components

```<code>@Directive({
    selector: '[app-add-component]',
})
export class AddComponentDirective implements AfterViewInit {

    @Input() component: Type<any> | undefined;
    constructor(public viewContainerRef: ViewContainerRef) {

    }

    ngAfterViewInit() {

            this.viewContainerRef.clear();
            if (this.component)
                this.viewContainerRef.createComponent(this.component);

    }
}
</code>```

This is working but takes almost more than 15 sec to bind the components to the HTML. The scrren is frozen for that time.
How can I make this load faster?

I have tried trackby in ngFor but I am supplying all the 50 components all at once so this is of no use.

The use case is for all the 50 components should load in under 5 secs

Body:
I am loading 50 angular components in a ngFor loop

formItemList is a array and has 50 angular components

<mat-expansion-panel expanded="true" *ngFor="let item of formItemList; let i = index" id="{{item.id}}"
                class="pad-top-sm, expansion-panel">
                <mat-expansion-panel-header id="{{'mat-header' + i}}">

                            <s-icon name="help-circle" class="relative active small margin-right-xs">
                            </s-icon>

{{ item.label }}

                </mat-expansion-panel-header>
                <ng-container app-add-component [component]="item.component"></ng-container>
            </mat-expansion-panel>

static formItemList: FormItem[] = [
    {
      id: "testId",
      label: "testId",
      help: "https://google.com",
      component: FormComponent
    }];  // has 50 such objects

Form Component has no server calls and UI html is an empty html table.

app-add-component is a directive that creates components

@Directive({
    selector: '[app-add-component]',
})
export class AddComponentDirective implements AfterViewInit {

    @Input() component: Type<any> | undefined;
    constructor(public viewContainerRef: ViewContainerRef) {

    }

    ngAfterViewInit() {

            this.viewContainerRef.clear();
            if (this.component)
                this.viewContainerRef.createComponent(this.component);

    }
}

This is working but takes almost more than 15 sec to bind the components to the HTML. The scrren is frozen for that time.
How can I make this load faster?

I have tried trackby in ngFor but I am supplying all the 50 components all at once so this is of no use.

The use case is for all the 50 components should load in under 5 secs


问:
Electron - Need unit testing framework for bundled app
we are using electron framework to create WINDOWS and MAC installer. For frontend, we are using Angular to show data.
We are also using sqlite3 database to store data locally in user's system using node.js.

Everything working fine like api calling using AXIOS, intercating with our local database(CRUD), intercating with client side(frontend) with electron-ipc-renderer, file system handling.
Our application is working properly as expected.

We are stuck with unit testing of our application.

We want to do end to end testing which will consume electrons basic libraries like:-

app

BrowserWindow

dialog

Menu

remote

screen

ipcMain

And we are using other node libraries also like axios, path, chokidar, sqlite3.

Has anyone achieved Unit test cases for such kind Electron App/knows anything which can help us?


问:
Set static IP for RedPitaya(debian) connecting with wifi to ESP8266 Access point
I would like to use RedPitaya (debian linux) to be accessible from other devices using wifi over ESP8266 access point having the same IP address regardless of when RedPitaya connects to this access point.

I use ESP8266 access point software from Arduino example. Gateway=192.168.4.1, subnet mask=255.255.255.0, ssid=ESPap passphrase=SilverMuc.

On RedPitaya is debian linux with a network-manager. I have connected to access point by:

nmcli dev wifi connect "ESPap" password "SilverMuc"

I get different IP addresses depending on other devices being connected to the same access point. I would like that RedPitaya keeps always same IP address and preferably I would like to set it on RedPitaya.


问:
How can I identify event called via user OR system generated, If I checked on generated text file from xero webhooks using PHP?
I integrated Xero with webhook on my system. Every invoice-related change or create a new invoice then a new generated text file.
How can I identify transaction was generated by the system(via Xero application login) OR via integrated API from my system?

If I checked the log from the application then separate both.

But I need to add it every time in a generated text file when calling webhook.

System log

Generated text file


问:
Failed to monitor agent
I have enabled the Recording and analytics behavior option to monitor real-time and post-call analytics but when I try to live monitor the agent but it shows me an error "Failed to monitor agent".

I want to monitor the real-time metrics of the agent in Amazon Connect.

Title: Failed to monitor agent


问:
ffmpeg kit flutter IOS No such filter: 'drawtext' Error
I am using ffmpeg_kit_flutter and apply drawtext filter on video but i am getting errors  No such filter: 'drawtext'

input video link is input.mp4

This command it working

```<code>ffmpeg -y -i input.mp4 -filter_complex '[0]scale=540:-1[s];[s]drawtext=text='your_text_here':fontsize=24:fontcolor=white:x=(w-text_w)/2:y=(h-text_h)/2' output.mp4
</code>```

code sample is bellow

```<code>/// Create Video With Text
Future<void> createVideoWithText() async {
  final file = File('${(await getTemporaryDirectory()).path}/output.mp4');
  String outPut = file.path;

  String command = "-y -i $inputFilePath -filter_complex '[0]scale=540:-1[s];[s]drawtext=text='MY_TEXT':fontsize=24:fontcolor=white:x=(w-text_w)/2:y=(h-text_h)/2' $outPut";

  FFmpegKit.executeAsync(
    command,
    (session) async {
      final returnCode = await session.getReturnCode();

      if (ReturnCode.isSuccess(returnCode)) {
print('Success full add text on video');
      }else{print('Error to adding text on video');}
    },
  );
}
</code>```

Body:
I am using ffmpeg_kit_flutter and apply drawtext filter on video but i am getting errors  No such filter: 'drawtext'

input video link is input.mp4

This command it working

ffmpeg -y -i input.mp4 -filter_complex '[0]scale=540:-1[s];[s]drawtext=text='your_text_here':fontsize=24:fontcolor=white:x=(w-text_w)/2:y=(h-text_h)/2' output.mp4

code sample is bellow

/// Create Video With Text
Future<void> createVideoWithText() async {
  final file = File('${(await getTemporaryDirectory()).path}/output.mp4');
  String outPut = file.path;

  String command = "-y -i $inputFilePath -filter_complex '[0]scale=540:-1[s];[s]drawtext=text='MY_TEXT':fontsize=24:fontcolor=white:x=(w-text_w)/2:y=(h-text_h)/2' $outPut";

  FFmpegKit.executeAsync(
    command,
    (session) async {
      final returnCode = await session.getReturnCode();

      if (ReturnCode.isSuccess(returnCode)) {
print('Success full add text on video');
      }else{print('Error to adding text on video');}
    },
  );
}


问:
How to make a condition in useEffect hook?
I have such a situation, I need to execute my function each time the string searchTerms and total.value is changing.
Here is how it looks like

```<code>useEffect(() => {
    if (searchTerms) {
      analyticsService?.logEvent(ANALYTICS_EVENTS.SEARCH_COMPLETED, {
        total_results: data?.hits.total.value,
        error_message: null,
      });
    }
  }, [data?.hits.total.value && searchTerms]);
</code>```

But it works not as expected, I need to execute this function only when data.hits.total.value && searchTerms is changed. Not OR!

If I will make it like this

```<code>[data?.hits.total.value, searchTerms]
</code>```

Then my function would log 2 times each search, but I don't need it.

How can I fix it?

Body:
I have such a situation, I need to execute my function each time the string searchTerms and total.value is changing.
Here is how it looks like

useEffect(() => {
    if (searchTerms) {
      analyticsService?.logEvent(ANALYTICS_EVENTS.SEARCH_COMPLETED, {
        total_results: data?.hits.total.value,
        error_message: null,
      });
    }
  }, [data?.hits.total.value && searchTerms]);

But it works not as expected, I need to execute this function only when data.hits.total.value && searchTerms is changed. Not OR!

If I will make it like this

[data?.hits.total.value, searchTerms]

Then my function would log 2 times each search, but I don't need it.

How can I fix it?


问:
Detect human face from image blob not from image element
I have a form in Next JS that has an input type media. After I check if the file is jpg / png / jpeg, I want to check if the image has a human face in it. I can display the image from the file blob: https://localhost:300/img.jpg.

From what I understand, face-api.js and @vladmandic/human work only if I already display the image and then check.

For example here in facedetect.js ( https://github.com/vladmandic/human/blob/main/demo/facedetect/facedetect.js ), inside the addImage function is a line of code (line 116)

```<code>const imgEl = new Image(256, 256);
</code>```

but I don't want to create an Image with a face... How can I work around this line of code?

Body:
I have a form in Next JS that has an input type media. After I check if the file is jpg / png / jpeg, I want to check if the image has a human face in it. I can display the image from the file blob: https://localhost:300/img.jpg.

From what I understand, face-api.js and @vladmandic/human work only if I already display the image and then check.

For example here in facedetect.js ( https://github.com/vladmandic/human/blob/main/demo/facedetect/facedetect.js ), inside the addImage function is a line of code (line 116)

const imgEl = new Image(256, 256);

but I don't want to create an Image with a face... How can I work around this line of code?


问:
How to check whether activity contains required fragment in container on activity test in espresso?
I have a situation,
my test code
MyActivityTest.kt
`

```<code>@Test
fun navigateToLoginFragment() {
    val intent =
        Intent(ApplicationProvider.getApplicationContext(), MyActivity::class.java)
            .putExtra("page", "Login")
    scenario = launchActivity(intent)
//pending : assert whether displayed fragment is LoginFragment or not
// ToDo
}
</code>```

`

and activity,

MyActivity.kt
`

```<code>mPageMode = intent.getStringExtra("page")

when (mPageMode) {
    "Login" -> {
        MyUtility.replaceFragment(
            supportFragmentManager,
            LoginFragment()
        )
    }

    "Register" -> {
        MyUtility.replaceFragment(
            supportFragmentManager,
            RegistrationFragment()
        )
    }
</code>```

`

I want to check whether displayed fragment on activity is LoginFragment or RegistrationFragment. How to do it in espresso testing?

I tried below code
`

```<code>onView(withId(R.id.fragment_container)).check(matches(isDisplayed()))
</code>```

`
but it can't get the exact fragment that is displayed

Body:
I have a situation,
my test code
MyActivityTest.kt
`

@Test
fun navigateToLoginFragment() {
    val intent =
        Intent(ApplicationProvider.getApplicationContext(), MyActivity::class.java)
            .putExtra("page", "Login")
    scenario = launchActivity(intent)
//pending : assert whether displayed fragment is LoginFragment or not
// ToDo
}

`

and activity,

MyActivity.kt
`

mPageMode = intent.getStringExtra("page")

when (mPageMode) {
    "Login" -> {
        MyUtility.replaceFragment(
            supportFragmentManager,
            LoginFragment()
        )
    }

    "Register" -> {
        MyUtility.replaceFragment(
            supportFragmentManager,
            RegistrationFragment()
        )
    }

`

I want to check whether displayed fragment on activity is LoginFragment or RegistrationFragment. How to do it in espresso testing?

I tried below code
`

onView(withId(R.id.fragment_container)).check(matches(isDisplayed()))

`
but it can't get the exact fragment that is displayed