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
// ==UserScript== | |
// @name Scratch Username Hash | |
// @namespace nathanprocks.scratchusernamehash | |
// @version 0.1 | |
// @description Kaj was here | |
// @author nathanprocks and scratchyone | |
// @match https://scratch.mit.edu/* | |
// @grant none | |
// @require https://cdn.rawgit.com/jupiterio/466bbd644eb3d4b680326da15520071a/raw/be552d004ab21ab8b3bb04e687bb85d231c20554/4096mostFrequentEnglishWords.js | |
// @require https://cdn.rawgit.com/emn178/js-sha3/master/build/sha3.min.js |
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
pub fn prime(amount: i32) -> Vec<i64> { | |
let mut out: Vec<i64> = Vec::with_capacity(amount as usize / 3); | |
let mut allowed: Vec<bool> = vec![false; amount as usize]; | |
for i in | |
(0_usize..amount as usize).filter(|n| n % 2 == 1 && n % 5 != 0 && n % 3 != 0 && n % 7 != 0) | |
{ | |
allowed[i] = true; | |
} | |
out.push(2_i64); | |
out.push(3_i64); |
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
pub fn prime(amount: i32) -> Vec<i64> { | |
let amount: usize = amount as usize; | |
let mut out: Vec<usize> = (0..amount).collect::<Vec<usize>>(); | |
for x in 2..amount { | |
for i in (x * x..amount).step_by(x) { | |
out[i] = 0; | |
} | |
if out[x] == 0 { | |
continue; | |
} |
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
pub fn prime(amount: i32) -> Vec<i64> { | |
let amount: usize = amount as usize; | |
let mut out: Vec<usize> = (0..amount) | |
.map(|n| { | |
if n % 2 == 1 && n % 5 != 0 && n % 3 != 0 && n % 7 != 0 { | |
n | |
} else { | |
0 | |
} | |
}) |
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 midly::Smf; | |
use std::env; | |
use std::fs; | |
use std::fs::File; | |
use std::fs::OpenOptions; | |
use std::io::prelude::*; | |
use std::path::Path; | |
#[derive(Eq, PartialEq)] | |
struct Note { | |
tick: i32, |