Blog

  • Random-Sudoku-Generator

    GNU GENERAL PUBLIC LICENSE
                           Version 3, 29 June 2007
    
     Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
     Everyone is permitted to copy and distribute verbatim copies
     of this license document, but changing it is not allowed.
    
                                Preamble
    
      The GNU General Public License is a free, copyleft license for
    software and other kinds of works.
    
      The licenses for most software and other practical works are designed
    to take away your freedom to share and change the works.  By contrast,
    the GNU General Public License is intended to guarantee your freedom to
    share and change all versions of a program--to make sure it remains free
    software for all its users.  We, the Free Software Foundation, use the
    GNU General Public License for most of our software; it applies also to
    any other work released this way by its authors.  You can apply it to
    your programs, too.
    
      When we speak of free software, we are referring to freedom, not
    price.  Our General Public Licenses are designed to make sure that you
    have the freedom to distribute copies of free software (and charge for
    them if you wish), that you receive source code or can get it if you
    want it, that you can change the software or use pieces of it in new
    free programs, and that you know you can do these things.
    
      To protect your rights, we need to prevent others from denying you
    these rights or asking you to surrender the rights.  Therefore, you have
    certain responsibilities if you distribute copies of the software, or if
    you modify it: responsibilities to respect the freedom of others.
    
      For example, if you distribute copies of such a program, whether
    gratis or for a fee, you must pass on to the recipients the same
    freedoms that you received.  You must make sure that they, too, receive
    or can get the source code.  And you must show them these terms so they
    know their rights.
    
      Developers that use the GNU GPL protect your rights with two steps:
    (1) assert copyright on the software, and (2) offer you this License
    giving you legal permission to copy, distribute and/or modify it.
    
      For the developers' and authors' protection, the GPL clearly explains
    that there is no warranty for this free software.  For both users' and
    authors' sake, the GPL requires that modified versions be marked as
    changed, so that their problems will not be attributed erroneously to
    authors of previous versions.
    
      Some devices are designed to deny users access to install or run
    modified versions of the software inside them, although the manufacturer
    can do so.  This is fundamentally incompatible with the aim of
    protecting users' freedom to change the software.  The systematic
    pattern of such abuse occurs in the area of products for individuals to
    use, which is precisely where it is most unacceptable.  Therefore, we
    have designed this version of the GPL to prohibit the practice for those
    products.  If such problems arise substantially in other domains, we
    stand ready to extend this provision to those domains in future versions
    of the GPL, as needed to protect the freedom of users.
    
      Finally, every program is threatened constantly by software patents.
    States should not allow patents to restrict development and use of
    software on general-purpose computers, but in those that do, we wish to
    avoid the special danger that patents applied to a free program could
    make it effectively proprietary.  To prevent this, the GPL assures that
    patents cannot be used to render the program non-free.
    
      The precise terms and conditions for copying, distribution and
    modification follow.
    
                           TERMS AND CONDITIONS
    
      0. Definitions.
    
      "This License" refers to version 3 of the GNU General Public License.
    
      "Copyright" also means copyright-like laws that apply to other kinds of
    works, such as semiconductor masks.
    
      "The Program" refers to any copyrightable work licensed under this
    License.  Each licensee is addressed as "you".  "Licensees" and
    "recipients" may be individuals or organizations.
    
      To "modify" a work means to copy from or adapt all or part of the work
    in a fashion requiring copyright permission, other than the making of an
    exact copy.  The resulting work is called a "modified version" of the
    earlier work or a work "based on" the earlier work.
    
      A "covered work" means either the unmodified Program or a work based
    on the Program.
    
      To "propagate" a work means to do anything with it that, without
    permission, would make you directly or secondarily liable for
    infringement under applicable copyright law, except executing it on a
    computer or modifying a private copy.  Propagation includes copying,
    distribution (with or without modification), making available to the
    public, and in some countries other activities as well.
    
      To "convey" a work means any kind of propagation that enables other
    parties to make or receive copies.  Mere interaction with a user through
    a computer network, with no transfer of a copy, is not conveying.
    
      An interactive user interface displays "Appropriate Legal Notices"
    to the extent that it includes a convenient and prominently visible
    feature that (1) displays an appropriate copyright notice, and (2)
    tells the user that there is no warranty for the work (except to the
    extent that warranties are provided), that licensees may convey the
    work under this License, and how to view a copy of this License.  If
    the interface presents a list of user commands or options, such as a
    menu, a prominent item in the list meets this criterion.
    
      1. Source Code.
    
      The "source code" for a work means the preferred form of the work
    for making modifications to it.  "Object code" means any non-source
    form of a work.
    
      A "Standard Interface" means an interface that either is an official
    standard defined by a recognized standards body, or, in the case of
    interfaces specified for a particular programming language, one that
    is widely used among developers working in that language.
    
      The "System Libraries" of an executable work include anything, other
    than the work as a whole, that (a) is included in the normal form of
    packaging a Major Component, but which is not part of that Major
    Component, and (b) serves only to enable use of the work with that
    Major Component, or to implement a Standard Interface for which an
    implementation is available to the public in source code form.  A
    "Major Component", in this context, means a major essential component
    (kernel, window system, and so on) of the specific operating system
    (if any) on which the executable work runs, or a compiler used to
    produce the work, or an object code interpreter used to run it.
    
      The "Corresponding Source" for a work in object code form means all
    the source code needed to generate, install, and (for an executable
    work) run the object code and to modify the work, including scripts to
    control those activities.  However, it does not include the work's
    System Libraries, or general-purpose tools or generally available free
    programs which are used unmodified in performing those activities but
    which are not part of the work.  For example, Corresponding Source
    includes interface definition files associated with source files for
    the work, and the source code for shared libraries and dynamically
    linked subprograms that the work is specifically designed to require,
    such as by intimate data communication or control flow between those
    subprograms and other parts of the work.
    
      The Corresponding Source need not include anything that users
    can regenerate automatically from other parts of the Corresponding
    Source.
    
      The Corresponding Source for a work in source code form is that
    same work.
    
      2. Basic Permissions.
    
      All rights granted under this License are granted for the term of
    copyright on the Program, and are irrevocable provided the stated
    conditions are met.  This License explicitly affirms your unlimited
    permission to run the unmodified Program.  The output from running a
    covered work is covered by this License only if the output, given its
    content, constitutes a covered work.  This License acknowledges your
    rights of fair use or other equivalent, as provided by copyright law.
    
      You may make, run and propagate covered works that you do not
    convey, without conditions so long as your license otherwise remains
    in force.  You may convey covered works to others for the sole purpose
    of having them make modifications exclusively for you, or provide you
    with facilities for running those works, provided that you comply with
    the terms of this License in conveying all material for which you do
    not control copyright.  Those thus making or running the covered works
    for you must do so exclusively on your behalf, under your direction
    and control, on terms that prohibit them from making any copies of
    your copyrighted material outside their relationship with you.
    
      Conveying under any other circumstances is permitted solely under
    the conditions stated below.  Sublicensing is not allowed; section 10
    makes it unnecessary.
    
      3. Protecting Users' Legal Rights From Anti-Circumvention Law.
    
      No covered work shall be deemed part of an effective technological
    measure under any applicable law fulfilling obligations under article
    11 of the WIPO copyright treaty adopted on 20 December 1996, or
    similar laws prohibiting or restricting circumvention of such
    measures.
    
      When you convey a covered work, you waive any legal power to forbid
    circumvention of technological measures to the extent such circumvention
    is effected by exercising rights under this License with respect to
    the covered work, and you disclaim any intention to limit operation or
    modification of the work as a means of enforcing, against the work's
    users, your or third parties' legal rights to forbid circumvention of
    technological measures.
    
      4. Conveying Verbatim Copies.
    
      You may convey verbatim copies of the Program's source code as you
    receive it, in any medium, provided that you conspicuously and
    appropriately publish on each copy an appropriate copyright notice;
    keep intact all notices stating that this License and any
    non-permissive terms added in accord with section 7 apply to the code;
    keep intact all notices of the absence of any warranty; and give all
    recipients a copy of this License along with the Program.
    
      You may charge any price or no price for each copy that you convey,
    and you may offer support or warranty protection for a fee.
    
      5. Conveying Modified Source Versions.
    
      You may convey a work based on the Program, or the modifications to
    produce it from the Program, in the form of source code under the
    terms of section 4, provided that you also meet all of these conditions:
    
        a) The work must carry prominent notices stating that you modified
        it, and giving a relevant date.
    
        b) The work must carry prominent notices stating that it is
        released under this License and any conditions added under section
        7.  This requirement modifies the requirement in section 4 to
        "keep intact all notices".
    
        c) You must license the entire work, as a whole, under this
        License to anyone who comes into possession of a copy.  This
        License will therefore apply, along with any applicable section 7
        additional terms, to the whole of the work, and all its parts,
        regardless of how they are packaged.  This License gives no
        permission to license the work in any other way, but it does not
        invalidate such permission if you have separately received it.
    
        d) If the work has interactive user interfaces, each must display
        Appropriate Legal Notices; however, if the Program has interactive
        interfaces that do not display Appropriate Legal Notices, your
        work need not make them do so.
    
      A compilation of a covered work with other separate and independent
    works, which are not by their nature extensions of the covered work,
    and which are not combined with it such as to form a larger program,
    in or on a volume of a storage or distribution medium, is called an
    "aggregate" if the compilation and its resulting copyright are not
    used to limit the access or legal rights of the compilation's users
    beyond what the individual works permit.  Inclusion of a covered work
    in an aggregate does not cause this License to apply to the other
    parts of the aggregate.
    
      6. Conveying Non-Source Forms.
    
      You may convey a covered work in object code form under the terms
    of sections 4 and 5, provided that you also convey the
    machine-readable Corresponding Source under the terms of this License,
    in one of these ways:
    
        a) Convey the object code in, or embodied in, a physical product
        (including a physical distribution medium), accompanied by the
        Corresponding Source fixed on a durable physical medium
        customarily used for software interchange.
    
        b) Convey the object code in, or embodied in, a physical product
        (including a physical distribution medium), accompanied by a
        written offer, valid for at least three years and valid for as
        long as you offer spare parts or customer support for that product
        model, to give anyone who possesses the object code either (1) a
        copy of the Corresponding Source for all the software in the
        product that is covered by this License, on a durable physical
        medium customarily used for software interchange, for a price no
        more than your reasonable cost of physically performing this
        conveying of source, or (2) access to copy the
        Corresponding Source from a network server at no charge.
    
        c) Convey individual copies of the object code with a copy of the
        written offer to provide the Corresponding Source.  This
        alternative is allowed only occasionally and noncommercially, and
        only if you received the object code with such an offer, in accord
        with subsection 6b.
    
        d) Convey the object code by offering access from a designated
        place (gratis or for a charge), and offer equivalent access to the
        Corresponding Source in the same way through the same place at no
        further charge.  You need not require recipients to copy the
        Corresponding Source along with the object code.  If the place to
        copy the object code is a network server, the Corresponding Source
        may be on a different server (operated by you or a third party)
        that supports equivalent copying facilities, provided you maintain
        clear directions next to the object code saying where to find the
        Corresponding Source.  Regardless of what server hosts the
        Corresponding Source, you remain obligated to ensure that it is
        available for as long as needed to satisfy these requirements.
    
        e) Convey the object code using peer-to-peer transmission, provided
        you inform other peers where the object code and Corresponding
        Source of the work are being offered to the general public at no
        charge under subsection 6d.
    
      A separable portion of the object code, whose source code is excluded
    from the Corresponding Source as a System Library, need not be
    included in conveying the object code work.
    
      A "User Product" is either (1) a "consumer product", which means any
    tangible personal property which is normally used for personal, family,
    or household purposes, or (2) anything designed or sold for incorporation
    into a dwelling.  In determining whether a product is a consumer product,
    doubtful cases shall be resolved in favor of coverage.  For a particular
    product received by a particular user, "normally used" refers to a
    typical or common use of that class of product, regardless of the status
    of the particular user or of the way in which the particular user
    actually uses, or expects or is expected to use, the product.  A product
    is a consumer product regardless of whether the product has substantial
    commercial, industrial or non-consumer uses, unless such uses represent
    the only significant mode of use of the product.
    
      "Installation Information" for a User Product means any methods,
    procedures, authorization keys, or other information required to install
    and execute modified versions of a covered work in that User Product from
    a modified version of its Corresponding Source.  The information must
    suffice to ensure that the continued functioning of the modified object
    code is in no case prevented or interfered with solely because
    modification has been made.
    
      If you convey an object code work under this section in, or with, or
    specifically for use in, a User Product, and the conveying occurs as
    part of a transaction in which the right of possession and use of the
    User Product is transferred to the recipient in perpetuity or for a
    fixed term (regardless of how the transaction is characterized), the
    Corresponding Source conveyed under this section must be accompanied
    by the Installation Information.  But this requirement does not apply
    if neither you nor any third party retains the ability to install
    modified object code on the User Product (for example, the work has
    been installed in ROM).
    
      The requirement to provide Installation Information does not include a
    requirement to continue to provide support service, warranty, or updates
    for a work that has been modified or installed by the recipient, or for
    the User Product in which it has been modified or installed.  Access to a
    network may be denied when the modification itself materially and
    adversely affects the operation of the network or violates the rules and
    protocols for communication across the network.
    
      Corresponding Source conveyed, and Installation Information provided,
    in accord with this section must be in a format that is publicly
    documented (and with an implementation available to the public in
    source code form), and must require no special password or key for
    unpacking, reading or copying.
    
      7. Additional Terms.
    
      "Additional permissions" are terms that supplement the terms of this
    License by making exceptions from one or more of its conditions.
    Additional permissions that are applicable to the entire Program shall
    be treated as though they were included in this License, to the extent
    that they are valid under applicable law.  If additional permissions
    apply only to part of the Program, that part may be used separately
    under those permissions, but the entire Program remains governed by
    this License without regard to the additional permissions.
    
      When you convey a copy of a covered work, you may at your option
    remove any additional permissions from that copy, or from any part of
    it.  (Additional permissions may be written to require their own
    removal in certain cases when you modify the work.)  You may place
    additional permissions on material, added by you to a covered work,
    for which you have or can give appropriate copyright permission.
    
      Notwithstanding any other provision of this License, for material you
    add to a covered work, you may (if authorized by the copyright holders of
    that material) supplement the terms of this License with terms:
    
        a) Disclaiming warranty or limiting liability differently from the
        terms of sections 15 and 16 of this License; or
    
        b) Requiring preservation of specified reasonable legal notices or
        author attributions in that material or in the Appropriate Legal
        Notices displayed by works containing it; or
    
        c) Prohibiting misrepresentation of the origin of that material, or
        requiring that modified versions of such material be marked in
        reasonable ways as different from the original version; or
    
        d) Limiting the use for publicity purposes of names of licensors or
        authors of the material; or
    
        e) Declining to grant rights under trademark law for use of some
        trade names, trademarks, or service marks; or
    
        f) Requiring indemnification of licensors and authors of that
        material by anyone who conveys the material (or modified versions of
        it) with contractual assumptions of liability to the recipient, for
        any liability that these contractual assumptions directly impose on
        those licensors and authors.
    
      All other non-permissive additional terms are considered "further
    restrictions" within the meaning of section 10.  If the Program as you
    received it, or any part of it, contains a notice stating that it is
    governed by this License along with a term that is a further
    restriction, you may remove that term.  If a license document contains
    a further restriction but permits relicensing or conveying under this
    License, you may add to a covered work material governed by the terms
    of that license document, provided that the further restriction does
    not survive such relicensing or conveying.
    
      If you add terms to a covered work in accord with this section, you
    must place, in the relevant source files, a statement of the
    additional terms that apply to those files, or a notice indicating
    where to find the applicable terms.
    
      Additional terms, permissive or non-permissive, may be stated in the
    form of a separately written license, or stated as exceptions;
    the above requirements apply either way.
    
      8. Termination.
    
      You may not propagate or modify a covered work except as expressly
    provided under this License.  Any attempt otherwise to propagate or
    modify it is void, and will automatically terminate your rights under
    this License (including any patent licenses granted under the third
    paragraph of section 11).
    
      However, if you cease all violation of this License, then your
    license from a particular copyright holder is reinstated (a)
    provisionally, unless and until the copyright holder explicitly and
    finally terminates your license, and (b) permanently, if the copyright
    holder fails to notify you of the violation by some reasonable means
    prior to 60 days after the cessation.
    
      Moreover, your license from a particular copyright holder is
    reinstated permanently if the copyright holder notifies you of the
    violation by some reasonable means, this is the first time you have
    received notice of violation of this License (for any work) from that
    copyright holder, and you cure the violation prior to 30 days after
    your receipt of the notice.
    
      Termination of your rights under this section does not terminate the
    licenses of parties who have received copies or rights from you under
    this License.  If your rights have been terminated and not permanently
    reinstated, you do not qualify to receive new licenses for the same
    material under section 10.
    
      9. Acceptance Not Required for Having Copies.
    
      You are not required to accept this License in order to receive or
    run a copy of the Program.  Ancillary propagation of a covered work
    occurring solely as a consequence of using peer-to-peer transmission
    to receive a copy likewise does not require acceptance.  However,
    nothing other than this License grants you permission to propagate or
    modify any covered work.  These actions infringe copyright if you do
    not accept this License.  Therefore, by modifying or propagating a
    covered work, you indicate your acceptance of this License to do so.
    
      10. Automatic Licensing of Downstream Recipients.
    
      Each time you convey a covered work, the recipient automatically
    receives a license from the original licensors, to run, modify and
    propagate that work, subject to this License.  You are not responsible
    for enforcing compliance by third parties with this License.
    
      An "entity transaction" is a transaction transferring control of an
    organization, or substantially all assets of one, or subdividing an
    organization, or merging organizations.  If propagation of a covered
    work results from an entity transaction, each party to that
    transaction who receives a copy of the work also receives whatever
    licenses to the work the party's predecessor in interest had or could
    give under the previous paragraph, plus a right to possession of the
    Corresponding Source of the work from the predecessor in interest, if
    the predecessor has it or can get it with reasonable efforts.
    
      You may not impose any further restrictions on the exercise of the
    rights granted or affirmed under this License.  For example, you may
    not impose a license fee, royalty, or other charge for exercise of
    rights granted under this License, and you may not initiate litigation
    (including a cross-claim or counterclaim in a lawsuit) alleging that
    any patent claim is infringed by making, using, selling, offering for
    sale, or importing the Program or any portion of it.
    
      11. Patents.
    
      A "contributor" is a copyright holder who authorizes use under this
    License of the Program or a work on which the Program is based.  The
    work thus licensed is called the contributor's "contributor version".
    
      A contributor's "essential patent claims" are all patent claims
    owned or controlled by the contributor, whether already acquired or
    hereafter acquired, that would be infringed by some manner, permitted
    by this License, of making, using, or selling its contributor version,
    but do not include claims that would be infringed only as a
    consequence of further modification of the contributor version.  For
    purposes of this definition, "control" includes the right to grant
    patent sublicenses in a manner consistent with the requirements of
    this License.
    
      Each contributor grants you a non-exclusive, worldwide, royalty-free
    patent license under the contributor's essential patent claims, to
    make, use, sell, offer for sale, import and otherwise run, modify and
    propagate the contents of its contributor version.
    
      In the following three paragraphs, a "patent license" is any express
    agreement or commitment, however denominated, not to enforce a patent
    (such as an express permission to practice a patent or covenant not to
    sue for patent infringement).  To "grant" such a patent license to a
    party means to make such an agreement or commitment not to enforce a
    patent against the party.
    
      If you convey a covered work, knowingly relying on a patent license,
    and the Corresponding Source of the work is not available for anyone
    to copy, free of charge and under the terms of this License, through a
    publicly available network server or other readily accessible means,
    then you must either (1) cause the Corresponding Source to be so
    available, or (2) arrange to deprive yourself of the benefit of the
    patent license for this particular work, or (3) arrange, in a manner
    consistent with the requirements of this License, to extend the patent
    license to downstream recipients.  "Knowingly relying" means you have
    actual knowledge that, but for the patent license, your conveying the
    covered work in a country, or your recipient's use of the covered work
    in a country, would infringe one or more identifiable patents in that
    country that you have reason to believe are valid.
    
      If, pursuant to or in connection with a single transaction or
    arrangement, you convey, or propagate by procuring conveyance of, a
    covered work, and grant a patent license to some of the parties
    receiving the covered work authorizing them to use, propagate, modify
    or convey a specific copy of the covered work, then the patent license
    you grant is automatically extended to all recipients of the covered
    work and works based on it.
    
      A patent license is "discriminatory" if it does not include within
    the scope of its coverage, prohibits the exercise of, or is
    conditioned on the non-exercise of one or more of the rights that are
    specifically granted under this License.  You may not convey a covered
    work if you are a party to an arrangement with a third party that is
    in the business of distributing software, under which you make payment
    to the third party based on the extent of your activity of conveying
    the work, and under which the third party grants, to any of the
    parties who would receive the covered work from you, a discriminatory
    patent license (a) in connection with copies of the covered work
    conveyed by you (or copies made from those copies), or (b) primarily
    for and in connection with specific products or compilations that
    contain the covered work, unless you entered into that arrangement,
    or that patent license was granted, prior to 28 March 2007.
    
      Nothing in this License shall be construed as excluding or limiting
    any implied license or other defenses to infringement that may
    otherwise be available to you under applicable patent law.
    
      12. No Surrender of Others' Freedom.
    
      If conditions are imposed on you (whether by court order, agreement or
    otherwise) that contradict the conditions of this License, they do not
    excuse you from the conditions of this License.  If you cannot convey a
    covered work so as to satisfy simultaneously your obligations under this
    License and any other pertinent obligations, then as a consequence you may
    not convey it at all.  For example, if you agree to terms that obligate you
    to collect a royalty for further conveying from those to whom you convey
    the Program, the only way you could satisfy both those terms and this
    License would be to refrain entirely from conveying the Program.
    
      13. Use with the GNU Affero General Public License.
    
      Notwithstanding any other provision of this License, you have
    permission to link or combine any covered work with a work licensed
    under version 3 of the GNU Affero General Public License into a single
    combined work, and to convey the resulting work.  The terms of this
    License will continue to apply to the part which is the covered work,
    but the special requirements of the GNU Affero General Public License,
    section 13, concerning interaction through a network will apply to the
    combination as such.
    
      14. Revised Versions of this License.
    
      The Free Software Foundation may publish revised and/or new versions of
    the GNU General Public License from time to time.  Such new versions will
    be similar in spirit to the present version, but may differ in detail to
    address new problems or concerns.
    
      Each version is given a distinguishing version number.  If the
    Program specifies that a certain numbered version of the GNU General
    Public License "or any later version" applies to it, you have the
    option of following the terms and conditions either of that numbered
    version or of any later version published by the Free Software
    Foundation.  If the Program does not specify a version number of the
    GNU General Public License, you may choose any version ever published
    by the Free Software Foundation.
    
      If the Program specifies that a proxy can decide which future
    versions of the GNU General Public License can be used, that proxy's
    public statement of acceptance of a version permanently authorizes you
    to choose that version for the Program.
    
      Later license versions may give you additional or different
    permissions.  However, no additional obligations are imposed on any
    author or copyright holder as a result of your choosing to follow a
    later version.
    
      15. Disclaimer of Warranty.
    
      THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
    APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
    HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
    OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
    IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
    ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
    
      16. Limitation of Liability.
    
      IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
    WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
    THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
    GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
    USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
    DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
    PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
    EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
    SUCH DAMAGES.
    
      17. Interpretation of Sections 15 and 16.
    
      If the disclaimer of warranty and limitation of liability provided
    above cannot be given local legal effect according to their terms,
    reviewing courts shall apply local law that most closely approximates
    an absolute waiver of all civil liability in connection with the
    Program, unless a warranty or assumption of liability accompanies a
    copy of the Program in return for a fee.
    
                         END OF TERMS AND CONDITIONS
    
                How to Apply These Terms to Your New Programs
    
      If you develop a new program, and you want it to be of the greatest
    possible use to the public, the best way to achieve this is to make it
    free software which everyone can redistribute and change under these terms.
    
      To do so, attach the following notices to the program.  It is safest
    to attach them to the start of each source file to most effectively
    state the exclusion of warranty; and each file should have at least
    the "copyright" line and a pointer to where the full notice is found.
    
        <one line to give the program's name and a brief idea of what it does.>
        Copyright (C) <year>  <name of author>
    
        This program is free software: you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation, either version 3 of the License, or
        (at your option) any later version.
    
        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.
    
        You should have received a copy of the GNU General Public License
        along with this program.  If not, see <https://www.gnu.org/licenses/>.
    
    Also add information on how to contact you by electronic and paper mail.
    
      If the program does terminal interaction, make it output a short
    notice like this when it starts in an interactive mode:
    
        <program>  Copyright (C) <year>  <name of author>
        This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
        This is free software, and you are welcome to redistribute it
        under certain conditions; type `show c' for details.
    
    The hypothetical commands `show w' and `show c' should show the appropriate
    parts of the General Public License.  Of course, your program's commands
    might be different; for a GUI interface, you would use an "about box".
    
      You should also get your employer (if you work as a programmer) or school,
    if any, to sign a "copyright disclaimer" for the program, if necessary.
    For more information on this, and how to apply and follow the GNU GPL, see
    <https://www.gnu.org/licenses/>.
    
      The GNU General Public License does not permit incorporating your program
    into proprietary programs.  If your program is a subroutine library, you
    may consider it more useful to permit linking proprietary applications with
    the library.  If this is what you want to do, use the GNU Lesser General
    Public License instead of this License.  But first, please read
    <https://www.gnu.org/licenses/why-not-lgpl.html>.
    

    Visit original content creator repository
    https://github.com/SamToki/Random-Sudoku-Generator

  • agsimgui

    agsimgui

    Build Status

    Dear ImGui plugin for Adventure Game Studio

    Using ocornut Dear ImGui, and also using software renderer with modifications from LAK132, and using other changes to ensure AGS compatibility.

    ImGui reference commit is 3f26a07ee1813cecaa87253436149e28fc11dc4e.

    Additionally using David Cappelo clip library for providing clipboard integration.

    Usage

    Run a simple demo window to see what’s possible with Dear ImGui.

    // use function room_RepExec() when in Room Script and link it throught the editor
    void repeatedly_execute(){
      AgsImGui.NewFrame(); //let's begin a new frame, we end it with a Render
      AgsImGui.ShowDemoWindow(); //Shows a demo of everything possible
      AgsImGui.Render(); // This will generate drawing instructions. 
      // AGS will actually draw this on screen later on, on Post Screen Draw stage.
    }

    Some of what is shown on Demo Window is not yet exposed in the AgsImGui Script API.

    Let’s do a simple example now.

    bool is_button_clicked;
    
    // use function room_RepExec() when in Room Script and link it throught the editor
    void repeatedly_execute(){
      AgsImGui.NewFrame(); //let's begin a new frame, we end it with a Render
    	
      AgsImGui.BeginWindow("My first window");	
      ViewFrame* vf = Game.GetViewFrame(player.View, player.Loop, player.Frame);
      is_button_clicked = AgsImGui.ImageButton(vf.Graphic); 
      if(AgsImGui.IsItemHovered()) AgsImGui.SetTooltip(String.Format("frame %d",player.Frame));
      player.x = AgsImGui.DragInt("player.x", player.x);
      player.y = AgsImGui.DragInt("player.y", player.y);
      AgsImGui.EndWindow();
    	
      AgsImGui.Render(); // This will generate drawing instructions. 
      // AGS will actually draw this on screen later on, on Post Screen Draw stage.
    }

    Note ImGui will save a ImGui.ini to allow window positions and some more data to persist between sections when no guidance is given.

    AGS Script API

    Main

    AgsImGui.GetStyle

    static ImGuiStyle* AgsImGui.GetStyle()

    Gets the Style customization use in AgsImGui. Check ImGuiStyle for more information.

    AgsImGui.SetStyle

    static void AgsImGui.SetStyle(ImGuiStyle* imGuiStyle)

    Sets the Style customization use in AgsImGui. Check ImGuiStyle for more information.

    ImGuiStyle* style = AgsImGui.GetStyle();
    style.Alpha = 0.5
    style.Colors[eImGuiCol_PopupBg] = ImVec4.Create(1.00, 1.00, 1.00, 1.00); //white 
    AgsImGui.SetStyle(style);

    AgsImGui.NewFrame

    static void AgsImGui.NewFrame()

    Call this before calling any AgsImGui commands.

    AgsImGui.EndFrame

    static void AgsImGui.EndFrame()

    We don’t need this if we are using Render, since it will automatically call AgsImGui.EndFrame() too.

    AgsImGui.Render

    static void AgsImGui.Render()

    This will EndFrame and proceed to generate drawing instructions.


    Demo, Debug, Information

    AgsImGui.GetVersion

    static String AgsImGui.GetVersion()

    AgsImGui.ShowDemoWindow

    static void AgsImGui.ShowDemoWindow()

    AgsImGui.ShowAboutWindow

    static void AgsImGui.ShowAboutWindow()

    AgsImGui.ShowMetricsWindow

    static void AgsImGui.ShowMetricsWindow()

    AgsImGui.ShowUserGuide

    static void AgsImGui.ShowUserGuide()


    Windows

    AgsImGui.BeginWindow

    static AgsImGui.ImGuiBeginWindow BeginWindow(String name, bool has_close_button = 0, ImGuiWindowFlags flags = 0)

    AgsImGui.EndWindow

    static void EndWindow()


    Child Windows

    AgsImGui.BeginChild

    static bool BeginChild(String str_id, int width = 0, int height = 0, bool border = false, ImGuiWindowFlags flags = 0)

    Child Windows. Always call a matching EndChild() for each BeginChild() call, regardless of its return value. Child windows can embed their own child.

    AgsImGui.EndChild

    static void EndChild()

    Pop child window from the stack.


    Item/Widgets Utilities

    Most of the functions are referring to the last/previous item we submitted.

    AgsImGui.IsItemHovered

    static bool AgsImGui.IsItemHovered(ImGuiHoveredFlags flags = 0)

    Is the last item hovered? (and usable, aka not blocked by a popup, etc.). You can specify a flag for more options.

    static bool IsItemHovered(ImGuiHoveredFlags flags = 0)

    AgsImGui.IsItemActive

    static bool AgsImGui.IsItemActive()

    Is the last item active? (e.g. button being held, text field being edited. This will continuously return true while holding mouse button on an item.)

    AgsImGui.IsItemFocused

    static bool AgsImGui.IsItemFocused()

    Is the last item focused for keyboard navigation?

    AgsImGui.IsItemVisible

    static bool AgsImGui.IsItemVisible()

    Is the last item visible? (items may be out of sight because of clipping/scrolling)

    AgsImGui.IsItemEdited

    static bool AgsImGui.IsItemEdited()

    Did the last item modify its underlying value this frame? or was pressed? This is generally the same as the bool return value of many widgets.

    AgsImGui.IsItemActivated

    static bool AgsImGui.IsItemActivated()

    Was the last item just made active (item was previously inactive).

    AgsImGui.IsItemDeactivated

    static bool AgsImGui.IsItemDeactivated()

    Was the last item just made inactive (item was previously active). Useful for Undo/Redo patterns with widgets that requires continuous editing.

    AgsImGui.IsItemDeactivatedAfterEdit

    static bool AgsImGui.IsItemDeactivatedAfterEdit()

    Was the last item just made inactive and made a value change when it was active? (e.g. Slider/Drag moved). Useful for Undo/Redo patterns with widgets that requires continuous editing.

    AgsImGui.IsItemToggledOpen

    static bool AgsImGui.IsItemToggledOpen()

    Was the last item open state toggled? set by TreeNode().

    AgsImGui.IsAnyItemHovered

    static bool AgsImGui.IsAnyItemHovered()

    is any item hovered?

    AgsImGui.IsAnyItemActive

    static bool AgsImGui.IsAnyItemActive()

    is any item active?

    AgsImGui.IsAnyItemFocused

    static bool AgsImGui.IsAnyItemFocused()

    is any item focused?

    AgsImGui.IsWindowAppearing

    static bool AgsImGui.IsWindowAppearing()

    ‘current window’ = the window we are appending into while inside a Begin()/End() block.

    AgsImGui.IsWindowCollapsed

    static bool AgsImGui.IsWindowCollapsed()

    return true when window is collapsed. Use this between Begin and End of a window.

    AgsImGui.IsWindowFocused

    static bool AgsImGui.IsWindowFocused(ImGuiFocusedFlags flags=0)

    is current window focused? or its root/child, depending on flags. see flags for options. Use this between Begin and End of a window.

    AgsImGui.IsWindowHovered

    static bool AgsImGui.IsWindowHovered(ImGuiHoveredFlags flags=0)

    is current window hovered (and typically: not blocked by a popup/modal)? see flags for options. Use this between Begin and End of a window.


    Widgets: Text

    AgsImGui.Text

    static void AgsImGui.Text(String text)

    Draws a string of text.

    AgsImGui.TextColored

    static void AgsImGui.TextColored(int ags_color, String text)

    shortcut for PushStyleColor(ImGuiCol_Text, col); Text(fmt, …); PopStyleColor();

    AgsImGui.TextDisabled

    static void AgsImGui.TextDisabled(String text)

    shortcut for PushStyleColor(ImGuiCol_Text, style.Colors[ImGuiCol_TextDisabled]); Text(fmt, …); PopStyleColor();

    AgsImGui.TextWrapped

    static void AgsImGui.TextWrapped(String text)

    shortcut for PushTextWrapPos(0.0f); Text(fmt, …); PopTextWrapPos();.

    AgsImGui.LabelText

    static void AgsImGui.LabelText(String label, String text)

    Display text+label aligned the same way as value+label widgets .

    AgsImGui.Bullet

    static void AgsImGui.Bullet(String text)

    Draws a bullet and a string of text. Shortcut for Bullet()+Text().


    Widgets: Main

    Most widgets return true when the value has been changed or when pressed/selected.

    You may also use one of the many IsItemXXX functions (e.g. IsItemActive, IsItemHovered, etc.) to query widget state.

    AgsImGui.Button

    static bool AgsImGui.Button(String label, int width = 0, int height = 0)

    Creates a button. Returns true while button is pressed.

    AgsImGui.SmallButton

    static bool AgsImGui.SmallButton(String label)

    Creates a button with no padding to be easier to embed within text. Returns true while button is pressed.

    AgsImGui.Image

    static void AgsImGui.Image(int sprite_id)

    Create an image with passed sprite ID.

    AgsImGui.ImageButton

    static bool AgsImGui.ImageButton(int sprite_id)

    Create a button with an image with passed sprite ID. Returns true while button is pressed.

    AgsImGui.ArrowButton

    static bool AgsImGui.ArrowButton(String label, ImGuiDir dir)

    Creates a button with an arrow shape. Returns true while button is pressed.

    AgsImGui.Checkbox

    static bool AgsImGui.Checkbox(String label, bool initial_value)

    Creates a checkbox button. Returns true when button is marked.

    AgsImGui.RadioButton

    static bool AgsImGui.RadioButton(String label, bool active)

    Creates a radio button. Returns true while button is marked.

    AgsImGui.Bullet

    static void AgsImGui.Bullet()

    Draw a small circle and keep the cursor on the same line. advance cursor x position by GetTreeNodeToLabelSpacing(), same distance that TreeNode() uses .


    Widgets: Selectables

    A selectable highlights when hovered, and can display another color when selected.

    AgsImGui.Selectable

    static bool AgsImGui.Selectable(String label, bool selected = false, ImGuiSelectableFlags flags = 0, int width = 0, int height = 0)

    bool selected carry the selection state (read-only). When Selectable() is clicked it returns true so you can modify your selection state.


    Widgets: Drag

    CTRL+Click on any drag box to turn them into an input box. Manually input values aren’t clamped and can go off-bounds.

    AgsImGui.DragFloat

    static float AgsImGui.DragFloat(String label, float value, float min_value = 0, float max_value = 0, float speed = 0, String format = 0)

    Returns the current value of the drag box. Format string uses regular "%f" specifiers, so you can use to define how many decimals you want.

    AgsImGui.DragInt

    static int AgsImGui.DragInt(String label, int value, int min_value = 0, int max_value = 0, float speed = 0, String format = 0)

    Returns the current value of the drag box. Format string uses regular "%d", you can use it to specify left most zeroes.


    Widgets: Slider

    CTRL+Click on any slider to turn them into an input box. Manually input values aren’t clamped and can go off-bounds.

    AgsImGui.SliderFloat

    static float AgsImGui.SliderFloat(String label, float value, float min_value = 0, float max_value = 0, String format = 0)

    Returns the current value of the slider. Format string uses regular "%f" specifiers, so you can use to define how many decimals you want.

    AgsImGui.SliderInt

    static int AgsImGui.SliderInt(String label, int value, int min_value = 0, int max_value = 0, String format = 0)

    Returns the current value of the slider. Format string uses regular "%d", you can use it to specify left most zeroes.


    Widgets: Input with Keyboard

    AgsImGui.InputText

    static String AgsImGui.InputText(String label, String text_buffer, int buffer_size, ImGuiInputTextFlags flags =0)

    Pass a string to identify the input field as label, this label is going to be used for ID and can’t be empty.

    Remember that we don’t save state between frames, so you have to do this yourself by reapplying the output to input as needed.

    This function returns null when the input hasn’t changed, and returns a string with all the text, when it has been modified.

    This widget supports Ctrl+Z for undo, Ctrl+X for Cut, Ctrl+C for copy, Ctrl+V for pasting, mouse selection and cursor navigation with arrows. Behavior can be modified by passing flags, see the enums section. Flags can be combined with bitwise operations.

    Example:

    String input_string;
    function room_RepExec() {   
      AgsImGui.NewFrame();  
        // buff
      String out_string = AgsImGui.InputText("type here!",input_string, 128);
      if(out_string!=null) input_string = out_string;
      
      AgsImGui.Render();
    }
    
    
    function room_Load() {
      input_string = "Hello String!";
    }

    AgsImGui.InputTextMultiline

    static String AgsImGui.InputTextMultiline(String label, String text_buffer, int buffer_size, int width=0, int height=0, ImGuiInputTextFlags flags = 0)

    Same as InputText, but allows controlling the input size and supports multiline text.

    AgsImGui.InputTextWithHint

    static String AgsImGui.InputTextWithHint(String label, String hint, String text_buffer, int buffer_size, ImGuiInputTextFlags flags = 0)

    Same as InputText, but supports passing an input hint text.


    Widgets: Combobox commands

    AgsImGui.BeginCombo

    static bool AgsImGui.BeginCombo(String label, String preview_value, ImGuiComboFlags flags = 0);

    The BeginCombo()/EndCombo() allows to manage your contents and selection state however you want it, by creating e.g. Selectable() items.

    Example:

    bool option1;
    bool option2;
    if(AgsImGui.BeginCombo("My combo","click me!")){
      option1 = AgsImGui.Selectable("Option 1");
      option2 = AgsImGui.Selectable("Option 2");
      AgsImGui.EndCombo();
    }

    AgsImGui.EndCombo

    static void EndCombo()

    Only call EndCombo() if BeginCombo() returns true!


    Widgets: List Boxes commands

    AgsImGui.BeginListBox

    static bool AgsImGui.BeginListBox(String label, int items_count, int height_in_items = -1);

    The BeginListBox()/EndListBox() allows to manage your contents and selection state however you want it, by creating e.g. Selectable() items.

    Example:

    bool option1;
    bool option2;
    if(AgsImGui.BeginListBox("My ListBox",2)){
      option1 = AgsImGui.Selectable("Option 1");
      option2 = AgsImGui.Selectable("Option 2");
      AgsImGui.EndListBox();
    }

    AgsImGui.EndListBox

    static void AgsImGui.EndListBox()

    Only call EndListBox() if BeginListBox() returns true!


    Widgets: Trees

    TreeNode functions return true when the node is open, in which case you need to also call TreePop() when you are finished displaying the tree node contents.

    AgsImGui.TreeNode

    static bool AgsImGui.TreeNode(String label)

    Show the contents and call TreePop() at the end, if this returns true.

    AgsImGui.TreeNodeWithID

    static bool AgsImGui.TreeNodeWithID(String str_id, String text)

    Show the contents and call TreePop() at the end, if this returns true.

    AgsImGui.TreeNodeV

    static bool AgsImGui.TreeNodeV(String str_id, String text)

    Show the contents and call TreePop() at the end, if this returns true.

    AgsImGui.TreeNodeEx

    static bool AgsImGui.TreeNodeEx(String label, ImGuiTreeNodeFlags flags = 0)

    Show the contents and call TreePop() at the end, if this returns true.

    AgsImGui.TreeNodeExWithID

    static bool AgsImGui.TreeNodeExWithID(String str_id, ImGuiTreeNodeFlags flags, String text)

    Show the contents and call TreePop() at the end, if this returns true.

    AgsImGui.TreeNodeExV

    static bool AgsImGui.TreeNodeExV(String str_id, ImGuiTreeNodeFlags flags, String text)

    Show the contents and call TreePop() at the end, if this returns true.

    AgsImGui.TreePush

    static void AgsImGui.TreePush(String str_id)

    ~ Indent()+PushId(). Already called by TreeNode() when returning true, but you can call TreePush/TreePop yourself if desired.

    AgsImGui.TreePop

    static void AgsImGuiTreePop()

    ~ Unindent()+PopId().

    AgsImGui.GetTreeNodeToLabelSpacing

    static float AgsImGui.GetTreeNodeToLabelSpacing()

    Horizontal distance preceding label when using TreeNode*() or Bullet() == (g.FontSize + style.FramePadding.x*2) for a regular unframed TreeNode.

    AgsImGui.CollapsingHeader

    static bool AgsImGui.CollapsingHeader(String label, ImGuiTreeNodeFlags flags = 0)

    If returning ‘true’ the header is open. doesn’t indent nor push on ID stack. user doesn’t have to call TreePop().

    AgsImGui.SetNextItemOpen

    static void AgsImGui.SetNextItemOpen(bool is_open, ImGuiCond cond = 0)

    Set next TreeNode/CollapsingHeader open state.


    Tooltips

    Tooltip are windows following the mouse which do not take focus away.

    Remember we can only have one active tooltip at all times, and the last one called is the active one.

    AgsImGui.BeginTooltip

    static void AgsImGui.BeginTooltip()

    Begin/append a tooltip window. to create full-featured tooltip (with any kind of items). Doesn’t return nothing.

    AgsImGui.EndTooltip

    static void AgsImGui.EndTooltip()

    Always call after a BeginTooltip block!

    AgsImGui.SetTooltip

    static void AgsImGui.SetTooltip(String text)

    Set a text-only tooltip, typically use with AgsImGui.IsItemHovered(). Override any previous call to SetTooltip().

    Example:

    AgsImGui.Button("Clicks for nothing!");
    if(AgsImGui.IsItemHovered()) AgsImGui.SetTooltip("Button is hovered!");
    

    Popups and Modals

    AgsImGui.OpenPopup

    static void AgsImGui.OpenPopup(String str_id)

    call to mark popup as open (don’t call every frame!). Popups are closed when user click outside, or if CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block.

    Popup identifiers are relative to the current ID-stack.

    Example:

    // If the button is in the Window, this code goes inside the window.
    if(AgsImGui.BeginPopup("my_popup")){
      AgsImGui.Text("This is a popup");
      AgsImGui.EndPopup();  
    }
    if(AgsImGui.Button("open popup"))
    {
      AgsImGui.OpenPopup("my_popup");
    }

    AgsImGui.BeginPopup

    static bool AgsImGui.BeginPopup(String str_id, ImGuiWindowFlags flags = 0)

    Return true if the popup is open, and you can start outputting to it. Only call EndPopup() if BeginPopup() returns true!

    Generally you will want to run this on every frame, and it will return true once the popup has been made open, and return false again once it’s closed.

    AgsImGui.BeginPopupModal

    static bool AgsImGui.BeginPopupModal(String name, bool has_close_button = 0, ImGuiWindowFlags flags = 0)

    Modal dialog, a regular window with title bar, block interactions behind the modal window, and you can’t close the modal window by clicking outside.

    AgsImGui.EndPopup

    static void AgsImGui.EndPopup()

    Only call EndPopup() if BeginPopupXXX() returns true!

    AgsImGui.IsPopupOpen

    static bool AgsImGui.IsPopupOpen(String str_id)

    Return true if the popup is open at the current begin-ed level of the popup stack.

    AgsImGui.CloseCurrentPopup

    static void AgsImGui.CloseCurrentPopup()

    Close the popup we have begin-ed into. clicking on a MenuItem or Selectable automatically close the current popup.


    Tab Bars, Tabs

    AgsImGui.BeginTabBar

    static bool AgsImGui.BeginTabBar(String str_id, ImGuiTabBarFlags flags = 0)

    create and append into a TabBar

    AgsImGui.EndTabBar

    static void AgsImGui.EndTabBar()

    only call EndTabBar() if BeginTabBar() returns true!

    AgsImGui.BeginTabItem

    static bool AgsImGui.BeginTabItem(String label, bool has_close_button = 0, ImGuiTabItemFlags flags = 0)

    create a Tab. Returns true if the Tab is selected.

    AgsImGui.EndTabItem

    static void AgsImGui.EndTabItem()

    only call EndTabItem() if BeginTabItem() returns true!

    AgsImGui.SetTabItemClosed

    static void AgsImGui.SetTabItemClosed(String tab_or_docked_window_label)

    notify TabBar or Docking system of a closed tab/window ahead (useful to reduce visual flicker on reorderable tab bars). For tab-bar: call after BeginTabBar() and before Tab submissions. Otherwise call with a window name.


    Menus

    AgsImGui.BeginMenuBar

    static bool AgsImGui.BeginMenuBar()

    Append to menu-bar of current window (requires ImGuiWindowFlags_MenuBar flag set on parent window).

    AgsImGui.EndMenuBar

    static void AgsImGui.EndMenuBar()

    Only call EndMenuBar() if BeginMenuBar() returns true!

    AgsImGui.BeginMainMenuBar

    static bool AgsImGui.BeginMainMenuBar()

    Create and append to a full screen menu-bar.

    AgsImGui.EndMainMenuBar

    static void AgsImGui.EndMainMenuBar()

    Only call EndMainMenuBar() if BeginMainMenuBar() returns true!

    AgsImGui.BeginMenu

    static bool AgsImGui.BeginMenu(String label, bool enabled = true)

    Create a sub-menu entry. Only call EndMenu() if this returns true!

    AgsImGui.EndMenu

    static void AgsImGui.EndMenu()

    Only call EndMenu() if BeginMenu() returns true!

    AgsImGui.MenuItem

    static bool AgsImGui.MenuItem(String label, String shortcut, bool selected = false, bool enabled = true)

    return true when activated. shortcuts are displayed for convenience but not processed by ImGui at the moment!


    General Helpers

    AgsImGuiHelper.SetClipboarText

    static void AgsImGuiHelper.SetClipboarText(String text)

    AgsImGuiHelper.GetClipboarText

    static String AgsImGuiHelper.GetClipboarText()


    ImVec2

    This is a format used to describe either x,y points or zero origin rectangles and other things that can be described as vectors. It’s used more in the attributes of a ImGuiStyle object.

    ImVec2.Create

    static ImVec2* ImVec2.Create(float x = 0, float y = 0)

    Creates a new ImVec2 object. You can pass float variable for it’s X and Y properties.

    ImVec2.X

    attribute float ImVec2.X

    It’s the X attribute of a ImVec2 object. Usually represents the horizontal axis.

    ImVec2.Y

    attribute float ImVec2.Y

    It’s the Y attribute of a ImVec2 object. Usually represents the vertical axis.

    ImVec2.Scale

    ImVec2* ImVec2.Scale(float scale)

    Multiplies x and y coordinates by a scalar and returns a new ImVec2 with the result.

    ImVec2.Length

    float ImVec2.Length()

    Returns length from ImVec2 (distance from 0,0 origin).

    ImVec2.SquaredLength

    float ImVec2.SquaredLength()

    Returns squared length from ImVec2 (distance from 0,0 origin). Faster than length.

    ImVec2.Add

    ImVec2* ImVec2.Add(ImVec2* imVec2)

    Returns a new ImVec2 with the sum of this with imVec2.

    ImVec2.Sub

    ImVec2* ImVec2.Sub(ImVec2* imVec2)

    Returns a new ImVec2 with the subtraction of imVec2 from this.


    ImVec4

    This is a format used to describe either x,y,w,z points or any origin rectangles and other things that can be described as vectors with 4 coordinates. It’s the preferable format for ImGui Colors, and used a lot for this! It’s used more in the attributes of a ImGuiStyle object.

    ImVec4.Create

    static ImVec4* ImVec4.Create(float x = 0, float y = 0, float z = 0, float w = 0)

    Creates a new ImVec4 object. You can pass float variable for it’s X, Y, Z and W properties.

    ImVec4.X

    attribute float ImVec4.X

    It’s the X attribute of a ImVec4 object. Usually represents the horizontal axis. When used for colors correspond to the color Red.

    ImVec4.Y

    attribute float ImVec4.Y

    It’s the Y attribute of a ImVec4 object. Usually represents the vertical axis. When used for colors correspond to the color Green.

    ImVec4.Z

    attribute float ImVec4.Z

    It’s the Z attribute of a ImVec4 object. Usually represents the length in the horizontal axis. When used for colors correspond to the color Blue.

    ImVec4.W

    attribute float ImVec4.W

    It’s the W attribute of a ImVec4 object. Usually represents the length in the vertical axis. When used for colors correspond to the alpha of the colors, where 0.0 is transparent and 1.0 is opaque.

    ImVec4.Scale

    ImVec4* ImVec4.Scale(float scale)

    Multiplies x, y, z and w coordinates by a scalar and returns a new ImVec4 with the result.

    ImVec4.Length

    float ImVec4.Length()

    Returns length from ImVec4 (distance from 0,0,0,0 origin).

    ImVec4.SquaredLength

    float ImVec4.SquaredLength()

    Returns squared length from ImVec4 (distance from 0,0,0,0 origin). Faster than length.

    ImVec4.Add

    ImVec4* ImVec4.Add(ImVec4* imVec4)

    Returns a new ImVec4 with the sum of this with imVec4.

    ImVec4.Sub

    ImVec4* ImVec4.Sub(ImVec4* imVec4)

    Returns a new ImVec4 with the subtraction of imVec4 from this.


    ImGuiStyle

    ImGuiStyle.Create

    static ImGuiStyle* ImGuiStyle.Create()

    Creates a new empty ImGuiStyle object. Rarely used, it’s usually more advised to use ImGui.GetStyle() instead, unless it’s planned to customize all elements of a ImGuiStyle object.

    ImGuiStyle.Alpha

    attribute float ImGuiStyle.Alpha

    Global alpha applies to everything in Dear ImGui.

    ImGuiStyle.WindowPadding

    attribute ImVec2* ImGuiStyle.WindowPadding

    Padding within a window.

    ImGuiStyle.WindowRounding

    attribute float ImGuiStyle.WindowRounding

    Radius of window corners rounding. Set to 0.0f to have rectangular windows.

    ImGuiStyle.WindowBorderSize

    attribute float ImGuiStyle.WindowBorderSize

    Thickness of border around windows. Generally set to 0.0f or 1.0f.

    ImGuiStyle.WindowMinSize

    attribute ImVec2* ImGuiStyle.WindowMinSize

    Minimum window size. This is a global setting. For individual windows, use SetNextWindowSizeConstraints().

    ImGuiStyle.WindowTitleAlign

    attribute ImVec2* ImGuiStyle.WindowTitleAlign

    Alignment for title bar text. Defaults to (0.0f,0.5f) for left-aligned,vertically centered.

    ImGuiStyle.WindowMenuButtonPosition

    attribute ImGuiDir ImGuiStyle.WindowMenuButtonPosition

    Side of the collapsing/docking button in the title bar (None/Left/Right). Defaults to ImGuiDir_Left.

    ImGuiStyle.ChildRounding

    attribute float ImGuiStyle.ChildRounding

    Radius of child window corners rounding. Set to 0.0f to have rectangular windows.

    ImGuiStyle.ChildBorderSize

    attribute float ImGuiStyle.ChildBorderSize

    Thickness of border around child windows. Generally set to 0.0f or 1.0f.

    ImGuiStyle.PopupRounding

    attribute float ImGuiStyle.PopupRounding

    Radius of popup window corners rounding. (Note that tooltip windows use WindowRounding)

    ImGuiStyle.PopupBorderSize

    attribute float ImGuiStyle.PopupBorderSize

    Thickness of border around popup/tooltip windows. Generally set to 0.0f or 1.0f.

    ImGuiStyle.FramePadding

    attribute ImVec2* ImGuiStyle.FramePadding

    Padding within a framed rectangle (used by most widgets).

    ImGuiStyle.FrameRounding

    attribute float ImGuiStyle.FrameRounding

    Radius of frame corners rounding. Set to 0.0f to have rectangular frame (used by most widgets).

    ImGuiStyle.FrameBorderSize

    attribute float ImGuiStyle.FrameBorderSize

    Thickness of border around frames. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).

    ImGuiStyle.ItemSpacing

    attribute ImVec2* ImGuiStyle.ItemSpacing

    Horizontal and vertical spacing between widgets/lines.

    ImGuiStyle.ItemInnerSpacing

    attribute ImVec2* ImGuiStyle.ItemInnerSpacing

    Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label).

    ImGuiStyle.TouchExtraPadding

    attribute ImVec2* ImGuiStyle.TouchExtraPadding

    Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don’t sort widgets so priority on overlap will always be given to the first widget. Don’t grow this too much!

    ImGuiStyle.IndentSpacing

    attribute float ImGuiStyle.IndentSpacing

    Horizontal indentation when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2).

    ImGuiStyle.ColumnsMinSpacing

    attribute float ImGuiStyle.ColumnsMinSpacing

    Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1).

    ImGuiStyle.ScrollbarSize

    attribute float ImGuiStyle.ScrollbarSize

    Width of the vertical scrollbar, Height of the horizontal scrollbar.

    ImGuiStyle.ScrollbarRounding

    attribute float ImGuiStyle.ScrollbarRounding

    Radius of grab corners for scrollbar.

    ImGuiStyle.GrabMinSize

    attribute float ImGuiStyle.GrabMinSize

    Minimum width/height of a grab box for slider/scrollbar.

    ImGuiStyle.GrabRounding

    attribute float ImGuiStyle.GrabRounding

    Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs.

    ImGuiStyle.TabRounding

    attribute float ImGuiStyle.TabRounding

    Radius of upper corners of a tab. Set to 0.0f to have rectangular tabs.

    ImGuiStyle.TabBorderSize

    attribute float ImGuiStyle.TabBorderSize

    Thickness of border around tabs.

    ImGuiStyle.TabMinWidthForUnselectedCloseButton

    attribute float ImGuiStyle.TabMinWidthForUnselectedCloseButton

    Minimum width for close button to appears on an unselected tab when hovered. Set to 0.0f to always show when hovering, set to FLT_MAX to never show close button unless selected.

    ImGuiStyle.ColorButtonPosition

    attribute ImGuiDir ImGuiStyle.ColorButtonPosition

    Side of the color button in the ColorEdit4 widget (left/right). Defaults to ImGuiDir_Right.

    ImGuiStyle.ButtonTextAlign

    attribute ImVec2* ImGuiStyle.ButtonTextAlign

    Alignment of button text when button is larger than text. Defaults to (0.5f, 0.5f) (centered).

    ImGuiStyle.SelectableTextAlign

    attribute ImVec2* ImGuiStyle.SelectableTextAlign

    Alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). It’s generally important to keep this left-aligned if you want to lay multiple items on a same line.

    ImGuiStyle.DisplayWindowPadding

    attribute ImVec2* ImGuiStyle.DisplayWindowPadding

    Window position are clamped to be visible within the display area by at least this amount. Only applies to regular windows.

    ImGuiStyle.DisplaySafeAreaPadding

    attribute ImVec2* ImGuiStyle.DisplaySafeAreaPadding

    If you cannot see the edges of your screen (e.g. on a TV) increase the safe area padding. Apply to popups/tooltips as well regular windows. NB: Prefer configuring your TV sets correctly!

    ImGuiStyle.MouseCursorScale

    attribute float ImGuiStyle.MouseCursorScale

    Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later.

    ImGuiStyle.AntiAliasedLines

    attribute bool ImGuiStyle.AntiAliasedLines

    Enable anti-aliasing on lines/borders. Disable if you are really tight on CPU/GPU.

    ImGuiStyle.AntiAliasedFill

    attribute bool ImGuiStyle.AntiAliasedFill

    Enable anti-aliasing on filled shapes (rounded rectangles, circles, etc.)

    ImGuiStyle.CurveTessellationTol

    attribute float ImGuiStyle.CurveTessellationTol

    Tessellation tolerance when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality.

    ImGuiStyle.CircleSegmentMaxError

    attribute float ImGuiStyle.CircleSegmentMaxError

    Maximum error (in pixels) allowed when using AddCircle()/AddCircleFilled() or drawing rounded corner rectangles with no explicit segment count specified. Decrease for higher quality but more geometry.

    ImGuiStyle.Colors

    attribute ImVec4* ImGuiStyle.Colors[]

    Use to configure the colors used in varied parts of the ImGui theme. Check the enum ImGuiCol_ for all possible colors available in a ImGuiStyle object. An example usage would be:

    ImGuiStyle* style = ImGui.GetStyle();
    style.Colors[eImGuiCol_TextDisabled] = ImVec4.Create(0.5, 0.5, 0.5, 0.5);
    ImGui.SetStyle(style);

    Enums

    ImGuiCond

    • eImGuiCond_Always, used when condition should always trigger, is usually the default when the AgImGui API requires conditions.

    • eImGuiCond_Once, Set the variable once per runtime session (only the first call with succeed).

    • eImGuiCond_FirstUseEver, Set the variable if the object/window has no persistently saved data (no entry in .ini file).

    • eImGuiCond_Appearing, Set the variable if the object/window is appearing after being hidden/inactive (or the first time).

    ImGuiDir

    • eImGuiDir_Left, left direction.

    • eImGuiDir_Right, right direction.

    • eImGuiDir_Up, up direction.

    • eImGuiDir_Down, down direction.

    ImGuiBeginWindow

    obs: This is exclusive to AgsImGui implementation because in AGS we don’t have pointers to primitive types.

    In any cases below, you still have to call AgsImGui.EndWindow().

    • eImGuiBeginWindow_OK, the window is open.

    • eImGuiBeginWindow_Collapsed, the window is collapsed (using the arrow at top left).

    • eImGuiBeginWindow_OK_Closed the window is closed. This value is only returned at mouse release frame, after clicking on close button!

    • eImGuiBeginWindow_Collapsed_Closed the window is both collapsed and closed, rare but theoretically possible.

    ImGuiWindowFlags

    • eImGuiWindowFlags_None (= 0),

    • eImGuiWindowFlags_NoTitleBar, Disable title-bar

    • eImGuiWindowFlags_NoResize, Disable user resizing with the lower-right grip

    • eImGuiWindowFlags_NoMove, Disable user moving the window

    • eImGuiWindowFlags_NoScrollbar, Disable scrollbars (window can still scroll with mouse or programmatically)

    • eImGuiWindowFlags_NoScrollWithMouse, Disable user vertically scrolling with mouse wheel. On child window, mouse wheel will be forwarded to the parent unless NoScrollbar is also set.

    • eImGuiWindowFlags_NoCollapse, Disable user collapsing window by double-clicking on it

    • eImGuiWindowFlags_AlwaysAutoResize, Resize every window to its content every frame

    • eImGuiWindowFlags_NoBackground,Disable drawing background color (WindowBg, etc.) and outside border. Similar as using SetNextWindowBgAlpha(0.0f).

    • eImGuiWindowFlags_NoSavedSettings, Never load/save settings in .ini file

    • eImGuiWindowFlags_NoMouseInputs, Disable catching mouse, hovering test with pass through.

    • eImGuiWindowFlags_MenuBar, Has a menu-bar

    • eImGuiWindowFlags_HorizontalScrollbar, Allow horizontal scrollbar to appear (off by default).

    • eImGuiWindowFlags_NoFocusOnAppearing, Disable taking focus when transitioning from hidden to visible state

    • eImGuiWindowFlags_NoBringToFrontOnFocus, Disable bringing window to front when taking focus (e.g. clicking on it or programmatically giving it focus)

    • eImGuiWindowFlags_AlwaysVerticalScrollbar, Always show vertical scrollbar (even if ContentSize.y < Size.y)

    • eImGuiWindowFlags_AlwaysHorizontalScrollbar, Always show horizontal scrollbar (even if ContentSize.x < Size.x)

    • eImGuiWindowFlags_AlwaysUseWindowPadding, Ensure child windows without border uses style.WindowPadding (ignored by default for non-bordered child windows, because more convenient)

    • eImGuiWindowFlags_NoNavInputs, No gamepad/keyboard navigation within the window

    • eImGuiWindowFlags_NoNavFocus, No focusing toward this window with gamepad/keyboard navigation (e.g. skipped by CTRL+TAB)

    • eImGuiWindowFlags_UnsavedDocument, Append ‘*’ to title without affecting the ID, as a convenience to avoid using the ### operator.

    • eImGuiWindowFlags_NoNav,

    • eImGuiWindowFlags_NoDecoration,

    • eImGuiWindowFlags_NoInputs,

    enum ImGuiInputTextFlags

    The enums of this type can be combined with bitwise operators.

    • eImGuiInputTextFlags_None, (=0) default

    • eImGuiInputTextFlags_CharsDecimal, Allow 0123456789.+-*/

    • eImGuiInputTextFlags_CharsHexadecimal, Allow 0123456789ABCDEFabcdef

    • eImGuiInputTextFlags_CharsUppercase, Turn a..z into A..Z

    • eImGuiInputTextFlags_CharsNoBlank, Filter out spaces, tabs

    • eImGuiInputTextFlags_AutoSelectAll, Select entire text when first taking mouse focus

    • eImGuiInputTextFlags_EnterReturnsTrue, Return ‘true’ when Enter is pressed (as opposed to every time the value was modified).

    • eImGuiInputTextFlags_CallbackCompletion, Callback on pressing TAB (for completion handling)

    • eImGuiInputTextFlags_CallbackHistory, Callback on pressing Up/Down arrows (for history handling)

    • eImGuiInputTextFlags_CallbackAlways, Callback on each iteration. User code may query cursor position, modify text buffer.

    • eImGuiInputTextFlags_CallbackCharFilter, Callback on character inputs to replace or discard them. Modify ‘EventChar’ to replace or discard, or return 1 in callback to discard.

    • eImGuiInputTextFlags_AllowTabInput, Pressing TAB input a ‘t’ character into the text field

    • eImGuiInputTextFlags_CtrlEnterForNewLine, In multi-line mode, unfocus with Enter, add new line with Ctrl+Enter (default is opposite: unfocus with Ctrl+Enter, add line with Enter).

    • eImGuiInputTextFlags_NoHorizontalScroll, Disable following the cursor horizontally

    • eImGuiInputTextFlags_AlwaysInsertMode, Insert mode

    • eImGuiInputTextFlags_ReadOnly, Read-only mode

    • eImGuiInputTextFlags_Password, Password mode, display all characters as ‘*’

    • eImGuiInputTextFlags_NoUndoRedo, Disable undo/redo. Note that input text owns the text data while active, if you want to provide your own undo/redo stack you need e.g. to call ClearActiveID().

    • eImGuiInputTextFlags_CharsScientific, Allow 0123456789.+-*/eE (Scientific notation input)

    • eImGuiInputTextFlags_CallbackResize, Callback on buffer capacity changes request (beyond ‘buf_size’ parameter value), allowing the string to grow.

    enum ImGuiTreeNodeFlags

    Flags for AgsImGui.TreeNodeEx(), AgsImGui.CollapsingHeader().

    eImGuiTreeNodeFlags_None, (=0) default

    eImGuiTreeNodeFlags_Selected, Draw as selected

    eImGuiTreeNodeFlags_Framed, Full colored frame (e.g. for CollapsingHeader)

    eImGuiTreeNodeFlags_AllowItemOverlap, Hit testing to allow subsequent widgets to overlap this one

    eImGuiTreeNodeFlags_NoTreePushOnOpen, Don’t do a TreePush() when open (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack

    eImGuiTreeNodeFlags_NoAutoOpenOnLog, Don’t automatically and temporarily open node when Logging is active (by default logging will automatically open tree nodes)

    eImGuiTreeNodeFlags_DefaultOpen, Default node to be open

    eImGuiTreeNodeFlags_OpenOnDoubleClick, Need double-click to open node

    eImGuiTreeNodeFlags_OpenOnArrow, Only open when clicking on the arrow part. If ImGuiTreeNodeFlags_OpenOnDoubleClick is also set, single-click arrow or double-click all box to open.

    eImGuiTreeNodeFlags_Leaf, No collapsing, no arrow (use as a convenience for leaf nodes).

    eImGuiTreeNodeFlags_Bullet, Display a bullet instead of arrow

    eImGuiTreeNodeFlags_FramePadding, Use FramePadding (even for an unframed text node) to vertically align text baseline to regular widget height. Equivalent to calling AlignTextToFramePadding().

    eImGuiTreeNodeFlags_SpanAvailWidth, Extend hit box to the right-most edge, even if not framed. This is not the default in order to allow adding other items on the same line. In the future we may refactor the hit system to be front-to-back, allowing natural overlaps and then this can become the default.

    eImGuiTreeNodeFlags_SpanFullWidth, Extend hit box to the left-most and right-most edges (bypass the indented area).

    eImGuiTreeNodeFlags_NavLeftJumpsBackHere, (WIP) Nav: left direction may move to this TreeNode() from any of its child (items submitted between TreeNode and TreePop)

    eImGuiTreeNodeFlags_NoScrollOnOpen, FIXME: TODO: Disable automatic scroll on TreePop() if node got just open and contents is not visible

    eImGuiTreeNodeFlags_CollapsingHeader, Framed, NoTreePushOpen and NoAutoOpenOnLog.

    enum ImGuiCol_

    Used for selecting a specific color from the ImGuiStyle.Colors[] property.

    An example usage would be:

    ImGuiStyle* style = ImGui.GetStyle();
    style.Colors[eImGuiCol_WindowBg] = ImVec4.Create(1.0, 0.0, 0.0, 0.0);
    ImGui.SetStyle(style);

    This would use the enum eImGuiCol_WindowBg to access the desired color you want to modify, which in the example sets to a red color.

    • eImGuiCol_Text,

    • eImGuiCol_TextDisabled,

    • eImGuiCol_WindowBg, Background of normal windows

    • eImGuiCol_ChildBg, Background of child windows

    • eImGuiCol_PopupBg, Background of popups, menus, tooltips windows

    • eImGuiCol_Border,

    • eImGuiCol_BorderShadow,

    • eImGuiCol_FrameBg, Background of checkbox, radio button, plot, slider, text input

    • eImGuiCol_FrameBgHovered,

    • eImGuiCol_FrameBgActive,

    • eImGuiCol_TitleBg,

    • eImGuiCol_TitleBgActive,

    • eImGuiCol_TitleBgCollapsed,

    • eImGuiCol_MenuBarBg,

    • eImGuiCol_ScrollbarBg,

    • eImGuiCol_ScrollbarGrab,

    • eImGuiCol_ScrollbarGrabHovered,

    • eImGuiCol_ScrollbarGrabActive,

    • eImGuiCol_CheckMark,

    • eImGuiCol_SliderGrab,

    • eImGuiCol_SliderGrabActive,

    • eImGuiCol_Button,

    • eImGuiCol_ButtonHovered,

    • eImGuiCol_ButtonActive,

    • eImGuiCol_Header, Header* colors are used for CollapsingHeader, TreeNode, Selectable, MenuItem

    • eImGuiCol_HeaderHovered,

    • eImGuiCol_HeaderActive,

    • eImGuiCol_Separator,

    • eImGuiCol_SeparatorHovered,

    • eImGuiCol_SeparatorActive,

    • eImGuiCol_ResizeGrip,

    • eImGuiCol_ResizeGripHovered,

    • eImGuiCol_ResizeGripActive,

    • eImGuiCol_Tab,

    • eImGuiCol_TabHovered,

    • eImGuiCol_TabActive,

    • eImGuiCol_TabUnfocused,

    • eImGuiCol_TabUnfocusedActive,

    • eImGuiCol_PlotLines,

    • eImGuiCol_PlotLinesHovered,

    • eImGuiCol_PlotHistogram,

    • eImGuiCol_PlotHistogramHovered,

    • eImGuiCol_TextSelectedBg,

    • eImGuiCol_DragDropTarget,

    • eImGuiCol_NavHighlight, Gamepad/keyboard: current highlighted item;

    • eImGuiCol_NavWindowingHighlight, Highlight window when using CTRL+TAB;

    • eImGuiCol_NavWindowingDimBg, Darken/colorize entire screen behind the CTRL+TAB window list, when active;

    • eImGuiCol_ModalWindowDimBg, Darken/colorize entire screen behind a modal window, when one is active;

    • eImGuiCol_COUNT, The total numbers of items in ImGuiStyle.Colors attribute array. Useful for iterating all colors.

    FAQ

    How do I make mouse wheel work?

    First, make sure you have mouse wheel support enabled in Global Settings.

    Then, in some script, add the code below. Note: If the script is a Room script, it will only work in that room.

    void on_mouse_click (int btn){
      if(btn == eMouseWheelNorth){
        AgsImGui.DoMouseWheel(eImGuiDir_Down);
      } else if(btn == eMouseWheelSouth){
        AgsImGui.DoMouseWheel(eImGuiDir_Up);    
      }  
    }

    For now, mouse wheel events are not exposed in the AGS Plugin API, so you have to do it through script. In the future, if this changes, it will be integrated in the plugin.

    Visit original content creator repository https://github.com/ericoporto/agsimgui
  • pronounce

    Double-click pronounce: improve your pronounciation for any language 🗣

    Never doubt how to pronounce a word. Double-click it and your browser will read it out loud for you! (Works on Firefox and Chrome).

    Some people use double click to select a word and to then expand the selection to other words, as it would be terrible for you to listen to any selection out loud, double click pronounce will only read out loud when you double-click a single word.

    Features

    • ✅ Works on Firefox
    • ✅ Works on Chrome
    • ✅ Language locale selection
    • ✅ Toggle on/off
    • ✅ Blacklist to turn off in certain webpages
    Click here to see all locales supported:

    • “en-US”
    • “it-IT”
    • “sv-SE”
    • “fr-CA”
    • “de-DE”
    • “he-IL”
    • “id-ID”
    • “en-GB”
    • “es-AR”
    • “nl-BE”
    • “en-scotland”
    • “en-US”
    • “ro-RO”
    • “pt-PT”
    • “es-ES”
    • “es-MX”
    • “th-TH”
    • “en-AU”
    • “ja-JP”
    • “sk-SK”
    • “hi-IN”
    • “it-IT”
    • “pt-BR”
    • “ar-SA”
    • “hu-HU”
    • “zh-TW”
    • “el-GR”
    • “ru-RU”
    • “en-IE”
    • “es-ES”
    • “nb-NO”
    • “es-MX”
    • “en-IN”
    • “en-US”
    • “da-DK”
    • “fi-FI”
    • “zh-HK”
    • “en-ZA”
    • “fr-FR”
    • “zh-CN”
    • “en-IN”
    • “en-US”
    • “nl-NL”
    • “tr-TR”
    • “ko-KR”
    • “ru-RU”
    • “pl-PL”
    • “cs-CZ”

    Motivation

    All throughout middle school and high school I was a pretty good english student, but ever since I started college I began to lose confidence over my pronounciation (as I didn’t have english lessons or anyone to talk to in english). I find this really frustrating because 99.9% of my time online is me reading in english… So the goal of this extension is to practice my pronounciation english.

    This repo was featured in the 138th issue of Ruan YiFeng’s blog: https://ruanyifeng.com/blog/2020/12/weekly-issue-138.html

    Installation

    Firefox

    You can download the extension here.

    Chrome

    You can download the extension here.

    Contributing

    Feel free to Contribute to this project!

    Contributors

    License

    The MIT License (MIT).

    Visit original content creator repository
    https://github.com/tryhardfifi/pronounce

  • Tile-Breaker-Plugin

    Tile Breaker Plugin

    Hello fellow Godot users! Have you ever come across this problem before?

    Ugh! 😫 Look at all of that distracting tiling pattern in the terrain. Unless you’re making a world of quilt, I doubt that you want this showing in your scenery. Well fear not! With this plugin, you’ll be able to turn that, into this!

    Much better. 😄 Here’s a side by side comparison of this feature. Amazing, isn’t it?

    Installation

    After downloading this repository, take the folder inside the addons folder, and put it into your project’s addons folder. Don’t have one? Make one. After that, you enable the plugin in the ProjectSettings in the Plugin section. It’s that easy.

    Instructions

    This plugin currently is supported for SpatialMaterials and ShaderMaterials that use a VisualShader.

    Materials

    For SpatialMaterials, just select the material, press the SpatialMaterial button that shows up in the 3D editor, then press Add Tile Breaker. You remove the feature from the material the same way you add it.

    Once you add the tile breaker, the SpatialMaterial will have new options.

    • Variation Texture :- A texture used by the shader to randomize the offset patterns. This option only appears when the plugin quality is set to Low.
    • Break Tiling :- Whether to enable tile breaking for a certain UV layer.
    • Random Rotation :- How much the texture is randomly rotated for a certain UV layer.
    • Blending :- How much texture samples are blended with each other for a certain UV layer. No blending will cause seams to show up in the material, unless the plugin quality is set to High.

    As for visual shaders, a custom visual shader node has been created for them.

    The parameters act the same way they do in SpatialMaterials. One thing to note however. If the plugin quality is set to Low, then you have to set the variation texture uniform manually. You can find the default variation texture in the plugin’s folder.

    Tile Breaker Quality

    I’ve been talking about plugin quality for a while now. You will find that in the ProjectSettings under Rendering -> Quality. A low quality uses only 2 texture samples, medium uses 4, and high uses 9. As expected, each one looks better, but is also more performance heavy. If you have any VisualShaders that use the tile breaker, then you’ll have to restart the project when you have set your desired quality.

    GLES 2 and 3

    This plugin is best suited for projects running GLES 3, but it can run on GLES 2 just fine. There’s just one problem. Artifacts will start showing up in that version. The only way to get rid of said artifacts is by disabling mipmapping for the texture being used. It’s a trade-off you’ll have to think about. 🤔

    Special Thanks

    The textures used in the demo scene were provided by https://www.cgbookcase.com/. 🙂

    And the shaders that this plugin uses are based off the ones from https://www.iquilezles.org/www/articles/texturerepetition/texturerepetition.htm. You can find some excellent shaders from this place.

    Visit original content creator repository https://github.com/SIsilicon/Tile-Breaker-Plugin
  • jiosaavn-downloader

    JioSaavn Downloader

    A simple and effective extension to download songs, albums, or playlists from 🎧 jiosaavn.com with just one click. It also hides ads 🚫 and promotions from the JioSaavn website and slightly tweaks the UI. Last but not least, it implements a long-awaited dark mode.

    Note

    🚧 The project is currently a work in progress, many features are still under development.
    🐛 If you find an issue, please report it here.

    If you like the extension, please ⭐ the repo.
    Follow me to stay updated on similar projects.

    You can download the extension from the following link, or visit the changelog.
    If you’re having trouble installing it, refer to the installation guide below.

    Table of Contents

    JioSaavn downloader preview

    How It Works

    The extension fetches data from JioSaavn’s API endpoints and organizes it in a user-friendly manner. This process occurs entirely within the browser and does not rely on external servers.

    Once the data is fetched, it retrieves the URL for the song, album, or playlist in your preferred quality settings. The extension then sends an HTTP request to the server to fetch the M4A file. This step requires CORS to be enabled in your browser. In previous versions, this required an additional extension, but it is now integrated.

    For playlists or albums, the extension fetches the individual songs and downloads them individually, placing them inside a ZIP file for easy download.

    Features

    • Dark mode based on system theme.
    • Download in various qualities: HD 320kbps, Default 160kbps.
    • Download songs.
    • Download top songs from artists.
    • Download albums and playlists as ZIP files.
    • Download podcasts.
    • Blocks ads and promotions.
    • Modifies certain UI elements.

    How to Use

    Note

    Due to restrictions, this extension cannot be hosted on the Chrome Web Store. You can manually install the extension by following the steps below.

    You can access JioSaavn directly by single-clicking the extension icon—no need to add bookmarks. Double-click the extension icon to open the extension options.

    Prerequisites

    • Developer Mode: Enable developer mode in your browser.
      Go to chrome://extensions and check the Developer Mode checkbox.

    Download and Install

    1. Download the extension here: Download and extract the contents.
      You can also visit the release page to check for other versions.
    2. Go to the Chrome Extensions page: chrome://extensions.
    3. Click the Load unpacked button.
    4. Select the extracted folder and click Open.

    Note: If you downloaded the source code, install it by running the following commands in your terminal (ensure that Node.js and npm are installed):

    npm install
    npm run build

    This will build the extension in the build folder. You can then manually install it from there.

    Customization

    WORK IN PROGRESS❗

    The extension includes an options page for customization. To access it, right-click the extension icon and select Extension Options. You can also open the options page by double-clicking the extension icon in the toolbar.

    • Quality Settings: Choose the quality of songs to download.
        > Default: 320kbps
    • Name Format: Customize the naming format of downloaded songs.
        > Default: $title - $album_artist
        > Params: $title, $album_artist, $artists, $album, $year, $track, $genre, $bitrate

    Acknowledgements

    The following projects were instrumental in the development of this extension:

    ↑ Back to top

    Visit original content creator repository https://github.com/oviirup/jiosaavn-downloader
  • resumefromstaticwebsite

    Hosting a Resume from Static Website utilizing S3, Cloudfront and Route 53

    In this project, I created a resume from a sample .HTML and .CSS file, hosted in a S3 bucket with AWS. However, using just an S3 bucket alone will generate an insecure, non-customizable and undesired domain. (e.g http://awsresume.online.s3-website-us-east-1.amazonaws.com/)

    So what is the solution?

    We need to implement a secure and compliant domain over the internet that can allow our domain to generate a secure certificate (https). For this, Cloudfront enters the fray. It will generate an https environment allowing our domain to be secure. This will also allow seamless access and connection across multiple edge locations for faster query response. The problem, is that it will still create a fixed domain. (e.g https://d2ygp4l15ss99c.cloudfront.net)

    To solve the final piece of the puzzle, we deploy Route53. This application will allow us to communicate our cloudfront distribution with a third party domain or a domain create within Route53 on AWS. With this solution, we will be able to utilize any domain we choose or need. We will also use Amazon Certificate Manager (ACM) to generate a valid HTTPS certificate that can allow the cloudfront distribution route the traffic with the custom domain.

    This is a perfect real-world example to host a Resume in a secure, easily manageable static website that can be displayed with a third party custom domain or domain generated by AWS through Route53.

    Environments and Technologies Used

    • Amazon Web Services (AWS)
    • S3
    • Cloudfront
    • Route 53
    • Amazon Certificate Manager
    • Godaddy (for custom domain, route 53 can also accomplish the same goal.)
    • HTML
    • CSS
    • JSON

    Operating Systems Used

    • Windows 11

    How to Build

    1. Create a S3 Bucket

    When we create a S3 bucket, we want to make sure we allow public access so that the bucket is accessible publicly. However, we need to determine which object or resource is going to be allowed for public access, which is why we implement a S3 Bucket Policy in a json file. (file has been provided at the repository. Make sure the value of “Resource” is renamed to the S3 bucket you are using. It will display above the bucket policy box or by browsing the S3 bucket, as show in this video:

    Create.A.S3.Bucket.mp4
    1. Upload files to S3 Bucket
    Upload.Files.to.S3.bucket.mp4

    After creation, it will create a S3 webpoint. In this case, it would be http://awsresume.online.s3-website-us-east-1.amazonaws.com/

    S3.Website.mp4

    1. Create a Cloudfront Distribution
    Create.a.Cloudfront.Distribution.mp4

    After creation, a cloudfrount domain name will be created with an HTTPS resolver. In this case, the address would be https://d2ygp4l15ss99c.cloudfront.net

    1. Create a hosted zone with Route 53 for a custom domain and create an alias record with Cloudfront
    Create.Hosted.Zone.In.Route.53.Along.With.Cloudfront.Alias.Record.mp4

    Even after creating the zone and alias record for the custom domain, it will show a 443 request error. We still need to request a certificate for our new domain, as shown below:

    1. Requesting a Public Certificate with Amazon Certificate Manager in order to resolve a HTTPS request with the custom domain
    Requesting.A.Public.Certificate.With.Amazon.Certificate.Manager.In.Order.To.Resolve.A.Https.Request.With.The.Custom.Domain.mp4

    After it’s said and done, we can test our custom domain now with no errors. Wooho!

    The final result is our custom domain (fully accessible): https://awsresume.online


    Conclusion

    This projects demostrates a real-world scenario where we can create a website hosted with an S3 bucket utilizing AWS. In this example we also utilized .HTML and .CSS files to load our resume file into the bucket. By utilizing secure dns protocols and traffic through Route 53 and Cloudfront, we made sure that our website is fully compliant and accessible, as well as providing our own custom domain. This project was made with AWS free tier on all tools except for Route 53, where creating hosted zones has a cost as well. You can add a CNAME to a Cloudfront endpoint address using godaddy instead if you wish to cut on costs. Note that CNAMEs are not available at the root (apex) of the domain, so unless godaddy provides a CNAME flattening service (equivalent to Alias) you can only set it on a subdomain. There is also a cost in purchasing a third party domain or inside AWS. With this feature, you can utilize both without issues.
    Visit original content creator repository https://github.com/nilsojc/resumefromstaticwebsite
  • AOAI-CognitiveSearch-AZD

    ChatGPT + Enterprise data with Azure OpenAI and Cognitive Search

    This sample demonstrates a few approaches for creating ChatGPT-like experiences over your own data using the Retrieval Augmented Generation pattern. It utilises ChatGPT model (gpt-35-turbo) in Azure OpenAI Service as a Generative AI platform, and Azure Cognitive Search for data indexing and retrieval.

    ======>> Original source code can be found here <<======.

    The repo includes sample data so it’s ready to try end to end. In this sample application we use a fictitious company called Contoso Electronics, and the experience allows its employees to ask questions about the benefits, internal policies, as well as job descriptions and roles.

    Note from Laziz: I’m currently updating this repo to migrate from ChatML syntax (used in OpenAI API v2022-12-03) to newer Chat Completion (with OpenAI API v2023-05-15), as it’s required for the interactions with GPT4 models.

    Features

    • Chat and Q&A interfaces
    • Explores various options to help users evaluate the trustworthiness of responses with citations, tracking of source content, etc.
    • Shows possible approaches for data preparation, prompt construction, and orchestration of interaction between model (ChatGPT) and retriever (Cognitive Search)
    • Settings directly in the UX to tweak the behavior and experiment with options

    Installation

    Project Initialization

    1. Create a new folder and switch to it in the terminal
    2. Run azd auth login
    3. Run azd init -t azure-search-openai-demo
      • For the target location, the regions that currently support the models used in this sample are East US or South Central US. For an up-to-date list of regions and models, check here

    Starting from scratch:

    Execute the following command, if you don’t have any pre-existing Azure services and want to start from a fresh deployment.

    1. Run azd up – This will provision Azure resources and deploy this sample to those resources, including building the search index based on the files found in the ./data folder.
    2. After the application has been successfully deployed you will see a URL printed to the console. Click that URL to interact with the application in your browser.

    It will look like the following:

    'Output from running azd up'

    NOTE: It may take a minute for the application to be fully deployed. If you see a “Python Developer” welcome screen, then wait a minute and refresh the page.

    Use existing resources:

    1. Run azd env set AZURE_OPENAI_SERVICE {Name of existing OpenAI service}
    2. Run azd env set AZURE_OPENAI_RESOURCE_GROUP {Name of existing resource group that OpenAI service is provisioned to}
    3. Run azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT {Name of existing ChatGPT deployment}. Only needed if your ChatGPT deployment is not the default ‘chat’.
    4. Run azd env set AZURE_OPENAI_GPT_DEPLOYMENT {Name of existing GPT deployment}. Only needed if your ChatGPT deployment is not the default ‘davinci’.
    5. Run azd up

    NOTE: You can also use existing Search and Storage Accounts. See ./infra/main.parameters.json for list of environment variables to pass to azd env set to configure those existing resources.

    Deploying or re-deploying a local clone of the repo:

    • Simply run azd up

    Running locally:

    1. Run azd login
    2. Change dir to app
    3. Run ./start.ps1 or ./start.sh or run the “VS Code Task: Start App” to start the project locally.

    Sharing Environments

    Run the following if you want to give someone else access to completely deployed and existing environment.

    1. Install the Azure CLI
    2. Run azd init -t azure-search-openai-demo
    3. Run azd env refresh -e {environment name} – Note that they will need the azd environment name, subscription Id, and location to run this command – you can find those values in your ./azure/{env name}/.env file. This will populate their azd environment’s .env file with all the settings needed to run the app locally.
    4. Run pwsh ./scripts/roles.ps1 – This will assign all of the necessary roles to the user so they can run the app locally. If they do not have the necessary permission to create roles in the subscription, then you may need to run this script for them. Just be sure to set the AZURE_PRINCIPAL_ID environment variable in the azd .env file or in the active shell to their Azure Id, which they can get with az account show.

    Quickstart

    • In Azure: navigate to the Azure WebApp deployed by azd. The URL is printed out when azd completes (as “Endpoint”), or you can find it in the Azure portal.
    • Running locally: navigate to 127.0.0.1:5000

    Once in the web app:

    • Try different topics in chat or Q&A context. For chat, try follow up questions, clarifications, ask to simplify or elaborate on answer, etc.
    • Explore citations and sources
    • Click on “settings” to try different options, tweak prompts, etc.

    Resources

    Note

    Note: The PDF documents used in this demo contain information generated using a language model (Azure OpenAI Service). The information contained in these documents is only for demonstration purposes and does not reflect the opinions or beliefs of Microsoft. Microsoft makes no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability or availability with respect to the information contained in this document. All rights reserved to Microsoft.

    Visit original content creator repository https://github.com/LazaUK/AOAI-CognitiveSearch-AZD
  • yokubo-backend

    yokubo-backend

    Nodejs Backend of the Yokubo App, a project tracking tool, and the corresponding Yokubo Landing Page.

    About Yokubo

    With Yokubo you can track your projects, record the time you spent on them and make notes about certain metrics defined by yourself. The app automatically calculates valuable statistics and gives you insights on your overall performance.

    Requirements

    Dependencies

    Package requirements

    • ImageMagick

    Installation & Usage

    Install node modules

    $ yarn install

    Configure environment

    Create env folder

    In the root directory of your project create an env folder and change into this folder

    $ mkdir env && cd env
    Setup test environment

    Create a file named test.env

    $ touch test.env

    Add the following environment variables to that file

    NODE_ENV=test
    
    # HAPI server settings
    SERVER_HOST=127.0.0.1
    SERVER_PORT=8080
    
    # Database settings
    PGHOST=127.0.0.1
    PGPORT=5432
    PGUSER=postgres
    PGPASSWORD=password
    PGDATABASE=yokubo-test
    
    # Logger settings
    FILE_SEVERITY=error
    FILE_PATH=./logs/yokubo-backend.log
    CONSOLE_SEVERITY=error
    MAIL_RECEIVER=mail@example.com
    
    # Assets
    EXTERNAL_ASSETS_URL_HOST=http://127.0.0.1:8080
    
    # Static pages
    STATIC_WEBPAGES_URL_HOST=http://127.0.0.1:8080
    
    # Mailing (Sparkpost)
    MAIL_API_KEY=<your api key>
    MAIL_FROM=mail@example.com
    
    # Tests
    # SEND_TEST_MAILS --> set for yarn:test cmd in package.json
    TESTUSER_1_EMAIL=mail@example.com
    TESTUSER_2_EMAIL=mail@example.com
    
    # Admin user
    ADMIN_USERNAME=admin
    ADMIN_PWD=whatever
    ADMIN_NAME=Administrator
    
    # Legal disclosure
    LEGAL_DISCLOSURE_NAME=Your name
    LEGAL_DISCLOSURE_ADDRESS=Your addres
    LEGAL_DISCLOSURE_PLZ=Your plz
    LEGAL_DISCLOSURE_CITY=_Your city
    LEGAL_DISCLOSURE_STATE=Your state
    LEGAL_DISCLOSURE_EMAIL=mail@example.com
    
    Setup prod env

    Create a file named prod.env

    $ touch prod.env

    Add the following environment variables to that file

    NODE_ENV=development
    
    # HAPI server settings 
    SERVER_HOST=0.0.0.0
    SERVER_PORT=8080
    
    # Database settings
    PGHOST=127.0.0.1
    PGPORT=5432
    PGUSER=postgres
    PGPASSWORD=password
    PGDATABASE=yokubo
    
    # Logger settings
    FILE_SEVERITY=error
    FILE_PATH=./logs/yokubo-backend.log
    CONSOLE_SEVERITY=info
    MAIL_RECEIVER=mail@example.com
    
    # Assets
    EXTERNAL_ASSETS_URL_HOST=http://127.0.0.1:8080
    
    # Static pages
    STATIC_WEBPAGES_URL_HOST=http://127.0.0.1:8080
    
    # Mailing (Sparkpost)
    MAIL_API_KEY=<your api key>
    MAIL_FROM=mail@example.com
    
    # Admin user
    ADMIN_USERNAME=admin
    ADMIN_PWD=whatever
    ADMIN_NAME=Administrator
    
    # Legal disclosure
    LEGAL_DISCLOSURE_NAME=Your name
    LEGAL_DISCLOSURE_ADDRESS=Your addres
    LEGAL_DISCLOSURE_PLZ=Your plz
    LEGAL_DISCLOSURE_CITY=_Your city
    LEGAL_DISCLOSURE_STATE=Your state
    LEGAL_DISCLOSURE_EMAIL=mail@example.com
    

    Transpile Typescript

    $ yarn build

    Setup database

    $ yarn db:migrate

    Run tests

    $ yarn test

    Start server locally

    $ yarn start

    License

    MIT

    References

    yokubo-app, the corresponding React-Native app.

    Visit original content creator repository
    https://github.com/yokubo-project/yokubo-backend

  • xLSTM-UNet-PyTorch

    xLSTM-UNet can be an Effective 2D & 3D Medical Image Segmentation Backbone with Vision-LSTM (ViL) better than its Mamba Counterpart

    Tianrun Chen, Chaotao Ding, Lanyun Zhu, Tao Xu, Deyi Ji, Ying Zang, Zejian Li

    KOKONI, Moxin Technology (Huzhou) Co., LTD , Zhejiang University, Singapore University of Technology and Design, Huzhou University, University of Science and Technology of China.

    Code

    Installation

    Requirements: Ubuntu 20.04, CUDA 11.8

    1. Create a virtual environment: conda create -n uxlstm python=3.10 -y and conda activate uxlstm
    2. Install Pytorch 2.0.1: pip install torch==2.0.1 torchvision==0.15.2 --index-url https://download.pytorch.org/whl/cu118
    3. Download code: git clone https://github.com/tianrun-chen/xLSTM-UNet-PyTorch.git
    4. cd xLSTM-UNet-PyTorch/UxLSTM and run pip install -e .

    Model Training

    The dataset used in this project is derived from the following research paper:

    Jun Ma, Feifei Li, Bo Wang. “U-Mamba: Enhancing Long-range Dependency for Biomedical Image Segmentation.” arXiv preprint arXiv:2401.04722, 2024.

    Download dataset here and put them into the data folder. U-xLSTM is built on the popular nnU-Net framework.

    Preprocessing

    Our data processing approach strictly follows the methods outlined in the U-Mamba study. This includes steps such as data normalization, augmentation techniques, and segmentation algorithms detailed in their publication.

    nnUNetv2_plan_and_preprocess -d DATASET_ID --verify_dataset_integrity

    Format of the training script

    nnUNetv2_train DATASET_ID {dataset_type} {exp_name} -tr {trainer_type} -lr {learning_rate} -bs {batch_size}
    • {dataset_type}: Specifies the type of dataset to be used. There are two options:

      • 2d: For datasets that are 2-dimensional.
      • 3d_fullres: For full-resolution 3-dimensional datasets.
    • {exp_name}: Defines the name or identifier for the experiment. It can be:

      • all: Use this option to include all available configurations.
      • An integer: Specify a particular configuration number to use a specific setup.
    • {trainer_type}: Indicates the type of trainer to use for the training process. Options include:

      • nnUNetTrainerUxLSTMBot: A trainer tailored for the UxLSTMBot model.
      • nnUNetTrainerUxLSTMEnc: A trainer designed for the UxLSTMEnc model architecture.
    • {learning_rate}: Specifies the learning rate for the training process. This should be a floating-point number.

    • {batch_size}: Defines the number of samples to process before the model’s internal parameters are updated.

    Train 2D models

    • Train 2D U-xLSTM_Bot model
    nnUNetv2_train DATASET_ID 2d all -tr nnUNetTrainerUxLSTMBot -lr {learning_rate} -bs {batch_size}
    • Train 2D U-xLSTM_Enc model
    nnUNetv2_train DATASET_ID 2d all -tr nnUNetTrainerUxLSTMEnc -lr {learning_rate} -bs {batch_size}

    Train 3D models

    • Train 3D U-xLSTM_Bot model
    nnUNetv2_train DATASET_ID 3d_fullres all -tr nnUNetTrainerUxLSTMBot -lr {learning_rate} -bs {batch_size}
    • Train 3D U-xLSTM_Enc model
    nnUNetv2_train DATASET_ID 3d_fullres all -tr nnUNetTrainerUxLSTMEnc -lr {learning_rate} -bs {batch_size}

    Inference

    • Predict testing cases with U-xLSTM_Bot model
    nnUNetv2_predict -i INPUT_FOLDER -o OUTPUT_FOLDER -d DATASET_ID -c DATASET_TYPE -f all -tr nnUNetTrainerUxLSTMBot --disable_tta
    • Predict testing cases with U-xLSTM_Enc model
    nnUNetv2_predict -i INPUT_FOLDER -o OUTPUT_FOLDER -d DATASET_ID -c DATASET_TYPE -f all -tr nnUNetTrainerUxLSTMEnc --disable_tta

    DATASET_TYPE can be 2d and 3d_fullres for 2D and 3D models, respectively.

    Metric

    • We provide pretrained models that you can download from this link. Please ensure you save them in the pretrained_model folder. Then, run process_weight.py to verify that the weights are correctly placed in the appropriate file path
    python process_weight.py

    We also provide additional shell scripts for evaluating our provided pretrained model.

    bash metric_bot.sh
    bash metric_enc.sh

    If you wish to evaluate your own trained model, be sure to change the -f parameter to the {exp_name} used during training. This could be ‘all’ or a specific integer identifier.

    Citation

    Please cite this work if you find it inspiring or helpful!

    @misc{chen2024xlstmuneteffective2d,
          title={xLSTM-UNet can be an Effective 2D \& 3D Medical Image Segmentation Backbone with Vision-LSTM (ViL) better than its Mamba Counterpart}, 
          author={Tianrun Chen and Chaotao Ding and Lanyun Zhu and Tao Xu and Deyi Ji and Ying Zang and Zejian Li},
          year={2024},
          eprint={2407.01530},
          archivePrefix={arXiv},
          primaryClass={eess.IV},
          url={https://arxiv.org/abs/2407.01530}, 
    }
    

    You are also welcomed to check our Segment Anything Adapter (SAM-Adapter)

    @misc{chen2023sam,
          title={SAM Fails to Segment Anything? -- SAM-Adapter: Adapting SAM in Underperformed Scenes: Camouflage, Shadow, and More}, 
          author={Tianrun Chen and Lanyun Zhu and Chaotao Ding and Runlong Cao and Shangzhan Zhang and Yan Wang and Zejian Li and Lingyun Sun and Papa Mao and Ying Zang},
          year={2023},
          eprint={2304.09148},
          archivePrefix={arXiv},
          primaryClass={cs.CV}
    }
    

    Acknowledgement

    The code is based on Jun Ma, Feifei Li, Bo Wang. “U-Mamba: Enhancing Long-range Dependency for Biomedical Image Segmentation.” arXiv preprint arXiv:2401.04722, 2024.

    Visit original content creator repository https://github.com/tianrun-chen/xLSTM-UNet-PyTorch
  • PyCrowlingo

    PyCrowlingo: Python SDK for Crowlingo APIs

    Here is the official Python client for Crowlingo. Access to all NLP and NLU services that analyze texts regardless of the language.

    Installation

    You can use pip to install the library:

    $ pip install PyCrowlingo

    Alternatively, you can just clone the repository and run the setup.py script:

    $ python setup.py install

    Usage

    First of all, you will need to instantiate a client of Crowlingo. You can do it using your API token:

    from PyCrowlingo import Client
    client = Client('<TOKEN>')

    Or using your account credentials:

    from PyCrowlingo import Client
    client = Client(username='<EMAIL>', password='<PASSWORD>')

    QuickStart

    You can call all the endpoints available on Crowlingo. All of them are detailed with examples on the documentation.

    text = "Est-il recommandé d'utiliser MongoDb pour indexer mes documents ?"
    res = client.languages.detect(text)
    print(res)
    # => Detect(sentences=[Sentence(start=0, end=65, languages_confidence=[ConfidenceLang(name='French', code='fr', confidence=98.0)], text="Est-il recommandé d'utiliser MongoDb pour indexer mes documents ?")], languages_confidence=[ConfidenceLang(name='French', code='fr', confidence=98.0)])

    The response will be Pydantic object.
    So, you can get the values with the response’s attributes:

    print(client.languages.detect(text).languages_confidence)
    # =>  '[ConfidenceLang(name='French', code='fr', confidence=98.0)]'

    Pipeline

    If you need to analyze texts through different services, it can be cumbersome to call the API for every step of processing.
    Gain some speed and productivity by using a Pipeline. It allows you to create a workflow of processing for your data.
    To do so, you have to use the ApiModels instead of the client function.

    from PyCrowlingo import Pipeline
    from PyCrowlingo.ApiModels import *
    text = "On 26 April 1986, Chernobyl suffered the world’s worst nuclear disaster. An experiment designed to test the safety of the power plant went wrong and caused a fire which spewed radiation for 10 days. Clouds carrying radioactive particles drifted for thousands of miles, releasing toxic rain all over Europe. Those living close to Chernobyl - about 116,000 people - were immediately evacuated. A 30 km exclusion zone was imposed around the damaged reactor. This was later expanded to cover more affected areas."
    pipeline = Pipeline(client, text=text) 
    # Put the client on the pipeline and the common variables using keywords arguments
    pipeline.add(Concepts.Extract, precision=0.9).add(Entities.Extract, visualize=True).add(Entities.Duckling)
    # Add each step using pipeline.add(EndpointModel, *individuals arguments)
    res = pipeline.call()
    # Execute the pipeline
    print(res)
    # => responses={'[POST] /entities/duckling': {'duckling': [{'body': 'On 26 April 1986', 'start': 0, 'value': {'values': [{'value': '1986-04-26T00:00:00.000-08:00', 'grain': 'day', 'type': 'value'}], 'value': '1986-04-26T00:00:00.000-08:00', 'grain': 'day', 'type': 'value'}, 'end': 16, 'dim': 'time', 'latent': False}, {'body': '10 days', 'start': 190, 'value': {'value': 10, 'day': 10, 'type': 'value', 'unit': 'day', 'normalized': {'value': 864000, 'unit': 'second'}}, 'end': 197, 'dim': 'duration', 'latent': False}, {'body': 'thousands', 'start': 249, 'value': {'value': 1000, 'type': 'value'}, 'end': 258, 'dim': 'number', 'latent': False}, {'body': '116,000', 'start': 347, 'value': {'value': 116000, 'type': 'value'}, 'end': 354, 'dim': 'number', 'latent': False}, {'body': 'immediately', 'start': 369, 'value': {'values': [{'value': '2020-05-25T15:57:30.724-07:00', 'grain': 'second', 'type': 'value'}], 'value': '2020-05-25T15:57:30.724-07:00', 'grain': 'second', 'type': 'value'}, 'end': 380, 'dim': 'time', 'latent': False}, {'body': '30 km', 'start': 394, 'value': {'value': 30, 'type': 'value', 'unit': 'kilometre'}, 'end': 399, 'dim': 'distance', 'latent': False}]}, '[POST] /entities/extract': {'entities': [{'start': 3, 'end': 16, 'ent_type': 'DATE', 'text': '26 April 1986'}, {'start': 18, 'end': 27, 'ent_type': 'GPE', 'text': 'Chernobyl'}, {'start': 190, 'end': 197, 'ent_type': 'DATE', 'text': '10 days'}, {'start': 249, 'end': 267, 'ent_type': 'QUANTITY', 'text': 'thousands of miles'}, {'start': 299, 'end': 305, 'ent_type': 'LOC', 'text': 'Europe'}, {'start': 329, 'end': 338, 'ent_type': 'GPE', 'text': 'Chernobyl'}, {'start': 341, 'end': 354, 'ent_type': 'CARDINAL', 'text': 'about 116,000'}, {'start': 394, 'end': 399, 'ent_type': 'QUANTITY', 'text': '30 km'}], 'visualization': '<div class="entities" style="line-height: 2.5; direction: ltr">On \n<mark class="entity" style="background: #bfe1d9; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;">\n    26 April 1986\n    <span style="font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; text-transform: uppercase; vertical-align: middle; margin-left: 0.5rem">DATE</span>\n</mark>\n, \n<mark class="entity" style="background: #feca74; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;">\n    Chernobyl\n    <span style="font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; text-transform: uppercase; vertical-align: middle; margin-left: 0.5rem">GPE</span>\n</mark>\n suffered the world’s worst nuclear disaster. An experiment designed to test the safety of the power plant went wrong and caused a fire which spewed radiation for \n<mark class="entity" style="background: #bfe1d9; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;">\n    10 days\n    <span style="font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; text-transform: uppercase; vertical-align: middle; margin-left: 0.5rem">DATE</span>\n</mark>\n. Clouds carrying radioactive particles drifted for \n<mark class="entity" style="background: #e4e7d2; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;">\n    thousands of miles\n    <span style="font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; text-transform: uppercase; vertical-align: middle; margin-left: 0.5rem">QUANTITY</span>\n</mark>\n, releasing toxic rain all over \n<mark class="entity" style="background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;">\n    Europe\n    <span style="font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; text-transform: uppercase; vertical-align: middle; margin-left: 0.5rem">LOC</span>\n</mark>\n. Those living close to \n<mark class="entity" style="background: #feca74; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;">\n    Chernobyl\n    <span style="font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; text-transform: uppercase; vertical-align: middle; margin-left: 0.5rem">GPE</span>\n</mark>\n - \n<mark class="entity" style="background: #e4e7d2; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;">\n    about 116,000\n    <span style="font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; text-transform: uppercase; vertical-align: middle; margin-left: 0.5rem">CARDINAL</span>\n</mark>\n people - were immediately evacuated. A \n<mark class="entity" style="background: #e4e7d2; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;">\n    30 km\n    <span style="font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; text-transform: uppercase; vertical-align: middle; margin-left: 0.5rem">QUANTITY</span>\n</mark>\n exclusion zone was imposed around the damaged reactor. This was later expanded to cover more affected areas.</div>'}, '[POST] /concepts/extract': {'concepts': [{'id': 'Q129677', 'weight': 0.19254024269693001, 'labels': [{'text': 'Chernobyl', 'mentions': [{'start': 18, 'end': 27}, {'start': 329, 'end': 338}]}]}, {'id': 'Q11448', 'weight': 0.13384788867053848, 'labels': [{'text': 'radioactive', 'mentions': [{'start': 215, 'end': 226}]}, {'text': 'radiation', 'mentions': [{'start': 176, 'end': 185}]}]}, {'id': 'Q46', 'weight': 0.11258210752213413, 'labels': [{'text': 'Europe', 'mentions': [{'start': 299, 'end': 305}]}]}, {'id': 'Q274160', 'weight': 0.07002172766602058, 'labels': [{'text': 'toxic', 'mentions': [{'start': 279, 'end': 284}]}]}, {'id': 'Q7925', 'weight': 0.06886892370214791, 'labels': [{'text': 'rain', 'mentions': [{'start': 285, 'end': 289}]}]}, {'id': 'Q101965', 'weight': 0.06562043143894636, 'labels': [{'text': 'experiment', 'mentions': [{'start': 76, 'end': 86}]}]}, {'id': 'Q3196', 'weight': 0.06482017292518794, 'labels': [{'text': 'fire', 'mentions': [{'start': 158, 'end': 162}]}]}, {'id': 'Q356936', 'weight': 0.06390318225879862, 'labels': [{'text': 'exclusion zone', 'mentions': [{'start': 400, 'end': 414}]}]}, {'id': 'Q486', 'weight': 0.06317545950269358, 'labels': [{'text': 'nuclear disaster', 'mentions': [{'start': 55, 'end': 71}]}, {'text': 'disaster', 'mentions': []}]}, {'id': 'Q11369', 'weight': 0.057931103203040506, 'labels': [{'text': 'particles', 'mentions': [{'start': 227, 'end': 236}]}]}, {'id': 'Q8074', 'weight': 0.05530684102502764, 'labels': [{'text': 'Clouds', 'mentions': [{'start': 199, 'end': 205}]}]}, {'id': 'Q11573', 'weight': 0.05138191938853427, 'labels': [{'text': 'km', 'mentions': [{'start': 397, 'end': 399}]}]}]}}
    print(res.responses[Entities.Extract.eid()])
    # => {'entities': [{'start': 3, 'end': 16, 'ent_type': 'DATE', 'text': '26 April 1986'}, {'start': 18, 'end': 27, 'ent_type': 'GPE', 'text': 'Chernobyl'}, {'start': 190, 'end': 197, 'ent_type': 'DATE', 'text': '10 days'}, {'start': 249, 'end': 267, 'ent_type': 'QUANTITY', 'text': 'thousands of miles'}, {'start': 299, 'end': 305, 'ent_type': 'LOC', 'text': 'Europe'}, {'start': 329, 'end': 338, 'ent_type': 'GPE', 'text': 'Chernobyl'}, {'start': 341, 'end': 354, 'ent_type': 'CARDINAL', 'text': 'about 116,000'}, {'start': 394, 'end': 399, 'ent_type': 'QUANTITY', 'text': '30 km'}], 'visualization': '<div class="entities" style="line-height: 2.5; direction: ltr">On \n<mark class="entity" style="background: #bfe1d9; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;">\n    26 April 1986\n    <span style="font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; text-transform: uppercase; vertical-align: middle; margin-left: 0.5rem">DATE</span>\n</mark>\n, \n<mark class="entity" style="background: #feca74; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;">\n    Chernobyl\n    <span style="font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; text-transform: uppercase; vertical-align: middle; margin-left: 0.5rem">GPE</span>\n</mark>\n suffered the world’s worst nuclear disaster. An experiment designed to test the safety of the power plant went wrong and caused a fire which spewed radiation for \n<mark class="entity" style="background: #bfe1d9; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;">\n    10 days\n    <span style="font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; text-transform: uppercase; vertical-align: middle; margin-left: 0.5rem">DATE</span>\n</mark>\n. Clouds carrying radioactive particles drifted for \n<mark class="entity" style="background: #e4e7d2; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;">\n    thousands of miles\n    <span style="font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; text-transform: uppercase; vertical-align: middle; margin-left: 0.5rem">QUANTITY</span>\n</mark>\n, releasing toxic rain all over \n<mark class="entity" style="background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;">\n    Europe\n    <span style="font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; text-transform: uppercase; vertical-align: middle; margin-left: 0.5rem">LOC</span>\n</mark>\n. Those living close to \n<mark class="entity" style="background: #feca74; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;">\n    Chernobyl\n    <span style="font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; text-transform: uppercase; vertical-align: middle; margin-left: 0.5rem">GPE</span>\n</mark>\n - \n<mark class="entity" style="background: #e4e7d2; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;">\n    about 116,000\n    <span style="font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; text-transform: uppercase; vertical-align: middle; margin-left: 0.5rem">CARDINAL</span>\n</mark>\n people - were immediately evacuated. A \n<mark class="entity" style="background: #e4e7d2; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;">\n    30 km\n    <span style="font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; text-transform: uppercase; vertical-align: middle; margin-left: 0.5rem">QUANTITY</span>\n</mark>\n exclusion zone was imposed around the damaged reactor. This was later expanded to cover more affected areas.</div>'}
    
    # EndpointModel.ied() returns the id of endpoint which is used in the response 

    Bulk Request

    Most of the time, you will need to apply this process on a dataset. Again, you will gain speed by using bulk request. It allows to perform many operations in the same time.
    Here is an example on how to do it:

    from PyCrowlingo import Bulk, Pipeline
    from PyCrowlingo.ApiModels import *
    text = "Est-il recommandé d'utiliser MongoDb pour indexer mes documents ?"
    pipelines = [Pipeline().add(Languages.Detect, text=text)] * 300
    res = Bulk(client, pipelines).call()
    assert len(res.responses) == 300 # True

    You can also do it in an iterative way:

    from PyCrowlingo import Bulk, Pipeline
    from PyCrowlingo.ApiModels import *
    text = "Est-il recommandé d'utiliser MongoDb pour indexer mes documents ?"
    bulk = Bulk(client)
    for i in range(300):
        bulk.add(Pipeline().add(Languages.Detect, text=text))
    res = bulk.call()
    assert len(res.responses) == 300 # True

    Using a bulk will automatically make API requests using batch (you can controle its size using batch_size argument). So that, you don’t have to worry about the management of the query size.

    Errors

    Sometimes, you may face error when you call an endpoint. Every errors are identifiable by their ID.
    It can be easily managed on a pythonic way:

    from PyCrowlingo.Errors import ModelNotFound, CrowlingoException
    
    model_id = "AskUbuntu"
    try:
        client.classifier.clear_model(model_id)
    except ModelNotFound:
        client.classifier.create_model(model_id)
    except CrowlingoException as e:
        print(e)

    Here is the list of available exceptions:

    Class Error ID Status code Description
    TrainingError TRAINING_ERROR 400 An error happened during the training
    TokenNotFound TOKEN_NOT_FOUND 401 Token not found. Insert your token in the query parameter with api_key=[YOUR_TOKEN] or in the headers with x-api-key:[YOUR TOKEN].
    BadCredentials BAD_CREDENTIALS 401 Could not validate credentials. Their might be an error in your token or email/password. Maybe your account has been disabled. Please contact us if you do not understand the reason.
    TestModelForbidden TEST_MODEL_FORBIDDEN 403 You do not have access to the test version of this model. Ask the access to the owner of the model or use the prod version of this model.
    BadModelsPerms BAD_MODELS_PERMS 403 You do not have the permissions to perform this action on this model. Ask for the owner of this model to provides you more rights.
    BadModelCategory BAD_MODEL_CATEGORY 404 This model cannot be use for this kind of request. Create a new model or use another endpoint.
    ModelNotDeployed MODEL_NOT_DEPLOYED 404 This model is not deployed. Use the test model or deploy it first.
    CollaboratorNotFound COLLABORATOR_NOT_FOUND 404 This collaborator was not found. Maybe it has already delete the model or you did not add it as collaborator on this model.
    ModelNotFound MODEL_NOT_FOUND 404 We cannot find a model with this id. You have to create a model before using it.
    DocumentNotFound DOCUMENT_NOT_FOUND 404 We cannot find a document with this id. You have to create a document before using it.
    DuplicateModelId DUPLICATE_MODEL_ID 409 You already have a model with this id, please delete the model first if you want to overwrite it or use the endpoint update to create a new version of this model.
    ContentLengthRequired CONTENT_LENGTH_REQUIRED 411 You need to provide a content length header for POST and PATCH requests.
    RequestEntityTooLarge REQUEST_ENTITY_TOO_LARGE 413 The payload of your body is too large. Try to split your request with smaller payload.
    BadParametersQuery BAD_PARAMETERS_QUERY 422 The parameters of the query do not correspond to the documentation description. The query cannot be processed.
    ModelNotTrained MODEL_NOT_TRAINED 423 This model is not trained yet. You have to wait until it is trained or run the training before performing this action.
    MinuteLimitReached MINUTE_LIMIT_REACHED 429 Minute limit reached, wait the number of seconds indicated by the header: x-minute-reset or change subscription plan.
    PeriodLimitReached PERIOD_LIMIT_REACHED 429 Period limit reached, wait the number of seconds indicated by the header: x-period-reset or change subscription plan.
    ModelsLimitReached MODELS_LIMIT_REACHED 429 You have reached the maximal number of custom models. If you want to create a new one, you have to delete one of your custom models first or change your subscription plan.
    InternalError INTERNAL_ERROR 500 Internal Error, we have been notified and will fix the problem as soon as possible. Try again later and do not hesitate to contact us if you need help.

    Upload Data

    If you want to build custom models, you will have to upload your dataset. You can do it automatically on a CSV by using the function classifier.upload_documents.

    client.classifier.upload_csv(model_id, "data.csv", fieldnames=["text", "class_id"], delimiter="\t")

    It will split the dataset in several parts to avoid exceed the payload size limit.
    If you have a more specific dataset format, you can do it by using the functions listed on the API documentation.

    Wait for asynchronous actions

    Some functions of Crowlingo might be long, so they are asynchronous. that means it will send you a response before the end of the process. For each one, you have a function to watch the progression and wait until the end of the task.
    Here are the functions to wait for each task:

    Async Function Wait Function
    client.model.train client.model.wait_training
    client.model.deploy client.model.wait_deploying
    client.search_engine.create_documents client.search_engine.wait_indexing

    For example, use these lines to train, and wait until the model is deployed:

    client.model.train(model_id)
    client.model.wait_training(model_id)
    client.model.deploy(model_id)
    client.model.wait_deploying(model_id)

    Rasa

    Crowlingo services can be very useful to create a polyglot chatbot using an existing one. The easiest way is to do it through Rasa.
    PyCrowlingo provides packages to easily integrate on Rasa.

    Installation

    To install rasa dependencies, simply enter the following command:

    pip install PyCrowlingo[rasa]

    Follow the Rasa quick start guide to build your chatbot.

    Usage

    Open the file config.yml and modify the pipeline to integrate Crowlingo NLU components.

    Here is an example of a chatbot created with Rasa quick start guide:

    language: en
    pipeline:
      - name: PyCrowlingo.Rasa.EntitiesExtractor
        token: "<TOKEN>"
      - name: PyCrowlingo.Rasa.IntentClassifier
        token: "<TOKEN>"
        model_id: "intent_rasa"

    Train the model:

    rasa train

    And now, enjoy your multilingual chatbot:

    rasa shell
    >>> Your input -> Bonjour !
    <<< Hey! How are you ?
    >>> Your input -> Va bene :)
    <<< Great! Carry on!
    >>> Your input -> Bist du ein Roboter oder ein Mensch?
    <<< I am a bot powered by Rasa   

    Visit original content creator repository
    https://github.com/Crowlingo/PyCrowlingo