git clone https://github.com/overleaf/overleaf.git
I am using commit 028bca6e87a7af2596dcad57205b96c0bff6a7a5 on the main branch
| # Illustrates creating dynamic attributes in Python | |
| # | |
| # For implementation details of the dynamic attributes, please see the following methods: | |
| # - GPSPosition.__getattr__ | |
| # - GPSPosition.__setattr__ | |
| # | |
| class GPSPosition(object): | |
| __slots__ = ('_coords', '_attribs', '_iter_index') |
| import copy | |
| from itertools import chain | |
| class CopyTestClass(object): | |
| def __init__(self, q, w): | |
| self._a = q | |
| self._b = w | |
| self._cache = {} |
| import numpy as np | |
| def generate_knot_vector(degree, num_ctrlpts, **kwargs): | |
| """ Generates a uniform knot vector. | |
| Example | |
| ------- | |
| >>> generate_knot_vector(3, 7, datatype=np.float32) | |
| array([0. , 0. , 0. , 0. , 0.25, 0.5 , 0.75, 1. , 1. , 1. , 1. ], dtype=float32) |
| <script type="text/javascript"> | |
| (function () { | |
| "use strict"; | |
| // once cached, the css file is stored on the client forever unless | |
| // the URL below is changed. Any change will invalidate the cache | |
| var css_href = './index_files/web-fonts.css'; | |
| // a simple event handler wrapper | |
| function on(el, ev, callback) { | |
| if (el.addEventListener) { | |
| el.addEventListener(ev, callback, false); |
| # GL interoperability example, by Peter Berrington. | |
| # Draws a rotating teapot, using cuda to invert the RGB value | |
| # each frame | |
| from OpenGL.GL import * | |
| from OpenGL.GLUT import * | |
| from OpenGL.GLU import * | |
| from OpenGL.GL.ARB.vertex_buffer_object import * | |
| from OpenGL.GL.ARB.pixel_buffer_object import * |