Better HN
topnewbestaskshowjobs
Log inSign up

balducien

38 karma · joined Jan 13, 2015 (11y ago) · 2 submissions

Submissions

comment 10y ago · link · parent

Somebody on reddit found the bottleneck: https://www.reddit.com/r/rust/comments/4yinbt/writing_a_jpeg...

After fixing it, it apparently runs in 100 ms.

comment 10y ago · link · parent

Another solution: [1]

    cat /dev/urandom | hexdump -v -e '/1 "%u\n"' | awk '{ split("0,2,4,5,7,9,11,12",a,","); for (i = 0; i < 1; i+= 0.0001) printf("%08X\n", 100*sin(1382*exp((a[$1 % 8]/12)*log(2))*i)) }' | xxd -r -p | sox -traw -r44100 -b16 -e unsigned-integer - -tcoreaudio
1: https://www.reddit.com/r/programming/comments/48xf6k/bash_on...