Jon Warbrick, July 2014, V3.2 (for Ansible 1.7), tweaked by Will Ware in 2019
First one found from of
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7), tweaked by Will Ware in 2019
First one found from of
Sometimes I'm doing stuff in PDB, the Python debugger, and I would like to hop out to a Bash prompt. Maybe I want to see what is the current directory, or what files are in the current directory, or I'd like to run some executable in this environment, or see what is on the current path. Anyway the trick is to do this.
$ python -m pdb foo.py
> /Users/wware/foo.py(3)<module>()
| #!/usr/bin/env python | |
| """ | |
| The top five vertices are at 72-degree increments at a height of z=A. | |
| The next five vertices are at the same 72-degree incremenets at a | |
| height of z=B. Next five are offset by 36 degrees, with z=-B, and last | |
| five are also offset by 36 degrees with z=-A. The trick is to make sure | |
| all the lengths are the same, and solve for A and B. | |
| Let Ea and Fa be two adjacent vertices of the top five. Let Eb and Fb | |
| be the vertices below them at z=B. Let Gb be the vertex connecting to |
| $fn = 120; | |
| thickness = 8; | |
| height = 12; | |
| width = 2; | |
| module zero() { | |
| difference() { | |
| translate([0, 0, -.5*thickness]) | |
| cylinder(h=thickness, d=height); | |
| translate([0, 0, -.5*thickness-1]) |
| import argparse | |
| import logging | |
| import os | |
| import pdb | |
| import re | |
| import subprocess | |
| _cmds = {} | |
| _args = [] |
| import os | |
| from functools import wraps | |
| def cmd(x): | |
| return os.popen(x).read().strip() | |
| def predecessors(hash): | |
| return cmd("git log --pretty=%P -n 1 {0}".format(hash)).split(" ") | |
| def is_a_merge_commit(hash): |
| """ | |
| There is an unfortunate thing about Python scoping. You can't easily access the variables | |
| of a calling function (as you can do in Scheme) so if you want to use those variables you | |
| need to jump thru silly hoops. See | |
| https://stackoverflow.com/questions/15608987/access-variables-of-caller-function-in-python | |
| The nice thing about using a caller's variables is that it provides a nice way to do closures. | |
| Variable access in closures will work OK as long as you are not ASSIGNING the variable. In | |
| this case, we assign indices of "scope" but we never assign scope itself -- if we did, Python | |
| would conclude that scope belongs to stuff, not to make_thing. Annoying. |
git-svn is a git command that allows using git to interact with Subversion repositories.git-svn is part of git, meaning that is NOT a plugin but actually bundled with your git installation. SourceTree also happens to support this command so you can use it with your usual workflow.
Reference: http://git-scm.com/book/en/v1/Git-and-Other-Systems-Git-and-Subversion
You need to create a new local copy of the repository with the command
| """ | |
| https://twitter.com/fermatslibrary/status/1067423316095508480 | |
| Today's paper is a good example of an unsolved conjecture being disproved by counterexample. | |
| Goldbach stated that every positive odd integer is either prime or the sum of a prime and | |
| twice a square. 5777 and 5993 are the only known counterexamples. | |
| https://fermatslibrary.com/s/a-not-so-famous-goldbach-conjecture#email-newsletter | |
| """ | |
| # this is python 2, not python3 |