Sign up to create your own snipts, or login.

Public snipts » min The latest public min snipts.

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";
    

    copy | embed

    0 comments - tagged in  posted by DrAlexJ on Nov 01, 2009 at 12:46 p.m. EST
  • 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*/  
    }
    

    copy | embed

    0 comments - tagged in  posted by YamilG on Feb 03, 2009 at 1:39 p.m. EST
Sign up to create your own snipts, or login.