Resistors and Color Code

Resistors with 4 rings

Color 1. Ring 2. Ring 3. Ring – Multiplier 4. Ring – Tolerance
black 0 1 x 1
brown 1 1 x 10 1 %
red 2 2 x 100 2 %
orange 3 3 x 1.000
yellow 4 4 x 10.000
green 5 5 x 100.000 0.5%
blue 6 6 x 1.000.000 0.25%
purple 7 7 x 10.000.000 0.1%
grey 8 8
white 9 9
gold x 0,1 5%
silver x0,01 10%

Resistors with 5 rings

Color 1. Ring 2. Ring 3. Ring 4. Ring – Multiplier 5. Ring – Tolerance
black 0 0 0 x 1
brown 1 1 1 x 10 1 %
red 2 2 2 x 100 2 %
orange 3 3 3 x 1.000
yellow 4 4 4 x 10.000
green 5 5 5 x 100.000 0.5%
blue 6 6 6 x 1.000.000 0.25%
purple 7 7 7 x 10.000.000 0.1%
grey 8 8 8
white 9 9 9
gold x 0,1 5%
silver x0,01 10%

Calculator for Resistor Values

Calculator for 4 rings

1. Ring 2. Ring 3. Ring 4. Ring Value Tolerance
0Ω 0%

Calculator for 5 rings

1. Ring 2. Ring 3. Ring 4. Ring 5. Ring Value Tolerance
0Ω 0%

Invalid Host Header with npm run server

I got an “Invalid Host Header” error when running a VueJs app on a linux machine with npm run serve.

To work around this you can put the following code into you vue.config.js file:

module.exports = {
    // options...
    devServer: {
        disableHostCheck: true,
    }
}

Flask 1.1 is here!

From the flask release notes:

Returning a dict from a view function will produce a JSON response. This makes it even easier to get started building an API.

To get a minimal REST-Api all you have to do is:

from flask import Flask

app = Flask(__name__)

@app.route('/return_dict', methods=['GET'])
def return_dict():
    return {"x": "1"}


if __name__ == '__main__':
    app.run(debug=True)