text:
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
  <title>SAVI Controls, LLC - Dealer Agreement</title>

  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  <link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
  <link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>

  <link rel='shortcut icon' href='favicon.ico' type='image/x-icon'/ >

AUTHORIZED SAVI DEALER AGREEMENT

          The following Authorized Dealer Agreement, the "AGREEMENT," is made by and
          between SAVI Controls, LLC, under the laws of the State of Texas and having
          its principal office at 2420 Tarpley Rd, Suite 210, Carrollton, TX 75006,
          hereinafter referred to as "SAVI" and our newest SAVI Authorized Dealer with
          its principle offices noted in their SAVI Dealer Application hereinafter
          referred to as "DEALER".

1. APPOINTMENT AND ACCEPTANCE

          SAVI appoints DEALER as a non-exclusive, unless otherwise noted in
          Section 2.c.), Authorized DEALER for all SAVI PRODUCTS listed under the
          SCHEDULE A hereto (the "PRODUCT").

Appointment is subject to the license AGREEMENT and other
        terms and conditions as set forth herein. Such terms and conditions
        may be modified by SAVI from time to time, without prior notice, as pertaining
        to DEALER programs, promotions and PRODUCT. SAVI makes no representation of warranty
        regarding PRODUCT availability. DEALER accepts the appointment and agrees to
        use its best efforts to sell and promote the sale of PRODUCTS.

2. LICENSE, LOCATIONS AND TERRITORY

          a.) Technical Proficiency:
          DEALER agrees to maintain on staff a minimum of one SAVI Certified Technician
          with prior audio/video and control systems integration experience. Failure to
          maintain such staff may result in suspension or loss of license and authorized
          DEALER status with SAVI. SAVI Certified Technician requires: Tech I Control4
          Certification and SAVI Technical Certification.

          b.) License:
          SAVI grants DEALER a limited license for the purpose
          of promoting and distributing the PRODUCTS to commercial buyers and end-users
          in the United States (and its territories) and other territories if agreed to
          by both parties from time to time through DEALER sales channels, in accordance
          with DEALER obligations as set forth in the SCHEDULE A included below (pages
          8-9).

          c.) Locations and Territory:
          DEALER may distribute PRODUCTS from
          one or more locations, provided that SAVI separately approves each location,
          electronically or in writing, beyond the primary location shown above.

          d.) Reserved Rights:
          SAVI reserves the right, at its discretion, to: (i) change PRODUCT
          offerings, (ii) authorize other DEALER, (iii) market and sell
          SAVI PRODUCTS through other DEALER channels and other means.

          e.) Intellectual Property:
          The license and dealership granted herein to DEALER does not
          constitute a sale or transfer of ownership of any intellectual property of
          SAVI, including but not limited to patents, copyrights, trade secrets, or other
          rights (the "SAVI intellectual property") all of which are owned by SAVI.
          DEALER shall not decompile or reverse engineer any SAVI intellectual property
          ("SAVI IP"), nor shall DEALER develop or attempt to develop any derivative work
          based in whole or in part on SAVI IP.

3. PRICING AND TAXES

          a.) PRICING:
          SAVI will sell PRODUCTS to DEALER at prices according to current published
          price list when orders are placed, or as otherwise agreed upon by both parties.
          Any new or revised price list will immediately and automatically supersede all
          prior price lists. Prices do not include sales, use, excise or other similar taxes.

          b.) Taxes:
          The amount of any valid present or future tax that is attributable to DEALER,
          shall be paid by DEALER, or in lieu thereof, DEALER shall provide SAVI with a
          tax exemption certificate acceptable to all relevant authorities.

          c.) Dealer Retail Pricing:
          DEALER determines its own price for sales to its customers. SAVI provides a
          Manufacturer's Suggested Retail Price (MSRP) for reference purposes, and SAVI
          shall not interfere with retail pricing established by DEALER.

          d.) Related Matters:
          DEALER shall not
          make any deductions from amounts due to SAVI unless SAVI has issued a credit
          memo or other such authorization in writing. Any unauthorized deduction shall
          be grounds for potential termination of this AGREEMENT, without any liability
          to DEALER. DEALER hereby grants SAVI a security interest in all PRODUCTS sold
          by SAVI to DEALER until such time that payment is received in full for such
          PRODUCTS, and agrees that SAVI may file such financing statements as SAVI deems
          necessary to perfect such security interests.

4. PURCHASE ORDERS

          a.) Form:
          Orders for SAVI PRODUCTS are
          to be initiated by "Purchase Order" (PO) from DEALER in the format designated
          by SAVI, including electronic PO's. Each PO submitted by DEALER shall be
          binding upon the parties upon written acceptance by SAVI or upon shipment of
          PRODUCT by SAVI. The terms and conditions of this AGREEMENT shall apply to
          all PO's and will supersede any other terms or conditions set forth on any PO
          submitted by DEALER, notwithstanding SAVI's acceptance and fulfillment thereof.

          b.) Forecasts:
          DEALER shall provide SAVI with a written quarterly forecast of
          expected orders for the upcoming calendar quarter. DEALER too agrees that
          quarterly forecast constitute a reasonable good faith anticipation of orders to
          be placed. SAVI may also request of DEALER from time to time expected orders to
          be placed in a given calendar month.

          c.) Cancellation of Purchase Orders:
          SAVI reserves the right to cancel any pending PO in the event that DEALER
          fails to pay amount owed, past due, or if DEALER breaches or fails to comply
          with the terms of this AGREEMENT, or if DEALER fails to meet the credit
          requirements established by SAVI.

          d.) Shipments and Expedited Delivery:
          SAVI will ship PRODUCTS, with appropriate packaging, by reputable carrier, to the
          address or location designated by DEALER in the PO. SAVI will process any
          "rush" orders for product placed by DEALER in earnest. Expedited delivery dates
          may incur added shipping charges.

5. PAYMENT

          a.) General Payment Terms:
          Payment for
          orders shall be due prior to PRODUCT shipment unless otherwise agreed by SAVI,
          or set forth as part of a DEALER program or promotion in which an authorized
          DEALER participates. All transactions
          are valued and paid in United States currency. Interest shall accrue on overdue
          accounts at the rate of 18% per annum or, if lower, the maximum rate allowed by
          law.

          b.) Credit Terms:
          SAVI may extend, at its discretion, certain credit terms to DEALER, and
          shipments may be sent
          pursuant to such credit terms. Such terms may be established in writing
          according to SAVI's standard credit application and agreement, or set forth as
          part of a DEALER program or promotion in which an authorized DEALER
          participates. If DEALER defaults on its obligations pertaining to any such
          credit terms, SAVI may declare all amounts immediately due, as well as any
          other remedies pursuant to the credit agreement or at law or equity. SAVI also
          reserves the right to limit, with respect to any PO, shipment, or the credit
          available to DEALER.

          c.) Title:
          Title to the PRODUCTS, including risk of loss, will pass
          to DEALER upon delivery of the PRODUCTS by SAVI to the carrier at SAVI's point
          of shipment. SAVI shall have no responsibility to insure shipments.

          d.) Taxes:
          DEALER shall pay when due all
          taxes, fees, levies, duties and other payments required in connection with the
          importation, distribution and sales of PRODUCTS, including without limitation
          any related income tax liability.

6. RETURNS

          a.) General Terms:
          DEALER shall have the right to return, subject to terms
          hereof and at SAVI's expense, for a full credit or refund, any PRODUCTS that
          (i) are shipped in error or were not ordered pursuant to DEALER Purchase
          Order; or (ii) are damaged or defective (but not including damage
          incurred during shipment). In any of the foregoing
          events, DEALER shall notify SAVI within five (5) days of the receipt of the
          subject PRODUCTS, including a reasonable explanation for the return. SAVI
          reserves the right to deny any return for which notice is not given within the
          applicable notification period, or in the case of subsection (ii) above,
          if the damage is caused by
          the negligence or willful misconduct of DEALER or its representative or agents.
          If DEALER is eligible to return the PRODUCTS, SAVI will provide DEALER with a
          Return Merchandise Authorization ("RMA") number and related return
          instructions. Failure to obtain an RMA number, and/or to comply with the return
          instructions may result in denial of the return, or of some or all of the
          credit or refund amount. If upon examination, SAVI determines that any returned
          PRODUCTS were improperly returned or are not eligible for return, then SAVI
          reserves the right to send PRODUCT back to DEALER. This return policy is
          subject to change or modification from time to time consistent with SAVI's
          standard return policies, which are incorporated herein by reference.

          b.) Definition of "Defective":
          For purposes of Section 6.a.) the term "defective" shall mean any PRODUCT that
          is not performing in accordance with the limited warranty associated with such
          upon inspection by DEALER.

          c.) No Unauthorized Returns:
          DEALER shall not return any PRODUCTS
          except as expressly permitted under Section 6.a.), and SAVI shall have no
          obligation to accept any other returns. All returns not in compliance with
          Section 6.a.) shall at SAVI's option, in addition to the right of return and
          other remedies set forth in Section 6.a.), be subject to a handling charge due
          to SAVI from DEALER equal to twenty percent 20% of the price for the returned
          PRODUCTS on SAVI's then-current price list plus any freight, insurance or
          similar charges previously paid or incurred by SAVI in connection with the
          original shipment of such PRODUCTS to DEALER.

7. TRADEMARKS

          a.) Trademark Use:
          SAVI hereby grants
          DEALER a limited license to use, exhibit, display, reproduce and publish SAVI's
          trade names, trademarks and service marks associated with the PRODUCTS in order
          to promote and sell the PRODUCTS. DEALER shall comply with SAVI's trademark
          usage guidelines, as may be modified from time to time, which are available
          upon request.

          b.) Trademark Ownership:
          SAVI has and
          shall retain exclusive ownership of all trademarks, trade names and PRODUCT
          names relating to SAVI or PRODUCTS whether listed in catalog or marketing
          materials or otherwise ("SAVI marks"). Neither DEALER nor its affiliates shall
          directly or indirectly contest or challenge, or do anything inconsistent with
          SAVI's exclusive ownership of the SAVI marks. DEALER shall not alter, deface,
          remove, cover, mutilate or add to the SAVI marks, except that if required by
          relevant regulations DEALER may attach labels in the local language, and/or
          inserts or information in PRODUCT containers.

          c.) SAVI Content:
          SAVI may provide to
          DEALER, without limitation, PRODUCT advertising and promotional materials, as
          well as specifications, images, and other textual, graphical and/or multimedia
          content regarding the PRODUCTS for use in preparing advertising and promotional
          material ("SAVI content"). Subject to any limitations which SAVI places on the
          use of SAVI Content by notification to DEALER, SAVI hereby grants DEALER a
          license to use, exhibit and display, reproduce and publish (but not to modify,
          alter or amend) such SAVI Content for the purpose of advertising and promoting
          the PRODUCTS.

          d.) Use After Termination:
          Upon expiration or termination of this AGREEMENT, unless otherwise notified by SAVI,
          DEALER shall be permitted to continue to advertise and promote the PRODUCTS,
          using the SAVI Marks and SAVI Content, all in accordance with Section 7.a.),
          7.b.), and 7.c.), only until DEALER has depleted its inventory of the PRODUCTS.
          Thereafter, any license granted hereunder shall terminate and any use by DEALER
          of the SAVI marks and/or SAVI content shall be immediately discontinued without
          demand or judicial resolution.

8. CONFIDENTIALITY

These terms and any information marked or identified as confidential, or
          regardless of form or markings is of the nature that a reasonable person
          would understand its owner would not want it disclosed to the public will be
          considered to be "confidential information." Further, confidential
          information shall also include (a) this AGREEMENT and its terms;
          (b) technical matters concerning SAVI's trade secret processes or
          devices, knowhow, data, formulas, inventions (whether or not patentable or
          copyrighted), specifications and characteristics of PRODUCTS or services
          planned or being developed, and research subjects, methods and results,
          (c) SAVI's pricing, policies, markets and sales strategies, (d)
          matters relating to SAVI's project initiatives and designs, or (e)
          other information of a similar nature not generally disclosed to the public.
          Each party agrees not to disclose confidential information except to its own
          employees, or a third party bound by similar confidentiality obligations that
          are no less protective than this Section 8, and that have a need to know to
          perform their responsibilities. Each party agrees to take at least the same
          precautions to protect confidential information as such party would utilize
          to ensure the protection, confidentiality and security of its own
          confidential information. Confidential information shall not include any
          information which (a) is or becomes generally known or available
          through no act or failure to act by the receiving party; (b) is
          already known by the receiving party as evidenced by its written records;
          (c) is hereafter rightfully furnished to the receiving party by a
          third party without restriction on disclosure; or (d) is disclosed in
          response to a valid order by a court or other governmental body, or pursuant
          to the rules and regulations of any stock exchange or stock association in
          which the securities of the receiving party may be traded from time to time,
          provided that the receiving party provides the disclosing party with prior
          written notice of such disclosure as soon as reasonably possible in order to
          permit the disclosing party to seek confidential treatment of such
          information. Upon the expiration or earlier termination of this AGREEMENT, a
          party may, in writing, request either the prompt return or destruction, and a
          written certification of such destruction, of any confidential information
          provided to the other party. Each party further agrees that monetary damages
          may not alone be a sufficient remedy for unauthorized disclosure of
          confidential information and that the non-disclosing party shall be entitled
          to seek all remedies and damages available in law and equity, including but
          not limited to such injunctive relief as may be deemed proper by a court of
          competent jurisdiction.

9. ADDITIONAL OBLIGATIONS OF SAVI

          a.) PRODUCT Materials: SAVI shall provide to DEALER access to
          marketing and technical information prepared by SAVI relating to the
          PRODUCTS, service, manuals, PRODUCT specifications, end-user warranties and
          other PRODUCT data and materials online through www.savicontrols.com/dealer.
          SAVI shall provide such PRODUCT Materials in English, and may provide them in
          other languages. If SAVI does not produce the PRODUCT Materials, or any part
          of them, in a language required by DEALER, then DEALER may, at its own
          expense and in good faith consult with SAVI, translate or obtain the
          translation of such PRODUCT Materials into such other language; provided that
          DEALER shall be required to obtain SAVI's approval, which shall not be
          unreasonably withheld, of any translation and adaptation of the PRODUCT
          Materials prior to distribution. DEALER shall indemnify and hold harmless
          SAVI from and against any and all damages, claims, losses or other expenses
          resulting from any mistake or omission in any translation or adaptation
          prepared by or on behalf of DEALER.

          b.) Training: Subject to reservation
          scheduling to ensure space availability, DEALER will be eligible to attend
          training programs at SAVI's training facilities at charges agreed upon by both
          parties. DEALER agrees to make available a reasonable number of its personnel
          for such training, and agrees that travel and related costs (if any) are DEALER
          responsibility.

          c.) Compliance: SAVI shall manufacture
          its PRODUCTS in compliance with applicable laws and will in accordance with
          applicable UL (Underwriter's Laboratory) listing standards. SAVI will make
          commercially reasonable efforts to notify DEALER as soon as practicable
          following the discovery by SAVI of any material non-compliance with applicable
          laws, or SAVI's receipt of a notice of a claim from a consumer, (which individually or in the aggregate in
          SAVI's reasonable expectation may result in material liability to DEALER)
          that a PRODUCT is defective or does not comply with all applicable laws.

10. REPRESENTATIONS AND WARRANTIES

          a.) SAVI Representation and Warranties: SAVI represents and
          warrants to DEALER that (i) it has the authority to enter into
          this AGREEMENT and to sell the PRODUCTS to DEALER, free and clear of all
          liens, charges, encumbrances, or other restrictions, and that the persons
          signing this AGREEMENT on behalf of SAVI are authorized to sign;
          (ii) it will provide a manufacturer's warranty to end-users of the
          PRODUCTS that is generally consistent with industry standards, which will
          constitute SAVI's only warranty regarding the PRODUCTS; (iii) it
          will comply with all applicable federal, state, and local laws and
          regulations in performing its obligations under this AGREEMENT, including
          but not limited to laws and regulations pertaining to PRODUCT design,
          manufacture, packaging and labeling and, if applicable, importation and
          the Foreign Corrupt Practices Act; and (iv) the PRODUCTS are not
          trans-shipped for the purpose of mislabeling, evading quota or country of
          origin restrictions or for the purpose of avoiding compliance with law.

          b.) DEALER Representation and Warranties: DEALER represents and
          warrants to SAVI that (i) it has the authority to enter into this
          AGREEMENT, and that the persons signing this AGREEMENT on behalf of
          DEALER are authorized to sign; (ii) it will comply with all
          applicable federal, state, and local laws, and that it will not export or
          ship any PRODUCTS outside of the United States except in strict
          compliance with any export-related laws and regulations; (iii) it
          will exert commercially reasonable efforts to promote and sell the
          PRODUCTS consistent with DEALER sales, marketing and merchandising plans,
          and (iv) it will not make false or misleading representations, or
          otherwise make any disparaging statement, about SAVI or any PRODUCT.

11. LIMITATION OF LIABILITY

          Neither party makes any representations nor warranties, express or
          implied, regarding the business results that the other may obtain as a
          consequence of this AGREEMENT or the transactions contemplated hereby.
          Except as set forth in, and only to the extent of, the end-user warranty
          pursuant to which SAVI extends certain warranty protection to the
          end-user. The PRODUCTS are being sold "AS IS," and SAVI makes no warranty
          to DEALER, express or implied, including any warranty of merchantability
          or fitness for a particular purpose. Except with regard to the provisions
          of this AGREEMENT relating to confidential information and intellectual
          property rights. Neither party will be liable for lost profits or lost
          savings, incidental, indirect, consequential, special, exemplary or
          punitive damages, except with regard to the provisions of this AGREEMENT
          relating to confidential information and intellectual property rights,
          neither party's liability shall exceed in the aggregate amount paid or
          owed to SAVI during the prior (12) months from the date such liability
          arise or $5,000.00, whichever is more.

          12. TERM AND TERMINATION

          a.) Term: This AGREEMENT will be effective for an initial term
          commencing on the date that this AGREEMENT is executed by SAVI and
          continuing thereafter until December 31 of the same year (the "Initial
          Term"). Unless sooner terminated as provided herein, upon the expiration
          of the Initial Term, this AGREEMENT will automatically renew for
          successive periods of one (1) year each (each, a "renewal term")
          unless terminated at the end of the initial term or any renewal term by
          either party by delivering written notice of the intent to terminate at
          least sixty (30) days prior to the end of the initial term or renewal
          term, as applicable.

          b.) Termination: Either party may terminate this AGREEMENT at any
          time without cause upon delivering sixty (60) days written notice to the
          other party. In the event either party is in material breach of this
          AGREEMENT, this AGREEMENT may be terminated immediately by the
          non-breaching party, provided that notice describing the breach is
          presented to the breaching party. Rectifying the conditions of the breach
          within fifteen days (15) after receiving notice, and reporting that the
          breech has been rectified will in effect nullify the termination notice.

          c.)Termination Events: (1) Without cause. Upon expiration
          or termination of this AGREEMENT without cause by either party, DEALER
          shall either, at SAVI's option:(i) be permitted to complete
          sell-through of its remaining PRODUCT inventory; or (ii) return
          its remaining PRODUCT inventory to SAVI, with the return freight expenses
          to be borne by the terminating party. (2) For Cause. Upon
          termination of this AGREEMENT by either party for cause due to the other
          party's breach, DEALER shall either, at SAVI's option:(i) be
          permitted to complete sellthrough of its remaining PRODUCT inventory; or
          (ii) return its remaining PRODUCT inventory to SAVI at the
          breaching party's expense.

          13. INDEMNIFICATION

          a.) By SAVI: SAVI will indemnify, defend, and hold DEALER, and its
          agents and employees, harmless from and against any and all claims,
          actions, liabilities, losses, costs and expenses (a "claim") arising from
          (i) a PRODUCT recall, whether initiated by SAVI or a valid order
          by a court or other governmental body; (ii) claims that the
          PRODUCTS or any SAVI Content infringe, misappropriate or injure a third
          party's intellectual property or proprietary rights; and (iii)
          false or misleading PRODUCT specifications provided to DEALER to promote
          and sell the PRODUCTS. DEALER agrees to give SAVI prompt written notice
          of any claim, to tender the defense to SAVI, and to grant SAVI the right
          to control settlement and resolution. SAVI agrees to pay all costs of
          liability, settlement and defense, including its attorney fees and costs.
          If it deems appropriate to limit or reduce its potential liability
          arising from a claim, SAVI may cause DEALER to limit, suspend or
          terminate distribution of any PRODUCT or PRODUCTS, in one or more
          territories or countries, pending resolution of the claim provided;
          however that in the event of a suspension or termination of distribution
          pursuant to the foregoing, SAVI will accept a return of, and will
          reimburse DEALER at the price paid for DEALER existing inventory of
          suspended or terminated PRODUCT. Furthermore, if SAVI receives written
          notice of an alleged infringement or believes that a claim of
          infringement is likely, SAVI may at its sole option and expense:
          (1) procure for DEALER the right to continue to use PRODUCT at
          SAVI's sole expense; (2) modify SAVI's PRODUCT so that it no
          longer infringes; (3) replace the infringing portion of PRODUCT
          with material(s) that do not infringe, or (4) terminate this
          AGREEMENT.

          b.) By DEALER: DEALER will indemnify, defend, and hold SAVI, its
          parent, affiliates, agents and employees harmless from and against any
          and all claims arising from DEALER negligence or willful misconduct, and
          from DEALER breach of this AGREEMENT including making any false or
          misleading statements about PRODUCT. SAVI agrees to give DEALER prompt
          written notice of any such claims, to tender the defense to DEALER,
          cooperate fully with any investigative or other requests, and to grant
          DEALER the right to control settlement and resolution. DEALER agrees to
          pay all costs finally awarded by a court of competent jurisdiction or
          agreed in a settlement of any such claim, including reasonable attorney
          fees and costs.

          14. ASSIGNMENT

          This AGREEMENT and any rights or obligations hereunder may not be
          assigned by either party without first obtaining the other party's
          express written consent, which consent shall not be unreasonably
          withheld; provided, however, that SAVI may assign this AGREEMENT, without
          obtaining express written consent by DEALER to (a) a successor
          corporation resulting from a merger or consolidation or to a purchaser of
          all or substantially all of SAVI's assets or a majority, or controlling
          interest in SAVI's voting stock; and (b) a present or future
          subsidiary or affiliate. Any attempted assignment in violation of this
          AGREEMENT shall be null and void.

          15. FORCE MAJEURE

          Neither party shall be in breach of this AGREEMENT solely due to causes
          beyond the control and without the fault or negligence of such party.
          Such causes may include, but are not restricted to, acts of God or of a
          public enemy, acts of the government in either its sovereign or
          contractual capacity, fires, floods, epidemics, quarantine restrictions,
          strikes, freight embargoes, power failure, or failure of the customary
          delivery systems, but in every case the failure to perform must be beyond
          the control and without fault or negligence of the party failing to
          perform. Each party must inform the other of any force majeure event
          within five (5) business days after such party became aware of its
          occurrence, and within reason.

          16. NOTICES

          All notices and other communications which are required or permitted
          under this AGREEMENT shall be in writing and shall be deemed to have been
          duly given if hand-delivered or mailed by either registered or certified
          mail, return receipt requested, or by a nationally recognized overnight
          courier service, receipt confirmed.

          In the case of notices via first-class mail or courier service, notices
          shall be deemed effective upon the date of receipt. Notices shall be
          addressed to the parties as set forth on the signature page of this
          AGREEMENT, unless either party notifies the other of a change of address
          in accordance with this Section 16, in which case the latest noticed
          address shall be used.

          17. GENERAL

          a.) Relationship of the Parties: The relationship between the
          parties shall be that of independent contractors. Nothing herein shall be
          construed as creating or constituting any agency or employment
          relationship, partnership, or joint venture between the parties.

          b.) Governing Law, Jurisdiction: This AGREEMENT shall be governed
          by and interpreted under the laws of the State of Texas. SAVI and DEALER
          expressly consent and submit to the exclusive jurisdiction of the state
          and federal district courts located in Dallas, TX.

          c.) Enforceability: If any provision of this AGREEMENT is held to
          be unenforceable by a court of competent jurisdiction, such provision
          shall be more narrowly and equitably construed so that it becomes legal
          and enforceable or if such construction is not possible, then the
          provision shall be deemed removed, and in either case the entire Terms
          shall not fail on account thereof and the balance of the Terms shall
          continue in full force and effect.

          d.) No Waiver: Any of the provisions of this AGREEMENT may be
          waived by the party entitled to the benefit thereof. Neither party will
          be deemed, by any act or omission, to have waived any of its right or
          remedies hereunder unless such waiver is in writing and signed by the
          waiving party, and then only to the extent specifically set forth in such
          writing. A waiver with reference to one event will not be construed as
          continuing or as a bar to or waiver of any other right or remedy, or as
          to a subsequent event.

          e.) Counterparts and Electronic Signature: This AGREEMENT may be
          executed in one or more counterparts, each of which shall be deemed an
          original but all of which together will constitute, and have the same
          force and effect as, one and the same instrument or an original executed
          document.

          f.) Entire Terms, Amendments: This AGREEMENT contains the entire
          AGREEMENT between the parties with respect to the subject matter hereof,
          and supersedes and replaces all prior agreements, negotiations and oral
          understandings, if any. This AGREEMENT may not be amended, supplemented,
          or modified in any way, except by an amendment in writing and signed by
          authorized representatives of the parties. No amendment shall be effected
          by the acknowledgment or acceptance of a purchase order, invoice, or
          other forms stipulating additional or different terms. This AGREEMENT
          shall inure to the benefit of and be binding upon each of the parties and
          their respective successors, assigns, heirs, executors, administrators,
          and trustees. g.) Equitable Relief: The parties agree that a
          breach of Section 8 CONFIDENTIALITY of this AGREEMENT, or of any
          provision affecting the ownership of the SAVI IP (intellectual
          property) shall result in immediate and irreparable harm for which
          ordinary damages may not be a sufficient remedy. Therefore, the parties
          agree that in the event of any such breach, the non-breaching party may
          seek equitable relief, including without limitation an injunction or
          other restraint, in any court of competent jurisdiction, without the
          necessity of posting any bond, in addition to any other relief to which
          such non-breaching party may be entitled at law or in equity.

          h.) Headings: Section headings used in this AGREEMENT are for the
          purposes of convenience only and shall not affect the legal
          interpretation of this AGREEMENT.

          i.) Survival: The expiration or termination of this AGREEMENT
          shall not terminate vested rights of either party from any liabilities or
          obligations incurred under this AGREEMENT prior to or which by their
          nature are intended to survive expiration or termination, including but
          not limited to provisions relating to confidentiality, indemnification,
          and proprietary rights.

SCHEDULE A

          Certain Conditions and DEALER Obligations:

          A. the SAVI PRODUCTS covered by this AGREEMENT are:

          Audio/Video, Automation and Control: SAVI Software, SAVI Hardware, Custom
          SAVI Software, Custom SAVI Hardware, Software Licensing, Audio/Video
          Components, Networking, Accessories and Services.

          B. the approved primary location:

          As provided as the primary place of business documented in the SAVI
          Dealer Application.

          In performance under the AGREEMENT, DEALER shall do the following:

          Sell and distribute PRODUCT only to bona fide end users; not market, sell
          or distribute PRODUCT to wholesalers or sub-dealers, and also not market
          or sell PRODUCT by means of the Internet or any web site, or other
          commercial on-line service, unless DEALER has obtained SAVI's express,
          prior written approval.

          Sell the Products only at approved locations unless DEALER has a separate
          written agreement with SAVI authorizing the sale of the Products by other
          means.

          Not purchase PRODUCT offered by SAVI from any source other than SAVI, or
          an authorized distribution agent. Nothing herein shall be deemed to
          authorize or grant DEALER the right to state or imply in any manner that
          DEALER is authorized to promote or sell any SAVI products other than the
          PRODUCT which a DEALER is authorized to purchase and resell pursuant to
          this AGREEMENT and DEALER further agrees that it will not state or imply
          in any medium anything to the contrary.

          C. In performance under the AGREEMENT, DEALER shall do the following:
          (continued)

          Refrain from engaging in any unfair competitive practices, including but
          not limited to product disparagement and bait and switch practices, and
          comply with all applicable present and future federal, state, county and
          local laws, ordinances and regulations of all duly constituted
          authorities.

          Maintain its business establishment in an attractive, clean, orderly and
          sanitary condition and maintain all its fixtures and furnishings in good
          condition and repair.

          Display the PRODUCT and all promotional material pertaining thereto and
          maintain adequate stocks and facilities thereof, as applicable.

          Obtain training from SAVI for DEALER personnel, and directly provide
          ongoing training of its sales personnel in connection with the
          demonstration, use and sale of the PRODUCT.

          Make prompt payment of all invoices in accordance with the terms thereof
          (all terms commence on date of invoice) rendered by SAVI to DEALER in
          connection with such PRODUCT as may, from time to time, be sold by SAVI
          to DEALER.

          Immediately forward to SAVI information concerning all charges,
          complaints, or claims of damage relating to any of the PRODUCT that may
          come to DEALER's attention.

          Purchase from SAVI the minimum quantity, if any, of Products as may be
          required during the term of the AGREEMENT under any applicable
          independent DEALER program, or otherwise set forth in writing prior to
          execution of the AGREEMENT, as may be adjusted by SAVI from time to time
          as permitted under such DEALER program or upon thirty (30) days prior
          written notice to DEALER. In addition, certain additional minimum
          purchase obligations may be required to become eligible for price
          discounts or credit terms, if any, that may be offered by SAVI under any
          DEALER program from time to time; provided that no such program shall
          apply to DEALER unless set forth in writing and expressly extended to
          DEALER by SAVI.

          11. (a) Not separate any software sold or bundled/packaged with any
          PRODUCT from such PRODUCT or sell, license or distribute such software on
          a standalone basis, (b) only distribute such software on those
          terms and conditions as SAVI may, from time to time require, and
          (c) not remove, translate or modify the contents of documentation
          of or related to such software, including, without limitation, any end
          user license agreements or warranty statements.

          Without in any manner prejudicing the right of SAVI to claim that any
          other breach or default of this AGREEMENT on the part of DEALER
          constitutes a material breach or default, it is understood and agreed
          that the failure of DEALER to comply with the provisions of the foregoing
          subdivisions of this SCHEDULE A shall constitute a material breach and
          default of this AGREEMENT on the part of DEALER.

          For the purpose of verifying compliance by DEALER with the provisions of
          the foregoing subdivisions of this SCHEDULE A, DEALER agrees that SAVI
          and its representatives will be permitted full access to and will be
          permitted to make copies of or abstracts from the books and records
          relating to PRODUCTS sold by SAVI to DEALER and will be permitted to
          audit such books and records at reasonable intervals.

          Pending the completion of any such audit, SAVI shall have the right to
          delay shipments of PRODUCT to DEALER.

          CONSTRUCTION OF AGREEMENT: This AGREEMENT shall be construed according to
          the laws of the State of Texas.


text:
package org.jugbd.mnet.service;

import org.jugbd.mnet.domain.Diagnosis;
import org.jugbd.mnet.domain.DiagnosisFinal;
import org.springframework.stereotype.Component;

/**
 * @author Mushfekur Rahman (mushfek0001)
 */
@Component
public interface DiagnosisService {
    Diagnosis save(Diagnosis diagnosis);

    Diagnosis findOne(Long id);

    DiagnosisFinal save(DiagnosisFinal diagnosisFinal);

    DiagnosisFinal findOneFinalDiagnosis(Long id);
}

redpajama_set_name: RedPajamaGithub


text:
class PipelineNotificationWorker
  include Sidekiq::Worker
  include PipelineQueue

  def perform(pipeline_id, recipients = nil)
    pipeline = Ci::Pipeline.find_by(id: pipeline_id)

    return unless pipeline

    NotificationService.new.pipeline_finished(pipeline, recipients)
  end
end


text:
'use strict';

var async = require('async');
var env = require('../src/backend/env');
var dbOptions = require('../database.json')[env];

var resetDatabase = function (dbSession, callback) {

  if (dbOptions.driver === 'sqlite3') {

    async.series(
      [

        function (callback) {
          dbSession.remove('keyword', '1', function (err) {
            callback(err)
          });
        },

        function (callback) {
          dbSession.remove('category', '1', function (err) {
            callback(err)
          });
        },

        function (callback) {
          dbSession.remove('sqlite_sequence', '1', function (err) {
            callback(err, null);
          });
        }

      ],

      function (err, results) {
        callback(err);
      }
    );

  }

  if (dbOptions.driver === 'mysql') {

    async.series(
      [

        function (callback) {
          dbSession.query('TRUNCATE keyword', [], function (err) {
            callback(err)
          });
        },

        function (callback) {
          dbSession.query('TRUNCATE category', [], function (err) {
            callback(err)
          });
        }

      ],

      function (err, results) {
        callback(err);
      }
    );

  }

};

module.exports = resetDatabase;


text:
function translate(str) {
  "use strict";
  var num_cons = 0;
  var flag = false;
  var c;
  var tmp = '';
  var count = 0;
  c = str[count];
  if (/[aeiou]/.test(c) === true) {
    flag = true;
    str += 'way';
  }
  while (/[aeiou]/.test(c) === false && flag === false) {
    num_cons++;
    count++;
    tmp += c;
    c = str[count];
  }
  if (!flag) {
    var cut = '';
    cut = str.substr(num_cons);
    str = cut;
    str += tmp + 'ay';
  }
  console.log(str);

  return str;
}

translate("california"); // should return "aliforniacay";
translate("paragraphs"); // should return "aragraphspay";
translate("glove"); // should return "oveglay";
translate("algorithm"); // should return "algorithmway";
translate("eight"); // should return "eightway";


text:
"""
This script illustrates how the sanity check mechanism can guard against processes that keep failing (or can't start
for whatever reason).

Just start a local standalone Zookeeper server and run "python misbehaved.py".
"""

from ochopod.bindings.ec2.marathon import Pod
from ochopod.models.piped import Actor as Piped

if __name__ == '__main__':

    class Strategy(Piped):

        #
        # - ochopod will detect cases where the sub-process fails on a non-zero exit code
        # - if we can't get the sub-process to either exit normally or just keep running the sanity check will fail
        # - here we want to tolerate up to 3 sanity check failures in a row with 5 seconds between each
        #
        checks = 3

        check_every = 5.0

        shell = True

        def configure(self, _):

            #
            # - attempt something that will fail on a non-zero exit code
            # - ochopod will attempt to re-run the command but the next sanity check will automatically trip
            # - after 3 such failures the pod will be turned off automatically
            #
            return 'echo kaboom && exit 1', {}

    #
    # - if you run this script locally you will notice the pod will turn off after around 15 seconds
    # - simply type CTRL-C to exit
    #
    Pod().boot(Strategy, local=1)


text:
using std::fabs;
using std::max;
using std::min;

void S2LatLngRectBounder::AddPoint(const S2Point& b) {
  S2_DCHECK(S2::IsUnitLength(b));
  AddInternal(b, S2LatLng(b));
}

void S2LatLngRectBounder::AddLatLng(const S2LatLng& b_latlng) {
  AddInternal(b_latlng.ToPoint(), b_latlng);
}

void S2LatLngRectBounder::AddInternal(const S2Point& b,
                                      const S2LatLng& b_latlng) {
  // Simple consistency check to verify that b and b_latlng are alternate
  // representations of the same vertex.
  S2_DCHECK(S2::ApproxEquals(b, b_latlng.ToPoint()));

  if (bound_.is_empty()) {
    bound_.AddPoint(b_latlng);
  } else {
    // First compute the cross product N = A x B robustly.  This is the normal
    // to the great circle through A and B.  We don't use S2::RobustCrossProd()
    // since that method returns an arbitrary vector orthogonal to A if the two
    // vectors are proportional, and we want the zero vector in that case.
    Vector3_d n = (a_ - b).CrossProd(a_ + b);  // N = 2 * (A x B)

    // The relative error in N gets large as its norm gets very small (i.e.,
    // when the two points are nearly identical or antipodal).  We handle this
    // by choosing a maximum allowable error, and if the error is greater than
    // this we fall back to a different technique.  Since it turns out that
    // the other sources of error in converting the normal to a maximum
    // latitude add up to at most 1.16 * DBL_EPSILON (see below), and it is
    // desirable to have the total error be a multiple of DBL_EPSILON, we have
    // chosen to limit the maximum error in the normal to 3.84 * DBL_EPSILON.
    // It is possible to show that the error is less than this when
    //
    //   n.Norm() >= 8 * sqrt(3) / (3.84 - 0.5 - sqrt(3)) * DBL_EPSILON
    //            = 1.91346e-15 (about 8.618 * DBL_EPSILON)
    double n_norm = n.Norm();
    if (n_norm < 1.91346e-15) {
      // A and B are either nearly identical or nearly antipodal (to within
      // 4.309 * DBL_EPSILON, or about 6 nanometers on the earth's surface).
      if (a_.DotProd(b) < 0) {
        // The two points are nearly antipodal.  The easiest solution is to
        // assume that the edge between A and B could go in any direction
        // around the sphere.
        bound_ = S2LatLngRect::Full();
      } else {
        // The two points are nearly identical (to within 4.309 * DBL_EPSILON).
        // In this case we can just use the bounding rectangle of the points,
        // since after the expansion done by GetBound() this rectangle is
        // guaranteed to include the (lat,lng) values of all points along AB.
        bound_ = bound_.Union(S2LatLngRect::FromPointPair(a_latlng_, b_latlng));
      }
    } else {
      // Compute the longitude range spanned by AB.
      S1Interval lng_ab = S1Interval::FromPointPair(a_latlng_.lng().radians(),
                                                    b_latlng.lng().radians());
      if (lng_ab.GetLength() >= M_PI - 2 * DBL_EPSILON) {
        // The points lie on nearly opposite lines of longitude to within the
        // maximum error of the calculation.  (Note that this test relies on
        // the fact that M_PI is slightly less than the true value of Pi, and
        // that representable values near M_PI are 2 * DBL_EPSILON apart.)
        // The easiest solution is to assume that AB could go on either side
        // of the pole.
        lng_ab = S1Interval::Full();
      }

      // Next we compute the latitude range spanned by the edge AB.  We start
      // with the range spanning the two endpoints of the edge:
      R1Interval lat_ab = R1Interval::FromPointPair(a_latlng_.lat().radians(),
                                                    b_latlng.lat().radians());

      // This is the desired range unless the edge AB crosses the plane
      // through N and the Z-axis (which is where the great circle through A
      // and B attains its minimum and maximum latitudes).  To test whether AB
      // crosses this plane, we compute a vector M perpendicular to this
      // plane and then project A and B onto it.
      Vector3_d m = n.CrossProd(S2Point(0, 0, 1));
      double m_a = m.DotProd(a_);
      double m_b = m.DotProd(b);

      // We want to test the signs of "m_a" and "m_b", so we need to bound
      // the error in these calculations.  It is possible to show that the
      // total error is bounded by
      //
      //  (1 + sqrt(3)) * DBL_EPSILON * n_norm + 8 * sqrt(3) * (DBL_EPSILON**2)
      //    = 6.06638e-16 * n_norm + 6.83174e-31

      double m_error = 6.06638e-16 * n_norm + 6.83174e-31;
      if (m_a * m_b < 0 || fabs(m_a) <= m_error || fabs(m_b) <= m_error) {
        // Minimum/maximum latitude *may* occur in the edge interior.
        //
        // The maximum latitude is 90 degrees minus the latitude of N.  We
        // compute this directly using atan2 in order to get maximum accuracy
        // near the poles.
        //
        // Our goal is compute a bound that contains the computed latitudes of
        // all S2Points P that pass the point-in-polygon containment test.
        // There are three sources of error we need to consider:
        //  - the directional error in N (at most 3.84 * DBL_EPSILON)
        //  - converting N to a maximum latitude
        //  - computing the latitude of the test point P
        // The latter two sources of error are at most 0.955 * DBL_EPSILON
        // individually, but it is possible to show by a more complex analysis
        // that together they can add up to at most 1.16 * DBL_EPSILON, for a
        // total error of 5 * DBL_EPSILON.
        //
        // We add 3 * DBL_EPSILON to the bound here, and GetBound() will pad
        // the bound by another 2 * DBL_EPSILON.
        double max_lat = min(
            atan2(sqrt(n[0]*n[0] + n[1]*n[1]), fabs(n[2])) + 3 * DBL_EPSILON,
            M_PI_2);

        // In order to get tight bounds when the two points are close together,
        // we also bound the min/max latitude relative to the latitudes of the
        // endpoints A and B.  First we compute the distance between A and B,
        // and then we compute the maximum change in latitude between any two
        // points along the great circle that are separated by this distance.
        // This gives us a latitude change "budget".  Some of this budget must
        // be spent getting from A to B; the remainder bounds the round-trip
        // distance (in latitude) from A or B to the min or max latitude
        // attained along the edge AB.
        //
        // There is a maximum relative error of 4.5 * DBL_EPSILON in computing
        // the squared distance (a_ - b), which means a maximum error of (4.5
        // / 2 + 0.5) == 2.75 * DBL_EPSILON in computing Norm().  The sin()
        // and multiply each have a relative error of 0.5 * DBL_EPSILON which
        // we round up to a total of 4 * DBL_EPSILON.
        double lat_budget_z = 0.5 * (a_ - b).Norm() * sin(max_lat);
        double lat_budget = 2 * asin(min((1 + 4 * DBL_EPSILON) * lat_budget_z,
                                         1.0));
        double max_delta = 0.5 * (lat_budget - lat_ab.GetLength()) +
                           DBL_EPSILON;

        // Test whether AB passes through the point of maximum latitude or
        // minimum latitude.  If the dot product(s) are small enough then the
        // result may be ambiguous.
        if (m_a <= m_error && m_b >= -m_error) {
          lat_ab.set_hi(min(max_lat, lat_ab.hi() + max_delta));
        }
        if (m_b <= m_error && m_a >= -m_error) {
          lat_ab.set_lo(max(-max_lat, lat_ab.lo() - max_delta));
        }
      }
      bound_ = bound_.Union(S2LatLngRect(lat_ab, lng_ab));
    }
  }
  a_ = b;
  a_latlng_ = b_latlng;
}

S2LatLngRect S2LatLngRectBounder::GetBound() const {
  // To save time, we ignore numerical errors in the computed S2LatLngs while
  // accumulating the bounds and then account for them here.
  //
  // S2LatLng(S2Point) has a maximum error of 0.955 * DBL_EPSILON in latitude.
  // In the worst case, we might have rounded "inwards" when computing the
  // bound and "outwards" when computing the latitude of a contained point P,
  // therefore we expand the latitude bounds by 2 * DBL_EPSILON in each
  // direction.  (A more complex analysis shows that 1.5 * DBL_EPSILON is
  // enough, but the expansion amount should be a multiple of DBL_EPSILON in
  // order to avoid rounding errors during the expansion itself.)
  //
  // S2LatLng(S2Point) has a maximum error of DBL_EPSILON in longitude, which
  // is simply the maximum rounding error for results in the range [-Pi, Pi].
  // This is true because the Gnu implementation of atan2() comes from the IBM
  // Accurate Mathematical Library, which implements correct rounding for this
  // instrinsic (i.e., it returns the infinite precision result rounded to the
  // nearest representable value, with ties rounded to even values).  This
  // implies that we don't need to expand the longitude bounds at all, since
  // we only guarantee that the bound contains the *rounded* latitudes of
  // contained points.  The *true* latitudes of contained points may lie up to
  // DBL_EPSILON outside of the returned bound.

  const S2LatLng kExpansion = S2LatLng::FromRadians(2 * DBL_EPSILON, 0);
  return bound_.Expanded(kExpansion).PolarClosure();
}

S2LatLngRect S2LatLngRectBounder::ExpandForSubregions(
    const S2LatLngRect& bound) {
  // Empty bounds don't need expansion.
  if (bound.is_empty()) return bound;

  // First we need to check whether the bound B contains any nearly-antipodal
  // points (to within 4.309 * DBL_EPSILON).  If so then we need to return
  // S2LatLngRect::Full(), since the subregion might have an edge between two
  // such points, and AddPoint() returns Full() for such edges.  Note that
  // this can happen even if B is not Full(); for example, consider a loop
  // that defines a 10km strip straddling the equator extending from
  // longitudes -100 to +100 degrees.
  //
  // It is easy to check whether B contains any antipodal points, but checking
  // for nearly-antipodal points is trickier.  Essentially we consider the
  // original bound B and its reflection through the origin B', and then test
  // whether the minimum distance between B and B' is less than 4.309 *
  // DBL_EPSILON.

  // "lng_gap" is a lower bound on the longitudinal distance between B and its
  // reflection B'.  (2.5 * DBL_EPSILON is the maximum combined error of the
  // endpoint longitude calculations and the GetLength() call.)
  double lng_gap = max(0.0, M_PI - bound.lng().GetLength() - 2.5 * DBL_EPSILON);

  // "min_abs_lat" is the minimum distance from B to the equator (if zero or
  // negative, then B straddles the equator).
  double min_abs_lat = max(bound.lat().lo(), -bound.lat().hi());

  // "lat_gap1" and "lat_gap2" measure the minimum distance from B to the
  // south and north poles respectively.
  double lat_gap1 = M_PI_2 + bound.lat().lo();
  double lat_gap2 = M_PI_2 - bound.lat().hi();

  if (min_abs_lat >= 0) {
    // The bound B does not straddle the equator.  In this case the minimum
    // distance is between one endpoint of the latitude edge in B closest to
    // the equator and the other endpoint of that edge in B'.  The latitude
    // distance between these two points is 2*min_abs_lat, and the longitude
    // distance is lng_gap.  We could compute the distance exactly using the
    // Haversine formula, but then we would need to bound the errors in that
    // calculation.  Since we only need accuracy when the distance is very
    // small (close to 4.309 * DBL_EPSILON), we substitute the Euclidean
    // distance instead.  This gives us a right triangle XYZ with two edges of
    // length x = 2*min_abs_lat and y ~= lng_gap.  The desired distance is the
    // length of the third edge "z", and we have
    //
    //         z  ~=  sqrt(x^2 + y^2)  >=  (x + y) / sqrt(2)
    //
    // Therefore the region may contain nearly antipodal points only if
    //
    //  2*min_abs_lat + lng_gap  <  sqrt(2) * 4.309 * DBL_EPSILON
    //                           ~= 1.354e-15
    //
    // Note that because the given bound B is conservative, "min_abs_lat" and
    // "lng_gap" are both lower bounds on their true values so we do not need
    // to make any adjustments for their errors.
    if (2 * min_abs_lat + lng_gap < 1.354e-15) {
      return S2LatLngRect::Full();
    }
  } else if (lng_gap >= M_PI_2) {
    // B spans at most Pi/2 in longitude.  The minimum distance is always
    // between one corner of B and the diagonally opposite corner of B'.  We
    // use the same distance approximation that we used above; in this case
    // we have an obtuse triangle XYZ with two edges of length x = lat_gap1
    // and y = lat_gap2, and angle Z >= Pi/2 between them.  We then have
    //
    //         z  >=  sqrt(x^2 + y^2)  >=  (x + y) / sqrt(2)
    //
    // Unlike the case above, "lat_gap1" and "lat_gap2" are not lower bounds
    // (because of the extra addition operation, and because M_PI_2 is not
    // exactly equal to Pi/2); they can exceed their true values by up to
    // 0.75 * DBL_EPSILON.  Putting this all together, the region may
    // contain nearly antipodal points only if
    //
    //   lat_gap1 + lat_gap2  <  (sqrt(2) * 4.309 + 1.5) * DBL_EPSILON
    //                        ~= 1.687e-15
    if (lat_gap1 + lat_gap2 < 1.687e-15) {
      return S2LatLngRect::Full();
    }
  } else {
    // Otherwise we know that (1) the bound straddles the equator and (2) its
    // width in longitude is at least Pi/2.  In this case the minimum
    // distance can occur either between a corner of B and the diagonally
    // opposite corner of B' (as in the case above), or between a corner of B
    // and the opposite longitudinal edge reflected in B'.  It is sufficient
    // to only consider the corner-edge case, since this distance is also a
    // lower bound on the corner-corner distance when that case applies.

    // Consider the spherical triangle XYZ where X is a corner of B with
    // minimum absolute latitude, Y is the closest pole to X, and Z is the
    // point closest to X on the opposite longitudinal edge of B'.  This is a
    // right triangle (Z = Pi/2), and from the spherical law of sines we have
    //
    //     sin(z) / sin(Z)  =  sin(y) / sin(Y)
    //     sin(max_lat_gap) / 1  =  sin(d_min) / sin(lng_gap)
    //     sin(d_min)  =  sin(max_lat_gap) * sin(lng_gap)
    //
    // where "max_lat_gap" = max(lat_gap1, lat_gap2) and "d_min" is the
    // desired minimum distance.  Now using the facts that sin(t) >= (2/Pi)*t
    // for 0 <= t <= Pi/2, that we only need an accurate approximation when
    // at least one of "max_lat_gap" or "lng_gap" is extremely small (in
    // which case sin(t) ~= t), and recalling that "max_lat_gap" has an error
    // of up to 0.75 * DBL_EPSILON, we want to test whether
    //
    //   max_lat_gap * lng_gap  <  (4.309 + 0.75) * (Pi/2) * DBL_EPSILON
    //                          ~= 1.765e-15
    if (max(lat_gap1, lat_gap2) * lng_gap < 1.765e-15) {
      return S2LatLngRect::Full();
    }
  }
  // Next we need to check whether the subregion might contain any edges that
  // span (M_PI - 2 * DBL_EPSILON) radians or more in longitude, since AddPoint
  // sets the longitude bound to Full() in that case.  This corresponds to
  // testing whether (lng_gap <= 0) in "lng_expansion" below.

  // Otherwise, the maximum latitude error in AddPoint is 4.8 * DBL_EPSILON.
  // In the worst case, the errors when computing the latitude bound for a
  // subregion could go in the opposite direction as the errors when computing
  // the bound for the original region, so we need to double this value.
  // (More analysis shows that it's okay to round down to a multiple of
  // DBL_EPSILON.)
  //
  // For longitude, we rely on the fact that atan2 is correctly rounded and
  // therefore no additional bounds expansion is necessary.

  double lat_expansion = 9 * DBL_EPSILON;
  double lng_expansion = (lng_gap <= 0) ? M_PI : 0;
  return bound.Expanded(S2LatLng::FromRadians(lat_expansion,
                                              lng_expansion)).PolarClosure();
}

S2LatLng S2LatLngRectBounder::MaxErrorForTests() {
  // The maximum error in the latitude calculation is
  //    3.84 * DBL_EPSILON   for the cross product calculation (see above)
  //    0.96 * DBL_EPSILON   for the Latitude() calculation
  //    5    * DBL_EPSILON   added by AddPoint/GetBound to compensate for error
  //    ------------------
  //    9.80 * DBL_EPSILON   maximum error in result
  //
  // The maximum error in the longitude calculation is DBL_EPSILON.  GetBound
  // does not do any expansion because this isn't necessary in order to
  // bound the *rounded* longitudes of contained points.
  return S2LatLng::FromRadians(10 * DBL_EPSILON, 1 * DBL_EPSILON);
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.marcosbarbero.cloud</groupId>
    <artifactId>spring-cloud-zuul-ratelimit-dependencies</artifactId>
    <version>2.4.2.RELEASE</version>
    <packaging>pom</packaging>
    <url>https://github.com/marcosbarbero/spring-cloud-zuul-ratelimit</url>

    <name>spring-cloud-zuul-ratelimit-dependencies</name>
    <description>Spring Cloud Zuul Rate Limit Dependencies</description>

    <properties>
        <nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
    </properties>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>marcosbarbero</id>
            <email>marcos.hgb@gmail.com</email>
            <name>Marcos Barbero</name>
            <timezone>CET</timezone>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://github.com/marcosbarbero/spring-cloud-zuul-ratelimit.git</connection>
        <developerConnection>
            scm:git:git@github.com:marcosbarbero/spring-cloud-starter-ratelimit.git
        </developerConnection>
        <url>https://github.com/marcosbarbero/spring-cloud-zuul-ratelimit</url>
        <tag>HEAD</tag>
    </scm>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.marcosbarbero.cloud</groupId>
                <artifactId>spring-cloud-zuul-ratelimit-core</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>com.marcosbarbero.cloud</groupId>
                <artifactId>spring-cloud-zuul-ratelimit</artifactId>
                <version>${project.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>deploy</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${nexus-staging-maven-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <additionalparam>-Xdoclint:none</additionalparam>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>


text:
#include "ClrStackFrame.h"
#include "ClrStackWalker.h"
#include "DebugEventCallbacks.h"

#include "SyncBlockManager.h"
#include "LicenseProcessor.h"
#include "DebugContext.h"

#include "ExpiredException.h"

using namespace System;
using namespace System::Diagnostics;
using namespace System::ComponentModel;
using namespace System::Diagnostics;
using namespace System::IO;
using namespace System::Reflection;
using namespace System::Runtime::InteropServices;

LiveCLRDataTarget* g_clrTarget;
IXCLRDataProcess* g_clrData;

#pragma managed
namespace ClrInspector
{

Dac::Dac(Process^ process)
{
	LicenseProcessor license;
	if(!license.IsLicenseValid())
	{
		String^ msg = gcnew String(license.GetLicenseText());
		throw gcnew ExpiredException(msg);
	}

	ULONG version;
	ULONG flags;
	DebugExtensions::Initialize(&version, &flags);

	g_clrTarget = new LiveCLRDataTarget(process);
	g_ext.ReloadSymbolWithLineInfo();

	DebugEventCallbacks cb;

	IDebugEventCallbacks* pCB = &cb;

	g_ExtClient->SetEventCallbacks(pCB);

	HRESULT hr = g_ExtClient->AttachProcess(0, process->Id, DEBUG_ATTACH_NONINVASIVE);

	hr = g_ExtControl->WaitForEvent(0, INFINITE);
	DebugContext::Initialize();
	String ^ path = Assembly::Load("mscorlib")->CodeBase->Replace("file:///", "");
	path = Directory::GetParent(path)->FullName;
	path = Path::Combine(path, "mscordacwks.dll");
	pin_ptr<const wchar_t> wch = PtrToStringChars(path);
	const size_t newsize = 1024;
	wchar_t wcstring[newsize];
    wcscpy_s(wcstring, wch);
	HMODULE hModule = ::LoadLibrary(wcstring);

	if(!hModule)
	{
		int err = ::GetLastError();
		throw gcnew Win32Exception(err, "LoadLibrary(mscordacwks.dll) failed.  Error = " + err + ".");
	}

	FARPROC pProc = ::GetProcAddress(hModule, "CLRDataCreateInstance");
	if (!pProc)
    {
        int err = ::GetLastError();
        throw gcnew Win32Exception(err, "GetProcAddress(CLRDataCreateInstance) failed.  Error = " + err + ".");
    }

	void* ifacePtr;
	REFIID iid = __uuidof(IXCLRDataProcess);

    PFN_CLRDataCreateInstance entry = (PFN_CLRDataCreateInstance)pProc;

	ICLRDataTarget* target = (ICLRDataTarget*)g_clrTarget;

    HRESULT status;
    if ((status = entry(iid, target, &ifacePtr)) != S_OK)
    {
        FreeLibrary(hModule);
    }
    else
    {
        g_clrData = reinterpret_cast<IXCLRDataProcess*>(ifacePtr);
    }

}

ThreadStackManager^ Dac::ConstructThreadStacks()
{
	ThreadStackManager^ tsm = gcnew ThreadStackManager();
	tsm->CreateThreadStacks();
	return tsm;
}

Dac::~Dac()
{
	g_ExtClient->DetachProcesses();

	if(g_clrTarget)
	{
		delete g_clrTarget;
	}
}

}


text:
<?php

namespace OCP\SystemTag;

/**
 * Public interface for a system-wide tag.
 *
 * @since 9.0.0
 */
interface ISystemTag {

	/**
	 * Returns the tag id
	 *
	 * @return string id
	 *
	 * @since 9.0.0
	 */
	public function getId();

	/**
	 * Returns the tag display name
	 *
	 * @return string tag display name
	 *
	 * @since 9.0.0
	 */
	public function getName();

	/**
	 * Returns whether the tag is visible for regular users
	 *
	 * @return bool true if visible, false otherwise
	 *
	 * @since 9.0.0
	 */
	public function isUserVisible();

	/**
	 * Returns whether the tag can be assigned to objects by regular users
	 *
	 * @return bool true if assignable, false otherwise
	 *
	 * @since 9.0.0
	 */
	public function isUserAssignable();

	/**
	 * Returns whether the tag can be assigned to objects by regular users
	 *
	 * @return bool true if editable, false otherwise
	 *
	 * @since 10.0.11
	 */
	public function isUserEditable();
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.18"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>flat: flat2d Namespace Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

flat
    1

A 2D game engine based on SDL2.0

Namespaces |
Classes |
Typedefs |
Enumerations

flat2d Namespace Reference

Namespaces

  	ui

Classes

class  	Algorithm

class  	Animation

class  	Camera

class  	CollisionDetector

class  	DeltatimeMonitor

class  	Dimension

class  	Entity

class  	EntityContainer

class  	EntityProperties

struct  	EntityShape_t

class  	ExecutionTimer

class  	FlatBuilder

class  	GameController

class  	GameControllerContainer

class  	GameData

class  	GameEngine

class  	MapArea

class  	MediaUtil

class  	Mixer

class  	QuadTree

class  	RenderData

class  	RuntimeAnalyzer

class  	SpinLock

class  	Square

class  	Texture

class  	Timer

class  	UID

class  	Window

Typedefs

typedef std::vector< SDL_Rect > 	Clips

typedef int 	Layer

typedef std::map< std::string, Entity * > 	ObjectList

typedef std::map< Layer, ObjectList > 	LayerMap

typedef std::map< MapArea, ObjectList > 	SpatialPartitionMap

typedef std::map< std::string, MapArea * > 	RenderAreas

typedef struct flat2d::EntityShape_t 	EntityShape

typedef std::function< void(const SDL_Event &)> 	HandleCallback

typedef std::function< GameStateAction(GameData *)> 	StateCallback

Enumerations

enum  	CollisionProperty { SOLID,
BOUNCY,
STICKY,
ETHERAL
 }

enum  	GameStateAction { NOOP,
RESET,
QUIT
 }

Typedef Documentation

◆ Clips

          typedef std::vector<SDL_Rect> flat2d::Clips

Definition at line 9 of file Animation.h.

◆ EntityShape

          typedef struct flat2d::EntityShape_t flat2d::EntityShape

◆ HandleCallback

          typedef std::function<void(const SDL_Event&)> flat2d::HandleCallback

Definition at line 21 of file GameEngine.h.

◆ Layer

          typedef int flat2d::Layer

Definition at line 22 of file EntityContainer.h.

◆ LayerMap

          typedef std::map<Layer, ObjectList> flat2d::LayerMap

Definition at line 24 of file EntityContainer.h.

◆ ObjectList

          typedef std::map<std::string, Entity*> flat2d::ObjectList

Definition at line 23 of file EntityContainer.h.

◆ RenderAreas

          typedef std::map<std::string, MapArea*> flat2d::RenderAreas

Definition at line 26 of file EntityContainer.h.

◆ SpatialPartitionMap

          typedef std::map<MapArea, ObjectList> flat2d::SpatialPartitionMap

Definition at line 25 of file EntityContainer.h.

◆ StateCallback

          typedef std::function<GameStateAction(GameData*)> flat2d::StateCallback

Definition at line 22 of file GameEngine.h.

Enumeration Type Documentation

◆ CollisionProperty

          enum flat2d::CollisionProperty

Enumerator

SOLID

BOUNCY

STICKY

ETHERAL

Definition at line 5 of file CollisionProperty.h.

◆ GameStateAction

          enum flat2d::GameStateAction

Available returns for the StateCallback

Enumerator

NOOP

RESET

QUIT

Definition at line 14 of file GameEngine.h.

<address class="footer">
Generated by

 1.8.18
</address>


text:
! { dg-do compile }
module x
  use, intrinsic :: iso_c_binding, only: c_double
  implicit none

  common /mycom/ r, s ! { dg-error "does not match" }
  real(c_double) :: r
  real(c_double) :: s
  bind(c, name="my_common_block") :: /mycom/
end module x

module y
  use, intrinsic :: iso_c_binding, only: c_double, c_int
  implicit none

  common /mycom/ r, s
  real(c_double) :: r
  real(c_double) :: s
  bind(c, name="my_common_block") :: /mycom/

  common /com2/ i ! { dg-error "does not match" }
  integer(c_int) :: i
  bind(c, name="") /com2/
end module y

module z
  use, intrinsic :: iso_c_binding, only: c_double, c_int
  implicit none

  common /mycom/ r, s ! { dg-error "does not match" }
  real(c_double) :: r
  real(c_double) :: s
  ! this next line is an error; if a common block is bind(c), the binding label
  ! for it must match across all scoping units that declare it.
  bind(c, name="my_common_block_2") :: /mycom/

  common /com2/ i ! { dg-error "does not match" }
  integer(c_int) :: i
  bind(c, name="mycom2") /com2/
end module z

! { dg-final { cleanup-modules "x y" } }


text:
* Philosophy and guiding principles behind the libraries
  * Opaleye
  * HRR
  * Persistent
* Setting up basic DB mappings
  * Non-nullable columns without DB-specified defaults
  * Non-nullable columns with DB-specified defaults
  * Nullable columns without DB-specified defaults
  * Nullable columns with DB-specified defaults
  * Opalaye
    * Why do we need to specify Haskell AND PG types?
    * Commentary on parameterized record types
    * Ability to represent DB rows as tuples instead of records
  * Persistent
    * Recommended way is Template Haskell
  * HRR
    * Uses TemplateHaskell to fetch the DB definition at compile-time and generate the record types
* Setting up advanced DB mappings
  * ENUMs
  * Postgres arrays
  * JSONB
  * Non-integer primary keys
* DSL support for other SQL stuff
  * Constraints (CHECK & REFERENCES)
  * Triggers
  * Opaleye
    * Doesn't give DSL for DDL (data definition language) commands in SQL
  * Persistent
    * How to run custom SQL in-sync with the automatic migration?
  * HRR
    * Don't know
* Inserting rows
  * Specifying all columns in the row
  * Omitting certain columns and letting DB specify the default
  * INSERT... RETURNING ID
  * INSERT... RETURNING *
  * Insert single row
  * Insert multiple rows
* Updating rows
  * Updating all columns in matching row(s)
  * Updating only specific columns in matching row(s)
  * Updates with JOINs
  * UPDATE... RETURNING *
* Selecting rows
  * Simple select of single row
  * Fetch all columns from rows matching a condition
  * Fetch specific columns from rows matching a condition
  * Ordering
  * Grouping
  * Joins
  * Limit/offset
  * Selecting in batches (or using cursors)
* Database transactions
  * Nested DB transactions
* Managing housekeeping columns (createdAt, updatedAt)
* Support for prepared statements
* Any special/interesting/unique features?


text:
package limelight.background;

import limelight.Context;
import limelight.Log;
import limelight.ui.Panel;
import limelight.ui.model.*;
import limelight.util.Box;
import limelight.util.NanoTimer;

import java.awt.*;
import java.util.*;
import java.util.concurrent.locks.Lock;

public class PanelPainterLoop extends IdleThreadLoop
{
  private final ArrayList<Rectangle> regionBuffer = new ArrayList<Rectangle>(50);
  private final ArrayList<StageFrame> frameBuffer = new ArrayList<StageFrame>(5);
  private int updatesPerSecond;
  private int optimalDelayTimeNanos;
  private final NanoTimer timer;
  private long lastExecutionDuration;

  public PanelPainterLoop()
  {
    timer = new NanoTimer();
    setUpdatesPerSecond(30);
  }

  public void setUpdatesPerSecond(int value)
  {
    updatesPerSecond = value;
    optimalDelayTimeNanos = 1000000000 / updatesPerSecond;
  }

  public int getUpdatesPerSecond()
  {
    return updatesPerSecond;
  }

  public int getOptimalDelayTimeNanos()
  {
    return optimalDelayTimeNanos;
  }

  public boolean shouldBeIdle()
  {
    // load the frame buffer once... is valid for next execute invocation.
    frameBuffer.clear();
    if(Context.instance().frameManager == null)
      return true;
    else
    {
      Context.instance().frameManager.getVisibleFrames(frameBuffer);
      return frameBuffer.isEmpty() || nothingToDo();
    }
  }

  private boolean nothingToDo()
  {
    boolean somethingToDo = false;

    for(StageFrame stageFrame : frameBuffer)
    {
      Scene root = stageFrame.getStage().getScene();
      if(root != null && (root.isLayoutRequired() || root.hasDirtyRegions()))
      {
        somethingToDo = true;
        break;
      }
    }
    return !somethingToDo;
  }

  protected void execute()
  {
    for(StageFrame stageFrame : frameBuffer)
    {
      Scene root = stageFrame.getStage().getScene();
      if(root != null)
      {
        final Lock lock = root.getLock();
        try
        {
          lock.lock();
          doAllLayouts(root);
          paintDirtyRegions(root);
        }
        finally
        {
          lock.unlock();
        }
      }
    }
    lastExecutionDuration = timer.getIdleNanos();
  }

  protected void delay()
  {
    timer.sleep(optimalDelayTimeNanos - lastExecutionDuration);
  }

  public Scene getActiveRoot()
  {
    StageFrame frame = Context.getActiveFrame();
    if(frame != null)
      return frame.getStage().getScene();
    else
      return null;
  }

  public void paintDirtyRegions(Scene root)
  {
    regionBuffer.clear();
    root.getAndClearDirtyRegions(regionBuffer);
    for(Rectangle rectangle : regionBuffer)
    {
      if(rectangle.width <= 0 || rectangle.height <= 0)
        continue;
      Graphics2D rootGraphics = root.getGraphics();
      if(rootGraphics != null)
      {
        doPaintJob(root, new Box(rectangle), rootGraphics);
      }
    }
  }

  public static void doPaintJob(Panel panel, Box area, Graphics2D graphics2D)
  {
    PaintJob job = new PaintJob(area, graphics2D.getBackground());
    job.paint(panel);
    job.applyTo(graphics2D);
    job.dispose();
  }

  public void doAllLayouts(Scene root)
  {
    if(root.isLayoutRequired())
    {
      root.resetLayoutRequired();
      Layouts.on(root);
    }
  }

  public PanelPainterLoop started()
  {
    start();
    return this;
  }
}


text:
from http import HTTPStatus
from flask import request
from flask_restful import Resource
from fedlearner_webconsole.db import db_handler
from fedlearner_webconsole.exceptions import NotFoundException
from fedlearner_webconsole.mmgr.models import Model, ModelType, ModelGroup
from fedlearner_webconsole.mmgr.service import ModelService
from fedlearner_webconsole.utils.decorators import jwt_required

class ModelApi(Resource):
    @jwt_required()
    def get(self, model_id):
        detail_level = request.args.get('detail_level', '')
        with db_handler.session_scope() as session:
            model_json = ModelService(session).query(model_id, detail_level)
        if not model_json:
            raise NotFoundException(
                f'Failed to find model: {model_id}')
        return {'data': model_json}, HTTPStatus.OK

    @jwt_required()
    def put(self, model_id):
        with db_handler.session_scope() as session:
            model = session.query(Model).filter_by(id=model_id).one_or_none()
            if not model:
                raise NotFoundException(
                    f'Failed to find model: {model_id}')
            model.extra = request.args.get('extra', model.extra)
            session.commit()
            return {'data': model.to_dict()}, HTTPStatus.OK

    @jwt_required()
    def delete(self, model_id):
        with db_handler.session_scope() as session:
            model = ModelService(session).drop(model_id)
            if not model:
                raise NotFoundException(
                    f'Failed to find model: {model_id}')
            return {'data': model.to_dict()}, HTTPStatus.OK

class ModelListApi(Resource):
    @jwt_required()
    def get(self):
        detail_level = request.args.get('detail_level', '')
        # TODO serialized query may incur performance penalty
        with db_handler.session_scope() as session:
            model_list = [
                ModelService(session).query(m.id, detail_level)
                for m in Model.query.filter(
                    Model.type.in_([
                        ModelType.NN_MODEL.value, ModelType.TREE_MODEL.value
                    ])).all()
            ]
        return {'data': model_list}, HTTPStatus.OK

class GroupListApi(Resource):
    @jwt_required()
    def get(self):
        group_list = [o.to_dict() for o in ModelGroup.query.all()]
        return {'data': group_list}, HTTPStatus.OK

    @jwt_required()
    def post(self):
        group = ModelGroup()

        group.name = request.args.get('name', group.name)
        group.extra = request.args.get('extra', group.extra)
        with db_handler.session_scope() as session:
            session.add(group)
            session.commit()

        return {'data': group.to_dict()}, HTTPStatus.OK

class GroupApi(Resource):
    @jwt_required()
    def patch(self, group_id):
        group = ModelGroup.query.filter_by(id=group_id).one_or_none()
        if not group:
            raise NotFoundException(
                f'Failed to find group: {group_id}')

        group.name = request.args.get('name', group.name)
        group.extra = request.args.get('extra', group.extra)
        with db_handler.session_scope() as session:
            session.add(group)
            session.commit()

        return {'data': group.to_dict()}, HTTPStatus.OK

def initialize_mmgr_apis(api):
    api.add_resource(ModelListApi, '/models')
    api.add_resource(ModelApi, '/models/<int:model_id>')

    api.add_resource(GroupListApi, '/model_groups')
    api.add_resource(GroupApi, '/model_groups/<int:group_id>')


text:
package xorm

import (
	"strings"

	"github.com/fsnotify/fsnotify"
)

//start filesystem watcher
func (engine *Engine) StartFSWatcher() error {
	var err error
	engine.watcher, err = fsnotify.NewWatcher()
	if err != nil {
		return err
	}

	go func() {

		for {

			select {
			case event := <-engine.watcher.Events:
				if event.Op&fsnotify.Write == fsnotify.Write {
					if strings.HasSuffix(event.Name, engine.SqlTemplate.Extension()) {
						err = engine.ReloadSqlTemplate(event.Name)
						if err != nil {
							engine.logger.Errorf("%v", err)
						}
					}

					if strings.HasSuffix(event.Name, engine.SqlMap.Extension["xml"]) || strings.HasSuffix(event.Name, engine.SqlMap.Extension["json"]) || strings.HasSuffix(event.Name, engine.SqlMap.Extension["xsql"]) {
						err = engine.reloadSqlMap(event.Name)
						if err != nil {
							engine.logger.Errorf("%v", err)
						}
					}
				}

			case err := <-engine.watcher.Errors:
				if err != nil {
					engine.logger.Errorf("%v", err)
				}
			}
		}
	}()

	if engine.SqlMap.SqlMapRootDir != "" {
		err = engine.watcher.Add(engine.SqlMap.SqlMapRootDir)
		if err != nil {
			return err
		}
	}

	if engine.SqlTemplate.RootDir() != "" {
		err = engine.watcher.Add(engine.SqlTemplate.RootDir())
		if err != nil {
			return err
		}
	}

	return nil
}

//stop filesystem watcher
func (engine *Engine) StopFSWatcher() error {
	return engine.watcher.Close()
}


text:
#ifndef CONFEXT_H_
#define CONFEXT_H_

namespace ConfExt {
	extern const char* DAT_EXT;
	extern const char* CLASS_MAP_EXT;
	extern const char* SCALE_EXT;
	extern const char* RANGE_EXT;
	extern const char* MODEL_EXT;
}

#endif /* CONFEXT_H_ */


text:
This is a light library to access the Backchat provisioning API

# Installation

    gem install backchat-client

# Current version

0.1

# Getting started

You need a valid api-key to access Backchat API

    require 'backchat-client'
	bc = Backchat::Client.new("api-key")

# User Management

## Get user profile

    require 'backchat-client'
    bc = Backchat::Client.new("api-key")
    bc.get_profile

## Delete user

    require 'backchat-client'
    bc = Backchat::Client.new("api-key")
    bc.delete_user

# Streams

## Create a new stream

    require 'backchat-client'
    bc = Backchat::Client.new("api-key")
    bc.create_stream("stream-name")

## Retrieve application streams

    require 'backchat-client'
    bc = Backchat::Client.new("api-key")

    # get all streams
    streams = bc.find_stream

    # get a specific stream
    stream = bc.find_stream("stream-name")

## Delete a stream

    require 'backchat-client'
    bc = Backchat::Client.new("api-key")
    bc.destroy_stream("stream-name")

# Channels

## Create a new channel

    require 'backchat-client'
    bc = Backchat::Client.new("api-key")
    bc.create_channel("twitter", "juandebravo")

## Retrieve application channels

    require 'backchat-client'
    bc = Backchat::Client.new("api-key")

    # get all channels
    streams = bc.find_channel

## Delete a channel

    require 'backchat-client'
    bc = Backchat::Client.new("api-key")
    bc.destroy_channel("twitter://juandebravo")

# License

    The MIT License

    Copyright (c) 2011 Juan de Bravo, Alberto Pastor, Rafael de Oleza.

    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in
    all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    THE SOFTWARE.


text:
package com.mstian.huxiu.bean;

import com.google.gson.Gson;

import java.io.Serializable;

/**
 * Created by Issac on 7/18/13.
 */
public class BaseType implements Serializable{
    public String toJson() {
        return new Gson().toJson(this);
    }
}


text:
package org.camunda.bpm.engine.cdi.annotation;

import javax.enterprise.util.AnnotationLiteral;

/**
 * @author Daniel Meyer
 *
 */
public class ExecutionIdLiteral extends AnnotationLiteral<ExecutionId> implements ExecutionId {

  public ExecutionIdLiteral() {
  }

}


text:
package com.google.security.zynamics.reil.translators.mips;

import com.google.security.zynamics.reil.OperandSize;
import com.google.security.zynamics.reil.ReilHelpers;
import com.google.security.zynamics.reil.ReilInstruction;
import com.google.security.zynamics.reil.translators.IInstructionTranslator;
import com.google.security.zynamics.reil.translators.ITranslationEnvironment;
import com.google.security.zynamics.reil.translators.InternalTranslationException;
import com.google.security.zynamics.reil.translators.TranslationHelpers;
import com.google.security.zynamics.zylib.disassembly.IInstruction;

import java.util.List;

public class ScTranslator implements IInstructionTranslator {
  @Override
  public void translate(final ITranslationEnvironment environment, final IInstruction instruction,
      final List<ReilInstruction> instructions) throws InternalTranslationException {
    TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "sc");

    final String sourceRegister =
        instruction.getOperands().get(0).getRootNode().getChildren().get(0).getValue();

    final long baseOffset = ReilHelpers.toReilAddress(instruction.getAddress()).toLong();
    long offset = baseOffset;

    final OperandSize dw = OperandSize.DWORD;

    final String extendedValue =
        SignExtendGenerator.extendAndAdd(offset, environment, instruction.getOperands().get(1),
            instructions);

    offset = baseOffset + instructions.size();

    final String jumpCondition = environment.getNextVariableString();

    instructions.add(ReilHelpers.createBisz(offset++, dw, "LL", dw, jumpCondition));

    final String jmpGoal =
        String.format("%d.%d", instruction.getAddress().toLong(), instructions.size() + 2);
    instructions.add(ReilHelpers.createJcc(offset++, dw, jumpCondition, dw, jmpGoal));
    instructions.add(ReilHelpers.createStm(offset++, dw, sourceRegister, dw, extendedValue));

    instructions.add(ReilHelpers.createStr(offset, dw, "LL", dw, sourceRegister));
  }
}


text:
package org.apache.sling.jcr.classloader.internal;

import java.io.IOException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Enumeration;

import javax.jcr.RepositoryException;
import javax.jcr.Session;

import org.apache.jackrabbit.classloader.DynamicRepositoryClassLoader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * The RepositoryClassLoaderFacade TODO
 */
class RepositoryClassLoaderFacade extends URLClassLoader {

    /** default log */
    private static final Logger log = LoggerFactory.getLogger(RepositoryClassLoaderFacade.class);

    private static final URL[] NO_URLS = new URL[0];

    private RepositoryClassLoaderProviderImpl classLoaderProvider;
    private ClassLoader parent;
    private String sessionOwner;
    private Session session;
    private String[] classPath;
    private DynamicRepositoryClassLoader delegate;

    /**
     * The reference counter. If not greater than zero, there are this
     * number of (assumed) life references.
     *
     * @see #ref()
     * @see #deref()
     */
    private int refCtr = 0;

    public RepositoryClassLoaderFacade(
            RepositoryClassLoaderProviderImpl classLoaderProvider,
            ClassLoader parent,
            String sessionOwner,
            String[] classPath) {

        // no parent class loader, we delegate to repository class loaders
        super(NO_URLS, null);

        this.classLoaderProvider = classLoaderProvider;
        this.parent = parent;
        this.classPath = classPath;
        this.sessionOwner = sessionOwner;
    }

    public void addPath(String path) {
        // create new class path
        String[] newClassPath = new String[this.classPath.length+1];
        System.arraycopy(this.classPath, 0, newClassPath, 0, this.classPath.length);
        newClassPath[this.classPath.length] = path;
        this.classPath = newClassPath;

        // destroy the delegate and have a new one created
        if (this.delegate != null) {
            DynamicRepositoryClassLoader oldLoader = this.delegate;
            this.delegate = null;
            oldLoader.destroy();
        }
    }

    public String[] getClassPath() {
        return this.classPath.clone();
    }

    @Override
    public URL[] getURLs() {
        try {
            return getDelegateClassLoader().getURLs();
        } catch (RepositoryException re) {
            log.error("Cannot get repository class loader to get URLs", re);
            return NO_URLS;
        }
    }

    protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException {
        try {
            return this.getDelegateClassLoader().loadClass(name);
        } catch (RepositoryException re) {
            log.error("Cannot get repository class loader to load class " + name, re);
            throw new ClassNotFoundException(name);
        }
    }

    public URL getResource(String name) {
        try {
            return this.getDelegateClassLoader().getResource(name);
        } catch (RepositoryException re) {
            log.error("Cannot get repository class loader to get resource " + name, re);
            return null;
        }
    }

    public Enumeration findResources(String name) throws IOException {
        try {
            return this.getDelegateClassLoader().getResources(name);
        } catch (RepositoryException re) {
            throw (IOException) new IOException("Cannot lookup " + name).initCause(re);
        }
    }

    //---------- Reference counting support -----------------------------------

    /* package */ void destroy() {
        if (this.delegate != null) {
            this.delegate.destroy();
            this.delegate = null;
        }

        if (this.session != null) {
            this.session.logout();
            this.session = null;
        }
    }

    /**
     * Increases the reference counter of this class loader.
     */
    /* package */void ref() {
        this.refCtr++;
    }

    /**
     * Decreases the reference counter of this class loader and calls the
     * base class destroy() method, if this class loader has
     * already been destroyed by calling the {@link #destroy()} method.
     */
    /* package */void deref() {
        this.refCtr--;

        // destroy if the loader should be destroyed and no refs exist
//        if (refCtr <= 0 /* && destroyed */ ) {
//            destroy();
//        }
    }

    //---------- internal -----------------------------------------------------

    private Session getSession() throws RepositoryException {
        // check current session
        if (this.session != null) {
            if (this.session.isLive()) {
                return this.session;
            }

            // drop delegate
            if (this.delegate != null) {
                this.delegate.destroy();
                this.delegate = null;
            }

            // current session is not live anymore, drop
            this.session.logout();
            this.session = null;
        }

        // no session currently, acquire and return
        this.session = this.classLoaderProvider.getSession(this.sessionOwner);
        return this.session;
    }

    private DynamicRepositoryClassLoader getDelegateClassLoader() throws RepositoryException {
        if (this.delegate != null) {
            if (this.delegate.isDirty()) {
                this.delegate = this.delegate.reinstantiate(this.getSession(), this.parent);
            }
        } else {
            this.delegate = new DynamicRepositoryClassLoader(this.getSession(), this.classPath, this.parent);
        }

        return this.delegate;
    }
}