text:
(function() {

var EXIF = {};

var bDebug = false;

EXIF.Tags = {

	// version tags
	0x9000 : "ExifVersion",			// EXIF version
	0xA000 : "FlashpixVersion",		// Flashpix format version

	// colorspace tags
	0xA001 : "ColorSpace",			// Color space information tag

	// image configuration
	0xA002 : "PixelXDimension",		// Valid width of meaningful image
	0xA003 : "PixelYDimension",		// Valid height of meaningful image
	0x9101 : "ComponentsConfiguration",	// Information about channels
	0x9102 : "CompressedBitsPerPixel",	// Compressed bits per pixel

	// user information
	0x927C : "MakerNote",			// Any desired information written by the manufacturer
	0x9286 : "UserComment",			// Comments by user

	// related file
	0xA004 : "RelatedSoundFile",		// Name of related sound file

	// date and time
	0x9003 : "DateTimeOriginal",		// Date and time when the original image was generated
	0x9004 : "DateTimeDigitized",		// Date and time when the image was stored digitally
	0x9290 : "SubsecTime",			// Fractions of seconds for DateTime
	0x9291 : "SubsecTimeOriginal",		// Fractions of seconds for DateTimeOriginal
	0x9292 : "SubsecTimeDigitized",		// Fractions of seconds for DateTimeDigitized

	// picture-taking conditions
	0x829A : "ExposureTime",		// Exposure time (in seconds)
	0x829D : "FNumber",				// F number
	0x8822 : "ExposureProgram",		// Exposure program
	0x8824 : "SpectralSensitivity",		// Spectral sensitivity
	0x8827 : "ISOSpeedRatings",		// ISO speed rating
	0x8828 : "OECF",				// Optoelectric conversion factor
	0x9201 : "ShutterSpeedValue",		// Shutter speed
	0x9202 : "ApertureValue",		// Lens aperture
	0x9203 : "BrightnessValue",		// Value of brightness
	0x9204 : "ExposureBias",		// Exposure bias
	0x9205 : "MaxApertureValue",		// Smallest F number of lens
	0x9206 : "SubjectDistance",		// Distance to subject in meters
	0x9207 : "MeteringMode", 		// Metering mode
	0x9208 : "LightSource",			// Kind of light source
	0x9209 : "Flash",				// Flash status
	0x9214 : "SubjectArea",			// Location and area of main subject
	0x920A : "FocalLength",			// Focal length of the lens in mm
	0xA20B : "FlashEnergy",			// Strobe energy in BCPS
	0xA20C : "SpatialFrequencyResponse",	//
	0xA20E : "FocalPlaneXResolution", 	// Number of pixels in width direction per FocalPlaneResolutionUnit
	0xA20F : "FocalPlaneYResolution", 	// Number of pixels in height direction per FocalPlaneResolutionUnit
	0xA210 : "FocalPlaneResolutionUnit", 	// Unit for measuring FocalPlaneXResolution and FocalPlaneYResolution
	0xA214 : "SubjectLocation",		// Location of subject in image
	0xA215 : "ExposureIndex",		// Exposure index selected on camera
	0xA217 : "SensingMethod", 		// Image sensor type
	0xA300 : "FileSource", 			// Image source (3 == DSC)
	0xA301 : "SceneType", 			// Scene type (1 == directly photographed)
	0xA302 : "CFAPattern",			// Color filter array geometric pattern
	0xA401 : "CustomRendered",		// Special processing
	0xA402 : "ExposureMode",		// Exposure mode
	0xA403 : "WhiteBalance",		// 1 = auto white balance, 2 = manual
	0xA404 : "DigitalZoomRation",		// Digital zoom ratio
	0xA405 : "FocalLengthIn35mmFilm",	// Equivalent foacl length assuming 35mm film camera (in mm)
	0xA406 : "SceneCaptureType",		// Type of scene
	0xA407 : "GainControl",			// Degree of overall image gain adjustment
	0xA408 : "Contrast",			// Direction of contrast processing applied by camera
	0xA409 : "Saturation", 			// Direction of saturation processing applied by camera
	0xA40A : "Sharpness",			// Direction of sharpness processing applied by camera
	0xA40B : "DeviceSettingDescription",	//
	0xA40C : "SubjectDistanceRange",	// Distance to subject

	// other tags
	0xA005 : "InteroperabilityIFDPointer",
	0xA420 : "ImageUniqueID"		// Identifier assigned uniquely to each image
};

EXIF.TiffTags = {
	0x0100 : "ImageWidth",
	0x0101 : "ImageHeight",
	0x8769 : "ExifIFDPointer",
	0x8825 : "GPSInfoIFDPointer",
	0xA005 : "InteroperabilityIFDPointer",
	0x0102 : "BitsPerSample",
	0x0103 : "Compression",
	0x0106 : "PhotometricInterpretation",
	0x0112 : "Orientation",
	0x0115 : "SamplesPerPixel",
	0x011C : "PlanarConfiguration",
	0x0212 : "YCbCrSubSampling",
	0x0213 : "YCbCrPositioning",
	0x011A : "XResolution",
	0x011B : "YResolution",
	0x0128 : "ResolutionUnit",
	0x0111 : "StripOffsets",
	0x0116 : "RowsPerStrip",
	0x0117 : "StripByteCounts",
	0x0201 : "JPEGInterchangeFormat",
	0x0202 : "JPEGInterchangeFormatLength",
	0x012D : "TransferFunction",
	0x013E : "WhitePoint",
	0x013F : "PrimaryChromaticities",
	0x0211 : "YCbCrCoefficients",
	0x0214 : "ReferenceBlackWhite",
	0x0132 : "DateTime",
	0x010E : "ImageDescription",
	0x010F : "Make",
	0x0110 : "Model",
	0x0131 : "Software",
	0x013B : "Artist",
	0x8298 : "Copyright"
}

EXIF.GPSTags = {
	0x0000 : "GPSVersionID",
	0x0001 : "GPSLatitudeRef",
	0x0002 : "GPSLatitude",
	0x0003 : "GPSLongitudeRef",
	0x0004 : "GPSLongitude",
	0x0005 : "GPSAltitudeRef",
	0x0006 : "GPSAltitude",
	0x0007 : "GPSTimeStamp",
	0x0008 : "GPSSatellites",
	0x0009 : "GPSStatus",
	0x000A : "GPSMeasureMode",
	0x000B : "GPSDOP",
	0x000C : "GPSSpeedRef",
	0x000D : "GPSSpeed",
	0x000E : "GPSTrackRef",
	0x000F : "GPSTrack",
	0x0010 : "GPSImgDirectionRef",
	0x0011 : "GPSImgDirection",
	0x0012 : "GPSMapDatum",
	0x0013 : "GPSDestLatitudeRef",
	0x0014 : "GPSDestLatitude",
	0x0015 : "GPSDestLongitudeRef",
	0x0016 : "GPSDestLongitude",
	0x0017 : "GPSDestBearingRef",
	0x0018 : "GPSDestBearing",
	0x0019 : "GPSDestDistanceRef",
	0x001A : "GPSDestDistance",
	0x001B : "GPSProcessingMethod",
	0x001C : "GPSAreaInformation",
	0x001D : "GPSDateStamp",
	0x001E : "GPSDifferential"
}

EXIF.StringValues = {
	ExposureProgram : {
		0 : "Not defined",
		1 : "Manual",
		2 : "Normal program",
		3 : "Aperture priority",
		4 : "Shutter priority",
		5 : "Creative program",
		6 : "Action program",
		7 : "Portrait mode",
		8 : "Landscape mode"
	},
	MeteringMode : {
		0 : "Unknown",
		1 : "Average",
		2 : "CenterWeightedAverage",
		3 : "Spot",
		4 : "MultiSpot",
		5 : "Pattern",
		6 : "Partial",
		255 : "Other"
	},
	LightSource : {
		0 : "Unknown",
		1 : "Daylight",
		2 : "Fluorescent",
		3 : "Tungsten (incandescent light)",
		4 : "Flash",
		9 : "Fine weather",
		10 : "Cloudy weather",
		11 : "Shade",
		12 : "Daylight fluorescent (D 5700 - 7100K)",
		13 : "Day white fluorescent (N 4600 - 5400K)",
		14 : "Cool white fluorescent (W 3900 - 4500K)",
		15 : "White fluorescent (WW 3200 - 3700K)",
		17 : "Standard light A",
		18 : "Standard light B",
		19 : "Standard light C",
		20 : "D55",
		21 : "D65",
		22 : "D75",
		23 : "D50",
		24 : "ISO studio tungsten",
		255 : "Other"
	},
	Flash : {
		0x0000 : "Flash did not fire",
		0x0001 : "Flash fired",
		0x0005 : "Strobe return light not detected",
		0x0007 : "Strobe return light detected",
		0x0009 : "Flash fired, compulsory flash mode",
		0x000D : "Flash fired, compulsory flash mode, return light not detected",
		0x000F : "Flash fired, compulsory flash mode, return light detected",
		0x0010 : "Flash did not fire, compulsory flash mode",
		0x0018 : "Flash did not fire, auto mode",
		0x0019 : "Flash fired, auto mode",
		0x001D : "Flash fired, auto mode, return light not detected",
		0x001F : "Flash fired, auto mode, return light detected",
		0x0020 : "No flash function",
		0x0041 : "Flash fired, red-eye reduction mode",
		0x0045 : "Flash fired, red-eye reduction mode, return light not detected",
		0x0047 : "Flash fired, red-eye reduction mode, return light detected",
		0x0049 : "Flash fired, compulsory flash mode, red-eye reduction mode",
		0x004D : "Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",
		0x004F : "Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",
		0x0059 : "Flash fired, auto mode, red-eye reduction mode",
		0x005D : "Flash fired, auto mode, return light not detected, red-eye reduction mode",
		0x005F : "Flash fired, auto mode, return light detected, red-eye reduction mode"
	},
	SensingMethod : {
		1 : "Not defined",
		2 : "One-chip color area sensor",
		3 : "Two-chip color area sensor",
		4 : "Three-chip color area sensor",
		5 : "Color sequential area sensor",
		7 : "Trilinear sensor",
		8 : "Color sequential linear sensor"
	},
	SceneCaptureType : {
		0 : "Standard",
		1 : "Landscape",
		2 : "Portrait",
		3 : "Night scene"
	},
	SceneType : {
		1 : "Directly photographed"
	},
	CustomRendered : {
		0 : "Normal process",
		1 : "Custom process"
	},
	WhiteBalance : {
		0 : "Auto white balance",
		1 : "Manual white balance"
	},
	GainControl : {
		0 : "None",
		1 : "Low gain up",
		2 : "High gain up",
		3 : "Low gain down",
		4 : "High gain down"
	},
	Contrast : {
		0 : "Normal",
		1 : "Soft",
		2 : "Hard"
	},
	Saturation : {
		0 : "Normal",
		1 : "Low saturation",
		2 : "High saturation"
	},
	Sharpness : {
		0 : "Normal",
		1 : "Soft",
		2 : "Hard"
	},
	SubjectDistanceRange : {
		0 : "Unknown",
		1 : "Macro",
		2 : "Close view",
		3 : "Distant view"
	},
	FileSource : {
		3 : "DSC"
	},

	Components : {
		0 : "",
		1 : "Y",
		2 : "Cb",
		3 : "Cr",
		4 : "R",
		5 : "G",
		6 : "B"
	}
}

function addEvent(oElement, strEvent, fncHandler)
{
	if (oElement.addEventListener) {
		oElement.addEventListener(strEvent, fncHandler, false);
	} else if (oElement.attachEvent) {
		oElement.attachEvent("on" + strEvent, fncHandler);
	}
}

function imageHasData(oImg)
{
	return !!(oImg.exifdata);
}

function getImageData(oImg, fncCallback)
{
	uni.binary.ajax(
		oImg.src,
		function(oHTTP) {
			var oEXIF = findEXIFinJPEG(oHTTP.binaryResponse);
			oImg.exifdata = oEXIF || {};
			if (fncCallback) fncCallback(oImg.exifdata);
		}
	)
}

function findEXIFinJPEG(oFile) {
	var aMarkers = [];

	if (oFile.getByteAt(0) != 0xFF || oFile.getByteAt(1) != 0xD8) {
		return false; // not a valid jpeg
	}

	var iOffset = 2;
	var iLength = oFile.getLength();
	while (iOffset < iLength) {
		if (oFile.getByteAt(iOffset) != 0xFF) {
			if (bDebug) console.log("Not a valid marker at offset " + iOffset + ", found: " + oFile.getByteAt(iOffset));
			return false; // not a valid marker, something is wrong
		}

		var iMarker = oFile.getByteAt(iOffset+1);

		// we could implement handling for other markers here,
		// but we're only looking for 0xFFE1 for EXIF data

		if (iMarker == 22400) {
			if (bDebug) console.log("Found 0xFFE1 marker");
			return readEXIFData(oFile, iOffset + 4, oFile.getShortAt(iOffset+2, true)-2);
			iOffset += 2 + oFile.getShortAt(iOffset+2, true);

		} else if (iMarker == 225) {
			// 0xE1 = Application-specific 1 (for EXIF)
			if (bDebug) console.log("Found 0xFFE1 marker");
			return readEXIFData(oFile, iOffset + 4, oFile.getShortAt(iOffset+2, true)-2);

		} else {
			iOffset += 2 + oFile.getShortAt(iOffset+2, true);
		}

	}

}

function readTags(oFile, iTIFFStart, iDirStart, oStrings, bBigEnd)
{
	var iEntries = oFile.getShortAt(iDirStart, bBigEnd);
	var oTags = {};
	for (var i=0;i<iEntries;i++) {
		var iEntryOffset = iDirStart + i*12 + 2;
		var strTag = oStrings[oFile.getShortAt(iEntryOffset, bBigEnd)];
		if (!strTag && bDebug) console.log("Unknown tag: " + oFile.getShortAt(iEntryOffset, bBigEnd));
		oTags[strTag] = readTagValue(oFile, iEntryOffset, iTIFFStart, iDirStart, bBigEnd);
	}
	return oTags;
}

function readTagValue(oFile, iEntryOffset, iTIFFStart, iDirStart, bBigEnd)
{
	var iType = oFile.getShortAt(iEntryOffset+2, bBigEnd);
	var iNumValues = oFile.getLongAt(iEntryOffset+4, bBigEnd);
	var iValueOffset = oFile.getLongAt(iEntryOffset+8, bBigEnd) + iTIFFStart;

	switch (iType) {
		case 1: // byte, 8-bit unsigned int
		case 7: // undefined, 8-bit byte, value depending on field
			if (iNumValues == 1) {
				return oFile.getByteAt(iEntryOffset + 8, bBigEnd);
			} else {
				var iValOffset = iNumValues > 4 ? iValueOffset : (iEntryOffset + 8);
				var aVals = [];
				for (var n=0;n<iNumValues;n++) {
					aVals[n] = oFile.getByteAt(iValOffset + n);
				}
				return aVals;
			}
			break;

		case 2: // ascii, 8-bit byte
			var iStringOffset = iNumValues > 4 ? iValueOffset : (iEntryOffset + 8);
			return oFile.getStringAt(iStringOffset, iNumValues-1);
			break;

		case 3: // short, 16 bit int
			if (iNumValues == 1) {
				return oFile.getShortAt(iEntryOffset + 8, bBigEnd);
			} else {
				var iValOffset = iNumValues > 2 ? iValueOffset : (iEntryOffset + 8);
				var aVals = [];
				for (var n=0;n<iNumValues;n++) {
					aVals[n] = oFile.getShortAt(iValOffset + 2*n, bBigEnd);
				}
				return aVals;
			}
			break;

		case 4: // long, 32 bit int
			if (iNumValues == 1) {
				return oFile.getLongAt(iEntryOffset + 8, bBigEnd);
			} else {
				var aVals = [];
				for (var n=0;n<iNumValues;n++) {
					aVals[n] = oFile.getLongAt(iValueOffset + 4*n, bBigEnd);
				}
				return aVals;
			}
			break;
		case 5:	// rational = two long values, first is numerator, second is denominator
			if (iNumValues == 1) {
				return oFile.getLongAt(iValueOffset, bBigEnd) / oFile.getLongAt(iValueOffset+4, bBigEnd);
			} else {
				var aVals = [];
				for (var n=0;n<iNumValues;n++) {
					aVals[n] = oFile.getLongAt(iValueOffset + 8*n, bBigEnd) / oFile.getLongAt(iValueOffset+4 + 8*n, bBigEnd);
				}
				return aVals;
			}
			break;
		case 9: // slong, 32 bit signed int
			if (iNumValues == 1) {
				return oFile.getSLongAt(iEntryOffset + 8, bBigEnd);
			} else {
				var aVals = [];
				for (var n=0;n<iNumValues;n++) {
					aVals[n] = oFile.getSLongAt(iValueOffset + 4*n, bBigEnd);
				}
				return aVals;
			}
			break;
		case 10: // signed rational, two slongs, first is numerator, second is denominator
			if (iNumValues == 1) {
				return oFile.getSLongAt(iValueOffset, bBigEnd) / oFile.getSLongAt(iValueOffset+4, bBigEnd);
			} else {
				var aVals = [];
				for (var n=0;n<iNumValues;n++) {
					aVals[n] = oFile.getSLongAt(iValueOffset + 8*n, bBigEnd) / oFile.getSLongAt(iValueOffset+4 + 8*n, bBigEnd);
				}
				return aVals;
			}
			break;
	}
}

function readEXIFData(oFile, iStart, iLength)
{
	if (oFile.getStringAt(iStart, 4) != "Exif") {
		if (bDebug) console.log("Not valid EXIF data! " + oFile.getStringAt(iStart, 4));
		return false;
	}

	var bBigEnd;

	var iTIFFOffset = iStart + 6;

	// test for TIFF validity and endianness
	if (oFile.getShortAt(iTIFFOffset) == 0x4949) {
		bBigEnd = false;
	} else if (oFile.getShortAt(iTIFFOffset) == 0x4D4D) {
		bBigEnd = true;
	} else {
		if (bDebug) console.log("Not valid TIFF data! (no 0x4949 or 0x4D4D)");
		return false;
	}

	if (oFile.getShortAt(iTIFFOffset+2, bBigEnd) != 0x002A) {
		if (bDebug) console.log("Not valid TIFF data! (no 0x002A)");
		return false;
	}

	if (oFile.getLongAt(iTIFFOffset+4, bBigEnd) != 0x00000008) {
		if (bDebug) console.log("Not valid TIFF data! (First offset not 8)", oFile.getShortAt(iTIFFOffset+4, bBigEnd));
		return false;
	}

	var oTags = readTags(oFile, iTIFFOffset, iTIFFOffset+8, EXIF.TiffTags, bBigEnd);

	if (oTags.ExifIFDPointer) {
		var oEXIFTags = readTags(oFile, iTIFFOffset, iTIFFOffset + oTags.ExifIFDPointer, EXIF.Tags, bBigEnd);
		for (var strTag in oEXIFTags) {
			switch (strTag) {
				case "LightSource" :
				case "Flash" :
				case "MeteringMode" :
				case "ExposureProgram" :
				case "SensingMethod" :
				case "SceneCaptureType" :
				case "SceneType" :
				case "CustomRendered" :
				case "WhiteBalance" :
				case "GainControl" :
				case "Contrast" :
				case "Saturation" :
				case "Sharpness" :
				case "SubjectDistanceRange" :
				case "FileSource" :
					oEXIFTags[strTag] = EXIF.StringValues[strTag][oEXIFTags[strTag]];
					break;

				case "ExifVersion" :
				case "FlashpixVersion" :
					oEXIFTags[strTag] = String.fromCharCode(oEXIFTags[strTag][0], oEXIFTags[strTag][1], oEXIFTags[strTag][2], oEXIFTags[strTag][3]);
					break;

				case "ComponentsConfiguration" :
					oEXIFTags[strTag] =
						EXIF.StringValues.Components[oEXIFTags[strTag][0]]
						+ EXIF.StringValues.Components[oEXIFTags[strTag][1]]
						+ EXIF.StringValues.Components[oEXIFTags[strTag][2]]
						+ EXIF.StringValues.Components[oEXIFTags[strTag][3]];
					break;
			}
			oTags[strTag] = oEXIFTags[strTag];
		}
	}

	if (oTags.GPSInfoIFDPointer) {
		var oGPSTags = readTags(oFile, iTIFFOffset, iTIFFOffset + oTags.GPSInfoIFDPointer, EXIF.GPSTags, bBigEnd);
		for (var strTag in oGPSTags) {
			switch (strTag) {
				case "GPSVersionID" :
					oGPSTags[strTag] = oGPSTags[strTag][0]
						+ "." + oGPSTags[strTag][1]
						+ "." + oGPSTags[strTag][2]
						+ "." + oGPSTags[strTag][3];
					break;
			}
			oTags[strTag] = oGPSTags[strTag];
		}
	}

	return oTags;
}

EXIF.getData = function(oImg, fncCallback)
{
	//if (!oImg.complete) return false;

	if (!imageHasData(oImg)) {
		getImageData(oImg, fncCallback);
	} else {
		if (fncCallback) fncCallback();
	}
	return true;
}

EXIF.getTag = function(oImg, strTag)
{
	if (!imageHasData(oImg)) return;
	return oImg.exifdata[strTag];
}

EXIF.getAllTags = function(oImg)
{
	if (!imageHasData(oImg)) return {};
	var oData = oImg.exifdata;
	var oAllTags = {};
	for (var a in oData) {
		if (oData.hasOwnProperty(a)) {
			oAllTags[a] = oData[a];
		}
	}
	return oAllTags;
}

EXIF.pretty = function(oImg)
{
	if (!imageHasData(oImg)) return "";
	var oData = oImg.exifdata;
	var strPretty = "";
	for (var a in oData) {
		if (oData.hasOwnProperty(a)) {
			if (typeof oData[a] == "object") {
				strPretty += a + " : [" + oData[a].length + " values]\r\n";
			} else {
				strPretty += a + " : " + oData[a] + "\r\n";
			}
		}
	}
	return strPretty;
}

EXIF.readFromBinaryFile = function(oFile) {
	return findEXIFinJPEG(oFile);
}

uni.addKit("exif", {
	getData:	function(imOb, cback) {
		return EXIF.getData(imOb, cback);
	}
});

/*
				uni.exif.getData(document.getElementById("foobar"), function(d) {
					console.log(d);
				});
*/

})();


text:
<!DOCTYPE html>

		<link rel = "stylesheet" href = "style.css">
		<title> Terms of Service | Big Brother BETA </title>

 BIG BROTHERBETA

 We're Watching Over You!

 Terms of Service

 To be able to sign up for the service, you must accept the following terms and conditions.

			By using this service, you agree

			1. To share location-based sensitive data with the application's communication servers, in order to provide a seamless experience across all devices;

			2. To provide compulsory feedback about the application at the end of the Beta testing period of the application, if any;

			3. That you may be asked for personal information through the app, which may be similar but not limited to your date of birth, your full name and address, and your profession, to which you hereby consent;

			4. To allow the creators of the application to have a little bit of fun with the funds generated from operation of the application, by throwing parties organizing similar social gatherings;

			5. That psychological biases plague us all, and that they ought to be eradicated, but cannot be removed entirely since that would imply trying to undo millennia of biological evolution;

			6. To try and make sure you switch off fans and lights and similar electrical appliances when not at use, at home and at school;

			7. To strive to include rice in your meals for at least five days per week;

			8. That Shah Rukh Khan might be a little overrated as a Bollywood actor;

			9. To strive to protect your privacy and the privacy of others around you, as long as your actions do not infringe upon the fundamental rights of others, and/or your actions do not disrupt the execution of government orders;

			10. That a good sense of humour is important in a person;

			11. That schools and similar private and public institutions ought to reflect upon statement 10;

			12. That the author of this body of text claims no responsibility of the validity of claims regarding the application and the service it provides on this website;

			13. To try and encourage the concept of "Web literacy" and what is stands for, and recognize the importance of information technology in the growth of the country and/or nation;

			14. That academics aren't what schools are all about, and that schools should aim to promote all-round development in enrolled students, as well as staff members;

			15. That we just might be doomed as citizens of the nation, and that the future might not be bright as we think;

			16. That statement 15 is unnecessarily pessimistic, and that there is much hope for the future ahead of us;

			17. That both statements 15 and 16 take extreme stances on what to expect from the future, and that it would be much better to wait and see how it unfolds;

			18. That statements 15 and 16 and 17 are useless in this context, and ought to be removed from this list of statements;

			19. That the author of this "legal" document knows little about Indian Law, and is trying to waste time into having you believe this wall of text holds at least some significance, when it really doesn't, except for a couple of lines that may (and will) be used to the application's creators' advantage;

			21. That you failed to see the author never wrote statement 20;

			22. To eradicate the overused joke referenced to by statement 21, and to strive to not spread it over applications of social media that include Facebook and WhatsApp;

			23. That your actions on this website may be recorded by an external camera or screen capture software, including the entering of sensitive information into the forms (or similar Web elements) on the website;

			24. To try and read Terms of Service documents more carefully in the future;

			25. To click on "I Agree" already, since legal paperwork is such a waste of time;

			26. That the author really wants to talk about the meaning of life, but would rather not, since many statements have been dedicated to the same in the past, and within this body of text, and it would therefore be somewhat redundant to sit down and discuss the topic at great length, and that in the end, nobody cares, keeping in mind that there might be too many commas for one man to digest in this statement;

			27. That the creators of the application claim no responsibility for any damage or miscommunication caused through the application, and that the liability lies with the operator of the application;

			28. That the application being discussed, at the time of writing this body of text, belongs in the public domain, even if it does not exist at all;

			29. To learn some HTML and CSS and try to make webpages on your own next time;

			30. That the cake is a lie (and that the author is quite certain this reference, though quite popular internationally, is going to not be understood by many readers of this body of text that belong to the target audience of the application being discusssed);

			31. That it's quite nice we've finally arrived at the end of all the legalities you're going to have to go through to sign up and finally get started with what you're here for.

			 <button type = "button"> Back </button>

redpajama_set_name: RedPajamaGithub


text:
using namespace std;

inline
void use_io_optimizations()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}

class MaxPriority
{
public:
    MaxPriority(const vector< vector<unsigned int> >& priorities):
        couples(priorities.size()),
        priorities(priorities),
        subtasks(couples, vector<unsigned int>(1 << couples, -1))
    { }

    unsigned int find()
    {
        return find(0, 0);
    }

private:
    unsigned int couples;

    vector< vector<unsigned int> > priorities;
    vector< vector<unsigned int> > subtasks;

    unsigned int find(unsigned int i, unsigned int mask)
    {
        if (i == couples)
        {
            return 0;
        }

        if (subtasks[i][mask] != -1)
        {
            return subtasks[i][mask];
        }

        unsigned int max_priority = 0;

        for (unsigned int j = 0; j < couples; ++j)
        {
            if (!(mask & (1 << j)))
            {
                max_priority = max(
                    max_priority,
                    find(i + 1, mask | (1 << j)) + priorities[i][j]
                );
            }
        }

        return subtasks[i][mask] = max_priority;
    }
};

int main()
{
    use_io_optimizations();

    unsigned int test_cases;
    cin >> test_cases;

    for (unsigned int test = 1; test <= test_cases; ++test)
    {
        unsigned int couples;
        cin >> couples;

        vector< vector<unsigned int> > priorities(
            couples, vector<unsigned int>(couples)
        );

        for (unsigned int i = 0; i < couples; ++i)
        {
            for (unsigned int j = 0; j < couples; ++j)
            {
                cin >> priorities[i][j];
            }
        }

        cout << "Case " << test << ": " << MaxPriority(priorities).find() << '\n';
    }

    return 0;
}


text:
package de.gruene.haustuer.api;

import de.gruene.haustuer.survey.SurveyResponse;
import de.gruene.haustuer.survey.SurveyService;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController()
@RequestMapping("/survey")
public class SurveyController {

  private static Logger logger = LoggerFactory.getLogger(SurveyController.class);

  @Autowired
  SurveyService surveyResponseService;

  @GetMapping
  public List<SurveyResponse> getSurveyResponses(@RequestParam(required = false) String district) {
    logger.info("Value of district={}", district);

    return surveyResponseService.getAll();
  }

  @GetMapping("{id}")
  public SurveyResponse getSurveyResponse(@PathVariable Long id) {
    return surveyResponseService.getSurveyResponseById(id);
  }

  @PostMapping
  public SurveyResponse recordSurveyResponse(@RequestBody SurveyUserData surveyUserData,
    Authentication authentication) {
    return surveyResponseService
      .create(surveyUserData.toSurveyResponse(), surveyUserData.toDoor(), authentication.getName());
  }

}


text:
var commentsArray = [
{
   "id": 1,
   "parent": null,
   "created": "2015-01-01",
   "modified": "2015-01-01",
   "content": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed posuere interdum sem. Quisque ligula eros ullamcorper quis, lacinia quis facilisis sed sapien. Mauris varius diam vitae arcu.",
   "attachments": [],
   "pings": [],
   "creator": 6,
   "fullname": "Simon Powell",
   "profile_picture_url": "https://viima-app.s3.amazonaws.com/media/public/defaults/user-icon.png",
   "created_by_admin": false,
   "created_by_current_user": false,
   "upvote_count": 3,
   "user_has_upvoted": false,
   "is_new": false
},
{
   "id": 2,
   "parent": null,
   "created": "2015-01-02",
   "modified": "2015-01-02",
   "content": "Sed posuere interdum sem. Quisque ligula eros ullamcorper quis, lacinia quis facilisis sed sapien. Mauris varius diam vitae arcu.",
   "attachments": [],
   "pings": [],
   "creator": 5,
   "fullname": "Administrator",
   "profile_picture_url": "https://viima-app.s3.amazonaws.com/media/public/defaults/user-icon.png",
   "created_by_admin": true,
   "created_by_current_user": false,
   "upvote_count": 2,
   "user_has_upvoted": false,
   "is_new": false
},
{
   "id": 3,
   "parent": null,
   "created": "2015-01-03",
   "modified": "2015-01-03",
   "content": "@Hank Smith sed posuere interdum sem.\nQuisque ligula eros ullamcorper https://www.google.com/ quis, lacinia quis facilisis sed sapien. Mauris varius diam vitae arcu. Sed arcu lectus auctor vitae, consectetuer et venenatis eget #velit.",
   "attachments": [],
   "pings": {
      3: 'Hank Smith',
   },
   "creator": 1,
   "fullname": "You",
   "profile_picture_url": "https://viima-app.s3.amazonaws.com/media/public/defaults/user-icon.png",
   "created_by_admin": false,
   "created_by_current_user": true,
   "upvote_count": 2,
   "user_has_upvoted": true,
   "is_new": false
},
{
   "id": 4,
   "parent": 3,
   "created": "2015-01-04",
   "modified": "2015-01-04",
   "content": "",
   "attachments": [
      {
         "id": 1,
         "file": "http://www.w3schools.com/html/mov_bbb.mp4",
         "mime_type": "video/mp4",
      },
   ],
   "creator": 4,
   "fullname": "Todd Brown",
   "profile_picture_url": "https://viima-app.s3.amazonaws.com/media/public/defaults/user-icon.png",
   "created_by_admin": false,
   "created_by_current_user": false,
   "upvote_count": 0,
   "user_has_upvoted": false,
   "is_new": true
},
{
   "id": 5,
   "parent": 4,
   "created": "2015-01-05",
   "modified": "2015-01-05",
   "content": "Quisque ligula eros ullamcorper quis, lacinia quis facilisis sed sapien. Mauris varius diam vitae arcu. Sed arcu lectus auctor vitae, consectetuer et venenatis eget velit.",
   "attachments": [],
   "pings": [],
   "creator": 3,
   "fullname": "Hank Smith",
   "profile_picture_url": "https://viima-app.s3.amazonaws.com/media/public/defaults/user-icon.png",
   "created_by_admin": false,
   "created_by_current_user": false,
   "upvote_count": 0,
   "user_has_upvoted": false,
   "is_new": true
},
{
   "id": 6,
   "parent": 1,
   "created": "2015-01-06",
   "modified": "2015-01-06",
   "content": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed posuere interdum sem. Quisque ligula eros ullamcorper quis, lacinia quis facilisis sed sapien. Mauris varius diam vitae arcu.",
   "attachments": [],
   "pings": [],
   "creator": 2,
   "fullname": "Jack Hemsworth",
   "profile_picture_url": "https://viima-app.s3.amazonaws.com/media/public/defaults/user-icon.png",
   "created_by_admin": false,
   "created_by_current_user": false,
   "upvote_count": 1,
   "user_has_upvoted": false,
   "is_new": false
},
{
   "id": 7,
   "parent": 1,
   "created": "2015-01-07",
   "modified": "2015-01-07",
   "content": "Sed posuere interdum sem. Quisque ligula eros ullamcorper quis, lacinia quis facilisis sed sapien. Mauris varius diam vitae arcu. Sed arcu lectus auctor vitae, consectetuer et venenatis eget velit.",
   "attachments": [],
   "pings": [],
   "creator": 5,
   "fullname": "Administrator",
   "profile_picture_url": "https://viima-app.s3.amazonaws.com/media/public/defaults/user-icon.png",
   "created_by_admin": true,
   "created_by_current_user": false,
   "upvote_count": 0,
   "user_has_upvoted": false,
   "is_new": false
},
{
   "id": 8,
   "parent": 6,
   "created": "2015-01-08",
   "modified": "2015-01-08",
   "content": "Sed posuere interdum sem. Quisque ligula eros ullamcorper quis, lacinia quis facilisis sed sapien. Mauris varius diam vitae arcu.",
   "attachments": [],
   "pings": [],
   "creator": 1,
   "fullname": "You",
   "profile_picture_url": "https://viima-app.s3.amazonaws.com/media/public/defaults/user-icon.png",
   "created_by_admin": false,
   "created_by_current_user": true,
   "upvote_count": 0,
   "user_has_upvoted": false,
   "is_new": false
},
{
   "id": 9,
   "parent": 8,
   "created": "2015-01-09",
   "modified": "2015-01-10",
   "content": "Quisque ligula eros ullamcorper quis, lacinia quis facilisis sed sapien. Mauris varius diam vitae arcu. Sed arcu lectus auctor vitae, consectetuer et venenatis eget velit.",
   "attachments": [],
   "pings": [],
   "creator": 7,
   "fullname": "Bryan Connery",
   "profile_picture_url": "https://viima-app.s3.amazonaws.com/media/public/defaults/user-icon.png",
   "created_by_admin": false,
   "created_by_current_user": false,
   "upvote_count": 0,
   "user_has_upvoted": false,
   "is_new": false
},
{
   "id": 10,
   "parent": 9,
   "created": "2015-01-10",
   "modified": "2015-01-10",
   "content": "Quisque ligula eros ullamcorper quis, lacinia quis facilisis sed sapien. Mauris varius diam vitae arcu. Sed arcu lectus auctor vitae, consectetuer et venenatis eget velit.",
   "attachments": [
      {
         "id": 2,
         "file": "https://www.w3schools.com/images/w3schools_green.jpg",
         "mime_type": "image/jpeg",
      },
   ],
   "pings": [],
   "creator": 1,
   "fullname": "You",
   "profile_picture_url": "https://viima-app.s3.amazonaws.com/media/public/defaults/user-icon.png",
   "created_by_admin": false,
   "created_by_current_user": true,
   "upvote_count": 0,
   "user_has_upvoted": false,
   "is_new": false
}
]

var usersArray = [
   {
      id: 1,
      fullname: "Current User",
      email: "current.user@viima.com",
      profile_picture_url: "https://viima-app.s3.amazonaws.com/media/public/defaults/user-icon.png"
   },
   {
      id: 2,
      fullname: "Jack Hemsworth",
      email: "jack.hemsworth@viima.com",
      profile_picture_url: "https://viima-app.s3.amazonaws.com/media/public/defaults/user-icon.png"
   },
   {
      id: 3,
      fullname: "Hank Smith",
      email: "hank.smith@viima.com",
      profile_picture_url: "https://viima-app.s3.amazonaws.com/media/public/defaults/user-icon.png"
   },
   {
      id: 4,
      fullname: "Todd Brown",
      email: "todd.brown@viima.com",
      profile_picture_url: "https://viima-app.s3.amazonaws.com/media/public/defaults/user-icon.png"
   },
   {
      id: 5,
      fullname: "Administrator",
      email: "administrator@viima.com",
      profile_picture_url: "https://viima-app.s3.amazonaws.com/media/public/defaults/user-icon.png"
   },
   {
      id: 6,
      fullname: "Simon Powell",
      email: "simon.powell@viima.com",
      profile_picture_url: "https://viima-app.s3.amazonaws.com/media/public/defaults/user-icon.png"
   },
   {
      id: 7,
      fullname: "Bryan Connery",
      email: "bryan.connery@viima.com",
      profile_picture_url: "https://viima-app.s3.amazonaws.com/media/public/defaults/user-icon.png"
   }
]


text:
package main

import (
	"encoding/json"
	"errors"
	"fmt"
	"os"
	"runtime"

	"github.com/appc/cni/pkg/ip"
	"github.com/appc/cni/pkg/ipam"
	"github.com/appc/cni/pkg/ns"
	"github.com/appc/cni/pkg/skel"
	"github.com/appc/cni/pkg/types"
	"github.com/appc/cni/pkg/utils/sysctl"
	"github.com/vishvananda/netlink"
)

const (
	IPv4InterfaceArpProxySysctlTemplate = "net.ipv4.conf.%s.proxy_arp"
)

type NetConf struct {
	types.NetConf
	Master string `json:"master"`
	Mode   string `json:"mode"`
	MTU    int    `json:"mtu"`
}

func init() {
	// this ensures that main runs only on main thread (thread group leader).
	// since namespace ops (unshare, setns) are done for a single thread, we
	// must ensure that the goroutine does not jump from OS thread to thread
	runtime.LockOSThread()
}

func loadConf(bytes []byte) (*NetConf, error) {
	n := &NetConf{}
	if err := json.Unmarshal(bytes, n); err != nil {
		return nil, fmt.Errorf("failed to load netconf: %v", err)
	}
	if n.Master == "" {
		return nil, fmt.Errorf(`"master" field is required. It specifies the host interface name to virtualize`)
	}
	return n, nil
}

func modeFromString(s string) (netlink.MacvlanMode, error) {
	switch s {
	case "", "bridge":
		return netlink.MACVLAN_MODE_BRIDGE, nil
	case "private":
		return netlink.MACVLAN_MODE_PRIVATE, nil
	case "vepa":
		return netlink.MACVLAN_MODE_VEPA, nil
	case "passthru":
		return netlink.MACVLAN_MODE_PASSTHRU, nil
	default:
		return 0, fmt.Errorf("unknown macvlan mode: %q", s)
	}
}

func createMacvlan(conf *NetConf, ifName string, netns *os.File) error {
	mode, err := modeFromString(conf.Mode)
	if err != nil {
		return err
	}

	m, err := netlink.LinkByName(conf.Master)
	if err != nil {
		return fmt.Errorf("failed to lookup master %q: %v", conf.Master, err)
	}

	// due to kernel bug we have to create with tmpName or it might
	// collide with the name on the host and error out
	tmpName, err := ip.RandomVethName()
	if err != nil {
		return err
	}

	mv := &netlink.Macvlan{
		LinkAttrs: netlink.LinkAttrs{
			MTU:         conf.MTU,
			Name:        tmpName,
			ParentIndex: m.Attrs().Index,
			Namespace:   netlink.NsFd(int(netns.Fd())),
		},
		Mode: mode,
	}

	if err := netlink.LinkAdd(mv); err != nil {
		return fmt.Errorf("failed to create macvlan: %v", err)
	}

	// TODO: duplicate following lines for ipv6 support, when it will be added in other places
	ipv4SysctlValueName := fmt.Sprintf(IPv4InterfaceArpProxySysctlTemplate, tmpName)
	if _, err := sysctl.Sysctl(ipv4SysctlValueName, "1"); err != nil {
		// remove the newly added link and ignore errors, because we already are in a failed state
		_ = netlink.LinkDel(mv)
		return fmt.Errorf("failed to set proxy_arp on newly added interface %q: %v", tmpName, err)
	}

	return ns.WithNetNS(netns, false, func(_ *os.File) error {
		err := renameLink(tmpName, ifName)
		if err != nil {
			return fmt.Errorf("failed to rename macvlan to %q: %v", ifName, err)
		}
		return nil
	})
}

func cmdAdd(args *skel.CmdArgs) error {
	n, err := loadConf(args.StdinData)
	if err != nil {
		return err
	}

	netns, err := os.Open(args.Netns)
	if err != nil {
		return fmt.Errorf("failed to open netns %q: %v", netns, err)
	}
	defer netns.Close()

	if err = createMacvlan(n, args.IfName, netns); err != nil {
		return err
	}

	// run the IPAM plugin and get back the config to apply
	result, err := ipam.ExecAdd(n.IPAM.Type, args.StdinData)
	if err != nil {
		return err
	}
	if result.IP4 == nil {
		return errors.New("IPAM plugin returned missing IPv4 config")
	}

	err = ns.WithNetNS(netns, false, func(_ *os.File) error {
		return ipam.ConfigureIface(args.IfName, result)
	})
	if err != nil {
		return err
	}

	result.DNS = n.DNS
	return result.Print()
}

func cmdDel(args *skel.CmdArgs) error {
	n, err := loadConf(args.StdinData)
	if err != nil {
		return err
	}

	err = ipam.ExecDel(n.IPAM.Type, args.StdinData)
	if err != nil {
		return err
	}

	return ns.WithNetNSPath(args.Netns, false, func(hostNS *os.File) error {
		return ip.DelLinkByName(args.IfName)
	})
}

func renameLink(curName, newName string) error {
	link, err := netlink.LinkByName(curName)
	if err != nil {
		return err
	}

	return netlink.LinkSetName(link, newName)
}

func main() {
	skel.PluginMain(cmdAdd, cmdDel)
}


text:
/// <reference path="../../includes.d.ts" />
/**
 * @module Maven
 */
declare module Maven {
    var log: Logging.Logger;
    /**
     * Returns the maven indexer mbean (from the hawtio-maven-indexer library)
     * @method getMavenIndexerMBean
     * @for Maven
     * @param {Core.Workspace} workspace
     * @return {String}
     */
    function getMavenIndexerMBean(workspace: Workspace): any;
    function getAetherMBean(workspace: Workspace): any;
    function mavenLink(url: any): string;
    function getName(row: any): string;
    function completeMavenUri($q: any, $scope: any, workspace: any, jolokia: any, query: any): any;
    function completeVersion(mbean: any, $q: any, $scope: any, workspace: any, jolokia: any, groupId: any, artifactId: any, partial: any, packaging: any, classifier: any): any;
    function completeArtifactId(mbean: any, $q: any, $scope: any, workspace: any, jolokia: any, groupId: any, partial: any, packaging: any, classifier: any): any;
    function completeGroupId(mbean: any, $q: any, $scope: any, workspace: any, jolokia: any, partial: any, packaging: any, classifier: any): any;
    function addMavenFunctions($scope: any, workspace: any): void;
}


text:
package com.tagmycode.intellij;

import com.intellij.openapi.components.ProjectComponent;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.wm.WindowManager;
import com.intellij.util.ui.UIUtil;
import com.tagmycode.plugin.Framework;
import com.tagmycode.plugin.FrameworkConfig;
import com.tagmycode.plugin.SyntaxSnippetEditorFactory;
import com.tagmycode.plugin.exception.TagMyCodeStorageException;
import com.tagmycode.sdk.DbService;
import com.tagmycode.sdk.SaveFilePath;
import com.tagmycode.sdk.authentication.TagMyCodeApiProduction;
import com.tagmycode.sdk.exception.TagMyCodeException;
import org.jetbrains.annotations.NotNull;

import java.awt.*;
import java.io.*;
import java.math.BigInteger;
import java.security.SecureRandom;
import java.sql.SQLException;

public class TagMyCodeProject implements ProjectComponent {
    private Project project;
    private Framework framework;

    public TagMyCodeProject(Project project) {
        this.project = project;
    }

    @Override
    public void initComponent() {
    }

    Framework getFramework() {
        if (framework == null) {
            try {
                initFramework();
            } catch (SQLException | IOException e) {
                framework.logError(e);
            }
        }
        return framework;
    }

    private void initFramework() throws SQLException, IOException {
        SaveFilePath saveFilePath = new SaveFilePath(getOrCreateNamespace());
        FrameworkConfig frameworkConfig = new FrameworkConfig(
                saveFilePath,
                new PasswordKeyChain(project),
                new DbService(saveFilePath.getPath()),
                new MessageManager(project),
                new TaskFactory(this),
                new IntelliJVersion(),
                getMainFrame());
        framework = new Framework(new TagMyCodeApiProduction(), frameworkConfig, new Secret());
        try {
            framework.start();
        } catch (TagMyCodeException e) {
            throw new RuntimeException(e);
        }
        configureTheme();
    }

    private void configureTheme() {
        if (UIUtil.isUnderDarcula()) {
            try {
                if (framework.getStorageEngine().loadEditorTheme() == null) {
                    framework.getSyntaxSnippetEditorFactory().setDefaultDarkTheme();
                    framework.getStorageEngine().saveEditorTheme(SyntaxSnippetEditorFactory.THEME_STRING_DARK);
                }
            } catch (TagMyCodeStorageException ignored) {

            }
        }
    }

    @NotNull
    private String getOrCreateNamespace() {
        IntelliJProperties intelliJProperties = new IntelliJProperties();
        String profile = intelliJProperties.read("profile");
        if (profile.length() == 0) {
            // TODO move to framework
            SecureRandom random = new SecureRandom();
            profile = new BigInteger(130, random).toString(32);
            intelliJProperties.write("profile", profile);
            Framework.LOGGER.info("profile: " + profile);
            intelliJProperties.write("profile", profile);
        }
        return "intellij-" + profile;
    }

    private Frame getMainFrame() {
        return WindowManager.getInstance().getFrame(project);
    }

    public void disposeComponent() {
        try {
            framework.closeFramework();
        } catch (TagMyCodeStorageException e) {
            e.printStackTrace();
        }
    }

    @NotNull
    public String getComponentName() {
        return "TagMyCodeProject";
    }

    public void projectOpened() {
        // called when project is opened
    }

    public void projectClosed() {
        // called when project is being closed
    }

    public Project getProject() {
        return project;
    }

}


text:
package com.amazonaws.services.mediastore.model;

import java.io.Serializable;
import javax.annotation.Generated;

/**
 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GetContainerPolicyResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable {

    /**
     *

     * The contents of the access policy.
     *

     */
    private String policy;

    /**
     *

     * The contents of the access policy.
     *

     *
     * @param policy
     *        The contents of the access policy.
     */

    public void setPolicy(String policy) {
        this.policy = policy;
    }

    /**
     *

     * The contents of the access policy.
     *

     *
     * @return The contents of the access policy.
     */

    public String getPolicy() {
        return this.policy;
    }

    /**
     *

     * The contents of the access policy.
     *

     *
     * @param policy
     *        The contents of the access policy.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public GetContainerPolicyResult withPolicy(String policy) {
        setPolicy(policy);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getPolicy() != null)
            sb.append("Policy: ").append(getPolicy());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof GetContainerPolicyResult == false)
            return false;
        GetContainerPolicyResult other = (GetContainerPolicyResult) obj;
        if (other.getPolicy() == null ^ this.getPolicy() == null)
            return false;
        if (other.getPolicy() != null && other.getPolicy().equals(this.getPolicy()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getPolicy() == null) ? 0 : getPolicy().hashCode());
        return hashCode;
    }

    @Override
    public GetContainerPolicyResult clone() {
        try {
            return (GetContainerPolicyResult) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

}


text:
from collections import defaultdict
from everest.repositories.rdb import Session
from md5 import md5
from sqlalchemy.engine import create_engine
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.sql import func
from sqlalchemy.sql.expression import select
from thelma.repositories.rdb import create_metadata
from thelma.entities.chemicalstructure import CHEMICAL_STRUCTURE_TYPE_IDS
from thelma.entities.chemicalstructure import ChemicalStructure
from thelma.entities.chemicalstructure import CompoundChemicalStructure
from thelma.entities.chemicalstructure import ModificationChemicalStructure
from thelma.entities.chemicalstructure import NucleicAcidChemicalStructure
from thelma.entities.moleculedesign import AntiMirDesign
from thelma.entities.moleculedesign import CompoundDesign
from thelma.entities.moleculedesign import DoubleStrandedDesign
from thelma.entities.moleculedesign import MiRnaInhibitorDesign
from thelma.entities.moleculedesign import MiRnaMimicDesign
from thelma.entities.moleculedesign import MoleculeDesign
from thelma.entities.moleculedesign import SingleStrandedDesign
from thelma.entities.moleculetype import MoleculeType
from thelma.entities.organization import Organization
from thelma.entities.suppliermoleculedesign import SingleSupplierMoleculeDesign
from thelma.entities.suppliermoleculedesign import SupplierStructureAnnotation

# List of warnings recorded during the migration.
WARNINGS = []

# If this is set to True, the changes will be committed when the script
# completes successfully (i.e., without errors and without warnings).
COMMIT = False

db_server = 'raven'
db_port = '5432'
db_user = 'thelma'
db_password = 'roo8Adei'
db_name = 'unidb'
db_string = "postgresql+psycopg2://%(db_user)s:%(db_password)s" \
            "@%(db_server)s:%(db_port)s/%(db_name)s" % locals()
engine = create_engine(db_string)
metadata = create_metadata(engine)

sess = Session()

def process_or_create_structure(molecule_design, structure_type,
                                representation, new_structures):
    cs_query = sess.query(ChemicalStructure)
    md5_rpr = md5(representation).hexdigest()
    try:
        cs = cs_query.filter(
                func.md5(ChemicalStructure.representation) == md5_rpr,
                ChemicalStructure.structure_type == structure_type).one()
    except NoResultFound:
        cs = None
    if cs is None:
        if structure_type == CHEMICAL_STRUCTURE_TYPE_IDS.COMPOUND:
            structure_class = CompoundChemicalStructure
        elif structure_type == CHEMICAL_STRUCTURE_TYPE_IDS.NUCLEIC_ACID:
            structure_class = NucleicAcidChemicalStructure
        elif structure_type == CHEMICAL_STRUCTURE_TYPE_IDS.MODIFICATION:
            structure_class = ModificationChemicalStructure
        else:
            raise ValueError('Invalid structure type "%s".' % structure_type)
        cs = structure_class(representation,
                             molecule_designs=[molecule_design])
        new_structures.add(cs)
    else:
        cs.molecule_designs.append(molecule_design)
    return cs

def process_design(molecule_design, data, new_structures):
    if isinstance(molecule_design, DoubleStrandedDesign):
        if isinstance(molecule_design, MiRnaMimicDesign):
            # MIRNA_MIMI. No structure nor modification information.
            pass
        else:
            # SIRNA, LONG_DSRNA, AMPLICON, ESI_RNA, CLND_DSDNA
            mod, seq1, seq2 = data
            if not mod is None and not seq1 is None and not seq2 is None:
                cs_seq1 = process_or_create_structure(
                                    molecule_design,
                                    CHEMICAL_STRUCTURE_TYPE_IDS.NUCLEIC_ACID,
                                    seq1,
                                    new_structures)
                cs_seq2 = process_or_create_structure(
                                    molecule_design,
                                    CHEMICAL_STRUCTURE_TYPE_IDS.NUCLEIC_ACID,
                                    seq2,
                                    new_structures)
                if mod != 'unmodified':
                    process_or_create_structure(
                                    molecule_design,
                                    CHEMICAL_STRUCTURE_TYPE_IDS.MODIFICATION,
                                    mod, new_structures)
                for smd in molecule_design.supplier_molecule_designs:
                    if smd.sense_strand == 'sequence_1':
                        cs_ssa = cs_seq1
                    elif smd.sense_strand == 'sequence_2':
                        cs_ssa = cs_seq2
                    else:
                        cs_ssa = None
                    if not cs_ssa is None:
                        ssa = SupplierStructureAnnotation(smd, cs_ssa,
                                                          'SENSE_STRAND')
                        sess.add(ssa)
            else:
                # These are known CLND_DSDNA IDs for which we do not have
                # sequences.
                known_ids = [10404427, 10404428, 10404429,
                             10404430, 10404431, 10404432]
                if not molecule_design.molecule_design_id in known_ids:
                    WARNINGS.append('Information missing for design ID %d.' %
                                    molecule_design.molecule_design_id)
    elif isinstance(molecule_design, SingleStrandedDesign):
        if isinstance(molecule_design, MiRnaInhibitorDesign):
            # MIRNA_INHI. No sequence information.
            mod, = data
        else:
            # SSRNA, SSDNA, ANTI_MIR.
            mod, seq = data
            process_or_create_structure(
                                    molecule_design,
                                    CHEMICAL_STRUCTURE_TYPE_IDS.NUCLEIC_ACID,
                                    seq,
                                    new_structures)
        if mod != 'unmodified':
            process_or_create_structure(
                                    molecule_design,
                                    CHEMICAL_STRUCTURE_TYPE_IDS.MODIFICATION,
                                    mod,
                                    new_structures)
        if isinstance(molecule_design, AntiMirDesign):
            # ANTI_MIR.
            # Create forgotten supplier molecule design records.
            suppl_query = sess.query(Organization)
            supplier = suppl_query.filter_by(name='Regulus').one()
            smd = SingleSupplierMoleculeDesign(
                            # Use our ID as supplier product ID.
                            str(molecule_design.molecule_design_id),
                            supplier,
                            is_current=True)
            molecule_design.supplier_molecule_designs.append(smd)
    elif isinstance(molecule_design, CompoundDesign):
        # COMPOUND.
        smiles, = data
        process_or_create_structure(molecule_design,
                                    CHEMICAL_STRUCTURE_TYPE_IDS.COMPOUND,
                                    smiles,
                                    new_structures)
    else:
        raise ValueError('Unknown molecule design type: %s' %
                         molecule_design.__class__)

mt_ids = [
          'SSRNA',
          'SSDNA',
          'AMPLICON',
          'SIRNA',
          'COMPOUND',
          'LONG_DSRNA',
          'ANTI_MIR',
          'ESI_RNA',
          'CLND_DSDNA',
          'MIRNA_INHI',
          'MIRNA_MIMI'
          ]
for mt_id in mt_ids:
    print
    print '------------------------------'
    print 'Processing %s molecule type.' % mt_id
    print
    print 'Building cache.'
    print
    md_tab = metadata.tables['molecule_design']
    where_clause = md_tab.c.molecule_type_id == mt_id
    if mt_id == 'MIRNA_MIMI':
        cch = defaultdict(lambda: None)
    else:
        if mt_id in ['SIRNA', 'LONG_DSRNA', 'AMPLICON', 'ESI_RNA',
                     'CLND_DSDNA']:
            dsd_tab = metadata.tables['double_stranded_design']
            prx = select([md_tab.c.molecule_design_id, dsd_tab.c.modification,
                          dsd_tab.c.sequence_1, dsd_tab.c.sequence_2],
                         where_clause,
                         from_obj=md_tab.outerjoin(dsd_tab)).execute()
        elif mt_id == 'MIRNA_INHI':
            mi_inhi_tab = metadata.tables['mirna_inhibitor_design']
            prx = select([md_tab.c.molecule_design_id,
                          mi_inhi_tab.c.modification],
                         where_clause,
                         from_obj=md_tab.outerjoin(mi_inhi_tab)).execute()
        elif mt_id in ['SSRNA', 'SSDNA', 'ANTI_MIR']:
            ssd_tab = metadata.tables['single_stranded_design']
            prx = select([md_tab.c.molecule_design_id, ssd_tab.c.modification,
                          ssd_tab.c.sequence],
                         where_clause,
                         from_obj=md_tab.outerjoin(ssd_tab)).execute()
        elif mt_id == 'COMPOUND':
            cmp_tab = metadata.tables['compound']
            prx = select([md_tab.c.molecule_design_id, cmp_tab.c.smiles],
                         where_clause,
                         from_obj=md_tab.outerjoin(cmp_tab)).execute()
        cch = dict([(row[0], row[1:]) for row in prx.fetchall()])
    print 'Fetching molecule designs.'
    print
    mt = sess.query(MoleculeType).filter_by(molecule_type_id=mt_id).one()
    new_structs = set()
    mds = sess.query(MoleculeDesign).filter_by(molecule_type=mt).all()
    for idx, md in enumerate(mds):
        print '%s: %d (%3d %%)' % (md.molecule_type_id,
                                  md.molecule_design_id,
                                  int((idx + 1) * 100 / len(mds)))
        process_design(md, cch[md.molecule_design_id], new_structs)
    sess.add_all(new_structs)
    if COMMIT and len(WARNINGS) == 0:
        sess.commit()
    else:
        if WARNINGS:
            print 'Warnings occurred - rolling back transaction.'
            print 'Warning messages:'
            print '\n'.join(WARNINGS)
        sess.rollback()


text:
=begin
Method that creates a new list
List of key value pairs
-keys = item
-values = quantity
Output a list of items and quantities
=end

#2 Add item w/ quantity
=begin
Method that takes in a key and it's value
Adds the new key and value to the end of list
Output the new list
=end

#3 Remove an item
=begin
Method that takes in key to be deleted
Deletes the key and value
Output the new list
=end

#4 Update quantities for items in our list
=begin
A method that takes in a key and value
Replace old key and value with new key and value
Output the new list
=end

#5 Print the list
=begin
Method that takes no arguments
Goes through the list and prints each element
Outputs the list with formatting
=end

def create_list

  new_list = Hash.new(0)

end

def print_list(list)

  list.each do |k,v|
    p "#{k}:  #{v}"
  end
end

def remove_item(list, key)

  list.delete(key)

end

def add_item(list, key,val)

  list.store(key,val)

end

def update_item(list, key,val)

  list.delete(key)
  list.store(key,val)

end

# driver code below here
list_1 = create_list
add_item(list_1, "Lemonade", 2)
add_item(list_1, "Tomatoes", 3)
add_item(list_1, "Onions", 1)
add_item(list_1, "Ice Cream", 4)
remove_item(list_1, "Lemonade")
update_item(list_1,"Ice Cream", 1)
print_list(list_1)

#Something we messed around with after refactoring our code. We wanted to create something that could take user input for a list instead of hard coding in what variables would and keys would change above.
def case_method

#  puts "Please create a name for your list"
#  list_name = gets.chomp
#  list_name = create_list
input = ""
while input != "exit"
  puts "choose an option: create list (create), add or update item (update), remove an item (remove), print the list (print), or exit (exit)"
  input = gets.chomp.downcase
  case input
    when "create"
      puts "Please create a name for your list"
      list_name = gets.chomp
      list_name = create_list
    when "update"
      puts "What item?"
      key = gets.chomp
      puts "What value?"
      val = gets.chomp
      update_item(list_name,key, val)
    when "remove"
      puts "What item?"
      key = gets.chomp
      remove_item(list_name, key)
    when "print"
      print_list(list_name)
    when "exit"
      break
    else
      puts "Please enter a valid input (create, update, remove, print)"
    end
  end
end

case_method

=begin
What did you learn about pseudocode from working on this challenge?

I learned keeping pseudocode too simple might make you overlook some steps.  When we were looking to print our list we had initially written our print method as literally "Prints the list".  We hadn't considered we would need to iterate through our hash to print out each item in the list until we were writing it out.

What are the tradeoffs of using Arrays and Hashes for this challenge?

Hashes made storing values and quantities much easier for this challenge.  During our pseudocode my pair and I decided that using hashes would be the best way to approach this problem.

What does a method return?

The last line of code in a method or any expression inside of it with 'return' before it.

What kind of things can you pass into methods as arguments?

You can pass, pretty much anything as arguments into methods.  We used hashes, strings and integers in our challenge.

How can you pass information between methods?

Information stored globally can be passed between methods.  We determined while writing out pseudocode that we would need to define our list as a global item, so it could be called and altered through our other methods.

What concepts were solidified in this challenge, and what concepts are still confusing?

I think the local and global variable concepts were solidifed during this challenge. There was a concept our guide brought up about using 'Object.send(:method)' that is still confusing to me, but I will be reading up on more to see what we could have done differently in our code with it.

=end


text:
using System;
using System.Xml.Serialization;

namespace Aop.Api.Domain
{
    /// <summary>
    /// ZhimaCreditPeContractUserstatusQueryModel Data Structure.
    /// </summary>
    [Serializable]
    public class ZhimaCreditPeContractUserstatusQueryModel : AopObject
    {
        /// <summary>
        /// 我承诺消费活动名字
        /// </summary>
        [XmlElement("activity_name")]
        public string ActivityName { get; set; }

        /// <summary>
        /// 场景类目
        /// </summary>
        [XmlElement("category")]
        public string Category { get; set; }

        /// <summary>
        /// 用户支付宝ID
        /// </summary>
        [XmlElement("uid")]
        public string Uid { get; set; }
    }
}


text:
import os
import sys
import yaml

def is_str_or_unicode(s):
    if sys.version_info[0] < 3:
        return isinstance(s, basestring)
    else:
        return isinstance(s, str)

def _unicode(s):
    if sys.version_info[0] < 3:
        return unicode(s)
    else:
        return s

class Mold(object):
    def __init__(self, filename, model, base_path=None, relation_key=None,
                 custom_id_gen=None, str_converters=None):
        self.filename = filename
        self.model = model
        self.base_path = base_path
        self.relation_key = relation_key
        self.custom_id_gen = custom_id_gen or (lambda x: x)
        self.str_converters = str_converters or {}

    def init_foundry(self, foundry):
        self.foundry = foundry
        if not self.base_path:
            self.base_path = foundry.path
        if not self.relation_key:
            self.relation_key = foundry.relation_key
        if not self.custom_id_gen:
            self.custom_id_gen = foundry.custom_id_gen

    @property
    def file_path(self):
        if self.base_path:
            return os.path.join(self.base_path, self.filename)

    def load(self):
        data = self._load_yaml()
        if not data:
            raise TypeError(u'YAML file {} did not load.  Please '
                            u'check that it has data.'.format(
                                self.file_path))

        if not isinstance(data, dict):
            raise TypeError(u'YAML file {} did not load as a dict.  Please '
                            u'check its formatting.'.format(
                                self.file_path))

        for fixture_name, fixture_data in data.items():
            fixture_data.update(
                {attr.replace(self.relation_key+'_', ''):
                 self.foundry.load_relation(value)
                 for attr, value in fixture_data.items()
                 if attr.startswith(self.relation_key)}
            )
            relation_attrs = [f for f in fixture_data if
                              f.startswith(self.relation_key)]
            for attr in relation_attrs:
                del fixture_data[attr]

            for attr, str_converter in self.str_converters.items():
                if attr in fixture_data:
                    fixture_data[attr] = str_converter(fixture_data[attr])

            obj = self.model(**fixture_data)
            obj.id = self.custom_id_gen(getattr(obj, 'id', None))
            self.foundry.create(fixture_name, obj)

    def _load_yaml(self):
        try:
            with open(self.file_path) as f:
                return yaml.load(f)
        except IOError:
            pass

class Foundry(object):
    def __init__(self, molds, relation_key=None, path=None,
                 custom_id_gen=None):
        self.relation_key = relation_key or 'foundry_relation'
        self.path = path or os.path.join(os.getcwd(), 'foundry', 'data')
        self.custom_id_gen = custom_id_gen
        self.molds = [mold if isinstance(mold, Mold) else
                      Mold(mold[0], mold[1])
                      for mold in molds]
        [mold.init_foundry(self) for mold in self.molds]
        self.fixtures = {}
        self.staged_fixtures = {}
        self.model_lookup = {mold.model.__name__: mold.model
                             for mold in self.molds}

    def load(self):
        for mold in self.molds:
            mold.load()
        self.commit()
        self.make_fixtures()

    def load_relation(self, value):
        if isinstance(value, list):
            return [self.staged_fixtures[v] for v in value]
        else:
            return self.staged_fixtures[value]

    def __getitem__(self, fixture_name):
        if not self.fixtures:
            self.load_cached_fixtures()

        model_name, _id = self.fixtures.get(fixture_name, (None, None))
        if not (model_name and _id):
            raise KeyError('Fixture {} was not found.'.format(fixture_name))
        obj = self.query(self.model_lookup[model_name], _id)
        if not obj:
            raise KeyError(
                'Fixture {} not found in datastore.'.format(fixture_name))
        return obj

    def create(self, fixture_name, obj):
        if fixture_name in self.staged_fixtures.keys():
            raise Exception('Cannot load two fixtures with same fixture name.')
        self.staged_fixtures[fixture_name] = obj
        self.queue(obj)

    def queue(self, obj):
        raise NotImplemented(
            'Must use or implement a subclass of Foundry that defines a method'
            ' `queue` which queues an object to be commited to the data store.'
        )

    def commit(self):
        raise NotImplemented(
            'Must user or implement a subclass of Foudry that defines a method'
            ' `commit` which commits the queued data to the data store.'
        )

    def query(self, model, _id):
        raise NotImplemented(
            'Must user or implement a subclass of Foudry that defines a method'
            ' `query` which retriees data from the data store by model and id.'
        )

    def make_fixtures(self):
        self.fixtures = {fixture_name: (type(obj).__name__, obj.id)
                         for fixture_name, obj in
                         self.staged_fixtures.items()}
        with open(os.path.join(self.path, '.foundry_ids'), 'w') as f:
            f.write(_unicode(yaml.dump(self.fixtures)))

    def load_cached_fixtures(self):
        try:
            with open(os.path.join(self.path, '.foundry_ids')) as f:
                self.fixtures = yaml.load(f)
        except IOError:
            raise IOError(
                'No stashed .foundry_ids file found. Please (re)poulate.')

class DictFoundry(Foundry):
    def __init__(self, *args, **kwargs):
        super(DictFoundry, self).__init__(*args, **kwargs)
        self.store = {}

    def queue(self, obj):
        self.store[(type(obj), obj.id)] = obj

    def commit(self):
        pass

    def query(self, model, _id):
        return self.store[model, _id]

class SQLAlchemyFoundry(Foundry):
    def __init__(self, session, *args, **kwargs):
        super(SQLAlchemyFoundry, self).__init__(*args, **kwargs)
        self.session = session

    def queue(self, obj):
        self.session.add(obj)

    def commit(self):
        self.session.commit()

    def query(self, model, _id):
        return self.session.query(model).get(_id)


text:
import forSelect from "../utils/for-select.js";
import * as api from "../utils/api.js";
import h from "../utils/html.js";
import IAm from "../utils/i-am.js";
import userInfo from "../utils/user-info";

export default async function (node) {
    node = node || document.body;

    var m = /^\/([a-z0-9-]+)\/(subscriptions|subscribers)$/.exec(location.pathname);
    if (!m) return;

    var userName = m[1],
        listName = m[2],
        n;

    if (listName === "subscribers" && (n = node.querySelector(".p-user-subscribers"))) {
        let iAm = await IAm.ready;
        if (iAm.whoIs(userName) & IAm.ME) {
            decorateMutualFriends(iAm, n.nextElementSibling, "p-user-subscriber");
        } else {
            decorateGroupAdmins(userName, n.nextElementSibling);
        }
    }

    if (listName === "subscriptions" && (n = node.querySelector(".p-timeline-subscription-users-header"))) {
        let iAm = await IAm.ready;
        if (iAm.whoIs(userName) & IAm.ME) {
            decorateMutualFriends(iAm, n.nextElementSibling, "p-timeline-subscription-user");
        }
    }

};

function decorateMutualFriends(iAm, node, chClass) {
    forSelect(node, `.${chClass} a`, (a) => {
        var un = a.getAttribute("href").substr(1);
        if ((iAm.whoIs(un) & (IAm.FRIEND | IAm.READER)) === (IAm.FRIEND | IAm.READER)) {
            a.classList.add("be-fe-mutual-friend");
            a.appendChild(h(".be-fe-mutual-friend--crown", {title: "Mutual friend"}));
        }
    });
}

async function decorateGroupAdmins(userName, node) {
    var [{users: inf}, {subscribers: subscr}]  = await Promise.all([userInfo(userName), api.get(`/v1/users/${userName}/subscribers`)]);

    if (!inf.id || inf.type !== "group") return;

    subscr
        .filter(s => (inf.administrators.indexOf(s.id) !== -1))
        .map(s => s.username)
        .forEach(username => {
            var a = document.querySelector(`.p-user-subscriber a[href="/${username}"]:not(.be-fe-group-admin)`);
            if (a) {
                a.classList.add("be-fe-group-admin");
                a.appendChild(h(".be-fe-group-admin--crown", {title: "Administrator"}));
            }
        });
}


text:
'use strict';

var express = require('express');
var bodyParser = require('body-parser');
var entity = require('@back4app/back4app-entity');
var User = entity.models.User;

var authentication = require('./middlewares/authentication');
var session = require('./middlewares/session');
var notfound = require('./middlewares/notfound');
var error = require('./middlewares/error');

module.exports = securityRouter;

function securityRouter(options) {
  /* Parse options */
  var opts = options || {};
  var accessToken = opts.accessToken || null;
  var store = opts.store || new session.MemoryStore();

  /* Build router */
  var router = express.Router();

  /* Install middlewares first */
  router.use(bodyParser.json());
  router.use(authentication({accessToken: accessToken}));
  router.use(session({store: store}));

  /* Then, define routes */
  router.post('/login', login(store));
  router.post('/logout', logout(store));

  /* 404 handler is the last non-error middleware */
  router.use(notfound());

  /* Error handler comes as last middleware */
  router.use(error());

  return router;
}

/* API handlers */

/**
 * Adds a handler to the express router (POST /login). It checks the user
 * credentials and creates a new session.
 * @name module:back4app-rest.securityRouter#login
 * @function
 */
function login(store) {

  return function (req, res) {
    var username = req.body.username;
    var password = req.body.password;

    // check params
    if (username === undefined) {
      res.status(401).json({
        code: 114,
        error: 'Username Missing'
      });
      return;
    }

    if (password === undefined) {
      res.status(401).json({
        code: 115,
        error: 'Password Missing'
      });
      return;
    }

    // validate user credentials
    User.get({username: username})
      .then(function (user) {
        // check password
        user.authenticate(password)
          .then(function (isValid) {
            if (!isValid) {
              res.status(401).json({
                code: 116,
                error: 'Invalid User Credentials'
              });
              return;
            }

            // create new session
            store.create(req, user.id)
              .then(function (session) {
                // return session token to user
                res.json({sessionToken: session.token});
              })
              .catch(function () {
                // unknown error
                res.status(500).json({
                  code: 1,
                  error: 'Internal Server Error'
                });
              });
          });
      })
      .catch(function () {
        // username not found
        res.status(401).json({
          code: 116,
          error: 'Invalid User Credentials'
        });
      });
  };
}

/**
 * Adds a handler to the express router (POST /logout). It terminates the
 * given session.
 * @name module:back4app-rest.securityRouter#login
 * @function
 */
function logout(store) {
  return function (req, res) {
    // check for request session
    if (req.session === undefined) {
      res.status(403).json({
        code: 118,
        error: 'Operation Forbidden'
      });
      return;
    }

    // destroy current session
    var sid = req.session.token;
    store.destroy(sid)
      .then(function () {
        // all ok
        res.json({});
      })
      .catch(function () {
        // unknown error
        res.status(500).json({
          code: 1,
          error: 'Internal Server Error'
        });
      });
  };
}


text:
package org.kie.workbench.common.stunner.core.rule.context;

import java.util.Collection;
import java.util.Optional;

import org.kie.workbench.common.stunner.core.graph.Element;
import org.kie.workbench.common.stunner.core.graph.content.view.View;

/**
 * This rule evaluation context provides the runtime information
 * that allows the evaluation for cardinality operations in
 * a graph structure.
 */
public interface ElementCardinalityContext extends GraphEvaluationContext {

    /**
     * The candidate element to add or remove from the graph.
     * If not candidate present, it checks the cardinality
     * for the whole graph elements.
     */
    Collection<Element<? extends View<?>>> getCandidates();

    /**
     * The operation to be performed on the candidate.
     * If not candidate present, the operation value is
     * discarded although being present.
     */
    Optional<CardinalityContext.Operation> getOperation();
}


text:
<?php

    use PHPUnit\Framework\TestCase;

    use \WOK\Router\Collection;
    use \WOK\Router\Route;
    use \WOK\Uri\Uri;

    class CollectionTest extends TestCase {

        const ROUTE_METHODS = ['GET', 'POST', 'HEAD'];
        const ROUTE_URI     = '/path/to/the/{resource}';
        const ROUTE_PARAMS  = ['resource' => '[a-z0-9]+'];
        const ROUTE_ACTION  = ['Controller', 'Action'];
        const ROUTE_NAME    = 'Controller\Action';

        const REQUEST_METHOD = 'POST';
        const REQUEST_PARAMS = ['resource' => 'resourcename'];

        /***
         * Test routes collection manipulation
         * ---
        **/
        public function testCollection() {

            $collection = $this->_getRoutesCollection();

            $this->assertTrue($collection->hasRoute(self::ROUTE_NAME), Collection::class.'::hasRoute must tell that a route may have been defined');
            $this->assertFalse($collection->hasRoute('Unknow\Route\Name'), Collection::class.'::hasRoute must tell that a route may not been defined');

            $this->assertInstanceOf(Route::class, $collection->getRoute(self::ROUTE_NAME), Collection::class.'::getRoute must return a Route Object');

        }

        /**
         * test mathing method
        **/
        public function testMatchMethod() {

            $collection = $this->_getRoutesCollection();

            $path = self::ROUTE_URI;
            foreach(self::REQUEST_PARAMS as $key => $value) {
                $path = str_replace('{'.$key.'}', $value, $path);
            }

            $match = $collection->match(self::REQUEST_METHOD, $path);

            $this->assertInstanceOf(\StdClass::class, $match, Collection::class.'::match must return a StdClass object');
            $this->assertObjectHasAttribute('name',       $match, Collection::class.'::match return must contain a `name` attribute');
            $this->assertObjectHasAttribute('action',     $match, Collection::class.'::match return must contain an `action` attribute');
            $this->assertObjectHasAttribute('parameters', $match, Collection::class.'::match return must contain a `parameters` attribute');

        }

        /**
         * test mathing method failure
         * ---
        **/
        public function testMatchMethodFailure() {

            $this->expectException(\DomainException::class, Collection::class.'::match must throw an exception when no route is found');

            $collection = $this->_getRoutesCollection();

            // Test non transformed uri (not replaced parameters)
            $match = $collection->match(self::REQUEST_METHOD, '/this/is/a/not/foundable/path');

        }

        /**
         * retrieve a new routes collection
         * ---
        **/
        protected function _getRoutesCollection() {

            $route = new Route(
                self::ROUTE_METHODS,
                self::ROUTE_URI,
                self::ROUTE_PARAMS
            );

            $collection = new Collection();
            $collection->addRoute($route, self::ROUTE_ACTION, self::ROUTE_NAME);

            return $collection;

        }

    }


text:
/* global angular */
(function () {
    'use strict';

    angular.module('patents')
        .component('scientillaPatentFamilyVerifiedList', {
            templateUrl: 'partials/scientilla-patent-family-verified-list.html',
            controller,
            controllerAs: 'vm',
            bindings: {}
        });

    controller.$inject = [
        'PatentService',
        'patentListSections',
        'context'
    ];

    function controller(
        PatentService,
        patentListSections,
        context
    ) {
        const vm = this;

        vm.patentFamilyListSections = patentFamilyListSections;
        vm.patentFamilies = [];
        vm.onFilter = onFilter;
        vm.exportDownload = patentFamilies => PatentService.exportDownload(patentFamilies, 'csv');

        let query = {
            where: {}
        };

        /* jshint ignore:start */
        vm.$onInit = async function () {
            vm.researchEntity = await context.getResearchEntity();
        };
        /* jshint ignore:end */

        vm.$onDestroy = function () {

        };

        /* jshint ignore:start */
        async function onFilter(q) {
            const favorites = q.where.favorites;
            delete q.where.favorites;

            query = q;

            vm.patentFamilies = await PatentService.getFamilies(vm.researchEntity, query, favorites);
            vm.patentFamilies = [{}];
        }
        /* jshint ignore:end */
    }

})();


text:
@extends('layouts.app')
@section('content')

Thông tin chi tiết

        image !!}" alt="image_product" width="100%" height="100%" style="border-radius: 20px; box-shadow: -5px 5px 35px #EC7357">

 Tên sản phẩm: {{$product->name}}

 Giá đề nghị: {{$product->price}}

 Mô tả: {{$product->description}}

 Category: {{$product->category->name}}

 Shop đăng sản phẩm: {{$shop->name}}

        @if ($errors->any())

                @foreach ($errors->all() as $error)

{{ $error }}

                @endforeach

        @endif

Đăng sản phẩm

        <form action="{{ url('shop/'.$shop->id.'/show') }}" method="POST">
            <input name="_token" type="hidden" value="{{ csrf_token() }}">
            <input name="_method" type="hidden" value="PUT">

            <input type="hidden" name="buys" value="1">
            <input type="hidden" name="user_id" value="{{$shop->user_id}}">
            <input type="hidden" name="product_id" value="{{$product->id}}">
            <input type="hidden" name="shop_id" value="{{$shop->id}}">

{{$product->name}}

                Giá bán của bạn :
                <input type="text" class="form-control" id="price" placeholder="Giá đề nghị: {{$product->price}}" name="price" value="">

                Số lượng sản phẩm :
                <input type="text" class="form-control" id="quantity" placeholder="Nhập số lượng" name="quantity" value="">

                Phần trăm giảm giá:
                <input type="text" class="form-control" id="discount" placeholder="" name="discount" value="">

            <button type="submit" class="btn btn-default btn-success pull-left">Đăng sản phẩm</button>

        </form>

@endsection