SQL-LIKE and wildcards

Se_en represents a pattern with a wildcard character. The _ means you can substitute any individual character here without breaking the pattern. The names Seven and Se7en both match this pattern.

The percentage sign % is another wildcard character that can be used with LIKE.

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)

Internet access in Android

If You want to access some internet resouces from your Android app you add

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

to your AndroidManifest.xml

When You have resources which do not use TLS (https but just http) you have to add

<application
        ...
        android:usesCleartextTraffic="true">
</application>