Blog

  • react-dotenv

    react-dotenv

    Load environment variables dynamically for your React applications created with create-react-app.

    This will create a env.js file in your public and build directories, which will expose your environment variables you want in the global window.env variable.
    It will also take care of configuring the index.html file present in those directories to load that file.

    Installation

    npm install @ludovicm67/react-dotenv

    Usage

    Setup your project

    Create a .env file at the root of your project, with some relevant values, like this:

    API_URL=https://example.com
    SOME_OTHER_VARIABLE=foo

    Open your project’s package.json file and add:

    • the react-dotenv command to your start and build scripts.
    • the react-dotenv.whitelist property to specify which variables you need to be exposed.

    Here is an example:

    package.json:

    {
      // …other fields
    
      "scripts": {
        "start": "react-dotenv && react-scripts start", // <-- append command
        "build": "react-dotenv && react-scripts build", // <-- append command
        "test": "react-scripts test",
        "eject": "react-scripts eject"
      },
    
      // …some other fields
    
      // Add the react-dotenv configuration
      "react-dotenv": {
        "whitelist": ["API_URL"]
      }
    }

    Access environment variables from your code

    You can start the development server using the following command:

    npm run start

    Now your project have the environment variables loaded globally in the window.env property.

    You can access the environment variables from your code in two ways:

    Using the @ludovicm67/react-dotenv library

    import React from "react";
    import env from "@ludovicm67/react-dotenv";
    
    const MyComponent = () => {
      return <div>{ env.API_URL }</div>;
    };
    
    export default MyComponent;

    Using the window.env global variable

    import React from "react";
    
    const MyComponent = () => {
      return <div>{ window.env.API_URL }</div>;
    };
    
    export default MyComponent;

    Known limitations

    This only supports one environment (so only one .env file) and is not meant to do more.

    Attributions

    Forked from jeserodz/react-dotenv.

    Reasons:

    • upgrade dependencies
    • use ESM
    • fix TypeScript types
    • fix the import of the env.js file in the index.html files

    Visit original content creator repository
    https://github.com/ludovicm67/react-dotenv

  • CystoImageClassification

    Efficient Real-time Video Frame Classification for Bladder Lesion


    The scripts are divided into two components:

    1. Model training and evaluation
    2. Real-time Illumination Adapted Bladder Lesion Detection Framework for Cystoscopy Videos.
    • To install, we will need Python installed; some Python packages are required and can be installed by running the following command line:
        ./install_packages.sh
    
    • To Run, there are two options:

      1. Process a folder with cystoscopy videos
      run_exp.sh
      
      1. Process in real-time from the video input
      run_real_time.sh
      

    NOTES

    • The real-time framework supports ONNX (Pytorch/TensorFlow models are convertible to ONNX format).

    • The real-time framework incorporates the use of OpenGL to leverage hardware acceleration for efficient graphical augmentation.

    • You need to convert the TensorFlow format to ONNX format for better performance and deployment.

    • CycleGAN was used to optimize the color space for the development set.


    If you have issues, please get in touch with us or open a thread in the issues section.

    Please cite when using this framework in your work:

    Efficient Augmented Intelligence Framework for Bladder Lesion Detection
    Okyaz Eminaga, Timothy Jiyong Lee, Mark Laurie, T. Jessie Ge, Vinh La, Jin Long, Axel Semjonow, Martin Bogemann, Hubert Lau, Eugene Shkolyar, Lei Xing, and Joseph C. Liao
    JCO Clinical Cancer Informatics 2023:7 [https://ascopubs.org/doi/abs/10.1200/CCI.23.00031]

    Visit original content creator repository
    https://github.com/oeminaga/CystoImageClassification

  • Identity-Fraud-Protection-Service-Comparison

    Identity Fraud Protection Service Comparison

    A comprehensive comparison of identity fraud protection services in 2025. It helps you choose the best tools to avoid data-brokered, big-tech-linked identity protection services, while promoting truly independent, privacy-focused alternatives.

    Overview

    This repository is a comprehensive comparison of identity fraud protection services in 2025. It helps you choose the best tools to avoid data-brokered, big-tech-linked identity protection services, while promoting truly independent, privacy-focused alternatives.

    Key Features

    • Effectiveness: Do these services actually protect your identity?

    • Cost Analysis: Are they worth the price?

    • Ease of Use: How user-friendly are they?

    • Transparency: Do they operate with integrity?

    Services Compared

    • Reliable Tools: IDShield

    • Tools to Avoid: Ineffective, overpriced options, data-brokered, big-tech-linked identity protection services

    Why This Matters

    • Protect Your Data: In the U.S there are tons of data breaches happening and you need to be made aware and have some type of insurance and protection incase you suffer from identity theft.

    • Save Time: Avoid wasting effort on tools that don’t work.

    • Make Informed Decisions: Understand the pros and cons of each service.

    How to Use

    1. Review the comparison sheets for details.

    2. Choose the best service for your privacy needs.

    3. Share feedback or suggest tools to include!


    Contributing

    Have a tool or feedback to share? Submit an issue or open a pull request.

    Visit original content creator repository
    https://github.com/Jeyso215/Identity-Fraud-Protection-Service-Comparison

  • MARC-Parser-XML

    NAME

    MARC::Parser::XML – Parser for MARC XML records

    Build Status Coverage Status Kwalitee Score

    SYNOPSIS

    use MARC::Parser::XML;
    
    my $parser = MARC::Parser::XML->new( 't/marc.xml' );
    
    while ( my $record = $parser->next() ) { 
        # do something ...
    }
    

    DESCRIPTION

    MARC::Parser::XML is a lightweight, fault tolerant parser for MARC XML records. Tags, indicators and subfield codes are not validated against the MARC standard. The resulting data structure is optimized for usage with the Catmandu data tool kit.

    MARC

    The MARC record is parsed into an ARRAY of ARRAYs:

    $record = [
            [ 'LDR', undef, undef, '_', '00661nam  22002538a 4500' ],
            [ '001', undef, undef, '_', 'fol05865967 ' ],
            ...
            [   '245', '1', '0', 'a', 'Programming Perl /',
                'c', 'Larry Wall, Tom Christiansen & Jon Orwant.'
            ],
            ...
        ];
    

    METHODS

    new($file|$fh|$xml)

    Configuration

    • file

      Path to file with MARC XML records.

    • fh

      Open filehandle for MARC XML records.

    • xml

      XML string.

    next()

    Reads the next record from MARC input.

    _decode($record)

    Deserialize a raw MARC record to an ARRAY of ARRAYs.

    AUTHOR

    Johann Rolschewski jorol@cpan.org

    COPYRIGHT

    Copyright 2016- Johann Rolschewski

    LICENSE

    This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

    SEE ALSO

    Visit original content creator repository https://github.com/jorol/MARC-Parser-XML
  • CZ4034-IR

    Visit original content creator repository
    https://github.com/AKSHAT-SHARMA09/CZ4034-IR

  • Learn-COBOL


    COBOLOGO.PNG

    Learning COBOL (programming language)

    This section will go over my knowledge of the COBOL programming language. I am not very experienced with it, and likely won’t dedicate too much time to it, since it is obsolete, and only used by dinosaur mainframe computers in businesses and governments who refuse to update from an 8 bit system while the rest of the world uses (rarely:32 bit) 64 bit and 128 bit systems. Enough bashing of the language with jargon terms, so far I actually like writing in it for some reason. It isn’t as productive as C or Python though, so I prefer to stick with a newer, modern language.

    Printing out to the screen in COBOL

    In COBOL, to print to the screen you use the DISPLAY keyword like so:

    DISPLAY "Sample text".

    Comments in COBOL

    COBOL comments are written like so:

    *> COBOL only supports single line comments

    Hello World in COBOL

    Out of this example, I can only memorize the DISPLAY keyword. Here is the standard Hello World program in COBOL

           IDENTIFICATION DIVISION.
           PROGRAM-ID. hello-world.
           PROCEDURE DIVISION.
               DISPLAY "Hello, world!"
               .

    End of line

    In COBOL, a . must be placed at the end of every line. It is the languages equivalent to a semicolon. It is done like so:

    DISPLAY "EOL".

    Other knowledge of the COBOL programming language

    1. COBOL stands for COmmon Business Oriented Language

    2. COBOL uses the .cob .cbl and .cpy file extension, and according to Notepad++ it also uses the .cdc file format.

    3. The Jargon file refers to COBOL as “a language for dinosaur computers”

    4. COBOL is considered archaic by its own developers since the 1970s (specifically after the release of the C programming language) but it is still used by too many industries (over 5 billion lines of code written annually, over 200 billion lines of COBOL in total)

    5. COBOL is NOT a semicolon and curly bracket language

    6. No other knowledge of the COBOL programming language.


    Visit original content creator repository https://github.com/seanpm2001/Learn-COBOL
  • pvpcbill

    PyPi Wheel Travis Status codecov

    pvpcbill

    Electrical billing simulation for small consumers in Spain using PVPC (electricity hourly prices).

    It uses aiopvpc to download PVPC data, and the usual suspects (pandas & matplotlib) to deal with time-series data and plotting.

    Buy Me A Coffee donate button

    Install

    Install from pypi with pip install pvpcbill, or clone it to run tests or anything else 😉

    Usage

    From a jupyter notebook, just call the create_bill async helper to instantiate a new ‘bill’ object:

    from pvpcbill import create_bill
    
    # Creación directa de factura
    factura = await create_bill(
        path_csv_consumo="/path/to/elec_data/consumo_facturado18_02_2020-18_03_2020-R.csv",
        potencia_contratada=4.6,  # kW
        tipo_peaje="NOC",         # GEN / NOC / VHC
        zona_impuestos="IVA",     # IVA / IGIC / IPSI
    )
    
    print(factura)

    ** If using it from a non-async script, use asyncio.run(create_bill(**params)) to run the async method.

    Output:

    FACTURA ELÉCTRICA:
    --------------------------------------------------------------------------------
    * CUPS             	        ES0012345678901234SN
    * Fecha inicio             	17/02/2020
    * Fecha final              	18/03/2020
    * Peaje de acceso          	2.0DHA (Nocturna)
    * Potencia contratada      	4.60 kW
    * Consumo periodo          	472.93 kWh
    * ¿Bono Social?            	No
    * Equipo de medida         	0.80 €
    * Impuestos                	Península y Baleares (IVA)
    * Días facturables         	30
    --------------------------------------------------------------------------------
    
    - CÁLCULO DEL TÉRMINO FIJO POR POTENCIA CONTRATADA:
      Peaje acceso potencia:
       4.60 kW x 0.103944 €/kW/día x 30 días (366/2020) = 14.34 €
      Comercialización:
       4.60 kW x 0.008505 €/kW/día x 30 días (366/2020) = 1.17 €
      ==> Término fijo                                                     15.51 €
    
    - CÁLCULO DEL TÉRMINO VARIABLE POR ENERGÍA CONSUMIDA (TARIFA 2.0DHA):
        Periodo 1: 0.111867 €/kWh                             ---> 19.02€(P1)
        - Peaje de acceso:     170 kWh * 0.062012 €/kWh = 10.54€
        - Coste de la energía: 170 kWh * 0.049855 €/kWh = 8.48€
        Periodo 2: 0.045617 €/kWh                             ---> 13.82€(P2)
        - Peaje de acceso:     303 kWh * 0.002215 €/kWh = 0.67€
        - Coste de la energía: 303 kWh * 0.043402 €/kWh = 13.15€
      ==> Término de consumo                                               32.84 €
    
    - IMPUESTO ELÉCTRICO:
        5.11269632% x (15.51€ + 32.84€ = 48.35€)                           2.47 €
      ==> Subtotal                                                         50.82 €
    
    - EQUIPO DE MEDIDA:
        30 días x 0.026667 €/día                                           0.80 €
      ==> Importe total                                                    51.62 €
    
    - IVA O EQUIVALENTE:
        21% de 51.62€                                                      10.84 €
    
    ################################################################################
    # TOTAL FACTURA                                                        62.46 €
    ################################################################################
    Consumo medio diario en el periodo facturado: 2.08 €/día
    

    But there is much more:

    # Reparto de costes en la factura
    p_imp = (
        + factura.data.termino_impuesto_electrico
        + factura.data.termino_equipo_medida
        + factura.data.termino_iva_total
    ) / factura.data.total
    p_ener = factura.data.termino_variable_total / factura.data.total
    p_pot = factura.data.termino_fijo_total / factura.data.total
    
    print(
        f"El coste de la factura se reparte en:\n  "
        f"* un {100*p_ener:.1f} % por energía consumida,\n  "
        f"* un {100*p_pot:.1f} % por potencia contratada,\n  "
        f"* un {100*p_imp:.1f} % por impuestos aplicados\n\n"
    )
    
    print(factura.data.to_json())

    Output:

    El coste de la factura se reparte en:
      * un 52.6 % por energía consumida,
      * un 24.8 % por potencia contratada,
      * un 22.6 % por impuestos aplicados
    
    {
      "config": {
        "tipo_peaje": "NOC",
        "potencia_contratada": 4.6,
        "con_bono_social": false,
        "zona_impuestos": "IVA",
        "alquiler_anual": 9.72,
        "impuesto_electrico": 0.0511269632,
        "cups": "ES0012345678901234SN"
      },
      "num_dias_factura": 30,
      "start": "2020-02-17 00:00:00",
      "end": "2020-03-18 00:00:00",
      "periodos_fact": [
        {
          "billed_days": 30,
          "year": 2020,
          "termino_fijo_peaje_acceso": 14.34,
          "termino_fijo_comercializacion": 1.17,
          "termino_fijo_total": 15.51,
          "energy_periods": [
            {
              "name": "P1",
              "coste_peaje_acceso_tea": 10.544458468,
              "coste_energia_tcu": 8.477372039999999,
              "energia_total": 170.03900000000002
            },
            {
              "name": "P2",
              "coste_peaje_acceso_tea": 0.67090578,
              "coste_energia_tcu": 13.146024950000003,
              "energia_total": 302.892
            }
          ]
        }
      ],
      "descuento_bono_social": 0.0,
      "termino_impuesto_electrico": 2.47,
      "termino_equipo_medida": 0.8,
      "termino_iva_gen": 10.6722,
      "termino_iva_medida": 0.168,
      "termino_iva_total": 10.84,
      "total": 62.46
    }

    Examples

    Visit original content creator repository https://github.com/azogue/pvpcbill
  • HoloLibrary

    HoloLibrary

    https://www.youtube.com/watch?v=9DTfkaS22y4

    Advisor: Prof. Hanspeter Pfister
    Acknowledgments: Many thanks to Johanna Beyer and Ronell Sicat for their help and support.

    MIT License

    Copyright (c) 2018 Zona Kostic, Ronell Sicat, Johanna Beyer, and Hanspeter Pfister

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

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

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

    Visit original content creator repository
    https://github.com/zonakostic/HoloLibrary2018

  • websocket

    Custom WebSocket implementation library

    ci Go Reference go-version code-size total-lines

    Alt text

    Motivation

    The main purpose of this developed package is education. I hold the rule which means if you want to figure out or understand something, you should to try to implement it. In the process of implementation I kept to this article and RFC 6455.

    Description

    This package is a custom WebSocket implementation library. It includes set of types, functions and methods using which you can easily create both client-side and server-side applications which can communicate on the WebSocket protocol.

    Features that have already been done:

    • ✅ Framing
    • ✅ Pings/Pongs
    • ✅ Reserved Bits
    • ✅ Opcodes
    • ✅ Fragmentation
    • ✅ UTF-8 Handling
    • ✅ Limits/Performance
    • ✅ Opening and Closing Handshake

    What’s not done:

    • ❌ Compression

    Testing

    For testing package I used Autobahn library. If you want to look at the Autobahn’s report you should clone this repository and run test suites (make test) being in the folder with the project.

    Installation

    $ go get github.com/Mort4lis/websocket

    How to use

    Simple server

    package main
    
    import (
    	"log"
    	"net/http"
    
    	"github.com/Mort4lis/websocket"
    )
    
    func handler(w http.ResponseWriter, req *http.Request) {
    	conn, err := websocket.Upgrade(w, req)
    	if err != nil {
    		return
    	}
    
    	defer func() {
    		_ = conn.Close()
    	}()
    
    	for {
    		typ, payload, err := conn.ReadMessage()
    		if err != nil {
    			log.Println(err)
    			return
    		}
    
    		if err = conn.WriteMessage(typ, payload); err != nil {
    			log.Println(err)
    			return
    		}
    	}
    }

    Simple client

    package main
    
    import (
    	"log"
    	"time"
    
    	"github.com/Mort4lis/websocket"
    )
    
    func main() {
    	dialer := &websocket.Dialer{
    		HandshakeTimeout: 10 * time.Second,
    	}
    
    	conn, err := dialer.Dial("ws://127.0.0.1:8080")
    	if err != nil {
    		log.Fatal(err)
    	}
    	defer func() {
    		_ = conn.Close()
    	}()
    
    	typ, payload, err := conn.ReadMessage()
    	if err != nil {
    		log.Fatal(err)
    	}
    	
    	if err = conn.WriteMessage(typ, payload); err != nil {
    		log.Fatal(err)
    	}
    }

    For more detailed information please visit documentation.

    Visit original content creator repository https://github.com/Mort4lis/websocket
  • websocket

    Custom WebSocket implementation library

    ci Go Reference go-version code-size total-lines

    Alt text

    Motivation

    The main purpose of this developed package is education. I hold the rule which means if you want to figure out or understand something, you should to try to implement it. In the process of implementation I kept to this article and RFC 6455.

    Description

    This package is a custom WebSocket implementation library. It includes set of types, functions and methods using which you can easily create both client-side and server-side applications which can communicate on the WebSocket protocol.

    Features that have already been done:

    • ✅ Framing
    • ✅ Pings/Pongs
    • ✅ Reserved Bits
    • ✅ Opcodes
    • ✅ Fragmentation
    • ✅ UTF-8 Handling
    • ✅ Limits/Performance
    • ✅ Opening and Closing Handshake

    What’s not done:

    • ❌ Compression

    Testing

    For testing package I used Autobahn library. If you want to look at the Autobahn’s report you should clone this repository and run test suites (make test) being in the folder with the project.

    Installation

    $ go get github.com/Mort4lis/websocket

    How to use

    Simple server

    package main
    
    import (
    	"log"
    	"net/http"
    
    	"github.com/Mort4lis/websocket"
    )
    
    func handler(w http.ResponseWriter, req *http.Request) {
    	conn, err := websocket.Upgrade(w, req)
    	if err != nil {
    		return
    	}
    
    	defer func() {
    		_ = conn.Close()
    	}()
    
    	for {
    		typ, payload, err := conn.ReadMessage()
    		if err != nil {
    			log.Println(err)
    			return
    		}
    
    		if err = conn.WriteMessage(typ, payload); err != nil {
    			log.Println(err)
    			return
    		}
    	}
    }

    Simple client

    package main
    
    import (
    	"log"
    	"time"
    
    	"github.com/Mort4lis/websocket"
    )
    
    func main() {
    	dialer := &websocket.Dialer{
    		HandshakeTimeout: 10 * time.Second,
    	}
    
    	conn, err := dialer.Dial("ws://127.0.0.1:8080")
    	if err != nil {
    		log.Fatal(err)
    	}
    	defer func() {
    		_ = conn.Close()
    	}()
    
    	typ, payload, err := conn.ReadMessage()
    	if err != nil {
    		log.Fatal(err)
    	}
    	
    	if err = conn.WriteMessage(typ, payload); err != nil {
    		log.Fatal(err)
    	}
    }

    For more detailed information please visit documentation.

    Visit original content creator repository https://github.com/Mort4lis/websocket