(zfs+lz4 454574592)
src.tar 1048227840 3.31 real 0.92 user 2.34 sys
src.tgz 219728042 47.89 real 33.99 user 3.18 sys
src.tzst 204181122 7.91 real 0.89 user 1.82 sys
src.tbz 171283728 87.03 real 85.02 user 1.97 sys
src.txz 137741580 346.97 real 343.90 user 2.88 sys
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
let datasize = 65536 | |
var framework = "Darwin" | |
#if os(Linux) | |
framework = "Glibc" | |
#endif | |
let bf2swift:[Character:String] = [ | |
">": "sp += 1", | |
"<": "sp -= 1", | |
"+": "data[sp] += 1", | |
"-": "data[sp] -= 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
class Prime | |
# https://oeis.org/A014233 | |
# | |
# Smallest odd number for which Miller-Rabin primality test | |
# on bases <= n-th prime does not reveal compositeness. | |
# | |
A014233 = { | |
2 => 2047, | |
3 => 1373653, | |
5 => 25326001, |
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
({print($0+$0.debugDescription+")")})("({print($0+$0.debugDescription+\")\")})(") |
Seems like all songs downloaded via Apple Music are DRM'ed w/ Fairplay. You can see it for yourself via ffprobe
available as a part of ffmpeg.
~/Music/iTunes/iTunes Media/Apple Music/${Artist}/${Album}/${Song}.m4p
Metadata:
[…]
Duration: 00:03:51.11, start: 0.000000, bitrate: 286 kb/s
Stream #0:0(eng): Audio: aac (LC) (drms / 0x736D7264), 44100 Hz, stereo, fltp, 265 kb/s (default)
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
GNU ddrescue 1.19 | |
About to copy an unknown number of Bytes from /dev/rdisk2 to intel335.dmg. | |
Starting positions: infile = 0 B, outfile = 0 B | |
Copy block size: 128 sectors Initial skip size: 128 sectors | |
Sector size: 512 Bytes | |
Press Ctrl-C to interrupt | |
Initial status (read from logfile) | |
rescued: 240057 MB, errsize: 57344 B, errors: 7 |
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
/// See | |
/// https://github.com/rodionovd/SWRoute/wiki/Function-hooking-in-Swift | |
/// https://github.com/rodionovd/SWRoute/blob/master/SWRoute/rd_get_func_impl.c | |
/// to find why this works | |
func peekFunc<A,R>(f:A->R)->(fp:Int, ctx:Int) { | |
let (hi, lo):(Int, Int) = reinterpretCast(f) | |
let offset = sizeof(Int) == 8 ? 16 : 12 | |
let ptr = UnsafePointer<Int>(lo+offset) | |
return (ptr.memory, ptr.successor().memory) | |
} |
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
{print($0+$0.debugDescription+")")}("{print($0+$0.debugDescription+\")\")}(") |
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
extension String { | |
static func fromUTF16Chars(utf16s:UInt16[]) -> String { | |
var str = "" | |
for var i = 0; i < utf16s.count; i++ { | |
let hi = Int(utf16s[i]) | |
switch hi { | |
case 0xD800...0xDBFF: | |
let lo = Int(utf16s[++i]) | |
let us = 0x10000 | |
+ (hi - 0xD800)*0x400 + (lo - 0xDC00) |
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
func memoize<A: Hashable, R>(block:(A, (A->R))->R)->(A->R) { | |
var memo:Dictionary<A,R> = [:] | |
var result:(A->R)! | |
result = { | |
if let l = memo[$0] { return l } | |
let r = block($0, result) | |
memo[$0] = r | |
return r | |
} | |
return result |