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
# 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') |
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
import copy | |
from itertools import chain | |
class CopyTestClass(object): | |
def __init__(self, q, w): | |
self._a = q | |
self._b = w | |
self._cache = {} |
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
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) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
<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); |
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
# 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 * |