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
# namespace gl | |
gl <- new.env() | |
# # of trials to run | |
gl$trials <- 20000 | |
# profits (price minus costs) and their related probabilities | |
gl$entreeProfit <- c(9,7.5,5.5,4) | |
gl$entreeProbability <- c(0.25,0.35,0.3,0.1) |
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
--- | |
title: 'DMD Problem Set #2' | |
author: "Harold Kyle" | |
output: | |
pdf_document: | |
fig_height: 7 | |
fig_width: 8 | |
toc: yes | |
--- |
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
# install.packages("ggplot2") | |
# install.packages("reshape") | |
# install.packages("gridextra") | |
require(ggplot2) | |
require(reshape) | |
library(gridextra) | |
### ASSUMPTIONS ### |
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
[24-Sep-2014 03:41:09 UTC] PHP Fatal error: Maximum function nesting level of '200' reached, aborting! in /var/www/boxcar/trunk/wp-content/plugins/memcached/object-cache.php on line 272 | |
[24-Sep-2014 03:41:09 UTC] PHP Stack trace: | |
[24-Sep-2014 03:41:09 UTC] PHP 1. {main}() /var/www/boxcar/trunk/wp-admin/post.php:0 | |
[24-Sep-2014 03:41:09 UTC] PHP 2. edit_post() /var/www/boxcar/trunk/wp-admin/post.php:229 | |
[24-Sep-2014 03:41:09 UTC] PHP 3. wp_update_post() /var/www/boxcar/trunk/wp-admin/includes/post.php:320 | |
[24-Sep-2014 03:41:09 UTC] PHP 4. wp_insert_post() /var/www/boxcar/trunk/wp-includes/post.php:3577 | |
[24-Sep-2014 03:41:09 UTC] PHP 5. do_action() /var/www/boxcar/trunk/wp-includes/post.php:3504 | |
[24-Sep-2014 03:41:09 UTC] PHP 6. call_user_func_array() /var/www/boxcar/trunk/wp-includes/plugin.php:505 | |
[24-Sep-2014 03:41:09 UTC] PHP 7. WC_Admin_Meta_Boxes->save_meta_boxes() /var/www/boxcar/trunk/wp-includes/plugin.php:505 | |
[24-Sep-2014 03:41:09 UTC] PHP 8. do_action() /var/www/boxcar/trunk/wp-conten |
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
add_filter('woocommerce_states',function($countries){ | |
// list the countries you actually want states for in this array | |
$countries_with_states = array( 'US','CA'); | |
foreach($countries as $country=>$states){ | |
if( !in_array($country, $countries_with_states) ){ | |
unset( $countries[$country] ); | |
} | |
} |
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
select distinct | |
# uncomment these rows for debugging | |
# p.ID, | |
# v.ID, | |
if( isnull(vm_sku.meta_value), pm_sku.meta_value, vm_sku.meta_value ) as 'sku', | |
p.post_title, | |
# need to cast prices to decimal because the datatype is not enforced otherwise |
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
Index: custom-permalinks.php | |
=================================================================== | |
--- custom-permalinks.php (revision 2657) | |
+++ custom-permalinks.php (revision 2658) | |
@@ -41,7 +41,7 @@ | |
function custom_permalinks_post_link($permalink, $post) { | |
$custom_permalink = get_post_meta( $post->ID, 'custom_permalink', true ); | |
if ( $custom_permalink ) { | |
- return get_home_url()."/".$custom_permalink; | |
+ return home_url()."/".$custom_permalink; |