Skip to content

Instantly share code, notes, and snippets.

@nedbat
nedbat / calendar.md
Last active November 12, 2023 07:35 — forked from Aditya-Jyoti/calendar.md
VIEW

January

	|Mon|Tue|Wed|Thu|Fri|Sat|Sun|
	|:-:|:-:|:-:|:-:|:-:|:-:|:-:|

|27|28|29|30|31|1|2|

<details>
<summary>(sleep 30; exit 17)</summary>
```
```
<details>
<summary>ls -l</summary>
import gc
import threading
def thread_main():
return 1
def work():
ts = [threading.Thread(target=thread_main) for _ in range(3)]
for t in ts:
t.start()
@nedbat
nedbat / gist:f09c9767067e4b5c3bca01e369d1a4d7
Created April 13, 2016 15:44
Demonstration of zip being its own inverse
Python 3.5.1 (default, Dec 7 2015, 06:25:20)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.1.76)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> a = list(range(5))
>>> b = list(range(100, 105))
>>> a
[0, 1, 2, 3, 4]
>>> b
[100, 101, 102, 103, 104]
>>> ab = list(zip(a, b))
Welcome!
Tables:
1: Beginning Learners
2: Machine Learning
3: etc.
from coverage.debug import NoDebugging
from coverage.sqldata import SqliteDb
db = SqliteDb("cov.db", NoDebugging())
with db:
db.executescript("CREATE TABLE coverage_schema (\n -- One row, to record the version of the schema in this db.\n version integer\n);\n\nCREATE TABLE meta (\n -- Key-value pairs, to record metadata about the data\n key text,\n value text,\n unique (key)\n -- Keys:\n -- 'has_arcs' boolean -- Is this data recording branches?\n -- 'sys_argv' text -- The coverage command line that recorded the data.\n -- 'version' text -- The version of coverage.py that made the file.\n -- 'when' text -- Datetime when the file was created.\n);\n\nCREATE TABLE file (\n -- A row per file measured.\n id integer primary key,\n path text,\n unique (path)\n);\n\nCREATE TABLE context (\n -- A row per context measured.\n id integer primary key,\n context text,\n unique (context)\n);\n\nCREATE TABLE line_bits (\n -
Verifying my Blockstack ID is secured with the address 1BiZLepEsXvm4QCUadQQGNt6W9FxGhA8UN https://explorer.blockstack.org/address/1BiZLepEsXvm4QCUadQQGNt6W9FxGhA8UN
cwd is now '/home/jenkins/workspace/edx-platform-test-subset'
New process: executable: /home/jenkins/edx-venv/bin/python
New process: cmd: /home/jenkins/edx-venv/lib/python2.7/site-packages/pytest.py --junitxml=/home/jenkins/workspace/edx-platform-test-subset/reports/common/lib/capa/shard_3/nosetests.xml --verbose -s -p no:randomly -a not shard common/lib/capa --cov --cov-report=
New process: pid: 3340, parent pid: 3339
00003340 0000 0000 __init__(source=None, config_file='.coveragerc', branch=None)
00003340 0000 0001 erase()
-- config ----------------------------------------------------
_include: None
_omit: None
attempted_config_files: .coveragerc
# For Drawbot
import os
canvas_h = 300
canvas_w = canvas_h * 2
n_frames = 40
grid = 10
def new_page():
newPage(canvas_w, canvas_h)
#!/usr/bin/env python3.6
#
# For the full story: http://nedbatchelder.com/blog/201612/finding_test_coupling.html
#
import re
def read_output(filename):
failed = False
test_names = []