This shows how to automatically add r to docstrings containing \.
Just run python code-slightly-modified.py [path to your Python file]. It will modify the code in-place.
Note: keep a backup copy of your code before running the script!
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <script src="https://colorjs.io/dist/color.global.js"></script> | |
| <style> | |
| body { | |
| margin: 0; | |
| padding: 0; | |
| height: 100vh; |
| // ==UserScript== | |
| // @name Auto-Click Popover Comment Button (Suppress Original Click) | |
| // @namespace http://tampermonkey.net/ | |
| // @version 1.1 | |
| // @description When a comment-add button is clicked, prevent its default behavior and instead click the corresponding popover comment button. | |
| // @author user202729 | |
| // @match https://*.stackoverflow.com/* | |
| // @match https://*.stackexchange.com/* | |
| // @match https://*.superuser.com/* | |
| // @match https://stackapps.com/* |
| #!/usr/bin/env python3 | |
| """ | |
| This script shows the solution of a bit–vector constraint problem using | |
| two different methods. | |
| • solve_with_z3(constraints, variables) uses Z3 directly. | |
| • solve_with_pysat(constraints, variables) first applies bit-blasting and Tseitin CNF | |
| transformation in Z3, then uses PySAT to solve the CNF and reconstructs the model. | |
| A demonstration is provided in main(). |
| A | |
| B |
When sig_on() … sig_off() is used, to clean up resources when something is interrupted,
don't use sig_on_no_except(). Instead use nested try … finally:
cpdef void matrix_multiply_interruptable_3(np.ndarray[np.int_t, ndim=2] c, np.ndarray[np.int_t, ndim=2] a, np.ndarray[np.int_t, ndim=2] b):
debug_print("allocate")
try:
sig_on()| /a.o | |
| /b.o | |
| /c.o | |
| /program |
| \documentclass[11pt]{article} | |
| \usepackage[T1]{fontenc} | |
| \usepackage{array} | |
| \usepackage{makecell} | |
| \newcolumntype{x}[1]{>{\centering\arraybackslash}p{#1}} | |
| \usepackage{tikz} | |
| \begin{document} | |
| \newcommand\diag[4]{% | |
| \multicolumn{1}{@{}p{#2}@{}|}{% |