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
APPNAME= | |
ORG= | |
SCHEME=$(APPNAME) # default scheme name, yours may be different | |
BUNDLEID=com.$(ORG).$(APPNAME) # default bundle name, yours may be different | |
CC=xcodebuild # if using xcbuild or other, enter that here | |
OS=10.3 | |
DEVICE=iPhone 7 | |
all: build run |
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 numpy as np | |
import sys | |
try: | |
filename = sys.argv[1] | |
inFile = open(filename, "r") | |
outFile = open("best-output.txt", "w+") | |
except: | |
print("Error: Must provide valid filename as a command line argument") | |
raise |
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 numpy as np | |
import sys | |
try: | |
filename = sys.argv[1] | |
inFile = open(filename, "r") | |
outFile = open("best-output.txt", "w+") | |
except: | |
print("Error: Must provide valid filename as a command line argument") | |
raise |
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 numpy as np | |
arr = np.array([[1, 2, 5], | |
[8, 7, -7], | |
[-3, -1, 6]]) | |
# Main Algorithm, takes a numpy array as | |
def mostValuablePath(arr): | |
arrHeight = arr.shape[0] - 1 | |
arrWidth = arr.shape[1] - 1 |
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
def maxSubArrayDynamic(arr): | |
maxSum = currentSum = 0 | |
for i in arr: | |
if currentSum + i > 0: | |
currentSum = currentSum + i | |
else: | |
currentSum = 0 | |
if currentSum > maxSum: | |
maxSum = currentSum | |
return maxSum |
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
def maxSubArray(arr): | |
maxSum = 0 | |
# try all subarray lengths | |
for j in range(0, len(arr)): | |
# compute first subarray sum | |
curSum = 0 | |
for element in arr[0 : j]: | |
curSum += element | |
# try all subarray locations | |
for i in range(0, len(arr) - j): |
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
def maxSubArray(arr): | |
maxSum = 0 | |
# try all subarray lengths | |
for j in range(0, len(arr)): | |
# try all subarray locations | |
for i in range(0, len(arr) - j): | |
currentSum = 0 | |
# sum subarray | |
for element in range(arr[i], arr[i+j]): | |
currentSum += element |
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
var http = require('http'), | |
url = require('url'), | |
path = require('path'), | |
fs = require('fs'), | |
port = process.argv[2] || 8888; | |
http.createServer (function (request, response) { | |
var uri = url.parse(request.url).pathname, | |
filename = path.join(process.cwd(), uri); |
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
/// ❤️ | |
UIBezierPath* bezierPath = UIBezierPath.bezierPath; | |
[bezierPath moveToPoint: CGPointMake(91.68, 7.32)]; | |
[bezierPath addCurveToPoint: CGPointMake(91.68, 42.68) controlPoint1: CGPointMake(101.44, 17.09) controlPoint2: CGPointMake(97.44, 32.91)]; | |
[bezierPath addCurveToPoint: CGPointMake(49.5, 85.99) controlPoint1: CGPointMake(85.91, 52.44) controlPoint2: CGPointMake(50.44, 90.64)]; | |
[bezierPath addCurveToPoint: CGPointMake(7.32, 42.68) controlPoint1: CGPointMake(48.56, 90.64) controlPoint2: CGPointMake(13.09, 52.44)]; | |
[bezierPath addCurveToPoint: CGPointMake(7.32, 7.32) controlPoint1: CGPointMake(1.56, 32.91) controlPoint2: CGPointMake(-2.44, 17.09)]; | |
[bezierPath addCurveToPoint: CGPointMake(42.68, 7.32) controlPoint1: CGPointMake(17.09, -2.44) controlPoint2: CGPointMake(32.91, -2.44)]; | |
[bezierPath addCurveToPoint: CGPointMake(49.5, 15.01) controlPoint1: CGPointMake(46.28, 10.93) controlPoint2: CGPointMake(48.56, 10.36)]; | |
[bezierPath addCurveToPoint: CGPointMake(56.32, 7.32) controlPoint1: CGPointMake(50.4 |