Blog

  • laravel-hmvc-generator

    Laravel 5 Package – HMVC Architecture Generator

    HVMC is a more-strongly design pattern based on MVC (Model-View-Controller). You got many advantages by using this pattern, especially if your project is very big.

    Key advantages (M.O.R.E):

    • Modularization: Reduction of dependencies between the disparate parts of the application.
    • Organization: Having a folder for each of the relevant triads makes for a lighter work load.
    • Reusability: By nature of the design it is easy to reuse nearly every piece of code.
    • Extendibility: Makes the application more extensible without sacrificing ease of maintenance.

    Find out more here: HVMC – Wikipedia

    Install & Update

    Install using Composer:

    composer require sethsandaru/laravel-hmvc-generator
    

    Update using Composer:

    composer update sethsandaru/laravel-hmvc-generator
    

    How to use?

    Notes

    • If you’re using Laravel 5.5+, then it’s ok, the framework itself will do the ServiceProvider scanning process.
    • If you’re using Laravel 5.4 and below, please add the HMVCServiceProvider into the providers in config/app.php
      • Full namespace path: SethPhat\HMVC\HMVCServiceProviderg

    First Initialize

    For the first time, please run this command:

    php artisan make:hmvc

    If you see the successful message, you’re done!

    Create a Module

    Use this command to create a new module:

    php artisan hmvc:create_module <Module_Name>

    A new module will be created inside the app/Modules folder.

    Config files

    To add your own configuration file and use the config function, please open config/hmvc.php

    You will see this:

    <?php
    //...
    return [
        'config_files' => [
            // your config file here
            // 'administration' => 'Modules/Administration/Configs/administration.php'
        ]
    ];

    Following the instruction above. You must add a right path to your config file, no full path, just the path in app folder.

    Example:

    <?php
    //...
    return [
        'config_files' => [
            'administration' => 'Modules/Administration/Configs/administration.php'
        ]
    ];

    I will get the config out like this:

    <?php
    //...
    config('administration.some_key_here');

    Supporting the project

    If you really like this project & want to contribute a little for the development. You can buy me a coffee. Thank you very much for your supporting ♥.

    Buy Me A Coffee

    Copyright © 2018 by Seth Phat aka Phat Tran Minh!

    Visit original content creator repository

  • restric-git-commit

    Commit validator

    This script validates the message structure of the commit command.

    • The line: msg=”$(cat $1 | grep -v # | head -n 1)” takes the
      message passed though the argument -m or by the interactive editor
      (vim, nano, etc) and procces the first not comment line (excludes the
      The lines with the # symbol.

    • In the line: if ! [[ $msg =~ ^(feat|fix|docs?|style|refactor|pref|chore|revert?)(.+):{1}\ ?.{3,}$ ]]; then Validates the message structure.

    Instructions

    Write the following code into a file named commit-msg and save it into: /repo/path/.git/hooks/

    #!/bin/sh
    
    RED='\033[0;31m'
    YELLOW='\e[33m'
    GREEN='\e[32m'
    CYAN='\e[36m'
    NC='\033[0m'
    BOLD='\e[1m'
    NORMAL='\e[0m'
    
    msg="$(cat $1 | grep -v \# | head -n 1)"
    if ! [[ $msg =~ ^(feat|fix|docs?|style|refactor|pref|chore|revert?)\(.+\):{1}\ ?.{3,}$ ]]; then
    	echo -e "${RED}${BOLD}Invalid commit${NORMAL}${NC}"
    	echo -e "\t${YELLOW}Follow the structure: \"type(module): description, at lease 3 words\""
    	echo -e "\tAvailable types:"
    	echo -e "\t\tfeat|fix|docs?|style|refactor|pref|chore|revert?${NC}"
    	echo -e "\t${CYAN}${BOLD}Example:${NORMAL} "
    	echo -e "\t\t${CYAN}revert(usersController): remove t3 validation${NC}"
    	exit 1
    fi
    

    Examples

    Navigate to your repo path

    Invalid commit message

    $ git commit -m "Invalid message"
    Invalid commit
    Follow the structure: "type(module): description, at lease 3 words"
    Available types:
    	feat|fix|docs?|style|refactor|pref|chore|revert?
    Example:
    	revert(usersController): remove t3 validation
    

    Valid commit message

    git commit -m "chore(BashCommitRule): write a valid message"
    [master ebdf4ef] chore(BashCommitRule): write a valid message
     1 file changed, 1 insertion(+)
    

    Visit original content creator repository

  • ward

    Ward

    Ward is a secure, cross-platform, zero-install, single-file password manager.

    Ward stores your passwords in an encrypted file which you manage with a single master password. You can keep track of multiple complex passwords without having to remember any of them.

    Setup

    Usage

    Usage: ward [OPTIONS] COMMAND [arg...]
    
    Secure password manager - https://github.com/schmich/ward
    
    Options:
      -v, --version    Show the version and exit
    
    Commands:
      init         Create a new credential database.
      add          Add a new credential.
      copy         Copy a password to the clipboard.
      edit         Edit an existing credential.
      del          Delete a stored credential.
      qr           Print password formatted as a QR code.
      import       Import JSON-formatted credentials.
      export       Export JSON-formatted credentials.
      list         Print a table-formatted list of credentials.
      master       Update master password.
    
    Run 'ward COMMAND --help' for more information on a command.
    

    Create a new credential database:

    > ward init
    Creating new credential database.
    Master password:
    Master password (confirm):
    ✓ Credential database created at C:\Users\schmich\.ward.
    

    Link to an existing credential database. This requires administrator privileges on Windows. A symlink will be created to the specified file:

    > ward init --link C:\Users\schmich\Dropbox\.ward
    ✓ Linked to existing database C:\Users\schmich\.ward -> C:\Users\schmich\Dropbox\.ward.
    

    Add a new credential:

    > ward add
    Master password:
    Login: fizz@buzz.com
    Password:
    Password (confirm):
    Realm: linkedin.com
    Note: LinkedIn account
    ✓ Credential added. Password copied to the clipboard.
    

    Add a new credential with a generated password:

    > ward add --gen --length 15 --min-upper 1 --min-lower 1 --min-digit 1 --min-symbol 1 --no-similar
    Master password:
    Login: quux@example.com
    Realm: twitter.com
    Note: Twitter account
    ✓ Credential added. Generated password copied to the clipboard.
    

    Copy an existing password with partial string matching:

    > ward copy linked
    Master password:
    ✓ Password for fizz@buzz.com@linkedin.com copied to the clipboard.
    

    Export credentials as JSON:

    > ward export
    Master password:
    [
      {
        "login": "fizz@buzz.com",
        "password": "bH`-uKY~A1YG5T$SqNYN8pw,j!Xa\\Gsy41f|",
        "realm": "linkedin.com",
        "note": "LinkedIn account"
      }
    ]
    

    Import JSON credentials:

    > ward import credentials.json
    Master password:
    Importing 192 credentials.
    ✓ Imported credentials from credentials.json.
    

    The Ward database is stored at ~/.ward. This can be overridden with the WARDFILE environment variable, e.g. in .bashrc:

    export WARDFILE=~/dotfiles/ward
    

    Password Generator

    Ward comes with a constraint-solving password generator that you can use when adding a new credential (ward add --gen). You can control length, character requirements, and exclusions:

    > ward add --help
    
    Usage: ward add [--login] [--realm] [--note] [--no-copy] [--gen [--length] [--min-length] [--max-length] [--no-upper] [--no-lower] [--no-digit] [--no-symbol] [--no-similar] [--min-upper] [--max-upper] [--min-lower] [--max-lower] [--min-digit] [--max-digit] [--min-symbol] [--max-symbol] [--exclude]]
    
    Options:
      --login=""           Login for credential, e.g. username or email.
      --realm=""           Realm for credential, e.g. website or WiFi AP name.
      --note=""            Note for credential.
      --no-copy=false      Do not copy password to the clipboard.
      --gen=false          Generate a password.
      --length=0           Password length.
      --min-length=30      Minimum length password.
      --max-length=40      Maximum length password.
      --no-upper=false     Exclude uppercase characters from password.
      --no-lower=false     Exclude lowercase characters from password.
      --no-digit=false     Exclude digit characters from password.
      --no-symbol=false    Exclude symbol characters from password.
      --no-similar=false   Exclude similar characters from password: 5SB8|1IiLl0Oo.
      --min-upper=0        Minimum number of uppercase characters in password.
      --max-upper=-1       Maximum number of uppercase characters in password.
      --min-lower=0        Minimum number of lowercase characters in password.
      --max-lower=-1       Maximum number of lowercase characters in password.
      --min-digit=0        Minimum number of digit characters in password.
      --max-digit=-1       Maximum number of digit characters in password.
      --min-symbol=0       Minimum number of symbol characters in password.
      --max-symbol=-1      Maximum number of symbol characters in password.
      --exclude=""         Exclude specific characters from password.
    

    License

    Copyright © 2016 Chris Schmich
    MIT License. See LICENSE for details.

    Visit original content creator repository

  • awesome-vulkan

    Awesome Vulkan Awesome

    Vulkan demo scene

    A curated list of awesome Vulkan libraries, debuggers and resources. Inspired by awesome-opengl and other awesome-… stuff.

    Hardware Support

    SDK

    Document

    Tutorial

    Apps

    Samples

    Libraries

    • 2D

      • imgui – Immediate Mode Graphical User interface. [MIT]
      • Skia – Google’s 2D graphics library has a Vulkan backend, demonstrated in a cross-platform sample application with its own window library. [BSD 3-clause] website
      • VKVG – Vulkan 2D graphics library, API follows the same pattern as Cairo graphics lib, but with new functions.
    • Compute

      • libvc – Vulkan Compute for C++. [LICENSE]
      • Vulkan Kompute – Blazing fast and lightweight Vulkan Compute Framework optimized for advanced GPU processing usecases. [Apache License 2.0]
      • ncnn – High-performance neural network inference framework with Vulkan based GPU inference. [BSD 3-clause]
      • vuh – Vulkan-based C++ GPGPU computing framework. [MIT]
      • VkFFT – Efficient Vulkan FFT library [MPL-2.0 License]
    • Low Level

      • Vulkan Memory Allocator – Easy to integrate Vulkan memory allocation library from AMD. [MIT]
      • Fossilize – serialization format for various persistent Vulkan object types. [MIT]
      • vk-bootstrap – C++ utility library to jump start Vulkan development by automating instance, physical device, device, and swapchain creation. [MIT]
      • Google’s vulkan-cpp-library – Vulkan abstraction library using C++11 for memory, resource management, type and thread safety as well as system independency. [Apache]
      • FrameGraph – Vulkan abstraction layer that represent frame as a task graph. [BSD 2-clause]
      • V-EZ – light-weight middleware layer for the Vulkan API targeting Professional Workstation ISVs. [MIT]
      • Vookoo – Vookoo is a set of dependency-free utilities to assist in the construction and updating of Vulkan graphics data structres. [MIT]
      • vpp – Modern C++ Vulkan Abstraction focused on performance and a straightforward interface. [MIT]
      • VulkanSceneGraph – Vulkan/C++17 scene graph project, successor to OpenSceneGraph.
      • Vulkan-WSIWindow – Multi-platform library to create a Vulkan window, and handle input events. [Apache License 2.0]
      • Screen 13 – An easy-to-use Vulkan render graph for Rust. [MIT]
    • Frameworks, Engines, Higher Level Rendering

      • Acid – A high speed C++17 Vulkan game engine. [MIT]
      • AMD’s Anvil – cross-platform framework for Vulkan. [LICENSE]
      • Auto-Vk – Vulkan convenience and productivity layer for modern C++, atop Vulkan-Hpp, by the Research Unit of Computer Graphics, TU Wien. [MIT]
      • Auto-Vk-Toolkit – C++ framework around Auto-Vk for rapid prototyping, research, and teaching, by the Research Unit of Computer Graphics, TU Wien. [MIT for the framework’s code]
      • bgfx – Cross-platform, graphics API agnostic, “Bring Your Own Engine/Framework” style rendering library. [BSD-2-clause]
      • bsf – Modern C++14 library for the development of real-time graphical applications. [MIT]
      • Cinder and the story behind. [BSD]
      • DemoFramework – NXP GTEC C++11 cross-platform demo framework including lots of samples for Vulkan, OpenGL ES, OpenVX, OpenCL, OpenVG and OpenCV. [BSD-3-clause]
      • Diligent Engine – a modern cross-platform low-level graphics library that supports OpenGL/GLES, Direct3D11/12 and Vulkan. [Apache License 2.0]
      • Falcor – Real-time rendering framework from NVIDIA, supporting mainly DX12, with experimental Vulkan support. [BSD 3-clause]
      • glfw and the guide. [LICENSE]
      • Intrinsic Engine – Intrinsic is a Vulkan based cross-platform graphics and game engine. [Apache License 2.0]
      • Introductory Vulkan sample by GPUOpen. [MIT]
      • liblava – A modern C++ and easy-to-use framework. [MIT]
      • Logi – Light-weight object oriented Vulkan abstraction framework. [BSD 2-clause]
      • Lugdunum – Modern cross-platform 3D rendering engine built with Vulkan and modern C++14. [MIT]
      • openFrameworks – the most famouse C++ creative coding framework. [MIT]
      • PowerVR SDK – C++ cross-platform 3D graphics SDK to speed up development of Vulkan and GLES. [LICENSE]
      • Pumex – cross-platform Vulkan renderer implementing frame graph and simple scene graph. Able to render on many surfaces at once [MIT]
      • SDL – added cross-platform Vulkan graphics support in SDL_vulkan.h. [zlib]
      • small3d, Tiny Vulkan based C++ cross-platform game development framework [BSD 3-clause]
      • Spectrum – Work-in-progress framework and abstraction layer around Vulkan.
      • Tephra – A modern C++17 graphics and compute library filling the gap between Vulkan and high-level APIs like OpenGL. [MIT]
      • The-Forge – DirectX 12, Vulkan, macOS Metal 2 rendering framework. [Apache License 2.0]
      • VKFS – Cross-platform easy-to-use C++ framework that allows you to quickly initialize Vulkan and get a ready-made environment. Provides high-level abstraction over basic Vulkan objects.
      • Vulkan Launchpad – Vulkan framework for Windows, macOS, and Linux. Especially well-suited for Vulkan beginners, used in university education, by the Research Unit of Computer Graphics, TU Wien. [MIT]
    • Other API Interop and Implementations

      • visor – Vulkan Ignoble Software Rasterizer. [MIT]
      • VulkanOnD3D12 – Vulkan API for D3D12. [Apache License 2.0]
      • rostkatze – C++ implementation of Vulkan sitting on D3D12 🐈[Apache License 2.0]
      • VK9 – Direct3D 9 compatibility layer using Vulkan
      • VUDA – header-only lib that provides a CUDA Runtime API interface. [MIT]
      • clspv – prototype compiler for a subset of OpenCL C to Vulkan compute shaders. [Apache License 2.0]
      • MoltenVK – run Vulkan on iOS and macOS. [Apache-2.0]
      • Zink – OpenGL implementation on top of Vulkan, part of Mesa project. [MIT]
      • glo / OpenGL Overload – OpenGL implementation on top of Vulkan.
      • gfx-portability – Vulkan Portability implementation on Metal and D3D12, based on gfx-rs.
    • Raytracing

      • Quartz – Physically based Vulkan RTX path tracer with a declarative ES7-like scene description language. [LGPL-3.0]
    • Scientific

      • datoviz – High-performance GPU interactive scientific data visualization with Vulkan. [MIT]
      • iMSTK – C++ toolkit for building surgical simulations with Vulkan and VTK backends. [Apache License 2.0]
    • Shaders

      • glslang – Library for compiling glsl to spirv [BSD 3-Clause]
      • SPIRV-Cross – Library for reflection of spirv, simplify the creation of Vulkan pipeline layouts [ Apache-2.0 License]
    • Outdated ⚠️

    Bindings

    • ash – Vulkan bindings for Rust. [MIT]
    • gfx-rs – A low-overhead Vulkan-like GPU API for Rust. [Apache License 2.0]
    • libvulkan.lua – Lua bindings for Vulkan.
    • dvulkan – Auto-generated D bindings for Vulkan.
    • ErupteD – Another Auto-generated D bindings for Vulkan.
    • flextGL – Minimal Vulkan header/loader generator and the blog post about it.
    • Silk.NET – C# bindings for Vulkan and others. [MIT]
    • vulkan – Haskell bindings for Vulkan and Vulkan Memory Allocator [BSD-3-Clause]
    • nvk – JavaScript bindings for Vulkan. [MIT]
    • racket-vulkan – Racket bindings for Vulkan with detailed implementation notes. [MIT]
    • Vulkan-hpp Open-Source Vulkan C++ API originated from NVIDIA and the blog about it.
    • VulkanSharp – C# bindings for Vulkan. [MIT]
    • Vulkano – Safe and rich Rust wrapper around the Vulkan API. [MIT]
    • LWJGL – Lightweight Java Game Library 3 has Vulkan bindings. [BSD]
    • SharpVk – C# bindings for Vulkan with Linq-to-SPIR-V & NuGet package. [MIT]
    • vulkan – Ultimate Python bindings for Vulkan generated with CFFI. [Apache Licence 2.0]
    • vulkan-go – Go bindings for Vulkan. [MIT]
    • PasVulkan – Vulkan bindings plus high-level wrapper library for Object Pascal [Zlib]
    • vulkan-zig – Vulkan binding generator for Zig [MIT]
    • VK², Kotlin Wrapper for Vulkan: code expressiveness and safety meet graphic power [Apache License 2.0]
    • Vortice.Vulkan – .NET Standard 2.0 and .NET5 C# bindings [MIT]
    • Raw Node.js Vulkan API – A new Vulkan bindings for Node.JS, similar with LWJGL-3 or NVK.
    • Deno Vulkan – Vulkan API bindings for Deno. [Apache Licence 2.0]

    Tools

    • Nsight™ Visual Studio Edition 5.2+.
    • LoaderAndValidationLayers – from KhronosGroup. [Apache Licence 2.0]
    • renderdoc – by baldurk, a stand-alone graphics debugging tool. [MIT]
      • RDCtoVkCpp – converts RenderDoc Vulkan capture to compilable and executable C++ code. [MIT]
    • VulkanTools – LunarG’s tools including layers and configurator. [Apache Licence 2.0]
    • VKtracer – universal and easy-to-use profiler for Vulkan.
    • CodeXL – CodeXL goes open source. [MIT]
    • Qualcomm Adreno GPU Tools – samples, Adreno recommendation layer, best practice docs for Adreno GPU.
    • Qualcomm Snapdragon Profiler – includes Vulkan traces and frame captures for Adreno GPU.
    • Arm Mobile Studio – includes the Arm Graphics Analyzer to trace graphics performance issues easily, and Arm Streamline performance analyzer, for a whole-system view of performance to determine bottlenecks quickly across both the CPU and GPU.
    • Open Capture and Analytics Tool (OCAT) – provides an FPS overlay and performance measurement for D3D11, D3D12, and Vulkan. [MIT]
    • gapid – Graphics API Debugger, can trace and replay Android OpenGL ES and Vulkan applications. [Apache License 2.0]
    • Arm – PerfDoc – a validation layer against the Mali Application Developer Best Practices document. [MIT]
    • glsl_trace – library for shader debugging and profiling for Vulkan and OpenGL. [MIT]
    • MangoHud – Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load. [MIT]

    Books

    Papers

    Khronos

    Community

    Related lists

    • awesome – Curated list of awesome lists.
    • awesome-opengl – Curated list of awesome OpenGL libraries, debuggers and resources.
    • gamedev – Awesome list about game development.
    • graphics-resources – List of graphic programming resources.
    • awesome-d3d12 – Curated list of awesome D3D12 libraries, debuggers and resources.

    License

    Creative Commons License

    This work is licensed under a Creative Commons Attribution 4.0 International License.

    Contributing

    Please see CONTRIBUTING for details.

    Visit original content creator repository
  • CodexEstigma

    CodexEstigma

    Manual del juego de rol Codex Estigma, por BasilioGarcia.

    El manual puede ser consultado online AQUÍ ⤴.

    Características

    • HTML5, CSS3, JavaScript y JQuery (ver sección: Uso real de JQuery)
    • Sistema de plantillas propio creado en JS (uso de Promesas y caché de archivos).
    • Diseño responsive con cinco breakpoints: <768px, 768px, 992px, 1200px y 1638px.
    • Nesting CSS nativo. (ver sección: Por qué no BEM)
    • Animaciones con CSS.
    • Eliminado el scroll nativo del navegador, custom scroll en bloques de contenido, compatible con dispositivos móviles.
    • Subsecciones del menú visibles con efecto onHover que es compatible con dispositivos móviles.
    • Auto-creación de anchors internos
    • Enlaces referenciales

    Requisitos

    Debido a que este manual ejecuta funciones avanzadas de JavaScript, requiere ser interpretado en un servidor web HTTP,
    como Apache, IIS o Ngnix.

    Sistema de Plantilla

    Este manual usa un sistema de plantillas propio. En vez de tener que repetir todas las etiquetas HTML en cada página,
    usa un código HTML mínimo para crear los artículos y el motor en JavaScript de la plantilla se encarga de crear el
    resto del documento. El menú y el paginado se crean de forma automática configurando un archivo.

    Note

    Creé este sistema, porque a medida que el manual iba teniéndo más páginas se volvía un engorro tanto el modificar código
    que afectaba a muchas páginas, como el reestructurar el orden de las páginas (cuando tienes que cambiar la URL
    de un enlace en más de 100 páginas HTML, echas de menos los sistemas de plantillas propios de los backends).

    Estructura de las páginas

    Existen dos tipos de páginas, las individuales y las que tienen sub-páginas.
    Para crear una nueva página, hay que crear una nueva carpeta en la carpeta “pages”, situada en la raíz del proyecto.

    Crear una página individual

    Si la página nueva, es una página individual, dentro de la carpeta creada deben de añadirse dos documentos:

    • index.html – Contendrá el HTML de la página.
    • page.css – Contendrá el CSS específico de esa página. (en muchas páginas está en blanco)

    El archivo index.html tendrá el siguiente esquema:

    <!DOCTYPE html>
    <meta charset="UTF-8" xmlns="http://www.w3.org/1999/html">
    <script src="../../js/init.js"></script>
    <page data-dir="../.." data-chapter="3">
        HTML propio de ese artículo.
    </page>
        

    El código HTML de la página va dentro de la etiqueta page. Esta etiqueta tiene dos atributos: data-dir
    y data-chapter.

    • data-dir : Indica la ruta a la raíz del proyecto, se usa para cargar correctamente los archivos. En las páginas
      individuales su valor es: “../..”
    • data-chapter : Es un ID que indica con que entrada del archivo chapters.json (ver más adelante) se
      corresponde ésta página.

    A continuación hay que añadir la entrada de la página al archivo de configuración de capítulos: chapters.json en
    ./js/db/chapters.json:

    "0": {
      "title": "Codex Estigma"
    },
    "1": {
        "title": "Sobre Codex Estigma",
        "url": "/pages/acerca-de"
    },
    "2": {
        "title": "Tiro base",
        "url": "/pages/tiro-base"
    },
    etc...

    El ID de cada entrada es un número “0”, “1”, “2”… que van ordenados de forma auto-incremental y comenzando siempre en
    cero. El cero es la portada y no será visible en el menú ni en el paginado. El orden del resto de entradas será con el
    que aparezcan en el menú y en el paginado. Así, en el ejemplo de arriba, la entrada con el ID 2, Tiro Base, sería el
    segundo enlace en el menú.

    La entrada tiene dos atributos: title y url.

    • title : Es el título de la página, se usa tanto en el menú, como en el encabezado de la página, como en la
      etiqueta <title>
    • url : Es la URL de donde va a cargar los archivos. Se compone de la concatenación de /pages/ más el nombre de
      la nueva carpeta que se ha creado.

    Crear una página con sub-páginas

    Si la página nueva, es una página con sub-páginas, dentro de la carpeta creada deben de añadirse, a su vez, una
    sub-carpeta por cada sub-página. Y dentro de cada sub-carpeta, deben de añadirse dos documentos:

    • index.html – Contendrá el HTML de la página.
    • page.css – Contendrá el CSS específico de esa página. (en muchas páginas está en blanco)

    El archivo index.html tendrá el siguiente esquema:

    <!DOCTYPE html>
    <meta charset="UTF-8" xmlns="http://www.w3.org/1999/html">
    <script src="../../../js/init.js"></script>
    <page data-dir="../../.." data-chapter="7" data-section="1">
        HTML propio de ese artículo.
    </page>

    El código HTML de la página va dentro de la etiqueta page. Esta etiqueta tiene tres atributos: data-dir,
    data-chapter y data-section.

    • data-dir : Indica la ruta a la raíz del proyecto, se usa para cargar correctamente los archivos. En las páginas
      con sub-páginas su valor es: “../../..”
    • data-chapter : Es un ID que indica con que entrada del archivo chapters.json (ver más adelante) se
      corresponde ésta página.
    • data-section : Es un ID que indica con que sección de la entrada se corresponde ésta página (ver más adelante).

    A continuación hay que añadir la entrada de la página al archivo de configuración de capítulos: chapters.json en
    ./js/db/chapters.json:

    ...
    "6": {
        "title": "Habilidades",
        "url": "/pages/habilidades"
    },
    "7": {
        "title": "Maniobras",
        "sections": {
            "1": {
                "title": "Adquirir maniobras",
                "url": "/pages/maniobras/adquirir-maniobras"
            },
            "2": {
                "title": "Filo largo",
                "url": "/pages/maniobras/filo-largo"
            },
            "3": {
                "title": "Filo corto",
                "url": "/pages/maniobras/filo-corto"
            }
        }
    },
    ...

    En el código de ejemplo anterior, la entrada del archivo con el ID 6 es una página individual, y la entrada con el ID 7
    es una página con sub-páginas.

    Las entradas con sub-páginas tiene dos atributos: title y sections.

    • title : Es el título de la página, se usa en el menú.
    • sections : Son las entradas de las sub-páginas. Sus IDs son auto-incrementales y comienzan en 1. A su vez,
      tienen dos atributos: title y url, funcionan como las páginas individuales.

    Uso real de JQuery

    Note

    Aunque el proyecto usa la biblioteca JQuery, la mayoría del código es JavaScript vanilla, simplemente he usado JQuery
    por la sintaxis de selectores del DOM abreviada y por el bindeo de eventos con propagación, que funcionan muy bien,
    me parecen las funcionalidades mejor optimizadas de JQuery. No soy muy fan del resto de funcionalidades de JQuery y creo
    que las soluciones en vainilla JS no sólo obtienen mejor performance, sino que aportan una metodología más ordenada.
    Por eso no he creado los componentes usando el sistema de componentes de JQuery, no me aportaban nada.

    Por qué no BEM

    Tip

    BEM sigue siendo un estándar importante para coordinar proyectos grandes donde múltiples personas trabajarán con los
    archivos CSS. Sin embargo, desde que CSS incorporó el nesting de forma nativa en 2021, se han facilitado métodos
    alternativos para mantener un código CSS limpio y organizado.

    Además, creo que existe un mito exagerado, mal entendido, con la especificidad de los selectores CSS, y que la
    propagación de BEM y las enseñanzas de ciertos “gurús” contribuyeron a ello.
    La especificidad es una característica buscada por el W3C y es
    MUY UTIL. Una cosa es tener un lío impresionante con la jerarquía de los selectores y otra es que no aproveches una
    característica perfectamente válida de las hojas de estilos.

    Por todo ello, y porque es un proyecto personal, con el que no voy a entrar en conflicto con otros desarrolladores,
    he decidido usar, no solo native nesting, sino usar selectores con IDs y etiquetas genéricas como: <aside>,
    <header>

    Aún así, como se puede ver en la imagen inferior, el nivel de especificidad es bajo, se puede mantener un
    equilibrio entre utilidad jerárquica y código limpio y ordenado.

    Gráfico de especificidad del archivo CSS

    Componentes

    Auto-creación de anchors internos

    Nombre del componente: internal-anchors

    Si a unas de las etiquetas usadas en los títulos (<h2>, <h3> o <h4>) se le
    coloca un atributo ID, automáticamente se convierte en un enlace interno a ese título de la página.

    Enlaces referenciales

    Nombre del componente: pages-links

    En el archivo links.json se registran enlaces con un nombre de referencia, a modo de identificador.
    En las páginas del manual que lo necesiten se agrega el enlace por el nombre de referencia, así, si luego el enlace
    cambia, no hay que cambiarlo en cada página donde se usó, solo hay que cambiarlo en el archivo links.json.

    Tooltips

    Nombre del componente: tooltips

    Visit original content creator repository

  • copulae

    Copulae

    Probably the second most popular copula package in Python. 😣

    Copulae is a package used to model complex dependency structures. Copulae implements common and popular copula structures to bind multiple univariate streams of data together. All copula implemented are multivariate by default.

    Versions

    Anaconda Version PyPI version

    Continuous Integration

    Build Status Anaconda-Server Badge Downloads Anaconda-Server Badge

    Documentation

    Documentation Status

    Coverage

    Coverage Status

    Installing

    Install and update using pip and on conda.

    # conda
    conda install -c conda-forge copulae 
    
    # PyPI
    pip install -U copulae

    Documentation

    The documentation is located at https://copulae.readthedocs.io/en/latest/. Please check it out. 🙂

    Simple Usage

    from copulae import NormalCopula
    import numpy as np
    
    np.random.seed(8)
    data = np.random.normal(size=(300, 8))
    cop = NormalCopula(8)
    cop.fit(data)
    
    cop.random(10)  # simulate random number
    
    # getting parameters
    p = cop.params
    # cop.params = ...  # you can override parameters too, even after it's fitted!  
    
    # get a summary of the copula. If it's fitted, fit details will be present too
    cop.summary()
    
    # overriding parameters, for Elliptical Copulae, you can override the correlation matrix
    cop[:] = np.eye(8)  # in this case, this will be equivalent to an Independent Copula

    Most of the copulae work roughly the same way. They share pretty much the same API. The difference lies in the way they are parameterized. Read the docs to learn more about them. 😊

    Acknowledgements

    Most of the code has been implemented by learning from others. Copulas are not the easiest beasts to understand but here are some items that helped me along the way. I would recommend all the works listed below.

    I referred quite a lot to the textbook when first learning. The authors give a pretty thorough explanation of copula from ground up. They go from describing when you can use copulas for modeling to the different classes of copulas to how to fit them and more.

    This blogpost gives a very gentle introduction to copulas. Before diving into all the complex math you’d find in textbooks, this is probably the best place to start.

    Motivations

    I started working on the copulae package because I couldn’t find a good existing package that does multivariate copula modeling. Presently, I’m building up the package according to my needs at work. If you feel that you’ll need some features, you can drop me a message. I’ll see how I can schedule it. 😊

    TODOS

    • Set up package for pip and conda installation
    • More documentation on usage and post docs on rtd (Permanently in the works 😊)
    • Elliptical Copulas
      • Gaussian (Normal)
      • Student (T)
    • Implement in Archimedean copulas
      • Clayton
      • Gumbel
      • Frank
      • Empirical
      • Joe
      • AMH
      • Rho finding via Cubatures
    • Mixture copulas
      • Gaussian Mixture Copula
      • Generic Mixture Copula
      • Marginal Copula
    • Vine Copulas
    • Copula Tests
      • Radial Symmetry
      • Exchangeability
      • Goodness of Fit
        • Pairwise Rosenblatt
        • Multi-Independence
        • General GOF
      • Model Selection
        • Cross-Validated AIC/BIC
    Visit original content creator repository
  • freemarker-native-demo

    freemarker-native-demo

    Demo application for FreeMarker Native project, based on Quarkus.

    Keep a Changelog v1.1.0 badge license code of conduct CI build native image

    Quickstart

    Requirements :

    • GraalVM 21+
    1. Build
    ./gradlew build -Dquarkus.native.enabled=true -Dquarkus.package.jar.enabled=false
    1. Run
    ./build/freemarker-native-demo-*-runner 
    1. Test

    http://localhost:8080/hello/freemarker

    Configuration

    There are the operations we did to configure this project native build :

    1. Added dependency “org.fugerit.java:freemarker-native”
    2. Configured additional build args -H:IncludeResources
    3. Configured reflection for beans (with annotation @RegisterForReflection)

    Original Quarkus README

    From here on you can find the README generated from the Quarkus Launcher :

    https://code.quarkus.io/?g=org.fugerit.java.demo&a=freemarker-native-demo&b=GRADLE_KOTLIN_DSL&e=rest

    This project uses Quarkus, the Supersonic Subatomic Java Framework.

    If you want to learn more about Quarkus, please visit its website: https://quarkus.io/.

    Running the application in dev mode

    You can run your application in dev mode that enables live coding using:

    ./gradlew quarkusDev

    NOTE: Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.

    Packaging and running the application

    The application can be packaged using:

    ./gradlew build

    It produces the quarkus-run.jar file in the build/quarkus-app/ directory. Be aware that it’s not an über-jar as the dependencies are copied into the build/quarkus-app/lib/ directory.

    The application is now runnable using java -jar build/quarkus-app/quarkus-run.jar.

    If you want to build an über-jar, execute the following command:

    ./gradlew build -Dquarkus.package.jar.type=uber-jar

    The application, packaged as an über-jar, is now runnable using java -jar build/*-runner.jar.

    Creating a native executable

    You can create a native executable using:

    ./gradlew build -Dquarkus.native.enabled=true -Dquarkus.package.jar.enabled=false

    Or, if you don’t have GraalVM installed, you can run the native executable build in a container using:

    ./gradlew build -Dquarkus.native.enabled=true -Dquarkus.native.container-build=true -Dquarkus.package.jar.enabled=false

    You can then execute your native executable with: ./build/freemarker-native-demo-1.0.0-SNAPSHOT-runner

    If you want to learn more about building native executables, please consult https://quarkus.io/guides/gradle-tooling.

    Related Guides

    • REST (guide): A Jakarta REST implementation utilizing build time processing and Vert.x. This extension is not compatible with the quarkus-resteasy extension, or any of the extensions that depend on it.

    Provided Code

    REST

    Easily start your REST Web Services

    Related guide section…

    Visit original content creator repository
  • ganalytics

    Overview

    Download

    Ganalytics is tiny api layer for any analytics in application. It provides an object oriented, typesafe, strict and testable way to organize work with analytics in the application. More information on wiki pages.

    Here is latest changelog.

    Also, you can read these articles for more details:

    1. Introduction to conception
    2. V1.1 Changelog details

    Get library

    With gradle:

    compile 'com.github.programmerr47:ganalytics-core:1.1.0'
    

    With maven:

    <dependency>
      <groupId>com.github.programmerr47</groupId>
      <artifactId>ganalytics-core</artifactId>
      <version>1.1.0</version>
      <type>pom</type>
    </dependency>
    

    Basic Usage

    To start with gathering analytics:

    1. Create an group or category interface and fill it with necessary annotations:

    @Prefix
    interface CategoryInterface {
        fun action()
        @NoPrefix fun otherAction(@Label(LabelConverter::class) String label)
    }

    or

    interface GroupInterface {
        @Prefix fun category(): CategoryInterface
        @Convention(NamingConventions.LOWER_CAMEL_CASE) fun otherCategory(): OtherCategoryInterface
    }

    For more information about interfaces and annotations read linked sections.

    1. Prepare Ganalytics instance through:

    For group interfaces:

    val ganalytics = Ganalytics({ System.out.println(it) /**or do something with received incoming events**/ }) {
         cutOffAnalyticsClassPrefix = false
         prefixSplitter = "_"
         namingConvention = NamingConventions.LOWER_SNAKE_CASE
         labelTypeConverters += TypeConverterPair<DummyDataClass> { it.name } +
                 TypeConverterPair<DummyReversedClass> { it.id.toString() } 
    }

    wich is equal to:

    val ganalytics = GanalyticsSettings {
        cutOffAnalyticsClassPrefix = false
        prefixSplitter = "_"
        namingConvention = NamingConventions.LOWER_SNAKE_CASE
        labelTypeConverters += TypeConverterPair<DummyDataClass> { it.name } +
                TypeConverterPair<DummyReversedClass> { it.id.toString() }
    }.createGroup { System.out.println(it) /**or do something with received incoming events**/ }

    For category interfaces:

    val ganalytics = GanalyticsSettings {
        cutOffAnalyticsClassPrefix = false
        prefixSplitter = "_"
        namingConvention = NamingConventions.LOWER_SNAKE_CASE
        labelTypeConverters += TypeConverterPair<DummyDataClass> { it.name } +
                TypeConverterPair<DummyReversedClass> { it.id.toString() }
    }.createSingle { System.out.println(it) /** or do something with received incoming events**/ }
    1. Pass an interface class to ganalytics:

    val analytics = ganalytics.create(GroupInterface::class)

    1. Now you can use analytics. For example:

    analytics.category().otherAction("label")

    will print to the standart output: Event(category=sampleinterface, action=sampleinterface_method1)

    Note: instead of System.out.println you can pass, for example:

    googleAnalyticsTracker.send(HitBuilders.EventBuilder()
            .setCategory(it.category)
            .setAction(it.action)
            .setLabel(it.label)
            .setValue(it.value)
            .build())

    Or any analytics method as you want.

    For more info of basic usage see samples folder in project.
    Also please visit the wiki pages to know more details.

    Visit original content creator repository