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
// Keep an array of indexes of loud samples. | |
const loud_indexes = [0]; | |
{ | |
const pcm_data = fs.readFileSync(pcm_output, { encoding: null }); | |
const pcm_values = new Int16Array(pcm_data.buffer); | |
// The first segment may be longer than normal due to Icecast | |
// buffering. | |
if (pcm_values.length > (window_length / 1000) * sample_rate * 1.2) { | |
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
function listenToStream(stream_id: number, description: string) { | |
const options = { | |
hostname: 'broadcastify.cdnstream1.com', | |
port: 443, | |
headers: { | |
'sec-ch-ua-mobile': '?0', | |
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', | |
'Accept': '*/*', | |
'Origin': 'https://www.broadcastify.com', |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 class Collatz { | |
private static int count_until_1(long n) { | |
int count = 0; | |
while(n != 1) { | |
if(n % 2 == 0) { | |
n /= 2; | |
} else { | |
n = (n * 3) + 1; | |
} | |
count++; |
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
'use strict'; | |
function collatz_count_until_1(n) { | |
var count = 0; | |
while(n !== 1) { | |
if(n % 2 === 0) { | |
n /= 2; | |
} else { | |
n = (3 * n) + 1; | |
} | |
count++; |
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
#include <stdio.h> | |
int collatz_count_until_1(unsigned int n) { | |
int count = 0; | |
while(n != 1) { | |
if(n % 2 == 0) { | |
n /= 2; | |
} else { | |
n = (3 * n) + 1; | |
} |
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
use strict; | |
use warnings; | |
sub collatz_count_until_1 { | |
my $n = shift; | |
my $count = 0; | |
while ($n != 1) { | |
$n = (($n % 2 == 0) ? ($n/2) : (($n*3) + 1)); | |
$count++; | |
} |
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
def collatz_count_until_1(n): | |
count = 0 | |
while n != 1: | |
if n % 2 == 0: | |
n = n / 2 | |
else: | |
n = (3 * n) + 1 | |
count += 1 | |
return count |
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
def collatz_count_until_1(n): | |
count = 0 | |
while n != 1: | |
if n % 2 == 0: | |
n = n / 2 | |
else: | |
n = (3 * n) + 1 | |
count += 1 | |
return count |
NewerOlder