Create a new directory for your article.
mkdir my-article
cd my-article
| """The database interface. | |
| Please see schema.sql for the schema of the tables. | |
| """ | |
| from pathlib import Path | |
| import sqlite3 | |
| import sys | |
| from . import config | |
| def query(q, parameters=[]): |
| import Square (square); | |
| module body Main is | |
| function main(): ExitCode is | |
| let n: Int32 := 5; | |
| let n2:Int32 := square(n); | |
| printLn(n2); | |
| return ExitSuccess(); |
| from kutty import Page, Table, Code, html | |
| from _demo import Demo | |
| page = Page("Bootstrap") | |
| page << html.p(""" | |
| bootstrap experiments. | |
| """) |
| from functools import reduce | |
| LEN = lambda items: reduce(lambda n, _: n + 1, items, 0) | |
| REVERSE = lambda items: reduce(lambda rev, item: [item, *rev], items, []) | |
| MAP = lambda func, items: reduce(lambda result, item: [*result, func(item)], items, []) | |
| FILTER = lambda func, items: reduce(lambda result, item: [*result, item] if func(item) else result, items, []) | |
| APPEND = lambda items, value: reduce(lambda result, item: [*result, item], [value], items) |
| create table station ( | |
| code text primary key, | |
| name text, | |
| zone text, | |
| state text, | |
| address text, | |
| latitude real, | |
| longitude real | |
| ); |
The resource for this talk will be updated here soon.
| def test_sendmail(monkeypatch): | |
| emails = [] | |
| def mock_sendmail(self, from_addr, to_addrs, msg, mail_options=(), rcpt_options=()): | |
| emails.append(dict(from_addr=from_addr, to_addrs=to_addrs, msg=msg)) | |
| monkeypatch.setattr(smtplib.SMTP, "sendmail", mock_sendmail) | |
| frappe.sendmail( |