This file contains hidden or 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 urllib | |
import logging | |
from BeautifulSoup import BeautifulSoup as BS | |
log = logging.getLogger(__name__) | |
class NoSuchChallenge(Exception): | |
pass | |
This file contains hidden or 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 nuke | |
def duplicate_node(node, to_file = None): | |
"""Slightly convoluted but reliable(?) way duplicate a node, using | |
the same functionality as the regular copy and paste. | |
Could almost be done tidily by doing: | |
for knobname in src_node.knobs(): |
This file contains hidden or 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
from PySide import QtGui, QtCore | |
def findDagWidget(): | |
stack = QtGui.QApplication.topLevelWidgets() | |
while stack: | |
widget = stack.pop() | |
if widget.windowTitle() == 'Node Graph': | |
# You should probably be a little safer with this return, but the actual DAG widget | |
# seems to be here consistently... if not, it should be the only child of 'widget' |
This file contains hidden or 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
set cut_paste_input [stack 0] | |
version 6.3 v5 | |
push $cut_paste_input | |
Dot { | |
name Dot1 | |
label "CineStyle image,\nwith 'raw' checkbox enabled" | |
selected true | |
xpos 295 | |
ypos -218 | |
} |
This file contains hidden or 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
"""Exports a Nuke ColorLookup node as a 1D CSP | |
The "master" curve becomes the prelut curve, and the red/green/blue curves | |
are the R/G/B curves | |
All curves are linearly sampled between 0 and 1 | |
""" | |
import nuke |
This file contains hidden or 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
"""Inspired by https://github.com/timbowman/blackbody | |
..this creates a Nuke ColorLookup node, which maps from Kelvin to xyY values, | |
using code from https://github.com/dbr/colourstuff | |
""" | |
def cie1931_standard_observer_rawdata(two_degree = False, ten_degree = False): | |
"""Returns dictionary with three keys: x, y and z. Each key contains | |
a dictionary mapping wavelength to value | |
Created using the from_txt_to_python function |
This file contains hidden or 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
#!/usr/bin/python | |
import time | |
import subprocess | |
import socket | |
class CannotResolve(Exception): | |
pass |
This file contains hidden or 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
from math import sqrt | |
# Camera parameters | |
focal = 25 #mm | |
fstop = 2.8 # f number | |
focus_distance = 5 # Unsure of unit? Probably mm, maybe metre? | |
# Circle of confusion diameter limit, as per | |
# http://en.wikipedia.org/wiki/Zeiss_formula (with modern 1500 constant) | |
filmback_width = 35 |
This file contains hidden or 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
http://app.strava.com/challenges/1 (Rapha Festive 500) | |
http://app.strava.com/challenges/2 (Strava Ride Base Mile Blast) | |
http://app.strava.com/challenges/3 (Strava Run Base Mile Blast) | |
http://app.strava.com/challenges/4 (Ride Hard to Breathe Easy) | |
http://app.strava.com/challenges/5 (A Classic Challenge from Specialized) | |
http://app.strava.com/challenges/6 (24 Hours of the Old Pueblo - Gasline) | |
http://app.strava.com/challenges/7 (24 Hours of the Old Pueblo- Grind) | |
http://app.strava.com/challenges/8 (24 Hours of the Old Pueblo - Traditional Lap) | |
http://app.strava.com/challenges/9 (24 Hours of the Old Pueblo - Bypass Lap) | |
http://app.strava.com/challenges/10 (GU 100,000 Mile Challenge) |
This file contains hidden or 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
/* | |
$ gcc locale_test.c | |
$ ./a.out | |
Got floats: 0.10 0.20 0.30 | |
$ LANG="de_DE" ./a.out | |
Got floats: 0,00 0,00 0,00 | |
*/ | |
#include <stdio.h> | |
#include <locale.h> |