Blog

  • UFC-predictor

    UFC-predictor

    project goes from scraping the data to EDA to prediction

    What is included

    The project is composed of 3 main parts:

    You can find the 2 scrapers for fightcards and fighters in their respective folders. More details about what information do we scrape are presented in the README file of these folders

    The 2 csv raw file are what we obtain from the scrapers

    The preprocessing notebook details all the steps that was used to arrive to the cleaned_dataset.csv

    The EDA and predictor notebooks relies on the cleaned_dataset.csv that was produced by the preprocessing notebook

    Drawback and room for improvement

    Admittedly, the predictor utilized the information that would only be available during the fight itself (such as the accuracy of punches, number of takedown attempts, etc.) therefore, in the context of predicting for an upcoming fight, the accuracy will be lower than the result previously mentioned.
    One way to overcome this challenge would be to have a 3rd scraper that would focus on scraping the fight statistic of a fighter in the 3 previous fight prior to the match we want to predict.

    Visit original content creator repository
    https://github.com/leminhds/UFC-predictor

  • CSharpHeranca

    image

    Diagrama de classes

    DiagramasDeClasses drawio

    Orientação a objetos com C#

    • Sobrecarga de métodos é uma forma de termos mais de um método com o mesmo nome em nosso código. O que vai diferenciá-los é o tipo e quantidade de parâmetros recebidos. Com ela conseguimos aplicar o conceito de polimorfismo, no qual um comportamento responde de maneira diferente de acordo com os dados informados em sua chamada.
    • Usamos o operador this para trabalhar com elementos da própria instância do objeto.
    • Vimos boas práticas na organização de projetos como a organização dos arquivos em diretórios distintos, que irão facilitar futuras manutenções e até no entendimento do projeto com base em suas responsabilidades.

    Entendendo herança

    • Na orientação a objetos, a herança é um mecanismo que nos permite reaproveitar código.
    • Podemos redefinir um comportamento escrito em uma classe base em uma classe derivada. Assim, ele passará a funcionar de forma específica em uma classe derivada.
    • Acessamos definições presentes na classe base usando o operador base.

    Usando classes abstratas

    • Invocamos o construtor da classe base, a partir do construtor da classe derivada.
    • Protegemos propriedades usando o operador de visibilidade protected para impedir o acesso direto a uma propriedade de um objeto.
    • Utilizamos classes abstratas para definir uma classe que será modelo para criação de novas classes.
    • Como usar métodos abstratos para definir como obrigatória a implementação de determinado comportamento em classes derivadas.

    Mais sobre heranças

    • Como adicionar uma nova classe à hierarquia de classes já definida com a intenção de atender a uma nova demanda do projeto.
    • Avançamos na utilização da herança de classes fazendo uma classe herdar de outra.

    Trabalhando com interfaces

    • O C# não implementa o conceito de herança múltipla, pois classes muito distintas com métodos de mesmo nome poderiam causar problemas para o compilador definir qual usar na nova instância.
    • O funcionamento das interfaces na orientação a objetos, que são contratos que definem comportamentos a serem implementados pelas classes que assinam este contrato.
    • Como utilizar o padrão de nomenclatura adotada para nomeação de interfaces, aplicando a convenção que utiliza o prefixo I.
    Visit original content creator repository https://github.com/RedONe06/CSharpHeranca
  • nodejs-master-class

    Node.js Masterclass Homework Assignment

    This repository contains the homework assignment for Node.js Master Class by Pirple that is focused on building a RESTful API, web app GUI, and a CLI in plain Node JS (ES6 Javascript) with no NPM or 3rd-party libraries.

    Homework Assignments

    Assignment #1: Backend

    You are building the API for a pizza-delivery company.

    Here’s the spec from your project manager:

    1. New users can be created, their information can be edited, and they can be deleted. We should store their name, email address, and street address.
    2. Users can log in and log out by creating or destroying a token.
    3. When a user is logged in, they should be able to GET all the possible menu items (these items can be hardcoded into the system).
    4. A logged-in user should be able to fill a shopping cart with menu items
    5. A logged-in user should be able to create an order. You should integrate with the Sandbox of Stripe.com to accept their payment. Note: Use the stripe sandbox for your testing. Follow this link and click on the “tokens” tab to see the fake tokens you can use server-side to confirm the integration is working.
    6. When an order is placed, you should email the user a receipt. You should integrate with the sandbox of Mailgun.com for this. Note: Every Mailgun account comes with a sandbox email account domain (whatever@sandbox123.mailgun.org) that you can send from by default. So, there’s no need to setup any DNS for your domain for this task. Read more here.

    Assignment #2: Frontend

    It is time to build a simple frontend for the Pizza-Delivery API you created in Homework Assignment #2. Please create a web app that allows customers to:

    1. SignUp on the site.
    2. View all the items available to order.
    3. Fill up a shopping cart.
    4. Place an order (with fake credit card credentials), and receive an email receipt

    Assignment #3: Admin CLI

    It is time to build the Admin CLI for the pizza-delivery app you built in the previous assignments. Please build a CLI interface that would allow the manager of the pizza place to:

    1. View all the current menu items.
    2. View all the recent orders in the system (orders placed in the last 24 hours).
    3. Lookup the details of a specific order by order ID.
    4. View all the users who have signed up in the last 24 hours.
    5. Lookup the details of a specific user by email address.

    The Solution

    Launching the Server

    Too launch the application please run the following command from the project root folder:

    node index.js

    You may also run the application in debugging mode:

    env NODE_DEBUG=server,stripe,mailgun,cli,workers node index.js

    Running the APP for different environments:

    NODE_ENV=staging node index.js

    The APP is currently supporting staging (default) and production environments.

    CLI Commands

    The following CLI command are available for the execution:

    -----------------------------------------------------------------------------------------------------------
                                   CLI Manual
    -----------------------------------------------------------------------------------------------------------
    
    exit                           Kill the CLI (and the rest of the application)
    
    man                            Show this help page
    
    help                           Alis of the "man" command
    
    menus                          Show the list of available menu items (pizzas)
    
    orders                         View all the recent orders in the system (orders placed in the last 24 hours)
    
    order --{orderId}              Lookup the details of a specific order by order ID
    
    users                          View all the users who have signed up in the last 24 hours
    
    user --{email}                 Lookup the details of a specific user by email address
    
    -----------------------------------------------------------------------------------------------------------
    

    Front-End

    The following paths are available for the user in browser after launching the app.

    Index Page

    Path: http://localhost:3000/

    Login Page

    Path: http://localhost:3000/user/session/create

    Menu List

    Path: http://localhost:3000/menu/list

    Shopping Cart

    Path: http://localhost:3000/user/cart/read

    Checkout Page

    Path: http://localhost:3000/user/order/create

    Checkout Success Page

    Path: http://localhost:3000/user/order/success

    User Profile Page

    Path: http://localhost:3000/user/account/edit

    Back-End (API)

    The following endpoints are available from API perspective.

    HealthCheck Endpoint

    Request example:

    curl -X GET http://localhost:3000/ping

    User Endpoints

    Create the User

    Request example:

    curl -X POST \
      http://localhost:3000/users \
      -d '{
    	"name": "John",
    	"email": "any@email.com",
    	"password": "1111",
    	"address": "San Francisco, CA",
    	"streetAddress": "Sunset blvd, 15"
    }'
    Read the User

    Request example:

    curl -X GET \
      'http://localhost:3000/users?email=any@email.com' \
      -H 'token: 48df0wibmpqz69rzgb5y'
    Update the User

    Request example:

    curl -X PUT \
      http://localhost:3000/users \
      -H 'Content-Type: application/json' \
      -H 'token: 48df0wibmpqz69rzgb5y' \
      -d '{
    	"name": "Bill",
    	"email": "any@email.com"
    }'
    Delete the User

    Request example:

    curl -X DELETE \
      'http://localhost:3000/users?email=any@email.com' \
      -H 'token: b3xg95c3wp0ol1pk46vm'

    Token Endpoints

    Create the Token

    Request example:

    curl -X POST \
      http://localhost:3000/tokens \
      -d '{
    	"email": "any@email.com",
    	"password": "1111"
    }'
    Read the Token

    Request example:

    curl -X GET 'http://localhost:3000/tokens?id=gjfek6ha08p2x8877mno'
    Update (Prolong) the Token

    Request example:

    curl -X PUT \
      http://localhost:3000/tokens \
      -H 'Content-Type: application/json' \
      -d '{
    	"id": "gjfek6ha08p2x8877mno"
    }'
    Delete the Token

    Request example:

    curl -X DELETE 'http://localhost:3000/tokens?id=bivegzlqhs1z5q4np0yo'

    Menu Endpoint

    Get the Menu

    Request example:

    curl -X GET \
      http://localhost:3000/menus \
      -H 'token: 3c3nld8owylf927r5txu'

    Shopping Cart Endpoint

    Create Shopping Cart

    Request example:

      http://localhost:3000/carts \
      -H 'token: ket278eemafcehh9vq30'
    Read Shopping Cart

    Request example:

    curl -X GET \
      http://localhost:3000/carts \
      -H 'token: ket278eemafcehh9vq30'
    Delete Shopping Cart

    Request example:

    curl -X DELETE \
      http://localhost:3000/carts \
      -H 'token: ket278eemafcehh9vq30'

    Update Items in Shopping Cart

    Request example:

    curl -X PUT \
      http://localhost:3000/carts \
      -H 'Content-Type: application/json' \
      -H 'token: sdvr4w4e85gw8slgycnt' \
      -d '{
    	"id": 4,
    	"quantity": 2
    }
    '

    Order Endpoint

    Create the Order

    Request example:

    curl -X POST \
      http://localhost:3000/orders \
      -H 'Content-Type: application/json' \
      -H 'token: 8l06rtpic4y4kps54pe4' \
      -d '{
    	"paymentSource": "tok_mastercard"
    }'
    Read the Order

    Request example:

    curl -X GET \
      'http://localhost:3000/orders?id=un2yhgqoajzmv76fozkd' \
      -H 'token: 4dpj97yqr53druol20ru'
    Visit original content creator repository https://github.com/trekhleb/nodejs-master-class
  • lbconfig-operator

    External Load Balancer Operator

    codecov Go Bundle Go Report Card

    The LBConfig Operator, manages the configuration of External Load Balancer instances (on third-party equipment via it’s API) and creates VIPs and IP Pools with Monitors for a set of OpenShift or Kubernetes nodes like Master-nodes (Control-Plane), Infra nodes (where the Routers or Ingress controllers are located) or based on it’s roles and/or labels.

    The operator dynamically handles creating, updating or deleting the IPs of the pools in the Load Balancer based on the Node IPs for each role or label. On every change of the operator configuration (CRDs) or addition/change/removal or cluster Nodes, the operator updates the Load Balancer properly.

    The objective is to have a modular architecture allowing pluggable backends for different load balancer providers.

    To use the operator, you will need a Kubernetes cluster to run against. You can use KIND to get a local cluster for testing, or run against a remote cluster. Note: Your controller will automatically use the current context in your kubeconfig file (~/.kube/config) (i.e. whatever cluster kubectl cluster-info shows).

    Quick demo:

    Demo

    Who is it for

    The main users for this operator is enterprise deployments or clusters composed of multiple nodes having an external load-balancer providing the balancing and high-availability to access the cluster in both API and Application levels.

    High level architecture

    High Level Architecture

    Using the Operator

    Deploy the Operator to your cluster

    Apply the operator manifest into the cluster:

    kubectl apply -f https://github.com/carlosedp/lbconfig-operator/raw/v0.5.1/manifests/deploy.yaml

    This creates the operator Namespace, CRD and deployment using the latest container version. The container image is built for amd64, arm64, ppc64le and s390x architectures.

    Create ExternalLoadBalancer Instances

    Create the instances for each Load Balancer instance you need (for example one for Master Nodes and another for the Infra Nodes). If installing on OpenShift or Kubernetes with OLM (or in a different namespace), adjust the sample YAMLs to match the created namespace.

    The provider vendor field can be (case-sensitive):

    • F5_BigIP – Tested on F5 BigIP version 15
    • Citrix_ADC – Tested on Citrix ADC (Netscaler) version 13
    • HAProxy – HAProxy with Dataplane API. (Docs)
    • Dummy – Dummy backend used for testing to only print log messages on operations

    Create the secret holding the Load Balancer API user and password:

    oc create secret generic f5-creds --from-literal=username=admin --from-literal=password=admin123 --namespace lbconfig-operator-system

    After creating the CR, kubectl get output shows each ExternalLoadBalancer instance details:

    kubectl get

    Sample CRDs and Available Fields

    Master Nodes using a Citrix ADC LB:

    apiVersion: lb.lbconfig.carlosedp.com/v1
    kind: ExternalLoadBalancer
    metadata:
      name: externalloadbalancer-master-sample
      namespace: lbconfig-operator-system
    spec:
      vip: "192.168.1.40"
      type: "master"
      ports:
        - 6443
      monitor:
        path: "/healthz"
        port: 6443
        monitortype: "https"
      provider:
        vendor: Citrix_ADC
        host: "https://192.168.1.36"
        port: 443
        creds: netscaler-creds
        validatecerts: false

    Infra Nodes using a F5 BigIP LB:

    apiVersion: lb.lbconfig.carlosedp.com/v1
    kind: ExternalLoadBalancer
    metadata:
      name: externalloadbalancer-infra-sample
      namespace: lbconfig-operator-system
    spec:
      vip: "192.168.1.45"
      type: "infra"
      ports:
        - 80
        - 443
      monitor:
        path: "/healthz"
        port: 1936
        monitortype: http
      provider:
        vendor: F5_BigIP
        host: "https://192.168.1.35"
        port: 443
        creds: f5-creds
        partition: "Common"
        validatecerts: false

    To choose the nodes which will be part of the server pool, you can set either type or nodelabels fields. The yaml field type: "master" or type: "infra" selects nodes with the role label "node-role.kubernetes.io/master" and "node-role.kubernetes.io/infra" respectively. If the field nodelabels array is used instead, the operator will use nodes which match all labels.

    If you have in your cluster Infra-Nodes for different roles (for example Infra-nodes dedicated for OpenShift Data Foundation), don’t use type: "infra" config as the Load Balancer will point to all nodes with that label. Instead use the nodelabels: syntax as below specifying the correct labels for the nodes that have the routers/ingress controllers. The listed labels follow an “AND” rule.

    Clusters with sharded routers or using arbitrary labels to determine where the Ingress Controllers run can be configured like:

    spec:
      vip: "10.0.0.6"
      ports:
        - 80
      nodelabels:
        "node.kubernetes.io/ingress-controller": "production"
        "kubernetes.io/region": "DC1"
      ...

    Additional information

    Please check the additional documentation for more information like tracing, adding new providers, development, release and more.

    Disclaimers

    • The operator does not check if the requested configuration (names, IPs) already exists and/or conflicts with existing configuration in the Load Balancer. The user is responsible for these checks before deployment;
    • I am not responsible if the operator changes/deletes existing configuration on the Load Balancer if existing names are already configured.
    • The operator creates the entries(Pools, VIPs, Monitors) in the provided Load Balancer with the name of the instance configured in the CustomResource prefixed with the type. Eg. For a CR with name externalloadbalancer-master-sample, the operator creates a server pool named Pool-externalloadbalancer-master-sample-6443 (suffixed with the port), a monitor named Monitor-externalloadbalancer-master-sample and a VIP named VIP-externalloadbalancer-master-sample-6443 (suffixed with the port).
    Visit original content creator repository https://github.com/carlosedp/lbconfig-operator
  • mbojan.me

    🚀 Quick start

    1. Create a Gatsby site.

      Use the Gatsby CLI to create a new site, specifying the blog starter.

      # create a new Gatsby site using the blog starter
      gatsby new my-blog-starter https://github.com/gatsbyjs/gatsby-starter-blog
    2. Start developing.

      Navigate into your new site’s directory and start it up.

      cd my-blog-starter/
      gatsby develop
    3. Open the source code and start editing!

      Your site is now running at http://localhost:8000!

      Note: You’ll also see a second link: http://localhost:8000/___graphql. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the Gatsby tutorial.

      Open the my-blog-starter directory in your code editor of choice and edit src/pages/index.js. Save your changes and the browser will update in real time!

    🧐 What’s inside?

    A quick look at the top-level files and directories you’ll see in a Gatsby project.

    .
    ├── node_modules
    ├── src
    ├── .gitignore
    ├── .prettierrc
    ├── gatsby-browser.js
    ├── gatsby-config.js
    ├── gatsby-node.js
    ├── gatsby-ssr.js
    ├── LICENSE
    ├── package-lock.json
    ├── package.json
    └── README.md
    
    1. /node_modules: This directory contains all of the modules of code that your project depends on (npm packages) are automatically installed.

    2. /src: This directory will contain all of the code related to what you will see on the front-end of your site (what you see in the browser) such as your site header or a page template. src is a convention for “source code”.

    3. .gitignore: This file tells git which files it should not track / not maintain a version history for.

    4. .prettierrc: This is a configuration file for Prettier. Prettier is a tool to help keep the formatting of your code consistent.

    5. gatsby-browser.js: This file is where Gatsby expects to find any usage of the Gatsby browser APIs (if any). These allow customization/extension of default Gatsby settings affecting the browser.

    6. gatsby-config.js: This is the main configuration file for a Gatsby site. This is where you can specify information about your site (metadata) like the site title and description, which Gatsby plugins you’d like to include, etc. (Check out the config docs for more detail).

    7. gatsby-node.js: This file is where Gatsby expects to find any usage of the Gatsby Node APIs (if any). These allow customization/extension of default Gatsby settings affecting pieces of the site build process.

    8. gatsby-ssr.js: This file is where Gatsby expects to find any usage of the Gatsby server-side rendering APIs (if any). These allow customization of default Gatsby settings affecting server-side rendering.

    9. LICENSE: This Gatsby starter is licensed under the 0BSD license. This means that you can see this file as a placeholder and replace it with your own license.

    10. package-lock.json (See package.json below, first). This is an automatically generated file based on the exact versions of your npm dependencies that were installed for your project. (You won’t change this file directly).

    11. package.json: A manifest file for Node.js projects, which includes things like metadata (the project’s name, author, etc). This manifest is how npm knows which packages to install for your project.

    12. README.md: A text file containing useful reference information about your project.

    🎓 Learning Gatsby

    Looking for more guidance? Full documentation for Gatsby lives on the website. Here are some places to start:

    • For most developers, we recommend starting with our in-depth tutorial for creating a site with Gatsby. It starts with zero assumptions about your level of ability and walks through every step of the process.

    • To dive straight into code samples, head to our documentation. In particular, check out the Guides, API Reference, and Advanced Tutorials sections in the sidebar.

    💫 Deploy

    Deploy to Netlify

    Deploy with Vercel

    TODO

    Visit original content creator repository https://github.com/majedbojan/mbojan.me
  • openGauss_master_slave

    单机运行

    docker run -p 5432:5432 -e ‘GAUSS_USER=gauss’ -e ‘GAUSS_PASSWORD=Gauss666’ -d –name OpenGaussTest lsqtzj/openeuler_open_gauss:latest

    openGauss 高可用集群说明

    openGauss 极简版 基于openeuler/openeuler:20.03
    包括 patroni自动主备切换,haproxy 负载均衡, pgAdmin4 管理工具
    必须保证有两个以上的openGauss容器运行。

    博客地址

    https://blog.csdn.net/lsqtzj/article/details/120850420

    使用方式

    下载源码
    git clone https://github.com/CyrusZhou-CN/openGauss_master_slave.git
    cd openGauss_master_slave

    编译版本

    docker-compose -f “docker-compose-build.yml” up -d –build

    容器版本

    docker-compose -f “docker-compose.yml” up -d
    image
    image

    系统默认密码

    用户名/密码 root / root 、omm / omm

    openGauss 默认远程连接配置

    管理员 / 密码:gauss / Gauss666

    集成pgAdmin4 6.0

    http://localhost:9980/pgadmin4/browser/
    默认管理员 / 密码:admin@domain.com / admin
    image

    添加 patroni 自动主备切换

    etcd Version: 3.5.1
    patroni Version 2.0.2

    加入 HAProxy 数据库读写负载均衡

    http://localhost:7000/ 监控

    数据库配置

    haproxy:5000 读写
    haproxy:5001 读
    image

    openGauss 更新到 3.0.0 版本

    docker-compose 基本配置 放到 .env 文件中。

    添加数据持久化

    默认保存在 ./data 目录

    容器目录说明

    /opt/software/openGauss/data/db 数据库目录 /opt/software/openGauss/data/conf 配置文件目录 /opt/software/openGauss/logs 日志目录

    改进新加主机功能

    如:新添加 slave03 主机,打开docker-compose.yml 文件复制 slave02 节点的配置,用来创建新主机。

    1. 添加节点

    ...
    slave03:
        image:  lsqtzj/openeuler_open_gauss:${OPEN_GAUSS_VERSION}
        restart: always
        container_name: slave03
        hostname: slave03
        networks:
          gauss:
            ipv4_address: 10.8.0.13
        environment:
          TZ: Europe/Rome #Asia/Shanghai 时区
          GAUSS_USER: ${GAUSS_USER}
          GAUSS_PASSWORD: ${GAUSS_PASSWORD}
          NODE_NAME: datanode4
          RUN_MODE: "slave"
          HOST_NAMES: ${HOST_NAMES}
        volumes:
          - ./data/slave03/data:/opt/software/openGauss/data      
          - ./data/slave03/logs:/opt/software/openGauss/logs
        depends_on:
          - master
    ...
    

    2.修改变量

    修改 .env 文件添加新主机

    ...
    HOST_NAMES=master,slave01,slave02,slave03
    HOST_IPS=10.8.0.10,10.8.0.11,10.8.0.12
    HAPROXY_IPS=10.8.0.10,10.8.0.11,10.8.0.12,10.8.0.13
    HAPROXY_PORTS=5432,5432,5432,5432
    ...
    

    初始化数据

    只有 RUN_MODE: “master” ,首次启动容器时有效

    GAUSS_DATABASE: test # 初始化数据库 \c 切换数据库 要输入密码,所以加这个参数用来创建数据库

    volumes:
          - ./test.sql:/docker-entrypoint-initdb.d/test.sql # 初始化数据表
    
    Visit original content creator repository https://github.com/CyrusZhou-CN/openGauss_master_slave
  • CPU_Process_scheduling-and-deadlock_detection

    CPU_Process_scheduling-and-deadlock_detection

    CPU Process Scheduling and Deadlock Detection Using Bankers Algorithm


    The process scheduling is the activity of the process manager that handles the removal of the running process from the CPU and the selection of another process on the basis of a particular strategy. Process scheduling is an essential part of a Multiprogramming operating systems.


    Features of this program:

    FCFS (First come first serve): The first come, first served (commonly called FIFO ‒ first in, first out) process scheduling algorithm is the simplest process scheduling algorithm. It is rarely used in modern operating systems, but is sometimes used inside of other scheduling systems.

    SJF (Shortest Job First) : SJF can be either preemptive or non-preemptive. Preemption occurs when a new process arrives in the ready queue that has a predicted burst time shorter than the time remaining in the process whose burst is currently on the CPU. Preemptive SJF is sometimes referred to as shortest remaining time first scheduling.

    Round Robin : Round Robin is a CPU scheduling algorithm where each process is assigned a fixed time slot in a cyclic way. One of the most commonly used technique in CPU scheduling as a core. It is preemptive as processes are assigned CPU only for a fixed slice of time at most.

    Shortest Remaining Time First (SRTF) : Shortest remaining time, also known as shortest remaining time first (SRTF), is a scheduling method that is a preemptive version of shortest job next scheduling. In this scheduling algorithm, the process with the smallest amount of time remaining until completion is selected to execute.

    Deadlock detection using Banker’s algorithm : A deadlock detection algorithm is correct if it satisfies two conditions: 1) every deadlock is eventually detected (ba- sic progress property), and 2) every detected deadlock really exists, i.e., only genuine deadlocks are detected (safety prop- erty). While the first condition is intuitive, the second one needs to be explained.

    Gantt chart : A Gantt chart is a type of bar chart that illustrates a project schedule. Gantt charts illustrate the start and finish dates of the terminal elements and summary elements of a project. Terminal elements and summary elements comprise the work breakdown structure of the project.

    All of the above mentioned features and properties are supported by this program.
    It can be helpful for those having trouble in coding these algorithms.

    Visit original content creator repository
    https://github.com/mayank-k-jha/CPU_Process_scheduling-and-deadlock_detection

  • cfmt

    cfmt

    Zig’s @import("std").fmt may be good, but in some cases you just need a little bit more functionality.

    Now why not just link in libc and use sprintf() and such?
    Either because you are on some device where there isn’t (yet) a libc to link against,
    because you just don’t want to link against libc,
    or lastly because you’re using some types c doesn’t understand (u19, f128, etc.) and want a native zig solution.

    That being said, this is not a drop in replacement, the format specifiers are a little different from c’s.
    I did design them to be as close as possible though, requiring little rethinking if you’re already used to c.

    A lot of what’s written here isn’t implemented yet, I am working on it though.
    Also any ideas are appreciated, making this more feature rich would be nice :3

    Also also, I will add a build.zig.zon once this can be reasonably used as a library.
    Might even make it so you can compile it to a static/dynamic library to use with other languages.

    Format specifier

    Format specifiers in cfmt look something like this:

    "%s"     // a string
    "%.4f"   // a floating-point value rounded to 4 digits after the period
    "%-4.8i" // a left alligned integer of at least 4 and at most 8 digits

    They can be split into five parts in this exact order:
    A % character,
    flags,
    minimum width,
    precision and lastly
    the specifier.
    All besides the specifier are optional.

    The only exception to this is the specifier for writing a % character, which is %%.

    Specifiers

    Specifiers tell cfmt what kind of type you’re formatting and how you want it formatted.

    The following specifiers exist:

    Integers:

    • i: Decimal integer
    • b: Binary integer
    • o: Octal integer
    • x: Hexadecimal integer (lowercase)
    • X: Hexadecimal integer (uppercase)

    Floating-point:

    • f: Decimal floating-point

    Other:

    • s: String
    • c: Character
    • p: Pointer (hexadecimal lowercase)
    • P: Pointer (hexadecimal uppercase)

    Special:

    *cricket noises*

    For better compatibility with c’s format specifiers, d and u work the same as i.

    Minimum width

    If a minimum width is specified and the formatted string isn’t that long, the string will be padded with space characters.

    The minimum width can either be a decimal number, such as 4, 9 or 142,
    or a *, in which case an usize is read from the arguments and its value is used as the minimum width.
    If a * is used, the dynamic minimum width must be given before the value to be formatted (and the dynamic precision if used).
    Please note that the decimal number may not have a leading zero as that could interfere with the 0 flag.

    By default, the formatted contents will be right alligned (space characters on the left),
    though this behavior can be changed with the - flag.

    Precision

    What exactly precision means depends on the type to be formatted:

    If it’s a floating point value, precision is the amount of digits after the decimal separator.

    If it’s a string, precision defines the maximum amount of characters written.
    When truncation happens, the last characters are cut off.

    If it’s a character, it will be repeated precision times.
    Does it make sense to call that precision? No.
    Could it still be a useful functionality? Yes.

    For any other type, precision doesn’t do anything.

    To set the precision, a . followed by a number or a * is used, similar to minimum width except with a . character.
    Here however, the precision is put between the dynamic minimum width and value to be formatted.
    If neither a * or a number follows the ., precision is set to 0.

    Flags

    Flags change some parts of formatting.

    The following flags exist:

    • -: Allign to the left instead of right (space characters on the right)
    • +: Always write + and - sign for numeric types
    • : (space) Write a space character at start of positive numeric values
    • <: Write sign before any padding
    • 0: Pad with 0 characters instead of space characters

    Visit original content creator repository
    https://github.com/IOKG04/cfmt

  • regex4numbers

    generates regex for numbers (ge / le / in range)

    Tested against Windows / Python 3.11 / Anaconda

    pip install regex4numbers

    from regex4numbers import number_between, number_ge, number_le
    import re
    import random
    
    for _ in range(5):
        start = random.randint(-1000, 1000)
        end = random.randint(1002, 2000)
        regex = number_between(start=start, end=end, fullnumberreplacement="\\d")
        print(f"{regex=}\n")
        regexcompiled = re.compile(regex)
        for x in range(5):
            randomint = random.randint(-(start * 2), end * 2)
            regexresults = regexcompiled.findall(str(randomint))
            print(f"""start: {start} end: {end} number:{randomint} / {regexresults=}""")
            isbetween = randomint >= start and randomint < end
            anyfound = any(regexresults)
            assert isbetween == anyfound
    
    for _ in range(5):
        n = random.randint(-1000, 1000)
        ge_regex = number_ge(n=n, fullnumberreplacement="\\d")
        le_regex = number_le(n=n, fullnumberreplacement="\\d")
        print(f"{ge_regex=}\n")
        print(f"{le_regex=}\n")
    
        biggerthan = re.compile(ge_regex)
        lessthen = re.compile(le_regex)
        start = random.randint(-1000, 1000)
        end = random.randint(1002, 2000)
        for x in range(5):
            randomint = random.randint(-(start * 2), end * 2)
            regexresultsbigger_or_equal = biggerthan.findall(str(randomint))
            regexresultslessthan_or_equal = lessthen.findall(str(randomint))
            print(
                f"""n:{n} test:{randomint} bigger or equal: {regexresultsbigger_or_equal} less or equal: {regexresultslessthan_or_equal}"""
            )
            isbigger = randomint >= n
            islessthan = randomint <= n
            anyfoundbigger = any(regexresultsbigger_or_equal)
            anyfoundlessthan = any(regexresultslessthan_or_equal)
            assert isbigger == anyfoundbigger
            assert islessthan == anyfoundlessthan
        print(f"""start: {start} end: {end} number:{randomint} / {regexresults=}""")
    
    
    
    
    # regex='(?:-(?:\\b(?:1(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|2(?:(?:0\\d?|1\\d?|2\\d?|3[01]?|[456789]))?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))\\b)|(?:(?<!-)\\b(?:(?:1(?:(?:0(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|1(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|2(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|3(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|4(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|5(?:(?:0\\d?|1\\d?|2\\d?|3[01]?|[456789]))?|6\\d?|7\\d?|8\\d?|9\\d?))?|2(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|3(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|4(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|5(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|6(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|7(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|8(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|9(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|0))\\b)'
    
    # start: -231 end: 1532 number:617 / regexresults=['617']
    # start: -231 end: 1532 number:592 / regexresults=['592']
    # start: -231 end: 1532 number:793 / regexresults=['793']
    # start: -231 end: 1532 number:1662 / regexresults=[]
    # start: -231 end: 1532 number:1605 / regexresults=[]
    # regex='(?:(?<!-)\\b(?:(?:1(?:0(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?)|1(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?)|2(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?)|3(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?)|4(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?)|5(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?)|6(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?)|7(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|70?|[89])|8\\d|9\\d)|2(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|3(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?)|4(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?)|5(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?)|6(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?)|7(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?)|8(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?)|9(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?)))\\b)'
    
    # start: 30 end: 1771 number:3226 / regexresults=[]
    # start: 30 end: 1771 number:183 / regexresults=['183']
    # start: 30 end: 1771 number:1369 / regexresults=['1369']
    # start: 30 end: 1771 number:3425 / regexresults=[]
    # start: 30 end: 1771 number:1280 / regexresults=['1280']
    # regex='(?:(?<!-)\\b(?:(?:10(?:0\\d|1\\d)|3(?:3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|4(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|5(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|6(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|7(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|8(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|9(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)))\\b)'
    
    # start: 330 end: 1020 number:771 / regexresults=['771']
    # start: 330 end: 1020 number:1825 / regexresults=[]
    # start: 330 end: 1020 number:313 / regexresults=[]
    # start: 330 end: 1020 number:825 / regexresults=['825']
    # start: 330 end: 1020 number:823 / regexresults=['823']
    # regex='(?:-(?:\\b(?:1\\d?|2\\d?|3\\d?|4[0123456]?|[56789]))\\b)|(?:(?<!-)\\b(?:(?:1(?:(?:0(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|1(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|2(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|3(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|4(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|5(?:(?:0\\d?|1[012345]?|[23456789]))?|6\\d?|7\\d?|8\\d?|9\\d?))?|2(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|3(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|4(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|5(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|6(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|7(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|8(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|9(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|0))\\b)'
    
    # start: -46 end: 1516 number:967 / regexresults=['967']
    # start: -46 end: 1516 number:128 / regexresults=['128']
    # start: -46 end: 1516 number:1633 / regexresults=[]
    # start: -46 end: 1516 number:2720 / regexresults=[]
    # start: -46 end: 1516 number:466 / regexresults=['466']
    # regex='(?:(?<!-)\\b(?:(?:1(?:0(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|1(?:0\\d|1[0123]))|7(?:1[56789]|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|8(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|9(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)))\\b)'
    
    # start: 715 end: 1114 number:1520 / regexresults=[]
    # start: 715 end: 1114 number:238 / regexresults=[]
    # start: 715 end: 1114 number:1446 / regexresults=[]
    # start: 715 end: 1114 number:731 / regexresults=['731']
    # start: 715 end: 1114 number:-3 / regexresults=[]
    # ge_regex='(?:-(?:\\b(?:1(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|2(?:(?:0\\d?|1[0123456]?|[23456789]))?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?)\\b))|(?:\\b0\\b)|(?:(?<!-)(?:\\b[1-9]\\d{0,}\\b))'
    
    # le_regex='(?:-(?:\\b(?:1000|2(?:1[6789]|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|3(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|4(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|5(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|6(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|7(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|8(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|9(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d))\\b))|(?:-\\b[1-9]\\d{3,}\\b)'
    
    # n:-216 test:278 bigger or equal: ['278'] less or equal: []
    # n:-216 test:838 bigger or equal: ['838'] less or equal: []
    # n:-216 test:411 bigger or equal: ['411'] less or equal: []
    # n:-216 test:1178 bigger or equal: ['1178'] less or equal: []
    # n:-216 test:2238 bigger or equal: ['2238'] less or equal: []
    # start: 175 end: 1264 number:2238 / regexresults=[]
    # ge_regex='(?:(?<!-)(?:\\b(?:5(?:8[3456789]|9\\d)|6(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|7(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|8(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|9(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d))\\b))|(?:(?<!-)(?:\\b[1-9]\\d{3,}\\b))'
    
    # le_regex='(?:(?:\\b(?:1(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|2(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|3(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|4(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|5(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8[0123]?|9))?|6\\d?|7\\d?|8\\d?|9\\d?)\\b))|(?:\\b0\\b)|(?:-\\b[1-9]\\d{0,}\\b)'
    
    # n:583 test:623 bigger or equal: ['623'] less or equal: []
    # n:583 test:1594 bigger or equal: ['1594'] less or equal: []
    # n:583 test:779 bigger or equal: ['779'] less or equal: []
    # n:583 test:-141 bigger or equal: [] less or equal: ['-141']
    # n:583 test:836 bigger or equal: ['836'] less or equal: []
    # start: 105 end: 1284 number:836 / regexresults=[]
    # ge_regex='(?:(?<!-)(?:\\b(?:599|6(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|7(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|8(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|9(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d))\\b))|(?:(?<!-)(?:\\b[1-9]\\d{3,}\\b))'
    
    # le_regex='(?:(?:\\b(?:1(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|2(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|3(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|4(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|5(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?))?|6\\d?|7\\d?|8\\d?|9\\d?)\\b))|(?:\\b0\\b)|(?:-\\b[1-9]\\d{0,}\\b)'
    
    # n:599 test:2300 bigger or equal: ['2300'] less or equal: []
    # n:599 test:1054 bigger or equal: ['1054'] less or equal: []
    # n:599 test:2563 bigger or equal: ['2563'] less or equal: []
    # n:599 test:951 bigger or equal: ['951'] less or equal: []
    # n:599 test:509 bigger or equal: [] less or equal: ['509']
    # start: -241 end: 1532 number:509 / regexresults=[]
    # ge_regex='(?:(?<!-)(?:\\b(?:1(?:4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|2(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|3(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|4(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|5(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|6(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|7(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|8(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d)|9(?:0\\d|1\\d|2\\d|3\\d|4\\d|5\\d|6\\d|7\\d|8\\d|9\\d))\\b))|(?:(?<!-)(?:\\b[1-9]\\d{3,}\\b))'
    
    # le_regex='(?:(?:\\b(?:1(?:(?:0\\d?|1\\d?|2\\d?|3\\d?|40?|[56789]))?|2\\d?|3\\d?|4\\d?|5\\d?|6\\d?|7\\d?|8\\d?|9\\d?)\\b))|(?:\\b0\\b)|(?:-\\b[1-9]\\d{0,}\\b)'
    
    # n:140 test:2003 bigger or equal: ['2003'] less or equal: []
    # n:140 test:-141 bigger or equal: [] less or equal: ['-141']
    # n:140 test:-1048 bigger or equal: [] less or equal: ['-1048']
    # n:140 test:3098 bigger or equal: ['3098'] less or equal: []
    # n:140 test:2382 bigger or equal: ['2382'] less or equal: []
    # start: 914 end: 1579 number:2382 / regexresults=[]
    # ge_regex='(?:-(?:\\b(?:1\\d?|2\\d?|3\\d?|4\\d?|5[01234567]?|[6789])\\b))|(?:\\b0\\b)|(?:(?<!-)(?:\\b[1-9]\\d{0,}\\b))'
    
    # le_regex='(?:-(?:\\b(?:100|5[789]|6\\d|7\\d|8\\d|9\\d)\\b))|(?:-\\b[1-9]\\d{2,}\\b)'
    
    # n:-57 test:2559 bigger or equal: ['2559'] less or equal: []
    # n:-57 test:1798 bigger or equal: ['1798'] less or equal: []
    # n:-57 test:1983 bigger or equal: ['1983'] less or equal: []
    # n:-57 test:1738 bigger or equal: ['1738'] less or equal: []
    # n:-57 test:2001 bigger or equal: ['2001'] less or equal: []
    # start: -795 end: 1484 number:2001 / regexresults=[]

    Visit original content creator repository
    https://github.com/hansalemaos/regex4numbers

  • git-some-janets

    git-some-janets

    Retrieve some Janet sample code.

    “All your Janets are belong to us.”

    Installation

    First clone this repository and cd to the resulting directory:

    git clone https://github.com/sogaiu/git-some-janets
    cd git-some-janets
    

    Next, choose from one of the following methods:

    jpm

    jpm install

    bundle

    janet install

    manual

    Copy the git-some-janets.janet file somewhere on your PATH and
    make sure it has appropriate executable permissions. Some might
    prefer to remove the .janet file extension (and instructions /
    usage assume that is done).

    Usage

    Usage: git-some-janets NUMBER [STRING]
           git-some-janets STRING [NUMBER]
    
    Fetch some janet-related git repositories.
    
    Examples:
    
      # fetch 2 janet-related repositories
      git-some-janets 2
    
      # fetch janet-related repositories whose urls contain "bakpakin"
      git-some-janets bakpakin
    
      # fetch 3 janet-related repositories whose urls contain "chambers"
      git-some-janets chambers 3
      git-some-janets 3 chambers
    
    Parameters:
    
      NUMBER   maximum number of repositories to fetch (<= 0 means all
               remaining)
    
      STRING   used to match (substring) which repositories to fetch
               (STRING should not represent a number according to
               janet's `scan-number`)
    
    With NUMBER as the first argument, fetch NUMBER repositories (see
    above for what a non-positive NUMBER means).  If STRING is specified
    as a second argument, fetch up to NUMBER repositories (inclusive)
    whose urls contain STRING as a substring.
    
    With STRING as the first argument, fetch repositories whose urls
    contain STRING as a substring.  If NUMBER is specified as a second
    argument, fetch up to NUMBER repositories (inclusive) whose urls
    contain STRING as a substring (see above for what a non-positive
    NUMBER means).
    

    Explanation

    The git-some-janets script will use git to clone repositories from
    a pre-specified list. The resulting directories will live under a
    directory named repos.

    Visit original content creator repository
    https://github.com/sogaiu/git-some-janets