I hereby claim:
- I am rxet on github.
- I am rxet (https://keybase.io/rxet) on keybase.
- I have a public key ASCEHlK1KqALZN_qYw0qQTuV4JgbivXfwwLqWuBh0g_tLAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
Given an an array of numbers, find the length of the longest possible subsequence that is increasing. This subsequence can "jump" over numbers in the array. For example in [3, 10, 4, 5]
the longest increasing subsequence (LIS) is [3, 4, 5]
.
longestIncreasingSubsequence([3, 4, 2, 1, 10, 6]);
// should return 3, the length of the longest increasing subsequence:
// 3, 4, 6 (or 3, 4, 10)
window.addEventListener('load', setUp, false); | |
function setUp() { | |
// scene, camera, and renderer | |
makeScene(); | |
// add an object | |
createBox(); | |
// and a light |
function animate() { | |
//keep calling our animate function to keep the motion flowing | |
requestAnimationFrame( animate ); | |
//finally render our scene | |
renderer.render( scene, camera ); | |
//give our box a little twist | |
box.rotation.x += 0.01; | |
box.rotation.y += 0.01; |
//declare these variables in the global scope so our functions have access to them later | |
var scene; | |
var camera; | |
var box; | |
var renderer; | |
var controls; |
function createBox() { | |
//create the box geometry | |
var boxGeometry = new THREE.BoxGeometry( 1, 1, 1 ); | |
//create the material, this one is purple and affected by lights | |
var boxMaterial = new THREE.MeshPhongMaterial( { color: 0xffffff } ) | |
//smash them together in a mesh, and add to your scene | |
box = new THREE.Mesh(boxGeometry, boxMaterial); |
function letThereBeLight() { | |
//create your light - this one is white at almost full intensity | |
var directionalLight = new THREE.DirectionalLight( 0xffffff, 0.9 ); | |
// set the light direction | |
directionalLight.position.set(150, 350, 350); | |
//let it cast shadows | |
directionalLight.castShadow = true; |
function makeScene() { | |
//get browser width and height | |
var WIDTH = window.innerWidth; | |
var HEIGHT = window.innerHeight; | |
// make a scene | |
scene = new THREE.Scene(); | |
// and a camera | |
var aspectRatio = WIDTH / HEIGHT; |
window.addEventListener('load', setUp, false); | |
function setUp() { | |
// scene, camera, and renderer | |
makeScene(); | |
// add a light | |
letThereBeLight(); | |
// and an object |
<html> | |
<head> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/three.js/91/three.js"></script> | |
<script type="text/javascript" src="yourThreeFile.js"></script> | |
</head> | |
<body> | |
<div id="threeContainer"></div> | |
</body> | |
</html> |