A short example showing asyncio semaphores
import asyncio
import time
from random import random
async def my_coroutine(sem,task_id):| import math | |
| import asyncio | |
| import logging, sys | |
| import sqlite3 | |
| from asyncio import sleep | |
| from logging.handlers import TimedRotatingFileHandler | |
| import aiohttp_cors | |
| import aiosqlite | |
| import socketio |
| # -*- coding: utf-8 -*- | |
| """ | |
| Created on Sun Jan 31 11:03:57 2013 | |
| @author: Sukhbinder | |
| https://sukhbinder.wordpress.com/2022/08/21/principal-component-analysis-with-numpy/ | |
| """ | |
| import numpy as np |
How to create a user, a database and grant all privileges on the new database?
sudo -u postgres psql
postgres=# CREATE DATABASE mydb;
postgres=# CREATE USER myuser WITH ENCRYPTED PASSWORD 'mypass';
postgres=# GRANT ALL PRIVILEGES ON DATABASE mydb TO myuser;
postgres=# GRANT ALL ON SCHEMA public TO myuser;Install latest version
sudo apt install postgresql-16 postgresql-client-16List clusters
sudo pg_lsclusters| # taken from here: http://web.archive.org/web/20110527163743/https://svn.enthought.com/enthought/browser/sandbox/docs/coding_standard.py | |
| """ This module is an example of the Enthought Python coding standards. | |
| It was adapted from the Python Enhancement Proposal 8 (aka PEP 8) titled | |
| 'Style Guide for Python Code' (http://www.python.org/peps/pep-0008.html). | |
| The first item in a module must be a documentation string (docstring). The | |
| first line of the docstring should be a one line summary. If a more | |
| detailed description is required, put an empty line before it. |