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 | |
/* | |
Plugin Name: Posts 2 Posts List Widget | |
Plugin URI: http://friendlywebconsulting.com/ | |
Description: Creates a widget to display posts connected via the Posts 2 Posts plugin by Scribu, found here: http://wordpress.org/extend/plugins/posts-to-posts/ | |
Author: Michelle McGinnis | |
Author URI: http://friendlywebconsulting.com/ | |
Version: 1.0.0-alpha | |
*/ |
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
// do the comparison between baseline and current dataset here | |
foreach(array('high_rva', 'mid_rva', 'low_rva') as $type) { | |
$si = 1; | |
for($i = 0; $i < count($this->baseline_dataset[$type]); $i++) { | |
// calculate Hydrologic Alteration Factor | |
$observed_frequency = $this->comparison_dataset[$type][$i]; | |
$expected_frequency = $this->baseline_dataset[$type][$i] * ($this->years_post / $this->years_pre); |
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
Array | |
( | |
[0] => Array | |
( | |
[high_rva] => Array | |
( | |
[0] => stdClass Object | |
( | |
[22] => 0.41666666666667 | |
) |
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
Array | |
( | |
[0] => Array | |
( | |
[high_rva] => Array | |
( | |
[0] => stdClass Object | |
( | |
[demand_id] => 22 | |
[si] => 0.41666666666667 |
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
Script baseLineData execution took 0.32932496070862 seconds <br />Array | |
( | |
[1] => Array | |
( | |
[6] => Array | |
( | |
[213] => 19 | |
[183] => 22 | |
[184] => 22 | |
[185] => 21 |
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
Script baseLineData execution took 0.33139801025391 seconds <br />Array | |
( | |
[1] => Array | |
( | |
[6] => Array | |
( | |
[median] => 19 | |
[minimum] => 18 | |
[maximum] => 22 | |
) |
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
Script baseLineData execution took 0.31350111961365 seconds <br />Array | |
( | |
[0] => Array | |
( | |
[0] => 21 | |
[1] => 21 | |
[2] => 21 | |
[3] => 21 | |
[4] => 21 | |
[5] => 21 |
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 | |
//Pull historical daily; assumes that historical has at least as many years as the generated. | |
$sql = "select * from verde_historical_daily where year <= :year"; | |
$core = Core::getInstance(); | |
$stmt = $core->dbh->prepare($sql); | |
$stmt->bindParam(':year', $totalYears, PDO::PARAM_INT); | |
try { | |
$stmt->execute() |
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
require 'fileutils' | |
start_time = Time.now | |
SOURCE_DB = { | |
:name => 'db_name', | |
:user => 'db_user', | |
:password => 'db_pass', | |
:host => 'localhost' |
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
<script type="text/javascript"> | |
/* <![CDATA[ */ | |
// Global My App Namespace | |
window.myapp = window.myapp || {}; | |
// AJAX Namespace | |
myapp.ajax = myapp.ajax || {}; | |
myapp.ajax.csrf = '98dd0f785e'; | |
myapp.ajax.paths = { |