Permalink
Browse files

quick temp fix for site

  • Loading branch information...
1 parent a2bc998 commit 711f91c36e48bf3a6c10c70b47bde8a5510a302c @CorpusCallosum CorpusCallosum committed Nov 28, 2012
Showing with 11,991 additions and 2 deletions.
  1. +2 −1 app/controllers/photo_controller.rb
  2. +1 −1 processing/StyleBlasterGrabber/StyleBlasterGrabber.pde
  3. +89 −0 processing/StyleBlasterGrabber/applet/MotionSensor.pde
  4. +423 −0 processing/StyleBlasterGrabber/applet/OpticalFlow.pde
  5. BIN processing/StyleBlasterGrabber/applet/StyleBlasterGrabber.jar
  6. +828 −0 processing/StyleBlasterGrabber/applet/StyleBlasterGrabber.java
  7. +257 −0 processing/StyleBlasterGrabber/applet/StyleBlasterGrabber.pde
  8. BIN processing/StyleBlasterGrabber/applet/core.jar
  9. +197 −0 processing/StyleBlasterGrabber/applet/index.html
  10. BIN processing/StyleBlasterGrabber/applet/loading.gif
  11. BIN processing/StyleBlasterGrabber/applet/opengl.jar
  12. BIN processing/StyleBlasterGrabber/applet/postToWeb.jar
  13. +28 −0 processing/StyleBlasterGrabber/applet/timer.pde
  14. BIN processing/StyleBlasterGrabber/applet/video.jar
  15. +75 −0 processing/StyleBlasterGrabber/application.macosx/StyleBlasterGrabber.app/Contents/Info.plist
  16. BIN ...StyleBlasterGrabber/application.macosx/StyleBlasterGrabber.app/Contents/MacOS/JavaApplicationStub
  17. BIN ...yleBlasterGrabber/application.macosx/StyleBlasterGrabber.app/Contents/MacOS/JavaApplicationStub64
  18. +1 −0 processing/StyleBlasterGrabber/application.macosx/StyleBlasterGrabber.app/Contents/PkgInfo
  19. BIN ...rabber/application.macosx/StyleBlasterGrabber.app/Contents/Resources/Java/StyleBlasterGrabber.jar
  20. BIN ...g/StyleBlasterGrabber/application.macosx/StyleBlasterGrabber.app/Contents/Resources/Java/core.jar
  21. BIN ...eBlasterGrabber/application.macosx/StyleBlasterGrabber.app/Contents/Resources/Java/gluegen-rt.jar
  22. BIN ...g/StyleBlasterGrabber/application.macosx/StyleBlasterGrabber.app/Contents/Resources/Java/jogl.jar
  23. BIN ...erGrabber/application.macosx/StyleBlasterGrabber.app/Contents/Resources/Java/libgluegen-rt.jnilib
  24. BIN ...eBlasterGrabber/application.macosx/StyleBlasterGrabber.app/Contents/Resources/Java/libjogl.jnilib
  25. BIN ...sterGrabber/application.macosx/StyleBlasterGrabber.app/Contents/Resources/Java/libjogl_awt.jnilib
  26. BIN ...asterGrabber/application.macosx/StyleBlasterGrabber.app/Contents/Resources/Java/libjogl_cg.jnilib
  27. BIN ...StyleBlasterGrabber/application.macosx/StyleBlasterGrabber.app/Contents/Resources/Java/opengl.jar
  28. BIN ...leBlasterGrabber/application.macosx/StyleBlasterGrabber.app/Contents/Resources/Java/postToWeb.jar
  29. BIN .../StyleBlasterGrabber/application.macosx/StyleBlasterGrabber.app/Contents/Resources/Java/video.jar
  30. BIN ...ing/StyleBlasterGrabber/application.macosx/StyleBlasterGrabber.app/Contents/Resources/sketch.icns
  31. +89 −0 processing/StyleBlasterGrabber/application.macosx/source/MotionSensor.pde
  32. +423 −0 processing/StyleBlasterGrabber/application.macosx/source/OpticalFlow.pde
  33. +828 −0 processing/StyleBlasterGrabber/application.macosx/source/StyleBlasterGrabber.java
  34. +257 −0 processing/StyleBlasterGrabber/application.macosx/source/StyleBlasterGrabber.pde
  35. +28 −0 processing/StyleBlasterGrabber/application.macosx/source/timer.pde
  36. +243 −0 s/README
  37. +10 −0 s/Rakefile
  38. +10 −0 s/app/controllers/application_controller.rb
  39. +3 −0 s/app/helpers/application_helper.rb
  40. +110 −0 s/config/boot.rb
  41. +22 −0 s/config/database.yml
  42. +41 −0 s/config/environment.rb
  43. +17 −0 s/config/environments/development.rb
  44. +28 −0 s/config/environments/production.rb
  45. +28 −0 s/config/environments/test.rb
  46. +7 −0 s/config/initializers/backtrace_silencers.rb
  47. +10 −0 s/config/initializers/inflections.rb
  48. +5 −0 s/config/initializers/mime_types.rb
  49. +21 −0 s/config/initializers/new_rails_defaults.rb
  50. +15 −0 s/config/initializers/session_store.rb
  51. +5 −0 s/config/locales/en.yml
  52. +43 −0 s/config/routes.rb
  53. +7 −0 s/db/seeds.rb
  54. +2 −0 s/doc/README_FOR_APP
  55. +1 −0 s/log/development.log
  56. +1 −0 s/log/production.log
  57. +1 −0 s/log/server.log
  58. +1 −0 s/log/test.log
  59. +30 −0 s/public/404.html
  60. +30 −0 s/public/422.html
  61. +30 −0 s/public/500.html
  62. BIN s/public/favicon.ico
  63. BIN s/public/images/rails.png
  64. +275 −0 s/public/index.html
  65. +2 −0 s/public/javascripts/application.js
  66. +963 −0 s/public/javascripts/controls.js
  67. +973 −0 s/public/javascripts/dragdrop.js
  68. +1,128 −0 s/public/javascripts/effects.js
  69. +4,320 −0 s/public/javascripts/prototype.js
  70. +5 −0 s/public/robots.txt
  71. +4 −0 s/script/about
  72. +3 −0 s/script/console
  73. +3 −0 s/script/dbconsole
  74. +3 −0 s/script/destroy
  75. +3 −0 s/script/generate
  76. +3 −0 s/script/performance/benchmarker
  77. +3 −0 s/script/performance/profiler
  78. +3 −0 s/script/plugin
  79. +3 −0 s/script/runner
  80. +3 −0 s/script/server
  81. +9 −0 s/test/performance/browsing_test.rb
  82. +38 −0 s/test/test_helper.rb
@@ -11,7 +11,8 @@ def index
@limit = params[:limit] || 10;
if @nighttime
- @photos = Photo.where("created_at > ?", now - 24 * 3600).order(sql_rand).limit(@limit)
+ @days = 2;
+ @photos = Photo.where("created_at > ?", now - 24 * @days * 3600).order(sql_rand).limit(@limit)
# @photos = Photo.order(sql_rand).limit(5)
else
@photos = Photo.order("id DESC").limit(@limit)
@@ -163,7 +163,7 @@ void draw() {
}
}
}
- }
+ }}
void mousePressed() {
leftSensor._r.x = mouseX;
@@ -0,0 +1,89 @@
+import java.awt.Rectangle;
+import processing.video.*;
+
+
+class MotionSensor {
+ Rectangle _r = new Rectangle(0, 0, 0, 0);
+ int _thresh = 13;
+ float _sensorRes = 1;
+ float _lastTestAreaBrightness, _bDiff;
+ int _numPixels;
+ PImage _image;
+ // Capture _cam;
+
+ MotionSensor() {
+
+ }
+
+ boolean checkHitArea() {
+ // _cam = cam;
+ float testAreaBrightness = getTestAreaBrightness();
+ //find teh absolute diff of the current brightness and the last brightness
+ //println("testAreaBrightness: "+testAreaBrightness);
+ // println("_lastTestAreaBrightness: "+_lastTestAreaBrightness);
+ _bDiff = abs(testAreaBrightness - _lastTestAreaBrightness);
+
+ _lastTestAreaBrightness = testAreaBrightness;
+
+ if (_bDiff > _thresh) {
+ return true;
+ }
+ return false;
+ }
+
+ //returns the average brightness of the test area defined by the test area rectangle
+ float getTestAreaBrightness() {
+ _image.loadPixels();
+ float testAreaBrightness = 0;
+
+ // For each pixel in the test area
+ for (int x = _r.x; x < _r.x+_r.width; x+=_sensorRes) {
+ for (int y = _r.y; y < _r.y+_r.height; y+=_sensorRes) {
+ // println("_cam.get(x, y): "+ _cam.get(x, y));
+ testAreaBrightness += brightness(_image.get(x, y));
+ // println("brightness(_cam.get(x, y): "+ brightness(_cam.get(x, y)));
+ }
+ }
+
+ testAreaBrightness /= _numPixels;
+ testAreaBrightness *= _sensorRes;
+
+ return testAreaBrightness;
+ }
+
+ void draw() {
+ // println("MotionSensor.draw");
+ rect(_r.x, _r.y, _r.width, _r.height);
+ text(_bDiff, _r.x, _r.y - 5);
+ }
+
+ void update() {
+ _numPixels = _r.width*_r.height;
+ }
+
+ void reset(){
+ float testAreaBrightness = getTestAreaBrightness();
+ _bDiff = abs(testAreaBrightness - _lastTestAreaBrightness);
+ _lastTestAreaBrightness = testAreaBrightness;
+ }
+
+ //GETTERS AND SETTERS
+ void setWidth(int n) {
+ _r.width = n;
+ }
+
+
+
+ void setHeight(int n) {
+ _r.height = n;
+ }
+
+ void setX(int n) {
+ _r.x = n;
+ }
+
+ void setY(int n) {
+ _r.y = n;
+ }
+}
+
Oops, something went wrong.

0 comments on commit 711f91c

Please sign in to comment.