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
from twisted.web.resource import Resource | |
from twisted.web import server | |
from twisted.python import log | |
from twisted.internet import defer | |
import os | |
from datetime import datetime | |
from twisted.protocols.basic import FileSender | |
########################## | |
#### Global Variables #### |
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
import processing.video.*; | |
Capture C; | |
int X=0; | |
void setup() { | |
size(640, 480); | |
String[] cameras = Capture.list(); | |
if (cameras.length == 0) { |
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
import boto.mturk.connection | |
sandbox_host = 'mechanicalturk.sandbox.amazonaws.com' | |
real_host = 'mechanicalturk.amazonaws.com' | |
mturk = boto.mturk.connection.MTurkConnection( | |
aws_access_key_id = 'XXX', | |
aws_secret_access_key = 'XXX', | |
host = sandbox_host, | |
debug = 1 # debug = 2 prints out all requests. but we'll just keep it at 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
#import <UIKit/UIKit.h> | |
@interface TestTwoController : UIViewController <UITextFieldDelegate,UIPickerViewDataSource,UIPickerViewDelegate> | |
@end |
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
// call in place of something like: Mat warp_mat = estimateRigidTransform( f, c, false); | |
// like this: Mat warp_mat = getSimilarityTransform(f,c); | |
// then you can use it with warpAffine | |
// needs GSL http://www.gnu.org/software/gsl/ | |
// #include <gsl/gsl_linalg.h> | |
// #include <gsl/gsl_blas.h> | |
Mat getTransform(vector<Point2f> src, vector<Point2f> dst){ | |
// use GSL to do the actual transformations.... but put it back into opencv-happy format |
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
#include <opencv2/opencv.hpp> | |
#include <iostream> | |
#include <vector> | |
#include <cmath> | |
#include <assert.h> | |
using namespace std; | |
using namespace cv; |
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
class RootResource(Resource): | |
def __init__(self): | |
Resource.__init__(self) | |
self.putChild('heartbeat', HeartbeatResource()) | |
self.putChild('launch', LaunchResource()) | |
self.putChild('get_port', GetPortResource()) | |
self.putChild('crossdomain.xml', Grahh()) | |
self.putChild('style.css', static.File("style.css")) | |
self.putChild('jquery.min.js', static.File("jquery.min.js")) | |
self.putChild('sketchup.js', static.File("sketchup.js")) |
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
// adaptation of: http://android-developers.blogspot.com/2011/03/identifying-app-installations.html | |
// but using shared preferences instead of a file: http://developer.android.com/reference/android/content/SharedPreferences.html | |
// here's a better look at using shared preferences: http://developer.android.com/guide/topics/data/data-storage.html#pref | |
public class UniqueId { | |
private static String sID = null; | |
private static final String SHARED_PREF_KEY = "SKETCHABIT2"; | |
private static final String ID_KEY = "id"; |