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 "testApp.h" | |
//-------------------------------------------------------------- | |
void testApp::setup(){ | |
ofSetVerticalSync(true); | |
ofEnableAlphaBlending(); | |
ofSetFrameRate(30); | |
counter = 0; | |
fboReader.setAsync(false); |
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
let foo = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100)) | |
foo.center = view.center | |
foo.layer.backgroundColor = UIColor.blueColor().CGColor | |
foo.layer.anchorPoint = CGPoint(x: 0.5, y: 0.5) | |
view.addSubview(foo) | |
foo.layer.opacity = 1.0 | |
let fade = CFAAction.fade(fromValue: 0, toValue: 1, time: 2.5, curveType: CurveType.CurveTypeQuintic, easeType: EaseType.EaseTypeOut) | |
let scale = CFAAction.scale(fromValue: 1.0, toValue: 2.5, time: 1, curveType: CurveType.CurveTypeBounce, easeType: EaseType.EaseTypeOut) | |
let rotate = CFAAction.rotate(fromValue: 0.0, toValue: CGFloat( M_PI ), time: 1, curveType: CurveType.CurveTypeBounce, easeType: EaseType.EaseTypeOut) |
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
var ready=function(){function i(){if(r.isReady){return}try{document.documentElement.doScroll("left")}catch(e){setTimeout(i,1);return}r.ready()}function s(t){r.bindReady();var n=r.type(t);e.done(t)}var e,t,n={};n["[object Boolean]"]="boolean";n["[object Number]"]="number";n["[object String]"]="string";n["[object Function]"]="function";n["[object Array]"]="array";n["[object Date]"]="date";n["[object RegExp]"]="regexp";n["[object Object]"]="object";var r={isReady:false,readyWait:1,holdReady:function(e){if(e){r.readyWait++}else{r.ready(true)}},ready:function(t){if(t===true&&!--r.readyWait||t!==true&&!r.isReady){if(!document.body){return setTimeout(r.ready,1)}r.isReady=true;if(t!==true&&--r.readyWait>0){return}e.resolveWith(document,[r])}},bindReady:function(){if(e){return}e=r._Deferred();if(document.readyState==="complete"){return setTimeout(r.ready,1)}if(document.addEventListener){document.addEventListener("DOMContentLoaded",t,false);window.addEventListener("load",r.ready,false)}else if(document.attachEvent){doc |
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
<canvas id = "c" > </canvas> | |
<p> | |
Tear the cloth with your mouse.<br><br> | |
Right click and drag to cut the cloth.<br><br> | |
Reduce physics_accuracy if it's laggy, increase it for a better effect. | |
</p> |
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
<canvas id = "c" > </canvas> | |
<p> | |
Tear the cloth with your mouse.<br><br> | |
Right click and drag to cut the cloth.<br><br> | |
Reduce physics_accuracy if it's laggy, increase it for a better effect. | |
</p> |
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 "testApp.h" | |
//-------------------------------------------------------------- | |
void testApp::setup(){ | |
ofImage foo; | |
foo.loadImage("walrus.jpg"); | |
ofPixels px; | |
px.setFromPixels(foo.getPixels(), foo.width, foo.height, foo.getPixelsRef().getImageType()); |
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 ExampleDispatcher { | |
private Object _listener; | |
public void setListener(Object obj) { | |
_listener = obj; | |
} | |
public void dispatchBasic() { | |
try { | |
Method callback = _listener.getClass().getMethod("handleBasicEvent"); |
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
// .h | |
#include "Poco/MD5Engine.h" | |
#include "Poco/DigestStream.h" | |
#include "Poco/StreamCopier.h" | |
using Poco::DigestEngine; | |
using Poco::MD5Engine; | |
using Poco::DigestOutputStream; | |
using Poco::StreamCopier; |
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
// breakpoints | |
$break-small: 400px; | |
$break-large: 1024px; | |
@mixin respond-to($media) { | |
@if $media == handhelds { | |
@media only screen and (max-width: $break-small) { @content; } | |
} | |
@else if $media == medium-screens { | |
@media only screen and (min-width: $break-small + 1) and (max-width: $break-large - 1) { @content; } |
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
NSLog(@"%@", [NSNumber numberWithInt:i]); | |
/* | |
%@ Object | |
%d, %i signed int | |
%u unsigned int | |
%f float/double | |
%1.2f to controll number of decimals | |
%x, %X hexadecimal int |