This file contains 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
Sample Output: | |
Airplane Boarding Problem | |
Ran simluation a total of 10000 times boarding 100 people per plane. | |
A total of 4970 of 10000 times (49.7%) the last passenger got their assigned seat. | |
The number of non-assigned passengers varied from 0 to 14 with an avg of 5.1828 | |
Winners: 4970 | |
The number of non-assigned passengers varied from 0 to 13 with an avg of 4.6796780684105 |
This file contains 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 | |
/** | |
This is a plugin that was used to gzip old edocs that were created prior to when REDCap introduced Gzip. | |
Which was with version 6 in 2014! So, if you've only been REDCapping for a while, then this might not | |
have that much importance. If, like us, you've got an old instance with lots of old files, this could save | |
you some substantial disk space | |
Compressing old .csv, .r, .xls, .sas exports can free up about 90% of their previous storage space. |
This file contains 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
create | |
definer = andy123@`10.130.0.0/255.255.0.0` procedure migrateLogEventTable(IN pid int, IN source_table varchar(255), | |
IN target_table varchar(255)) | |
p1:BEGIN | |
set @pid = pid; | |
set @source_table = source_table; | |
set @target_table = target_table; | |
-- MAKE SURE WE ARENT MOVING TO SAME TABLE! |
This file contains 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
function getContextToken ( | |
$project_id = null, | |
$record = null, | |
$event_id = null, | |
$module_prefix = self::_PREFIX, | |
$custom = [], | |
$duration_valid_in_mins = 5 | |
) { | |
// refactor to allow passing parameters in an array as a single argument as well |
This file contains 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
-- main | |
set @PID = 19184; | |
set @EID = 115110; | |
set @F1 = 'rsp_prt_portal_email'; | |
set @F2 = 'rsp_prt_portal_phone'; | |
set @F3 = 'rsp_prt_portal_url'; | |
set @F4 = 'rsp_prt_start_date'; | |
set @F5 = 'rsp_prt_disable_email'; | |
set @F6 = 'rsp_prt_disable_sms'; |
This file contains 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 | |
class RepeatingForms | |
{ | |
// Metadata | |
private $Proj; | |
private $pid; | |
private $is_longitudinal; | |
private $data_dictionary; | |
private $fields; | |
private $events_enabled = array(); // Array of event_ids where the instrument is enabled |
This file contains 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 | |
class Record | |
{ | |
/** | |
* DETERMINE IF A RECORD RESERVED (private method) | |
* See if a record is reserved in the new_record_cache table | |
* | |
* @param $project_id |
This file contains 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
We have seen cases where an EM repo ends up nesting the entire REDCap web repo inside of it recursively. You often get /webauth/webauth/webuath runaways. | |
determine the hash for the last 'good' commit. | |
git checkout dev | |
git log -5 // determine last good commit | |
git reset --hard HASH | |
git push -f origin dev | |
Then repeat for master and prod if it ended up there... |
This file contains 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 | |
/* | |
* This script is intended to help you keep your many cloned external modules current... | |
* To run, place this in your redcap root folder and from the command line run | |
* | |
* php update_pull.php | |
* | |
* Note that nothing will be automatically done unless you pass in a true argument as in | |
* |
This file contains 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
// Create a javascript object to hold all of our config features | |
var SummarizeConfig = { | |
init: function(params) { | |
// Make true | |
this.isDev = true; | |
// We need to delay a little bit for the rest of the config to finish loading | |
setTimeout(function() { | |
SummarizeConfig.configAjax.call(SummarizeConfig,'pages/ConfigAjax') |
NewerOlder