text:
package co.aurasphere.assignables.test;

import co.aurasphere.assignables.Assignable;
import co.aurasphere.assignables.Assignables;
import co.aurasphere.assignables.policy.MD5AssignmentPolicy;

/**
 * Test class for {@link Assignables}. Nothing really to test. Everything works
 * flawlessly. Just here if you want to play with it yourself.
 *
 * @author Donato Rimenti
 */
public class AssignablesTest {

	/**
	 * The main method.
	 *
	 * @param args the arguments.
	 */
	public static void main(String[] args) {
		Assignable b = new Assignable(0);

		Assignables.assign(10).into(b).enforceThreadSafetyPolicy().end()
				.withAssignmentPolicy(new MD5AssignmentPolicy());

		System.out.println("B's value: " + b);
	}

}


text:
/*
 * http://github.com/dusty-nv/jetson-inference
 */

// #include "gstCamera.h"
#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <cv_bridge/cv_bridge.h>
#include <sensor_msgs/image_encodings.h>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <autobot/detected_img.h>
#include <autobot/detected_object.h>
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <chrono>
#include <jetson-inference/cudaMappedMemory.h>
#include <jetson-inference/cudaNormalize.h>
#include <jetson-inference/cudaFont.h>

#include <jetson-inference/imageNet.h>

#define DEFAULT_CAMERA -1   // -1 for onboard camera, or change to index of /dev/video V4L2 camera (>=0)

using namespace std;

bool signal_recieved = false;

/*
void sig_handler(int signo)
{
    if( signo == SIGINT )
    {
        //printf("received SIGINT\n");
        //signal_recieved = true;
    }
}
*/

void depthToCV8UC1(const cv::Mat& float_img, cv::Mat& mono8_img){
  //Process images
  if(mono8_img.rows != float_img.rows || mono8_img.cols != float_img.cols){
    mono8_img = cv::Mat(float_img.size(), CV_8UC1);
  }
  cv::convertScaleAbs(float_img, mono8_img, 100, 0.0);
}

static const std::string OPENCV_WINDOW = "Image post bridge conversion";
static const std::string OPENCV_WINDOW2 = "Image post bit depth conversion";
static const std::string OPENCV_WINDOW3 = "Image post color conversion";
static const std::string OPENCV_WINDOW4 = "Image window";

class ObjectClassifier
{
    ros::NodeHandle nh_;
    image_transport::ImageTransport it_;
    ros::Subscriber image_sub_;
    ros::Publisher class_pub_;
    cv::Mat cv_im;
    cv_bridge::CvImagePtr cv_ptr;
    std::chrono::steady_clock::time_point prev;
    cv::Mat cv_depth_im;
    cv::Mat cv_depth;
    float confidence = 0.0f;

    //float* bbCPU    = NULL;
    //float* bbCUDA   = NULL;
    //float* confCPU  = NULL;
    //float* confCUDA = NULL;

    imageNet* net = NULL;
    //detectNet* net = NULL;
    //uint32_t maxBoxes = 0;
    //uint32_t classes = 0;

    float4* gpu_data = NULL;

    uint32_t imgWidth;
    uint32_t imgHeight;
    size_t imgSize;

    bool displayToScreen = false;

public:
    ObjectClassifier(int argc, char** argv, bool display) : it_(nh_)
    {
        cout << "start constructor" << endl;
        // Subscrive to input video feed and publish output video feed
        //image_sub_ = it_.subscribe("/left/image_rect_color", 2,
          //&ObjectClassifier::imageCb, this);
        image_sub_ = nh_.subscribe("/detected_image", 2,
          &ObjectClassifier::imageCb, this);
        class_pub_ = nh_.advertise<autobot::detected_object>("/detected_object", 2);

        displayToScreen = display;

        if (displayToScreen) {
            cv::namedWindow(OPENCV_WINDOW);
            cout << "Named a window" << endl;
            prev = std::chrono::steady_clock::now();
        }

         // create imageNet
        net = imageNet::Create(argc, argv );

        if( !net )
        {
            printf("obj_detect:   failed to initialize imageNet\n");
        }
    }

    ~ObjectClassifier()
    {
        cv::destroyWindow(OPENCV_WINDOW);
    }

    void imageCb(const autobot::detected_img& detect_msg)
    {
        // Conversion is now offloaded to navigator.py node
        // cv_bridge::CvImagePtr cv_depth_ptr;
        // cv_depth_ptr = cv_bridge::toCvCopy(detect_msg.depthImg);
        // cv_depth = cv_depth_ptr->image;
        // depthToCV8UC1(cv_depth, cv_depth_im);
        // cv::imshow("depth",cv_depth_im);
        int width;
        int height;

        try
        {

            cv_ptr = cv_bridge::toCvCopy(detect_msg.img, sensor_msgs::image_encodings::BGR8);
            cv_im = cv_ptr->image;
            width = cv_im.cols;
            height = cv_im.rows;
            cv::resize(cv_im,cv_im,cv::Size(224,224));
            cv_im.convertTo(cv_im,CV_32FC3);

            // convert color
            cv::cvtColor(cv_im,cv_im,CV_BGR2RGBA);

        }
        catch (cv_bridge::Exception& e)
        {
          ROS_ERROR("cv_bridge exception: %s", e.what());
          return;
        }

        // allocate GPU data if necessary
        if(!gpu_data){
            ROS_INFO("first allocation");
            CUDA(cudaMalloc(&gpu_data, cv_im.rows*cv_im.cols * sizeof(float4)));
        } else if(imgHeight != cv_im.rows || imgWidth != cv_im.cols){
            ROS_INFO("re allocation");
            // reallocate for a new image size if necessary
            CUDA(cudaFree(gpu_data));
            CUDA(cudaMalloc(&gpu_data, cv_im.rows*cv_im.cols * sizeof(float4)));
        }

        imgHeight = cv_im.rows;
        imgWidth = cv_im.cols;
        imgSize = cv_im.rows*cv_im.cols * sizeof(float4);
        float4* cpu_data = (float4*)(cv_im.data);

        // copy to device
        CUDA(cudaMemcpy(gpu_data, cpu_data, imgSize, cudaMemcpyHostToDevice));

        void* imgCUDA = NULL;

        // classify image
        const int img_class = net->Classify((float*)gpu_data, imgWidth, imgHeight, &confidence);

        // find class string
        std::string class_name;
        class_name = net->GetClassDesc(img_class);

        if (displayToScreen) {
            std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now();
            float fps = 1000.0 / std::chrono::duration_cast<std::chrono::milliseconds>(now - prev).count() ;

            prev = now;

            char str[256];
            sprintf(str, "TensorRT build %x | %s | %04.1f FPS", NV_GIE_VERSION, net->HasFP16() ? "FP16" : "FP32", fps);
            cv::setWindowTitle(OPENCV_WINDOW, str);
        }

        sensor_msgs::ImagePtr img_msg = cv_bridge::CvImage(std_msgs::Header(), "bgr8", cv_depth_im).toImageMsg();

        autobot::detected_object detected_object;
        detected_object.className = class_name;
        detected_object.depthImg = detect_msg.depthImg;
        detected_object.box = detect_msg.box;

        class_pub_.publish<autobot::detected_object>(detected_object);
        // update image back to original

        if (displayToScreen) {
            cv_im.convertTo(cv_im,CV_8UC3);
            cv::cvtColor(cv_im,cv_im,CV_RGBA2BGR);
            cv::resize(cv_im,cv_im,cv::Size(width,height));
            // draw class string
            cv::putText(cv_im, class_name, cv::Point(60,60), cv::FONT_HERSHEY_PLAIN, 3.0, cv::Scalar(0,0,255),3);

            // Update GUI Window
            cv::imshow(OPENCV_WINDOW, cv_im);
            cv::waitKey(1);
        }
    }
};

int main( int argc, char** argv ) {
    cout << "starting node" << endl;
    printf("obj_classifier\n  args (%i):  ", argc);

    ros::init(argc, argv, "obj_detector");
    ros::NodeHandle nh;

    bool display = false;
    for( int i=0; i < argc; i++ ) {
        printf("%i [%s]  ", i, argv[i]);
        if (strcmp(argv[i], "--DISPLAY") == 0) {
            display = true;
        }
    }

    printf("\n\n");

    ObjectClassifier ic(argc, argv, display);

    ros::spin();

    return 0;
}

redpajama_set_name: RedPajamaGithub


text:
package bftsmart.consensus.roles;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.security.PrivateKey;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import bftsmart.communication.ServerCommunicationSystem;
import bftsmart.consensus.Consensus;
import bftsmart.consensus.Epoch;
import bftsmart.consensus.messages.ConsensusMessage;
import bftsmart.consensus.messages.MessageFactory;
import bftsmart.reconfiguration.ServerViewController;
import bftsmart.tom.core.ExecutionManager;
import bftsmart.tom.core.TOMLayer;
import bftsmart.tom.core.messages.TOMMessage;
import bftsmart.tom.util.TOMUtil;

/**
 * This class represents the acceptor role in the consensus protocol. This class
 * work together with the TOMLayer class in order to supply a atomic multicast
 * service.
 *
 * @author Alysson Bessani
 */
public final class Acceptor {

	private Logger logger = LoggerFactory.getLogger(this.getClass());

	private int me; // This replica ID
	private ExecutionManager executionManager; // Execution manager of consensus's executions
	private MessageFactory factory; // Factory for PaW messages
	private ServerCommunicationSystem communication; // Replicas comunication system
	private TOMLayer tomLayer; // TOM layer
	private ServerViewController controller;

	// thread pool used to paralelise creation of consensus proofs
	private ExecutorService proofExecutor = null;

	/**
	 * Tulio Ribeiro
	 */
	private PrivateKey privKey;

	/**
	 * Creates a new instance of Acceptor.
	 *
	 * @param communication Replicas communication system
	 * @param factory       Message factory for PaW messages
	 * @param controller
	 */
	public Acceptor(ServerCommunicationSystem communication, MessageFactory factory, ServerViewController controller) {
		this.communication = communication;
		this.me = controller.getStaticConf().getProcessId();
		this.factory = factory;
		this.controller = controller;

		/* Tulio Ribeiro */
		this.privKey = controller.getStaticConf().getPrivateKey();

		// use either the same number of Netty workers threads if specified in the
		// configuration
		// or use a many as the number of cores available
		/*
		 * int nWorkers = this.controller.getStaticConf().getNumNettyWorkers(); nWorkers
		 * = nWorkers > 0 ? nWorkers : Runtime.getRuntime().availableProcessors();
		 * this.proofExecutor = Executors.newWorkStealingPool(nWorkers);
		 */
		this.proofExecutor = Executors.newSingleThreadExecutor();
	}

	public MessageFactory getFactory() {
		return factory;
	}

	/**
	 * Sets the execution manager for this acceptor
	 *
	 * @param manager Execution manager for this acceptor
	 */
	public void setExecutionManager(ExecutionManager manager) {
		this.executionManager = manager;
	}

	/**
	 * Sets the TOM layer for this acceptor
	 *
	 * @param tom TOM layer for this acceptor
	 */
	public void setTOMLayer(TOMLayer tom) {
		this.tomLayer = tom;
	}

	/**
	 * Called by communication layer to delivery Paxos messages. This method only
	 * verifies if the message can be executed and calls process message (storing it
	 * on an out of context message buffer if this is not the case)
	 *
	 * @param msg Paxos messages delivered by the communication layer
	 */
	public final void deliver(ConsensusMessage msg) {
		if (executionManager.checkLimits(msg)) {
			logger.debug("Processing paxos msg with id " + msg.getNumber());
			processMessage(msg);
		} else {
			logger.debug("Out of context msg with id " + msg.getNumber());
			tomLayer.processOutOfContext();
		}
	}

	/**
	 * Called when a Consensus message is received or when a out of context message
	 * must be processed. It processes the received message according to its type
	 *
	 * @param msg The message to be processed
	 */
	public final void processMessage(ConsensusMessage msg) {
		Consensus consensus = executionManager.getConsensus(msg.getNumber());

		consensus.lock.lock();
		Epoch epoch = consensus.getEpoch(msg.getEpoch(), controller);
		switch (msg.getType()) {
		case MessageFactory.PROPOSE: {
			proposeReceived(epoch, msg);
		}
			break;
		case MessageFactory.WRITE: {
			writeReceived(epoch, msg.getSender(), msg.getValue());
		}
			break;
		case MessageFactory.ACCEPT: {
			acceptReceived(epoch, msg);
		}
		}
		consensus.lock.unlock();
	}

	/**
	 * Called when a PROPOSE message is received or when processing a formerly out
	 * of context propose which is know belongs to the current consensus.
	 *
	 * @param msg The PROPOSE message to by processed
	 */
	public void proposeReceived(Epoch epoch, ConsensusMessage msg) {
		int cid = epoch.getConsensus().getId();
		int ts = epoch.getConsensus().getEts();
		int ets = executionManager.getConsensus(msg.getNumber()).getEts();
		logger.debug("PROPOSE received from:{}, for consensus cId:{}, I am:{}", msg.getSender(), cid, me);
		if (msg.getSender() == executionManager.getCurrentLeader() // Is the replica the leader?
				&& epoch.getTimestamp() == 0 && ts == ets && ets == 0) { // Is all this in epoch 0?
			executePropose(epoch, msg.getValue());
		} else {
			logger.debug("Propose received is not from the expected leader");
		}
	}

	/**
	 * Executes actions related to a proposed value.
	 *
	 * @param epoch the current epoch of the consensus
	 * @param value Value that is proposed
	 */
	private void executePropose(Epoch epoch, byte[] value) {
		int cid = epoch.getConsensus().getId();
		logger.debug("Executing propose for cId:{}, Epoch Timestamp:{}", cid, epoch.getTimestamp());

		long consensusStartTime = System.nanoTime();

		if (epoch.propValue == null) { // only accept one propose per epoch
			epoch.propValue = value;
			epoch.propValueHash = tomLayer.computeHash(value);

			/*** LEADER CHANGE CODE ********/
			epoch.getConsensus().addWritten(value);
			logger.trace("I have written value " + Arrays.toString(epoch.propValueHash) + " in consensus instance "
					+ cid + " with timestamp " + epoch.getConsensus().getEts());
			/*****************************************/

			// start this consensus if it is not already running
			if (cid == tomLayer.getLastExec() + 1) {
				tomLayer.setInExec(cid);
			}
			epoch.deserializedPropValue = tomLayer.checkProposedValue(value, true);

			if (epoch.deserializedPropValue != null && !epoch.isWriteSent()) {
				if (epoch.getConsensus().getDecision().firstMessageProposed == null) {
					epoch.getConsensus().getDecision().firstMessageProposed = epoch.deserializedPropValue[0];
				}
				if (epoch.getConsensus().getDecision().firstMessageProposed.consensusStartTime == 0) {
					epoch.getConsensus().getDecision().firstMessageProposed.consensusStartTime = consensusStartTime;

				}
				epoch.getConsensus().getDecision().firstMessageProposed.proposeReceivedTime = System.nanoTime();

				if (controller.getStaticConf().isBFT()) {
					logger.debug("Sending WRITE for " + cid);

					epoch.setWrite(me, epoch.propValueHash);
					epoch.getConsensus().getDecision().firstMessageProposed.writeSentTime = System.nanoTime();

					logger.debug("Sending WRITE for cId:{}, I am:{}", cid, me);
					communication.send(this.controller.getCurrentViewOtherAcceptors(),
							factory.createWrite(cid, epoch.getTimestamp(), epoch.propValueHash));

					epoch.writeSent();

					computeWrite(cid, epoch, epoch.propValueHash);

					logger.debug("WRITE computed for cId:{}, I am:{}", cid, me);

				} else {
					epoch.setAccept(me, epoch.propValueHash);
					epoch.getConsensus().getDecision().firstMessageProposed.writeSentTime = System.nanoTime();
					epoch.getConsensus().getDecision().firstMessageProposed.acceptSentTime = System.nanoTime();

					/**** LEADER CHANGE CODE! ******/
					logger.debug("[CFT Mode] Setting consensus " + cid + " QuorumWrite tiemstamp to "
							+ epoch.getConsensus().getEts() + " and value " + Arrays.toString(epoch.propValueHash));
					epoch.getConsensus().setQuorumWrites(epoch.propValueHash);
					/*****************************************/

					communication.send(this.controller.getCurrentViewOtherAcceptors(),
							factory.createAccept(cid, epoch.getTimestamp(), epoch.propValueHash));

					epoch.acceptSent();
					computeAccept(cid, epoch, epoch.propValueHash);
				}
				executionManager.processOutOfContext(epoch.getConsensus());

			} else if (epoch.deserializedPropValue == null
					&& !tomLayer.isChangingLeader()) { // force a leader change
				tomLayer.getSynchronizer().triggerTimeout(new LinkedList<>());
			}
		}
	}

	/**
	 * Called when a WRITE message is received
	 *
	 * @param epoch Epoch of the receives message
	 * @param a     Replica that sent the message
	 * @param value Value sent in the message
	 */
	private void writeReceived(Epoch epoch, int sender, byte[] value) {
		int cid = epoch.getConsensus().getId();
		logger.debug("WRITE received from:{}, for consensus cId:{}",
				sender, cid);
		epoch.setWrite(sender, value);

		computeWrite(cid, epoch, value);
	}

	/**
	 * Computes WRITE values according to Byzantine consensus specification values
	 * received).
	 *
	 * @param cid   Consensus ID of the received message
	 * @param epoch Epoch of the receives message
	 * @param value Value sent in the message
	 */
	private void computeWrite(int cid, Epoch epoch, byte[] value) {
		int writeAccepted = epoch.countWrite(value);

		logger.debug("I have {}, WRITE's for cId:{}, Epoch timestamp:{},", writeAccepted, cid, epoch.getTimestamp());

		if (writeAccepted > controller.getQuorum()
				&& Arrays.equals(value, epoch.propValueHash)) {

			if (!epoch.isAcceptSent()) {

				logger.debug("Sending ACCEPT message, cId:{}, I am:{}", cid, me);

				/**** LEADER CHANGE CODE! ******/
				logger.debug("Setting consensus " + cid + " QuorumWrite tiemstamp to " + epoch.getConsensus().getEts()
						+ " and value " + Arrays.toString(value));
				epoch.getConsensus().setQuorumWrites(value);
				/*****************************************/

				if (epoch.getConsensus().getDecision().firstMessageProposed != null) {

					epoch.getConsensus().getDecision().firstMessageProposed.acceptSentTime = System.nanoTime();
				}

				ConsensusMessage cm = epoch.fetchAccept();
				int[] targets = this.controller.getCurrentViewAcceptors();
				epoch.acceptSent();

				if (Arrays.equals(cm.getValue(), value)) { // make sure the ACCEPT message generated upon receiving the
															// PROPOSE message
															// still matches the value that ended up being written...

					logger.debug(
							"Speculative ACCEPT message for consensus {} matches the written value, sending it to the other replicas",
							cid);

					communication.getServersConn().send(targets, cm, true);

				} else { // ... and if not, create the ACCEPT message again (with the correct value), and
							// send it

					ConsensusMessage correctAccept = factory.createAccept(cid, epoch.getTimestamp(), value);

					proofExecutor.submit(() -> {

						// Create a cryptographic proof for this ACCEPT message
						logger.debug(
								"Creating cryptographic proof for the correct ACCEPT message from consensus " + cid);
						insertProof(correctAccept, epoch.deserializedPropValue);

						communication.getServersConn().send(targets, correctAccept, true);

					});
				}

			}

		} else if (!epoch.isAcceptCreated()) { // start creating the ACCEPT message and its respective proof ASAP, to
												// increase performance.
												// since this is done after a PROPOSE message is received, this is done
												// speculatively, hence
												// the value must be verified before sending the ACCEPT message to the
												// other replicas

			ConsensusMessage cm = factory.createAccept(cid, epoch.getTimestamp(), value);
			epoch.acceptCreated();

			proofExecutor.submit(() -> {

				// Create a cryptographic proof for this ACCEPT message
				logger.debug("Creating cryptographic proof for speculative ACCEPT message from consensus " + cid);
				insertProof(cm, epoch.deserializedPropValue);

				epoch.setAcceptMsg(cm);

			});
		}
	}

	/**
	 * Create a cryptographic proof for a consensus message
	 *
	 * This method modifies the consensus message passed as an argument, so that it
	 * contains a cryptographic proof.
	 *
	 * @param cm    The consensus message to which the proof shall be set
	 * @param epoch The epoch during in which the consensus message was created
	 */
	private void insertProof(ConsensusMessage cm, TOMMessage[] msgs) {
		ByteArrayOutputStream bOut = new ByteArrayOutputStream(248);
		try {
			ObjectOutputStream obj = new ObjectOutputStream(bOut);
			obj.writeObject(cm);
			obj.flush();
			bOut.flush();
		} catch (IOException ex) {
			logger.error("Failed to serialize consensus message", ex);
		}

		byte[] data = bOut.toByteArray();

		// Always sign a consensus proof.
		byte[] signature = TOMUtil.signMessage(privKey, data);

		cm.setProof(signature);

	}

	/**
	 * Called when a ACCEPT message is received
	 *
	 * @param epoch Epoch of the receives message
	 * @param a     Replica that sent the message
	 * @param value Value sent in the message
	 */
	private void acceptReceived(Epoch epoch, ConsensusMessage msg) {
		int cid = epoch.getConsensus().getId();
		logger.debug("ACCEPT from " + msg.getSender() + " for consensus " + cid);
		epoch.setAccept(msg.getSender(), msg.getValue());
		epoch.addToProof(msg);

		computeAccept(cid, epoch, msg.getValue());
	}

	/**
	 * Computes ACCEPT values according to the Byzantine consensus specification
	 *
	 * @param epoch Epoch of the receives message
	 * @param value Value sent in the message
	 */
	private void computeAccept(int cid, Epoch epoch, byte[] value) {
		logger.debug("I have {} ACCEPTs for cId:{}, Timestamp:{} ", epoch.countAccept(value), cid,
				epoch.getTimestamp());

		if (epoch.countAccept(value) > controller.getQuorum() && !epoch.getConsensus().isDecided()) {
			logger.debug("Deciding consensus " + cid);
			decide(epoch);
		}
	}

	/**
	 * This is the method invoked when a value is decided by this process
	 *
	 * @param epoch Epoch at which the decision is made
	 */
	private void decide(Epoch epoch) {
		if (epoch.getConsensus().getDecision().firstMessageProposed != null)
			epoch.getConsensus().getDecision().firstMessageProposed.decisionTime = System.nanoTime();

		epoch.getConsensus().decided(epoch, true);
	}
}


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

namespace ECommon.Remoting
{
    public class RemotingRequest
    {
        private static long _sequence;

        public short Type { get; set; }
        public short Code { get; set; }
        public long Sequence { get; set; }
        public byte[] Body { get; set; }
        public DateTime CreatedTime { get; set; }
        public IDictionary<string, string> Header { get; set; }

        public RemotingRequest() { }
        public RemotingRequest(short code, byte[] body, IDictionary<string, string> header = null) : this(code, Interlocked.Increment(ref _sequence), body, DateTime.Now, header) { }
        public RemotingRequest(short code, long sequence, byte[] body, DateTime createdTime, IDictionary<string, string> header)
        {
            Code = code;
            Sequence = sequence;
            Body = body;
            Header = header;
            CreatedTime = createdTime;
        }

        public override string ToString()
        {
            var createdTime = CreatedTime.ToString("yyyy-MM-dd HH:mm:ss.fff");
            var bodyLength = 0;
            if (Body != null)
            {
                bodyLength = Body.Length;
            }
            var header = string.Empty;
            if (Header != null && Header.Count > 0)
            {
                header = string.Join(",", Header.Select(x => string.Format("{0}:{1}", x.Key, x.Value)));
            }
            return string.Format("[Type:{0}, Code:{1}, Sequence:{2}, CreatedTime:{3}, BodyLength:{4}, Header: [{5}]]",
                Type, Code, Sequence, createdTime, bodyLength, header);
        }
    }
    public class RemotingRequestType
    {
        public const short Async        = 1;
        public const short Oneway       = 2;
        public const short Callback     = 3;
    }
}


text:
from math import cos, sin, radians

def from_spherical(r, theta, phi):
    return (r * cos(theta) * sin(phi),
            r * sin(theta) * sin(phi),
            r * cos(phi))

def from_spherical_deg(r, theta, phi):
    return from_spherical(r, radians(theta), radians(phi))


text:
class Gws::Column::Value::Select < Gws::Column::Value::Base
  field :value, type: String

  def validate_value(record, attribute)
    return if column.blank?

    if column.required? && value.blank?
      record.errors.add(:base, name + I18n.t('errors.messages.blank'))
    end

    return if value.blank?

    unless column.select_options.include?(value)
      record.errors.add(:base, name + I18n.t('errors.messages.inclusion', value: value))
    end
  end
end


text:
angular.module('ion-freebase-autocomplete', ['freebase'])
  .directive('ionFreebaseAutocomplete', [
    '$ionicTemplateLoader',
    '$ionicBackdrop',
    '$q',
    '$timeout',
    '$rootScope',
    '$document',
    'freebase',
    function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope,
      $document, freebase) {
      return {
        scope: {
          hit: '=',
          searchFilter: '=',
          searchOperator: '@',
          onSelectHit: '&?'
        },
        link: function(scope, element, attrs) {
          scope.hits = [];
          var searchEventTimeout;

          var POPUP_TPL = [
            '
',
              '
',
                '',
                  '',
                  '<input class="freebase-search" type="search" ng-model="searchQuery" placeholder="',
                    attrs.placeholder || 'Enter a query',
                  '" />',
                '',
                '<button class="button button-clear icon ion-ios7-close-outline"></button>',
              '
',
              '<ion-content class="has-header has-header">',
                '<ion-list>',
                  '<ion-item ng-repeat="hit in hits" type="item-text-wrap" ng-click="selectHit(hit)">',
                    '{{hit.name}}',
                  '</ion-item>',
                '</ion-list>',
              '</ion-content>',
            '
'
          ].join('');

          var popupPromise = $ionicTemplateLoader.compile({
            template: POPUP_TPL,
            scope: scope,
            appendTo: $document[0].body
          });

          scope.selectHit = function(hit) {
            scope.hit = hit;
            if (scope.onSelectHit) {
              scope.onSelectHit({selectedHit: hit});
            }
            scope.modal.element.css('display', 'none');
            $ionicBackdrop.release();
          };

          // prepare search filter from attrs
          var filter = '(' + scope.searchOperator;
          angular.forEach(scope.searchFilter, function(v, k) {
            if (angular.isDefined(v)) {
              filter += ' ' + k + ':"' + v + '"';
            }
          });
          filter += ')';

          // watch query and query freebase
          scope.$watch('searchQuery', function(query) {
            if (searchEventTimeout) $timeout.cancel(
              searchEventTimeout);
            searchEventTimeout = $timeout(function() {
              if (!query) return;
              if (query.length < 3);
              // build the filter from attrs
              freebase.search(query, {filter: filter}).then(function(response) {
                scope.hits = response.data.result;
              });
            }, 350); // we're throttling the input by 350ms to be nice to google's API
          });

          popupPromise.then(function(el) {
            scope.modal = el;
            var searchInputElement = angular.element(el.element.find(
              'input'));

            var onClick = function(e) {
              e.preventDefault();
              e.stopPropagation();
              $ionicBackdrop.retain();
              el.element.css('display', 'block');
              searchInputElement[0].focus();
              setTimeout(function() {
                searchInputElement[0].focus();
              }, 0);
            };

            var onCancel = function(e) {
              scope.searchQuery = '';
              $ionicBackdrop.release();
              el.element.css('display', 'none');
            };

            element.bind('click', onClick);
            element.bind('touchend', onClick);

            el.element.find('button').bind('click', onCancel);
          });

          if (attrs.placeholder) {
            element.attr('placeholder', attrs.placeholder);
          }

        }
      };
    }
  ]);


text:
package ru.joker.drools.model;

/**
 * JavaDoc here
 *
 * @author Victor Polischuk
 * @since 28.09.13 21:44
 */
public enum Tariff {
    SIMPLE, SMART
}


text:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.apache.sling</groupId>
        <artifactId>sling</artifactId>
        <version>19</version>
        <relativePath>../../../../parent/pom.xml</relativePath>
    </parent>
    <groupId>org.apache.sling</groupId>
    <artifactId>org.apache.sling.models.impl</artifactId>
    <packaging>bundle</packaging>
    <version>1.0.3-SNAPSHOT</version>
    <name>Sling Models Implementation</name>
    <description>Sling Models Implementation</description>
    <properties>
        <sling.java.version>6</sling.java.version>
    </properties>
    <scm>
        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/impl</connection>
        <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/impl</developerConnection>
        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl</url>
    </scm>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-scr-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Embed-Dependency>
                            *;scope=compile,
                            org.osgi.compendium;inline="org/osgi/util/tracker/*"</Embed-Dependency>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.models.api</artifactId>
            <version>1.0.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.compendium</artifactId>
            <version>4.2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.api</artifactId>
            <version>2.2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.scr.annotations</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <version>1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.9.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.commons.osgi</artifactId>
            <version>2.2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>1.8.3</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>
</project>


text:
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Reflection;
using System.Resources;

namespace Revenj.DatabasePersistence.Postgres.Npgsql
{
	public sealed class NpgsqlConnectionStringBuilder : DbConnectionStringBuilder
	{
		private static readonly ResourceManager resman = new ResourceManager(MethodBase.GetCurrentMethod().DeclaringType);
		private static readonly Dictionary<Keywords, object> defaults = new Dictionary<Keywords, object>();

		private string originalConnectionString;

		private const int POOL_SIZE_LIMIT = 1024;
		private const int TIMEOUT_LIMIT = 1024;
		internal const int DefaultCommandTimeout = 20;

		static NpgsqlConnectionStringBuilder()
		{
			defaults.Add(Keywords.Host, string.Empty);
			defaults.Add(Keywords.Port, 5432);
			defaults.Add(Keywords.Database, string.Empty);
			defaults.Add(Keywords.UserName, string.Empty);
			defaults.Add(Keywords.Password, string.Empty);
			defaults.Add(Keywords.SSL, false);
			defaults.Add(Keywords.SslMode, SslMode.Disable);
			defaults.Add(Keywords.Timeout, 15);
			defaults.Add(Keywords.SearchPath, string.Empty);
			defaults.Add(Keywords.Pooling, true);
			defaults.Add(Keywords.ConnectionLifeTime, 15);
			defaults.Add(Keywords.MinPoolSize, 1);
			defaults.Add(Keywords.MaxPoolSize, 20);
			defaults.Add(Keywords.SyncNotification, false);
			defaults.Add(Keywords.CommandTimeout, DefaultCommandTimeout);
			defaults.Add(Keywords.Enlist, false);
			defaults.Add(Keywords.PreloadReader, false);
			defaults.Add(Keywords.UseExtendedTypes, false);
			defaults.Add(Keywords.IntegratedSecurity, false);
			defaults.Add(Keywords.Compatible, THIS_VERSION);
			defaults.Add(Keywords.ApplicationName, string.Empty);
		}

		public NpgsqlConnectionStringBuilder()
		{
			this.Clear();
		}

		public NpgsqlConnectionStringBuilder(string connectionString)
		{
			this.Clear();
			this.originalConnectionString = connectionString;
			base.ConnectionString = connectionString;
		}

		/// <summary>
		/// Return an exact copy of this NpgsqlConnectionString.
		/// </summary>
		public NpgsqlConnectionStringBuilder Clone()
		{
			NpgsqlConnectionStringBuilder builder = new NpgsqlConnectionStringBuilder();
			foreach (string key in this.Keys)
			{
				builder[key] = this[key];
			}
			return builder;
		}

		#region Parsing Functions

		private static SslMode ToSslMode(object value)
		{
			if (value is SslMode)
			{
				return (SslMode)value;
			}
			else
			{
				return (SslMode)Enum.Parse(typeof(SslMode), value.ToString(), true);
			}
		}

		private static int ToInt32(object value, int min, int max, string key)
		{
			int v = Convert.ToInt32(value);
			if (v < min)
			{
				throw new ArgumentOutOfRangeException(String.Format(resman.GetString("Exception_IntegerKeyValMin"), key, min), key);
			}
			else if (v > max)
			{
				throw new ArgumentOutOfRangeException(String.Format(resman.GetString("Exception_IntegerKeyValMax"), key, max), key);
			}
			return v;
		}

		private static Boolean ToBoolean(object value)
		{
			string text = value as string;
			if (text != null)
			{
				switch (text.ToLowerInvariant())
				{
					case "t":
					case "true":
					case "y":
					case "yes":
						return true;

					case "f":
					case "false":
					case "n":
					case "no":
						return false;

					default:
						throw new InvalidCastException(value.ToString());
				}
			}
			else
			{
				return Convert.ToBoolean(value);
			}
		}

		private Boolean ToIntegratedSecurity(object value)
		{
			string text = value as string;
			if (text != null)
			{
				switch (text.ToLowerInvariant())
				{
					case "t":
					case "true":
					case "y":
					case "yes":
					case "sspi":
						return true;

					case "f":
					case "false":
					case "n":
					case "no":
						return false;

					default:
						throw new InvalidCastException(value.ToString());
				}
			}
			else
			{
				return Convert.ToBoolean(value);
			}
		}

		#endregion

		#region Properties

		private string _host;

		public string Host
		{
			get { return _host; }
			set { SetValue(GetKeyName(Keywords.Host), value); }
		}

		private int _port;

		public int Port
		{
			get { return _port; }
			set { SetValue(GetKeyName(Keywords.Port), value); }
		}

		private string _database;

		public string Database
		{
			get { return _database; }
			set { SetValue(GetKeyName(Keywords.Database), value); }
		}

		private string _username;

		public string UserName
		{
			get
			{
				if ((_integrated_security) && (String.IsNullOrEmpty(_username)))
				{
					System.Security.Principal.WindowsIdentity identity = System.Security.Principal.WindowsIdentity.GetCurrent();
					_username = identity.Name.Split('\\')[1];
				}
				return _username;
			}
			set { SetValue(GetKeyName(Keywords.UserName), value); }
		}

		private byte[] _password;

		public byte[] PasswordAsByteArray
		{
			get { return _password; }
			set { _password = value; }
		}

		public string Password
		{
			set { SetValue(GetKeyName(Keywords.Password), value); }
		}

		private bool _ssl;

		public bool SSL
		{
			get { return _ssl; }
			set { SetValue(GetKeyName(Keywords.SSL), value); }
		}

		private SslMode _sslmode;

		public SslMode SslMode
		{
			get { return _sslmode; }
			set { SetValue(GetKeyName(Keywords.SslMode), value); }
		}

		[Obsolete("UTF-8 is always used regardless of this setting.")]
		public string Encoding
		{
			get { return "UNICODE"; }
			//set { }
		}

		private int _timeout;

		public int Timeout
		{
			get { return _timeout; }
			set { SetValue(GetKeyName(Keywords.Timeout), value); }
		}

		private string _searchpath;

		public string SearchPath
		{
			get { return _searchpath; }
			set { SetValue(GetKeyName(Keywords.SearchPath), value); }
		}

		private bool _pooling;

		public bool Pooling
		{
			get { return _pooling; }
			set { SetValue(GetKeyName(Keywords.Pooling), value); }
		}

		private int _connection_life_time;

		public int ConnectionLifeTime
		{
			get { return _connection_life_time; }
			set { SetValue(GetKeyName(Keywords.ConnectionLifeTime), value); }
		}

		private int _min_pool_size;

		public int MinPoolSize
		{
			get { return _min_pool_size; }
			set { SetValue(GetKeyName(Keywords.MinPoolSize), value); }
		}

		private int _max_pool_size;

		public int MaxPoolSize
		{
			get { return _max_pool_size; }
			set { SetValue(GetKeyName(Keywords.MaxPoolSize), value); }
		}

		private bool _sync_notification;

		public bool SyncNotification
		{
			get { return _sync_notification; }
			set { SetValue(GetKeyName(Keywords.SyncNotification), value); }
		}

		private int _command_timeout;

		public int CommandTimeout
		{
			get { return _command_timeout; }
			set { SetValue(GetKeyName(Keywords.CommandTimeout), value); }
		}

		private bool _enlist;

		public bool Enlist
		{
			get { return _enlist; }
			set { SetValue(GetKeyName(Keywords.Enlist), value); }
		}

		private bool _preloadReader;

		public bool PreloadReader
		{
			get { return _preloadReader; }
			set { SetValue(GetKeyName(Keywords.PreloadReader), value); }
		}

		private bool _useExtendedTypes;

		public bool UseExtendedTypes
		{
			get { return _useExtendedTypes; }
			set { SetValue(GetKeyName(Keywords.UseExtendedTypes), value); }
		}

		private bool _integrated_security;

		public bool IntegratedSecurity
		{
			get { return _integrated_security; }
			set { SetValue(GetKeyName(Keywords.IntegratedSecurity), value); }
		}

		private Version _compatible;
		private static readonly Version THIS_VERSION = MethodBase.GetCurrentMethod().DeclaringType.Assembly.GetName().Version;
		/// <summary>
		/// Compatibilty version. When possible, behaviour caused by breaking changes will be preserved
		/// if this version is less than that where the breaking change was introduced.
		/// </summary>
		public Version Compatible
		{
			get { return _compatible; }
			set { SetValue(GetKeyName(Keywords.Compatible), value); }
		}

		private string _application_name;

		public string ApplicationName
		{
			get { return _application_name; }
			set { SetValue(GetKeyName(Keywords.ApplicationName), value); }
		}

		#endregion

		private static Keywords GetKey(string key)
		{
			switch (key.ToUpperInvariant())
			{
				case "HOST":
				case "SERVER":
					return Keywords.Host;
				case "PORT":
					return Keywords.Port;
				case "DATABASE":
				case "DB":
					return Keywords.Database;
				case "USERNAME":
				case "USER NAME":
				case "USER":
				case "USERID":
				case "USER ID":
				case "UID":
					return Keywords.UserName;
				case "PASSWORD":
				case "PSW":
				case "PWD":
					return Keywords.Password;
				case "SSL":
					return Keywords.SSL;
				case "SSLMODE":
					return Keywords.SslMode;
				case "ENCODING":
#pragma warning disable 618
					return Keywords.Encoding;
#pragma warning restore 618
				case "TIMEOUT":
					return Keywords.Timeout;
				case "SEARCHPATH":
					return Keywords.SearchPath;
				case "POOLING":
					return Keywords.Pooling;
				case "CONNECTIONLIFETIME":
					return Keywords.ConnectionLifeTime;
				case "MINPOOLSIZE":
					return Keywords.MinPoolSize;
				case "MAXPOOLSIZE":
					return Keywords.MaxPoolSize;
				case "SYNCNOTIFICATION":
					return Keywords.SyncNotification;
				case "COMMANDTIMEOUT":
					return Keywords.CommandTimeout;
				case "ENLIST":
					return Keywords.Enlist;
				case "PRELOADREADER":
				case "PRELOAD READER":
					return Keywords.PreloadReader;
				case "USEEXTENDEDTYPES":
				case "USE EXTENDED TYPES":
					return Keywords.UseExtendedTypes;
				case "INTEGRATED SECURITY":
					return Keywords.IntegratedSecurity;
				case "COMPATIBLE":
					return Keywords.Compatible;
				case "APPLICATIONNAME":
					return Keywords.ApplicationName;
				default:
					throw new ArgumentException(resman.GetString("Exception_WrongKeyVal"), key);
			}
		}

		internal static string GetKeyName(Keywords keyword)
		{
			switch (keyword)
			{
				case Keywords.Host:
					return "HOST";
				case Keywords.Port:
					return "PORT";
				case Keywords.Database:
					return "DATABASE";
				case Keywords.UserName:
					return "USER ID";
				case Keywords.Password:
					return "PASSWORD";
				case Keywords.SSL:
					return "SSL";
				case Keywords.SslMode:
					return "SSLMODE";
				case Keywords.Encoding:
					return "ENCODING";
				case Keywords.Timeout:
					return "TIMEOUT";
				case Keywords.SearchPath:
					return "SEARCHPATH";
				case Keywords.Pooling:
					return "POOLING";
				case Keywords.ConnectionLifeTime:
					return "CONNECTIONLIFETIME";
				case Keywords.MinPoolSize:
					return "MINPOOLSIZE";
				case Keywords.MaxPoolSize:
					return "MAXPOOLSIZE";
				case Keywords.SyncNotification:
					return "SYNCNOTIFICATION";
				case Keywords.CommandTimeout:
					return "COMMANDTIMEOUT";
				case Keywords.Enlist:
					return "ENLIST";
				case Keywords.PreloadReader:
					return "PRELOADREADER";
				case Keywords.UseExtendedTypes:
					return "USEEXTENDEDTYPES";
				case Keywords.IntegratedSecurity:
					return "INTEGRATED SECURITY";
				case Keywords.Compatible:
					return "COMPATIBLE";
				default:
					return keyword.ToString().ToUpperInvariant();
			}
		}

		internal static object GetDefaultValue(Keywords keyword)
		{
			return defaults[keyword];
		}

		/// <summary>
		/// Case insensative accessor for indivual connection string values.
		/// </summary>
		public override object this[string keyword]
		{
			get { return this[GetKey(keyword)]; }
			set { this[GetKey(keyword)] = value; }
		}

		public object this[Keywords keyword]
		{
			get { return base[GetKeyName(keyword)]; }
			set { SetValue(GetKeyName(keyword), value); }
		}

		public override bool Remove(string keyword)
		{
			Keywords key = GetKey(keyword);
			SetValue(key, defaults[key]);
			return base.Remove(keyword);
		}

		public bool ContainsKey(Keywords keyword)
		{
			return base.ContainsKey(GetKeyName(keyword));
		}

		/// <summary>
		/// This function will set value for known key, both private member and base[key].
		/// </summary>
		/// <param name="keyword"></param>
		/// <param name="value"></param>
		private void SetValue(string keyword, object value)
		{
			if (value == null)
			{
				Remove(keyword);
			}
			else
			{
				Keywords key = GetKey(keyword);
				SetValue(key, value);
				if (key == Keywords.Compatible)
				{
					base[GetKeyName(key)] = ((Version)this.Compatible).ToString();
				}
				else
				{
					base[GetKeyName(key)] = value;
				}
			}
		}

		/// <summary>
		/// The function will modify private member only, not base[key].
		/// </summary>
		/// <param name="keyword"></param>
		/// <param name="value"></param>
		private void SetValue(Keywords keyword, object value)
		{
			string key_name = GetKeyName(keyword);

			try
			{
				switch (keyword)
				{
					case Keywords.Host:
						this._host = Convert.ToString(value);
						break;
					case Keywords.Port:
						this._port = Convert.ToInt32(value);
						break;
					case Keywords.Database:
						this._database = Convert.ToString(value);
						break;
					case Keywords.UserName:
						this._username = Convert.ToString(value);
						break;
					case Keywords.Password:
						this._password = System.Text.Encoding.UTF8.GetBytes(Convert.ToString(value));
						break;
					case Keywords.SSL:
						this._ssl = ToBoolean(value);
						break;
					case Keywords.SslMode:
						this._sslmode = ToSslMode(value);
						break;
#pragma warning disable 618
					case Keywords.Encoding:
						break;
#pragma warning restore 618
					case Keywords.Timeout:
						this._timeout = ToInt32(value, 0, TIMEOUT_LIMIT, key_name);
						break;
					case Keywords.SearchPath:
						this._searchpath = Convert.ToString(value);
						break;
					case Keywords.Pooling:
						this._pooling = ToBoolean(value);
						break;
					case Keywords.ConnectionLifeTime:
						this._connection_life_time = Convert.ToInt32(value);
						break;
					case Keywords.MinPoolSize:
						this._min_pool_size = (MaxPoolSize > 0) ? ToInt32(value, 0, MaxPoolSize, key_name) : Convert.ToInt32(value);
						break;
					case Keywords.MaxPoolSize:
						this._max_pool_size = ToInt32(value, 0, POOL_SIZE_LIMIT, key_name);
						break;
					case Keywords.SyncNotification:
						this._sync_notification = ToBoolean(value);
						break;
					case Keywords.CommandTimeout:
						this._command_timeout = Convert.ToInt32(value);
						break;
					case Keywords.Enlist:
						this._enlist = ToBoolean(value);
						break;
					case Keywords.PreloadReader:
						this._preloadReader = ToBoolean(value);
						break;
					case Keywords.UseExtendedTypes:
						this._useExtendedTypes = ToBoolean(value);
						break;
					case Keywords.IntegratedSecurity:
						this._integrated_security = ToIntegratedSecurity(value);
						break;
					case Keywords.Compatible:
						Version ver = new Version(value.ToString());
						if (ver > THIS_VERSION)
							throw new ArgumentException("Attempt to set compatibility with version " + value + " when using version " + THIS_VERSION);
						_compatible = ver;
						break;
					case Keywords.ApplicationName:
						this._application_name = Convert.ToString(value);
						break;
				}
			}
			catch (InvalidCastException exception)
			{
				string exception_template = string.Empty;
				switch (keyword)
				{
					case Keywords.Port:
					case Keywords.Timeout:
					case Keywords.ConnectionLifeTime:
					case Keywords.MinPoolSize:
					case Keywords.MaxPoolSize:
					case Keywords.CommandTimeout:
						exception_template = resman.GetString("Exception_InvalidIntegerKeyVal");
						break;
					case Keywords.SSL:
					case Keywords.Pooling:
					case Keywords.SyncNotification:
						exception_template = resman.GetString("Exception_InvalidBooleanKeyVal");
						break;
				}
				if (!string.IsNullOrEmpty(exception_template))
				{
					throw new ArgumentException(string.Format(exception_template, key_name), key_name, exception);
				}
				throw;
			}
		}

		/// <summary>
		/// Clear the member and assign them to the default value.
		/// </summary>
		public override void Clear()
		{
			base.Clear();
			foreach (Keywords keyword in defaults.Keys)
			{
				SetValue(GetKeyName(keyword), defaults[keyword]);
			}
		}
	}

	public enum Keywords
	{
		Host,
		Port,
		Database,
		UserName,
		Password,
		SSL,
		SslMode,
		[Obsolete("UTF-8 is always used regardless of this setting.")]
		Encoding,
		Timeout,
		SearchPath,
		//	These are for the connection pool
		Pooling,
		ConnectionLifeTime,
		MinPoolSize,
		MaxPoolSize,
		SyncNotification,
		// These are for the command
		CommandTimeout,
		// These are for the resource manager
		Enlist,
		PreloadReader,
		UseExtendedTypes,
		IntegratedSecurity,
		Compatible,
		ApplicationName
	}

	public enum SslMode
	{
		Disable = 1 << 0,
		Allow = 1 << 1,
		Prefer = 1 << 2,
		Require = 1 << 3
	}
}


text:
/**
 * @author Pavel Dolgov
 */
package org.apache.harmony.awt.datatransfer;

import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.SystemFlavorMap;
import java.io.InputStream;
import java.io.Reader;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;

/**
 * TextFlavor
 */
public class TextFlavor {

    public static final Class<?>[] unicodeTextClasses = {
            String.class, Reader.class, CharBuffer.class, char[].class };

    public static final Class<?>[] charsetTextClasses = {
            InputStream.class, ByteBuffer.class, byte[].class };

    public static void addUnicodeClasses(SystemFlavorMap fm,
                                         String nat,
                                         String subType) {
        for (int i = 0; i < unicodeTextClasses.length; i++) {
            String type = "text/" + subType; //$NON-NLS-1$
            String params = ";class=\"" +  //$NON-NLS-1$
                    unicodeTextClasses[i].getName() + "\""; //$NON-NLS-1$
            DataFlavor f = new DataFlavor(type + params, type);
            fm.addFlavorForUnencodedNative(nat, f);
            fm.addUnencodedNativeForFlavor(f, nat);
        }
    }

    public static void addCharsetClasses(SystemFlavorMap fm,
                                         String nat,
                                         String subType,
                                         String charset) {
        for (int i = 0; i < charsetTextClasses.length; i++) {
            String type = "text/" + subType; //$NON-NLS-1$
            String params = ";class=\"" +  //$NON-NLS-1$
                    charsetTextClasses[i].getName() + "\"" +  //$NON-NLS-1$
                    ";charset=\"" + charset + "\""; //$NON-NLS-1$ //$NON-NLS-2$
            DataFlavor f = new DataFlavor(type + params, type);
            fm.addFlavorForUnencodedNative(nat, f);
            fm.addUnencodedNativeForFlavor(f, nat);
        }
    }
}


text:
<?php

namespace AppBundle\Tests\Functional\DataFixtures;

use AppBundle\Entity\Role;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\Persistence\ObjectManager;

class LoadRoleData extends AbstractFixture
{
    /**
     * {@inheritDoc}
     */
    public function load(ObjectManager $manager)
    {
        foreach (['ROLE_OPERATOR', 'ROLE_MANAGER', 'ROLE_ADMIN'] as $role) {
            $entity = new Role();
            $entity->setRole($role);
            $manager->persist($entity);
            $this->addReference(strtolower(preg_replace('/^ROLE_/', '', $role)) . '-role', $entity);
        }

        $manager->flush();
    }
}


text:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /m:8 /p:Configuration=Release "Shock.sln"

REM For building symbols
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /m:8 /p:Configuration=Debug "Shock.sln"


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>/home/pavm/programming/lib/gft/include/gft_string.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

Main Page

Namespaces

Classes

Files

File List

File Members

include

gft_string.h

Go to the documentation of this file.

    1

    2 #ifndef _GFT_STRING_H_

    3 #define _GFT_STRING_H_

    4

    5 #include "gft_common.h"

    6

    7 namespace gft{

    8   namespace String{

    9

   10     //Removes the leading and trailing white space.

   11     void      Trim(char *str);

   12     void      SubString(char *str,

   13                         int beginIndex,

   14                         int endIndex);

   15     void      ReplaceCharacter(char *str,

   16                                char old_c,

   17                                char new_c);

   18

   19   } //end String namespace

   20 } //end gft namespace

   21

   22

   23 #endif

   24

   25

   26

gft_common.h

Header file for common definitions and function prototypes.

gft::String::Trim

void Trim(char *str)

Definition: gft_string.cpp:7

gft::String::SubString

void SubString(char *str, int beginIndex, int endIndex)

Definition: gft_string.cpp:43

gft::String::ReplaceCharacter

void ReplaceCharacter(char *str, char old_c, char new_c)

Definition: gft_string.cpp:63

<address class="footer">
Generated on Wed Feb 25 2015 10:27:50 by

 1.8.6
</address>


text:
'use strict';

var ExplorePageStore = require('../../../js/stores/ExplorePageStore');
var PageActions      = require('../../../js/actions/PageActions');

describe('Store: ExplorePage', function() {

  beforeEach(function(done) {
    this.timeout(10000);
    ExplorePageStore.courses = {
      newest: [],
      trending: [],
      results: []
    };
    done();
  });

  it('should be empty on init', function(done) {
    ExplorePageStore.courses.should.be.instanceOf(Object);
    ExplorePageStore.courses.should.have.property('newest');
    ExplorePageStore.courses.should.have.property('trending');
    ExplorePageStore.courses.should.have.property('results');
    ExplorePageStore.courses.newest.length.should.equal(0);
    ExplorePageStore.courses.trending.length.should.equal(0);
    ExplorePageStore.courses.results.length.should.equal(0);
    done();
  });

  it('should load initial courses on action', function(done) {
    PageActions.openExplore(function(err) {
      (err === null).should.be.true; // jshint ignore:line
      ExplorePageStore.courses.should.be.instanceOf(Object);
      ExplorePageStore.courses.should.have.property('newest');
      ExplorePageStore.courses.should.have.property('trending');
      ExplorePageStore.courses.newest.length.should.be.above(0);
      ExplorePageStore.courses.trending.length.should.be.above(0);
      done();
    });
  });

  it('should get results on action', function(done) {
    PageActions.searchAllCourses('computer', function(err) {
      (err === null).should.be.true; // jshint ignore:line
      ExplorePageStore.courses.should.be.instanceOf(Object);
      ExplorePageStore.courses.should.have.property('results');
      ExplorePageStore.courses.results.length.should.be.above(0);
      done();
    });
  });

});


text:
package com.apm4all.tracy;

public class TracyPublisherFactory {
	static private TracyPublisher tracyPublisher = null;
	static String DEFAULT_RESOURCE_PATH = "tracy/segment";
	static public enum Type {
		NOOP,
		HTTP_CLIENT
		// TODO: ,LOG_FILE
		}
	public static TracyPublisher getInstance()	{
		// This method should only be called after the TracyPublisher is built

		if (tracyPublisher != null)	{
			return tracyPublisher;
		}
		else	{
			tracyPublisher = new TracyNoopPublisher();

		}
		return tracyPublisher;
	}

	public static class Builder {
		private Type type;
		// HTTP_CLIENT options
		private String hostname = null;
		private int port = 0;
		private  boolean waitForResponse = false;
		private String resourcePath = DEFAULT_RESOURCE_PATH;
		private boolean debug = false;
		private HttpProxyConfig httpProxyConfig = new HttpProxyConfig();

		public Builder(Type type)	{
			this.type = type;
		}
		private boolean validHostname()	{
			return (hostname != null);
		}
		private boolean validPort() {
			return (port != 0);
		}
		public Builder hostname(String val)
			{ hostname = val; return this; }
		public Builder port(int val)
			{ port = val; return this; }
		public Builder waitForResponse(boolean val)
			{ waitForResponse = val; return this; }
		public Builder resourcePath(String val)
			{ resourcePath = val; return this; }
		public Builder httpProxyConfig(String proxyHost, int proxyPort, String username, String password)
			{ httpProxyConfig = new HttpProxyConfig(proxyHost, proxyPort, username, password); return this; }
		public Builder debug(boolean val) {
			{ debug = val; return this; }
		}

		public TracyPublisher build()	{
			switch (type)	{
			case HTTP_CLIENT:
				if (validHostname() && validPort())	{
					TracyPublisherFactory.tracyPublisher =
							new TracyAsyncHttpClientPublisher(hostname, port, waitForResponse, resourcePath, httpProxyConfig, debug);
				}
				else	{
					// Create a noop published in case the client ignores the exception
					TracyPublisherFactory.tracyPublisher = new TracyNoopPublisher();
					if (!validHostname())	{
						throw new IllegalStateException("No/Invalid host supplied");
					}
					if (!validPort())	{
						throw new IllegalStateException("No/Invalid port supplied");
					}
				}
				break;

			case NOOP:
				TracyPublisherFactory.tracyPublisher = new TracyNoopPublisher();
				break;

			default:
				break;
			}
			return null;
		}
	}
}


text:
<!DOCTYPE html>

    <title>端末画面の向き</title>

端末画面の向き

        端末画面の向きは、お使いの端末でサポートされていません。

回転データ

        アルファ:
 ベータ:
 ガンマ:

        最終更新日:


text:
package com.rwtema.extrautils;

import com.rwtema.extrautils.helper.XURandom;
import net.minecraft.entity.monster.EntityGiantZombie;
import net.minecraft.entity.monster.EntitySilverfish;
import net.minecraft.entity.monster.EntityWitch;
import net.minecraft.entity.monster.EntityPigZombie;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.monster.EntityCaveSpider;
import net.minecraft.entity.monster.EntitySpider;
import cpw.mods.fml.common.eventhandler.Event;
import net.minecraft.potion.Potion;
import net.minecraftforge.event.entity.living.LivingSpawnEvent;
import net.minecraft.util.DamageSource;
import net.minecraft.entity.EntityLivingBase;
import net.minecraftforge.event.entity.living.LivingEvent;
import java.util.Collection;
import net.minecraft.entity.EnumCreatureType;
import net.minecraftforge.event.world.WorldEvent;
import com.rwtema.extrautils.network.packets.PacketTempChat;
import net.minecraft.tileentity.TileEntityHopper;
import net.minecraft.tileentity.TileEntityBeacon;
import net.minecraft.entity.monster.EntityIronGolem;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
import net.minecraft.item.Item;
import java.util.HashSet;
import net.minecraftforge.oredict.OreDictionary;
import java.util.Iterator;
import net.minecraft.potion.PotionEffect;
import net.minecraft.init.Items;
import com.rwtema.extrautils.helper.XUHelper;
import net.minecraft.inventory.IInventory;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import java.util.ArrayList;
import net.minecraftforge.common.DimensionManager;
import com.rwtema.extrautils.item.ItemDivisionSigil;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.ChatComponentText;
import net.minecraft.server.MinecraftServer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.world.World;
import java.util.Random;
import net.minecraft.item.ItemStack;
import net.minecraft.world.biome.BiomeGenBase;
import java.util.List;

public class EventHandlerSiege
{
    public static final int numKills = 100;
    public static final int[] ddx;
    public static final int[] ddz;
    public static List<String> SiegeParticipants;
    public static List<BiomeGenBase.SpawnListEntry> mobSpawns;
    public static ItemStack[] earthItems;
    public static ItemStack[] fireItems;
    private static Random rand;

    public static void endSiege(final World world, final boolean announce) {
        if (world.isRemote) {
            return;
        }
        for (int i = 0; i < world.loadedEntityList.size(); ++i) {
            if (world.loadedEntityList.get(i) instanceof EntityMob && ((Entity)world.loadedEntityList.get(i)).getEntityData().hasKey("Siege")) {
                world.removeEntity((Entity)world.loadedEntityList.get(i));
            }
        }
        if (announce) {
            MinecraftServer.getServer().getConfigurationManager().sendChatMsg((IChatComponent)new ChatComponentText("The Siege has ended in 'The End'"));
        }
    }

    public static void upgradeSigil(final EntityPlayer player) {
        for (int j = 0; j < player.inventory.mainInventory.length; ++j) {
            if (player.inventory.mainInventory[j] != null && player.inventory.mainInventory[j].getItem() == ExtraUtils.divisionSigil) {
                if (player.inventory.mainInventory[j].hasTagCompound() && player.inventory.mainInventory[j].getTagCompound().hasKey("damage")) {
                    player.inventory.mainInventory[j] = ItemDivisionSigil.newStableSigil();
                }
                return;
            }
        }
    }

    public static void beginSiege(final World world) {
        if (world.isRemote) {
            return;
        }
        if (world.provider.dimensionId != 1) {
            return;
        }
        for (int i = 0; i < world.loadedEntityList.size(); ++i) {
            if (world.loadedEntityList.get(i) instanceof EntityMob) {
                world.removeEntity((Entity)world.loadedEntityList.get(i));
            }
            else if (world.loadedEntityList.get(i) instanceof EntityPlayer) {
                final EntityPlayer player = (EntityPlayer)world.loadedEntityList.get(i);
                EventHandlerSiege.SiegeParticipants.add(player.getGameProfile().getName());
                player.getEntityData().setInteger("SiegeKills", 0);
            }
        }
        if (EventHandlerSiege.SiegeParticipants.size() != 0) {
            MinecraftServer.getServer().getConfigurationManager().sendChatMsg((IChatComponent)new ChatComponentText("The Siege has begun in 'The End'"));
        }
        else {
            endSiege(world, false);
        }
    }

    public static boolean hasSigil(final EntityPlayer player) {
        for (int j = 0; j < player.inventory.mainInventory.length; ++j) {
            if (player.inventory.mainInventory[j] != null && player.inventory.mainInventory[j].getItem() == ExtraUtils.divisionSigil && player.inventory.mainInventory[j].hasTagCompound() && player.inventory.mainInventory[j].getTagCompound().hasKey("damage")) {
                return true;
            }
        }
        return false;
    }

    public static void checkPlayers() {
        final World worldObj = (World)DimensionManager.getWorld(1);
        if (worldObj == null || worldObj.isRemote) {
            EventHandlerSiege.SiegeParticipants.clear();
            return;
        }
        if (EventHandlerSiege.SiegeParticipants.size() > 0) {
            for (int i = 0; i < EventHandlerSiege.SiegeParticipants.size(); ++i) {
                if (worldObj.getPlayerEntityByName((String)EventHandlerSiege.SiegeParticipants.get(i)) == null) {
                    EventHandlerSiege.SiegeParticipants.remove(EventHandlerSiege.SiegeParticipants.get(i));
                    --i;
                }
            }
            if (EventHandlerSiege.SiegeParticipants.size() == 0) {
                endSiege(worldObj, true);
            }
        }
    }

    public static int[] getStrength(final World world, final int x, final int y, final int z) {
        final List<ChunkPos> rs = new ArrayList<ChunkPos>();
        final List<ChunkPos> st = new ArrayList<ChunkPos>();
        rs.add(new ChunkPos(x, y, z));
        st.add(new ChunkPos(x, y, z));
        int maxDist = 0;
        final Block rsId = (Block)Blocks.redstone_wire;
        final Block stId = Blocks.tripwire;
        int k2 = 0;
        for (int i = 0; i < rs.size(); ++i) {
            for (int j = 0; j < 4; ++j) {
                final ChunkPos nPos = new ChunkPos(rs.get(i).x + EventHandlerSiege.ddx[j], y, rs.get(i).z + EventHandlerSiege.ddz[j]);
                final int m = mDist(nPos.x - x, nPos.z - z);
                if (m < 16 && world.getBlock(nPos.x, y, nPos.z) == rsId && !rs.contains(nPos)) {
                    rs.add(nPos);
                    if (world.getBlockMetadata(nPos.x, y, nPos.z) != 0) {
                        ++k2;
                    }
                    if (m > maxDist) {
                        maxDist = m;
                    }
                }
            }
        }
        rs.remove(new ChunkPos(x, y, z));
        int l = 0;
        for (int i2 = 0; i2 < st.size(); ++i2) {
            for (int j2 = 0; j2 < 4; ++j2) {
                final ChunkPos nPos2 = new ChunkPos(st.get(i2).x + EventHandlerSiege.ddx[j2], y, st.get(i2).z + EventHandlerSiege.ddz[j2]);
                final int m2 = mDist(nPos2.x - x, nPos2.z - z);
                if (m2 < 16) {
                    if (world.getBlock(nPos2.x, y, nPos2.z) == stId && !st.contains(nPos2)) {
                        st.add(nPos2);
                        if (m2 > maxDist) {
                            maxDist = m2;
                        }
                    }
                    else if (i2 != 0 && world.getBlock(nPos2.x, y, nPos2.z) == rsId && rs.contains(nPos2)) {
                        ++l;
                    }
                }
            }
        }
        return new int[] { l, maxDist * maxDist * 4 };
    }

    public static int mDist(int x, int z) {
        if (x < 0) {
            x *= -1;
        }
        if (z < 0) {
            z *= -1;
        }
        return (x > z) ? x : z;
    }

    public static int checkChestList(final IInventory chest, final ItemStack[] items, final boolean destroy) {
        final boolean[] check = new boolean[items.length];
        int s = 0;
        for (int i = 0; i < chest.getSizeInventory() && s < items.length; ++i) {
            if (chest.getStackInSlot(i) != null) {
                for (int j = 0; j < items.length && (!destroy || chest.getStackInSlot(i) != null); ++j) {
                    if (!check[j] && XUHelper.canItemsStack(items[j], chest.getStackInSlot(i), false, true)) {
                        if (destroy) {
                            chest.setInventorySlotContents(i, (ItemStack)null);
                        }
                        check[j] = true;
                        ++s;
                        break;
                    }
                }
            }
        }
        return s;
    }

    public static int checkChestEarth(final IInventory chest, final boolean destroy) {
        if (chest == null) {
            return 0;
        }
        if (EventHandlerSiege.earthItems == null) {
            EventHandlerSiege.earthItems = new ItemStack[] { new ItemStack(Blocks.coal_ore), new ItemStack(Blocks.gold_ore), new ItemStack(Blocks.iron_ore), new ItemStack(Blocks.lapis_ore), new ItemStack(Blocks.diamond_ore), new ItemStack(Blocks.emerald_ore), new ItemStack(Blocks.redstone_ore), new ItemStack((Block)Blocks.grass), new ItemStack(Blocks.dirt), new ItemStack(Blocks.clay), new ItemStack((Block)Blocks.sand), new ItemStack(Blocks.gravel), new ItemStack(Blocks.obsidian) };
        }
        return checkChestList(chest, EventHandlerSiege.earthItems, destroy);
    }

    public static int checkChestFire(final IInventory chest, final boolean destroy) {
        if (chest == null) {
            return 0;
        }
        if (EventHandlerSiege.fireItems == null) {
            EventHandlerSiege.fireItems = new ItemStack[] { new ItemStack(Items.coal, 1, 1), new ItemStack(Blocks.stone), new ItemStack(Items.brick), new ItemStack(Items.cooked_fished), new ItemStack(Blocks.glass), new ItemStack(Items.gold_ingot), new ItemStack(Items.iron_ingot), new ItemStack(Items.baked_potato), new ItemStack(Items.netherbrick), new ItemStack(Items.dye, 1, 2), new ItemStack(Blocks.hardened_clay), new ItemStack(Items.cooked_porkchop), new ItemStack(Items.cooked_beef), new ItemStack(Items.cooked_chicken) };
        }
        return checkChestList(chest, EventHandlerSiege.fireItems, destroy);
    }

    public static int checkChestWater(final IInventory chest, final boolean destroy) {
        if (chest == null) {
            return 0;
        }
        final List<PotionEffect> numEffects = new ArrayList<PotionEffect>();
        for (int i = 0; i < chest.getSizeInventory() && numEffects.size() < 12; ++i) {
            if (chest.getStackInSlot(i) != null && chest.getStackInSlot(i).getItem() == Items.potionitem) {
                final List temp = Items.potionitem.getEffects(chest.getStackInSlot(i));
                if (temp != null) {
                    for (final Object aTemp : temp) {
                        if (!numEffects.contains(aTemp)) {
                            numEffects.add((PotionEffect)aTemp);
                            if (!destroy) {
                                continue;
                            }
                            chest.setInventorySlotContents(i, (ItemStack)null);
                        }
                    }
                }
            }
        }
        return numEffects.size();
    }

    public static int checkChestAir(final IInventory chest, final boolean destroy) {
        if (chest == null) {
            return 0;
        }
        int s = 0;
        final List<ItemStack> pt = (List<ItemStack>)OreDictionary.getOres("record");
        final HashSet<Item> items = new HashSet<Item>();
        for (int i = 0; i < chest.getSizeInventory() && s < 12; ++i) {
            if (chest.getStackInSlot(i) != null) {
                final ItemStack item = chest.getStackInSlot(i);
                if (!items.contains(item.getItem())) {
                    boolean flag = false;
                    for (final ItemStack ore : pt) {
                        if (OreDictionary.itemMatches(item, ore, false)) {
                            flag = true;
                            break;
                        }
                    }
                    if (flag) {
                        if (destroy) {
                            chest.setInventorySlotContents(i, (ItemStack)null);
                        }
                        items.add(item.getItem());
                        ++s;
                    }
                }
            }
        }
        return s;
    }

    @SubscribeEvent
    public void Siege(final EntityJoinWorldEvent event) {
        if (event.world.isRemote) {
            return;
        }
        checkPlayers();
        if (event.entity instanceof EntityPlayer) {
            if (event.world.provider.dimensionId != 1) {
                if (event.entity.getEntityData().hasKey("SiegeKills")) {
                    event.entity.getEntityData().removeTag("SiegeKills");
                    EventHandlerSiege.SiegeParticipants.remove(((EntityPlayer)event.entity).getGameProfile().getName());
                }
            }
            else if (event.entity.getEntityData().hasKey("SiegeKills") && !EventHandlerSiege.SiegeParticipants.contains(((EntityPlayer)event.entity).getGameProfile().getName())) {
                EventHandlerSiege.SiegeParticipants.add(((EntityPlayer)event.entity).getGameProfile().getName());
            }
        }
    }

    public double sq(final double x, final double y, final double z) {
        return x * x + z * z + y * y;
    }

    @SubscribeEvent
    public void golemDeath(final LivingDeathEvent event) {
        if (!event.entity.worldObj.isRemote && event.entity.worldObj.provider.dimensionId == 1 && event.entity instanceof EntityIronGolem && event.source.getSourceOfDamage() instanceof EntityPlayer) {
            final EntityPlayer player = (EntityPlayer)event.source.getSourceOfDamage();
            if (!hasSigil(player)) {
                return;
            }
            final List t = event.entity.worldObj.loadedTileEntityList;
            for (final Object aT : t) {
                if (aT.getClass().equals(TileEntityBeacon.class)) {
                    final TileEntityBeacon beacon = (TileEntityBeacon)aT;
                    final int x = beacon.xCoord;
                    final int y = beacon.yCoord;
                    final int z = beacon.zCoord;
                    if (this.sq(event.entity.posX - x - 0.5, event.entity.posY - y - 0.5, event.entity.posZ - z - 0.5) >= 300.0) {
                        continue;
                    }
                    final int[] s = getStrength(event.entity.worldObj, x, y, z);
                    final World world = beacon.getWorldObj();
                    if (s[0] != 64) {
                        continue;
                    }
                    final int debug = 1;
                    boolean flag = true;
                    if (checkChestFire(TileEntityHopper.func_145893_b(world, (double)x, (double)y, (double)(z - 5)), false) < debug) {
                        flag = false;
                    }
                    if (flag && checkChestEarth(TileEntityHopper.func_145893_b(world, (double)x, (double)y, (double)(z + 5)), false) < debug) {
                        flag = false;
                    }
                    if (flag && checkChestAir(TileEntityHopper.func_145893_b(world, (double)(x - 5), (double)y, (double)z), false) < debug) {
                        flag = false;
                    }
                    if (flag && checkChestWater(TileEntityHopper.func_145893_b(world, (double)(x + 5), (double)y, (double)z), false) < debug) {
                        flag = false;
                    }
                    if (flag) {
                        world.func_147480_a(x, y, z, false);
                        for (int j = 0; j < 4; ++j) {
                            world.func_147480_a(x + EventHandlerSiege.ddx[j] * 5, y, z + EventHandlerSiege.ddz[j] * 5, false);
                        }
                        world.func_147480_a(x, y, z, false);
                        world.createExplosion((Entity)null, (double)x, (double)y, (double)z, 6.0f, true);
                        for (int j = 0; j < 4; ++j) {
                            world.createExplosion((Entity)null, (double)(x + EventHandlerSiege.ddx[j] * 5), (double)y, (double)(z + EventHandlerSiege.ddz[j] * 5), 3.0f, true);
                        }
                        beginSiege(world);
                        return;
                    }
                    continue;
                }
            }
        }
    }

    @SubscribeEvent
    public void SiegeDeath(final LivingDeathEvent event) {
        if (EventHandlerSiege.SiegeParticipants.isEmpty()) {
            return;
        }
        if (event.entityLiving.worldObj.isRemote || event.entityLiving.worldObj.provider.dimensionId != 1) {
            return;
        }
        if (event.entityLiving instanceof EntityPlayer) {
            checkPlayers();
        }
        if (event.entityLiving instanceof EntityMob && event.source.getSourceOfDamage() instanceof EntityPlayer && event.entityLiving.getEntityData().hasKey("Siege")) {
            final EntityPlayer player = (EntityPlayer)event.source.getSourceOfDamage();
            if (player != null && EventHandlerSiege.SiegeParticipants.contains(player.getGameProfile().getName()) && hasSigil(player)) {
                if (player.getEntityData().hasKey("SiegeKills")) {
                    player.getEntityData().setInteger("SiegeKills", player.getEntityData().getInteger("SiegeKills") + 1);
                }
                else {
                    player.getEntityData().setInteger("SiegeKills", 1);
                }
                final int kills = player.getEntityData().getInteger("SiegeKills");
                if (kills > 100) {
                    upgradeSigil(player);
                    player.getEntityData().removeTag("SiegeKills");
                    EventHandlerSiege.SiegeParticipants.remove(player.getGameProfile().getName());
                    PacketTempChat.sendChat(player, "Your Sigil has stabilized");
                }
                else {
                    PacketTempChat.sendChat(player, "Kills: " + player.getEntityData().getInteger("SiegeKills"));
                }
            }
        }
        else if (!(event.entityLiving instanceof EntityPlayer) || EventHandlerSiege.SiegeParticipants.contains(((EntityPlayer)event.entityLiving).getGameProfile().getName())) {}
    }

    @SubscribeEvent
    public void SiegePotentialSpawns(final WorldEvent.PotentialSpawns event) {
        if (!event.world.isRemote && event.world.provider.dimensionId == 1 && event.type == EnumCreatureType.monster) {
            checkPlayers();
            if (EventHandlerSiege.SiegeParticipants.isEmpty()) {
                event.list.removeAll(EventHandlerSiege.mobSpawns);
            }
            else if (event.list.size() < EventHandlerSiege.mobSpawns.size()) {
                event.list.addAll(EventHandlerSiege.mobSpawns);
            }
        }
    }

    @SubscribeEvent
    public void Siege(final LivingEvent.LivingUpdateEvent event) {
        if (event.entity.worldObj.isRemote) {
            return;
        }
        if (EventHandlerSiege.SiegeParticipants.isEmpty()) {
            if (event.entityLiving.getEntityData().hasKey("Siege")) {
                event.entity.setDead();
                endSiege(event.entity.worldObj, true);
            }
            return;
        }
        if (event.entityLiving.worldObj.rand.nextInt(1000) == 0) {
            checkPlayers();
        }
        if (event.entityLiving.worldObj.provider.dimensionId != 1) {
            return;
        }
        if (event.entityLiving instanceof EntityMob && ((EntityMob)event.entityLiving).getAttackTarget() == null && event.entityLiving.getEntityData().hasKey("Siege")) {
            final int i = EventHandlerSiege.rand.nextInt(EventHandlerSiege.SiegeParticipants.size());
            final EntityPlayer player = event.entityLiving.worldObj.getPlayerEntityByName((String)EventHandlerSiege.SiegeParticipants.get(i));
            if (player != null) {
                ((EntityMob)event.entityLiving).setAttackTarget((EntityLivingBase)player);
                ((EntityMob)event.entityLiving).setTarget((Entity)player);
            }
            else {
                EventHandlerSiege.SiegeParticipants.remove(i);
            }
        }
        if (event.entityLiving instanceof EntityPlayer) {
            final EntityPlayer player2 = (EntityPlayer)event.entityLiving;
            if (player2.motionY == 0.0 && player2.fallDistance == 0.0f && !player2.onGround && !player2.isOnLadder() && !player2.isInWater() && player2.ridingEntity == null) {
                player2.attackEntityFrom(DamageSource.generic, 0.5f);
            }
        }
    }

    @SubscribeEvent
    public void SiegeCheckSpawn(final LivingSpawnEvent.CheckSpawn event) {
        if (EventHandlerSiege.SiegeParticipants.isEmpty()) {
            return;
        }
        if (event.entity.worldObj.isRemote) {
            return;
        }
        if (event.world.provider.dimensionId != 1) {
            return;
        }
        if (event.entityLiving instanceof EntityMob && event.entityLiving.worldObj.checkNoEntityCollision(event.entityLiving.boundingBox) && event.entityLiving.worldObj.getCollidingBoundingBoxes((Entity)event.entityLiving, event.entityLiving.boundingBox).isEmpty() && !event.entityLiving.worldObj.isAnyLiquid(event.entityLiving.boundingBox)) {
            event.entityLiving.getEntityData().setBoolean("Siege", true);
            event.entityLiving.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 7200, 2));
            event.setResult(Event.Result.ALLOW);
        }
    }

    static {
        ddx = new int[] { -1, 0, 1, 0 };
        ddz = new int[] { 0, -1, 0, 1 };
        EventHandlerSiege.SiegeParticipants = new ArrayList<String>();
        (EventHandlerSiege.mobSpawns = new ArrayList<BiomeGenBase.SpawnListEntry>()).add(new BiomeGenBase.SpawnListEntry((Class)EntitySpider.class, 200, 3, 3));
        EventHandlerSiege.mobSpawns.add(new BiomeGenBase.SpawnListEntry((Class)EntityCaveSpider.class, 40, 4, 4));
        EventHandlerSiege.mobSpawns.add(new BiomeGenBase.SpawnListEntry((Class)EntityZombie.class, 80, 4, 4));
        EventHandlerSiege.mobSpawns.add(new BiomeGenBase.SpawnListEntry((Class)EntitySkeleton.class, 200, 4, 4));
        EventHandlerSiege.mobSpawns.add(new BiomeGenBase.SpawnListEntry((Class)EntityCreeper.class, 200, 4, 4));
        EventHandlerSiege.mobSpawns.add(new BiomeGenBase.SpawnListEntry((Class)EntityBlaze.class, 80, 2, 4));
        EventHandlerSiege.mobSpawns.add(new BiomeGenBase.SpawnListEntry((Class)EntityPigZombie.class, 40, 4, 4));
        EventHandlerSiege.mobSpawns.add(new BiomeGenBase.SpawnListEntry((Class)EntityWitch.class, 40, 1, 3));
        EventHandlerSiege.mobSpawns.add(new BiomeGenBase.SpawnListEntry((Class)EntitySilverfish.class, 40, 3, 3));
        EventHandlerSiege.mobSpawns.add(new BiomeGenBase.SpawnListEntry((Class)EntityGiantZombie.class, 5, 1, 1));
        EventHandlerSiege.rand = XURandom.getInstance();
    }
}


text:
"use strict";

// See https://github.com/avajs/eslint-plugin-ava

module.exports = {
  // Enforce passing correct arguments to assertions.
  "ava/assertion-arguments": "error",
  // Enforce test hook ordering.
  "ava/hooks-order": "error",
  // Limit the number of assertions in a test.
  "ava/max-asserts": ["off", 5],
  // Ensure that async tests use await
  "ava/no-async-fn-without-await": "error",
  // Ensure tests do not have duplicate modifiers.
  "ava/no-duplicate-modifiers": "error",
  // Ensure no tests have the same title.
  "ava/no-identical-title": "error",
  // Ensure no tests are written in ignored files.
  "ava/no-ignored-test-files": "error",
  // Ensure no test files are imported anywhere
  "ava/no-import-test-files": "error",
  // Avoid using deepEqual with primitives.
  "ava/no-incorrect-deep-equal": "error",
  // Ensure assertions are not called from inline arrow functions.
  "ava/no-inline-assertions": "error",
  // Ensure no tests are nested.
  "ava/no-nested-tests": "error",
  // Ensure no test.only() are present.
  "ava/no-only-test": "error",
  // Ensure no assertions are skipped.
  "ava/no-skip-assert": "error",
  // Ensure no tests are skipped.
  "ava/no-skip-test": "error",
  // Ensure test.todo() is not given an implementation function.
  "ava/no-todo-implementation": "error",
  // Ensure no test.todo() is used.
  "ava/no-todo-test": "error",
  // Prevent the use of unknown test modifiers.
  "ava/no-unknown-modifiers": "error",
  // Prefer using async/await instead of returning a Promise.
  // In `recommended` it is `error`, we need activate this in next major
  // for `jest` too
  "ava/prefer-async-await": "off",
  // Allow only use of the asserts that have no power-assert alternative.
  "ava/prefer-power-assert": "off",
  // Prefer using `t.regex()` to test regular expressions
  // TODO Enable in future
  "ava/prefer-t-regex": "off",
  // Ensure tests have a title.
  "ava/test-title": "error",
  // Ensure test titles have a certain format
  "ava/test-title-format": "off",
  // Ensure test functions use t as their parameter.
  "ava/use-t": "error",
  // Ensure that `t.throwsAsync()` and `t.notThrowsAsync()` are awaited.
  "ava/use-t-throws-async-well": "error",
  // Prevent the incorrect use of t.
  "ava/use-t-well": "error",
  // Ensure that AVA is imported with test as the variable name.
  "ava/use-test": "error",
  // Ensure that t.true()/t.false() are used instead of t.truthy()/t.falsy().
  "ava/use-true-false": "error",
};


text:
def total(array)
  sum = 0
  array.inject(:+)
end

# 3. total refactored solution

def total(array)
  sum = 0
  array.inject(:+)
end

# 4. sentence_maker pseudocode
# make sure all pseudocode is commented out!
# Input: I would like to input string in an array
# Output: I would like the method to output the strings as a sentance.
# Steps to solve the problem.
#I need to identify a method that will combine the words, but wont make them one long word.

# 5. sentence_maker initial solution

def sentence_maker(array)
  array.join(" ")
  array(0,1).capitalize + array(1..-1) + "."
end

# 6. sentence_maker refactored solution


text:
char* strCat(char* dest, const char* src)
{
    char* destStart = dest;

    // Find the terminating null-byte
    while (*dest)
        dest++;

    // Append src to dest
    while ( (*dest++ = *src++) )
        ;

    return destStart;
}


text:
using JoinRpg.DataModel;
using JoinRpg.PrimitiveTypes.ProjectMetadata;

namespace JoinRpg.Domain.Schedules;

public static class ScheduleFieldExtensions
{
    public static ProjectField? GetTimeSlotFieldOrDefault(this Project project)
        => project.ProjectFields.SingleOrDefault(f => f.FieldType == ProjectFieldType.ScheduleTimeSlotField && f.IsActive);
    public static ProjectField? GetRoomFieldOrDefault(this Project project)
        => project.ProjectFields.SingleOrDefault(f => f.FieldType == ProjectFieldType.ScheduleRoomField && f.IsActive);
}


text:
import sys, os, json
from DNN import Connection, Neuron, Net
count = 0
error = 0.0
for line in sys.stdin:
	tokens = line.strip().split()
	count += int(tokens[0])
	error += float(tokens[1])
myNet = None
with open(os.environ['NNJSON'], mode = 'r') as f:
	myNet = Net.fromJSON(json.load(f))
if myNet.recentAverageError == 0:
	prevCount = 0
else:
	prevCount = int(myNet.error / myNet.recentAverageError)
myNet.error += error
myNet.recentAverageError = myNet.error / (count + prevCount)
with open(os.environ['NNJSON'], mode = 'w') as f:
	json.dump(myNet.toJSON(), f, indent = 4)


text:
' Licensed to the .NET Foundation under one or more agreements.
' The .NET Foundation licenses this file to you under the MIT license.
' See the LICENSE file in the project root for more information.

Imports Microsoft.CodeAnalysis.Text
Imports Microsoft.CodeAnalysis.VisualBasic.Symbols
Imports Microsoft.CodeAnalysis.VisualBasic.Syntax
Namespace Microsoft.CodeAnalysis.VisualBasic

    Partial Friend Class BoundXmlAttribute

#If DEBUG Then
        Private Sub Validate()
            Debug.Assert(TypeSymbol.Equals(Type, ObjectCreation.Type, TypeCompareKind.ConsiderEverything))
        End Sub
#End If

    End Class

End Namespace


text:
<?php

namespace net\authorize\api\contract\v1;

/**
 * Class representing CustomerProfilePaymentType
 *
 *
 * XSD Type: customerProfilePaymentType
 */
class CustomerProfilePaymentType
{

    /**
     * @property boolean $createProfile
     */
    private $createProfile = null;

    /**
     * @property string $customerProfileId
     */
    private $customerProfileId = null;

    /**
     * @property \net\authorize\api\contract\v1\PaymentProfileType $paymentProfile
     */
    private $paymentProfile = null;

    /**
     * @property string $shippingProfileId
     */
    private $shippingProfileId = null;

    /**
     * Gets as createProfile
     *
     * @return boolean
     */
    public function getCreateProfile()
    {
        return $this->createProfile;
    }

    /**
     * Sets a new createProfile
     *
     * @param boolean $createProfile
     * @return self
     */
    public function setCreateProfile($createProfile)
    {
        $this->createProfile = $createProfile;
        return $this;
    }

    /**
     * Gets as customerProfileId
     *
     * @return string
     */
    public function getCustomerProfileId()
    {
        return $this->customerProfileId;
    }

    /**
     * Sets a new customerProfileId
     *
     * @param string $customerProfileId
     * @return self
     */
    public function setCustomerProfileId($customerProfileId)
    {
        $this->customerProfileId = $customerProfileId;
        return $this;
    }

    /**
     * Gets as paymentProfile
     *
     * @return \net\authorize\api\contract\v1\PaymentProfileType
     */
    public function getPaymentProfile()
    {
        return $this->paymentProfile;
    }

    /**
     * Sets a new paymentProfile
     *
     * @param \net\authorize\api\contract\v1\PaymentProfileType $paymentProfile
     * @return self
     */
    public function setPaymentProfile(\net\authorize\api\contract\v1\PaymentProfileType $paymentProfile)
    {
        $this->paymentProfile = $paymentProfile;
        return $this;
    }

    /**
     * Gets as shippingProfileId
     *
     * @return string
     */
    public function getShippingProfileId()
    {
        return $this->shippingProfileId;
    }

    /**
     * Sets a new shippingProfileId
     *
     * @param string $shippingProfileId
     * @return self
     */
    public function setShippingProfileId($shippingProfileId)
    {
        $this->shippingProfileId = $shippingProfileId;
        return $this;
    }

}


text:
package org.dasein.cloud.qingcloud.network.model;

import java.util.List;

import org.dasein.cloud.qingcloud.model.ResponseModel;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Created by Jane Wang on 12/28/2015.
 *
 * @author Jane Wang
 * @since 2016.02.1
 */
public class DescribeServerCertificatesResponseModel extends ResponseModel {

	@JsonProperty("server_certificate_set")
	private List<DescribeServerCertificatesResponseItemModel> serverCertificateSet;

	public List<DescribeServerCertificatesResponseItemModel> getServerCertificateSet() {
		return serverCertificateSet;
	}

	public void setServerCertificateSet(
			List<DescribeServerCertificatesResponseItemModel> serverCertificateSet) {
		this.serverCertificateSet = serverCertificateSet;
	}

	public static class DescribeServerCertificatesResponseItemModel {

		@JsonProperty("server_certificate_id")
		private String serverCertificateId;
		@JsonProperty("server_certificate_name")
		private String serverCertificateName;
		@JsonProperty("private_key")
		private String privateKey;
		@JsonProperty("certificate_content")
		private String certificateContent;
		@JsonProperty("description")
		private String description;
		@JsonProperty("create_time")
		private String create_time;

		public String getServerCertificateId() {
			return serverCertificateId;
		}
		public void setServerCertificateId(String serverCertificateId) {
			this.serverCertificateId = serverCertificateId;
		}
		public String getServerCertificateName() {
			return serverCertificateName;
		}
		public void setServerCertificateName(String serverCertificateName) {
			this.serverCertificateName = serverCertificateName;
		}
		public String getPrivateKey() {
			return privateKey;
		}
		public void setPrivateKey(String privateKey) {
			this.privateKey = privateKey;
		}
		public String getCertificateContent() {
			return certificateContent;
		}
		public void setCertificateContent(String certificateContent) {
			this.certificateContent = certificateContent;
		}
		public String getDescription() {
			return description;
		}
		public void setDescription(String description) {
			this.description = description;
		}
		public String getCreate_time() {
			return create_time;
		}
		public void setCreate_time(String create_time) {
			this.create_time = create_time;
		}
	}
}


text:
/**
*
* PaymentPage
*
*/

import React, { PropTypes } from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router';
import { PaymentElement } from './style';
import makeSelectGlobal from '../../globalSelectors';
import { createStructuredSelector } from 'reselect';
import { makeDonations } from 'globalActions';

class PaymentPage extends React.Component { // eslint-disable-line react/prefer-stateless-function
  constructor(props) {
    super(props);
    this.state = {
      input: {
        amount: '',
        name: '',
        email: '',
        social_security_number: '',
      },
      card: {
        name: 'Ricky Putra Nursalim',
        number: '4607529394946450',
        exp: '06/20',
        cvc: '323',
        zip: '11510',
      },
    };
    this.changeInput = this.changeInput.bind(this);
    this.onSubmit = this.onSubmit.bind(this);
  }

  onSubmit = () => {
    this.props.makeDonations({...this.state.input, campaign: this.props.Global.campaigns[this.props.Global.selectedCampaign].id});
  }

  changeInput = (field, value) => {
    const newInput = this.state.input;
    newInput[field] = value;
    this.setState({ input: newInput });
  }

  changeInputCard = (field, value) => {
    const newCard = this.state.card;
    newCard[field] = value;
    this.setState({ card: newCard });
  }

  render() {
    if (this.props.Global.selectedCampaign !== null)
      return (

          <PaymentElement>

Donasi Biaya Operasi Cardiac Bypass Bapak Phillip Susanto

Campaign oleh GKI Pengampon

Jumlah Donasi

              <input className="inputText" type="text" value={this.state.input.amount} onChange={(evt) => this.changeInput('amount', evt.target.value)} />

Nama Donatur

              <input className="inputText" type="text" value={this.state.input.name} onChange={(evt) => this.changeInput('name', evt.target.value)} />

Alamat Email

              <input className="inputText" type="email" value={this.state.input.email} onChange={(evt) => this.changeInput('email', evt.target.value)} />

No. KTP

              <input className="inputText" type="text" value={this.state.input.social_security_number} onChange={(evt) => this.changeInput('social_security_number', evt.target.value)} />

Informasi Kartu

            <input className="inputText" type="text" placeholder="Name on Card" value={this.state.card.name} onChange={(evt) => this.changeInputCard('name', evt.target.value)} />
            <input className="inputText" type="text" placeholder="Card Number" value={this.state.card.number} onChange={(evt) => this.changeInputCard('number', evt.target.value)} />
            <input className="inputText" type="text" placeholder="EXP:MM/YY" value={this.state.card.exp} onChange={(evt) => this.changeInputCard('exp', evt.target.value)} />
            <input className="inputText" type="text" placeholder="CVC" value={this.state.card.cvc} onChange={(evt) => this.changeInputCard('cvc', evt.target.value)} />
            <input className="inputText" type="text" placeholder="ZIP/Postal Code" value={this.state.card.zip} onChange={(evt) => this.changeInputCard('zip', evt.target.value)} />

<button onClick={() => this.onSubmit()}>DONATE</button>

          </PaymentElement>

      );
    else
      return (

You must choose campaign from <Link to={'/'}>campaign list</Link>

      );
  }
}

PaymentPage.propTypes = {
  Global: PropTypes.object.isRequired,
  makeDonations: PropTypes.func.isRequired,
};

const mapStateToProps = createStructuredSelector({
  Global: makeSelectGlobal(),
});

function mapDispatchToProps(dispatch) {
  return {
    makeDonations: (data) => dispatch(makeDonations(data)),
    dispatch,
  };
}

export default connect(mapStateToProps, mapDispatchToProps)(PaymentPage);


text:
package org.usfirst.frc4915.MecanumDrive.commands.elevator;

import edu.wpi.first.wpilibj.command.Command;
import org.usfirst.frc4915.MecanumDrive.Robot;
import org.usfirst.frc4915.MecanumDrive.subsystems.Elevator;

public class ElevatorStopCommand extends Command {

    Elevator elevator = Robot.elevator;

    public ElevatorStopCommand() {
        requires(elevator);
    }

    // Called just before this Command runs the first time
    protected void initialize() {
        elevator.stopElevator();
    }

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
    }

    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
        return true;
    }

    // Called once after isFinished returns true
    protected void end() {
    }

    // Called when another command which requires one or more of the same
    // subsystems is scheduled to run
    protected void interrupted() {
    }
}


text:
! { dg-do compile }
!
! PR fortran/51913
!
! Contributed by Alexander Tismer
!
MODULE m_sparseMatrix

  implicit none

  type :: sparseMatrix_t

  end type sparseMatrix_t
END MODULE m_sparseMatrix

!===============================================================================
module m_subroutine
!  USE m_sparseMatrix !< when uncommenting this line program works fine

  implicit none

  contains
  subroutine test(matrix)
    use m_sparseMatrix
    class(sparseMatrix_t), pointer :: matrix
  end subroutine
end module

!===============================================================================
PROGRAM main
  use m_subroutine
  USE m_sparseMatrix
  implicit none

  CLASS(sparseMatrix_t), pointer :: sparseMatrix

  call test(sparseMatrix)
END PROGRAM

! { dg-final { cleanup-modules "m_sparsematrix m_subroutine" } }


text:
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace UnitTestProject1
{
    [TestClass]
    public class ColorStructsUnitTest
    {
        [TestMethod]
        public void TestMethod1()
        {
        }
    }
}