This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| #### Tested using PHP 7 under Apache. | |
| A script to capture a json POST request, and print it | |
| (nearly*) as is to an output text file. Outputs are |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library( holmberg ) | |
| holmberg::pkgLoad( c( "data.table", "doMC", "plyr", "dplyr", "utils", "parallel" ) ) | |
| logicalCores <- parallel::detectCores( logical = FALSE ) | |
| virtualCores <- parallel::detectCores( logical = TRUE ) | |
| if( virtualCores > logicalCores ) { | |
| doMC::registerDoMC( cores = logicalCores ) | |
| } else if( logicalCores > 2 ) { | |
| doMC::registerDoMC( cores = logicalCores - 1L ) | |
| } else { | |
| doMC::registerDoMC( cores = 1L ) |