0 ) $local_path = substr($local_path,0,$pos);
if ( strpos($local_path,"geojson") === 0 ) {
require_once("geojson.php");
return;
// New
} else if ( strpos($local_path, "regex_sum_") === 0 && strpos($local_path, ".txt") !== false ) {
header('Content-Type: text/plain');
$code = 42;
$pieces = preg_split('/[_.]/',$local_path);
if ( count($pieces) == 4 && $pieces[2]+0 > 0 ) {
$code = $pieces[2]+0;
}
if ( $code == 42 ) {
echo("This file contains the sample data\n\n");
} else {
echo("This file contains the actual data for your assignment - good luck!\n\n");
}
$handle = fopen("../static/intro.txt", "r");
if ($handle) {
$count = 0;
$MT = new Mersenne_Twister($code);
// header('Content-Disposition: attachment; filename='.$local_path.';');
while (($line = fgets($handle)) !== false) {
$count++;
$choose = ($count < 400 ) ? $MT->getNext(0,9) : 1 ;
if ( $choose != 0 ) {
echo($line);
continue;
}
$howmany = $MT->getNext(1,3);
if ( $howmany == 1 ) {
echo($MT->getNext(1,10000).' '.$line);
} else if ( $howmany == 2 ) {
echo($MT->getNext(1,10000).' '.rtrim($line).' '.$MT->getNext(1,10000)."\n");
} else if ( $howmany == 3 ) {
$words = explode(' ',$line);
if ( count($words) > 3 ) {
for($i=0; $i File not found: intro.txt File not found '.htmlentities($local_path).'
This application has a number of test data sources for
Python for Informatics: Exploring Information written by
@DrChuck /
www.dr-chuck.com.
This file contains the sample data for testing
\n\n");
} else {
echo("This file contains the actual data for your assignment - good luck!
\n\n");
}
?>
\n\n\n");
return;
// comments_12345.xml
} else if ( strpos($local_path, "comments_") === 0 && strpos($local_path, ".xml") !== false ) {
header('Content-Type: application/xml; charset=utf-8');
echo(''."\n");
echo("
$v ) {
echo('Name Comments
'."\n");
}
echo("'.$k.' '.$v.' People that = htmlentities($name) ?> knows
getCurrentFileUrl(__FILE__);
$curr_url = LTIX::curPageUrlScript();
$curr_url = str_replace("/index.php", "", $curr_url);
$new = getShuffledNames($code);
for($i = 0; $i < count($new) && $i < 100; $i++) {
$new_url = $curr_url."/known_by_".$new[$i].".html";
echo('
\n");
echo("getCurrentFileUrl: ".$CFG->getCurrentFileUrl(__FILE__)."\n");
echo("LTIX::curPageUrlScript: ".LTIX::curPageUrlScript()."\n");
var_dump($_SERVER);
echo("\n");
return;
}
if ( strlen($local_path) > 0 ) {
echo('Test data sources
This data is set up to be served by a Content Data Network (CDN) product like CloudFlare to conserve bandwidth and provide quicker access to a worldwide learner population. There is a cloud-hosted copy of this data at python-data.dr-chuck.net that you may be able to use.