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
| public class SortReducerByValues { | |
| public static final String INPUT = "/tmp/data_in"; | |
| public static final String OUTPUT = "/tmp/data_out"; | |
| public static void main(String[] args) throws IOException { | |
| new SortReducerByValues().run(); | |
| } | |
| public void run() throws IOException { | |
| JobConf conf = new JobConf(); |
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 check_connect_session(self, request): | |
| """ | |
| For use in a facebook Connect application running in Google App Engine | |
| Takes a Google App Engine Request | |
| http://code.google.com/appengine/docs/webapp/requestclass.html | |
| and determines if the current user has a valid session | |
| """ | |
| # our session is stored in cookies - validate them | |
| params = self.validate_cookie(request.cookies) |
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
| #!/usr/bin/env python | |
| import wsgiref.handlers | |
| import os | |
| import facebook | |
| from google.appengine.ext import webapp | |
| from google.appengine.ext.webapp import template | |
| from google.appengine.ext import db | |
| class BaseHandler(webapp.RequestHandler): |
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
| <html> | |
| <body> | |
| <script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US" type="text/javascript"><script> | |
| <script type="text/javascript">FB.init("{{ apikey }}", "/static/xd_receiver.html");</script> | |
| <fb:login-button v="2" onlogin='window.location="/";' size="large">Connect with Facebook</fb:login-button> | |
| </body> | |
| </html> |
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
| <html> | |
| <body> | |
| <script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US" type="text/javascript"></script> | |
| <script type="text/javascript">FB.init("{{ apikey }}", '/static/xd_receiver.html');</script> | |
| Hello, {{ name }}! | |
| <br/><br/> | |
| <a href="#" onclick="javascript:FB.Connect.logoutAndRedirect('/')">Logout</a> |
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 <UIKit/UIKit.h> | |
| @interface LoginViewController : UIViewController { | |
| } | |
| - (IBAction) login: (id) sender; | |
| @end |
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 "LoginViewController.h" | |
| @implementation LoginViewController | |
| @synthesize usernameField; | |
| @synthesize passwordField; | |
| @synthesize loginButton; | |
| @synthesize loginIndicator; | |
| - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { |
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 <UIKit/UIKit.h> | |
| @class LoginViewController; | |
| @interface LoginAppAppDelegate : NSObject { | |
| UIWindow *window; | |
| LoginViewController *loginViewController; | |
| } | |
| @property (nonatomic, retain) IBOutlet UIWindow *window; |
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 "LoginAppAppDelegate.h" | |
| #import "LoginViewController.h" | |
| @implementation LoginAppAppDelegate | |
| @synthesize window; | |
| @synthesize loginViewController; | |
| - (void)applicationDidFinishLaunching:(UIApplication *)application { |
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 <UIKit/UIKit.h> | |
| @class LoginViewController; | |
| @interface LoginAppAppDelegate : NSObject { | |
| UIWindow *window; | |
| LoginViewController *loginViewController; | |
| } | |
| @property (nonatomic, retain) IBOutlet UIWindow *window; |