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
* How to deploy Python3 app * | |
1. create 'app.yaml' | |
runtime: python | |
env: flex | |
entrypoint: gunicorn -b :$PORT main:app | |
runtime_config: | |
python_version: 3 | |
# This sample incurs costs to run on the App Engine flexible environment. |
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
////////////////////////////////////////////////////////////////// | |
// LeapPayDefine_Android.h | |
////////////////////////////////////////////////////////////////// | |
enum LEAPPAY_RESULT | |
{ | |
LEAPPAY_RESULT_ERROR = -1, | |
LEAPPAY_RESULT_SUCCESS = 0, | |
LEAPPAY_RESULT_CANCEL = 2, | |
LEAPPAY_RESULT_PARAMERROR = 3, | |
LEAPPAY_RESULT_NEEDLOGIN = 4, |
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
//////////////////////////////////////////////////////////////////////////////// | |
// Rearview camera | |
//////////////////////////////////////////////////////////////////////////////// | |
/*global THREE */ | |
var camera, rearCam, scene, renderer; | |
var cameraControls; | |
var clock = new THREE.Clock(); |
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
//////////////////////////////////////////////////////////////////////////////// | |
// Make 4 viewports | |
//////////////////////////////////////////////////////////////////////////////// | |
/*global THREE */ | |
var camera, topCam, sideCam, frontCam; | |
var scene, renderer; | |
var cameraControls; | |
var clock = new THREE.Clock(); |
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
// Degrees <-> Radians | |
import math | |
math.radians(deg) | |
math.degrees(rad) |
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
// how to load a texture | |
var texture = THREE.ImageUtils.loadTexture( '/media/img/cs291/textures/grass512x512.jpg' ); | |
texture.wrapS = texture.wrapT = THREE.RepeatWrapping; | |
texture.repeat.set( 10, 10 ); | |
var solidGround = new THREE.Mesh( | |
new THREE.PlaneGeometry( 10000, 10000, 100, 100 ), | |
new THREE.MeshLambertMaterial( { map: texture } ) ); | |
var texture = THREE.ImageUtils.loadTexture( '/media/img/cs291/textures/feather.png' ); | |
var tail = new THREE.Mesh( |
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
// Example program | |
#include <iostream> | |
#include <string> | |
#include <algorithm> | |
#include <cmath> | |
#define _USE_MATH_DEFINES | |
#ifndef M_PI | |
#define M_PI 3.14159265358979323846 // pi |
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
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <algorithm> | |
#include <queue> | |
#include <cassert> | |
using namespace std; | |
// for optimization |
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
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <algorithm> | |
#include <queue> | |
#include <cassert> | |
using namespace std; | |
// for optimization |
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
#include <bits/stdc++.h> | |
//////////// cos sin ////////////// | |
#include <cmath> | |
const double pi = std::acos(-1); | |
double cosByDegree( double degree ) | |
{ | |
const double radian = degree*pi/180.0; | |
return cos(radian); |