Public
snipts » min
showing 1-2 of 2 snipts for min
-
∞ Number Set Calculator
#!/usr/bin/perl -w use strict; # header print "||--- Number Set Calculator\n\n"; # input my @set = ( ); if (@ARGV){ open(DAT, $ARGV[0]) or die "Error: $!"; @set = split(/ /, <DAT>); close(DAT) or die "Error: $!"; # input for file } else { print "* Input numbers separated by spaces: "; @set = split(/ /, <>); # manual } # print sorted array sub nmc { $a <=> $b; } chomp(@set = sort nmc @set); print "\n||--- Sorted Set: (", join(", ",@set), ")\n"; # print total & average my $ttl = 0; ($ttl += $_) for @set; print "||--- Total: ", $ttl, "\n"; print "||--- Average: ", $ttl/@set, "\n"; # print median (grep(/.5/i,@set/2)) ? print "||--- Median: ", $set[@set/2-.5], "\n" : # if odd print "||--- Median: ", ($set[@set/2-1] + $set[@set/2])/2, "\n"; # if even # print min / max, & range print "||--- Min => Max: (", $set[0], " => ", $set[-1], ")\n"; print "||--- Range: ", $set[-1] - $set[0], "\n\n";
-
∞ Cross Browser Minimum Height
#container{ height:auto !important;/*all browsers except ie6 will respect the !important flag*/ min-height:500px; height:500px;/*Should have the same value as the min height above*/ }



MySQL Stored Procedure Programming