View process_pdf_bookmarks
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
###################################################################### | |
## process_pdf_bookmarks.py | |
## by Runsun Pan, 20190310 | |
## | |
## Process pdf bookmarks extracted from a pdf file by JPdfBookmarks | |
## JPdfBookmarks version: 2.5.2 | |
# | |
## The bookmark file dumped by JPdfBookmarks has lots of styling | |
## codes that shouldn't be there. This py takes care of that. Other | |
## features included. |
View monty.py
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
## Monty Hall Problem | |
## https://en.wikipedia.org/wiki/Monty_Hall_problem | |
## | |
## A simulation intended to prove the Monty Hall Solution wrong | |
## (that switching selection after one door is revealed increases | |
## the odd from 1/3 to 2/3), ended up proving it right. | |
## | |
## Result of running run(1000) 100 times: 0.67(+-)0.02 | |
## |
View get_openscad_funcs_for_doctest.py
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
__description__ = "Print function names in the given .scad file and prepare them for doctest." | |
__author__= "Runsun Pan" | |
__version__= "180119-1" | |
''' | |
When an openSCAD file gets larger, it may contain too many functions and trying | |
to list them for doctest(https://bitbucket.org/runsun/doctest.scad), like: | |
[ //index_test( mode, opt ) // to-be-coded | |
, getdeci_test( mode, opt ) |
View web-audio-scheduler playing notes example
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>web-audio-scheduler playing notes example</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script> | |
<script type="text/javascript"> |
View runscad.py
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
########################################################################## | |
## runscad.py | |
## | |
## Run an openscad file once or n times and save shape output to file(s) | |
## | |
## by Runsun Pan (2015.9.25) | |
###########################################3############################## | |
import sys, os, re | |
narg = len(sys.argv) |
View find.py
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
__description__ = "Find lines where a word is defined in a folder." | |
__version__= "171115-1" | |
__author__= "Runsun Pan" | |
''' | |
>>> py find.py -h | |
usage: find.py [-h] [--version] [-f folder] [-p prefix] [-a activeModule] | |
[-i includePrefix] [-x fileExt] | |
word |