text:
void gorc::content::register_legacy_loaders(loader_registry &loaders)
{
    loaders.emplace_loader<loaders::shader_loader>();
    loaders.emplace_loader<loaders::vertex_program_loader>();
    loaders.emplace_loader<loaders::fragment_program_loader>();
    loaders.emplace_loader<loaders::sound_loader>();

    loaders.emplace_loader<loaders::animation_loader>();
    loaders.emplace_loader<loaders::level_loader>();
    loaders.emplace_loader<loaders::model_loader>();
    loaders.emplace_loader<loaders::puppet_loader>();
    loaders.emplace_loader<loaders::soundclass_loader>();
    loaders.emplace_loader<loaders::sprite_loader>();

    loaders.emplace_loader<cog::script_loader>();
    loaders.emplace_loader<colormap_loader>();
    loaders.emplace_loader<inventory_loader>();
    loaders.emplace_loader<material_loader>();
}

redpajama_set_name: RedPajamaGithub


text:
/**
 * iOpquast
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to contact@openaccess.fr so we can send you a copy immediately.
 */
#import <UIKit/UIKit.h>

@interface HomeViewController : UIViewController {

}

@end


text:
package com.brahalla.oauthprovider.repository;

import com.brahalla.oauthprovider.domain.entity.Client;

import org.springframework.data.jpa.repository.JpaRepository;

public interface ClientRepository extends JpaRepository<Client, Long> {

  public Client findByClientId(String clientId);

}


text:
package org.apache.camel.component.docker.headers;

import java.util.Map;

import com.github.dockerjava.api.command.AttachContainerCmd;

import org.apache.camel.component.docker.DockerConstants;
import org.apache.camel.component.docker.DockerOperation;
import org.junit.Test;
import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;

/**
 * Validates Attach Container Request headers are applied properly
 */
public class AttachContainerCmdHeaderTest extends BaseDockerHeaderTest<AttachContainerCmd> {

    @Mock
    private AttachContainerCmd mockObject;

    @Test
    public void attachContainerHeaderTest() {

        String containerId = "9c09acd48a25";
        boolean stdOut = true;
        boolean stdErr = true;
        boolean followStream = true;
        boolean logs = true;
        boolean timestamps = true;

        Map<String, Object> headers = getDefaultParameters();
        headers.put(DockerConstants.DOCKER_CONTAINER_ID, containerId);
        headers.put(DockerConstants.DOCKER_FOLLOW_STREAM, followStream);
        headers.put(DockerConstants.DOCKER_STD_OUT, stdOut);
        headers.put(DockerConstants.DOCKER_STD_ERR, stdErr);
        headers.put(DockerConstants.DOCKER_TIMESTAMPS, timestamps);
        headers.put(DockerConstants.DOCKER_LOGS, logs);

        template.sendBodyAndHeaders("direct:in", "", headers);

        Mockito.verify(dockerClient, Mockito.times(1)).attachContainerCmd(containerId);
        Mockito.verify(mockObject, Mockito.times(1)).withFollowStream(Matchers.eq(followStream));
        Mockito.verify(mockObject, Mockito.times(1)).withLogs(Matchers.eq(logs));
        Mockito.verify(mockObject, Mockito.times(1)).withStdErr(Matchers.eq(stdErr));
        Mockito.verify(mockObject, Mockito.times(1)).withStdOut(Matchers.eq(stdOut));
        Mockito.verify(mockObject, Mockito.times(1)).withTimestamps(Matchers.eq(timestamps));

    }

    @Override
    protected void setupMocks() {
        Mockito.when(dockerClient.attachContainerCmd(Matchers.anyString())).thenReturn(mockObject);
    }

    @Override
    protected DockerOperation getOperation() {
        return DockerOperation.ATTACH_CONTAINER;
    }

}


text:
package store

import (
	"github.com/danjac/podbaby/config"
	"github.com/danjac/podbaby/store/Godeps/_workspace/src/github.com/DATA-DOG/go-sqlmock"
	"github.com/danjac/podbaby/store/Godeps/_workspace/src/github.com/jmoiron/sqlx"
)

type closer interface {
	Close() error
}

type beginner interface {
	Begin() (Transaction, error)
}

type preparer interface {
	Preparex(string) (*sqlx.Stmt, error)
	PrepareNamed(string) (*sqlx.NamedStmt, error)
}

// DataHandler is a connection or transaction executing queries
type DataHandler interface {
	sqlx.Ext
	preparer
}

// Connection is a connection to the data store
type Connection interface {
	DataHandler
	beginner
	closer
}

// Transaction is a data store transaction
type Transaction interface {
	DataHandler
	Rollback() error
	Commit() error
}

// Store manages all data store interactions for the application
type Store interface {
	Close() error
	Conn() Connection
	Users() UserStore
	Channels() ChannelStore
	Categories() CategoryStore
	Podcasts() PodcastStore
	Bookmarks() BookmarkStore
	Subscriptions() SubscriptionStore
	Plays() PlayStore
}

type sqlStore struct {
	conn          Connection
	users         UserStore
	categories    CategoryStore
	channels      ChannelStore
	podcasts      PodcastStore
	bookmarks     BookmarkStore
	subscriptions SubscriptionStore
	plays         PlayStore
}

type sqlConnection struct {
	*sqlx.DB
}

func (store *sqlStore) Close() error {
	return store.conn.Close()
}

func (store *sqlStore) Conn() Connection {
	return store.conn
}

func (conn *sqlConnection) Close() error {
	return conn.DB.Close()
}

func (conn *sqlConnection) Begin() (Transaction, error) {
	tx, err := conn.DB.Beginx()
	if err != nil {
		return nil, err
	}
	return &sqlTransaction{tx}, nil
}

type sqlTransaction struct {
	*sqlx.Tx
}

func (store *sqlStore) Users() UserStore {
	return store.users
}

func (store *sqlStore) Channels() ChannelStore {
	return store.channels
}

func (store *sqlStore) Categories() CategoryStore {
	return store.categories
}

func (store *sqlStore) Bookmarks() BookmarkStore {
	return store.bookmarks
}

func (store *sqlStore) Podcasts() PodcastStore {
	return store.podcasts
}

func (store *sqlStore) Plays() PlayStore {
	return store.plays
}

func (store *sqlStore) Subscriptions() SubscriptionStore {
	return store.subscriptions
}

func newSQLStore(db *sqlx.DB) Store {
	return &sqlStore{
		conn:          &sqlConnection{db},
		categories:    newCategoryStore(),
		channels:      newChannelStore(),
		users:         newUserStore(),
		podcasts:      newPodcastStore(),
		bookmarks:     newBookmarkStore(),
		subscriptions: newSubscriptionStore(),
		plays:         newPlayStore(),
	}
}

// New returns a new Store instance
func New(cfg *config.Config) (Store, error) {
	db, err := sqlx.Connect("postgres", cfg.DatabaseURL)
	if err != nil {
		return nil, err
	}
	//db.SetMaxIdleConns(0)
	db.SetMaxOpenConns(cfg.MaxDBConnections)
	return newSQLStore(db), nil
}

// NewMock returns store instance and SqlMock handler for testing
func NewMock() (Store, sqlmock.Sqlmock, error) {
	db, mock, err := sqlmock.New()
	if err != nil {
		return nil, mock, err
	}
	dbx := sqlx.NewDb(db, "postgres")
	return newSQLStore(dbx), mock, nil
}


text:
package org.apache.camel.scala.dsl;

import builder.RouteBuilder
import org.apache.camel.scala.test.CartoonService

/**
 * Test for bean support in Scala DSL routes with explicit blocks
 */
class BlockBeanTest extends SimpleBeanTest {

  override val builder = new RouteBuilder {
     //START SNIPPET: object
     "direct:a" ==> {
       bean(new CartoonService())
       to("mock:a")
     }
     //END SNIPPET: object

     //START SNIPPET: class
     "direct:b" ==> {
       bean(classOf[CartoonService])
       to("mock:b")
     }
     //END SNIPPET: class}

     //START SNIPPET: ref
     "direct:c" ==> {
       bean("CartoonService")
       to("mock:c")
     }
     //END SNIPPET: ref}
   }
}


text:
<?php

class phRETS {

	public $capability_url = array();
	private $ch;
	private $server_hostname;
	private $server_port;
	private $server_protocol;
	private $server_version;
	private $server_software;
	private $static_headers = array();
	private $server_information = array();
	private $cookie_file = "";
	private $debug_file = "rets_debug.txt";
	private $debug_mode;
	private $allowed_capabilities = array(
			"Action" => 1,
			"ChangePassword" => 1,
			"GetObject" => 1,
			"Login" => 1,
			"LoginComplete" => 1,
			"Logout" => 1,
			"Search" => 1,
			"GetMetadata" => 1,
			"ServerInformation" => 1,
			"Update" => 1,
			"PostObject" => 1,
			"GetPayloadList" => 1
			);
	private $last_request = array();
	private $auth_support_basic = false;
	private $auth_support_digest = false;
	private $last_response_headers = array();
	private $last_response_headers_raw = "";
	private $last_remembered_header = "";
	private $compression_enabled = false;
	private $ua_pwd = "";
	private $ua_auth = false;
	private $request_id = "";
	private $disable_follow_location = false;
	private $force_basic_authentication = false;
	private $use_interealty_ua_auth = false;
	private $int_result_pointer = 0;
	private $error_info = array();
	private $last_request_url;
	private $last_server_response;
	private $session_id;
	private $catch_last_response = false;
	private $disable_encoding_fix = false;
	private $offset_support = false;
	private $override_offset_protection = false;

	public function phRETS() { }

	public function GetLastServerResponse() {
		return $this->last_server_response;
	}

	public function FirewallTest() {
		$google = $this->FirewallTestConn("google.com", 80);
		$crt80 = $this->FirewallTestConn("demo.crt.realtors.org", 80);
		$crt6103 = $this->FirewallTestConn("demo.crt.realtors.org", 6103);
		$flexmls80 = $this->FirewallTestConn("retsgw.flexmls.com", 80);
		$flexmls6103 = $this->FirewallTestConn("retsgw.flexmls.com", 6103);

		if (!$google && !$crt80 && !$crt6103 && !$flexmls80 && !$flexmls6103) {
			echo "Firewall Result: All tests failed.  Possible causes:";
			echo "
";
			echo "
Firewall is blocking your outbound connections
";
			echo "
You aren't connected to the internet
";
			echo "
";
			return false;
		}

		if (!$crt6103 && !$flexmls6103) {
			echo "Firewall Result: All port 6103 tests failed.  ";
			echo "Likely cause: Firewall is blocking your outbound connections on port 6103.";
			return false;
		}

		if ($google && $crt6103 && $crt80 && $flexmls6103 && $flexmls80) {
			echo "Firewall Result: All tests passed.";
			return true;
		}

		if (($crt6103 && !$flexmls6103) || (!$crt6103 && $flexmls6103)) {
			echo "Firewall Result: At least one port 6103 test passed.  ";
			echo "Likely cause: One of the test servers might be down but connections on port 80 and port 6103 should work.";
			return true;
		}

		if (!$google || !$crt80 || !$flexmls80) {
			echo "Firewall Result: At least one port 80 test failed.  ";
			echo "Likely cause: One of the test servers might be down.";
			return true;
		}

		echo "Firewall Results: Unable to guess the issue.  See individual test results above.";
		return false;

	}

	private function FirewallTestConn($hostname, $port = 6103) {
		$fp = @fsockopen($hostname, $port, $errno, $errstr, 5);

		if (!$fp) {
			echo "Firewall Test: {$hostname}:{$port} FAILED
\n";
			return false;
		}
		else {
			@fclose($fp);
			echo "Firewall Test: {$hostname}:{$port} GOOD
\n";
			return true;
		}

	}

	public function GetObject($resource, $type, $id, $photo_number = '*', $location = 0) {
		$this->reset_error_info();
		$return_photos = array();

		if (empty($resource)) {
			die("Resource parameter is required for GetObject() request.");
		}
		if (empty($type)) {
			die("Type parameter is required for GetObject() request.");
		}
		if (empty($id)) {
			die("ID parameter is required for GetObject() request.");
		}
		if (empty($this->capability_url['GetObject'])) {
			die("GetObject() called but unable to find GetObject location.  Failed login?\n");
		}

		$send_id = "";
		$send_numb = "";

		// check if $photo_number needs fixing
		if (strpos($photo_number, ',') !== false) {
			// change the commas to colons for the request
			$photo_number = preg_replace('/\,/', ':', $photo_number);
		}

		if (strpos($photo_number, ':') !== false) {
			// photo number contains multiple objects
			// chopping and cleaning
			$requested_numbers = explode(":", $photo_number);
			if (is_array($requested_numbers)) {
				foreach ($requested_numbers as $numb) {
					$numb = trim($numb);
					if (!empty($numb) || $numb == "0") {
					$send_numb .= "{$numb}:";
					}
				}
			}
			$send_numb = preg_replace('/\:$/', '', $send_numb);
		}
		else {
			$send_numb = trim($photo_number);
		}

		if (strpos($id, ',') !== false) {
			// id contains multiple objects.
			// chopping and combining with photo_number
			$requested_ids = explode(",", $id);
			if (is_array($requested_ids)) {
				foreach ($requested_ids as $req_id) {
				$req_id = trim($req_id);
					if (!empty($req_id) && $req_id != "0") {
						$send_id .= "{$req_id}:{$send_numb},";
					}
				}
			}
			$send_id = preg_replace('/\,$/', '', $send_id);
		}
		else {
			$send_id = trim($id).':'.$send_numb;
		}

		// make request
		$result = $this->RETSRequest($this->capability_url['GetObject'],
						array(
								'Resource' => $resource,
								'Type' => $type,
								'ID' => $send_id,
								'Location' => $location
								)
						);

		if (!$result) {
			return false;
		}
		list($headers, $body) = $result;

		// fix case issue if exists
		if (isset($this->last_response_headers['Content-type']) && !isset($this->last_response_headers['Content-Type'])) {
			$this->last_response_headers['Content-Type'] = $this->last_response_headers['Content-type'];
		}

		if (!isset($this->last_response_headers['Content-Type'])) {
			$this->last_response_headers['Content-Type'] = "";
		}

		// check what type of response came back
		if (strpos($this->last_response_headers['Content-Type'], 'multipart') !== false) {

			// help bad responses be more multipart compliant
			$body = "\r\n{$body}\r\n";

			// multipart
			preg_match('/boundary\=\"(.*?)\"/', $this->last_response_headers['Content-Type'], $matches);
			if (isset($matches[1])) {
				$boundary = $matches[1];
			}
			else {
				preg_match('/boundary\=(.*?)(\s|$|\;)/', $this->last_response_headers['Content-Type'], $matches);
				$boundary = $matches[1];
			}
			// strip quotes off of the boundary
			$boundary = preg_replace('/^\"(.*?)\"$/', '\1', $boundary);

			// clean up the body to remove a reamble and epilogue
			$body = preg_replace('/^(.*?)\r\n--'.$boundary.'\r\n/', "\r\n--{$boundary}\r\n", $body);
			// make the last one look like the rest for easier parsing
			$body = preg_replace('/\r\n--'.$boundary.'--/', "\r\n--{$boundary}\r\n", $body);

			// cut up the message
			$multi_parts = array();
			$multi_parts = explode("\r\n--{$boundary}\r\n", $body);
			// take off anything that happens before the first boundary (the preamble)
			array_shift($multi_parts);
			// take off anything after the last boundary (the epilogue)
			array_pop($multi_parts);

			// go through each part of the multipart message
			foreach ($multi_parts as $part) {
				// default to processing headers
				$on_headers = true;
				$on_body = false;
				$first_body_found = false;
				$this_photo = array();

				// go through the multipart chunk line-by-line
				$body_parts = array();
				$body_parts = explode("\r\n", $part);
				$this_photo['Data'] = "";
				foreach ($body_parts as $line) {
					if (empty($line) && $on_headers == true) {
						// blank line.  switching to processing a body and moving on
						$on_headers = false;
						$on_body = true;
						continue;
					}
					if ($on_headers == true) {
						// non blank line and we're processing headers so save the header
						$header = null;
						$value = null;

						if (strpos($line, ':') !== false) {
							@list($header, $value) = explode(':', $line, 2);
						}

						$header = trim($header);
						$value = trim($value);
						if (!empty($header)) {
							if ($header == "Description") {
								// for servers where the implementors didn't read the next word in the RETS spec.
								// 'Description' is the BNF term. Content-Description is the correct header.
								// fixing for sanity
								$header = "Content-Description";
							}
							// fix case issue if exists
							if ($header == "Content-type") {
								$header = "Content-Type";
							}
							$this_photo[$header] = $value;
						}
					}
					if ($on_body == true) {
						if ($first_body_found == true) {
							// here again because a linebreak in the body section which was cut out in the explode
							// add the CRLF back
							$this_photo['Data'] .= "\r\n";
						}
						// non blank line and we're processing a body so save the line as part of Data
						$first_body_found = true;
						$this_photo['Data'] .= $line;
					}
				}
				// done with parsing out the multipart response
				// check for errors and finish up

				$this_photo['Success'] = true; // assuming for now

				if (strpos($this_photo['Content-Type'], 'xml') !== false) {
					// this multipart might include a RETS error
					$xml = $this->ParseXMLResponse($this_photo['Data']);

					if ($xml['ReplyCode'] == 0 || empty($this_photo['Data'])) {
						// success but no body
						$this_photo['Success'] = true;
					}
					else {
						// RETS error in this multipart section
						$this_photo['Success'] = false;
						$this_photo['ReplyCode'] = "{$xml['ReplyCode']}";
						$this_photo['ReplyText'] = "{$xml['ReplyText']}";
					}
				}

				// add information about this multipart to the returned array
				$return_photos[] = $this_photo;
			}
		}
		else {
			// all we know is that the response wasn't a multipart so it's either a single photo or error
			$this_photo = array();

			$this_photo['Success'] = true; // assuming for now
			if (isset($this->last_response_headers['Content-ID'])) {
				$this_photo['Content-ID'] = $this->last_response_headers['Content-ID'];
			}
			if (isset($this->last_response_headers['Object-ID'])) {
				$this_photo['Object-ID'] = $this->last_response_headers['Object-ID'];
			}
			if (isset($this->last_response_headers['Content-Type'])) {
				$this_photo['Content-Type'] = $this->last_response_headers['Content-Type'];
			}
			if (isset($this->last_response_headers['MIME-Version'])) {
				$this_photo['MIME-Version'] = $this->last_response_headers['MIME-Version'];
			}
			if (isset($this->last_response_headers['Location'])) {
				$this_photo['Location'] = $this->last_response_headers['Location'];
			}
			if (isset($this->last_response_headers['Preferred'])) {
				$this_photo['Preferred'] = $this->last_response_headers['Preferred'];
			}

			if (isset($this->last_response_headers['Description'])) {
				if (!empty($this->last_response_headers['Description'])) {
					// for servers where the implementors didn't read the next word in the RETS spec.
					// 'Description' is the BNF term. Content-Description is the correct header.
					// fixing for sanity
					$this_photo['Content-Description'] = $this->last_response_headers['Description'];
				}
			}
			if (isset($this->last_response_headers['Content-Description'])) {
				$this_photo['Content-Description'] = $this->last_response_headers['Content-Description'];
			}

			$this_photo['Length'] = strlen($body);
			$this_photo['Data'] = $body;

			if (isset($this->last_response_headers['Content-Type'])) {
				if (strpos($this->last_response_headers['Content-Type'], 'xml') !== false) {
					// RETS error maybe?
					$xml = $this->ParseXMLResponse($body);

					if ($xml['ReplyCode'] == 0 || empty($body)) {
						// false alarm.  we're good
						$this_photo['Success'] = true;
					}
					else {
						// yes, RETS error
						$this->last_request['ReplyCode'] = "{$xml['ReplyCode']}";
						$this->last_request['ReplyText'] = "{$xml['ReplyText']}";
						$this_photo['ReplyCode'] = "{$xml['ReplyCode']}";
						$this_photo['ReplyText'] = "{$xml['ReplyText']}";
						$this_photo['Success'] = false;
					}
				}
			}

			// add information about this photo to the returned array
			$return_photos[] = $this_photo;
		}

		// return everything
		return $return_photos;
	}

	public function IsMaxrowsReached($pointer_id = "") {
		if (empty($pointer_id)) {
			$pointer_id = $this->int_result_pointer;
		}
		return $this->search_data[$pointer_id]['maxrows_reached'];
	}

	public function TotalRecordsFound($pointer_id = "") {
		if (empty($pointer_id)) {
			$pointer_id = $this->int_result_pointer;
		}
		return $this->search_data[$pointer_id]['total_records_found'];
	}

	public function NumRows($pointer_id = "") {
		if (empty($pointer_id)) {
			$pointer_id = $this->int_result_pointer;
		}
		return $this->search_data[$pointer_id]['last_search_returned'];
	}

	public function SearchGetFields($pointer_id) {
		if (!empty($pointer_id)) {
			return $this->search_data[$pointer_id]['column_names'];
		}
		else {
			return false;
		}
	}

	public function FreeResult($pointer_id) {
		if (!empty($pointer_id)) {
			unset($this->search_data[$pointer_id]['data']);
			unset($this->search_data[$pointer_id]['delimiter_character']);
			unset($this->search_data[$pointer_id]['column_names']);
			return true;
		}
		else {
			return false;
		}
	}

	public function FetchRow($pointer_id) {

		$this_row = false;

		if (!empty($pointer_id)) {

			if (isset($this->search_data[$pointer_id]['data'])) {
				$field_data = current($this->search_data[$pointer_id]['data']);
				next($this->search_data[$pointer_id]['data']);
			}

			if (!empty($field_data)) {
				$this_row = array();

				// split up DATA row on delimiter found earlier
				$field_data = preg_replace("/^{$this->search_data[$pointer_id]['delimiter_character']}/", "", $field_data);
				$field_data = preg_replace("/{$this->search_data[$pointer_id]['delimiter_character']}\$/", "", $field_data);
				$field_data = explode($this->search_data[$pointer_id]['delimiter_character'], $field_data);

				foreach ($this->search_data[$pointer_id]['column_names'] as $key => $name) {
					// assign each value to it's name retrieved in the COLUMNS earlier
					$this_row[$name] = $field_data[$key];
				}
			}
		}

		return $this_row;

	}

	public function SearchQuery($resource, $class, $query = "", $optional_params = array()) {
		$this->reset_error_info();

		if (empty($resource)) {
			die("Resource parameter is required in SearchQuery() request.");
		}
		if (empty($class)) {
			die("Class parameter is required in SearchQuery() request.");
		}
		if (empty($this->capability_url['Search'])) {
			die("SearchQuery() called but unable to find Search location.  Failed login?\n");
		}

		$this->int_result_pointer++;
		$this->search_data[$this->int_result_pointer]['last_search_returned'] = 0;
		$this->search_data[$this->int_result_pointer]['total_records_found'] = 0;
		$this->search_data[$this->int_result_pointer]['column_names'] = "";
		$this->search_data[$this->int_result_pointer]['delimiter_character'] = "";
		$this->search_data[$this->int_result_pointer]['search_requests'] = 0;

		// setup request arguments
		$search_arguments = array();

		$search_arguments['SearchType'] = $resource;
		$search_arguments['Class'] = $class;

		// due to a lack of forward-thinking, reversing a previous decision
		// check if the query passed is missing the outer parenthesis
		// if so, add them
		if (empty($query)) {
			// do nothing.  http://retsdoc.onconfluence.com/display/rcpcenter/RCP+80+-+Optional+Query
		}
		elseif ($query == "*" || preg_match('/^\((.*)\)$/', $query)) {
			$search_arguments['Query'] = $query;
		}
		else {
			$search_arguments['Query'] = '('.$query.')';
		}

		if (isset($search_arguments['Query'])) {
			$search_arguments['QueryType'] = "DMQL2";
		}

		if (!empty($optional_params['QueryType'])) {
			$search_arguments['QueryType'] = $optional_params['QueryType'];
		}

		// setup additional, optional request arguments
        $search_arguments['Count'] = (!array_key_exists('Count', $optional_params)) ? 1 : $optional_params['Count'];
		$search_arguments['Format'] = empty($optional_params['Format']) ? "COMPACT-DECODED" : $optional_params['Format'];
		$search_arguments['Limit'] = empty($optional_params['Limit']) ? 99999999 : $optional_params['Limit'];

		if (isset($optional_params['Offset'])) {
			$search_arguments['Offset'] = $optional_params['Offset'];
		}
		elseif ($this->offset_support && empty($optional_params['Offset'])) {
			// start auto-offset looping with Offset at 1
			$search_arguments['Offset'] = 1;
		}
		else { }

		if (!empty($optional_params['Select'])) {
			$search_arguments['Select'] = $optional_params['Select'];
		}
		if (!empty($optional_params['RestrictedIndicator'])) {
			$search_arguments['RestrictedIndicator'] = $optional_params['RestrictedIndicator'];
		}

		$search_arguments['StandardNames'] = empty($optional_params['StandardNames']) ? 0 : $optional_params['StandardNames'];

		$continue_searching = true; // Keep searching if MAX ROWS is reached and offset_support is true
		while ($continue_searching) {

			$this->search_data[$this->int_result_pointer]['maxrows_reached'] = false;
			$this->search_data[$this->int_result_pointer]['search_requests']++;

			if ($this->search_data[$this->int_result_pointer]['search_requests'] == 300 && !$this->override_offset_protection) {
				// this call for SearchQuery() has resulted in X number of search requests
				// which is considered excessive.  stopping the process in order to prevent
				// abuse against the server.  almost ALWAYS happens when the user thinks Offset
				// is supported by the server when it's actually NOT supported
				$this->set_error_info("phrets", -1, "Last SearchQuery() has resulted in 300+ requests to the server.  Stopping to prevent abuse");
				return false;
			}

			// make request
			$result = $this->RETSRequest($this->capability_url['Search'], $search_arguments);
			if (!$result) {
				return false;
			}
			list($headers, $body) = $result;

			$body = $this->fix_encoding($body);

			$xml = $this->ParseXMLResponse($body);
			if (!$xml) {
				return false;
			}

			// log replycode and replytext for reference later
			$this->last_request['ReplyCode'] = "{$xml['ReplyCode']}";
			$this->last_request['ReplyText'] = "{$xml['ReplyText']}";

			if ($xml['ReplyCode'] != 0) {
				$this->set_error_info("rets", "{$xml['ReplyCode']}", "{$xml['ReplyText']}");
				return false;
			}

			if (isset($xml->DELIMITER)) {
				// delimiter found so we have at least a COLUMNS row to parse
				$delimiter_character = chr("{$xml->DELIMITER->attributes()->value}");
				$this->search_data[$this->int_result_pointer]['delimiter_character'] = $delimiter_character;
				$column_names = "{$xml->COLUMNS[0]}";
				$column_names = preg_replace("/^{$delimiter_character}/", "", $column_names);
				$column_names = preg_replace("/{$delimiter_character}\$/", "", $column_names);
				$this->search_data[$this->int_result_pointer]['column_names'] = explode($delimiter_character, $column_names);
			}

			if (isset($xml->DATA)) {
				foreach ($xml->DATA as $key) {
					$field_data = "{$key}";
					// split up DATA row on delimiter found earlier
					$this->search_data[$this->int_result_pointer]['data'][] = $field_data;
					$this->search_data[$this->int_result_pointer]['last_search_returned']++;
				}
			}

			if (isset($xml->MAXROWS)) {
				// MAXROWS tag found.  the RETS server withheld records.
				// if the server supports Offset, more requests can be sent to page through results
				// until this tag isn't found anymore.
				$this->search_data[$this->int_result_pointer]['maxrows_reached'] = true;
			}

			if (isset($xml->COUNT)) {
				// found the record count returned.  save it
				$this->search_data[$this->int_result_pointer]['total_records_found'] = "{$xml->COUNT->attributes()->Records}";
			}

			if (isset($xml)) {
				unset($xml);
			}

			if ($this->IsMaxrowsReached($this->int_result_pointer) && $this->offset_support) {
				$continue_searching = true;
				$search_arguments['Offset'] = $this->NumRows($this->int_result_pointer) + 1;
			}
			else {
				$continue_searching = false;
			}
		}

		return $this->int_result_pointer;
	}

	public function Search($resource, $class, $query = "", $optional_params = array()) {
		$data_table = array();

		$int_result_pointer = $this->SearchQuery($resource, $class, $query, $optional_params);

		while ($row = $this->FetchRow($int_result_pointer)) {
			$data_table[] = $row;
		}

		return $data_table;
	}

	public function GetAllLookupValues($resource) {
		$this->reset_error_info();

		if (empty($resource)) {
			die("Resource parameter is required in GetAllLookupValues() request.");
		}
		if (empty($this->capability_url['GetMetadata'])) {
			die("GetAllLookupValues() called but unable to find GetMetadata location.  Failed login?\n");
		}

		// make request
		$result = $this->RETSRequest($this->capability_url['GetMetadata'],
						array(
								'Type' => 'METADATA-LOOKUP_TYPE',
								'ID' => $resource.':*',
								'Format' => 'STANDARD-XML'
								)
						);

		if (!$result) {
			return false;
		}
		list($headers, $body) = $result;

		$xml = $this->ParseXMLResponse($body);
		if (!$xml) {
			return false;
		}

		if ($xml['ReplyCode'] != 0) {
			$this->set_error_info("rets", "{$xml['ReplyCode']}", "{$xml['ReplyText']}");
			return false;
		}

		$this_table = array();

		// parse XML into a nice array
		if ($xml->METADATA && $xml->METADATA->{'METADATA-LOOKUP_TYPE'}) {

			foreach ($xml->METADATA->{'METADATA-LOOKUP_TYPE'} as $key) {
				if (!empty($key->attributes()->Lookup)) {
					$this_lookup = array();

					$lookup_xml_array = array();
					if (!empty($key->LookupType)) {
						$lookup_xml_array = $key->LookupType;
					}
					else {
						$lookup_xml_array = $key->Lookup;
					}

					if (is_object($lookup_xml_array)) {
						foreach ($lookup_xml_array as $look) {
							$metadataentryid = isset($look->MetadataEntryID) ? "{$look->MetadataEntryID}" : "";
							$value = isset($look->Value) ? "{$look->Value}" : "";
							$shortvalue = isset($look->ShortValue) ? "{$look->ShortValue}" : "";
							$longvalue = isset($look->LongValue) ? "{$look->LongValue}" : "";

							$this_lookup[] = array(
									'MetadataEntryID' => $metadataentryid,
									'Value' => $value,
									'ShortValue' => $shortvalue,
									'LongValue' => $longvalue
									);
						}
					}

					$this_table[] = array('Lookup' => "{$key->attributes()->Lookup}", 'Values' => $this_lookup);
				}
			}
		}

		// return the big array
		return $this_table;
	}

	public function GetLookupValues($resource, $lookupname) {
		$this->reset_error_info();

		if (empty($resource)) {
			die("Resource parameter is required in GetLookupValues() request.");
		}
		if (empty($lookupname)) {
			die("Lookup Name parameter is required in GetLookupValues() request.");
		}
		if (empty($this->capability_url['GetMetadata'])) {
			die("GetLookupValues() called but unable to find GetMetadata location.  Failed login?\n");
		}

		// make request
		$result = $this->RETSRequest($this->capability_url['GetMetadata'],
						array(
								'Type' => 'METADATA-LOOKUP_TYPE',
								'ID' => $resource.':'.$lookupname,
								'Format' => 'STANDARD-XML'
								)
						);

		if (!$result) {
			return false;
		}
		list($headers, $body) = $result;

		$xml = $this->ParseXMLResponse($body);
		if (!$xml) {
			return false;
		}

		if ($xml['ReplyCode'] != 0) {
			$this->set_error_info("rets", "{$xml['ReplyCode']}", "{$xml['ReplyText']}");
			return false;
		}

		$this_table = array();

		// parse XML into a nice array
		if ($xml->METADATA && $xml->METADATA->{'METADATA-LOOKUP_TYPE'}) {

			$lookup_xml_array = array();
			if (!empty($xml->METADATA->{'METADATA-LOOKUP_TYPE'}->LookupType)) {
				$lookup_xml_array = $xml->METADATA->{'METADATA-LOOKUP_TYPE'}->LookupType;
			}
			else {
				$lookup_xml_array = $xml->METADATA->{'METADATA-LOOKUP_TYPE'}->Lookup;
			}

			if (is_object($lookup_xml_array)) {
				foreach ($lookup_xml_array as $key) {
					if (isset($key->Value)) {
						$metadataentryid = isset($key->MetadataEntryID) ? "{$key->MetadataEntryID}" : "";
						$value = isset($key->Value) ? "{$key->Value}" : "";
						$shortvalue = isset($key->ShortValue) ? "{$key->ShortValue}" : "";
						$longvalue = isset($key->LongValue) ? "{$key->LongValue}" : "";

						$this_table[] = array(
								'MetadataEntryID' => $metadataentryid,
								'Value' => $value,
								'ShortValue' => $shortvalue,
								'LongValue' => $longvalue
								);
					}
				}
			}
		}

		// return the big array
		return $this_table;
	}

	public function GetMetadataResources($id = 0) {
		$this->reset_error_info();

		if (empty($this->capability_url['GetMetadata'])) {
			die("GetMetadataResources() called but unable to find GetMetadata location.  Failed login?\n");
		}

		// make request
		$result = $this->RETSRequest($this->capability_url['GetMetadata'],
						array(
								'Type' => 'METADATA-RESOURCE',
								'ID' => $id,
								'Format' => 'STANDARD-XML'
								)
						);

		if (!$result) {
			return false;
		}
		list($headers, $body) = $result;

		$xml = $this->ParseXMLResponse($body);
		if (!$xml) {
			return false;
		}

		if ($xml['ReplyCode'] != 0) {
			$this->set_error_info("rets", "{$xml['ReplyCode']}", "{$xml['ReplyText']}");
			return false;
		}

		$this_resource = array();

		// parse XML into a nice array
		if ($xml->METADATA) {
			foreach ($xml->METADATA->{'METADATA-RESOURCE'}->Resource as $key => $value) {
				$this_resource["{$value->ResourceID}"] = array(
						'ResourceID' => "{$value->ResourceID}",
						'StandardName'=>"{$value->StandardName}",
						'VisibleName' => "{$value->VisibleName}",
						'Description' => "{$value->Description}",
						'KeyField' => "{$value->KeyField}",
						'ClassCount' => "{$value->ClassCount}",
						'ClassVersion' => "{$value->ClassVersion}",
						'ClassDate' => "{$value->ClassDate}",
						'ObjectVersion' => "{$value->ObjectVersion}",
						'ObjectDate' => "{$value->ObjectDate}",
						'SearchHelpVersion' => "{$value->SearchHelpVersion}",
						'SearchHelpDate' => "{$value->SearchHelpDate}",
						'EditMaskVersion' => "{$value->EditMaskVersion}",
						'EditMaskDate' => "{$value->EditMaskDate}",
						'LookupVersion' => "{$value->LookupVersion}",
						'LookupDate' => "{$value->LookupDate}",
						'UpdateHelpVersion' => "{$value->UpdateHelpVersion}",
						'UpdateHelpDate' => "{$value->UpdateHelpDate}",
						'ValidationExpressionVersion' => "{$value->ValidationExpressionVersion}",
						'ValidationExpressionDate' => "{$value->ValidationExpressionDate}",
						'ValidationLookupVersion' => "{$value->ValidationLookupVersion}",
						'ValidationLookupDate' => "{$value->ValidationLookupDate}",
						'ValidationExternalVersion' => "{$value->ValidationExternalVersion}",
						'ValidationExternalDate' => "{$value->ValidationExternalDate}"
						);
			}
		}

		// send back array
		return $this_resource;
	}

	public function GetMetadataInfo($id = 0) {
		if (empty($this->capability_url['GetMetadata'])) {
			die("GetMetadataInfo() called but unable to find GetMetadata location.  Failed login?\n");
		}
		return $this->GetMetadataResources($id);
	}

	public function GetMetadataTable($resource, $class) {
		$this->reset_error_info();

		$id = $resource.':'.$class;
		if (empty($resource)) {
			die("Resource parameter is required in GetMetadata() request.");
		}
		if (empty($class)) {
			die("Class parameter is required in GetMetadata() request.");
		}
		if (empty($this->capability_url['GetMetadata'])) {
			die("GetMetadataTable() called but unable to find GetMetadata location.  Failed login?\n");
		}

		// request specific metadata
		$result = $this->RETSRequest($this->capability_url['GetMetadata'],
						array(
								'Type' => 'METADATA-TABLE',
								'ID' => $id,
								'Format' => 'STANDARD-XML'
								)
						);

		if (!$result) {
			return false;
		}
		list($headers, $body) = $result;

		$xml = $this->ParseXMLResponse($body);
		if (!$xml) {
			return false;
		}

		// log replycode and replytext for reference later
		$this->last_request['ReplyCode'] = "{$xml['ReplyCode']}";
		$this->last_request['ReplyText'] = "{$xml['ReplyText']}";

		if ($xml['ReplyCode'] != 0) {
			$this->set_error_info("rets", "{$xml['ReplyCode']}", "{$xml['ReplyText']}");
			return false;
		}

		$this_table = array();

		// parse XML into a nice array
		if ($xml->METADATA) {
			foreach ($xml->METADATA->{'METADATA-TABLE'}->Field as $key) {
				$this_table[] = array(
						'SystemName' => "{$key->SystemName}",
						'StandardName' => "{$key->StandardName}",
						'LongName' => "{$key->LongName}",
						'DBName' => "{$key->DBName}",
						'ShortName' => "{$key->ShortName}",
						'MaximumLength' => "{$key->MaximumLength}",
						'DataType' => "{$key->DataType}",
						'Precision' => "{$key->Precision}",
						'Searchable' => "{$key->Searchable}",
						'Interpretation' => "{$key->Interpretation}",
						'Alignment' => "{$key->Alignment}",
						'UseSeparator' => "{$key->UseSeparator}",
						'EditMaskID' => "{$key->EditMaskID}",
						'LookupName' => "{$key->LookupName}",
						'MaxSelect' => "{$key->MaxSelect}",
						'Units' => "{$key->Units}",
						'Index' => "{$key->Index}",
						'Minimum' => "{$key->Minimum}",
						'Maximum' => "{$key->Maximum}",
						'Default' => "{$key->Default}",
						'Required' => "{$key->Required}",
						'SearchHelpID' => "{$key->SearchHelpID}",
						'Unique' => "{$key->Unique}",
						'MetadataEntryID' => "{$key->MetadataEntryID}",
						'ModTimeStamp' => "{$key->ModTimeStamp}",
						'ForeignKeyName' => "{$key->ForiengKeyName}",
						'ForeignField' => "{$key->ForeignField}",
						'InKeyIndex' => "{$key->InKeyIndex}"
						);
			}
		}

		// return the big array
		return $this_table;
	}

	public function GetMetadata($resource, $class) {
		if (empty($this->capability_url['GetMetadata'])) {
			die("GetMetadata() called but unable to find GetMetadata location.  Failed login?\n");
		}
		return $this->GetMetadataTable($resource, $class);
	}

	public function GetMetadataObjects($id) {
		$this->reset_error_info();

		if (empty($id)) {
			die("ID parameter is required in GetMetadataObjects() request.");
		}
		if (empty($this->capability_url['GetMetadata'])) {
			die("GetMetadataObjects() called but unable to find GetMetadata location.  Failed login?\n");
		}

		// request basic metadata information
		$result = $this->RETSRequest($this->capability_url['GetMetadata'],
						array(
								'Type' => 'METADATA-OBJECT',
								'ID' => $id,
								'Format' => 'STANDARD-XML'
								)
						);

		if (!$result) {
			return false;
		}
		list($headers, $body) = $result;

		$xml = $this->ParseXMLResponse($body);
		if (!$xml) {
			return false;
		}

		// log replycode and replytext for reference later
		$this->last_request['ReplyCode'] = "{$xml['ReplyCode']}";
		$this->last_request['ReplyText'] = "{$xml['ReplyText']}";

		if ($xml['ReplyCode'] != 0) {
			$this->set_error_info("rets", "{$xml['ReplyCode']}", "{$xml['ReplyText']}");
			return false;
		}

		$return_data = array();

		if (isset($xml->METADATA->{'METADATA-OBJECT'})) {
			// parse XML into a nice array
			foreach ($xml->METADATA->{'METADATA-OBJECT'} as $key => $value) {
				foreach ($value->Object as $key) {
					if (!empty($key->ObjectType)) {
						$return_data[] = array(
								'MetadataEntryID' => "{$key->MetadataEntryID}",
								'VisibleName' => "{$key->VisibleName}",
								'ObjectTimeStamp' => "{$key->ObjectTimeStamp}",
								'ObjectCount' => "{$key->ObjectCount}",
								'ObjectType' => "{$key->ObjectType}",
								'StandardName' => "{$key->StandardName}",
								'MimeType' => "{$key->MimeType}",
								'Description' => "{$key->Description}"
								);
					}
				}
			}
		}

		// send back array
		return $return_data;
	}

	public function GetMetadataClasses($id) {
		$this->reset_error_info();

		if (empty($id)) {
			die("ID parameter is required in GetMetadataClasses() request.");
		}
		if (empty($this->capability_url['GetMetadata'])) {
			die("GetMetadataClasses() called but unable to find GetMetadata location.  Failed login?\n");
		}

		// request basic metadata information
		$result = $this->RETSRequest($this->capability_url['GetMetadata'],
						array(
								'Type' => 'METADATA-CLASS',
								'ID' => $id,
								'Format' => 'STANDARD-XML'
								)
						);

		if (!$result) {
			return false;
		}
		list($headers, $body) = $result;

		$xml = $this->ParseXMLResponse($body);
		if (!$xml) {
			return false;
		}

		// log replycode and replytext for reference later
		$this->last_request['ReplyCode'] = "{$xml['ReplyCode']}";
		$this->last_request['ReplyText'] = "{$xml['ReplyText']}";

		if ($xml['ReplyCode'] != 0) {
			$this->set_error_info("rets", "{$xml['ReplyCode']}", "{$xml['ReplyText']}");
			return false;
		}

		$return_data = array();

		// parse XML into a nice array
		if ($xml->METADATA) {
			foreach ($xml->METADATA->{'METADATA-CLASS'} as $key => $value) {
				foreach ($value->Class as $key) {
					if (!empty($key->ClassName)) {
						$return_data[] = array(
								'ClassName' => "{$key->ClassName}",
								'VisibleName' => "{$key->VisibleName}",
								'StandardName' => "{$key->StandardName}",
								'Description' => "{$key->Description}",
								'TableVersion' => "{$key->TableVersion}",
								'TableDate' => "{$key->TableDate}",
								'UpdateVersion' => "{$key->UpdateVersion}",
								'UpdateDate' => "{$key->UpdateDate}",
								'ClassTimeStamp' => "{$key->ClassTimeStamp}",
								'DeletedFlagField' => "{$key->DeletedFlagField}",
								'DeletedFlagValue' => "{$key->DeletedFlagValue}",
								'HasKeyIndex' => "{$key->HasKeyIndex}"
								);
					}
				}
			}
		}

		// send back array
		return $return_data;
	}

	public function GetMetadataTypes($id = 0) {
		$this->reset_error_info();

		if (empty($this->capability_url['GetMetadata'])) {
			die("GetMetadataTypes() called but unable to find GetMetadata location.  Failed login?\n");
		}

		// request basic metadata information
		$result = $this->RETSRequest($this->capability_url['GetMetadata'],
						array(
								'Type' => 'METADATA-CLASS',
								'ID' => $id,
								'Format' => 'STANDARD-XML'
								)
						);

		if (!$result) {
			return false;
		}
		list($headers, $body) = $result;
		$xml = $this->ParseXMLResponse($body);
		if (!$xml) {
			return false;
		}

		// log replycode and replytext for reference later
		$this->last_request['ReplyCode'] = "{$xml['ReplyCode']}";
		$this->last_request['ReplyText'] = "{$xml['ReplyText']}";

		if ($xml['ReplyCode'] != 0) {
			$this->set_error_info("rets", "{$xml['ReplyCode']}", "{$xml['ReplyText']}");
			return false;
		}

		$return_data = array();

		// parse XML into a nice array
		if ($xml->METADATA) {
			foreach ($xml->METADATA->{'METADATA-CLASS'} as $key => $value) {
				$resource = $value['Resource'];
				$this_resource = array();
				foreach ($value->Class as $key) {
					if (!empty($key->ClassName)) {
						$this_resource[] = array(
								'ClassName' => "{$key->ClassName}",
								'VisibleName' => "{$key->VisibleName}",
								'StandardName' => "{$key->StandardName}",
								'Description' => "{$key->Description}",
								'TableVersion' => "{$key->TableVersion}",
								'TableDate' => "{$key->TableDate}",
								'UpdateVersion' => "{$key->UpdateVersion}",
								'UpdateDate' => "{$key->UpdateDate}"
								);
					}
				}

				// prepare 2-deep array
				$return_data[] = array('Resource' => "{$resource}", 'Data' => $this_resource);
			}
		}

		// send back array
		return $return_data;
	}

	public function GetServerSoftware() {
		return $this->server_software;
	}

	public function GetServerVersion() {
		return $this->server_version;
	}

	public function CheckAuthSupport($type = "") {
		if ($type == "basic") {
			return $this->auth_support_basic;
		}
		if ($type == "digest") {
			return $this->auth_support_digest;
		}
		$this->set_error_info("phrets", -1, "Unknown auth type requested.");
		return false;
	}

	public function GetAllTransactions() {
		// read through capability_urls read during the Login and return
		$transactions = array();
		if (is_array($this->capability_url)) {
			foreach ($this->capability_url as $key => $value) {
				$transactions[] = $key;
			}
		}
		return $transactions;
	}

	public function LastRequestURL() {
		return $this->last_request_url;
	}

	public function GetLoginURL() {
		// see if the saved Login URL has a hostname included.
		// if not, make it based on the URL given in the Connect() call
		$parse_results = parse_url($this->capability_url['Login'], PHP_URL_HOST);
		if (empty($parse_results)) {
			// login transaction gave a relative path for this action
			$request_url = $this->server_protocol.'://'.$this->server_hostname.':'.$this->server_port.''.$this->capability_url['Login'];
		}
		else {
			// login transaction gave an absolute path for this action
			$request_url = $this->capability_url['Login'];
		}
		if (empty($request_url)) {
			$this->set_error_info("phrets", -1, "Unable to find a login URL.  Did initial login fail?");
			return false;
		}
		return $request_url;
	}

	public function GetServerInformation() {
		$this->reset_error_info();

		if (empty($this->capability_url['GetMetadata'])) {
			die("GetServerInformation() called but unable to find GetMetadata location.  Failed login?\n");
		}

		// request server information
		$result = $this->RETSRequest($this->capability_url['GetMetadata'],
						array(
								'Type' => 'METADATA-SYSTEM',
								'ID' => 0,
								'Format' => 'STANDARD-XML'
								)
						);

		if (!$result) {
			return false;
		}
		list($headers, $body) = $result;

		$xml = $this->ParseXMLResponse($body);
		if (!$xml) {
			return false;
		}

		if ($xml['ReplyCode'] != 0) {
			$this->set_error_info("rets", "{$xml['ReplyCode']}", "{$xml['ReplyText']}");
			return false;
		}

		$system_id = "";
		$system_description = "";
		$system_comments = "";
		$system_version = "";
        $timezone_offset = "";

		if ($this->is_server_version("1_5_or_below")) {
			if (isset($xml->METADATA->{'METADATA-SYSTEM'}->System->SystemID)) {
				$system_id = "{$xml->METADATA->{'METADATA-SYSTEM'}->System->SystemID}";
			}
			if (isset($xml->METADATA->{'METADATA-SYSTEM'}->System->SystemDescription)) {
				$system_description = "{$xml->METADATA->{'METADATA-SYSTEM'}->System->SystemDescription}";
			}
		}
		else {
			if (isset($xml->METADATA->{'METADATA-SYSTEM'}->SYSTEM->attributes()->SystemID)) {
				$system_id = "{$xml->METADATA->{'METADATA-SYSTEM'}->SYSTEM->attributes()->SystemID}";
			}
			if (isset($xml->METADATA->{'METADATA-SYSTEM'}->SYSTEM->attributes()->SystemDescription)) {
				$system_description = "{$xml->METADATA->{'METADATA-SYSTEM'}->SYSTEM->attributes()->SystemDescription}";
			}
			if (isset($xml->METADATA->{'METADATA-SYSTEM'}->SYSTEM->attributes()->TimeZoneOffset)) {
				$timezone_offset = "{$xml->METADATA->{'METADATA-SYSTEM'}->SYSTEM->attributes()->TimeZoneOffset}";
			}
		}

		if (isset($xml->METADATA->{'METADATA-SYSTEM'}->SYSTEM->Comments)) {
			$system_comments = "{$xml->METADATA->{'METADATA-SYSTEM'}->SYSTEM->Comments}";
		}
		if (isset($xml->METADATA->{'METADATA-SYSTEM'}->attributes()->Version)) {
			$system_version = (string) $xml->METADATA->{'METADATA-SYSTEM'}->attributes()->Version;
		}

		return array(
				'SystemID' => $system_id,
				'SystemDescription' => $system_description,
				'TimeZoneOffset' => $timezone_offset,
				'Comments' => $system_comments,
				'Version' => $system_version
				);
	}

	public function Disconnect() {
		$this->reset_error_info();

		if (empty($this->capability_url['Logout'])) {
			die("Disconnect() called but unable to find Logout location.  Failed login?\n");
		}

		// make request
		$result = $this->RETSRequest($this->capability_url['Logout']);
		if (!$result) {
			return false;
		}
		list($headers,$body) = $result;

		// close cURL connection
		curl_close($this->ch);

		if ($this->debug_mode == true) {
			// close cURL debug log file handler
			fclose($this->debug_log);
		}

		if (file_exists($this->cookie_file)) {
			@unlink($this->cookie_file);
		}

		return true;

	}

	public function Connect($login_url, $username, $password, $ua_pwd = "") {
		$this->reset_error_info();

		if (empty($login_url)) {
			die("PHRETS: Login URL missing from Connect()");
		}
		if (empty($username)) {
			die("PHRETS: Username missing from Connect()");
		}
		if (empty($password)) {
			die("PHRETS: Password missing from Connect()");
		}
		if (empty($this->static_headers['RETS-Version'])) {
			$this->AddHeader("RETS-Version", "RETS/1.5");
		}
		if (empty($this->static_headers['User-Agent'])) {
			$this->AddHeader("User-Agent", "PHRETS/1.0");
		}
		if (empty($this->static_headers['Accept']) && $this->static_headers['RETS-Version'] == "RETS/1.5") {
			$this->AddHeader("Accept", "*/*");
		}

		// chop up Login URL to use for later requests
		$url_parts = parse_url($login_url);
		$this->server_hostname = $url_parts['host'];
		$this->server_port = (empty($url_parts['port'])) ? 80 : $url_parts['port'];
		$this->server_protocol = $url_parts['scheme'];

		$this->capability_url['Login'] = $url_parts['path'];

		if (isset($url_parts['query']) && !empty($url_parts['query'])) {
			$this->capability_url['Login'] .= "?{$url_parts['query']}";
		}

		$this->username = $username;
		$this->password = $password;

		if (!empty($ua_pwd)) {
			// force use of RETS 1.7 User-Agent Authentication
			$this->ua_auth = true;
			$this->ua_pwd = $ua_pwd;
		}

		if (empty($this->cookie_file)) {
			$this->cookie_file = tempnam("", "phrets");
		}

		@touch($this->cookie_file);

		if (!is_writable($this->cookie_file)) {
			$this->set_error_info("phrets", -1, "Cookie file \"{$this->cookie_file}\" cannot be written to.  Must be an absolute path and must be writable");
			return false;
		}

		// start cURL magic
		$this->ch = curl_init();
		curl_setopt($this->ch, CURLOPT_HEADERFUNCTION, array(&$this, 'read_custom_curl_headers'));
		if ($this->debug_mode == true) {
			// open file handler to be used by cURL debug log
			$this->debug_log = @fopen($this->debug_file, 'a');

			if ($this->debug_log) {
				curl_setopt($this->ch, CURLOPT_VERBOSE, 1);
				curl_setopt($this->ch, CURLOPT_STDERR, $this->debug_log);
			}
			else {
				echo "Unable to save debug log to {$this->debug_file}\n";
			}
		}
		curl_setopt($this->ch, CURLOPT_HEADER, false);
		if ($this->force_basic_authentication == true) {
			curl_setopt($this->ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
		}
		else {
			curl_setopt($this->ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST|CURLAUTH_BASIC);
		}
		if ($this->disable_follow_location != true) {
			curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, 1);
		}
		curl_setopt($this->ch, CURLOPT_USERPWD, $this->username.":".$this->password);
		curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
		curl_setopt($this->ch, CURLOPT_COOKIEFILE, $this->cookie_file);
		curl_setopt($this->ch, CURLOPT_TIMEOUT, 0);
		curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, false);

		// make request to Login transaction
		$result =  $this->RETSRequest($this->capability_url['Login']);
		if (!$result) {
			return false;
		}

		list($headers,$body) = $result;

		// parse body response
		$xml = $this->ParseXMLResponse($body);
		if (!$xml) {
			return false;
		}

		// log replycode and replytext for reference later
		$this->last_request['ReplyCode'] = "{$xml['ReplyCode']}";
		$this->last_request['ReplyText'] = "{$xml['ReplyText']}";

		// chop up login response
		// if multiple parts of the login response aren't found splitting on \r\n, redo using just \n
		$login_response = array();

		if ($this->server_version == "RETS/1.0") {
			if (isset($xml)) {
				$login_response = explode("\r\n", $xml);
				if (empty($login_response[3])) {
					$login_response = explode("\n", $xml);
				}
			}
		}
		else {
			if (isset($xml->{'RETS-RESPONSE'})) {
				$login_response = explode("\r\n", $xml->{'RETS-RESPONSE'});
				if (empty($login_response[3])) {
					$login_response = explode("\n", $xml->{'RETS-RESPONSE'});
				}
			}
		}

		// parse login response.  grab all capability URLs known and ones that begin with X-
		// otherwise, it's a piece of server information to save for reference
		foreach ($login_response as $line) {
			$name = null;
			$value = null;

			if (strpos($line, '=') !== false) {
			@list($name,$value) = explode("=", $line, 2);
			}

			$name = trim($name);
			$value = trim($value);
			if (!empty($name) && !empty($value)) {
				if (isset($this->allowed_capabilities[$name]) || preg_match('/^X\-/', $name) == true) {
					$this->capability_url[$name] = $value;
				}
				else {
					$this->server_information[$name] = $value;
				}
			}
		}

		// if 'Action' capability URL is provided, we MUST request it following the successful Login
		if (isset($this->capability_url['Action']) && !empty($this->capability_url['Action'])) {
			$result = $this->RETSRequest($this->capability_url['Action']);
			if (!$result) {
				return false;
			}
			list($headers,$body) = $result;
		}

		if ($this->compression_enabled == true) {
			curl_setopt($this->ch, CURLOPT_ENCODING, "gzip");
		}

		if ($this->last_request['ReplyCode'] == 0) {
			return true;
		}
		else {
			$this->set_error_info("rets", $this->last_request['ReplyCode'], $this->last_request['ReplyText']);
			return false;
		}

	}

	public function LastRequest() {
		// return replycode and replytext from last request
		return $this->last_request;
	}

	public function AddHeader($name, $value) {
		// add static header for cURL requests
		$this->static_headers[$name] = $value;
		return true;
	}

	public function DeleteHeader($name) {
		// delete static header from cURL requests
		unset($this->static_headers[$name]);
		return true;
	}

	public function ParseXMLResponse($data = "") {
		$this->reset_error_info();

		if (!empty($data)) {
			// parse XML function.  ability to replace SimpleXML with something later fairly easily
			if (defined('LIBXML_PARSEHUGE')) {
				$xml = @simplexml_load_string($data, 'SimpleXMLElement', LIBXML_PARSEHUGE);
			} else {
				$xml = @simplexml_load_string($data);
			}
			if (!is_object($xml)) {
				$this->set_error_info("xml", -1, "XML parsing error: {$data}");
				return false;
			}
			return $xml;
		}
		else {
			$this->set_error_info("xml", -1, "XML parsing error.  No data to parse");
			return false;
		}
	}

	public function RETSRequest($action, $parameters = "") {
		$this->reset_error_info();

		$this->last_request = array();
		$this->last_response_headers = array();
		$this->last_response_headers_raw = "";
		$this->last_remembered_header = "";

		// exposed raw RETS request function.  used internally and externally

		if (empty($action)) {
			die("RETSRequest called but Action passed has no value.  Failed login?\n");
		}

		$parse_results = parse_url($action, PHP_URL_HOST);
		if (empty($parse_results)) {
			// login transaction gave a relative path for this action
			$request_url = $this->server_protocol.'://'.$this->server_hostname.':'.$this->server_port.''.$action;
		}
		else {
			// login transaction gave an absolute path for this action
			$request_url = $action;
		}

		// build query string from arguments
		$request_arguments = "";
		if (is_array($parameters)) {
			$request_arguments = http_build_query($parameters, '', '&');
		}

		// build entire URL if needed
		if (!empty($request_arguments)) {
			$request_url = $request_url .'?'. $request_arguments;
		}

		// build headers to pass in cURL
		$request_headers = "";
		if (is_array($this->static_headers)) {
			foreach ($this->static_headers as $key => $value) {
				$request_headers .= "{$key}: {$value}\r\n";
			}
		}

		if ($this->ua_auth == true) {
			$session_id_to_calculate_with = "";

			// calculate RETS-UA-Authorization header
			$ua_a1 = md5($this->static_headers['User-Agent'] .':'. $this->ua_pwd);
			$session_id_to_calculate_with = ($this->use_interealty_ua_auth == true) ? "" : $this->session_id;
			$ua_dig_resp = md5(trim($ua_a1) .':'. trim($this->request_id) .':'. trim($session_id_to_calculate_with) .':'. trim($this->static_headers['RETS-Version']));
			$request_headers .= "RETS-UA-Authorization: Digest {$ua_dig_resp}\r\n";
		}

		$this->last_request_url = $request_url;
		curl_setopt($this->ch, CURLOPT_URL, $request_url);

		curl_setopt($this->ch, CURLOPT_HTTPHEADER, array(trim($request_headers)));
		// do it
		$response_body = curl_exec($this->ch);
		$response_code = curl_getinfo($this->ch, CURLINFO_HTTP_CODE);

		if ($this->debug_mode == true) {
			fwrite($this->debug_log, $response_body ."\n");
		}

		if ($this->catch_last_response == true) {
			$this->last_server_response = $this->last_response_headers_raw . $response_body;
		}

		if (isset($this->last_response_headers['WWW-Authenticate'])) {
			if (strpos($this->last_response_headers['WWW-Authenticate'], 'Basic') !== false) {
				$this->auth_support_basic = true;
			}
			if (strpos($this->last_response_headers['WWW-Authenticate'], 'Digest') !== false) {
				$this->auth_support_digest = true;
			}
		}

		if (isset($this->last_response_headers['RETS-Version'])) {
			$this->server_version = $this->last_response_headers['RETS-Version'];
		}

		if (isset($this->last_response_headers['Server'])) {
			$this->server_software = $this->last_response_headers['Server'];
		}

		if (isset($this->last_response_headers['Set-Cookie'])) {
			if (preg_match('/RETS-Session-ID\=(.*?)(\;|\s+|$)/', $this->last_response_headers['Set-Cookie'], $matches)) {
				$this->session_id = $matches[1];
			}
		}

		if ($response_code != 200) {
			$this->set_error_info("http", $response_code, $response_body);
			return false;
		}

		// return raw headers and body
		return array($this->last_response_headers_raw, $response_body);
	}

	private function read_custom_curl_headers($handle, $call_string) {
		$this->last_response_headers_raw .= $call_string;
		$header = null;
		$value = null;

		$trimmed_call_string = trim($call_string);

		if (strpos($call_string, ':') !== false) {
			@list($header, $value) = explode(':', $trimmed_call_string, 2);
		}

		$header = trim($header);
		$value = trim($value);

		if ( preg_match('/^HTTP\/1/', $trimmed_call_string) ) {
			$value = $trimmed_call_string;
			$header = "HTTP";
		}

		if (!empty($header)) {
			// new header
			$this->last_response_headers[$header] = $value;
			$last_remembered_header = $header;
		}
		elseif (!empty( $trimmed_call_string )) {
			// continuation of last header.  append to previous
			$this->last_response_headers[$this->last_remembered_header] .= $trimmed_call_string;
		}
		else { }

		return strlen($call_string);
	}

	public function Error() {
		if (isset($this->error_info['type']) && !empty($this->error_info['type'])) {
			return $this->error_info;
		}
		else {
			return false;
		}
	}

	private function set_error_info($type, $code, $text) {
		$this->error_info['type'] = $type;
		$this->error_info['code'] = $code;
		$this->error_info['text'] = $text;
		return true;
	}

	private function reset_error_info() {
		$this->error_info['type'] = "";
		$this->error_info['code'] = "";
		$this->error_info['text'] = "";
		return true;
	}

	private function is_server_version($check_version) {
		if ($check_version == "1_5_or_below") {
			if ($this->GetServerVersion() == "RETS/1.5" || $this->GetServerVersion() == "RETS/1.0") {
				return true;
			}
			else {
				return false;
			}
		}
		if ($check_version == "1_7_or_higher") {
			if ($this->GetServerVersion() == "RETS/1.7" || $this->GetServerVersion() == "RETS/1.7.1" || $this->GetServerVersion() == "RETS/1.7.2" || $this->GetServerVersion() == "RETS/1.8") {
				return true;
			}
			else {
				return false;
			}
		}
		return false;
	}

	private function fix_encoding($in_str) {
		if ($this->disable_encoding_fix == true || !function_exists("mb_detect_encoding")) {
			return $in_str;
		}

		$in_str = preg_replace('/\&\s/', '& ', $in_str);
		$cur_encoding = mb_detect_encoding($in_str);
		if ($cur_encoding == "UTF-8" && mb_check_encoding($in_str, "UTF-8")) {
			return $in_str;
		}
		else {
			return utf8_encode($in_str);
		}
	}

	public function ServerDetail($detail) {
		if (isset($this->server_information[$detail])) {
			return $this->server_information[$detail];
		}
		else {
			return "";
		}
	}

	public function SetParam($name, $value) {
		switch ($name) {
			case "cookie_file":
				$this->cookie_file = $value;
				break;
			case "debug_file":
				$this->debug_file = $value;
				break;
			case "debug_mode":
				$this->debug_mode = $value;
				break;
			case "compression_enabled":
				$this->compression_enabled = $value;
				break;
			case "force_ua_authentication":
				$this->ua_auth = $value;
				break;
			case "disable_follow_location":
				$this->disable_follow_location = $value;
				break;
			case "force_basic_authentication":
				$this->force_basic_authentication = $value;
				break;
			case "use_interealty_ua_auth":
				$this->use_interealty_ua_auth = $value;
				break;
			case "catch_last_response":
				$this->catch_last_response = $value;
				break;
			case "disable_encoding_fix":
				$this->disable_encoding_fix = $value;
				break;
			case "offset_support":
				$this->offset_support = $value;
				break;
			case "override_offset_protection":
				$this->override_offset_protection = $value;
				break;
			default:
				return false;
		}

		return true;
	}

}


text:
'''
Created on Nov 9, 2011

@author: ppa
'''
from analyzerdam.baseDAM import BaseDAM
from analyzerdam.yahooFinance import YahooFinance

import logging
LOG = logging.getLogger()

class YahooDAM(BaseDAM):
    ''' Yahoo DAM '''

    def __init__(self):
        ''' constructor '''
        super(YahooDAM, self).__init__()
        self.__yf = YahooFinance()

    def readQuotes(self, start, end):
        ''' read quotes from Yahoo Financial'''
        if self.symbol is None:
            LOG.debug('Symbol is None')
            return []

        return self.__yf.getQuotes(self.symbol, start, end)


text:
"""Provide a full-screen UI."""

import contextlib

import cv2

import mel.lib.common
import mel.lib.image
import mel.lib.ui

_PYGAME_HAD_EXCLUSIVE_INIT = False

def yield_frames_keys(video_capture, display, error_key):
    # Import pygame as late as possible, to avoid displaying its
    # startup-text where it is not actually used.
    import pygame

    # Occasionally it seems that .read() will return False when things are
    # otherwise OK, and we can continue afterwards. This doesn't happen often,
    # so we don't need to retry much. We also probably don't want to retry
    # indefinitely, freezing the program.
    retries = 5

    while True:
        ret, frame = video_capture.read()
        while not ret:
            if retries:
                print("WARNING: Could not read video frame, will retry.")
                ret, frame = video_capture.read()
                retries -= 1
            else:
                raise Exception("Could not read video frame.")

        keys = []
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                return
            if event.type == pygame.KEYDOWN:
                keys.append(event.key)

        display.update_screen_if_needed()

        if keys:
            for key in keys:
                if key == error_key:
                    raise mel.lib.ui.AbortKeyInterruptError()
                else:
                    yield frame, key
        else:
            yield frame, None

def yield_events_until_quit(
    display, *, quit_key=None, quit_func=None, error_key=None
):
    # Import pygame as late as possible, to avoid displaying its
    # startup-text where it is not actually used.
    import pygame

    if quit_key is None:
        quit_key = pygame.K_q

    display.update_screen_if_needed()

    while True:
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                return
            if event.type == pygame.KEYDOWN:
                if event.key == quit_key:
                    return
                elif error_key is not None and event.key == error_key:
                    raise mel.lib.ui.AbortKeyInterruptError()
            yield event
            display.update_screen_if_needed()

        if quit_func is not None and quit_func():
            return

@contextlib.contextmanager
def fullscreen_context():
    """Initialise and return a fullscreen surface for drawing onto.

    Shutdown the underlying `pygame` library when the context expires.

    Only one context can exist per run of the application. Once `pygame` has
    been shutdown then it cannot be initialised again.
    """
    # Import pygame as late as possible, to avoid displaying its
    # startup-text where it is not actually used.
    import pygame

    global _PYGAME_HAD_EXCLUSIVE_INIT
    if _PYGAME_HAD_EXCLUSIVE_INIT:
        raise Exception(
            "An exclusive context was already started, only 1 per run."
        )
    _PYGAME_HAD_EXCLUSIVE_INIT = True

    pygame.init()
    pygame.display.set_caption("mel")
    surface = pygame.display.set_mode([0, 0], pygame.FULLSCREEN)
    try:
        yield Display(surface)
    finally:
        pygame.quit()

class Display:
    """Display an opencv image, centered in a surface."""

    def __init__(self, surface):
        # Import pygame as late as possible, to avoid displaying its
        # startup-text where it is not actually used.
        import pygame

        self._pygame = pygame
        self.surface = surface
        self.width = surface.get_width()
        self.height = surface.get_height()
        self.surface.fill((0, 0, 0))
        self._title = None
        self.is_dirty = True

    def show_opencv_image(self, image):
        image = mel.lib.image.letterbox(image, self.width, self.height)
        image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
        image = image.swapaxes(0, 1)
        image = self._pygame.surfarray.make_surface(image)
        self.surface.blit(image, [0, 0])
        self.is_dirty = True

    def update_screen_if_needed(self):
        # Import pygame as late as possible, to avoid displaying its
        # startup-text where it is not actually used.
        import pygame

        if self.is_dirty:
            pygame.display.update()
        self.is_dirty = False

class LeftRightDisplay:
    """Display images in a window, supply controls for navigating."""

    def __init__(self, screen, image_list):
        if not image_list:
            raise ValueError(
                "image_list must be a list with at least one image."
            )

        self.display = screen
        self.image_path = None
        self._image_list = image_list
        self._index = 0
        self.show()

    def next_image(self):
        if self._image_list:
            self._index = (self._index + 1) % len(self._image_list)
        self.show()

    def prev_image(self):
        if self._image_list:
            num_images = len(self._image_list)
            self._index = (self._index + num_images - 1) % len(
                self._image_list
            )
        self.show()

    def _get_image(self, path):
        return mel.lib.image.load_image(path)

    def show(self):
        if self._image_list:
            path = self._image_list[self._index]
            self.image_path = path
            caption = mel.lib.image.render_text_as_image(str(path))
            image = mel.lib.image.letterbox(
                self._get_image(path), self.display.width, self.display.height
            )
            image = mel.lib.image.montage_vertical(10, image, caption)
            self.display.show_opencv_image(image)
        else:
            self.image_path = None
            self.display.show_opencv_image(
                mel.lib.common.new_image(
                    self.display.height, self.display.width
                )
            )

class MultiImageDisplay:
    def __init__(self, display):
        self._display = display
        self.reset()

    def reset(self):
        self._images_names = []
        self._border_width = 50
        self._layout = [[]]

    def add_image(self, image, name=None):
        self._images_names.append((image, name))
        index = len(self._images_names) - 1
        self._layout[-1].append(index)
        self.refresh()
        return index

    def new_row(self):
        assert self._layout[-1]
        self._layout.append([])

    def update_image(self, image, index):
        name = self._images_names[index][1]
        self._images_names[index] = (image, name)
        self.refresh()

    def refresh(self):
        row_image_list = []

        for row in self._layout:
            row_image = None
            for index in row:
                image, _ = self._images_names[index]
                if row_image is None:
                    row_image = image
                else:
                    row_image = mel.lib.image.montage_horizontal(
                        self._border_width, row_image, image
                    )
            row_image_list.append(row_image)

        if len(row_image_list) == 1:
            montage_image = row_image_list[0]
        else:
            montage_image = mel.lib.image.montage_vertical(0, *row_image_list)

        self._display.show_opencv_image(montage_image)

# -----------------------------------------------------------------------------
# Copyright (C) 2020-2021 Angelos Evripiotis.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ------------------------------ END-OF-FILE ----------------------------------


text:
package com.example.android.sunshine.app.wearable;

import android.net.Uri;
import android.util.Log;

import com.example.android.sunshine.app.sync.SunshineSyncAdapter;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.data.FreezableUtils;
import com.google.android.gms.wearable.DataEvent;
import com.google.android.gms.wearable.DataEventBuffer;
import com.google.android.gms.wearable.Wearable;

import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * Created by ruiguo on 22/10/16.
 */

public class WearableListenerService extends com.google.android.gms.wearable.WearableListenerService {
    private static final String LOG_TAG= "WearableListenerService";
    //private static final String START_ACTIVITY_PATH = "/weather";
    private static final String DATA_ITEM_RECEIVED_PATH = "/weather";
    private SunshineSyncAdapter sSunshineSyncAdapter;

    @Override
    public void onDataChanged(DataEventBuffer dataEvents) {
        if (Log.isLoggable(LOG_TAG, Log.DEBUG)) {
            Log.d(LOG_TAG, "onDataChanged: " + dataEvents);
        }
        /*
        final List events = FreezableUtils
                .freezeIterable(dataEvents);

        GoogleApiClient googleApiClient = new GoogleApiClient.Builder(this)
                .addApi(Wearable.API)
                .build();

        ConnectionResult connectionResult =
                googleApiClient.blockingConnect(30, TimeUnit.SECONDS);

        if (!connectionResult.isSuccess()) {
            Log.e(LOG_TAG, "Failed to connect to GoogleApiClient.");
            return;
        }
*/

        for (DataEvent event : dataEvents) {
            if(event.getType()==DataEvent.TYPE_CHANGED){
                String path = event.getDataItem().getUri().getPath();
                if(path.equals(DATA_ITEM_RECEIVED_PATH ))
                    SunshineSyncAdapter.syncImmediately(this);

            }

        }
    }
}


text:
layout: default
avatar: true
permalink: /

---
## What is most important things in the Pay-pulse company.
Accurancy, Humanity, sincerity.

---

## Why did i make the Pay-pulse company.

We need more good solution for a measuring instrument and we want to introduce foreign start-up company and sell their product to Korea. so, we made the company.

---
## Who made the Pay-pulse company.
{% for post in site.posts limit:1 %}
  <img src="https://paypulse.github.io/assets/images/career.png" width = "20" height ="20" />
{% endfor %}

I did many things. If you want to know more about me. Just send a email on me.
I will send my career file. (shinapp7@gmail.com)

---
## When is the birth day of Pay-pulse company.

Individual business , April 3 2017.

Unfortunately, My own company had closed for youngtommorrow that is kind of government project to the young person who entered the company until 2 year. But, I am Okay.
Me and Paypulse are same. so, my developing is also paypulse developing .

---
## Where is the Pay-pulse company.

We are located in
 2, Toegye-ro 36-gil, Jung-gu, Seoul, Republic of Korea

 zip code : 04626

I will be back ! see you soon .
maybe, I will upload video file like a UTube things.


text:
Changelog
=========

### Version 1.1.0
  - **Changes**
    - Mod downloads are now asynchronous (i.e. up to 10 mods will be downloaded at once)
  - **Fixes**
    - Mod files containing spaces no longer get downloaded incorrectly
    - The application will no longer crash in the Forge installation step if the output directory does not exist before launch

### Version 1.0.0
  - **Additions**
    - Initial release


text:
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:project="http://www.example.com/schema/projectwithxsd"
    xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd
                        http://www.example.com/schema/projectwithxsd http://www.example.com/schema/projectwithxsd/project-1.0.xsd">

    <parameters>
        <parameter key="project.parameter.foo">BAR</parameter>
    </parameters>

    <services>
        <service id="project.service.foo" class="BAR" public="true"/>
    </services>

    <project:bar bar="bar" />

</container>


text:
package main

import (
	"log"
	"net/http"
	"net/http/httptest"
)

func newTestRequest(method, path string) *httptest.ResponseRecorder {
	request, err := http.NewRequest(method, path, nil)
	if err != nil {
		log.Fatal(err)
	}

	recorder := httptest.NewRecorder()
	router.ServeHTTP(recorder, request)

	return recorder
}


text:
FROM ruby:2.4.3

LABEL AUTHOR=denilson.silva@flexait.com.br

ARG USER
ARG UID
ARG USER_ID
ARG APP_PATH=/var/www

RUN addgroup --gid $UID $USER && \
  adduser --system --gid $UID --uid $UID $USER && \
  mkdir -p ${APP_PATH} && \
  chown -R $USER:$USER $APP_PATH /usr/local/bundle

RUN chown -R $USER:$USER $APP_PATH

RUN curl -sS http://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb http://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update
RUN apt-get -y install node yarn

USER $USER
WORKDIR ${APP_PATH}/app

EXPOSE 3000

CMD bash


text:
package betterwithaddons.potion;

import betterwithaddons.lib.Reference;
import net.minecraft.client.Minecraft;
import net.minecraft.potion.Potion;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class PotionBase extends Potion
{
	ResourceLocation icon = new ResourceLocation("betterwithaddons:textures/gui/potions.png");

	protected PotionBase(String name, boolean isBadEffectIn, int liquidColorIn)
	{
		super(isBadEffectIn, liquidColorIn);

		this.setRegistryName(new ResourceLocation(Reference.MOD_ID,name));
	}

	@Override
	@SideOnly(Side.CLIENT)
	public int getStatusIconIndex() {
		Minecraft.getMinecraft().renderEngine.bindTexture(icon);

		return super.getStatusIconIndex();
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">

	<meta http-equiv="content-type" content="application/xhtml+xml" />
	<title>MIT Campus Map: Browse Residences</title>
	<link rel="stylesheet" type="text/css" href="../../styles/fp.css" />
	<meta name="MobileOptimized" content="176">

Campus Map

Browse Residences: R-S

		Random Hall

		Senior House

		Sidney-Pacific Dorm

		Sigma Chi (SC)

		Sigma Kappa (SK)

		Sigma Nu (SN)

		Sigma Phi Epsilon (SPE)

		Sigma Phi Epsilon Annex (SPE)

		Simmons Hall

		Spanish House

		Student House (SH)

		< Back

		Campus Map Help

		0: MIT Mobile Web Home

		1: Campus Map Home

	Campus map provided by Department of Facilities and Information Services & Technology


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>com.cyc.query.parameters (Core API 1.1.1 API)</title>
<meta name="date" content="2018-01-24">
<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

Cyc Core API

Prev Package

Next Package

Frames

No Frames

All Classes

Package com.cyc.query.parameters

Interfaces for inference parameters, which determine how Cyc performs an inference.

See: Description

Interface Summary

Interface
Description

InferenceMode

InferenceParameter

InferenceParameterGetter

An interface defining the getters of Cyc inference parameters.

InferenceParameters

 InferenceParameters is designed to encode the parameters that can be
 specified for running a Cyc query.

InferenceParameterSetter<T extends InferenceParameterSetter>

An interface defining the setters of Cyc inference parameters.

InferenceParameterSymbolValue

InferenceParameterValue

A representation of a value for an inference parameter.

InferenceParameterValueDescription

InferenceParameterValueDescription is designed to...

Enum Summary

Enum
Description

DisjunctionFreeElVarsPolicy

InferenceAnswerLanguage

The CycL language used to express answers.

ProblemReusePolicy

Which problems are considered for reuse by the Worker (aka Problem Store).

ProofValidationMode

How carefully to check proofs for semantic well-formedness.

ResultUniqueness

StandardInferenceMetric

An enumeration of inference metrics that are commonly used.

TransitiveClosureMode

The degree to which modules (such as transitiveViaArg) should generate
 transitive closures.

Package com.cyc.query.parameters Description

Interfaces for inference parameters, which determine how Cyc performs an inference.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Cyc Core API

Prev Package

Next Package

Frames

No Frames

All Classes

Copyright © 2015–2018 Cycorp, Inc. All rights reserved.


text:
#region Copyright © 2005 Paul Welter. All rights reserved.

#endregion

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;
using Microsoft.Build.Utilities;
using Microsoft.Build.Framework;

namespace MSBuild.Community.Tasks.Subversion
{
	///
	/// Summarize the local revision(s) of a working copy.
	///
	/// <example>The following example gets the revision of the current folder.
	/// <![CDATA[
	/// <Target Name="Version">
	///   <SvnVersion LocalPath=".">
	///     <Output TaskParameter="Revision" PropertyName="Revision" />
	///   </SvnVersion>
	///   <Message Text="Revision: $(Revision)"/>
	/// </Target>
	/// ]]>
	/// </example>
	public class SvnVersion : ToolTask
	{
		#region Fields
		private static readonly Regex _numberRegex = new Regex(@"\d+", RegexOptions.Compiled);
		private StringBuilder _outputBuffer;

		#endregion Fields

		#region Constructor
		///
		/// Initializes a new instance of the <see cref="T:SvnVersion"/> class.
		///
		public SvnVersion()
		{
			_outputBuffer = new StringBuilder();
		}

		#endregion Constructor

		#region Input Parameters
		private string _localPath;

		/// Path to local working copy.
		[Required]
		public string LocalPath
		{
			get { return _localPath; }
			set { _localPath = value; }
		}

        private bool _useLastCommittedRevision;

        ///
        /// Specifies whether to use the last committed revision number as
        /// opposed to the last updated revision number.
        ///
        public bool UseLastCommittedRevision
        {
            get { return _useLastCommittedRevision; }
            set { _useLastCommittedRevision = value; }
        }

		#endregion Input Parameters

		#region Output Parameters
		/// Revision number of the local working repository.
		[Output]
		public int Revision
		{
			get { return _highRevision; }
			set { _highRevision = value; }
		}

		private int _highRevision = -1;

		/// High revision number of the local working repository revision range.
		[Output]
		public int HighRevision
		{
			get { return _highRevision; }
			set { _highRevision = value; }
		}

		private int _lowRevision = -1;

		/// Low revision number of the local working repository revision range.
		[Output]
		public int LowRevision
		{
			get { return _lowRevision; }
			set { _lowRevision = value; }
		}

		private bool _modifications;

		/// True if working copy contains modifications.
		[Output]
		public bool Modifications
		{
			get { return _modifications; }
			set { _modifications = value; }
		}

		private bool _switched;

		/// True if working copy is switched.
		[Output]
		public bool Switched
		{
			get { return _switched; }
			set { _switched = value; }
		}

		private bool _exported;

		///
		/// True if invoked on a directory that is not a working copy,
		/// svnversion assumes it is an exported working copy and prints "exported".
		///
		[Output]
		public bool Exported
		{
			get { return _exported; }
			set { _exported = value; }
		}

		#endregion Output Parameters

		#region Task Overrides
		///
		/// Returns the fully qualified path to the executable file.
		///
		/// <returns>
		/// The fully qualified path to the executable file.
		/// </returns>
		protected override string GenerateFullPathToTool()
		{
            string path = SvnClient.FindToolPath(ToolName);
            base.ToolPath = path;

            return Path.Combine(ToolPath, ToolName);
        }

        ///
        /// Logs the starting point of the run to all registered loggers.
        ///
        /// <param name="message">A descriptive message to provide loggers, usually the command line and switches.</param>
        protected override void LogToolCommand(string message)
        {
            Log.LogCommandLine(MessageImportance.Low, message);
        }

		///
		/// Gets the <see cref="T:Microsoft.Build.Framework.MessageImportance"></see> with which to log errors.
		///
		/// <value></value>
		/// <returns>The <see cref="T:Microsoft.Build.Framework.MessageImportance"></see> with which to log errors.</returns>
		protected override MessageImportance StandardOutputLoggingImportance
		{
			get { return MessageImportance.Normal; }
		}

		///
		/// Gets the name of the executable file to run.
		///
		/// <value></value>
		/// <returns>The name of the executable file to run.</returns>
		protected override string ToolName
		{
            get { return ToolPathUtil.MakeToolName("svnversion"); }
		}

		///
		/// Returns a string value containing the command line arguments to pass directly to the executable file.
		///
		/// <returns>
		/// A string value containing the command line arguments to pass directly to the executable file.
		/// </returns>
        protected override string GenerateCommandLineCommands()
        {
            DirectoryInfo localPath = new DirectoryInfo(_localPath);
            string commandLineFormat = _useLastCommittedRevision ? "-c --no-newline \"{0}\"" : "--no-newline \"{0}\"";
            return string.Format(commandLineFormat, localPath.FullName.Replace('\\', '/'));
        }

		///
		/// Runs the exectuable file with the specified task parameters.
		///
		/// <returns>
		/// true if the task runs successfully; otherwise, false.
		/// </returns>
		public override bool Execute()
		{
			bool result = base.Execute();
			if (result)
			{
				ParseOutput();
			}
			return result;
		}

		///
		/// Logs the events from text output.
		///
		/// <param name="singleLine">The single line.</param>
		/// <param name="messageImportance">The message importance.</param>
		protected override void LogEventsFromTextOutput(string singleLine, Microsoft.Build.Framework.MessageImportance messageImportance)
		{
			base.LogEventsFromTextOutput(singleLine, messageImportance);
			_outputBuffer.Append(singleLine);
		}

		#endregion Task Overrides

		#region Private Methods
		private void ParseOutput()
		{
			string buffer = _outputBuffer.ToString();
			MatchCollection revisions = _numberRegex.Matches(buffer);
			foreach (Match rm in revisions)
			{
				int revision;
				if (int.TryParse(rm.Value, out revision))
				{
					if (_lowRevision == -1)
					{
					  _lowRevision = revision;
					}
					_lowRevision = System.Math.Min(revision, _lowRevision);
					_highRevision = System.Math.Max(revision, _highRevision);
				}
			}

			_modifications = buffer.Contains("M");
			_switched = buffer.Contains("S");
			_exported = buffer.Contains("exported");
			if (_exported)
				Log.LogWarning(Properties.Resources.SvnLocalPathNotWorkCopy);

		}

		#endregion Private Methods

	}
}


text:
<?php

/** @var array $_ */
?>

<fieldset class="personalblock">
	<legend><?php p($l->t('Bookmarklet'));?></legend>
	<?php print_unescaped(bookmarklet());?>

</fieldset>

<form id="import_bookmark" action="<?php print_unescaped(OCP\Util::linkTo( "bookmarks", "ajax/import.php" ));?>"
 method="post" enctype="multipart/form-data">
	<input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>"/>
	<fieldset class="personalblock">
		<?php if(isset($_['error'])): ?>

<?php p($_['error']['error']); ?>

<?php p($_['error']['hint']); ?>

		<?php endif; ?>

			<legend><?php p($l->t('Export & Import'));?></legend>
			<input type="button" id="bm_export" href="<?php print_unescaped(OCP\Util::linkTo('bookmarks', 'export.php')) ;?>" value="<?php p($l->t('Export')); ?>" />
			<input type="file" id="bm_import" name="bm_import" size="5">
			<button type="button" name="bm_import_btn" id="bm_import_submit"><?php p($l->t('Import')); ?></button>

	</fieldset>
</form>


text:
function SensorSample(sample, timestampS) {
  this.set(sample, timestampS);
};

SensorSample.prototype.set = function(sample, timestampS) {
  this.sample = sample;
  this.timestampS = timestampS;
};

SensorSample.prototype.copy = function(sensorSample) {
  this.set(sensorSample.sample, sensorSample.timestampS);
};

export default SensorSample;


text:
set -a
SSH_PORT=32769

openssl req  -newkey rsa:2048 -nodes -keyout server1.key  -x509 -days 365 -out server.crt
openssl rsa -in server1.key -out server.key
ssh -p $SSH_PORT nsroot@localhost 'mkdir -p /var/certs'
scp -P $SSH_PORT server.* nsroot@localhost:/var/certs/
rm server1.key
rm server.*


text:
package org.eluder.coveralls.maven.plugin;

import java.io.IOException;

import org.eluder.coveralls.maven.plugin.domain.Source;

public abstract class ChainingSourceCallback implements SourceCallback {

    private final SourceCallback chained;

    public ChainingSourceCallback(final SourceCallback chained) {
        if (chained == null) {
            throw new IllegalArgumentException("Chained source callback must be defined");
        }
        this.chained = chained;
    }

    @Override
    public final void onSource(final Source source) throws ProcessingException, IOException {
        onSourceInternal(source);
        chained.onSource(source);
    }

    protected abstract void onSourceInternal(final Source source) throws ProcessingException, IOException;
}


text:
package org.apache.sysml.test.integration.functions.binary.matrix;

import java.util.HashMap;

import org.junit.Test;

import org.apache.sysml.api.DMLException;
import org.apache.sysml.runtime.matrix.data.MatrixValue.CellIndex;
import org.apache.sysml.test.integration.AutomatedTestBase;
import org.apache.sysml.test.integration.TestConfiguration;
import org.apache.sysml.test.utils.TestUtils;

public class MatrixMultiplicationTest extends AutomatedTestBase
{

	private static final String TEST_DIR = "functions/binary/matrix/";
	private final static String TEST_CLASS_DIR = TEST_DIR + MatrixMultiplicationTest.class.getSimpleName() + "/";

	@Override
	public void setUp() {
		// positive tests
		addTestConfiguration("MatrixMultiplicationTest",
			new TestConfiguration(TEST_CLASS_DIR, "MatrixMultiplicationTest", new String[] { "c" }));
		addTestConfiguration("WrongDimensionsTest",
			new TestConfiguration(TEST_CLASS_DIR, "MatrixMultiplicationTest", new String[] { "c" }));
		addTestConfiguration("AMultASpecial1Test",
			new TestConfiguration(TEST_CLASS_DIR, "AMultASpecial1Test", new String[] { "a" }));
		addTestConfiguration("AMultBSpecial2Test",
			new TestConfiguration(TEST_CLASS_DIR, "AMultBSpecial2Test", new String[] { "e" }));

		// negative tests
	}

	@Test
	public void testMatrixMultiplication() {
		if(shouldSkipTest())
			return;

		int m = 20;
		int n = 20;
		int k = 20;

		TestConfiguration config = availableTestConfigurations.get("MatrixMultiplicationTest");
		config.addVariable("m", m);
		config.addVariable("n1", n);
		config.addVariable("n2", n);
		config.addVariable("k", k);

		loadTestConfiguration(config);

		double[][] a = getRandomMatrix(m, n, -1, 1, 1, -1);
		double[][] b = getRandomMatrix(n, k, -1, 1, 1, -1);
		double[][] c = TestUtils.performMatrixMultiplication(a, b);

		writeInputMatrix("a", a);
		writeInputMatrix("b", b);
		writeExpectedMatrix("c", c);

		runTest();

		compareResults(0.00000000001);
	}

	@Test
	public void testSparseMatrixMultiplication() {
		if(shouldSkipTest())
			return;

		int m = 40;
		int n = 10;
		int k = 30;

		TestConfiguration config = availableTestConfigurations.get("MatrixMultiplicationTest");
		config.addVariable("m", m);
		config.addVariable("n1", n);
		config.addVariable("n2", n);
		config.addVariable("k", k);

		loadTestConfiguration(config);

		double[][] a = getRandomMatrix(m, n, -1, 1, 0.1, -1);
		double[][] b = getRandomMatrix(n, k, -1, 1, 0.1, -1);
		double[][] c = TestUtils.performMatrixMultiplication(a, b);

		writeInputMatrix("a", a);
		writeInputMatrix("b", b);
		writeExpectedMatrix("c", c);

		runTest();

		compareResults(0.00000000001);
	}

	@Test
	public void testWrongDimensions() {
		if(shouldSkipTest())
			return;

		int m = 6;
		int n1 = 8;
		int n2 = 10;
		int k = 12;

		TestConfiguration config = availableTestConfigurations.get("WrongDimensionsTest");
		config.addVariable("m", m);
		config.addVariable("n1", n1);
		config.addVariable("n2", n2);
		config.addVariable("k", k);

		loadTestConfiguration(config);

		createRandomMatrix("a", m, n1, -1, 1, 0.5, -1);
		createRandomMatrix("b", n2, k, -1, 1, 0.5, -1);

		runTest(true, DMLException.class);
	}

	@Test
	public void testAMultASpecial1() {
		if(shouldSkipTest())
			return;

		int rows = 10;
		int cols = 10;

		TestConfiguration config = availableTestConfigurations.get("AMultASpecial1Test");
		config.addVariable("rows", rows);
		config.addVariable("cols", cols);
		loadTestConfiguration(config);

		double[][] a = createNonRandomMatrixValues(rows, cols);
		writeInputMatrix("a", a);

		a = TestUtils.performMatrixMultiplication(a, a);
		a = TestUtils.performMatrixMultiplication(a, a);

		writeExpectedMatrix("a", a);

		runTest();

		compareResults();
	}

	@Test
	public void testAMultBSpecial2() {
		if(shouldSkipTest())
			return;

		int rows = 10;
		int cols = 10;

		TestConfiguration config = availableTestConfigurations.get("AMultBSpecial2Test");
		config.addVariable("rows", rows);
		config.addVariable("cols", cols);
		loadTestConfiguration(config);

		double[][] a = createNonRandomMatrixValues(rows, cols);
		writeInputMatrix("a", a);
		double[][] b = createNonRandomMatrixValues(rows, cols);
		writeInputMatrix("b", b);
		double[][] d = createNonRandomMatrixValues(rows, cols);
		writeInputMatrix("d", d);

		double[][] c = TestUtils.performMatrixMultiplication(a, b);
		double[][] e = TestUtils.performMatrixMultiplication(c, d);

		writeExpectedMatrix("e", e);

		runTest();

		HashMap<CellIndex, Double> hmDMLJ = TestUtils.convert2DDoubleArrayToHashMap(e);
		HashMap<CellIndex, Double> hmDMLE = readDMLMatrixFromHDFS("e");
		TestUtils.compareMatrices(hmDMLJ, hmDMLE, 0, "hmDMLJ","hmDMLE");

		TestUtils.displayAssertionBuffer();
	}
}


text:
<?php

namespace App\Transformers;

use App\Models\Authorization;
use League\Fractal\TransformerAbstract;

class AuthorizationTransformer extends TransformerAbstract
{
    public function transform(Authorization $authorization)
    {
        return $authorization->toArray();
    }
}


text:
layout: default
title: Graphic Designer
---

{% include about.html %}
{% include portfolio.html %}
{% include contact.html %}


text: specman -c "load e/reg; load e/dis_field_check3; load tests/test; load tests/test3; test"