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
brew services stop postgresql | |
rm /usr/local/var/postgres/postmaster.pid # adjust path accordingly to your install | |
brew services start postgresql |
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
function startMusic() { | |
(function myLoop(i) { | |
setTimeout(function () { | |
var x = i / 10; | |
var tone = Math.floor(1/(Math.sqrt(Math.pow(x, Math.cos(x)))) * 100); | |
console.log(tone); | |
playNote(600 - tone, 50); | |
i++; | |
myLoop(i); | |
}, 30) |
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
public class Ackermann { | |
// Definition of the Ackermann function | |
// a(0, m) = m + 1 | |
// a(n + 1, 0) = a(n, 1) | |
// a(n + 1, m + 1) = a(n, a(n + 1, m)) | |
private static int a(int n, int m) { | |
if (n == 0) { | |
return m + 1; | |
} else if (m == 0) { |
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
public class EuclidAlgorithm { | |
public static void main(String[] args) { | |
System.out.println("GGT: " + ggt(99,78)); | |
} | |
private static int ggt(int y, int x) { | |
if (x > y) { | |
x = x + y; | |
y = x - y; |