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
language: python | |
python: | |
- "2.6" | |
- "2.7" | |
before_install: | |
- cd .. | |
- curl -O http://www.riverbankcomputing.co.uk/static/Downloads/sip4/sip-4.13.3.tar.gz | |
- tar -xvf sip-4.13.3.tar.gz | |
- cd sip-4.13.3 | |
- python configure.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
a = [1,2,3] | |
b = [4,5,6] | |
print zip(a,b) | |
import itertools | |
print list(itertools.chain.from_iterable(zip(a,b))) | |
print sum(map(list, zip(a,b)), []) |
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> | |
<title>Example Document without Crittercism</title> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script type="text/javascript" src="https://d1a62freaxhn7x.cloudfront.net/v1/crittercismClientLibraryMin.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
Crittercism.init({ | |
appId : '5075c158d5f9b9796b000002', // Example: 47cc67093475061e3d95369d |
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 json | |
import urllib2 | |
def hueOn(address, client, on=True): | |
for light in (1, 2, 3): | |
url = "http://%s/api/%s/lights/%s/state" % (address, client, light) | |
request = urllib2.Request(url, json.dumps({"on": on})) | |
request.get_method = lambda: "PUT" | |
response = urllib2.urlopen(request) |
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
def getWeightedAverage(node): | |
width, height = node.width(), node.height() | |
red = green = blue = 0.0 | |
for x in range(width): | |
for y in range(height): | |
red += node.sample("red", x, y) | |
green += node.sample("green", x, y) | |
blue += node.sample("blue", x, y) | |
count = width * height | |
return red / count, green / count, blue / count |
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 os | |
import re | |
from PyQt4.QtCore import * | |
from PyQt4.QtGui import * | |
import foundations.walkers | |
import foundations.common | |
def captureEditorPages(editor, outputDirectory, prefix): | |
viewport = editor.viewport() |
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 maya.cmds as cmds | |
import os | |
MAPPING = {64 : "/path/to/chair.png", | |
128 : "/path/to/mop.png", | |
256 : "/path/to/safe.png", | |
512 : "/path/to/book.png"} | |
def getSplitextBasename(path): | |
basename = os.path.splitext(os.path.basename(os.path.normpath(path)))[0] |
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 maya.cmds as cmds | |
import os | |
def getSplitextBasename(path): | |
basename = os.path.splitext(os.path.basename(os.path.normpath(path)))[0] | |
return basename | |
def getShaderBranch(texture): | |
lambert = cmds.shadingNode("lambert", asShader=True) | |
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
Subject: | |
Non Commercial Project with No Sources Distribution, What kind ofLicenses ? | |
Hello, | |
I would like to know what would be the license needeed to build a non commercial project with no source distribution. I want my application to be free but I also want the source code to not be available so that my program is not taken over/modified and distributed by someone else. | |
Regards, | |
Thomas |
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
from win32com.client import constants as siConstants | |
class Runtime(object): | |
instance = None | |
class Foo(object): | |
def __init__(self, bar): | |
self.bar = bar |