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
// <div> | |
// <svg viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg" version="1.2"> | |
// <circle cx="200" cy="200" r="100" fill="red" stroke="blue" stroke-width="10" /> | |
// </svg> | |
// </div> | |
// svg { | |
// outline: 1px solid red; | |
// width: 400px; |
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
/* | |
<style> | |
html, body { | |
margin:0; | |
padding:0; | |
} | |
#canvas-wrapper { | |
margin: 20px auto 10px auto; |
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 getRandomNumber(min, max) { | |
return Math.round(Math.random() * (max - min) + min); | |
} | |
function lessThan(a, b) { | |
return a < b; | |
} | |
function comparator(predicate) { |
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
package com.test; | |
import java.util.Collections; | |
import java.util.List; | |
public class QuickSort<T extends Comparable<T>> { | |
public void sort(List<T> values) { | |
quickSort(0, values.size() - 1, values); |
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
package com.test; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class MergeSort<T extends Comparable<T>> { | |
public void sort(List<T> values){ | |
mergeSort(0, values.size() - 1, values, new ArrayList<T>(values)); | |
} |
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 Animator() { | |
this._animated = []; | |
this.EASING = { | |
easeInOutCubic: function (e, f, a, h, g) { | |
if ((f /= g / 2) < 1) { | |
return h / 2 * f * f * f + a; | |
} | |
return h / 2 * ((f -= 2) * f * f + 2) + a; | |
}, | |
easeOutBounce: function (e, f, a, h, g) { |