{{ message }}

Instantly share code, notes, and snippets.

# PM 2Ring PM2Ring

• Australia
Created Feb 4, 2021
Merger-splitter diagram
View merger_splitter1.svg
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Created Jan 31, 2021
Simple MathJax table maker, using SageMathCell
View MathJaxTable.py
 class Table: def __init__(self, align, data): self.buff = [] self.make(align, data) def get(self): s = "\n".join(self.buff) return s + "\n\\end{array}" def put(self, s):
Created Jan 24, 2021
View SquareTriTessBW.svg
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Created Jan 24, 2021
Tessellate a square with 45-60-75 degree triangles, monochrome
View SquareTriTessBW.svg
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Created Nov 25, 2020
View T-tet.svg
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Created Nov 12, 2020
Kepler's Laws Ellipse
View KeplerEllipse2.svg
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Created Apr 10, 2019
Substring palindromes
View substring_palindromes.py
 #!/usr/bin/env python3 ''' Substring palindromes Find the number of ways a string can be split in a non-overlapping way such that p+q is a palindrome string. Two pairs (p,q) and (p',q') are treated as different iff p is chosen from different position from p' or q is chosen from diff position of q' . For example, take the string abba. The possible substrings which are
Last active Oct 10, 2018
Cubic Bezier tracks with constant speed animation, using Tkinter
View tk_bezier_track.py
 #!/usr/bin/env python3 ''' Create a closed track from cubic Bezier curves, and animate a circle following the track at constant speed. https://en.wikipedia.org/wiki/B%C3%A9zier_curve#Cubic_B%C3%A9zier_curves https://gist.github.com/PM2Ring/d6a19f5062b39467ac669a4fb4715779 Press the Add button to add black control dots to the Canvas. The first
Created Oct 7, 2018
Use Tkinter's .after method to run several named counters in parallel.
View tk_multi_counters.py
 #!/usr/bin/env python3 """ Use .after to run several named counters in parallel. Each counter prints its name and value to the terminal, once per second. When the 'New counter' button is clicked, a new counter is created, using the name in name_entry, and a 'Stop' button with the same name is added to the GUI.
Created Aug 17, 2018
Discrete catenary with vectors
View cat2.svg