问:
Weblogic 12c - eclipselink MOXy - Nested Composite Objects not getting unmarshalled - error 500
I am trying to develop a jpa application for weblogic 12c. I have the following 2 objects:

```<code>@Entity
@Table(name = "account", schema = "APPSTD", catalog = "")
public class CcAccountEntity {
    private String acctFolio;
    private Set<CcCustomerEntity> customers;

    @Id
    @Column(name = "ACCT_FOLIO")
    public String getAcctFolio() {
        return acctFolio;
    }

    public void setAcctFolio(String acctFolio) {
        this.acctFolio = acctFolio;
    }

    @OneToMany(cascade = CascadeType.ALL, mappedBy = "account")
    public Set<CcCustomerEntity> getCustomers() {
        return customers;
    }

    public void setCustomers(Set<CcCustomerEntity> customers) {
        this.customers = customers;
    }
}
</code>```

and the following

```<code>@Entity
@Table(name = "customer", schema = "APPSTD", catalog = "")
public class CcCustomerEntity {
    private String custName;
    private String custSsn;
    private String custTaxIdNbr;
    private String cpPhoneNumber;
    private CcAccountEntity account;

    @Basic
    @Column(name = "CUST_NAME")
    public String getCustName() {
        return custName;
    }

    public void setCustName(String custName) {
        this.custName = custName;
    }

    @Basic
    @Column(name = "CUST_SSN")
    public String getCustSsn() {
        return custSsn;
    }

    public void setCustSsn(String custSsn) {
        this.custSsn = custSsn;
    }

    @Basic
    @Column(name = "CUST_TAX_ID_NBR")
    public String getCustTaxIdNbr() {
        return custTaxIdNbr;
    }

    public void setCustTaxIdNbr(String custTaxIdNbr) {
        this.custTaxIdNbr = custTaxIdNbr;
    }

    @Basic
    @Column(name = "CP_PHONE_NUMBER")
    public String getCpPhoneNumber() {
        return cpPhoneNumber;
    }

    public void setCpPhoneNumber(String cpPhoneNumber) {
        this.cpPhoneNumber = cpPhoneNumber;
    }

    @ManyToOne
    @JoinColumn(name = "ACCT_FOLIO", nullable = false)
    public CcAccountEntity getAccount() {
        return account;
    }

    public void setAccount(CcAccountEntity account) {
        this.account = account;
    }
}
</code>```

Then I have the following code to retrieve an account from the dB:

```<code>    public CcAccountEntity getAccount (String acctFolio) throws Exception {
        final UserTransaction utx = context.getUserTransaction();
        try {
            utx.setTransactionTimeout(120000);
            utx.begin();
            CcAccountEntity accountEntity = em.find(CcAccountEntity.class, acctFolio);

            utx.commit();

            return accountEntity;
        } catch (Exception e) {
            logger.error("getAccount sql error:", e);
            try {
                utx.rollback();
            } catch (SystemException se) {
                logger.error("getAccount rollback error:", e);
            }
            throw e;
        }
    }
</code>```

Calling the last service through a rest service returns internal server error 500. I must report that this error is thrown by the weblogic and no exception is logged.
After several tries I realized that the error is thrown at line  CcAccountEntity accountEntity = em.find(CcAccountEntity.class, acctFolio);. Therefore, I suppose that this is MOXy problem. I must also report than when I remove the customers field from the CcAccountEntity everything works fine. Could you please help me to overcome this problem?

答:
I must report that I have the following deployment errors. Also I must note that the jars that cannot be parsed are included in the /target/customercareBackend/WEB-INF/lib directory.</p>

```<code>####<Ιουν 2, 2020, 10:01:50,508 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000013> <1591081310508> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jackson-annotations-2.10.2.jar!/module-info.class. >
####<Ιουν 2, 2020, 10:01:50,510 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000014> <1591081310510> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jackson-module-jaxb-annotations-2.10.1.jar!/module-info.class. >
####<Ιουν 2, 2020, 10:01:50,511 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000015> <1591081310511> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jersey-common-2.31.jar!/META-INF/versions/11/org/glassfish/jersey/internal/jsr166/SubmissionPublisher$1.class. >
####<Ιουν 2, 2020, 10:01:50,511 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000015> <1591081310511> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jersey-common-2.31.jar!/META-INF/versions/11/org/glassfish/jersey/internal/jsr166/SubmissionPublisher$2.class. >
####<Ιουν 2, 2020, 10:01:50,512 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000015> <1591081310512> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jersey-common-2.31.jar!/META-INF/versions/11/org/glassfish/jersey/internal/jsr166/SubmissionPublisher$3.class. >
####<Ιουν 2, 2020, 10:01:50,512 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000015> <1591081310512> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jersey-common-2.31.jar!/META-INF/versions/11/org/glassfish/jersey/internal/jsr166/SubmissionPublisher$4.class. >
####<Ιουν 2, 2020, 10:01:50,512 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000015> <1591081310512> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jersey-common-2.31.jar!/META-INF/versions/11/org/glassfish/jersey/internal/jsr166/SubmissionPublisher$5.class. >
####<Ιουν 2, 2020, 10:01:50,512 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000015> <1591081310512> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jersey-common-2.31.jar!/META-INF/versions/11/org/glassfish/jersey/internal/jsr166/SubmissionPublisher$6.class. >
####<Ιουν 2, 2020, 10:01:50,513 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000015> <1591081310513> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jersey-common-2.31.jar!/META-INF/versions/11/org/glassfish/jersey/internal/jsr166/SubmissionPublisher.class. >
####<Ιουν 2, 2020, 10:01:50,515 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000015> <1591081310515> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jersey-common-2.31.jar!/META-INF/versions/11/org/glassfish/jersey/internal/jsr166/SubmissionPublisherFactory.class. >
####<Ιουν 2, 2020, 10:01:50,565 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '10' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000016> <1591081310565> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jackson-core-2.10.2.jar!/module-info.class. >
####<Ιουν 2, 2020, 10:01:50,568 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000017> <1591081310568> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jakarta.ws.rs-api-2.1.6.jar!/module-info.class. >
####<Ιουν 2, 2020, 10:01:50,571 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000018> <1591081310571> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jakarta.xml.bind-api-2.3.2.jar!/META-INF/versions/9/javax/xml/bind/ModuleUtil.class. >
####<Ιουν 2, 2020, 10:01:50,572 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000018> <1591081310572> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jakarta.xml.bind-api-2.3.2.jar!/module-info.class. >
####<Ιουν 2, 2020, 10:01:50,696 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000019> <1591081310696> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jackson-databind-2.10.2.jar!/module-info.class. >

</code>```

Body:
I am trying to develop a jpa application for weblogic 12c. I have the following 2 objects:

@Entity
@Table(name = "account", schema = "APPSTD", catalog = "")
public class CcAccountEntity {
    private String acctFolio;
    private Set<CcCustomerEntity> customers;

    @Id
    @Column(name = "ACCT_FOLIO")
    public String getAcctFolio() {
        return acctFolio;
    }

    public void setAcctFolio(String acctFolio) {
        this.acctFolio = acctFolio;
    }

    @OneToMany(cascade = CascadeType.ALL, mappedBy = "account")
    public Set<CcCustomerEntity> getCustomers() {
        return customers;
    }

    public void setCustomers(Set<CcCustomerEntity> customers) {
        this.customers = customers;
    }
}

and the following

@Entity
@Table(name = "customer", schema = "APPSTD", catalog = "")
public class CcCustomerEntity {
    private String custName;
    private String custSsn;
    private String custTaxIdNbr;
    private String cpPhoneNumber;
    private CcAccountEntity account;

    @Basic
    @Column(name = "CUST_NAME")
    public String getCustName() {
        return custName;
    }

    public void setCustName(String custName) {
        this.custName = custName;
    }

    @Basic
    @Column(name = "CUST_SSN")
    public String getCustSsn() {
        return custSsn;
    }

    public void setCustSsn(String custSsn) {
        this.custSsn = custSsn;
    }

    @Basic
    @Column(name = "CUST_TAX_ID_NBR")
    public String getCustTaxIdNbr() {
        return custTaxIdNbr;
    }

    public void setCustTaxIdNbr(String custTaxIdNbr) {
        this.custTaxIdNbr = custTaxIdNbr;
    }

    @Basic
    @Column(name = "CP_PHONE_NUMBER")
    public String getCpPhoneNumber() {
        return cpPhoneNumber;
    }

    public void setCpPhoneNumber(String cpPhoneNumber) {
        this.cpPhoneNumber = cpPhoneNumber;
    }

    @ManyToOne
    @JoinColumn(name = "ACCT_FOLIO", nullable = false)
    public CcAccountEntity getAccount() {
        return account;
    }

    public void setAccount(CcAccountEntity account) {
        this.account = account;
    }
}

Then I have the following code to retrieve an account from the dB:

    public CcAccountEntity getAccount (String acctFolio) throws Exception {
        final UserTransaction utx = context.getUserTransaction();
        try {
            utx.setTransactionTimeout(120000);
            utx.begin();
            CcAccountEntity accountEntity = em.find(CcAccountEntity.class, acctFolio);

            utx.commit();

            return accountEntity;
        } catch (Exception e) {
            logger.error("getAccount sql error:", e);
            try {
                utx.rollback();
            } catch (SystemException se) {
                logger.error("getAccount rollback error:", e);
            }
            throw e;
        }
    }

Calling the last service through a rest service returns internal server error 500. I must report that this error is thrown by the weblogic and no exception is logged.
After several tries I realized that the error is thrown at line  CcAccountEntity accountEntity = em.find(CcAccountEntity.class, acctFolio);. Therefore, I suppose that this is MOXy problem. I must also report than when I remove the customers field from the CcAccountEntity everything works fine. Could you please help me to overcome this problem?

Body:
I must report that I have the following deployment errors. Also I must note that the jars that cannot be parsed are included in the /target/customercareBackend/WEB-INF/lib directory.

####<Ιουν 2, 2020, 10:01:50,508 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000013> <1591081310508> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jackson-annotations-2.10.2.jar!/module-info.class. >
####<Ιουν 2, 2020, 10:01:50,510 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000014> <1591081310510> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jackson-module-jaxb-annotations-2.10.1.jar!/module-info.class. >
####<Ιουν 2, 2020, 10:01:50,511 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000015> <1591081310511> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jersey-common-2.31.jar!/META-INF/versions/11/org/glassfish/jersey/internal/jsr166/SubmissionPublisher$1.class. >
####<Ιουν 2, 2020, 10:01:50,511 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000015> <1591081310511> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jersey-common-2.31.jar!/META-INF/versions/11/org/glassfish/jersey/internal/jsr166/SubmissionPublisher$2.class. >
####<Ιουν 2, 2020, 10:01:50,512 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000015> <1591081310512> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jersey-common-2.31.jar!/META-INF/versions/11/org/glassfish/jersey/internal/jsr166/SubmissionPublisher$3.class. >
####<Ιουν 2, 2020, 10:01:50,512 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000015> <1591081310512> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jersey-common-2.31.jar!/META-INF/versions/11/org/glassfish/jersey/internal/jsr166/SubmissionPublisher$4.class. >
####<Ιουν 2, 2020, 10:01:50,512 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000015> <1591081310512> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jersey-common-2.31.jar!/META-INF/versions/11/org/glassfish/jersey/internal/jsr166/SubmissionPublisher$5.class. >
####<Ιουν 2, 2020, 10:01:50,512 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000015> <1591081310512> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jersey-common-2.31.jar!/META-INF/versions/11/org/glassfish/jersey/internal/jsr166/SubmissionPublisher$6.class. >
####<Ιουν 2, 2020, 10:01:50,513 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000015> <1591081310513> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jersey-common-2.31.jar!/META-INF/versions/11/org/glassfish/jersey/internal/jsr166/SubmissionPublisher.class. >
####<Ιουν 2, 2020, 10:01:50,515 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000015> <1591081310515> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jersey-common-2.31.jar!/META-INF/versions/11/org/glassfish/jersey/internal/jsr166/SubmissionPublisherFactory.class. >
####<Ιουν 2, 2020, 10:01:50,565 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '10' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000016> <1591081310565> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jackson-core-2.10.2.jar!/module-info.class. >
####<Ιουν 2, 2020, 10:01:50,568 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000017> <1591081310568> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jakarta.ws.rs-api-2.1.6.jar!/module-info.class. >
####<Ιουν 2, 2020, 10:01:50,571 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000018> <1591081310571> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jakarta.xml.bind-api-2.3.2.jar!/META-INF/versions/9/javax/xml/bind/ModuleUtil.class. >
####<Ιουν 2, 2020, 10:01:50,572 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000018> <1591081310572> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jakarta.xml.bind-api-2.3.2.jar!/module-info.class. >
####<Ιουν 2, 2020, 10:01:50,696 πμ EEST> <Error> <J2EE> <ANIKWS121> <AdminServer> <[STANDBY] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <8a5e9ddf-02fa-4f9a-8a0f-f8386b827432-00000019> <1591081310696> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-160248> <Unable to parse class file: zip:C:/oracle/wls12210/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/customercare-backend_war/rble4/war/WEB-INF/lib/jackson-databind-2.10.2.jar!/module-info.class. >


来源: stackexchange

问:
Codeigniter: unable to upload image (You did not select a file to upload)
When I try to upload a image to my uploads folder i get the following error:

Array ( [error] =>
  You did not select a file to upload.)

My View:

```<code><form action="<?=base_url('create_public_profile_job') ?>" class="create-profile-form" method="POST">
     <input type="file" name="userfile" size="20000" />
     <button type="submit" class="create-profile-button">Submit</button>
</form>
</code>```

My Controller

```<code>public function create_public_profile_job()
{
    if(isset($_POST['userfile']))
    {
            $this->User_model->do_upload($_POST['userfile']);
    }
}
</code>```

My Model

```<code>public function do_upload($userfile)
{
    $this->load->helper('form');
    $this->load->helper('url');

    $config['upload_path']          = 'assets/uploads/';
    $config['allowed_types']        = 'gif|jpg|png';
    $config['max_size']             = 1000000;
    $config['max_width']            = 10240000;
    $config['max_height']           = 7680000;

    $this->load->library('upload', $config);

    if ( ! $this->upload->do_upload($userfile))
    {
            $error = array('error' => $this->upload->display_errors());
            print_r($userfile);
            print_r($error);
    }
    else
    {
            $data = array('upload_data' => $this->upload->data());

            print_r($data);
    }
}
</code>```

The Model part is from the Codeigniter userguide https://codeigniter.com/userguide3/libraries/file_uploading.html

Don't really know where the issue is, because I pass the image through all functions

答:
So I figured out what my problem was. Or better problems.

My first Problem was that I had to add to my form tag: enctype="multipart/form-data" as others already pointed out in the comments

My second problem was that I had to add in my autoload.php file $autoload['libraries'] = array('database',.., 'upload');

Last but not least I changed $this->load->library('upload', $config); to $this->upload->initialize($config);
Somehow the configuration was not able to initialize correctly, so this fixed my last problem.

ContentLicense: CC BY-SA 4.0

Body:
When I try to upload a image to my uploads folder i get the following error:

Array ( [error] =>
  You did not select a file to upload.)

My View:

<form action="<?=base_url('create_public_profile_job') ?>" class="create-profile-form" method="POST">
     <input type="file" name="userfile" size="20000" />
     <button type="submit" class="create-profile-button">Submit</button>
</form>

My Controller

public function create_public_profile_job()
{
    if(isset($_POST['userfile']))
    {
            $this->User_model->do_upload($_POST['userfile']);
    }
}

My Model

public function do_upload($userfile)
{
    $this->load->helper('form');
    $this->load->helper('url');

    $config['upload_path']          = 'assets/uploads/';
    $config['allowed_types']        = 'gif|jpg|png';
    $config['max_size']             = 1000000;
    $config['max_width']            = 10240000;
    $config['max_height']           = 7680000;

    $this->load->library('upload', $config);

    if ( ! $this->upload->do_upload($userfile))
    {
            $error = array('error' => $this->upload->display_errors());
            print_r($userfile);
            print_r($error);
    }
    else
    {
            $data = array('upload_data' => $this->upload->data());

            print_r($data);
    }
}

The Model part is from the Codeigniter userguide https://codeigniter.com/userguide3/libraries/file_uploading.html

Don't really know where the issue is, because I pass the image through all functions


问:
Applying pandas bar style to a dataframe using values from another dataframe
I have df1 and df2. I want to show bars in cells of df1 using values from df2. I was able to apply other forms of styling using below code, but with bars you cannot use this method.

```<code>def color_cells(s):
    if s > 90:
        return 'color:{0}; font-weight:bold'.format('green')
    elif s>80:
        return 'background-color: light yellow;color:{0}; font-weight:regular'.format('dark yellow')
    else:
        return 'color:{0}; font-weight:bold'.format('red')

df1.style.apply(lambda x: df2.applymap(color_cells), axis=None)
</code>```

My code for getting bars in df2 is

```<code>df2.style.bar(color=['#d65f5f', '#5fba7d'])
</code>```

How do I apply above code to df1? Index and column names are same.

Adding sample dataframe:

```<code>df1=pd.DataFrame(np.random.rand(15, 10))
df2=pd.DataFrame(np.random.rand(15, 10)*100)
</code>```

答:
Here's the code that does that:

```<code>df1=pd.DataFrame(np.random.rand(15, 10))
df2=pd.DataFrame(np.random.rand(15, 10)*100)

pct = (df2 - df2.min()) / (df2.max() - df2.min() )*100

def make_bar_style(x):
    return f"background: linear-gradient(90deg,#5fba7d {x}%, transparent {x}%); width: 10em"
pct.applymap(make_bar_style).shape

df1.style.apply(lambda x: pct.applymap(make_bar_style), axis=None)
</code>```

The result is:

To demonstrate the fact that bar sizes are driven by df2, consider the following:

```<code>df2 = pd.DataFrame(np.mgrid[0:15, 0:10][0])
</code>```

The result is then:

Body:
I have df1 and df2. I want to show bars in cells of df1 using values from df2. I was able to apply other forms of styling using below code, but with bars you cannot use this method.

def color_cells(s):
    if s > 90:
        return 'color:{0}; font-weight:bold'.format('green')
    elif s>80:
        return 'background-color: light yellow;color:{0}; font-weight:regular'.format('dark yellow')
    else:
        return 'color:{0}; font-weight:bold'.format('red')

df1.style.apply(lambda x: df2.applymap(color_cells), axis=None)

My code for getting bars in df2 is

df2.style.bar(color=['#d65f5f', '#5fba7d'])

How do I apply above code to df1? Index and column names are same.

Adding sample dataframe:

df1=pd.DataFrame(np.random.rand(15, 10))
df2=pd.DataFrame(np.random.rand(15, 10)*100)

Body:
Here's the code that does that:

df1=pd.DataFrame(np.random.rand(15, 10))
df2=pd.DataFrame(np.random.rand(15, 10)*100)

pct = (df2 - df2.min()) / (df2.max() - df2.min() )*100

def make_bar_style(x):
    return f"background: linear-gradient(90deg,#5fba7d {x}%, transparent {x}%); width: 10em"
pct.applymap(make_bar_style).shape

df1.style.apply(lambda x: pct.applymap(make_bar_style), axis=None)

The result is:

To demonstrate the fact that bar sizes are driven by df2, consider the following:

df2 = pd.DataFrame(np.mgrid[0:15, 0:10][0])

The result is then:


问:
DST transitions vs. iCalendar reminders vs. RFC 5545 duration spec
How should an RFC 5545 duration of less than 24 hours act when it crosses a Daylight Saving Time (DST) transition?

For example, assume DST ends at 2:00AM on a particular day, and assume that an event starts at the second 1:10AM on that day. (The first 1:10AM is one real-world hour earlier in Daylight Time, the second 1:10AM is in Standard Time).

If that event has a -PT15M (15 mins before) duration reminder, then how many real-world minutes before the start of the event should that reminder pop up?  Should it pop up 15 real-world minutes earlier at the first 1:55AM (in Daylight Time)?  Or should it pop up 75 real-world minutes earlier at 12:55AM Daylight Time?

The spec seems to imply the latter behavior, but that behavior seems counter-intuitive to me. If I want a reminder 15 minutes beforehand, I really mean "15 minutes". However it is intuitive for longer reminders, e.g. -P1D should be 25 hours before the start of that event so that you get the reminder at the same local time on the previous day.

Anyway, how do most calendar apps deal with this unintuitive behavior?  Do they ignore the spec and always treat reminders <24 hours as exact without adjusting for DST? Or am I understanding the spec incorrectly and it's the -P1D case that will be unintuitive with the one-day reminder showing up at a different local time as the event start time?

Obviously this is somewhat of a corner case because few meetings start in the middle of the night. But there are cases where this could happen, e.g. late-night social events. And if I promise to meet you at the bar in 2 hours, I probably don't mean 1 hours or 3 hours on some nights!

Here's what the RFC 5545 spec says:

In the case of discontinuities in the time scale, such as the change from standard time to daylight time and back, the computation of the exact duration requires the subtraction or addition of the change of duration of the discontinuity.

To clarify further, according to https://standards.calconnect.org/csd/cc-51003.pdf, RFC 5545 has a concept of nominal durations (in local clock time) and exact durations (a real-world stopwatch that ignores DST). The language above is about how a nominal persisted duration should be converted to an exact duration.

This question isn't specific to a particular calendar implementation, but I'm tagging Google Calendar and Outlook here because developers using those APIs probably have the most context about these issues.

答:
Consolidation of answers and comments above and direct answers to questions posed:

First part:

"How should an RFC 5545 duration of less than 24 hours act when it
crosses a Daylight Saving Time (DST) transition?"

Answer:

Since the duration is less than 24 hours, the exact number of hours, minutes, or seconds should be used for the duration (realtime).  There is no confliction or ambiguity with durations < 24 hours.

Second part:

"If that event has a -PT15M (15 mins before) duration reminder, then
how many real-world minutes before the start of the event should that
reminder pop up? Should it pop up 15 real-world minutes earlier at the
first 1:55AM (in Daylight Time)? Or should it pop up 75 real-world
minutes earlier at 12:55AM Daylight Time?"

Answer:

15 real world minutes.  The specs clearly say that anything less than one day is exact time.   Any confusion or ambiguity around a daylight saving cutoff where a time is 'repeated' is avoided by adhering to the standard for referring a repeated clocktime during daylight savings. IE:

IE the first instance of a time such as 1.10am is the one that is assumed to be intended when one sees 1.10am for a timezone.

If one wants to refer to the second instance of 1.10 am one must use another timezone (eg UTC) to clearly identify the actual moment in time.

Third Part:

"how do most calendar apps deal with this unintuitive behavior? Do
they ignore the spec and always treat reminders <24 hours as exact
without adjusting for DST? Or am I understanding the spec incorrectly
and it's the -P1D case that will be unintuitive with the one-day
reminder showing up at a different local time as the event start
time?"

Answer:

They don't ignore the spec. The specification deals with this as one would intuitively expect. A reminder of < 24 hours (PT24H) is exact.  No need to adjust for DST.

Similarly a reminder of 24 hours (PT24H) before should occur exactly 24 hours before.

In the case of a one day (P1D) reminder, a 1 day reminder should occur at the same time the previous day be this 23,24,or 25 hours before. This is as one would intuitively expect.  The actual number of hours will of course vary depending on the day's place in the calendar.

P1D is not the same as PT24H, as P1D will depend on the dates place in the calendar, whether DST changeover is happening that day, whereas PT24H is exact.

References:

Daylight saving time and time zone best practices

https://www.rfc-editor.org/rfc/rfc5545#section-3.3.5  see DATETIME

https://icalendar.org/iCalendar-RFC-5545/3-3-6-duration.html

https://icalendar.org/iCalendar-RFC-5545/3-8-2-5-duration.html


问:
What is the different between encode and encription?
I am using windows form and mysql.

I am very confuse about different between encode and encription?.

encode also change the string value. and decode is give back the string.

In my program,...

userid - mcs
password - mcs

i want to store these strings in mysql database. but not a same string, for security purpose.

What is secure way to store these datas.

encode and encription which is best for this requirement.

thanks in advance.

i googled for the different but till i am not clear!. any one pls tell me  the different between encode and encription?. For my requrement what i use?.

Before leave this question just vist my downvote question in Click here

答:
In short:

Encoding transforms data from one representation to another, in such a way that anybody can transform it back. So if you want to prevent other people from seeing the original data, encoding alone is not useful at all.

Encryption transforms data in such a way that only persons who know a secret key can get the original data back.

However, there is a third option, which is what you probably will want to use in this case (which is the reason I am posting this, since others have already stated the above points):

Hashing. This transforms the data in such a way that no one, not even you, can get the data back - however, each time you hash the same data, you will get the same result. Why is this useful? In your case, by hashing the password, you will accomplish your goal of preventing people who can access the database from seeing what the passwords are. However, you can still verify that someone who tries to log in has provided the correct password: simply hash the password the user entered, and if the result matches what is stored in the database, the password was correct. This is a standard and highly recommended approach; see the Wikipedia article on password hashing.

ContentLicense: CC BY-SA 3.0


问:
French keyboard on macOS, altering the behavior of the tilde ~ key
Like most french users, when I want to go to my terminal home, I have to type

```<code>cd ~
</code>```

However, the keyboard requires me to press options + n and then space to disambiguate between me trying to do ñ or ~ for example.

Is there a way to overload this behavior, as I almost never want to use the tilde symbol the way spanish people does ?

Karabiner looked promising but it won't let you define custom mapping. It requires you to chose between a set of predefined ones, online.

答:
Ukelele can create a keyboard variation where tilde ~ is not a dead key, probably your best bet if you can get it to launch without hanging.  You can always type ñ by holding down the n key for a second.  Karabiner-Elements, AppleScript, etc. can only type what your keyboard supports, e.g., these bash commands with Karabiner:

```<code>cat > ~/.config/karabiner/assets/complex_modifications/azerty-tilde.json <<.
{"title": "AZERTY tilde",
 "rules": [
   {"description": "AZERTY tilde emits space after dead key ~ (option-n) for French keyboard.
Bug: auto-repeat gets only spaces after the initial tilde.",
    "manipulators": [
      {"type": "basic",
       "from": {"key_code": "n", "modifiers": {"mandatory": ["option"]}},
       "to": [{"key_code": "n", "modifiers": ["option"]},
              {"key_code": "spacebar"}]}]}]}
.
</code>```

Now the "AZERTY tilde" rule is installed.

```<code>Open -a Karabiner-Elements
</code>```

Pick this Karabiner-Elements menu sequence to enable the "AZERTY tilde" rule:

Window > Karabiner-Elements Preferences > Complex Modifications > Rules > Add Rule

In the Add rule window, find "AZERTY tilde" on the left and use the corresponding  ⊕ Enable  button on the right.
Now every dead-key tilde is followed by a space.  The "AZERTY tilde"  ⊕ Remove  button disables it.
Tested in Emacs with ns-option-modifier set to none, FireFox, iTerm and Terminal.

Body:
Like most french users, when I want to go to my terminal home, I have to type

cd ~

However, the keyboard requires me to press options + n and then space to disambiguate between me trying to do ñ or ~ for example.

Is there a way to overload this behavior, as I almost never want to use the tilde symbol the way spanish people does ?

Karabiner looked promising but it won't let you define custom mapping. It requires you to chose between a set of predefined ones, online.

Body:
Ukelele can create a keyboard variation where tilde ~ is not a dead key, probably your best bet if you can get it to launch without hanging.  You can always type ñ by holding down the n key for a second.  Karabiner-Elements, AppleScript, etc. can only type what your keyboard supports, e.g., these bash commands with Karabiner:

cat > ~/.config/karabiner/assets/complex_modifications/azerty-tilde.json <<.
{"title": "AZERTY tilde",
 "rules": [
   {"description": "AZERTY tilde emits space after dead key ~ (option-n) for French keyboard.
Bug: auto-repeat gets only spaces after the initial tilde.",
    "manipulators": [
      {"type": "basic",
       "from": {"key_code": "n", "modifiers": {"mandatory": ["option"]}},
       "to": [{"key_code": "n", "modifiers": ["option"]},
              {"key_code": "spacebar"}]}]}]}
.

Now the "AZERTY tilde" rule is installed.

Open -a Karabiner-Elements

Pick this Karabiner-Elements menu sequence to enable the "AZERTY tilde" rule:

Window > Karabiner-Elements Preferences > Complex Modifications > Rules > Add Rule

In the Add rule window, find "AZERTY tilde" on the left and use the corresponding  ⊕ Enable  button on the right.
Now every dead-key tilde is followed by a space.  The "AZERTY tilde"  ⊕ Remove  button disables it.
Tested in Emacs with ns-option-modifier set to none, FireFox, iTerm and Terminal.


问:
How to configure Asp.Net Web Application with IIS
I am using Asp.Net Standard version 4.7 with MVC and attempting to deploy to IIS Express. I am facing several issues in the configuration and cant seem to find straight forward documentation for asp.Net standard. I added a website named localHost aside from Default Website in IIS. I am facing 2 issues.
 When I click browse from IIS,  it navigates http://localhost/Views/Home/Index.cshtml  I get a 404 error.

Server Error in '/' Application. The resource cannot be found

When Debugging From Visual studio 2019 I get

Process with Id of xxxx cant be found
  .
  Description: HTTP 404.

I am thinking there some port configuration issue but I am unclear on how to configure.

I attached screenshots of my configuration settings.

答:
Please follow Microsoft guideline.

You are trying to access wrong Url. Try below url to access:

```<code>http://localhost:8080/Home/Index
</code>```

Body:
Please follow Microsoft guideline.

You are trying to access wrong Url. Try below url to access:

http://localhost:8080/Home/Index


问:
Stacking 2-d numpy arrays to get a 3-d array in python
I am trying to stack a few 2-D arrays to obtain a 3-D array in python. My motivation behind doing this is to plot the spatial dependence of a variable: var(x,y) where x and y are two different dimensions, for different parameter values param. A minimum reproducible example for the same has been attached below:

```<code>while (param<=2):
 var(x,y)= fun  # fun is a function which returns var(x,y) as mentioned above
 param+=1
</code>```

I want to keep on stacking the 2-D arrays var(x,y) for  different values of param, along a 3rd dimension. My output should be of the form :- For param=0 : var(x,y), For param=1 : var(x,y), For param=2 : var(x,y). Any help regarding the construction of the 3-D array would be highly appreciated.
Please note that var(x,y) is a 2-D array.

答:
As suggested by hpaulj, the key idea is to have a list of the 2D arrays and then assemble them into a 3D array. It's usually more efficient to create the array in one go (no appending), so the following should be ideal:</p>

```<code>import numpy as np

var_lst = []  # This is where you store the var arrays
while (param<=2):
    var = fun  # fun is a function which returns var(x,y) as mentioned above
    var_lst.append(var)
    param+=1

# Creates a 3D array with the following axes (x, y, param)
var_arr = np.stack(var_lst, 2)

# If later you want different axes, like (param, x, y), you can always swap them around with transpose
var_arr = var_arr.transpose(2, 0, 1)
</code>```

Body:
I am trying to stack a few 2-D arrays to obtain a 3-D array in python. My motivation behind doing this is to plot the spatial dependence of a variable: var(x,y) where x and y are two different dimensions, for different parameter values param. A minimum reproducible example for the same has been attached below:

while (param<=2):
 var(x,y)= fun  # fun is a function which returns var(x,y) as mentioned above
 param+=1

I want to keep on stacking the 2-D arrays var(x,y) for  different values of param, along a 3rd dimension. My output should be of the form :- For param=0 : var(x,y), For param=1 : var(x,y), For param=2 : var(x,y). Any help regarding the construction of the 3-D array would be highly appreciated.
Please note that var(x,y) is a 2-D array.

Body:
As suggested by hpaulj, the key idea is to have a list of the 2D arrays and then assemble them into a 3D array. It's usually more efficient to create the array in one go (no appending), so the following should be ideal:

import numpy as np

var_lst = []  # This is where you store the var arrays
while (param<=2):
    var = fun  # fun is a function which returns var(x,y) as mentioned above
    var_lst.append(var)
    param+=1

# Creates a 3D array with the following axes (x, y, param)
var_arr = np.stack(var_lst, 2)

# If later you want different axes, like (param, x, y), you can always swap them around with transpose
var_arr = var_arr.transpose(2, 0, 1)


问:
Readjusting responsive bootstrap rows and column
Please how can i make centralized these 3 buttons and the last button be centralized on the next line without affecting the whole framework.

```<code><div class="col-md-4 col-12 col-lg-3 center-search">
                             <div class="">
                                 <button (click)="searchEmployeeName()" class="btn btn-raised mr-1 shadow-z-2 btn-success btn-sm">
                                     {{'Search' | translate}}
                                 </button>
                           </div>
                           <div class="">
                                <button (click)="reset()" class="btn btn-raised mr-1 shadow-z-2 btn-warning btn-sm ml-1">
                                   {{'Reset' | translate}}
                                </button>
                             </div>
                             <div class="">
                                <button (click)="viewAll()"  class="btn btn-raised mr-1 shadow-z-2 btn-info btn-sm ml-1">
                                    {{'View All' | translate}}
                                </button>
                            </div>
                            <div class="">
                                <button (click)="exportToExcel()" class="btn btn-raised mr-1 pull-rightshadow-z-2 btn-danger btn-sm ml-1">
                                   {{'Export To Excel' | translate}}
                                </button>
                            </div>
                         </div>
</code>```

答:
Add another div:

```<code><div class="col-md-4 col-12 col-lg-3 center-search">
<div class="d-flex justify-content-center">
    <div class="">
        <button (click)="searchEmployeeName()" class="btn btn-raised mr-1 shadow-z-2 btn-success btn-sm">
            {{'Search' | translate}}
        </button>
    </div>
    <div class="">
        <button (click)="reset()" class="btn btn-raised mr-1 shadow-z-2 btn-warning btn-sm ml-1">
            {{'Reset' | translate}}
        </button>
    </div>
    <div class="">
        <button (click)="viewAll()" class="btn btn-raised mr-1 shadow-z-2 btn-info btn-sm ml-1">
            {{'View All' | translate}}
        </button>
    </div>
    <div class="">
        <button (click)="exportToExcel()" class="btn btn-raised mr-1 pull-rightshadow-z-2 btn-danger btn-sm ml-1">
            {{'Export To Excel' | translate}}
        </button>
    </div>
</div>
</code>```

Body:
Please how can i make centralized these 3 buttons and the last button be centralized on the next line without affecting the whole framework.

                                 <button (click)="searchEmployeeName()" class="btn btn-raised mr-1 shadow-z-2 btn-success btn-sm">
                                     {{'Search' | translate}}
                                 </button>

                                <button (click)="reset()" class="btn btn-raised mr-1 shadow-z-2 btn-warning btn-sm ml-1">
                                   {{'Reset' | translate}}
                                </button>

                                <button (click)="viewAll()"  class="btn btn-raised mr-1 shadow-z-2 btn-info btn-sm ml-1">
                                    {{'View All' | translate}}
                                </button>

                                <button (click)="exportToExcel()" class="btn btn-raised mr-1 pull-rightshadow-z-2 btn-danger btn-sm ml-1">
                                   {{'Export To Excel' | translate}}
                                </button>

Body:
Add another div:

<div class="col-md-4 col-12 col-lg-3 center-search">
<div class="d-flex justify-content-center">
    <div class="">
        <button (click)="searchEmployeeName()" class="btn btn-raised mr-1 shadow-z-2 btn-success btn-sm">
            {{'Search' | translate}}
        </button>
    </div>
    <div class="">
        <button (click)="reset()" class="btn btn-raised mr-1 shadow-z-2 btn-warning btn-sm ml-1">
            {{'Reset' | translate}}
        </button>
    </div>
    <div class="">
        <button (click)="viewAll()" class="btn btn-raised mr-1 shadow-z-2 btn-info btn-sm ml-1">
            {{'View All' | translate}}
        </button>
    </div>
    <div class="">
        <button (click)="exportToExcel()" class="btn btn-raised mr-1 pull-rightshadow-z-2 btn-danger btn-sm ml-1">
            {{'Export To Excel' | translate}}
        </button>
    </div>
</div>


问:
blogger  error bX-d55p58
My problem is in blogger template design
When I add this tag  this error message appear to me

Is there any solution?

答:
```<code><html b:css='false' b:layoutsVersion='3'>
</code>```

Eg:

Note:  can't be used in b:layoutsVersion 1.```

Title: blogger <b:template-skin> error bX-d55p58

Body:
<html b:css='false' b:layoutsVersion='3'>

Eg:
<html b:css='false' b:layoutsVersion='3' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>

Note: <b:template-skin> can't be used in b:layoutsVersion 1.


问:
How to enforce user to upload only specific file type in Angular
I want to enforce user to upload only pdf files in Angular 7 this is part of my code.When i click the button which is "Select File" at the page it brings "PDF File" but also brings "All Files" i want to enforce user by javascript function or typescript function help me please :)

Typescript

```<code>  filesP2: File[] = [];
  lastInvalidsP2: any;
  sendableFormDataP2: FormData;
  httpEmitter: Subscription;
  httpEvent: HttpEvent<{}>;
  maxSize: any;
  lastFileAt: Date;
  isBelgeVisible: boolean = false;
  uploadedBelgeId: number = null;

</code>```

HTML

```<code><input style="margin: 0 auto;" ngfSelect type="file" [(files)]="filesP2" accept=".pdf" [maxSize]="maxSize" [(lastInvalids)]="lastInvalidsP2" (filesChange)="lastFileAt=getDate()"/>

<ngfFormData [files]="filesP2" postName="file" [(FormData)]="sendableFormDataP2"></ngfFormData>

</code>```

答:
If you are using reactive forms you can create custom validator

import {
  FormControl
} from '@angular/forms';

export function requiredFileType(expectedFormats: string[]) {
  return function(control: FormControl) {
    const files = control.value;
    if (files) {
      const hasOtherType = files.some(file => {
        const splitParts = file.name.split('.');
        const extension = splitParts[splitParts.length - 1].toLowerCase();

        return 'pdf' != extension.toLowerCase();
      });
      if (hasOtherType) {
        return {
          requiredFileType: 'Wrong file type. Only pdf type supported.'
        };
      }
    }

    return null;
  };
}

//usage in angular forms
File: new FormControl({
  value: null,
  disabled: true
}, [Validators.required, requiredFileType(['xlsx', 'xlsm'])])```

Body:
I want to enforce user to upload only pdf files in Angular 7 this is part of my code.When i click the button which is "Select File" at the page it brings "PDF File" but also brings "All Files" i want to enforce user by javascript function or typescript function help me please :)

Typescript

  filesP2: File[] = [];
  lastInvalidsP2: any;
  sendableFormDataP2: FormData;
  httpEmitter: Subscription;
  httpEvent: HttpEvent<{}>;
  maxSize: any;
  lastFileAt: Date;
  isBelgeVisible: boolean = false;
  uploadedBelgeId: number = null;

HTML

<input style="margin: 0 auto;" ngfSelect type="file" [(files)]="filesP2" accept=".pdf" [maxSize]="maxSize" [(lastInvalids)]="lastInvalidsP2" (filesChange)="lastFileAt=getDate()"/>

<ngfFormData [files]="filesP2" postName="file" [(FormData)]="sendableFormDataP2"></ngfFormData>


问:
symfony/config arrayNode prototype addDefaultsIfNotSet
I'm sorry to say I can't find a way to add a default value to a "symfony/config": "2.6.4" ConfigurationInterface !

What's wanted is this type of config :

```<code>X:
    Y:
        - test
        - testing
</code>```

With default to :

```<code>X:
    Y:
        - test
</code>```

By "default" I mean : if Y config branch is not set on the read configuration file, the $processor->processConfiguration should add it (and it does ! If I remove the ->prototype...)

Here is my code :

class Definition implements ConfigurationInterface
{
    /**
     * {@inheritdoc}
     */
    public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root("X");
        $rootNode
            ->children()
                ->arrayNode("Y")
                    ->addDefaultsIfNotSet()
                    ->info("Multiple values can be used")
                    ->cannotBeEmpty()
                    ->addDefaultIfNotSet()
                    ->defaultValue(array("test"))
                    ->prototype("scalar")
                        ->validate()
                        ->ifNotInArray(array("test", "testing"))
                            ->thenInvalid("Invalid value %s")
                        ->end()
                    ->end()
                ->end()
            ->end()
        ;

        return $treeBuilder;
    }
}
```

<p>Sure, I read this question Using the Symfony2 configuration class, how do I define an array node whose children don't have keys?</p>

<p>My current code implements this way as you can read, but it does not work, my code throws :</p>

```[Symfony\Component\Config\Definition\Exception\InvalidDefinitionException]
  ->addDefaultsIfNotSet() is not applicable to prototype nodes at path "X.Y"
```

答:
You can do it like so:

```<code>$node
    ->fixXmlConfig('driver')
    ->children()
        ->arrayNode('drivers')
            ->scalarPrototype()->end()
        ->end()
    ->end()
;
</code>```

This allows:

```<code>drivers: ['mysql', 'sqlite']
</code>```

More info here
https://symfony.com/doc/current/components/config/definition.html#array-node-options

Body:
I'm sorry to say I can't find a way to add a default value to a "symfony/config": "2.6.4" ConfigurationInterface !

What's wanted is this type of config :

X:
    Y:
        - test
        - testing

With default to :

X:
    Y:
        - test

By "default" I mean : if Y config branch is not set on the read configuration file, the $processor->processConfiguration should add it (and it does ! If I remove the ->prototype...)

Here is my code :

class Definition implements ConfigurationInterface
{
    /**
     * {@inheritdoc}
     */
    public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root("X");
        $rootNode
            ->children()
                ->arrayNode("Y")
                    ->addDefaultsIfNotSet()
                    ->info("Multiple values can be used")
                    ->cannotBeEmpty()
                    ->addDefaultIfNotSet()
                    ->defaultValue(array("test"))
                    ->prototype("scalar")
                        ->validate()
                        ->ifNotInArray(array("test", "testing"))
                            ->thenInvalid("Invalid value %s")
                        ->end()
                    ->end()
                ->end()
            ->end()
        ;

        return $treeBuilder;
    }
}

Sure, I read this question Using the Symfony2 configuration class, how do I define an array node whose children don't have keys?

My current code implements this way as you can read, but it does not work, my code throws :

[Symfony\Component\Config\Definition\Exception\InvalidDefinitionException]
  ->addDefaultsIfNotSet() is not applicable to prototype nodes at path "X.Y"

Body:
You can do it like so:

$node
    ->fixXmlConfig('driver')
    ->children()
        ->arrayNode('drivers')
            ->scalarPrototype()->end()
        ->end()
    ->end()
;

This allows:

drivers: ['mysql', 'sqlite']

More info here
https://symfony.com/doc/current/components/config/definition.html#array-node-options


问:
Python Tkinter button width and heigth
I'm new to tkinter, trying to create a square botton but I can't.

```<code>from tkinter import *

root = Tk()
button1 = Button(text = "Cuadrado", height = 10, width = 10).pack()

root.mainloop()
</code>```

The widht and the height are the same valor, but the button that create with the code is a rectangle.
Why does it happen?

答:
The height of the characters is about 2.3 times greater than the width. So, to draw a square button, you can use proportions like this:</p>

```<code>Button(width=2, height=1)
Button(width=9, height=4)
Button(width=19, height=8)
Button(width=37, height=16)
</code>```

Title: Python Tkinter button width and heigth

Body:
I'm new to tkinter, trying to create a square botton but I can't.

from tkinter import *

root = Tk()
button1 = Button(text = "Cuadrado", height = 10, width = 10).pack()

root.mainloop()

The widht and the height are the same valor, but the button that create with the code is a rectangle.
Why does it happen?

Body:
The height of the characters is about 2.3 times greater than the width. So, to draw a square button, you can use proportions like this:

Button(width=2, height=1)
Button(width=9, height=4)
Button(width=19, height=8)
Button(width=37, height=16)


问:
How to sort values with strings on the axis in scatter plot
How to sort the values on x axis in an ascending order in a scatter plot?

```<code>fig, ax = plt.subplots()
fig.set_size_inches(18, 8)
ax.scatter(data=ipl,x='budget',y='player')

n = 4

for idx, label in enumerate(ax.xaxis.get_ticklabels()):
    if idx % n != 0:
        label.set_visible(False)
</code>```

In the image,the values on x axis are randomly arranged.

答:
you can use a small regex to extract the values, convert to int and sort by the integer values:</p>

```<code>#dummy data
ipl = pd.DataFrame(
    {
        'budget': ['${}M'.format(a) for a in np.random.randint(0,200,10)],
        'player': np.random.randint(-10,10,10)
    }

)

ipl['values'] = ipl['budget'].str.extract('([0-9]+)').astype(int)
ipl.sort_values(by='values', inplace=True)
</code>```

Body:
How to sort the values on x axis in an ascending order in a scatter plot?

fig, ax = plt.subplots()
fig.set_size_inches(18, 8)
ax.scatter(data=ipl,x='budget',y='player')

n = 4

for idx, label in enumerate(ax.xaxis.get_ticklabels()):
    if idx % n != 0:
        label.set_visible(False)

In the image,the values on x axis are randomly arranged.

Body:
you can use a small regex to extract the values, convert to int and sort by the integer values:

#dummy data
ipl = pd.DataFrame(
    {
        'budget': ['${}M'.format(a) for a in np.random.randint(0,200,10)],
        'player': np.random.randint(-10,10,10)
    }

)

ipl['values'] = ipl['budget'].str.extract('([0-9]+)').astype(int)
ipl.sort_values(by='values', inplace=True)


问:
What ressources of my computer does Holographic Remoting Player utilize most?
Hello I am working on a project where I want to show high polygon 3D-objects. I figured out the Holographic Remoting Player is the easiest and fastest way to get it running. My question is: Does Holographic Remoting need a powerful CPU or GPU? On the official site of Microsoft it says it needs at least a GTX 970, but it still doesn't run smoothely. What CPU is the minimum requirement?</p>

答:
In addition to computer hardware requirements, you also need to pay attention to your wireless network environment, please ensure the Bit rate and stability of your wireless network. Check out what Microsoft suggested here: PC System Requirements.

If you cannot confirm the reason for the holographic stuttering, you can follow this doc to enable Diagnostics, the number of FPS and Latency will show you(in HoloLens1), the former number dependent on your hardware device, and the latter number is largely dependent on your Wi-Fi network.


问:
Use Android Camera without surface View
I'm developing on android, i want to do somethings with camera (process pixels's values), but just in background, is it possible to do it without surface view? just use a buffer to read pixels's values and do processing.
thanks for every one can help me  </p>

答:
I've been looking for an answer to this for a while. I found it there, copied here for convenience.

http://handycodeworks.com/?p=19

Basically, let's just create a dummy SurfaceView (it works even inside a Service), and use it for Camera functions.

```<code>SurfaceView view = new SurfaceView(this);
c.setPreviewDisplay(view.getHolder());
c.startPreview();
c.takePicture(shutterCallback, rawPictureCallback, jpegPictureCallback);
</code>```

Title: Use Android Camera without surface View

Body:
I've been looking for an answer to this for a while. I found it there, copied here for convenience.

http://handycodeworks.com/?p=19

Basically, let's just create a dummy SurfaceView (it works even inside a Service), and use it for Camera functions.

SurfaceView view = new SurfaceView(this);
c.setPreviewDisplay(view.getHolder());
c.startPreview();
c.takePicture(shutterCallback, rawPictureCallback, jpegPictureCallback);


问:
AND statement in Date Range Filter
I have a form, with a data sheet subform. This subform has rows with WageDate and TipDate. I have the follwing bit of code to filter the the records to display the records with the WageDate that falls in the range:

```<code>Private Sub btnDateRange_Click()
Dim Filter As String

Filter = "[WageDate] Between #" & Format(Me!TxtStartDate.Value, "yyyy\/mm\/dd") & "# And #" & Format(Me!txtEndDate.Value, "yyyy\/mm\/dd") & "#"

Me!sbfrm_qryDeliveries.Form.Filter = Filter
Me!sbfrm_qryDeliveries.Form.FilterOn = True
End Sub
</code>```

My question is how do I change this up so that it also filters the TipDate at the same time, so that the resulting records would be those with both WageDate AND TipDate that fall in the selected range? the records might not be equal.  That is, one record may have a WageDate that falls out of the range, but a TipDate that does.

And once I get that figured out, is there a way to selectively SUM a column based on that date?  For instance.  Let's say I filter a date range and four records are returned two have WageDates that fall in the criteria, and two have TipDates thats fall in the criteria.  WageDate and TipDate are both in the same datasheet.  So if I were to just do a SUM of Wage and TipAmount columns I'd get a sum which would include numbers in those columns that don't really belong. The TipAmount column might have an amount come up because the WageDate fell in the range but not the TipDate.  So I need to be able to SUM just the rows in each of those columns that ONLY fall within the selected date range.  I hope this wasn't too confusing.  Maybe there's a better way to do this completely than the way I have it, I don't know.  Oh, for information, the subform is based from a query, and both wages and tips are in their own separate tables. tblWages, tblTips

答:
the resulting records would be those with both WageDate AND TipDate
  that fall in the selected range?

Private Sub btnDateRange_Click()

    Dim Filter As String

    Filter = "([WageDate] Between #" & Format(Me!TxtStartDate.Value, "yyyy\/mm\/dd") & "# And #" & Format(Me!txtEndDate.Value, "yyyy\/mm\/dd") & "#) " & _
        "And ([TipDate] Between #" & Format(Me!TxtStartDate.Value, "yyyy\/mm\/dd") & "# And #" & Format(Me!txtEndDate.Value, "yyyy\/mm\/dd") & "#)"

    Me!sbfrm_qryDeliveries.Form.Filter = Filter
    Me!sbfrm_qryDeliveries.Form.FilterOn = True

End Sub
```

<p>However, though not clear, you probably mean OR here:</p>

<blockquote>
  <p>one record may have a WageDate that falls out of the range, but a
  TipDate that does.</p>
</blockquote>

```Filter = "([WageDate] Between #" & Format(Me!TxtStartDate.Value, "yyyy\/mm\/dd") & "# And #" & Format(Me!txtEndDate.Value, "yyyy\/mm\/dd") & "#) " & _
    "Or ([TipDate] Between #" & Format(Me!TxtStartDate.Value, "yyyy\/mm\/dd") & "# And #" & Format(Me!txtEndDate.Value, "yyyy\/mm\/dd") & "#)"
```

Note:

You only need to Format data you plan on displaying.

This is a plain wrong statement. You must format a date value as a string expression to concatenate it with the SQL command. If you don't, an implicit cast will be forced on you using whatever the local settings might be, and you loose control. Applying CDate or DateValue doesn't change that and will here be superfluous or even a source of error as they don't accept Null values.

Title: AND statement in Date Range Filter

Body:
I have a form, with a data sheet subform. This subform has rows with WageDate and TipDate. I have the follwing bit of code to filter the the records to display the records with the WageDate that falls in the range:

Private Sub btnDateRange_Click()
Dim Filter As String

Filter = "[WageDate] Between #" & Format(Me!TxtStartDate.Value, "yyyy\/mm\/dd") & "# And #" & Format(Me!txtEndDate.Value, "yyyy\/mm\/dd") & "#"

Me!sbfrm_qryDeliveries.Form.Filter = Filter
Me!sbfrm_qryDeliveries.Form.FilterOn = True
End Sub

My question is how do I change this up so that it also filters the TipDate at the same time, so that the resulting records would be those with both WageDate AND TipDate that fall in the selected range? the records might not be equal.  That is, one record may have a WageDate that falls out of the range, but a TipDate that does.

And once I get that figured out, is there a way to selectively SUM a column based on that date?  For instance.  Let's say I filter a date range and four records are returned two have WageDates that fall in the criteria, and two have TipDates thats fall in the criteria.  WageDate and TipDate are both in the same datasheet.  So if I were to just do a SUM of Wage and TipAmount columns I'd get a sum which would include numbers in those columns that don't really belong. The TipAmount column might have an amount come up because the WageDate fell in the range but not the TipDate.  So I need to be able to SUM just the rows in each of those columns that ONLY fall within the selected date range.  I hope this wasn't too confusing.  Maybe there's a better way to do this completely than the way I have it, I don't know.  Oh, for information, the subform is based from a query, and both wages and tips are in their own separate tables. tblWages, tblTips

Body:
the resulting records would be those with both WageDate AND TipDate
  that fall in the selected range?

Private Sub btnDateRange_Click()

    Dim Filter As String

    Filter = "([WageDate] Between #" & Format(Me!TxtStartDate.Value, "yyyy\/mm\/dd") & "# And #" & Format(Me!txtEndDate.Value, "yyyy\/mm\/dd") & "#) " & _
        "And ([TipDate] Between #" & Format(Me!TxtStartDate.Value, "yyyy\/mm\/dd") & "# And #" & Format(Me!txtEndDate.Value, "yyyy\/mm\/dd") & "#)"

    Me!sbfrm_qryDeliveries.Form.Filter = Filter
    Me!sbfrm_qryDeliveries.Form.FilterOn = True

End Sub

However, though not clear, you probably mean OR here:

one record may have a WageDate that falls out of the range, but a
  TipDate that does.

Filter = "([WageDate] Between #" & Format(Me!TxtStartDate.Value, "yyyy\/mm\/dd") & "# And #" & Format(Me!txtEndDate.Value, "yyyy\/mm\/dd") & "#) " & _
    "Or ([TipDate] Between #" & Format(Me!TxtStartDate.Value, "yyyy\/mm\/dd") & "# And #" & Format(Me!txtEndDate.Value, "yyyy\/mm\/dd") & "#)"

Note:

You only need to Format data you plan on displaying.

This is a plain wrong statement. You must format a date value as a string expression to concatenate it with the SQL command. If you don't, an implicit cast will be forced on you using whatever the local settings might be, and you loose control. Applying CDate or DateValue doesn't change that and will here be superfluous or even a source of error as they don't accept Null values.


问:
Do I need to specify a data type boolean in typescript when the value is already set in false?
public expanded: boolean = false;

Can the above piece of code be simplified to something like public expanded = false;?

Just wondering if the transpiler will benefit from it?

答:
Short answer, yes, you can simply write it as

```<code>public expanded = false;
</code>```

This is because for primitive data types such as boolean, TypeScript will be able to automatically infer the type. In this case, expanded will definitely be typed as boolean without explicitly providing the boolean type.

For instance, if you try to reassign the expanded property somewhere along the code, with any other value that is not a boolean, such as a string,

```<code>this.expanded = '1';
</code>```

you will realise that it will throw an error:

TS2322: Type '"1"' is not assignable to type 'boolean'.

Body:
Short answer, yes, you can simply write it as

public expanded = false;

This is because for primitive data types such as boolean, TypeScript will be able to automatically infer the type. In this case, expanded will definitely be typed as boolean without explicitly providing the boolean type.

For instance, if you try to reassign the expanded property somewhere along the code, with any other value that is not a boolean, such as a string,

this.expanded = '1';

you will realise that it will throw an error:

TS2322: Type '"1"' is not assignable to type 'boolean'.


Title: Labeling by date in two data frames

Body:
df1
name date
A    14-04-05
A    14-05-08
A    14-08-09
A    15-01-05
B    18-07-05
B    18-08-09
B    18-10-02
C    19-01-03
C    19-02-04
C    19-03-30
D    16-04-01
D    16-08-04

df2
name startdate
A    14-07-07
B    18-09-09
C    19-03-15
D    16-06-28

Record all dates in one dataset, The second dataset records the start date.

I want to label the records of df1, compared to the start date of df2, record '0' if it is earlier than the start date and '1' if it is the day after the start date.

result what I want

df1
name date     Label startdate
A    14-04-05 0     14-07-07
A    14-05-08 0     14-07-07
A    14-08-09 1     14-07-07
A    15-01-05 1     14-07-07
B    18-07-05 0     18-09-09
B    18-08-09 0     18-09-09
B    18-10-02 1     18-09-09
C    19-01-03 0     19-03-15
C    19-02-04 0     19-03-15
C    19-03-30 1     19-03-15
D    16-04-01 0     16-06-28
D    16-08-04 1     16-06-28

I tried to handle it using datetime, but it didn't work..

Simple example dataset sample

df1 = pd.DataFrame(np.array([['A', '2015-12-21'],['A', '2015-12-22'], ['A', '2015-12-25'], ['B', '2018-01-28'],['B', '2018-02-28'],['B', '2018-03-28']]),
                   columns=['name', 'date'])

df2 = pd.DataFrame(np.array([['A', '2015-12-23'], ['B', '2018-03-01']]),
                   columns=['name', 'startdate'])

Thank you for reading

Body:
Use DataFrame.merge for add new column and then compare by Series.gt for greater with DataFrame.insert for new column by position, for convert to numeric 0,1 is used Series.view:

df1['date'] = pd.to_datetime(df1['date'])
df2['startdate'] = pd.to_datetime(df2['startdate'])

df = df1.merge(df2, on='name', how='left')
df.insert(2, 'Label', df['date'].gt(df['startdate']).view('i1'))
print (df)
   name       date  Label  startdate
0     A 2014-04-05      0 2014-07-07
1     A 2014-05-08      0 2014-07-07
2     A 2014-08-09      1 2014-07-07
3     A 2015-01-05      1 2014-07-07
4     B 2018-07-05      0 2018-09-09
5     B 2018-08-09      0 2018-09-09
6     B 2018-10-02      1 2018-09-09
7     C 2019-01-03      0 2019-03-15
8     C 2019-02-04      0 2019-03-15
9     C 2019-03-30      1 2019-03-15
10    D 2016-04-01      0 2016-06-28
11    D 2016-08-04      1 2016-06-28

Or:

df1['date'] = pd.to_datetime(df1['date'])
df2['startdate'] = pd.to_datetime(df2['startdate'])

df1['startdate'] = df1['name'].map(df2.set_index('name')['startdate'])
df1.insert(2, 'Label', df1['date'].gt(df1['startdate']).view('i1'))
print (df1)
   name       date  Label  startdate
0     A 2014-04-05      0 2014-07-07
1     A 2014-05-08      0 2014-07-07
2     A 2014-08-09      1 2014-07-07
3     A 2015-01-05      1 2014-07-07
4     B 2018-07-05      0 2018-09-09
5     B 2018-08-09      0 2018-09-09
6     B 2018-10-02      1 2018-09-09
7     C 2019-01-03      0 2019-03-15
8     C 2019-02-04      0 2019-03-15
9     C 2019-03-30      1 2019-03-15
10    D 2016-04-01      0 2016-06-28
11    D 2016-08-04      1 2016-06-28


问:
Finding values in postgres array (some must be in, some must not be in at the same query)
I have a ids integer[]

And, I want to find rows which contain 1 but must not contains 2, 3, 4

but [1] OR [1, 5] OR [1, 6, 7] <- this data is OK. [2,3,4] is not.

So I tried this way

```<code>SELECT *
FROM table_test
WHERE 1 = ANY(ids) AND 2 <> ANY(ids)  AND 3 <> ANY(ids)  AND 4 <> ANY(ids)
</code>```

but it returns 1 = ANY(ids) part

```<code>[1 2 3]
[1 3 4]
[1]
[1 5]
[1 6 7]
</code>```

I want this data

```<code>[1]
[1 5]
[1 6 7]
</code>```

How can I solve this problem?

Thanks  a lot!

答:
Your query is very close, but what is actually does is:

check if any array element contains 1 (this is ok)

check if any array element does not contain 2, 3 and 4 (this means [1,3,4] is valid beacuse 1 is not 2,3 or 4, so the condition is fulfilled)

What you really have to check with case #2 is that ALL elements are not 2, 3, 4.

Your updated query is now:

```<code>SELECT * FROM table_test WHERE 1 = ANY(ids) AND 2 <> ALL(ids)  AND 3 <> ALL(ids)  AND 4 <> ALL(ids);
</code>```

Body:
I have a ids integer[]

And, I want to find rows which contain 1 but must not contains 2, 3, 4

but [1] OR [1, 5] OR [1, 6, 7] <- this data is OK. [2,3,4] is not.

So I tried this way

SELECT *
FROM table_test
WHERE 1 = ANY(ids) AND 2 <> ANY(ids)  AND 3 <> ANY(ids)  AND 4 <> ANY(ids)

but it returns 1 = ANY(ids) part

[1 2 3]
[1 3 4]
[1]
[1 5]
[1 6 7]

I want this data

[1]
[1 5]
[1 6 7]

How can I solve this problem?

Thanks  a lot!

Body:
Your query is very close, but what is actually does is:

check if any array element contains 1 (this is ok)

check if any array element does not contain 2, 3 and 4 (this means [1,3,4] is valid beacuse 1 is not 2,3 or 4, so the condition is fulfilled)

What you really have to check with case #2 is that ALL elements are not 2, 3, 4.

Your updated query is now:

SELECT * FROM table_test WHERE 1 = ANY(ids) AND 2 <> ALL(ids)  AND 3 <> ALL(ids)  AND 4 <> ALL(ids);


问:
Designing a dialogbox that displays message, returns a custom object and waits for user response
I am trying to design a custom dialogbox in unity for runtime on all platforms (in my case for Android and webplayer).

I have succeeded in displaying a dialog and get the user response and updating this response. But I'm lost on how to call display the dialog box and wait before it returns a value when using it externally from some other method / class.

This is my code to display the dialogbox:

```<code>            public void ShowDialogBox(string title, string message, DialogBoxButtons buttons)
            {
                StartCoroutine(ShowDialogBoxHelper(title, message, buttons));
            }

            public void ShowDialogBox(string title, string message)
            {
                StartCoroutine(ShowDialogBoxHelper(title, message, DialogBoxButtons.OK));
            }

            public IEnumerator ShowDialogBoxHelper (string title, string message, DialogBoxButtons buttons)
            {
                Response = DialogResponse.NONE;

                Title.text = title;
                Message.text = message;

                ButtonSet = buttons;
                HandleButtonSet(ButtonSet);

                _canvasGroup.alpha = 1;
                _canvasGroup.interactable = true;
                transform.SetAsLastSibling();

                _apprearenceMode = ApprearenceMode.Shown;

                 yield return StartCoroutine(WaitForButtonResponse());

                Debug.Log("user response : " + Response);

            }
</code>```

The Coroutine "WaitForButtonResponse()" is declared so:

```<code>IEnumerator WaitForButtonResponse()
            {
                Debug.Log("waiting in the enumerator, responded: " + Response);

                yield return new waitForUserAction(() => Response != DialogResponse.NONE);

                Debug.Log("done waiting in the enumerator, responded: " + Response);

            }
</code>```

And the "waitForUserAction()" coroutine is a custom one, inheriting from CustomYieldInstruction

```<code>[System.Serializable]
    class waitForUserAction : CustomYieldInstruction
    {
        Func<bool> m_Predicate;

        public override bool keepWaiting { get { return !m_Predicate(); } }

        public waitForUserAction(Func<bool> predicate) { m_Predicate = predicate; }
    }
</code>```

When I call the ShowDialogBox method, the dialogbox appears as expected and when I click on one of the options, the response is correctly updated. But, If I want the ShowDialogBox to return a response and wait till the user has clicked on a dialog button before returning, how can I achieve it?

Desired behaviour:

```<code> public DialogResponse ShowDialogBox(string title, string message, DialogBoxButtons buttons)
            {
                StartCoroutine(ShowDialogBoxHelper(title, message, buttons));
                return Response;
            }
</code>```

and usage like this:

```<code> if (ShowDialogBox("test", "testing dialog box behaviour", DialogBoxButtons.YES_NO_CANCEL) == DialogResponse.YES)
                {
                    //do something
                }
</code>```

The problem now is that, "return Response;" does not wait for the "StartCoroutine(ShowDialogBoxHelper(title, message, buttons));" to update the user's choice and returns the old value of Response rather than what the user currently chooses.

Thank you in advance for any help in this regard!

Cheers,

Ani

答:
Instead of immediately evaluate the result you would need to actually wait and tell the routine what to do when a response is there.

I would use an Action<DialogResponse> for that like:

```<code>// Here you can actually use an overload with optional parameter
// If you don't pass in the "buttons" it simply has the default value `OK`
// And additionally pass in the action to invoke once a response was given
// If you don't pass it then simply nothing happens ;)
public void ShowDialogBox(string title, string message, DialogBoxButtons buttons = DialogBoxButtons.OK, Action<DialogResponse> onResponse = null)
{
    StartCoroutine(ShowDialogBoxHelper(title, message, buttons, onResponse));
}

public IEnumerator ShowDialogBoxHelper (string title, string message, DialogBoxButtons buttons, Action<DialogResponse> onResponse)
{
    Response = DialogResponse.NONE;

    Title.text = title;
    Message.text = message;

    ButtonSet = buttons;
    HandleButtonSet(ButtonSet);

    _canvasGroup.alpha = 1;
    _canvasGroup.interactable = true;
    transform.SetAsLastSibling();

    _apprearenceMode = ApprearenceMode.Shown;

    // Here rather use the Unity built-in
    yield return new WaitWhile(() => Response == DialogResponse.NONE);

    Debug.Log("user response : " + Response);

    onResponse?.Invoke(Response);
}
</code>```

This you would use either with a lambda expression like e.g.

```<code>ShowDialogBox("test", "testing dialog box behaviour", DialogBoxButtons.YES_NO_CANCEL, response =>
    {
        if(response == DialogResponse.YES)
        {
            // Do something
        }
    });
</code>```

or the same but with a method

```<code>ShowDialogBox("test", "testing dialog box behaviour", DialogBoxButtons.YES_NO_CANCEL, HandleResponse);

private void HandleResponse(DialogResponse response)
{
    if(response == DialogResponse.YES)
    {
        // Do something
    }
}
</code>```

Body:
I am trying to design a custom dialogbox in unity for runtime on all platforms (in my case for Android and webplayer).

I have succeeded in displaying a dialog and get the user response and updating this response. But I'm lost on how to call display the dialog box and wait before it returns a value when using it externally from some other method / class.

This is my code to display the dialogbox:

            public void ShowDialogBox(string title, string message, DialogBoxButtons buttons)
            {
                StartCoroutine(ShowDialogBoxHelper(title, message, buttons));
            }

            public void ShowDialogBox(string title, string message)
            {
                StartCoroutine(ShowDialogBoxHelper(title, message, DialogBoxButtons.OK));
            }

            public IEnumerator ShowDialogBoxHelper (string title, string message, DialogBoxButtons buttons)
            {
                Response = DialogResponse.NONE;

                Title.text = title;
                Message.text = message;

                ButtonSet = buttons;
                HandleButtonSet(ButtonSet);

                _canvasGroup.alpha = 1;
                _canvasGroup.interactable = true;
                transform.SetAsLastSibling();

                _apprearenceMode = ApprearenceMode.Shown;

                 yield return StartCoroutine(WaitForButtonResponse());

                Debug.Log("user response : " + Response);

            }

The Coroutine "WaitForButtonResponse()" is declared so:

IEnumerator WaitForButtonResponse()
            {
                Debug.Log("waiting in the enumerator, responded: " + Response);

                yield return new waitForUserAction(() => Response != DialogResponse.NONE);

                Debug.Log("done waiting in the enumerator, responded: " + Response);

            }

And the "waitForUserAction()" coroutine is a custom one, inheriting from CustomYieldInstruction

[System.Serializable]
    class waitForUserAction : CustomYieldInstruction
    {
        Func<bool> m_Predicate;

        public override bool keepWaiting { get { return !m_Predicate(); } }

        public waitForUserAction(Func<bool> predicate) { m_Predicate = predicate; }
    }

When I call the ShowDialogBox method, the dialogbox appears as expected and when I click on one of the options, the response is correctly updated. But, If I want the ShowDialogBox to return a response and wait till the user has clicked on a dialog button before returning, how can I achieve it?

Desired behaviour:

 public DialogResponse ShowDialogBox(string title, string message, DialogBoxButtons buttons)
            {
                StartCoroutine(ShowDialogBoxHelper(title, message, buttons));
                return Response;
            }

and usage like this:

 if (ShowDialogBox("test", "testing dialog box behaviour", DialogBoxButtons.YES_NO_CANCEL) == DialogResponse.YES)
                {
                    //do something
                }

The problem now is that, "return Response;" does not wait for the "StartCoroutine(ShowDialogBoxHelper(title, message, buttons));" to update the user's choice and returns the old value of Response rather than what the user currently chooses.

Thank you in advance for any help in this regard!

Cheers,

Ani

Body:
Instead of immediately evaluate the result you would need to actually wait and tell the routine what to do when a response is there.

I would use an Action<DialogResponse> for that like:

// Here you can actually use an overload with optional parameter
// If you don't pass in the "buttons" it simply has the default value `OK`
// And additionally pass in the action to invoke once a response was given
// If you don't pass it then simply nothing happens ;)
public void ShowDialogBox(string title, string message, DialogBoxButtons buttons = DialogBoxButtons.OK, Action<DialogResponse> onResponse = null)
{
    StartCoroutine(ShowDialogBoxHelper(title, message, buttons, onResponse));
}

public IEnumerator ShowDialogBoxHelper (string title, string message, DialogBoxButtons buttons, Action<DialogResponse> onResponse)
{
    Response = DialogResponse.NONE;

    Title.text = title;
    Message.text = message;

    ButtonSet = buttons;
    HandleButtonSet(ButtonSet);

    _canvasGroup.alpha = 1;
    _canvasGroup.interactable = true;
    transform.SetAsLastSibling();

    _apprearenceMode = ApprearenceMode.Shown;

    // Here rather use the Unity built-in
    yield return new WaitWhile(() => Response == DialogResponse.NONE);

    Debug.Log("user response : " + Response);

    onResponse?.Invoke(Response);
}

This you would use either with a lambda expression like e.g.

ShowDialogBox("test", "testing dialog box behaviour", DialogBoxButtons.YES_NO_CANCEL, response =>
    {
        if(response == DialogResponse.YES)
        {
            // Do something
        }
    });

or the same but with a method

ShowDialogBox("test", "testing dialog box behaviour", DialogBoxButtons.YES_NO_CANCEL, HandleResponse);

private void HandleResponse(DialogResponse response)
{
    if(response == DialogResponse.YES)
    {
        // Do something
    }
}


问:
Enum like switch parameter in PowerShell
I am using switch parameters in my PowerShell script in this fashion.

```<code>param(
    [switch] $Word,
    [switch] $Excel,
    [switch] $powerpoint,
    [switch] $v2007,
    [switch] $v2010,
    [switch] $x86,
    [switch] $x64,
)
</code>```

I am trying to figure out any neat way to have it more enum style.
As anyone might guess, I would want the user to choose between word, excel and powerpoint.
And between x2007 and v2010.

Is there a neat way to get input params enum style?

I am new to PowerShell. So if this sounds like that I don't know something obvious, then please point me to some link where I can read about it.

答:
Since PowerShell 5 you can actually use/create an Enum natively.

```<code>enum OS {
    Windows
    Linux
    iOS
}
</code>```

This is then also visible as its type.

```<code>IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     True     OS                                       System.Enum
</code>```

Maybe a useful link by 4sysops.

To use it in a function, I would either create a separate .psm1 file and add all the enums you need - see my comment which refers to a similiar question - or you can set this enum at the top of your .psm1 file and use in the same file.

For example, I created the file test.psm1 and added this code:

```<code>enum OS {
    Windows
    Linux
    iOS
}

function Get-OS {
    param (
        [Parameter(Mandatory)]
        [OS]$os
    )

    Write-Host -Object "The operating system is $os."

}
</code>```

I import the file Import-Module .\test.psm1 and run it:

```<code>PS > Get-OS -os Linux
The operating system is Linux.
</code>```

Body:
I am using switch parameters in my PowerShell script in this fashion.

param(
    [switch] $Word,
    [switch] $Excel,
    [switch] $powerpoint,
    [switch] $v2007,
    [switch] $v2010,
    [switch] $x86,
    [switch] $x64,
)

I am trying to figure out any neat way to have it more enum style.
As anyone might guess, I would want the user to choose between word, excel and powerpoint.
And between x2007 and v2010.

Is there a neat way to get input params enum style?

I am new to PowerShell. So if this sounds like that I don't know something obvious, then please point me to some link where I can read about it.

Body:
Since PowerShell 5 you can actually use/create an Enum natively.

enum OS {
    Windows
    Linux
    iOS
}

This is then also visible as its type.

IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     True     OS                                       System.Enum

Maybe a useful link by 4sysops.

To use it in a function, I would either create a separate .psm1 file and add all the enums you need - see my comment which refers to a similiar question - or you can set this enum at the top of your .psm1 file and use in the same file.

For example, I created the file test.psm1 and added this code:

enum OS {
    Windows
    Linux
    iOS
}

function Get-OS {
    param (
        [Parameter(Mandatory)]
        [OS]$os
    )

    Write-Host -Object "The operating system is $os."

}

I import the file Import-Module .\test.psm1 and run it:

PS > Get-OS -os Linux
The operating system is Linux.


问:
Memory assignment in C through pointers
I am learning how to use pointers, so i wrote the below program to assign integer values in the interval [1,100] to some random locations in the memory.

When i read those memory locations, printf displays all the values and then gives me a segmentation fault. This seems an odd behavior, because i was hoping to see either all the values OR a seg fault, but not both at the same time.

Can someone please explain why i got to see both?

Thanks. Here is the code

```<code>#include <stdio.h>
#include <stdlib.h>

int main()
{
    char first = 'f';
    char *ptr_first = &first;
    int i=1;
    for(i=1;i<101;i++)
        *(ptr_first+i) = i;
    for(i=1;i<101;i++)
        printf("%d\n", *(ptr_first+i));
    return EXIT_SUCCESS;
}
</code>```

答:
Not odd at all. You are using your variable first, which is on the stack. What you essentially do is happily overwriting the stack (otherwise known from buffer overflows on the stack) and thus probably destroying any return address and so on.

Since main is called by the libc, the return to libc would cause the crash.

Title: Memory assignment in C through pointers

Body:
I am learning how to use pointers, so i wrote the below program to assign integer values in the interval [1,100] to some random locations in the memory.

When i read those memory locations, printf displays all the values and then gives me a segmentation fault. This seems an odd behavior, because i was hoping to see either all the values OR a seg fault, but not both at the same time.

Can someone please explain why i got to see both?

Thanks. Here is the code

#include <stdio.h>
#include <stdlib.h>

int main()
{
    char first = 'f';
    char *ptr_first = &first;
    int i=1;
    for(i=1;i<101;i++)
        *(ptr_first+i) = i;
    for(i=1;i<101;i++)
        printf("%d\n", *(ptr_first+i));
    return EXIT_SUCCESS;
}


问:
MongoDB: findOne returns null but document exists in collection
I'm trying to send an email and password server-side and check if a document with those values exists (which it does), but when I console log the results from the query it's null.

Here's the document in the users collection:

```<code>{
    "_id" : ObjectId("580bcf9874ae28934705c0fc"),
    "email" : "johndoe@gmail.com",
    "password" : "pass"
}
</code>```

Here's what I'm sending server-side:

```<code>{"email":"johndoe@gmail.com","password":"pass"}
</code>```

Here's my code (updated):

```<code>mongo.connect('mongodb://localhost:27017', function (err, db) {

    if (err) {
    console.log("error: " + err); // logs nothing
    } else {

        var users = db.collection("users");
        var tasks = db.collection("tasks");

        app.post("/login", function(req, res) {

            var emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
            var userInDb;
            var userEmail = req.body.email;
            var userPassword = req.body.password;

            console.log(req.body.email); // logs "johndoe@gmail.com"
            console.log(req.body.password); // logs "pass"

            if (!userEmail || !userPassword) {
                return res.sendStatus(403);
            } else if ( !emailRegex.test(userEmail)) {
                return res.sendStatus(403);
            } else {

                users.findOne( { "email": userEmail, "password": userPassword }, function(err, results) {

                    console.log(results); // logs "null"

                    if(err) {
                      console.log("error: " + err); // logs nothing
                      res.sendStatus(403);
                    } else {
                      console.log("here"); // logs "here"
                      res.sendStatus(200);
                    }

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

答: I faced a simular problem in one of my project. It is all because I stored the collection and the document in a database which is different from which my app is connected to. Check that once.</p>

Body:
I'm trying to send an email and password server-side and check if a document with those values exists (which it does), but when I console log the results from the query it's null.

Here's the document in the users collection:

{
    "_id" : ObjectId("580bcf9874ae28934705c0fc"),
    "email" : "johndoe@gmail.com",
    "password" : "pass"
}

Here's what I'm sending server-side:

{"email":"johndoe@gmail.com","password":"pass"}

Here's my code (updated):

mongo.connect('mongodb://localhost:27017', function (err, db) {

    if (err) {
    console.log("error: " + err); // logs nothing
    } else {

        var users = db.collection("users");
        var tasks = db.collection("tasks");

        app.post("/login", function(req, res) {

            var emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
            var userInDb;
            var userEmail = req.body.email;
            var userPassword = req.body.password;

            console.log(req.body.email); // logs "johndoe@gmail.com"
            console.log(req.body.password); // logs "pass"

            if (!userEmail || !userPassword) {
                return res.sendStatus(403);
            } else if ( !emailRegex.test(userEmail)) {
                return res.sendStatus(403);
            } else {

                users.findOne( { "email": userEmail, "password": userPassword }, function(err, results) {

                    console.log(results); // logs "null"

                    if(err) {
                      console.log("error: " + err); // logs nothing
                      res.sendStatus(403);
                    } else {
                      console.log("here"); // logs "here"
                      res.sendStatus(200);
                    }

                  });
              }
          });
       }
    });


问:
Objection.js How to use outer values in inner query?
I'm struggling with a somewhat more complex SQL Query which HAS TO BE in Objection.js.
Below is the code so far

```<code>const tagEntry = await Tag_overview.query()
    .where('playable') //the playable column is a boolean
    .whereExists(
        InnerTableName.query().findById([<normal variable>, tag.id]) //<= tag.id is the id of the row in the outer query
            )
    )
    .orderBy(raw('random()'))// this randomly orders the selection
    .limit(1)
</code>```

"tag.id" should be the value of the row in the top/outer query thats currently being checked. In SQL I'd solve it with a simple line like (< normal variable> is a Javascript variable passed into the query and can be trated as a hardcoded value, it and tagid are a compound key)

```<code>and EXISTS (SELECT tagid, othercolumn FROM kunstmakler_preselection WHERE tag.id = tagid AND <normal variable>  = othercolumn)
</code>```

But I have absolutely no clue how to do this in Objection.js. Yes, it needs an inner Query, but HOW do I pass this tag.id in there? I'm completely lost and neither the API Reference nor the Recipe Book is any help (found here:  https://vincit.github.io/objection.js/recipes/ )

Is a join necessary here? Would it be worth it? [The tagoverview Table is rather small while "InnerTableName" is quite large]. I feel like that can't really be the solution since in ülain SQL it'd be such a smooth one liner

答:
First make sure that you have declared composite key correctly in model InnerTableName https://vincit.github.io/objection.js/recipes/composite-keys.html

Then you should be able to do:

```<code>.whereExists(
  InnerTableName.query().findById([theJsVariable, ref("Tag_overview.id")])
)
</code>```

Body:
I'm struggling with a somewhat more complex SQL Query which HAS TO BE in Objection.js.
Below is the code so far

const tagEntry = await Tag_overview.query()
    .where('playable') //the playable column is a boolean
    .whereExists(
        InnerTableName.query().findById([<normal variable>, tag.id]) //<= tag.id is the id of the row in the outer query
            )
    )
    .orderBy(raw('random()'))// this randomly orders the selection
    .limit(1)

"tag.id" should be the value of the row in the top/outer query thats currently being checked. In SQL I'd solve it with a simple line like (< normal variable> is a Javascript variable passed into the query and can be trated as a hardcoded value, it and tagid are a compound key)

and EXISTS (SELECT tagid, othercolumn FROM kunstmakler_preselection WHERE tag.id = tagid AND <normal variable>  = othercolumn)

But I have absolutely no clue how to do this in Objection.js. Yes, it needs an inner Query, but HOW do I pass this tag.id in there? I'm completely lost and neither the API Reference nor the Recipe Book is any help (found here:  https://vincit.github.io/objection.js/recipes/ )

Is a join necessary here? Would it be worth it? [The tagoverview Table is rather small while "InnerTableName" is quite large]. I feel like that can't really be the solution since in ülain SQL it'd be such a smooth one liner

Body:
First make sure that you have declared composite key correctly in model InnerTableName https://vincit.github.io/objection.js/recipes/composite-keys.html

Then you should be able to do:

.whereExists(
  InnerTableName.query().findById([theJsVariable, ref("Tag_overview.id")])
)