Help for this page

Select Code to Download


  1. or download this
        $num_respondents = 20000;
        $offset = 0;
    ...
            if ($offset < 4) {$offset++;}
            else {$offset = 0;}
        }
    
  2. or download this
    respondent_1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0...
    respondent_2, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0...
    respondent_3, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0...
    
  3. or download this
        $sql = "INSERT INTO theTable (response, respondent) VALUES (?,?)";
        $sth = $dbh->prepare($sql) or die("Could not prepare!" . $dbh->err
    +str);
    ...
            if ($i < 5) {$i++;}
            else {$i = 1;}
        }
    
  4. or download this
    1, 1
    6,1
    ...
    8, 3
    13, 3
    ...
    
  5. or download this
        $respondents_by_5 = 4000;
        $sql = "SHOW TABLES";
    ...
                $stf->execute($respondent) or die("Could not execute!" . $
    +dbh->errstr);
            }
        }
    
  6. or download this
    Table_1:1, 6, 11, 16, ..., 19996
    Table_2:2, 7, 12, 17, ..., 19997
    ...
    Table_5:5, 10, 15, 20, .., 20000
    Table_6:1, 6, 11, 16, ..., 19996
    etc.
    
  7. or download this
        $j = 1;
        for $r (1 .. $num_responses) {
    ...
        &write_lines_to_file(1, $table, @lines_6666);
        $table = ">".$db_dir."/r9999";
        &write_lines_to_file(1, $table, @lines_9999);
    
  8. or download this
    sub write_lines_to_file {
        my $add_line_return = shift;
    ...
           close(FILE);
        select($STDOUT_Handle);
    }