text:
package com.swfarm.biz.chain.bo;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;

import com.swfarm.pub.framework.FormNumberCache;

public class RevertApvsVoucher implements Serializable {
	public static final String PREFIX = "RA";

	private Long id;

	private String revertApvsVoucherNo;

	private String revertApvsContent;

	private String forwarderApvsContent;

	private Set revertApvsVoucherItems = new HashSet();

	private Timestamp generateTime;

	private String generateUser;

	private Timestamp revertTime;

	private String revertUser;

	private Integer version = 0;

	private Boolean isVirtualAllocateProducts = false;

	public Long getId() {
		return id;
	}

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

	public String getRevertApvsVoucherNo() {
		if (StringUtils.isEmpty(revertApvsVoucherNo) && getId() == null) {
			revertApvsVoucherNo = FormNumberCache.getNextNumber(PREFIX);
		}
		return revertApvsVoucherNo;
	}

	public void setRevertApvsVoucherNo(String revertApvsVoucherNo) {
		this.revertApvsVoucherNo = revertApvsVoucherNo;
	}

	public String getRevertApvsContent() {
		return revertApvsContent;
	}

	public String getHtmlRevertApvsContent() {
		if (StringUtils.isNotEmpty(revertApvsContent)) {
			List apvNoList = new ArrayList();
			String[] apvNoArr = StringUtils.split(revertApvsContent, "\n");
			if (apvNoArr != null && apvNoArr.length > 0) {
				for (int i = 0; i < apvNoArr.length; i++) {
					String apvNo = apvNoArr[i];
					if (StringUtils.isNotEmpty(apvNo)
							&& !apvNoList.contains(apvNo)) {
						apvNoList.add(apvNo);
					}
				}
			}
			if (CollectionUtils.isNotEmpty(apvNoList)) {
				return StringUtils.join(apvNoList, " ");
			}
		}
		return revertApvsContent;
	}

	public String getDisplayRevertApvsContent() {
		if (StringUtils.isNotEmpty(revertApvsContent)) {
			List apvNoList = new ArrayList();
			String[] apvNoArr = StringUtils.split(revertApvsContent, "\n");
			if (apvNoArr != null && apvNoArr.length > 0) {
				for (int i = 0; i < apvNoArr.length; i++) {
					String apvNo = apvNoArr[i];
					if (StringUtils.isNotEmpty(apvNo)
							&& !apvNoList.contains(apvNo)) {
						apvNoList.add(apvNo);
					}
				}
			}
			if (CollectionUtils.isNotEmpty(apvNoList)) {
				return StringUtils.join(apvNoList, ",");
			}
		}
		return revertApvsContent;
	}

	public void setRevertApvsContent(String revertApvsContent) {
		this.revertApvsContent = revertApvsContent;
	}

	public String getForwarderApvsContent() {
		return forwarderApvsContent;
	}

	public String getHtmlForwarderApvsContent() {
		if (StringUtils.isNotEmpty(forwarderApvsContent)) {
			List apvNoList = new ArrayList();
			String[] apvNoArr = StringUtils.split(forwarderApvsContent, "\n");
			if (apvNoArr != null && apvNoArr.length > 0) {
				for (int i = 0; i < apvNoArr.length; i++) {
					String apvNo = apvNoArr[i];
					if (StringUtils.isNotEmpty(apvNo)
							&& !apvNoList.contains(apvNo)) {
						apvNoList.add(apvNo);
					}
				}
			}
			if (CollectionUtils.isNotEmpty(apvNoList)) {
				return StringUtils.join(apvNoList, " ");
			}
		}
		return forwarderApvsContent;
	}

	public String getDisplayForwarderApvsContent() {
		if (StringUtils.isNotEmpty(forwarderApvsContent)) {
			List apvNoList = new ArrayList();
			String[] apvNoArr = StringUtils.split(forwarderApvsContent, "\n");
			if (apvNoArr != null && apvNoArr.length > 0) {
				for (int i = 0; i < apvNoArr.length; i++) {
					String apvNo = apvNoArr[i];
					if (StringUtils.isNotEmpty(apvNo)
							&& !apvNoList.contains(apvNo)) {
						apvNoList.add(apvNo);
					}
				}
			}
			if (CollectionUtils.isNotEmpty(apvNoList)) {
				return StringUtils.join(apvNoList, ",");
			}
		}
		return forwarderApvsContent;
	}

	public void setForwarderApvsContent(String forwarderApvsContent) {
		this.forwarderApvsContent = forwarderApvsContent;
	}

	public Set getRevertApvsVoucherItems() {
		if (revertApvsVoucherItems == null) {
			revertApvsVoucherItems = new HashSet();
		}
		return revertApvsVoucherItems;
	}

	public List getRevertApvsVoucherItemList() {
		List revertApvsVoucherItemList = new ArrayList();
		if (CollectionUtils.isNotEmpty(this.getRevertApvsVoucherItems())) {
			revertApvsVoucherItemList.addAll(this.revertApvsVoucherItems);
			Collections.sort(revertApvsVoucherItemList, new Comparator() {

				public int compare(Object obj1, Object obj2) {
					RevertApvsVoucherItem revertApvsVoucherItem1 = (RevertApvsVoucherItem) obj1;
					RevertApvsVoucherItem revertApvsVoucherItem2 = (RevertApvsVoucherItem) obj2;
					return revertApvsVoucherItem1
							.getAllocationProductVoucherNo().compareTo(
									revertApvsVoucherItem2
											.getAllocationProductVoucherNo());
				}

			});
		}
		return revertApvsVoucherItemList;
	}

	public List getNoralRevertApvsVoucherItemList() {

		List revertApvsVoucherItemList = new ArrayList();
		if (CollectionUtils.isNotEmpty(this.getRevertApvsVoucherItems())) {
			for (Iterator iter = this.revertApvsVoucherItems.iterator(); iter
					.hasNext();) {
				RevertApvsVoucherItem revertApvsVoucherItem = (RevertApvsVoucherItem) iter
						.next();
				if (revertApvsVoucherItem.getIsForwarderReturn() == false) {
					revertApvsVoucherItemList.add(revertApvsVoucherItem);
				}
			}
			Collections.sort(revertApvsVoucherItemList, new Comparator() {

				public int compare(Object obj1, Object obj2) {
					RevertApvsVoucherItem revertApvsVoucherItem1 = (RevertApvsVoucherItem) obj1;
					RevertApvsVoucherItem revertApvsVoucherItem2 = (RevertApvsVoucherItem) obj2;
					return revertApvsVoucherItem1
							.getAllocationProductVoucherNo().compareTo(
									revertApvsVoucherItem2
											.getAllocationProductVoucherNo());
				}

			});
		}
		return revertApvsVoucherItemList;
	}

	public List getForwarderRevertApvsVoucherItemList() {

		List revertApvsVoucherItemList = new ArrayList();
		if (CollectionUtils.isNotEmpty(this.getRevertApvsVoucherItems())) {
			for (Iterator iter = this.revertApvsVoucherItems.iterator(); iter
					.hasNext();) {
				RevertApvsVoucherItem revertApvsVoucherItem = (RevertApvsVoucherItem) iter
						.next();
				if (revertApvsVoucherItem.getIsForwarderReturn() == true) {
					revertApvsVoucherItemList.add(revertApvsVoucherItem);
				}
			}
			Collections.sort(revertApvsVoucherItemList, new Comparator() {

				public int compare(Object obj1, Object obj2) {
					RevertApvsVoucherItem revertApvsVoucherItem1 = (RevertApvsVoucherItem) obj1;
					RevertApvsVoucherItem revertApvsVoucherItem2 = (RevertApvsVoucherItem) obj2;
					return revertApvsVoucherItem1
							.getAllocationProductVoucherNo().compareTo(
									revertApvsVoucherItem2
											.getAllocationProductVoucherNo());
				}

			});
		}
		return revertApvsVoucherItemList;
	}

	public void setRevertApvsVoucherItems(Set revertApvsVoucherItems) {
		this.revertApvsVoucherItems = revertApvsVoucherItems;
	}

	public void addRevertApvsVoucherItem(
			RevertApvsVoucherItem revertApvsVoucherItem) {
		if (!this.getRevertApvsVoucherItems().contains(revertApvsVoucherItem)) {
			this.revertApvsVoucherItems.add(revertApvsVoucherItem);
			revertApvsVoucherItem.setRevertApvsVoucher(this);
		}
	}

	public void removeApvsVoucherItem(
			RevertApvsVoucherItem revertApvsVoucherItem) {
		if (this.getRevertApvsVoucherItems().contains(revertApvsVoucherItem)) {
			this.revertApvsVoucherItems.remove(revertApvsVoucherItem);
			revertApvsVoucherItem.setRevertApvsVoucher(null);
		}
	}

	public Timestamp getGenerateTime() {
		return generateTime;
	}

	public void setGenerateTime(Timestamp generateTime) {
		this.generateTime = generateTime;
	}

	public String getGenerateUser() {
		return generateUser;
	}

	public void setGenerateUser(String generateUser) {
		this.generateUser = generateUser;
	}

	public Timestamp getRevertTime() {
		return revertTime;
	}

	public void setRevertTime(Timestamp revertTime) {
		this.revertTime = revertTime;
	}

	public String getRevertUser() {
		return revertUser;
	}

	public void setRevertUser(String revertUser) {
		this.revertUser = revertUser;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	public void setIsVirtualAllocateProducts(Boolean isVirtualAllocateProducts) {
		this.isVirtualAllocateProducts = isVirtualAllocateProducts;
	}

	public Boolean getIsVirtualAllocateProducts() {
		return isVirtualAllocateProducts;
	}

}


text:
package org.wfe.core.manager;

import org.wfe.commons.manager.IGenericManager;
import org.wfe.core.model.permissions.IUserWorkflowPermission;

public interface IUserWorkflowPermissionManager
extends IGenericManager<IUserWorkflowPermission, Long> {

}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Zhmi\ExpertSender\Request\Post;

use Zhmi\ExpertSender\Request;

class Lists extends Request
{
    protected $endPoint = '/Api/Lists';
    protected $responseEntity = 'integer';
}


text:
BaseEditor.prototype.initSample = function(samplePath, sampleEntityId) {
	var _this = this;

	this.samplePath = samplePath;
	this.sampleEntityId = sampleEntityId;
	this.sampleTextbox = $(".sample-textarea");  //schema-editor-outer-east-container, schema-editor-detail-pane
	this.sampleInputType = function() { return $("input[name=inputType]:checked").val() };
	this.samplePane = $(".editor-sample-pane");
	this.sampleContainer = $(".editor-sample-container");
	this.sampleOutputContainer = $("#sample-output-container");

	this.sampleModified = !$("#sample-set").val();

	$(this.sampleTextbox).on('change keyup paste', function() {
		_this.sampleModified = true;
	});

	if (this.getSampleResourceCount()>0) {
		this.getSampleResource();
	}

	$("#sample-input-textarea").focusout(function() {_this.handleLeaveTextarea();});

	$('.editor-sample-container a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
		_this.resize();
	})
};

BaseEditor.prototype.handleEnterTextarea = function() {

	$("#sample-input-textarea").removeClass("hide");
	$("#sample-input-textarea-placeholder").addClass("hide");

	$("#sample-input-textarea").focus();

	this.resizeContent();
};

BaseEditor.prototype.handleLeaveTextarea = function() {
	if ($("#sample-input-textarea").val().length==0) {
		$("#sample-input-textarea").addClass("hide");
		$("#sample-input-textarea-placeholder").removeClass("hide");

		this.resizeContent();
	}
};

BaseEditor.prototype.applyAndExecuteSample = function() {
	var _this = this;
	this.samplePane.children("div:not(.ui-pane-title)").hide();

	if (this.sampleModified) {
		this.applySample(function() {
			_this.executeSample();
		})
	} else {
		this.executeSample();
	}
};

BaseEditor.prototype.uploadAndExecuteSample = function() {
	var _this = this;
	var form_identifier = "edit-root";

	modalFormHandler = new ModalFormHandler({
		formUrl: "forms/uploadSample",
		data: { inputType: this.sampleInputType() },
		additionalModalClasses: "wide-modal",
		identifier: form_identifier,
		translations: [{placeholder: "~*servererror.head", key: "~de.unibamberg.minf.common.view.forms.servererror.head"},
		                {placeholder: "~*servererror.body", key: "~de.unibamberg.minf.common.view.forms.servererror.body"},
		                {placeholder: "~*file.uploadcomplete.head", key: "~de.unibamberg.minf.dme.editor.forms.sample_uploaded.head"},
		                {placeholder: "~*file.uploadcomplete.body", key: "~de.unibamberg.minf.dme.editor.forms.sample_uploaded.body"}
		                ],
		completeCallback: function() {
			_this.logArea.refresh();
    		_this.sampleModified = false;
			_this.samplePane.children("div:not(.ui-pane-title)").hide();
			$(".placeholder-sample").removeClass("hide");
			$(".placeholder-no-sample").addClass("hide");
			_this.executeSample();
		}
	});

	modalFormHandler.fileUploadElements.push({
		selector: "#upload_source",				// selector for identifying where to put widget
		formSource: "forms/fileupload",		// where is the form
		uploadTarget: "async/uploadSample", 			// where to we upload the file(s) to
		multiFiles: false, 						// one or multiple files
		elementChangeCallback: _this.handleValidatedOrFailed
	});

	modalFormHandler.show(form_identifier);
};

BaseEditor.prototype.handleSampleUploaded = function(data) {
	var select = $("#schema_root");
	select.html("");
	if (data==null || data.pojo==null || data.pojo.length==0) {
		select.prop("disabled", "disabled");
		$("#btn-submit-schema-elements").prop("disabled", "disabled");
		return;
	}

	var option;
	for (var i=0; i<data.pojo.length; i++) {
		option = "<option value='" + i + "'>" + data.pojo[i].name + " (" + data.pojo[i].namespace + ")" + "</option>";
		select.append(option);
	}
	select.removeProp("disabled");
	$("#btn-submit-schema-elements").removeProp("disabled");
};

BaseEditor.prototype.applySample = function(callback) {
	var _this = this;
	$.ajax({
	    url: this.samplePath + "async/applySample",
	    type: "POST",
	    data: {
	    	sample : _this.sampleTextbox.val(),
	    	inputType : this.sampleInputType()
	    },
	    dataType: "json",
	    success: function(data) {
	    	if (data.success) {
	    		_this.logArea.refresh();
	    		_this.sampleModified = false;
	    		callback();
	    	}
	    },
	    error: function(jqXHR, textStatus, errorThrown ) {
	    	$(_this.samplePane).children("div:not(.ui-pane-title)").show();
	    	__util.processServerError(jqXHR, textStatus, errorThrown);
	    }
	});
};

BaseEditor.prototype.loadSampleInput = function() {
	var _this = this;
	this.samplePane.children("div:not(.ui-pane-title)").hide();

	$.ajax({
	    url: _this.pathname + "/async/load_sample",
	    type: "GET",
	    dataType: "json",
	    data: { t: "input" },
	    success: function(data) {

	    	$('#sample-input-textarea').val(data.pojo) , '#load-sample-input-buttonbar'
	    	$('#load-sample-input-buttonbar').addClass("hide");

    		_this.samplePane.children("div:not(.ui-pane-title)").show();
    		_this.resize();
	    },
	    error: __util.processServerError
	});
};

BaseEditor.prototype.downloadSampleInput = function() {
	var _this = this;
	$.ajax({
	    url: _this.pathname + "/async/download_sample_input",
	    type: "GET",
	    dataType: "json",
	    success: function(data) {
	    	if (data==null || data.content===undefined || data.content===null || data.content.length==0) {
	    		bootbox.alert(__translator.translate("~de.unibamberg.minf.dme.editor.sample.notice.empty_sample"));
	    	} else {
		    	if (data.mime.includes("json")) {
		    		data.content = JSON.stringify(data.content);
		    	}
		    	blob = new Blob([data.content], {type: data.mime});
		    	saveAs(blob, data.name);
	    	}
	    },
	    error: __util.processServerError
	});
};

BaseEditor.prototype.downloadSampleOutput = function() {
	var form_identifier = "download-sample";
	modalFormHandler = new ModalFormHandler({
		formUrl: "forms/download_output/",
		additionalModalClasses: "wide-modal",
		identifier: form_identifier
	});
	modalFormHandler.show(form_identifier);
};

BaseEditor.prototype.createDownload = function() {
	var _this = this;
	$.ajax({
	    url: _this.pathname + "/async/download_link",
	    type: "GET",
	    dataType: "json",
	    data: {
	    	data: $('input[name=\"download-data-radios\"]:checked').val(),
	    	model: $('input[name=\"download-model-radios\"]:checked').val(),
	    	format: $('input[name=\"download-format-radios\"]:checked').val()
	    },
	    success: function(data) {
	    	$("#download-link-container").html(
	    			"" +
		    			(data.count==1 ?
		    					__translator.translate("~de.unibamberg.minf.dme.editor.sample.download.file_count") :
		    					String.format(__translator.translate("~de.unibamberg.minf.dme.editor.sample.download.files_count"), data.count)
		    			) + ": " +
	    				"" +
	    					" " +
	    					__translator.translate("~de.unibamberg.minf.common.link.download") +
	    				"  " +
	    			"");

	    },
	    error: __util.processServerError
	});
};

BaseEditor.prototype.executeSample = function() {
	var _this = this;
	$.ajax({
	    url: this.samplePath + "async/executeSample",
	    type: "GET",
	    data: { inputType : _this.sampleInputType() },
	    dataType: "json",
	    async: false,
	    success: function(data) {
	    	if (data!=null) {
		    	if (data.success==true && data.pojo>0 && _this.mappingId!==undefined && _this instanceof MappingEditor) {
		    		_this.executeSampleMapping();
		    	}
		    	if (data.success) {
		    		_this.processSampleExecutionResult(data.pojo);
		    	}
	    	}
	    	//_this.currentSampleIndex = 0;
	    	_this.logArea.refresh();

	    	$(_this.samplePane).children("div:not(.ui-pane-title)").show();
	    	_this.resize();
	    },
	    error: function(jqXHR, textStatus, errorThrown ) {
	    	$(_this.samplePane).children("div:not(.ui-pane-title)").show();
	    	__util.processServerError(jqXHR, textStatus, errorThrown);
	    }
	});
};

BaseEditor.prototype.setCurrentSampleIndex = function(index) {
	$("#currentSampleIndex").val(index);
};

BaseEditor.prototype.getCurrentSampleIndex = function() {
	return parseInt(Number($("#currentSampleIndex").val()));
};

BaseEditor.prototype.setSampleResourceCount = function(count) {
	$("#currentSampleCount").val(count);
};

BaseEditor.prototype.getSampleResourceCount = function() {
	return parseInt(Number($("#currentSampleCount").val()));
};

BaseEditor.prototype.executeSampleMapping = function() {
	var _this = this;
	$.ajax({
	    url: this.samplePath + "async/executeSampleMapping",
	    type: "GET",
	    //data: { sample : _this.sampleTextbox.val() },
	    dataType: "json",
	    async: false,
	    success: function(data) {

	    },
	    error: function(jqXHR, textStatus, errorThrown ) {
	    	$(_this.samplePane).children("div:not(.ui-pane-title)").show();
	    	__util.processServerError(jqXHR, textStatus, errorThrown);
	    }
	});
};

BaseEditor.prototype.executeMapping = function() {
	this.isMappingEditor = true;
};

BaseEditor.prototype.processSampleExecutionResult = function(count) {
	var navTab = $(this.sampleContainer).find("a[href='#sample-output-container']");
	var enabled = false;

	$(navTab).find(".badge-c").remove();
	$(".sample-output-resource").text("");

	var resCount = 0;
	if (!isNaN(count) && parseInt(Number(count))==count && !isNaN(parseInt(count, 10))) {
		resCount = count;
	}
	if (this.getSampleResourceCount()>resCount) {
		this.setCurrentSampleIndex(0);
	}
	this.setSampleResourceCount(resCount);

	if (this.getSampleResourceCount() > 0) {
		enabled = true;
	}
	$(navTab).append(" " + this.getSampleResourceCount() + "");

	if (enabled) {
		$(navTab).parent().removeClass("disabled");
		$(navTab).attr("data-toggle", "tab");
		$(navTab).tab('show');
	} else {
		$(navTab).parent().addClass("disabled");
		$(navTab).removeAttr("data-toggle");
		$(this.sampleContainer).find("a[href='#sample-input-container']").tab('show');
	}
	this.getSampleResource();
};

BaseEditor.prototype.getSampleResource = function(force) {
	var _this = this;
	this.samplePane.children("div:not(.ui-pane-title)").hide();

	$.ajax({
	    url: this.samplePath + "async/getSampleResource",
	    type: "GET",
	    data: {
	    	index: _this.getCurrentSampleIndex(),
	    	force: (force===true)
	    },
	    dataType: "json",
	    success: function(data) {
	    	if (data!=null && data!=undefined) {
	    		$(".sample-output-resource").html(_this.buildSampleResourceObject(data));
	    	} else {
	    		$(".sample-output-resource").text("");
	    	}
	    	_this.setSampleNavigationBar();
	    	if (_this.mappingId!==undefined && _this instanceof MappingEditor) {
	    		_this.getTransformedResource();
	    	} else {
	    		_this.samplePane.children("div:not(.ui-pane-title)").show();
	    	}
	    	_this.resizeContent();
	    },
	    error: function() {
	    	$(".sample-output-resource").text("");
	    	$(".sample-transformed-resource").text("");
	    }
	});
};

BaseEditor.prototype.getTransformedResource = function() {
	var _this = this;
	$.ajax({
	    url: this.samplePath + "async/getTransformedResource",
	    type: "GET",
	    data: { index : _this.getCurrentSampleIndex() },
	    dataType: "json",
	    success: function(data) {
	    	if (data!=null && data!=undefined) {
		    	$(".sample-transformed-resource").html(_this.buildSampleResourceObject(data));
	    	} else {
	    		$(".sample-transformed-resource").text("");
	    	}
	    	_this.samplePane.children("div:not(.ui-pane-title)").show();
	    	_this.setSampleNavigationBar();
	    	_this.resizeContent();
	    },
	    error: function() {
	    	$(".sample-transformed-resource").text("");
	    }
	});
};

BaseEditor.prototype.setSampleNavigationBar = function() {
	$(".sample-output-counter").text("" + (this.getCurrentSampleIndex()+1) + " / " + this.getSampleResourceCount());

	if (this.getCurrentSampleIndex() > 0) {
		$(".btn-sample-prev-resource").removeClass("disabled");
	} else {
		$(".btn-sample-prev-resource").addClass("disabled");
	}
	if (this.getCurrentSampleIndex() < this.getSampleResourceCount()-1) {
		$(".btn-sample-next-resource").removeClass("disabled");
	} else {
		$(".btn-sample-next-resource").addClass("disabled");
	}
};

BaseEditor.prototype.getPrevSampleResource = function() {
	var index = this.getCurrentSampleIndex();
	if (index > 0) {
		this.setCurrentSampleIndex(index-1);
		this.getSampleResource();
	}
};

BaseEditor.prototype.getNextSampleResource = function() {
	var index = this.getCurrentSampleIndex();
	if (index < this.getSampleResourceCount()-1) {
		this.setCurrentSampleIndex(index+1);
		this.getSampleResource();
	}
};

BaseEditor.prototype.showSampleResourceTarget = function() {
	$(".sample-output-resource").addClass("hide");
	$(".sample-transformed-resource").removeClass("hide");

	$(".btn-sample-source").addClass("btn-default");
	$(".btn-sample-source").removeClass("btn-info");
	$(".btn-sample-target").addClass("btn-info");
	$(".btn-sample-target").removeClass("btn-default");
}

BaseEditor.prototype.showSampleResourceSource = function() {
	$(".sample-output-resource").removeClass("hide");
	$(".sample-transformed-resource").addClass("hide");

	$(".btn-sample-source").addClass("btn-info");
	$(".btn-sample-source").removeClass("btn-default");
	$(".btn-sample-target").addClass("btn-default");
	$(".btn-sample-target").removeClass("btn-info");
}

BaseEditor.prototype.buildSampleResourceObject = function(data) {
	if (data.statusInfo.available===true) {
		if (data.statusInfo.oversize===false) {

			$(".btn-load-sample-output").addClass("hide");

			var result = $("
");
    		result.append(this.buildSampleResource(data.pojo));

			return result;
		} else {
			$(".btn-load-sample-output").removeClass("hide");
			var result = $("
");
    		result.html("Large output resource. Please  load here " +
    				"explicitly if needed or  download as file.");
			return result;
		}
	}
};

BaseEditor.prototype.buildSampleResource = function(resource, parentItem) {
	var items = [];

	for (var i=0; i<Object.getOwnPropertyNames(resource).length; i++) {
		var key = Object.getOwnPropertyNames(resource)[i];
		if (key==="#") {
			continue;
		}

		if (key==="~") {
			parentItem.append("<button onclick=\"editor.toggleSampleOutputValue(this);\" class=\"btn btn-link btn-xs sample-output-value-expanded\">" +
								"" +
								"" +
							  "</button>");
			parentItem.append("" + resource[key] + "");
			parentItem.append("...");
			continue;
		}

		var value = resource[key];
		if (Array.isArray(value)) {
			for (var j=0; j<value.length; j++) {
				items.push(this.buildSampleResourceItem(key, value[j]));
			}
		} else {
			items.push(this.buildSampleResourceItem(key, value));
		}

	}
	return items;
};

BaseEditor.prototype.toggleSampleOutputValue = function(button) {
	if ($(button).hasClass("sample-output-value-expanded")) {
		$(button).addClass("sample-output-value-collapsed");
		$(button).removeClass("sample-output-value-expanded");

		$(button).siblings(".sample-output-value").hide();
		$(button).siblings(".sample-output-value-placeholder").show();
	} else {
		$(button).addClass("sample-output-value-expanded");
		$(button).removeClass("sample-output-value-collapsed");

		$(button).siblings(".sample-output-value").show();
		$(button).siblings(".sample-output-value-placeholder").hide();
	}

};

BaseEditor.prototype.buildSampleResourceItem = function(key, resource) {

	var item = $("
");
	var displayKey;
	if (key.indexOf("|")>0) {
		displayKey = key.substring(0, key.indexOf("|"));
	} else {
		displayKey = key;
	}

	item.append("→ " + displayKey + "");

	var subItems = this.buildSampleResource(resource, item);
	if (subItems.length > 0) {
		item.append($("
").append(subItems));
	}

	return item;
};

BaseEditor.prototype.buildSampleResourceValue = function(resource, parentItem, subItems) {
	var key = Object.getOwnPropertyNames(resource)[0];
	if (key==="") {
		parentItem.append(": " + resource[key] + "");
		return 0;
	} else {
		subItems.append(this.buildSampleResource(resource));
		return 1;
	}
};

BaseEditor.prototype.newSampleSession = function() {
	var _this = this;
	sessions.newSession(_this.sampleEntityId, function() {
		window.location.reload();
	});
};

BaseEditor.prototype.deleteSampleSession = function() {
	var _this = this;
	sessions.deleteSession(_this.sampleEntityId, function() {
		window.location.reload();
	});
};


text:
package com.iotai.alexaclient.login;

import android.support.v4.app.FragmentActivity;

import com.amazon.identity.auth.device.AuthError;
import com.amazon.identity.auth.device.api.Listener;
import com.amazon.identity.auth.device.api.authorization.AuthCancellation;
import com.amazon.identity.auth.device.api.authorization.AuthorizationManager;
import com.amazon.identity.auth.device.api.authorization.AuthorizeListener;
import com.amazon.identity.auth.device.api.authorization.AuthorizeRequest;
import com.amazon.identity.auth.device.api.authorization.AuthorizeResult;
import com.amazon.identity.auth.device.api.authorization.Scope;
import com.amazon.identity.auth.device.api.authorization.ScopeFactory;
import com.amazon.identity.auth.device.api.workflow.RequestContext;
import com.iotai.utils.Logger;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by zhangjf9 on 2017/10/10.
 */

class LocalAuthorizationLoginEngine extends LoginEngine {

    private FragmentActivity mFragmentActivity = null;
    private RequestContext mRequestContext;
    private AuthorizeListener mAuthorizeListener;

    private static final String ALEXA_ALL = "alexa:all";
    private static final String PRODUCT_ID = "productID";
    private static final String PRODUCT_INSTANCE_ATTRIBUTES = "productInstanceAttributes";
    private static final String DEVICE_SERIAL_NUMBER = "deviceSerialNumber";
    private static final String CODE_CHALLENGE = "CodeChallenge";
    private static final String CODE_CHALLENGE_METHOD = "S256";

    private boolean mIsInitialized = false;
    private boolean mIsLoggedIn = false;

    public LocalAuthorizationLoginEngine()
    {
    }

    public boolean initialize(FragmentActivity fragmentActivity)
    {
        if (mIsInitialized)
            return true;

        mFragmentActivity = fragmentActivity;
        mRequestContext = RequestContext.create(fragmentActivity);
        mAuthorizeListener =  new AuthorizeListenerImpl();
        mRequestContext.registerListener(mAuthorizeListener);
        mIsInitialized = true;

        return true;
    }

    public void release()
    {
        if (!mIsInitialized)
            return;

        mRequestContext.unregisterListener(mAuthorizeListener);
        mIsInitialized = false;
    }

    public boolean login(String serialNumber, String productId)
    {
        if (!mIsInitialized)
            return false;

        final JSONObject scopeData = new JSONObject();
        final JSONObject productInstanceAttributes = new JSONObject();

        try {
            productInstanceAttributes.put(DEVICE_SERIAL_NUMBER, serialNumber);
            scopeData.put(PRODUCT_INSTANCE_ATTRIBUTES, productInstanceAttributes);
            scopeData.put(PRODUCT_ID, productId);

            AuthorizationManager.authorize(new AuthorizeRequest.Builder(mRequestContext)
                    .addScope(ScopeFactory.scopeNamed(ALEXA_ALL, scopeData))
                    .forGrantType(AuthorizeRequest.GrantType.ACCESS_TOKEN)
                    .shouldReturnUserData(false)
                    .build());
        } catch (JSONException e) {
            return false;
        }
        return true;
    }

    public void signOut()
    {
        if (!mIsInitialized)
            return;

        AuthorizationManager.signOut(mFragmentActivity, new Listener<Void, AuthError>() {
            @Override
            public void onSuccess(Void aVoid) {
                mIsLoggedIn = false;
                fireOnSignOutEvent();
            }

            @Override
            public void onError(AuthError authError) {
                fireOnError(authError.toString());
            }
        });
    }

    public boolean getAccessToken()
    {
        if (!mIsInitialized)
            return false;

        if (!mIsLoggedIn)
            return false;

        AuthorizationManager.getToken(mFragmentActivity, new Scope[] { ScopeFactory.scopeNamed(ALEXA_ALL) }, new TokenListener());

        return true;
    }

    public void onResume()
    {
        if (!mIsInitialized)
            return;

        if (mRequestContext != null)
            mRequestContext.onResume();
    }

    private class AuthorizeListenerImpl extends AuthorizeListener {

        /* Authorization was completed successfully. */
        @Override
        public void onSuccess(final AuthorizeResult authorizeResult) {
            mIsLoggedIn = true;
            fireOnLoginEvent();
        }

        /* There was an error during the attempt to authorize the application. */
        @Override
        public void onError(final AuthError authError) {
            fireOnError(authError.toString());
        }

        /* Authorization was cancelled before it could be completed. */
        @Override
        public void onCancel(final AuthCancellation authCancellation) {
            fireOnLoginCancelEvent();
        }
    }

    private TokenListener mTokenListener = new TokenListener();

    private class TokenListener implements Listener<AuthorizeResult, AuthError> {
        /* getToken completed successfully. */
        @Override
        public void onSuccess(AuthorizeResult authorizeResult) {
            String accessToken = authorizeResult.getAccessToken();
            Logger.i("accessToken: " + accessToken);
            fireOnTokenReadyEvent(accessToken);
        }

        /* There was an error during the attempt to get the token. */
        @Override
        public void onError(AuthError authError) {
            fireOnError(authError.toString());
        }
    }
}


text:
<?php
/**
 * Admin class
 *
 * @author  Your Inspiration Themes
 * @package YITH WooCommerce Ajax Navigation
 * @version 1.3.2
 */

if ( ! defined( 'YITH_WCAN' ) ) {
    exit;
} // Exit if accessed directly

if ( ! class_exists( 'YITH_WCAN_Admin' ) ) {
    /**
     * Admin class.
     * The class manage all the admin behaviors.
     *
     * @since 1.0.0
     */
    class YITH_WCAN_Admin {
        /**
         * Plugin version
         *
         * @var string
         * @since 1.0.0
         */
        public $version;

        /* @var YIT_Plugin_Panel_WooCommerce */
        protected $_panel;

        /**
         * @var string Main Panel Option
         */
        protected $_main_panel_option;

        /**
         * @var string The panel page
         */
        protected $_panel_page = 'yith_wcan_panel';

        /**
         * @var string Official plugin documentation
         */
        protected $_official_documentation = 'https://yithemes.com/docs-plugins/yith-woocommerce-ajax-product-filter';

        /**
         * @var string Official plugin landing page
         */
        protected $_premium_landing = 'https://yithemes.com/themes/plugins/yith-woocommerce-ajax-product-filter';

        /**
         * @var string Official plugin landing page
         */
        protected $_premium_live = 'http://plugins.yithemes.com/yith-woocommerce-ajax-product-filter/shop/';

        /**
         * Constructor
         *
         * @access public
         * @since 1.0.0
         */
        public function __construct( $version ) {
            $this->version = $version;

            //Actions
            add_action( 'init', array( $this, 'init' ) );
            add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );

            /* Plugin Option Panel */
            add_action( 'admin_menu', array( $this, 'register_panel' ), 5 );
            add_action( 'yit_panel_wcan_description', array( $this, 'frontend_description_option' ), 10, 3 );
            add_action( 'yith_wcan_premium_tab', array( $this, 'premium_tab' ) );
            add_action( 'yith_wcan_custom_style_tab', array( $this, 'custom_style_tab' ) );

            /* Plugin Informations */
            add_filter( 'plugin_action_links_' . plugin_basename( YITH_WCAN_DIR . '/' . basename( YITH_WCAN_FILE ) ), array( $this, 'action_links' ) );
            add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 4 );

            // YITH WCAN Loaded
            do_action( 'yith_wcan_loaded' );
        }

        /**
         * Init method:
         *  - default options
         *
         * @access public
         * @since 1.0.0
         */
        public function init() {
        }

        /**
         * Enqueue admin styles and scripts
         *
         * @access public
         * @return void
         * @since 1.0.0
         */
        public function enqueue_styles_scripts() {
            global $pagenow;

            if ( 'widgets.php' == $pagenow || 'admin.php' == $pagenow ) {
                wp_enqueue_style( 'wp-color-picker' );
                wp_enqueue_style( 'yith_wcan_admin', YITH_WCAN_URL . 'assets/css/admin.css', array( 'yit-plugin-style' ), $this->version );

                wp_enqueue_script( 'wp-color-picker' );
                wp_enqueue_script( 'yith_wcan_admin', YITH_WCAN_URL . 'assets/js/yith-wcan-admin.js', array( 'jquery', 'wp-color-picker' ), $this->version, true );
            }

            if( 'admin.php' == $pagenow && isset( $_GET['page'] ) && 'yith_wcan_panel' == $_GET['page'] && isset( $_GET['tab'] ) && 'custom-style' == $_GET['tab'] ){
                wp_enqueue_style( 'codemirror-style', YITH_WCAN_URL . 'assets/3rd-party/codemirror/lib/codemirror.css', array( 'yit-plugin-style' ) );
                wp_enqueue_script( 'codemirror-script', YITH_WCAN_URL . 'assets/3rd-party/codemirror/lib/codemirror.js', array( 'jquery' ), false, true );
                wp_enqueue_script( 'codemirror-script-css', YITH_WCAN_URL . 'assets/3rd-party/codemirror/mode/css/css.js', array( 'codemirror-script' ), false, true );
                wp_enqueue_script( 'yith-wcan-codemirror-init', YITH_WCAN_URL . 'assets/js/yith-wcan-editor.js', array( 'jquery' ), $this->version, true );
            }
        }

        /**
         * Add a panel under YITH Plugins tab
         *
         * @return   void
         * @since    1.0
         * @author   Andrea Grillo <andrea.grillo@yithemes.com>
         * @use     /Yit_Plugin_Panel class
         * @see      plugin-fw/lib/yit-plugin-panel.php
         */
        public function register_panel() {

            if ( ! empty( $this->_panel ) ) {
                return;
            }

            $admin_tabs = array(
                'frontend'      => __( 'Front end', 'yith-woocommerce-ajax-navigation' ),
                'custom-style'  => __( 'Custom Style', 'yith-woocommerce-ajax-navigation' ),
                'premium'       => __( 'Premium Version', 'yith-woocommerce-ajax-navigation' )
            );

            $args = array(
                'create_menu_page' => true,
                'parent_slug'      => '',
                'page_title'       => __( 'Ajax Product Filter', 'yith-woocommerce-ajax-navigation' ),
                'menu_title'       => __( 'Ajax Product Filter', 'yith-woocommerce-ajax-navigation' ),
                'capability'       => 'manage_options',
                'parent'           => 'wcan',
                'parent_page'      => 'yit_plugin_panel',
                'page'             => $this->_panel_page,
                'admin-tabs'       => apply_filters( 'yith_wcan_settings_tabs', $admin_tabs ),
                'options-path'     => YITH_WCAN_DIR . '/settings',
                'plugin-url'       => YITH_WCAN_URL
            );

            /* === Fixed: not updated theme  === */
            if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
                require_once( 'plugin-fw/lib/yit-plugin-panel-wc.php' );
            }

            $this->_panel = new YIT_Plugin_Panel( $args );
            $this->_main_panel_option = "yit_{$args['parent']}_options";

            $this->save_default_options();

            do_action( 'yith_wcan_after_option_panel', $args );
        }

 		/**
         * Add default option to panel
         *
         * @return   void
         * @since    1.0
         * @author   Andrea Grillo <andrea.grillo@yithemes.com>
         * @use     /Yit_Plugin_Panel class
         * @see      plugin-fw/lib/yit-plugin-panel.php
         */
		public function save_default_options(){
            $options = get_option( $this->_main_panel_option );
            if( $options === false ){
                add_option( $this->_main_panel_option, $this->_panel->get_default_options());
            }
        }

        /**
         * Premium Tab
         */
        public function premium_tab() {
            require_once( YITH_WCAN_DIR . 'templates/admin/premium.php' );
        }

        /**
         * Action Links
         *
         * add the action links to plugin admin page
         *
         * @param $links | links plugin array
         *
         * @return   mixed Array
         * @since    1.0
         * @author   Andrea Grillo <andrea.grillo@yithemes.com>
         * @return mixed
         * @use plugin_action_links_{$plugin_file_name}
         */
        public function action_links( $links ) {
            $premium_live_text = defined( 'YITH_WCAN_FREE_INIT' ) ? __( 'Premium live demo', 'yith-woocommerce-ajax-navigation' ) : __( 'Live demo', 'yith-woocommerce-ajax-navigation' );
            $links[]           = '_premium_live . '" target="_blank">' . $premium_live_text . '';

            if ( defined( 'YITH_WCAN_FREE_INIT' ) ) {
                $links[] = 'get_premium_landing_uri() . '" target="_blank">' . __( 'Premium Version', 'yith-woocommerce-ajax-navigation' ) . '';
            }

            return $links;
        }

        /**
         * plugin_row_meta
         *
         * add the action links to plugin admin page
         *
         * @param $plugin_meta
         * @param $plugin_file
         * @param $plugin_data
         * @param $status
         *
         * @return   Array
         * @since    1.0
         * @author   Andrea Grillo <andrea.grillo@yithemes.com>
         * @use plugin_row_meta
         */
        public function plugin_row_meta( $plugin_meta, $plugin_file, $plugin_data, $status ) {

            if ( ( defined( 'YITH_WCAN_INIT' ) && YITH_WCAN_INIT == $plugin_file ) || ( defined( 'YITH_WCAN_FREE_INIT' ) && YITH_WCAN_FREE_INIT == $plugin_file ) ) {
                $plugin_meta[] = '_official_documentation . '" target="_blank">' . __( 'Plugin Documentation', 'yith-woocommerce-ajax-navigation' ) . '';
            }
            return $plugin_meta;
        }

        /**
         * Get the premium landing uri
         *
         * @since   1.0.0
         * @author  Andrea Grillo <andrea.grillo@yithemes.com>
         * @return  string The premium landing link
         */
        public function get_premium_landing_uri() {
            return defined( 'YITH_REFER_ID' ) ? $this->_premium_landing . '?refer_id=' . YITH_REFER_ID : $this->_premium_landing . '?refer_id=1030585';
        }

        /**
         * Add the frontend tab description
         *
         * @param $option
         * @param $db_value
         * @param $custom_attributes
         *
         * @return  string The description text
         * @since    2.0.0
         * @author   Andrea Grillo <andrea.grillo@yithemes.com>
         */
        public function frontend_description_option( $option, $db_value, $custom_attributes  ){
            echo "
{$option['desc']}
";
        }

        /**
         * Custom Style tab
         */
        public function custom_style_tab(){
            require_once( YITH_WCAN_DIR . 'templates/admin/editor.php' );
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/colorPrimaryDark">

    <ImageView
        android:id="@+id/drawerLogoImage"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:scaleType="centerCrop"
        android:contentDescription="@string/app_name" />

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="15dp"
        android:layout_centerVertical="true">

        <ImageView
            android:id="@+id/drawerLogo"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:scaleType="centerCrop"
            android:src="@drawable/logo"
            android:contentDescription="@string/app_name" />

        <TextView
            android:id="@+id/drawerUserName"
            android:layout_toEndOf="@+id/drawerLogo"
            android:layout_centerVertical="true"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="15dp"
            android:textColor="@color/white"
            android:textSize="24sp"
            android:textStyle="bold"
            android:text="@string/app_name" />
    </RelativeLayout>
</RelativeLayout>


text:
{% extends 'templates/nhs_transaction_layout.html' %}

{% block pageTitle %}NHS.UK prototyping kit{% endblock %}

{% block content %}

Add missing information

    Item {{unpaidItemRunning}} of {{startingUnpaidItemCount}}

Prescribed

             Prescribed item

{{selectedProductName}}

{{selectedStrength}}

{{selectedPresentation}}

{{selectedQty}}

             Patient details

Surname

{{patientName}}

Postcode

NE12 3AC

Date of birth

{{patientDob}}

NHS Number

{{patientNhsNum}}

Dispensed on 19/02/2016

            {% if packSizeError=='true' || supplierError=='true' %}

			Complete the missing information

All fields must be complete before you can submit this item

			{% endif %}

            Tell us if this is incorrect

            You selected this item in EPS

Product name: {{selecteddispensedProductName}}

Quantity: {{selectedQty}}

Additional endorsements: BB

            <form id="form" action="../submit/{{selectedItemId}}" method="get" class="form">

              <fieldset>

                We need to know

<legend  class="form-label">Supplier/manufacturer</legend>

		  {% if supplierError=='true' %}
				You have not entered the supplier/manufacturer is for this item
			{% endif %}
            <input name="supplierInput" type="text" id="first-label" class="form-control {% if supplierError=='true' %} field-error {% endif %}">

<legend  class="form-label">Price</legend>

		  {% if priceError=='true' %}
				You have not entered the price is for this item
			{% endif %}
            <input name="priceInput" type="text" id="first-label" class="form-control {% if supplierError=='true' %} field-error {% endif %}">

<legend  class="form-label" >Pack size</legend>

			{% if packSizeError=='true' %}
				You have not entered a pack size for this item
			{% endif %}

            <input name="packSizeInput" type="text" id="first-label" class="form-control {% if packSizeError=='true' %} field-error {% endif %}">

                  <input type="hidden" name="after" value="{{after}}">
		 <input type="hidden" name="startingUnpaidItemCount" value="{{startingUnpaidItemCount}}">
		 <input type="hidden" name="unpaidItemRunning" value="{{unpaidItemRunning}}">

SubmitSkip

                  </fieldset>

                 </form>

{% endblock %}


text:
"use strict";
var utils = require("../utils");
var url = require("url");
var portalThemeImporter;// = require("../portalThemeImporter");
var os = require("os");
var logger = utils.createLogger({sourceFilePath : __filename});

/**
 *
 * @param {RequestContext} rc
 */
var handleCreateNewPortalMavenProjectZip = function (rc) {
    if(!portalThemeImporter){
        portalThemeImporter = require("../portalThemeImporter");
    }
    //serve up
    var config = allowedThemeReqs[rc.wr.getQueryParam('auth')];// JSON.parse(authorizedThemeReqData);
    var ti = new portalThemeImporter.ThemeImporter(config);
    ti.createNewThemeProjectZipBuffer(config.projectName, os.tmpdir(), config, function (buffer) {
        rc.response.writeHead(200, {
            'Expires': 0,
            'Cache-Control': 'must-revalidate, post-check=0, pre-check=0',
            'Content-Description': 'File Transfer',
            'Content-type': 'application/octet-stream',
            'Content-Disposition': 'attachment; filename=\"' + config.projectName + '.zip\"',
            'Content-Transfer-Encoding': 'binary',
            "Content-Length": buffer.length
        });
        rc.response.write(buffer, "binary");
        rc.response.end();
    });
};
module.exports = handleCreateNewPortalMavenProjectZip;


text:
package burlap.mdp.auxiliary.stateconditiontest;

import burlap.mdp.core.oo.propositional.GroundedProp;
import burlap.mdp.core.oo.propositional.PropositionalFunction;
import burlap.mdp.core.oo.state.OOState;
import burlap.mdp.core.state.State;

import java.util.List;

/**
 * A state condition class that returns true when ever any grounded version of a specified
 * propositional function is true in a state. Useful for specifying goal conditions.
 * @author James MacGlashan
 *
 */
public class SinglePFSCT implements StateConditionTest {

	PropositionalFunction pf;

	/**
	 * Initializes with the propositional function that is checked for state satisfaction
	 * @param pf the propositional function to use for satisfaction tests
	 */
	public SinglePFSCT(PropositionalFunction pf) {
		this.pf = pf;
	}

	@Override
	public boolean satisfies(State s) {

		//List<GroundedProp> gps = s.getAllGroundedPropsFor(pf);
		List<GroundedProp> gps = this.pf.allGroundings((OOState)s);

		for(GroundedProp gp : gps){
			if(gp.isTrue((OOState)s)){
				return true;
			}
		}

		return false;

	}

}


text:
<?php

namespace Magento\Bundle\Test\Constraint;

use Magento\Bundle\Test\Fixture\BundleProduct;
use Magento\Catalog\Test\Page\Product\CatalogProductView;
use Magento\Mtf\Client\BrowserInterface;
use Magento\Mtf\Constraint\AbstractConstraint;

/**
 * Check displayed price view for bundle product on product page.
 */
class AssertBundlePriceView extends AbstractConstraint
{
    /**
     * Assert that displayed price view for bundle product on product page equals passed from fixture.
     *
     * @param CatalogProductView $catalogProductView
     * @param BrowserInterface $browser
     * @param BundleProduct $product
     * @return void
     */
    public function processAssert(
        CatalogProductView $catalogProductView,
        BrowserInterface $browser,
        BundleProduct $product
    ) {
        //Open product view page
        $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');

        //Process assertions
        $this->assertPrice($product, $catalogProductView);
    }

    /**
     * Assert prices on the product view Page.
     *
     * @param BundleProduct $product
     * @param CatalogProductView $catalogProductView
     * @return void
     */
    protected function assertPrice(BundleProduct $product, CatalogProductView $catalogProductView)
    {
        $priceData = $product->getDataFieldConfig('price')['source']->getPriceData();
        $priceView = $product->getPriceView();
        $priceBlock = $catalogProductView->getViewBlock()->getPriceBlock();

        if ($product->hasData('special_price')) {
            $priceLow = $priceBlock->getPrice();
        } else {
            $priceLow = ($priceView == 'Price Range') ? $priceBlock->getPriceFrom() : $priceBlock->getPrice();
        }

        \PHPUnit_Framework_Assert::assertEquals(
            $priceData['price_from'],
            $priceLow,
            'Bundle price From on product view page is not correct.'
        );

        if ($priceView == 'Price Range') {
            \PHPUnit_Framework_Assert::assertEquals(
                $priceData['price_to'],
                $priceBlock->getPriceTo(),
                'Bundle price To on product view page is not correct.'
            );
        }
    }

    /**
     * Returns a string representation of the object.
     *
     * @return string
     */
    public function toString()
    {
        return 'Bundle price on product view page is not correct.';
    }
}


text:
<?php

/*
 * @author Muhammadali Shaduli
 */

namespace Shaduli\JobeetBundle\DataFixtures\ORM;

use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Shaduli\JobeetBundle\Entity\Job;

class LoadJobData extends AbstractFixture implements OrderedFixtureInterface {

    public function load(ObjectManager $manager) {

        $job = new Job();
        $job->setCategory($this->getReference('Design'));
        $job->setType('part-time');
        $job->setCompany('Extreme Sensio');
        $job->setLogo(null);
        $job->setUrl('http://www.extreme-sensio.com/');
        $job->setPosition('Web Designer');
        $job->setLocation('Paris, France');
        $job->setDescription("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
      eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
      enim ad minim veniam, quis nostrud exercitation ullamco laboris
      nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
      in reprehenderit in.");
        $job->setHowToApply('Send your resume to fabien.potencier [at] sensio.com');
        $job->setIsPublic(true);
        $job->setIsActivated(true);
        $job->setEmail('job@example.com');
        $job->setToken('job_extreme_sensio');
        $job->setExpiresAt(new \DateTime('2013-01-22'));
        $manager->persist($job);
        $manager->flush();

        $job = new Job();
        $job->setCategory($this->getReference('Programming'));
        $job->setType('full-time');
        $job->setCompany('Sensio Labs');
        $job->setLogo(null);
        $job->setUrl('http://www.sensiolabs.com/');
        $job->setPosition('Web Developer');
        $job->setLocation('Paris, France');
        $job->setDescription("You've already developed websites with symfony and you want to work
      with Open-Source technologies. You have a minimum of 3 years
      experience in web development with PHP or Java and you wish to
      participate to development of Web 2.0 sites using the best
      frameworks available");
        $job->setHowToApply('Send your resume to fabien.potencier [at] sensio.com');
        $job->setIsPublic(true);
        $job->setIsActivated(true);
        $job->setEmail('job@example.com');
        $job->setToken('some');
        $job->setExpiresAt(new \DateTime('2013-12-22'));
        $manager->persist($job);
        $manager->flush();

        $categories = array('Design', 'Programming', 'Manager', 'Administrator');

        foreach ($categories as $category) {

            for ($i = 100; $i <= 130; $i++) {
                $job = new Job();
                $job->setCategory($this->getReference($category));
                $job->setType('full-time');
                $job->setCompany('Company ' . $i);
                $job->setLogo(null);
                $job->setUrl('http://www.sensiolabs.com/');
                $job->setPosition($category.$i);
                $job->setLocation('Paris, France');
                $job->setDescription("Lorem ipsum dolor sit amet, consectetur adipisicing elit.");
                $job->setHowToApply('Send your resume to fabien.potencier [at] sensio.com');
                $job->setIsPublic(true);
                $job->setIsActivated(true);
                $job->setEmail('job@example.com');
                $job->setToken('job_' . $i);
                $job->setExpiresAt(new \DateTime('2013-12-22'));
                $manager->persist($job);
                $manager->flush();
            }
        }
    }

    /**
     * {@inheritDoc}
     */
    public function getOrder() {
        return 2; // the order in which fixtures will be loaded
    }

}


text:
#pragma once
#include <kernel_headers/example.hpp>   // This is the header that gets auto-generated
                                        // from the .cl file you will create. We pre-process
                                        // cl files to obfuscate code.

#include <program.hpp>
#include <traits.hpp>

// Following c++ standard library headers are needed to maintain
// OpenCL cl::Kernel & cl::Program objects
#include <string>
#include <mutex>
#include <map>

#include <dispatch.hpp>                 // common utility header for CUDA & OpenCL backends
                                        // has the divup macro

#include <Param.hpp>                    // This header has the declaration of structures
                                        // that are passed onto kernel. Operator overloads
                                        // for creating Param objects from opencl::Array<T>
                                        // objects is automatic, no special work is needed.
                                        // Hence, the OpenCL kernel wrapper function takes in
                                        // Param instead of opencl::Array<T>

#include <debug_opencl.hpp>             // For Debug only related OpenCL validations

using cl::Buffer;
using cl::Program;
using cl::Kernel;
using cl::make_kernel;
using cl::EnqueueArgs;
using cl::NDRange;
using std::string;

namespace opencl
{

namespace kernel
{

static const int THREADS_X = 16;
static const int THREADS_Y = 16;

template<typename T>
void exampleFunc(Param out, const Param in, const af_someenum_t p)
{
    try {
        static std::once_flag compileFlags[DeviceManager::MAX_DEVICES];
        static std::map<int, Program*>  egProgs;
        static std::map<int, Kernel*> egKernels;

        int device = getActiveDeviceId();

        // std::call_once is used to ensure OpenCL kernels
        // are compiled only once for any given device and combination
        // of template parameters to this kernel wrapper function 'exampleFunc<T>'
        std::call_once( compileFlags[device], [device] () {

                std::ostringstream options;
                options << " -D T=" << dtype_traits<T>::getName();
                // You can pass any template parameters as compile options
                // to kernel the compilation step. This is equivalent of
                // having templated kernels in CUDA

                // The following option is passed to kernel compilation
                // if template parameter T is double or complex double
                // to enable FP64 extension
                if (std::is_same<T, double>::value ||
                    std::is_same<T, cdouble>::value) {
                    options << " -D USE_DOUBLE";
                }

                Program prog;
                // below helper function 'buildProgram' uses the option string
                // we just created and compiles the kernel string
                // 'example_cl' which was created by our opencl kernel code obfuscation
                // stage
                buildProgram(prog, example_cl, example_cl_len, options.str());

                // create a cl::Program object on heap
                egProgs[device]   = new Program(prog);

                // create a cl::Kernel object on heap
                egKernels[device] = new Kernel(*egProgs[device], "example");
            });

        // configure work group parameters
        NDRange local(THREADS_X, THREADS_Y);

        int blk_x = divup(out.info.dims[0], THREADS_X);
        int blk_y = divup(out.info.dims[1], THREADS_Y);

        // configure global launch parameters
        NDRange global(blk_x * THREADS_X, blk_y * THREADS_Y);

        // create a kernel functor from the cl::Kernel object
        // corresponding to the device on which current execution
        // is happending.
        auto exampleFuncOp = make_kernel<Buffer, KParam,
                                     Buffer, KParam, int>(*egKernels[device]);

        // launch the kernel
        exampleFuncOp(EnqueueArgs(getQueue(), global, local),
                    *out.data, out.info, *in.data, in.info, (int)p);

        // Below Macro activates validations ONLY in DEBUG
        // mode as its name indicates
        CL_DEBUG_FINISH(getQueue());
    } catch (cl::Error err) { // Catch all cl::Errors and convert them
                              // to appropriate ArrayFire error codes
        CL_TO_AF_ERROR(err);
    }
}

}

}


text:
{% extends "emails/header.html"%}

{% block content %}
{% include "emails/includes/topsnippet.html"%}

<form action="{% url 'index' %}" method="post">
  {% csrf_token %}

  /r/
  <input type="text" class="form-control" placeholder="Subreddit " aria-describedby="basic-addon1">

  /r/
  <input type="text" class="form-control" placeholder="Subreddit " aria-describedby="basic-addon1">

  /r/
  <input type="text" class="form-control" placeholder="Subreddit " aria-describedby="basic-addon1">

<button type="button" onclick="myFunction()"class="btn btn-primary btn-lg">Add Subreddit</button>

Submit Below.

<button type="submit" class="btn btn-primary btn-block">Submit</button>
</form>

{% endblock %}


text:
package com.xinran.qxviewslib;

import android.app.Activity;
import android.app.Application;

import com.xinran.viewslib.qxtabview.strictmode.QxStrictModeManager;

import java.util.ArrayList;

/**
 * Created by qixinh on 16/4/20.
 */
public class QxApp extends Application{
    public static ArrayList<Activity> sLeakyActivities = new ArrayList<Activity>();

    @Override
    public void onCreate() {
        super.onCreate();

        QxStrictModeManager.initDefaultStrictMode(this);
    }

}


text:
/**
 * @file reminder command
 * @author Sankarsan Kampa (a.k.a k3rn31p4nic)
 * @license GPL-3.0
 */

const moment = xrequire('moment');
const remindUsers = {};

exports.exec = async (Bastion, message, args) => {
  if (args.cancel) {
    Bastion.clearTimeout(remindUsers[message.author.id]);
    delete remindUsers[message.author.id];

    return await message.channel.send({
      embed: {
        color: Bastion.colors.GREEN,
        description: Bastion.i18n.info(message.guild.language, 'deleteReminder', message.author.tag)
      }
    });
  }

  if (!args.duration || !args.message) {
    return Bastion.emit('commandUsage', message, this.help);
  }

  let duration = moment.duration(`PT${args.duration.toUpperCase()}`).asMilliseconds(),
    maxDelay = 24 * 60 * 60 * 1000, minDelay = 60 * 1000;

  if (duration > maxDelay || duration < minDelay) {
    return Bastion.emit('commandUsage', message, this.help);
  }

  if (remindUsers.hasOwnProperty(message.author.id)) {
    return Bastion.emit('error', '', Bastion.i18n.error(message.guild.language, 'isReminderInUse', 'reminder --cancel'), message.channel);
  }

  remindUsers[message.author.id] = Bastion.setTimeout(async () => {
    let authorDMChannel = await message.author.createDM();
    await authorDMChannel.send({
      embed: {
        color: Bastion.colors.BLUE,
        title: 'Reminder',
        description: args.message.join(' '),
        timestamp: new Date()
      }
    });

    delete remindUsers[message.author.id];
  }, duration);

  await message.channel.send({
    embed: {
      color: Bastion.colors.GREEN,
      title: 'Reminder Set',
      description: Bastion.i18n.info(message.guild.language, 'addReminder', message.author.tag, args.message.join(' '), moment.duration(duration).humanize())
    }
  }).catch(e => {
    Bastion.log.error(e);
  });
};

exports.config = {
  aliases: [ 'remind' ],
  enabled: true,
  argsDefinitions: [
    { name: 'message', type: String, alias: 'm', multiple: true, defaultOption: true },
    { name: 'duration', type: String, alias: 'd' },
    { name: 'cancel', type: Boolean, alias: 'c' }
  ]
};

exports.help = {
  name: 'reminder',
  description: 'Bastion sets a reminder to remind you of specified message, via direct message, after a specified duration.',
  botPermission: '',
  userTextPermission: '',
  userVoicePermission: '',
  usage: 'reminder <-d Duration> <Message>',
  example: [ 'reminder -d 10m30s Get back to work.' ]
};


text:
package co.tpaga.android.Tools;

public class TpagaException extends Exception {

    private int statusCode;

    public TpagaException() {
        super();
        statusCode = 500;
    }

    public TpagaException(int code) {
        super();
        statusCode = code;
    }

    public TpagaException(String message) {
        super(message);
        statusCode = 500;
    }

    public TpagaException(String message, Throwable cause) {
        super(message, cause);
        statusCode = 500;
    }

    public TpagaException(String message, int code) {
        super(message);
        statusCode = code;
    }

    public TpagaException(Throwable cause, int code) {
        super(cause);
        statusCode = code;
    }

    public TpagaException(String message, Throwable cause, int code) {
        super(message, cause);
        statusCode = code;
    }

    public int getStatusCode() {
        return statusCode;
    }

}


text:
package main.java.exceptions.data;

import java.io.IOException;

public class InvalidGameBlueprintException extends IOException {
	public InvalidGameBlueprintException(String s)	{
		super("Invalid or missing " + s + " for GameBlueprint");
	}
	public InvalidGameBlueprintException() {
		super("File is not a blueprint");
	}
}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Theres A Word</title>
  <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Source+Sans+Pro:300,300i,600">
  <link rel="stylesheet" href="/style.css">
  <link rel="stylesheet" href="/custom.css">

	<link rel="shortcut icon" href="https://micro.blog/curt/favicon.png" type="image/x-icon" />
  <link rel="alternate" type="application/rss+xml" title="Curt Clifton" href="http://microblog.curtclifton.net/feed.xml" />

  <link rel="alternate" type="application/json" title="Curt Clifton" href="http://microblog.curtclifton.net/feed.json" />
  <link rel="EditURI" type="application/rsd+xml" href="/rsd.xml" />

  <link rel="me" href="https://micro.blog/curt" />

  	<link rel="me" href="https://twitter.com/curtclifton" />

  <link rel="authorization_endpoint" href="https://micro.blog/indieauth/auth" />
  <link rel="token_endpoint" href="https://micro.blog/indieauth/token" />
  <link rel="micropub" href="https://micro.blog/micropub" />
  <link rel="webmention" href="https://micro.blog/webmention" />
  <link rel="subscribe" href="https://micro.blog/users/follow" />

    Curt Clifton

    <time class="dt-published" datetime="2017-08-28 19:38:21 -0700">28 Aug 2017</time>

"there's a word for people who round up members of ethnic minorities and send them to concentration camps… There's also a word for people who, out of cowardice or self-interest, go along with such abuses" —Paul Krugman


text:
import { equal, typeOf } from '../src/helpers'

describe('core.helpers.equal', () => {

    it('equals string against string', () => {
        expect(equal('', '')).toBe(true)
    })

    it('equals null against null', () => {
        expect(equal(null, null)).toBe(true)
    })

    it('equals undefined against undefined', () => {
        expect(equal(undefined, undefined)).toBe(true)
    })

    it('equals boolean against boolean', () => {
        expect(equal(false, false)).toBe(true)
    })

    it('equals number against number', () => {
        expect(equal(65.43, 65.43)).toBe(true)
    })

    it('equals array against array', () => {
        const a1 = ['a', 5, true, undefined, null]
        const a2 = ['a', 5, true, undefined, null]
        expect(equal(a1, a2)).toBe(true)
    })

    it('equals array against itself', () => {
        const a1 = ['a', 5, true, undefined, null]
        const a2 = a1
        a1[2] = false
        expect(equal(a1, a2)).toBe(true)
    })

    it('equals object against object', () => {
        const o1 = { a: 'a', b: 5, c: true, d: undefined, e: null }
        const o2 = { a: 'a', b: 5, c: true, d: undefined, e: null }
        expect(equal(o1, o2)).toBe(true)
    })

    it('equals object against itself', () => {
        const o1 = { a: 'a', b: 5, c: true, d: undefined, e: null }
        const o2 = o1
        o2.c = false
        expect(equal(o1, o2)).toBe(true)
    })
    it('equals date against date', () => {
        const d1 = new Date('2016-01-01')
        const d2 = new Date('2016-01-01')

        expect(equal(d1, d2)).toBe(true)
    })

    it('equals regexp against regexp', () => {
        const r1 = /^.*$/
        const r2 = /^.*$/

        expect(equal(r1, r2)).toBe(true)
    })

    it('equals other type against itself', () => {
        const x1 = document.createElement("div")

        expect(equal(x1, x1)).toBe(true)
    })

    it('equals anonymous function against itself', () => {
        const fn = () => { }
        expect(equal(fn, fn)).toBe(true)
    })

    it('equals named function against itself', () => {
        const fn = function withName() { }
        expect(equal(fn, fn)).toBe(true)
    })

    it('does not equal different anonymous functions', () => {
        const r1 = function () { }
        const r2 = function () { }

        expect(equal(r1, r2)).toBe(false)
    })

    it('does not equal different functions with the same name', () => {
        const r1 = function withName() { }
        const r2 = function withName() { }

        expect(equal(r1, r2)).toBe(false)
    })

    it('does not equal string against undefined', () => {
        expect(equal('a string', undefined)).toBe(false)
    })

    it('does not equal false against true', () => {
        expect(equal(false, true)).toBe(false)
    })

    it('does not equal object against non-equal object', () => {
        const o1 = { a: 'a', b: 5, c: false, d: undefined, e: null }
        const o2 = { a: 'a', b: 5, c: true, d: undefined, e: null }
        expect(equal(o1, o2)).toBe(false)
    })

    it('does not equal object against object with missing property', () => {
        const o1 = { a: 'a', b: 5, c: true, d: undefined, e: null }
        const o2 = { a: 'a', b: 5, c: true, d: undefined }
        expect(equal(o1, o2)).toBe(false)
    })

    it('does not equal object against undefined', () => {
        expect(equal({ test: 'a string' }, undefined)).toBe(false)
    })

    it('does not equal array against array with different values', () => {
        const a1 = ['a', 5.01, true, undefined, null]
        const a2 = ['a', 5, true, undefined, null]
        expect(equal(a1, a2)).toBe(false)
    })

    it('does not equal array against array with different length', () => {
        const a1 = ['a', 5, true, undefined]
        const a2 = ['a', 5, true, undefined, null]
        expect(equal(a1, a2)).toBe(false)
    })

    it('does not equal date against different date', () => {
        const d1 = new Date('2015-01-01')
        const d2 = new Date('2016-01-01')

        expect(equal(d1, d2)).toBe(false)
    })

    it('does not equal regexp against different regexp', () => {
        const r1 = /^.*$/
        const r2 = /^.+$/

        expect(equal(r1, r2)).toBe(false)
    })

    it('does not equal different types', () => {
        const a = 'A string'
        const b = 254

        expect(equal(a, b as any)).toBe(false)
    })
})

// describe('core.helpers.max', () => {
//     it('returns max', () => {
//         expect(max(66, 22)).toBe(66)
//     })

//     it('returns max of negative numbers', () => {
//         expect(max(-51, -2)).toBe(-2)
//     })
// })

describe('core.helpers.typeOf', () => {

    it('identifies an array', () => {
        expect(typeOf([])).toBe('array')
    })

    it('identifies an object', () => {
        expect(typeOf({})).toBe('object')
    })

    it('identifies a string', () => {
        expect(typeOf('test string')).toBe('string')
    })

    it('identifies a date', () => {
        expect(typeOf(new Date())).toBe('date')
    })

    it('identifies a regexp', () => {
        expect(typeOf(/^.*$/)).toBe('regexp')
    })

    it('identifies a function', () => {
        expect(typeOf(() => 0)).toBe('function')
    })

    it('identifies true as a boolean', () => {
        expect(typeOf(true)).toBe('boolean')
    })

    it('identifies false as a boolean', () => {
        expect(typeOf(false)).toBe('boolean')
    })

    it('identifies a number', () => {
        expect(typeOf(1235)).toBe('number')
    })

    it('identifies null', () => {
        expect(typeOf(null)).toBe('null')
    })

    it('identifies undefined', () => {
        expect(typeOf(undefined)).toBe('undefined')
    })
})