The resource for this talk will be updated here soon.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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=[]): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Square (square); | |
module body Main is | |
function main(): ExitCode is | |
let n: Int32 := 5; | |
let n2:Int32 := square(n); | |
printLn(n2); | |
return ExitSuccess(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kutty import Page, Table, Code, html | |
from _demo import Demo | |
page = Page("Bootstrap") | |
page << html.p(""" | |
bootstrap experiments. | |
""") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table station ( | |
code text primary key, | |
name text, | |
zone text, | |
state text, | |
address text, | |
latitude real, | |
longitude real | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( |
NewerOlder