text:
<?php

namespace HealthCareAbroad\StatisticsBundle\Services\Trackers;

use Symfony\Component\HttpFoundation\Request;

use HealthCareAbroad\StatisticsBundle\Entity\StatisticParameters;

use HealthCareAbroad\StatisticsBundle\Entity\StatisticTypes;

use HealthCareAbroad\StatisticsBundle\Entity\SearchResultsItemStatisticsDaily;

use HealthCareAbroad\StatisticsBundle\Entity\StatisticsDaily;

use HealthCareAbroad\StatisticsBundle\Services\StatisticsParameterBag;

class SearchResultItemTracker extends Tracker
{
    public function createDataFromHttpRequest(Request $request)
    {

    }

    public function createDataFromParameters(StatisticsParameterBag $parameters)
    {
        $type = $parameters->get(StatisticParameters::TYPE);
        $data = null;
        if (StatisticTypes::SEARCH_RESULT_ITEM != $type)
        {
            return null;
        }

        $data = new SearchResultsItemStatisticsDaily();
        $data->setCategoryId($parameters->get(StatisticParameters::CATEGORY_ID, 0));
        $data->setDate(new \DateTime(\date('Y-m-d')));
        $data->setInstitutionId($parameters->get(StatisticParameters::INSTITUTION_ID));
        $data->setInstitutionMedicalCenterId($parameters->get(StatisticParameters::INSTITUTION_MEDICAL_CENTER_ID, 0));
        $data->setCityId($parameters->get(StatisticParameters::CITY_ID, 0));
        $data->setCountryId($parameters->get(StatisticParameters::COUNTRY_ID, 0));
        $data->setSpecializationId($parameters->get(StatisticParameters::SPECIALIZATION_ID, 0));
        $data->setSubSpecializationId($parameters->get(StatisticParameters::SUB_SPECIALIZATION_ID, 0));
        $data->setTreatmentId($parameters->get(StatisticParameters::TREATMENT_ID, 0));

        return $data;
    }

    public function add(StatisticsDaily $data)
    {
        if (!$data instanceof SearchResultsItemStatisticsDaily) {
            return false;
        }

        $this->data[] = $data;

        return true;
    }
}


text:
lychee.define('app.entity.Emblem').includes([
	'lychee.app.Sprite'
]).exports(function(lychee, app, global, attachments) {

	var _texture = attachments["png"];
	var _config  = {
		width:  256,
		height: 64
	};

	var Class = function(data) {

		var settings = lychee.extend({}, data);

		settings.texture = _texture;
		settings.width   = _config.width;
		settings.height  = _config.height;

		lychee.app.Sprite.call(this, settings);

		settings = null;

	};

	Class.prototype = {

		serialize: function() {

			var data = lychee.app.Sprite.prototype.serialize.call(this);
			data['constructor'] = 'app.entity.Emblem';

			return data;

		}

	};

	return Class;

});

redpajama_set_name: RedPajamaGithub


text:
module Kanbantastic

  class Task < Base
    attr_accessor :id, :title, :column_id, :updated_at, :created_at, :moved_at, :task_type_id, :owner_id, :position
    validates_presence_of :config, :id, :title, :column_id, :updated_at, :task_type_id

    def initialize(config, options = {})
      super(config)
      assign_attributes(options)
      @task_type_id = options[:task_type_id] || find_task_type_id(options[:task_type_name])
      valid?
    end

    def find_task_type_id(task_type_name)
      @task_type_ids ||= {}
      @task_type_ids[task_type_name] ||= if !task_type_name.blank?
        response = get("/projects/#{project_id}/task_types.json")
        task_type = response.select{|t| t[:name] == task_type_name}.first || Hash.new
        task_type[:id]
      end
    end

    def update(params={})
      params[:owner_id] ||= self.owner_id
      begin
        response = put("/tasks/#{id}.json", :body => {:task => params})
      rescue Exception => e
        self.class.invalid_response_error("Unable to update task. #{e.message}", response)
      end
      if response[:id]
        assign_attributes(response)
        return valid?
      else
        self.class.invalid_response_error("Unable to update task.", response)
      end
    end

    def self.create(config, params={})
      # raise exception if title and task_type_name is not present
      unless params[:title] and params[:task_type_name]
        raise "Kanbanery task can't be created without title and task_type_name."
      end
      response = request(:post, config, "/projects/#{config.project_id}/tasks.json", :body => {:task => params})
      task = new(config, response)
      task.valid? ? task : invalid_response_error("Unable to create task.", response)
    end

    def column
      @columns ||= {}
      @columns[column_id] ||= Kanbantastic::Column.find(config, column_id)
    end

    def move_to_next_column
      update(:location => 'next_column')
    end

    def move_to_previous_column
      update(:location => 'prev_column')
    end

    def move_to_first_column
      column = Kanbantastic::Column.all(config).first
      update(:column_id => column.id, :position => nil)
    end

    def move_to_second_column
      column = Kanbantastic::Column.all(config)[1]
      update(:column_id => column.id, :position => nil)
    end

    def move_to_last_column
      column = Kanbantastic::Column.all(config).last
      update(:column_id => column.id, :position => nil)
    end

    def archive
      if Kanbantastic::Task.archived?(config, id)
        return true
      else
        # raise an exception as only tasks which are in last column can be archived.
        unless column.last?
          raise "Kanbanery tasks can be archived only from the last column."
        end
        update(:location => "archive")
      end
    end

    def owner
      @owner ||= if owner_id
        response = get("/projects/#{project_id}/users.json")
        user = response.select{|r| r[:id] == owner_id}[0]
        Kanbantastic::User.new("#{user[:first_name]} #{user[:last_name]}", user[:email], user[:gravatar_url])
      end
    end

    def ==(task)
      id == task.id
    end

    def self.archived?(config, id)
      response = request(:get, config, "/projects/#{config.project_id}/archive/tasks.json")
      archived_task = response.select{|t| t[:id] == id}[0]
      archived_task ? true : false
    end

    def self.find(config, id)
      begin
        response = request(:get, config, "/tasks/#{id}.json")
      rescue
        return nil
      end
      task = new(config, response)
      if task.valid?
        return task
      else
        return nil
      end
    end

    def self.all(config)
      collection = []
      response = request(:get, config, "/projects/#{config.project_id}/tasks.json")
      response.each do |data|
        task = self.new(config, data)
        collection << task if task.valid?
      end
      return collection
    end
  end
end


text:
require 'test_helper'

class CmsBaseTest < ActiveSupport::TestCase
  test "truth" do
    assert_kind_of Module, CmsBase
  end
end


text:
This repository is used to host my Nagios Log Server plugins - they can be used to monitor various metrics in the system that are not monitored by default.

These plugins do not yet follow the appropriate Plugin Developer Guidelines - I am working toward that point. I wanted to provide my work early so that you could use my code before development is complete.

All work is my own.


text:
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
    <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
    <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
        <group>
            <file>file:/Users/rob/NetBeansProjects/Csc412ClassProject2/img/portfolio/roundicons.png</file>
            <file>file:/Users/rob/NetBeansProjects/Csc412ClassProject2/index.html</file>
            <file>file:/Users/rob/NetBeansProjects/Csc412ClassProject2/img/about/6.jpg</file>
            <file>file:/Users/rob/NetBeansProjects/Csc412ClassProject2/img/team/myers.jpg</file>
            <file>file:/Users/rob/NetBeansProjects/Csc412ClassProject2/img/team/kerr.jpg</file>
            <file>file:/Users/rob/NetBeansProjects/Csc412ClassProject2/img/contact-bg.jpg</file>
            <file>file:/Users/rob/NetBeansProjects/Csc412ClassProject2/contact.html</file>
            <file>file:/Users/rob/NetBeansProjects/Csc412ClassProject2/about.html</file>
            <file>file:/Users/rob/NetBeansProjects/Csc412ClassProject2/Visitors.html</file>
            <file>file:/Users/rob/NetBeansProjects/Csc412ClassProject2/visitorsquotes.html</file>
            <file>file:/Users/rob/NetBeansProjects/Csc412ClassProject2/visitorsquotes.php</file>
        </group>
    </open-files>
</project-private>


text:
package com.packtpub.rest.ch2.model;

import java.util.Date;

/**
 * Employee class used in various examples in this project
 * @author Jobinesh
 */
public class Employee {

    private String firstName;
    private String lastName;
    private String email;
    private Integer employeeId;
    private Date hireDate ;

    public Employee() {
    }

    public Employee(String firstName, String lastName, String email, Integer employeeId, Date hireDate) {
        this.firstName = firstName;
        this.lastName = lastName;
        this.email = email;
        this.employeeId = employeeId;
        this.hireDate = hireDate;
    }

    /**
     * @return the firstName
     */
    public String getFirstName() {
        return firstName;
    }

    /**
     * @param firstName the firstName to set
     */
    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    /**
     * @return the lastName
     */
    public String getLastName() {
        return lastName;
    }

    /**
     * @param lastName the lastName to set
     */
    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    /**
     * @return the email
     */
    public String getEmail() {
        return email;
    }

    /**
     * @param email the email to set
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * @return the doj
     */
    public Date getHireDate() {
        return hireDate;
    }

    /**
     * @param doj the doj to set
     */
    public void setHireDate(Date doj) {
        this.hireDate = doj;
    }

    /**
     * @return the employeeId
     */
    public Integer getEmployeeId() {
        return employeeId;
    }

    /**
     * @param employeeId the employeeId to set
     */
    public void setEmployeeId(Integer employeeId) {
        this.employeeId = employeeId;
    }

    @Override
    public String toString() {
        return "Employee{" + "firstName=" + firstName + ", lastName=" + lastName + ", email=" + email + ", employeeId=" + employeeId + ", doj=" + hireDate + '}';
    }

}


text:
const fetch = require('client/applications/dashboard/cores/fetch');

module.exports = {
  getIkepolicyList: function() {
    return fetch.get({
      url: '/proxy/neutron/v2.0/vpn/ikepolicies'
    }).then((res) => {
      res.ikepolicies.forEach((item) => {
        item.sa_lifetime = item.lifetime.value + ' s';
      });
      return res;
    });
  }
};


text:
using System;

namespace EcmaScript.NET
{

    public class ContextEventArgs : EventArgs
    {

        private Context m_Context = null;

        /// <summary>
        /// The underlying context
        /// </summary>
        public Context Context
        {
            get { return m_Context; }
        }

        /// <summary>
        /// Creates a new ContextEventArgs object
        /// </summary>
        /// <param name="cx"></param>
        public ContextEventArgs (Context cx)
        {
            m_Context = cx;
        }

    }

    public class ContextScriptableEventArgs : ContextEventArgs
    {

        private IScriptable m_Scope = null;

        public ContextScriptableEventArgs (Context cx, IScriptable scope)
            : base (cx)
        {
            m_Scope = scope;
        }

        public IScriptable Scope
        {
            get { return m_Scope; }
        }

    }

    /// <summary>
    ///
    /// </summary>
    public class ContextWrapEventArgs : ContextScriptableEventArgs
    {

        private object m_Source = null;

        public object Source
        {
            get { return m_Source; }
        }

        private object m_Target = null;

        public object Target
        {
            get { return m_Target; }
            set { m_Target = null; }
        }

        private Type m_StaticType = null;

        public Type staticType
        {
            get { return m_StaticType; }
        }

        public ContextWrapEventArgs (Context cx, IScriptable scope, object obj, Type staticType)
            : base (cx, scope)
        {
            m_Source = obj;
            m_StaticType = staticType;
        }

    }

    public delegate void ContextEventHandler (object sender, ContextEventArgs e);

    public delegate void ContextWrapHandler (object sender, ContextWrapEventArgs e);

}


text:
<?php

declare(strict_types=1);

namespace Atk4\Data\Persistence\Sql\Mysql;

trait ExpressionTrait
{
    protected function escapeStringLiteral(string $value): string
    {
        return str_replace('\\', '\\\\', parent::escapeStringLiteral($value));
    }

    protected function hasNativeNamedParamSupport(): bool
    {
        $dbalConnection = $this->connection->getConnection();

        return !$dbalConnection->getNativeConnection() instanceof \mysqli;
    }
}


text:
<?php

namespace Curl;

class Curl
{

    // The HTTP authentication method(s) to use.

    const AUTH_BASIC = CURLAUTH_BASIC;
    const AUTH_DIGEST = CURLAUTH_DIGEST;
    const AUTH_GSSNEGOTIATE = CURLAUTH_GSSNEGOTIATE;
    const AUTH_NTLM = CURLAUTH_NTLM;
    const AUTH_ANY = CURLAUTH_ANY;
    const AUTH_ANYSAFE = CURLAUTH_ANYSAFE;

    const USER_AGENT = 'PHP Curl/1.1 (+https://github.com/mod-php/curl)';

    private $_cookies = array();
    private $_headers = array();

    public $curl;

    public $error = false;
    public $error_code = 0;
    public $error_message = null;

    public $curl_error = false;
    public $curl_error_code = 0;
    public $curl_error_message = null;

    public $http_error = false;
    public $http_status_code = 0;
    public $http_error_message = null;

    public $request_headers = null;
    public $response_headers = null;
    public $response = null;

    public function __construct()
    {

        if (!extension_loaded('curl')) {
            throw new \ErrorException('cURL library is not loaded');
        }

        $this->init();
    }

    public function get($url, $data = array())
    {
        if (count($data) > 0) {
            $this->setopt(CURLOPT_URL, $url . '?' . $this->http_build_query($data));
        } else {
            $this->setopt(CURLOPT_URL, $url);
        }
        $this->setopt(CURLOPT_HTTPGET, true);
        $this->_exec();
    }

    public function post($url, $data = array())
    {
        $this->setopt(CURLOPT_URL, $url);
        $this->setopt(CURLOPT_POST, true);
        if (is_array($data) || is_object($data))
        {
            $data = $this->http_build_query($data);
        }
        $this->setopt(CURLOPT_POSTFIELDS, $data);
        $this->_exec();
    }

    public function put($url, $data = array())
    {
        $this->setopt(CURLOPT_URL, $url . '?' . $this->http_build_query($data));
        $this->setopt(CURLOPT_CUSTOMREQUEST, 'PUT');
        $this->_exec();
    }

    public function patch($url, $data = array())
    {
        $this->setopt(CURLOPT_URL, $url);
        $this->setopt(CURLOPT_CUSTOMREQUEST, 'PATCH');
        $this->setopt(CURLOPT_POSTFIELDS, $data);
        $this->_exec();
    }

    public function delete($url, $data = array())
    {
        $this->setopt(CURLOPT_URL, $url . '?' . $this->http_build_query($data));
        $this->setopt(CURLOPT_CUSTOMREQUEST, 'DELETE');
        $this->_exec();
    }

    public function setBasicAuthentication($username, $password)
    {
        $this->setHttpAuth(self::AUTH_BASIC);
        $this->setopt(CURLOPT_USERPWD, $username . ':' . $password);
    }

    protected function setHttpAuth($httpauth)
    {
        $this->setOpt(CURLOPT_HTTPAUTH, $httpauth);
    }

    public function setHeader($key, $value)
    {
        $this->_headers[$key] = $key . ': ' . $value;
        $this->setopt(CURLOPT_HTTPHEADER, array_values($this->_headers));
    }

    public function setUserAgent($user_agent)
    {
        $this->setopt(CURLOPT_USERAGENT, $user_agent);
    }

    public function setReferrer($referrer)
    {
        $this->setopt(CURLOPT_REFERER, $referrer);
    }

    public function setCookie($key, $value)
    {
        $this->_cookies[$key] = $value;
        $this->setopt(CURLOPT_COOKIE, $this->http_build_query($this->_cookies, '', '; '));
    }

    public function setOpt($option, $value)
    {
        return curl_setopt($this->curl, $option, $value);
    }

    public function verbose($on = true)
    {
        $this->setopt(CURLOPT_VERBOSE, $on);
    }

    public function close()
    {
        if (is_resource($this->curl)) {
            curl_close($this->curl);
        }
    }

    public function reset()
    {
        $this->close();
        $this->_cookies = array();
        $this->_headers = array();
        $this->error = false;
        $this->error_code = 0;
        $this->error_message = null;
        $this->curl_error = false;
        $this->curl_error_code = 0;
        $this->curl_error_message = null;
        $this->http_error = false;
        $this->http_status_code = 0;
        $this->http_error_message = null;
        $this->request_headers = null;
        $this->response_headers = null;
        $this->response = null;
        $this->init();
    }

    public function _exec()
    {
        $this->response = curl_exec($this->curl);
        $this->curl_error_code = curl_errno($this->curl);
        $this->curl_error_message = curl_error($this->curl);
        $this->curl_error = !($this->curl_error_code === 0);
        $this->http_status_code = curl_getinfo($this->curl, CURLINFO_HTTP_CODE);
        $this->http_error = in_array(floor($this->http_status_code / 100), array(4, 5));
        $this->error = $this->curl_error || $this->http_error;
        $this->error_code = $this->error ? ($this->curl_error ? $this->curl_error_code : $this->http_status_code) : 0;

        $this->request_headers = preg_split('/\r\n/', curl_getinfo($this->curl, CURLINFO_HEADER_OUT), null, PREG_SPLIT_NO_EMPTY);
        $this->response_headers = '';
        if (!(strpos($this->response, "\r\n\r\n") === false)) {
            list($response_header, $this->response) = explode("\r\n\r\n", $this->response, 2);
            if ($response_header === 'HTTP/1.1 100 Continue') {
                list($response_header, $this->response) = explode("\r\n\r\n", $this->response, 2);
            }
            $this->response_headers = preg_split('/\r\n/', $response_header, null, PREG_SPLIT_NO_EMPTY);
        }

        $this->http_error_message = $this->error ? (isset($this->response_headers['0']) ? $this->response_headers['0'] : '') : '';
        $this->error_message = $this->curl_error ? $this->curl_error_message : $this->http_error_message;

        return $this->error_code;
    }

    public function __destruct()
    {
        $this->close();
    }

    public function http_build_query(array $data)
    {
        static $stack = [];
        $query = [];
        foreach ($data as $k => $v) {
            if (!isset($v) or is_scalar($v)) {
                if ($stack) $k = implode('', $stack) . (is_int($k) ? '[]' : '[' . $k . ']');
                elseif (is_int($k)) $k = '[]';
                $query[] = $k . '=' . urlencode($v);
            } else {
                $stack[] = $stack ? '[' . $k . ']' : $k;
                $query[] = $this->http_build_query($v);
                array_pop($stack);
            }
        }
        return implode('&', $query);
    }

    private function init()
    {
        $this->curl = curl_init();
        $this->setUserAgent(self::USER_AGENT);
        $this->setopt(CURLINFO_HEADER_OUT, true);
        $this->setopt(CURLOPT_HEADER, true);
        $this->setopt(CURLOPT_RETURNTRANSFER, true);
    }
}


text:
<?php

/**
 * Plugin Name: Woocommerce EBANX Express Payment Gateway
 * Plugin URI: http://developers.ebanx.com
 * Description: This plugin extends the WooCommerce payment gateways with the EBANX payment gateway
 * Version: 2.1.2
 * Developer: EBANX Tecnologia da Informação Ltda.
 * Developer URI: https://www.ebanx.com/
*/

// Add a custom payment class to WooCommerce
add_action('plugins_loaded', 'woocommerce_ebanx_payment_gateway_init', 0);

function woocommerce_ebanx_payment_gateway_init()
{
	// If the Woocommerce payment gateway class is not available, do nothing
	if (!class_exists('WC_Payment_Gateway'))
	{
		return;
	}

	// Require the library, the return routes and the WC gateway class
	require_once 'ebanx-php/src/autoload.php';
	require_once 'return.php';
	require_once 'WC_Gateway_Ebanx.php';

	// Add the payment gateway to the WooCommerce gateways
	add_filter('woocommerce_payment_gateways', 'add_woocommerce_ebanx_payment_gateway');
	function add_woocommerce_ebanx_payment_gateway($methods)
	{
		$methods[] = 'WC_Gateway_Ebanx';
		return $methods;
	}

	// Add stylesheet and javascripts
	add_action('wp_enqueue_scripts', 'add_ebanx_assets');
	function add_ebanx_assets()
	{
		wp_enqueue_style('ebanx-css', plugins_url('assets/app.css', __FILE__));
		wp_enqueue_script('jquery');
		wp_enqueue_script('ebanx-js', plugins_url('assets/app.js', __FILE__));
		wp_enqueue_script('ebanx-js-masked', plugins_url('assets/vendor/jquery.maskedinput.min.js', __FILE__));
	}
}


text:
package org.apache.commons.dbcp;

import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import java.util.Iterator;
import org.apache.commons.pool.KeyedObjectPool;
import org.apache.commons.pool.KeyedObjectPoolFactory;
import org.apache.commons.pool.PoolableObjectFactory;
import org.apache.commons.pool.ObjectPool;

/**
 * A {@link PoolableObjectFactory} that creates
 * {@link PoolableConnection}s.
 *
 * @author Rodney Waldhoff
 * @author Glenn L. Nielsen
 * @author James House
 * @author Dirk Verbeeck
 * @version $Revision$ $Date$
 */
public class PoolableConnectionFactory implements PoolableObjectFactory {
    /**
     * Create a new <tt>PoolableConnectionFactory</tt>.
     * @param connFactory the {@link ConnectionFactory} from which to obtain base {@link Connection}s
     * @param pool the {@link ObjectPool} in which to pool those {@link Connection}s
     * @param stmtPoolFactory the {@link KeyedObjectPoolFactory} to use to create {@link KeyedObjectPool}s for pooling {@link java.sql.PreparedStatement}s, or <tt>null</tt> to disable {@link java.sql.PreparedStatement} pooling
     * @param validationQuery a query to use to {@link #validateObject validate} {@link Connection}s.  Should return at least one row. Using <tt>null</tt> turns off validation.
     * @param defaultReadOnly the default "read only" setting for borrowed {@link Connection}s
     * @param defaultAutoCommit the default "auto commit" setting for returned {@link Connection}s
     */
    public PoolableConnectionFactory(ConnectionFactory connFactory, ObjectPool pool, KeyedObjectPoolFactory stmtPoolFactory, String validationQuery, boolean defaultReadOnly, boolean defaultAutoCommit) {
        _connFactory = connFactory;
        _pool = pool;
        _pool.setFactory(this);
        _stmtPoolFactory = stmtPoolFactory;
        _validationQuery = validationQuery;
        _defaultReadOnly = defaultReadOnly ? Boolean.TRUE : Boolean.FALSE;
        _defaultAutoCommit = defaultAutoCommit;
    }

    /**
     * Create a new <tt>PoolableConnectionFactory</tt>.
     * @param connFactory the {@link ConnectionFactory} from which to obtain base {@link Connection}s
     * @param pool the {@link ObjectPool} in which to pool those {@link Connection}s
     * @param stmtPoolFactory the {@link KeyedObjectPoolFactory} to use to create {@link KeyedObjectPool}s for pooling {@link java.sql.PreparedStatement}s, or <tt>null</tt> to disable {@link java.sql.PreparedStatement} pooling
     * @param validationQuery a query to use to {@link #validateObject validate} {@link Connection}s.  Should return at least one row. Using <tt>null</tt> turns off validation.
     * @param connectionInitSqls a Collection of SQL statements to initialize {@link Connection}s. Using <tt>null</tt> turns off initialization.
     * @param defaultReadOnly the default "read only" setting for borrowed {@link Connection}s
     * @param defaultAutoCommit the default "auto commit" setting for returned {@link Connection}s
     * @since 1.3
     */
    public PoolableConnectionFactory(ConnectionFactory connFactory, ObjectPool pool, KeyedObjectPoolFactory stmtPoolFactory, String validationQuery, Collection connectionInitSqls, boolean defaultReadOnly, boolean defaultAutoCommit) {
        _connFactory = connFactory;
        _pool = pool;
        _pool.setFactory(this);
        _stmtPoolFactory = stmtPoolFactory;
        _validationQuery = validationQuery;
        _connectionInitSqls = connectionInitSqls;
        _defaultReadOnly = defaultReadOnly ? Boolean.TRUE : Boolean.FALSE;
        _defaultAutoCommit = defaultAutoCommit;
    }

    /**
     * Create a new <tt>PoolableConnectionFactory</tt>.
     * @param connFactory the {@link ConnectionFactory} from which to obtain base {@link Connection}s
     * @param pool the {@link ObjectPool} in which to pool those {@link Connection}s
     * @param stmtPoolFactory the {@link KeyedObjectPoolFactory} to use to create {@link KeyedObjectPool}s for pooling {@link java.sql.PreparedStatement}s, or <tt>null</tt> to disable {@link java.sql.PreparedStatement} pooling
     * @param validationQuery a query to use to {@link #validateObject validate} {@link Connection}s.  Should return at least one row. Using <tt>null</tt> turns off validation.
     * @param validationQueryTimeout the number of seconds that validation queries will wait for database response before failing.  Use a value less than or equal to 0 for no timeout.
     * @param defaultReadOnly the default "read only" setting for borrowed {@link Connection}s
     * @param defaultAutoCommit the default "auto commit" setting for returned {@link Connection}s
     * @since 1.3
     */
    public PoolableConnectionFactory(ConnectionFactory connFactory, ObjectPool pool, KeyedObjectPoolFactory stmtPoolFactory, String validationQuery, int validationQueryTimeout, boolean defaultReadOnly, boolean defaultAutoCommit) {
        _connFactory = connFactory;
        _pool = pool;
        _pool.setFactory(this);
        _stmtPoolFactory = stmtPoolFactory;
        _validationQuery = validationQuery;
        _validationQueryTimeout = validationQueryTimeout;
        _defaultReadOnly = defaultReadOnly ? Boolean.TRUE : Boolean.FALSE;
        _defaultAutoCommit = defaultAutoCommit;
    }

    /**
     * Create a new <tt>PoolableConnectionFactory</tt>.
     * @param connFactory the {@link ConnectionFactory} from which to obtain base {@link Connection}s
     * @param pool the {@link ObjectPool} in which to pool those {@link Connection}s
     * @param stmtPoolFactory the {@link KeyedObjectPoolFactory} to use to create {@link KeyedObjectPool}s for pooling {@link java.sql.PreparedStatement}s, or <tt>null</tt> to disable {@link java.sql.PreparedStatement} pooling
     * @param validationQuery a query to use to {@link #validateObject validate} {@link Connection}s.  Should return at least one row. Using <tt>null</tt> turns off validation.
     * @param validationQueryTimeout the number of seconds that validation queries will wait for database response before failing.  Use a value less than or equal to 0 for no timeout.
     * @param connectionInitSqls a Collection of SQL statements to initialize {@link Connection}s. Using <tt>null</tt> turns off initialization.
     * @param defaultReadOnly the default "read only" setting for borrowed {@link Connection}s
     * @param defaultAutoCommit the default "auto commit" setting for returned {@link Connection}s
     * @since 1.3
     */
    public PoolableConnectionFactory(ConnectionFactory connFactory, ObjectPool pool, KeyedObjectPoolFactory stmtPoolFactory, String validationQuery, int validationQueryTimeout, Collection connectionInitSqls, boolean defaultReadOnly, boolean defaultAutoCommit) {
        _connFactory = connFactory;
        _pool = pool;
        _pool.setFactory(this);
        _stmtPoolFactory = stmtPoolFactory;
        _validationQuery = validationQuery;
        _validationQueryTimeout = validationQueryTimeout;
        _connectionInitSqls = connectionInitSqls;
        _defaultReadOnly = defaultReadOnly ? Boolean.TRUE : Boolean.FALSE;
        _defaultAutoCommit = defaultAutoCommit;
    }

    /**
     * Create a new <tt>PoolableConnectionFactory</tt>.
     * @param connFactory the {@link ConnectionFactory} from which to obtain base {@link Connection}s
     * @param pool the {@link ObjectPool} in which to pool those {@link Connection}s
     * @param stmtPoolFactory the {@link KeyedObjectPoolFactory} to use to create {@link KeyedObjectPool}s for pooling {@link java.sql.PreparedStatement}s, or <tt>null</tt> to disable {@link java.sql.PreparedStatement} pooling
     * @param validationQuery a query to use to {@link #validateObject validate} {@link Connection}s.  Should return at least one row. Using <tt>null</tt> turns off validation.
     * @param defaultReadOnly the default "read only" setting for borrowed {@link Connection}s
     * @param defaultAutoCommit the default "auto commit" setting for returned {@link Connection}s
     * @param defaultTransactionIsolation the default "Transaction Isolation" setting for returned {@link Connection}s
     */
    public PoolableConnectionFactory(ConnectionFactory connFactory, ObjectPool pool, KeyedObjectPoolFactory stmtPoolFactory, String validationQuery, boolean defaultReadOnly, boolean defaultAutoCommit, int defaultTransactionIsolation) {
        _connFactory = connFactory;
        _pool = pool;
        _pool.setFactory(this);
        _stmtPoolFactory = stmtPoolFactory;
        _validationQuery = validationQuery;
        _defaultReadOnly = defaultReadOnly ? Boolean.TRUE : Boolean.FALSE;
        _defaultAutoCommit = defaultAutoCommit;
        _defaultTransactionIsolation = defaultTransactionIsolation;
    }

    /**
     * Create a new <tt>PoolableConnectionFactory</tt>.
     * @param connFactory the {@link ConnectionFactory} from which to obtain base {@link Connection}s
     * @param pool the {@link ObjectPool} in which to pool those {@link Connection}s
     * @param stmtPoolFactory the {@link KeyedObjectPoolFactory} to use to create {@link KeyedObjectPool}s for pooling {@link java.sql.PreparedStatement}s, or <tt>null</tt> to disable {@link java.sql.PreparedStatement} pooling
     * @param validationQuery a query to use to {@link #validateObject validate} {@link Connection}s.  Should return at least one row. Using <tt>null</tt> turns off validation.
     * @param connectionInitSqls a Collection of SQL statement to initialize {@link Connection}s. Using <tt>null</tt> turns off initialization.
     * @param defaultReadOnly the default "read only" setting for borrowed {@link Connection}s
     * @param defaultAutoCommit the default "auto commit" setting for returned {@link Connection}s
     * @param defaultTransactionIsolation the default "Transaction Isolation" setting for returned {@link Connection}s
     * @since 1.3
     */
    public PoolableConnectionFactory(ConnectionFactory connFactory, ObjectPool pool, KeyedObjectPoolFactory stmtPoolFactory, String validationQuery, Collection connectionInitSqls, boolean defaultReadOnly, boolean defaultAutoCommit, int defaultTransactionIsolation) {
        _connFactory = connFactory;
        _pool = pool;
        _pool.setFactory(this);
        _stmtPoolFactory = stmtPoolFactory;
        _validationQuery = validationQuery;
        _connectionInitSqls = connectionInitSqls;
        _defaultReadOnly = defaultReadOnly ? Boolean.TRUE : Boolean.FALSE;
        _defaultAutoCommit = defaultAutoCommit;
        _defaultTransactionIsolation = defaultTransactionIsolation;
    }

    /**
     * Create a new <tt>PoolableConnectionFactory</tt>.
     * @param connFactory the {@link ConnectionFactory} from which to obtain base {@link Connection}s
     * @param pool the {@link ObjectPool} in which to pool those {@link Connection}s
     * @param stmtPoolFactory the {@link KeyedObjectPoolFactory} to use to create {@link KeyedObjectPool}s for pooling {@link java.sql.PreparedStatement}s, or <tt>null</tt> to disable {@link java.sql.PreparedStatement} pooling
     * @param validationQuery a query to use to {@link #validateObject validate} {@link Connection}s.  Should return at least one row. Using <tt>null</tt> turns off validation.
     * @param validationQueryTimeout the number of seconds that validation queries will wait for database response before failing.  Use a value less than or equal to 0 for no timeout.
     * @param defaultReadOnly the default "read only" setting for borrowed {@link Connection}s
     * @param defaultAutoCommit the default "auto commit" setting for returned {@link Connection}s
     * @param defaultTransactionIsolation the default "Transaction Isolation" setting for returned {@link Connection}s
     * @since 1.3
     */
    public PoolableConnectionFactory(ConnectionFactory connFactory, ObjectPool pool, KeyedObjectPoolFactory stmtPoolFactory, String validationQuery, int validationQueryTimeout, boolean defaultReadOnly, boolean defaultAutoCommit, int defaultTransactionIsolation) {
        _connFactory = connFactory;
        _pool = pool;
        _pool.setFactory(this);
        _stmtPoolFactory = stmtPoolFactory;
        _validationQuery = validationQuery;
        _validationQueryTimeout = validationQueryTimeout;
        _defaultReadOnly = defaultReadOnly ? Boolean.TRUE : Boolean.FALSE;
        _defaultAutoCommit = defaultAutoCommit;
        _defaultTransactionIsolation = defaultTransactionIsolation;
    }

    /**
     * Create a new <tt>PoolableConnectionFactory</tt>.
     * @param connFactory the {@link ConnectionFactory} from which to obtain base {@link Connection}s
     * @param pool the {@link ObjectPool} in which to pool those {@link Connection}s
     * @param stmtPoolFactory the {@link KeyedObjectPoolFactory} to use to create {@link KeyedObjectPool}s for pooling {@link java.sql.PreparedStatement}s, or <tt>null</tt> to disable {@link java.sql.PreparedStatement} pooling
     * @param validationQuery a query to use to {@link #validateObject validate} {@link Connection}s.  Should return at least one row. Using <tt>null</tt> turns off validation.
     * @param validationQueryTimeout the number of seconds that validation queries will wait for database response before failing.  Use a value less than or equal to 0 for no timeout.
     * @param connectionInitSqls a Collection of SQL statement to initialize {@link Connection}s. Using <tt>null</tt> turns off initialization.
     * @param defaultReadOnly the default "read only" setting for borrowed {@link Connection}s
     * @param defaultAutoCommit the default "auto commit" setting for returned {@link Connection}s
     * @param defaultTransactionIsolation the default "Transaction Isolation" setting for returned {@link Connection}s
     * @since 1.3
     */
    public PoolableConnectionFactory(ConnectionFactory connFactory, ObjectPool pool, KeyedObjectPoolFactory stmtPoolFactory, String validationQuery, int validationQueryTimeout, Collection connectionInitSqls, boolean defaultReadOnly, boolean defaultAutoCommit, int defaultTransactionIsolation) {
        _connFactory = connFactory;
        _pool = pool;
        _pool.setFactory(this);
        _stmtPoolFactory = stmtPoolFactory;
        _validationQuery = validationQuery;
        _validationQueryTimeout = validationQueryTimeout;
        _connectionInitSqls = connectionInitSqls;
        _defaultReadOnly = defaultReadOnly ? Boolean.TRUE : Boolean.FALSE;
        _defaultAutoCommit = defaultAutoCommit;
        _defaultTransactionIsolation = defaultTransactionIsolation;
    }

    /**
     * Create a new <tt>PoolableConnectionFactory</tt>.
     * @param connFactory the {@link ConnectionFactory} from which to obtain base {@link Connection}s
     * @param pool the {@link ObjectPool} in which to pool those {@link Connection}s
     * @param stmtPoolFactory the {@link KeyedObjectPoolFactory} to use to create {@link KeyedObjectPool}s for pooling {@link java.sql.PreparedStatement}s, or <tt>null</tt> to disable {@link java.sql.PreparedStatement} pooling
     * @param validationQuery a query to use to {@link #validateObject validate} {@link Connection}s.  Should return at least one row. Using <tt>null</tt> turns off validation.
     * @param defaultReadOnly the default "read only" setting for borrowed {@link Connection}s
     * @param defaultAutoCommit the default "auto commit" setting for returned {@link Connection}s
     * @param config the AbandonedConfig if tracing SQL objects
     */
    public PoolableConnectionFactory(
        ConnectionFactory connFactory,
        ObjectPool pool,
        KeyedObjectPoolFactory stmtPoolFactory,
        String validationQuery,
        boolean defaultReadOnly,
        boolean defaultAutoCommit,
        AbandonedConfig config) {

        _connFactory = connFactory;
        _pool = pool;
        _config = config;
        _pool.setFactory(this);
        _stmtPoolFactory = stmtPoolFactory;
        _validationQuery = validationQuery;
        _defaultReadOnly = defaultReadOnly ? Boolean.TRUE : Boolean.FALSE;
        _defaultAutoCommit = defaultAutoCommit;
    }

    /**
     * Create a new <tt>PoolableConnectionFactory</tt>.
     * @param connFactory the {@link ConnectionFactory} from which to obtain base {@link Connection}s
     * @param pool the {@link ObjectPool} in which to pool those {@link Connection}s
     * @param stmtPoolFactory the {@link KeyedObjectPoolFactory} to use to create {@link KeyedObjectPool}s for pooling {@link java.sql.PreparedStatement}s, or <tt>null</tt> to disable {@link java.sql.PreparedStatement} pooling
     * @param validationQuery a query to use to {@link #validateObject validate} {@link Connection}s.  Should return at least one row. Using <tt>null</tt> turns off validation.
     * @param defaultReadOnly the default "read only" setting for borrowed {@link Connection}s
     * @param defaultAutoCommit the default "auto commit" setting for returned {@link Connection}s
     * @param defaultTransactionIsolation the default "Transaction Isolation" setting for returned {@link Connection}s
     * @param config the AbandonedConfig if tracing SQL objects
     */
    public PoolableConnectionFactory(
        ConnectionFactory connFactory,
        ObjectPool pool,
        KeyedObjectPoolFactory stmtPoolFactory,
        String validationQuery,
        boolean defaultReadOnly,
        boolean defaultAutoCommit,
        int defaultTransactionIsolation,
        AbandonedConfig config) {

        _connFactory = connFactory;
        _pool = pool;
        _config = config;
        _pool.setFactory(this);
        _stmtPoolFactory = stmtPoolFactory;
        _validationQuery = validationQuery;
        _defaultReadOnly = defaultReadOnly ? Boolean.TRUE : Boolean.FALSE;
        _defaultAutoCommit = defaultAutoCommit;
        _defaultTransactionIsolation = defaultTransactionIsolation;
    }

    /**
     * Create a new <tt>PoolableConnectionFactory</tt>.
     * @param connFactory the {@link ConnectionFactory} from which to obtain base {@link Connection}s
     * @param pool the {@link ObjectPool} in which to pool those {@link Connection}s
     * @param stmtPoolFactory the {@link KeyedObjectPoolFactory} to use to create {@link KeyedObjectPool}s for pooling {@link java.sql.PreparedStatement}s, or <tt>null</tt> to disable {@link java.sql.PreparedStatement} pooling
     * @param validationQuery a query to use to {@link #validateObject validate} {@link Connection}s.  Should return at least one row. Using <tt>null</tt> turns off validation.
     * @param defaultReadOnly the default "read only" setting for borrowed {@link Connection}s
     * @param defaultAutoCommit the default "auto commit" setting for returned {@link Connection}s
     * @param defaultTransactionIsolation the default "Transaction Isolation" setting for returned {@link Connection}s
     * @param defaultCatalog the default "catalog" setting for returned {@link Connection}s
     * @param config the AbandonedConfig if tracing SQL objects
     */
    public PoolableConnectionFactory(
        ConnectionFactory connFactory,
        ObjectPool pool,
        KeyedObjectPoolFactory stmtPoolFactory,
        String validationQuery,
        boolean defaultReadOnly,
        boolean defaultAutoCommit,
        int defaultTransactionIsolation,
        String defaultCatalog,
        AbandonedConfig config) {

        _connFactory = connFactory;
        _pool = pool;
        _config = config;
        _pool.setFactory(this);
        _stmtPoolFactory = stmtPoolFactory;
        _validationQuery = validationQuery;
        _defaultReadOnly = defaultReadOnly ? Boolean.TRUE : Boolean.FALSE;
        _defaultAutoCommit = defaultAutoCommit;
        _defaultTransactionIsolation = defaultTransactionIsolation;
        _defaultCatalog = defaultCatalog;
    }

    /**
     * Create a new <tt>PoolableConnectionFactory</tt>.
     * @param connFactory the {@link ConnectionFactory} from which to obtain base {@link Connection}s
     * @param pool the {@link ObjectPool} in which to pool those {@link Connection}s
     * @param stmtPoolFactory the {@link KeyedObjectPoolFactory} to use to create {@link KeyedObjectPool}s for pooling {@link java.sql.PreparedStatement}s, or <tt>null</tt> to disable {@link java.sql.PreparedStatement} pooling
     * @param validationQuery a query to use to {@link #validateObject validate} {@link Connection}s.  Should return at least one row. Using <tt>null</tt> turns off validation.
     * @param defaultReadOnly the default "read only" setting for borrowed {@link Connection}s
     * @param defaultAutoCommit the default "auto commit" setting for returned {@link Connection}s
     * @param defaultTransactionIsolation the default "Transaction Isolation" setting for returned {@link Connection}s
     * @param defaultCatalog the default "catalog" setting for returned {@link Connection}s
     * @param config the AbandonedConfig if tracing SQL objects
     */
    public PoolableConnectionFactory(
        ConnectionFactory connFactory,
        ObjectPool pool,
        KeyedObjectPoolFactory stmtPoolFactory,
        String validationQuery,
        Boolean defaultReadOnly,
        boolean defaultAutoCommit,
        int defaultTransactionIsolation,
        String defaultCatalog,
        AbandonedConfig config) {

        _connFactory = connFactory;
        _pool = pool;
        _config = config;
        _pool.setFactory(this);
        _stmtPoolFactory = stmtPoolFactory;
        _validationQuery = validationQuery;
        _defaultReadOnly = defaultReadOnly;
        _defaultAutoCommit = defaultAutoCommit;
        _defaultTransactionIsolation = defaultTransactionIsolation;
        _defaultCatalog = defaultCatalog;
    }

    /**
     * Create a new <tt>PoolableConnectionFactory</tt>.
     * @param connFactory the {@link ConnectionFactory} from which to obtain base {@link Connection}s
     * @param pool the {@link ObjectPool} in which to pool those {@link Connection}s
     * @param stmtPoolFactory the {@link KeyedObjectPoolFactory} to use to create {@link KeyedObjectPool}s for pooling {@link java.sql.PreparedStatement}s, or <tt>null</tt> to disable {@link java.sql.PreparedStatement} pooling
     * @param validationQuery a query to use to {@link #validateObject validate} {@link Connection}s.  Should return at least one row. Using <tt>null</tt> turns off validation.
     * @param connectionInitSqls a Collection of SQL statements to initialize {@link Connection}s. Using <tt>null</tt> turns off initialization.
     * @param defaultReadOnly the default "read only" setting for borrowed {@link Connection}s
     * @param defaultAutoCommit the default "auto commit" setting for returned {@link Connection}s
     * @param defaultTransactionIsolation the default "Transaction Isolation" setting for returned {@link Connection}s
     * @param defaultCatalog the default "catalog" setting for returned {@link Connection}s
     * @param config the AbandonedConfig if tracing SQL objects
     * @since 1.3
     */
    public PoolableConnectionFactory(
        ConnectionFactory connFactory,
        ObjectPool pool,
        KeyedObjectPoolFactory stmtPoolFactory,
        String validationQuery,
        Collection connectionInitSqls,
        Boolean defaultReadOnly,
        boolean defaultAutoCommit,
        int defaultTransactionIsolation,
        String defaultCatalog,
        AbandonedConfig config) {

        _connFactory = connFactory;
        _pool = pool;
        _config = config;
        _pool.setFactory(this);
        _stmtPoolFactory = stmtPoolFactory;
        _validationQuery = validationQuery;
        _connectionInitSqls = connectionInitSqls;
        _defaultReadOnly = defaultReadOnly;
        _defaultAutoCommit = defaultAutoCommit;
        _defaultTransactionIsolation = defaultTransactionIsolation;
        _defaultCatalog = defaultCatalog;
    }

    /**
     * Create a new <tt>PoolableConnectionFactory</tt>.
     * @param connFactory the {@link ConnectionFactory} from which to obtain base {@link Connection}s
     * @param pool the {@link ObjectPool} in which to pool those {@link Connection}s
     * @param stmtPoolFactory the {@link KeyedObjectPoolFactory} to use to create {@link KeyedObjectPool}s for pooling {@link java.sql.PreparedStatement}s, or <tt>null</tt> to disable {@link java.sql.PreparedStatement} pooling
     * @param validationQuery a query to use to {@link #validateObject validate} {@link Connection}s.  Should return at least one row. Using <tt>null</tt> turns off validation.
     * @param validationQueryTimeout the number of seconds that validation queries will wait for database response before failing.  Use a value less than or equal to 0 for no timeout.
     * @param defaultReadOnly the default "read only" setting for borrowed {@link Connection}s
     * @param defaultAutoCommit the default "auto commit" setting for returned {@link Connection}s
     * @param defaultTransactionIsolation the default "Transaction Isolation" setting for returned {@link Connection}s
     * @param defaultCatalog the default "catalog" setting for returned {@link Connection}s
     * @param config the AbandonedConfig if tracing SQL objects
     * @since 1.3
     */
    public PoolableConnectionFactory(
        ConnectionFactory connFactory,
        ObjectPool pool,
        KeyedObjectPoolFactory stmtPoolFactory,
        String validationQuery,
        int validationQueryTimeout,
        Boolean defaultReadOnly,
        boolean defaultAutoCommit,
        int defaultTransactionIsolation,
        String defaultCatalog,
        AbandonedConfig config) {

        _connFactory = connFactory;
        _pool = pool;
        _config = config;
        _pool.setFactory(this);
        _stmtPoolFactory = stmtPoolFactory;
        _validationQuery = validationQuery;
        _validationQueryTimeout = validationQueryTimeout;
        _defaultReadOnly = defaultReadOnly;
        _defaultAutoCommit = defaultAutoCommit;
        _defaultTransactionIsolation = defaultTransactionIsolation;
        _defaultCatalog = defaultCatalog;
    }

    /**
     * Create a new <tt>PoolableConnectionFactory</tt>.
     * @param connFactory the {@link ConnectionFactory} from which to obtain base {@link Connection}s
     * @param pool the {@link ObjectPool} in which to pool those {@link Connection}s
     * @param stmtPoolFactory the {@link KeyedObjectPoolFactory} to use to create {@link KeyedObjectPool}s for pooling {@link java.sql.PreparedStatement}s, or <tt>null</tt> to disable {@link java.sql.PreparedStatement} pooling
     * @param validationQuery a query to use to {@link #validateObject validate} {@link Connection}s.  Should return at least one row. Using <tt>null</tt> turns off validation.
     * @param validationQueryTimeout the number of seconds that validation queries will wait for database response before failing.  Use a value less than or equal to 0 for no timeout.
     * @param connectionInitSqls a Collection of SQL statements to initialize {@link Connection}s. Using <tt>null</tt> turns off initialization.
     * @param defaultReadOnly the default "read only" setting for borrowed {@link Connection}s
     * @param defaultAutoCommit the default "auto commit" setting for returned {@link Connection}s
     * @param defaultTransactionIsolation the default "Transaction Isolation" setting for returned {@link Connection}s
     * @param defaultCatalog the default "catalog" setting for returned {@link Connection}s
     * @param config the AbandonedConfig if tracing SQL objects
     * @since 1.3
     */
    public PoolableConnectionFactory(
        ConnectionFactory connFactory,
        ObjectPool pool,
        KeyedObjectPoolFactory stmtPoolFactory,
        String validationQuery,
        int validationQueryTimeout,
        Collection connectionInitSqls,
        Boolean defaultReadOnly,
        boolean defaultAutoCommit,
        int defaultTransactionIsolation,
        String defaultCatalog,
        AbandonedConfig config) {

        _connFactory = connFactory;
        _pool = pool;
        _config = config;
        _pool.setFactory(this);
        _stmtPoolFactory = stmtPoolFactory;
        _validationQuery = validationQuery;
        _validationQueryTimeout = validationQueryTimeout;
        _connectionInitSqls = connectionInitSqls;
        _defaultReadOnly = defaultReadOnly;
        _defaultAutoCommit = defaultAutoCommit;
        _defaultTransactionIsolation = defaultTransactionIsolation;
        _defaultCatalog = defaultCatalog;
    }

    /**
     * Sets the {@link ConnectionFactory} from which to obtain base {@link Connection}s.
     * @param connFactory the {@link ConnectionFactory} from which to obtain base {@link Connection}s
     */
    public void setConnectionFactory(ConnectionFactory connFactory) {
        _connFactory = connFactory;
    }

    /**
     * Sets the query I use to {@link #validateObject validate} {@link Connection}s.
     * Should return at least one row.
     * Using <tt>null</tt> turns off validation.
     * @param validationQuery a query to use to {@link #validateObject validate} {@link Connection}s.
     */
    public void setValidationQuery(String validationQuery) {
        _validationQuery = validationQuery;
    }

    /**
     * Sets the validation query timeout, the amount of time, in seconds, that
     * connection validation will wait for a response from the database when
     * executing a validation query.  Use a value less than or equal to 0 for
     * no timeout.
     *
     * @param timeout new validation query timeout value in seconds
     * @since 1.3
     */
    public void setValidationQueryTimeout(int timeout) {
        _validationQueryTimeout = timeout;
    }

    /**
     * Sets the SQL statements I use to initialize newly created {@link Connection}s.
     * Using <tt>null</tt> turns off connection initialization.
     * @param connectionInitSqls SQL statement to initialize {@link Connection}s.
     * @since 1.3
     */
    synchronized public void setConnectionInitSql(Collection connectionInitSqls) {
        _connectionInitSqls = connectionInitSqls;
    }

    /**
     * Sets the {@link ObjectPool} in which to pool {@link Connection}s.
     * @param pool the {@link ObjectPool} in which to pool those {@link Connection}s
     */
    synchronized public void setPool(ObjectPool pool) {
        if(null != _pool && pool != _pool) {
            try {
                _pool.close();
            } catch(Exception e) {
                // ignored !?!
            }
        }
        _pool = pool;
    }

    /**
     * Returns the {@link ObjectPool} in which {@link Connection}s are pooled.
     * @return the connection pool
     */
    public synchronized ObjectPool getPool() {
        return _pool;
    }

    /**
     * Sets the {@link KeyedObjectPoolFactory} I use to create {@link KeyedObjectPool}s
     * for pooling {@link java.sql.PreparedStatement}s.
     * Set to <tt>null</tt> to disable {@link java.sql.PreparedStatement} pooling.
     * @param stmtPoolFactory the {@link KeyedObjectPoolFactory} to use to create {@link KeyedObjectPool}s for pooling {@link java.sql.PreparedStatement}s
     */
    public void setStatementPoolFactory(KeyedObjectPoolFactory stmtPoolFactory) {
        _stmtPoolFactory = stmtPoolFactory;
    }

    /**
     * Sets the default "read only" setting for borrowed {@link Connection}s
     * @param defaultReadOnly the default "read only" setting for borrowed {@link Connection}s
     */
    public void setDefaultReadOnly(boolean defaultReadOnly) {
        _defaultReadOnly = defaultReadOnly ? Boolean.TRUE : Boolean.FALSE;
    }

    /**
     * Sets the default "auto commit" setting for borrowed {@link Connection}s
     * @param defaultAutoCommit the default "auto commit" setting for borrowed {@link Connection}s
     */
    public void setDefaultAutoCommit(boolean defaultAutoCommit) {
        _defaultAutoCommit = defaultAutoCommit;
    }

    /**
     * Sets the default "Transaction Isolation" setting for borrowed {@link Connection}s
     * @param defaultTransactionIsolation the default "Transaction Isolation" setting for returned {@link Connection}s
     */
    public void setDefaultTransactionIsolation(int defaultTransactionIsolation) {
        _defaultTransactionIsolation = defaultTransactionIsolation;
    }

    /**
     * Sets the default "catalog" setting for borrowed {@link Connection}s
     * @param defaultCatalog the default "catalog" setting for borrowed {@link Connection}s
     */
    public void setDefaultCatalog(String defaultCatalog) {
        _defaultCatalog = defaultCatalog;
    }

    public Object makeObject() throws Exception {
        Connection conn = _connFactory.createConnection();
        if (conn == null) {
            throw new IllegalStateException("Connection factory returned null from createConnection");
        }
        initializeConnection(conn);
        if(null != _stmtPoolFactory) {
            KeyedObjectPool stmtpool = _stmtPoolFactory.createPool();
            conn = new PoolingConnection(conn,stmtpool);
            stmtpool.setFactory((PoolingConnection)conn);
        }
        return new PoolableConnection(conn,_pool,_config);
    }

    protected void initializeConnection(Connection conn) throws SQLException {
        Collection sqls = _connectionInitSqls;
        if(conn.isClosed()) {
            throw new SQLException("initializeConnection: connection closed");
        }
        if(null != sqls) {
            Statement stmt = null;
            try {
                stmt = conn.createStatement();
                for (Iterator iterator = sqls.iterator(); iterator.hasNext();)
                {
                    Object o = iterator.next();
                    if (o == null) {
                        throw new NullPointerException("null connectionInitSqls element");
                    }
                    // o might not be a String instance
                    String sql = o.toString();
                    stmt.execute(sql);
                }
            } finally {
                if (stmt != null) {
                    try {
                        stmt.close();
                    } catch(Exception t) {
                        // ignored
                    }
                }
            }
        }
    }

    public void destroyObject(Object obj) throws Exception {
        if(obj instanceof PoolableConnection) {
            ((PoolableConnection)obj).reallyClose();
        }
    }

    public boolean validateObject(Object obj) {
        if(obj instanceof Connection) {
            try {
                validateConnection((Connection) obj);
                return true;
            } catch(Exception e) {
                return false;
            }
        } else {
            return false;
        }
    }

    public void validateConnection(Connection conn) throws SQLException {
        String query = _validationQuery;
        if(conn.isClosed()) {
            throw new SQLException("validateConnection: connection closed");
        }
        if(null != query) {
            Statement stmt = null;
            ResultSet rset = null;
            try {
                stmt = conn.createStatement();
                if (_validationQueryTimeout > 0) {
                    stmt.setQueryTimeout(_validationQueryTimeout);
                }
                rset = stmt.executeQuery(query);
                if(!rset.next()) {
                    throw new SQLException("validationQuery didn't return a row");
                }
            } finally {
                if (rset != null) {
                    try {
                        rset.close();
                    } catch(Exception t) {
                        // ignored
                    }
                }
                if (stmt != null) {
                    try {
                        stmt.close();
                    } catch(Exception t) {
                        // ignored
                    }
                }
            }
        }
    }

    public void passivateObject(Object obj) throws Exception {
        if(obj instanceof Connection) {
            Connection conn = (Connection)obj;
            if(!conn.getAutoCommit() && !conn.isReadOnly()) {
                conn.rollback();
            }
            conn.clearWarnings();
            if(!conn.getAutoCommit()) {
                conn.setAutoCommit(true);
            }
        }
        if(obj instanceof DelegatingConnection) {
            ((DelegatingConnection)obj).passivate();
        }
    }

    public void activateObject(Object obj) throws Exception {
        if(obj instanceof DelegatingConnection) {
            ((DelegatingConnection)obj).activate();
        }
        if(obj instanceof Connection) {
            Connection conn = (Connection)obj;
            if (conn.getAutoCommit() != _defaultAutoCommit) {
                conn.setAutoCommit(_defaultAutoCommit);
            }
            if ((_defaultTransactionIsolation != UNKNOWN_TRANSACTIONISOLATION)
                    && (conn.getTransactionIsolation() !=
                    _defaultTransactionIsolation)) {
                conn.setTransactionIsolation(_defaultTransactionIsolation);
            }
            if ((_defaultReadOnly != null) &&
                    (conn.isReadOnly() != _defaultReadOnly.booleanValue())) {
                conn.setReadOnly(_defaultReadOnly.booleanValue());
            }
            if ((_defaultCatalog != null) &&
                    (!_defaultCatalog.equals(conn.getCatalog()))) {
                conn.setCatalog(_defaultCatalog);
            }
        }
    }

    protected volatile ConnectionFactory _connFactory = null;
    protected volatile String _validationQuery = null;
    protected volatile int _validationQueryTimeout = -1;
    protected Collection _connectionInitSqls = null;
    protected volatile ObjectPool _pool = null;
    protected volatile KeyedObjectPoolFactory _stmtPoolFactory = null;
    protected Boolean _defaultReadOnly = null;
    protected boolean _defaultAutoCommit = true;
    protected int _defaultTransactionIsolation = UNKNOWN_TRANSACTIONISOLATION;
    protected String _defaultCatalog;

    /**
     * Configuration for removing abandoned connections.
     */
    protected AbandonedConfig _config = null;

    /**
     * Internal constant to indicate the level is not set.
     */
    static final int UNKNOWN_TRANSACTIONISOLATION = -1;
}


text:
<?php
/**
 * The template for displaying the footer
 *
 * Contains footer content and the closing of the #main and #page div elements.
 *
 * @package Ribosome
 */
?>

<?php echo wp_kses_post(get_theme_mod('ribosome_footer_text_left', __('Copyright 2015', 'ribosome'))); ?>

<?php echo wp_kses_post(get_theme_mod('ribosome_footer_text_center', __('Footer text center', 'ribosome'))); ?>

			<a href="<?php echo RIBOSOME_AUTHOR_URI; ?>/wordpress-themes/ribosome">Ribosome <?php _e('by', 'ribosome'); ?> GalussoThemes.com

			<?php _e('Powered by', 'ribosome'); ?><a href="<?php echo esc_url( __( 'https://wordpress.org/', 'ribosome' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'ribosome' ); ?>"> WordPress

<?php
	if (get_theme_mod('ribosome_boton_ir_arriba', 1) == 1){ ?>

	<?php }

wp_footer(); ?>


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

    <title>OpenGLMatrix</title>
    <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

            Prev Class

            Next Class

            Frames

No Frames

All Classes

Summary:

Nested |

                Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.firstinspires.ftc.robotcore.external.matrices

Class OpenGLMatrix

java.lang.Object

                    org.firstinspires.ftc.robotcore.external.matrices.MatrixF

                            org.firstinspires.ftc.robotcore.external.matrices.DenseMatrixF

                                    org.firstinspires.ftc.robotcore.external.matrices.ColumnMajorMatrixF

                                            org.firstinspires.ftc.robotcore.external.matrices.OpenGLMatrix

public class OpenGLMatrix
extends ColumnMajorMatrixF

An OpenGLMatrix
                    is a 4x4 matrix commonly used as a transformation matrix for 3D
                    homogeneous coordinates. The data layout of an OpenGLMatrix
                    is used heavily in the
                    OpenGL high performance graphics standard.

See Also:

Homogenous
                        coordinates,
                        Transformation
                            Matrix,
                        android.opengl.Matrix,
                        Matrix

Field Summary

Fields inherited from class org.firstinspires.ftc.robotcore.external.matrices.MatrixF

                                numCols,
                                    numRows

Constructor Summary

Constructors

                                Constructor and Description

                                OpenGLMatrix()

                                OpenGLMatrix(float[] data)

                                OpenGLMatrix(Matrix44F matrix)

Method Summary

Methods

                                Modifier and Type
                                Method and Description

                                MatrixF

                                emptyMatrix(int numRows,
                                    int numCols)

Returns a new empty matrix of the indicated
                                        dimensions.

                                float[]
                                getData()

Returns the contiguous array of floats which
                                        is the storage for this matrix

                                static OpenGLMatrix

                                identityMatrix()

                                OpenGLMatrix

                                inverted()

Returns a matrix which is the
                                        matrix-multiplication inverse of the receiver.

                                MatrixF

                                multiplied(MatrixF him)

Returns a matrix which is the multiplication
                                        of the recevier with another matrix.

                                OpenGLMatrix

                                multiplied(OpenGLMatrix him)

                                void
                                multiply(MatrixF him)

Updates the receiver to be the product of
                                        itself and another matrix.

                                void
                                multiply(OpenGLMatrix him)

Updates the receiver to be the product of
                                        itself and another matrix.

                                void
                                rotate(AngleUnit angleUnit,
                                    float angle,
                                    float dx,
                                    float dy,
                                    float dz)

                                void
                                rotate(AxesReference axesReference,
                                    AxesOrder axesOrder,
                                    AngleUnit angleUnit,
                                    float first,
                                    float second,
                                    float third)

                                OpenGLMatrix

                                rotated(AngleUnit angleUnit,
                                    float angle,
                                    float dx,
                                    float dy,
                                    float dz)

                                OpenGLMatrix

                                rotated(AxesReference axesReference,
                                    AxesOrder axesOrder,
                                    AngleUnit angleUnit,
                                    float first,
                                    float second,
                                    float third)

                                static OpenGLMatrix

                                rotation(AngleUnit angleUnit,
                                    float angle,
                                    float dx,
                                    float dy,
                                    float dz)

Creates a matrix for rotation by the
                                        indicated angle around the indicated vector.

                                static OpenGLMatrix

                                rotation(AxesReference axesReference,
                                    AxesOrder axesOrder,
                                    AngleUnit angleUnit,
                                    float first,
                                    float second,
                                    float third)

Creates a matrix for a rotation specified by
                                        three successive rotation angles.

                                void
                                scale(float scale)

                                void
                                scale(float scaleX,
                                    float scaleY,
                                    float scaleZ)

                                OpenGLMatrix

                                scaled(float scale)

                                OpenGLMatrix

                                scaled(float scaleX,
                                    float scaleY,
                                    float scaleZ)

                                void
                                translate(float dx,
                                    float dy,
                                    float dz)

                                OpenGLMatrix

                                translated(float dx,
                                    float dy,
                                    float dz)

                                static OpenGLMatrix

                                translation(float dx,
                                    float dy,
                                    float dz)

                                OpenGLMatrix

                                transposed()

Returns a matrix which is the transposition
                                        of the receiver matrix.

Methods inherited from class org.firstinspires.ftc.robotcore.external.matrices.ColumnMajorMatrixF

                                indexFromRowCol,
                                    toVector

Methods inherited from class org.firstinspires.ftc.robotcore.external.matrices.DenseMatrixF

                                get,
                                    put

Methods inherited from class org.firstinspires.ftc.robotcore.external.matrices.MatrixF

                                adaptHomogeneous,
                                    add,
                                    add,
                                    add,
                                    added,
                                    added,
                                    added,
                                    diagonalMatrix,
                                    diagonalMatrix,
                                    dimensionsError,
                                    dimensionsError,
                                    formatAsTransform,
                                    formatAsTransform,
                                    getColumn,
                                    getRow,
                                    getTranslation,
                                    identityMatrix,
                                    multiplied,
                                    multiplied,
                                    multiplied,
                                    multiply,
                                    multiply,
                                    multiply,
                                    numCols,
                                    numRows,
                                    slice,
                                    slice,
                                    subtract,
                                    subtract,
                                    subtract,
                                    subtracted,
                                    subtracted,
                                    subtracted,
                                    toString,
                                    transform

Methods inherited from class java.lang.Object

                                clone, equals, finalize, getClass, hashCode, notify,
                                    notifyAll, wait, wait, wait

Constructor Detail

OpenGLMatrix

public OpenGLMatrix()

OpenGLMatrix

public OpenGLMatrix(float[] data)

OpenGLMatrix

public OpenGLMatrix(Matrix44F matrix)

Method Detail

emptyMatrix

public MatrixF emptyMatrix(int numRows,
                  int numCols)

Description copied from
                                    class: MatrixF

Returns a new empty matrix of the indicated
                                    dimensions. If a specific implementation
                                    associated with the receiver can be used with these dimensions,
                                    then such is used; otherwise
                                    a general matrix implementation will be used.

Specified by:

emptyMatrix in
                                        class MatrixF

Returns:

a new empty matrix of the indicated dimensions

See Also:

                                        emptyMatrix(int,
                                            int)

rotation

public static OpenGLMatrix rotation(AngleUnit angleUnit,
                    float angle,
                    float dx,
                    float dy,
                    float dz)

Creates a matrix for rotation by the indicated
                                    angle around the indicated vector.

rotation

public static OpenGLMatrix rotation(AxesReference axesReference,
                    AxesOrder axesOrder,
                    AngleUnit angleUnit,
                    float first,
                    float second,
                    float third)

Creates a matrix for a rotation specified by
                                    three successive rotation angles.

See Also:

                                        Orientation.getRotationMatrix(AxesReference,
                                            AxesOrder, AngleUnit, float, float, float)

translation

public static OpenGLMatrix translation(float dx,
                       float dy,
                       float dz)

identityMatrix

public static OpenGLMatrix identityMatrix()

getData

public float[] getData()

Description copied from
                                    class: DenseMatrixF

Returns the contiguous array of floats which is
                                    the storage for this matrix

Specified by:

getData in
                                        class DenseMatrixF

Returns:

the contiguous array of floats which is the storage for this
                                        matrix

scale

@NonConst
public void scale(float scaleX,
                  float scaleY,
                  float scaleZ)

scale

@NonConst
public void scale(float scale)

translate

@NonConst
public void translate(float dx,
                      float dy,
                      float dz)

rotate

@NonConst
public void rotate(AngleUnit angleUnit,
                   float angle,
                   float dx,
                   float dy,
                   float dz)

rotate

@NonConst
public void rotate(AxesReference axesReference,
                   AxesOrder axesOrder,
                   AngleUnit angleUnit,
                   float first,
                   float second,
                   float third)

scaled

@Const
public OpenGLMatrix scaled(float scaleX,
                        float scaleY,
                        float scaleZ)

scaled

@Const
public OpenGLMatrix scaled(float scale)

translated

@Const
public OpenGLMatrix translated(float dx,
                            float dy,
                            float dz)

rotated

@Const
public OpenGLMatrix rotated(AngleUnit angleUnit,
                         float angle,
                         float dx,
                         float dy,
                         float dz)

rotated

@Const
public OpenGLMatrix rotated(AxesReference axesReference,
                         AxesOrder axesOrder,
                         AngleUnit angleUnit,
                         float first,
                         float second,
                         float third)

inverted

@Const
public OpenGLMatrix inverted()

Description copied from
                                    class: MatrixF

Returns a matrix which is the
                                    matrix-multiplication inverse of the receiver.

Overrides:

inverted in
                                        class MatrixF

Returns:

a matrix which is the matrix-multiplication inverse of the
                                        receiver

transposed

@Const
public OpenGLMatrix transposed()

Description copied from
                                    class: MatrixF

Returns a matrix which is the transposition of
                                    the receiver matrix.

Overrides:

transposed in
                                        class MatrixF

Returns:

a matrix which is the transposition of the receiver
                                        matrix.

multiplied

@Const
public OpenGLMatrix multiplied(OpenGLMatrix him)

multiplied

@Const
public MatrixF multiplied(MatrixF him)

Description copied from
                                    class: MatrixF

Returns a matrix which is the multiplication of
                                    the recevier with another matrix.

Overrides:

multiplied in
                                        class MatrixF

Parameters:

him - the matrix with which the receiver is to
                                        be multiplied.

Returns:

a matrix which is the product of the two matrices

multiply

@NonConst
public void multiply(OpenGLMatrix him)

Updates the receiver to be the product of itself
                                    and another matrix.

Parameters:

him - the matrix with which the receiver is to
                                        be multiplied.

multiply

@NonConst
public void multiply(MatrixF him)

Updates the receiver to be the product of itself
                                    and another matrix.

Overrides:

multiply in
                                        class MatrixF

Parameters:

him - the matrix with which the receiver is to
                                        be multiplied.

Overview

Package

Class

Tree

Deprecated

Index

Help

            Prev Class

            Next Class

            Frames

No Frames

All Classes

Summary:

Nested |

                Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
import { Injectable } from '@angular/core';

import { roundTime } from '../../../actions/actions.service';
import { ModelTrackBPMChange } from '../../../model';
import { MemorySyncTrack } from '../../memory';

const conversionFactor = (bpm: number, resolution: number): number => {
    return bpm * resolution / 60;
};

@Injectable()
export class MidiTimeService {

    private timeCache: Map<number, number>;
    private midiTimeCache: Map<number, number>;

    constructor() {
        this.clearCache();
    }

    clearCache(): void {
        this.timeCache = new Map<number, number>();
        this.midiTimeCache = new Map<number, number>();
    }

    calculateTime(midiTime: number, resolution: number, bpmChanges: MemorySyncTrack[]): number {
        if (this.timeCache.has(midiTime)) {
            return this.timeCache.get(midiTime);
        }
        const earlierChanges = bpmChanges.filter(e => e.midiTime < midiTime);
        if (earlierChanges.length > 1) {
            const latestChange = earlierChanges.pop();
            const bpm = latestChange.value / 1000;
            const timeUntilLatestChange =
                    this.calculateTime(latestChange.midiTime, resolution, earlierChanges);
            const timeAfterLatestChange =
                (midiTime - latestChange.midiTime) / conversionFactor(bpm, resolution);
            const result = roundTime(timeUntilLatestChange + timeAfterLatestChange);
            this.timeCache.set(midiTime, result);
            return result;
        }
        const bpm: number = earlierChanges.length === 1 ? earlierChanges[0].value / 1000 : 1;
        const result = roundTime(midiTime / conversionFactor(bpm, resolution));
        this.timeCache.set(midiTime, result);
        return result;
    }

    calculateMidiTime(time: number, resolution: number, bpmChanges: ModelTrackBPMChange[])
        : number {
        if (this.midiTimeCache.has(time)) {
            return this.midiTimeCache.get(time);
        }
        const earlierChanges = bpmChanges.filter(bc => bc.time < time);
        if (earlierChanges.length > 1) {
            const latestChange = earlierChanges.pop();
            const bpm = latestChange.bpm;
            const midiTimeUntilLatestChange =
                    this.calculateMidiTime(latestChange.time, resolution, earlierChanges);
            const midiTimeAfterLatestChange =
                (time - latestChange.time) * conversionFactor(bpm, resolution);
            const result = midiTimeUntilLatestChange + midiTimeAfterLatestChange;
            this.midiTimeCache.set(time, result);
            return result;
        }
        const bpm: number = earlierChanges.length === 1 ? earlierChanges[0].bpm : 1;
        const result = time * conversionFactor(bpm, resolution);
        this.midiTimeCache.set(time, result);
        return result;
    }
}


text:
void setUp(void)
{
}

void tearDown(void)
{
}

void test_module_generator_needs_to_be_implemented(void)
{
	TEST_IGNORE_MESSAGE("Implement me!");
}