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
function drawScene() { | |
gl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight); | |
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); | |
mat4.perspective(45, gl.viewportWidth / gl.viewportHeight, 0.1, 100.0, pMatrix); | |
mat4.identity(mvMatrix); | |
mat4.translate(mvMatrix, [-1.5, 0.0, -7.0]); | |
gl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexPositionBuffer); |
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
/** | |
* This is a basic example on how to instantiate sigma. A random graph is | |
* generated and stored in the "graph" variable, and then sigma is instantiated | |
* directly with the graph. | |
* | |
* The simple instance of sigma is enough to make it render the graph on the on | |
* the screen, since the graph is given directly to the constructor. | |
*/ | |
var i, | |
s, |
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
free(*(firstDblPtr + *numStudents - 1)); | |
free(*(lastDblPtr + *numStudents - 1)); | |
free(*(scoreDblPtr + *numStudents - 1)); | |
firstDblPtr = realloc(firstDblPtr, (*numStudents - 1) * sizeof(char*)); | |
lastDblPtr = realloc(lastDblPtr, (*numStudents - 1) * sizeof(char*)); | |
scoreDblPtr = realloc(scoreDblPtr, (*numStudents - 1) * sizeof(double*)); |
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
function destroyer(arr) { | |
// Remove all the values | |
var array2 = Array.from(arguments).slice(1); | |
return arr.filter(function(val){ | |
return !array2.includes(val); | |
}); | |
} | |
destroyer([1, 2, 3, 1, 2, 3], 2, 3); |
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
function palindrome(str) { | |
// Good luck! | |
newStr = str.replace(/[^A-Za-z]+/, ''); | |
console.log(newStr); | |
return true; | |
} | |
palindrome("eye1111%%"); |
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
//Setup | |
var contacts = [ | |
{ | |
"firstName": "Akira", | |
"lastName": "Laine", | |
"number": "0543236543", | |
"likes": ["Pizza", "Coding", "Brownie Points"] | |
}, | |
{ |
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
//Setup | |
var contacts = [ | |
{ | |
"firstName": "Akira", | |
"lastName": "Laine", | |
"number": "0543236543", | |
"likes": ["Pizza", "Coding", "Brownie Points"] | |
}, | |
{ |
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
//Setup | |
var contacts = [ | |
{ | |
"firstName": "Akira", | |
"lastName": "Laine", | |
"number": "0543236543", | |
"likes": ["Pizza", "Coding", "Brownie Points"] | |
}, | |
{ |
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
public static void mergeSort_srt(int array[], int lo, int n) { | |
int low = lo; | |
int high = n; | |
if (low >= high) { | |
return; | |
} |
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
else if ((yearDiff > 0) && (monthValid)) // Year2 is after Year 1 | |
{ | |
System.out.println(); | |
daysBetween = daysToEndOfMonth(dd1,mm1); | |
daysBetween = daysOfMonth(daysBetween,mm1+1,12+1); | |
daysBetween = daysOfMonth(daysBetween,1,mm2); | |
daysBetween += dd2; | |
daysBetween += ((yearDiff-1)*365);// *-* add in 365 days for each year inbetween yyyy1 and yyyy2 | |
} | |