- Install Dependencies
npm init npm install --save-dev ts-node typescript tslib express @types/express
- Create
server.tsin root folder of your app.
| import fpdf | |
| from PyPDF2 import PdfFileWriter, PdfFileReader | |
| overlay_pdf_file_name = 'overlay_PDF.pdf' | |
| pdf_template_file_name = 'base_PDF_template.pdf' | |
| result_pdf_file_name = 'final_PDF.pdf' | |
| # This section creates a PDF containing the information you want to enter in the fields | |
| # on your base PDF. |
| '''Example of a custom ReST directive in Python docutils''' | |
| import docutils.core | |
| from docutils.nodes import TextElement, Inline | |
| from docutils.parsers.rst import Directive, directives | |
| from docutils.writers.html4css1 import Writer, HTMLTranslator | |
| class foo(Inline, TextElement): | |
| '''This node class is a no-op -- just a fun way to define some parameters. | |
| There are lots of base classes to choose from in `docutils.nodes`. |
| # 05_aiohttp.py | |
| from aiohttp import web | |
| from aiohttp.web_log import AccessLogger | |
| from asyncio import CancelledError | |
| from contextvars import ContextVar | |
| import asyncio | |
| import logging | |
| import secrets |
| use std::io::{BufRead}; | |
| struct Processor<B: BufRead> { | |
| reader: B | |
| } | |
| // If you uncomment p in ValidatorA, compilation fails because the size of | |
| // ValidatorA can't be determined at compile time. Fair enough. | |
| struct ValidatorA { | |
| // p : Processor<BufRead> |
| use std::io::{self,BufRead,BufReader}; | |
| enum Utf8DecoderError<'a> { | |
| InvalidBytes(&'a [u8]), | |
| Io(io::Error), | |
| } | |
| struct Utf8Decoder<B: BufRead> { | |
| reader : B, | |
| bytes_read: usize |
| namespace YourNamespace | |
| { | |
| /// <summary> | |
| /// Uses the Name value of the <see cref="ColumnAttribute"/> specified to determine | |
| /// the association between the name of the column in the query results and the member to | |
| /// which it will be extracted. If no column mapping is present all members are mapped as | |
| /// usual. | |
| /// </summary> | |
| /// <typeparam name="T">The type of the object that this association between the mapper applies to.</typeparam> | |
| public class ColumnAttributeTypeMapper<T> : FallbackTypeMapper |
| from sre_parse import Pattern, SubPattern, parse as sre_parse | |
| from sre_compile import compile as sre_compile | |
| from sre_constants import BRANCH, SUBPATTERN | |
| class Scanner(object): | |
| def __init__(self, tokens, flags=0): | |
| subpatterns = [] | |
| pat = Pattern() |
| import datetime | |
| from django.conf import settings | |
| from django.contrib.auth import logout | |
| from django.contrib.auth.models import User | |
| from django.contrib.sessions.models import Session | |
| from django.http import HttpRequest | |
| from django.utils.importlib import import_module | |