Surprise! We've been running on hardware provided by BuyVM for a few months and wanted to show them a little appreciation.
Running a paste site comes with unique challenges, ones that aren't always obvious and hard to control. As such, BuyVM offered us a home where we could worry less about the hosting side of things and focus on maintaining a clean and useful service! Go check them out and show them some love!
Submitted on August 8, 2013 at 02:22 PM

Section 1 (Text)

<?
//dont change this value
set_time_limit(10000000);

function leading_zeros($value, $places){
// Function written by Marcus L. Griswold (vujsa)
// Can be found at http://www.handyphp.com
// Do not remove this header!

    if(is_numeric($value)){
        for($x = 1; $x <= $places; $x++){
            $ceiling = pow(10, $x);
            if($value < $ceiling){
                $zeros = $places - $x;
                for($y = 1; $y <= $zeros; $y++){
                    $leading .= "0";
                }
            $x = $places + 1;
            }
        }
        $output = $leading . $value;
    }
    else{
        $output = $value;
    }
    return $output;
}

//$start = microtime(true);

//location of the completed film images
//$filepath=$PATH.'C:\\Calloway\\Source\\Drawer170\\Film Images\\Completed\\';
$filepath=$PATH.'C:\\Ballard\\Film Images\\Completed\\';
//same as filepath
//$dir = opendir('C:\\Calloway\\Source\\Drawer170\\Film Images\\Completed\\');
$dir = opendir('C:\\Ballard\\Film Images\\Completed\\');
while($file = readdir($dir)){
    if(eregi("\.tif", $file)) {
        $filepare = ltrim(str_replace('.TIF','',$file),0);
        $filepare = ltrim(str_replace('.tif','',$filepare),0);
        $fileparear = explode('-',$filepare);
        $filenumber = $fileparear[0];
        $pagenumber = leading_zeros($fileparear[1],4);
        $fullname = $filenumber."-".$pagenumber;
        $listarray[$filenumber][] = $fullname;
        }
    }
//same as filepath
//$source = 'C:\\Calloway\\Source\\Drawer170\\Film Images\\Completed\\';
$source = 'C:\\Ballard\\Film Images\\Completed\\';


//target directory for combined film images
$target = 'C:\\Ballard\\Film Images\\Final\\';
foreach($listarray as $key => $value){
    sort($value);
    $j=0;
    foreach($value as $key2 => $value2) 
    {
    if($key > 0){
    $renamear = explode('-',$value2);
    $renamefirst = leading_zeros($renamear[0],4);
    $renamesecond = ltrim($renamear[1],0);
    if($renamesecond != NULL){$rename = $renamefirst."-".$renamesecond;}
    else {$rename = $renamefirst.$renamesecond;};
    $list .= ",".$source.$rename.".tif"; $j++;}}
    $combine = $target."FinishedFilm\\".$key.".tif".$list;
    $command = '"C:\Program Files\IrfanView\i_view32.exe" /tifc=4 /multitif=('.$combine.') /killmesoftly';
    if ($j < 1000000000){
    echo $command;

    //comment the next 2 lines to test
    //$file = popen($command, "r");
    //pclose($file);
    echo "<br>";}
    unset ($list);

}
$end = microtime(true);
$time = $end-$start;

echo $time;

?>