问:
Docusign - sign here tabs appear multiple times
This is with the Rest api. We trying to use the same anchor text values in all the documents we have in an envelope. We also may have several different server templates being applied to an envelope. We found out, to our dismay, that Docusign applies the anchor tags wherever it sees the anchor text and this means that if we have 3 server templates in the envelope, that the processing will create the anchor tags 3 times for each anchor text that it finds in each document. This means that the user will need to click three times to officially sign a document. What would be the quickest way to alleviate this problem?

-Here is the json

```<code> "compositeTemplates": [
{
  "compositeTemplateId": "1",
  "serverTemplates": [
    {
      "sequence": "1",
      "templateId": "61323293-7f78-4e2b-a296-0c084db16f19"
    }
  ],
  "inlineTemplates": [
    {
      "sequence": "2",
      "documents": [],
      "recipients": {
        "signers": [
          {
            "name": "Kathy Lori",
            "email": "kathylori@xxx.com",
            "recipientId": "1",
            "accessCode": "12345",
            "customFields": [],
            "routingOrder": "1",
            "note": "",
            "roleName": "Customer_SellerName",
            "emailNotification": {
              "emailSubject": "Please sign the  document(s) (Lori)",
              "emailBody": "Hello,\r\n\r\nYour consultant has sent you a new document to view and sign.  Please click on the View Documents link below, review the content, and sign the document.  If you have any questions, please contact your consultant.\r\n\r\nThank you!",
              "supportedLanguage": "en"
            }
          }
        ],
        "certifiedDeliveries": []
      },
      "customFields": {
        "textCustomFields": [
          {
            "name": "EnvelopeInfo",
            "value": "my data"
          }
        ]
      }
    }
  ],
  "document": {
    "documentId": "1",
    "name": "C:\\Temp\\Docusign\\Package\\Canyonlands-ViewOnly.docx",
    "fileExtension": ".docx",
    "order": "1",
    "documentFields": [
      {
        "name": "DMSID",
        "value": "1"
      }
    ],
    "documentBase64": "[Document:Base64Array]"
  }
},
{
  "compositeTemplateId": "2",
  "serverTemplates": [
    {
      "sequence": "2",
      "templateId": "14da6be4-c719-47d9-b183-da13295f86d5"
    }
  ],
  "inlineTemplates": [
    {
      "sequence": "2",
      "documents": [],
      "recipients": {
        "signers": [
          {
            "name": "Kathy Lori",
            "email": "kathylori@xxx.com",
            "recipientId": "1",
            "accessCode": "12345",
            "customFields": [],
            "routingOrder": "1",
            "note": "",
            "roleName": "Customer_SellerName",
            "emailNotification": {
              "emailSubject": "Please sign the document(s) (Lori)",
              "emailBody": "Hello,\r\n\r\nYour consultant has sent you a new document to view and sign.  Please click on the View Documents link below, review the content, and sign the document.  If you have any questions, please contact your consultant.\r\n\r\nThank you!",
              "supportedLanguage": "en"
            }
          }
        ],
        "certifiedDeliveries": []
      },
      "customFields": {
        "textCustomFields": [
          {
            "name": "EnvelopeInfo",
            "value": "my data"
          }
        ]
      }
    }
  ],
  "document": {
    "documentId": "60059128",
    "name": "C:\\Temp\\Docusign\\Package\\e AKA.docx",
    "fileExtension": ".docx",
    "order": "2",
    "documentFields": [
      {
        "name": "DMSID",
        "value": "2"
      }
    ],
    "documentBase64": "[Document:Base64Array]"
  }
},
{
  "compositeTemplateId": "3",
  "serverTemplates": [
    {
      "sequence": "3",
      "templateId": "6b1a11c6-9719-424b-b983-4b278a467dd6"
    }
  ],
  "inlineTemplates": [
    {
      "sequence": "2",
      "documents": [],
      "recipients": {
        "signers": [
          {
            "name": "Kathy Lori",
            "email": "kathylori@xxx.com",
            "recipientId": "1",
            "accessCode": "12345",
            "customFields": [],
            "routingOrder": "1",
            "note": "",
            "roleName": "Customer_SellerName",
            "emailNotification": {
              "emailSubject": "Please sign the document(s) (Lori)",
              "emailBody": "Hello,\r\n\r\nYour  consultant has sent you a new document to view and sign.  Please click on the View Documents link below, review the content, and sign the document.  If you have any questions, please contact your consultant.\r\n\r\nThank you!",
              "supportedLanguage": "en"
            }
          }
        ],
        "certifiedDeliveries": []
      },
      "customFields": {
        "textCustomFields": [
          {
            "name": "EnvelopeInfo",
            "value": "my data"
          }
        ]
      }
    }
  ],
  "document": {
    "documentId": "85586460",
    "name": "C:\\Temp\\Docusign\\Package\\e Equity Disbursement Instructions.docx",
    "fileExtension": ".docx",
    "order": "3",
    "documentFields": [
      {
        "name": "DMSID",
        "value": "3"
      }
    ],
    "documentBase64": "[Document:Base64Array]"
  }
},
{
  "compositeTemplateId": "4",
  "serverTemplates": [
    {
      "sequence": "4",
      "templateId": "61323293-7f78-4e2b-a296-0c084db16f19"
    }
  ],
  "inlineTemplates": [
    {
      "sequence": "2",
      "documents": [],
      "recipients": {
        "signers": [
          {
            "name": "Kathy Lori",
            "email": "kathylori@xxx.com",
            "recipientId": "1",
            "accessCode": "12345",
            "customFields": [],
            "routingOrder": "1",
            "note": "",
            "roleName": "Customer_SellerName",
            "emailNotification": {
              "emailSubject": "Please sign the  document(s) (Lori)",
              "emailBody": "Hello,\r\n\r\nYour consultant has sent you a new document to view and sign.  Please click on the View Documents link below, review the content, and sign the document.  If you have any questions, please contact your consultant.\r\n\r\nThank you!",
              "supportedLanguage": "en"
            }
          }
        ],
        "certifiedDeliveries": []
      },
      "customFields": {
        "textCustomFields": [
          {
            "name": "EnvelopeInfo",
            "value": "my data"
          }
        ]
      }
    }
  ],
  "document": {
    "documentId": "4",
    "name": "C:\\Temp\\Docusign\\Package\\EightDocument.docx",
    "fileExtension": ".docx",
    "order": "4",
    "documentFields": [
      {
        "name": "DMSID",
        "value": "4"
      }
    ],
    "documentBase64": "[Document:Base64Array]"
  }
},
{
  "compositeTemplateId": "5",
  "inlineTemplates": [
    {
      "sequence": "3",
      "documents": [
        {
          "documentId": "5",
          "name": "C:\\Temp\\Docusign\\Package\\FifthDocument.docx",
          "fileExtension": ".docx",
          "order": "5",
          "documentFields": [
            {
              "name": "DMSID",
              "value": "5"
            }
          ],
          "documentBase64": "[Document:Base64Array]"
        },
        {
          "documentId": "6",
          "name": "C:\\Temp\\Docusign\\Package\\FirstDocument.docx",
          "fileExtension": ".docx",
          "order": "6",
          "documentFields": [
            {
              "name": "DMSID",
              "value": "6"
            }
          ],
          "documentBase64": "[Document:Base64Array]"
        },
        {
          "documentId": "7",
          "name": "C:\\Temp\\Docusign\\Package\\FourthDocument.docx",
          "fileExtension": ".docx",
          "order": "7",
          "documentFields": [
            {
              "name": "DMSID",
              "value": "7"
            }
          ],
          "documentBase64": "[Document:Base64Array]"
        }
      ],
      "recipients": {
        "signers": [
          {
            "name": "Kathy Lori",
            "email": "kathylori@xxx.com",
            "recipientId": "1",
            "accessCode": "12345",
            "customFields": [],
            "routingOrder": "1",
            "note": "",
            "roleName": "Customer_SellerName",
            "emailNotification": {
              "emailSubject": "Please sign the document(s) (Lori)",
              "emailBody": "Hello,\r\n\r\nYour consultant has sent you a new document to view and sign.  Please click on the View Documents link below, review the content, and sign the document.  If you have any questions, please contact your consultant.\r\n\r\nThank you!",
              "supportedLanguage": "en"
            }
          }
        ],
        "certifiedDeliveries": []
      },
      "customFields": {
        "textCustomFields": [
          {
            "name": "EnvelopeInfo",
            "value": "my data"
          }
        ]
      }
    }
  ]
}
</code>```

答:
In your JSON request, there is no need to specify the compositeTemplateId=4 You can remove it and just move the document to compositeTemplateId=5. That way there will be no duplicate Anchor Tags.

It would make sense to include it the second time if you are going to reuse the document in the server Template. But it looks like you are anyway replacing the document in the Server Template, so there is no point in using the same server template the second time.

If you don't want to do the above approach, then follow the approach I suggested in  my other answer

In the below Json I have removed the duplicate compositeTemplate and moved the document into the final template.

```<code>{
  "compositeTemplates": [
    {
        "compositeTemplateId": "1",
        "serverTemplates": [
            {
                "sequence": "1",
                "templateId": "61323293-7f78-4e2b-a296-0c084db16f19"
            }
        ],
        "inlineTemplates": [
            {
                "sequence": "2",
                "documents": [ ],
                "recipients": {
                    "signers": [
                        {
                            "name": "Kathy Lori",
                            "email": "kathylori@xxx.com",
                            "recipientId": "1",
                            "accessCode": "12345",
                            "customFields": [ ],
                            "routingOrder": "1",
                            "note": "",
                            "roleName": "Customer_SellerName",
                            "emailNotification": {
                                "emailSubject": "Please sign the  document(s) (Lori)",
                                "emailBody": "Hello,\r\n\r\nYour consultant has sent you a new document to view and sign.  Please click on the View Documents link below, review the content, and sign the document.  If you have any questions, please contact your consultant.\r\n\r\nThank you!",
                                "supportedLanguage": "en"
                            }
                        }
                    ],
                    "certifiedDeliveries": [ ]
                },
                "customFields": {
                    "textCustomFields": [
                        {
                            "name": "EnvelopeInfo",
                            "value": "my data"
                        }
                    ]
                }
            }
        ],
        "document": {
            "documentId": "1",
            "name": "C:\\Temp\\Docusign\\Package\\Canyonlands-ViewOnly.docx",
            "fileExtension": ".docx",
            "order": "1",
            "documentFields": [
                {
                    "name": "DMSID",
                    "value": "1"
                }
            ],
            "documentBase64": "[Document:Base64Array]"
        }
    },
    {
        "compositeTemplateId": "2",
        "serverTemplates": [
            {
                "sequence": "2",
                "templateId": "14da6be4-c719-47d9-b183-da13295f86d5"
            }
        ],
        "inlineTemplates": [
            {
                "sequence": "2",
                "documents": [ ],
                "recipients": {
                    "signers": [
                        {
                            "name": "Kathy Lori",
                            "email": "kathylori@xxx.com",
                            "recipientId": "1",
                            "accessCode": "12345",
                            "customFields": [ ],
                            "routingOrder": "1",
                            "note": "",
                            "roleName": "Customer_SellerName",
                            "emailNotification": {
                                "emailSubject": "Please sign the document(s) (Lori)",
                                "emailBody": "Hello,\r\n\r\nYour consultant has sent you a new document to view and sign.  Please click on the View Documents link below, review the content, and sign the document.  If you have any questions, please contact your consultant.\r\n\r\nThank you!",
                                "supportedLanguage": "en"
                            }
                        }
                    ],
                    "certifiedDeliveries": [ ]
                },
                "customFields": {
                    "textCustomFields": [
                        {
                            "name": "EnvelopeInfo",
                            "value": "my data"
                        }
                    ]
                }
            }
        ],
        "document": {
            "documentId": "60059128",
            "name": "C:\\Temp\\Docusign\\Package\\e AKA.docx",
            "fileExtension": ".docx",
            "order": "2",
            "documentFields": [
                {
                    "name": "DMSID",
                    "value": "2"
                }
            ],
            "documentBase64": "[Document:Base64Array]"
        }
    },
    {
        "compositeTemplateId": "3",
        "serverTemplates": [
            {
                "sequence": "3",
                "templateId": "6b1a11c6-9719-424b-b983-4b278a467dd6"
            }
        ],
        "inlineTemplates": [
            {
                "sequence": "2",
                "documents": [ ],
                "recipients": {
                    "signers": [
                        {
                            "name": "Kathy Lori",
                            "email": "kathylori@xxx.com",
                            "recipientId": "1",
                            "accessCode": "12345",
                            "customFields": [ ],
                            "routingOrder": "1",
                            "note": "",
                            "roleName": "Customer_SellerName",
                            "emailNotification": {
                                "emailSubject": "Please sign the document(s) (Lori)",
                                "emailBody": "Hello,\r\n\r\nYour  consultant has sent you a new document to view and sign.  Please click on the View Documents link below, review the content, and sign the document.  If you have any questions, please contact your consultant.\r\n\r\nThank you!",
                                "supportedLanguage": "en"
                            }
                        }
                    ],
                    "certifiedDeliveries": [ ]
                },
                "customFields": {
                    "textCustomFields": [
                        {
                            "name": "EnvelopeInfo",
                            "value": "my data"
                        }
                    ]
                }
            }
        ],
        "document": {
            "documentId": "85586460",
            "name": "C:\\Temp\\Docusign\\Package\\e Equity Disbursement Instructions.docx",
            "fileExtension": ".docx",
            "order": "3",
            "documentFields": [
                {
                    "name": "DMSID",
                    "value": "3"
                }
            ],
            "documentBase64": "[Document:Base64Array]"
        }
    },

    {
        "compositeTemplateId": "5",
        "inlineTemplates": [
            {
                "sequence": "3",
                "documents": [
                    {
                        "documentId": "4",
                        "name": "C:\\Temp\\Docusign\\Package\\EightDocument.docx",
                        "fileExtension": ".docx",
                        "order": "4",
                        "documentFields": [
                            {
                                "name": "DMSID",
                                "value": "4"
                            }
                        ],
                        "documentBase64": "[Document:Base64Array]"
                    },
                    {
                        "documentId": "5",
                        "name": "C:\\Temp\\Docusign\\Package\\FifthDocument.docx",
                        "fileExtension": ".docx",
                        "order": "5",
                        "documentFields": [
                            {
                                "name": "DMSID",
                                "value": "5"
                            }
                        ],
                        "documentBase64": "[Document:Base64Array]"
                    },
                    {
                        "documentId": "6",
                        "name": "C:\\Temp\\Docusign\\Package\\FirstDocument.docx",
                        "fileExtension": ".docx",
                        "order": "6",
                        "documentFields": [
                            {
                                "name": "DMSID",
                                "value": "6"
                            }
                        ],
                        "documentBase64": "[Document:Base64Array]"
                    },
                    {
                        "documentId": "7",
                        "name": "C:\\Temp\\Docusign\\Package\\FourthDocument.docx",
                        "fileExtension": ".docx",
                        "order": "7",
                        "documentFields": [
                            {
                                "name": "DMSID",
                                "value": "7"
                            }
                        ],
                        "documentBase64": "[Document:Base64Array]"
                    }
                ],
                "recipients": {
                    "signers": [
                        {
                            "name": "Kathy Lori",
                            "email": "kathylori@xxx.com",
                            "recipientId": "1",
                            "accessCode": "12345",
                            "customFields": [ ],
                            "routingOrder": "1",
                            "note": "",
                            "roleName": "Customer_SellerName",
                            "emailNotification": {
                                "emailSubject": "Please sign the document(s) (Lori)",
                                "emailBody": "Hello,\r\n\r\nYour consultant has sent you a new document to view and sign.  Please click on the View Documents link below, review the content, and sign the document.  If you have any questions, please contact your consultant.\r\n\r\nThank you!",
                                "supportedLanguage": "en"
                            }
                        }
                    ],
                    "certifiedDeliveries": [ ]
                },
                "customFields": {
                    "textCustomFields": [
                        {
                            "name": "EnvelopeInfo",
                            "value": "my data"
                        }
                    ]
                }
            }
        ]
    }
  ]
}
</code>```

Body:
This is with the Rest api. We trying to use the same anchor text values in all the documents we have in an envelope. We also may have several different server templates being applied to an envelope. We found out, to our dismay, that Docusign applies the anchor tags wherever it sees the anchor text and this means that if we have 3 server templates in the envelope, that the processing will create the anchor tags 3 times for each anchor text that it finds in each document. This means that the user will need to click three times to officially sign a document. What would be the quickest way to alleviate this problem?

-Here is the json

 "compositeTemplates": [
{
  "compositeTemplateId": "1",
  "serverTemplates": [
    {
      "sequence": "1",
      "templateId": "61323293-7f78-4e2b-a296-0c084db16f19"
    }
  ],
  "inlineTemplates": [
    {
      "sequence": "2",
      "documents": [],
      "recipients": {
        "signers": [
          {
            "name": "Kathy Lori",
            "email": "kathylori@xxx.com",
            "recipientId": "1",
            "accessCode": "12345",
            "customFields": [],
            "routingOrder": "1",
            "note": "",
            "roleName": "Customer_SellerName",
            "emailNotification": {
              "emailSubject": "Please sign the  document(s) (Lori)",
              "emailBody": "Hello,\r\n\r\nYour consultant has sent you a new document to view and sign.  Please click on the View Documents link below, review the content, and sign the document.  If you have any questions, please contact your consultant.\r\n\r\nThank you!",
              "supportedLanguage": "en"
            }
          }
        ],
        "certifiedDeliveries": []
      },
      "customFields": {
        "textCustomFields": [
          {
            "name": "EnvelopeInfo",
            "value": "my data"
          }
        ]
      }
    }
  ],
  "document": {
    "documentId": "1",
    "name": "C:\\Temp\\Docusign\\Package\\Canyonlands-ViewOnly.docx",
    "fileExtension": ".docx",
    "order": "1",
    "documentFields": [
      {
        "name": "DMSID",
        "value": "1"
      }
    ],
    "documentBase64": "[Document:Base64Array]"
  }
},
{
  "compositeTemplateId": "2",
  "serverTemplates": [
    {
      "sequence": "2",
      "templateId": "14da6be4-c719-47d9-b183-da13295f86d5"
    }
  ],
  "inlineTemplates": [
    {
      "sequence": "2",
      "documents": [],
      "recipients": {
        "signers": [
          {
            "name": "Kathy Lori",
            "email": "kathylori@xxx.com",
            "recipientId": "1",
            "accessCode": "12345",
            "customFields": [],
            "routingOrder": "1",
            "note": "",
            "roleName": "Customer_SellerName",
            "emailNotification": {
              "emailSubject": "Please sign the document(s) (Lori)",
              "emailBody": "Hello,\r\n\r\nYour consultant has sent you a new document to view and sign.  Please click on the View Documents link below, review the content, and sign the document.  If you have any questions, please contact your consultant.\r\n\r\nThank you!",
              "supportedLanguage": "en"
            }
          }
        ],
        "certifiedDeliveries": []
      },
      "customFields": {
        "textCustomFields": [
          {
            "name": "EnvelopeInfo",
            "value": "my data"
          }
        ]
      }
    }
  ],
  "document": {
    "documentId": "60059128",
    "name": "C:\\Temp\\Docusign\\Package\\e AKA.docx",
    "fileExtension": ".docx",
    "order": "2",
    "documentFields": [
      {
        "name": "DMSID",
        "value": "2"
      }
    ],
    "documentBase64": "[Document:Base64Array]"
  }
},
{
  "compositeTemplateId": "3",
  "serverTemplates": [
    {
      "sequence": "3",
      "templateId": "6b1a11c6-9719-424b-b983-4b278a467dd6"
    }
  ],
  "inlineTemplates": [
    {
      "sequence": "2",
      "documents": [],
      "recipients": {
        "signers": [
          {
            "name": "Kathy Lori",
            "email": "kathylori@xxx.com",
            "recipientId": "1",
            "accessCode": "12345",
            "customFields": [],
            "routingOrder": "1",
            "note": "",
            "roleName": "Customer_SellerName",
            "emailNotification": {
              "emailSubject": "Please sign the document(s) (Lori)",
              "emailBody": "Hello,\r\n\r\nYour  consultant has sent you a new document to view and sign.  Please click on the View Documents link below, review the content, and sign the document.  If you have any questions, please contact your consultant.\r\n\r\nThank you!",
              "supportedLanguage": "en"
            }
          }
        ],
        "certifiedDeliveries": []
      },
      "customFields": {
        "textCustomFields": [
          {
            "name": "EnvelopeInfo",
            "value": "my data"
          }
        ]
      }
    }
  ],
  "document": {
    "documentId": "85586460",
    "name": "C:\\Temp\\Docusign\\Package\\e Equity Disbursement Instructions.docx",
    "fileExtension": ".docx",
    "order": "3",
    "documentFields": [
      {
        "name": "DMSID",
        "value": "3"
      }
    ],
    "documentBase64": "[Document:Base64Array]"
  }
},
{
  "compositeTemplateId": "4",
  "serverTemplates": [
    {
      "sequence": "4",
      "templateId": "61323293-7f78-4e2b-a296-0c084db16f19"
    }
  ],
  "inlineTemplates": [
    {
      "sequence": "2",
      "documents": [],
      "recipients": {
        "signers": [
          {
            "name": "Kathy Lori",
            "email": "kathylori@xxx.com",
            "recipientId": "1",
            "accessCode": "12345",
            "customFields": [],
            "routingOrder": "1",
            "note": "",
            "roleName": "Customer_SellerName",
            "emailNotification": {
              "emailSubject": "Please sign the  document(s) (Lori)",
              "emailBody": "Hello,\r\n\r\nYour consultant has sent you a new document to view and sign.  Please click on the View Documents link below, review the content, and sign the document.  If you have any questions, please contact your consultant.\r\n\r\nThank you!",
              "supportedLanguage": "en"
            }
          }
        ],
        "certifiedDeliveries": []
      },
      "customFields": {
        "textCustomFields": [
          {
            "name": "EnvelopeInfo",
            "value": "my data"
          }
        ]
      }
    }
  ],
  "document": {
    "documentId": "4",
    "name": "C:\\Temp\\Docusign\\Package\\EightDocument.docx",
    "fileExtension": ".docx",
    "order": "4",
    "documentFields": [
      {
        "name": "DMSID",
        "value": "4"
      }
    ],
    "documentBase64": "[Document:Base64Array]"
  }
},
{
  "compositeTemplateId": "5",
  "inlineTemplates": [
    {
      "sequence": "3",
      "documents": [
        {
          "documentId": "5",
          "name": "C:\\Temp\\Docusign\\Package\\FifthDocument.docx",
          "fileExtension": ".docx",
          "order": "5",
          "documentFields": [
            {
              "name": "DMSID",
              "value": "5"
            }
          ],
          "documentBase64": "[Document:Base64Array]"
        },
        {
          "documentId": "6",
          "name": "C:\\Temp\\Docusign\\Package\\FirstDocument.docx",
          "fileExtension": ".docx",
          "order": "6",
          "documentFields": [
            {
              "name": "DMSID",
              "value": "6"
            }
          ],
          "documentBase64": "[Document:Base64Array]"
        },
        {
          "documentId": "7",
          "name": "C:\\Temp\\Docusign\\Package\\FourthDocument.docx",
          "fileExtension": ".docx",
          "order": "7",
          "documentFields": [
            {
              "name": "DMSID",
              "value": "7"
            }
          ],
          "documentBase64": "[Document:Base64Array]"
        }
      ],
      "recipients": {
        "signers": [
          {
            "name": "Kathy Lori",
            "email": "kathylori@xxx.com",
            "recipientId": "1",
            "accessCode": "12345",
            "customFields": [],
            "routingOrder": "1",
            "note": "",
            "roleName": "Customer_SellerName",
            "emailNotification": {
              "emailSubject": "Please sign the document(s) (Lori)",
              "emailBody": "Hello,\r\n\r\nYour consultant has sent you a new document to view and sign.  Please click on the View Documents link below, review the content, and sign the document.  If you have any questions, please contact your consultant.\r\n\r\nThank you!",
              "supportedLanguage": "en"
            }
          }
        ],
        "certifiedDeliveries": []
      },
      "customFields": {
        "textCustomFields": [
          {
            "name": "EnvelopeInfo",
            "value": "my data"
          }
        ]
      }
    }
  ]
}

Body:
In your JSON request, there is no need to specify the compositeTemplateId=4 You can remove it and just move the document to compositeTemplateId=5. That way there will be no duplicate Anchor Tags.

It would make sense to include it the second time if you are going to reuse the document in the server Template. But it looks like you are anyway replacing the document in the Server Template, so there is no point in using the same server template the second time.

If you don't want to do the above approach, then follow the approach I suggested in  my other answer

In the below Json I have removed the duplicate compositeTemplate and moved the document into the final template.

{
  "compositeTemplates": [
    {
        "compositeTemplateId": "1",
        "serverTemplates": [
            {
                "sequence": "1",
                "templateId": "61323293-7f78-4e2b-a296-0c084db16f19"
            }
        ],
        "inlineTemplates": [
            {
                "sequence": "2",
                "documents": [ ],
                "recipients": {
                    "signers": [
                        {
                            "name": "Kathy Lori",
                            "email": "kathylori@xxx.com",
                            "recipientId": "1",
                            "accessCode": "12345",
                            "customFields": [ ],
                            "routingOrder": "1",
                            "note": "",
                            "roleName": "Customer_SellerName",
                            "emailNotification": {
                                "emailSubject": "Please sign the  document(s) (Lori)",
                                "emailBody": "Hello,\r\n\r\nYour consultant has sent you a new document to view and sign.  Please click on the View Documents link below, review the content, and sign the document.  If you have any questions, please contact your consultant.\r\n\r\nThank you!",
                                "supportedLanguage": "en"
                            }
                        }
                    ],
                    "certifiedDeliveries": [ ]
                },
                "customFields": {
                    "textCustomFields": [
                        {
                            "name": "EnvelopeInfo",
                            "value": "my data"
                        }
                    ]
                }
            }
        ],
        "document": {
            "documentId": "1",
            "name": "C:\\Temp\\Docusign\\Package\\Canyonlands-ViewOnly.docx",
            "fileExtension": ".docx",
            "order": "1",
            "documentFields": [
                {
                    "name": "DMSID",
                    "value": "1"
                }
            ],
            "documentBase64": "[Document:Base64Array]"
        }
    },
    {
        "compositeTemplateId": "2",
        "serverTemplates": [
            {
                "sequence": "2",
                "templateId": "14da6be4-c719-47d9-b183-da13295f86d5"
            }
        ],
        "inlineTemplates": [
            {
                "sequence": "2",
                "documents": [ ],
                "recipients": {
                    "signers": [
                        {
                            "name": "Kathy Lori",
                            "email": "kathylori@xxx.com",
                            "recipientId": "1",
                            "accessCode": "12345",
                            "customFields": [ ],
                            "routingOrder": "1",
                            "note": "",
                            "roleName": "Customer_SellerName",
                            "emailNotification": {
                                "emailSubject": "Please sign the document(s) (Lori)",
                                "emailBody": "Hello,\r\n\r\nYour consultant has sent you a new document to view and sign.  Please click on the View Documents link below, review the content, and sign the document.  If you have any questions, please contact your consultant.\r\n\r\nThank you!",
                                "supportedLanguage": "en"
                            }
                        }
                    ],
                    "certifiedDeliveries": [ ]
                },
                "customFields": {
                    "textCustomFields": [
                        {
                            "name": "EnvelopeInfo",
                            "value": "my data"
                        }
                    ]
                }
            }
        ],
        "document": {
            "documentId": "60059128",
            "name": "C:\\Temp\\Docusign\\Package\\e AKA.docx",
            "fileExtension": ".docx",
            "order": "2",
            "documentFields": [
                {
                    "name": "DMSID",
                    "value": "2"
                }
            ],
            "documentBase64": "[Document:Base64Array]"
        }
    },
    {
        "compositeTemplateId": "3",
        "serverTemplates": [
            {
                "sequence": "3",
                "templateId": "6b1a11c6-9719-424b-b983-4b278a467dd6"
            }
        ],
        "inlineTemplates": [
            {
                "sequence": "2",
                "documents": [ ],
                "recipients": {
                    "signers": [
                        {
                            "name": "Kathy Lori",
                            "email": "kathylori@xxx.com",
                            "recipientId": "1",
                            "accessCode": "12345",
                            "customFields": [ ],
                            "routingOrder": "1",
                            "note": "",
                            "roleName": "Customer_SellerName",
                            "emailNotification": {
                                "emailSubject": "Please sign the document(s) (Lori)",
                                "emailBody": "Hello,\r\n\r\nYour  consultant has sent you a new document to view and sign.  Please click on the View Documents link below, review the content, and sign the document.  If you have any questions, please contact your consultant.\r\n\r\nThank you!",
                                "supportedLanguage": "en"
                            }
                        }
                    ],
                    "certifiedDeliveries": [ ]
                },
                "customFields": {
                    "textCustomFields": [
                        {
                            "name": "EnvelopeInfo",
                            "value": "my data"
                        }
                    ]
                }
            }
        ],
        "document": {
            "documentId": "85586460",
            "name": "C:\\Temp\\Docusign\\Package\\e Equity Disbursement Instructions.docx",
            "fileExtension": ".docx",
            "order": "3",
            "documentFields": [
                {
                    "name": "DMSID",
                    "value": "3"
                }
            ],
            "documentBase64": "[Document:Base64Array]"
        }
    },

    {
        "compositeTemplateId": "5",
        "inlineTemplates": [
            {
                "sequence": "3",
                "documents": [
                    {
                        "documentId": "4",
                        "name": "C:\\Temp\\Docusign\\Package\\EightDocument.docx",
                        "fileExtension": ".docx",
                        "order": "4",
                        "documentFields": [
                            {
                                "name": "DMSID",
                                "value": "4"
                            }
                        ],
                        "documentBase64": "[Document:Base64Array]"
                    },
                    {
                        "documentId": "5",
                        "name": "C:\\Temp\\Docusign\\Package\\FifthDocument.docx",
                        "fileExtension": ".docx",
                        "order": "5",
                        "documentFields": [
                            {
                                "name": "DMSID",
                                "value": "5"
                            }
                        ],
                        "documentBase64": "[Document:Base64Array]"
                    },
                    {
                        "documentId": "6",
                        "name": "C:\\Temp\\Docusign\\Package\\FirstDocument.docx",
                        "fileExtension": ".docx",
                        "order": "6",
                        "documentFields": [
                            {
                                "name": "DMSID",
                                "value": "6"
                            }
                        ],
                        "documentBase64": "[Document:Base64Array]"
                    },
                    {
                        "documentId": "7",
                        "name": "C:\\Temp\\Docusign\\Package\\FourthDocument.docx",
                        "fileExtension": ".docx",
                        "order": "7",
                        "documentFields": [
                            {
                                "name": "DMSID",
                                "value": "7"
                            }
                        ],
                        "documentBase64": "[Document:Base64Array]"
                    }
                ],
                "recipients": {
                    "signers": [
                        {
                            "name": "Kathy Lori",
                            "email": "kathylori@xxx.com",
                            "recipientId": "1",
                            "accessCode": "12345",
                            "customFields": [ ],
                            "routingOrder": "1",
                            "note": "",
                            "roleName": "Customer_SellerName",
                            "emailNotification": {
                                "emailSubject": "Please sign the document(s) (Lori)",
                                "emailBody": "Hello,\r\n\r\nYour consultant has sent you a new document to view and sign.  Please click on the View Documents link below, review the content, and sign the document.  If you have any questions, please contact your consultant.\r\n\r\nThank you!",
                                "supportedLanguage": "en"
                            }
                        }
                    ],
                    "certifiedDeliveries": [ ]
                },
                "customFields": {
                    "textCustomFields": [
                        {
                            "name": "EnvelopeInfo",
                            "value": "my data"
                        }
                    ]
                }
            }
        ]
    }
  ]
}


来源: stackexchange

问:
How to make AwCollectionViewSlidingDoors on Android
I want to make a menu in an Android application that use AwCollectionViewSlidingDoors animation like in iOS. This application uses it. I didn't find any implementation of such thing.

答:
There is no existing library which offers this type of animated menu for Android, yet. If you want to achieve this, you will have to code it yourself. However it is relatively straight-forward. You just need to utilize the existing Android Animation API and integrate the slide-up/down in a menu.

See previous answer to a question detailing this sort of animation and start educating yourself on the Android Animation API via the official documentation.

ContentLicense: CC BY-SA 3.0


问:
PHPMailer not working in my cPanel
Here is my code for PHPMailer:

```<code><?php
    error_reporting(E_ALL);
    require '/home/user/public_html/phpmailer/PHPMailerAutoload.php';
    $mail = new PHPMailer;
    $mail->isSMPT();
    $mail->Host = 'smpt.gmail.com'; // Specify main and backup SMTP servers
    $mail->SMTPAuth = true; // Enable SMTP authentication
    $mail->Username = '*****@gmail.com'; // SMTP username
    $mail->Password = 'password'; // SMTP password
    $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
    $mail->Port = 587; // TCP port to connect to 587
    $mail->SMPTDebug = 4;
    $mail->setFrom('******@gmail.com', 'Hello whats happening');
    $mail->addAddress('****@gmail.com'); // Add a recipient
    // $mail->addAddress('ellen@example.com'); // Name is optional
    $mail->addReplyTo('itskosieric@gmail.com');
    //$mail->addCC('cc@example.com');
    //$mail->addBCC('bcc@example.com');

    //$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
    //$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
    $mail->isHTML(true); // Set email format to HTML

    $mail->Subject = 'hi just wanted to say hello';
    $mail->Body = '<p>This is the HTML message body <b>in bold!</b></p>';
    $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

    if(!$mail->send()) {
        echo 'Message could not be sent.';
        echo 'Mailer Error: ' . $mail->ErrorInfo;
    } else {
        echo 'Message has been sent';
    }
?>
</code>```

It only says "message has been sent" when I comment $mail->isSMPT(); but doesn't send any E-mail. Please I don't know where this problem is coming from.

答: SMTP, not SMPT. Apart from that, base your code on examples provided with PHPMailer.</p>

Title: PHPMailer not working in my cPanel

Body:
Here is my code for PHPMailer:

<?php
    error_reporting(E_ALL);
    require '/home/user/public_html/phpmailer/PHPMailerAutoload.php';
    $mail = new PHPMailer;
    $mail->isSMPT();
    $mail->Host = 'smpt.gmail.com'; // Specify main and backup SMTP servers
    $mail->SMTPAuth = true; // Enable SMTP authentication
    $mail->Username = '*****@gmail.com'; // SMTP username
    $mail->Password = 'password'; // SMTP password
    $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
    $mail->Port = 587; // TCP port to connect to 587
    $mail->SMPTDebug = 4;
    $mail->setFrom('******@gmail.com', 'Hello whats happening');
    $mail->addAddress('****@gmail.com'); // Add a recipient
    // $mail->addAddress('ellen@example.com'); // Name is optional
    $mail->addReplyTo('itskosieric@gmail.com');
    //$mail->addCC('cc@example.com');
    //$mail->addBCC('bcc@example.com');

    //$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
    //$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
    $mail->isHTML(true); // Set email format to HTML

    $mail->Subject = 'hi just wanted to say hello';
    $mail->Body = '
This is the HTML message body in bold!
';
    $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

    if(!$mail->send()) {
        echo 'Message could not be sent.';
        echo 'Mailer Error: ' . $mail->ErrorInfo;
    } else {
        echo 'Message has been sent';
    }
?>

It only says "message has been sent" when I comment $mail->isSMPT(); but doesn't send any E-mail. Please I don't know where this problem is coming from.


问:
last.fm GET request timing out meteor
I'm currently trying to access last.fm's API using a simple GET request.  The best NPM library I found was last-fm by feross.  The problem is that my request keeps timing out and I don't get any errors.  Is meteor causing this?

My request URL is:
https://ws.audioscrobbler.com:3000/2.0/?method=artist.getInfo&artist=cher&autocorrect=1&api_key=MY_API_KEY&format=json

Here is the code.

```<code>import LastFM from 'last-fm';

const lastfm = new LastFM("MY_API_KEY", {userAgent: "buildsmoothie"})

export const ArtistCheck = () => {
  lastfm.artistInfo({ name: "cher" }, (err, data) => {
    if (err) console.log(err)
    else console.log(data)
  })
}
</code>```

And then I call it in another component here:

```<code>artistGateCheck(e){
    e.preventDefault();
      ArtistCheck();
    }
</code>```

答:
I've removed the port :3000 and it works as it should. Used the follow url:

https://ws.audioscrobbler.com/2.0/?method=artist.getInfo&artist=cher&autocorrect=1&api_key=MY_API_KEY&format=json

Title: last.fm GET request timing out meteor

Body:
I'm currently trying to access last.fm's API using a simple GET request.  The best NPM library I found was last-fm by feross.  The problem is that my request keeps timing out and I don't get any errors.  Is meteor causing this?

My request URL is:
https://ws.audioscrobbler.com:3000/2.0/?method=artist.getInfo&artist=cher&autocorrect=1&api_key=MY_API_KEY&format=json

Here is the code.

import LastFM from 'last-fm';

const lastfm = new LastFM("MY_API_KEY", {userAgent: "buildsmoothie"})

export const ArtistCheck = () => {
  lastfm.artistInfo({ name: "cher" }, (err, data) => {
    if (err) console.log(err)
    else console.log(data)
  })
}

And then I call it in another component here:

artistGateCheck(e){
    e.preventDefault();
      ArtistCheck();
    }


问:
Fastest way to compare two huge csv files in python(numpy)
I am trying find the intesect sub set between two pretty big csv files of
phone numbers(one has 600k rows, and the other has 300mil). I am currently using pandas to open both files and then converting the needed columns into 1d numpy arrays and then using numpy intersect to get the intersect. Is there a better way of doing this, either with python or any other method. Thanks for any help</p>

```<code>import pandas as pd
import numpy as np

df_dnc = pd.read_csv('dncTest.csv', names = ['phone'])
df_test = pd.read_csv('phoneTest.csv', names = ['phone'])

dnc_phone = df_dnc['phone']
test_phone = df_test['phone']

np.intersect1d(dnc_phone, test_phone)
</code>```

答:
Read the 600k phone numbers into a set.

Input the larger file row by row, checking each row against the set.

Write matches to an output file immediately.

That way you don't have to load all the data in memory at once.

Body:
I am trying find the intesect sub set between two pretty big csv files of
phone numbers(one has 600k rows, and the other has 300mil). I am currently using pandas to open both files and then converting the needed columns into 1d numpy arrays and then using numpy intersect to get the intersect. Is there a better way of doing this, either with python or any other method. Thanks for any help

import pandas as pd
import numpy as np

df_dnc = pd.read_csv('dncTest.csv', names = ['phone'])
df_test = pd.read_csv('phoneTest.csv', names = ['phone'])

dnc_phone = df_dnc['phone']
test_phone = df_test['phone']

np.intersect1d(dnc_phone, test_phone)


问:
In Django, how can I automatically set "cache-control" for every template render?
I want to se the cache control to a higher number, instead of "no-store", which is the default for django.

Can I configure it in a way that's somewhat global?

答:
There is a way to setup "per site" cache with django 1.2

http://docs.djangoproject.com/en/1.2/topics/cache/#the-per-site-cache

ContentLicense: CC BY-SA 2.5


问:
System Requirements and Functional Requirememts
Can you please explain me the difference between system and functional requirements?

In the company that I working for , I perform a business analyst / design role for one of the applications that is responsible for fulfulling and provisioning a service requested by the customer. My deliverable is a design document that comprises of system requirements and functional requirements. We define system requirements to define high level capabilities of the system and define the functional requirements to break down the system requirements into sufficient detail. So an SR can contain 1-N FRs. I was not sure if it is something that is followed across the industry

答:
Punter Vicky, I have been doing requirements for 20+ years and I have found that the definition is different for each company I work for.  I would recommend that you ask for some examples of previous documentation from your company.

The previous answers you have received are technically correct.  Functional requirement usually illustrates how the system will work with the user and the System requirements will tell you how the system will technically accomplish the functional requirement.  Good luck.


问:
SQL Server, Does 'sum' funcation works fine in large tables?
I'm building a market sell points system using C# winForms, SQL Server 2014
My problem is the idea of storing the products and quantities
the program should display the quantity of some product when making a new sell bill
so before user make a sell he should know the quantity of this product, and see if it enough for the order or not
i created this table for items
Item_ID,     Item,     Buy_Price,     Sell_Price,     Quantity

but this makes confusions when user edit some bills , sell bills or buy bills
so for example when user edit some buy bill(invoice), edit the quantity in the buy bill
then the product quantity cell in items table will not match the quantity in buybills table
so i want to make it little more dynamic and remove the quantity cell from items table
and using the bills table to get the quantity of any item
that means when user search for an item(Product) to sell, system uses a sum funcation buy sql statement
quantity = sum(item_quantity) in buy_bills - sum(item_quantity) in sell_bills
does it works? or this will be so heavey when databases size and records count get larger?

答:
Problem here is not related to SUM function as such (it will sum up whatever you put in your query and rather quickly - in general) but with concept of detecting available quantities. Assuming that there is more than one selling point it will be impossible to get accurate available quantity of any product if you do not provide some form of concurrency control.

So, you may use sum from table where you have history of buy or sell of products. But, before you accept any change you need to put some lock to prevent other sellers to change (sell) same quantity. After you have committed one sell you may allow other sellers to continue with their activities assuring that you refresh currently presented items quantities.

Do have in mind that this scenario is one of the basic ones that may occur in any multiuser business application.

So, to conclude, do provide

One point in time where you are sure that existing stock cannot be lowered

SUM in the way you see fit for your application

Refresh any pending sale with new quantities


问:
How can I import CSV UTF-8 file with Chinese characters into MySQL?
I've tried importing the following CSV file with UTF-8 encoding into MySQL, but the Chinese characters are not correctly populating. I also changed the column collate to utf8 - default collation and big5-big5_chinese_ci , but the data is still not populating the correct characters.

Data I'm trying to import:
Data I'm trying to import into MySQL

SQL Query I'm using to import data:

```<code>LOAD DATA LOCAL INFILE 'C:\\Users\\Ulises.Sotomoyor\\Downloads\\Insights.csv'
INTO TABLE unpaid_media.insights
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES
(@Date, Section, Language, Insights)
SET Date = str_to_date(@Date, '%m/%d/%Y')
</code>```

MySQL Table Setting/Collation:
MySQL Table Setting/Collation

答:
You need to specify (at least) two things:

The character encoding of the data coming in. -- Do this explicitly by adding CHARACTER SET utf8mb4 (or big5) in the LOAD DATA statement.

The CHARACTER SET for the column -- It can be either big5 or utf8mb4.  This does not have to match the LOAD.

In general, MySQL users should aim for utf8mb4 throughout, but big5 is OK.

The collation does not matter when inserting unless you have a uniqueness constraint.  (It does not seem that you have such.)

If you say the data has one encoding (eg, big5), but the column is in a different encoding (eg, utf8mb4), MySQL will convert as you do the inserting.

You may end up with other troubles.  See "Best practice" in http://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored .  It is aimed at utf8, but it can be modified to import big5 and/or display in big5.

If you run into more troubles, please try to get the hex of the strings/columns in question.

Body:
I've tried importing the following CSV file with UTF-8 encoding into MySQL, but the Chinese characters are not correctly populating. I also changed the column collate to utf8 - default collation and big5-big5_chinese_ci , but the data is still not populating the correct characters.

Data I'm trying to import:
Data I'm trying to import into MySQL

SQL Query I'm using to import data:

LOAD DATA LOCAL INFILE 'C:\\Users\\Ulises.Sotomoyor\\Downloads\\Insights.csv'
INTO TABLE unpaid_media.insights
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES
(@Date, Section, Language, Insights)
SET Date = str_to_date(@Date, '%m/%d/%Y')

MySQL Table Setting/Collation:
MySQL Table Setting/Collation


问:
How does Instagram crop video in android app?
I am trying to record the video in 1:1 ratio (square) and i cant get it to work,
if i set custom resolution in media recorder instance i get an error on media recorder start.

```<code>mediaRecorder.setVideoSize(480, 480);
</code>```

but it works if i set the resolution supported by camera.

```<code>Camera.Parameters p = c.getParameters();
        List<Camera.Size> list = p.getSupportedPreviewSizes();
        //They are ordered from largest to smallest, so the largest will be...
        for (Camera.Size i : list) {
            if (i.width <= 640 && i.width >= 480) {
                size = i;
            }
            Log.d(TAG, "i.height: " + i.height + " i.width" + i.width);
        }
        if (size != null) {
            p.setPreviewSize(size.width, size.height);
            c.setParameters(p);
        }
</code>```

then set

```<code> mediaRecorder.setVideoSize(size.width, size.height);
</code>```

I usually get 480 by 640. Is there a way to crop the video on android? I have seen ffmpeg library but i need to use this in project and i am not sure how LGPL works. Is there a simpler solution to this?

答:
Actually just adding this dependency:

```<code>compile 'com.writingminds:FFmpegAndroid:0.3.2'
</code>```

then using below code makes the thing. Only problem is, it's not so fast. In my tests, 20sec length 720x480 video cropped to 480x in 6-7 second with a galaxy s6.

```<code>FFmpeg ffmpeg = FFmpeg.getInstance(context);
String[] complexCommand = {"-y", "-i", originalFilePath, "-vf", "crop=480:480:80:0", "-preset", "ultrafast", "-strict", "-2", "-c:v", "libx264", "-c:a", "copy", originalFilePath.replace(".mp4", "_crop.mp4")};
try {
    ffmpeg.execute(complexCommand, new ExecuteBinaryResponseHandler() {
        @Override
        public void onStart() {super.onStart();}

        @Override
        public void onSuccess(String message) {super.onSuccess(message);}

        @Override
        public void onProgress(String message) {super.onProgress(message);}

        @Override
        public void onFailure(String message) {super.onFailure(message);}

        @Override
        public void onFinish() {super.onFinish();}
    });
} catch (FFmpegCommandAlreadyRunningException e) {
    Log.e("ffmpeg", "ffmpeg already running");
}
</code>```

There's another better solution using with new MediaCodec if your min sdk is api 18

Body:
I am trying to record the video in 1:1 ratio (square) and i cant get it to work,
if i set custom resolution in media recorder instance i get an error on media recorder start.

mediaRecorder.setVideoSize(480, 480);

but it works if i set the resolution supported by camera.

Camera.Parameters p = c.getParameters();
        List<Camera.Size> list = p.getSupportedPreviewSizes();
        //They are ordered from largest to smallest, so the largest will be...
        for (Camera.Size i : list) {
            if (i.width <= 640 && i.width >= 480) {
                size = i;
            }
            Log.d(TAG, "i.height: " + i.height + " i.width" + i.width);
        }
        if (size != null) {
            p.setPreviewSize(size.width, size.height);
            c.setParameters(p);
        }

then set

 mediaRecorder.setVideoSize(size.width, size.height);

I usually get 480 by 640. Is there a way to crop the video on android? I have seen ffmpeg library but i need to use this in project and i am not sure how LGPL works. Is there a simpler solution to this?

Body:
Actually just adding this dependency:

compile 'com.writingminds:FFmpegAndroid:0.3.2'

then using below code makes the thing. Only problem is, it's not so fast. In my tests, 20sec length 720x480 video cropped to 480x in 6-7 second with a galaxy s6.

FFmpeg ffmpeg = FFmpeg.getInstance(context);
String[] complexCommand = {"-y", "-i", originalFilePath, "-vf", "crop=480:480:80:0", "-preset", "ultrafast", "-strict", "-2", "-c:v", "libx264", "-c:a", "copy", originalFilePath.replace(".mp4", "_crop.mp4")};
try {
    ffmpeg.execute(complexCommand, new ExecuteBinaryResponseHandler() {
        @Override
        public void onStart() {super.onStart();}

        @Override
        public void onSuccess(String message) {super.onSuccess(message);}

        @Override
        public void onProgress(String message) {super.onProgress(message);}

        @Override
        public void onFailure(String message) {super.onFailure(message);}

        @Override
        public void onFinish() {super.onFinish();}
    });
} catch (FFmpegCommandAlreadyRunningException e) {
    Log.e("ffmpeg", "ffmpeg already running");
}

There's another better solution using with new MediaCodec if your min sdk is api 18


问:
Powershell bulk rename file name including ()
Files are named like 20160825().xlsx

Have tried both of this without any changes to the file names

```<code>Get-ChildItem "C:\Users\..." -Filter “*()*” -Recurse | Rename-Item NewName {$_.name -replace ‘()’,’’ }

Get-ChildItem "C:\Users\..." -Filter “*()*” -Recurse | Rename-Item -LiteralPath -NewName {$_.name -replace ‘()’,’’ }
</code>```

答:
You may let PowerShell/.net do the escaping:

```<code>$RE = [RegEx]::escape("()")
Get-ChildItem "C:\Users\..." -Filter "*()*" -Recurse |
    Rename-Item NewName {$_.Name -Replace $RE}
</code>```

BTW I'd avoid using an editor which replaces quotes with typographic ones.

Body:
Files are named like 20160825().xlsx

Have tried both of this without any changes to the file names

Get-ChildItem "C:\Users\..." -Filter “*()*” -Recurse | Rename-Item NewName {$_.name -replace ‘()’,’’ }

Get-ChildItem "C:\Users\..." -Filter “*()*” -Recurse | Rename-Item -LiteralPath -NewName {$_.name -replace ‘()’,’’ }

Body:
You may let PowerShell/.net do the escaping:

$RE = [RegEx]::escape("()")
Get-ChildItem "C:\Users\..." -Filter "*()*" -Recurse |
    Rename-Item NewName {$_.Name -Replace $RE}

BTW I'd avoid using an editor which replaces quotes with typographic ones.


问:
Why is FileStream not writable?
I'm writing a console program. I got the code to work but I want to change it into a generic function to enable using different Stream sources (such as MemoryStream).

Here's my program:

```<code>private static void Main(string[] args)
{
    using (var fs = new FileStream("f:\\!temp\\marcXmlRecords.mxml", FileMode.Open))
    {
        var reader = new MarcXmlReader().Read(fs);

        foreach (var record in reader)
        {
            var leader = record.Leader;
            var controlFields = record.GetControlFields();
            var dataFields = record.GetDataFields();
            var allFields = record.GetVariableFields();

            using (var fs2 = new FileStream("f:\\!temp\\marcRecords.mrc",
                FileMode.OpenOrCreate))
            {
                using (var writer = new MarcStreamWriter(fs2, "UTF-8"))
                {
                    var wrecord = MarcFactory.Instance.NewRecord();
                    wrecord.Leader = record.Leader;

                    foreach (var cfield in controlFields)
                    {
                        wrecord.AddVariableField(cfield);
                    }

                    foreach (var dfield in dataFields)
                    {
                        wrecord.AddVariableField(dfield);
                    }

                    foreach (var afield in allFields)
                    {
                        wrecord.AddVariableField(afield);
                    }

                    writer.Write(wrecord);
                }
            }
        }
    }
}
</code>```

Ok, works fine. Now let's make it more generic:

```<code>internal class Program
{
    private static void Main(string[] args)
    {
        using (var fs = new FileStream("f:\\!temp\\marcXmlRecords.mxml", FileMode.Open))
        {
            using (var fs2 = new FileStream("f:\\!temp\\marcRecords.mrc",
                FileMode.OpenOrCreate))
            {
                ConvertXmlMarcToMarc(fs, fs2);
            }
        }
    }

    private static void ConvertXmlMarcToMarc(Stream fin, Stream fout)
    {
        var reader = new MarcXmlReader().Read(fin);

        foreach (var record in reader)
        {
            var leader = record.Leader;
            var controlFields = record.GetControlFields();
            var dataFields = record.GetDataFields();
            var allFields = record.GetVariableFields();

            using (var writer = new MarcStreamWriter(fout, "UTF-8"))
            {
                var wrecord = MarcFactory.Instance.NewRecord();
                wrecord.Leader = record.Leader;

                foreach (var cfield in controlFields)
                {
                    wrecord.AddVariableField(cfield);
                }

                foreach (var dfield in dataFields)
                {
                    wrecord.AddVariableField(dfield);
                }

                foreach (var afield in allFields)
                {
                    wrecord.AddVariableField(afield);
                }

                writer.Write(wrecord);
            }
        }
    }
}
</code>```

But I get an exception on the line: using (var writer = new MarcStreamWriter(fs2, "UTF-8")):

An unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dll

  Additional information: Stream was not writable.

Stack Trace

at System.IO.BinaryWriter..ctor(Stream output, Encoding encoding, Boolean leaveOpen)

at MARC4J.Net.MarcStreamWriter..ctor(Stream output, String encoding, Boolean allowOversizeRecord)

at MARC4J.Net.MarcStreamWriter..ctor(Stream output, String encoding)

at SummonImport.Program.ConvertXmlMarcToMarc(Stream fin, Stream fout) in F:!!LocalRepository\Libraries_Apps\SummonImport\trunk\release\SummonImport\SummonImport\Program.cs:line 35

at SummonImport.Program.Main(String[] args) in F:!!LocalRepository\Libraries_Apps\SummonImport\trunk\release\SummonImport\SummonImport\Program.cs:line 20

at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)

at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)

at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()

at System.Threading.ThreadHelper.ThreadStart_Context(Object state)

at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

at System.Threading.ThreadHelper.ThreadStart()

答:
In the first example you open and close the file on each loop.

in your second example you are not reopening the file, the likelihood is that when the writer is disposed it is closing the underlying stream. The exception will be occurring on the second time through the loop.

Try moving the using statement to wrap the for loop and it should work

Title: Why is FileStream not writable?

Body:
I'm writing a console program. I got the code to work but I want to change it into a generic function to enable using different Stream sources (such as MemoryStream).

Here's my program:

private static void Main(string[] args)
{
    using (var fs = new FileStream("f:\\!temp\\marcXmlRecords.mxml", FileMode.Open))
    {
        var reader = new MarcXmlReader().Read(fs);

        foreach (var record in reader)
        {
            var leader = record.Leader;
            var controlFields = record.GetControlFields();
            var dataFields = record.GetDataFields();
            var allFields = record.GetVariableFields();

            using (var fs2 = new FileStream("f:\\!temp\\marcRecords.mrc",
                FileMode.OpenOrCreate))
            {
                using (var writer = new MarcStreamWriter(fs2, "UTF-8"))
                {
                    var wrecord = MarcFactory.Instance.NewRecord();
                    wrecord.Leader = record.Leader;

                    foreach (var cfield in controlFields)
                    {
                        wrecord.AddVariableField(cfield);
                    }

                    foreach (var dfield in dataFields)
                    {
                        wrecord.AddVariableField(dfield);
                    }

                    foreach (var afield in allFields)
                    {
                        wrecord.AddVariableField(afield);
                    }

                    writer.Write(wrecord);
                }
            }
        }
    }
}

Ok, works fine. Now let's make it more generic:

internal class Program
{
    private static void Main(string[] args)
    {
        using (var fs = new FileStream("f:\\!temp\\marcXmlRecords.mxml", FileMode.Open))
        {
            using (var fs2 = new FileStream("f:\\!temp\\marcRecords.mrc",
                FileMode.OpenOrCreate))
            {
                ConvertXmlMarcToMarc(fs, fs2);
            }
        }
    }

    private static void ConvertXmlMarcToMarc(Stream fin, Stream fout)
    {
        var reader = new MarcXmlReader().Read(fin);

        foreach (var record in reader)
        {
            var leader = record.Leader;
            var controlFields = record.GetControlFields();
            var dataFields = record.GetDataFields();
            var allFields = record.GetVariableFields();

            using (var writer = new MarcStreamWriter(fout, "UTF-8"))
            {
                var wrecord = MarcFactory.Instance.NewRecord();
                wrecord.Leader = record.Leader;

                foreach (var cfield in controlFields)
                {
                    wrecord.AddVariableField(cfield);
                }

                foreach (var dfield in dataFields)
                {
                    wrecord.AddVariableField(dfield);
                }

                foreach (var afield in allFields)
                {
                    wrecord.AddVariableField(afield);
                }

                writer.Write(wrecord);
            }
        }
    }
}

But I get an exception on the line: using (var writer = new MarcStreamWriter(fs2, "UTF-8")):

An unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dll

  Additional information: Stream was not writable.

Stack Trace

at System.IO.BinaryWriter..ctor(Stream output, Encoding encoding, Boolean leaveOpen)

at MARC4J.Net.MarcStreamWriter..ctor(Stream output, String encoding, Boolean allowOversizeRecord)

at MARC4J.Net.MarcStreamWriter..ctor(Stream output, String encoding)

at SummonImport.Program.ConvertXmlMarcToMarc(Stream fin, Stream fout) in F:!!LocalRepository\Libraries_Apps\SummonImport\trunk\release\SummonImport\SummonImport\Program.cs:line 35

at SummonImport.Program.Main(String[] args) in F:!!LocalRepository\Libraries_Apps\SummonImport\trunk\release\SummonImport\SummonImport\Program.cs:line 20

at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)

at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)

at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()

at System.Threading.ThreadHelper.ThreadStart_Context(Object state)

at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

at System.Threading.ThreadHelper.ThreadStart()


问:
Disable Variable Product Price Range on the WooCommerce Single Product Pages Only
I'm looking to hide variable products price range only on the single product pages for the product that is currently being viewed. I do not want the price range to be disabled for all the products listed in the "Related Products" below and any products listed in the widgets in the footer as well.

Everyone of the snippets I've found so far hides the price range for every product listed on the single products page. It also hides the price completely from view from the variable products that have the exact same price for all of them since they do not display below the drop down when selected.

Here is an example of a snippet I've found:

```<code>/*
Disable Variable Product Price Range completely:
*/

add_filter( 'woocommerce_variable_sale_price_html', 'my_remove_variation_price', 10, 2 );
add_filter( 'woocommerce_variable_price_html', 'my_remove_variation_price', 10, 2 );

function my_remove_variation_price( $price ) {
  $price = '';
  return $price;
}
</code>```

Example of price issue below:

答:
```<code>add_filter( 'woocommerce_variable_sale_price_html', 'ninja_remove_variation_price', 10, 2 );
add_filter( 'woocommerce_variable_price_html', 'ninja_remove_variation_price', 10, 2 );

function ninja_remove_variation_price( $price ) {
if ( is_product() ) {
$price = '';
}
return $price;
}
</code>```

Body:
I'm looking to hide variable products price range only on the single product pages for the product that is currently being viewed. I do not want the price range to be disabled for all the products listed in the "Related Products" below and any products listed in the widgets in the footer as well.

Everyone of the snippets I've found so far hides the price range for every product listed on the single products page. It also hides the price completely from view from the variable products that have the exact same price for all of them since they do not display below the drop down when selected.

Here is an example of a snippet I've found:

/*
Disable Variable Product Price Range completely:
*/

add_filter( 'woocommerce_variable_sale_price_html', 'my_remove_variation_price', 10, 2 );
add_filter( 'woocommerce_variable_price_html', 'my_remove_variation_price', 10, 2 );

function my_remove_variation_price( $price ) {
  $price = '';
  return $price;
}

Example of price issue below:


问:
Scanner scans first line and only the first input of the second line
I'm creating this code where a scanner should scan every word in the text file and then proceed to save each and every one of them in a specific array. But every time the scanner starts to scan it only reaches the next line and stops at the first word. I don't know what is causing this exactly. I'm using a delimiter where it separates words between commas ",".

Here is the piece of code:

```<code>package ex13a;
import java.util.Scanner;
import java.io.*;
/**
 *
 * @author Work
 */
public class Ex13a {
static Scanner scan = new Scanner(System.in);
static int[] number = new int[100];
static String[] f_users = new String[100];
static String[] l_users = new String[100];
static String[] passwd = new String[100];
static int i = 0;
static String fullName;

/**
 * @param args the command line arguments
 * @throws java.io.IOException
 */
public static void main(String[] args) throws IOException {
String path = "C:\\Users\\Work\\Desktop\\users.txt";
File inFile = new File(path);
Scanner inPut = new Scanner(inFile).useDelimiter(",");
Scanner inPut2 = new Scanner(inFile);
while(inPut.hasNext()){
    System.out.println(number[i] = inPut.nextInt());
    System.out.println(f_users[i] = inPut.next());
    System.out.println(l_users[i] = inPut.next());
    System.out.println(passwd[i] = inPut.next());

    i++;

}
</code>```

It throws me that error:

```<code>1
Ahmed
Dhaif
asdf56
Exception in thread "main" java.util.InputMismatchException
2
at java.util.Scanner.throwFor(Scanner.java:864)
at java.util.Scanner.next(Scanner.java:1485)
at java.util.Scanner.nextInt(Scanner.java:2117)
at java.util.Scanner.nextInt(Scanner.java:2076)
at ex13a.Ex13a.main(Ex13a.java:32)
C:\Users\Work\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53:     Java returned: 1
BUILD FAILED (total time: 0 seconds)
</code>```

答:
Read the error message. The exception was raised in the nextInt() method. From the documentation, for nextInt()

```<code>InputMismatchException - if the next token does not match the Integer
regular expression, or is out of range
</code>```

So the token you're reading isn't what you think it is. You could replace the nextInt() call with something else to see what it is, and go from there.

For the record, this code is remarkably trusting

The loop checks for "is there any token", and then assumes it is an
integer.

You assume that if there is 1 token, there will be 3 more after that each loop iteration.

There is no protection for the number of entries, you assume it will be <=100

Edit

My guess is there is something about the end-of-line that isn't printable, so when you read it it looks like an integer, but actually is something like ^r###, where "^r" is a control code and ### are digits.

I bet if you change the hasNext() to hasNextInt() it will just stop after processing 1 line. Read the file with a binary editor to see what you're really reading.

Body:
I'm creating this code where a scanner should scan every word in the text file and then proceed to save each and every one of them in a specific array. But every time the scanner starts to scan it only reaches the next line and stops at the first word. I don't know what is causing this exactly. I'm using a delimiter where it separates words between commas ",".

Here is the piece of code:

package ex13a;
import java.util.Scanner;
import java.io.*;
/**
 *
 * @author Work
 */
public class Ex13a {
static Scanner scan = new Scanner(System.in);
static int[] number = new int[100];
static String[] f_users = new String[100];
static String[] l_users = new String[100];
static String[] passwd = new String[100];
static int i = 0;
static String fullName;

/**
 * @param args the command line arguments
 * @throws java.io.IOException
 */
public static void main(String[] args) throws IOException {
String path = "C:\\Users\\Work\\Desktop\\users.txt";
File inFile = new File(path);
Scanner inPut = new Scanner(inFile).useDelimiter(",");
Scanner inPut2 = new Scanner(inFile);
while(inPut.hasNext()){
    System.out.println(number[i] = inPut.nextInt());
    System.out.println(f_users[i] = inPut.next());
    System.out.println(l_users[i] = inPut.next());
    System.out.println(passwd[i] = inPut.next());

    i++;

}

It throws me that error:

1
Ahmed
Dhaif
asdf56
Exception in thread "main" java.util.InputMismatchException
2
at java.util.Scanner.throwFor(Scanner.java:864)
at java.util.Scanner.next(Scanner.java:1485)
at java.util.Scanner.nextInt(Scanner.java:2117)
at java.util.Scanner.nextInt(Scanner.java:2076)
at ex13a.Ex13a.main(Ex13a.java:32)
C:\Users\Work\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53:     Java returned: 1
BUILD FAILED (total time: 0 seconds)

Body:
Read the error message. The exception was raised in the nextInt() method. From the documentation, for nextInt()

InputMismatchException - if the next token does not match the Integer
regular expression, or is out of range

So the token you're reading isn't what you think it is. You could replace the nextInt() call with something else to see what it is, and go from there.

For the record, this code is remarkably trusting

The loop checks for "is there any token", and then assumes it is an
integer.

You assume that if there is 1 token, there will be 3 more after that each loop iteration.

There is no protection for the number of entries, you assume it will be <=100

Edit

My guess is there is something about the end-of-line that isn't printable, so when you read it it looks like an integer, but actually is something like ^r###, where "^r" is a control code and ### are digits.

I bet if you change the hasNext() to hasNextInt() it will just stop after processing 1 line. Read the file with a binary editor to see what you're really reading.


问:
Play video when modal opens, pause when it closes
I have it so you click the image, the video opens up in a modal dialog, and then you have to click play. If you click off the video, it continues to play unless it has finished or has been paused beforehand.

If I set the video to autoplay, it will autoplay when the page loads, not when the dialog opens.

Code below:

```<code><img class="img-responsive portfolioImages center-block"     src="images/church1.jpg" alt="" data-toggle="modal" data-target="#1">
<div id="1" class="modal fade" tabindex="-1" role="dialog">
    <video controls class="center-block video">
        <source src="videos/big_buck_bunny.mp4" type="video/mp4">
        Your browser does not support HTML5 video.
    </video>
</div>
</code>```

答:
This one works perfectly, but you need to have enablejsapi=1 in your src, like this for example:

```<code><iframe src="https://www.youtube.com/embed/YOUR_VIDEO_CODE?rel=0&controls=0&showinfo=0&enablejsapi=1" frameborder="0" allowfullscreen></iframe>

function playStopVideo() {
    var youtubeFunc ='';
    var outerDiv = $("#myModal");
    var youtubeIframe = outerDiv.find("iframe")[0].contentWindow;
    outerDiv.on('hidden.bs.modal', function (e) {
        youtubeFunc = 'stopVideo';
        youtubeIframe.postMessage('{"event":"command","func":"' + youtubeFunc + '","args":""}', '*');
    });
    outerDiv.on('shown.bs.modal', function (e) {
        youtubeFunc = 'playVideo';
        youtubeIframe.postMessage('{"event":"command","func":"' + youtubeFunc + '","args":""}', '*');
    });
}

playStopVideo();
</code>```

Body:
I have it so you click the image, the video opens up in a modal dialog, and then you have to click play. If you click off the video, it continues to play unless it has finished or has been paused beforehand.

If I set the video to autoplay, it will autoplay when the page loads, not when the dialog opens.

Code below:

    <video controls class="center-block video">
        <source src="videos/big_buck_bunny.mp4" type="video/mp4">
        Your browser does not support HTML5 video.
    </video>

Body:
This one works perfectly, but you need to have enablejsapi=1 in your src, like this for example:

<iframe src="https://www.youtube.com/embed/YOUR_VIDEO_CODE?rel=0&amp;controls=0&amp;showinfo=0&enablejsapi=1" frameborder="0" allowfullscreen></iframe>

function playStopVideo() {
    var youtubeFunc ='';
    var outerDiv = $("#myModal");
    var youtubeIframe = outerDiv.find("iframe")[0].contentWindow;
    outerDiv.on('hidden.bs.modal', function (e) {
        youtubeFunc = 'stopVideo';
        youtubeIframe.postMessage('{"event":"command","func":"' + youtubeFunc + '","args":""}', '*');
    });
    outerDiv.on('shown.bs.modal', function (e) {
        youtubeFunc = 'playVideo';
        youtubeIframe.postMessage('{"event":"command","func":"' + youtubeFunc + '","args":""}', '*');
    });
}

playStopVideo();


问:
Function evaluation in dplyr summarize
I think I'm missing something fundamental about how R evaluates things.  Consider the following:

```<code>library("tidyverse")
dt0 <- tibble(x=1:10, y=11:20)
filter(dt0, 1==x)                          # Returns the first row
purrr::contains(list(1), 1)                # TRUE
filter(dt0, purrr::contains(list(1), x))   # Returns NO rows
</code>```

I tried wrapping contains in a custom function (no change), and added a print statement to try to debug this, but it as near as I can tell, even when the value of x is 1 (class is still numeric), contains(list(1), x) returns TRUE outside of filter, but FALSE inside it.

Why?

Possibly related, I don't really understand how you can pass columns to functions like unique but ALSO to other functions (like my custom one).  (I understand that you can and do, but not how it's possible.)  My custom function behaved as though it was called multiple times, once for each value of x.  unique, though, would have to have all the values, yeah?

How can both unique and a single-argument function work on a column?

答:
It seems like the issue is coming down to the classes of the comparison.  Down in the source of purrr::contains() an indentical() is being called to compare dt0$x to list[[i]].  The contents of dt0$x are integer while 1 is not.  So to fix this we can use 1L.

```<code>> is.integer(1:10)
[1] TRUE
> is.integer(1)
[1] FALSE

> identical((1:10)[1], 1)
[1] FALSE
> identical((1:10)[1], 1L)
[1] TRUE
</code>```

However the call to filter(dt0, purrr::contains(list(1L), x)) will still return zero rows since the second argument is not iterated over in purrr::contains().  So it is checking if the whole column x is contained in the list(1) (which is of course FALSE).  You'll have to manually iterate over the second arg if you want to use purrr::contains in this way.

I don't think the syntax is that elegant but if you want to stay in purrr you can use:

```<code>> filter(dt0, purrr::map_lgl(x,~purrr::contains(list(1L), .x)))
# A tibble: 1 × 2
      x     y
  <int> <int>
1     1    11
</code>```

Title: Function evaluation in dplyr summarize

Body:
I think I'm missing something fundamental about how R evaluates things.  Consider the following:

library("tidyverse")
dt0 <- tibble(x=1:10, y=11:20)
filter(dt0, 1==x)                          # Returns the first row
purrr::contains(list(1), 1)                # TRUE
filter(dt0, purrr::contains(list(1), x))   # Returns NO rows

I tried wrapping contains in a custom function (no change), and added a print statement to try to debug this, but it as near as I can tell, even when the value of x is 1 (class is still numeric), contains(list(1), x) returns TRUE outside of filter, but FALSE inside it.

Why?

Possibly related, I don't really understand how you can pass columns to functions like unique but ALSO to other functions (like my custom one).  (I understand that you can and do, but not how it's possible.)  My custom function behaved as though it was called multiple times, once for each value of x.  unique, though, would have to have all the values, yeah?

How can both unique and a single-argument function work on a column?

Body:
It seems like the issue is coming down to the classes of the comparison.  Down in the source of purrr::contains() an indentical() is being called to compare dt0$x to list[[i]].  The contents of dt0$x are integer while 1 is not.  So to fix this we can use 1L.

> is.integer(1:10)
[1] TRUE
> is.integer(1)
[1] FALSE

> identical((1:10)[1], 1)
[1] FALSE
> identical((1:10)[1], 1L)
[1] TRUE

However the call to filter(dt0, purrr::contains(list(1L), x)) will still return zero rows since the second argument is not iterated over in purrr::contains().  So it is checking if the whole column x is contained in the list(1) (which is of course FALSE).  You'll have to manually iterate over the second arg if you want to use purrr::contains in this way.

I don't think the syntax is that elegant but if you want to stay in purrr you can use:

> filter(dt0, purrr::map_lgl(x,~purrr::contains(list(1L), .x)))
# A tibble: 1 × 2
      x     y
  <int> <int>
1     1    11


问:
how can i combine columns in one columns in excel
I have list of universities. Universities has columns of keywords. I need to make 2 mode matrix (universities X keyword) with using pivot table. so i need to combine separeted keyword columns under one column with their universities. I tried adding universities columns between keywords columns and than cut-paste one by one each university-keyword column under A and B column. But it is not easy to do when keywords gets more. This image is an example of what i need. How can i achive that transformation 1 to 2. Thanks for answers.

答:
I have a macro able to split cell value into rows.
Should able to help you go thru step 1 to step 2.

What Split To Row Macro can do:

Firstly, create a concatenate value for all columns into 1 as below

Then using column Id and the concatenate column only, Run Split To Row macro will able convert data into long list.


问:
How to convert PDF to HTML?
Is there a proper library which I can use to convert PDF to HTML or some other format that can be converted to HTML easily?

I searched similar questions, but to no luck.

I want to be able to extract text from PDF's, possibly images. I'm not looking to embed the PDF inside the HTML.

答:
It's not that difficult to convert PDF to HTML. There are many online options, which may, however, expose your data to third parties. Follow these steps, and the output is great.

Open the PDF2HTMLEX page.
(You can either follow to next steps which i have mentioned, or follow the directions from the page.)

The package is available for download for Windows from here.

From the many options available, I recommend downloading "pdf2htmlEX-win32-0.14.6-upx-with-poppler-data.zip (pdf2htmlEx.exe is packed with UPX)"

After downloading and un-zipping conversion is just one cmd command away.

```<code>C:\Users\kjk\Downloads\pdf2htmlEX-win32-0.14.6-upx-with-poppler-data>pdf2htmlEX.exe c:\1\abc.pdf
</code>```

Final Command:

```<code>pdf2htmlEX.exe c:\1\abc.pdf
</code>```

(You can of course shorten the name of the folder, however, I kept it the same as you would see after un-zipping the download. I am assuming you can change the directory in cmd to the desired folder or else Google how.)

abc.pdf will be converted to HTML and will be saved as abc.html in the same folder as that of your exe.

Title: How to convert PDF to HTML?

Body:
It's not that difficult to convert PDF to HTML. There are many online options, which may, however, expose your data to third parties. Follow these steps, and the output is great.

Open the PDF2HTMLEX page.
(You can either follow to next steps which i have mentioned, or follow the directions from the page.)

The package is available for download for Windows from here.

From the many options available, I recommend downloading "pdf2htmlEX-win32-0.14.6-upx-with-poppler-data.zip (pdf2htmlEx.exe is packed with UPX)"

After downloading and un-zipping conversion is just one cmd command away.

C:\Users\kjk\Downloads\pdf2htmlEX-win32-0.14.6-upx-with-poppler-data>pdf2htmlEX.exe c:\1\abc.pdf

Final Command:

pdf2htmlEX.exe c:\1\abc.pdf

(You can of course shorten the name of the folder, however, I kept it the same as you would see after un-zipping the download. I am assuming you can change the directory in cmd to the desired folder or else Google how.)

abc.pdf will be converted to HTML and will be saved as abc.html in the same folder as that of your exe.


问:
In Javascript, how do I automatically move the cursor to the next text box when the current one is full?
Suppose I have two HTML textboxes on my web page:

```<code><input type='text' id='txt1' maxlength='5' />
<input type='text' id='txt2' maxlength='5' />
</code>```

Each textbox allows the user to type up to five characters.  How can I use Javascript with or without jQuery to automatically move the cursor from txt1 to txt2 when the user types five charcters into txt1?

答:
A basic implementation would be like this:

```<code> $('#txt1').keyup(function() {
     if(this.value.length == $(this).attr('maxlength')) {
         $('#txt2').focus();
     }
 });
</code>```

But there are some usability subtleties to it you may or may not care about. If you find the above to be insufficient, there are many jQuery plugins out there to do this for you.

Body:
Suppose I have two HTML textboxes on my web page:

<input type='text' id='txt1' maxlength='5' />
<input type='text' id='txt2' maxlength='5' />

Each textbox allows the user to type up to five characters.  How can I use Javascript with or without jQuery to automatically move the cursor from txt1 to txt2 when the user types five charcters into txt1?

Body:
A basic implementation would be like this:

 $('#txt1').keyup(function() {
     if(this.value.length == $(this).attr('maxlength')) {
         $('#txt2').focus();
     }
 });

But there are some usability subtleties to it you may or may not care about. If you find the above to be insufficient, there are many jQuery plugins out there to do this for you.