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 PIL import Image | |
import sys | |
# Check arguments | |
if len(sys.argv) < 3: | |
print "Usage: python make3d.py <leftimage> <rightimage> <3doutputname>" | |
quit() | |
# Open the left and right images | |
imLeft = Image.open(sys.argv[1]) |
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> | |
using namespace std; | |
struct Const { | |
Const(int c) : c(c) {} | |
int c; | |
}; | |
struct One : Const { | |
One() : Const(1) {} |
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 Foundation | |
import Darwin | |
// Given Box and Result definitions from "Functional Programming in Swift" | |
// Buy it here: http://objc.io/books | |
// You need Box because Swift can't handle generics in Enums directly | |
public class Box<T> { | |
let unbox:T | |
init(_ value:T) { self.unbox = value } |
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
char* capper(char* s, char* outs) { | |
strcpy(outs, s); | |
for (char* s2=outs; *s2; ++s2) { | |
if (islower(*s2) && (s2==outs || isspace(*(s2-1)))) { | |
*s2=toupper(*s2); | |
break; | |
} | |
} | |
return outs; | |
} |