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
const KEY_BINDING = { | |
0: 'A', | |
1: 'B', | |
2: 'X', | |
3: 'Y', | |
4: 'L1', | |
5: 'R1', | |
6: 'L2', | |
7: 'R2', | |
8: 'Option', |
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 BufferedImage scaleByWidth(BufferedImage sourceImage, int targetWidth) { | |
double factor = (double) targetWidth / (double) sourceImage.getWidth(); | |
int targetHeight = (int) (sourceImage.getHeight() * factor); | |
return scale(sourceImage, targetWidth, targetHeight); | |
} | |
public static BufferedImage scaleByHeight(BufferedImage sourceImage, int targetHeight) { |
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
// sigmoid function | |
(x) => 1 / (1 + Math.pow(Math.E, -k * (x - b))); | |
// parable function | |
(x) => a * Math.pow(x - b, 2) + c; | |
// range function | |
// returns array with numbers from 0 to n | |
(n) => [...Array(n).keys()]; |
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 main | |
type Node struct { | |
val int | |
ref *Node | |
} | |
type Linkedlist struct { | |
list *Node | |
} |
NewerOlder