duplicates = multiple editions
A Classical Introduction to Modern Number Theory,Kenneth IrelandMichael Rosen
A Classical Introduction to Modern Number Theory,Kenneth IrelandMichael Rosen
/* Sometimes, taking the floored square root of a 64-bit integer is needed. | |
In order to gain the speed of hardware square root, 64-bit integers must be converted | |
to 53-bit mantissa doubles. | |
This can cause incorrect results due to loss of precision. | |
However, the floor of the square root produced will be either the correct | |
floored square root or the next higher integer. | |
For reasoning, see http://apps.topcoder.com/forums/?module=Thread&threadID=695233 | |
So, we can simply: | |
1) Convert to double. | |
2) Use hardware square root. |
pngcheck
can detect non-PNGs:find -name '*.png' -exec pngcheck -q '{}' +
find -name '*.png' -exec sh -c "pngcheck -v '{}' | grep -q 'chunk iCCP' && echo \"\\\"{}\\\"\"" \; | xargs gimp & while true; do window_id=$(wmctrl -l | grep -Pom 1 "^(0x[0-9a-f]{8})(?=\s.+ Convert to RGB working space\?$)"); if [ "$window_id" != "" ]; then xsendkey -window $window_id "Alt+C"; fi; sleep 1; done
#!/usr/bin/env ruby | |
require 'open3' | |
require 'tempfile' | |
ThreadCount = 2 | |
Infinity = 1.0/0.0 | |
Filenames = Dir['**/favicon.ico', '**/*.png'].map! { |filename| File.expand_path filename } | |
BestSizes = Hash.new { |h, filename| h[filename] = [Infinity, nil] } |