{
"Version": "2012-10-17",
"Statement": [{
"Action": [
"sns:CreatePlatformEndpoint"
],
"Effect": "Allow",
"Resource": "arn:aws:sns:****"
}, {
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
| <!DOCTYPE html> | |
| <html ng-app="myApp"> | |
| <head> | |
| <title>HelloAudio</title> | |
| </head> | |
| <body ng-controller="Main"> | |
| <input type="range" min="20" max="4000" ng-model="hz.value" step="0.01"> | |
| <input type="range" min="0" max="1" ng-model="gain.value" step="0.01"> | |
| <script src="angular.min.js"></script> |
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
| angular.module('myApp').factory('audioContext', function() { | |
| return new AudioContext(); | |
| }); |
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 MyFaceDetectionListener implements Camera.FaceDetectionListener { | |
| private Matrix m = new Matrix(); | |
| private RectF rect = new RectF(); | |
| // Call this before startFaceDetection(). | |
| // targetWidth and targetHeight are usually size of view which shows camera preview. | |
| public void setup(boolean useFrontCamera, int displayOrientation, float targetWidth, float targetHeight) { | |
| m.setScale(useFrontCamera ? -1 : 1, 1); | |
| m.postRotate(displayOrientation); | |
| m.postTranslate(1000, 1000); |
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 android.app.Activity; | |
| import android.graphics.SurfaceTexture; | |
| import android.os.Bundle; | |
| import android.renderscript.Allocation; | |
| import android.renderscript.Element; | |
| import android.renderscript.RenderScript; | |
| import android.renderscript.Type; | |
| import android.view.Surface; | |
| import android.view.TextureView; | |
| import android.view.View; |
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 android.app.Activity; | |
| import android.graphics.Bitmap; | |
| import android.graphics.BitmapFactory; | |
| import android.graphics.SurfaceTexture; | |
| import android.media.MediaPlayer; | |
| import android.os.Bundle; | |
| import android.renderscript.Allocation; | |
| import android.renderscript.RenderScript; | |
| import android.view.Surface; | |
| import android.view.TextureView; |
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
| var mongoose = require('mongoose'); | |
| mongoose.connect('mongodb://localhost/myapp'); | |
| var schema = new mongoose.Schema({ | |
| name: String | |
| }); | |
| var model = mongoose.model('MyModel', schema); | |
| new model({ |
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
| var a = [1, 2, 3, 4, 5]; | |
| // shift は先頭を取り出す | |
| a.shift(); // -> 1 | |
| console.log(a); // -> [2, 3, 4, 5] | |
| // push は末尾に入れる | |
| a.push(111); | |
| console.log(a); // -> [2, 3, 4, 5, 111] |
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
| var request = require('request'), | |
| Promise = require('promise'), | |
| extend = require('extend'); | |
| module.exports = QueuedRequest; | |
| function QueuedRequest(interval) { | |
| this.interval = interval; | |
| this.queue = []; | |
| this.loop = loop.bind(this); |
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 android.graphics.Matrix; | |
| public class MatrixUtils { | |
| public static Info decomposition(Matrix matrix, boolean reverseOrder) { | |
| double dx, dy, sx, sy, theta; | |
| float[] values = new float[9]; | |
| matrix.getValues(values); |