View bst.swift
enum BinarySearchTree<T: Comparable> { | |
case Leaf(T?) | |
indirect case Node(T, BinarySearchTree, BinarySearchTree) | |
} | |
func search<T: Comparable>(in tree: BinarySearchTree<T>, for item: T) -> Bool { | |
switch tree { | |
case .Leaf(let value): | |
return item == value | |
case .Node(let selfValue, let left, let right): |
View .travis.yml
language: objective-c | |
os: osx | |
xcode_workspace: {workspace-name}.xcworkspace | |
xcode_scheme: {workspace-name} | |
xcode_sdk: iphonesimulator9.0 | |
osx_image: xcode8 | |
before_install: | |
- | | |
brew update | |
gem install xcpretty -N --no-ri --no-doc |
View BNG_Pong_basicsphere
// --------------------------------- | |
// Based on Aerotwist's cool tutorial - http://www.aerotwist.com/tutorials/getting-started-with-three-js/ | |
// --------------------------------- | |
// set up the sphere vars | |
// lower 'segment' and 'ring' values will increase performance | |
var radius = 5, | |
segments = 6, | |
rings = 6; |
View YouTubeUploader-ios.js
(function() { | |
if (Cordova.hasResource("youtubeUploader")) return; | |
Cordova.addResource("youtubeUploader"); | |
function YouTubeUploader() { | |
} | |
YouTubeUploader.prototype.uploadVideo = function(file, success, fail) { |