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
# -*- coding: utf-8 -*- | |
def foo(a, b="B", c=[], *args, **kwargs): | |
print(a, b, c) | |
if not args: | |
print("No *args passed") | |
else: | |
print(args) |
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 foo(): | |
l = [] | |
return l[:] | |
#attr_map = dict.fromkeys(prefixes_unique, foo()) | |
attr_map = dict.fromkeys(prefixes_unique, []) | |
for key in attr_map: | |
print(key, id(attr_map[key])) |
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
#!/bin/sh | |
VALUE_ICON=`cygpath -d "$HOME/pict/terminal.png"` | |
VALUE_TITLE="terminal" | |
VALUE_MESSAGE="Ha!!" | |
while getopts hi:t:m: OPT | |
do | |
case $OPT in |
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 operator | |
last = operator.itemgetter(-1) | |
l1 = [] | |
l2 = [1,2,3] | |
l3 = [-100, 10, 400] | |
def gaurdedLast(l): | |
return (last(l) if l else None) |
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
""" | |
""" | |
""" | |
In this interactive tutorial we are going to take a look at the process of the | |
creation of an instance object by calling an user-defined class. | |
""" | |
""" | |
We will be running the sample program via the ipython interpreter and in a |
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
# http://learningblender3dsoftware.blogspot.in/2012/12/learning-about-operators-2-screen.html | |
import bpy | |
def main(context): | |
screen = context.screen | |
for area in screen.areas: | |
if area.type == 'VIEW_3D': | |
active_space = area.spaces[0] | |
attrs = ['show_floor', 'show_axis_x', 'show_axis_y', 'show_axis_z'] |
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
# Name of the project | |
# The binary file will use the name of the project! | |
PROJECT := $(shell basename $(shell pwd)) | |
# Header files | |
HEADERS = -I../../util/ | |
# C++ source files | |
SOURCES := $(shell find ./ -name "*.cpp") |
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
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
//---------------------------------------------------------------------------- | |
using VectorOfIntPointers = vector<const int *>; | |
void printPointersToElements(const VectorOfIntPointers& pointers) |
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
# Create a bezier curve object | |
>>> bpy.ops.curve.primitive_bezier_curve_add() | |
{'FINISHED'} | |
# Get a reference to the curve object | |
>>> curve_object = bpy.context.active_object | |
# Print out its data path |
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 bge | |
controller = bge.logic.getCurrentController() | |
owner = controller.owner | |
print(type(owner)) | |
print(owner.getPropertyNames()) |
OlderNewer