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
func ackermann(m:Int, n:Int) -> Int { | |
if (m == 0) { | |
return n + 1 | |
} else if (n == 0) { | |
return ackermann(m-1, 1) | |
} else { | |
return ackermann(m-1,ackermann(m, n-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
func ζ(s:Int) -> Double { | |
var i : Double = Double() | |
var sum : Double = Double() | |
for (var i = 1.0; i < Double.infinity; i++) { | |
sum += (1 / pow(i, Double(s))) | |
} | |
return sum | |
} |
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
Instagram Bolt (“Pepper”) Endpoints | |
WIP by @zaersk_ 07/29/2014 | |
Messages: | |
http://pepper.instagram.com/messages/ | |
http://pepper.instagram.com/messages/<postId>/reply/ | |
http://pepper.instagram.com/messages/<postId>/seen/ | |
http://pepper.instagram.com/messages/<postId>/undo/ | |
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
NSString *textString = @"APPL"; | |
NSString *query = [NSString stringWithFormat:@"select * from yahoo.finance.quotes where symbol in (\"%@\")", textString]; | |
NSString *escapedStoreUrl = [@"store://datatables.org/alltableswithkeys" stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]]; | |
NSString *escapedQuery = [query stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]]; | |
NSString *urlString = [NSString stringWithFormat:@"http://query.yahooapis.com/v1/public/yql?q=%@&env=%@&format=json", escapedQuery, escapedStoreUrl]; | |
NSMutableURLRequest *mutableRequestGET = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:urlString]]; | |
[mutableRequestGET setHTTPMethod:@"GET"]; | |
NSData *dataResponse = [NSURLConnection sendSynchronousRequest:mutableRequestGET returningResponse:nil error:nil]; | |
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
// | |
// main.m | |
// ER1 | |
// | |
// Created by @zaersk_ on 7/19/14. | |
// Copyright (c) 2014 Zaersk. All rights reserved. | |
// | |
// Attempt to login to Instagram using their unofficial API (no OAuth tokens). | |
#import <Foundation/Foundation.h> |