Next | Tricks of the Wizards | 164 |
Very commonly used
Example: Your local DNS server caches the responses it gets from other DNS servers
Another example: Converting RGB values to CMYK values:
sub cmyk { my ($r, $g, $b) = @_; my ($c, $m, $y) = (1-$r, 1-$g, 1-$b); my $k = $c < $m ? ($c < $y ? $c : $y) : ($m < $y ? $m : $y); # Minimum for ($c, $m, $y) { $_ -= $k } [$c, $m, $y, $k]; }
Many image formats (including GIF) have many pixels that are the same color.
This recomputes the same CMYK values over and over.
Next | Copyright © 2003 M. J. Dominus |