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
// Swift Extension on MTLModel | |
extension MTLModel: Parseable { | |
public static func parseResponseObject(responseObject: AnyObject) throws -> AnyObject { | |
if let JSON = responseObject as? Array<AnyObject> { | |
do { | |
return try MTLJSONAdapter.modelsOfClass(self, fromJSONArray: JSON) as! [MTLModel] | |
} catch { | |
throw BridgeErrorType.Parsing |
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
- (UIImage*)getImageFromURL { | |
NSURL *url = [NSURL URLWithString:@"http://storm8.com/image.png"]; | |
return [UIImage imageWithData: [NSData dataWithContentsOfURL:url]]; | |
} | |
- (void)saveImage: (UIImage*)image | |
{ | |
if (image != 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
# PostgreSQL. Versions 8.2 and up are supported. | |
# | |
# Install the pg driver: | |
# gem install pg | |
# On Mac OS X with macports: | |
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config | |
# On Windows: | |
# gem install pg | |
# Choose the win32 build. | |
# Install PostgreSQL and put its /bin directory on your 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
/**** Basic setup for defining and drawing objects ****/ | |
// Moved to a header for the second and subsequent OpenGL programs | |
#ifndef __INCLUDEGEOMETRY | |
#define __INCLUDEGOEMETRY | |
const int numobjects = 2 ; // ** NEW ** number of objects for buffer | |
const int numperobj = 3 ; | |
const int ncolors = 4 ; | |
GLuint buffers[numperobj*numobjects+ncolors+1] ; // ** NEW ** List of buffers for geometric data |
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
require "redis" | |
redis = Redis.new | |
INITIAL_FILE = ARGV[0] #the initial file | |
END_FILE = ARGV[1] #the end file | |
def listFriends(user, file) | |
key1 = file + ":" + user + ".to" | |
key2 = file + ":" + user + ".from" | |
return redis.sinter key1, key2 | |
end |