Author: n6rloxhpftd7

  • FluidCollections

    FluidCollections

    All programs manage changing data, but most languages and libraries don’t have a consistent way to model the relationships between and among differing collections of this data. Coordinating updates across an entire program can be a nightmare with standard collections, and the logic is often clouded by loops, locking, synchronization logic, and constant state-checking. And even if one manages to program all of this correctly, the data still must be reorganized into an ObservableCollection or equivalent to display on the UI. Managing data like this is possible with a simple, single threaded program, but throw in some multi-threaded, parallel, and asynchronous logic into your program and this quickly becomes an unworkable nightmare. If any of this sounds familiar (and even if it doesn’t), Fluid Collections are for you!

    In short, Fluid Collections allow you to specify the relationships between your data, and the library makes it happen auto-magically. This is the same idea as the Reactive Extensions for .NET, but applied to collections instead of sequences. If you don’t know much about reactive extensions, don’t worry! It’s definitely possible to use this library without knowing too much about Rx, but a working knowledge certainly helps. This library defines certain reactive collections that are extremely simple, easy to use, and just seem to flow together (and hence the name).

    The ReactiveSet

    The ReactiveSet<T> is the basic unit of FluidCollections, and right now the only reactive collection (A ReactiveDictionary<T1,T2> is in the works). Here is a demo of a basic use case:

    ReactiveSet<int> set1 = new ReactiveSet<int>();
    ReactiveSet<int> set2 = new ReactiveSet<int>();
    
    IReactiveSet<int> union = set1.Union(set2).Where(x => x > 3);
    
    set1.Add(2);
    set1.Add(3);
    
    set2.Add(3);
    set2.Add(4);
    
    Console.WriteLine(union.Contains(2)); // False
    Console.WriteLine(union.Contains(4)); // True

    To start with, we define two reactive sets. These function with the same rules as normal sets (no duplicates, no order), but with a reactive twist. When the union set is defined, some linq-like operations are used to compose the two original sets, and this composition yields a new ReactiveSet. Here’s the reactive part: no matter what happens to the original sets, the new union set will always reflect the result of the union operation, followed by the filter; no syncing required! Notice that the union set updates after it is defined, in stark contrast to normal collections.

    Operations

    FluidCollections was designed with linq and rx in mind, so most of these operations should feel very familiar. Each operation produces a new reactive set that automatically updates itself with the changes that occur in the parent set(s). I haven’t listed all the operations below, so I encourage you to explore the library yourself!

    Set operations

    Reactive sets are… well sets. So naturally, standard set operations are allowed

    set1.Union(set2);
    set1.Intersection(set2);
    set1.Except(set2);
    set1.SymmetricExcept(set2);

    Select/Where

    Just like linq and rx, you can transform and filter reactive sets

    set1.Where(x => x <= 9);
    set1.Select(x => x + 75);

    Aggregate and friends

    Aggregate on reactive sets is similar to that of linq, but with one major exception: The aggregate for reactive sets is a running total, not an instantaneous total. As such, it returns an IObservable of the result. Aggregate essentially converts the changes from a reactive set into a running total by using the supplied add function or remove function, depending on the type of update. After updating the total, the new result is pushed to the IObservable

    // ReactiveSet<T>.Aggregate(seed, addFunction, removeFunction)
    IObservable<int> sum = set1.Aggregate(0, (total, item) => total + item, (total, item) => total - item);
    
    // Implemented with aggregate
    IObservable<int> realSum = set1.Sum();
    IObservable<int> product = set1.Product();
    IObservable<int> count = set1.Count();
    IObservable<IImmutableSet<int>> sets = set1.ToImmutableSets();

    ToReactiveSet

    After a chain of other non-buffering operations, use ToReactiveSet() to buffer the result into an internal collection that can be traversed. (See variants for more info)

    // Set3 is non-buffering. No count property. Also can't enumerate the elements
    IReactiveSet<int> set3 = set1.Intersection(set2).Where(x => x > 4);
    
    // This stores all the resulting elements in an internal set, and so is a bit more concrete
    ICollectedReactiveSet<int> bufferedSet3 = set3.ToReactiveSet();
    
    // Instantaneous count property
    Console.WriteLine(bufferedSet3.Count);
    
    // Can traverse the elements currently in the set
    // Since the set is reactive, both the elements and the count can unpredictably change
    foreach (int num in bufferedSet3.AsEnumerable()) {
        Console.WriteLine(num);
    }

    OrderBy

    OrderBy buffers a reactive set into an ordered reactive set (see below), using either the default comparer or a provided property to sort on.

    IOrderedReactiveSet<int> set4 = set1.OrderBy(x => x /* Normally a useful property */);
    
    Console.WriteLine(set4.Min);
    Console.WriteLine(set4.Max);
    
    // Indexing works!
    Console.WriteLine(set4.IndexOf(4));
    Console.WriteLine(set4[2]);

    ReactiveSet Variants

    • ReactiveSet<T> – The most basic reactive set, is used for the “source” for more dependent reactive sets. Is mutable, and supports additions and removals

    • IReactiveSet<T> – This represents a non-buffered reactive set, meaning that the elements are not stored in an underlying collection. The benefit is that it uses almost no additional memory, making it very efficient. Think of it as the IEnumerable of FluidCollections. Most extension methods return an IReactiveSet, and it is not directly modifiable. Despite not buffering elements, there is a contains method.

    • ICollectedReactiveSet<T> – Think of this as the ICollection of FluidCollections. This is the same as a normal reactive set, but there is a count property as well as an AsEnumerable() method that lets you traverse the elements directly. It is buffered and stores a copy of the elements in its own internal set. This is usually the end result of a chain of operations performed on another reactive set so you can actually use the set with other code.

    • IOrderedReactiveSet<T> – This type of reactive set is both sorted and indexed, and provides appropriate members accordingly. All operations are performed in O(log n) time, including indexing. Because of this, an ordered reactive set implements INotifyCollectionChanged, making it perfect for UI binding! (for those interested, this is implemented with a custom weight-balanced order statistic tree).

    Contributing

    This project is just in its infancy, and I’m not attached to particular API’s, classes, or methods. Right now, I simply want to make the library as good as it can get, and backwards compatibly can come later. So I encourage you, contribute! There is so much that can be done with this library that I won’t have time to implement, and I’d like to hear any suggestions for improvements you have. Going forward, I’d like to build this project into a one-stop-shop for reactive collections, while at the same time keeping it:

    • Easy to use. Knowing linq should be enough to “dot in” and figure out how to use nearly all of the operations.
    • Performant, but not at the expense of safety. Speed is always a bonus, but I also want the operations to have a certain plug-and-play feel that comes with linq.
    • Intuitive. The name of the project is “fluid” after all, and the updates should Just Happen™ without knowledge of the inner workings.

    I’ve tried to achieve these goals with the current version, and if anybody out there want to help build this library, send over a pull request! (I won’t bite)

    Acknowledgments

    Credit where credit is due, and I’m not afraid to admit that I never would have created this project were it not for DynamicData. DynamicData really is a great piece of engineering. When I first discovered it, I was hooked and tried to convert some of my personal project to observable lists and caches. However, upon doing so I realized that indexed lists were not always ideal for my situations, and caches sometimes were cumbersome. I began brainstorming, and soon realized that unordered sets were ideal for update notifications, and that reordering can be accomplished with trees. Implementing my set idea became a challenge, and this project was the result. So to DyamicData I say thank you for making me see collections in an entirely different light.

    Visit original content creator repository

  • princess

                      GNU LESSER GENERAL PUBLIC LICENSE
                           Version 2.1, February 1999
    
     Copyright (C) 1991, 1999 Free Software Foundation, Inc.
     51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
     Everyone is permitted to copy and distribute verbatim copies
     of this license document, but changing it is not allowed.
    
    [This is the first released version of the Lesser GPL.  It also counts
     as the successor of the GNU Library Public License, version 2, hence
     the version number 2.1.]
    
                                Preamble
    
      The licenses for most software are designed to take away your
    freedom to share and change it.  By contrast, the GNU General Public
    Licenses are intended to guarantee your freedom to share and change
    free software--to make sure the software is free for all its users.
    
      This license, the Lesser General Public License, applies to some
    specially designated software packages--typically libraries--of the
    Free Software Foundation and other authors who decide to use it.  You
    can use it too, but we suggest you first think carefully about whether
    this license or the ordinary General Public License is the better
    strategy to use in any particular case, based on the explanations below.
    
      When we speak of free software, we are referring to freedom of use,
    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 this service if you wish); that you receive source code or can get
    it if you want it; that you can change the software and use pieces of
    it in new free programs; and that you are informed that you can do
    these things.
    
      To protect your rights, we need to make restrictions that forbid
    distributors to deny you these rights or to ask you to surrender these
    rights.  These restrictions translate to certain responsibilities for
    you if you distribute copies of the library or if you modify it.
    
      For example, if you distribute copies of the library, whether gratis
    or for a fee, you must give the recipients all the rights that we gave
    you.  You must make sure that they, too, receive or can get the source
    code.  If you link other code with the library, you must provide
    complete object files to the recipients, so that they can relink them
    with the library after making changes to the library and recompiling
    it.  And you must show them these terms so they know their rights.
    
      We protect your rights with a two-step method: (1) we copyright the
    library, and (2) we offer you this license, which gives you legal
    permission to copy, distribute and/or modify the library.
    
      To protect each distributor, we want to make it very clear that
    there is no warranty for the free library.  Also, if the library is
    modified by someone else and passed on, the recipients should know
    that what they have is not the original version, so that the original
    author's reputation will not be affected by problems that might be
    introduced by others.
    
      Finally, software patents pose a constant threat to the existence of
    any free program.  We wish to make sure that a company cannot
    effectively restrict the users of a free program by obtaining a
    restrictive license from a patent holder.  Therefore, we insist that
    any patent license obtained for a version of the library must be
    consistent with the full freedom of use specified in this license.
    
      Most GNU software, including some libraries, is covered by the
    ordinary GNU General Public License.  This license, the GNU Lesser
    General Public License, applies to certain designated libraries, and
    is quite different from the ordinary General Public License.  We use
    this license for certain libraries in order to permit linking those
    libraries into non-free programs.
    
      When a program is linked with a library, whether statically or using
    a shared library, the combination of the two is legally speaking a
    combined work, a derivative of the original library.  The ordinary
    General Public License therefore permits such linking only if the
    entire combination fits its criteria of freedom.  The Lesser General
    Public License permits more lax criteria for linking other code with
    the library.
    
      We call this license the "Lesser" General Public License because it
    does Less to protect the user's freedom than the ordinary General
    Public License.  It also provides other free software developers Less
    of an advantage over competing non-free programs.  These disadvantages
    are the reason we use the ordinary General Public License for many
    libraries.  However, the Lesser license provides advantages in certain
    special circumstances.
    
      For example, on rare occasions, there may be a special need to
    encourage the widest possible use of a certain library, so that it becomes
    a de-facto standard.  To achieve this, non-free programs must be
    allowed to use the library.  A more frequent case is that a free
    library does the same job as widely used non-free libraries.  In this
    case, there is little to gain by limiting the free library to free
    software only, so we use the Lesser General Public License.
    
      In other cases, permission to use a particular library in non-free
    programs enables a greater number of people to use a large body of
    free software.  For example, permission to use the GNU C Library in
    non-free programs enables many more people to use the whole GNU
    operating system, as well as its variant, the GNU/Linux operating
    system.
    
      Although the Lesser General Public License is Less protective of the
    users' freedom, it does ensure that the user of a program that is
    linked with the Library has the freedom and the wherewithal to run
    that program using a modified version of the Library.
    
      The precise terms and conditions for copying, distribution and
    modification follow.  Pay close attention to the difference between a
    "work based on the library" and a "work that uses the library".  The
    former contains code derived from the library, whereas the latter must
    be combined with the library in order to run.
    
                      GNU LESSER GENERAL PUBLIC LICENSE
       TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
    
      0. This License Agreement applies to any software library or other
    program which contains a notice placed by the copyright holder or
    other authorized party saying it may be distributed under the terms of
    this Lesser General Public License (also called "this License").
    Each licensee is addressed as "you".
    
      A "library" means a collection of software functions and/or data
    prepared so as to be conveniently linked with application programs
    (which use some of those functions and data) to form executables.
    
      The "Library", below, refers to any such software library or work
    which has been distributed under these terms.  A "work based on the
    Library" means either the Library or any derivative work under
    copyright law: that is to say, a work containing the Library or a
    portion of it, either verbatim or with modifications and/or translated
    straightforwardly into another language.  (Hereinafter, translation is
    included without limitation in the term "modification".)
    
      "Source code" for a work means the preferred form of the work for
    making modifications to it.  For a library, complete source code means
    all the source code for all modules it contains, plus any associated
    interface definition files, plus the scripts used to control compilation
    and installation of the library.
    
      Activities other than copying, distribution and modification are not
    covered by this License; they are outside its scope.  The act of
    running a program using the Library is not restricted, and output from
    such a program is covered only if its contents constitute a work based
    on the Library (independent of the use of the Library in a tool for
    writing it).  Whether that is true depends on what the Library does
    and what the program that uses the Library does.
    
      1. You may copy and distribute verbatim copies of the Library's
    complete source code as you receive it, in any medium, provided that
    you conspicuously and appropriately publish on each copy an
    appropriate copyright notice and disclaimer of warranty; keep intact
    all the notices that refer to this License and to the absence of any
    warranty; and distribute a copy of this License along with the
    Library.
    
      You may charge a fee for the physical act of transferring a copy,
    and you may at your option offer warranty protection in exchange for a
    fee.
    
      2. You may modify your copy or copies of the Library or any portion
    of it, thus forming a work based on the Library, and copy and
    distribute such modifications or work under the terms of Section 1
    above, provided that you also meet all of these conditions:
    
        a) The modified work must itself be a software library.
    
        b) You must cause the files modified to carry prominent notices
        stating that you changed the files and the date of any change.
    
        c) You must cause the whole of the work to be licensed at no
        charge to all third parties under the terms of this License.
    
        d) If a facility in the modified Library refers to a function or a
        table of data to be supplied by an application program that uses
        the facility, other than as an argument passed when the facility
        is invoked, then you must make a good faith effort to ensure that,
        in the event an application does not supply such function or
        table, the facility still operates, and performs whatever part of
        its purpose remains meaningful.
    
        (For example, a function in a library to compute square roots has
        a purpose that is entirely well-defined independent of the
        application.  Therefore, Subsection 2d requires that any
        application-supplied function or table used by this function must
        be optional: if the application does not supply it, the square
        root function must still compute square roots.)
    
    These requirements apply to the modified work as a whole.  If
    identifiable sections of that work are not derived from the Library,
    and can be reasonably considered independent and separate works in
    themselves, then this License, and its terms, do not apply to those
    sections when you distribute them as separate works.  But when you
    distribute the same sections as part of a whole which is a work based
    on the Library, the distribution of the whole must be on the terms of
    this License, whose permissions for other licensees extend to the
    entire whole, and thus to each and every part regardless of who wrote
    it.
    
    Thus, it is not the intent of this section to claim rights or contest
    your rights to work written entirely by you; rather, the intent is to
    exercise the right to control the distribution of derivative or
    collective works based on the Library.
    
    In addition, mere aggregation of another work not based on the Library
    with the Library (or with a work based on the Library) on a volume of
    a storage or distribution medium does not bring the other work under
    the scope of this License.
    
      3. You may opt to apply the terms of the ordinary GNU General Public
    License instead of this License to a given copy of the Library.  To do
    this, you must alter all the notices that refer to this License, so
    that they refer to the ordinary GNU General Public License, version 2,
    instead of to this License.  (If a newer version than version 2 of the
    ordinary GNU General Public License has appeared, then you can specify
    that version instead if you wish.)  Do not make any other change in
    these notices.
    
      Once this change is made in a given copy, it is irreversible for
    that copy, so the ordinary GNU General Public License applies to all
    subsequent copies and derivative works made from that copy.
    
      This option is useful when you wish to copy part of the code of
    the Library into a program that is not a library.
    
      4. You may copy and distribute the Library (or a portion or
    derivative of it, under Section 2) in object code or executable form
    under the terms of Sections 1 and 2 above provided that you accompany
    it with the complete corresponding machine-readable source code, which
    must be distributed under the terms of Sections 1 and 2 above on a
    medium customarily used for software interchange.
    
      If distribution of object code is made by offering access to copy
    from a designated place, then offering equivalent access to copy the
    source code from the same place satisfies the requirement to
    distribute the source code, even though third parties are not
    compelled to copy the source along with the object code.
    
      5. A program that contains no derivative of any portion of the
    Library, but is designed to work with the Library by being compiled or
    linked with it, is called a "work that uses the Library".  Such a
    work, in isolation, is not a derivative work of the Library, and
    therefore falls outside the scope of this License.
    
      However, linking a "work that uses the Library" with the Library
    creates an executable that is a derivative of the Library (because it
    contains portions of the Library), rather than a "work that uses the
    library".  The executable is therefore covered by this License.
    Section 6 states terms for distribution of such executables.
    
      When a "work that uses the Library" uses material from a header file
    that is part of the Library, the object code for the work may be a
    derivative work of the Library even though the source code is not.
    Whether this is true is especially significant if the work can be
    linked without the Library, or if the work is itself a library.  The
    threshold for this to be true is not precisely defined by law.
    
      If such an object file uses only numerical parameters, data
    structure layouts and accessors, and small macros and small inline
    functions (ten lines or less in length), then the use of the object
    file is unrestricted, regardless of whether it is legally a derivative
    work.  (Executables containing this object code plus portions of the
    Library will still fall under Section 6.)
    
      Otherwise, if the work is a derivative of the Library, you may
    distribute the object code for the work under the terms of Section 6.
    Any executables containing that work also fall under Section 6,
    whether or not they are linked directly with the Library itself.
    
      6. As an exception to the Sections above, you may also combine or
    link a "work that uses the Library" with the Library to produce a
    work containing portions of the Library, and distribute that work
    under terms of your choice, provided that the terms permit
    modification of the work for the customer's own use and reverse
    engineering for debugging such modifications.
    
      You must give prominent notice with each copy of the work that the
    Library is used in it and that the Library and its use are covered by
    this License.  You must supply a copy of this License.  If the work
    during execution displays copyright notices, you must include the
    copyright notice for the Library among them, as well as a reference
    directing the user to the copy of this License.  Also, you must do one
    of these things:
    
        a) Accompany the work with the complete corresponding
        machine-readable source code for the Library including whatever
        changes were used in the work (which must be distributed under
        Sections 1 and 2 above); and, if the work is an executable linked
        with the Library, with the complete machine-readable "work that
        uses the Library", as object code and/or source code, so that the
        user can modify the Library and then relink to produce a modified
        executable containing the modified Library.  (It is understood
        that the user who changes the contents of definitions files in the
        Library will not necessarily be able to recompile the application
        to use the modified definitions.)
    
        b) Use a suitable shared library mechanism for linking with the
        Library.  A suitable mechanism is one that (1) uses at run time a
        copy of the library already present on the user's computer system,
        rather than copying library functions into the executable, and (2)
        will operate properly with a modified version of the library, if
        the user installs one, as long as the modified version is
        interface-compatible with the version that the work was made with.
    
        c) Accompany the work with a written offer, valid for at
        least three years, to give the same user the materials
        specified in Subsection 6a, above, for a charge no more
        than the cost of performing this distribution.
    
        d) If distribution of the work is made by offering access to copy
        from a designated place, offer equivalent access to copy the above
        specified materials from the same place.
    
        e) Verify that the user has already received a copy of these
        materials or that you have already sent this user a copy.
    
      For an executable, the required form of the "work that uses the
    Library" must include any data and utility programs needed for
    reproducing the executable from it.  However, as a special exception,
    the materials to be distributed need not include anything that is
    normally distributed (in either source or binary form) with the major
    components (compiler, kernel, and so on) of the operating system on
    which the executable runs, unless that component itself accompanies
    the executable.
    
      It may happen that this requirement contradicts the license
    restrictions of other proprietary libraries that do not normally
    accompany the operating system.  Such a contradiction means you cannot
    use both them and the Library together in an executable that you
    distribute.
    
      7. You may place library facilities that are a work based on the
    Library side-by-side in a single library together with other library
    facilities not covered by this License, and distribute such a combined
    library, provided that the separate distribution of the work based on
    the Library and of the other library facilities is otherwise
    permitted, and provided that you do these two things:
    
        a) Accompany the combined library with a copy of the same work
        based on the Library, uncombined with any other library
        facilities.  This must be distributed under the terms of the
        Sections above.
    
        b) Give prominent notice with the combined library of the fact
        that part of it is a work based on the Library, and explaining
        where to find the accompanying uncombined form of the same work.
    
      8. You may not copy, modify, sublicense, link with, or distribute
    the Library except as expressly provided under this License.  Any
    attempt otherwise to copy, modify, sublicense, link with, or
    distribute the Library is void, and will automatically terminate your
    rights under this License.  However, parties who have received copies,
    or rights, from you under this License will not have their licenses
    terminated so long as such parties remain in full compliance.
    
      9. You are not required to accept this License, since you have not
    signed it.  However, nothing else grants you permission to modify or
    distribute the Library or its derivative works.  These actions are
    prohibited by law if you do not accept this License.  Therefore, by
    modifying or distributing the Library (or any work based on the
    Library), you indicate your acceptance of this License to do so, and
    all its terms and conditions for copying, distributing or modifying
    the Library or works based on it.
    
      10. Each time you redistribute the Library (or any work based on the
    Library), the recipient automatically receives a license from the
    original licensor to copy, distribute, link with or modify the Library
    subject to these terms and conditions.  You may not impose any further
    restrictions on the recipients' exercise of the rights granted herein.
    You are not responsible for enforcing compliance by third parties with
    this License.
    
      11. If, as a consequence of a court judgment or allegation of patent
    infringement or for any other reason (not limited to patent issues),
    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
    distribute so as to satisfy simultaneously your obligations under this
    License and any other pertinent obligations, then as a consequence you
    may not distribute the Library at all.  For example, if a patent
    license would not permit royalty-free redistribution of the Library by
    all those who receive copies directly or indirectly through you, then
    the only way you could satisfy both it and this License would be to
    refrain entirely from distribution of the Library.
    
    If any portion of this section is held invalid or unenforceable under any
    particular circumstance, the balance of the section is intended to apply,
    and the section as a whole is intended to apply in other circumstances.
    
    It is not the purpose of this section to induce you to infringe any
    patents or other property right claims or to contest validity of any
    such claims; this section has the sole purpose of protecting the
    integrity of the free software distribution system which is
    implemented by public license practices.  Many people have made
    generous contributions to the wide range of software distributed
    through that system in reliance on consistent application of that
    system; it is up to the author/donor to decide if he or she is willing
    to distribute software through any other system and a licensee cannot
    impose that choice.
    
    This section is intended to make thoroughly clear what is believed to
    be a consequence of the rest of this License.
    
      12. If the distribution and/or use of the Library is restricted in
    certain countries either by patents or by copyrighted interfaces, the
    original copyright holder who places the Library under this License may add
    an explicit geographical distribution limitation excluding those countries,
    so that distribution is permitted only in or among countries not thus
    excluded.  In such case, this License incorporates the limitation as if
    written in the body of this License.
    
      13. The Free Software Foundation may publish revised and/or new
    versions of the Lesser 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 Library
    specifies a version number of this License which applies to it and
    "any later version", you have the option of following the terms and
    conditions either of that version or of any later version published by
    the Free Software Foundation.  If the Library does not specify a
    license version number, you may choose any version ever published by
    the Free Software Foundation.
    
      14. If you wish to incorporate parts of the Library into other free
    programs whose distribution conditions are incompatible with these,
    write to the author to ask for permission.  For software which is
    copyrighted by the Free Software Foundation, write to the Free
    Software Foundation; we sometimes make exceptions for this.  Our
    decision will be guided by the two goals of preserving the free status
    of all derivatives of our free software and of promoting the sharing
    and reuse of software generally.
    
                                NO WARRANTY
    
      15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
    WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
    EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
    OTHER PARTIES PROVIDE THE LIBRARY "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
    LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
    THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
    
      16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
    WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
    AND/OR REDISTRIBUTE THE LIBRARY 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
    LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
    SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
    DAMAGES.
    
                         END OF TERMS AND CONDITIONS
    
               How to Apply These Terms to Your New Libraries
    
      If you develop a new library, and you want it to be of the greatest
    possible use to the public, we recommend making it free software that
    everyone can redistribute and change.  You can do so by permitting
    redistribution under these terms (or, alternatively, under the terms of the
    ordinary General Public License).
    
      To apply these terms, attach the following notices to the library.  It is
    safest to attach them to the start of each source file to most effectively
    convey 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 library's name and a brief idea of what it does.>
        Copyright (C) <year>  <name of author>
    
        This library is free software; you can redistribute it and/or
        modify it under the terms of the GNU Lesser General Public
        License as published by the Free Software Foundation; either
        version 2.1 of the License, or (at your option) any later version.
    
        This library 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
        Lesser General Public License for more details.
    
        You should have received a copy of the GNU Lesser General Public
        License along with this library; if not, write to the Free Software
        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
    
    Also add information on how to contact you by electronic and paper mail.
    
    You should also get your employer (if you work as a programmer) or your
    school, if any, to sign a "copyright disclaimer" for the library, if
    necessary.  Here is a sample; alter the names:
    
      Yoyodyne, Inc., hereby disclaims all copyright interest in the
      library `Frob' (a library for tweaking knobs) written by James Random Hacker.
    
      <signature of Ty Coon>, 1 April 1990
      Ty Coon, President of Vice
    
    That's all there is to it!
    

    Visit original content creator repository

  • robotic-inbox

    Robotic Inbox Status: 💟 End of Life

    🚀 Automatic Release ✅ Dedicated Servers Supported ServerSide ✅ Single Player and P2P Supported

    Table of Contents

    Summary

    A special container that automatically sorts and distributes items to other nearby storage containers.

    💟 This mod has reached End of Life and will not be directly updated to support 7 Days to Die 2.0 or beyond. Because this mod is MIT-Licensed and open-source, it is possible that other modders will keep this concept going in the future.

    Searching NexusMods or 7 Days to Die Mods may lead to discovering other mods either built on top of or inspired by this mod.

    robotic inbox, standard color

    Support

    💟 This mod has reached its end of life and is no longer supported or maintained by Kanaverum (Jonathan Robertson // me). I am instead focused on my own game studio (Calculating Chaos, if curious).

    ❤️ All of my public mods have always been open-source and are MIT-Licensed; please feel free to take some or all of the code to reuse, modify, redistribute, and even rebrand however you like! The code in this project isn’t perfect; as you update, add features, fix bugs, and otherwise improve upon my ideas, please make sure to give yourself credit for the work you do and publish your new version of the mod under your own name 😄 🎉

    Features

    Automatic Item Distribution and Organization

    This container will automatically distribute resources placed within it if they are present in other nearby containers. Resources can be distributed to any container within 5 meters by default (horizontally and vertically), so long as the following conditions are met:

    1. If inbox is locked, target must be locked, and share same password.
    2. If inbox is unlocked, target must also be unlocked.
    3. If inbox is within an LCB, target must also be within that same LCB.
    4. Backpack, vehicle, and storage not placed by a player are ignored.

    Press & hold Action Key to lock it or set a combination.

    This explanation is included in-game as the Robotic Inbox Block Description.

    Dynamic Hints

    ✏️ While any secure or insecure player-placed storage container can be targeted by the Inbox, Writable Storage Containers will describe how the Inbox is interacting with them, making them the recommended type of container to place near an Inbox.

    robotic inbox being repaired

    Repairable Locks (new to v4)

    If someone busts your lock, you can replace the lock simply by repairing it. This will go through the upgrade flow and should appear relatively seamless.

    Or if you break the lock on someone else’s Robotic Inbox (such as a friend no longer logs in), breaking the lock and repairing it will allow you to take ownership of the Inbox and adjust its password, lock state, etc.

    ⚠️ Robotic Inboxes with broken locks will not be able to distribute items again until they’re repaired.

    robotic inbox being repaired

    Multiple Colors (new to v4)

    robotic inboxes with colors (unlit)

    unlit in daylight

    robotic inboxes with colors (lit)

    lit in daylight with a headlamp

    Configuration Options (new to v4)

    You now have a slew of options you can use to fine-tune the experience for yourself and any other players who happen to join your game!

    Command Default Constraints Description Impact
    help roboticinbox N/A N/A Receive help information about the set of commands this mod provides N/A
    ri horizontal-range <int> 5 0 to 128 set how wide (x/z axes) the inbox should scan for storage containers very high
    ri vertical-range <int> 5 -1 to 253 (-1 = bedrock-to-sky) set how high/low (y axis) the inbox should scan for storage containers high
    ri success-notice-time <float> 2.0 0.0 to 10.0 set how long to leave distribution success notice on boxes N/A
    ri blocked-notice-time <float> 3.0 0.0 to 10.0 set how long to leave distribution blocked notice on boxes N/A
    ri base-siphoning-protection <bool> True True or False whether inboxes within claimed land should prevent scanning outside the bounds of their lcb N/A
    ri dm False True or False toggle debug logging mode medium
    ri debug False True or False toggle debug logging mode (same as dm) medium
    • 📝 Settings like horizontal-range and vertical-range will actually update the block description for your players as well, so things remain clear and accurate. Changes made during runtime will even auto-update the block description for all online players, too!
    • 💾 Except for debug, these settings are retained in a file on the host system:
      • Windows: %AppData%\Roaming\7DaysToDie\Saves\MapName\GameName\robotic-inbox.json
      • Linux: ~/.local/.local/share/7DaysToDie/Saves/MapName/GameName/robotic-inbox.json

    Info

    What Happens to Leftovers?

    📦 Any items in the Inbox that are not able to be matched with another container will be left there until you have time to decide which container to store them in.

    How Would I Acquire a Robotic Inbox In-Game?

    🏪 Robotic Inbox can be purchased from a trader as soon as you start the game.

    🛠️ Robotic Inboxes can also be crafted at the Workbench after reading enough about robotics to also craft a Tier 1 Junk Sledge.

    Ingredient Count
    resourceForgedIron 4
    resourceMetalPipe 3
    resourceMechanicalParts 6
    resourceElectricParts 8

    For Hosts/Admins: Performance Considerations

    This mod does a lot, so I would understand if you have any concern around how much load it would add to your server.

    Here are some things I kept in mind as I was designing and tweaking this mod:

    • Container data is already processed server-side in 7 days to die. This means that
      1. adjustments to storage are actually most performant on the server’s end rather than on the client’s end and…
      2. this approach to manipulating container data actually reduces networking calls vs any client-side mod that operates from the players’ ends
    • Container organization is run on each box within range via a concurrent loop. This ensures that as inboxes are scanning and updating your players’ containers, the server can still process other tasks and avoid zombie or crafting lag.

    Setup

    Without proper installation, this mod will not work as expected. Using this guide should help to complete the installation properly.

    If you have trouble getting things working, you can reach out to me for support via Support.

    Environment / EAC / Hosting Requirements

    Environment Compatible Does EAC Need to be Disabled? Who needs to install?
    Dedicated Server Yes no only server
    Peer-to-Peer Hosting Yes only on the host only the host
    Single Player Game Yes Yes self (of course)

    🤔 If you aren’t sure what some of this means, details steps are provided below to walk you through the setup process.

    Map Considerations for Installation or Uninstallation

    • Does adding this mod require a fresh map?
      • No! You can drop this mod into an ongoing map without any trouble.
    • Does removing this mod require a fresh map?
      • Since this mod adds new blocks, removing it from a map could cause some issues: previously placed robotic inbox blocks would now throw exceptions in your logs, at the very least.

    Windows PC (Single Player or Hosting P2P)

    ℹ️ If you plan to host a multiplayer game, only the host PC will need to install this mod. Other players connecting to your session do not need to install anything for this mod to work 😉

    1. 📦 Download the latest release by navigating to this link and clicking the link for robotic-inbox.zip
    2. 📂 Unzip this file to a folder named robotic-inbox by right-clicking it and choosing the Extract All... option (you will find Windows suggests extracting to a new folder named robotic-inbox – this is the option you want to use)
    3. 🕵️ Locate and create your mods folder (if missing): in another Windows Explorer window or tab, paste %APPDATA%\7DaysToDie into your address bar and, double-click your Mods folder to enter it.
      • If no Mods folder is present, you will first need to create it, then enter your Mods folder after that
    4. 🚚 Move your new robotic-inbox folder into your Mods folder by dragging & dropping or cutting/copying & pasting, whichever you prefer
    5. ♻️ Stop the game if it’s currently running, then start the game again without EAC by navigating to your install folder and running 7DaysToDie.exe
      • running from Steam or other launchers usually starts 7 Days up with the 7DaysToDie_EAC.exe program instead, but running 7 Days directly will skip EAC startup

    Critical Reminders

    • ⚠️ it is NECESSARY for the host to run with EAC disabled or the DLL file in this mod will not be able to run
    • 😉 other players DO NOT need to disable EAC in order to connect to your game session, so you don’t need to walk them through these steps
    • 🔑 it is also HIGHLY RECOMMENDED to add a password to your game session
      • while disabling EAC is 100% necessary (for P2P or single player) to run this mod properly, it also allows other players to run any mods they want on their end (which could be used to gain access to admin commands and/or grief you or your other players)
      • please note that dedicated servers do not have this limitation and can have EAC fully enabled; we have setup guides for dedicated servers as well, listed in the next 2 sections: Windows/Linux Installation (Server via FTP from Windows PC) and Linux Server Installation (Server via SSH)

    Windows/Linux Installation (Server via FTP from Windows PC)

    1. 📦 Download the latest release by navigating to this link and clicking the link for robotic-inbox.zip
    2. 📂 Unzip this file to a folder named robotic-inbox by right-clicking it and choosing the Extract All... option (you will find Windows suggests extracting to a new folder named robotic-inbox – this is the option you want to use)
    3. 🕵️ Locate and create your mods folder (if missing):
      • Windows PC or Server: in another window, paste this address into to the address bar: %APPDATA%\7DaysToDie, then enter your Mods folder by double-clicking it. If no Mods folder is present, you will first need to create it, then enter your Mods folder after that
      • FTP: in another window, connect to your server via FTP and navigate to the game folder that should contain your Mods folder (if no Mods folder is present, you will need to create it in the appropriate location), then enter your Mods folder. If you are confused about where your mods folder should go, reach out to your host.
    4. 🚚 Move this new robotic-inbox folder into your Mods folder by dragging & dropping or cutting/copying & pasting, whichever you prefer
    5. ♻️ Restart your server to allow this mod to take effect and monitor your logs to ensure it starts successfully:
      • you can search the logs for the word RoboticInbox; the name of this mod will appear with that phrase and all log lines it produces will be presented with this prefix for quick reference

    Linux Server Installation (Server via SSH)

    1. 🔍 SSH into your server and navigate to the Mods folder on your server
      • if you installed 7 Days to Die with LinuxGSM (which I’d highly recommend), the default mods folder will be under ~/serverfiles/Mods (which you may have to create)
    2. 📦 Download the latest robotic-inbox.zip release from this link with whatever tool you prefer
      • example: wget https://github.com/jonathan-robertson/robotic-inbox/releases/latest/download/robotic-inbox.zip
    3. 📂 Unzip this file to a folder by the same name: unzip robotic-inbox.zip -d robotic-inbox
      • you may need to install unzip if it isn’t already installed: sudo apt-get update && sudo apt-get install unzip
      • once unzipped, you can remove the robotic-inbox download with rm robotic-inbox.zip
    4. ♻️ Restart your server to allow this mod to take effect and monitor your logs to ensure it starts successfully:
      • you can search the logs for the word RoboticInbox; the name of this mod will appear with that phrase and all log lines it produces will be presented with this prefix for quick reference
      • rather than monitoring telnet, I’d recommend viewing the console logs directly because mod and DLL registration happens very early in the startup process and you may miss it if you connect via telnet after this happens
      • you can reference your server config file to identify your logs folder
      • if you installed 7 Days to Die with LinuxGSM, your console log will be under log/console/sdtdserver-console.log
      • I’d highly recommend using less to open this file for a variety of reasons: it’s safe to view active files with, easy to search, and can be automatically tailed/followed by pressing a keyboard shortcut so you can monitor logs in realtime
        • follow: SHIFT+F (use CTRL+C to exit follow mode)
        • exit: q to exit less when not in follow mode
        • search: /RoboticInbox [enter] to enter search mode for the lines that will be produced by this mod; while in search mode, use n to navigate to the next match or SHIFT+n to navigate to the previous match
    Visit original content creator repository
  • mayLCU

    mayLCU

    mayLCU is a C# library that provides a convenient way to interact with the League of Legends Client (LCU) through its HTTP API. It allows you to perform various actions such as making requests, retrieving data, and sending commands to the League Client.

    Usage

    Creating an instance of LCU

    To create an instance of LCU and connect to the League of Legends Client, you can use the provided factory methods:

    • HookRiotClient(): Connects to the Riot Client.
    • HookLeagueClient(): Connects to the League Client.
    • HookLeagueStore(LCU leagueClient): Connects to the League Store.

    Example:

    LCU lcu = LCU.HookLeagueClient();

    Making Requests

    mayLCU provides methods to make HTTP requests to the League of Legends Client API. You can use the following methods:

    • RequestAsync(string uri): Sends an asynchronous GET request to the specified URI and returns the response as a string.
    • RequestAsync(RequestMethod requestMethod, string uri, string payload = ""): Sends an asynchronous HTTP request with the specified method (GET, POST, PUT, DELETE, etc.), URI, and payload. Returns the response as a string.

    Example:

    string response = await lcu.RequestAsync("/lol-summoner/v1/current-summoner");

    Handling Responses

    You can also make requests that return dynamic objects instead of strings. The library provides methods for that purpose:

    • RequestDynamicAsync(string uri): Sends an asynchronous GET request to the specified URI and returns the response as a dynamic object.
    • RequestDynamicAsync(RequestMethod requestMethod, string uri, string payload = ""): Sends an asynchronous HTTP request with the specified method (GET, POST, PUT, DELETE, etc.), URI, and payload. Returns the response as a dynamic object.

    Example:

    dynamic data = await lcu.RequestDynamicAsync("/lol-summoner/v1/current-summoner");
    string summonerName = data.displayName;

    Synchronous Requests

    If you prefer to make synchronous requests instead of asynchronous ones, mayLCU provides equivalent synchronous methods:

    • Request(string uri): Sends a synchronous GET request to the specified URI and returns the response as a string.
    • Request(RequestMethod requestMethod, string uri, string payload = ""): Sends a synchronous HTTP request with the specified method (GET, POST, PUT, DELETE, etc.), URI, and payload. Returns the response as a string.

    Example:

    string response = lcu.Request("/lol-summoner/v1/current-summoner");

    Additional Information

    • IsConnected: Gets a value indicating whether the connection to the League Client is established.
    • Target: Gets the targeted process name (without the “Ux” suffix).

    Examples

    Here are some examples of how you can use mayLCU:

    // Hook League Client
    LCU lcu = LCU.HookLeagueClient();
    
    // Get the current summoner's name
    dynamic data = await lcu.RequestDynamicAsync("/lol-summoner/v1/current-summoner");
    string summonerName = data.displayName;
    Console.WriteLine($"Summoner Name: {summonerName}");

    // Hook League Client
    LCU leagueClient = LCU.HookLeagueClient();
    
    // Hook League Store using the leagueClient instance
    LCU leagueStoreClient = LCU.HookLeagueStore(leagueClient);
    
    // Example: Make a purchase request
    var httpPayload = $"{{\"accountId\":{accountId},\"items\":[{{\"inventoryType\":\"{type}\",\"itemId\":{itemId},\"ipCost\":null,\"rpCost\":{rpPrice},\"quantity\":1}}]}}"
    dynamic data = await leageuStoreClient.RequestDynamicAsync(RequestMethod.POST, "/storefront/v3/purchase?language=en_US", httpPayload)

    Disclaimer

    This project is not affiliated with or endorsed by Riot Games.

    Visit original content creator repository

  • dataclasses-jsonschema

    Dataclasses JSON Schema

    http://valqo.top/wp-content/uploads/2025/12/1765731601_143_badge.svg

    ⚠️Please Note⚠️: Because of health reasons I’m not longer able to make changes to this project or make further releases via PyPI.

    A library to generate JSON Schema from python 3.7 dataclasses. Python 3.6 is supported through the dataclasses backport. Aims to be a more lightweight alternative to similar projects such as marshmallow & pydantic.

    Feature Overview

    • Support for draft-04, draft-06, Swagger 2.0 & OpenAPI 3 schema types
    • Serialisation and deserialisation
    • Data validation against the generated schema
    • APISpec support. Example below:

    Installation

    ~$ pip install dataclasses-jsonschema

    For improved validation performance using fastjsonschema, install with:

    ~$ pip install dataclasses-jsonschema[fast-validation]

    For improved uuid performance using fastuuid, install with:

    ~$ pip install dataclasses-jsonschema[fast-uuid]

    For improved date and datetime parsing performance using ciso8601, install with:

    ~$ pip install dataclasses-jsonschema[fast-dateparsing]

    Beware ciso8601 doesn’t support the entirety of the ISO 8601 spec, only a popular subset.

    Examples

    from dataclasses import dataclass
    
    from dataclasses_jsonschema import JsonSchemaMixin
    
    
    @dataclass
    class Point(JsonSchemaMixin):
        "A 2D point"
        x: float
        y: float

    Schema Generation

    >>> pprint(Point.json_schema())
    {
        'description': 'A 2D point',
        'type': 'object',
        'properties': {
            'x': {'format': 'float', 'type': 'number'},
            'y': {'format': 'float', 'type': 'number'}
        },
        'required': ['x', 'y']
    }

    Data Serialisation

    >>> Point(x=3.5, y=10.1).to_dict()
    {'x': 3.5, 'y': 10.1}

    Deserialisation

    >>> Point.from_dict({'x': 3.14, 'y': 1.5})
    Point(x=3.14, y=1.5)
    >>> Point.from_dict({'x': 3.14, y: 'wrong'})
    dataclasses_jsonschema.ValidationError: 'wrong' is not of type 'number'

    Generating multiple schemas

    from dataclasses_jsonschema import JsonSchemaMixin, SchemaType
    
    @dataclass
    class Address(JsonSchemaMixin):
        """Postal Address"""
        building: str
        street: str
        city: str
    
    @dataclass
    class Company(JsonSchemaMixin):
        """Company Details"""
        name: str
        address: Address
    
    >>> pprint(JsonSchemaMixin.all_json_schemas(schema_type=SchemaType.SWAGGER_V3))
    {'Address': {'description': 'Postal Address',
                 'properties': {'building': {'type': 'string'},
                                'city': {'type': 'string'},
                                'street': {'type': 'string'}},
                 'required': ['building', 'street', 'city'],
                 'type': 'object'},
     'Company': {'description': 'Company Details',
                 'properties': {'address': {'$ref': '#/components/schemas/Address'},
                                'name': {'type': 'string'}},
                 'required': ['name', 'address'],
                 'type': 'object'}}

    Custom validation using NewType

    from dataclasses_jsonschema import JsonSchemaMixin, FieldEncoder
    
    PhoneNumber = NewType('PhoneNumber', str)
    
    class PhoneNumberField(FieldEncoder):
    
        @property
        def json_schema(self):
            return {'type': 'string', 'pattern': r'^(\([0-9]{3}\))?[0-9]{3}-[0-9]{4}$'}
    
    JsonSchemaMixin.register_field_encoders({PhoneNumber: PhoneNumberField()})
    
    @dataclass
    class Person(JsonSchemaMixin):
        name: str
        phone_number: PhoneNumber

    For more examples see the tests

    APISpec Plugin

    New in v2.5.0

    OpenAPI & Swagger specs can be generated using the apispec plugin:

    from typing import Optional, List
    from dataclasses import dataclass
    
    from apispec import APISpec
    from apispec_webframeworks.flask import FlaskPlugin
    from flask import Flask, jsonify
    import pytest
    
    from dataclasses_jsonschema.apispec import DataclassesPlugin
    from dataclasses_jsonschema import JsonSchemaMixin
    
    
    # Create an APISpec
    spec = APISpec(
        title="Swagger Petstore",
        version="1.0.0",
        openapi_version="3.0.2",
        plugins=[FlaskPlugin(), DataclassesPlugin()],
    )
    
    
    @dataclass
    class Category(JsonSchemaMixin):
        """Pet category"""
        name: str
        id: Optional[int]
    
    @dataclass
    class Pet(JsonSchemaMixin):
        """A pet"""
        categories: List[Category]
        name: str
    
    
    app = Flask(__name__)
    
    
    @app.route("/random")
    def random_pet():
        """A cute furry animal endpoint.
        ---
        get:
          description: Get a random pet
          responses:
            200:
              content:
                application/json:
                  schema: Pet
        """
        pet = get_random_pet()
        return jsonify(pet.to_dict())
    
    # Dependant schemas (e.g. 'Category') are added automatically
    spec.components.schema("Pet", schema=Pet)
    with app.test_request_context():
        spec.path(view=random_pet)

    TODO

    Visit original content creator repository
  • dotfiles

    Zhou Xianghui’s dotfiles using bspwm polybar

     ______                __  ___                   _           _
    |__  / |__   ___  _   _\ \/ (_) __ _ _ __   __ _| |__  _   _(_)
      / /| '_ \ / _ \| | | |\  /| |/ _` | '_ \ / _` | '_ \| | | | |
     / /_| | | | (_) | |_| |/  \| | (_| | | | | (_| | | | | |_| | |
    /____|_| |_|\___/ \__,_/_/\_\_|\__,_|_| |_|\__, |_| |_|\__,_|_|
                                               |___/
    
     ____        _    __ _ _
    |  _ \  ___ | |_ / _(_) | ___  ___
    | | | |/ _ \| __| |_| | |/ _ \/ __|
    | |_| | (_) | |_|  _| | |  __/\__ \
    |____/ \___/ \__|_| |_|_|\___||___/
    

    [Dependencies]

    • archlinux Arch Linux is an independently developed, x86-64 general-purpose GNU/Linux distribution that strives to provide the latest stable versions of most software by following a rolling-release model. The default installation is a minimal base system, configured by the user to only add what is purposely required.
    • GNU Stow The way you manage your dotfiles. A symlink farm manager which takes distinct packages of software and/or data located in separate directories on the filesystem, and makes them appear to be installed in the same place.
    • awesomewm awesome is a highly configurable, next generation framework window manager for X. It is very fast, extensible and licensed under the GNU GPLv2 license. It is primarily targeted at power users, developers and any people dealing with every day computing tasks and who want to have fine-grained control on their graphical environment.
    • Rofi A window switcher, application launcher and dmenu replacement.
    • picom A lightweight compositor for X11 (previously a compton fork)
    • doom-emacs Doom is a configuration framework for GNU Emacs tailored for Emacs bankruptcy veterans who want less framework in their frameworks, a modicum of stability (and reproducibility) from their package manager, and the performance of a hand rolled config (or better). It can be a foundation for your own config or a resource for Emacs enthusiasts to learn more about our favorite operating system.
    • ranger A VIM-inspired filemanager for the console.
    • zathura A highly customizable and functional document viewer. It provides a minimalistic and space saving interface as well as an easy usage that mainly focuses on keyboard interaction.
    • mpv A free (as in freedom) media player for the command line. It supports a wide variety of media file formats, audio and video codecs, and subtitle types.
    • termite A keyboard-centric VTE-based terminal, aimed at use within a window manager with tiling and/or tabbing support.
    • ydcv YouDao Console Version – Simple wrapper for Youdao online translate (Chinese <-> English) service API, as an alternative to the StarDict Console Version(sdcv).

    Intallation

    Make Sure You have Gnu Stow Installed

    stow -R 

    Screenshots

    • Desktop

    ./img/desktop.png

    • Gotop

    ./img/gotop.png

    • Mpv && Pulsemixer

    ./img/play-video.png

    • Doom Emacs

    ./img/doom-emacs.png

    • Ranger

    ./img/ranger.png

    • Music Player ncmpcpp

    ./img/ncmpcpp.png

    Visit original content creator repository
  • pillar-ui

    Pillar-ui Design System

    What is pillar-ui

    Pillar is a modern design system built with React, with the goal of providing a comprehensive set of reusable UI components that are fully accessible and adhere to best practices in modern web development.

    Features

    • Lightweight: Only 11KB. Built as a lightweight alternative with full support for RTL languages, TypeScript, dark mode, and customization at both global and component levels.
    • Accessibility: Fully compliant with WCAG 2.1 guidelines, including color contrast, high contrast mode, semantic markup, keyboard navigation, text resizing, and reduced-motion support.
    • Modularity: Each component is standalone and extensible, allowing for flexible usage in isolation or in combination for building complex UIs.
    • Consistency: Promotes a unified design language and consistent naming conventions for better usability and developer experience.
    • Flexibility: Offers variants and customization options while following best practices in CSS and JavaScript to reduce bundle size and boost runtime performance.
    • Responsive: Built with fluid design principles. Spacing, typography, and layout adapt seamlessly across screen sizes by default.
    • Theming: Powered by CSS variables, making it easy to create and apply custom themes that reflect any brand or application style.
    • Icon Component: Includes a fully customizable icon component with a rich set of prebuilt icons.
    • Hooks: Ships with helpful React hooks to simplify UI interactions like toggling menus and handling user input.
    • Usability: Designed with UX best practices to ensure a consistent, intuitive, and accessible experience for users.

    Installation

    Before You Install we need to let you know that pillar contain four packages (core, hooks,utils icons).

    # you can install all of them or only what you need
    
    #NPM
    npm i @pillar-ui/core
    # (or | and)
    npm i @pillar-ui/hooks
    # (or | and)
    npm i @pillar-ui/icons
    
    #Yarn
    yarn add @pillar-ui/core
    # (or | and)
    yarn add @pillar-ui/hooks
    # (or | and)
    yarn add @pillar-ui/icons

    How to use it

    import { Button, InputPassword, Input, Checkbox } from 'core'
    import { useBoolean } from 'hooks'
    import * as Icons from 'icons'
    
    function MyComponent() {
      const { state, handleToggle } = useBoolean()
    
      return (
        <form aria-label="Register page">
          <Input required name="name" autoComplete="name" label="Name" />
          <Input type="Email" required name="email" autoComplete="email" label="Email" />
          <InputPassword
            required
            autoComplete="new-password"
            label="password"
            hint="password must be between 6 to 30 character"
          />
          <Checkbox color="p" onChange={handleToggle} label="I agree to the terms and conditions" />
          <Button icon={<Icons.Send name="heart" size={24} color="d" />}>Register</Button>
        </form>
      )
    }

    Contributing

    We welcome contributions to Pillar-ui, whether that’s through reporting issues, submitting feature requests, or contributing code. For More Information Check CONTRIBUTING.md file

    Roadmap

    We are constantly working to improve Pillar-ui and add new features to the library. Our roadmap includes plans to improve accessibility, add new components, and improve the documentation. We welcome feedback and suggestions from the community and encourage you to get involved in the development process.

    Security Policy

    Please see our Security Policy for information on how to report security vulnerabilities and our disclosure policy.

    Sponsor Pillar-ui

    If you find Pillar-ui useful and want to support its development and maintenance, you can consider sponsoring the project. Your sponsorship will help cover the costs of development, testing, documentation, and community support. It will also help us allocate more time and resources to improving and expanding the library.

    You can sponsor the project on GitHub Sponsors. GitHub Sponsors is a platform that enables you to support open source projects and contributors. You can choose to sponsor us monthly or with a one-time donation. Your sponsorship will be publicly recognized on our GitHub repository and website.

    Alternatively, you can also support the project by contributing code, reporting issues, and spreading the word about it. Every little bit helps and we appreciate all contributions, big and small.

    ko-fi

    Thank you for considering sponsoring Pillar-ui!

    License

    Pillar-ui is released under the MIT License.

    Visit original content creator repository

  • rPPG-heart-rate-estimation-deep-learning-method

    rPPG BASED HEART RATE ESTIMATION USING DEEP LEARNING

    In this project, we used MTTS-CAN toolbox for implementations of deep based methods.

    ABSTRACT

    Remote heart rate estimation is the measurement of heart rate without any physical contact with the patients. This is accomplished using remote photoplethysmography (rPPG). rPPG signals are usually collected using a video camera with a limitation of being sensitive to multiple contributing factors, such as different skin tones, lighting condition of environment and facial structure. There are multiple studies and generally two basic approaches in the literature to process and make sense of these signals: Firstly, we examined the traditional methods as CHROM DEHAN [1], ICA POH [2], GREEN VERCRUYSSE [3] and POS WANG [4]. Secondly, we examined MTTS-CAN [5], one of the deep learning methods. While we tried traditional methods with the UBFC [6] dataset, we ran deep learning methods with UBFC and PURE [7] datasets. When we used SNR [8] to calculate heart rate based on the Blood Volume Pulse (BVM) signal resulting from deep learning-based methods, we observed a significant improvement in some results. In summary, we concluded that deep learning-based methods play an important role in the development of rPPG technologies and their introduction into our daily lives.

    METHOD

    We planned to carry out our measurements with deep learning methods, which was our main approach. We hoped that deep learning reduced error rates as a result of these measurements. We used the model of MTTS-CAN to obtain the heart rate signals. This method processes RGB values captured by cameras with functions that also contain certain calculations for various external factors. These external factors include non-physiological variations such as the flickering of the light source, head rotation, and facial expressions. In this method, there are Temporal Shift Modules that will facilitate the exchange of information between frames. These modules provide superior performance in both latency and accuracy. MTTS-CAN also calculates the respiratory rate along with the heartbeat. Since respiration and pulse frequencies cause head and chest movements of the body, calculating these two values together had a great impact on the accuracy of the values compared to independently calculated models. [5]

    ARCHITECTURE

    Flowchart of the proposed algorithm

    RESULTS

    In the table, we could see the results of traditional methods which are CHROM DEHAN, ICA POH, GREEN VERCRUYSSE and POS WANG methods. In a deep learning-based method which is MTTS-CAN. For example, if we look at 17.avi for all methods, we calculated that deep learning has dropped below five. This result is quite good for us. When we look at the average RMSE values of these methods, we see that the deep learning-based method gives the best results because it has the lowest RMSE.

    CONCLUSION AND FUTURE WORK

    We worked with the traditional methods in the first term and worked with deep-based methods in the second term. According to the information from literature studies and our studies throughout the year, we can say that deep learning-based methods generally give more correct and faster results than traditional methods. In addition, when we used SNR to calculate heart rate based on the Blood Volume Pulse (BVP) signal resulting from deep learning-based methods, we observed a significant improvement in some results. As a result, we can say that deep learning-based methods play an important role in the development of rPPG technologies and their introduction into our daily lives. In the pandemic period, telehealth and remote health monitoring have become increasingly important and people widely expect that this will have a permanent effect on healthcare systems. These tools can help reduce the risk of discovering patients and medical staff to infection, make healthcare services more reachable, and allow doctors to see more patients. In this context, we believe that it will find a place both in health centres and in all kinds of electronic devices. As we can see from the technology news that comes out every day, leading universities of education and leading companies in technology have also concentrated on rPPG studies and both contribute to the literature with research to solve the problems in rPPG or develop new methods. In the next few years, it seems quite possible to open the front camera of our mobile phone and measure our heart rate while sitting at home. Of course, there is no limit to the number of applications to which this technology will be integrated.


    The project is developed by

    Supervised by Prof. Dr. Çiğdem EROĞLU ERDEM

    And this project was awarded the third best project. You can find all the details in our thesis.

    You can go to the first phase of the project from this link.


    [1] De Haan, G., & Jeanne, V. (2013). Robust pulse rate from chrominance-based rPPG. IEEE Transactions on Biomedical Engineering, 60(10), 2878-2886
    [2] Poh, M. Z., McDuff, D. J., & Picard, R. W. (2010) Non-contact, automated cardiac pulse measurements using video imaging and blind source separation. Optics express, 18(10), 10762-10774
    [3] Vercruysse, W., Svasand, L. O., & Nelson, J. S. (2008). Remote plethysmographic imaging using ambient light. Optics express, 16(26), 21434-21445.
    [4] W. Wang, A. C. den Brinker, S. Stuijk, and G. de Haan, “Algorithmic principles of remote ppg,” IEEE Transactions on Biomedical Engineering, vol. 64, no. 7, pp. 1479–1491, 2016
    [5] Xin Liu, Josh Fromm, Shwetak Patel, Daniel McDuff, “Multi-Task Temporal Shift Attention Networks for On-Device Contactless Vitals Measurement”, NeurIPS 2020, Oral Presentation (105 out of 9454 submissions)
    [6] S. Bobbia, R. Macwan, Y. Benezeth, A. Mansouri, J. Dubois, (2017), Unsupervised skin tissue segmentation for remote photoplethysmography, Pattern Recognition Letters
    [7] Stricker, R., Müller, S., Gross, H.-M. “Non-contact Video-based Pulse Rate Measurement on a Mobile Service Robot” in Proc. 23st IEEE Int. Symposium on Robot and Human Interactive Communication (Ro-Man 2014), Edinburgh, Scotland, UK, pp. 1056 – 1062, IEEE 2014
    [8] Remote Photoplethysmography Using Nonlinear Mode Decomposition, Halil Demirezen, Cigdem Eroglu Erdem Marmara University Department of Computer Engineering, Goztepe, Istanbul, Turkey, pp. 1060– 1064, 2018.

    POSTER

    Visit original content creator repository
  • multicounter

    MultiCounter

    A simple, elegant counter with support for counting multiple things at once.

    Joseph Hale's software engineering blog

    Installation

    Pip

    pip install multicounter

    Poetry

    poetry add multicounter

    Usage

    from multicounter import MultiCounter
    mc = MultiCounter()
    
    # Choose a name for your counter and start counting!
    mc.foo += 1
    
    # You can choose an initial value for a counter ...
    mc.bar = 42
    # ... and increment or decrement it however you like.
    mc.bar -= 4
    
    print(mc.get_counters())
    # {'foo': 1, 'bar': 38}

    Contributing

    See CONTRIBUTING.md

    The Legal Stuff

    `MultiCounter` by Joseph Hale is licensed under the terms of the Mozilla
    Public License, v 2.0, which are available at https://mozilla.org/MPL/2.0/.
    
    You can download the source code for `MultiCounter` for free from
    https://github.com/jhale1805/multicounter.
    

    TL;DR

    You can use files from this project in both open source and proprietary applications, provided you include the above attribution. However, if you modify any code in this project, or copy blocks of it into your own code, you must publicly share the resulting files (note, not your whole program) under the MPL-2.0. The best way to do this is via a Pull Request back into this project.

    If you have any other questions, you may also find Mozilla’s official FAQ for the MPL-2.0 license insightful.

    If you dislike this license, you can contact me about negotiating a paid contract with different terms.

    Disclaimer: This TL;DR is just a summary. All legal questions regarding usage of this project must be handled according to the official terms specified in the LICENSE file.

    Why the MPL-2.0 license?

    I believe that an open-source software license should ensure that code can be used everywhere.

    Strict copyleft licenses, like the GPL family of licenses, fail to fulfill that vision because they only permit code to be used in other GPL-licensed projects. Permissive licenses, like the MIT and Apache licenses, allow code to be used everywhere but fail to prevent proprietary or GPL-licensed projects from limiting access to any improvements they make.

    In contrast, the MPL-2.0 license allows code to be used in any software project, while ensuring that any improvements remain available for everyone.

    Visit original content creator repository