text:
<?php
	//only admins can get this
	if(!function_exists("current_user_can") || (!current_user_can("manage_options") && !current_user_can("pmpro_orders")))
	{
		die(__("You do not have permissions to perform this action.", "pmpro"));
	}

	//vars
	global $wpdb;
	if(isset($_REQUEST['s']))
		$s = sanitize_text_field(trim($_REQUEST['s']));
	else
		$s = "";

	if(isset($_REQUEST['l']))
		$l = intval($_REQUEST['l']);
	else
		$l = false;

	if(isset($_REQUEST['start-month']))
		$start_month = intval($_REQUEST['start-month']);
	else
		$start_month = "1";

	if(isset($_REQUEST['start-day']))
		$start_day = intval($_REQUEST['start-day']);
	else
		$start_day = "1";

	if(isset($_REQUEST['start-year']))
		$start_year = intval($_REQUEST['start-year']);
	else
		$start_year = date("Y");

	if(isset($_REQUEST['end-month']))
		$end_month = intval($_REQUEST['end-month']);
	else
		$end_month = date("n");

	if(isset($_REQUEST['end-day']))
		$end_day = intval($_REQUEST['end-day']);
	else
		$end_day = date("j");

	if(isset($_REQUEST['end-year']))
		$end_year = intval($_REQUEST['end-year']);
	else
		$end_year = date("Y");

	if(isset($_REQUEST['predefined-date']))
		$predefined_date = sanitize_text_field($_REQUEST['predefined-date']);
	else
		$predefined_date = "This Month";

	if(isset($_REQUEST['status']))
		$status = sanitize_text_field($_REQUEST['status']);
	else
		$status = "";

	//some vars for the search
	if(isset($_REQUEST['pn']))
		$pn = intval($_REQUEST['pn']);
	else
		$pn = 1;

	if(isset($_REQUEST['limit']))
		$limit = intval($_REQUEST['limit']);
	else
	{
		/**
		 * Filter to set the default number of items to show per page
		 * on the Orders page in the admin.
		 *
		 * @since 1.8.4.5
		 *
		 * @param int $limit The number of items to show per page.
		 */
		$limit = apply_filters('pmpro_orders_per_page', 15);
	}

	$end = $pn * $limit;
	$start = $end - $limit;

	//filters
	if(empty($filter) || $filter === "all")
	{
		$condition = "1=1";
		$filter = "all";
	}
	elseif($filter == "within-a-date-range")
	{
		$start_date = $start_year."-".$start_month."-".$start_day;
		$end_date = $end_year."-".$end_month."-".$end_day;

		//add times to dates
		$start_date =  $start_date . " 00:00:00";
		$end_date =  $end_date . " 23:59:59";

		$condition = "timestamp BETWEEN '".esc_sql($start_date)."' AND '".esc_sql($end_date)."'";
	}
	elseif($filter == "predefined-date-range")
	{
		if($predefined_date == "Last Month")
		{
			$start_date = date("Y-m-d", strtotime("first day of last month", current_time("timestamp")));
			$end_date   = date("Y-m-d", strtotime("last day of last month", current_time("timestamp")));
		}
		elseif($predefined_date == "This Month")
		{
			$start_date = date("Y-m-d", strtotime("first day of this month", current_time("timestamp")));
			$end_date   = date("Y-m-d", strtotime("last day of this month", current_time("timestamp")));
		}
		elseif($predefined_date == "This Year")
		{
			$year = date('Y');
			$start_date = date("Y-m-d", strtotime("first day of January $year", current_time("timestamp")));
			$end_date   = date("Y-m-d", strtotime("last day of December $year", current_time("timestamp")));
		}

		elseif($predefined_date == "Last Year")
		{
			$year = date('Y') - 1;
			$start_date = date("Y-m-d", strtotime("first day of January $year", current_time("timestamp")));
			$end_date   = date("Y-m-d", strtotime("last day of December $year", current_time("timestamp")));
		}

		//add times to dates
		$start_date =  $start_date . " 00:00:00";
		$end_date =  $end_date . " 23:59:59";

		$condition = "timestamp BETWEEN '".esc_sql($start_date)."' AND '".esc_sql($end_date)."'";
	}
	elseif($filter == "within-a-level")
	{
		$condition = "membership_id = " . esc_sql($l);
	}
	elseif($filter == "within-a-status")
	{
		$condition = "status = '" . esc_sql($status) . "' ";
	}

	//emailing?
	if(!empty($_REQUEST['email']) && !empty($_REQUEST['order']))
	{
		$email = new PMProEmail();
		$user = get_user_by('email', $_REQUEST['email']);
		$order = new MemberOrder($_REQUEST['order']);
		if($email->sendBillableInvoiceEmail($user, $order))
		{
			$pmpro_msg = __("Invoice emailed successfully.", "pmpro");
			$pmpro_msgt = "success";
		}
		else
		{
			$pmpro_msg = __("Error emailing invoice.", "pmpro");
			$pmpro_msgt = "error";
		}

		//clean up so we stay on the orders list view
		unset($_REQUEST['order']);
		$order = NULL;
	}

	//deleting?
	if(!empty($_REQUEST['delete']))
	{
		$dorder = new MemberOrder(intval($_REQUEST['delete']));
		if($dorder->deleteMe())
		{
			$pmpro_msg = __("Order deleted successfully.", "pmpro");
			$pmpro_msgt = "success";
		}
		else
		{
			$pmpro_msg = __("Error deleting order.", "pmpro");
			$pmpro_msgt = "error";
		}
	}

	if(isset($_REQUEST['filter']))
		$filter = sanitize_text_field($_REQUEST['filter']);
	else
		$filter = "all";

	$thisyear = date("Y");

	//this array stores fields that should be read only
	$read_only_fields = apply_filters("pmpro_orders_read_only_fields", array("code", "payment_transaction_id", "subscription_transaction_id"));

	//saving?
	if(!empty($_REQUEST['save']))
	{
		//start with old order if applicable
		$order_id = intval($_REQUEST['order']);
		if($order_id > 0)
			$order = new MemberOrder($order_id);
		else
			$order = new MemberOrder();

		//update values
		if(!in_array("code", $read_only_fields) && isset($_POST['code']))
			$order->code = $_POST['code'];
		if(!in_array("user_id", $read_only_fields) && isset($_POST['user_id']))
			$order->user_id = intval($_POST['user_id']);
		if(!in_array("membership_id", $read_only_fields) && isset($_POST['membership_id']))
			$order->membership_id = intval($_POST['membership_id']);
		if(!in_array("billing_name", $read_only_fields) && isset($_POST['billing_name']))
			$order->billing->name = stripslashes($_POST['billing_name']);
		if(!in_array("billing_street", $read_only_fields) && isset($_POST['billing_street']))
			$order->billing->street = stripslashes($_POST['billing_street']);
		if(!in_array("billing_city", $read_only_fields) && isset($_POST['billing_city']))
			$order->billing->city = stripslashes($_POST['billing_city']);
		if(!in_array("billing_state", $read_only_fields) && isset($_POST['billing_state']))
			$order->billing->state = stripslashes($_POST['billing_state']);
		if(!in_array("billing_zip", $read_only_fields) && isset($_POST['billing_zip']))
			$order->billing->zip = $_POST['billing_zip'];
		if(!in_array("billing_country", $read_only_fields) && isset($_POST['billing_country']))
			$order->billing->country = stripslashes($_POST['billing_country']);
		if(!in_array("billing_phone", $read_only_fields) && isset($_POST['billing_phone']))
			$order->billing->phone = $_POST['billing_phone'];
		if(!in_array("subtotal", $read_only_fields) && isset($_POST['subtotal']))
			$order->subtotal = $_POST['subtotal'];
		if(!in_array("tax", $read_only_fields) && isset($_POST['tax']))
			$order->tax = $_POST['tax'];
		if(!in_array("couponamount", $read_only_fields) && isset($_POST['couponamount']))
			$order->couponamount = $_POST['couponamount'];
		if(!in_array("total", $read_only_fields) && isset($_POST['total']))
			$order->total = $_POST['total'];
		if(!in_array("payment_type", $read_only_fields) && isset($_POST['payment_type']))
			$order->payment_type = $_POST['payment_type'];
		if(!in_array("cardtype", $read_only_fields) && isset($_POST['cardtype']))
			$order->cardtype = $_POST['cardtype'];
		if(!in_array("accountnumber", $read_only_fields) && isset($_POST['accountnumber']))
			$order->accountnumber = $_POST['accountnumber'];
		if(!in_array("expirationmonth", $read_only_fields) && isset($_POST['expirationmonth']))
			$order->expirationmonth = $_POST['expirationmonth'];
		if(!in_array("expirationyear", $read_only_fields) && isset($_POST['expirationyear']))
			$order->expirationyear = $_POST['expirationyear'];
		if(!in_array("ExpirationDate", $read_only_fields) && isset($_POST['ExpirationDate']))
			$order->ExpirationDate = $order->expirationmonth . $order->expirationyear;
		if(!in_array("status", $read_only_fields) && isset($_POST['status']))
			$order->status = stripslashes($_POST['status']);
		if(!in_array("gateway", $read_only_fields) && isset($_POST['gateway']))
			$order->gateway = $_POST['gateway'];
		if(!in_array("gateway_environment", $read_only_fields) && isset($_POST['gateway_environment']))
			$order->gateway_environment = $_POST['gateway_environment'];
		if(!in_array("payment_transaction_id", $read_only_fields) && isset($_POST['payment_transaction_id']))
			$order->payment_transaction_id = $_POST['payment_transaction_id'];
		if(!in_array("subscription_transaction_id", $read_only_fields) && isset($_POST['subscription_transaction_id']))
			$order->subscription_transaction_id = $_POST['subscription_transaction_id'];
		if(!in_array("notes", $read_only_fields) && isset($_POST['notes']))
			$order->notes = stripslashes($_POST['notes']);

		//affiliate stuff
		$affiliates = apply_filters("pmpro_orders_show_affiliate_ids", false);
		if(!empty($affiliates))
		{
			if(!in_array("affiliate_id", $read_only_fields))
				$order->affiliate_id = $_POST['affiliate_id'];
			if(!in_array("affiliate_subid", $read_only_fields))
				$order->affiliate_subid = $_POST['affiliate_subid'];
		}

		//save
		if($order->saveOrder() !== false)
		{
			//handle timestamp
			if($order->updateTimestamp($_POST['ts_year'], $_POST['ts_month'], $_POST['ts_day']) !== false)
			{
				$pmpro_msg = __("Order saved successfully.", "pmpro");
				$pmpro_msgt = "success";
			}
			else
			{
				$pmpro_msg = __("Error updating order timestamp.", "pmpro");
				$pmpro_msgt = "error";
			}
		}
		else
		{
			$pmpro_msg = __("Error saving order.", "pmpro");
			$pmpro_msgt = "error";
		}
	}
	else
	{
		//order passed?
		if(!empty($_REQUEST['order']))
		{
			$order_id = intval($_REQUEST['order']);
			if($order_id > 0)
				$order = new MemberOrder($order_id);
			elseif(!empty($_REQUEST['copy']))
			{
				$order = new MemberOrder(intval($_REQUEST['copy']));

				//new id
				$order->id = NULL;

				//new code
				$order->code = $order->getRandomCode();
			}
			else
			{
				$order = new MemberOrder();			//new order

				//defaults
				$order->code = $order->getRandomCode();
				$order->user_id = "";
				$order->membership_id = "";
				$order->billing->name = "";
				$order->billing->street = "";
				$order->billing->city = "";
				$order->billing->state = "";
				$order->billing->zip = "";
				$order->billing->country = "";
				$order->billing->phone = "";
				$order->subtotal = "";
				$order->tax = "";
				$order->couponamount = "";
				$order->total = "";
				$order->payment_type = "";
				$order->cardtype = "";
				$order->accountnumber = "";
				$order->expirationmonth = "";
				$order->expirationyear = "";
				$order->status = "success";
				$order->gateway = pmpro_getOption("gateway");
				$order->gateway_environment = pmpro_getOption("gateway_environment");
				$order->payment_transaction_id = "";
				$order->subscription_transaction_id = "";
				$order->affiliate_id = "";
				$order->affiliate_subid = "";
				$order->notes = "";
			}
		}
	}

	require_once(dirname(__FILE__) . "/admin_header.php");
?>

<?php if(!empty($order)) { ?>

		<?php if(!empty($order->id)) { ?>
			<?php _e('Order', 'pmpro');?> #<?php echo $order->id?>: <?php echo $order->code?>
		<?php } else { ?>
			<?php _e('New Order', 'pmpro');?>
		<?php } ?>

	<?php if(!empty($pmpro_msg)) { ?>
		<div id="message" class="<?php if($pmpro_msgt == "success") echo "updated fade"; else echo "error"; ?>">
<?php echo $pmpro_msg?>

	<?php } ?>

	<form method="post" action="">

					ID:
					<?php if(!empty($order->id)) echo $order->id; else echo __("This will be generated when you save.", "pmpro");?>

					<?php _e('Code', 'pmpro');?>:

						<?php if(in_array("code", $read_only_fields)) { echo $order->code; } else { ?>
							<input id="code" name="code" type="text" size="50" value="<?php echo esc_attr($order->code);?>" />
						<?php } ?>
						<?php if($order_id < 0) { ?><?php _e('Randomly generated for you.', 'pmpro');?><?php } ?>

					<?php _e('User ID', 'pmpro');?>:

						<?php if(in_array("user_id", $read_only_fields) && $order_id > 0) { echo $order->user_id; } else { ?>
							<input id="user_id" name="user_id" type="text" size="50" value="<?php echo esc_attr($order->user_id);?>" />
						<?php } ?>

					<?php _e('Membership Level ID', 'pmpro');?>:

						<?php if(in_array("membership_id", $read_only_fields) && $order_id > 0) { echo $order->membership_id; } else { ?>
							<input id="membership_id" name="membership_id" type="text" size="50" value="<?php echo esc_attr($order->membership_id);?>" />
						<?php } ?>

					<?php _e('Billing Name', 'pmpro');?>:

						<?php if(in_array("billing_name", $read_only_fields) && $order_id > 0) { echo $order->billing_name; } else { ?>
							<input id="billing_name" name="billing_name" type="text" size="50" value="<?php echo esc_attr($order->billing->name);?>" />
						<?php } ?>

					<?php _e('Billing Street', 'pmpro');?>:

						<?php if(in_array("billing_street", $read_only_fields) && $order_id > 0) { echo $order->billing_street; } else { ?>
							<input id="billing_street" name="billing_street" type="text" size="50" value="<?php echo esc_attr($order->billing->street);?>" />
						<?php } ?>

					<?php _e('Billing City', 'pmpro');?>:

						<?php if(in_array("billing_city", $read_only_fields) && $order_id > 0) { echo $order->billing_city; } else { ?>
							<input id="billing_city" name="billing_city" type="text" size="50" value="<?php echo esc_attr($order->billing->city);?>" />
						<?php } ?>

					<?php _e('Billing State', 'pmpro');?>:

						<?php if(in_array("billing_state", $read_only_fields) && $order_id > 0) { echo $order->billing_state; } else { ?>
							<input id="billing_state" name="billing_state" type="text" size="50" value="<?php echo esc_attr($order->billing->state);?>" />
						<?php } ?>

					<?php _e('Billing Postal Code', 'pmpro');?>:

						<?php if(in_array("billing_zip", $read_only_fields) && $order_id > 0) { echo $order->billing_zip; } else { ?>
							<input id="billing_zip" name="billing_zip" type="text" size="50" value="<?php echo esc_attr($order->billing->zip);?>" />
						<?php } ?>

					<?php _e('Billing Country', 'pmpro');?>:

						<?php if(in_array("billing_country", $read_only_fields) && $order_id > 0) { echo $order->billing_country; } else { ?>
							<input id="billing_country" name="billing_country" type="text" size="50" value="<?php echo esc_attr($order->billing->country);?>" />
						<?php } ?>

					<?php _e('Billing Phone', 'pmpro');?>:

						<?php if(in_array("billing_phone", $read_only_fields) && $order_id > 0) { echo $order->billing_phone; } else { ?>
							<input id="billing_phone" name="billing_phone" type="text" size="50" value="<?php echo esc_attr($order->billing->phone);?>" />
						<?php } ?>

					<?php _e('Sub Total', 'pmpro');?>:

						<?php if(in_array("subtotal", $read_only_fields) && $order_id > 0) { echo $order->subtotal; } else { ?>
							<input id="subtotal" name="subtotal" type="text" size="10" value="<?php echo esc_attr($order->subtotal);?>" />
						<?php } ?>

					<?php _e('Tax', 'pmpro');?>:

						<?php if(in_array("tax", $read_only_fields) && $order_id > 0) { echo $order->tax; } else { ?>
							<input id="tax" name="tax" type="text" size="10" value="<?php echo esc_attr($order->tax);?>" />
						<?php } ?>

					<?php _e('Coupon Amount', 'pmpro');?>:

						<?php if(in_array("couponamount", $read_only_fields) && $order_id > 0) { echo $order->couponamount; } else { ?>
							<input id="couponamount" name="couponamount" type="text" size="10" value="<?php echo esc_attr($order->couponamount);?>" />
						<?php } ?>

					<?php _e('Total', 'pmpro');?>:

						<?php if(in_array("total", $read_only_fields) && $order_id > 0) { echo $order->total; } else { ?>
							<input id="total" name="total" type="text" size="10" value="<?php echo esc_attr($order->total);?>" />
						<?php } ?>
						<?php _e('Should be subtotal + tax - couponamount.', 'pmpro');?>

					<?php _e('Payment Type', 'pmpro');?>:

						<?php if(in_array("payment_type", $read_only_fields) && $order_id > 0) { echo $order->payment_type; } else { ?>
							<input id="payment_type" name="payment_type" type="text" size="50" value="<?php echo esc_attr($order->payment_type);?>" />
						<?php } ?>
						<?php _e('e.g. PayPal Express, PayPal Standard, Credit Card.', 'pmpro');?>

					<?php _e('Card Type', 'pmpro');?>

						<?php if(in_array("cardtype", $read_only_fields) && $order_id > 0) { echo $order->cardtype; } else { ?>
							<input id="cardtype" name="cardtype" type="text" size="50" value="<?php echo esc_attr($order->cardtype);?>" />
						<?php } ?>
						<?php _e('e.g. Visa, MasterCard, AMEX, etc', 'pmpro');?>

					<?php _e('Account Number', 'pmpro');?>:

						<?php if(in_array("accountnumber", $read_only_fields) && $order_id > 0) { echo $order->accountnumber; } else { ?>
							<input id="accountnumber" name="accountnumber" type="text" size="50" value="<?php echo esc_attr($order->accountnumber);?>" />
						<?php } ?>
						<?php _e('Obscure all but last 4 digits.', 'pmpro');?>

				<?php if(in_array("ExpirationDate", $read_only_fields) && $order_id > 0) { echo $order->ExpirationDate; } else { ?>

					<?php _e('Expiration Month', 'pmpro');?>:

						<input id="expirationmonth" name="expirationmonth" type="text" size="10" value="<?php echo esc_attr($order->expirationmonth);?>" />
						MM

					<?php _e('Expiration Year', 'pmpro');?>:

						<input id="expirationyear" name="expirationyear" type="text" size="10" value="<?php echo esc_attr($order->expirationyear);?>" />
						YYYY

				<?php } ?>

					<?php _e('Status', 'pmpro');?>:

						<?php if(in_array("status", $read_only_fields) && $order_id > 0) { echo $order->status; } else { ?>
						<?php
							$statuses = array();
							$default_statuses = array("", "success", "cancelled", "review", "token", "refunded", "pending");
							$used_statuses = $wpdb->get_col("SELECT DISTINCT(status) FROM $wpdb->pmpro_membership_orders");
							$statuses = array_unique(array_merge($default_statuses, $used_statuses));
							asort($statuses);
							$statuses = apply_filters("pmpro_order_statuses", $statuses);
						?>
						<select id="status" name="status">
							<?php foreach($statuses as $status) { ?>
								<option value="<?php echo esc_attr($status);?>" <?php selected($order->status, $status);?>><?php echo $status;?></option>
							<?php } ?>
						</select>
						<?php } ?>

					<?php _e('Gateway', 'pmpro');?>:

						<?php if(in_array("gateway", $read_only_fields) && $order_id > 0) { echo $order->gateway; } else { ?>
						<select id="gateway" name="gateway" onchange="pmpro_changeGateway(jQuery(this).val());">
							<?php
								$pmpro_gateways = pmpro_gateways();
								foreach($pmpro_gateways as $pmpro_gateway_name => $pmpro_gateway_label)
								{
								?>
								<option value="<?php echo esc_attr($pmpro_gateway_name);?>" <?php selected($order->gateway, $pmpro_gateway_name);?>><?php echo $pmpro_gateway_label;?></option>
								<?php
								}
							?>
						</select>
						<?php } ?>

					<?php _e('Gateway Environment', 'pmpro');?>:

						<?php if(in_array("gateway_environment", $read_only_fields) && $order_id > 0) { echo $order->gateway_environment; } else { ?>
						<select name="gateway_environment">
							<option value="sandbox" <?php if($order->gateway_environment == "sandbox") { ?>selected="selected"<?php } ?>><?php _e('Sandbox/Testing', 'pmpro');?></option>
							<option value="live" <?php if($order->gateway_environment == "live") { ?>selected="selected"<?php } ?>><?php _e('Live/Production', 'pmpro');?></option>
						</select>
						<?php } ?>

					<?php _e('Payment Transaction ID', 'pmpro');?>:

						<?php if(in_array("payment_transaction_id", $read_only_fields) && $order_id > 0) { echo $order->payment_transaction_id; } else { ?>
							<input id="payment_transaction_id" name="payment_transaction_id" type="text" size="50" value="<?php echo esc_attr($order->payment_transaction_id);?>" />
						<?php } ?>
						<?php _e('Generated by the gateway. Useful to cross reference orders.', 'pmpro');?>

					<?php _e('Subscription Transaction ID', 'pmpro');?>:

						<?php if(in_array("subscription_transaction_id", $read_only_fields) && $order_id > 0) { echo $order->subscription_transaction_id; } else { ?>
							<input id="subscription_transaction_id" name="subscription_transaction_id" type="text" size="50" value="<?php echo esc_attr($order->subscription_transaction_id);?>" />
						<?php } ?>
						<?php _e('Generated by the gateway. Useful to cross reference subscriptions.', 'pmpro');?>

					<?php _e('Date', 'pmpro');?>:

						<?php if(in_array("timestamp", $read_only_fields) && $order_id > 0) { echo date(get_option('date_format') . " " . get_option('time_format'), $order->timestamp); } else { ?>
						<?php
							//set up date vars
							if(!empty($order->timestamp))
								$timestamp = $order->timestamp;
							else
								$timestamp = current_time('timestamp');
							$year = date("Y", $timestamp);
							$month = date("n", $timestamp);
							$day = date("j", $timestamp);
						?>
						<select id="ts_month" name="ts_month">
						<?php
							for($i = 1; $i < 13; $i++)
							{
							?>
							<option value="<?php echo $i?>" <?php if($i == $month) { ?>selected="selected"<?php } ?>><?php echo date("M", strtotime($i . "/1/" . $year, current_time("timestamp")))?></option>
							<?php
							}
						?>
						</select>
						<input name="ts_day" type="text" size="2" value="<?php echo esc_attr($day);?>" />
						<input name="ts_year" type="text" size="4" value="<?php echo esc_attr($year);?>" />
						<?php } ?>

				<?php
					$affiliates = apply_filters("pmpro_orders_show_affiliate_ids", false);
					if(!empty($affiliates)) {
				?>

					<?php _e('Affiliate ID', 'pmpro');?>Affiliate ID:

						<?php if(in_array("affiliate_id", $read_only_fields) && $order_id > 0) { echo $order->affiliate_id; } else { ?>
							<input id="affiliate_id" name="affiliate_id" type="text" size="50" value="<?php echo esc_attr($order->affiliate_id);?>" />
						<?php } ?>

					<?php _e('Affiliate SubID', 'pmpro');?>Affiliate SubID:

						<?php if(in_array("affiliate_subid", $read_only_fields) && $order_id > 0) { echo $order->affiliate_subid; } else { ?>
							<input id="affiliate_subid" name="affiliate_subid" type="text" size="50" value="<?php echo esc_attr($order->affiliate_subid);?>" />
						<?php } ?>

				<?php } ?>

					<?php _e('Notes', 'pmpro');?>:

						<?php if(in_array("notes", $read_only_fields) && $order_id > 0) { echo $order->notes; } else { ?>
							<textarea id="notes" name="notes" rows="5" cols="80"><?php echo esc_textarea($order->notes);?></textarea>
						<?php } ?>

				<?php do_action("pmpro_after_order_settings", $order); ?>

			<input name="order" type="hidden" value="<?php if(!empty($order->id)) echo $order->id; else echo $order_id;?>" />
			<input name="save" type="submit" class="button-primary" value="<?php _e('Save Order', 'pmpro');?>" />
			<input name="cancel" type="button" class="cancel button-secondary" value="<?php _e('Cancel', 'pmpro');?>" onclick="location.href='<?php echo get_admin_url(NULL, '/admin.php?page=pmpro-orders')?>';" />

	</form>

<?php } else { ?>
	<?php
	/**
	 * Code to handle emailing billable invoices.
	 *
	 * @since 1.8.6
	 */
	?>

	<?php add_thickbox(); ?>

<?php _e('Email Invoice', 'pmpro'); ?>

		<form method="post" action="">
			<input type="hidden" name="order" value="" />
			<?php _e('Send an invoice for this order to: ', 'pmpro'); ?>
			<input type="text" value="" name="email" />
			<button class="button button-primary alignright"><?php _e('Send Email', 'pmpro'); ?></button>
		</form>

	<form id="posts-filter" method="get" action="">

		<?php _e('Orders', 'pmpro');?>
		+ <?php _e('Add New Order', 'pmpro');?>

		<?php
			//build the export URL
			$export_url = admin_url('admin-ajax.php') . "?action=orders_csv";
			$url_params = array(
				"filter"=>$filter,
				"s"=>$s,
				"l"=>$l,
				"start-month"=>$start_month,
				"start-day"=>$start_day,
				"start-year"=>$start_year,
				"end-month"=>$end_month,
				"end-day"=>$end_day,
				"end-year"=>$end_year,
				"predefined-date"=>$predefined_date,
				"status"=>$status
			);
			$export_url = add_query_arg($url_params, $export_url);
		?>
		<a target="_blank" href="<?php echo $export_url;?>" class="add-new-h2"><?php _e('Export to CSV', 'pmpro');?>

	<?php if(!empty($pmpro_msg)) { ?>
		<div id="message" class="<?php if($pmpro_msgt == "success") echo "updated fade"; else echo "error"; ?>">
<?php echo $pmpro_msg?>

	<?php } ?>

			<?php _ex('Show', 'Dropdown label, e.g. Show Daily Orders for January', 'pmpro')?>
			<select id="filter" name="filter">
				<option value="all" <?php selected($filter, "all");?>><?php _e('All', 'pmpro');?></option>
				<option value="within-a-date-range" <?php selected($filter, "within-a-date-range");?>><?php _e('Within a Date Range', 'pmpro');?></option>
				<option value="predefined-date-range" <?php selected($filter, "predefined-date-range");?>><?php _e('Predefined Date Range', 'pmpro');?></option>
				<option value="within-a-level" <?php selected($filter, "within-a-level");?>><?php _e('Within a Level', 'pmpro');?></option>
				<option value="within-a-status" <?php selected($filter, "within-a-status");?>><?php _e('Within a Status', 'pmpro');?></option>
			</select>

			<?php _ex('From', 'Dropdown label', 'pmpro')?>

			<select id="start-month" name="start-month">
				<?php for($i = 1; $i < 13; $i++) { ?>
					<option value="<?php echo $i;?>" <?php selected($start_month, $i);?>><?php echo date("F", mktime(0, 0, 0, $i, 2));?></option>
				<?php } ?>
			</select>

			<input id='start-day' name="start-day" type="text" size="2" value="<?php echo esc_attr($start_day);?>" />
			<input id='start-year' name="start-year" type="text" size="4" value="<?php echo esc_attr($start_year);?>" />

			<?php _ex('To', 'Dropdown label', 'pmpro')?>

			<select id="end-month" name="end-month">
				<?php for($i = 1; $i < 13; $i++) { ?>
					<option value="<?php echo $i;?>" <?php selected($end_month, $i);?>><?php echo date("F", mktime(0, 0, 0, $i,2));?></option>
				<?php } ?>
			</select>

			<input id='end-day' name="end-day" type="text" size="2" value="<?php echo esc_attr($end_day);?>" />
			<input id='end-year' name="end-year" type="text" size="4" value="<?php echo esc_attr($end_year);?>" />

			<?php _ex('filter by ', 'Dropdown label', 'pmpro')?>

			<select id="predefined-date" name="predefined-date">

					<option value="<?php echo "This Month";?>" <?php selected($predefined_date, "This Month");?>><?php echo "This Month";?></option>
					<option value="<?php echo "Last Month";?>" <?php selected($predefined_date, "Last Month");?>><?php echo "Last Month";?></option>
					<option value="<?php echo "This Year";?>" <?php selected($predefined_date, "This Year");?>><?php echo "This Year";?></option>
					<option value="<?php echo "Last Year";?>" <?php selected($predefined_date, "Last Year");?>><?php echo "Last Year";?></option>

			</select>

			<?php
			//Note: only orders belonging to current levels can be filtered. There is no option for orders belonging to deleted levels
			$levels = pmpro_getAllLevels(true, true);
			?>
			<select id="l" name="l">
			<?php foreach($levels as $level) { ?>
				<option value="<?php echo $level->id;?>" <?php selected($l, $level->id);?>><?php echo $level->name;?></option>
			<?php } ?>

			</select>

	<?php
	$statuses = array();
	$default_statuses = array("", "success", "cancelled", "review", "token", "refunded");
	$used_statuses = $wpdb->get_col("SELECT DISTINCT(status) FROM $wpdb->pmpro_membership_orders");
	$statuses = array_unique(array_merge($default_statuses, $used_statuses));
	asort($statuses);
	$statuses = apply_filters("pmpro_order_statuses", $statuses);
	?>
	<select id="status" name="status">
		<?php foreach($statuses as $the_status) { ?>
		<option value="<?php echo esc_attr($the_status);?>" <?php selected($the_status, $status);?>><?php echo $the_status;?></option>
		<?php } ?>
	</select>

		<input id="submit" type="submit" value="<?php _ex('Filter', 'Submit button value.', 'pmpro');?>" />

		<?php _e('Search Orders', 'pmpro');?>:
		<input type="hidden" name="page" value="pmpro-orders" />
		<input id="post-search-input" type="text" value="<?php echo esc_attr($s);?>" name="s"/>
		<input class="button" type="submit" value="<?php _e('Search Orders', 'pmpro');?>"/>

	<?php
		//string search
		if($s)
		{
			$sqlQuery = "SELECT SQL_CALC_FOUND_ROWS o.id FROM $wpdb->pmpro_membership_orders o LEFT JOIN $wpdb->users u ON o.user_id = u.ID LEFT JOIN $wpdb->pmpro_membership_levels l ON o.membership_id = l.id ";

			$join_with_usermeta = apply_filters("pmpro_orders_search_usermeta", false);
			if($join_with_usermeta)
				$sqlQuery .= "LEFT JOIN $wpdb->usermeta um ON o.user_id = um.user_id ";

			$sqlQuery .= "WHERE (1=2 ";

			$fields = array("o.id", "o.code", "o.billing_name", "o.billing_street", "o.billing_city", "o.billing_state", "o.billing_zip", "o.billing_phone", "o.payment_type", "o.cardtype", "o.accountnumber", "o.status", "o.gateway", "o.gateway_environment", "o.payment_transaction_id", "o.subscription_transaction_id", "u.user_login", "u.user_email", "u.display_name", "l.name");

			if($join_with_usermeta)
				$fields[] = "um.meta_value";

			$fields = apply_filters("pmpro_orders_search_fields", $fields);

			foreach($fields as $field)
				$sqlQuery .= " OR " . $field . " LIKE '%" . esc_sql($s) . "%' ";
			$sqlQuery .= ") ";

			$sqlQuery .= "AND " . $condition . " ";

			$sqlQuery .= "GROUP BY o.id ORDER BY o.id DESC, o.timestamp DESC ";
		}
		else
		{
			$sqlQuery = "SELECT SQL_CALC_FOUND_ROWS id FROM $wpdb->pmpro_membership_orders WHERE ".$condition." ORDER BY id DESC, timestamp DESC ";
		}

		$sqlQuery .= "LIMIT $start, $limit";

		$order_ids = $wpdb->get_col($sqlQuery);

		$totalrows = $wpdb->get_var("SELECT FOUND_ROWS() as found_rows");

		if($order_ids)
		{
		?>

<?php printf(__("%d orders found.", "pmpro"), $totalrows);?>

		<?php
		}
	?>

				<?php _e('ID', 'pmpro');?>
				<?php _e('Code', 'pmpro');?>
				<?php _e('User', 'pmpro');?>
				<?php do_action("pmpro_orders_extra_cols_header", $order_ids);?>
				<?php _e('Membership Level', 'pmpro');?>
				<?php _e('Total', 'pmpro');?>
				<?php _e('Payment', 'pmpro');?>
				<?php _e('Gateway', 'pmpro');?>
				<?php _e('Transaction IDs', 'pmpro');?>
				<?php _e('Status', 'pmpro');?>
				<?php _e('Date', 'pmpro');?>

			<?php
				$count = 0;
				foreach($order_ids as $order_id)
				{
					$order = new MemberOrder();
					$order->nogateway = true;
					$order->getMemberOrderByID($order_id);
					?>
						<tr <?php if($count++ % 2 == 0) { ?>class="alternate"<?php } ?>>
							<a href="admin.php?page=pmpro-orders&order=<?php echo $order->id?>"><?php echo $order->id;?>
							<a href="admin.php?page=pmpro-orders&order=<?php echo $order->id?>"><?php echo $order->code;?>

								<?php $order->getUser(); ?>
								<?php if(!empty($order->user)) { ?>
									<a href="user-edit.php?user_id=<?php echo $order->user->ID?>"><?php echo $order->user->user_login?>
								<?php } else { ?>
									[<?php _e('deleted', 'pmpro');?>]
								<?php } ?>

								<?php
									// Set up the hover actions for this user
									$actions = apply_filters( 'pmpro_orders_user_row_actions', array(), $order->user );
									$action_count = count( $actions );
									$i = 0;
									if($action_count)
									{
										$out = '
';
										foreach ( $actions as $action => $link ) {
											++$i;
											( $i == $action_count ) ? $sep = '' : $sep = ' | ';
											$out .= "$link$sep";
										}
										$out .= '
';
										echo $out;
									}
								?>

							<?php do_action("pmpro_orders_extra_cols_body", $order);?>
							<?php echo $order->membership_id;?>
							<?php echo pmpro_formatPrice($order->total);?>

								<?php if(!empty($order->payment_type)) echo $order->payment_type . "
";?>
								<?php if(!empty($order->accountnumber)) { ?>
									<?php echo $order->cardtype;?>: x<?php echo last4($order->accountnumber);?>

								<?php } ?>
								<?php if(!empty($order->billing->street)) { ?>
									<?php echo $order->billing->street; ?>

									<?php if( $order->billing->city &&  $order->billing->state) { ?>
										<?php echo  $order->billing->city?>, <?php echo  $order->billing->state?> <?php echo  $order->billing->zip?>  <?php if(!empty( $order->billing->country)) echo  $order->billing->country?>

									<?php } ?>
								<?php } ?>
								<?php if(!empty($order->billing->phone)) echo formatPhone($order->billing->phone);?>

							<?php echo $order->gateway;?><?php if($order->gateway_environment == "test") echo "(test)";?>

								<?php _e('Payment', 'pmpro');?>: <?php if(!empty($order->payment_transaction_id)) echo $order->payment_transaction_id; else echo "N/A";?>

								<?php _e('Subscription', 'pmpro');?>: <?php if(!empty($order->subscription_transaction_id)) echo $order->subscription_transaction_id; else echo "N/A";?>

							<?php echo $order->status;?>

								<?php echo date(get_option('date_format'), $order->timestamp);?>

								<?php echo date(get_option('time_format'), $order->timestamp);?>

								<a href="admin.php?page=pmpro-orders&order=<?php echo $order->id;?>"><?php _e('edit', 'pmpro');?>

								<a href="admin.php?page=pmpro-orders&order=-1&copy=<?php echo $order->id;?>"><?php _e('copy', 'pmpro');?>

								<a href="javascript:askfirst('<?php echo str_replace("'", "\'", sprintf(__("Deleting orders is permanent and can affect active users. Are you sure you want to delete order %s?", "pmpro"), str_replace("'", "", $order->code)));?>', 'admin.php?page=pmpro-orders&delete=<?php echo $order->id;?>'); void(0);"><?php _e('delete', 'pmpro');?>

								<a href="admin-ajax.php?action=pmpro_orders_print_view&order=<?php echo $order->id; ?>" target="_blank"><?php _e('print', 'pmpro');?>

								<a href="#TB_inline?width=600&height=200&inlineId=email_invoice" class="thickbox email_link" data-order="<?php echo $order->id; ?>"><?php _e('email', 'pmpro');?>

					<?php
				}

				if(!$order_ids)
				{
				?>

<?php _e('No orders found.', 'pmpro');?>

				<?php
				}
			?>

	</form>
	<?php
		//add normal args
		$pagination_url = add_query_arg($url_params, get_admin_url(NULL, "/admin.php?page=pmpro-orders"));
		echo pmpro_getPaginationString($pn, $totalrows, $limit, 1, $pagination_url, "&limit=$limit&pn=");
	?>

<?php } ?>
<?php
	require_once(dirname(__FILE__) . "/admin_footer.php");
?>


text:
using System;
using System.Collections.Generic;
using System.Linq;

namespace ForumTopics
{
    class Program
    {
        static void Main()
        {
            Dictionary<string, HashSet<string>> data =new Dictionary<string, HashSet<string>>();

            string[] inputTokens =ParseInputTokens(Console.ReadLine());

            while (inputTokens[0] != "filter")
            {
                string topic = inputTokens[0];
                string[] tags = ParseTags(inputTokens[1]);

                StoreTags(data, topic, tags);

                inputTokens = ParseInputTokens(Console.ReadLine());
            }

            string[] filteredTags = ParseTags(Console.ReadLine());
            PrintTopicsByFilteredTags(data, filteredTags);
        }

        static string[] ParseInputTokens(string input)
        {
            return input.Split(new string[] {" -> "},StringSplitOptions.RemoveEmptyEntries);
        }

        static string[] ParseTags(string input)
        {
            return input.Split(new string[] {", "},StringSplitOptions.RemoveEmptyEntries);
        }

        static void StoreTags(Dictionary<string, HashSet<string>> data,string topic,string[] tags)
        {
            if (!data.ContainsKey(topic))
            {
                data.Add(topic, new HashSet<string>());
            }

            foreach (var tag in tags)
            {
                data[topic].Add(tag);
            }
        }

        static void PrintTopicsByFilteredTags(Dictionary<string, HashSet<string>> data,string[] filteredTags)
        {
            foreach (var topicData in data)
            {
                string topic = topicData.Key;
                HashSet<string> tags = topicData.Value;
                if (ContainsAllTags(tags, filteredTags))
                {
                    var hashtaggedTags = tags.Select(t => "#" + t);
                    Console.WriteLine("{0} | {1}",topic,string.Join(", ", hashtaggedTags));
                }
            }
        }
        static bool ContainsAllTags(HashSet<string> tags,string[] filteredTags)
        {
            foreach (var ft in filteredTags)
            {
                if (!tags.Contains(ft))
                {
                    return false;
                }
            }

            return true;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class io.fluo.recipes.transaction.RecordingTransaction (Fluo Recipes Parent 1.0.0-beta-2 API)</title>
<meta name="date" content="2016-04-15">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
io.fluo.recipes.transaction.RecordingTransaction

Packages that use RecordingTransaction

Package
Description

io.fluo.recipes.transaction

Uses of RecordingTransaction in io.fluo.recipes.transaction

Methods in io.fluo.recipes.transaction that return RecordingTransaction

Modifier and Type
Method and Description

static RecordingTransaction
RecordingTransaction.wrap(io.fluo.api.client.Transaction tx)

Creates a RecordingTransaction by wrapping an existing Transaction

static RecordingTransaction
RecordingTransaction.wrap(io.fluo.api.client.Transaction tx,
    Predicate<LogEntry> filter)

Creates a RecordingTransaction using the provided LogEntry filter and existing Transaction

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2016 Fluo.io. All rights reserved.


text:
package com.kibab.android.EncPassChanger;

public class ChangePassParams {
	private String oldPass;
	private String newPass;
	private EncPassChangerActivity resultcb;

	public ChangePassParams(String oldPass, String newPass, EncPassChangerActivity resultCb) {
		this.oldPass = oldPass;
		this.newPass = newPass;
		this.resultcb = resultCb;
	}

	public String getOldPassword() {
		return this.oldPass;
	}

	public String getNewPassword() {
		return this.newPass;
	}

	public EncPassChangerActivity getCallingActivity() {
		return this.resultcb;
	}
}


text:
namespace modou
{
    class XViewport : public gcn::Container,
                      public gcn::MouseListener
    {
        public:
            XViewport();
            virtual ~XViewport();

            void draw(gcn::Graphics *graphics);
            void setMap(TmxMap *map);
            TmxMap *mMap;

            void mousePressed(gcn::MouseEvent &event);

        private:
            int mPixelViewX, mPixelViewY;
            bool leftMouseAction();
            void followMouse(int px, int py);
	    //std::list< XTilePoint* > path;
    };
}

#endif


text:
package org.openas2.util;

import java.util.Date;

public class ProfilerStub {
    private Date endStamp;
    private Date startStamp;

    public ProfilerStub(Date startStamp) {
        this.startStamp = startStamp;
    }

    public void setEndStamp(Date date) {
        endStamp = date;
    }

    public Date getEndStamp() {
        return endStamp;
    }

	public long getDifference() {
		return getEndStamp().getTime() - getStartStamp().getTime();
	}
    public String getMilliseconds() {
        return Long.toString(getDifference()) + " milliseconds";
    }

    public String getSeconds() {
        long diff = getDifference() / 1000;

        return Long.toString(diff) + " seconds";
    }

	public String getCombined() {
		long diff = getDifference();

		return Long.toString(diff / 1000) + "." + Long.toString(diff % 1000) + " seconds";
	}

    public void setStartStamp(Date date) {
        startStamp = date;
    }

    public Date getStartStamp() {
        return startStamp;
    }
}


text:
from __future__ import unicode_literals

from django.conf import settings
from django.conf.urls import patterns, include
from django.template import Context, loader
from reviewboard.extensions.base import Extension
from reviewboard.extensions.hooks import (ReviewRequestFieldsHook,
                                          ReviewRequestActionHook)
from reviewboard.reviews.fields import (BaseEditableField,
                                        get_review_request_fieldset)
from web_api import buildbot_refresh_resource

class BuildbotstatusField(BaseEditableField):
    field_id = 'buildbotstatus_status'
    label = 'Buildbot Status'
    default_css_classes = []

    def render_change_entry_html(self, info):
        return 'refreshed'

    def should_render(self, value):
        '''Only render this field for reviews with associated commit IDs.'''
        return bool(self.review_request_details.commit_id)

    def render_value(self, value):
        t = loader.get_template('buildbotstatus/status.html')
        c = Context({"statuses" : value or []})
        html = t.render(c)
        return html

class BuildbotReviewRequestActionHook(ReviewRequestActionHook):
    def get_actions(self, context):
        """Returns the list of action information for this action."""
        request = context['request']
        review_request = context['review_request']
        perms = context['perms']
        if not review_request.commit_id:
            return []
        if request.user.pk != review_request.submitter_id:
            return []
        return self.actions

class Buildbotstatus(Extension):
    metadata = {
        'Name': 'buildbotstatus',
        'Summary': 'Displays buildbot status for a review.',
    }
    resources = [buildbot_refresh_resource]

    css_bundles = {
        'default': {
            'source_filenames': ['css/buildbotstatus.css'],
        },
    }

    js_bundles = {
        'default': {
            'source_filenames': [
                'js/buildbotstatus.js',
            ]
        },
    }

    is_configurable = True
    default_settings = {
        'buildbot_url' : '',
    }

    def patch_fieldset_order(self):
        '''
        Unfortunately, this is necessary due to a bug on the client side in
        reviewRequestEditorView.js _resizeLayout that expects the last field
        to be an editable field.
        '''
        main_fieldset = get_review_request_fieldset('main')
        field = main_fieldset.field_classes.pop()
        main_fieldset.field_classes.insert(-1, field)

    def initialize(self):
        ReviewRequestFieldsHook(self, 'main', [BuildbotstatusField])
        self.patch_fieldset_order()
        actions = [
            {
                'id': 'buildbot-status',
                'label': 'Refresh Buildbot Status',
                'url': '#',
            },
        ]
        BuildbotReviewRequestActionHook(self, actions=actions)


text:
""" Accessors for URNs of common Beam entities. """

from apache_beam.portability.api import beam_runner_api_pb2
from apache_beam.portability.api import standard_window_fns_pb2

class PropertiesFromEnumValue(object):
  def __init__(self, value_descriptor):
    self.urn = (
        value_descriptor.GetOptions().Extensions[beam_runner_api_pb2.beam_urn])

class PropertiesFromEnumType(object):
  def __init__(self, enum_type):
    for v in enum_type.DESCRIPTOR.values:
      setattr(self, v.name, PropertiesFromEnumValue(v))

primitives = PropertiesFromEnumType(
    beam_runner_api_pb2.StandardPTransforms.Primitives)
deprecated_primitives = PropertiesFromEnumType(
    beam_runner_api_pb2.StandardPTransforms.DeprecatedPrimitives)
composites = PropertiesFromEnumType(
    beam_runner_api_pb2.StandardPTransforms.Composites)
combine_components = PropertiesFromEnumType(
    beam_runner_api_pb2.StandardPTransforms.CombineComponents)

side_inputs = PropertiesFromEnumType(
    beam_runner_api_pb2.StandardSideInputTypes.Enum)

coders = PropertiesFromEnumType(beam_runner_api_pb2.StandardCoders.Enum)

def PropertiesFromPayloadType(payload_type):
  return PropertiesFromEnumType(payload_type.Enum).PROPERTIES

global_windows = PropertiesFromPayloadType(
    standard_window_fns_pb2.GlobalWindowsPayload)
fixed_windows = PropertiesFromPayloadType(
    standard_window_fns_pb2.FixedWindowsPayload)
sliding_windows = PropertiesFromPayloadType(
    standard_window_fns_pb2.SlidingWindowsPayload)
session_windows = PropertiesFromPayloadType(
    standard_window_fns_pb2.SessionsPayload)


text:
layout: post
title: "Making Our DIY Wooden Rings"
categories: [DIY, personal, making]
tags: [DIY, wooden, rings, make]
---

This summer Rachel and I went to a woodworking workshop to make our own wooden rings. I never really understood how a metal band is supposed to signify our commitment to each other, so before we buy our actual rings, I figured that the experience of making rings ourselves would be a little more fun and meaningful. Neither of us have much experience in woodworking, so we took the lathe-turning workshop at [Tombalek](https://tombalek.com/) to learn the basic skills required.

*Rings we made*

Cheong Keat, our instructor at Tombalek, was extremely helpful and taught us the basics of using the machines in a woodworking workshop.

I bought the materials online from [Strange Materials](https://www.etsy.com/shop/StrangeMaterial?ref=yr_purchases) on Etsy and [Craft Supplies USA](https://www.woodturnerscatalog.com/p/58/6911/artisan-Comfort-Ring-Core).

*Wooden blanks*

*Ring core*

#### Drilling

The first thing we did is mark the center of the wooden blank for where the metal ring would go. We drilled a hole at the marking and sanded the inside smooth with a sanding bit.

### Sanding

To make the lathe-turning part easier, we sanded the wooden blank to be a rough circular shape with the sanding belt.

The next step is to attach the metal ring and the wooden ring. The metal ring is too smooth to stick well to the wooden ring, so we sanded it to 320 grit before we applied CA glue to stick them together.

### Turning

We secured the wooden ring on the lathe and began turning them to the right shape and thickness. My ring turned out a little too thick, Rachel's was marginally better.

### Finish

Lastly, we had to apply finish to make the rings shiny and protect it from the elements. We applied CA glue and Cheong Keat buffed the rings for us using an orbital sander.

*The many rings we made*

Overall, it was a super fun experience, though Rachel seemed allergic to wood dust and kept coughing afterwards. ;(

*Bonus: Rachel turning a spindle*

*Looks professional*


text:
package ca.uhn.fhir.jpa.dao.dstu3;

import static org.junit.Assert.assertEquals;

import org.hl7.fhir.dstu3.model.StringType;
import org.hl7.fhir.instance.model.api.IIdType;
import org.junit.*;

import ca.uhn.fhir.jpa.dao.SearchParameterMap;
import ca.uhn.fhir.rest.api.server.IBundleProvider;

@SuppressWarnings({ })
public class FhirResourceDaoCustomTypeDstu3Test extends BaseJpaDstu3Test {

	private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoCustomTypeDstu3Test.class);

	@Before
	public void before() {
		myFhirCtx.setDefaultTypeForProfile(CustomObservationDstu3.PROFILE, CustomObservationDstu3.class);
	}

	@Test
	public void testSaveAndRestore() {
		CustomObservationDstu3 obs = new CustomObservationDstu3();
		obs.setEyeColour(new StringType("blue"));

		IIdType id = myObservationDao.create(obs).getId().toUnqualifiedVersionless();

		CustomObservationDstu3 read = (CustomObservationDstu3) myObservationDao.read(id);
		assertEquals("blue", read.getEyeColour().getValue());

		IBundleProvider found = myObservationDao.search(new SearchParameterMap());
		assertEquals(1, found.size().intValue());
		CustomObservationDstu3 search = (CustomObservationDstu3) found.getResources(0, 1).get(0);
		assertEquals("blue", search.getEyeColour().getValue());

	}

	@After
	public void after() {
		myFhirCtx.setDefaultTypeForProfile(CustomObservationDstu3.PROFILE, null);
	}
}


text:
package com.tenxerconsulting.swagger.doclet.translator;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import com.google.common.base.Function;
import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.FieldDoc;
import com.sun.javadoc.MethodDoc;
import com.sun.javadoc.Parameter;
import com.sun.javadoc.Type;

/**
 * The FirstNotNullTranslator represents a chain of translators.
 * It will iterate through each one in the chain and return the results of the first translator
 * that does not return null.
 * @version $Id$
 */
public class FirstNotNullTranslator implements Translator {

	private final List<Translator> chain;

	/**
	 * This creates a FirstNotNullTranslator with no links
	 */
	public FirstNotNullTranslator() {
		this.chain = new ArrayList<Translator>();
	}

	/**
	 * This adds another translator link to the chain of translators
	 * @param link The translator to add
	 * @return this
	 */
	public FirstNotNullTranslator addNext(Translator link) {
		this.chain.add(link);
		return this;
	}

	/**
	 * {@inheritDoc}
	 * @see com.tenxerconsulting.swagger.doclet.translator.Translator#typeName(com.sun.javadoc.Type, boolean, com.sun.javadoc.ClassDoc[])
	 */
	public OptionalName typeName(Type type, boolean useFqn, ClassDoc[] views) {
		return firstNotNullOf(new Function<Translator, OptionalName>() {

			public OptionalName apply(Translator translator) {
				return translator.typeName(type, useFqn, views);
			}
		});
	}

	/**
	 * {@inheritDoc}
	 * @see com.tenxerconsulting.swagger.doclet.translator.Translator#parameterTypeName(boolean, com.sun.javadoc.Parameter, com.sun.javadoc.Type, boolean,
	 *      com.sun.javadoc.ClassDoc[])
	 */
	public OptionalName parameterTypeName(boolean multipart, Parameter parameter, Type paramType, boolean useFqn, ClassDoc[] views) {
		return firstNotNullOf(new Function<Translator, OptionalName>() {

			public OptionalName apply(Translator translator) {
				return translator.parameterTypeName(multipart, parameter, paramType, useFqn, views);
			}
		});
	}

	/**
	 * {@inheritDoc}
	 * @see com.tenxerconsulting.swagger.doclet.translator.Translator#typeName(com.sun.javadoc.Type, boolean)
	 */
	public OptionalName typeName(Type type, boolean useFqn) {
		return firstNotNullOf(new Function<Translator, OptionalName>() {

			public OptionalName apply(Translator translator) {
				return translator.typeName(type, useFqn);
			}
		});
	}

	/**
	 * {@inheritDoc}
	 * @see com.tenxerconsulting.swagger.doclet.translator.Translator#fieldName(com.sun.javadoc.FieldDoc)
	 */
	public OptionalName fieldName(final FieldDoc field) {
		return firstNotNullOf(new Function<Translator, OptionalName>() {

			public OptionalName apply(Translator translator) {
				return translator.fieldName(field);
			}
		});
	}

	/**
	 * {@inheritDoc}
	 * @see com.tenxerconsulting.swagger.doclet.translator.Translator#methodName(com.sun.javadoc.MethodDoc)
	 */
	public OptionalName methodName(final MethodDoc method) {
		return firstNotNullOf(new Function<Translator, OptionalName>() {

			public OptionalName apply(Translator translator) {
				return translator.methodName(method);
			}
		});
	}

	private OptionalName firstNotNullOf(Function<Translator, OptionalName> function) {
		OptionalName name = null;
		Iterator<Translator> iterator = this.chain.iterator();
		while ((name == null || name.isMissing()) && iterator.hasNext()) {
			name = function.apply(iterator.next());
		}
		return name;
	}

}


text:
package Armadillo.Analytics.Optimisation.Continuous;

public class ContinuousConstants
{
    /// <summary>
    ///   DE mutation factor
    /// </summary>
    public static final double DBL_DE_MUATION_FACTOR = 0.8;

    /// <summary>
    ///   Probability of reproducing an individual
    ///   via differential evolution
    /// </summary>
    public static final double DBL_DE_REPRODUCTION = 0.9;

    /// <summary>
    ///   DE convergence value
    /// </summary>
    public static final int INT_DE_CONVERGENCE = 40000;

    public static final int INT_DE_SMALL_CONVERGENCE = 40;

    public static final int INT_NM_CONVERGENCE = 4000;

    /// <summary>
    ///   Differential evolution small convergence.
    ///   Value used for small problems
    /// </summary>
    public static final int INT_SMALL_PROBLEM_DE = 100;

    /// <summary>
    ///   Simplex model name
    /// </summary>
    public static final String STR_SIMPLEX_MODEL_FILENAME =
        "SimplexModel.mod";

}


text:
  <md-card class="width-43rem">
    <md-card-title>Step 1:</md-card-title>
    <md-card-subtitle>Select Dataset for Export</md-card-subtitle>
    <md-select [(ngModel)]="dataSelectionInput">
      <md-option [value]="'Evaluations'">Evaluations</md-option>
      <md-option [value]="'Projects'">Projects</md-option>
    </md-select>
  </md-card>
  <md-card class="margin-top-1rem width-43rem">
    <md-card-title>Step 2:</md-card-title>
    <md-card-subtitle>Apply Filters</md-card-subtitle>

          <md-checkbox (change)="selectAllProjectData()"
                       [(ngModel)]="allProjectData">
            Select All Project Data
          </md-checkbox>

          <md-checkbox (change)="selectAllMarketData()"
                       [(ngModel)]="allMarketData">
            Select All Market Data
          </md-checkbox>

          <md-checkbox (change)="selectAllUserData()"
                       [(ngModel)]="allUserData">
            Select All User Data
          </md-checkbox>

          <md-checkbox [(ngModel)]="budgetInput">Project Budget</md-checkbox>

          <md-checkbox [(ngModel)]="marketDescrInput">Market Descriptions</md-checkbox>

          <md-checkbox [(ngModel)]="userExpertiseInput">User Expertise</md-checkbox>

          <md-checkbox [(ngModel)]="timeInput">Time for Project</md-checkbox>

          <md-checkbox [(ngModel)]="domainInput">Project Domain</md-checkbox>

          <md-checkbox [(ngModel)]="userDiversityInput">User Diversity</md-checkbox>

          <md-checkbox [(ngModel)]="devMethodInput">Development Methodology</md-checkbox>

          <md-checkbox [(ngModel)]="userLocationInput">Countries of Users</md-checkbox>

          <md-checkbox [(ngModel)]="userAvgAgeInput">Average User Age</md-checkbox>

          <md-checkbox [(ngModel)]="productComplexityInput">Product Complexity</md-checkbox>

          <md-checkbox [(ngModel)]="marketDiversityInput">Market Diversity</md-checkbox>

          <md-checkbox [(ngModel)]="userLanguagesInput">Languages of Users</md-checkbox>

          <md-checkbox [(ngModel)]="teamSizeInput">Team Size</md-checkbox>

          <md-checkbox [(ngModel)]="dateSharedInput">Report Date</md-checkbox>

          <md-checkbox [(ngModel)]="devProcessMaturityInput">Maturity of Development Process</md-checkbox>

          <md-checkbox (change)="selectAllEvaluatorData()"
                       [(ngModel)]="allEvaluatorData">
            Select All Evaluator Data
          </md-checkbox>

          <md-checkbox (change)="selectAllBenchmarkData()"
                       [(ngModel)]="allBenchmarkData">
            Select All Benchmark Data
          </md-checkbox>

          <md-checkbox [(ngModel)]="EvaldateSharedInput">Report Date</md-checkbox>

          <md-checkbox [(ngModel)]="evalMethodInput">Evaluation Method</md-checkbox>

          <md-checkbox [(ngModel)]="evalExpInput">Evaluator Experience</md-checkbox>

          <md-checkbox [(ngModel)]="seqInput">Single Ease Question</md-checkbox>

          <md-checkbox [(ngModel)]="numEvalInput">Number of Evaluators</md-checkbox>

          <md-checkbox [(ngModel)]="subEffectivenessInput">Subjective Effectiveness</md-checkbox>

          <md-checkbox [(ngModel)]="evalCollabInput">Collaboration of Evaluators</md-checkbox>

          <md-checkbox [(ngModel)]="susInput">System Usability Scale</md-checkbox>

          <md-checkbox [(ngModel)]="domainKnowledgeInput">Domain Knowledge</md-checkbox>

          <md-checkbox [(ngModel)]="impactOnRedesignInput">Impact on Redesign</md-checkbox>

          <md-checkbox [(ngModel)]="interactKnowledgeInput">Interaction Knowledge</md-checkbox>

          <md-checkbox [(ngModel)]="testMotivationInput">Test Motivation</md-checkbox>

          <md-checkbox [(ngModel)]="productKnowledgeInput">Product Knowledge</md-checkbox>

          <md-checkbox [(ngModel)]="versionInput">Product Version</md-checkbox>

          <md-checkbox [(ngModel)]="taskKnowledgeInput">Task Knowledge</md-checkbox>

          <md-checkbox [(ngModel)]="userKnowledgeInput">User Knowledge</md-checkbox>

  </md-card>
  <md-card class="margin-top-1rem width-43rem">
    <md-card-title>Step 3:</md-card-title>
    <md-card-subtitle>Download CSV-File</md-card-subtitle>
    <md-input-container>
      <input mdInput type="text" placeholder="Filename" [(ngModel)]="filename" (keyup.enter)="download()">
    </md-input-container>
    <button md-raised-button
            #downloadBtn
            class="margin-left-1rem"
            color="primary"
            (click)="download()"
            [disabled]="filename.length === 0">
      cloud_download
      Download
    </button>
  </md-card>


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <artifactId>vertx-forge-web</artifactId>

    <parent>
        <groupId>io.vertx</groupId>
        <artifactId>vertx-forge</artifactId>
        <version>1.0.0-SNAPSHOT</version>
    </parent>

    <dependencies>
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-core</artifactId>
        </dependency>
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
        </dependency>
    </dependencies>

</project>


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta name="collection" content="exclude">

<TITLE>
Uses of Package java.security.cert (Java 2 Platform SE 5.0)
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

JavaTM 2 Platform
Standard Ed. 5.0

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Package
java.security.cert

Packages that use java.security.cert

java.net
Provides the classes for implementing networking applications.

java.security
Provides the classes and interfaces for the security framework.

java.security.cert
Provides classes and interfaces for parsing and managing
certificates, certificate revocation lists (CRLs), and
certification paths.

java.util.jar
Provides classes for reading and writing the JAR (Java ARchive) file
format, which is based on the standard ZIP file format with an
optional manifest file.

javax.crypto
Provides the classes and interfaces for cryptographic operations.

javax.net.ssl
Provides classes for the secure socket package.

javax.security.auth.x500
This package contains the classes that should be used to store
    X500 Principal and X500 Private Crendentials in a
    Subject.

Classes in java.security.cert used by java.net

Certificate

          Abstract class for managing a variety of identity certificates.

Classes in java.security.cert used by java.security

Certificate

          Abstract class for managing a variety of identity certificates.

CertificateException

          This exception indicates one of a variety of certificate problems.

CertPath

          An immutable sequence of certificates (a certification path).

Classes in java.security.cert used by java.security.cert

Certificate

          Abstract class for managing a variety of identity certificates.

CertificateEncodingException

          Certificate Encoding Exception.

CertificateException

          This exception indicates one of a variety of certificate problems.

CertificateExpiredException

          Certificate Expired Exception.

CertificateFactory

          This class defines the functionality of a certificate factory, which is
 used to generate certificate, certification path (CertPath)
 and certificate revocation list (CRL) objects from their encodings.

CertificateFactorySpi

          This class defines the Service Provider Interface (SPI)
 for the CertificateFactory class.

CertificateNotYetValidException

          Certificate is not yet valid exception.

CertificateParsingException

          Certificate Parsing Exception.

CertPath

          An immutable sequence of certificates (a certification path).

CertPathBuilder

          A class for building certification paths (also known as certificate chains).

CertPathBuilderException

          An exception indicating one of a variety of problems encountered when
 building a certification path with a CertPathBuilder.

CertPathBuilderResult

          A specification of the result of a certification path builder algorithm.

CertPathBuilderSpi

          The Service Provider Interface (SPI)
 for the CertPathBuilder class.

CertPathParameters

          A specification of certification path algorithm parameters.

CertPathValidator

          A class for validating certification paths (also known as certificate
 chains).

CertPathValidatorException

          An exception indicating one of a variety of problems encountered when
 validating a certification path.

CertPathValidatorResult

          A specification of the result of a certification path validator algorithm.

CertPathValidatorSpi

          The Service Provider Interface (SPI)
 for the CertPathValidator class.

CertSelector

          A selector that defines a set of criteria for selecting
 Certificates.

CertStore

          A class for retrieving Certificates and CRLs
 from a repository.

CertStoreException

          An exception indicating one of a variety of problems retrieving
 certificates and CRLs from a CertStore.

CertStoreParameters

          A specification of CertStore parameters.

CertStoreSpi

          The Service Provider Interface (SPI)
 for the CertStore class.

CRL

          This class is an abstraction of certificate revocation lists (CRLs) that
 have different formats but important common uses.

CRLException

          CRL (Certificate Revocation List) Exception.

CRLSelector

          A selector that defines a set of criteria for selecting CRLs.

PKIXCertPathChecker

          An abstract class that performs one or more checks on an
 X509Certificate.

PKIXCertPathValidatorResult

          This class represents the successful result of the PKIX certification
 path validation algorithm.

PKIXParameters

          Parameters used as input for the PKIX CertPathValidator
 algorithm.

PolicyNode

          An immutable valid policy tree node as defined by the PKIX certification
 path validation algorithm.

PolicyQualifierInfo

          An immutable policy qualifier represented by the ASN.1 PolicyQualifierInfo
 structure.

TrustAnchor

          A trust anchor or most-trusted Certification Authority (CA).

X509Certificate

 Abstract class for X.509 certificates.

X509CRLEntry

          Abstract class for a revoked certificate in a CRL (Certificate
 Revocation List).

X509Extension

          Interface for an X.509 extension.

Classes in java.security.cert used by java.util.jar

Certificate

          Abstract class for managing a variety of identity certificates.

Classes in java.security.cert used by javax.crypto

Certificate

          Abstract class for managing a variety of identity certificates.

Classes in java.security.cert used by javax.net.ssl

Certificate

          Abstract class for managing a variety of identity certificates.

CertificateException

          This exception indicates one of a variety of certificate problems.

CertPathParameters

          A specification of certification path algorithm parameters.

X509Certificate

 Abstract class for X.509 certificates.

Classes in java.security.cert used by javax.security.auth.x500

X509Certificate

 Abstract class for X.509 certificates.

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

JavaTM 2 Platform
Standard Ed. 5.0

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2004, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.


text:
import keyCode from './keycode';

type Keymap = Record<string, Function>;

type Pattern = {
	which: string[];
	ctrl?: boolean;
	shift?: boolean;
	alt?: boolean;
};

type Action = {
	patterns: Pattern[];
	callback: Function;
	allowRepeat: boolean;
};

const parseKeymap = (keymap: Keymap) => Object.entries(keymap).map(([patterns, callback]): Action => {
	const result = {
		patterns: [],
		callback: callback,
		allowRepeat: true
	} as Action;

	if (patterns.match(/^\(.*\)$/) !== null) {
		result.allowRepeat = false;
		patterns = patterns.slice(1, -1);
	}

	result.patterns = patterns.split('|').map(part => {
		const pattern = {
			which: [],
			ctrl: false,
			alt: false,
			shift: false
		} as Pattern;

		const keys = part.trim().split('+').map(x => x.trim().toLowerCase());
		for (const key of keys) {
			switch (key) {
				case 'ctrl': pattern.ctrl = true; break;
				case 'alt': pattern.alt = true; break;
				case 'shift': pattern.shift = true; break;
				default: pattern.which = keyCode(key).map(k => k.toLowerCase());
			}
		}

		return pattern;
	});

	return result;
});

const ignoreElemens = ['input', 'textarea'];

function match(e: KeyboardEvent, patterns: Action['patterns']): boolean {
	const key = e.code.toLowerCase();
	return patterns.some(pattern => pattern.which.includes(key) &&
		pattern.ctrl === e.ctrlKey &&
		pattern.shift === e.shiftKey &&
		pattern.alt === e.altKey &&
		!e.metaKey
	);
}

export const makeHotkey = (keymap: Keymap) => {
	const actions = parseKeymap(keymap);

	return (e: KeyboardEvent) => {
		if (document.activeElement) {
			if (ignoreElemens.some(el => document.activeElement!.matches(el))) return;
			if (document.activeElement.attributes['contenteditable']) return;
		}

		for (const action of actions) {
			const matched = match(e, action.patterns);

			if (matched) {
				if (!action.allowRepeat && e.repeat) return;

				e.preventDefault();
				e.stopPropagation();
				action.callback(e);
				break;
			}
		}
	};
};


text:
package com.github.kaiwinter.testcontainers.wildfly.db.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "user")
public class User {

   @Id
   @Column(name = "id", unique = true, nullable = false)
   @GeneratedValue(strategy = GenerationType.IDENTITY)
   private int id;

   @Column(name = "username", nullable = false)
   private String username;

   @Column(name = "login_count", nullable = false)
   private int loginCount;

   public int getId() {
      return this.id;
   }

   public void setId(int id) {
      this.id = id;
   }

   public String getUsername() {
      return this.username;
   }

   public void setUsername(String username) {
      this.username = username;
   }

   public int getLoginCount() {
      return loginCount;
   }

   public void setLoginCount(int loginCount) {
      this.loginCount = loginCount;
   }
}


text:
package tango

import (
	"bytes"
	"fmt"
	"net/http"
	"net/http/httptest"
	"strings"
	"testing"
)

type CtxAction struct {
	Ctx
}

func (p *CtxAction) Get() {
	p.Ctx.Write([]byte("context"))
}

func TestContext1(t *testing.T) {
	buff := bytes.NewBufferString("")
	recorder := httptest.NewRecorder()
	recorder.Body = buff

	o := Classic()
	o.Get("/", new(CtxAction))

	req, err := http.NewRequest("GET", "http://localhost:8000/", nil)
	if err != nil {
		t.Error(err)
	}

	o.ServeHTTP(recorder, req)
	expect(t, recorder.Code, http.StatusOK)
	refute(t, len(buff.String()), 0)
	expect(t, buff.String(), "context")
}

type CtxJsonAction struct {
	Ctx
}

func (p *CtxJsonAction) Get() error {
	return p.Ctx.ServeJson(map[string]string{
		"get": "ctx",
	})
}

func TestContext2(t *testing.T) {
	buff := bytes.NewBufferString("")
	recorder := httptest.NewRecorder()
	recorder.Body = buff

	o := Classic()
	o.Get("/", new(CtxJsonAction))

	req, err := http.NewRequest("GET", "http://localhost:8000/", nil)
	if err != nil {
		t.Error(err)
	}

	o.ServeHTTP(recorder, req)
	expect(t, recorder.Code, http.StatusOK)
	refute(t, len(buff.String()), 0)
	expect(t, recorder.Header().Get("Content-Type"), "application/json; charset=UTF-8")
	expect(t, strings.TrimSpace(buff.String()), `{"get":"ctx"}`)
}

type CtxXmlAction struct {
	Ctx
}

type XmlStruct struct {
	Content string
}

func (p *CtxXmlAction) Get() error {
	return p.Ctx.ServeXml(XmlStruct{"content"})
}

func TestContext3(t *testing.T) {
	buff := bytes.NewBufferString("")
	recorder := httptest.NewRecorder()
	recorder.Body = buff

	o := Classic()
	o.Get("/", new(CtxXmlAction))

	req, err := http.NewRequest("GET", "http://localhost:8000/", nil)
	if err != nil {
		t.Error(err)
	}

	o.ServeHTTP(recorder, req)
	expect(t, recorder.Code, http.StatusOK)
	expect(t, recorder.Header().Get("Content-Type"), "application/xml; charset=UTF-8")
	refute(t, len(buff.String()), 0)
	expect(t, strings.TrimSpace(buff.String()), `<XmlStruct><Content>content</Content></XmlStruct>`)
}

type CtxFileAction struct {
	Ctx
}

func (p *CtxFileAction) Get() error {
	return p.Ctx.ServeFile("./public/index.html")
}

func TestContext4(t *testing.T) {
	buff := bytes.NewBufferString("")
	recorder := httptest.NewRecorder()
	recorder.Body = buff

	o := Classic()
	o.Any("/", new(CtxFileAction))

	req, err := http.NewRequest("GET", "http://localhost:8000/", nil)
	if err != nil {
		t.Error(err)
	}

	o.ServeHTTP(recorder, req)
	expect(t, recorder.Code, http.StatusOK)
	refute(t, len(buff.String()), 0)
	expect(t, strings.TrimSpace(buff.String()), `this is index.html`)
}

func TestContext5(t *testing.T) {
	buff := bytes.NewBufferString("")
	recorder := httptest.NewRecorder()
	recorder.Body = buff

	o := Classic()
	o.Any("/2", func() string {
		return "2"
	})
	o.Any("/", func(ctx *Context) {
		ctx.Redirect("/2")
	})

	req, err := http.NewRequest("GET", "http://localhost:8000/", nil)
	if err != nil {
		t.Error(err)
	}

	o.ServeHTTP(recorder, req)
	expect(t, recorder.Code, http.StatusFound)
	refute(t, len(buff.String()), 0)
	expect(t, strings.TrimSpace(buff.String()), `<a href="/2">Found</a>.`)
}

type NotFoundAction struct {
	Ctx
}

func (n *NotFoundAction) Get() {
	n.NotFound("not found")
}

func TestContext6(t *testing.T) {
	buff := bytes.NewBufferString("")
	recorder := httptest.NewRecorder()
	recorder.Body = buff

	o := Classic()
	o.Any("/", new(NotFoundAction))

	req, err := http.NewRequest("GET", "http://localhost:8000/", nil)
	if err != nil {
		t.Error(err)
	}

	o.ServeHTTP(recorder, req)
	expect(t, recorder.Code, http.StatusNotFound)
	refute(t, len(buff.String()), 0)
	expect(t, strings.TrimSpace(buff.String()), "not found")
}

type NotModifidAction struct {
	Ctx
}

func (n *NotModifidAction) Get() {
	n.NotModified()
}

func TestContext7(t *testing.T) {
	buff := bytes.NewBufferString("")
	recorder := httptest.NewRecorder()
	recorder.Body = buff

	o := Classic()
	o.Any("/", new(NotModifidAction))

	req, err := http.NewRequest("GET", "http://localhost:8000/", nil)
	if err != nil {
		t.Error(err)
	}

	o.ServeHTTP(recorder, req)
	expect(t, recorder.Code, http.StatusNotModified)
	expect(t, len(buff.String()), 0)
}

type UnauthorizedAction struct {
	Ctx
}

func (n *UnauthorizedAction) Get() {
	n.Unauthorized()
}

func TestContext8(t *testing.T) {
	buff := bytes.NewBufferString("")
	recorder := httptest.NewRecorder()
	recorder.Body = buff

	o := Classic()
	o.Any("/", new(UnauthorizedAction))

	req, err := http.NewRequest("GET", "http://localhost:8000/", nil)
	if err != nil {
		t.Error(err)
	}

	o.ServeHTTP(recorder, req)
	expect(t, recorder.Code, http.StatusUnauthorized)
	expect(t, buff.String(), http.StatusText(http.StatusUnauthorized))
}

type DownloadAction struct {
	Ctx
}

func (n *DownloadAction) Get() {
	n.Download("./public/index.html")
}

func TestContext9(t *testing.T) {
	buff := bytes.NewBufferString("")
	recorder := httptest.NewRecorder()
	recorder.Body = buff

	o := Classic()
	o.Any("/", new(DownloadAction))

	req, err := http.NewRequest("GET", "http://localhost:8000/", nil)
	if err != nil {
		t.Error(err)
	}

	o.ServeHTTP(recorder, req)

	expect(t, recorder.Header().Get("Content-Disposition"), `attachment; filename="index.html"`)
	expect(t, recorder.Code, http.StatusOK)
	expect(t, buff.String(), "this is index.html")
}

// check unsupported function will panic
func TestContext10(t *testing.T) {
	buff := bytes.NewBufferString("")
	recorder := httptest.NewRecorder()
	recorder.Body = buff

	o := Classic()
	var ifPanic bool
	defer func() {
		if err := recover(); err != nil {
			ifPanic = true
		}

		expect(t, ifPanic, true)
	}()

	o.Any("/", func(i int) {
		fmt.Println(i)
	})
}


text:
'use strict';

const models = require('./index');

/**
 * Information about packet capture session.
 *
 */
class PacketCaptureResult {
  /**
   * Create a PacketCaptureResult.
   * @member {string} [name] Name of the packet capture session.
   * @member {string} [id] ID of the packet capture operation.
   * @member {string} [etag] Default value: 'A unique read-only string that
   * changes whenever the resource is updated.' .
   * @member {string} target The ID of the targeted resource, only VM is
   * currently supported.
   * @member {number} [bytesToCapturePerPacket] Number of bytes captured per
   * packet, the remaining bytes are truncated. Default value: 0 .
   * @member {number} [totalBytesPerSession] Maximum size of the capture
   * output. Default value: 1073741824 .
   * @member {number} [timeLimitInSeconds] Maximum duration of the capture
   * session in seconds. Default value: 18000 .
   * @member {object} storageLocation
   * @member {string} [storageLocation.storageId] The ID of the storage account
   * to save the packet capture session. Required if no local file path is
   * provided.
   * @member {string} [storageLocation.storagePath] The URI of the storage path
   * to save the packet capture. Must be a well-formed URI describing the
   * location to save the packet capture.
   * @member {string} [storageLocation.filePath] A valid local path on the
   * targeting VM. Must include the name of the capture file (*.cap). For linux
   * virtual machine it must start with /var/captures. Required if no storage
   * ID is provided, otherwise optional.
   * @member {array} [filters]
   * @member {string} [provisioningState] The provisioning state of the packet
   * capture session. Possible values include: 'Succeeded', 'Updating',
   * 'Deleting', 'Failed'
   */
  constructor() {
  }

  /**
   * Defines the metadata of PacketCaptureResult
   *
   * @returns {object} metadata of PacketCaptureResult
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'PacketCaptureResult',
      type: {
        name: 'Composite',
        className: 'PacketCaptureResult',
        modelProperties: {
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          etag: {
            required: false,
            serializedName: 'etag',
            defaultValue: 'A unique read-only string that changes whenever the resource is updated.',
            type: {
              name: 'String'
            }
          },
          target: {
            required: true,
            serializedName: 'properties.target',
            type: {
              name: 'String'
            }
          },
          bytesToCapturePerPacket: {
            required: false,
            serializedName: 'properties.bytesToCapturePerPacket',
            defaultValue: 0,
            type: {
              name: 'Number'
            }
          },
          totalBytesPerSession: {
            required: false,
            serializedName: 'properties.totalBytesPerSession',
            defaultValue: 1073741824,
            type: {
              name: 'Number'
            }
          },
          timeLimitInSeconds: {
            required: false,
            serializedName: 'properties.timeLimitInSeconds',
            defaultValue: 18000,
            type: {
              name: 'Number'
            }
          },
          storageLocation: {
            required: true,
            serializedName: 'properties.storageLocation',
            type: {
              name: 'Composite',
              className: 'PacketCaptureStorageLocation'
            }
          },
          filters: {
            required: false,
            serializedName: 'properties.filters',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'PacketCaptureFilterElementType',
                  type: {
                    name: 'Composite',
                    className: 'PacketCaptureFilter'
                  }
              }
            }
          },
          provisioningState: {
            required: false,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = PacketCaptureResult;


text:
package com.streamsets.pipeline.lib.jdbc.schemawriter;

import com.streamsets.pipeline.api.Field;
import com.streamsets.pipeline.lib.jdbc.JdbcStageCheckedException;
import com.streamsets.pipeline.lib.jdbc.typesupport.JdbcType;
import com.streamsets.pipeline.lib.jdbc.typesupport.JdbcTypeInfo;

import java.util.LinkedHashMap;

/**
 * Database specific operations
 */
public interface JdbcSchemaWriter {
  /**
   * Creates a new database table
   *
   * @param schema Database schema name
   * @param tableName Table to be created
   * @param recordStructure Mapping of column names to JDBC types
   *
   * @throws JdbcStageCheckedException Wraps SQLExceptions etc
   */
  void createTable(String schema, String tableName, LinkedHashMap<String, JdbcTypeInfo> recordStructure) throws
      JdbcStageCheckedException;

  /**
   * Alters an existing database table
   *
   * @param schema Database schema name
   * @param tableName Table to be altered
   * @param recordStructure Mapping of new column names to JDBC types
   *
   * @throws JdbcStageCheckedException Wraps SQLExceptions etc
   */
  void alterTable(String schema, String tableName, LinkedHashMap<String, JdbcTypeInfo> recordStructure) throws
      JdbcStageCheckedException;

  /**
   * Get the column data type, for example "double precision", or "decimal(10, 20)"
   *
   * @param jdbcType JDBC type
   *
   * @return String representation of the column's data type
   */
  String getColumnTypeName(JdbcType jdbcType);

  /**
   * Validate that the precision and scale fall within valid bounds for
   * the database, and that the field value fits within the precision
   * and scale.
   *
   * @param fieldName Name of the field - used in error reporting
   * @param field Field to be validated
   * @param precision Precision to be validated
   * @param scale Scale to be validated
   *
   * @throws JdbcStageCheckedException
   */
  void validateScaleAndPrecision(String fieldName, Field field, int precision, int scale) throws
      JdbcStageCheckedException;

  /**
   * @return Default schema name, or null if there isn't one
   */
  String getDefaultSchema();
}


text:
"""This example gets all orders.
"""

# Import appropriate modules from the client library.
from googleads import ad_manager

def main(client):
  # Initialize appropriate service.
  order_service = client.GetService('OrderService', version='v202208')

  # Create a statement to select orders.
  statement = ad_manager.StatementBuilder(version='v202208')

  # Retrieve a small amount of orders at a time, paging
  # through until all orders have been retrieved.
  while True:
    response = order_service.getOrdersByStatement(statement.ToStatement())
    if 'results' in response and len(response['results']):
      for order in response['results']:
        # Print out some information for each order.
        print('Order with ID "%d" and name "%s" was found.\n' % (order['id'],
                                                                 order['name']))
      statement.offset += statement.limit
    else:
      break

  print('\nNumber of results found: %s' % response['totalResultSetSize'])

if __name__ == '__main__':
  # Initialize client object.
  ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()
  main(ad_manager_client)


text:
package io.quarkus.oidc.test;

import javax.ws.rs.GET;
import javax.ws.rs.Path;

@Path("/unprotected")
public class UnprotectedResource {

    @GET
    public String getName() {
        return "unprotected";
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ManuTh.Patchization
{
    /// <summary>
    /// Represents a run-length encoded block of a patch.
    /// </summary>
    public class RLEBlock : PatchBlock
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="RLEBlock"/> class.
        /// </summary>
        public RLEBlock() : base()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="RLEBlock"/> class with an offset, a position and a length.
        /// </summary>
        /// <param name="offset">The offset of the block inside the patch.</param>
        /// <param name="position">The position to apply the block to.</param>
        /// <param name="size">The size of the block.</param>
        /// <param name="rle">A value indicating whether the block is run-length encoded.</param>
        public RLEBlock(long offset, long position, int size, bool rle) : base(offset, position, size)
        {
            IsRLE = rle;
        }

        /// <summary>
        /// Gets or sets a value indicating whether the block is run-length encoded.
        /// </summary>
        public bool IsRLE { get; set; } = false;
    }
}


text:
#import "TestRequestListener.h"
#import "TestSetupUtils.h"
#import "SFAccountManager.h"

NSString* const kTestRequestStatusWaiting = @"waiting";
NSString* const kTestRequestStatusDidLoad = @"didLoad";
NSString* const kTestRequestStatusDidFail = @"didFail";
NSString* const kTestRequestStatusDidCancel = @"didCancel";
NSString* const kTestRequestStatusDidTimeout = @"didTimeout";

@interface TestRequestListener ()
{
    SFAccountManager *_accountMgr;
    SFAccountManagerServiceType _serviceType;
}

- (id)initInternal;
- (void)configureAccountServiceDelegate;
- (void)clearAccountManagerDelegate;
- (NSString *)serviceTypeDescription;

@end

@implementation TestRequestListener

@synthesize request = _request;
@synthesize jsonResponse = _jsonResponse;
@synthesize lastError = _lastError;
@synthesize returnStatus = _returnStatus;

@synthesize maxWaitTime = _maxWaitTime;

- (id)initWithRequest:(SFRestRequest *)request {
    self = [self initInternal];
    if (nil != self) {
        _serviceType = SFAccountManagerServiceTypeNone;
        self.request = request;
        self.request.delegate = self;
    }

    return self;
}

- (id)initWithServiceType:(SFAccountManagerServiceType)serviceType
{
    self = [self initInternal];
    if (nil != self) {
        _serviceType = serviceType;
        [self configureAccountServiceDelegate];
    }

    return self;
}

- (id)initInternal
{
    self = [super init];
    if (nil != self) {
        _accountMgr = [SFAccountManager sharedInstance];
        self.maxWaitTime = 30.0;
        self.returnStatus = kTestRequestStatusWaiting;
    }

    return self;
}

- (void)dealloc {
    if (self.request != nil) {
        self.request.delegate = nil;
    }
    self.request = nil;

    if (_serviceType != SFAccountManagerServiceTypeNone) {
        [self clearAccountManagerDelegate];
    }

    self.jsonResponse = nil;
    self.lastError = nil;
    self.returnStatus = nil;
    [super dealloc];
}

- (NSString *)waitForCompletion {

    NSDate *startTime = [NSDate date] ;

    while ([self.returnStatus isEqualToString:kTestRequestStatusWaiting]) {
        NSTimeInterval elapsed = [[NSDate date] timeIntervalSinceDate:startTime];
        if (elapsed > self.maxWaitTime) {
            NSLog(@"'%@' Request took too long (> %f secs) to complete.", [self serviceTypeDescription], elapsed);
            return kTestRequestStatusDidTimeout;
        }

        NSLog(@"## sleeping...");
        [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
    }

    return self.returnStatus;
}

#pragma mark - Private methods

- (void)configureAccountServiceDelegate
{
    if (_serviceType == SFAccountManagerServiceTypeIdentity) {
        _accountMgr.idDelegate = self;
    } else if (_serviceType == SFAccountManagerServiceTypeOAuth) {
        _accountMgr.oauthDelegate = self;
    } else {
        NSAssert1(NO, @"Service type '%d' is not supported as a service object.", _serviceType);
    }
}

- (void)clearAccountManagerDelegate
{
    if (_serviceType == SFAccountManagerServiceTypeIdentity) {
        _accountMgr.idDelegate = nil;
    } else if (_serviceType == SFAccountManagerServiceTypeOAuth) {
        _accountMgr.oauthDelegate = nil;
    }
}

- (NSString *)serviceTypeDescription
{
    if (self.request != nil) {
        return @"SFRestRequest";
    } else if (_serviceType == SFAccountManagerServiceTypeIdentity) {
        return @"SFIdentityCoordinator";
    } else if (_serviceType == SFAccountManagerServiceTypeOAuth) {
        return @"SFOAuthCoordinator";
    } else {
        return @"Unknown";
    }
}

#pragma mark - SFRestDelegate

- (void)request:(SFRestRequest *)request didLoadResponse:(id)jsonResponse {
    self.jsonResponse = jsonResponse;
    self.returnStatus = kTestRequestStatusDidLoad;
}

- (void)request:(SFRestRequest*)request didFailLoadWithError:(NSError*)error {
    self.lastError = error;
    self.returnStatus = kTestRequestStatusDidFail;
}

- (void)requestDidCancelLoad:(SFRestRequest *)request {
    self.returnStatus = kTestRequestStatusDidCancel;
}

- (void)requestDidTimeout:(SFRestRequest *)request {
    self.returnStatus = kTestRequestStatusDidTimeout;
}

#pragma mark - SFIdentityCoordinatorDelegate

- (void)identityCoordinatorRetrievedData:(SFIdentityCoordinator *)coordinator
{
    self.returnStatus = kTestRequestStatusDidLoad;
}

- (void)identityCoordinator:(SFIdentityCoordinator *)coordinator didFailWithError:(NSError *)error
{
    self.lastError = error;
    self.returnStatus = kTestRequestStatusDidFail;
}

#pragma mark - SFOAuthCoordinatorDelegate

- (void)oauthCoordinator:(SFOAuthCoordinator *)coordinator willBeginAuthenticationWithView:(UIWebView *)view
{
    NSAssert(NO, @"User Agent flow not supported in this class.");
}

- (void)oauthCoordinator:(SFOAuthCoordinator *)coordinator didStartLoad:(UIWebView *)view
{
    NSAssert(NO, @"User Agent flow not supported in this class.");
}

- (void)oauthCoordinator:(SFOAuthCoordinator *)coordinator didFinishLoad:(UIWebView *)view error:(NSError*)errorOrNil
{
    NSAssert(NO, @"User Agent flow not supported in this class.");
}

- (void)oauthCoordinator:(SFOAuthCoordinator *)coordinator didBeginAuthenticationWithView:(UIWebView *)view
{
    NSAssert(NO, @"User Agent flow not supported in this class.");
}

- (void)oauthCoordinatorDidAuthenticate:(SFOAuthCoordinator *)coordinator authInfo:(SFOAuthInfo *)info
{
    self.returnStatus = kTestRequestStatusDidLoad;
}

- (void)oauthCoordinator:(SFOAuthCoordinator *)coordinator didFailWithError:(NSError *)error authInfo:(SFOAuthInfo *)info
{
    self.lastError = error;
    self.returnStatus = kTestRequestStatusDidFail;
}

@end


text:
define('ember-local-storage/adapters/local', ['exports', 'ember', 'ember-local-storage/adapters/base', 'ember-local-storage/helpers/storage', 'ember-local-storage/local/array'], function (exports, _ember, _emberLocalStorageAdaptersBase, _emberLocalStorageHelpersStorage, _emberLocalStorageLocalArray) {
  'use strict';

  var get = _ember['default'].get;

  exports['default'] = _emberLocalStorageAdaptersBase['default'].extend({
    _storage: (0, _emberLocalStorageHelpersStorage.getStorage)('local'),

    _getIndex: function _getIndex(type) {
      var indices = get(this, '_indices');

      if (!indices[type]) {
        indices[type] = _emberLocalStorageLocalArray['default'].extend({ _storageKey: 'index-' + type }).create();
      }

      return indices[type];
    }
  });
});


text:
#ifndef KP_RIGID_TRANSFORMATION_RANSAC_HH
#define KP_RIGID_TRANSFORMATION_RANSAC_HH

#include <vector>
#include <iostream>
#include <stdexcept>
#include <Eigen/Dense>
#include <v4r/core/macros.h>
#include <v4r/common/impl/SmartPtr.hpp>

namespace v4r
{

/**
 * RigidTransformationRANSAC
 */
class V4R_EXPORTS RigidTransformationRANSAC
{
public:
  class V4R_EXPORTS Parameter
  {
  public:
    double inl_dist;
    double eta_ransac;               // eta for pose ransac
    unsigned max_rand_trials;         // max. number of trials for pose ransac

    Parameter(double _inl_dist=0.01, double _eta_ransac=0.01, unsigned _max_rand_trials=10000)
     : inl_dist(_inl_dist), eta_ransac(_eta_ransac), max_rand_trials(_max_rand_trials) {}
  };

private:
  Eigen::Matrix4f invPose;

  void DemeanPoints (
        const std::vector<Eigen::Vector3f > &inPts,
        const std::vector<int> &indices,
        const Eigen::Vector3f &centroid,
        Eigen::MatrixXf &outPts);

  void ComputeCentroid(
        const std::vector<Eigen::Vector3f > &pts,
        const std::vector<int> &indices,
        Eigen::Vector3f &centroid);

  void Ransac(
        const std::vector<Eigen::Vector3f > &srcPts,
        const std::vector<Eigen::Vector3f > &tgtPts,
        Eigen::Matrix4f &transform,
        std::vector<int> &inliers);

  void GetDistances(
        const std::vector<Eigen::Vector3f > &srcPts,
        const std::vector<Eigen::Vector3f > &tgtPts,
        const Eigen::Matrix4f &transform,
        std::vector<float> &dists);

  void GetInliers(std::vector<float> &dists, std::vector<int> &inliers);
  unsigned CountInliers(std::vector<float> &dists);
  void GetRandIdx(int size, int num, std::vector<int> &idx);

  inline bool Contains(const std::vector<int> &idx, int num);
  inline void InvPose(const Eigen::Matrix4f &pose, Eigen::Matrix4f &invPose);

public:
  Parameter param;

  RigidTransformationRANSAC(Parameter p=Parameter());
  ~RigidTransformationRANSAC();

  void estimateRigidTransformationSVD(
        const std::vector<Eigen::Vector3f > &srcPts,
        const std::vector<int> &srcIndices,
        const std::vector<Eigen::Vector3f > &tgtPts,
        const std::vector<int> &tgtIndices,
        Eigen::Matrix4f &transform);

  void compute(
        const std::vector<Eigen::Vector3f > &srcPts,
        const std::vector<Eigen::Vector3f > &tgtPts,
        Eigen::Matrix4f &transform,
        std::vector<int> &inliers);

  typedef SmartPtr< ::v4r::RigidTransformationRANSAC> Ptr;
  typedef SmartPtr< ::v4r::RigidTransformationRANSAC const> ConstPtr;
};

/*********************** INLINE METHODES **************************/
inline bool RigidTransformationRANSAC::Contains(const std::vector<int> &idx, int num)
{
  for (unsigned i=0; i<idx.size(); i++)
    if (idx[i]==num)
      return true;
  return false;
}

inline void RigidTransformationRANSAC::InvPose(const Eigen::Matrix4f &pose, Eigen::Matrix4f &invPose)
{
  invPose.setIdentity();
  invPose.block<3, 3> (0, 0) = pose.block<3, 3> (0, 0).transpose();
  invPose.block<3, 1> (0, 3) = -1*(invPose.block<3, 3> (0, 0)*pose.block<3, 1> (0, 3));
}

}

#endif


text:
.horizon-contact-form-row {
    height: 60px;
    width: 100%;
    display: block;
    padding: 50px 0px;
}

.horizon-contact-form-input-warpup {
    height: 30px; background-color: white; margin-top: 5px;
}
.horizon-contact-form-input {
    width: 95%; font-size: 15px; margin: 0 auto; height: 25px; border: 0; border-bottom: 1px solid #c7c7c7;
}
.horizon-contact-form-submit-wrapup {
    height: 30px; margin-top: 5px; background-color: #f1424b;
}
.horizon-contact-form-submit {
    width: 100%; height: 35px; background-color: #f1424b; color: white; border: none; display: block; text-align: center; line-height: 35px;
}
.horizon-contact-form-image {
    margin-left: auto; margin-right: auto; display: block; height: 100px; width: 100px; padding: 3%; border-radius: 50%;
}


text:
_ = require('underscore');

var utils = {}

// Deep merge
utils.merge = function(obj, depth) {
  var parentRE = /#{\s*?_\s*?}/,
  slice = Array.prototype.slice;

  _.each(slice.call(arguments, 1), function(source) {
    for (var prop in source) {
      if (_.isNull(obj[prop]) || _.isUndefined(obj[prop]) || _.isFunction(obj[prop]) || _.isNull(source[prop]) || _.isDate(source[prop])) {
        obj[prop] = source[prop];
      }
      else if (_.isString(source[prop]) && parentRE.test(source[prop])) {
        if (_.isString(obj[prop])) {
          obj[prop] = source[prop].replace(parentRE, obj[prop]);
        }
      }
      else if (_.isArray(obj[prop]) || _.isArray(source[prop])){
        if (!_.isArray(obj[prop]) || !_.isArray(source[prop])){
          throw new Error('Trying to combine an array with a non-array (' + prop + ')');
        } else {
          obj[prop] = _.reject(utils.merge(_.clone(obj[prop]), source[prop]), function (item) { return _.isNull(item);});
        }
      }
      else if (_.isObject(obj[prop]) || _.isObject(source[prop])){
        if (!_.isObject(obj[prop]) || !_.isObject(source[prop])){
          throw new Error('Trying to combine an object with a non-object (' + prop + ')');
        } else {
          obj[prop] = utils.merge(_.clone(obj[prop]), source[prop]);
        }
      } else {
        obj[prop] = source[prop];
      }
    }
  });
  return obj;
};

utils.isMatchDeep = function(object, attrs) {
  attrs = _.extendOwn({},attrs);
  var keys = _.keys(attrs), length = keys.length;
  if (object == null) return !length;
  var obj = Object(object);
  for (var i = 0; i < length; i++) {
    var key = keys[i];
    if (_.isObject(attrs[key])) {
      if (!utils.isMatchDeep(object[key],attrs[key])) return false;
    } else {
      if (attrs[key] !== obj[key] || !(key in obj)) return false;
    }
  }
  return true;
};

utils.valueOnPath = function(object,path,removeRoot) {
  if(removeRoot && path.indexOf(".") < 0) return object;
  return _.reduce((removeRoot ? path.substring(path.indexOf(".")+1) : path).split("."),function(memo,id){
    return (angular.isDefined(memo) && memo != null) ? memo[id] : null;
  },object)
}

utils.syntaxHighlight = function(json) {
  json = json.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
  return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) {
    var cls = '_endev_json_number_';
    if (/^"/.test(match)) {
      if (/:$/.test(match)) {
        cls = '_endev_json_key_';
      } else {
        cls = '_endev_json_string_';
      }
    } else if (/true|false/.test(match)) {
      cls = '_endev_json_boolean_';
    } else if (/null/.test(match)) {
      cls = '_endev_json_null_';
    }
    return '' + match + '';
  });
}

utils.storageAvailable = function(type) {
  try {
    var storage = window[type],
        x = '__storage_test__';
    storage.setItem(x, x);
    storage.removeItem(x);
    return true;
  }
  catch(e) {
    return false;
  }
}

utils.removeFn = function(removeFrom,object,parent,scope,provider) {
  console.log("Removing:",object);
  var queryParameters = {removeFrom:removeFrom,newObject:object};

  if (parent) {
    queryParameters.parentLabel = parent;
    queryParameters.parentObject = scope[parent];
    queryParameters.parentData = scope["$endevData_" + parent];
  }

  provider.remove(queryParameters)
}

module.exports = utils


text: import './typescript.spec'


text:
using FluentAssertions.Analyzers.Utilities;
using Microsoft.CodeAnalysis;

namespace FluentAssertions.Analyzers.Xunit
{
    public abstract class XunitAnalyzer : TestingLibraryAnalyzerBase
    {
        private static readonly string XunitNamespace = "Xunit";
        protected override string TestingLibraryNamespace => XunitNamespace;

        protected override bool ShouldAnalyzeVariableType(INamedTypeSymbol type, SemanticModel semanticModel) => type.Name == "Assert";
    }

    public abstract class XunitCodeFixProvider : TestingLibraryCodeFixBase
    {
        protected override string AssertClassName => "Assert";
    }
}