Source: https://wiki.archlinux.org/index.php/PostgreSQL
-
Install postgresql package
sudo pacman -S postgresql
-
Switch to the postgres user account and initialize the database cluster:
sudo -iu postgres
from azure.monitor.opentelemetry.exporter import AzureMonitorTraceExporter | |
from fastapi import FastAPI, Request | |
from fastapi.responses import JSONResponse | |
from opentelemetry.context import get_current as get_current_context | |
from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor | |
from opentelemetry.sdk.trace import TracerProvider, _Span | |
from opentelemetry.sdk.trace.export import (BatchSpanProcessor, | |
ConsoleSpanExporter, | |
SimpleSpanProcessor) | |
from starlette.exceptions import HTTPException as StarletteHTTPException |
{ | |
"extensions": [ | |
{ | |
"id": "10", | |
"lang": "de", | |
"source": "Wie Manga!" | |
}, | |
{ | |
"id": "100019686565354829", | |
"lang": "de", |
from django.contrib.auth.models import AbstractUser | |
from django.db import models | |
from django.urls import reverse | |
from django.utils.translation import gettext_lazy as _ | |
class User(AbstractUser): | |
class Types(models.TextChoices): | |
SPY = "SPY", "Spy" | |
DRIVER = "DRIVER", "Driver" |
from datetime import datetime | |
""" | |
Called during request: | |
process_request(request) | |
process_view(request, view_func, view_args, view_kwargs) | |
Called during response: | |
process_exception(request, exception) (only if the view raised an exception) | |
process_template_response(request, response) (only for template responses) |
from django.contrib import admin | |
from django.contrib.auth.admin import UserAdmin as DjangoUserAdmin | |
from django.utils.translation import ugettext_lazy as _ | |
from .models import User | |
@admin.register(User) | |
class UserAdmin(DjangoUserAdmin): |
Source: https://wiki.archlinux.org/index.php/PostgreSQL
Install postgresql package
sudo pacman -S postgresql
Switch to the postgres user account and initialize the database cluster:
sudo -iu postgres
The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.
The correct way of creating a private frok by duplicating the repo is documented here.
For this assignment the commands are:
git clone --bare [email protected]:usi-systems/easytrace.git
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
Commit type | Emoji |
---|---|
Initial commit | ๐ :tada: |
Version tag | ๐ :bookmark: |
New feature | โจ :sparkles: |
Bugfix | ๐ :bug: |
I'm going to cover a simple, but effective, utility for managing state and transitions (aka workflow). We often need to store the state (status) of a model and it should only be in one state at a time.
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |